@colixsystems/widget-sdk 0.134.1 → 0.134.2
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/dist/property-schema.js +19 -2
- package/package.json +1 -1
package/dist/property-schema.js
CHANGED
|
@@ -329,6 +329,21 @@ function cloneDefault(value) {
|
|
|
329
329
|
return JSON.parse(JSON.stringify(value));
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
+
// sc-6996: a schema key naming the prototype slot would make `out[k] = …` a
|
|
333
|
+
// SETTER rather than a write. Define it so the default lands as own data.
|
|
334
|
+
function setResolved(target, key, value) {
|
|
335
|
+
if (key === "__proto__") {
|
|
336
|
+
Object.defineProperty(target, key, {
|
|
337
|
+
value,
|
|
338
|
+
writable: true,
|
|
339
|
+
enumerable: true,
|
|
340
|
+
configurable: true,
|
|
341
|
+
});
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
target[key] = value;
|
|
345
|
+
}
|
|
346
|
+
|
|
332
347
|
function resolveLeaf(def, value) {
|
|
333
348
|
if (!isPlainObject(def)) return value;
|
|
334
349
|
if (value === undefined || value === null) {
|
|
@@ -341,7 +356,9 @@ function resolveLeaf(def, value) {
|
|
|
341
356
|
) {
|
|
342
357
|
const out = { ...value };
|
|
343
358
|
for (const [k, child] of Object.entries(def.properties)) {
|
|
344
|
-
|
|
359
|
+
// Unreachable for "__proto__" here (value[k] reads the prototype, never
|
|
360
|
+
// undefined, so no default applies) — kept so both sinks stay one rule.
|
|
361
|
+
setResolved(out, k, resolveLeaf(child, value[k]));
|
|
345
362
|
}
|
|
346
363
|
return out;
|
|
347
364
|
}
|
|
@@ -370,7 +387,7 @@ export function resolveProps(schema, props) {
|
|
|
370
387
|
if (!isPlainObject(schema)) return input;
|
|
371
388
|
const out = { ...input };
|
|
372
389
|
for (const [k, def] of Object.entries(schema)) {
|
|
373
|
-
out
|
|
390
|
+
setResolved(out, k, resolveLeaf(def, input[k]));
|
|
374
391
|
}
|
|
375
392
|
return out;
|
|
376
393
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.134.
|
|
3
|
+
"version": "0.134.2",
|
|
4
4
|
"description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
|
|
5
5
|
"homepage": "https://github.com/Colix-AB/AppStudio",
|
|
6
6
|
"type": "module",
|