@plaudit/webpack-extensions 2.93.0 → 2.93.1
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
CHANGED
|
@@ -60,6 +60,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
60
60
|
- Legacy PostCSS features that have been integrated into modern CSS
|
|
61
61
|
- `@extends` support
|
|
62
62
|
|
|
63
|
+
## [2.93.1] - 2026-07-15
|
|
64
|
+
### Fixed
|
|
65
|
+
- The new supported features code overriding unintended data in theme.json
|
|
66
|
+
|
|
63
67
|
## [2.93.0] - 2026-07-15
|
|
64
68
|
### Added
|
|
65
69
|
- Logic to emit code that makes the supported features declared in block.json file the defaults for those blocks in the "theme.json" file
|
|
@@ -22,7 +22,6 @@ export declare class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEnt
|
|
|
22
22
|
constructor(config: VerifiedPlauditWordpressWebpackConfig, dest: VerifiedAdvancedOutputConfig, webpackRemoveEmptyScriptsPlugin: WebpackRemoveEmptyScriptsPlugin, context: string, entry: EntryProvider<BlockEntrypointInfo>);
|
|
23
23
|
protected processAssets(compilation: Compilation, parsedAssetJsonProvider: ParsedAssetJsonProvider): Promise<void>;
|
|
24
24
|
private emitBlockLoaderFile;
|
|
25
|
-
private static readonly IGNORED_THEME_JSON_FLAG_PROPS;
|
|
26
25
|
private static pickOutFlagPropsFromBlockSupports;
|
|
27
26
|
private callRegisterFunction;
|
|
28
27
|
private transformBlocks;
|
|
@@ -227,25 +227,40 @@ class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.Abst
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
// This isn't strictly necessary, but it allows us to trivially eliminate commonly-used block supports flags that aren't used in theme.json
|
|
230
|
-
static IGNORED_THEME_JSON_FLAG_PROPS = ['align', 'alignWide', 'anchor', 'contentRole', 'interactivity', 'listView', 'plaudit'];
|
|
230
|
+
// private static readonly IGNORED_THEME_JSON_FLAG_PROPS = ['align', 'alignWide', 'anchor', 'contentRole', 'inserter', 'interactivity', 'listView', 'plaudit'];
|
|
231
231
|
static pickOutFlagPropsFromBlockSupports(supports) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
232
|
+
function isRecord(value) {
|
|
233
|
+
return typeof value === 'object' && !!value && !Array.isArray(value);
|
|
234
|
+
}
|
|
235
|
+
let addedProp = false;
|
|
236
|
+
const res = {};
|
|
237
|
+
if ('color' in supports) {
|
|
238
|
+
const color = supports.color;
|
|
239
|
+
if (isRecord(color)) {
|
|
240
|
+
const colorFlags = {};
|
|
241
|
+
for (const prop of ['background', 'link', 'text']) {
|
|
242
|
+
if (supports[prop]) {
|
|
243
|
+
colorFlags[prop] = true;
|
|
244
|
+
res.color = colorFlags;
|
|
245
|
+
addedProp = true;
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
|
-
|
|
244
|
-
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if ('dimensions' in supports) {
|
|
251
|
+
const dimensions = supports.dimensions;
|
|
252
|
+
if (isRecord(dimensions)) {
|
|
253
|
+
const dimensionsFlags = {};
|
|
254
|
+
for (const prop of ['aspectRatio']) {
|
|
255
|
+
if (supports[prop]) {
|
|
256
|
+
dimensionsFlags[prop] = true;
|
|
257
|
+
res.color = dimensionsFlags;
|
|
258
|
+
addedProp = true;
|
|
259
|
+
}
|
|
245
260
|
}
|
|
246
261
|
}
|
|
247
262
|
}
|
|
248
|
-
return
|
|
263
|
+
return addedProp ? res : undefined;
|
|
249
264
|
}
|
|
250
265
|
callRegisterFunction(type, writer, baseUriVar, handles) {
|
|
251
266
|
for (const [name, { src, rest }] of handles) {
|