@plaudit/webpack-extensions 2.83.0 → 2.83.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,6 +5,14 @@ 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
+ ## [2.83.1] - 2026-01-27
9
+ ### Fixed
10
+ - An issue wherein the theme-level styles would pollute the editor's UI styles
11
+ - This was done by reverting the changes from `2.73.1`
12
+
13
+ ### Internals
14
+ - Removed `build` from git
15
+
8
16
  ## [2.83.0] - 2026-01-20
9
17
  ### Added
10
18
  - Support for `hook_name` condition to the `admin` location for plain entrypoints
@@ -90,6 +90,21 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
90
90
  }
91
91
  }
92
92
  PlainEntrypointsConfigFileGeneratorPlugin.appendEnqueuingHandleLists(writer, handleLists);
93
+ const sortedEditorStyleHandles = sortedStyleHandles
94
+ .filter(([_, { locations: { clientEditor }, type }]) => type === 'style' && (clientEditor || typeof clientEditor === 'number'))
95
+ .sort((a, b) => {
96
+ const aPriority = typeof a[1].locations.clientEditor === 'boolean' ? 10 : a[1].locations.clientEditor;
97
+ const bPriority = typeof b[1].locations.clientEditor === 'boolean' ? 10 : b[1].locations.clientEditor;
98
+ return aPriority - bPriority;
99
+ })
100
+ .map(info => info[1].src);
101
+ if (sortedEditorStyleHandles.length > 0) {
102
+ writer.linebreak();
103
+ for (const handleSrc of sortedEditorStyleHandles) {
104
+ const handlePath = node_path_1.default.join(this.outputDir, node_path_1.default.relative(emitDir, handleSrc));
105
+ writer.call("add_editor_style", [(0, shared_1.leadingSlashIt)(handlePath)]);
106
+ }
107
+ }
93
108
  (0, shared_1.emitPHPWriterAsAsset)(writer, compilation, "plain-entrypoints-loader.php");
94
109
  }
95
110
  static addHandlesToHandleLists(type, handles, handleLists) {
@@ -101,6 +116,11 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
101
116
  for (const location of (0, shared_1.constantKeys)(shared_1.standardLocationNamesMeta)) {
102
117
  let priority, hook_name;
103
118
  const dataLocation = data.locations[location];
119
+ if (location === 'clientEditor' && type === 'style') {
120
+ // We don't include editor styles in the handle list because editor styles are enqueued via a completely separate mechanism at runtime and, therefore,
121
+ // cannot be handled by the same code as every other enqueueable item
122
+ continue;
123
+ }
104
124
  if (typeof dataLocation === 'number') {
105
125
  priority = dataLocation;
106
126
  hook_name = undefined;
@@ -136,16 +156,17 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
136
156
  }
137
157
  }
138
158
  static appendEnqueuingHandleLists(writer, handleLists) {
139
- const enqueuingHandleActions = (0, shared_1.constantEntries)(shared_1.standardLocationNamesMeta)
140
- .map(([sln, { action, supports_hook_name }]) => [action, [handleLists[sln], supports_hook_name]]);
141
- for (const [action, [handleList, supports_hook_name]] of enqueuingHandleActions) {
159
+ for (const [sln, { action, supports_hook_name, additional_action_code }] of (0, shared_1.constantEntries)(shared_1.standardLocationNamesMeta)) {
160
+ const handleList = handleLists[sln];
142
161
  if (handleList.length > 0) {
162
+ writer.linebreak();
143
163
  for (const [priority, prioritizedHandleList] of PlainEntrypointsConfigFileGeneratorPlugin.separateHandleListByPriority(handleList)) {
144
164
  if (supports_hook_name) {
145
165
  const hookNamedHandleLists = PlainEntrypointsConfigFileGeneratorPlugin.separateHandleListByHookName(prioritizedHandleList);
146
166
  if (!(0, shared_1.arrayIsLength)(hookNamedHandleLists, 1) || hookNamedHandleLists[0][0] !== "") {
147
167
  const hook_name_var = new expressions_1.Var("hook_name", "?string");
148
168
  writer.action(action, writer => {
169
+ additional_action_code?.before?.(writer);
149
170
  for (const [hook_name, handles] of hookNamedHandleLists) {
150
171
  writer.if(expressions_1.Op.binary(hook_name_var, " === ", hook_name));
151
172
  for (const handle of handles) {
@@ -153,14 +174,17 @@ class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAnd
153
174
  }
154
175
  writer.endIf();
155
176
  }
177
+ additional_action_code?.after?.(writer);
156
178
  }, { priority, functionArgParameters: [hook_name_var] });
157
179
  continue;
158
180
  }
159
181
  }
160
182
  writer.action(action, writer => {
183
+ additional_action_code?.before?.(writer);
161
184
  for (const handle of prioritizedHandleList) {
162
185
  writer.call(`wp_enqueue_${handle.type}`, [handle.handle]);
163
186
  }
187
+ additional_action_code?.after?.(writer);
164
188
  }, { priority });
165
189
  }
166
190
  }
package/build/shared.d.ts CHANGED
@@ -19,15 +19,12 @@ export type HandleData = {
19
19
  export declare const standardLocationNamesMeta: {
20
20
  readonly clientView: {
21
21
  readonly action: "wp_enqueue_scripts";
22
- readonly supports_hook_name: false;
23
22
  };
24
23
  readonly clientEditor: {
25
24
  readonly action: "enqueue_block_editor_assets";
26
- readonly supports_hook_name: false;
27
25
  };
28
26
  readonly blockAssets: {
29
27
  readonly action: "enqueue_block_assets";
30
- readonly supports_hook_name: false;
31
28
  };
32
29
  readonly admin: {
33
30
  readonly action: "admin_enqueue_scripts";
@@ -35,15 +32,20 @@ export declare const standardLocationNamesMeta: {
35
32
  };
36
33
  readonly login: {
37
34
  readonly action: "login_enqueue_scripts";
38
- readonly supports_hook_name: false;
39
35
  };
40
36
  readonly customizer: {
41
37
  readonly action: "customize_controls_enqueue_scripts";
42
- readonly supports_hook_name: false;
43
38
  };
44
39
  readonly analytics: {
45
40
  readonly action: "plaudit_enqueue_analytics";
46
- readonly supports_hook_name: false;
41
+ };
42
+ };
43
+ export type StandardLocationNameMeta = {
44
+ action: typeof standardLocationNamesMeta[keyof typeof standardLocationNamesMeta]['action'];
45
+ supports_hook_name?: boolean;
46
+ additional_action_code?: {
47
+ before?(writer: PHPWriter): unknown;
48
+ after?(writer: PHPWriter): unknown;
47
49
  };
48
50
  };
49
51
  export type StandardLocationNames = keyof typeof standardLocationNamesMeta;
@@ -52,7 +54,9 @@ type LocationWithHookNameSupport = boolean | number | string | string[] | {
52
54
  priority?: number;
53
55
  };
54
56
  export type UsageLocations = {
55
- [K in StandardLocationNames]?: typeof standardLocationNamesMeta[K]['supports_hook_name'] extends true ? LocationWithHookNameSupport : boolean | number;
57
+ [K in StandardLocationNames]?: typeof standardLocationNamesMeta[K] extends {
58
+ supports_hook_name: true;
59
+ } ? LocationWithHookNameSupport : boolean | number;
56
60
  } & {
57
61
  register?: boolean | number;
58
62
  handle?: string | ((generatedHandle: string) => string);
package/build/shared.js CHANGED
@@ -49,13 +49,13 @@ function isParsedAssetsJson(thing) {
49
49
  return true;
50
50
  }
51
51
  exports.standardLocationNamesMeta = {
52
- clientView: { action: "wp_enqueue_scripts", supports_hook_name: false },
53
- clientEditor: { action: "enqueue_block_editor_assets", supports_hook_name: false },
54
- blockAssets: { action: "enqueue_block_assets", supports_hook_name: false },
52
+ clientView: { action: "wp_enqueue_scripts" },
53
+ clientEditor: { action: "enqueue_block_editor_assets" },
54
+ blockAssets: { action: "enqueue_block_assets" },
55
55
  admin: { action: "admin_enqueue_scripts", supports_hook_name: true },
56
- login: { action: "login_enqueue_scripts", supports_hook_name: false },
57
- customizer: { action: "customize_controls_enqueue_scripts", supports_hook_name: false },
58
- analytics: { action: "plaudit_enqueue_analytics", supports_hook_name: false }
56
+ login: { action: "login_enqueue_scripts" },
57
+ customizer: { action: "customize_controls_enqueue_scripts" },
58
+ analytics: { action: "plaudit_enqueue_analytics" },
59
59
  };
60
60
  function isNormalizedUsageLocations(usageLocations) {
61
61
  return typeof usageLocations.registerScriptArgs !== 'string';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.83.0",
3
+ "version": "2.83.1",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/build",
@@ -25,7 +25,7 @@
25
25
  "devDependencies": {
26
26
  "@plaudit/gutenberg-api-extensions": "^2.84.3",
27
27
  "@types/browser-sync-webpack-plugin": "^2.2.5",
28
- "@types/node": "^25.0.9",
28
+ "@types/node": "^25.0.10",
29
29
  "@types/postcss-functions": "^4.0.4",
30
30
  "@types/tapable": "^2.3.0",
31
31
  "@types/webpack": "^5.28.5",