@wordpress/block-editor 12.12.0 → 12.13.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 +12 -10
- package/README.md +35 -3
- package/build/components/block-alignment-control/use-available-alignments.js +30 -28
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-list/block.native.js +4 -4
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/layout.js +2 -3
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/border-radius-control/index.js +3 -2
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +6 -6
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/colors/with-colors.js +2 -8
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +6 -7
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +5 -13
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/font-family/index.js +2 -3
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/font-size-picker.js +3 -5
- package/build/components/font-sizes/font-size-picker.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +3 -4
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +7 -8
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -2
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/gradients/use-gradient.js +2 -5
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/height-control/index.js +3 -3
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/index.js +9 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +9 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +3 -3
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/link-control/search-item.js +11 -0
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +2 -1
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +10 -5
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +1 -1
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +6 -3
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/unit-control/index.js +3 -3
- package/build/components/unit-control/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +6 -1
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-settings/index.js +212 -0
- package/build/components/use-settings/index.js.map +1 -0
- package/build/hooks/align.js +51 -35
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +37 -32
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +4 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/color.js +2 -4
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/duotone.js +10 -9
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-size.js +4 -4
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/layout.js +10 -11
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js +3 -3
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/position.js +2 -3
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-color-props.js +3 -11
- package/build/hooks/use-color-props.js.map +1 -1
- package/build/hooks/utils.js +1 -42
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +3 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/utils/object.js +4 -1
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +19 -24
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +30 -28
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-list/block.native.js +4 -4
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/layout.js +2 -2
- package/build-module/components/block-list/layout.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +3 -2
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +6 -5
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/colors/with-colors.js +2 -7
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +6 -7
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +5 -12
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/font-family/index.js +2 -2
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/font-size-picker.js +3 -4
- package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +3 -3
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +7 -8
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +2 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +2 -4
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/height-control/index.js +3 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +3 -2
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/link-control/search-item.js +12 -1
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +2 -1
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +10 -5
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +1 -1
- package/build-module/components/resizable-box-popover/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +6 -2
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -2
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/unit-control/index.js +3 -2
- package/build-module/components/unit-control/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +5 -1
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +203 -0
- package/build-module/components/use-settings/index.js.map +1 -0
- package/build-module/hooks/align.js +51 -35
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +37 -32
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +4 -4
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/color.js +2 -4
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/duotone.js +11 -10
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-size.js +4 -4
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/layout.js +10 -11
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.js +3 -3
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/position.js +2 -3
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-color-props.js +3 -11
- package/build-module/hooks/use-color-props.js.map +1 -1
- package/build-module/hooks/utils.js +2 -43
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +3 -2
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/utils/object.js +3 -1
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +20 -24
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/style-rtl.css +13 -6
- package/build-style/style.css +13 -6
- package/package.json +36 -34
- package/src/components/block-alignment-control/use-available-alignments.js +49 -34
- package/src/components/block-list/block.native.js +4 -4
- package/src/components/block-list/layout.js +2 -2
- package/src/components/block-styles/style.scss +1 -1
- package/src/components/border-radius-control/index.js +3 -2
- package/src/components/color-palette/with-color-context.js +9 -9
- package/src/components/colors/with-colors.js +6 -7
- package/src/components/colors-gradients/control.js +10 -7
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +29 -15
- package/src/components/font-family/index.js +2 -2
- package/src/components/font-sizes/font-size-picker.js +6 -4
- package/src/components/font-sizes/with-font-sizes.js +3 -5
- package/src/components/global-styles/filters-panel.js +9 -15
- package/src/components/global-styles/image-settings-panel.js +2 -2
- package/src/components/global-styles/typography-panel.js +1 -1
- package/src/components/gradients/use-gradient.js +10 -4
- package/src/components/height-control/index.js +3 -2
- package/src/components/index.js +1 -1
- package/src/components/index.native.js +1 -1
- package/src/components/inner-blocks/index.js +2 -2
- package/src/components/inserter/style.scss +9 -1
- package/src/components/letter-spacing-control/index.js +3 -2
- package/src/components/link-control/search-item.js +14 -0
- package/src/components/link-control/search-results.js +1 -0
- package/src/components/link-control/use-search-handler.js +22 -15
- package/src/components/resizable-box-popover/index.js +1 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +7 -5
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -2
- package/src/components/unit-control/index.js +3 -8
- package/src/components/use-block-commands/index.js +2 -1
- package/src/components/{use-setting → use-settings}/README.md +9 -10
- package/src/components/use-settings/index.js +272 -0
- package/src/components/{use-setting → use-settings}/test/index.js +47 -5
- package/src/hooks/align.js +79 -54
- package/src/hooks/anchor.js +75 -65
- package/src/hooks/background.js +7 -9
- package/src/hooks/color.js +7 -4
- package/src/hooks/duotone.js +24 -19
- package/src/hooks/font-size.js +4 -4
- package/src/hooks/layout.js +11 -11
- package/src/hooks/line-height.js +3 -3
- package/src/hooks/position.js +5 -3
- package/src/hooks/use-color-props.js +21 -14
- package/src/hooks/utils.js +88 -43
- package/src/layouts/constrained.js +3 -8
- package/src/utils/object.js +4 -1
- package/src/utils/test/__snapshots__/transform-styles.js.snap +103 -0
- package/src/utils/test/transform-styles.js +217 -0
- package/src/utils/transform-styles/index.js +25 -25
- package/build/components/use-setting/index.js +0 -161
- package/build/components/use-setting/index.js.map +0 -1
- package/build/utils/transform-styles/ast/index.js +0 -21
- package/build/utils/transform-styles/ast/index.js.map +0 -1
- package/build/utils/transform-styles/ast/parse.js +0 -660
- package/build/utils/transform-styles/ast/parse.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/compiler.js +0 -52
- package/build/utils/transform-styles/ast/stringify/compiler.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/compress.js +0 -178
- package/build/utils/transform-styles/ast/stringify/compress.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/identity.js +0 -207
- package/build/utils/transform-styles/ast/stringify/identity.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/index.js +0 -36
- package/build/utils/transform-styles/ast/stringify/index.js.map +0 -1
- package/build/utils/transform-styles/transforms/url-rewrite.js +0 -130
- package/build/utils/transform-styles/transforms/url-rewrite.js.map +0 -1
- package/build/utils/transform-styles/transforms/wrap.js +0 -59
- package/build/utils/transform-styles/transforms/wrap.js.map +0 -1
- package/build/utils/transform-styles/traverse.js +0 -37
- package/build/utils/transform-styles/traverse.js.map +0 -1
- package/build-module/components/use-setting/index.js +0 -154
- package/build-module/components/use-setting/index.js.map +0 -1
- package/build-module/utils/transform-styles/ast/index.js +0 -6
- package/build-module/utils/transform-styles/ast/index.js.map +0 -1
- package/build-module/utils/transform-styles/ast/parse.js +0 -654
- package/build-module/utils/transform-styles/ast/parse.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/compiler.js +0 -49
- package/build-module/utils/transform-styles/ast/stringify/compiler.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/compress.js +0 -176
- package/build-module/utils/transform-styles/ast/stringify/compress.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/identity.js +0 -206
- package/build-module/utils/transform-styles/ast/stringify/identity.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/index.js +0 -29
- package/build-module/utils/transform-styles/ast/stringify/index.js.map +0 -1
- package/build-module/utils/transform-styles/transforms/url-rewrite.js +0 -123
- package/build-module/utils/transform-styles/transforms/url-rewrite.js.map +0 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +0 -52
- package/build-module/utils/transform-styles/transforms/wrap.js.map +0 -1
- package/build-module/utils/transform-styles/traverse.js +0 -28
- package/build-module/utils/transform-styles/traverse.js.map +0 -1
- package/src/components/use-setting/index.js +0 -218
- package/src/utils/transform-styles/ast/index.js +0 -5
- package/src/utils/transform-styles/ast/parse.js +0 -732
- package/src/utils/transform-styles/ast/stringify/compiler.js +0 -50
- package/src/utils/transform-styles/ast/stringify/compress.js +0 -238
- package/src/utils/transform-styles/ast/stringify/identity.js +0 -286
- package/src/utils/transform-styles/ast/stringify/index.js +0 -32
- package/src/utils/transform-styles/test/__snapshots__/traverse.js.snap +0 -7
- package/src/utils/transform-styles/test/traverse.js +0 -24
- package/src/utils/transform-styles/transforms/test/__snapshots__/url-rewrite.js.snap +0 -25
- package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +0 -64
- package/src/utils/transform-styles/transforms/test/url-rewrite.js +0 -39
- package/src/utils/transform-styles/transforms/test/wrap.js +0 -95
- package/src/utils/transform-styles/transforms/url-rewrite.js +0 -139
- package/src/utils/transform-styles/transforms/wrap.js +0 -56
- package/src/utils/transform-styles/traverse.js +0 -32
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Return `true` if the given path is http/https.
|
|
9
|
-
*
|
|
10
|
-
* @param {string} filePath path
|
|
11
|
-
*
|
|
12
|
-
* @return {boolean} is remote path.
|
|
13
|
-
*/
|
|
14
|
-
function isRemotePath(filePath) {
|
|
15
|
-
return /^(?:https?:)?\/\//.test(filePath);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Return `true` if the given filePath is an absolute url.
|
|
20
|
-
*
|
|
21
|
-
* @param {string} filePath path
|
|
22
|
-
*
|
|
23
|
-
* @return {boolean} is absolute path.
|
|
24
|
-
*/
|
|
25
|
-
function isAbsolutePath(filePath) {
|
|
26
|
-
return /^\/(?!\/)/.test(filePath);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Whether or not the url should be inluded.
|
|
31
|
-
*
|
|
32
|
-
* @param {Object} meta url meta info
|
|
33
|
-
*
|
|
34
|
-
* @return {boolean} is valid.
|
|
35
|
-
*/
|
|
36
|
-
function isValidURL(meta) {
|
|
37
|
-
// Ignore hashes or data uris.
|
|
38
|
-
if (meta.value.indexOf('data:') === 0 || meta.value.indexOf('#') === 0) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
if (isAbsolutePath(meta.value)) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Do not handle the http/https urls if `includeRemote` is false.
|
|
46
|
-
if (isRemotePath(meta.value)) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Get the absolute path of the url, relative to the basePath
|
|
54
|
-
*
|
|
55
|
-
* @param {string} str the url
|
|
56
|
-
* @param {string} baseURL base URL
|
|
57
|
-
*
|
|
58
|
-
* @return {string} the full path to the file
|
|
59
|
-
*/
|
|
60
|
-
function getResourcePath(str, baseURL) {
|
|
61
|
-
return new URL(str, baseURL).toString();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Process the single `url()` pattern
|
|
66
|
-
*
|
|
67
|
-
* @param {string} baseURL the base URL for relative URLs.
|
|
68
|
-
*
|
|
69
|
-
* @return {Promise} the Promise.
|
|
70
|
-
*/
|
|
71
|
-
function processURL(baseURL) {
|
|
72
|
-
return meta => ({
|
|
73
|
-
...meta,
|
|
74
|
-
newUrl: 'url(' + meta.before + meta.quote + getResourcePath(meta.value, baseURL) + meta.quote + meta.after + ')'
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Get all `url()`s, and return the meta info
|
|
80
|
-
*
|
|
81
|
-
* @param {string} value decl.value.
|
|
82
|
-
*
|
|
83
|
-
* @return {Array} the urls.
|
|
84
|
-
*/
|
|
85
|
-
function getURLs(value) {
|
|
86
|
-
const reg = /url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;
|
|
87
|
-
let match;
|
|
88
|
-
const URLs = [];
|
|
89
|
-
while ((match = reg.exec(value)) !== null) {
|
|
90
|
-
const meta = {
|
|
91
|
-
source: match[0],
|
|
92
|
-
before: match[1],
|
|
93
|
-
quote: match[2],
|
|
94
|
-
value: match[3],
|
|
95
|
-
after: match[4]
|
|
96
|
-
};
|
|
97
|
-
if (isValidURL(meta)) {
|
|
98
|
-
URLs.push(meta);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return URLs;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Replace the raw value's `url()` segment to the new value
|
|
106
|
-
*
|
|
107
|
-
* @param {string} raw the raw value.
|
|
108
|
-
* @param {Array} URLs the URLs to replace.
|
|
109
|
-
*
|
|
110
|
-
* @return {string} the new value.
|
|
111
|
-
*/
|
|
112
|
-
function replaceURLs(raw, URLs) {
|
|
113
|
-
URLs.forEach(item => {
|
|
114
|
-
raw = raw.replace(item.source, item.newUrl);
|
|
115
|
-
});
|
|
116
|
-
return raw;
|
|
117
|
-
}
|
|
118
|
-
const rewrite = rootURL => node => {
|
|
119
|
-
if (node.type === 'declaration') {
|
|
120
|
-
const updatedURLs = getURLs(node.value).map(processURL(rootURL));
|
|
121
|
-
return {
|
|
122
|
-
...node,
|
|
123
|
-
value: replaceURLs(node.value, updatedURLs)
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
return node;
|
|
127
|
-
};
|
|
128
|
-
var _default = rewrite;
|
|
129
|
-
exports.default = _default;
|
|
130
|
-
//# sourceMappingURL=url-rewrite.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isRemotePath","filePath","test","isAbsolutePath","isValidURL","meta","value","indexOf","getResourcePath","str","baseURL","URL","toString","processURL","newUrl","before","quote","after","getURLs","reg","match","URLs","exec","source","push","replaceURLs","raw","forEach","item","replace","rewrite","rootURL","node","type","updatedURLs","map","_default","exports","default"],"sources":["@wordpress/block-editor/src/utils/transform-styles/transforms/url-rewrite.js"],"sourcesContent":["/**\n * Return `true` if the given path is http/https.\n *\n * @param {string} filePath path\n *\n * @return {boolean} is remote path.\n */\nfunction isRemotePath( filePath ) {\n\treturn /^(?:https?:)?\\/\\//.test( filePath );\n}\n\n/**\n * Return `true` if the given filePath is an absolute url.\n *\n * @param {string} filePath path\n *\n * @return {boolean} is absolute path.\n */\nfunction isAbsolutePath( filePath ) {\n\treturn /^\\/(?!\\/)/.test( filePath );\n}\n\n/**\n * Whether or not the url should be inluded.\n *\n * @param {Object} meta url meta info\n *\n * @return {boolean} is valid.\n */\nfunction isValidURL( meta ) {\n\t// Ignore hashes or data uris.\n\tif (\n\t\tmeta.value.indexOf( 'data:' ) === 0 ||\n\t\tmeta.value.indexOf( '#' ) === 0\n\t) {\n\t\treturn false;\n\t}\n\n\tif ( isAbsolutePath( meta.value ) ) {\n\t\treturn false;\n\t}\n\n\t// Do not handle the http/https urls if `includeRemote` is false.\n\tif ( isRemotePath( meta.value ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Get the absolute path of the url, relative to the basePath\n *\n * @param {string} str the url\n * @param {string} baseURL base URL\n *\n * @return {string} the full path to the file\n */\nfunction getResourcePath( str, baseURL ) {\n\treturn new URL( str, baseURL ).toString();\n}\n\n/**\n * Process the single `url()` pattern\n *\n * @param {string} baseURL the base URL for relative URLs.\n *\n * @return {Promise} the Promise.\n */\nfunction processURL( baseURL ) {\n\treturn ( meta ) => ( {\n\t\t...meta,\n\t\tnewUrl:\n\t\t\t'url(' +\n\t\t\tmeta.before +\n\t\t\tmeta.quote +\n\t\t\tgetResourcePath( meta.value, baseURL ) +\n\t\t\tmeta.quote +\n\t\t\tmeta.after +\n\t\t\t')',\n\t} );\n}\n\n/**\n * Get all `url()`s, and return the meta info\n *\n * @param {string} value decl.value.\n *\n * @return {Array} the urls.\n */\nfunction getURLs( value ) {\n\tconst reg = /url\\((\\s*)(['\"]?)(.+?)\\2(\\s*)\\)/g;\n\tlet match;\n\tconst URLs = [];\n\n\twhile ( ( match = reg.exec( value ) ) !== null ) {\n\t\tconst meta = {\n\t\t\tsource: match[ 0 ],\n\t\t\tbefore: match[ 1 ],\n\t\t\tquote: match[ 2 ],\n\t\t\tvalue: match[ 3 ],\n\t\t\tafter: match[ 4 ],\n\t\t};\n\t\tif ( isValidURL( meta ) ) {\n\t\t\tURLs.push( meta );\n\t\t}\n\t}\n\treturn URLs;\n}\n\n/**\n * Replace the raw value's `url()` segment to the new value\n *\n * @param {string} raw the raw value.\n * @param {Array} URLs the URLs to replace.\n *\n * @return {string} the new value.\n */\nfunction replaceURLs( raw, URLs ) {\n\tURLs.forEach( ( item ) => {\n\t\traw = raw.replace( item.source, item.newUrl );\n\t} );\n\n\treturn raw;\n}\n\nconst rewrite = ( rootURL ) => ( node ) => {\n\tif ( node.type === 'declaration' ) {\n\t\tconst updatedURLs = getURLs( node.value ).map( processURL( rootURL ) );\n\t\treturn {\n\t\t\t...node,\n\t\t\tvalue: replaceURLs( node.value, updatedURLs ),\n\t\t};\n\t}\n\n\treturn node;\n};\n\nexport default rewrite;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAYA,CAAEC,QAAQ,EAAG;EACjC,OAAO,mBAAmB,CAACC,IAAI,CAAED,QAAS,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,cAAcA,CAAEF,QAAQ,EAAG;EACnC,OAAO,WAAW,CAACC,IAAI,CAAED,QAAS,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,UAAUA,CAAEC,IAAI,EAAG;EAC3B;EACA,IACCA,IAAI,CAACC,KAAK,CAACC,OAAO,CAAE,OAAQ,CAAC,KAAK,CAAC,IACnCF,IAAI,CAACC,KAAK,CAACC,OAAO,CAAE,GAAI,CAAC,KAAK,CAAC,EAC9B;IACD,OAAO,KAAK;EACb;EAEA,IAAKJ,cAAc,CAAEE,IAAI,CAACC,KAAM,CAAC,EAAG;IACnC,OAAO,KAAK;EACb;;EAEA;EACA,IAAKN,YAAY,CAAEK,IAAI,CAACC,KAAM,CAAC,EAAG;IACjC,OAAO,KAA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EC,GAAG,EAAEL,IAAI,EAAG;EACjCA,IAAI,CAACM,OAAO,CAAIC,IAAI,IAAM;IACzBF,GAAG,GAAGA,GAAG,CAACG,OAAO,CAAED,IAAI,CAACL,MAAM,EAAEK,IAAI,CAACd,MAAO,CAAC;EAC9C,CAAE,CAAC;EAEH,OAAOY,GAAG;AACX;AAEA,MAAMI,OAAO,GAAKC,OAAO,IAAQC,IAAI,IAAM;EAC1C,IAAKA,IAAI,CAACC,IAAI,KAAK,aAAa,EAAG;IAClC,MAAMC,WAAW,GAAGhB,OAAO,CAAEc,IAAI,CAAC1B,KAAM,CAAC,CAAC6B,GAAG,CAAEtB,UAAU,CAAEkB,OAAQ,CAAE,CAAC;IACtE,OAAO;MACN,GAAGC,IAAI;MACP1B,KAAK,EAAEmB,WAAW,CAAEO,IAAI,CAAC1B,KAAK,EAAE4B,WAAY;IAC7C,CAAC;EACF;EAEA,OAAOF,IAAI;AACZ,CAAC;AAAC,IAAAI,QAAA,GAEaN,OAAO;AAAAO,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* @constant string IS_ROOT_TAG Regex to check if the selector is a root tag selector.
|
|
9
|
-
*/
|
|
10
|
-
const IS_ROOT_TAG = /^(body|html|:root).*$/;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates a callback to modify selectors so they only apply within a certain
|
|
14
|
-
* namespace.
|
|
15
|
-
*
|
|
16
|
-
* @param {string} namespace Namespace to prefix selectors with.
|
|
17
|
-
* @param {string[]} ignore Selectors to not prefix.
|
|
18
|
-
*
|
|
19
|
-
* @return {(node: Object) => Object} Callback to wrap selectors.
|
|
20
|
-
*/
|
|
21
|
-
const wrap = (namespace, ignore = []) => node => {
|
|
22
|
-
/**
|
|
23
|
-
* Updates selector if necessary.
|
|
24
|
-
*
|
|
25
|
-
* @param {string} selector Selector to modify.
|
|
26
|
-
*
|
|
27
|
-
* @return {string} Updated selector.
|
|
28
|
-
*/
|
|
29
|
-
const updateSelector = selector => {
|
|
30
|
-
if (ignore.includes(selector.trim())) {
|
|
31
|
-
return selector;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Skip the update when a selector already has a namespace + space (" ").
|
|
35
|
-
if (selector.trim().startsWith(`${namespace} `)) {
|
|
36
|
-
return selector;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Anything other than a root tag is always prefixed.
|
|
40
|
-
{
|
|
41
|
-
if (!selector.match(IS_ROOT_TAG)) {
|
|
42
|
-
return namespace + ' ' + selector;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// HTML and Body elements cannot be contained within our container so lets extract their styles.
|
|
47
|
-
return selector.replace(/^(body|html|:root)/, namespace);
|
|
48
|
-
};
|
|
49
|
-
if (node.type === 'rule') {
|
|
50
|
-
return {
|
|
51
|
-
...node,
|
|
52
|
-
selectors: node.selectors.map(updateSelector)
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return node;
|
|
56
|
-
};
|
|
57
|
-
var _default = wrap;
|
|
58
|
-
exports.default = _default;
|
|
59
|
-
//# sourceMappingURL=wrap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["IS_ROOT_TAG","wrap","namespace","ignore","node","updateSelector","selector","includes","trim","startsWith","match","replace","type","selectors","map","_default","exports","default"],"sources":["@wordpress/block-editor/src/utils/transform-styles/transforms/wrap.js"],"sourcesContent":["/**\n * @constant string IS_ROOT_TAG Regex to check if the selector is a root tag selector.\n */\nconst IS_ROOT_TAG = /^(body|html|:root).*$/;\n\n/**\n * Creates a callback to modify selectors so they only apply within a certain\n * namespace.\n *\n * @param {string} namespace Namespace to prefix selectors with.\n * @param {string[]} ignore Selectors to not prefix.\n *\n * @return {(node: Object) => Object} Callback to wrap selectors.\n */\nconst wrap =\n\t( namespace, ignore = [] ) =>\n\t( node ) => {\n\t\t/**\n\t\t * Updates selector if necessary.\n\t\t *\n\t\t * @param {string} selector Selector to modify.\n\t\t *\n\t\t * @return {string} Updated selector.\n\t\t */\n\t\tconst updateSelector = ( selector ) => {\n\t\t\tif ( ignore.includes( selector.trim() ) ) {\n\t\t\t\treturn selector;\n\t\t\t}\n\n\t\t\t// Skip the update when a selector already has a namespace + space (\" \").\n\t\t\tif ( selector.trim().startsWith( `${ namespace } ` ) ) {\n\t\t\t\treturn selector;\n\t\t\t}\n\n\t\t\t// Anything other than a root tag is always prefixed.\n\t\t\t{\n\t\t\t\tif ( ! selector.match( IS_ROOT_TAG ) ) {\n\t\t\t\t\treturn namespace + ' ' + selector;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// HTML and Body elements cannot be contained within our container so lets extract their styles.\n\t\t\treturn selector.replace( /^(body|html|:root)/, namespace );\n\t\t};\n\n\t\tif ( node.type === 'rule' ) {\n\t\t\treturn {\n\t\t\t\t...node,\n\t\t\t\tselectors: node.selectors.map( updateSelector ),\n\t\t\t};\n\t\t}\n\n\t\treturn node;\n\t};\n\nexport default wrap;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,uBAAuB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,IAAI,GACTA,CAAEC,SAAS,EAAEC,MAAM,GAAG,EAAE,KACtBC,IAAI,IAAM;EACX;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,cAAc,GAAKC,QAAQ,IAAM;IACtC,IAAKH,MAAM,CAACI,QAAQ,CAAED,QAAQ,CAACE,IAAI,CAAC,CAAE,CAAC,EAAG;MACzC,OAAOF,QAAQ;IAChB;;IAEA;IACA,IAAKA,QAAQ,CAACE,IAAI,CAAC,CAAC,CAACC,UAAU,CAAG,GAAGP,SAAW,GAAG,CAAC,EAAG;MACtD,OAAOI,QAAQ;IAChB;;IAEA;IACA;MACC,IAAK,CAAEA,QAAQ,CAACI,KAAK,CAAEV,WAAY,CAAC,EAAG;QACtC,OAAOE,SAAS,GAAG,GAAG,GAAGI,QAAQ;MAClC;IACD;;IAEA;IACA,OAAOA,QAAQ,CAACK,OAAO,CAAE,oBAAoB,EAAET,SAAU,CAAC;EAC3D,CAAC;EAED,IAAKE,IAAI,CAACQ,IAAI,KAAK,MAAM,EAAG;IAC3B,OAAO;MACN,GAAGR,IAAI;MACPS,SAAS,EAAET,IAAI,CAACS,SAAS,CAACC,GAAG,CAAET,cAAe;IAC/C,CAAC;EACF;EAEA,OAAOD,IAAI;AACZ,CAAC;AAAC,IAAAW,QAAA,GAEYd,IAAI;AAAAe,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _traverse = _interopRequireDefault(require("traverse"));
|
|
9
|
-
var _ast = require("./ast");
|
|
10
|
-
/**
|
|
11
|
-
* External dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
function traverseCSS(css, callback) {
|
|
19
|
-
try {
|
|
20
|
-
const parsed = (0, _ast.parse)(css);
|
|
21
|
-
const updated = _traverse.default.map(parsed, function (node) {
|
|
22
|
-
if (!node) {
|
|
23
|
-
return node;
|
|
24
|
-
}
|
|
25
|
-
const updatedNode = callback(node);
|
|
26
|
-
return this.update(updatedNode);
|
|
27
|
-
});
|
|
28
|
-
return (0, _ast.stringify)(updated);
|
|
29
|
-
} catch (err) {
|
|
30
|
-
// eslint-disable-next-line no-console
|
|
31
|
-
console.warn('Error while traversing the CSS: ' + err);
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
var _default = traverseCSS;
|
|
36
|
-
exports.default = _default;
|
|
37
|
-
//# sourceMappingURL=traverse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_traverse","_interopRequireDefault","require","_ast","traverseCSS","css","callback","parsed","parse","updated","traverse","map","node","updatedNode","update","stringify","err","console","warn","_default","exports","default"],"sources":["@wordpress/block-editor/src/utils/transform-styles/traverse.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport traverse from 'traverse';\n\n/**\n * Internal dependencies\n */\nimport { parse, stringify } from './ast';\n\nfunction traverseCSS( css, callback ) {\n\ttry {\n\t\tconst parsed = parse( css );\n\n\t\tconst updated = traverse.map( parsed, function ( node ) {\n\t\t\tif ( ! node ) {\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\tconst updatedNode = callback( node );\n\t\t\treturn this.update( updatedNode );\n\t\t} );\n\n\t\treturn stringify( updated );\n\t} catch ( err ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn( 'Error while traversing the CSS: ' + err );\n\n\t\treturn null;\n\t}\n}\n\nexport default traverseCSS;\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,IAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,SAASE,WAAWA,CAAEC,GAAG,EAAEC,QAAQ,EAAG;EACrC,IAAI;IACH,MAAMC,MAAM,GAAG,IAAAC,UAAK,EAAEH,GAAI,CAAC;IAE3B,MAAMI,OAAO,GAAGC,iBAAQ,CAACC,GAAG,CAAEJ,MAAM,EAAE,UAAWK,IAAI,EAAG;MACvD,IAAK,CAAEA,IAAI,EAAG;QACb,OAAOA,IAAI;MACZ;MACA,MAAMC,WAAW,GAAGP,QAAQ,CAAEM,IAAK,CAAC;MACpC,OAAO,IAAI,CAACE,MAAM,CAAED,WAAY,CAAC;IAClC,CAAE,CAAC;IAEH,OAAO,IAAAE,cAAS,EAAEN,OAAQ,CAAC;EAC5B,CAAC,CAAC,OAAQO,GAAG,EAAG;IACf;IACAC,OAAO,CAACC,IAAI,CAAE,kCAAkC,GAAGF,GAAI,CAAC;IAExD,OAAO,IAAI;EACZ;AACD;AAAC,IAAAG,QAAA,GAEcf,WAAW;AAAAgB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { __EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE, hasBlockSupport } from '@wordpress/blocks';
|
|
6
|
-
import { applyFilters } from '@wordpress/hooks';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { useBlockEditContext } from '../block-edit';
|
|
12
|
-
import { store as blockEditorStore } from '../../store';
|
|
13
|
-
import { getValueFromObjectPath } from '../../utils/object';
|
|
14
|
-
const blockedPaths = ['color', 'border', 'dimensions', 'typography', 'spacing'];
|
|
15
|
-
const deprecatedFlags = {
|
|
16
|
-
'color.palette': settings => settings.colors,
|
|
17
|
-
'color.gradients': settings => settings.gradients,
|
|
18
|
-
'color.custom': settings => settings.disableCustomColors === undefined ? undefined : !settings.disableCustomColors,
|
|
19
|
-
'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients,
|
|
20
|
-
'typography.fontSizes': settings => settings.fontSizes,
|
|
21
|
-
'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes,
|
|
22
|
-
'typography.lineHeight': settings => settings.enableCustomLineHeight,
|
|
23
|
-
'spacing.units': settings => {
|
|
24
|
-
if (settings.enableCustomUnits === undefined) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (settings.enableCustomUnits === true) {
|
|
28
|
-
return ['px', 'em', 'rem', 'vh', 'vw', '%'];
|
|
29
|
-
}
|
|
30
|
-
return settings.enableCustomUnits;
|
|
31
|
-
},
|
|
32
|
-
'spacing.padding': settings => settings.enableCustomSpacing
|
|
33
|
-
};
|
|
34
|
-
const prefixedFlags = {
|
|
35
|
-
/*
|
|
36
|
-
* These were only available in the plugin
|
|
37
|
-
* and can be removed when the minimum WordPress version
|
|
38
|
-
* for the plugin is 5.9.
|
|
39
|
-
*/
|
|
40
|
-
'border.customColor': 'border.color',
|
|
41
|
-
'border.customStyle': 'border.style',
|
|
42
|
-
'border.customWidth': 'border.width',
|
|
43
|
-
'typography.customFontStyle': 'typography.fontStyle',
|
|
44
|
-
'typography.customFontWeight': 'typography.fontWeight',
|
|
45
|
-
'typography.customLetterSpacing': 'typography.letterSpacing',
|
|
46
|
-
'typography.customTextDecorations': 'typography.textDecoration',
|
|
47
|
-
'typography.customTextTransforms': 'typography.textTransform',
|
|
48
|
-
/*
|
|
49
|
-
* These were part of WordPress 5.8 and we need to keep them.
|
|
50
|
-
*/
|
|
51
|
-
'border.customRadius': 'border.radius',
|
|
52
|
-
'spacing.customMargin': 'spacing.margin',
|
|
53
|
-
'spacing.customPadding': 'spacing.padding',
|
|
54
|
-
'typography.customLineHeight': 'typography.lineHeight'
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Remove `custom` prefixes for flags that did not land in 5.8.
|
|
59
|
-
*
|
|
60
|
-
* This provides continued support for `custom` prefixed properties. It will
|
|
61
|
-
* be removed once third party devs have had sufficient time to update themes,
|
|
62
|
-
* plugins, etc.
|
|
63
|
-
*
|
|
64
|
-
* @see https://github.com/WordPress/gutenberg/pull/34485
|
|
65
|
-
*
|
|
66
|
-
* @param {string} path Path to desired value in settings.
|
|
67
|
-
* @return {string} The value for defined setting.
|
|
68
|
-
*/
|
|
69
|
-
const removeCustomPrefixes = path => {
|
|
70
|
-
return prefixedFlags[path] || path;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Hook that retrieves the given setting for the block instance in use.
|
|
75
|
-
*
|
|
76
|
-
* It looks up the settings first in the block instance hierarchy.
|
|
77
|
-
* If none is found, it'll look it up in the block editor store.
|
|
78
|
-
*
|
|
79
|
-
* @param {string} path The path to the setting.
|
|
80
|
-
* @return {any} Returns the value defined for the setting.
|
|
81
|
-
* @example
|
|
82
|
-
* ```js
|
|
83
|
-
* const isEnabled = useSetting( 'typography.dropCap' );
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
export default function useSetting(path) {
|
|
87
|
-
const {
|
|
88
|
-
name: blockName,
|
|
89
|
-
clientId
|
|
90
|
-
} = useBlockEditContext();
|
|
91
|
-
return useSelect(select => {
|
|
92
|
-
if (blockedPaths.includes(path)) {
|
|
93
|
-
// eslint-disable-next-line no-console
|
|
94
|
-
console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.');
|
|
95
|
-
return undefined;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// 0. Allow third parties to filter the block's settings at runtime.
|
|
99
|
-
let result = applyFilters('blockEditor.useSetting.before', undefined, path, clientId, blockName);
|
|
100
|
-
if (undefined !== result) {
|
|
101
|
-
return result;
|
|
102
|
-
}
|
|
103
|
-
const normalizedPath = removeCustomPrefixes(path);
|
|
104
|
-
|
|
105
|
-
// 1. Take settings from the block instance or its ancestors.
|
|
106
|
-
// Start from the current block and work our way up the ancestors.
|
|
107
|
-
const candidates = [clientId, ...select(blockEditorStore).getBlockParents(clientId, /* ascending */true)];
|
|
108
|
-
for (const candidateClientId of candidates) {
|
|
109
|
-
const candidateBlockName = select(blockEditorStore).getBlockName(candidateClientId);
|
|
110
|
-
if (hasBlockSupport(candidateBlockName, '__experimentalSettings', false)) {
|
|
111
|
-
var _getValueFromObjectPa;
|
|
112
|
-
const candidateAtts = select(blockEditorStore).getBlockAttributes(candidateClientId);
|
|
113
|
-
result = (_getValueFromObjectPa = getValueFromObjectPath(candidateAtts, `settings.blocks.${blockName}.${normalizedPath}`)) !== null && _getValueFromObjectPa !== void 0 ? _getValueFromObjectPa : getValueFromObjectPath(candidateAtts, `settings.${normalizedPath}`);
|
|
114
|
-
if (result !== undefined) {
|
|
115
|
-
// Stop the search for more distant ancestors and move on.
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// 2. Fall back to the settings from the block editor store (__experimentalFeatures).
|
|
122
|
-
const settings = select(blockEditorStore).getSettings();
|
|
123
|
-
if (result === undefined) {
|
|
124
|
-
var _getValueFromObjectPa2;
|
|
125
|
-
const defaultsPath = `__experimentalFeatures.${normalizedPath}`;
|
|
126
|
-
const blockPath = `__experimentalFeatures.blocks.${blockName}.${normalizedPath}`;
|
|
127
|
-
result = (_getValueFromObjectPa2 = getValueFromObjectPath(settings, blockPath)) !== null && _getValueFromObjectPa2 !== void 0 ? _getValueFromObjectPa2 : getValueFromObjectPath(settings, defaultsPath);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Return if the setting was found in either the block instance or the store.
|
|
131
|
-
if (result !== undefined) {
|
|
132
|
-
if (PATHS_WITH_MERGE[normalizedPath]) {
|
|
133
|
-
return ['default', 'theme', 'custom'].reduce((acc, key) => {
|
|
134
|
-
var _result$key;
|
|
135
|
-
return acc.concat((_result$key = result[key]) !== null && _result$key !== void 0 ? _result$key : []);
|
|
136
|
-
}, []);
|
|
137
|
-
}
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// 3. Otherwise, use deprecated settings.
|
|
142
|
-
const deprecatedSettingsValue = deprecatedFlags[normalizedPath] ? deprecatedFlags[normalizedPath](settings) : undefined;
|
|
143
|
-
if (deprecatedSettingsValue !== undefined) {
|
|
144
|
-
return deprecatedSettingsValue;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// 4. Fallback for typography.dropCap:
|
|
148
|
-
// This is only necessary to support typography.dropCap.
|
|
149
|
-
// when __experimentalFeatures are not present (core without plugin).
|
|
150
|
-
// To remove when __experimentalFeatures are ported to core.
|
|
151
|
-
return normalizedPath === 'typography.dropCap' ? true : undefined;
|
|
152
|
-
}, [blockName, clientId, path]);
|
|
153
|
-
}
|
|
154
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","__EXPERIMENTAL_PATHS_WITH_MERGE","PATHS_WITH_MERGE","hasBlockSupport","applyFilters","useBlockEditContext","store","blockEditorStore","getValueFromObjectPath","blockedPaths","deprecatedFlags","settings","colors","gradients","disableCustomColors","undefined","disableCustomGradients","fontSizes","disableCustomFontSizes","enableCustomLineHeight","enableCustomUnits","enableCustomSpacing","prefixedFlags","removeCustomPrefixes","path","useSetting","name","blockName","clientId","select","includes","console","warn","result","normalizedPath","candidates","getBlockParents","candidateClientId","candidateBlockName","getBlockName","_getValueFromObjectPa","candidateAtts","getBlockAttributes","getSettings","_getValueFromObjectPa2","defaultsPath","blockPath","reduce","acc","key","_result$key","concat","deprecatedSettingsValue"],"sources":["@wordpress/block-editor/src/components/use-setting/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { applyFilters } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { store as blockEditorStore } from '../../store';\nimport { getValueFromObjectPath } from '../../utils/object';\n\nconst blockedPaths = [\n\t'color',\n\t'border',\n\t'dimensions',\n\t'typography',\n\t'spacing',\n];\n\nconst deprecatedFlags = {\n\t'color.palette': ( settings ) => settings.colors,\n\t'color.gradients': ( settings ) => settings.gradients,\n\t'color.custom': ( settings ) =>\n\t\tsettings.disableCustomColors === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomColors,\n\t'color.customGradient': ( settings ) =>\n\t\tsettings.disableCustomGradients === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomGradients,\n\t'typography.fontSizes': ( settings ) => settings.fontSizes,\n\t'typography.customFontSize': ( settings ) =>\n\t\tsettings.disableCustomFontSizes === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomFontSizes,\n\t'typography.lineHeight': ( settings ) => settings.enableCustomLineHeight,\n\t'spacing.units': ( settings ) => {\n\t\tif ( settings.enableCustomUnits === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( settings.enableCustomUnits === true ) {\n\t\t\treturn [ 'px', 'em', 'rem', 'vh', 'vw', '%' ];\n\t\t}\n\n\t\treturn settings.enableCustomUnits;\n\t},\n\t'spacing.padding': ( settings ) => settings.enableCustomSpacing,\n};\n\nconst prefixedFlags = {\n\t/*\n\t * These were only available in the plugin\n\t * and can be removed when the minimum WordPress version\n\t * for the plugin is 5.9.\n\t */\n\t'border.customColor': 'border.color',\n\t'border.customStyle': 'border.style',\n\t'border.customWidth': 'border.width',\n\t'typography.customFontStyle': 'typography.fontStyle',\n\t'typography.customFontWeight': 'typography.fontWeight',\n\t'typography.customLetterSpacing': 'typography.letterSpacing',\n\t'typography.customTextDecorations': 'typography.textDecoration',\n\t'typography.customTextTransforms': 'typography.textTransform',\n\t/*\n\t * These were part of WordPress 5.8 and we need to keep them.\n\t */\n\t'border.customRadius': 'border.radius',\n\t'spacing.customMargin': 'spacing.margin',\n\t'spacing.customPadding': 'spacing.padding',\n\t'typography.customLineHeight': 'typography.lineHeight',\n};\n\n/**\n * Remove `custom` prefixes for flags that did not land in 5.8.\n *\n * This provides continued support for `custom` prefixed properties. It will\n * be removed once third party devs have had sufficient time to update themes,\n * plugins, etc.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34485\n *\n * @param {string} path Path to desired value in settings.\n * @return {string} The value for defined setting.\n */\nconst removeCustomPrefixes = ( path ) => {\n\treturn prefixedFlags[ path ] || path;\n};\n\n/**\n * Hook that retrieves the given setting for the block instance in use.\n *\n * It looks up the settings first in the block instance hierarchy.\n * If none is found, it'll look it up in the block editor store.\n *\n * @param {string} path The path to the setting.\n * @return {any} Returns the value defined for the setting.\n * @example\n * ```js\n * const isEnabled = useSetting( 'typography.dropCap' );\n * ```\n */\nexport default function useSetting( path ) {\n\tconst { name: blockName, clientId } = useBlockEditContext();\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( blockedPaths.includes( path ) ) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'Top level useSetting paths are disabled. Please use a subpath to query the information needed.'\n\t\t\t\t);\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// 0. Allow third parties to filter the block's settings at runtime.\n\t\t\tlet result = applyFilters(\n\t\t\t\t'blockEditor.useSetting.before',\n\t\t\t\tundefined,\n\t\t\t\tpath,\n\t\t\t\tclientId,\n\t\t\t\tblockName\n\t\t\t);\n\n\t\t\tif ( undefined !== result ) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst normalizedPath = removeCustomPrefixes( path );\n\n\t\t\t// 1. Take settings from the block instance or its ancestors.\n\t\t\t// Start from the current block and work our way up the ancestors.\n\t\t\tconst candidates = [\n\t\t\t\tclientId,\n\t\t\t\t...select( blockEditorStore ).getBlockParents(\n\t\t\t\t\tclientId,\n\t\t\t\t\t/* ascending */ true\n\t\t\t\t),\n\t\t\t];\n\n\t\t\tfor ( const candidateClientId of candidates ) {\n\t\t\t\tconst candidateBlockName =\n\t\t\t\t\tselect( blockEditorStore ).getBlockName(\n\t\t\t\t\t\tcandidateClientId\n\t\t\t\t\t);\n\t\t\t\tif (\n\t\t\t\t\thasBlockSupport(\n\t\t\t\t\t\tcandidateBlockName,\n\t\t\t\t\t\t'__experimentalSettings',\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tconst candidateAtts =\n\t\t\t\t\t\tselect( blockEditorStore ).getBlockAttributes(\n\t\t\t\t\t\t\tcandidateClientId\n\t\t\t\t\t\t);\n\t\t\t\t\tresult =\n\t\t\t\t\t\tgetValueFromObjectPath(\n\t\t\t\t\t\t\tcandidateAtts,\n\t\t\t\t\t\t\t`settings.blocks.${ blockName }.${ normalizedPath }`\n\t\t\t\t\t\t) ??\n\t\t\t\t\t\tgetValueFromObjectPath(\n\t\t\t\t\t\t\tcandidateAtts,\n\t\t\t\t\t\t\t`settings.${ normalizedPath }`\n\t\t\t\t\t\t);\n\t\t\t\t\tif ( result !== undefined ) {\n\t\t\t\t\t\t// Stop the search for more distant ancestors and move on.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 2. Fall back to the settings from the block editor store (__experimentalFeatures).\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\t\tif ( result === undefined ) {\n\t\t\t\tconst defaultsPath = `__experimentalFeatures.${ normalizedPath }`;\n\t\t\t\tconst blockPath = `__experimentalFeatures.blocks.${ blockName }.${ normalizedPath }`;\n\t\t\t\tresult =\n\t\t\t\t\tgetValueFromObjectPath( settings, blockPath ) ??\n\t\t\t\t\tgetValueFromObjectPath( settings, defaultsPath );\n\t\t\t}\n\n\t\t\t// Return if the setting was found in either the block instance or the store.\n\t\t\tif ( result !== undefined ) {\n\t\t\t\tif ( PATHS_WITH_MERGE[ normalizedPath ] ) {\n\t\t\t\t\treturn [ 'default', 'theme', 'custom' ].reduce(\n\t\t\t\t\t\t( acc, key ) => {\n\t\t\t\t\t\t\treturn acc.concat( result[ key ] ?? [] );\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t// 3. Otherwise, use deprecated settings.\n\t\t\tconst deprecatedSettingsValue = deprecatedFlags[ normalizedPath ]\n\t\t\t\t? deprecatedFlags[ normalizedPath ]( settings )\n\t\t\t\t: undefined;\n\t\t\tif ( deprecatedSettingsValue !== undefined ) {\n\t\t\t\treturn deprecatedSettingsValue;\n\t\t\t}\n\n\t\t\t// 4. Fallback for typography.dropCap:\n\t\t\t// This is only necessary to support typography.dropCap.\n\t\t\t// when __experimentalFeatures are not present (core without plugin).\n\t\t\t// To remove when __experimentalFeatures are ported to core.\n\t\t\treturn normalizedPath === 'typography.dropCap' ? true : undefined;\n\t\t},\n\t\t[ blockName, clientId, path ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,+BAA+B,IAAIC,gBAAgB,EACnDC,eAAe,QACT,mBAAmB;AAC1B,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,sBAAsB,QAAQ,oBAAoB;AAE3D,MAAMC,YAAY,GAAG,CACpB,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,CACT;AAED,MAAMC,eAAe,GAAG;EACvB,eAAe,EAAIC,QAAQ,IAAMA,QAAQ,CAACC,MAAM;EAChD,iBAAiB,EAAID,QAAQ,IAAMA,QAAQ,CAACE,SAAS;EACrD,cAAc,EAAIF,QAAQ,IACzBA,QAAQ,CAACG,mBAAmB,KAAKC,SAAS,GACvCA,SAAS,GACT,CAAEJ,QAAQ,CAACG,mBAAmB;EAClC,sBAAsB,EAAIH,QAAQ,IACjCA,QAAQ,CAACK,sBAAsB,KAAKD,SAAS,GAC1CA,SAAS,GACT,CAAEJ,QAAQ,CAACK,sBAAsB;EACrC,sBAAsB,EAAIL,QAAQ,IAAMA,QAAQ,CAACM,SAAS;EAC1D,2BAA2B,EAAIN,QAAQ,IACtCA,Q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ast/index.js"],"sourcesContent":["// Adapted from https://github.com/reworkcss/css\n// because we needed to remove source map support.\n\nexport { default as parse } from './parse';\nexport { default as stringify } from './stringify';\n"],"mappings":"AAAA;AACA;;AAEA,SAASA,OAAO,IAAIC,KAAK,QAAQ,SAAS;AAC1C,SAASD,OAAO,IAAIE,SAAS,QAAQ,aAAa"}
|