assign-gingerly 0.0.37 → 0.0.38
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/object-extension.js
CHANGED
|
@@ -138,7 +138,7 @@ class ElementEnhancementContainer {
|
|
|
138
138
|
}
|
|
139
139
|
// Check if there's an enhKey
|
|
140
140
|
if (registryItem.enhKey) {
|
|
141
|
-
const ctx = { config: registryItem, mountCtx };
|
|
141
|
+
const ctx = { config: registryItem, mountCtx, emc: mountCtx?.emc };
|
|
142
142
|
const self = this;
|
|
143
143
|
// Get existing initVals from enhKey
|
|
144
144
|
const existingInitVals = self[registryItem.enhKey] &&
|
|
@@ -155,7 +155,7 @@ class ElementEnhancementContainer {
|
|
|
155
155
|
}
|
|
156
156
|
else {
|
|
157
157
|
// No enhKey, still pass attrInitVals
|
|
158
|
-
const ctx = { config: registryItem, mountCtx };
|
|
158
|
+
const ctx = { config: registryItem, mountCtx, emc: mountCtx?.emc };
|
|
159
159
|
instance = new SpawnClass(element, ctx, attrInitVals);
|
|
160
160
|
}
|
|
161
161
|
// Store in global instance map
|
package/object-extension.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assignGingerly, { EnhancementRegistry, ItemscopeRegistry, IAssignGingerlyOptions, getInstanceMap, INSTANCE_MAP_GUID } from './assignGingerly.js';
|
|
2
|
-
import { EnhancementConfig } from './types/assign-gingerly/types.js';
|
|
2
|
+
import { EnhancementConfig, SpawnContext } from './types/assign-gingerly/types.js';
|
|
3
3
|
import { parseWithAttrs } from './parseWithAttrs.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -225,7 +225,7 @@ class ElementEnhancementContainer {
|
|
|
225
225
|
|
|
226
226
|
// Check if there's an enhKey
|
|
227
227
|
if (registryItem.enhKey) {
|
|
228
|
-
const ctx = { config: registryItem, mountCtx };
|
|
228
|
+
const ctx: SpawnContext = { config: registryItem, mountCtx, emc: (mountCtx as any)?.emc };
|
|
229
229
|
const self = this as any;
|
|
230
230
|
|
|
231
231
|
// Get existing initVals from enhKey
|
|
@@ -245,7 +245,7 @@ class ElementEnhancementContainer {
|
|
|
245
245
|
self[registryItem.enhKey] = instance;
|
|
246
246
|
} else {
|
|
247
247
|
// No enhKey, still pass attrInitVals
|
|
248
|
-
const ctx = { config: registryItem, mountCtx };
|
|
248
|
+
const ctx: SpawnContext = { config: registryItem, mountCtx, emc: (mountCtx as any)?.emc };
|
|
249
249
|
instance = new SpawnClass(element, ctx, attrInitVals);
|
|
250
250
|
}
|
|
251
251
|
|
package/package.json
CHANGED
|
@@ -212,6 +212,13 @@ export interface SpawnContext<T = any, TMountContext = any> {
|
|
|
212
212
|
* Used for scoped parser registry access during attribute parsing.
|
|
213
213
|
*/
|
|
214
214
|
synthesizerElement?: Element;
|
|
215
|
+
/**
|
|
216
|
+
* The full EMC configuration object that triggered this spawn.
|
|
217
|
+
* Passed through so enhancement classes can access their full configuration
|
|
218
|
+
* (including customData) without needing to separately import the JSON file.
|
|
219
|
+
* This avoids duplicate JSON imports when using emoji shorthand aliases.
|
|
220
|
+
*/
|
|
221
|
+
emc?: any;
|
|
215
222
|
}
|
|
216
223
|
|
|
217
224
|
/**
|