@plaudit/webpack-extensions 3.14.0 → 3.14.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
@@ -5,13 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.14.1] - 2026-07-15
9
+ ### Fixed
10
+ - The new supported features code overriding unintended data in theme.json
11
+ - This comes from version `2.93.1`
12
+
8
13
  ## [3.14.0] - 2026-07-15
9
14
  ### Added
10
15
  - Logic to emit code that makes the supported features declared in block.json file the defaults for those blocks in the "theme.json" file
11
16
  - This uses filters to achieve the "defaulting", which means that it's plugin and theme agnostic
12
- - This comes from version `2.92.4`
17
+ - This comes from version `2.93.0`
13
18
  - The `useBlockSupportsAsThemeJsonDefaults` flag to allow the new logic to be disabled
14
- - This comes from version `2.92.4`
19
+ - This comes from version `2.93.0`
15
20
 
16
21
  ## [3.13.0] - 2026-07-14
17
22
  ### Added
@@ -204,6 +209,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
204
209
  - Legacy PostCSS features that have been integrated into modern CSS
205
210
  - `@extends` support
206
211
 
212
+ ## [2.93.1] - 2026-07-15
213
+ ### Fixed
214
+ - The new supported features code overriding unintended data in theme.json
215
+
207
216
  ## [2.93.0] - 2026-07-15
208
217
  ### Added
209
218
  - 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": "3.14.0",
3
+ "version": "3.14.1",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/dist",