@kosdev-code/kos-ui-plugin 2.1.5 → 2.1.7
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/documentation-generator-Blyj8V7Z.cjs +266 -0
- package/documentation-generator-Blyj8V7Z.cjs.map +1 -0
- package/{documentation-generator-BVDETA08.js → documentation-generator-C0BDW8NY.js} +452 -452
- package/documentation-generator-C0BDW8NY.js.map +1 -0
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/lib/utils/discovery/documentation-generator.d.ts.map +1 -1
- package/lib/utils/processors/initialize-plugins.d.ts +2 -2
- package/lib/utils/processors/initialize-plugins.d.ts.map +1 -1
- package/package.json +2 -2
- package/utils.cjs +1 -1
- package/utils.js +1 -1
- package/documentation-generator-BVDETA08.js.map +0 -1
- package/documentation-generator-CTsesVKL.cjs +0 -266
- package/documentation-generator-CTsesVKL.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var A = Object.defineProperty;
|
|
2
|
-
var j = (n,
|
|
3
|
-
var P = (n,
|
|
2
|
+
var j = (n, t, e) => t in n ? A(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var P = (n, t, e) => (j(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import { z as E } from "zod";
|
|
5
|
-
function N(n,
|
|
6
|
-
for (var
|
|
7
|
-
const i = e
|
|
5
|
+
function N(n, t) {
|
|
6
|
+
for (var e = 0; e < t.length; e++) {
|
|
7
|
+
const i = t[e];
|
|
8
8
|
if (typeof i != "string" && !Array.isArray(i)) {
|
|
9
9
|
for (const s in i)
|
|
10
10
|
if (s !== "default" && !(s in n)) {
|
|
@@ -32,60 +32,60 @@ function V(n) {
|
|
|
32
32
|
v = n;
|
|
33
33
|
}
|
|
34
34
|
x.setRemoteDefinitions = V;
|
|
35
|
-
async function M(n,
|
|
36
|
-
const
|
|
37
|
-
if (R.has(
|
|
38
|
-
return R.get(
|
|
39
|
-
const o = (await (F.has(n) ? F.get(n) : await q(n)).get(
|
|
40
|
-
return R.set(
|
|
35
|
+
async function M(n, t) {
|
|
36
|
+
const e = `${n}:${t}`;
|
|
37
|
+
if (R.has(e))
|
|
38
|
+
return R.get(e);
|
|
39
|
+
const o = (await (F.has(n) ? F.get(n) : await q(n)).get(t))();
|
|
40
|
+
return R.set(e, o), o;
|
|
41
41
|
}
|
|
42
42
|
x.loadRemoteModule = M;
|
|
43
|
-
const L = (n,
|
|
43
|
+
const L = (n, t) => new Promise((e, i) => {
|
|
44
44
|
const s = document.createElement("script");
|
|
45
45
|
s.src = n, s.type = "text/javascript", s.async = !0, s.onload = () => {
|
|
46
|
-
|
|
47
|
-
get: (a) => window[
|
|
46
|
+
e({
|
|
47
|
+
get: (a) => window[t].get(a),
|
|
48
48
|
init: (a) => {
|
|
49
49
|
try {
|
|
50
|
-
window[
|
|
50
|
+
window[t].init(a);
|
|
51
51
|
} catch (r) {
|
|
52
|
-
console.error(`Failed to initialize remote ${
|
|
52
|
+
console.error(`Failed to initialize remote ${t}`, r), i(r);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
}, s.onerror = () => i(new Error(`Remote ${
|
|
56
|
+
}, s.onerror = () => i(new Error(`Remote ${t} not found`)), document.head.appendChild(s);
|
|
57
57
|
});
|
|
58
58
|
async function q(n) {
|
|
59
59
|
if (!S && !v)
|
|
60
60
|
throw new Error("Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.");
|
|
61
61
|
_ || (_ = !0, await __webpack_init_sharing__("default"));
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
!
|
|
65
|
-
const i = await L(
|
|
62
|
+
const t = v ? v[n] : await S(n);
|
|
63
|
+
let e = t;
|
|
64
|
+
!t.endsWith(".mjs") && !t.endsWith(".js") && (e = `${t}${t.endsWith("/") ? "" : "/"}remoteEntry.js`);
|
|
65
|
+
const i = await L(e, n);
|
|
66
66
|
return await i.init(__webpack_share_scopes__.default), F.set(n, i), i;
|
|
67
67
|
}
|
|
68
68
|
(function(n) {
|
|
69
69
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.setRemoteUrlResolver = n.setRemoteDefinitions = n.loadRemoteModule = void 0;
|
|
70
|
-
var
|
|
70
|
+
var t = x;
|
|
71
71
|
Object.defineProperty(n, "loadRemoteModule", { enumerable: !0, get: function() {
|
|
72
|
-
return
|
|
72
|
+
return t.loadRemoteModule;
|
|
73
73
|
} }), Object.defineProperty(n, "setRemoteDefinitions", { enumerable: !0, get: function() {
|
|
74
|
-
return
|
|
74
|
+
return t.setRemoteDefinitions;
|
|
75
75
|
} }), Object.defineProperty(n, "setRemoteUrlResolver", { enumerable: !0, get: function() {
|
|
76
|
-
return
|
|
76
|
+
return t.setRemoteUrlResolver;
|
|
77
77
|
} });
|
|
78
78
|
})(k);
|
|
79
79
|
const Re = /* @__PURE__ */ N({
|
|
80
80
|
__proto__: null
|
|
81
81
|
}, [k]);
|
|
82
82
|
function B(n) {
|
|
83
|
-
var
|
|
83
|
+
var t;
|
|
84
84
|
try {
|
|
85
85
|
if ("shape" in n) {
|
|
86
|
-
const
|
|
86
|
+
const e = n, i = [];
|
|
87
87
|
for (const [s, o] of Object.entries(
|
|
88
|
-
|
|
88
|
+
e.shape
|
|
89
89
|
)) {
|
|
90
90
|
const a = o, r = {
|
|
91
91
|
name: s,
|
|
@@ -93,32 +93,32 @@ function B(n) {
|
|
|
93
93
|
};
|
|
94
94
|
if (a._def && a._def.description && (r.description = a._def.description), a._def) {
|
|
95
95
|
let c = a._def.typeName || "unknown";
|
|
96
|
-
c === "ZodOptional" && a._def.innerType && (c = ((
|
|
96
|
+
c === "ZodOptional" && a._def.innerType && (c = ((t = a._def.innerType._def) == null ? void 0 : t.typeName) || "unknown"), r.type = c.replace("Zod", "").toLowerCase();
|
|
97
97
|
}
|
|
98
98
|
i.push(r);
|
|
99
99
|
}
|
|
100
100
|
return i;
|
|
101
101
|
}
|
|
102
102
|
return [];
|
|
103
|
-
} catch (
|
|
104
|
-
return console.warn("Failed to extract schema field info:",
|
|
103
|
+
} catch (e) {
|
|
104
|
+
return console.warn("Failed to extract schema field info:", e), [];
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
class H {
|
|
108
108
|
constructor() {
|
|
109
109
|
P(this, "issues", []);
|
|
110
110
|
}
|
|
111
|
-
addError(
|
|
112
|
-
this.issues.push({ type: "error", message:
|
|
111
|
+
addError(t) {
|
|
112
|
+
this.issues.push({ type: "error", message: t });
|
|
113
113
|
}
|
|
114
|
-
addWarning(
|
|
115
|
-
this.issues.push({ type: "warning", message:
|
|
114
|
+
addWarning(t) {
|
|
115
|
+
this.issues.push({ type: "warning", message: t });
|
|
116
116
|
}
|
|
117
|
-
addInfo(
|
|
118
|
-
this.issues.push({ type: "info", message:
|
|
117
|
+
addInfo(t) {
|
|
118
|
+
this.issues.push({ type: "info", message: t });
|
|
119
119
|
}
|
|
120
120
|
hasErrors() {
|
|
121
|
-
return this.issues.some((
|
|
121
|
+
return this.issues.some((t) => t.type === "error");
|
|
122
122
|
}
|
|
123
123
|
hasIssues() {
|
|
124
124
|
return this.issues.length > 0;
|
|
@@ -131,11 +131,11 @@ class W {
|
|
|
131
131
|
constructor() {
|
|
132
132
|
P(this, "cache", /* @__PURE__ */ new Map());
|
|
133
133
|
}
|
|
134
|
-
set(
|
|
135
|
-
this.cache.set(
|
|
134
|
+
set(t, e) {
|
|
135
|
+
this.cache.set(t, e);
|
|
136
136
|
}
|
|
137
|
-
get(
|
|
138
|
-
return this.cache.get(
|
|
137
|
+
get(t) {
|
|
138
|
+
return this.cache.get(t) || [];
|
|
139
139
|
}
|
|
140
140
|
clear() {
|
|
141
141
|
this.cache.clear();
|
|
@@ -149,9 +149,9 @@ const U = [];
|
|
|
149
149
|
function z(n) {
|
|
150
150
|
U.push(n);
|
|
151
151
|
}
|
|
152
|
-
function G(n,
|
|
152
|
+
function G(n, t, e) {
|
|
153
153
|
return U.reduce(
|
|
154
|
-
(i, s) => s(i,
|
|
154
|
+
(i, s) => s(i, t, e),
|
|
155
155
|
n
|
|
156
156
|
);
|
|
157
157
|
}
|
|
@@ -159,31 +159,31 @@ class J {
|
|
|
159
159
|
constructor() {
|
|
160
160
|
P(this, "extensionPoints", /* @__PURE__ */ new Map());
|
|
161
161
|
}
|
|
162
|
-
define(
|
|
163
|
-
if (this.extensionPoints.has(
|
|
164
|
-
return console.warn(`Extension point ${
|
|
165
|
-
const
|
|
166
|
-
config:
|
|
167
|
-
id:
|
|
162
|
+
define(t) {
|
|
163
|
+
if (this.extensionPoints.has(t.id))
|
|
164
|
+
return console.warn(`Extension point ${t.id} is already defined`), this.extensionPoints.get(t.id);
|
|
165
|
+
const e = {
|
|
166
|
+
config: t,
|
|
167
|
+
id: t.id,
|
|
168
168
|
isRegistered: !1,
|
|
169
|
-
getExtensions: (i) => i[
|
|
169
|
+
getExtensions: (i) => i[t.id] || {},
|
|
170
170
|
register: () => {
|
|
171
|
-
if (
|
|
172
|
-
console.warn(`Extension point ${
|
|
171
|
+
if (e.isRegistered) {
|
|
172
|
+
console.warn(`Extension point ${t.id} is already registered`);
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
const i = this.createReducer(
|
|
176
|
-
z(i),
|
|
175
|
+
const i = this.createReducer(t);
|
|
176
|
+
z(i), e.isRegistered = !0;
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
|
-
return
|
|
179
|
+
return t.schema && (e.getSchemaFieldInfo = () => B(t.schema)), this.extensionPoints.set(t.id, e), e;
|
|
180
180
|
}
|
|
181
|
-
createReducer(
|
|
182
|
-
return (
|
|
183
|
-
const o = i[
|
|
181
|
+
createReducer(t) {
|
|
182
|
+
return (e, i, s) => {
|
|
183
|
+
const o = i[t.contributionKey];
|
|
184
184
|
return !o || typeof o != "object" || Object.entries(o).forEach(
|
|
185
185
|
([a, r]) => {
|
|
186
|
-
var
|
|
186
|
+
var m, h;
|
|
187
187
|
if (!r)
|
|
188
188
|
return;
|
|
189
189
|
const c = {
|
|
@@ -192,9 +192,9 @@ class J {
|
|
|
192
192
|
experiences: s,
|
|
193
193
|
contributions: i
|
|
194
194
|
};
|
|
195
|
-
if (
|
|
195
|
+
if (t.validate) {
|
|
196
196
|
const d = new H();
|
|
197
|
-
if (
|
|
197
|
+
if (t.validate(
|
|
198
198
|
r,
|
|
199
199
|
d
|
|
200
200
|
) === "skip") {
|
|
@@ -207,48 +207,48 @@ class J {
|
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
if (d.hasIssues()) {
|
|
210
|
-
const b = d.getIssues().map((
|
|
211
|
-
...
|
|
212
|
-
message: `Extension point validation: ${
|
|
210
|
+
const b = d.getIssues().map((f) => ({
|
|
211
|
+
...f,
|
|
212
|
+
message: `Extension point validation: ${f.message}`
|
|
213
213
|
}));
|
|
214
214
|
if (w.set(a, b), d.hasErrors()) {
|
|
215
215
|
console.error(
|
|
216
|
-
`Validation failed for ${
|
|
217
|
-
b.filter((
|
|
216
|
+
`Validation failed for ${t.id} contribution "${a}":`,
|
|
217
|
+
b.filter((f) => f.type === "error").map((f) => f.message).join(", ")
|
|
218
218
|
);
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
221
|
} else
|
|
222
222
|
w.set(a, []);
|
|
223
223
|
}
|
|
224
|
-
const l =
|
|
225
|
-
t
|
|
224
|
+
const l = t.transform ? t.transform(r, c) : r;
|
|
225
|
+
e[t.id] || (e[t.id] = {});
|
|
226
226
|
const u = {
|
|
227
227
|
id: a,
|
|
228
|
-
type:
|
|
228
|
+
type: t.contributionKey,
|
|
229
229
|
data: l,
|
|
230
230
|
remote: c.remote,
|
|
231
231
|
sectionId: c.sectionId
|
|
232
232
|
};
|
|
233
|
-
if (
|
|
233
|
+
if (t.isRankable && typeof r.rank == "number" && (u.rank = r.rank), l && typeof l == "object" && ("component" in l && (u.component = l.component), "view" in l && (u.view = l.view), "location" in l && (u.location = l.location)), e[t.id][a] = u, t.hasView && ((m = t.relatedPoints) != null && m.view)) {
|
|
234
234
|
const d = r.experienceId, p = s == null ? void 0 : s[d];
|
|
235
|
-
p && (t
|
|
235
|
+
p && (e[t.relatedPoints.view] || (e[t.relatedPoints.view] = {}), e[t.relatedPoints.view][a] = {
|
|
236
236
|
id: a,
|
|
237
|
-
type: `${
|
|
237
|
+
type: `${t.contributionKey}.view`,
|
|
238
238
|
data: p,
|
|
239
239
|
remote: c.remote,
|
|
240
240
|
sectionId: c.sectionId
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
(h =
|
|
243
|
+
(h = t.relatedPoints) != null && h.definition && (e[t.relatedPoints.definition] || (e[t.relatedPoints.definition] = {}), e[t.relatedPoints.definition][a] = {
|
|
244
244
|
id: a,
|
|
245
|
-
type: `${
|
|
245
|
+
type: `${t.contributionKey}.definition`,
|
|
246
246
|
data: l,
|
|
247
247
|
remote: c.remote,
|
|
248
248
|
sectionId: c.sectionId
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
-
),
|
|
251
|
+
), e;
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
@@ -256,7 +256,7 @@ class J {
|
|
|
256
256
|
*/
|
|
257
257
|
getAllExtensionPoints() {
|
|
258
258
|
return Array.from(this.extensionPoints.values()).filter(
|
|
259
|
-
(
|
|
259
|
+
(t) => t.isRegistered
|
|
260
260
|
);
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
@@ -268,14 +268,14 @@ class J {
|
|
|
268
268
|
/**
|
|
269
269
|
* Get a specific extension point definition
|
|
270
270
|
*/
|
|
271
|
-
getExtensionPoint(
|
|
272
|
-
return this.extensionPoints.get(
|
|
271
|
+
getExtensionPoint(t) {
|
|
272
|
+
return this.extensionPoints.get(t);
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
275
|
* Check if an extension point is registered
|
|
276
276
|
*/
|
|
277
|
-
hasExtensionPoint(
|
|
278
|
-
return this.extensionPoints.has(
|
|
277
|
+
hasExtensionPoint(t) {
|
|
278
|
+
return this.extensionPoints.has(t);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
const O = new J();
|
|
@@ -284,18 +284,18 @@ function y() {
|
|
|
284
284
|
}
|
|
285
285
|
function Z(n = {}) {
|
|
286
286
|
const {
|
|
287
|
-
experienceIdProperty:
|
|
288
|
-
flattenComponentProperties:
|
|
287
|
+
experienceIdProperty: t = "experienceId",
|
|
288
|
+
flattenComponentProperties: e = !0,
|
|
289
289
|
customTransform: i
|
|
290
290
|
} = n;
|
|
291
291
|
return (s, o) => {
|
|
292
292
|
var l;
|
|
293
|
-
const a = s[
|
|
293
|
+
const a = s[t], r = a ? ((l = o.experiences) == null ? void 0 : l[a]) || {} : {};
|
|
294
294
|
let c = {
|
|
295
295
|
...s,
|
|
296
296
|
view: r
|
|
297
297
|
};
|
|
298
|
-
return
|
|
298
|
+
return e && r && (r.component && (c.component = r.component), r.location && (c.location = r.location)), i && (c = i(s, r, o) || c), c;
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
301
|
function Y(n) {
|
|
@@ -308,7 +308,7 @@ const Q = {
|
|
|
308
308
|
$env: () => process.env.NODE_ENV || "development"
|
|
309
309
|
};
|
|
310
310
|
function X(n) {
|
|
311
|
-
const
|
|
311
|
+
const t = {
|
|
312
312
|
id: n.id,
|
|
313
313
|
displayName: n.displayName,
|
|
314
314
|
description: n.description,
|
|
@@ -321,128 +321,128 @@ function X(n) {
|
|
|
321
321
|
exportName: n.metadata.exportName || ee(n.id)
|
|
322
322
|
} : void 0
|
|
323
323
|
};
|
|
324
|
-
return n.schema && (
|
|
324
|
+
return n.schema && (t.schema = te(n.schema, {
|
|
325
325
|
hasView: n.hasView,
|
|
326
326
|
isRankable: n.isRankable
|
|
327
|
-
})), n.validation && (
|
|
327
|
+
})), n.validation && (t.validate = ie(n.validation)), n.transform ? t.transform = de(n.transform) : n.hasView && (t.transform = Z()), t;
|
|
328
328
|
}
|
|
329
329
|
function ee(n) {
|
|
330
|
-
return n.split(".").map((
|
|
330
|
+
return n.split(".").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join("") + "Extension";
|
|
331
331
|
}
|
|
332
|
-
function te(n,
|
|
332
|
+
function te(n, t) {
|
|
333
333
|
try {
|
|
334
|
-
const { z:
|
|
334
|
+
const { z: e } = require("zod");
|
|
335
335
|
if (n.properties) {
|
|
336
336
|
const i = {};
|
|
337
|
-
i.id =
|
|
337
|
+
i.id = e.string().min(1), i.title = e.string().min(1), i.namespace = e.string().min(1), t != null && t.hasView && (i.experienceId = e.string().min(1)), t != null && t.isRankable && (i.rank = e.number().min(0).max(1e3).optional());
|
|
338
338
|
for (const [o, a] of Object.entries(n.properties))
|
|
339
|
-
i[o] = ne(a,
|
|
340
|
-
let s =
|
|
339
|
+
i[o] = ne(a, e);
|
|
340
|
+
let s = e.object(i);
|
|
341
341
|
return n.additionalProperties || (s = s.strict()), s;
|
|
342
342
|
}
|
|
343
|
-
return
|
|
344
|
-
} catch (
|
|
345
|
-
console.warn("Zod not available for JSON schema conversion:",
|
|
343
|
+
return e.any();
|
|
344
|
+
} catch (e) {
|
|
345
|
+
console.warn("Zod not available for JSON schema conversion:", e);
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
function ne(n,
|
|
350
|
-
let
|
|
349
|
+
function ne(n, t) {
|
|
350
|
+
let e;
|
|
351
351
|
switch (n.type) {
|
|
352
352
|
case "string":
|
|
353
|
-
|
|
353
|
+
e = t.string(), n.minLength && (e = e.min(n.minLength)), n.maxLength && (e = e.max(n.maxLength)), n.pattern && (e = e.regex(new RegExp(n.pattern))), n.enum && (e = t.enum(n.enum));
|
|
354
354
|
break;
|
|
355
355
|
case "number":
|
|
356
|
-
|
|
356
|
+
e = t.number(), n.minimum !== void 0 && (e = e.min(n.minimum)), n.maximum !== void 0 && (e = e.max(n.maximum));
|
|
357
357
|
break;
|
|
358
358
|
case "boolean":
|
|
359
|
-
|
|
359
|
+
e = t.boolean();
|
|
360
360
|
break;
|
|
361
361
|
case "array":
|
|
362
|
-
|
|
362
|
+
e = t.array(t.any());
|
|
363
363
|
break;
|
|
364
364
|
case "object":
|
|
365
|
-
|
|
365
|
+
e = t.object({});
|
|
366
366
|
break;
|
|
367
367
|
default:
|
|
368
|
-
|
|
368
|
+
e = t.any();
|
|
369
369
|
}
|
|
370
|
-
return n.description && (
|
|
370
|
+
return n.description && (e = e.describe(n.description)), n.default !== void 0 && (e = e.default(n.default)), e;
|
|
371
371
|
}
|
|
372
372
|
function ie(n) {
|
|
373
|
-
return n.module ? ue(n.module) : (
|
|
373
|
+
return n.module ? ue(n.module) : (t, e) => {
|
|
374
374
|
if (!n.rules)
|
|
375
375
|
return;
|
|
376
|
-
const i =
|
|
376
|
+
const i = t;
|
|
377
377
|
for (const s of n.rules)
|
|
378
|
-
se(s, i,
|
|
378
|
+
se(s, i, e);
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
function se(n,
|
|
381
|
+
function se(n, t, e) {
|
|
382
382
|
switch (n.type) {
|
|
383
383
|
case "required":
|
|
384
|
-
oe(n,
|
|
384
|
+
oe(n, t, e);
|
|
385
385
|
break;
|
|
386
386
|
case "range":
|
|
387
|
-
re(n,
|
|
387
|
+
re(n, t, e);
|
|
388
388
|
break;
|
|
389
389
|
case "pattern":
|
|
390
|
-
ae(n,
|
|
390
|
+
ae(n, t, e);
|
|
391
391
|
break;
|
|
392
392
|
case "dependency":
|
|
393
|
-
ce(n,
|
|
393
|
+
ce(n, t, e);
|
|
394
394
|
break;
|
|
395
395
|
case "custom":
|
|
396
|
-
le(n,
|
|
396
|
+
le(n, t, e);
|
|
397
397
|
break;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
function oe(n,
|
|
401
|
-
n.field && !
|
|
400
|
+
function oe(n, t, e) {
|
|
401
|
+
n.field && !t[n.field] && e.addError(n.message || `Field '${n.field}' is required`);
|
|
402
402
|
}
|
|
403
|
-
function re(n,
|
|
404
|
-
if (n.field && typeof
|
|
405
|
-
const i =
|
|
406
|
-
n.min !== void 0 && i < n.min &&
|
|
403
|
+
function re(n, t, e) {
|
|
404
|
+
if (n.field && typeof t[n.field] == "number") {
|
|
405
|
+
const i = t[n.field];
|
|
406
|
+
n.min !== void 0 && i < n.min && e.addError(
|
|
407
407
|
n.message || `Field '${n.field}' must be at least ${n.min}`
|
|
408
|
-
), n.max !== void 0 && i > n.max &&
|
|
408
|
+
), n.max !== void 0 && i > n.max && e.addError(
|
|
409
409
|
n.message || `Field '${n.field}' must be at most ${n.max}`
|
|
410
410
|
);
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
function ae(n,
|
|
414
|
-
n.field && n.pattern && typeof
|
|
413
|
+
function ae(n, t, e) {
|
|
414
|
+
n.field && n.pattern && typeof t[n.field] == "string" && (new RegExp(n.pattern).test(t[n.field]) || e.addError(
|
|
415
415
|
n.message || `Field '${n.field}' does not match pattern ${n.pattern}`
|
|
416
416
|
));
|
|
417
417
|
}
|
|
418
|
-
function ce(n,
|
|
418
|
+
function ce(n, t, e) {
|
|
419
419
|
if (n.field && n.dependsOn && n.expression)
|
|
420
420
|
try {
|
|
421
|
-
$(n.expression,
|
|
421
|
+
$(n.expression, t) || e.addError(
|
|
422
422
|
n.message || `Field '${n.field}' dependency validation failed`
|
|
423
423
|
);
|
|
424
424
|
} catch (i) {
|
|
425
|
-
|
|
425
|
+
e.addWarning(`Failed to evaluate dependency expression: ${i}`);
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
|
-
function le(n,
|
|
428
|
+
function le(n, t, e) {
|
|
429
429
|
if (n.expression)
|
|
430
430
|
try {
|
|
431
|
-
$(n.expression,
|
|
431
|
+
$(n.expression, t) || e.addError(n.message || "Custom validation failed");
|
|
432
432
|
} catch (i) {
|
|
433
|
-
|
|
433
|
+
e.addWarning(`Failed to evaluate custom expression: ${i}`);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
function ue(n) {
|
|
437
|
-
return (
|
|
438
|
-
console.warn(`External validation module not implemented: ${n}`),
|
|
437
|
+
return (t, e) => {
|
|
438
|
+
console.warn(`External validation module not implemented: ${n}`), e.addWarning(
|
|
439
439
|
`External validation module not yet supported: ${n}`
|
|
440
440
|
);
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
443
|
function de(n) {
|
|
444
|
-
return n.module ? pe(n.module) : (
|
|
445
|
-
const i = { ...
|
|
444
|
+
return n.module ? pe(n.module) : (t, e) => {
|
|
445
|
+
const i = { ...t };
|
|
446
446
|
if (n.addFields)
|
|
447
447
|
for (const [s, o] of Object.entries(n.addFields))
|
|
448
448
|
i[s] = fe(o);
|
|
@@ -464,18 +464,18 @@ function de(n) {
|
|
|
464
464
|
};
|
|
465
465
|
}
|
|
466
466
|
function pe(n) {
|
|
467
|
-
return (
|
|
467
|
+
return (t, e) => (console.warn(`External transform module not implemented: ${n}`), t);
|
|
468
468
|
}
|
|
469
469
|
function fe(n) {
|
|
470
470
|
if (typeof n == "string" && n.startsWith("$")) {
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
473
|
-
return
|
|
471
|
+
const t = Q[n];
|
|
472
|
+
if (t)
|
|
473
|
+
return t();
|
|
474
474
|
}
|
|
475
475
|
return n;
|
|
476
476
|
}
|
|
477
|
-
function me(n,
|
|
478
|
-
switch (
|
|
477
|
+
function me(n, t) {
|
|
478
|
+
switch (t) {
|
|
479
479
|
case "trim":
|
|
480
480
|
return n.trim();
|
|
481
481
|
case "lowercase":
|
|
@@ -491,81 +491,81 @@ function me(n, e) {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
function ge(n) {
|
|
494
|
-
return n.replace(/[-_\s]+(.)?/g, (
|
|
494
|
+
return n.replace(/[-_\s]+(.)?/g, (t, e) => e ? e.toUpperCase() : "").replace(/^./, (t) => t.toLowerCase());
|
|
495
495
|
}
|
|
496
496
|
function he(n) {
|
|
497
497
|
return n.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
498
498
|
}
|
|
499
|
-
function $(n,
|
|
499
|
+
function $(n, t) {
|
|
500
500
|
try {
|
|
501
|
-
let
|
|
502
|
-
for (const [i, s] of Object.entries(
|
|
501
|
+
let e = n;
|
|
502
|
+
for (const [i, s] of Object.entries(t)) {
|
|
503
503
|
const o = typeof s == "string" ? `"${s}"` : String(s);
|
|
504
|
-
|
|
504
|
+
e = e.replace(
|
|
505
505
|
new RegExp(`\\b${i}\\b`, "g"),
|
|
506
506
|
o
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
|
-
if (
|
|
510
|
-
const [i, s] =
|
|
509
|
+
if (e.includes("!==")) {
|
|
510
|
+
const [i, s] = e.split("!==").map((o) => o.trim());
|
|
511
511
|
return i !== s;
|
|
512
512
|
}
|
|
513
|
-
if (
|
|
514
|
-
const [i, s] =
|
|
513
|
+
if (e.includes("===")) {
|
|
514
|
+
const [i, s] = e.split("===").map((o) => o.trim());
|
|
515
515
|
return i === s;
|
|
516
516
|
}
|
|
517
|
-
return
|
|
518
|
-
} catch (
|
|
519
|
-
return console.error("Expression evaluation failed:",
|
|
517
|
+
return e.includes("||") ? e.split("||").map((s) => s.trim()).some((s) => $(s, t)) : e.includes("&&") ? e.split("&&").map((s) => s.trim()).every((s) => $(s, t)) : !1;
|
|
518
|
+
} catch (e) {
|
|
519
|
+
return console.error("Expression evaluation failed:", e), !1;
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
const ye = (n) => (
|
|
522
|
+
const ye = (n) => (t, e) => {
|
|
523
523
|
var c;
|
|
524
|
-
const i = n[
|
|
524
|
+
const i = n[e].remote, s = e, o = (c = n[e].contributes) == null ? void 0 : c.experiences;
|
|
525
525
|
return Object.keys(o).forEach((l) => {
|
|
526
526
|
const u = o[l];
|
|
527
|
-
|
|
527
|
+
t.experiences[l] = {
|
|
528
528
|
...u,
|
|
529
529
|
remote: i,
|
|
530
530
|
sectionId: s
|
|
531
531
|
};
|
|
532
532
|
}), y().getAllExtensionPoints().forEach((l) => {
|
|
533
533
|
var h;
|
|
534
|
-
const { contributionKey: u } = l.config,
|
|
535
|
-
|
|
536
|
-
d && d.id && (
|
|
534
|
+
const { contributionKey: u } = l.config, m = (h = n[e].contributes) == null ? void 0 : h[u];
|
|
535
|
+
m && (t[u] || (t[u] = {}), Array.isArray(m) ? m.forEach((d) => {
|
|
536
|
+
d && d.id && (t[u][d.id] = {
|
|
537
537
|
...d,
|
|
538
538
|
remote: i,
|
|
539
539
|
sectionId: s
|
|
540
540
|
});
|
|
541
|
-
}) : typeof
|
|
542
|
-
|
|
541
|
+
}) : typeof m == "object" && Object.entries(m).forEach(([d, p]) => {
|
|
542
|
+
t[u][d] = {
|
|
543
543
|
...p,
|
|
544
544
|
id: d,
|
|
545
545
|
remote: i,
|
|
546
546
|
sectionId: s
|
|
547
547
|
};
|
|
548
548
|
}));
|
|
549
|
-
}),
|
|
549
|
+
}), t;
|
|
550
550
|
};
|
|
551
551
|
async function be(n) {
|
|
552
|
-
const
|
|
552
|
+
const t = n ?? window.KosPlugins.__dynamicRemotes;
|
|
553
553
|
if (window.KosPlugins.extensions) {
|
|
554
554
|
const o = window.KosPlugins.extensions;
|
|
555
555
|
return {
|
|
556
556
|
extensionPoints: o,
|
|
557
557
|
getExtensions: (a) => o[a] || [],
|
|
558
|
-
remotes:
|
|
558
|
+
remotes: t,
|
|
559
559
|
extensions: window.KosPlugins.__extensions
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
564
|
-
for (const o of Object.keys(
|
|
562
|
+
const e = window.KosPlugins.__extensions ?? await Ee(t), i = {};
|
|
563
|
+
if (e)
|
|
564
|
+
for (const o of Object.keys(e))
|
|
565
565
|
i[o] = Object.values(
|
|
566
|
-
|
|
566
|
+
e[o] || {}
|
|
567
567
|
);
|
|
568
|
-
return window.KosPlugins.extensions = i, { extensionPoints: i, getExtensions: (o) => i[o] || [], remotes:
|
|
568
|
+
return window.KosPlugins.extensions = i, { extensionPoints: i, getExtensions: (o) => i[o] || [], remotes: t, extensions: e };
|
|
569
569
|
}
|
|
570
570
|
const T = {
|
|
571
571
|
controlPourDefinitions: {},
|
|
@@ -618,55 +618,55 @@ async function Ee(n) {
|
|
|
618
618
|
console.warn(`Failed to load InitPlugin from ${o.remote}:`, a);
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
const
|
|
621
|
+
const t = xe(n), e = t.experiences, s = G(
|
|
622
622
|
{},
|
|
623
|
-
|
|
624
|
-
|
|
623
|
+
t,
|
|
624
|
+
e
|
|
625
625
|
);
|
|
626
626
|
return window.KosPlugins = window.KosPlugins || {}, window.KosPlugins.__extensions = s, s;
|
|
627
627
|
}
|
|
628
628
|
async function Se(n) {
|
|
629
|
-
const { getExtensions:
|
|
630
|
-
return
|
|
629
|
+
const { getExtensions: t } = await be();
|
|
630
|
+
return t(n);
|
|
631
631
|
}
|
|
632
|
-
const Pe = (n = null) => (n || window.location.search.replace("?", "")).split("&").map((
|
|
633
|
-
const [
|
|
634
|
-
return [
|
|
635
|
-
}).reduce((
|
|
636
|
-
const n = window.location.origin,
|
|
637
|
-
return (
|
|
632
|
+
const Pe = (n = null) => (n || window.location.search.replace("?", "")).split("&").map((t) => {
|
|
633
|
+
const [e, i] = t.split("=");
|
|
634
|
+
return [e, decodeURIComponent(i || "")];
|
|
635
|
+
}).reduce((t, [e, i]) => (t[e] = i, t), {}), ve = () => {
|
|
636
|
+
const n = window.location.origin, t = Pe();
|
|
637
|
+
return (t == null ? void 0 : t.host) || n;
|
|
638
638
|
}, Fe = async (n) => {
|
|
639
|
-
var
|
|
640
|
-
const
|
|
641
|
-
pluginBaseUrl: i =
|
|
639
|
+
var b;
|
|
640
|
+
const t = ve(), e = n ?? {}, {
|
|
641
|
+
pluginBaseUrl: i = t,
|
|
642
642
|
pluginApiPath: s = "/api/app/kosdev.ddk/ncui/plugins",
|
|
643
643
|
overrides: o = {},
|
|
644
644
|
pluginContext: a
|
|
645
|
-
} =
|
|
645
|
+
} = e, r = !!a, c = r ? `${i}/api/kos/ui/plugins/contexts` : `${i}${s}`;
|
|
646
646
|
console.log(
|
|
647
647
|
`initialize-plugins: Using Plugin Framework: ${r}: Fetching plugins from ${c}`
|
|
648
648
|
);
|
|
649
|
-
const u = await (await fetch(c)).json(),
|
|
650
|
-
const C = (o == null ? void 0 : o[
|
|
651
|
-
return
|
|
649
|
+
const u = await (await fetch(c)).json(), m = typeof (a == null ? void 0 : a.context) == "string" ? [a.context] : (a == null ? void 0 : a.context) || [], h = r ? ((b = u.data) == null ? void 0 : b.filter((f) => m.includes(f.name)).flatMap((f) => f.plugins)) ?? [] : u.data ?? [], d = h == null ? void 0 : h.reduce((f, g) => {
|
|
650
|
+
const C = (o == null ? void 0 : o[g.id]) ?? r ? `${i}${g.path}` : `${i}${g.baseUrl}`;
|
|
651
|
+
return g.descriptor ? f[g.id] = {
|
|
652
652
|
basePath: `${C}remoteEntry.js`,
|
|
653
|
-
extensions:
|
|
654
|
-
contributes:
|
|
655
|
-
remote:
|
|
656
|
-
init: !!
|
|
653
|
+
extensions: g.descriptor.extensions || [],
|
|
654
|
+
contributes: g.descriptor.contributes,
|
|
655
|
+
remote: g.descriptor.id,
|
|
656
|
+
init: !!g.descriptor.init
|
|
657
657
|
} : console.error(
|
|
658
|
-
`initialize-plugins: Plugin ${
|
|
659
|
-
),
|
|
658
|
+
`initialize-plugins: Plugin ${g.id} does not have a descriptor`
|
|
659
|
+
), f;
|
|
660
660
|
}, {});
|
|
661
|
-
window.KosPlugins = window.KosPlugins || {}, window.KosPlugins.__dynamicRemotes =
|
|
662
|
-
const
|
|
663
|
-
const C =
|
|
664
|
-
return
|
|
661
|
+
window.KosPlugins = window.KosPlugins || {}, window.KosPlugins.__dynamicRemotes = d;
|
|
662
|
+
const p = Object.keys(d).reduce((f, g) => {
|
|
663
|
+
const C = d[g].remote;
|
|
664
|
+
return f[C] = d[g].basePath, f;
|
|
665
665
|
}, {});
|
|
666
|
-
return k.setRemoteDefinitions(
|
|
666
|
+
return k.setRemoteDefinitions(p), p;
|
|
667
667
|
};
|
|
668
|
-
function _e(n,
|
|
669
|
-
return !n || Object.keys(n).length === 0 ? null :
|
|
668
|
+
function _e(n, t, e = !1) {
|
|
669
|
+
return !n || Object.keys(n).length === 0 ? null : e ? t && n[t] ? n[t] : null : t && n[t] ? n[t] : Object.values(n).filter((s) => typeof s.id == "string").sort((s, o) => {
|
|
670
670
|
const a = typeof s.rank == "number" ? s.rank : 1 / 0, r = typeof o.rank == "number" ? o.rank : 1 / 0;
|
|
671
671
|
if (a === r) {
|
|
672
672
|
const c = s.id ?? "", l = o.id ?? "";
|
|
@@ -683,39 +683,39 @@ const D = E.object({
|
|
|
683
683
|
}), we = D.extend({
|
|
684
684
|
rank: E.number().int().min(0).optional().describe("Optional ranking for ordering (higher = preferred)")
|
|
685
685
|
});
|
|
686
|
-
function Te(n,
|
|
687
|
-
const i = n.safeParse(
|
|
686
|
+
function Te(n, t, e) {
|
|
687
|
+
const i = n.safeParse(t);
|
|
688
688
|
return i.success ? !0 : (i.error.errors.forEach((s) => {
|
|
689
|
-
|
|
689
|
+
e.addError(`${s.path.join(".")}: ${s.message}`);
|
|
690
690
|
}), !1);
|
|
691
691
|
}
|
|
692
|
-
function Ue(n,
|
|
693
|
-
|
|
694
|
-
`${n} '${
|
|
692
|
+
function Ue(n, t, e) {
|
|
693
|
+
t && !t.includes(".") && e.addWarning(
|
|
694
|
+
`${n} '${t}' should typically include dot notation (e.g., 'category.item')`
|
|
695
695
|
);
|
|
696
696
|
}
|
|
697
|
-
function $e(n,
|
|
698
|
-
n !== void 0 && n >
|
|
697
|
+
function $e(n, t, e = 1e3) {
|
|
698
|
+
n !== void 0 && n > e && t.addWarning(
|
|
699
699
|
`Rank ${n} seems unusually high - consider using lower values for better ordering`
|
|
700
700
|
);
|
|
701
701
|
}
|
|
702
|
-
function Oe(n,
|
|
703
|
-
return (
|
|
702
|
+
function Oe(n, t = {}) {
|
|
703
|
+
return (t.rankable ? we : D).extend(n);
|
|
704
704
|
}
|
|
705
|
-
function De(n,
|
|
706
|
-
typeof n == "object" && n !== null && "rank" in n && $e(n.rank,
|
|
705
|
+
function De(n, t, e = 1e3) {
|
|
706
|
+
typeof n == "object" && n !== null && "rank" in n && $e(n.rank, t, e);
|
|
707
707
|
}
|
|
708
708
|
class I {
|
|
709
709
|
/**
|
|
710
710
|
* Get all extension points with their plugin information
|
|
711
711
|
*/
|
|
712
|
-
static getExtensionPoints(
|
|
712
|
+
static getExtensionPoints(t, e = {}) {
|
|
713
713
|
const {
|
|
714
714
|
includeLegacyExtensions: i = !0,
|
|
715
715
|
includeEmptyExtensionPoints: s = !0
|
|
716
|
-
} =
|
|
716
|
+
} = e, a = y().getAllExtensionPoints(), r = [];
|
|
717
717
|
return a.forEach((c) => {
|
|
718
|
-
const l = Object.values((
|
|
718
|
+
const l = Object.values((t == null ? void 0 : t[c.id]) || {});
|
|
719
719
|
!s && l.length === 0 || r.push({
|
|
720
720
|
id: c.id,
|
|
721
721
|
displayName: c.config.displayName,
|
|
@@ -725,8 +725,8 @@ class I {
|
|
|
725
725
|
pluginCount: l.length,
|
|
726
726
|
plugins: l
|
|
727
727
|
});
|
|
728
|
-
}), i &&
|
|
729
|
-
if (r.some((
|
|
728
|
+
}), i && t && Object.entries(t).forEach(([c, l]) => {
|
|
729
|
+
if (r.some((m) => m.id === c))
|
|
730
730
|
return;
|
|
731
731
|
const u = Object.values(l || {});
|
|
732
732
|
!s && u.length === 0 || r.push({
|
|
@@ -740,38 +740,38 @@ class I {
|
|
|
740
740
|
/**
|
|
741
741
|
* Filter extension points based on search criteria
|
|
742
742
|
*/
|
|
743
|
-
static filterExtensionPoints(
|
|
744
|
-
if (!
|
|
745
|
-
return
|
|
746
|
-
const i =
|
|
747
|
-
return
|
|
743
|
+
static filterExtensionPoints(t, e) {
|
|
744
|
+
if (!e.trim())
|
|
745
|
+
return t;
|
|
746
|
+
const i = e.toLowerCase();
|
|
747
|
+
return t.filter(
|
|
748
748
|
(s) => {
|
|
749
749
|
var o, a, r, c, l, u;
|
|
750
|
-
return s.id.toLowerCase().includes(i) || ((o = s.displayName) == null ? void 0 : o.toLowerCase().includes(i)) || ((a = s.description) == null ? void 0 : a.toLowerCase().includes(i)) || ((c = (r = s.metadata) == null ? void 0 : r.category) == null ? void 0 : c.toLowerCase().includes(i)) || ((u = (l = s.metadata) == null ? void 0 : l.tags) == null ? void 0 : u.some((
|
|
750
|
+
return s.id.toLowerCase().includes(i) || ((o = s.displayName) == null ? void 0 : o.toLowerCase().includes(i)) || ((a = s.description) == null ? void 0 : a.toLowerCase().includes(i)) || ((c = (r = s.metadata) == null ? void 0 : r.category) == null ? void 0 : c.toLowerCase().includes(i)) || ((u = (l = s.metadata) == null ? void 0 : l.tags) == null ? void 0 : u.some((m) => m.toLowerCase().includes(i)));
|
|
751
751
|
}
|
|
752
752
|
);
|
|
753
753
|
}
|
|
754
754
|
/**
|
|
755
755
|
* Calculate health statistics for the plugin system
|
|
756
756
|
*/
|
|
757
|
-
static calculateHealthStats(
|
|
758
|
-
const
|
|
757
|
+
static calculateHealthStats(t) {
|
|
758
|
+
const e = t.length, i = t.filter(
|
|
759
759
|
(c) => c.pluginCount > 0
|
|
760
|
-
).length, s =
|
|
760
|
+
).length, s = t.reduce(
|
|
761
761
|
(c, l) => c + l.pluginCount,
|
|
762
762
|
0
|
|
763
|
-
), o =
|
|
763
|
+
), o = t.filter(
|
|
764
764
|
(c) => c.source === "simplified"
|
|
765
|
-
).length, a =
|
|
765
|
+
).length, a = t.filter(
|
|
766
766
|
(c) => c.source === "legacy"
|
|
767
|
-
).length, r =
|
|
767
|
+
).length, r = t.filter(
|
|
768
768
|
(c) => {
|
|
769
769
|
var l;
|
|
770
770
|
return (l = c.metadata) == null ? void 0 : l.deprecated;
|
|
771
771
|
}
|
|
772
772
|
).length;
|
|
773
773
|
return {
|
|
774
|
-
totalExtensionPoints:
|
|
774
|
+
totalExtensionPoints: e,
|
|
775
775
|
extensionPointsWithPlugins: i,
|
|
776
776
|
totalPlugins: s,
|
|
777
777
|
simplifiedExtensionPoints: o,
|
|
@@ -782,16 +782,16 @@ class I {
|
|
|
782
782
|
/**
|
|
783
783
|
* Analyze a specific plugin for health and capabilities
|
|
784
784
|
*/
|
|
785
|
-
static analyzePlugin(
|
|
786
|
-
const
|
|
787
|
-
if (
|
|
788
|
-
const r =
|
|
785
|
+
static analyzePlugin(t) {
|
|
786
|
+
const e = !!t.component, i = typeof t.rank == "number", s = t.rank || 0, o = [];
|
|
787
|
+
if (e ? o.push("UI Component") : o.push("Background Service"), i && o.push(`Rank: ${s}`), t.namespace) {
|
|
788
|
+
const r = t.namespace;
|
|
789
789
|
r.includes("kos") || r.includes("ddk") ? o.push("First-party") : o.push("Third-party");
|
|
790
790
|
}
|
|
791
|
-
|
|
791
|
+
t.modalMode && o.push(`Modal: ${t.modalMode}`);
|
|
792
792
|
let a = "healthy";
|
|
793
|
-
return
|
|
794
|
-
hasComponent:
|
|
793
|
+
return t.remote || (a = "warning"), {
|
|
794
|
+
hasComponent: e,
|
|
795
795
|
hasRank: i,
|
|
796
796
|
healthStatus: a,
|
|
797
797
|
capabilities: o
|
|
@@ -800,55 +800,55 @@ class I {
|
|
|
800
800
|
/**
|
|
801
801
|
* Get extension point by ID with detailed information
|
|
802
802
|
*/
|
|
803
|
-
static getExtensionPointById(
|
|
804
|
-
return
|
|
803
|
+
static getExtensionPointById(t, e) {
|
|
804
|
+
return t.find((i) => i.id === e);
|
|
805
805
|
}
|
|
806
806
|
/**
|
|
807
807
|
* Validate if an extension point ID follows conventions
|
|
808
808
|
*/
|
|
809
|
-
static validateExtensionPointId(
|
|
810
|
-
const
|
|
811
|
-
|
|
809
|
+
static validateExtensionPointId(t) {
|
|
810
|
+
const e = [], i = [];
|
|
811
|
+
t.includes(".") || (e.push(
|
|
812
812
|
"Extension point ID should contain at least one dot (namespace.feature)"
|
|
813
813
|
), i.push('Use format like "ddk.myFeature" or "app.myFeature"'));
|
|
814
|
-
const s =
|
|
815
|
-
s.length < 2 &&
|
|
814
|
+
const s = t.split(".");
|
|
815
|
+
s.length < 2 && e.push(
|
|
816
816
|
"Extension point ID should have at least 2 parts (namespace.feature)"
|
|
817
817
|
);
|
|
818
818
|
const o = s[0];
|
|
819
819
|
return o && !["ddk", "cui", "app"].includes(o) && !o.endsWith("app") && i.push(
|
|
820
820
|
"Consider using standard namespaces: ddk, cui, or [appname]app"
|
|
821
|
-
), s.some((r) => /[A-Z]/.test(r)) && (
|
|
821
|
+
), s.some((r) => /[A-Z]/.test(r)) && (e.push("Extension point ID parts should be lowercase"), i.push(
|
|
822
822
|
'Use kebab-case or dot notation: "my.feature" not "my.myFeature"'
|
|
823
823
|
)), {
|
|
824
|
-
isValid:
|
|
825
|
-
issues:
|
|
824
|
+
isValid: e.length === 0,
|
|
825
|
+
issues: e,
|
|
826
826
|
suggestions: i
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
829
|
/**
|
|
830
830
|
* Validate a plugin descriptor structure and content
|
|
831
831
|
*/
|
|
832
|
-
static validatePluginDescriptor(
|
|
833
|
-
const
|
|
834
|
-
if (
|
|
832
|
+
static validatePluginDescriptor(t) {
|
|
833
|
+
const e = [], i = [], s = [], o = [];
|
|
834
|
+
if (t.id ? t.id.match(/^[a-z0-9-]+$/) || o.push(
|
|
835
835
|
"Plugin ID convention: use lowercase letters, numbers, and hyphens (e.g., 'my-awesome-plugin')"
|
|
836
|
-
) : (s.push("id"),
|
|
836
|
+
) : (s.push("id"), e.push("Plugin descriptor must have an 'id' field")), !t.contributes)
|
|
837
837
|
i.push(
|
|
838
838
|
"Plugin has no contributions - it won't extend any functionality"
|
|
839
839
|
), o.push("Add a 'contributes' section with plugin contributions");
|
|
840
840
|
else {
|
|
841
|
-
const a = Object.keys(
|
|
841
|
+
const a = Object.keys(t.contributes);
|
|
842
842
|
a.length === 0 && i.push("Plugin contributes section is empty"), a.forEach((r) => {
|
|
843
|
-
const c =
|
|
843
|
+
const c = t.contributes[r];
|
|
844
844
|
if (!Array.isArray(c)) {
|
|
845
|
-
|
|
845
|
+
e.push(`Contribution '${r}' must be an array`);
|
|
846
846
|
return;
|
|
847
847
|
}
|
|
848
848
|
c.forEach((l, u) => {
|
|
849
|
-
l.id ||
|
|
849
|
+
l.id || e.push(
|
|
850
850
|
`Contribution ${r}[${u}] missing required 'id' field`
|
|
851
|
-
), r === "experiences" && l.component && !l.location && (
|
|
851
|
+
), r === "experiences" && l.component && !l.location && (e.push(
|
|
852
852
|
`Experience '${l.id}' has component but no location`
|
|
853
853
|
), o.push(
|
|
854
854
|
"Add 'location' field pointing to the component file"
|
|
@@ -856,15 +856,15 @@ class I {
|
|
|
856
856
|
`${r} contribution '${l.id}' missing 'title' field`
|
|
857
857
|
), l.namespace || i.push(
|
|
858
858
|
`${r} contribution '${l.id}' missing 'namespace' field`
|
|
859
|
-
), l.experienceId ||
|
|
859
|
+
), l.experienceId || e.push(
|
|
860
860
|
`${r} contribution '${l.id}' missing required 'experienceId' field`
|
|
861
861
|
));
|
|
862
862
|
});
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
return
|
|
866
|
-
isValid:
|
|
867
|
-
errors:
|
|
865
|
+
return t.init !== void 0 && typeof t.init != "boolean" && e.push("'init' field must be a boolean value"), {
|
|
866
|
+
isValid: e.length === 0 && s.length === 0,
|
|
867
|
+
errors: e,
|
|
868
868
|
warnings: i,
|
|
869
869
|
missingRequired: s,
|
|
870
870
|
suggestions: o
|
|
@@ -873,9 +873,9 @@ class I {
|
|
|
873
873
|
/**
|
|
874
874
|
* Check compatibility between plugin contributions and available extension points
|
|
875
875
|
*/
|
|
876
|
-
static checkPluginCompatibility(
|
|
876
|
+
static checkPluginCompatibility(t, e) {
|
|
877
877
|
const i = [], s = [], o = [], a = [];
|
|
878
|
-
if (!
|
|
878
|
+
if (!t.contributes)
|
|
879
879
|
return {
|
|
880
880
|
isCompatible: !0,
|
|
881
881
|
issues: ["Plugin has no contributions to check"],
|
|
@@ -884,9 +884,9 @@ class I {
|
|
|
884
884
|
suggestions: []
|
|
885
885
|
};
|
|
886
886
|
const r = y(), c = new Set(
|
|
887
|
-
|
|
887
|
+
e.map((l) => l.id)
|
|
888
888
|
);
|
|
889
|
-
return Object.entries(
|
|
889
|
+
return Object.entries(t.contributes).forEach(
|
|
890
890
|
([l, u]) => {
|
|
891
891
|
this.getExpectedExtensionPoints(l).forEach((p) => {
|
|
892
892
|
c.has(p) || (s.push(p), i.push(
|
|
@@ -921,7 +921,7 @@ class I {
|
|
|
921
921
|
/**
|
|
922
922
|
* Map contribution keys to their expected extension point IDs
|
|
923
923
|
*/
|
|
924
|
-
static getExpectedExtensionPoints(
|
|
924
|
+
static getExpectedExtensionPoints(t) {
|
|
925
925
|
return {
|
|
926
926
|
cui: ["ddk.cui", "ddk.cui.view", "ddk.cui.settings.config"],
|
|
927
927
|
utilities: ["ddk.utility", "ddk.utility.view", "ddk.utilities"],
|
|
@@ -934,21 +934,21 @@ class I {
|
|
|
934
934
|
// Experiences don't directly map to extension points
|
|
935
935
|
views: []
|
|
936
936
|
// Views are mapped by their extension point ID keys
|
|
937
|
-
}[
|
|
937
|
+
}[t] || [];
|
|
938
938
|
}
|
|
939
939
|
/**
|
|
940
940
|
* Get comprehensive plugin analysis including validation and compatibility
|
|
941
941
|
*/
|
|
942
|
-
static analyzePluginDescriptor(
|
|
943
|
-
const i = this.validatePluginDescriptor(
|
|
944
|
-
|
|
945
|
-
|
|
942
|
+
static analyzePluginDescriptor(t, e) {
|
|
943
|
+
const i = this.validatePluginDescriptor(t), s = this.checkPluginCompatibility(
|
|
944
|
+
t,
|
|
945
|
+
e
|
|
946
946
|
), o = [];
|
|
947
947
|
return i.warnings.length > 0 && o.push(
|
|
948
948
|
"Address validation warnings to improve plugin quality"
|
|
949
949
|
), s.isCompatible || o.push(
|
|
950
950
|
"Resolve compatibility issues before deploying plugin"
|
|
951
|
-
),
|
|
951
|
+
), t.contributes && Object.keys(t.contributes).length === 1 && o.push(
|
|
952
952
|
"Consider adding more contribution types to increase plugin value"
|
|
953
953
|
), {
|
|
954
954
|
validation: i,
|
|
@@ -961,14 +961,14 @@ class Ae {
|
|
|
961
961
|
/**
|
|
962
962
|
* Generate complete documentation for all extension points
|
|
963
963
|
*/
|
|
964
|
-
static generateFullDocumentation(
|
|
964
|
+
static generateFullDocumentation(t, e = {}) {
|
|
965
965
|
const {
|
|
966
966
|
includeUsageExamples: i = !0,
|
|
967
967
|
includeTypeDefinitions: s = !0,
|
|
968
968
|
includeLegacyExtensions: o = !0,
|
|
969
969
|
includePluginHealth: a = !0
|
|
970
|
-
} =
|
|
971
|
-
|
|
970
|
+
} = e, r = I.getExtensionPoints(
|
|
971
|
+
t,
|
|
972
972
|
{
|
|
973
973
|
includeLegacyExtensions: o,
|
|
974
974
|
includeEmptyExtensionPoints: !0
|
|
@@ -994,18 +994,18 @@ class Ae {
|
|
|
994
994
|
/**
|
|
995
995
|
* Generate documentation header with metadata
|
|
996
996
|
*/
|
|
997
|
-
static generateHeader(
|
|
997
|
+
static generateHeader(t) {
|
|
998
998
|
return `# KOS Plugin Extension Points Reference
|
|
999
999
|
|
|
1000
1000
|
**Generated**: ${(/* @__PURE__ */ new Date()).toLocaleString()}
|
|
1001
1001
|
|
|
1002
1002
|
## System Overview
|
|
1003
1003
|
|
|
1004
|
-
- **Total Extension Points**: ${
|
|
1005
|
-
- **Extension Points with Plugins**: ${
|
|
1006
|
-
- **Total Active Plugins**: ${
|
|
1007
|
-
- **Simplified Extension Points**: ${
|
|
1008
|
-
- **Legacy Extension Points**: ${
|
|
1004
|
+
- **Total Extension Points**: ${t.totalExtensionPoints}
|
|
1005
|
+
- **Extension Points with Plugins**: ${t.extensionPointsWithPlugins}
|
|
1006
|
+
- **Total Active Plugins**: ${t.totalPlugins}
|
|
1007
|
+
- **Simplified Extension Points**: ${t.simplifiedExtensionPoints}
|
|
1008
|
+
- **Legacy Extension Points**: ${t.legacyExtensionPoints}
|
|
1009
1009
|
|
|
1010
1010
|
---
|
|
1011
1011
|
|
|
@@ -1014,26 +1014,26 @@ class Ae {
|
|
|
1014
1014
|
/**
|
|
1015
1015
|
* Generate table of contents
|
|
1016
1016
|
*/
|
|
1017
|
-
static generateTableOfContents(
|
|
1018
|
-
let
|
|
1017
|
+
static generateTableOfContents(t) {
|
|
1018
|
+
let e = `## Table of Contents
|
|
1019
1019
|
|
|
1020
1020
|
`;
|
|
1021
|
-
return
|
|
1022
|
-
`,
|
|
1023
|
-
`,
|
|
1021
|
+
return e += `- [Overview](#overview)
|
|
1022
|
+
`, e += `- [Extension Points](#extension-points)
|
|
1023
|
+
`, t.forEach((i) => {
|
|
1024
1024
|
const s = i.id.toLowerCase().replace(/\./g, "");
|
|
1025
|
-
|
|
1025
|
+
e += ` - [${i.id}](#${s}) (${i.pluginCount} plugins)
|
|
1026
1026
|
`;
|
|
1027
|
-
}),
|
|
1028
|
-
`,
|
|
1029
|
-
`,
|
|
1027
|
+
}), e += `- [Type Definitions](#type-definitions)
|
|
1028
|
+
`, e += `- [Contribution Guide](#contribution-guide)
|
|
1029
|
+
`, e += `- [Troubleshooting](#troubleshooting)
|
|
1030
1030
|
|
|
1031
|
-
`,
|
|
1031
|
+
`, e;
|
|
1032
1032
|
}
|
|
1033
1033
|
/**
|
|
1034
1034
|
* Generate overview section with health statistics
|
|
1035
1035
|
*/
|
|
1036
|
-
static generateOverviewSection(
|
|
1036
|
+
static generateOverviewSection(t, e) {
|
|
1037
1037
|
let i = `## Overview
|
|
1038
1038
|
|
|
1039
1039
|
`;
|
|
@@ -1041,11 +1041,11 @@ class Ae {
|
|
|
1041
1041
|
|
|
1042
1042
|
`, i += `### Extension Point Types
|
|
1043
1043
|
|
|
1044
|
-
`, i += "-
|
|
1044
|
+
`, i += "- ** Simplified Extension Points**: Use the new simplified API from `defineExtensionPoint`\n", i += `- ** Legacy Extension Points**: Use the traditional reducer-based system
|
|
1045
1045
|
|
|
1046
|
-
`,
|
|
1046
|
+
`, e.deprecatedExtensionPoints > 0 && (i += `### ⚠️ Deprecated Extension Points
|
|
1047
1047
|
|
|
1048
|
-
`, i += `${
|
|
1048
|
+
`, i += `${e.deprecatedExtensionPoints} extension points are marked as deprecated. `, i += `Consider migrating to newer alternatives.
|
|
1049
1049
|
|
|
1050
1050
|
`), i + `---
|
|
1051
1051
|
|
|
@@ -1054,24 +1054,24 @@ class Ae {
|
|
|
1054
1054
|
/**
|
|
1055
1055
|
* Generate documentation section for a single extension point
|
|
1056
1056
|
*/
|
|
1057
|
-
static generateExtensionPointSection(
|
|
1057
|
+
static generateExtensionPointSection(t, e) {
|
|
1058
1058
|
var a;
|
|
1059
|
-
const { includeUsageExamples: i = !0, includePluginHealth: s = !0 } =
|
|
1060
|
-
let o = `## ${
|
|
1059
|
+
const { includeUsageExamples: i = !0, includePluginHealth: s = !0 } = e;
|
|
1060
|
+
let o = `## ${t.id}
|
|
1061
1061
|
|
|
1062
1062
|
`;
|
|
1063
|
-
if (
|
|
1063
|
+
if (t.displayName && (o += `**Display Name**: ${t.displayName}
|
|
1064
1064
|
|
|
1065
|
-
`),
|
|
1065
|
+
`), t.description && (o += `**Description**: ${t.description}
|
|
1066
1066
|
|
|
1067
|
-
`), o += `**Source**: ${
|
|
1068
|
-
`, o += `**Active Plugins**: ${
|
|
1067
|
+
`), o += `**Source**: ${t.source}
|
|
1068
|
+
`, o += `**Active Plugins**: ${t.pluginCount}
|
|
1069
1069
|
|
|
1070
|
-
`,
|
|
1070
|
+
`, t.metadata) {
|
|
1071
1071
|
o += `### Metadata
|
|
1072
1072
|
|
|
1073
1073
|
`;
|
|
1074
|
-
const r =
|
|
1074
|
+
const r = t.metadata;
|
|
1075
1075
|
r.category && (o += `- **Category**: ${r.category}
|
|
1076
1076
|
`), r.owner && (o += `- **Owner**: ${r.owner}
|
|
1077
1077
|
`), r.since && (o += `- **Since**: ${r.since}
|
|
@@ -1080,110 +1080,110 @@ class Ae {
|
|
|
1080
1080
|
`), o += `
|
|
1081
1081
|
`;
|
|
1082
1082
|
}
|
|
1083
|
-
return i && (o += this.generateUsageExamples(
|
|
1084
|
-
|
|
1083
|
+
return i && (o += this.generateUsageExamples(t)), t.plugins.length > 0 ? o += this.generatePluginList(
|
|
1084
|
+
t.plugins,
|
|
1085
1085
|
s
|
|
1086
1086
|
) : o += `### Plugins
|
|
1087
1087
|
|
|
1088
1088
|
No plugins currently registered for this extension point.
|
|
1089
1089
|
|
|
1090
|
-
`, o += this.generateSchemaFieldsSection(
|
|
1090
|
+
`, o += this.generateSchemaFieldsSection(t), o += this.generateContributionStructure(t), o + `---
|
|
1091
1091
|
|
|
1092
1092
|
`;
|
|
1093
1093
|
}
|
|
1094
1094
|
/**
|
|
1095
1095
|
* Generate usage examples for an extension point
|
|
1096
1096
|
*/
|
|
1097
|
-
static generateUsageExamples(
|
|
1098
|
-
let
|
|
1097
|
+
static generateUsageExamples(t) {
|
|
1098
|
+
let e = `### Usage Examples
|
|
1099
1099
|
|
|
1100
1100
|
`;
|
|
1101
|
-
return
|
|
1101
|
+
return t.source === "simplified" && (e += `#### Using Simplified API
|
|
1102
1102
|
|
|
1103
|
-
`,
|
|
1104
|
-
`,
|
|
1105
|
-
|
|
1103
|
+
`, e += "```typescript\n", e += `// Import the extension point
|
|
1104
|
+
`, e += `import { ${this.getExtensionPointImportName(
|
|
1105
|
+
t.id
|
|
1106
1106
|
)} } from './extension-points';
|
|
1107
1107
|
|
|
1108
|
-
`,
|
|
1109
|
-
`,
|
|
1108
|
+
`, e += `// Use extension component hook
|
|
1109
|
+
`, e += `import { useExtensionComponent } from '@kosdev-code/kos-ui-plugin';
|
|
1110
1110
|
|
|
1111
|
-
`,
|
|
1112
|
-
|
|
1111
|
+
`, e += `const Component = useExtensionComponent(${this.getExtensionPointImportName(
|
|
1112
|
+
t.id
|
|
1113
1113
|
)});
|
|
1114
1114
|
|
|
1115
|
-
`,
|
|
1116
|
-
`,
|
|
1117
|
-
`,
|
|
1118
|
-
`,
|
|
1119
|
-
`,
|
|
1120
|
-
`,
|
|
1121
|
-
`,
|
|
1122
|
-
`,
|
|
1123
|
-
|
|
1124
|
-
`,
|
|
1125
|
-
`,
|
|
1126
|
-
`,
|
|
1127
|
-
|
|
1115
|
+
`, e += `if (Component) {
|
|
1116
|
+
`, e += ` return (
|
|
1117
|
+
`, e += ` <Component
|
|
1118
|
+
`, e += ` customProp="value"
|
|
1119
|
+
`, e += ` onComplete={handleComplete}
|
|
1120
|
+
`, e += ` />
|
|
1121
|
+
`, e += ` );
|
|
1122
|
+
`, e += `}
|
|
1123
|
+
|
|
1124
|
+
`, e += `// Or use with dynamic component
|
|
1125
|
+
`, e += `const [Component] = useDynamicComponent({
|
|
1126
|
+
`, e += ` extension: ${this.getExtensionPointImportName(
|
|
1127
|
+
t.id
|
|
1128
1128
|
)}.id
|
|
1129
|
-
`,
|
|
1130
|
-
`,
|
|
1129
|
+
`, e += `});
|
|
1130
|
+
`, e += "```\n\n", e += `#### Using Typed Hooks
|
|
1131
1131
|
|
|
1132
|
-
`,
|
|
1133
|
-
`,
|
|
1134
|
-
|
|
1132
|
+
`, e += "```typescript\n", e += `// Get all extensions with type safety
|
|
1133
|
+
`, e += `const extensions = useExtensions(${this.getExtensionPointImportName(
|
|
1134
|
+
t.id
|
|
1135
1135
|
)});
|
|
1136
1136
|
|
|
1137
|
-
`,
|
|
1138
|
-
`,
|
|
1139
|
-
|
|
1137
|
+
`, e += `// Get best extension
|
|
1138
|
+
`, e += `const bestExtension = useBest(${this.getExtensionPointImportName(
|
|
1139
|
+
t.id
|
|
1140
1140
|
)});
|
|
1141
1141
|
|
|
1142
|
-
`,
|
|
1143
|
-
`,
|
|
1144
|
-
|
|
1142
|
+
`, e += `// Check availability
|
|
1143
|
+
`, e += `const hasExtensions = useHasExtensions(${this.getExtensionPointImportName(
|
|
1144
|
+
t.id
|
|
1145
1145
|
)});
|
|
1146
|
-
`,
|
|
1146
|
+
`, e += "```\n\n"), e += `#### Using DynamicComponent
|
|
1147
1147
|
|
|
1148
|
-
`,
|
|
1149
|
-
`,
|
|
1150
|
-
|
|
1148
|
+
`, e += "```typescript\n", e += `import { DynamicComponent } from '@kosdev-code/kos-ui-plugin';
|
|
1149
|
+
`, e += `import { ${this.getExtensionPointImportName(
|
|
1150
|
+
t.id
|
|
1151
1151
|
)} } from './extension-points';
|
|
1152
1152
|
|
|
1153
|
-
`,
|
|
1154
|
-
`,
|
|
1155
|
-
|
|
1153
|
+
`, e += `<DynamicComponent
|
|
1154
|
+
`, e += ` extension={${this.getExtensionPointImportName(
|
|
1155
|
+
t.id
|
|
1156
1156
|
)}.id}
|
|
1157
|
-
`,
|
|
1158
|
-
`,
|
|
1159
|
-
`,
|
|
1160
|
-
`,
|
|
1161
|
-
|
|
1162
|
-
`,
|
|
1163
|
-
`,
|
|
1164
|
-
|
|
1157
|
+
`, e += ` props={{ customData: "value" }}
|
|
1158
|
+
`, e += ` fallback={<div>Loading...</div>}
|
|
1159
|
+
`, e += `/>
|
|
1160
|
+
`, e += "```\n\n", e += `#### Using Context
|
|
1161
|
+
|
|
1162
|
+
`, e += "```typescript\n", e += `import { useKosPluginsContext } from '@kosdev-code/kos-ui-plugin';
|
|
1163
|
+
`, e += `import { ${this.getExtensionPointImportName(
|
|
1164
|
+
t.id
|
|
1165
1165
|
)} } from './extension-points';
|
|
1166
1166
|
|
|
1167
|
-
`,
|
|
1168
|
-
`,
|
|
1169
|
-
|
|
1167
|
+
`, e += `const { getExtensions } = useKosPluginsContext();
|
|
1168
|
+
`, e += `const extensions = getExtensions(${this.getExtensionPointImportName(
|
|
1169
|
+
t.id
|
|
1170
1170
|
)}.id);
|
|
1171
|
-
`,
|
|
1171
|
+
`, e += "```\n\n", e;
|
|
1172
1172
|
}
|
|
1173
1173
|
/**
|
|
1174
1174
|
* Generate plugin list with health information
|
|
1175
1175
|
*/
|
|
1176
|
-
static generatePluginList(
|
|
1176
|
+
static generatePluginList(t, e) {
|
|
1177
1177
|
let i = `### Active Plugins
|
|
1178
1178
|
|
|
1179
1179
|
`;
|
|
1180
|
-
return
|
|
1180
|
+
return t.forEach((s) => {
|
|
1181
1181
|
if (i += `#### ${s.id}
|
|
1182
1182
|
|
|
1183
1183
|
`, s.remote && (i += `- **Remote**: ${s.remote}
|
|
1184
1184
|
`), s.sectionId && (i += `- **Section**: ${s.sectionId}
|
|
1185
1185
|
`), s.rank !== void 0 && (i += `- **Rank**: ${s.rank}
|
|
1186
|
-
`),
|
|
1186
|
+
`), e) {
|
|
1187
1187
|
const o = I.analyzePlugin(s);
|
|
1188
1188
|
i += `- **Health**: ${this.getHealthEmoji(o.healthStatus)} ${o.healthStatus}
|
|
1189
1189
|
`, o.capabilities.length > 0 && (i += `- **Capabilities**: ${o.capabilities.join(", ")}
|
|
@@ -1196,10 +1196,10 @@ No plugins currently registered for this extension point.
|
|
|
1196
1196
|
/**
|
|
1197
1197
|
* Generate schema fields documentation
|
|
1198
1198
|
*/
|
|
1199
|
-
static generateSchemaFieldsSection(
|
|
1200
|
-
if (
|
|
1199
|
+
static generateSchemaFieldsSection(t) {
|
|
1200
|
+
if (t.source !== "simplified")
|
|
1201
1201
|
return "";
|
|
1202
|
-
const i = y().getExtensionPoint(
|
|
1202
|
+
const i = y().getExtensionPoint(t.id);
|
|
1203
1203
|
if (!(i != null && i.getSchemaFieldInfo))
|
|
1204
1204
|
return "";
|
|
1205
1205
|
const s = i.getSchemaFieldInfo();
|
|
@@ -1222,87 +1222,87 @@ No plugins currently registered for this extension point.
|
|
|
1222
1222
|
/**
|
|
1223
1223
|
* Generate contribution structure documentation
|
|
1224
1224
|
*/
|
|
1225
|
-
static generateContributionStructure(
|
|
1226
|
-
let
|
|
1225
|
+
static generateContributionStructure(t) {
|
|
1226
|
+
let e = `### Contribution Structure
|
|
1227
1227
|
|
|
1228
1228
|
`;
|
|
1229
|
-
|
|
1229
|
+
e += `To contribute to this extension point, add the following to your plugin descriptor:
|
|
1230
1230
|
|
|
1231
|
-
`,
|
|
1232
|
-
`,
|
|
1233
|
-
`,
|
|
1231
|
+
`, e += "```json\n", e += `{
|
|
1232
|
+
`, e += ` "id": "your-plugin-id",
|
|
1233
|
+
`, e += ` "contributes": {
|
|
1234
1234
|
`;
|
|
1235
|
-
const i = this.inferContributionKey(
|
|
1236
|
-
|
|
1237
|
-
`,
|
|
1235
|
+
const i = this.inferContributionKey(t);
|
|
1236
|
+
e += ` "${i}": [
|
|
1237
|
+
`, e += ` {
|
|
1238
1238
|
`;
|
|
1239
|
-
const s = this.getSchemaFieldsForContribution(
|
|
1239
|
+
const s = this.getSchemaFieldsForContribution(t);
|
|
1240
1240
|
if (s.length > 0) {
|
|
1241
1241
|
const a = [];
|
|
1242
1242
|
s.forEach((r) => {
|
|
1243
1243
|
let c;
|
|
1244
1244
|
r.name === "id" ? c = '"your-contribution-id"' : r.name === "title" ? c = '"Your Contribution Title"' : r.name === "namespace" ? c = '"your-namespace"' : r.name === "experienceId" ? c = '"your-experience-id"' : r.name === "dashboardKey" ? c = '"your-dashboard-key"' : r.name === "rank" ? c = "10" : r.type === "string" ? c = `"your-${r.name}"` : r.type === "number" ? c = "0" : r.type === "boolean" ? c = "false" : c = `"your-${r.name}"`, (r.required || ["experienceId", "rank", "dashboardKey"].includes(r.name)) && a.push(` "${r.name}": ${c}`);
|
|
1245
|
-
}),
|
|
1245
|
+
}), e += a.join(`,
|
|
1246
1246
|
`);
|
|
1247
1247
|
} else {
|
|
1248
|
-
|
|
1249
|
-
`,
|
|
1250
|
-
`,
|
|
1251
|
-
"experienceId": "your-experience-id"`), this.isRankableExtensionPoint(
|
|
1248
|
+
e += ` "id": "your-contribution-id",
|
|
1249
|
+
`, e += ` "title": "Your Contribution Title",
|
|
1250
|
+
`, e += ' "namespace": "your-namespace"', this.isViewBasedExtensionPoint(t) && (e += `,
|
|
1251
|
+
"experienceId": "your-experience-id"`), this.isRankableExtensionPoint(t) && (e += `,
|
|
1252
1252
|
"rank": 10`);
|
|
1253
|
-
const a = this.getSpecificFields(
|
|
1254
|
-
a.length > 0 && (
|
|
1253
|
+
const a = this.getSpecificFields(t);
|
|
1254
|
+
a.length > 0 && (e += `,
|
|
1255
1255
|
${a.join(`,
|
|
1256
1256
|
`)}`);
|
|
1257
1257
|
}
|
|
1258
|
-
return
|
|
1258
|
+
return e += `
|
|
1259
1259
|
}
|
|
1260
|
-
`,
|
|
1260
|
+
`, e += " ]", (s.some((a) => a.name === "experienceId") || this.isViewBasedExtensionPoint(t)) && (e += `,
|
|
1261
1261
|
"experiences": {
|
|
1262
|
-
`,
|
|
1263
|
-
`,
|
|
1264
|
-
`,
|
|
1265
|
-
`,
|
|
1266
|
-
`,
|
|
1267
|
-
`,
|
|
1262
|
+
`, e += ` "your-experience-id": {
|
|
1263
|
+
`, e += ` "id": "your-experience-id",
|
|
1264
|
+
`, e += ` "component": "YourComponent",
|
|
1265
|
+
`, e += ` "location": "./src/components/YourComponent.tsx"
|
|
1266
|
+
`, e += ` }
|
|
1267
|
+
`, e += " }"), e += `
|
|
1268
1268
|
}
|
|
1269
|
-
`,
|
|
1270
|
-
`,
|
|
1269
|
+
`, e += `}
|
|
1270
|
+
`, e += "```\n\n", e;
|
|
1271
1271
|
}
|
|
1272
1272
|
/**
|
|
1273
1273
|
* Generate TypeScript definitions section
|
|
1274
1274
|
*/
|
|
1275
|
-
static generateTypeDefinitionsSection(
|
|
1276
|
-
let
|
|
1275
|
+
static generateTypeDefinitionsSection(t) {
|
|
1276
|
+
let e = `## Type Definitions
|
|
1277
1277
|
|
|
1278
1278
|
`;
|
|
1279
|
-
return
|
|
1279
|
+
return e += `### Extension Point Types
|
|
1280
1280
|
|
|
1281
|
-
`,
|
|
1282
|
-
i.source === "simplified" && (
|
|
1283
|
-
`,
|
|
1284
|
-
`,
|
|
1285
|
-
`,
|
|
1286
|
-
`,
|
|
1287
|
-
`,
|
|
1281
|
+
`, e += "```typescript\n", t.forEach((i) => {
|
|
1282
|
+
i.source === "simplified" && (e += `// ${i.id}
|
|
1283
|
+
`, e += `interface ${this.getExtensionPointTypeName(i.id)} {
|
|
1284
|
+
`, e += ` id: "${i.id}";
|
|
1285
|
+
`, e += ` displayName?: "${i.displayName || ""}";
|
|
1286
|
+
`, e += ` description?: "${i.description || ""}";
|
|
1287
|
+
`, e += `}
|
|
1288
1288
|
|
|
1289
1289
|
`);
|
|
1290
|
-
}),
|
|
1291
|
-
|
|
1292
|
-
`,
|
|
1293
|
-
`,
|
|
1294
|
-
`,
|
|
1295
|
-
`,
|
|
1296
|
-
`,
|
|
1297
|
-
|
|
1298
|
-
`,
|
|
1299
|
-
`,
|
|
1300
|
-
`,
|
|
1301
|
-
|
|
1302
|
-
`,
|
|
1303
|
-
`,
|
|
1304
|
-
`,
|
|
1305
|
-
`,
|
|
1290
|
+
}), e += "```\n\n", e += `### Plugin Contribution Types
|
|
1291
|
+
|
|
1292
|
+
`, e += "```typescript\n", e += `interface BaseContribution {
|
|
1293
|
+
`, e += ` id: string;
|
|
1294
|
+
`, e += ` title: string;
|
|
1295
|
+
`, e += ` namespace: string;
|
|
1296
|
+
`, e += `}
|
|
1297
|
+
|
|
1298
|
+
`, e += `interface ViewBasedContribution extends BaseContribution {
|
|
1299
|
+
`, e += ` experienceId: string;
|
|
1300
|
+
`, e += `}
|
|
1301
|
+
|
|
1302
|
+
`, e += `interface RankableContribution extends BaseContribution {
|
|
1303
|
+
`, e += ` rank: number;
|
|
1304
|
+
`, e += `}
|
|
1305
|
+
`, e += "```\n\n", e;
|
|
1306
1306
|
}
|
|
1307
1307
|
/**
|
|
1308
1308
|
* Generate contribution guide
|
|
@@ -1397,12 +1397,12 @@ console.log(validation.warnings); // Check for warnings
|
|
|
1397
1397
|
`;
|
|
1398
1398
|
}
|
|
1399
1399
|
// Helper methods
|
|
1400
|
-
static getExtensionPointImportName(
|
|
1400
|
+
static getExtensionPointImportName(t) {
|
|
1401
1401
|
var a;
|
|
1402
|
-
const i = y().getExtensionPoint(
|
|
1402
|
+
const i = y().getExtensionPoint(t);
|
|
1403
1403
|
if ((a = i == null ? void 0 : i.config.metadata) != null && a.exportName)
|
|
1404
1404
|
return i.config.metadata.exportName;
|
|
1405
|
-
const s =
|
|
1405
|
+
const s = t.split(".");
|
|
1406
1406
|
return (s.length > 1 ? s.slice(1) : s).map(
|
|
1407
1407
|
(r) => (
|
|
1408
1408
|
// Handle hyphenated parts (e.g., "pump-detail" -> "PumpDetail")
|
|
@@ -1410,11 +1410,11 @@ console.log(validation.warnings); // Check for warnings
|
|
|
1410
1410
|
)
|
|
1411
1411
|
).join("") + "Extension";
|
|
1412
1412
|
}
|
|
1413
|
-
static getExtensionPointTypeName(
|
|
1414
|
-
return this.getExtensionPointImportName(
|
|
1413
|
+
static getExtensionPointTypeName(t) {
|
|
1414
|
+
return this.getExtensionPointImportName(t) + "Type";
|
|
1415
1415
|
}
|
|
1416
|
-
static getHealthEmoji(
|
|
1417
|
-
switch (
|
|
1416
|
+
static getHealthEmoji(t) {
|
|
1417
|
+
switch (t) {
|
|
1418
1418
|
case "healthy":
|
|
1419
1419
|
return "✅";
|
|
1420
1420
|
case "warning":
|
|
@@ -1425,13 +1425,13 @@ console.log(validation.warnings); // Check for warnings
|
|
|
1425
1425
|
return "❓";
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
1428
|
-
static inferContributionKey(
|
|
1429
|
-
if (
|
|
1430
|
-
const a = y().getExtensionPoint(
|
|
1428
|
+
static inferContributionKey(t) {
|
|
1429
|
+
if (t.source === "simplified") {
|
|
1430
|
+
const a = y().getExtensionPoint(t.id);
|
|
1431
1431
|
if (a != null && a.config.contributionKey)
|
|
1432
1432
|
return a.config.contributionKey;
|
|
1433
1433
|
}
|
|
1434
|
-
const
|
|
1434
|
+
const e = t.id.split("."), i = e[e.length - 1];
|
|
1435
1435
|
return {
|
|
1436
1436
|
cui: "cui",
|
|
1437
1437
|
utility: "utilities",
|
|
@@ -1443,56 +1443,56 @@ console.log(validation.warnings); // Check for warnings
|
|
|
1443
1443
|
controlPour: "controlPour"
|
|
1444
1444
|
}[i] || i + "s";
|
|
1445
1445
|
}
|
|
1446
|
-
static isViewBasedExtensionPoint(
|
|
1447
|
-
if (
|
|
1448
|
-
const i = y().getExtensionPoint(
|
|
1446
|
+
static isViewBasedExtensionPoint(t) {
|
|
1447
|
+
if (t.source === "simplified") {
|
|
1448
|
+
const i = y().getExtensionPoint(t.id);
|
|
1449
1449
|
return (i == null ? void 0 : i.config.hasView) || !1;
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1452
|
-
(
|
|
1451
|
+
return t.plugins.some(
|
|
1452
|
+
(e) => e.experienceId
|
|
1453
1453
|
);
|
|
1454
1454
|
}
|
|
1455
|
-
static isRankableExtensionPoint(
|
|
1456
|
-
if (
|
|
1457
|
-
const i = y().getExtensionPoint(
|
|
1455
|
+
static isRankableExtensionPoint(t) {
|
|
1456
|
+
if (t.source === "simplified") {
|
|
1457
|
+
const i = y().getExtensionPoint(t.id);
|
|
1458
1458
|
return (i == null ? void 0 : i.config.isRankable) || !1;
|
|
1459
1459
|
}
|
|
1460
|
-
return
|
|
1461
|
-
(
|
|
1460
|
+
return t.plugins.some(
|
|
1461
|
+
(e) => typeof e.rank == "number"
|
|
1462
1462
|
);
|
|
1463
1463
|
}
|
|
1464
1464
|
/**
|
|
1465
1465
|
* Get schema fields for contribution structure generation
|
|
1466
1466
|
*/
|
|
1467
|
-
static getSchemaFieldsForContribution(
|
|
1468
|
-
if (
|
|
1467
|
+
static getSchemaFieldsForContribution(t) {
|
|
1468
|
+
if (t.source !== "simplified")
|
|
1469
1469
|
return [];
|
|
1470
|
-
const i = y().getExtensionPoint(
|
|
1470
|
+
const i = y().getExtensionPoint(t.id);
|
|
1471
1471
|
return i != null && i.getSchemaFieldInfo ? i.getSchemaFieldInfo() : [];
|
|
1472
1472
|
}
|
|
1473
|
-
static getSpecificFields(
|
|
1474
|
-
const
|
|
1475
|
-
switch (this.inferContributionKey(
|
|
1473
|
+
static getSpecificFields(t) {
|
|
1474
|
+
const e = [];
|
|
1475
|
+
switch (this.inferContributionKey(t)) {
|
|
1476
1476
|
case "utilities":
|
|
1477
|
-
|
|
1477
|
+
e.push('"utilDescriptor": "your-util-descriptor"');
|
|
1478
1478
|
break;
|
|
1479
1479
|
case "setupStep":
|
|
1480
|
-
|
|
1480
|
+
e.push('"setupDescriptor": "your-setup-descriptor"');
|
|
1481
1481
|
break;
|
|
1482
1482
|
case "settings":
|
|
1483
|
-
|
|
1483
|
+
e.push('"settingsGroup": "your-settings-group"');
|
|
1484
1484
|
break;
|
|
1485
1485
|
case "navViews":
|
|
1486
|
-
|
|
1486
|
+
e.push('"navDescriptor": "your-nav-descriptor"');
|
|
1487
1487
|
break;
|
|
1488
1488
|
case "troubleActions":
|
|
1489
|
-
|
|
1489
|
+
e.push('"troubleType": "your-trouble-type"');
|
|
1490
1490
|
break;
|
|
1491
1491
|
case "cui":
|
|
1492
|
-
|
|
1492
|
+
e.push('"cuiDescriptor": "your-cui-descriptor"');
|
|
1493
1493
|
break;
|
|
1494
1494
|
}
|
|
1495
|
-
return
|
|
1495
|
+
return e;
|
|
1496
1496
|
}
|
|
1497
1497
|
}
|
|
1498
1498
|
export {
|
|
@@ -1520,4 +1520,4 @@ export {
|
|
|
1520
1520
|
_e as r,
|
|
1521
1521
|
Te as v
|
|
1522
1522
|
};
|
|
1523
|
-
//# sourceMappingURL=documentation-generator-
|
|
1523
|
+
//# sourceMappingURL=documentation-generator-C0BDW8NY.js.map
|