@wordpress/components 25.11.1-next.f8d8eceb.0 → 25.12.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 -1
- package/build/disclosure/index.js +37 -7
- package/build/disclosure/index.js.map +1 -1
- package/build/disclosure/types.js +6 -0
- package/build/disclosure/types.js.map +1 -0
- package/build/divider/component.js +5 -3
- package/build/divider/component.js.map +1 -1
- package/build/divider/types.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/index.js +26 -16
- package/build/dropdown-menu-v2-ariakit/index.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/types.js.map +1 -1
- package/build/gradient-picker/index.js +1 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/index.native.js +8 -1
- package/build/index.native.js.map +1 -1
- package/build/mobile/audio-player/index.native.js +8 -9
- package/build/mobile/audio-player/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +44 -3
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/radio-group/context.js +22 -0
- package/build/radio-group/context.js.map +1 -0
- package/build/radio-group/index.js +27 -23
- package/build/radio-group/index.js.map +1 -1
- package/build/radio-group/radio.js +58 -0
- package/build/radio-group/radio.js.map +1 -0
- package/build/radio-group/types.js +6 -0
- package/build/radio-group/types.js.map +1 -0
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/tabs/styles.js +14 -7
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tab.js +3 -5
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tablist.js +3 -5
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/tabpanel.js +6 -9
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/text-control/index.js +5 -1
- package/build/text-control/index.js.map +1 -1
- package/build/text-control/types.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +4 -2
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +13 -9
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/types.js.map +1 -1
- package/build-module/disclosure/index.js +33 -8
- package/build-module/disclosure/index.js.map +1 -1
- package/build-module/disclosure/types.js +2 -0
- package/build-module/disclosure/types.js.map +1 -0
- package/build-module/divider/component.js +3 -3
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/types.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/index.js +27 -17
- package/build-module/dropdown-menu-v2-ariakit/index.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/types.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -1
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/mobile/audio-player/index.native.js +9 -10
- package/build-module/mobile/audio-player/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +43 -4
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/radio-group/context.js +14 -0
- package/build-module/radio-group/context.js.map +1 -0
- package/build-module/radio-group/index.js +24 -23
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/radio-group/radio.js +46 -0
- package/build-module/radio-group/radio.js.map +1 -0
- package/build-module/radio-group/types.js +2 -0
- package/build-module/radio-group/types.js.map +1 -0
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/tabs/styles.js +11 -5
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tab.js +3 -5
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tablist.js +3 -5
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/tabpanel.js +6 -7
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/text-control/index.js +6 -1
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/text-control/types.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +4 -2
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +13 -9
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/types.js.map +1 -1
- package/build-style/style-rtl.css +21 -3
- package/build-style/style.css +21 -3
- package/build-types/card/card-divider/component.d.ts +1 -1
- package/build-types/card/card-divider/hook.d.ts +162 -162
- package/build-types/disclosure/index.d.ts +7 -1
- package/build-types/disclosure/index.d.ts.map +1 -1
- package/build-types/disclosure/types.d.ts +12 -0
- package/build-types/disclosure/types.d.ts.map +1 -0
- package/build-types/divider/component.d.ts +5 -1
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/stories/index.story.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +1 -1
- package/build-types/divider/types.d.ts +2 -2
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts +1 -1
- package/build-types/radio-group/context.d.ts +10 -0
- package/build-types/radio-group/context.d.ts.map +1 -0
- package/build-types/radio-group/index.d.ts +7 -9
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts +8 -0
- package/build-types/radio-group/radio.d.ts.map +1 -0
- package/build-types/radio-group/stories/index.story.d.ts +14 -0
- package/build-types/radio-group/stories/index.story.d.ts.map +1 -0
- package/build-types/radio-group/types.d.ts +40 -0
- package/build-types/radio-group/types.d.ts.map +1 -0
- package/build-types/tabs/index.d.ts +3 -3
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +10 -0
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts +1 -1
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/tabpanel.d.ts +4 -1
- package/build-types/tabs/tabpanel.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +7 -31
- package/build-types/tabs/types.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +2 -1
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/types.d.ts +6 -0
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts +1 -0
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +6 -0
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/disclosure/index.tsx +44 -0
- package/src/disclosure/types.tsx +10 -0
- package/src/divider/component.tsx +3 -3
- package/src/divider/stories/index.story.tsx +8 -0
- package/src/divider/types.ts +2 -2
- package/src/dropdown-menu/style.scss +4 -0
- package/src/dropdown-menu-v2-ariakit/README.md +0 -7
- package/src/dropdown-menu-v2-ariakit/index.tsx +31 -15
- package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +1 -4
- package/src/dropdown-menu-v2-ariakit/test/index.tsx +0 -26
- package/src/dropdown-menu-v2-ariakit/types.ts +1 -1
- package/src/gradient-picker/index.tsx +1 -1
- package/src/index.native.js +1 -0
- package/src/mobile/audio-player/index.native.js +9 -13
- package/src/mobile/global-styles-context/utils.native.js +52 -3
- package/src/radio-group/context.tsx +18 -0
- package/src/radio-group/index.tsx +65 -0
- package/src/radio-group/radio.tsx +55 -0
- package/src/radio-group/stories/index.story.tsx +90 -0
- package/src/radio-group/types.ts +39 -0
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
- package/src/tabs/README.md +3 -33
- package/src/tabs/stories/index.story.tsx +9 -1
- package/src/tabs/styles.ts +16 -0
- package/src/tabs/tab.tsx +6 -6
- package/src/tabs/tablist.tsx +21 -20
- package/src/tabs/tabpanel.tsx +24 -23
- package/src/tabs/test/index.tsx +71 -16
- package/src/tabs/types.ts +7 -32
- package/src/text-control/index.tsx +5 -1
- package/src/text-control/style.scss +5 -0
- package/src/text-control/types.ts +6 -0
- package/src/toggle-group-control/toggle-group-control/component.tsx +8 -2
- package/src/toggle-group-control/toggle-group-control/styles.ts +13 -4
- package/src/toggle-group-control/types.ts +6 -0
- package/src/toolbar/toolbar-button/style.scss +0 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/build/radio-group/radio/index.js +0 -49
- package/build/radio-group/radio/index.js.map +0 -1
- package/build/radio-group/radio-context/index.js +0 -18
- package/build/radio-group/radio-context/index.js.map +0 -1
- package/build-module/radio-group/radio/index.js +0 -40
- package/build-module/radio-group/radio/index.js.map +0 -1
- package/build-module/radio-group/radio-context/index.js +0 -10
- package/build-module/radio-group/radio-context/index.js.map +0 -1
- package/build-types/radio-group/radio/index.d.ts +0 -7
- package/build-types/radio-group/radio/index.d.ts.map +0 -1
- package/build-types/radio-group/radio-context/index.d.ts +0 -6
- package/build-types/radio-group/radio-context/index.d.ts.map +0 -1
- package/src/disclosure/index.js +0 -11
- package/src/radio-group/index.js +0 -51
- package/src/radio-group/radio/index.js +0 -40
- package/src/radio-group/radio-context/index.js +0 -11
- package/src/radio-group/stories/index.story.js +0 -83
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
## 25.
|
|
5
|
+
## 25.12.0 (2023-11-16)
|
|
6
|
+
|
|
7
|
+
### Bug Fix
|
|
8
|
+
|
|
9
|
+
- `Toolbar`: Remove CSS rule that prevented focus outline to be visible for toolbar buttons in the `:active` state. ([#56123](https://github.com/WordPress/gutenberg/pull/56123)).
|
|
10
|
+
|
|
11
|
+
### Internal
|
|
12
|
+
|
|
13
|
+
- Migrate `Divider` from `reakit` to `ariakit` ([#55622](https://github.com/WordPress/gutenberg/pull/55622))
|
|
14
|
+
- Migrate `DisclosureContent` from `reakit` to `ariakit` and TypeScript ([#55639](https://github.com/WordPress/gutenberg/pull/55639))
|
|
15
|
+
- Migrate `RadioGroup` from `reakit` to `ariakit` and TypeScript ([#55580](https://github.com/WordPress/gutenberg/pull/55580))
|
|
16
|
+
|
|
17
|
+
### Experimental
|
|
18
|
+
|
|
19
|
+
- `Tabs`: Add `focusable` prop to the `Tabs.TabPanel` sub-component ([#55287](https://github.com/WordPress/gutenberg/pull/55287))
|
|
20
|
+
- `Tabs`: Update sub-components to accept relevant HTML element props ([#55860](https://github.com/WordPress/gutenberg/pull/55860))
|
|
21
|
+
- `DropdownMenuV2`: Fix radio menu item check icon not rendering correctly in some browsers ([#55964](https://github.com/WordPress/gutenberg/pull/55964))
|
|
22
|
+
- `DropdownMenuV2`: prevent default when pressing Escape key to close menu ([#55962](https://github.com/WordPress/gutenberg/pull/55962))
|
|
23
|
+
|
|
24
|
+
### Enhancements
|
|
25
|
+
|
|
26
|
+
- `ToggleGroupControl`: Add opt-in prop for 40px default size ([#55789](https://github.com/WordPress/gutenberg/pull/55789)).
|
|
27
|
+
- `TextControl`: Add opt-in prop for 40px default size ([#55471](https://github.com/WordPress/gutenberg/pull/55471)).
|
|
28
|
+
|
|
29
|
+
### Bug Fix
|
|
30
|
+
|
|
31
|
+
- `DropdownMenu`: remove extra vertical space around the toggle button ([#56136](https://github.com/WordPress/gutenberg/pull/56136)).
|
|
32
|
+
- Package should not depend on `@ariakit/test`, that package is only needed for testing ([#56091](https://github.com/WordPress/gutenberg/pull/56091)).
|
|
33
|
+
|
|
34
|
+
## 25.11.0 (2023-11-02)
|
|
6
35
|
|
|
7
36
|
### Enhancements
|
|
8
37
|
|
|
@@ -3,11 +3,41 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
|
|
6
|
+
exports.default = exports.DisclosureContent = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
|
|
9
|
+
var _element = require("@wordpress/element");
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
/**
|
|
13
|
+
* External dependencies
|
|
14
|
+
*/
|
|
15
|
+
// eslint-disable-next-line no-restricted-imports
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* WordPress dependencies
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Accessible Disclosure component that controls visibility of a section of
|
|
23
|
+
* content. It follows the WAI-ARIA Disclosure Pattern.
|
|
24
|
+
*/
|
|
25
|
+
const UnforwardedDisclosureContent = ({
|
|
26
|
+
visible,
|
|
27
|
+
children,
|
|
28
|
+
...props
|
|
29
|
+
}, ref) => {
|
|
30
|
+
const disclosure = Ariakit.useDisclosureStore({
|
|
31
|
+
open: visible
|
|
32
|
+
});
|
|
33
|
+
return (0, _react.createElement)(Ariakit.DisclosureContent, {
|
|
34
|
+
store: disclosure,
|
|
35
|
+
ref: ref,
|
|
36
|
+
...props
|
|
37
|
+
}, children);
|
|
38
|
+
};
|
|
39
|
+
const DisclosureContent = (0, _element.forwardRef)(UnforwardedDisclosureContent);
|
|
40
|
+
exports.DisclosureContent = DisclosureContent;
|
|
41
|
+
var _default = DisclosureContent;
|
|
42
|
+
exports.default = _default;
|
|
13
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","UnforwardedDisclosureContent","visible","children","props","ref","disclosure","useDisclosureStore","open","_react","createElement","DisclosureContent","store","forwardRef","exports","_default"],"sources":["@wordpress/components/src/disclosure/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\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 { DisclosureContentProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\n/**\n * Accessible Disclosure component that controls visibility of a section of\n * content. It follows the WAI-ARIA Disclosure Pattern.\n */\nconst UnforwardedDisclosureContent = (\n\t{\n\t\tvisible,\n\t\tchildren,\n\t\t...props\n\t}: WordPressComponentProps< DisclosureContentProps, 'div', false >,\n\tref: React.ForwardedRef< any >\n) => {\n\tconst disclosure = Ariakit.useDisclosureStore( { open: visible } );\n\n\treturn (\n\t\t<Ariakit.DisclosureContent\n\t\t\tstore={ disclosure }\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.DisclosureContent>\n\t);\n};\n\nexport const DisclosureContent = forwardRef( UnforwardedDisclosureContent );\nexport default DisclosureContent;\n"],"mappings":";;;;;;;AAIA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAAgD,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAThD;AACA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA,MAAMW,4BAA4B,GAAGA,CACpC;EACCC,OAAO;EACPC,QAAQ;EACR,GAAGC;AAC6D,CAAC,EAClEC,GAA8B,KAC1B;EACJ,MAAMC,UAAU,GAAG/B,OAAO,CAACgC,kBAAkB,CAAE;IAAEC,IAAI,EAAEN;EAAQ,CAAE,CAAC;EAElE,OACC,IAAAO,MAAA,CAAAC,aAAA,EAACnC,OAAO,CAACoC,iBAAiB;IACzBC,KAAK,EAAGN,UAAY;IACpBD,GAAG,EAAGA,GAAK;IAAA,GACND;EAAK,GAERD,QACwB,CAAC;AAE9B,CAAC;AAEM,MAAMQ,iBAAiB,GAAG,IAAAE,mBAAU,EAAEZ,4BAA6B,CAAC;AAACa,OAAA,CAAAH,iBAAA,GAAAA,iBAAA;AAAA,IAAAI,QAAA,GAC7DJ,iBAAiB;AAAAG,OAAA,CAAA5B,OAAA,GAAA6B,QAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/disclosure/types.tsx"],"sourcesContent":["export type DisclosureContentProps = {\n\t/**\n\t * If set to `true` the content will be shown, otherwise it's hidden.\n\t */\n\tvisible?: boolean;\n\t/**\n\t * The content to display within the component.\n\t */\n\tchildren: React.ReactNode;\n};\n"],"mappings":""}
|
|
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Divider = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
|
|
9
9
|
var _context = require("../context");
|
|
10
10
|
var _styles = require("./styles");
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
13
|
/**
|
|
12
14
|
* External dependencies
|
|
13
15
|
*/
|
|
@@ -15,8 +17,8 @@ var _styles = require("./styles");
|
|
|
15
17
|
|
|
16
18
|
function UnconnectedDivider(props, forwardedRef) {
|
|
17
19
|
const contextProps = (0, _context.useContextSystem)(props, 'Divider');
|
|
18
|
-
return (0, _react.createElement)(
|
|
19
|
-
|
|
20
|
+
return (0, _react.createElement)(Ariakit.Separator, {
|
|
21
|
+
render: (0, _react.createElement)(_styles.DividerView, null),
|
|
20
22
|
...contextProps,
|
|
21
23
|
ref: forwardedRef
|
|
22
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_context","_styles","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","UnconnectedDivider","props","forwardedRef","contextProps","useContextSystem","_react","createElement","Separator","render","DividerView","ref","Divider","contextConnect","exports","_default"],"sources":["@wordpress/components/src/divider/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnect, useContextSystem } from '../context';\nimport { DividerView } from './styles';\nimport type { DividerProps } from './types';\n\nfunction UnconnectedDivider(\n\tprops: WordPressComponentProps< DividerProps, 'hr', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst contextProps = useContextSystem( props, 'Divider' );\n\n\treturn (\n\t\t<Ariakit.Separator\n\t\t\trender={ <DividerView /> }\n\t\t\t{ ...contextProps }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n}\n\n/**\n * `Divider` is a layout component that separates groups of related content.\n *\n * ```js\n * import {\n * \t\t__experimentalDivider as Divider,\n * \t\t__experimentalText as Text,\n * \t\t__experimentalVStack as VStack,\n * } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<VStack spacing={4}>\n * \t\t\t<Text>Some text here</Text>\n * \t\t\t<Divider />\n * \t\t\t<Text>Some more text here</Text>\n * \t\t</VStack>\n * \t);\n * }\n * ```\n */\nexport const Divider = contextConnect( UnconnectedDivider, 'Divider' );\n\nexport default Divider;\n"],"mappings":";;;;;;;AAIA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAuC,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA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,MAAM,EAAG,IAAAH,MAAA,CAAAC,aAAA,EAAC7B,OAAA,CAAAgC,WAAW,MAAE,CAAG;IAAA,GACrBN,YAAY;IACjBO,GAAG,EAAGR;EAAc,CACpB,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,OAAO,GAAG,IAAAC,uBAAc,EAAEZ,kBAAkB,EAAE,SAAU,CAAC;AAACa,OAAA,CAAAF,OAAA,GAAAA,OAAA;AAAA,IAAAG,QAAA,GAExDH,OAAO;AAAAE,OAAA,CAAA5B,OAAA,GAAA6B,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/divider/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { SeparatorProps } from '
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/divider/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { SeparatorProps } from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport type { SpaceInput } from '../utils/space';\n\nexport type DividerProps = Omit<\n\tSeparatorProps,\n\t'children' | 'unstable_system' | 'orientation' | 'as' | 'render'\n> & {\n\t/**\n\t * Adjusts all margins on the inline dimension.\n\t *\n\t * Can either be a number (which will act as a multiplier to the library's grid system base of 4px),\n\t * or a literal CSS value string.\n\t */\n\tmargin?: SpaceInput;\n\t/**\n\t * Adjusts the inline-end margin.\n\t *\n\t * Can either be a number (which will act as a multiplier to the library's grid system base of 4px),\n\t * or a literal CSS value string.\n\t */\n\tmarginEnd?: SpaceInput;\n\t/**\n\t * Adjusts the inline-start margin.\n\t *\n\t * Can either be a number (which will act as a multiplier to the library's grid system base of 4px),\n\t * or a literal CSS value string.\n\t */\n\tmarginStart?: SpaceInput;\n\t/**\n\t * Divider's orientation. When using inside a flex container, you may need\n\t * to make sure the divider is `stretch` aligned in order for it to be\n\t * visible.\n\t *\n\t * @default 'horizontal'\n\t */\n\torientation?: SeparatorProps[ 'orientation' ];\n};\n"],"mappings":""}
|
|
@@ -68,6 +68,14 @@ const DropdownMenuCheckboxItem = (0, _element.forwardRef)(function DropdownMenuC
|
|
|
68
68
|
})), children, suffix && (0, _react.createElement)(Styled.ItemSuffixWrapper, null, suffix));
|
|
69
69
|
});
|
|
70
70
|
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
71
|
+
const radioCheck = (0, _react.createElement)(_primitives.SVG, {
|
|
72
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
73
|
+
viewBox: "0 0 24 24"
|
|
74
|
+
}, (0, _react.createElement)(_primitives.Circle, {
|
|
75
|
+
cx: 12,
|
|
76
|
+
cy: 12,
|
|
77
|
+
r: 3
|
|
78
|
+
}));
|
|
71
79
|
const DropdownMenuRadioItem = (0, _element.forwardRef)(function DropdownMenuRadioItem({
|
|
72
80
|
suffix,
|
|
73
81
|
children,
|
|
@@ -83,15 +91,10 @@ const DropdownMenuRadioItem = (0, _element.forwardRef)(function DropdownMenuRadi
|
|
|
83
91
|
}, (0, _react.createElement)(Ariakit.MenuItemCheck, {
|
|
84
92
|
store: dropdownMenuContext?.store,
|
|
85
93
|
render: (0, _react.createElement)(Styled.ItemPrefixWrapper, null)
|
|
86
|
-
}, (0, _react.createElement)(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
cx: 12,
|
|
91
|
-
cy: 12,
|
|
92
|
-
r: 3,
|
|
93
|
-
fill: "currentColor"
|
|
94
|
-
}))), children, suffix);
|
|
94
|
+
}, (0, _react.createElement)(_icon.default, {
|
|
95
|
+
icon: radioCheck,
|
|
96
|
+
size: 24
|
|
97
|
+
})), children, suffix);
|
|
95
98
|
});
|
|
96
99
|
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
97
100
|
const DropdownMenuGroup = (0, _element.forwardRef)(function DropdownMenuGroup(props, ref) {
|
|
@@ -127,7 +130,6 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
127
130
|
children,
|
|
128
131
|
shift,
|
|
129
132
|
modal = true,
|
|
130
|
-
hideOnEscape = true,
|
|
131
133
|
// From internal components context
|
|
132
134
|
variant,
|
|
133
135
|
// Rest
|
|
@@ -170,6 +172,19 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
170
172
|
// eslint-disable-next-line no-console
|
|
171
173
|
console.warn('For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.');
|
|
172
174
|
}
|
|
175
|
+
const hideOnEscape = (0, _element.useCallback)(event => {
|
|
176
|
+
// Pressing Escape can cause unexpected consequences (ie. exiting
|
|
177
|
+
// full screen mode on MacOs, close parent modals...).
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
// Returning `true` causes the menu to hide.
|
|
180
|
+
return true;
|
|
181
|
+
}, []);
|
|
182
|
+
const wrapperProps = (0, _element.useMemo)(() => ({
|
|
183
|
+
dir: computedDirection,
|
|
184
|
+
style: {
|
|
185
|
+
direction: computedDirection
|
|
186
|
+
}
|
|
187
|
+
}), [computedDirection]);
|
|
173
188
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(Ariakit.MenuButton, {
|
|
174
189
|
ref: ref,
|
|
175
190
|
store: dropdownMenuStore,
|
|
@@ -190,12 +205,7 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
190
205
|
hideOnHoverOutside: false,
|
|
191
206
|
"data-side": appliedPlacementSide,
|
|
192
207
|
variant: variant,
|
|
193
|
-
wrapperProps:
|
|
194
|
-
dir: computedDirection,
|
|
195
|
-
style: {
|
|
196
|
-
direction: computedDirection
|
|
197
|
-
}
|
|
198
|
-
},
|
|
208
|
+
wrapperProps: wrapperProps,
|
|
199
209
|
hideOnEscape: hideOnEscape,
|
|
200
210
|
unmountOnHide: true
|
|
201
211
|
}, (0, _react.createElement)(DropdownMenuContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","_icons","_primitives","_context","_icon","_interopRequireDefault","Styled","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DropdownMenuContext","createContext","undefined","exports","DropdownMenuItem","forwardRef","prefix","suffix","children","hideOnClick","props","ref","dropdownMenuContext","useContext","_react","createElement","store","ItemPrefixWrapper","ItemSuffixWrapper","DropdownMenuCheckboxItem","MenuItemCheck","render","icon","check","size","DropdownMenuRadioItem","SVG","viewBox","xmlns","Circle","cx","cy","r","fill","DropdownMenuGroup","DropdownMenuGroupLabel","UnconnectedDropdownMenu","_props$placement","_trigger$props$suffix","open","defaultOpen","onOpenChange","placement","trigger","gutter","shift","modal","hideOnEscape","variant","otherProps","useContextSystem","parentContext","computedDirection","isRTL","computedPlacement","test","replace","dropdownMenuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","rtl","contextValue","useMemo","appliedPlacementSide","useState","split","isValidElement","type","console","warn","Fragment","MenuButton","cloneElement","SubmenuChevronIcon","chevronRightSmall","DropdownMenu","hideOnHoverOutside","wrapperProps","dir","style","direction","unmountOnHide","Provider","value","contextConnect","DropdownMenuSeparator"],"sources":["@wordpress/components/src/dropdown-menu-v2-ariakit/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tcloneElement,\n\tisValidElement,\n} from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\nimport { check, chevronRightSmall } from '@wordpress/icons';\nimport { SVG, Circle } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnect } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport Icon from '../icon';\nimport type {\n\tDropdownMenuContext as DropdownMenuContextType,\n\tDropdownMenuProps,\n\tDropdownMenuGroupProps,\n\tDropdownMenuGroupLabelProps,\n\tDropdownMenuItemProps,\n\tDropdownMenuCheckboxItemProps,\n\tDropdownMenuRadioItemProps,\n\tDropdownMenuSeparatorProps,\n} from './types';\nimport * as Styled from './styles';\n\nexport const DropdownMenuContext = createContext<\n\tDropdownMenuContextType | undefined\n>( undefined );\n\nexport const DropdownMenuItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuItemProps, 'div', false >\n>( function DropdownMenuItem(\n\t{ prefix, suffix, children, hideOnClick = true, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t{ prefix && (\n\t\t\t\t<Styled.ItemPrefixWrapper>{ prefix }</Styled.ItemPrefixWrapper>\n\t\t\t) }\n\t\t\t{ children }\n\t\t\t{ suffix && (\n\t\t\t\t<Styled.ItemSuffixWrapper>{ suffix }</Styled.ItemSuffixWrapper>\n\t\t\t) }\n\t\t</Styled.DropdownMenuItem>\n\t);\n} );\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuCheckboxItemProps, 'div', false >\n>( function DropdownMenuCheckboxItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuCheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t{ children }\n\t\t\t{ suffix && (\n\t\t\t\t<Styled.ItemSuffixWrapper>{ suffix }</Styled.ItemSuffixWrapper>\n\t\t\t) }\n\t\t</Styled.DropdownMenuCheckboxItem>\n\t);\n} );\n\nexport const DropdownMenuRadioItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuRadioItemProps, 'div', false >\n>( function DropdownMenuRadioItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuRadioItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t>\n\t\t\t\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t<Circle\n\t\t\t\t\t\tcx={ 12 }\n\t\t\t\t\t\tcy={ 12 }\n\t\t\t\t\t\tr={ 3 }\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t></Circle>\n\t\t\t\t</SVG>\n\t\t\t</Ariakit.MenuItemCheck>\n\t\t\t{ children }\n\t\t\t{ suffix }\n\t\t</Styled.DropdownMenuRadioItem>\n\t);\n} );\n\nexport const DropdownMenuGroup = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupProps, 'div', false >\n>( function DropdownMenuGroup( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroup\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t/>\n\t);\n} );\n\nexport const DropdownMenuGroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupLabelProps, 'div', false >\n>( function DropdownMenuGroupLabel( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroupLabel\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t/>\n\t);\n} );\n\nconst UnconnectedDropdownMenu = (\n\tprops: WordPressComponentProps< DropdownMenuProps, 'div', false >,\n\tref: React.ForwardedRef< HTMLDivElement >\n) => {\n\tconst {\n\t\t// Store props\n\t\topen,\n\t\tdefaultOpen = false,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// Menu trigger props\n\t\ttrigger,\n\n\t\t// Menu props\n\t\tgutter,\n\t\tchildren,\n\t\tshift,\n\t\tmodal = true,\n\t\thideOnEscape = true,\n\n\t\t// From internal components context\n\t\tvariant,\n\n\t\t// Rest\n\t\t...otherProps\n\t} = useContextSystem<\n\t\ttypeof props & Pick< DropdownMenuContextType, 'variant' >\n\t>( props, 'DropdownMenu' );\n\n\tconst parentContext = useContext( DropdownMenuContext );\n\n\tconst computedDirection = isRTL() ? 'rtl' : 'ltr';\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root dropdown,\n\t// and of `right-start` for nested dropdowns.\n\tlet computedPlacement =\n\t\tprops.placement ??\n\t\t( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( computedDirection === 'rtl' ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst dropdownMenuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl: computedDirection === 'rtl',\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: dropdownMenuStore, variant } ),\n\t\t[ dropdownMenuStore, variant ]\n\t);\n\n\t// Extract the side from the applied placement — useful for animations.\n\tconst appliedPlacementSide = dropdownMenuStore\n\t\t.useState( 'placement' )\n\t\t.split( '-' )[ 0 ];\n\n\tif (\n\t\tdropdownMenuStore.parent &&\n\t\t! ( isValidElement( trigger ) && DropdownMenuItem === trigger.type )\n\t) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ /* Menu trigger */ }\n\t\t\t<Ariakit.MenuButton\n\t\t\t\tref={ ref }\n\t\t\t\tstore={ dropdownMenuStore }\n\t\t\t\trender={\n\t\t\t\t\tdropdownMenuStore.parent\n\t\t\t\t\t\t? cloneElement( trigger, {\n\t\t\t\t\t\t\t\t// Add submenu arrow, unless a `suffix` is explicitly specified\n\t\t\t\t\t\t\t\tsuffix: trigger.props.suffix ?? (\n\t\t\t\t\t\t\t\t\t<Styled.SubmenuChevronIcon\n\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: trigger\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t{ /* Menu popover */ }\n\t\t\t<Styled.DropdownMenu\n\t\t\t\t{ ...otherProps }\n\t\t\t\tmodal={ modal }\n\t\t\t\tstore={ dropdownMenuStore }\n\t\t\t\tgutter={ gutter ?? ( dropdownMenuStore.parent ? 16 : 8 ) }\n\t\t\t\tshift={ shift ?? ( dropdownMenuStore.parent ? -8 : 0 ) }\n\t\t\t\thideOnHoverOutside={ false }\n\t\t\t\tdata-side={ appliedPlacementSide }\n\t\t\t\tvariant={ variant }\n\t\t\t\twrapperProps={ {\n\t\t\t\t\tdir: computedDirection,\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tdirection: computedDirection,\n\t\t\t\t\t},\n\t\t\t\t} }\n\t\t\t\thideOnEscape={ hideOnEscape }\n\t\t\t\tunmountOnHide\n\t\t\t>\n\t\t\t\t<DropdownMenuContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</DropdownMenuContext.Provider>\n\t\t\t</Styled.DropdownMenu>\n\t\t</>\n\t);\n};\nexport const DropdownMenu = contextConnect(\n\tUnconnectedDropdownMenu,\n\t'DropdownMenu'\n);\n\nexport const DropdownMenuSeparator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< DropdownMenuSeparatorProps, 'hr', false >\n>( function DropdownMenuSeparator( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuSeparator\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\tvariant={ dropdownMenuContext?.variant }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;;;AAIA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,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BAAiB,CAACE,MAAM,GAAG,EAAE,GAAG,CAAK;IAC1Dd,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAMY,iBAAiB,CAACE,MAAM,GAAG,CAAC,CAAC,GAAG,CAAK;IACxDoB,kBAAkB,EAAG,KAAO;IAC5B,aAAYb,oBAAsB;IAClClB,OAAO,EAAGA,OAAS;IACnBgC,YAAY,EAAG;MACdC,GAAG,EAAE7B,iBAAiB;MACtB8B,KAAK,EAAE;QACNC,SAAS,EAAE/B;MACZ;IACD,CAAG;IACHL,YAAY,EAAGA,YAAc;IAC7BqC,aAAa;EAAA,GAEb,IAAAtE,MAAA,CAAAC,aAAA,EAACf,mBAAmB,CAACqF,QAAQ;IAACC,KAAK,EAAGtB;EAAc,GACjDxD,QAC2B,CACV,CACpB,CAAC;AAEL,CAAC;AACM,MAAMsE,YAAY,GAAG,IAAAS,uBAAc,EACzCnD,uBAAuB,EACvB,cACD,CAAC;AAACjC,OAAA,CAAA2E,YAAA,GAAAA,YAAA;AAEK,MAAMU,qBAAqB,GAAG,IAAAnF,mBAAU,EAG5C,SAASmF,qBAAqBA,CAAE9E,KAAK,EAAEC,GAAG,EAAG;EAC/C,MAAMC,mBAAmB,GAAG,IAAAC,mBAAU,EAAEb,mBAAoB,CAAC;EAC7D,OACC,IAAAc,MAAA,CAAAC,aAAA,EAACtC,MAAM,CAAC+G,qBAAqB;IAC5B7E,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVM,KAAK,EAAGJ,mBAAmB,EAAEI,KAAO;IACpCgC,OAAO,EAAGpC,mBAAmB,EAAEoC;EAAS,CACxC,CAAC;AAEJ,CAAE,CAAC;AAAC7C,OAAA,CAAAqF,qBAAA,GAAAA,qBAAA"}
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","_icons","_primitives","_context","_icon","_interopRequireDefault","Styled","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DropdownMenuContext","createContext","undefined","exports","DropdownMenuItem","forwardRef","prefix","suffix","children","hideOnClick","props","ref","dropdownMenuContext","useContext","_react","createElement","store","ItemPrefixWrapper","ItemSuffixWrapper","DropdownMenuCheckboxItem","MenuItemCheck","render","icon","check","size","radioCheck","SVG","xmlns","viewBox","Circle","cx","cy","r","DropdownMenuRadioItem","DropdownMenuGroup","DropdownMenuGroupLabel","UnconnectedDropdownMenu","_props$placement","_trigger$props$suffix","open","defaultOpen","onOpenChange","placement","trigger","gutter","shift","modal","variant","otherProps","useContextSystem","parentContext","computedDirection","isRTL","computedPlacement","test","replace","dropdownMenuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","rtl","contextValue","useMemo","appliedPlacementSide","useState","split","isValidElement","type","console","warn","hideOnEscape","useCallback","event","preventDefault","wrapperProps","dir","style","direction","Fragment","MenuButton","cloneElement","SubmenuChevronIcon","chevronRightSmall","DropdownMenu","hideOnHoverOutside","unmountOnHide","Provider","value","contextConnect","DropdownMenuSeparator"],"sources":["@wordpress/components/src/dropdown-menu-v2-ariakit/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tcloneElement,\n\tisValidElement,\n\tuseCallback,\n} from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\nimport { check, chevronRightSmall } from '@wordpress/icons';\nimport { SVG, Circle } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnect } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport Icon from '../icon';\nimport type {\n\tDropdownMenuContext as DropdownMenuContextType,\n\tDropdownMenuProps,\n\tDropdownMenuGroupProps,\n\tDropdownMenuGroupLabelProps,\n\tDropdownMenuItemProps,\n\tDropdownMenuCheckboxItemProps,\n\tDropdownMenuRadioItemProps,\n\tDropdownMenuSeparatorProps,\n} from './types';\nimport * as Styled from './styles';\n\nexport const DropdownMenuContext = createContext<\n\tDropdownMenuContextType | undefined\n>( undefined );\n\nexport const DropdownMenuItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuItemProps, 'div', false >\n>( function DropdownMenuItem(\n\t{ prefix, suffix, children, hideOnClick = true, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t{ prefix && (\n\t\t\t\t<Styled.ItemPrefixWrapper>{ prefix }</Styled.ItemPrefixWrapper>\n\t\t\t) }\n\t\t\t{ children }\n\t\t\t{ suffix && (\n\t\t\t\t<Styled.ItemSuffixWrapper>{ suffix }</Styled.ItemSuffixWrapper>\n\t\t\t) }\n\t\t</Styled.DropdownMenuItem>\n\t);\n} );\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuCheckboxItemProps, 'div', false >\n>( function DropdownMenuCheckboxItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuCheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t{ children }\n\t\t\t{ suffix && (\n\t\t\t\t<Styled.ItemSuffixWrapper>{ suffix }</Styled.ItemSuffixWrapper>\n\t\t\t) }\n\t\t</Styled.DropdownMenuCheckboxItem>\n\t);\n} );\n\nconst radioCheck = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Circle cx={ 12 } cy={ 12 } r={ 3 }></Circle>\n\t</SVG>\n);\n\nexport const DropdownMenuRadioItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuRadioItemProps, 'div', false >\n>( function DropdownMenuRadioItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuRadioItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t>\n\t\t\t\t<Icon icon={ radioCheck } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\t\t\t{ children }\n\t\t\t{ suffix }\n\t\t</Styled.DropdownMenuRadioItem>\n\t);\n} );\n\nexport const DropdownMenuGroup = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupProps, 'div', false >\n>( function DropdownMenuGroup( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroup\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t/>\n\t);\n} );\n\nexport const DropdownMenuGroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupLabelProps, 'div', false >\n>( function DropdownMenuGroupLabel( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroupLabel\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t/>\n\t);\n} );\n\nconst UnconnectedDropdownMenu = (\n\tprops: WordPressComponentProps< DropdownMenuProps, 'div', false >,\n\tref: React.ForwardedRef< HTMLDivElement >\n) => {\n\tconst {\n\t\t// Store props\n\t\topen,\n\t\tdefaultOpen = false,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// Menu trigger props\n\t\ttrigger,\n\n\t\t// Menu props\n\t\tgutter,\n\t\tchildren,\n\t\tshift,\n\t\tmodal = true,\n\n\t\t// From internal components context\n\t\tvariant,\n\n\t\t// Rest\n\t\t...otherProps\n\t} = useContextSystem<\n\t\ttypeof props & Pick< DropdownMenuContextType, 'variant' >\n\t>( props, 'DropdownMenu' );\n\n\tconst parentContext = useContext( DropdownMenuContext );\n\n\tconst computedDirection = isRTL() ? 'rtl' : 'ltr';\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root dropdown,\n\t// and of `right-start` for nested dropdowns.\n\tlet computedPlacement =\n\t\tprops.placement ??\n\t\t( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( computedDirection === 'rtl' ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst dropdownMenuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl: computedDirection === 'rtl',\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: dropdownMenuStore, variant } ),\n\t\t[ dropdownMenuStore, variant ]\n\t);\n\n\t// Extract the side from the applied placement — useful for animations.\n\tconst appliedPlacementSide = dropdownMenuStore\n\t\t.useState( 'placement' )\n\t\t.split( '-' )[ 0 ];\n\n\tif (\n\t\tdropdownMenuStore.parent &&\n\t\t! ( isValidElement( trigger ) && DropdownMenuItem === trigger.type )\n\t) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.'\n\t\t);\n\t}\n\n\tconst hideOnEscape = useCallback(\n\t\t( event: React.KeyboardEvent< Element > ) => {\n\t\t\t// Pressing Escape can cause unexpected consequences (ie. exiting\n\t\t\t// full screen mode on MacOs, close parent modals...).\n\t\t\tevent.preventDefault();\n\t\t\t// Returning `true` causes the menu to hide.\n\t\t\treturn true;\n\t\t},\n\t\t[]\n\t);\n\n\tconst wrapperProps = useMemo(\n\t\t() => ( {\n\t\t\tdir: computedDirection,\n\t\t\tstyle: {\n\t\t\t\tdirection:\n\t\t\t\t\tcomputedDirection as React.CSSProperties[ 'direction' ],\n\t\t\t},\n\t\t} ),\n\t\t[ computedDirection ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ /* Menu trigger */ }\n\t\t\t<Ariakit.MenuButton\n\t\t\t\tref={ ref }\n\t\t\t\tstore={ dropdownMenuStore }\n\t\t\t\trender={\n\t\t\t\t\tdropdownMenuStore.parent\n\t\t\t\t\t\t? cloneElement( trigger, {\n\t\t\t\t\t\t\t\t// Add submenu arrow, unless a `suffix` is explicitly specified\n\t\t\t\t\t\t\t\tsuffix: trigger.props.suffix ?? (\n\t\t\t\t\t\t\t\t\t<Styled.SubmenuChevronIcon\n\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: trigger\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t{ /* Menu popover */ }\n\t\t\t<Styled.DropdownMenu\n\t\t\t\t{ ...otherProps }\n\t\t\t\tmodal={ modal }\n\t\t\t\tstore={ dropdownMenuStore }\n\t\t\t\tgutter={ gutter ?? ( dropdownMenuStore.parent ? 16 : 8 ) }\n\t\t\t\tshift={ shift ?? ( dropdownMenuStore.parent ? -8 : 0 ) }\n\t\t\t\thideOnHoverOutside={ false }\n\t\t\t\tdata-side={ appliedPlacementSide }\n\t\t\t\tvariant={ variant }\n\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\thideOnEscape={ hideOnEscape }\n\t\t\t\tunmountOnHide\n\t\t\t>\n\t\t\t\t<DropdownMenuContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</DropdownMenuContext.Provider>\n\t\t\t</Styled.DropdownMenu>\n\t\t</>\n\t);\n};\nexport const DropdownMenu = contextConnect(\n\tUnconnectedDropdownMenu,\n\t'DropdownMenu'\n);\n\nexport const DropdownMenuSeparator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< DropdownMenuSeparatorProps, 'hr', false >\n>( function DropdownMenuSeparator( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuSeparator\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\tvariant={ dropdownMenuContext?.variant }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;;;AAIA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAA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MAAA,CAAAC,aAAA,EAACtC,MAAM,CAACkH,qBAAqB;IAC5BhF,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVM,KAAK,EAAGJ,mBAAmB,EAAEI,KAAO;IACpC+B,OAAO,EAAGnC,mBAAmB,EAAEmC;EAAS,CACxC,CAAC;AAEJ,CAAE,CAAC;AAAC5C,OAAA,CAAAwF,qBAAA,GAAAA,qBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/dropdown-menu-v2-ariakit/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type * as Ariakit from '@ariakit/react';\nimport type { Placement } from '@floating-ui/react-dom';\n\nexport interface DropdownMenuContext {\n\t/**\n\t * The ariakit store shared across all DropdownMenu subcomponents.\n\t */\n\tstore: Ariakit.MenuStore;\n\t/**\n\t * The variant used by the underlying menu popover.\n\t */\n\tvariant?: 'toolbar';\n}\n\nexport interface DropdownMenuProps {\n\t/**\n\t * The trigger button.\n\t */\n\ttrigger: React.ReactElement;\n\t/**\n\t * The contents of the dropdown.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * The open state of the dropdown menu when it is initially rendered. Use when\n\t * not wanting to control its open state.\n\t *\n\t * @default false\n\t */\n\tdefaultOpen?: boolean;\n\t/**\n\t * The controlled open state of the dropdown menu. Must be used in conjunction\n\t * with `onOpenChange`.\n\t */\n\topen?: boolean;\n\t/**\n\t * Event handler called when the open state of the dropdown menu changes.\n\t */\n\tonOpenChange?: ( open: boolean ) => void;\n\t/**\n\t * The modality of the dropdown menu. When set to true, interaction with\n\t * outside elements will be disabled and only menu content will be visible to\n\t * screen readers.\n\t *\n\t * @default true\n\t */\n\tmodal?: boolean;\n\t/**\n\t * The placement of the dropdown menu popover.\n\t *\n\t * @default 'bottom-start' for root-level menus, 'right-start' for nested menus\n\t */\n\tplacement?: Placement;\n\t/**\n\t * The distance between the popover and the anchor element.\n\t *\n\t * @default 8 for root-level menus, 16 for nested menus\n\t */\n\tgutter?: number;\n\t/**\n\t * The skidding of the popover along the anchor element. Can be set to\n\t * negative values to make the popover shift to the opposite side.\n\t *\n\t * @default 0 for root-level menus, -8 for nested menus\n\t */\n\tshift?: number;\n\t/**\n\t * Determines whether the menu popover will be hidden when the user presses\n\t * the Escape key.\n\t *\n\t * @default true
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/dropdown-menu-v2-ariakit/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type * as Ariakit from '@ariakit/react';\nimport type { Placement } from '@floating-ui/react-dom';\n\nexport interface DropdownMenuContext {\n\t/**\n\t * The ariakit store shared across all DropdownMenu subcomponents.\n\t */\n\tstore: Ariakit.MenuStore;\n\t/**\n\t * The variant used by the underlying menu popover.\n\t */\n\tvariant?: 'toolbar';\n}\n\nexport interface DropdownMenuProps {\n\t/**\n\t * The trigger button.\n\t */\n\ttrigger: React.ReactElement;\n\t/**\n\t * The contents of the dropdown.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * The open state of the dropdown menu when it is initially rendered. Use when\n\t * not wanting to control its open state.\n\t *\n\t * @default false\n\t */\n\tdefaultOpen?: boolean;\n\t/**\n\t * The controlled open state of the dropdown menu. Must be used in conjunction\n\t * with `onOpenChange`.\n\t */\n\topen?: boolean;\n\t/**\n\t * Event handler called when the open state of the dropdown menu changes.\n\t */\n\tonOpenChange?: ( open: boolean ) => void;\n\t/**\n\t * The modality of the dropdown menu. When set to true, interaction with\n\t * outside elements will be disabled and only menu content will be visible to\n\t * screen readers.\n\t *\n\t * @default true\n\t */\n\tmodal?: boolean;\n\t/**\n\t * The placement of the dropdown menu popover.\n\t *\n\t * @default 'bottom-start' for root-level menus, 'right-start' for nested menus\n\t */\n\tplacement?: Placement;\n\t/**\n\t * The distance between the popover and the anchor element.\n\t *\n\t * @default 8 for root-level menus, 16 for nested menus\n\t */\n\tgutter?: number;\n\t/**\n\t * The skidding of the popover along the anchor element. Can be set to\n\t * negative values to make the popover shift to the opposite side.\n\t *\n\t * @default 0 for root-level menus, -8 for nested menus\n\t */\n\tshift?: number;\n\t/**\n\t * Determines whether the menu popover will be hidden when the user presses\n\t * the Escape key.\n\t *\n\t * @default `( event ) => { event.preventDefault(); return true; }`\n\t */\n\thideOnEscape?:\n\t\t| boolean\n\t\t| ( (\n\t\t\t\tevent: KeyboardEvent | React.KeyboardEvent< Element >\n\t\t ) => boolean );\n}\n\nexport interface DropdownMenuGroupProps {\n\t/**\n\t * The contents of the dropdown menu group.\n\t */\n\tchildren: React.ReactNode;\n}\n\nexport interface DropdownMenuGroupLabelProps {\n\t/**\n\t * The contents of the dropdown menu group label.\n\t */\n\tchildren: React.ReactNode;\n}\n\nexport interface DropdownMenuItemProps {\n\t/**\n\t * The contents of the menu item.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * The contents of the menu item's prefix.\n\t */\n\tprefix?: React.ReactNode;\n\t/**\n\t * The contents of the menu item's suffix.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Whether to hide the parent menu when the item is clicked.\n\t *\n\t * @default true\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * Determines if the element is disabled.\n\t */\n\tdisabled?: boolean;\n}\n\nexport interface DropdownMenuCheckboxItemProps\n\textends Omit< DropdownMenuItemProps, 'prefix' | 'hideOnClick' > {\n\t/**\n\t * Whether to hide the dropdown menu when the item is clicked.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The checkbox menu item's name.\n\t */\n\tname: string;\n\t/**\n\t * The checkbox item's value, useful when using multiple checkbox menu items\n\t * associated to the same `name`.\n\t */\n\tvalue?: string;\n\t/**\n\t * The controlled checked state of the checkbox menu item.\n\t */\n\tchecked?: boolean;\n\t/**\n\t * The checked state of the checkbox menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t */\n\tdefaultChecked?: boolean;\n\t/**\n\t * Event handler called when the checked state of the checkbox menu item changes.\n\t */\n\tonChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;\n}\n\nexport interface DropdownMenuRadioItemProps\n\textends Omit< DropdownMenuItemProps, 'prefix' | 'hideOnClick' > {\n\t/**\n\t * Whether to hide the dropdown menu when the item is clicked.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The radio item's name.\n\t */\n\tname: string;\n\t/**\n\t * The radio item's value.\n\t */\n\tvalue: string | number;\n\t/**\n\t * The controlled checked state of the radio menu item.\n\t */\n\tchecked?: boolean;\n\t/**\n\t * The checked state of the radio menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t */\n\tdefaultChecked?: boolean;\n\t/**\n\t * Event handler called when the checked radio menu item changes.\n\t */\n\tonChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;\n}\n\nexport interface DropdownMenuSeparatorProps {}\n"],"mappings":""}
|
|
@@ -229,7 +229,7 @@ function GradientPicker({
|
|
|
229
229
|
__experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
|
|
230
230
|
value: value,
|
|
231
231
|
onChange: onChange
|
|
232
|
-
}), (gradients.length || clearable) && (0, _react.createElement)(Component, {
|
|
232
|
+
}), (gradients.length > 0 || clearable) && (0, _react.createElement)(Component, {
|
|
233
233
|
...additionalProps,
|
|
234
234
|
className: className,
|
|
235
235
|
clearGradient: clearGradient,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_compose","_element","_deprecated","_interopRequireDefault","_circularOptionPicker","_customGradientPicker","_vStack","_styles","_spacer","isMultipleOriginObject","obj","Array","isArray","gradients","isMultipleOriginArray","arr","length","every","gradientObj","SingleOrigin","className","clearGradient","onChange","value","additionalProps","gradientOptions","useMemo","map","gradient","name","index","_react","createElement","default","Option","key","isSelected","tooltipText","sprintf","__","style","color","background","onClick","OptionGroup","options","MultipleOrigin","headingLevel","instanceId","useInstanceId","VStack","spacing","gradientSet","id","ColorHeading","level","Component","props","asButtons","loop","actions","ariaLabel","ariaLabelledby","metaProps","_metaProps","GradientPicker","__nextHasNoMargin","clearable","disableCustomGradients","__experimentalIsRenderedInSidebar","useCallback","undefined","deprecated","since","version","hint","deprecatedMarginSpacerProps","marginTop","marginBottom","Spacer","ButtonAction","_default","exports"],"sources":["@wordpress/components/src/gradient-picker/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport CircularOptionPicker from '../circular-option-picker';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport { VStack } from '../v-stack';\nimport { ColorHeading } from '../color-palette/styles';\nimport { Spacer } from '../spacer';\nimport type {\n\tGradientPickerComponentProps,\n\tPickerProps,\n\tOriginObject,\n\tGradientObject,\n} from './types';\n\n// The Multiple Origin Gradients have a `gradients` property (an array of\n// gradient objects), while Single Origin ones have a `gradient` property.\nconst isMultipleOriginObject = (\n\tobj: Record< string, any >\n): obj is OriginObject =>\n\tArray.isArray( obj.gradients ) && ! ( 'gradient' in obj );\n\nconst isMultipleOriginArray = ( arr: any[] ): arr is OriginObject[] => {\n\treturn (\n\t\tarr.length > 0 &&\n\t\tarr.every( ( gradientObj ) => isMultipleOriginObject( gradientObj ) )\n\t);\n};\n\nfunction SingleOrigin( {\n\tclassName,\n\tclearGradient,\n\tgradients,\n\tonChange,\n\tvalue,\n\t...additionalProps\n}: PickerProps< GradientObject > ) {\n\tconst gradientOptions = useMemo( () => {\n\t\treturn gradients.map( ( { gradient, name }, index ) => (\n\t\t\t<CircularOptionPicker.Option\n\t\t\t\tkey={ gradient }\n\t\t\t\tvalue={ gradient }\n\t\t\t\tisSelected={ value === gradient }\n\t\t\t\ttooltipText={\n\t\t\t\t\tname ||\n\t\t\t\t\t// translators: %s: gradient code e.g: \"linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);\".\n\t\t\t\t\tsprintf( __( 'Gradient code: %s' ), gradient )\n\t\t\t\t}\n\t\t\t\tstyle={ { color: 'rgba( 0,0,0,0 )', background: gradient } }\n\t\t\t\tonClick={\n\t\t\t\t\tvalue === gradient\n\t\t\t\t\t\t? clearGradient\n\t\t\t\t\t\t: () => onChange( gradient, index )\n\t\t\t\t}\n\t\t\t\taria-label={\n\t\t\t\t\tname\n\t\t\t\t\t\t? // translators: %s: The name of the gradient e.g: \"Angular red to blue\".\n\t\t\t\t\t\t sprintf( __( 'Gradient: %s' ), name )\n\t\t\t\t\t\t: // translators: %s: gradient code e.g: \"linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);\".\n\t\t\t\t\t\t sprintf( __( 'Gradient code: %s' ), gradient )\n\t\t\t\t}\n\t\t\t/>\n\t\t) );\n\t}, [ gradients, value, onChange, clearGradient ] );\n\treturn (\n\t\t<CircularOptionPicker.OptionGroup\n\t\t\tclassName={ className }\n\t\t\toptions={ gradientOptions }\n\t\t\t{ ...additionalProps }\n\t\t/>\n\t);\n}\n\nfunction MultipleOrigin( {\n\tclassName,\n\tclearGradient,\n\tgradients,\n\tonChange,\n\tvalue,\n\theadingLevel,\n}: PickerProps< OriginObject > ) {\n\tconst instanceId = useInstanceId( MultipleOrigin );\n\n\treturn (\n\t\t<VStack spacing={ 3 } className={ className }>\n\t\t\t{ gradients.map( ( { name, gradients: gradientSet }, index ) => {\n\t\t\t\tconst id = `color-palette-${ instanceId }-${ index }`;\n\t\t\t\treturn (\n\t\t\t\t\t<VStack spacing={ 2 } key={ index }>\n\t\t\t\t\t\t<ColorHeading level={ headingLevel } id={ id }>\n\t\t\t\t\t\t\t{ name }\n\t\t\t\t\t\t</ColorHeading>\n\t\t\t\t\t\t<SingleOrigin\n\t\t\t\t\t\t\tclearGradient={ clearGradient }\n\t\t\t\t\t\t\tgradients={ gradientSet }\n\t\t\t\t\t\t\tonChange={ ( gradient ) =>\n\t\t\t\t\t\t\t\tonChange( gradient, index )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\taria-labelledby={ id }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n\nfunction Component( props: PickerProps< any > ) {\n\tconst {\n\t\tasButtons,\n\t\tloop,\n\t\tactions,\n\t\theadingLevel,\n\t\t'aria-label': ariaLabel,\n\t\t'aria-labelledby': ariaLabelledby,\n\t\t...additionalProps\n\t} = props;\n\tconst options = isMultipleOriginArray( props.gradients ) ? (\n\t\t<MultipleOrigin headingLevel={ headingLevel } { ...additionalProps } />\n\t) : (\n\t\t<SingleOrigin { ...additionalProps } />\n\t);\n\n\tlet metaProps:\n\t\t| { asButtons: false; loop?: boolean; 'aria-label': string }\n\t\t| { asButtons: false; loop?: boolean; 'aria-labelledby': string }\n\t\t| { asButtons: true };\n\n\tif ( asButtons ) {\n\t\tmetaProps = { asButtons: true };\n\t} else {\n\t\tconst _metaProps: { asButtons: false; loop?: boolean } = {\n\t\t\tasButtons: false,\n\t\t\tloop,\n\t\t};\n\n\t\tif ( ariaLabel ) {\n\t\t\tmetaProps = { ..._metaProps, 'aria-label': ariaLabel };\n\t\t} else if ( ariaLabelledby ) {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t};\n\t\t} else {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-label': __( 'Custom color picker.' ),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn (\n\t\t<CircularOptionPicker\n\t\t\t{ ...metaProps }\n\t\t\tactions={ actions }\n\t\t\toptions={ options }\n\t\t/>\n\t);\n}\n\n/**\n * GradientPicker is a React component that renders a color gradient picker to\n * define a multi step gradient. There's either a _linear_ or a _radial_ type\n * available.\n *\n * ```jsx\n *import { GradientPicker } from '@wordpress/components';\n *import { useState } from '@wordpress/element';\n *\n *const myGradientPicker = () => {\n *\tconst [ gradient, setGradient ] = useState( null );\n *\n *\treturn (\n *\t\t<GradientPicker\n *\t\t\t__nextHasNoMargin\n *\t\t\tvalue={ gradient }\n *\t\t\tonChange={ ( currentGradient ) => setGradient( currentGradient ) }\n *\t\t\tgradients={ [\n *\t\t\t\t{\n *\t\t\t\t\tname: 'JShine',\n *\t\t\t\t\tgradient:\n *\t\t\t\t\t\t'linear-gradient(135deg,#12c2e9 0%,#c471ed 50%,#f64f59 100%)',\n *\t\t\t\t\tslug: 'jshine',\n *\t\t\t\t},\n *\t\t\t\t{\n *\t\t\t\t\tname: 'Moonlit Asteroid',\n *\t\t\t\t\tgradient:\n *\t\t\t\t\t\t'linear-gradient(135deg,#0F2027 0%, #203A43 0%, #2c5364 100%)',\n *\t\t\t\t\tslug: 'moonlit-asteroid',\n *\t\t\t\t},\n *\t\t\t\t{\n *\t\t\t\t\tname: 'Rastafarie',\n *\t\t\t\t\tgradient:\n *\t\t\t\t\t\t'linear-gradient(135deg,#1E9600 0%, #FFF200 0%, #FF0000 100%)',\n *\t\t\t\t\tslug: 'rastafari',\n *\t\t\t\t},\n *\t\t\t] }\n *\t\t/>\n *\t);\n *};\n *```\n *\n */\nexport function GradientPicker( {\n\t/** Start opting into the new margin-free styles that will become the default in a future version. */\n\t__nextHasNoMargin = false,\n\tclassName,\n\tgradients = [],\n\tonChange,\n\tvalue,\n\tclearable = true,\n\tdisableCustomGradients = false,\n\t__experimentalIsRenderedInSidebar,\n\theadingLevel = 2,\n\t...additionalProps\n}: GradientPickerComponentProps ) {\n\tconst clearGradient = useCallback(\n\t\t() => onChange( undefined ),\n\t\t[ onChange ]\n\t);\n\n\tif ( ! __nextHasNoMargin ) {\n\t\tdeprecated( 'Outer margin styles for wp.components.GradientPicker', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.4',\n\t\t\thint: 'Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version',\n\t\t} );\n\t}\n\n\tconst deprecatedMarginSpacerProps = ! __nextHasNoMargin\n\t\t? {\n\t\t\t\tmarginTop: ! gradients.length ? 3 : undefined,\n\t\t\t\tmarginBottom: ! clearable ? 6 : 0,\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t// Outmost Spacer wrapper can be removed when deprecation period is over\n\t\t<Spacer marginBottom={ 0 } { ...deprecatedMarginSpacerProps }>\n\t\t\t<VStack spacing={ gradients.length ? 4 : 0 }>\n\t\t\t\t{ ! disableCustomGradients && (\n\t\t\t\t\t<CustomGradientPicker\n\t\t\t\t\t\t__nextHasNoMargin\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( gradients.length || clearable ) && (\n\t\t\t\t\t<Component\n\t\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tclearGradient={ clearGradient }\n\t\t\t\t\t\tgradients={ gradients }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\tclearable &&\n\t\t\t\t\t\t\t! disableCustomGradients && (\n\t\t\t\t\t\t\t\t<CircularOptionPicker.ButtonAction\n\t\t\t\t\t\t\t\t\tonClick={ clearGradient }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t\t\t\t</CircularOptionPicker.ButtonAction>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</Spacer>\n\t);\n}\n\nexport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AAC;EAEL;IACC;IACA,IAAApC,MAAA,CAAAC,aAAA,EAACxB,OAAA,CAAAuE,MAAM;MAACD,YAAY,EAAG,CAAG;MAAA,GAAMF;IAA2B,GAC1D,IAAA7C,MAAA,CAAAC,aAAA,EAAC1B,OAAA,CAAA4C,MAAM;MAACC,OAAO,EAAGtC,SAAS,CAACG,MAAM,GAAG,CAAC,GAAG;IAAG,GACzC,CAAEoD,sBAAsB,IACzB,IAAArC,MAAA,CAAAC,aAAA,EAAC3B,qBAAA,CAAA4B,OAAoB;MACpBiC,iBAAiB;MACjBG,iCAAiC,EAChCA,iCACA;MACD9C,KAAK,EAAGA,KAAO;MACfD,QAAQ,EAAGA;IAAU,CACrB,CACD,EACC,CAAET,SAAS,CAACG,MAAM,IAAImD,SAAS,KAChC,IAAApC,MAAA,CAAAC,aAAA,EAACwB,SAAS;MAAA,GACJhC,eAAe;MACpBJ,SAAS,EAAGA,SAAW;MACvBC,aAAa,EAAGA,aAAe;MAC/BR,SAAS,EAAGA,SAAW;MACvBS,QAAQ,EAAGA,QAAU;MACrBC,KAAK,EAAGA,KAAO;MACfqC,OAAO,EACNO,SAAS,IACT,CAAEC,sBAAsB,IACvB,IAAArC,MAAA,CAAAC,aAAA,EAAC5B,qBAAA,CAAA6B,OAAoB,CAAC+C,YAAY;QACjCrC,OAAO,EAAGtB;MAAe,GAEvB,IAAAkB,QAAE,EAAE,OAAQ,CACoB,CAEpC;MACDQ,YAAY,EAAGA;IAAc,CAC7B,CAEK,CACD;EAAC;AAEX;AAAC,IAAAkC,QAAA,GAEchB,cAAc;AAAAiB,OAAA,CAAAjD,OAAA,GAAAgD,QAAA"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_compose","_element","_deprecated","_interopRequireDefault","_circularOptionPicker","_customGradientPicker","_vStack","_styles","_spacer","isMultipleOriginObject","obj","Array","isArray","gradients","isMultipleOriginArray","arr","length","every","gradientObj","SingleOrigin","className","clearGradient","onChange","value","additionalProps","gradientOptions","useMemo","map","gradient","name","index","_react","createElement","default","Option","key","isSelected","tooltipText","sprintf","__","style","color","background","onClick","OptionGroup","options","MultipleOrigin","headingLevel","instanceId","useInstanceId","VStack","spacing","gradientSet","id","ColorHeading","level","Component","props","asButtons","loop","actions","ariaLabel","ariaLabelledby","metaProps","_metaProps","GradientPicker","__nextHasNoMargin","clearable","disableCustomGradients","__experimentalIsRenderedInSidebar","useCallback","undefined","deprecated","since","version","hint","deprecatedMarginSpacerProps","marginTop","marginBottom","Spacer","ButtonAction","_default","exports"],"sources":["@wordpress/components/src/gradient-picker/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport CircularOptionPicker from '../circular-option-picker';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport { VStack } from '../v-stack';\nimport { ColorHeading } from '../color-palette/styles';\nimport { Spacer } from '../spacer';\nimport type {\n\tGradientPickerComponentProps,\n\tPickerProps,\n\tOriginObject,\n\tGradientObject,\n} from './types';\n\n// The Multiple Origin Gradients have a `gradients` property (an array of\n// gradient objects), while Single Origin ones have a `gradient` property.\nconst isMultipleOriginObject = (\n\tobj: Record< string, any >\n): obj is OriginObject =>\n\tArray.isArray( obj.gradients ) && ! ( 'gradient' in obj );\n\nconst isMultipleOriginArray = ( arr: any[] ): arr is OriginObject[] => {\n\treturn (\n\t\tarr.length > 0 &&\n\t\tarr.every( ( gradientObj ) => isMultipleOriginObject( gradientObj ) )\n\t);\n};\n\nfunction SingleOrigin( {\n\tclassName,\n\tclearGradient,\n\tgradients,\n\tonChange,\n\tvalue,\n\t...additionalProps\n}: PickerProps< GradientObject > ) {\n\tconst gradientOptions = useMemo( () => {\n\t\treturn gradients.map( ( { gradient, name }, index ) => (\n\t\t\t<CircularOptionPicker.Option\n\t\t\t\tkey={ gradient }\n\t\t\t\tvalue={ gradient }\n\t\t\t\tisSelected={ value === gradient }\n\t\t\t\ttooltipText={\n\t\t\t\t\tname ||\n\t\t\t\t\t// translators: %s: gradient code e.g: \"linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);\".\n\t\t\t\t\tsprintf( __( 'Gradient code: %s' ), gradient )\n\t\t\t\t}\n\t\t\t\tstyle={ { color: 'rgba( 0,0,0,0 )', background: gradient } }\n\t\t\t\tonClick={\n\t\t\t\t\tvalue === gradient\n\t\t\t\t\t\t? clearGradient\n\t\t\t\t\t\t: () => onChange( gradient, index )\n\t\t\t\t}\n\t\t\t\taria-label={\n\t\t\t\t\tname\n\t\t\t\t\t\t? // translators: %s: The name of the gradient e.g: \"Angular red to blue\".\n\t\t\t\t\t\t sprintf( __( 'Gradient: %s' ), name )\n\t\t\t\t\t\t: // translators: %s: gradient code e.g: \"linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);\".\n\t\t\t\t\t\t sprintf( __( 'Gradient code: %s' ), gradient )\n\t\t\t\t}\n\t\t\t/>\n\t\t) );\n\t}, [ gradients, value, onChange, clearGradient ] );\n\treturn (\n\t\t<CircularOptionPicker.OptionGroup\n\t\t\tclassName={ className }\n\t\t\toptions={ gradientOptions }\n\t\t\t{ ...additionalProps }\n\t\t/>\n\t);\n}\n\nfunction MultipleOrigin( {\n\tclassName,\n\tclearGradient,\n\tgradients,\n\tonChange,\n\tvalue,\n\theadingLevel,\n}: PickerProps< OriginObject > ) {\n\tconst instanceId = useInstanceId( MultipleOrigin );\n\n\treturn (\n\t\t<VStack spacing={ 3 } className={ className }>\n\t\t\t{ gradients.map( ( { name, gradients: gradientSet }, index ) => {\n\t\t\t\tconst id = `color-palette-${ instanceId }-${ index }`;\n\t\t\t\treturn (\n\t\t\t\t\t<VStack spacing={ 2 } key={ index }>\n\t\t\t\t\t\t<ColorHeading level={ headingLevel } id={ id }>\n\t\t\t\t\t\t\t{ name }\n\t\t\t\t\t\t</ColorHeading>\n\t\t\t\t\t\t<SingleOrigin\n\t\t\t\t\t\t\tclearGradient={ clearGradient }\n\t\t\t\t\t\t\tgradients={ gradientSet }\n\t\t\t\t\t\t\tonChange={ ( gradient ) =>\n\t\t\t\t\t\t\t\tonChange( gradient, index )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\taria-labelledby={ id }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n\nfunction Component( props: PickerProps< any > ) {\n\tconst {\n\t\tasButtons,\n\t\tloop,\n\t\tactions,\n\t\theadingLevel,\n\t\t'aria-label': ariaLabel,\n\t\t'aria-labelledby': ariaLabelledby,\n\t\t...additionalProps\n\t} = props;\n\tconst options = isMultipleOriginArray( props.gradients ) ? (\n\t\t<MultipleOrigin headingLevel={ headingLevel } { ...additionalProps } />\n\t) : (\n\t\t<SingleOrigin { ...additionalProps } />\n\t);\n\n\tlet metaProps:\n\t\t| { asButtons: false; loop?: boolean; 'aria-label': string }\n\t\t| { asButtons: false; loop?: boolean; 'aria-labelledby': string }\n\t\t| { asButtons: true };\n\n\tif ( asButtons ) {\n\t\tmetaProps = { asButtons: true };\n\t} else {\n\t\tconst _metaProps: { asButtons: false; loop?: boolean } = {\n\t\t\tasButtons: false,\n\t\t\tloop,\n\t\t};\n\n\t\tif ( ariaLabel ) {\n\t\t\tmetaProps = { ..._metaProps, 'aria-label': ariaLabel };\n\t\t} else if ( ariaLabelledby ) {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-labelledby': ariaLabelledby,\n\t\t\t};\n\t\t} else {\n\t\t\tmetaProps = {\n\t\t\t\t..._metaProps,\n\t\t\t\t'aria-label': __( 'Custom color picker.' ),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn (\n\t\t<CircularOptionPicker\n\t\t\t{ ...metaProps }\n\t\t\tactions={ actions }\n\t\t\toptions={ options }\n\t\t/>\n\t);\n}\n\n/**\n * GradientPicker is a React component that renders a color gradient picker to\n * define a multi step gradient. There's either a _linear_ or a _radial_ type\n * available.\n *\n * ```jsx\n *import { GradientPicker } from '@wordpress/components';\n *import { useState } from '@wordpress/element';\n *\n *const myGradientPicker = () => {\n *\tconst [ gradient, setGradient ] = useState( null );\n *\n *\treturn (\n *\t\t<GradientPicker\n *\t\t\t__nextHasNoMargin\n *\t\t\tvalue={ gradient }\n *\t\t\tonChange={ ( currentGradient ) => setGradient( currentGradient ) }\n *\t\t\tgradients={ [\n *\t\t\t\t{\n *\t\t\t\t\tname: 'JShine',\n *\t\t\t\t\tgradient:\n *\t\t\t\t\t\t'linear-gradient(135deg,#12c2e9 0%,#c471ed 50%,#f64f59 100%)',\n *\t\t\t\t\tslug: 'jshine',\n *\t\t\t\t},\n *\t\t\t\t{\n *\t\t\t\t\tname: 'Moonlit Asteroid',\n *\t\t\t\t\tgradient:\n *\t\t\t\t\t\t'linear-gradient(135deg,#0F2027 0%, #203A43 0%, #2c5364 100%)',\n *\t\t\t\t\tslug: 'moonlit-asteroid',\n *\t\t\t\t},\n *\t\t\t\t{\n *\t\t\t\t\tname: 'Rastafarie',\n *\t\t\t\t\tgradient:\n *\t\t\t\t\t\t'linear-gradient(135deg,#1E9600 0%, #FFF200 0%, #FF0000 100%)',\n *\t\t\t\t\tslug: 'rastafari',\n *\t\t\t\t},\n *\t\t\t] }\n *\t\t/>\n *\t);\n *};\n *```\n *\n */\nexport function GradientPicker( {\n\t/** Start opting into the new margin-free styles that will become the default in a future version. */\n\t__nextHasNoMargin = false,\n\tclassName,\n\tgradients = [],\n\tonChange,\n\tvalue,\n\tclearable = true,\n\tdisableCustomGradients = false,\n\t__experimentalIsRenderedInSidebar,\n\theadingLevel = 2,\n\t...additionalProps\n}: GradientPickerComponentProps ) {\n\tconst clearGradient = useCallback(\n\t\t() => onChange( undefined ),\n\t\t[ onChange ]\n\t);\n\n\tif ( ! __nextHasNoMargin ) {\n\t\tdeprecated( 'Outer margin styles for wp.components.GradientPicker', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.4',\n\t\t\thint: 'Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version',\n\t\t} );\n\t}\n\n\tconst deprecatedMarginSpacerProps = ! __nextHasNoMargin\n\t\t? {\n\t\t\t\tmarginTop: ! gradients.length ? 3 : undefined,\n\t\t\t\tmarginBottom: ! clearable ? 6 : 0,\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t// Outmost Spacer wrapper can be removed when deprecation period is over\n\t\t<Spacer marginBottom={ 0 } { ...deprecatedMarginSpacerProps }>\n\t\t\t<VStack spacing={ gradients.length ? 4 : 0 }>\n\t\t\t\t{ ! disableCustomGradients && (\n\t\t\t\t\t<CustomGradientPicker\n\t\t\t\t\t\t__nextHasNoMargin\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( gradients.length > 0 || clearable ) && (\n\t\t\t\t\t<Component\n\t\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tclearGradient={ clearGradient }\n\t\t\t\t\t\tgradients={ gradients }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\tclearable &&\n\t\t\t\t\t\t\t! disableCustomGradients && (\n\t\t\t\t\t\t\t\t<CircularOptionPicker.ButtonAction\n\t\t\t\t\t\t\t\t\tonClick={ clearGradient }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t\t\t\t</CircularOptionPicker.ButtonAction>\n\t\t\t\t\t\t\t)\n\t\t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alStyles: true,
|
|
119
119
|
getGlobalStyles: true,
|
|
120
120
|
getColorsAndGradients: true,
|
|
121
|
-
useMobileGlobalStylesColors: true
|
|
121
|
+
useMobileGlobalStylesColors: true,
|
|
122
|
+
useEditorColorScheme: true
|
|
122
123
|
};
|
|
123
124
|
Object.defineProperty(exports, "ALIGNMENT_BREAKPOINTS", {
|
|
124
125
|
enumerable: true,
|
|
@@ -744,6 +745,12 @@ Object.defineProperty(exports, "useConvertUnitToMobile", {
|
|
|
744
745
|
return _useUnitConverterToMobile.useConvertUnitToMobile;
|
|
745
746
|
}
|
|
746
747
|
});
|
|
748
|
+
Object.defineProperty(exports, "useEditorColorScheme", {
|
|
749
|
+
enumerable: true,
|
|
750
|
+
get: function () {
|
|
751
|
+
return _utils4.useEditorColorScheme;
|
|
752
|
+
}
|
|
753
|
+
});
|
|
747
754
|
Object.defineProperty(exports, "useGlobalStyles", {
|
|
748
755
|
enumerable: true,
|
|
749
756
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_primitives","require","_colorIndicator","_interopRequireDefault","_colorPalette","_colorPicker","_dashicon","_dropdown","_dropdownMenu","_focalPointPicker","_toolbar","_tooltip","_icon","_spinner","_slotFill","_styleProvider","_baseControl","_utils","_textareaControl","_body","_actions","_button","_text","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_externalLink","_textControl","_toggleControl","_sandbox","_searchControl","_selectControl","_rangeControl","_resizableBox","_footerMessageControl","_colorControl","_queryControls","_notice","_list","_radioControl","_unitControl","_utils2","_disabled","_draggable","_withConstrainedTabbing","_withFallbackStyles","_withFilters","_fontSizePicker","_withFocusOutside","_withFocusReturn","_withNotices","_withSpokenMessages","_autocompletionItems","_autocomplete","_bottomSheet","_bottomSheetContext","_bottomSheetSelectControl","_htmlTextInput","_keyboardAvoidingView","_keyboardAwareFlatList","_picker","_cycleSelectControl","_gradient","_colorSettings","_segmentedControl","_focalPointSettingsPanel","_bottomSheetTextControl","_footerMessageLink","_linkPicker","_linkPickerScreen","_linkSettings","_linkSettingsScreen","_linkSettingsNavigation","_imageLinkDestinationsScreen","_image","_imageEditingButton","_inserterButton","_clipboard","_audioPlayer","_badge","_gridicons","_utils3","_alignments","_useUnitConverterToMobile","_globalStylesContext","_utils4","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["@wordpress/components/src/index.native.js"],"sourcesContent":["export {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as Dashicon } from './dashicon';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport {\n\tToolbar,\n\tToolbarButton,\n\tToolbarContext as __experimentalToolbarContext,\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tToolbarItem,\n} from './toolbar';\nexport { default as Tooltip } from './tooltip';\nexport { default as Icon } from './icon';\nexport { default as Spinner } from './spinner';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n} from './slot-fill';\n\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { default as BaseControl } from './base-control';\nexport { hasSplitBorders as __experimentalHasSplitBorders } from './border-box-control/utils';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelActions } from './panel/actions';\nexport { default as Button } from './button';\nexport { default as __experimentalText } from './text';\nexport { default as ExternalLink } from './external-link';\nexport { default as TextControl } from './text-control';\nexport { default as ToggleControl } from './toggle-control';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as FooterMessageControl } from './footer-message-control';\nexport { default as ColorControl } from './color-control';\nexport { default as QueryControls } from './query-controls';\nexport { default as Notice } from './notice';\nexport { default as NoticeList } from './notice/list';\nexport { default as RadioControl } from './radio-control';\nexport {\n\tdefault as UnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n} from './unit-control';\nexport {\n\tCSS_UNITS as CSS_UNITS,\n\tfilterUnitsWithSettings as filterUnitsWithSettings,\n} from './unit-control/utils';\nexport { default as Disabled } from './disabled';\nexport { default as Draggable, DraggableTrigger } from './draggable';\n\n// Higher-Order Components.\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as FontSizePicker } from './font-size-picker'; // Intentionally called after slot-fill and withFilters.\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport { default as withFocusReturn } from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\nexport * from './text';\n\n// Mobile Components.\nexport {\n\t__unstableAutocompletionItemsFill,\n\t__unstableAutocompletionItemsSlot,\n} from './mobile/autocompletion-items';\nexport { default as Autocomplete } from './autocomplete';\nexport { default as BottomSheet } from './mobile/bottom-sheet';\nexport {\n\tBottomSheetConsumer,\n\tBottomSheetProvider,\n\tBottomSheetContext,\n} from './mobile/bottom-sheet/bottom-sheet-context';\nexport { default as BottomSheetSelectControl } from './mobile/bottom-sheet-select-control';\nexport { default as HTMLTextInput } from './mobile/html-text-input';\nexport { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';\nexport { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';\nexport { default as Picker } from './mobile/picker';\nexport { default as CycleSelectControl } from './mobile/cycle-select-control';\nexport { default as Gradient } from './mobile/gradient';\nexport { default as ColorSettings } from './mobile/color-settings';\nexport { default as SegmentedControls } from './mobile/segmented-control';\nexport { default as FocalPointSettingsPanel } from './mobile/focal-point-settings-panel';\nexport { default as BottomSheetTextControl } from './mobile/bottom-sheet-text-control';\nexport { default as FooterMessageLink } from './mobile/bottom-sheet/footer-message-link/footer-message-link';\nexport { LinkPicker } from './mobile/link-picker';\nexport { default as LinkPickerScreen } from './mobile/link-picker/link-picker-screen';\nexport { default as LinkSettings } from './mobile/link-settings';\nexport { default as LinkSettingsScreen } from './mobile/link-settings/link-settings-screen';\nexport { default as LinkSettingsNavigation } from './mobile/link-settings/link-settings-navigation';\nexport { default as ImageLinkDestinationsScreen } from './mobile/link-settings/image-link-destinations-screen';\nexport { default as SegmentedControl } from './mobile/segmented-control';\nexport { default as Image, IMAGE_DEFAULT_FOCAL_POINT } from './mobile/image';\nexport { default as ImageEditingButton } from './mobile/image/image-editing-button';\nexport { default as InserterButton } from './mobile/inserter-button';\nexport { setClipboard, getClipboard } from './mobile/clipboard';\nexport { default as AudioPlayer } from './mobile/audio-player';\nexport { default as Badge } from './mobile/badge';\nexport { default as Gridicons } from './mobile/gridicons';\n\n// Utils.\nexport { colorsUtils } from './mobile/color-settings/utils';\nexport {\n\tWIDE_ALIGNMENTS,\n\tALIGNMENT_BREAKPOINTS,\n\talignmentHelpers,\n} from './mobile/utils/alignments';\n\n// Hooks.\nexport {\n\tconvertUnitToMobile,\n\tuseConvertUnitToMobile,\n\tgetValueAndUnit,\n} from './mobile/utils/use-unit-converter-to-mobile';\n\nexport {\n\tdefault as GlobalStylesContext,\n\tuseGlobalStyles,\n\twithGlobalStyles,\n\tgetMergedGlobalStyles,\n} from './mobile/global-styles-context';\nexport {\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n\tuseMobileGlobalStylesColors,\n} from './mobile/global-styles-context/utils';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
1
|
+
{"version":3,"names":["_primitives","require","_colorIndicator","_interopRequireDefault","_colorPalette","_colorPicker","_dashicon","_dropdown","_dropdownMenu","_focalPointPicker","_toolbar","_tooltip","_icon","_spinner","_slotFill","_styleProvider","_baseControl","_utils","_textareaControl","_body","_actions","_button","_text","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_externalLink","_textControl","_toggleControl","_sandbox","_searchControl","_selectControl","_rangeControl","_resizableBox","_footerMessageControl","_colorControl","_queryControls","_notice","_list","_radioControl","_unitControl","_utils2","_disabled","_draggable","_withConstrainedTabbing","_withFallbackStyles","_withFilters","_fontSizePicker","_withFocusOutside","_withFocusReturn","_withNotices","_withSpokenMessages","_autocompletionItems","_autocomplete","_bottomSheet","_bottomSheetContext","_bottomSheetSelectControl","_htmlTextInput","_keyboardAvoidingView","_keyboardAwareFlatList","_picker","_cycleSelectControl","_gradient","_colorSettings","_segmentedControl","_focalPointSettingsPanel","_bottomSheetTextControl","_footerMessageLink","_linkPicker","_linkPickerScreen","_linkSettings","_linkSettingsScreen","_linkSettingsNavigation","_imageLinkDestinationsScreen","_image","_imageEditingButton","_inserterButton","_clipboard","_audioPlayer","_badge","_gridicons","_utils3","_alignments","_useUnitConverterToMobile","_globalStylesContext","_utils4","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["@wordpress/components/src/index.native.js"],"sourcesContent":["export {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as Dashicon } from './dashicon';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport {\n\tToolbar,\n\tToolbarButton,\n\tToolbarContext as __experimentalToolbarContext,\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tToolbarItem,\n} from './toolbar';\nexport { default as Tooltip } from './tooltip';\nexport { default as Icon } from './icon';\nexport { default as Spinner } from './spinner';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n} from './slot-fill';\n\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { default as BaseControl } from './base-control';\nexport { hasSplitBorders as __experimentalHasSplitBorders } from './border-box-control/utils';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelActions } from './panel/actions';\nexport { default as Button } from './button';\nexport { default as __experimentalText } from './text';\nexport { default as ExternalLink } from './external-link';\nexport { default as TextControl } from './text-control';\nexport { default as ToggleControl } from './toggle-control';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as FooterMessageControl } from './footer-message-control';\nexport { default as ColorControl } from './color-control';\nexport { default as QueryControls } from './query-controls';\nexport { default as Notice } from './notice';\nexport { default as NoticeList } from './notice/list';\nexport { default as RadioControl } from './radio-control';\nexport {\n\tdefault as UnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n} from './unit-control';\nexport {\n\tCSS_UNITS as CSS_UNITS,\n\tfilterUnitsWithSettings as filterUnitsWithSettings,\n} from './unit-control/utils';\nexport { default as Disabled } from './disabled';\nexport { default as Draggable, DraggableTrigger } from './draggable';\n\n// Higher-Order Components.\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as FontSizePicker } from './font-size-picker'; // Intentionally called after slot-fill and withFilters.\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport { default as withFocusReturn } from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\nexport * from './text';\n\n// Mobile Components.\nexport {\n\t__unstableAutocompletionItemsFill,\n\t__unstableAutocompletionItemsSlot,\n} from './mobile/autocompletion-items';\nexport { default as Autocomplete } from './autocomplete';\nexport { default as BottomSheet } from './mobile/bottom-sheet';\nexport {\n\tBottomSheetConsumer,\n\tBottomSheetProvider,\n\tBottomSheetContext,\n} from './mobile/bottom-sheet/bottom-sheet-context';\nexport { default as BottomSheetSelectControl } from './mobile/bottom-sheet-select-control';\nexport { default as HTMLTextInput } from './mobile/html-text-input';\nexport { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';\nexport { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';\nexport { default as Picker } from './mobile/picker';\nexport { default as CycleSelectControl } from './mobile/cycle-select-control';\nexport { default as Gradient } from './mobile/gradient';\nexport { default as ColorSettings } from './mobile/color-settings';\nexport { default as SegmentedControls } from './mobile/segmented-control';\nexport { default as FocalPointSettingsPanel } from './mobile/focal-point-settings-panel';\nexport { default as BottomSheetTextControl } from './mobile/bottom-sheet-text-control';\nexport { default as FooterMessageLink } from './mobile/bottom-sheet/footer-message-link/footer-message-link';\nexport { LinkPicker } from './mobile/link-picker';\nexport { default as LinkPickerScreen } from './mobile/link-picker/link-picker-screen';\nexport { default as LinkSettings } from './mobile/link-settings';\nexport { default as LinkSettingsScreen } from './mobile/link-settings/link-settings-screen';\nexport { default as LinkSettingsNavigation } from './mobile/link-settings/link-settings-navigation';\nexport { default as ImageLinkDestinationsScreen } from './mobile/link-settings/image-link-destinations-screen';\nexport { default as SegmentedControl } from './mobile/segmented-control';\nexport { default as Image, IMAGE_DEFAULT_FOCAL_POINT } from './mobile/image';\nexport { default as ImageEditingButton } from './mobile/image/image-editing-button';\nexport { default as InserterButton } from './mobile/inserter-button';\nexport { setClipboard, getClipboard } from './mobile/clipboard';\nexport { default as AudioPlayer } from './mobile/audio-player';\nexport { default as Badge } from './mobile/badge';\nexport { default as Gridicons } from './mobile/gridicons';\n\n// Utils.\nexport { colorsUtils } from './mobile/color-settings/utils';\nexport {\n\tWIDE_ALIGNMENTS,\n\tALIGNMENT_BREAKPOINTS,\n\talignmentHelpers,\n} from './mobile/utils/alignments';\n\n// Hooks.\nexport {\n\tconvertUnitToMobile,\n\tuseConvertUnitToMobile,\n\tgetValueAndUnit,\n} from './mobile/utils/use-unit-converter-to-mobile';\n\nexport {\n\tdefault as GlobalStylesContext,\n\tuseGlobalStyles,\n\twithGlobalStyles,\n\tgetMergedGlobalStyles,\n} from './mobile/global-styles-context';\nexport {\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n\tuseMobileGlobalStylesColors,\n\tuseEditorColorScheme,\n} from './mobile/global-styles-context/utils';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AArE,GAAA,CAAAkE,GAAA,SAAAK,MAAA,WAAAC,qBAAA,GAAAnF,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAoF,wBAAA,WAAAjF,GAAA,IAAA0E,GAAA,QAAA1E,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAuE,GAAA,EAAA1E,GAAA,SAAAkF,IAAA,GAAAF,qBAAA,GAAAnF,MAAA,CAAAoF,wBAAA,CAAAP,GAAA,EAAA1E,GAAA,cAAAkF,IAAA,KAAAA,IAAA,CAAA1E,GAAA,IAAA0E,IAAA,CAAAC,GAAA,KAAAtF,MAAA,CAAAS,cAAA,CAAAyE,MAAA,EAAA/E,GAAA,EAAAkF,IAAA,YAAAH,MAAA,CAAA/E,GAAA,IAAA0E,GAAA,CAAA1E,GAAA,SAAA+E,MAAA,CAAAH,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,EAAAK,MAAA,YAAAA,MAAA"}
|
|
@@ -32,7 +32,6 @@ var _audioUrlParser = require("./audio-url-parser.native");
|
|
|
32
32
|
|
|
33
33
|
const isIOS = _reactNative.Platform.OS === 'ios';
|
|
34
34
|
function Player({
|
|
35
|
-
getStylesFromColorScheme,
|
|
36
35
|
isUploadInProgress,
|
|
37
36
|
isUploadFailed,
|
|
38
37
|
attributes,
|
|
@@ -60,27 +59,27 @@ function Player({
|
|
|
60
59
|
});
|
|
61
60
|
}
|
|
62
61
|
};
|
|
63
|
-
const containerStyle =
|
|
64
|
-
const iconStyle =
|
|
65
|
-
const iconDisabledStyle =
|
|
62
|
+
const containerStyle = (0, _components.useEditorColorScheme)(_styles.default.container, _styles.default.containerDark);
|
|
63
|
+
const iconStyle = (0, _components.useEditorColorScheme)(_styles.default.icon, _styles.default.iconDark);
|
|
64
|
+
const iconDisabledStyle = (0, _components.useEditorColorScheme)(_styles.default.iconDisabled, _styles.default.iconDisabledDark);
|
|
66
65
|
const isDisabled = isUploadFailed || isUploadInProgress;
|
|
67
66
|
const finalIconStyle = {
|
|
68
67
|
...iconStyle,
|
|
69
68
|
...(isDisabled && iconDisabledStyle)
|
|
70
69
|
};
|
|
71
|
-
const iconContainerStyle =
|
|
70
|
+
const iconContainerStyle = (0, _components.useEditorColorScheme)(_styles.default.iconContainer, _styles.default.iconContainerDark);
|
|
72
71
|
const titleContainerStyle = {
|
|
73
72
|
..._styles.default.titleContainer,
|
|
74
73
|
...(isIOS ? _styles.default.titleContainerIOS : _styles.default.titleContainerAndroid)
|
|
75
74
|
};
|
|
76
|
-
const titleStyle =
|
|
77
|
-
const uploadFailedStyle =
|
|
78
|
-
const subtitleStyle =
|
|
75
|
+
const titleStyle = (0, _components.useEditorColorScheme)(_styles.default.title, _styles.default.titleDark);
|
|
76
|
+
const uploadFailedStyle = (0, _components.useEditorColorScheme)(_styles.default.uploadFailed, _styles.default.uploadFailedDark);
|
|
77
|
+
const subtitleStyle = (0, _components.useEditorColorScheme)(_styles.default.subtitle, _styles.default.subtitleDark);
|
|
79
78
|
const finalSubtitleStyle = {
|
|
80
79
|
...subtitleStyle,
|
|
81
80
|
...(isUploadFailed && uploadFailedStyle)
|
|
82
81
|
};
|
|
83
|
-
const buttonBackgroundStyle =
|
|
82
|
+
const buttonBackgroundStyle = (0, _components.useEditorColorScheme)(_styles.default.buttonBackground, _styles.default.buttonBackgroundDark);
|
|
84
83
|
let title = '';
|
|
85
84
|
let extension = '';
|
|
86
85
|
if (src) {
|