@wordpress/components 31.0.1-next.76cff8c98.0 → 32.0.1-next.06ee73755.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 +6 -1
- package/build/context/context-system-provider.cjs +1 -1
- package/build/context/context-system-provider.cjs.map +1 -1
- package/build/duotone-picker/duotone-picker.cjs +1 -1
- package/build/duotone-picker/duotone-picker.cjs.map +1 -1
- package/build/higher-order/with-fallback-styles/index.cjs +1 -1
- package/build/higher-order/with-fallback-styles/index.cjs.map +1 -1
- package/build-module/context/context-system-provider.mjs +1 -1
- package/build-module/context/context-system-provider.mjs.map +1 -1
- package/build-module/duotone-picker/duotone-picker.mjs +1 -1
- package/build-module/duotone-picker/duotone-picker.mjs.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.mjs +1 -1
- package/build-module/higher-order/with-fallback-styles/index.mjs.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +5 -4
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +5 -4
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +5 -4
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +5 -4
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +5 -4
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +5 -4
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +1 -1
- package/build-types/card/card/hook.d.ts +5 -4
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +5 -4
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +5 -4
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +5 -4
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +5 -4
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +5 -4
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-picker/styles.d.ts +1 -1
- package/build-types/date-time/date/styles.d.ts +1 -1
- package/build-types/date-time/time/styles.d.ts +4 -4
- package/build-types/elevation/hook.d.ts +5 -4
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/external-link/index.d.ts +1 -2
- package/build-types/external-link/index.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts +5 -4
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +5 -4
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +5 -4
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +127 -127
- package/build-types/grid/hook.d.ts +5 -4
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +5 -4
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +5 -4
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +5 -4
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +5 -4
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +5 -4
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +5 -4
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +379 -379
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/scrollable/hook.d.ts +5 -4
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/search-control/index.d.ts +13 -3
- package/build-types/search-control/index.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +13 -1
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +5 -4
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +5 -4
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +5 -4
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +5 -4
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +5 -4
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +5 -4
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +5 -4
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/build-types/v-stack/hook.d.ts +5 -4
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
- package/build-types/view/component.d.ts +126 -126
- package/package.json +27 -20
- package/src/context/context-system-provider.js +1 -1
- package/src/duotone-picker/duotone-picker.tsx +1 -1
- package/src/higher-order/with-fallback-styles/index.tsx +1 -1
- package/src/higher-order/with-notices/test/index.tsx +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 32.0.0-next.0 (2026-01-12)
|
|
6
|
+
|
|
7
|
+
### Code Quality
|
|
8
|
+
|
|
9
|
+
- Fix missing dependencies. [#74310](https://github.com/WordPress/gutenberg/pull/74310)
|
|
6
10
|
|
|
7
11
|
### Breaking Changes
|
|
8
12
|
|
|
@@ -52,6 +56,7 @@
|
|
|
52
56
|
- `AnglePickerControl`: Migrate styles from Emotion to a CSS module ([#73786](https://github.com/WordPress/gutenberg/pull/73786)).
|
|
53
57
|
- `Menu`: Clean up popover wrappers ([#74207](https://github.com/WordPress/gutenberg/pull/74207)).
|
|
54
58
|
- `Button`, `DateCalendar`, `DateRangeCalendar`, `CheckboxControl`, `Panel`, `Placeholder`: Remove outdated vendor prefix properties in CSS ([#74213](https://github.com/WordPress/gutenberg/pull/74213)).
|
|
59
|
+
- Updated `fast-deep-equal` imports for compatibility with strict Node.js resolution ([#74530](https://github.com/WordPress/gutenberg/pull/74530)).
|
|
55
60
|
|
|
56
61
|
## 30.9.0 (2025-11-26)
|
|
57
62
|
|
|
@@ -36,7 +36,7 @@ __export(context_system_provider_exports, {
|
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(context_system_provider_exports);
|
|
38
38
|
var import_deepmerge = __toESM(require("deepmerge"));
|
|
39
|
-
var import_es6 = __toESM(require("fast-deep-equal/es6"));
|
|
39
|
+
var import_es6 = __toESM(require("fast-deep-equal/es6/index.js"));
|
|
40
40
|
var import_is_plain_object = require("is-plain-object");
|
|
41
41
|
var import_element = require("@wordpress/element");
|
|
42
42
|
var import_warning = __toESM(require("@wordpress/warning"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/context/context-system-provider.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useRef, useMemo, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComponentsContext = createContext(/** @type {Record<string, any>} */{});\nComponentsContext.displayName = 'ComponentsContext';\nexport const useComponentsContext = () => useContext(ComponentsContext);\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge({\n value\n}) {\n const parentContext = useComponentsContext();\n const valueRef = useRef(value);\n useUpdateEffect(() => {\n if (\n // Objects are equivalent.\n fastDeepEqual(valueRef.current, value) &&\n // But not the same reference.\n valueRef.current !== value) {\n globalThis.SCRIPT_DEBUG === true ? warn(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;\n }\n }, [value]);\n\n // `parentContext` will always be memoized (i.e., the result of this hook itself)\n // or the default value from when the `ComponentsContext` was originally\n // initialized (which will never change, it's a static variable)\n // so this memoization will prevent `deepmerge()` from rerunning unless\n // the references to `value` change OR the `parentContext` has an actual material change\n // (because again, it's guaranteed to be memoized or a static reference to the empty object\n // so we know that the only changes for `parentContext` are material ones... i.e., why we\n // don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n // need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n // correctly warning when the `value` isn't being properly memoized. All of that to say\n // that this should be super safe to assume that `useMemo` will only run on actual\n // changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n const config = useMemo(() => {\n // Deep clone `parentContext` to avoid mutating it later.\n return deepmerge(parentContext !== null && parentContext !== void 0 ? parentContext : {}, value !== null && value !== void 0 ? value : {}, {\n isMergeableObject: isPlainObject\n });\n }, [parentContext, value]);\n return config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ({\n children,\n value\n}) => {\n const contextValue = useContextSystemBridge({\n value\n });\n return /*#__PURE__*/_jsx(ComponentsContext.Provider, {\n value: contextValue,\n children: children\n });\n};\nexport const ContextSystemProvider = memo(BaseContextSystemProvider);"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useRef, useMemo, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComponentsContext = createContext(/** @type {Record<string, any>} */{});\nComponentsContext.displayName = 'ComponentsContext';\nexport const useComponentsContext = () => useContext(ComponentsContext);\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge({\n value\n}) {\n const parentContext = useComponentsContext();\n const valueRef = useRef(value);\n useUpdateEffect(() => {\n if (\n // Objects are equivalent.\n fastDeepEqual(valueRef.current, value) &&\n // But not the same reference.\n valueRef.current !== value) {\n globalThis.SCRIPT_DEBUG === true ? warn(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;\n }\n }, [value]);\n\n // `parentContext` will always be memoized (i.e., the result of this hook itself)\n // or the default value from when the `ComponentsContext` was originally\n // initialized (which will never change, it's a static variable)\n // so this memoization will prevent `deepmerge()` from rerunning unless\n // the references to `value` change OR the `parentContext` has an actual material change\n // (because again, it's guaranteed to be memoized or a static reference to the empty object\n // so we know that the only changes for `parentContext` are material ones... i.e., why we\n // don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n // need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n // correctly warning when the `value` isn't being properly memoized. All of that to say\n // that this should be super safe to assume that `useMemo` will only run on actual\n // changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n const config = useMemo(() => {\n // Deep clone `parentContext` to avoid mutating it later.\n return deepmerge(parentContext !== null && parentContext !== void 0 ? parentContext : {}, value !== null && value !== void 0 ? value : {}, {\n isMergeableObject: isPlainObject\n });\n }, [parentContext, value]);\n return config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ({\n children,\n value\n}) => {\n const contextValue = useContextSystemBridge({\n value\n });\n return /*#__PURE__*/_jsx(ComponentsContext.Provider, {\n value: contextValue,\n children: children\n });\n};\nexport const ContextSystemProvider = memo(BaseContextSystemProvider);"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAsB;AACtB,iBAA0B;AAC1B,6BAA8B;AAK9B,qBAAiE;AACjE,qBAAiB;AAKjB,mBAAgC;AAChC,yBAA4B;AACrB,IAAM,wBAAoB;AAAA;AAAA,EAAgD,CAAC;AAAC;AACnF,kBAAkB,cAAc;AACzB,IAAM,uBAAuB,UAAM,2BAAW,iBAAiB;AAWtE,SAAS,uBAAuB;AAAA,EAC9B;AACF,GAAG;AACD,QAAM,gBAAgB,qBAAqB;AAC3C,QAAM,eAAW,uBAAO,KAAK;AAC7B,oCAAgB,MAAM;AACpB;AAAA;AAAA,UAEA,WAAAA,SAAc,SAAS,SAAS,KAAK;AAAA,MAErC,SAAS,YAAY;AAAA,MAAO;AAC1B,iBAAW,iBAAiB,WAAO,eAAAC,SAAK,gCAAgC,KAAK,UAAU,KAAK,CAAC,EAAE,IAAI;AAAA,IACrG;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAcV,QAAM,aAAS,wBAAQ,MAAM;AAE3B,eAAO,iBAAAC,SAAU,kBAAkB,QAAQ,kBAAkB,SAAS,gBAAgB,CAAC,GAAG,UAAU,QAAQ,UAAU,SAAS,QAAQ,CAAC,GAAG;AAAA,MACzI,mBAAmB;AAAA,IACrB,CAAC;AAAA,EACH,GAAG,CAAC,eAAe,KAAK,CAAC;AACzB,SAAO;AACT;AAmBA,IAAM,4BAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,uBAAuB;AAAA,IAC1C;AAAA,EACF,CAAC;AACD,SAAoB,uCAAAC,KAAK,kBAAkB,UAAU;AAAA,IACnD,OAAO;AAAA,IACP;AAAA,EACF,CAAC;AACH;AACO,IAAM,4BAAwB,qBAAK,yBAAyB;",
|
|
6
6
|
"names": ["fastDeepEqual", "warn", "deepmerge", "_jsx"]
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ __export(duotone_picker_exports, {
|
|
|
33
33
|
default: () => duotone_picker_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(duotone_picker_exports);
|
|
36
|
-
var import_es6 = __toESM(require("fast-deep-equal/es6"));
|
|
36
|
+
var import_es6 = __toESM(require("fast-deep-equal/es6/index.js"));
|
|
37
37
|
var import_element = require("@wordpress/element");
|
|
38
38
|
var import_i18n = require("@wordpress/i18n");
|
|
39
39
|
var import_color_list_picker = __toESM(require("./color-list-picker/index.cjs"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/duotone-picker/duotone-picker.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorListPicker from './color-list-picker';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport CustomDuotoneBar from './custom-duotone-bar';\nimport { getDefaultColors, getGradientFromCSSColors } from './utils';\nimport { Spacer } from '../spacer';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * ```jsx\n * import { DuotonePicker, DuotoneSwatch } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const DUOTONE_PALETTE = [\n * \t{ colors: [ '#8c00b7', '#fcff41' ], name: 'Purple and yellow', slug: 'purple-yellow' },\n * \t{ colors: [ '#000097', '#ff4747' ], name: 'Blue and red', slug: 'blue-red' },\n * ];\n *\n * const COLOR_PALETTE = [\n * \t{ color: '#ff4747', name: 'Red', slug: 'red' },\n * \t{ color: '#fcff41', name: 'Yellow', slug: 'yellow' },\n * \t{ color: '#000097', name: 'Blue', slug: 'blue' },\n * \t{ color: '#8c00b7', name: 'Purple', slug: 'purple' },\n * ];\n *\n * const Example = () => {\n * \tconst [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );\n * \treturn (\n * \t\t<>\n * \t\t\t<DuotonePicker\n * \t\t\t\tduotonePalette={ DUOTONE_PALETTE }\n * \t\t\t\tcolorPalette={ COLOR_PALETTE }\n * \t\t\t\tvalue={ duotone }\n * \t\t\t\tonChange={ setDuotone }\n * \t\t\t/>\n * \t\t\t<DuotoneSwatch values={ duotone } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nfunction DuotonePicker({\n asButtons,\n loop,\n clearable = true,\n unsetable = true,\n colorPalette,\n duotonePalette,\n disableCustomColors,\n disableCustomDuotone,\n value,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...otherProps\n}) {\n const [defaultDark, defaultLight] = useMemo(() => getDefaultColors(colorPalette), [colorPalette]);\n const isUnset = value === 'unset';\n const unsetOptionLabel = __('Unset');\n const unsetOption = /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: \"unset\",\n isSelected: isUnset,\n tooltipText: unsetOptionLabel,\n \"aria-label\": unsetOptionLabel,\n className: \"components-duotone-picker__color-indicator\",\n onClick: () => {\n onChange(isUnset ? undefined : 'unset');\n }\n }, \"unset\");\n const duotoneOptions = duotonePalette.map(({\n colors,\n slug,\n name\n }) => {\n const style = {\n background: getGradientFromCSSColors(colors, '135deg'),\n color: 'transparent'\n };\n const tooltipText = name !== null && name !== void 0 ? name : sprintf(\n // translators: %s: duotone code e.g: \"dark-grayscale\" or \"7f7f7f-ffffff\".\n __('Duotone code: %s'), slug);\n const label = name ? sprintf(\n // translators: %s: The name of the option e.g: \"Dark grayscale\".\n __('Duotone: %s'), name) : tooltipText;\n const isSelected = fastDeepEqual(colors, value);\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: colors,\n isSelected: isSelected,\n \"aria-label\": label,\n tooltipText: tooltipText,\n style: style,\n onClick: () => {\n onChange(isSelected ? undefined : colors);\n }\n }, slug);\n });\n const {\n metaProps,\n labelProps\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);\n const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;\n return /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...otherProps,\n ...metaProps,\n ...labelProps,\n options: options,\n actions: !!clearable && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: () => onChange(undefined),\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n }),\n children: /*#__PURE__*/_jsx(Spacer, {\n paddingTop: options.length === 0 ? 0 : 4,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 3,\n children: [!disableCustomColors && !disableCustomDuotone && /*#__PURE__*/_jsx(CustomDuotoneBar, {\n value: isUnset ? undefined : value,\n onChange: onChange\n }), !disableCustomDuotone && /*#__PURE__*/_jsx(ColorListPicker, {\n labels: [__('Shadows'), __('Highlights')],\n colors: colorPalette,\n value: isUnset ? undefined : value,\n disableCustomColors: disableCustomColors,\n enableAlpha: true,\n onChange: newColors => {\n if (!newColors[0]) {\n newColors[0] = defaultDark;\n }\n if (!newColors[1]) {\n newColors[1] = defaultLight;\n }\n const newValue = newColors.length >= 2 ? newColors : undefined;\n // @ts-expect-error TODO: The color arrays for a DuotonePicker should be a tuple of two colors,\n // but it's currently typed as a string[].\n // See also https://github.com/WordPress/gutenberg/pull/49060#discussion_r1136951035\n onChange(newValue);\n }\n })]\n })\n })\n });\n}\nexport default DuotonePicker;"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorListPicker from './color-list-picker';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport CustomDuotoneBar from './custom-duotone-bar';\nimport { getDefaultColors, getGradientFromCSSColors } from './utils';\nimport { Spacer } from '../spacer';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * ```jsx\n * import { DuotonePicker, DuotoneSwatch } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const DUOTONE_PALETTE = [\n * \t{ colors: [ '#8c00b7', '#fcff41' ], name: 'Purple and yellow', slug: 'purple-yellow' },\n * \t{ colors: [ '#000097', '#ff4747' ], name: 'Blue and red', slug: 'blue-red' },\n * ];\n *\n * const COLOR_PALETTE = [\n * \t{ color: '#ff4747', name: 'Red', slug: 'red' },\n * \t{ color: '#fcff41', name: 'Yellow', slug: 'yellow' },\n * \t{ color: '#000097', name: 'Blue', slug: 'blue' },\n * \t{ color: '#8c00b7', name: 'Purple', slug: 'purple' },\n * ];\n *\n * const Example = () => {\n * \tconst [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );\n * \treturn (\n * \t\t<>\n * \t\t\t<DuotonePicker\n * \t\t\t\tduotonePalette={ DUOTONE_PALETTE }\n * \t\t\t\tcolorPalette={ COLOR_PALETTE }\n * \t\t\t\tvalue={ duotone }\n * \t\t\t\tonChange={ setDuotone }\n * \t\t\t/>\n * \t\t\t<DuotoneSwatch values={ duotone } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nfunction DuotonePicker({\n asButtons,\n loop,\n clearable = true,\n unsetable = true,\n colorPalette,\n duotonePalette,\n disableCustomColors,\n disableCustomDuotone,\n value,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...otherProps\n}) {\n const [defaultDark, defaultLight] = useMemo(() => getDefaultColors(colorPalette), [colorPalette]);\n const isUnset = value === 'unset';\n const unsetOptionLabel = __('Unset');\n const unsetOption = /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: \"unset\",\n isSelected: isUnset,\n tooltipText: unsetOptionLabel,\n \"aria-label\": unsetOptionLabel,\n className: \"components-duotone-picker__color-indicator\",\n onClick: () => {\n onChange(isUnset ? undefined : 'unset');\n }\n }, \"unset\");\n const duotoneOptions = duotonePalette.map(({\n colors,\n slug,\n name\n }) => {\n const style = {\n background: getGradientFromCSSColors(colors, '135deg'),\n color: 'transparent'\n };\n const tooltipText = name !== null && name !== void 0 ? name : sprintf(\n // translators: %s: duotone code e.g: \"dark-grayscale\" or \"7f7f7f-ffffff\".\n __('Duotone code: %s'), slug);\n const label = name ? sprintf(\n // translators: %s: The name of the option e.g: \"Dark grayscale\".\n __('Duotone: %s'), name) : tooltipText;\n const isSelected = fastDeepEqual(colors, value);\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: colors,\n isSelected: isSelected,\n \"aria-label\": label,\n tooltipText: tooltipText,\n style: style,\n onClick: () => {\n onChange(isSelected ? undefined : colors);\n }\n }, slug);\n });\n const {\n metaProps,\n labelProps\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);\n const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;\n return /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...otherProps,\n ...metaProps,\n ...labelProps,\n options: options,\n actions: !!clearable && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: () => onChange(undefined),\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n }),\n children: /*#__PURE__*/_jsx(Spacer, {\n paddingTop: options.length === 0 ? 0 : 4,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 3,\n children: [!disableCustomColors && !disableCustomDuotone && /*#__PURE__*/_jsx(CustomDuotoneBar, {\n value: isUnset ? undefined : value,\n onChange: onChange\n }), !disableCustomDuotone && /*#__PURE__*/_jsx(ColorListPicker, {\n labels: [__('Shadows'), __('Highlights')],\n colors: colorPalette,\n value: isUnset ? undefined : value,\n disableCustomColors: disableCustomColors,\n enableAlpha: true,\n onChange: newColors => {\n if (!newColors[0]) {\n newColors[0] = defaultDark;\n }\n if (!newColors[1]) {\n newColors[1] = defaultLight;\n }\n const newValue = newColors.length >= 2 ? newColors : undefined;\n // @ts-expect-error TODO: The color arrays for a DuotonePicker should be a tuple of two colors,\n // but it's currently typed as a string[].\n // See also https://github.com/WordPress/gutenberg/pull/49060#discussion_r1136951035\n onChange(newValue);\n }\n })]\n })\n })\n });\n}\nexport default DuotonePicker;"],
|
|
5
5
|
"mappings": "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",
|
|
6
6
|
"names": ["_jsx", "CircularOptionPicker", "fastDeepEqual", "_jsxs", "CustomDuotoneBar", "ColorListPicker"]
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ __export(with_fallback_styles_exports, {
|
|
|
33
33
|
default: () => with_fallback_styles_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(with_fallback_styles_exports);
|
|
36
|
-
var import_es6 = __toESM(require("fast-deep-equal/es6"));
|
|
36
|
+
var import_es6 = __toESM(require("fast-deep-equal/es6/index.js"));
|
|
37
37
|
var import_element = require("@wordpress/element");
|
|
38
38
|
var import_compose = require("@wordpress/compose");
|
|
39
39
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/higher-order/with-fallback-styles/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default mapNodeToProps => createHigherOrderComponent(WrappedComponent => {\n return class extends Component {\n constructor(props) {\n super(props);\n this.nodeRef = this.props.node;\n this.state = {\n fallbackStyles: undefined,\n grabStylesCompleted: false\n };\n this.bindRef = this.bindRef.bind(this);\n }\n bindRef(node) {\n if (!node) {\n return;\n }\n this.nodeRef = node;\n }\n componentDidMount() {\n this.grabFallbackStyles();\n }\n componentDidUpdate() {\n this.grabFallbackStyles();\n }\n grabFallbackStyles() {\n const {\n grabStylesCompleted,\n fallbackStyles\n } = this.state;\n if (this.nodeRef && !grabStylesCompleted) {\n const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);\n if (!fastDeepEqual(newFallbackStyles, fallbackStyles)) {\n this.setState({\n fallbackStyles: newFallbackStyles,\n grabStylesCompleted: Object.values(newFallbackStyles).every(Boolean)\n });\n }\n }\n }\n render() {\n const wrappedComponent = /*#__PURE__*/_jsx(WrappedComponent, {\n ...this.props,\n ...this.state.fallbackStyles\n });\n return this.props.node ? wrappedComponent : /*#__PURE__*/_jsxs(\"div\", {\n ref: this.bindRef,\n children: [\" \", wrappedComponent, \" \"]\n });\n }\n };\n}, 'withFallbackStyles');"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default mapNodeToProps => createHigherOrderComponent(WrappedComponent => {\n return class extends Component {\n constructor(props) {\n super(props);\n this.nodeRef = this.props.node;\n this.state = {\n fallbackStyles: undefined,\n grabStylesCompleted: false\n };\n this.bindRef = this.bindRef.bind(this);\n }\n bindRef(node) {\n if (!node) {\n return;\n }\n this.nodeRef = node;\n }\n componentDidMount() {\n this.grabFallbackStyles();\n }\n componentDidUpdate() {\n this.grabFallbackStyles();\n }\n grabFallbackStyles() {\n const {\n grabStylesCompleted,\n fallbackStyles\n } = this.state;\n if (this.nodeRef && !grabStylesCompleted) {\n const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);\n if (!fastDeepEqual(newFallbackStyles, fallbackStyles)) {\n this.setState({\n fallbackStyles: newFallbackStyles,\n grabStylesCompleted: Object.values(newFallbackStyles).every(Boolean)\n });\n }\n }\n }\n render() {\n const wrappedComponent = /*#__PURE__*/_jsx(WrappedComponent, {\n ...this.props,\n ...this.state.fallbackStyles\n });\n return this.props.node ? wrappedComponent : /*#__PURE__*/_jsxs(\"div\", {\n ref: this.bindRef,\n children: [\" \", wrappedComponent, \" \"]\n });\n }\n };\n}, 'withFallbackStyles');"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAA0B;AAK1B,qBAA0B;AAC1B,qBAA2C;AAC3C,yBAA2C;AAC3C,IAAO,+BAAQ,wBAAkB,2CAA2B,sBAAoB;AAC9E,SAAO,cAAc,yBAAU;AAAA,IAC7B,YAAY,OAAO;AACjB,YAAM,KAAK;AACX,WAAK,UAAU,KAAK,MAAM;AAC1B,WAAK,QAAQ;AAAA,QACX,gBAAgB;AAAA,QAChB,qBAAqB;AAAA,MACvB;AACA,WAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,IACvC;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,CAAC,MAAM;AACT;AAAA,MACF;AACA,WAAK,UAAU;AAAA,IACjB;AAAA,IACA,oBAAoB;AAClB,WAAK,mBAAmB;AAAA,IAC1B;AAAA,IACA,qBAAqB;AACnB,WAAK,mBAAmB;AAAA,IAC1B;AAAA,IACA,qBAAqB;AACnB,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,MACF,IAAI,KAAK;AACT,UAAI,KAAK,WAAW,CAAC,qBAAqB;AACxC,cAAM,oBAAoB,eAAe,KAAK,SAAS,KAAK,KAAK;AACjE,YAAI,KAAC,WAAAA,SAAc,mBAAmB,cAAc,GAAG;AACrD,eAAK,SAAS;AAAA,YACZ,gBAAgB;AAAA,YAChB,qBAAqB,OAAO,OAAO,iBAAiB,EAAE,MAAM,OAAO;AAAA,UACrE,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AACP,YAAM,mBAAgC,uCAAAC,KAAK,kBAAkB;AAAA,QAC3D,GAAG,KAAK;AAAA,QACR,GAAG,KAAK,MAAM;AAAA,MAChB,CAAC;AACD,aAAO,KAAK,MAAM,OAAO,mBAAgC,uCAAAC,MAAM,OAAO;AAAA,QACpE,KAAK,KAAK;AAAA,QACV,UAAU,CAAC,KAAK,kBAAkB,GAAG;AAAA,MACvC,CAAC;AAAA,IACH;AAAA,EACF;AACF,GAAG,oBAAoB;",
|
|
6
6
|
"names": ["fastDeepEqual", "_jsx", "_jsxs"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/components/src/context/context-system-provider.js
|
|
2
2
|
import deepmerge from "deepmerge";
|
|
3
|
-
import fastDeepEqual from "fast-deep-equal/es6";
|
|
3
|
+
import fastDeepEqual from "fast-deep-equal/es6/index.js";
|
|
4
4
|
import { isPlainObject } from "is-plain-object";
|
|
5
5
|
import { createContext, useContext, useRef, useMemo, memo } from "@wordpress/element";
|
|
6
6
|
import warn from "@wordpress/warning";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/context/context-system-provider.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useRef, useMemo, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComponentsContext = createContext(/** @type {Record<string, any>} */{});\nComponentsContext.displayName = 'ComponentsContext';\nexport const useComponentsContext = () => useContext(ComponentsContext);\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge({\n value\n}) {\n const parentContext = useComponentsContext();\n const valueRef = useRef(value);\n useUpdateEffect(() => {\n if (\n // Objects are equivalent.\n fastDeepEqual(valueRef.current, value) &&\n // But not the same reference.\n valueRef.current !== value) {\n globalThis.SCRIPT_DEBUG === true ? warn(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;\n }\n }, [value]);\n\n // `parentContext` will always be memoized (i.e., the result of this hook itself)\n // or the default value from when the `ComponentsContext` was originally\n // initialized (which will never change, it's a static variable)\n // so this memoization will prevent `deepmerge()` from rerunning unless\n // the references to `value` change OR the `parentContext` has an actual material change\n // (because again, it's guaranteed to be memoized or a static reference to the empty object\n // so we know that the only changes for `parentContext` are material ones... i.e., why we\n // don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n // need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n // correctly warning when the `value` isn't being properly memoized. All of that to say\n // that this should be super safe to assume that `useMemo` will only run on actual\n // changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n const config = useMemo(() => {\n // Deep clone `parentContext` to avoid mutating it later.\n return deepmerge(parentContext !== null && parentContext !== void 0 ? parentContext : {}, value !== null && value !== void 0 ? value : {}, {\n isMergeableObject: isPlainObject\n });\n }, [parentContext, value]);\n return config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ({\n children,\n value\n}) => {\n const contextValue = useContextSystemBridge({\n value\n });\n return /*#__PURE__*/_jsx(ComponentsContext.Provider, {\n value: contextValue,\n children: children\n });\n};\nexport const ContextSystemProvider = memo(BaseContextSystemProvider);"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useRef, useMemo, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComponentsContext = createContext(/** @type {Record<string, any>} */{});\nComponentsContext.displayName = 'ComponentsContext';\nexport const useComponentsContext = () => useContext(ComponentsContext);\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge({\n value\n}) {\n const parentContext = useComponentsContext();\n const valueRef = useRef(value);\n useUpdateEffect(() => {\n if (\n // Objects are equivalent.\n fastDeepEqual(valueRef.current, value) &&\n // But not the same reference.\n valueRef.current !== value) {\n globalThis.SCRIPT_DEBUG === true ? warn(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;\n }\n }, [value]);\n\n // `parentContext` will always be memoized (i.e., the result of this hook itself)\n // or the default value from when the `ComponentsContext` was originally\n // initialized (which will never change, it's a static variable)\n // so this memoization will prevent `deepmerge()` from rerunning unless\n // the references to `value` change OR the `parentContext` has an actual material change\n // (because again, it's guaranteed to be memoized or a static reference to the empty object\n // so we know that the only changes for `parentContext` are material ones... i.e., why we\n // don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n // need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n // correctly warning when the `value` isn't being properly memoized. All of that to say\n // that this should be super safe to assume that `useMemo` will only run on actual\n // changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n const config = useMemo(() => {\n // Deep clone `parentContext` to avoid mutating it later.\n return deepmerge(parentContext !== null && parentContext !== void 0 ? parentContext : {}, value !== null && value !== void 0 ? value : {}, {\n isMergeableObject: isPlainObject\n });\n }, [parentContext, value]);\n return config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ({\n children,\n value\n}) => {\n const contextValue = useContextSystemBridge({\n value\n });\n return /*#__PURE__*/_jsx(ComponentsContext.Provider, {\n value: contextValue,\n children: children\n });\n};\nexport const ContextSystemProvider = memo(BaseContextSystemProvider);"],
|
|
5
5
|
"mappings": ";AAGA,OAAO,eAAe;AACtB,OAAO,mBAAmB;AAC1B,SAAS,qBAAqB;AAK9B,SAAS,eAAe,YAAY,QAAQ,SAAS,YAAY;AACjE,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC,SAAS,OAAO,YAAY;AACrB,IAAM,oBAAoB;AAAA;AAAA,EAAgD,CAAC;AAAC;AACnF,kBAAkB,cAAc;AACzB,IAAM,uBAAuB,MAAM,WAAW,iBAAiB;AAWtE,SAAS,uBAAuB;AAAA,EAC9B;AACF,GAAG;AACD,QAAM,gBAAgB,qBAAqB;AAC3C,QAAM,WAAW,OAAO,KAAK;AAC7B,kBAAgB,MAAM;AACpB;AAAA;AAAA,MAEA,cAAc,SAAS,SAAS,KAAK;AAAA,MAErC,SAAS,YAAY;AAAA,MAAO;AAC1B,iBAAW,iBAAiB,OAAO,KAAK,gCAAgC,KAAK,UAAU,KAAK,CAAC,EAAE,IAAI;AAAA,IACrG;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAcV,QAAM,SAAS,QAAQ,MAAM;AAE3B,WAAO,UAAU,kBAAkB,QAAQ,kBAAkB,SAAS,gBAAgB,CAAC,GAAG,UAAU,QAAQ,UAAU,SAAS,QAAQ,CAAC,GAAG;AAAA,MACzI,mBAAmB;AAAA,IACrB,CAAC;AAAA,EACH,GAAG,CAAC,eAAe,KAAK,CAAC;AACzB,SAAO;AACT;AAmBA,IAAM,4BAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,uBAAuB;AAAA,IAC1C;AAAA,EACF,CAAC;AACD,SAAoB,qBAAK,kBAAkB,UAAU;AAAA,IACnD,OAAO;AAAA,IACP;AAAA,EACF,CAAC;AACH;AACO,IAAM,wBAAwB,KAAK,yBAAyB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// packages/components/src/duotone-picker/duotone-picker.tsx
|
|
2
|
-
import fastDeepEqual from "fast-deep-equal/es6";
|
|
2
|
+
import fastDeepEqual from "fast-deep-equal/es6/index.js";
|
|
3
3
|
import { useMemo } from "@wordpress/element";
|
|
4
4
|
import { __, sprintf } from "@wordpress/i18n";
|
|
5
5
|
import ColorListPicker from "./color-list-picker/index.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/duotone-picker/duotone-picker.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorListPicker from './color-list-picker';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport CustomDuotoneBar from './custom-duotone-bar';\nimport { getDefaultColors, getGradientFromCSSColors } from './utils';\nimport { Spacer } from '../spacer';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * ```jsx\n * import { DuotonePicker, DuotoneSwatch } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const DUOTONE_PALETTE = [\n * \t{ colors: [ '#8c00b7', '#fcff41' ], name: 'Purple and yellow', slug: 'purple-yellow' },\n * \t{ colors: [ '#000097', '#ff4747' ], name: 'Blue and red', slug: 'blue-red' },\n * ];\n *\n * const COLOR_PALETTE = [\n * \t{ color: '#ff4747', name: 'Red', slug: 'red' },\n * \t{ color: '#fcff41', name: 'Yellow', slug: 'yellow' },\n * \t{ color: '#000097', name: 'Blue', slug: 'blue' },\n * \t{ color: '#8c00b7', name: 'Purple', slug: 'purple' },\n * ];\n *\n * const Example = () => {\n * \tconst [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );\n * \treturn (\n * \t\t<>\n * \t\t\t<DuotonePicker\n * \t\t\t\tduotonePalette={ DUOTONE_PALETTE }\n * \t\t\t\tcolorPalette={ COLOR_PALETTE }\n * \t\t\t\tvalue={ duotone }\n * \t\t\t\tonChange={ setDuotone }\n * \t\t\t/>\n * \t\t\t<DuotoneSwatch values={ duotone } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nfunction DuotonePicker({\n asButtons,\n loop,\n clearable = true,\n unsetable = true,\n colorPalette,\n duotonePalette,\n disableCustomColors,\n disableCustomDuotone,\n value,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...otherProps\n}) {\n const [defaultDark, defaultLight] = useMemo(() => getDefaultColors(colorPalette), [colorPalette]);\n const isUnset = value === 'unset';\n const unsetOptionLabel = __('Unset');\n const unsetOption = /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: \"unset\",\n isSelected: isUnset,\n tooltipText: unsetOptionLabel,\n \"aria-label\": unsetOptionLabel,\n className: \"components-duotone-picker__color-indicator\",\n onClick: () => {\n onChange(isUnset ? undefined : 'unset');\n }\n }, \"unset\");\n const duotoneOptions = duotonePalette.map(({\n colors,\n slug,\n name\n }) => {\n const style = {\n background: getGradientFromCSSColors(colors, '135deg'),\n color: 'transparent'\n };\n const tooltipText = name !== null && name !== void 0 ? name : sprintf(\n // translators: %s: duotone code e.g: \"dark-grayscale\" or \"7f7f7f-ffffff\".\n __('Duotone code: %s'), slug);\n const label = name ? sprintf(\n // translators: %s: The name of the option e.g: \"Dark grayscale\".\n __('Duotone: %s'), name) : tooltipText;\n const isSelected = fastDeepEqual(colors, value);\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: colors,\n isSelected: isSelected,\n \"aria-label\": label,\n tooltipText: tooltipText,\n style: style,\n onClick: () => {\n onChange(isSelected ? undefined : colors);\n }\n }, slug);\n });\n const {\n metaProps,\n labelProps\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);\n const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;\n return /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...otherProps,\n ...metaProps,\n ...labelProps,\n options: options,\n actions: !!clearable && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: () => onChange(undefined),\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n }),\n children: /*#__PURE__*/_jsx(Spacer, {\n paddingTop: options.length === 0 ? 0 : 4,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 3,\n children: [!disableCustomColors && !disableCustomDuotone && /*#__PURE__*/_jsx(CustomDuotoneBar, {\n value: isUnset ? undefined : value,\n onChange: onChange\n }), !disableCustomDuotone && /*#__PURE__*/_jsx(ColorListPicker, {\n labels: [__('Shadows'), __('Highlights')],\n colors: colorPalette,\n value: isUnset ? undefined : value,\n disableCustomColors: disableCustomColors,\n enableAlpha: true,\n onChange: newColors => {\n if (!newColors[0]) {\n newColors[0] = defaultDark;\n }\n if (!newColors[1]) {\n newColors[1] = defaultLight;\n }\n const newValue = newColors.length >= 2 ? newColors : undefined;\n // @ts-expect-error TODO: The color arrays for a DuotonePicker should be a tuple of two colors,\n // but it's currently typed as a string[].\n // See also https://github.com/WordPress/gutenberg/pull/49060#discussion_r1136951035\n onChange(newValue);\n }\n })]\n })\n })\n });\n}\nexport default DuotonePicker;"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorListPicker from './color-list-picker';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport CustomDuotoneBar from './custom-duotone-bar';\nimport { getDefaultColors, getGradientFromCSSColors } from './utils';\nimport { Spacer } from '../spacer';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * ```jsx\n * import { DuotonePicker, DuotoneSwatch } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const DUOTONE_PALETTE = [\n * \t{ colors: [ '#8c00b7', '#fcff41' ], name: 'Purple and yellow', slug: 'purple-yellow' },\n * \t{ colors: [ '#000097', '#ff4747' ], name: 'Blue and red', slug: 'blue-red' },\n * ];\n *\n * const COLOR_PALETTE = [\n * \t{ color: '#ff4747', name: 'Red', slug: 'red' },\n * \t{ color: '#fcff41', name: 'Yellow', slug: 'yellow' },\n * \t{ color: '#000097', name: 'Blue', slug: 'blue' },\n * \t{ color: '#8c00b7', name: 'Purple', slug: 'purple' },\n * ];\n *\n * const Example = () => {\n * \tconst [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );\n * \treturn (\n * \t\t<>\n * \t\t\t<DuotonePicker\n * \t\t\t\tduotonePalette={ DUOTONE_PALETTE }\n * \t\t\t\tcolorPalette={ COLOR_PALETTE }\n * \t\t\t\tvalue={ duotone }\n * \t\t\t\tonChange={ setDuotone }\n * \t\t\t/>\n * \t\t\t<DuotoneSwatch values={ duotone } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nfunction DuotonePicker({\n asButtons,\n loop,\n clearable = true,\n unsetable = true,\n colorPalette,\n duotonePalette,\n disableCustomColors,\n disableCustomDuotone,\n value,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...otherProps\n}) {\n const [defaultDark, defaultLight] = useMemo(() => getDefaultColors(colorPalette), [colorPalette]);\n const isUnset = value === 'unset';\n const unsetOptionLabel = __('Unset');\n const unsetOption = /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: \"unset\",\n isSelected: isUnset,\n tooltipText: unsetOptionLabel,\n \"aria-label\": unsetOptionLabel,\n className: \"components-duotone-picker__color-indicator\",\n onClick: () => {\n onChange(isUnset ? undefined : 'unset');\n }\n }, \"unset\");\n const duotoneOptions = duotonePalette.map(({\n colors,\n slug,\n name\n }) => {\n const style = {\n background: getGradientFromCSSColors(colors, '135deg'),\n color: 'transparent'\n };\n const tooltipText = name !== null && name !== void 0 ? name : sprintf(\n // translators: %s: duotone code e.g: \"dark-grayscale\" or \"7f7f7f-ffffff\".\n __('Duotone code: %s'), slug);\n const label = name ? sprintf(\n // translators: %s: The name of the option e.g: \"Dark grayscale\".\n __('Duotone: %s'), name) : tooltipText;\n const isSelected = fastDeepEqual(colors, value);\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: colors,\n isSelected: isSelected,\n \"aria-label\": label,\n tooltipText: tooltipText,\n style: style,\n onClick: () => {\n onChange(isSelected ? undefined : colors);\n }\n }, slug);\n });\n const {\n metaProps,\n labelProps\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);\n const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;\n return /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...otherProps,\n ...metaProps,\n ...labelProps,\n options: options,\n actions: !!clearable && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: () => onChange(undefined),\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n }),\n children: /*#__PURE__*/_jsx(Spacer, {\n paddingTop: options.length === 0 ? 0 : 4,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 3,\n children: [!disableCustomColors && !disableCustomDuotone && /*#__PURE__*/_jsx(CustomDuotoneBar, {\n value: isUnset ? undefined : value,\n onChange: onChange\n }), !disableCustomDuotone && /*#__PURE__*/_jsx(ColorListPicker, {\n labels: [__('Shadows'), __('Highlights')],\n colors: colorPalette,\n value: isUnset ? undefined : value,\n disableCustomColors: disableCustomColors,\n enableAlpha: true,\n onChange: newColors => {\n if (!newColors[0]) {\n newColors[0] = defaultDark;\n }\n if (!newColors[1]) {\n newColors[1] = defaultLight;\n }\n const newValue = newColors.length >= 2 ? newColors : undefined;\n // @ts-expect-error TODO: The color arrays for a DuotonePicker should be a tuple of two colors,\n // but it's currently typed as a string[].\n // See also https://github.com/WordPress/gutenberg/pull/49060#discussion_r1136951035\n onChange(newValue);\n }\n })]\n })\n })\n });\n}\nexport default DuotonePicker;"],
|
|
5
5
|
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// packages/components/src/higher-order/with-fallback-styles/index.tsx
|
|
2
|
-
import fastDeepEqual from "fast-deep-equal/es6";
|
|
2
|
+
import fastDeepEqual from "fast-deep-equal/es6/index.js";
|
|
3
3
|
import { Component } from "@wordpress/element";
|
|
4
4
|
import { createHigherOrderComponent } from "@wordpress/compose";
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/higher-order/with-fallback-styles/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default mapNodeToProps => createHigherOrderComponent(WrappedComponent => {\n return class extends Component {\n constructor(props) {\n super(props);\n this.nodeRef = this.props.node;\n this.state = {\n fallbackStyles: undefined,\n grabStylesCompleted: false\n };\n this.bindRef = this.bindRef.bind(this);\n }\n bindRef(node) {\n if (!node) {\n return;\n }\n this.nodeRef = node;\n }\n componentDidMount() {\n this.grabFallbackStyles();\n }\n componentDidUpdate() {\n this.grabFallbackStyles();\n }\n grabFallbackStyles() {\n const {\n grabStylesCompleted,\n fallbackStyles\n } = this.state;\n if (this.nodeRef && !grabStylesCompleted) {\n const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);\n if (!fastDeepEqual(newFallbackStyles, fallbackStyles)) {\n this.setState({\n fallbackStyles: newFallbackStyles,\n grabStylesCompleted: Object.values(newFallbackStyles).every(Boolean)\n });\n }\n }\n }\n render() {\n const wrappedComponent = /*#__PURE__*/_jsx(WrappedComponent, {\n ...this.props,\n ...this.state.fallbackStyles\n });\n return this.props.node ? wrappedComponent : /*#__PURE__*/_jsxs(\"div\", {\n ref: this.bindRef,\n children: [\" \", wrappedComponent, \" \"]\n });\n }\n };\n}, 'withFallbackStyles');"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default mapNodeToProps => createHigherOrderComponent(WrappedComponent => {\n return class extends Component {\n constructor(props) {\n super(props);\n this.nodeRef = this.props.node;\n this.state = {\n fallbackStyles: undefined,\n grabStylesCompleted: false\n };\n this.bindRef = this.bindRef.bind(this);\n }\n bindRef(node) {\n if (!node) {\n return;\n }\n this.nodeRef = node;\n }\n componentDidMount() {\n this.grabFallbackStyles();\n }\n componentDidUpdate() {\n this.grabFallbackStyles();\n }\n grabFallbackStyles() {\n const {\n grabStylesCompleted,\n fallbackStyles\n } = this.state;\n if (this.nodeRef && !grabStylesCompleted) {\n const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);\n if (!fastDeepEqual(newFallbackStyles, fallbackStyles)) {\n this.setState({\n fallbackStyles: newFallbackStyles,\n grabStylesCompleted: Object.values(newFallbackStyles).every(Boolean)\n });\n }\n }\n }\n render() {\n const wrappedComponent = /*#__PURE__*/_jsx(WrappedComponent, {\n ...this.props,\n ...this.state.fallbackStyles\n });\n return this.props.node ? wrappedComponent : /*#__PURE__*/_jsxs(\"div\", {\n ref: this.bindRef,\n children: [\" \", wrappedComponent, \" \"]\n });\n }\n };\n}, 'withFallbackStyles');"],
|
|
5
5
|
"mappings": ";AAGA,OAAO,mBAAmB;AAK1B,SAAS,iBAAiB;AAC1B,SAAS,kCAAkC;AAC3C,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,IAAO,+BAAQ,oBAAkB,2BAA2B,sBAAoB;AAC9E,SAAO,cAAc,UAAU;AAAA,IAC7B,YAAY,OAAO;AACjB,YAAM,KAAK;AACX,WAAK,UAAU,KAAK,MAAM;AAC1B,WAAK,QAAQ;AAAA,QACX,gBAAgB;AAAA,QAChB,qBAAqB;AAAA,MACvB;AACA,WAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,IACvC;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,CAAC,MAAM;AACT;AAAA,MACF;AACA,WAAK,UAAU;AAAA,IACjB;AAAA,IACA,oBAAoB;AAClB,WAAK,mBAAmB;AAAA,IAC1B;AAAA,IACA,qBAAqB;AACnB,WAAK,mBAAmB;AAAA,IAC1B;AAAA,IACA,qBAAqB;AACnB,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,MACF,IAAI,KAAK;AACT,UAAI,KAAK,WAAW,CAAC,qBAAqB;AACxC,cAAM,oBAAoB,eAAe,KAAK,SAAS,KAAK,KAAK;AACjE,YAAI,CAAC,cAAc,mBAAmB,cAAc,GAAG;AACrD,eAAK,SAAS;AAAA,YACZ,gBAAgB;AAAA,YAChB,qBAAqB,OAAO,OAAO,iBAAiB,EAAE,MAAM,OAAO;AAAA,UACrE,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AACP,YAAM,mBAAgC,qBAAK,kBAAkB;AAAA,QAC3D,GAAG,KAAK;AAAA,QACR,GAAG,KAAK,MAAM;AAAA,MAChB,CAAC;AACD,aAAO,KAAK,MAAM,OAAO,mBAAgC,sBAAM,OAAO;AAAA,QACpE,KAAK,KAAK;AAAA,QACV,UAAU,CAAC,KAAK,kBAAkB,GAAG;AAAA,MACvC,CAAC;AAAA,IACH;AAAA,EACF;AACF,GAAG,oBAAoB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -110,7 +110,7 @@ export declare function useBorderBoxControl(props: WordPressComponentProps<Borde
|
|
|
110
110
|
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
111
111
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
112
112
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
113
|
-
onBeforeInput?: import("react").
|
|
113
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
114
114
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
115
115
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
116
116
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -160,8 +160,6 @@ export declare function useBorderBoxControl(props: WordPressComponentProps<Borde
|
|
|
160
160
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
161
161
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
162
162
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
163
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
164
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
165
163
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
166
164
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
167
165
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -255,11 +253,13 @@ export declare function useBorderBoxControl(props: WordPressComponentProps<Borde
|
|
|
255
253
|
defaultChecked?: boolean | undefined | undefined;
|
|
256
254
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
257
255
|
accessKey?: string | undefined | undefined;
|
|
256
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
258
257
|
autoFocus?: boolean | undefined | undefined;
|
|
259
258
|
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
260
259
|
contextMenu?: string | undefined | undefined;
|
|
261
260
|
dir?: string | undefined | undefined;
|
|
262
261
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
262
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
263
263
|
nonce?: string | undefined | undefined;
|
|
264
264
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
265
265
|
radioGroup?: string | undefined | undefined;
|
|
@@ -273,7 +273,6 @@ export declare function useBorderBoxControl(props: WordPressComponentProps<Borde
|
|
|
273
273
|
rev?: string | undefined | undefined;
|
|
274
274
|
typeof?: string | undefined | undefined;
|
|
275
275
|
vocab?: string | undefined | undefined;
|
|
276
|
-
autoCapitalize?: string | undefined | undefined;
|
|
277
276
|
autoCorrect?: string | undefined | undefined;
|
|
278
277
|
autoSave?: string | undefined | undefined;
|
|
279
278
|
itemProp?: string | undefined | undefined;
|
|
@@ -286,6 +285,8 @@ export declare function useBorderBoxControl(props: WordPressComponentProps<Borde
|
|
|
286
285
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
287
286
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
288
287
|
is?: string | undefined | undefined;
|
|
288
|
+
exportparts?: string | undefined | undefined;
|
|
289
|
+
part?: string | undefined | undefined;
|
|
289
290
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
290
291
|
};
|
|
291
292
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/border-box-control/hook.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAK7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE3E,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,uBAAuB,CAAE,qBAAqB,EAAE,KAAK,CAAE;;;;;;;;;iCAyCzB,MAAM;+BAuC/B,MAAM,GAAG,SAAS,QACvB,UAAU
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/border-box-control/hook.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAK7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE3E,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,uBAAuB,CAAE,qBAAqB,EAAE,KAAK,CAAE;;;;;;;;;iCAyCzB,MAAM;+BAuC/B,MAAM,GAAG,SAAS,QACvB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CjB"}
|
|
@@ -97,7 +97,7 @@ export declare function useBorderBoxControlLinkedButton(props: WordPressComponen
|
|
|
97
97
|
onBlur?: import("react").FocusEventHandler<HTMLButtonElement> | undefined;
|
|
98
98
|
onBlurCapture?: import("react").FocusEventHandler<HTMLButtonElement> | undefined;
|
|
99
99
|
onChangeCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
100
|
-
onBeforeInput?: import("react").
|
|
100
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLButtonElement> | undefined;
|
|
101
101
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
102
102
|
onInput?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
103
103
|
onInputCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
@@ -147,8 +147,6 @@ export declare function useBorderBoxControlLinkedButton(props: WordPressComponen
|
|
|
147
147
|
onProgressCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
148
148
|
onRateChange?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
149
149
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
150
|
-
onResize?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
151
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
152
150
|
onSeeked?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
153
151
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
154
152
|
onSeeking?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
@@ -241,11 +239,13 @@ export declare function useBorderBoxControlLinkedButton(props: WordPressComponen
|
|
|
241
239
|
defaultChecked?: boolean | undefined | undefined;
|
|
242
240
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
243
241
|
accessKey?: string | undefined | undefined;
|
|
242
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
244
243
|
autoFocus?: boolean | undefined | undefined;
|
|
245
244
|
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
246
245
|
contextMenu?: string | undefined | undefined;
|
|
247
246
|
dir?: string | undefined | undefined;
|
|
248
247
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
248
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
249
249
|
nonce?: string | undefined | undefined;
|
|
250
250
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
251
251
|
radioGroup?: string | undefined | undefined;
|
|
@@ -259,7 +259,6 @@ export declare function useBorderBoxControlLinkedButton(props: WordPressComponen
|
|
|
259
259
|
rev?: string | undefined | undefined;
|
|
260
260
|
typeof?: string | undefined | undefined;
|
|
261
261
|
vocab?: string | undefined | undefined;
|
|
262
|
-
autoCapitalize?: string | undefined | undefined;
|
|
263
262
|
autoCorrect?: string | undefined | undefined;
|
|
264
263
|
autoSave?: string | undefined | undefined;
|
|
265
264
|
itemProp?: string | undefined | undefined;
|
|
@@ -272,6 +271,8 @@ export declare function useBorderBoxControlLinkedButton(props: WordPressComponen
|
|
|
272
271
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
273
272
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
274
273
|
is?: string | undefined | undefined;
|
|
274
|
+
exportparts?: string | undefined | undefined;
|
|
275
|
+
part?: string | undefined | undefined;
|
|
275
276
|
formAction?: string | undefined;
|
|
276
277
|
formEncType?: string | undefined | undefined;
|
|
277
278
|
formMethod?: string | undefined | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/border-box-control-linked-button/hook.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,+BAA+B,CAC9C,KAAK,EAAE,uBAAuB,CAAE,iBAAiB,EAAE,QAAQ,CAAE
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/border-box-control-linked-button/hook.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,+BAA+B,CAC9C,KAAK,EAAE,uBAAuB,CAAE,iBAAiB,EAAE,QAAQ,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe7D"}
|
|
@@ -101,7 +101,7 @@ export declare function useBorderBoxControlSplitControls(props: WordPressCompone
|
|
|
101
101
|
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
102
102
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
103
103
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
104
|
-
onBeforeInput?: import("react").
|
|
104
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
105
105
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
106
106
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
107
107
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -151,8 +151,6 @@ export declare function useBorderBoxControlSplitControls(props: WordPressCompone
|
|
|
151
151
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
152
152
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
153
153
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
154
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
155
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
156
154
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
157
155
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
158
156
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -246,11 +244,13 @@ export declare function useBorderBoxControlSplitControls(props: WordPressCompone
|
|
|
246
244
|
defaultChecked?: boolean | undefined | undefined;
|
|
247
245
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
248
246
|
accessKey?: string | undefined | undefined;
|
|
247
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
249
248
|
autoFocus?: boolean | undefined | undefined;
|
|
250
249
|
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
251
250
|
contextMenu?: string | undefined | undefined;
|
|
252
251
|
dir?: string | undefined | undefined;
|
|
253
252
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
253
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
254
254
|
nonce?: string | undefined | undefined;
|
|
255
255
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
256
256
|
radioGroup?: string | undefined | undefined;
|
|
@@ -264,7 +264,6 @@ export declare function useBorderBoxControlSplitControls(props: WordPressCompone
|
|
|
264
264
|
rev?: string | undefined | undefined;
|
|
265
265
|
typeof?: string | undefined | undefined;
|
|
266
266
|
vocab?: string | undefined | undefined;
|
|
267
|
-
autoCapitalize?: string | undefined | undefined;
|
|
268
267
|
autoCorrect?: string | undefined | undefined;
|
|
269
268
|
autoSave?: string | undefined | undefined;
|
|
270
269
|
itemProp?: string | undefined | undefined;
|
|
@@ -277,6 +276,8 @@ export declare function useBorderBoxControlSplitControls(props: WordPressCompone
|
|
|
277
276
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
278
277
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
279
278
|
is?: string | undefined | undefined;
|
|
279
|
+
exportparts?: string | undefined | undefined;
|
|
280
|
+
part?: string | undefined | undefined;
|
|
280
281
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
281
282
|
};
|
|
282
283
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/border-box-control-split-controls/hook.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,wBAAgB,gCAAgC,CAC/C,KAAK,EAAE,uBAAuB,CAAE,kBAAkB,EAAE,KAAK,CAAE
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/border-box-control-split-controls/hook.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,wBAAgB,gCAAgC,CAC/C,KAAK,EAAE,uBAAuB,CAAE,kBAAkB,EAAE,KAAK,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqC3D"}
|
|
@@ -91,7 +91,7 @@ export declare function useBorderBoxControlVisualizer(props: WordPressComponentP
|
|
|
91
91
|
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
92
92
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
93
93
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
94
|
-
onBeforeInput?: import("react").
|
|
94
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
95
95
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
96
96
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
97
97
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -141,8 +141,6 @@ export declare function useBorderBoxControlVisualizer(props: WordPressComponentP
|
|
|
141
141
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
142
142
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
143
143
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
144
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
145
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
146
144
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
147
145
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
148
146
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -236,11 +234,13 @@ export declare function useBorderBoxControlVisualizer(props: WordPressComponentP
|
|
|
236
234
|
defaultChecked?: boolean | undefined | undefined;
|
|
237
235
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
238
236
|
accessKey?: string | undefined | undefined;
|
|
237
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
239
238
|
autoFocus?: boolean | undefined | undefined;
|
|
240
239
|
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
241
240
|
contextMenu?: string | undefined | undefined;
|
|
242
241
|
dir?: string | undefined | undefined;
|
|
243
242
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
243
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
244
244
|
nonce?: string | undefined | undefined;
|
|
245
245
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
246
246
|
radioGroup?: string | undefined | undefined;
|
|
@@ -254,7 +254,6 @@ export declare function useBorderBoxControlVisualizer(props: WordPressComponentP
|
|
|
254
254
|
rev?: string | undefined | undefined;
|
|
255
255
|
typeof?: string | undefined | undefined;
|
|
256
256
|
vocab?: string | undefined | undefined;
|
|
257
|
-
autoCapitalize?: string | undefined | undefined;
|
|
258
257
|
autoCorrect?: string | undefined | undefined;
|
|
259
258
|
autoSave?: string | undefined | undefined;
|
|
260
259
|
itemProp?: string | undefined | undefined;
|
|
@@ -267,6 +266,8 @@ export declare function useBorderBoxControlVisualizer(props: WordPressComponentP
|
|
|
267
266
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
268
267
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
269
268
|
is?: string | undefined | undefined;
|
|
269
|
+
exportparts?: string | undefined | undefined;
|
|
270
|
+
part?: string | undefined | undefined;
|
|
270
271
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
271
272
|
};
|
|
272
273
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/border-box-control-visualizer/hook.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,uBAAuB,CAAE,eAAe,EAAE,KAAK,CAAE
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/border-box-control-visualizer/hook.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,uBAAuB,CAAE,eAAe,EAAE,KAAK,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBxD"}
|
|
@@ -114,7 +114,7 @@ export declare function useBorderControl(props: WordPressComponentProps<BorderCo
|
|
|
114
114
|
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
115
115
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
116
116
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
117
|
-
onBeforeInput?: import("react").
|
|
117
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
118
118
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
119
119
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
120
120
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -164,8 +164,6 @@ export declare function useBorderControl(props: WordPressComponentProps<BorderCo
|
|
|
164
164
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
165
165
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
166
166
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
167
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
168
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
169
167
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
170
168
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
171
169
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -259,11 +257,13 @@ export declare function useBorderControl(props: WordPressComponentProps<BorderCo
|
|
|
259
257
|
defaultChecked?: boolean | undefined | undefined;
|
|
260
258
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
261
259
|
accessKey?: string | undefined | undefined;
|
|
260
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
262
261
|
autoFocus?: boolean | undefined | undefined;
|
|
263
262
|
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
264
263
|
contextMenu?: string | undefined | undefined;
|
|
265
264
|
dir?: string | undefined | undefined;
|
|
266
265
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
266
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
267
267
|
nonce?: string | undefined | undefined;
|
|
268
268
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
269
269
|
radioGroup?: string | undefined | undefined;
|
|
@@ -277,7 +277,6 @@ export declare function useBorderControl(props: WordPressComponentProps<BorderCo
|
|
|
277
277
|
rev?: string | undefined | undefined;
|
|
278
278
|
typeof?: string | undefined | undefined;
|
|
279
279
|
vocab?: string | undefined | undefined;
|
|
280
|
-
autoCapitalize?: string | undefined | undefined;
|
|
281
280
|
autoCorrect?: string | undefined | undefined;
|
|
282
281
|
autoSave?: string | undefined | undefined;
|
|
283
282
|
itemProp?: string | undefined | undefined;
|
|
@@ -290,6 +289,8 @@ export declare function useBorderControl(props: WordPressComponentProps<BorderCo
|
|
|
290
289
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
291
290
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
292
291
|
is?: string | undefined | undefined;
|
|
292
|
+
exportparts?: string | undefined | undefined;
|
|
293
|
+
part?: string | undefined | undefined;
|
|
293
294
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
294
295
|
};
|
|
295
296
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-control/border-control/hook.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAW3D,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,uBAAuB,CAAE,kBAAkB,EAAE,KAAK,CAAE;;;;;;;;iCA2C5C,MAAM;6BAwDV,MAAM;+BA7CH,MAAM
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-control/border-control/hook.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAW3D,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,uBAAuB,CAAE,kBAAkB,EAAE,KAAK,CAAE;;;;;;;;iCA2C5C,MAAM;6BAwDV,MAAM;+BA7CH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+FpB"}
|
|
@@ -107,7 +107,7 @@ export declare function useBorderControlDropdown(props: WordPressComponentProps<
|
|
|
107
107
|
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
108
108
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
109
109
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
110
|
-
onBeforeInput?: import("react").
|
|
110
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
111
111
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
112
112
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
113
113
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -156,8 +156,6 @@ export declare function useBorderControlDropdown(props: WordPressComponentProps<
|
|
|
156
156
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
157
157
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
158
158
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
159
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
160
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
161
159
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
162
160
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
163
161
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -251,11 +249,13 @@ export declare function useBorderControlDropdown(props: WordPressComponentProps<
|
|
|
251
249
|
defaultChecked?: boolean | undefined | undefined;
|
|
252
250
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
253
251
|
accessKey?: string | undefined | undefined;
|
|
252
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
254
253
|
autoFocus?: boolean | undefined | undefined;
|
|
255
254
|
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
256
255
|
contextMenu?: string | undefined | undefined;
|
|
257
256
|
dir?: string | undefined | undefined;
|
|
258
257
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
258
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
259
259
|
nonce?: string | undefined | undefined;
|
|
260
260
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
261
261
|
radioGroup?: string | undefined | undefined;
|
|
@@ -269,7 +269,6 @@ export declare function useBorderControlDropdown(props: WordPressComponentProps<
|
|
|
269
269
|
rev?: string | undefined | undefined;
|
|
270
270
|
typeof?: string | undefined | undefined;
|
|
271
271
|
vocab?: string | undefined | undefined;
|
|
272
|
-
autoCapitalize?: string | undefined | undefined;
|
|
273
272
|
autoCorrect?: string | undefined | undefined;
|
|
274
273
|
autoSave?: string | undefined | undefined;
|
|
275
274
|
itemProp?: string | undefined | undefined;
|
|
@@ -282,6 +281,8 @@ export declare function useBorderControlDropdown(props: WordPressComponentProps<
|
|
|
282
281
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
283
282
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
284
283
|
is?: string | undefined | undefined;
|
|
284
|
+
exportparts?: string | undefined | undefined;
|
|
285
|
+
part?: string | undefined | undefined;
|
|
285
286
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
286
287
|
};
|
|
287
288
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-control/border-control-dropdown/hook.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,CAAE;;;;;;;;4BAkBtB,MAAM;4BAQN,MAAM
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/border-control/border-control-dropdown/hook.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,CAAE;;;;;;;;4BAkBtB,MAAM;4BAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDtC"}
|