@coffer-org/core 2.1.2 → 2.1.3
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/compose.js +22 -8
- package/package.json +2 -2
package/dist/compose.js
CHANGED
|
@@ -35,6 +35,17 @@ export function composeRegistry(plugins, opts = {}) {
|
|
|
35
35
|
contribMap.set(key, acc);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
const mergeFieldContrib = (f, c) => {
|
|
39
|
+
if (c.options.length) {
|
|
40
|
+
const seen = new Set((f.options ?? []).map((o) => o.value));
|
|
41
|
+
f.options = [...(f.options ?? []), ...c.options.filter((o) => !seen.has(o.value))];
|
|
42
|
+
}
|
|
43
|
+
if (c.suggestions.length) {
|
|
44
|
+
const cur = f.hints['suggestions'] ?? [];
|
|
45
|
+
const seen = new Set(cur);
|
|
46
|
+
f.hints['suggestions'] = [...cur, ...c.suggestions.filter((s) => !seen.has(s))];
|
|
47
|
+
}
|
|
48
|
+
};
|
|
38
49
|
const optionListMap = new Map();
|
|
39
50
|
for (const p of enabled) {
|
|
40
51
|
for (const list of p.optionLists ?? []) {
|
|
@@ -47,14 +58,17 @@ export function composeRegistry(plugins, opts = {}) {
|
|
|
47
58
|
const c = contribMap.get(`${m.library}/${m.shelf}/${key}`);
|
|
48
59
|
if (!c)
|
|
49
60
|
continue;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
mergeFieldContrib(f, c);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
for (const p of enabled) {
|
|
65
|
+
for (const [key, f] of p.settings ? fieldEntries(p.settings.fields) : []) {
|
|
66
|
+
const c = contribMap.get(`_settings/${p.id}/${key}`);
|
|
67
|
+
if (!c)
|
|
68
|
+
continue;
|
|
69
|
+
mergeFieldContrib(f, c);
|
|
70
|
+
if (f.prim === 'select' && f.options?.length) {
|
|
71
|
+
bindSelectSourceZod(f, f.options.map((o) => o.value));
|
|
58
72
|
}
|
|
59
73
|
}
|
|
60
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffer-org/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"postpack": "node ../../scripts/swap-exports.mjs src"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@coffer-org/sdk": "^2.1.
|
|
27
|
+
"@coffer-org/sdk": "^2.1.2"
|
|
28
28
|
}
|
|
29
29
|
}
|