@kosdev-code/kos-ui-plugin 2.1.7 → 2.1.9

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.
@@ -1,8 +1,8 @@
1
- var A = Object.defineProperty;
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
- import { z as E } from "zod";
5
- function N(n, t) {
1
+ var W = Object.defineProperty;
2
+ var G = (n, t, e) => t in n ? W(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var C = (n, t, e) => (G(n, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { z as w } from "zod";
5
+ function z(n, t) {
6
6
  for (var e = 0; e < t.length; e++) {
7
7
  const i = t[e];
8
8
  if (typeof i != "string" && !Array.isArray(i)) {
@@ -18,29 +18,29 @@ function N(n, t) {
18
18
  }
19
19
  return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
20
20
  }
21
- var k = {}, x = {};
22
- Object.defineProperty(x, "__esModule", { value: !0 });
23
- x.loadRemoteModule = x.setRemoteDefinitions = x.setRemoteUrlResolver = void 0;
24
- let v, S;
25
- const R = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
26
- let _ = !1;
27
- function K(n) {
28
- S = n;
21
+ var F = {}, E = {};
22
+ Object.defineProperty(E, "__esModule", { value: !0 });
23
+ E.loadRemoteModule = E.setRemoteDefinitions = E.setRemoteUrlResolver = void 0;
24
+ let R, D;
25
+ const O = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map();
26
+ let j = !1;
27
+ function J(n) {
28
+ D = n;
29
29
  }
30
- x.setRemoteUrlResolver = K;
31
- function V(n) {
32
- v = n;
30
+ E.setRemoteUrlResolver = J;
31
+ function Z(n) {
32
+ R = n;
33
33
  }
34
- x.setRemoteDefinitions = V;
35
- async function M(n, t) {
34
+ E.setRemoteDefinitions = Z;
35
+ async function Y(n, t) {
36
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;
37
+ if (O.has(e))
38
+ return O.get(e);
39
+ const o = (await (U.has(n) ? U.get(n) : await X(n)).get(t))();
40
+ return O.set(e, o), o;
41
41
  }
42
- x.loadRemoteModule = M;
43
- const L = (n, t) => new Promise((e, i) => {
42
+ E.loadRemoteModule = Y;
43
+ const Q = (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
46
  e({
@@ -55,19 +55,19 @@ const L = (n, t) => new Promise((e, i) => {
55
55
  });
56
56
  }, s.onerror = () => i(new Error(`Remote ${t} not found`)), document.head.appendChild(s);
57
57
  });
58
- async function q(n) {
59
- if (!S && !v)
58
+ async function X(n) {
59
+ if (!D && !R)
60
60
  throw new Error("Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.");
61
- _ || (_ = !0, await __webpack_init_sharing__("default"));
62
- const t = v ? v[n] : await S(n);
61
+ j || (j = !0, await __webpack_init_sharing__("default"));
62
+ const t = R ? R[n] : await D(n);
63
63
  let e = t;
64
64
  !t.endsWith(".mjs") && !t.endsWith(".js") && (e = `${t}${t.endsWith("/") ? "" : "/"}remoteEntry.js`);
65
- const i = await L(e, n);
66
- return await i.init(__webpack_share_scopes__.default), F.set(n, i), i;
65
+ const i = await Q(e, n);
66
+ return await i.init(__webpack_share_scopes__.default), U.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 t = x;
70
+ var t = E;
71
71
  Object.defineProperty(n, "loadRemoteModule", { enumerable: !0, get: function() {
72
72
  return t.loadRemoteModule;
73
73
  } }), Object.defineProperty(n, "setRemoteDefinitions", { enumerable: !0, get: function() {
@@ -75,11 +75,11 @@ async function q(n) {
75
75
  } }), Object.defineProperty(n, "setRemoteUrlResolver", { enumerable: !0, get: function() {
76
76
  return t.setRemoteUrlResolver;
77
77
  } });
78
- })(k);
79
- const Re = /* @__PURE__ */ N({
78
+ })(F);
79
+ const Ne = /* @__PURE__ */ z({
80
80
  __proto__: null
81
- }, [k]);
82
- function B(n) {
81
+ }, [F]);
82
+ function ee(n) {
83
83
  var t;
84
84
  try {
85
85
  if ("shape" in n) {
@@ -104,9 +104,9 @@ function B(n) {
104
104
  return console.warn("Failed to extract schema field info:", e), [];
105
105
  }
106
106
  }
107
- class H {
107
+ class te {
108
108
  constructor() {
109
- P(this, "issues", []);
109
+ C(this, "issues", []);
110
110
  }
111
111
  addError(t) {
112
112
  this.issues.push({ type: "error", message: t });
@@ -127,9 +127,9 @@ class H {
127
127
  return [...this.issues];
128
128
  }
129
129
  }
130
- class W {
130
+ class ne {
131
131
  constructor() {
132
- P(this, "cache", /* @__PURE__ */ new Map());
132
+ C(this, "cache", /* @__PURE__ */ new Map());
133
133
  }
134
134
  set(t, e) {
135
135
  this.cache.set(t, e);
@@ -141,23 +141,23 @@ class W {
141
141
  this.cache.clear();
142
142
  }
143
143
  }
144
- const w = new W();
145
- function Ie(n) {
146
- return w.get(n);
144
+ const I = new ne();
145
+ function Ke(n) {
146
+ return I.get(n);
147
147
  }
148
- const U = [];
149
- function z(n) {
150
- U.push(n);
148
+ const K = [];
149
+ function ie(n) {
150
+ K.push(n);
151
151
  }
152
- function G(n, t, e) {
153
- return U.reduce(
152
+ function se(n, t, e) {
153
+ return K.reduce(
154
154
  (i, s) => s(i, t, e),
155
155
  n
156
156
  );
157
157
  }
158
- class J {
158
+ class oe {
159
159
  constructor() {
160
- P(this, "extensionPoints", /* @__PURE__ */ new Map());
160
+ C(this, "extensionPoints", /* @__PURE__ */ new Map());
161
161
  }
162
162
  define(t) {
163
163
  if (this.extensionPoints.has(t.id))
@@ -173,17 +173,17 @@ class J {
173
173
  return;
174
174
  }
175
175
  const i = this.createReducer(t);
176
- z(i), e.isRegistered = !0;
176
+ ie(i), e.isRegistered = !0;
177
177
  }
178
178
  };
179
- return t.schema && (e.getSchemaFieldInfo = () => B(t.schema)), this.extensionPoints.set(t.id, e), e;
179
+ return t.schema && (e.getSchemaFieldInfo = () => ee(t.schema)), this.extensionPoints.set(t.id, e), e;
180
180
  }
181
181
  createReducer(t) {
182
182
  return (e, i, s) => {
183
183
  const o = i[t.contributionKey];
184
184
  return !o || typeof o != "object" || Object.entries(o).forEach(
185
185
  ([a, r]) => {
186
- var m, h;
186
+ var f, h;
187
187
  if (!r)
188
188
  return;
189
189
  const c = {
@@ -193,12 +193,12 @@ class J {
193
193
  contributions: i
194
194
  };
195
195
  if (t.validate) {
196
- const d = new H();
196
+ const d = new te();
197
197
  if (t.validate(
198
198
  r,
199
199
  d
200
200
  ) === "skip") {
201
- w.set(a, [
201
+ I.set(a, [
202
202
  {
203
203
  type: "warning",
204
204
  message: "Plugin marked to skip processing"
@@ -207,19 +207,19 @@ class J {
207
207
  return;
208
208
  }
209
209
  if (d.hasIssues()) {
210
- const b = d.getIssues().map((f) => ({
211
- ...f,
212
- message: `Extension point validation: ${f.message}`
210
+ const x = d.getIssues().map((m) => ({
211
+ ...m,
212
+ message: `Extension point validation: ${m.message}`
213
213
  }));
214
- if (w.set(a, b), d.hasErrors()) {
214
+ if (I.set(a, x), d.hasErrors()) {
215
215
  console.error(
216
216
  `Validation failed for ${t.id} contribution "${a}":`,
217
- b.filter((f) => f.type === "error").map((f) => f.message).join(", ")
217
+ x.filter((m) => m.type === "error").map((m) => m.message).join(", ")
218
218
  );
219
219
  return;
220
220
  }
221
221
  } else
222
- w.set(a, []);
222
+ I.set(a, []);
223
223
  }
224
224
  const l = t.transform ? t.transform(r, c) : r;
225
225
  e[t.id] || (e[t.id] = {});
@@ -230,7 +230,7 @@ class J {
230
230
  remote: c.remote,
231
231
  sectionId: c.sectionId
232
232
  };
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)) {
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 && ((f = t.relatedPoints) != null && f.view)) {
234
234
  const d = r.experienceId, p = s == null ? void 0 : s[d];
235
235
  p && (e[t.relatedPoints.view] || (e[t.relatedPoints.view] = {}), e[t.relatedPoints.view][a] = {
236
236
  id: a,
@@ -278,11 +278,11 @@ class J {
278
278
  return this.extensionPoints.has(t);
279
279
  }
280
280
  }
281
- const O = new J();
282
- function y() {
283
- return O;
281
+ const V = new oe();
282
+ function b() {
283
+ return V;
284
284
  }
285
- function Z(n = {}) {
285
+ function re(n = {}) {
286
286
  const {
287
287
  experienceIdProperty: t = "experienceId",
288
288
  flattenComponentProperties: e = !0,
@@ -298,16 +298,16 @@ function Z(n = {}) {
298
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
- function Y(n) {
302
- return O.define(n);
301
+ function ae(n) {
302
+ return V.define(n);
303
303
  }
304
- const Q = {
304
+ const ce = {
305
305
  $timestamp: () => Date.now(),
306
306
  $date: () => (/* @__PURE__ */ new Date()).toISOString(),
307
307
  $packageVersion: () => process.env.npm_package_version || "0.0.0",
308
308
  $env: () => process.env.NODE_ENV || "development"
309
309
  };
310
- function X(n) {
310
+ function le(n) {
311
311
  const t = {
312
312
  id: n.id,
313
313
  displayName: n.displayName,
@@ -318,25 +318,25 @@ function X(n) {
318
318
  relatedPoints: n.relatedPoints,
319
319
  metadata: n.metadata ? {
320
320
  ...n.metadata,
321
- exportName: n.metadata.exportName || ee(n.id)
321
+ exportName: n.metadata.exportName || ue(n.id)
322
322
  } : void 0
323
323
  };
324
- return n.schema && (t.schema = te(n.schema, {
324
+ return n.schema && (t.schema = de(n.schema, {
325
325
  hasView: n.hasView,
326
326
  isRankable: n.isRankable
327
- })), n.validation && (t.validate = ie(n.validation)), n.transform ? t.transform = de(n.transform) : n.hasView && (t.transform = Z()), t;
327
+ })), n.validation && (t.validate = fe(n.validation)), n.transform ? t.transform = Pe(n.transform) : n.hasView && (t.transform = re()), t;
328
328
  }
329
- function ee(n) {
329
+ function ue(n) {
330
330
  return n.split(".").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join("") + "Extension";
331
331
  }
332
- function te(n, t) {
332
+ function de(n, t) {
333
333
  try {
334
334
  const { z: e } = require("zod");
335
335
  if (n.properties) {
336
336
  const i = {};
337
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, e);
339
+ i[o] = pe(a, e);
340
340
  let s = e.object(i);
341
341
  return n.additionalProperties || (s = s.strict()), s;
342
342
  }
@@ -346,7 +346,7 @@ function te(n, t) {
346
346
  return;
347
347
  }
348
348
  }
349
- function ne(n, t) {
349
+ function pe(n, t) {
350
350
  let e;
351
351
  switch (n.type) {
352
352
  case "string":
@@ -369,38 +369,38 @@ function ne(n, t) {
369
369
  }
370
370
  return n.description && (e = e.describe(n.description)), n.default !== void 0 && (e = e.default(n.default)), e;
371
371
  }
372
- function ie(n) {
373
- return n.module ? ue(n.module) : (t, e) => {
372
+ function fe(n) {
373
+ return n.module ? Ee(n.module) : (t, e) => {
374
374
  if (!n.rules)
375
375
  return;
376
376
  const i = t;
377
377
  for (const s of n.rules)
378
- se(s, i, e);
378
+ me(s, i, e);
379
379
  };
380
380
  }
381
- function se(n, t, e) {
381
+ function me(n, t, e) {
382
382
  switch (n.type) {
383
383
  case "required":
384
- oe(n, t, e);
384
+ ge(n, t, e);
385
385
  break;
386
386
  case "range":
387
- re(n, t, e);
387
+ he(n, t, e);
388
388
  break;
389
389
  case "pattern":
390
- ae(n, t, e);
390
+ ye(n, t, e);
391
391
  break;
392
392
  case "dependency":
393
- ce(n, t, e);
393
+ be(n, t, e);
394
394
  break;
395
395
  case "custom":
396
- le(n, t, e);
396
+ xe(n, t, e);
397
397
  break;
398
398
  }
399
399
  }
400
- function oe(n, t, e) {
400
+ function ge(n, t, e) {
401
401
  n.field && !t[n.field] && e.addError(n.message || `Field '${n.field}' is required`);
402
402
  }
403
- function re(n, t, e) {
403
+ function he(n, t, e) {
404
404
  if (n.field && typeof t[n.field] == "number") {
405
405
  const i = t[n.field];
406
406
  n.min !== void 0 && i < n.min && e.addError(
@@ -410,42 +410,42 @@ function re(n, t, e) {
410
410
  );
411
411
  }
412
412
  }
413
- function ae(n, t, e) {
413
+ function ye(n, t, e) {
414
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, t, e) {
418
+ function be(n, t, e) {
419
419
  if (n.field && n.dependsOn && n.expression)
420
420
  try {
421
- $(n.expression, t) || e.addError(
421
+ S(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, t, e) {
428
+ function xe(n, t, e) {
429
429
  if (n.expression)
430
430
  try {
431
- $(n.expression, t) || e.addError(n.message || "Custom validation failed");
431
+ S(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
- function ue(n) {
436
+ function Ee(n) {
437
437
  return (t, e) => {
438
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
- function de(n) {
444
- return n.module ? pe(n.module) : (t, e) => {
443
+ function Pe(n) {
444
+ return n.module ? we(n.module) : (t, e) => {
445
445
  const i = { ...t };
446
446
  if (n.addFields)
447
447
  for (const [s, o] of Object.entries(n.addFields))
448
- i[s] = fe(o);
448
+ i[s] = ve(o);
449
449
  if (n.removeFields)
450
450
  for (const s of n.removeFields)
451
451
  delete i[s];
@@ -456,25 +456,25 @@ function de(n) {
456
456
  s in i && (i[o] = i[s], delete i[s]);
457
457
  if (n.normalizeFields)
458
458
  for (const { field: s, operation: o } of n.normalizeFields)
459
- s in i && typeof i[s] == "string" && (i[s] = me(
459
+ s in i && typeof i[s] == "string" && (i[s] = $e(
460
460
  i[s],
461
461
  o
462
462
  ));
463
463
  return i;
464
464
  };
465
465
  }
466
- function pe(n) {
466
+ function we(n) {
467
467
  return (t, e) => (console.warn(`External transform module not implemented: ${n}`), t);
468
468
  }
469
- function fe(n) {
469
+ function ve(n) {
470
470
  if (typeof n == "string" && n.startsWith("$")) {
471
- const t = Q[n];
471
+ const t = ce[n];
472
472
  if (t)
473
473
  return t();
474
474
  }
475
475
  return n;
476
476
  }
477
- function me(n, t) {
477
+ function $e(n, t) {
478
478
  switch (t) {
479
479
  case "trim":
480
480
  return n.trim();
@@ -483,20 +483,20 @@ function me(n, t) {
483
483
  case "uppercase":
484
484
  return n.toUpperCase();
485
485
  case "camelCase":
486
- return ge(n);
486
+ return ke(n);
487
487
  case "kebabCase":
488
- return he(n);
488
+ return Ce(n);
489
489
  default:
490
490
  return n;
491
491
  }
492
492
  }
493
- function ge(n) {
493
+ function ke(n) {
494
494
  return n.replace(/[-_\s]+(.)?/g, (t, e) => e ? e.toUpperCase() : "").replace(/^./, (t) => t.toLowerCase());
495
495
  }
496
- function he(n) {
496
+ function Ce(n) {
497
497
  return n.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
498
498
  }
499
- function $(n, t) {
499
+ function S(n, t) {
500
500
  try {
501
501
  let e = n;
502
502
  for (const [i, s] of Object.entries(t)) {
@@ -514,14 +514,14 @@ function $(n, t) {
514
514
  const [i, s] = e.split("===").map((o) => o.trim());
515
515
  return i === s;
516
516
  }
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;
517
+ return e.includes("||") ? e.split("||").map((s) => s.trim()).some((s) => S(s, t)) : e.includes("&&") ? e.split("&&").map((s) => s.trim()).every((s) => S(s, t)) : !1;
518
518
  } catch (e) {
519
519
  return console.error("Expression evaluation failed:", e), !1;
520
520
  }
521
521
  }
522
- const ye = (n) => (t, e) => {
522
+ const Re = (n) => (t, e) => {
523
523
  var c;
524
- const i = n[e].remote, s = e, o = (c = n[e].contributes) == null ? void 0 : c.experiences;
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] = {
@@ -529,16 +529,16 @@ const ye = (n) => (t, e) => {
529
529
  remote: i,
530
530
  sectionId: s
531
531
  };
532
- }), y().getAllExtensionPoints().forEach((l) => {
532
+ }), b().getAllExtensionPoints().forEach((l) => {
533
533
  var h;
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) => {
534
+ const { contributionKey: u } = l.config, f = (h = n[e].contributes) == null ? void 0 : h[u];
535
+ f && (t[u] || (t[u] = {}), Array.isArray(f) ? f.forEach((d) => {
536
536
  d && d.id && (t[u][d.id] = {
537
537
  ...d,
538
538
  remote: i,
539
539
  sectionId: s
540
540
  });
541
- }) : typeof m == "object" && Object.entries(m).forEach(([d, p]) => {
541
+ }) : typeof f == "object" && Object.entries(f).forEach(([d, p]) => {
542
542
  t[u][d] = {
543
543
  ...p,
544
544
  id: d,
@@ -548,7 +548,7 @@ const ye = (n) => (t, e) => {
548
548
  }));
549
549
  }), t;
550
550
  };
551
- async function be(n) {
551
+ async function Ie(n) {
552
552
  const t = n ?? window.KosPlugins.__dynamicRemotes;
553
553
  if (window.KosPlugins.extensions) {
554
554
  const o = window.KosPlugins.extensions;
@@ -559,7 +559,7 @@ async function be(n) {
559
559
  extensions: window.KosPlugins.__extensions
560
560
  };
561
561
  }
562
- const e = window.KosPlugins.__extensions ?? await Ee(t), i = {};
562
+ const e = window.KosPlugins.__extensions ?? await Fe(t), i = {};
563
563
  if (e)
564
564
  for (const o of Object.keys(e))
565
565
  i[o] = Object.values(
@@ -567,29 +567,29 @@ async function be(n) {
567
567
  );
568
568
  return window.KosPlugins.extensions = i, { extensionPoints: i, getExtensions: (o) => i[o] || [], remotes: t, extensions: e };
569
569
  }
570
- const T = {
570
+ const N = {
571
571
  controlPourDefinitions: {},
572
572
  experiences: {}
573
573
  };
574
- function xe(n) {
575
- return n ? Object.keys(n).reduce(ye(n), {
576
- ...T
577
- }) : T;
574
+ function Se(n) {
575
+ return n ? Object.keys(n).reduce(Re(n), {
576
+ ...N
577
+ }) : N;
578
578
  }
579
- async function Ee(n) {
579
+ async function Fe(n) {
580
580
  if (!n)
581
581
  return window.KosPlugins = window.KosPlugins || {}, {};
582
582
  for (const o of Object.values(n)) {
583
583
  try {
584
584
  if (o.extensions && Array.isArray(o.extensions)) {
585
- const a = o.extensions.filter((r) => r && typeof r == "object" && "id" in r).map((r) => X(r));
585
+ const a = o.extensions.filter((r) => r && typeof r == "object" && "id" in r).map((r) => le(r));
586
586
  if (a.length > 0) {
587
587
  console.info(
588
588
  `Registering ${a.length} JSON extension point(s) from ${o.remote}`
589
589
  );
590
590
  for (const r of a)
591
591
  try {
592
- Y(r).register(), console.debug(`Registered JSON extension point: ${r.id}`);
592
+ ae(r).register(), console.debug(`Registered JSON extension point: ${r.id}`);
593
593
  } catch (c) {
594
594
  console.error(
595
595
  `Failed to register JSON extension point '${r.id}' from ${o.remote}:`,
@@ -606,7 +606,7 @@ async function Ee(n) {
606
606
  }
607
607
  if (o.init)
608
608
  try {
609
- const a = await k.loadRemoteModule(
609
+ const a = await F.loadRemoteModule(
610
610
  o.remote,
611
611
  "./InitPlugin"
612
612
  );
@@ -618,54 +618,77 @@ async function Ee(n) {
618
618
  console.warn(`Failed to load InitPlugin from ${o.remote}:`, a);
619
619
  }
620
620
  }
621
- const t = xe(n), e = t.experiences, s = G(
621
+ const t = Se(n), e = t.experiences, s = se(
622
622
  {},
623
623
  t,
624
624
  e
625
625
  );
626
626
  return window.KosPlugins = window.KosPlugins || {}, window.KosPlugins.__extensions = s, s;
627
627
  }
628
- async function Se(n) {
629
- const { getExtensions: t } = await be();
628
+ async function Ve(n) {
629
+ const { getExtensions: t } = await Ie();
630
630
  return t(n);
631
631
  }
632
- const Pe = (n = null) => (n || window.location.search.replace("?", "")).split("&").map((t) => {
632
+ const _e = (n = null) => (n || window.location.search.replace("?", "")).split("&").map((t) => {
633
633
  const [e, i] = t.split("=");
634
634
  return [e, decodeURIComponent(i || "")];
635
- }).reduce((t, [e, i]) => (t[e] = i, t), {}), ve = () => {
636
- const n = window.location.origin, t = Pe();
635
+ }).reduce((t, [e, i]) => (t[e] = i, t), {}), Oe = () => {
636
+ const n = window.location.origin, t = _e();
637
637
  return (t == null ? void 0 : t.host) || n;
638
- }, Fe = async (n) => {
639
- var b;
640
- const t = ve(), e = n ?? {}, {
638
+ }, Me = async (n) => {
639
+ var x;
640
+ const t = Oe(), e = n ?? {}, {
641
641
  pluginBaseUrl: i = t,
642
- pluginApiPath: s = "/api/app/kosdev.ddk/ncui/plugins",
642
+ pluginApiPath: s,
643
643
  overrides: o = {},
644
644
  pluginContext: a
645
- } = e, r = !!a, c = r ? `${i}/api/kos/ui/plugins/contexts` : `${i}${s}`;
645
+ } = e, r = s ? `${i}${s}` : `${i}/api/kos/ui/plugins/contexts`;
646
646
  console.log(
647
- `initialize-plugins: Using Plugin Framework: ${r}: Fetching plugins from ${c}`
647
+ `initialize-plugins: Using Plugin Framework. Fetching plugins from ${r}`
648
648
  );
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
- basePath: `${C}remoteEntry.js`,
653
- extensions: g.descriptor.extensions || [],
654
- contributes: g.descriptor.contributes,
655
- remote: g.descriptor.id,
656
- init: !!g.descriptor.init
657
- } : console.error(
658
- `initialize-plugins: Plugin ${g.id} does not have a descriptor`
659
- ), f;
649
+ const l = await (await fetch(r)).json(), u = typeof (a == null ? void 0 : a.context) == "string" ? [a.context] : (a == null ? void 0 : a.context) || [], f = ((x = l.data) == null ? void 0 : x.filter((m) => u.length === 0 || u.includes(m.name)).flatMap((m) => m.plugins)) ?? [], h = a == null ? void 0 : a.group, d = f == null ? void 0 : f.reduce((m, g) => {
650
+ const _ = (o == null ? void 0 : o[g.id]) ?? `${i}${g.path}`;
651
+ if (g.descriptor) {
652
+ const A = (g.descriptor.extensions || []).reduce((P, y) => {
653
+ const k = y.groups || [];
654
+ return (!h || k.includes(h)) && P.push(y), P;
655
+ }, []), v = g.descriptor.contributes || {};
656
+ let $ = !1;
657
+ const L = Object.keys(v).reduce(
658
+ (P, y) => {
659
+ if (Array.isArray(v[y])) {
660
+ const k = (v[y] || []).filter((B) => {
661
+ const H = B.groups || [];
662
+ return !h || H.includes(h);
663
+ });
664
+ $ = $ || k.length > 0, P[y] = k;
665
+ } else
666
+ P[y] = v[y], $ = Object.keys(v[y]).length > 0;
667
+ return P;
668
+ },
669
+ {}
670
+ ), q = !!g.descriptor.init && (A.length > 0 || $);
671
+ m[g.id] = {
672
+ basePath: `${_}remoteEntry.js`,
673
+ extensions: A,
674
+ contributes: L,
675
+ remote: g.descriptor.id,
676
+ init: q
677
+ };
678
+ } else
679
+ console.error(
680
+ `initialize-plugins: Plugin ${g.id} does not have a descriptor`
681
+ );
682
+ return m;
660
683
  }, {});
661
684
  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;
685
+ const p = Object.keys(d).reduce((m, g) => {
686
+ const _ = d[g].remote;
687
+ return m[_] = d[g].basePath, m;
665
688
  }, {});
666
- return k.setRemoteDefinitions(p), p;
689
+ return F.setRemoteDefinitions(p), p;
667
690
  };
668
- function _e(n, t, e = !1) {
691
+ function Le(n, t, e = !1) {
669
692
  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
693
  const a = typeof s.rank == "number" ? s.rank : 1 / 0, r = typeof o.rank == "number" ? o.rank : 1 / 0;
671
694
  if (a === r) {
@@ -675,37 +698,37 @@ function _e(n, t, e = !1) {
675
698
  return a - r;
676
699
  })[0] ?? null;
677
700
  }
678
- const D = E.object({
679
- id: E.string().min(1, "ID is required").describe("Unique identifier for this extension"),
680
- title: E.string().min(1, "Title is required").describe("Display title shown in the interface"),
681
- namespace: E.string().min(1, "Namespace is required").describe("Namespace for organizing related extensions"),
682
- experienceId: E.string().min(1, "Experience ID is required").describe("Reference to the UI component experience for rendering")
683
- }), we = D.extend({
684
- rank: E.number().int().min(0).optional().describe("Optional ranking for ordering (higher = preferred)")
701
+ const M = w.object({
702
+ id: w.string().min(1, "ID is required").describe("Unique identifier for this extension"),
703
+ title: w.string().min(1, "Title is required").describe("Display title shown in the interface"),
704
+ namespace: w.string().min(1, "Namespace is required").describe("Namespace for organizing related extensions"),
705
+ experienceId: w.string().min(1, "Experience ID is required").describe("Reference to the UI component experience for rendering")
706
+ }), Te = M.extend({
707
+ rank: w.number().int().min(0).optional().describe("Optional ranking for ordering (higher = preferred)")
685
708
  });
686
- function Te(n, t, e) {
709
+ function qe(n, t, e) {
687
710
  const i = n.safeParse(t);
688
711
  return i.success ? !0 : (i.error.errors.forEach((s) => {
689
712
  e.addError(`${s.path.join(".")}: ${s.message}`);
690
713
  }), !1);
691
714
  }
692
- function Ue(n, t, e) {
715
+ function Be(n, t, e) {
693
716
  t && !t.includes(".") && e.addWarning(
694
717
  `${n} '${t}' should typically include dot notation (e.g., 'category.item')`
695
718
  );
696
719
  }
697
- function $e(n, t, e = 1e3) {
720
+ function De(n, t, e = 1e3) {
698
721
  n !== void 0 && n > e && t.addWarning(
699
722
  `Rank ${n} seems unusually high - consider using lower values for better ordering`
700
723
  );
701
724
  }
702
- function Oe(n, t = {}) {
703
- return (t.rankable ? we : D).extend(n);
725
+ function He(n, t = {}) {
726
+ return (t.rankable ? Te : M).extend(n);
704
727
  }
705
- function De(n, t, e = 1e3) {
706
- typeof n == "object" && n !== null && "rank" in n && $e(n.rank, t, e);
728
+ function We(n, t, e = 1e3) {
729
+ typeof n == "object" && n !== null && "rank" in n && De(n.rank, t, e);
707
730
  }
708
- class I {
731
+ class T {
709
732
  /**
710
733
  * Get all extension points with their plugin information
711
734
  */
@@ -713,7 +736,7 @@ class I {
713
736
  const {
714
737
  includeLegacyExtensions: i = !0,
715
738
  includeEmptyExtensionPoints: s = !0
716
- } = e, a = y().getAllExtensionPoints(), r = [];
739
+ } = e, a = b().getAllExtensionPoints(), r = [];
717
740
  return a.forEach((c) => {
718
741
  const l = Object.values((t == null ? void 0 : t[c.id]) || {});
719
742
  !s && l.length === 0 || r.push({
@@ -726,7 +749,7 @@ class I {
726
749
  plugins: l
727
750
  });
728
751
  }), i && t && Object.entries(t).forEach(([c, l]) => {
729
- if (r.some((m) => m.id === c))
752
+ if (r.some((f) => f.id === c))
730
753
  return;
731
754
  const u = Object.values(l || {});
732
755
  !s && u.length === 0 || r.push({
@@ -747,7 +770,7 @@ class I {
747
770
  return t.filter(
748
771
  (s) => {
749
772
  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((m) => m.toLowerCase().includes(i)));
773
+ 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((f) => f.toLowerCase().includes(i)));
751
774
  }
752
775
  );
753
776
  }
@@ -883,7 +906,7 @@ class I {
883
906
  incompatibleTypes: [],
884
907
  suggestions: []
885
908
  };
886
- const r = y(), c = new Set(
909
+ const r = b(), c = new Set(
887
910
  e.map((l) => l.id)
888
911
  );
889
912
  return Object.entries(t.contributes).forEach(
@@ -898,13 +921,13 @@ class I {
898
921
  const d = r.getAllExtensionPoints().find(
899
922
  (p) => p.config.contributionKey === l
900
923
  );
901
- d && u.length > 0 && u.forEach((p, b) => {
924
+ d && u.length > 0 && u.forEach((p, x) => {
902
925
  d.config.isRankable && typeof p.rank != "number" && (i.push(
903
- `${l}[${b}]: Extension point '${d.id}' expects 'rank' property`
926
+ `${l}[${x}]: Extension point '${d.id}' expects 'rank' property`
904
927
  ), a.push(
905
928
  "Add 'rank' property with numeric value for ordering"
906
929
  )), d.config.hasView && !p.experienceId && (i.push(
907
- `${l}[${b}]: Extension point '${d.id}' expects 'experienceId' for view-based contributions`
930
+ `${l}[${x}]: Extension point '${d.id}' expects 'experienceId' for view-based contributions`
908
931
  ), a.push(
909
932
  "Add 'experienceId' property linking to an experience definition"
910
933
  ));
@@ -957,7 +980,7 @@ class I {
957
980
  };
958
981
  }
959
982
  }
960
- class Ae {
983
+ class Ge {
961
984
  /**
962
985
  * Generate complete documentation for all extension points
963
986
  */
@@ -967,13 +990,13 @@ class Ae {
967
990
  includeTypeDefinitions: s = !0,
968
991
  includeLegacyExtensions: o = !0,
969
992
  includePluginHealth: a = !0
970
- } = e, r = I.getExtensionPoints(
993
+ } = e, r = T.getExtensionPoints(
971
994
  t,
972
995
  {
973
996
  includeLegacyExtensions: o,
974
997
  includeEmptyExtensionPoints: !0
975
998
  }
976
- ), c = I.calculateHealthStats(r);
999
+ ), c = T.calculateHealthStats(r);
977
1000
  let l = this.generateHeader(c);
978
1001
  return l += this.generateTableOfContents(r), l += this.generateOverviewSection(r, c), r.forEach((u) => {
979
1002
  l += this.generateExtensionPointSection(u, {
@@ -1184,7 +1207,7 @@ No plugins currently registered for this extension point.
1184
1207
  `), s.sectionId && (i += `- **Section**: ${s.sectionId}
1185
1208
  `), s.rank !== void 0 && (i += `- **Rank**: ${s.rank}
1186
1209
  `), e) {
1187
- const o = I.analyzePlugin(s);
1210
+ const o = T.analyzePlugin(s);
1188
1211
  i += `- **Health**: ${this.getHealthEmoji(o.healthStatus)} ${o.healthStatus}
1189
1212
  `, o.capabilities.length > 0 && (i += `- **Capabilities**: ${o.capabilities.join(", ")}
1190
1213
  `);
@@ -1199,7 +1222,7 @@ No plugins currently registered for this extension point.
1199
1222
  static generateSchemaFieldsSection(t) {
1200
1223
  if (t.source !== "simplified")
1201
1224
  return "";
1202
- const i = y().getExtensionPoint(t.id);
1225
+ const i = b().getExtensionPoint(t.id);
1203
1226
  if (!(i != null && i.getSchemaFieldInfo))
1204
1227
  return "";
1205
1228
  const s = i.getSchemaFieldInfo();
@@ -1399,7 +1422,7 @@ console.log(validation.warnings); // Check for warnings
1399
1422
  // Helper methods
1400
1423
  static getExtensionPointImportName(t) {
1401
1424
  var a;
1402
- const i = y().getExtensionPoint(t);
1425
+ const i = b().getExtensionPoint(t);
1403
1426
  if ((a = i == null ? void 0 : i.config.metadata) != null && a.exportName)
1404
1427
  return i.config.metadata.exportName;
1405
1428
  const s = t.split(".");
@@ -1427,7 +1450,7 @@ console.log(validation.warnings); // Check for warnings
1427
1450
  }
1428
1451
  static inferContributionKey(t) {
1429
1452
  if (t.source === "simplified") {
1430
- const a = y().getExtensionPoint(t.id);
1453
+ const a = b().getExtensionPoint(t.id);
1431
1454
  if (a != null && a.config.contributionKey)
1432
1455
  return a.config.contributionKey;
1433
1456
  }
@@ -1445,7 +1468,7 @@ console.log(validation.warnings); // Check for warnings
1445
1468
  }
1446
1469
  static isViewBasedExtensionPoint(t) {
1447
1470
  if (t.source === "simplified") {
1448
- const i = y().getExtensionPoint(t.id);
1471
+ const i = b().getExtensionPoint(t.id);
1449
1472
  return (i == null ? void 0 : i.config.hasView) || !1;
1450
1473
  }
1451
1474
  return t.plugins.some(
@@ -1454,7 +1477,7 @@ console.log(validation.warnings); // Check for warnings
1454
1477
  }
1455
1478
  static isRankableExtensionPoint(t) {
1456
1479
  if (t.source === "simplified") {
1457
- const i = y().getExtensionPoint(t.id);
1480
+ const i = b().getExtensionPoint(t.id);
1458
1481
  return (i == null ? void 0 : i.config.isRankable) || !1;
1459
1482
  }
1460
1483
  return t.plugins.some(
@@ -1467,7 +1490,7 @@ console.log(validation.warnings); // Check for warnings
1467
1490
  static getSchemaFieldsForContribution(t) {
1468
1491
  if (t.source !== "simplified")
1469
1492
  return [];
1470
- const i = y().getExtensionPoint(t.id);
1493
+ const i = b().getExtensionPoint(t.id);
1471
1494
  return i != null && i.getSchemaFieldInfo ? i.getSchemaFieldInfo() : [];
1472
1495
  }
1473
1496
  static getSpecificFields(t) {
@@ -1496,28 +1519,28 @@ console.log(validation.warnings); // Check for warnings
1496
1519
  }
1497
1520
  }
1498
1521
  export {
1499
- D as B,
1500
- Ae as D,
1501
- I as P,
1502
- we as R,
1503
- Fe as a,
1504
- be as b,
1505
- y as c,
1506
- ye as d,
1507
- xe as e,
1508
- Se as f,
1509
- Ie as g,
1510
- Y as h,
1511
- Re as i,
1512
- Z as j,
1513
- O as k,
1514
- Ee as l,
1515
- k as m,
1516
- Ue as n,
1517
- $e as o,
1518
- Oe as p,
1519
- De as q,
1520
- _e as r,
1521
- Te as v
1522
+ M as B,
1523
+ Ge as D,
1524
+ T as P,
1525
+ Te as R,
1526
+ Me as a,
1527
+ Ie as b,
1528
+ b as c,
1529
+ Re as d,
1530
+ Se as e,
1531
+ Ve as f,
1532
+ Ke as g,
1533
+ ae as h,
1534
+ Ne as i,
1535
+ re as j,
1536
+ V as k,
1537
+ Fe as l,
1538
+ F as m,
1539
+ Be as n,
1540
+ De as o,
1541
+ He as p,
1542
+ We as q,
1543
+ Le as r,
1544
+ qe as v
1522
1545
  };
1523
- //# sourceMappingURL=documentation-generator-C0BDW8NY.js.map
1546
+ //# sourceMappingURL=documentation-generator-7qgOfgJZ.js.map