@wordpress/block-editor 12.10.3 → 12.10.4
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/build/components/block-styles/index.js +1 -2
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/iframe/index.js +9 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-filter.js +11 -10
- package/build/components/inserter/block-patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +1 -1
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +4 -33
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/list-view/block.js +1 -32
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +8 -1
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +8 -3
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/utils.js +35 -0
- package/build/components/list-view/utils.js.map +1 -1
- package/build/store/actions.js +8 -12
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js +55 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +19 -1
- package/build/store/reducer.js.map +1 -1
- package/build/utils/transform-styles/transforms/wrap.js +5 -0
- package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -2
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/iframe/index.js +9 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-filter.js +13 -12
- package/build-module/components/inserter/block-patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +1 -1
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +5 -34
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/list-view/block.js +3 -34
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +8 -1
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +8 -3
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/utils.js +34 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/store/actions.js +8 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js +52 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +18 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +5 -0
- package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-style/style-rtl.css +1 -1
- package/build-style/style.css +1 -1
- package/package.json +32 -32
- package/src/components/block-styles/index.js +1 -4
- package/src/components/iframe/index.js +8 -1
- package/src/components/inserter/block-patterns-filter.js +22 -10
- package/src/components/inserter/block-patterns-tab.js +0 -3
- package/src/components/inserter/media-tab/hooks.js +10 -44
- package/src/components/inserter/style.scss +1 -1
- package/src/components/list-view/block.js +3 -43
- package/src/components/list-view/branch.js +11 -1
- package/src/components/list-view/index.js +8 -4
- package/src/components/list-view/utils.js +37 -0
- package/src/store/actions.js +7 -11
- package/src/store/private-selectors.js +72 -0
- package/src/store/reducer.js +17 -0
- package/src/store/test/actions.js +10 -16
- package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +13 -6
- package/src/utils/transform-styles/transforms/test/wrap.js +9 -0
- package/src/utils/transform-styles/transforms/wrap.js +5 -0
|
@@ -1279,9 +1279,9 @@ describe( 'actions', () => {
|
|
|
1279
1279
|
fetch: () => {},
|
|
1280
1280
|
} )( {
|
|
1281
1281
|
select: {
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1282
|
+
getRegisteredInserterMediaCategories: () => [
|
|
1283
|
+
{ name: 'a' },
|
|
1284
|
+
],
|
|
1285
1285
|
},
|
|
1286
1286
|
} );
|
|
1287
1287
|
expect( console ).toHaveErroredWith(
|
|
@@ -1296,11 +1296,9 @@ describe( 'actions', () => {
|
|
|
1296
1296
|
fetch: () => {},
|
|
1297
1297
|
} )( {
|
|
1298
1298
|
select: {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
],
|
|
1303
|
-
} ),
|
|
1299
|
+
getRegisteredInserterMediaCategories: () => [
|
|
1300
|
+
{ labels: { name: 'a' } },
|
|
1301
|
+
],
|
|
1304
1302
|
},
|
|
1305
1303
|
} );
|
|
1306
1304
|
expect( console ).toHaveErroredWith(
|
|
@@ -1321,18 +1319,14 @@ describe( 'actions', () => {
|
|
|
1321
1319
|
const dispatch = jest.fn();
|
|
1322
1320
|
registerInserterMediaCategory( category )( {
|
|
1323
1321
|
select: {
|
|
1324
|
-
|
|
1322
|
+
getRegisteredInserterMediaCategories: () =>
|
|
1323
|
+
inserterMediaCategories,
|
|
1325
1324
|
},
|
|
1326
1325
|
dispatch,
|
|
1327
1326
|
} );
|
|
1328
1327
|
expect( dispatch ).toHaveBeenLastCalledWith( {
|
|
1329
|
-
type: '
|
|
1330
|
-
|
|
1331
|
-
inserterMediaCategories: [
|
|
1332
|
-
...inserterMediaCategories,
|
|
1333
|
-
{ ...category, isExternalResource: true },
|
|
1334
|
-
],
|
|
1335
|
-
},
|
|
1328
|
+
type: 'REGISTER_INSERTER_MEDIA_CATEGORY',
|
|
1329
|
+
category: { ...category, isExternalResource: true },
|
|
1336
1330
|
} );
|
|
1337
1331
|
} );
|
|
1338
1332
|
} );
|
|
@@ -22,6 +22,19 @@ color: red;
|
|
|
22
22
|
}"
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
+
exports[`CSS selector wrap should not double wrap selectors 1`] = `
|
|
26
|
+
".my-namespace h1,
|
|
27
|
+
.my-namespace .red {
|
|
28
|
+
color: red;
|
|
29
|
+
}"
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
exports[`CSS selector wrap should replace :root selectors 1`] = `
|
|
33
|
+
".my-namespace {
|
|
34
|
+
--my-color: #ff0000;
|
|
35
|
+
}"
|
|
36
|
+
`;
|
|
37
|
+
|
|
25
38
|
exports[`CSS selector wrap should replace root tags 1`] = `
|
|
26
39
|
".my-namespace,
|
|
27
40
|
.my-namespace h1 {
|
|
@@ -49,9 +62,3 @@ color: red;
|
|
|
49
62
|
}
|
|
50
63
|
}"
|
|
51
64
|
`;
|
|
52
|
-
|
|
53
|
-
exports[`CSS selector wrap should replace :root selectors 1`] = `
|
|
54
|
-
".my-namespace {
|
|
55
|
-
--my-color: #ff0000;
|
|
56
|
-
}"
|
|
57
|
-
`;
|
|
@@ -83,4 +83,13 @@ describe( 'CSS selector wrap', () => {
|
|
|
83
83
|
|
|
84
84
|
expect( output ).toMatchSnapshot();
|
|
85
85
|
} );
|
|
86
|
+
|
|
87
|
+
it( 'should not double wrap selectors', () => {
|
|
88
|
+
const callback = wrap( '.my-namespace' );
|
|
89
|
+
const input = ` .my-namespace h1, .red { color: red; }`;
|
|
90
|
+
|
|
91
|
+
const output = traverse( input, callback );
|
|
92
|
+
|
|
93
|
+
expect( output ).toMatchSnapshot();
|
|
94
|
+
} );
|
|
86
95
|
} );
|
|
@@ -27,6 +27,11 @@ const wrap =
|
|
|
27
27
|
return selector;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
// Skip the update when a selector already has a namespace + space (" ").
|
|
31
|
+
if ( selector.trim().startsWith( `${ namespace } ` ) ) {
|
|
32
|
+
return selector;
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
// Anything other than a root tag is always prefixed.
|
|
31
36
|
{
|
|
32
37
|
if ( ! selector.match( IS_ROOT_TAG ) ) {
|