@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
- const entries = [];
233
- for (const [key, value] of Object.entries(supports)) {
234
- if (!key.startsWith("__") && !EnhancedBlockJSONPlugin.IGNORED_THEME_JSON_FLAG_PROPS.includes(key) && value) {
235
- if (typeof value === 'object') {
236
- if (!Array.isArray(value)) {
237
- const v = EnhancedBlockJSONPlugin.pickOutFlagPropsFromBlockSupports(value);
238
- if (v !== undefined) {
239
- entries.push([key, v]);
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
- else if (typeof value === 'boolean') {
244
- entries.push([key, true]);
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 entries.length > 0 ? Object.fromEntries(entries) : undefined;
263
+ return addedProp ? res : undefined;
249
264
  }
250
265
  callRegisterFunction(type, writer, baseUriVar, handles) {
251
266
  for (const [name, { src, rest }] of handles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.93.0",
3
+ "version": "2.93.1",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/dist",