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

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 U = Object.defineProperty;
2
+ var A = (n, t, e) => t in n ? U(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var E = (n, t, e) => (A(n, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { z as x } from "zod";
5
+ function j(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 $ = {}, b = {};
22
+ Object.defineProperty(b, "__esModule", { value: !0 });
23
+ b.loadRemoteModule = b.setRemoteDefinitions = b.setRemoteUrlResolver = void 0;
24
+ let P, I;
25
+ const C = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
26
+ let F = !1;
27
+ function N(n) {
28
+ I = n;
29
29
  }
30
- x.setRemoteUrlResolver = K;
31
- function V(n) {
32
- v = n;
30
+ b.setRemoteUrlResolver = N;
31
+ function K(n) {
32
+ P = n;
33
33
  }
34
- x.setRemoteDefinitions = V;
35
- async function M(n, t) {
34
+ b.setRemoteDefinitions = K;
35
+ async function V(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 (C.has(e))
38
+ return C.get(e);
39
+ const o = (await (S.has(n) ? S.get(n) : await L(n)).get(t))();
40
+ return C.set(e, o), o;
41
41
  }
42
- x.loadRemoteModule = M;
43
- const L = (n, t) => new Promise((e, i) => {
42
+ b.loadRemoteModule = V;
43
+ const M = (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 L(n) {
59
+ if (!I && !P)
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
+ F || (F = !0, await __webpack_init_sharing__("default"));
62
+ const t = P ? P[n] : await I(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 M(e, n);
66
+ return await i.init(__webpack_share_scopes__.default), S.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 = b;
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
+ })($);
79
+ const Ce = /* @__PURE__ */ j({
80
80
  __proto__: null
81
- }, [k]);
82
- function B(n) {
81
+ }, [$]);
82
+ function q(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 B {
108
108
  constructor() {
109
- P(this, "issues", []);
109
+ E(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 H {
131
131
  constructor() {
132
- P(this, "cache", /* @__PURE__ */ new Map());
132
+ E(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) {
144
+ const w = new H();
145
+ function Re(n) {
146
146
  return w.get(n);
147
147
  }
148
- const U = [];
149
- function z(n) {
150
- U.push(n);
148
+ const T = [];
149
+ function W(n) {
150
+ T.push(n);
151
151
  }
152
- function G(n, t, e) {
153
- return U.reduce(
152
+ function z(n, t, e) {
153
+ return T.reduce(
154
154
  (i, s) => s(i, t, e),
155
155
  n
156
156
  );
157
157
  }
158
- class J {
158
+ class G {
159
159
  constructor() {
160
- P(this, "extensionPoints", /* @__PURE__ */ new Map());
160
+ E(this, "extensionPoints", /* @__PURE__ */ new Map());
161
161
  }
162
162
  define(t) {
163
163
  if (this.extensionPoints.has(t.id))
@@ -173,10 +173,10 @@ class J {
173
173
  return;
174
174
  }
175
175
  const i = this.createReducer(t);
176
- z(i), e.isRegistered = !0;
176
+ W(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 = () => q(t.schema)), this.extensionPoints.set(t.id, e), e;
180
180
  }
181
181
  createReducer(t) {
182
182
  return (e, i, s) => {
@@ -193,7 +193,7 @@ class J {
193
193
  contributions: i
194
194
  };
195
195
  if (t.validate) {
196
- const d = new H();
196
+ const d = new B();
197
197
  if (t.validate(
198
198
  r,
199
199
  d
@@ -207,14 +207,14 @@ 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 g = d.getIssues().map((p) => ({
211
+ ...p,
212
+ message: `Extension point validation: ${p.message}`
213
213
  }));
214
- if (w.set(a, b), d.hasErrors()) {
214
+ if (w.set(a, g), 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
+ g.filter((p) => p.type === "error").map((p) => p.message).join(", ")
218
218
  );
219
219
  return;
220
220
  }
@@ -231,11 +231,11 @@ class J {
231
231
  sectionId: c.sectionId
232
232
  };
233
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
- const d = r.experienceId, p = s == null ? void 0 : s[d];
235
- p && (e[t.relatedPoints.view] || (e[t.relatedPoints.view] = {}), e[t.relatedPoints.view][a] = {
234
+ const d = r.experienceId, f = s == null ? void 0 : s[d];
235
+ f && (e[t.relatedPoints.view] || (e[t.relatedPoints.view] = {}), e[t.relatedPoints.view][a] = {
236
236
  id: a,
237
237
  type: `${t.contributionKey}.view`,
238
- data: p,
238
+ data: f,
239
239
  remote: c.remote,
240
240
  sectionId: c.sectionId
241
241
  });
@@ -278,11 +278,11 @@ class J {
278
278
  return this.extensionPoints.has(t);
279
279
  }
280
280
  }
281
- const O = new J();
281
+ const O = new G();
282
282
  function y() {
283
283
  return O;
284
284
  }
285
- function Z(n = {}) {
285
+ function J(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) {
301
+ function Z(n) {
302
302
  return O.define(n);
303
303
  }
304
- const Q = {
304
+ const Y = {
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 Q(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 || X(n.id)
322
322
  } : void 0
323
323
  };
324
- return n.schema && (t.schema = te(n.schema, {
324
+ return n.schema && (t.schema = ee(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 = ne(n.validation)), n.transform ? t.transform = ue(n.transform) : n.hasView && (t.transform = J()), t;
328
328
  }
329
- function ee(n) {
329
+ function X(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 ee(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] = te(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 te(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 ne(n) {
373
+ return n.module ? le(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
+ ie(s, i, e);
379
379
  };
380
380
  }
381
- function se(n, t, e) {
381
+ function ie(n, t, e) {
382
382
  switch (n.type) {
383
383
  case "required":
384
- oe(n, t, e);
384
+ se(n, t, e);
385
385
  break;
386
386
  case "range":
387
- re(n, t, e);
387
+ oe(n, t, e);
388
388
  break;
389
389
  case "pattern":
390
- ae(n, t, e);
390
+ re(n, t, e);
391
391
  break;
392
392
  case "dependency":
393
- ce(n, t, e);
393
+ ae(n, t, e);
394
394
  break;
395
395
  case "custom":
396
- le(n, t, e);
396
+ ce(n, t, e);
397
397
  break;
398
398
  }
399
399
  }
400
- function oe(n, t, e) {
400
+ function se(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 oe(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 re(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 ae(n, t, e) {
419
419
  if (n.field && n.dependsOn && n.expression)
420
420
  try {
421
- $(n.expression, t) || e.addError(
421
+ v(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 ce(n, t, e) {
429
429
  if (n.expression)
430
430
  try {
431
- $(n.expression, t) || e.addError(n.message || "Custom validation failed");
431
+ v(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 le(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 ue(n) {
444
+ return n.module ? de(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] = pe(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] = fe(
460
460
  i[s],
461
461
  o
462
462
  ));
463
463
  return i;
464
464
  };
465
465
  }
466
- function pe(n) {
466
+ function de(n) {
467
467
  return (t, e) => (console.warn(`External transform module not implemented: ${n}`), t);
468
468
  }
469
- function fe(n) {
469
+ function pe(n) {
470
470
  if (typeof n == "string" && n.startsWith("$")) {
471
- const t = Q[n];
471
+ const t = Y[n];
472
472
  if (t)
473
473
  return t();
474
474
  }
475
475
  return n;
476
476
  }
477
- function me(n, t) {
477
+ function fe(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 me(n);
487
487
  case "kebabCase":
488
- return he(n);
488
+ return ge(n);
489
489
  default:
490
490
  return n;
491
491
  }
492
492
  }
493
- function ge(n) {
493
+ function me(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 ge(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 v(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) => v(s, t)) : e.includes("&&") ? e.split("&&").map((s) => s.trim()).every((s) => v(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 he = (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] = {
@@ -538,9 +538,9 @@ const ye = (n) => (t, e) => {
538
538
  remote: i,
539
539
  sectionId: s
540
540
  });
541
- }) : typeof m == "object" && Object.entries(m).forEach(([d, p]) => {
541
+ }) : typeof m == "object" && Object.entries(m).forEach(([d, f]) => {
542
542
  t[u][d] = {
543
- ...p,
543
+ ...f,
544
544
  id: d,
545
545
  remote: i,
546
546
  sectionId: s
@@ -548,7 +548,7 @@ const ye = (n) => (t, e) => {
548
548
  }));
549
549
  }), t;
550
550
  };
551
- async function be(n) {
551
+ async function ye(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 xe(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 _ = {
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 be(n) {
575
+ return n ? Object.keys(n).reduce(he(n), {
576
+ ..._
577
+ }) : _;
578
578
  }
579
- async function Ee(n) {
579
+ async function xe(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) => Q(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
+ Z(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 $.loadRemoteModule(
610
610
  o.remote,
611
611
  "./InitPlugin"
612
612
  );
@@ -618,54 +618,54 @@ 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 = be(n), e = t.experiences, s = z(
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 Ie(n) {
629
+ const { getExtensions: t } = await ye();
630
630
  return t(n);
631
631
  }
632
- const Pe = (n = null) => (n || window.location.search.replace("?", "")).split("&").map((t) => {
632
+ const Ee = (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), {}), Pe = () => {
636
+ const n = window.location.origin, t = Ee();
637
637
  return (t == null ? void 0 : t.host) || n;
638
- }, Fe = async (n) => {
639
- var b;
640
- const t = ve(), e = n ?? {}, {
638
+ }, Se = async (n) => {
639
+ var f;
640
+ const t = Pe(), 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
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) || [], m = ((f = l.data) == null ? void 0 : f.filter((g) => u.length === 0 || u.includes(g.name)).flatMap((g) => g.plugins)) ?? [], h = m == null ? void 0 : m.reduce((g, p) => {
650
+ const k = (o == null ? void 0 : o[p.id]) ?? `${i}${p.path}`;
651
+ return p.descriptor ? g[p.id] = {
652
+ basePath: `${k}remoteEntry.js`,
653
+ extensions: p.descriptor.extensions || [],
654
+ contributes: p.descriptor.contributes,
655
+ remote: p.descriptor.id,
656
+ init: !!p.descriptor.init
657
657
  } : console.error(
658
- `initialize-plugins: Plugin ${g.id} does not have a descriptor`
659
- ), f;
658
+ `initialize-plugins: Plugin ${p.id} does not have a descriptor`
659
+ ), g;
660
660
  }, {});
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;
661
+ window.KosPlugins = window.KosPlugins || {}, window.KosPlugins.__dynamicRemotes = h;
662
+ const d = Object.keys(h).reduce((g, p) => {
663
+ const k = h[p].remote;
664
+ return g[k] = h[p].basePath, g;
665
665
  }, {});
666
- return k.setRemoteDefinitions(p), p;
666
+ return $.setRemoteDefinitions(d), d;
667
667
  };
668
- function _e(n, t, e = !1) {
668
+ function Fe(n, t, e = !1) {
669
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) {
@@ -675,26 +675,26 @@ function _e(n, t, e = !1) {
675
675
  return a - r;
676
676
  })[0] ?? null;
677
677
  }
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")
678
+ const D = x.object({
679
+ id: x.string().min(1, "ID is required").describe("Unique identifier for this extension"),
680
+ title: x.string().min(1, "Title is required").describe("Display title shown in the interface"),
681
+ namespace: x.string().min(1, "Namespace is required").describe("Namespace for organizing related extensions"),
682
+ experienceId: x.string().min(1, "Experience ID is required").describe("Reference to the UI component experience for rendering")
683
683
  }), we = D.extend({
684
- rank: E.number().int().min(0).optional().describe("Optional ranking for ordering (higher = preferred)")
684
+ rank: x.number().int().min(0).optional().describe("Optional ranking for ordering (higher = preferred)")
685
685
  });
686
- function Te(n, t, e) {
686
+ function _e(n, t, e) {
687
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, t, e) {
692
+ function Te(n, t, e) {
693
693
  t && !t.includes(".") && e.addWarning(
694
694
  `${n} '${t}' should typically include dot notation (e.g., 'category.item')`
695
695
  );
696
696
  }
697
- function $e(n, t, e = 1e3) {
697
+ function ve(n, t, e = 1e3) {
698
698
  n !== void 0 && n > e && t.addWarning(
699
699
  `Rank ${n} seems unusually high - consider using lower values for better ordering`
700
700
  );
@@ -703,9 +703,9 @@ function Oe(n, t = {}) {
703
703
  return (t.rankable ? we : D).extend(n);
704
704
  }
705
705
  function De(n, t, e = 1e3) {
706
- typeof n == "object" && n !== null && "rank" in n && $e(n.rank, t, e);
706
+ typeof n == "object" && n !== null && "rank" in n && ve(n.rank, t, e);
707
707
  }
708
- class I {
708
+ class R {
709
709
  /**
710
710
  * Get all extension points with their plugin information
711
711
  */
@@ -888,23 +888,23 @@ class I {
888
888
  );
889
889
  return Object.entries(t.contributes).forEach(
890
890
  ([l, u]) => {
891
- this.getExpectedExtensionPoints(l).forEach((p) => {
892
- c.has(p) || (s.push(p), i.push(
893
- `Extension point '${p}' not available for '${l}' contributions`
891
+ this.getExpectedExtensionPoints(l).forEach((f) => {
892
+ c.has(f) || (s.push(f), i.push(
893
+ `Extension point '${f}' not available for '${l}' contributions`
894
894
  ), a.push(
895
- `Ensure the extension point '${p}' is registered`
895
+ `Ensure the extension point '${f}' is registered`
896
896
  ));
897
897
  });
898
898
  const d = r.getAllExtensionPoints().find(
899
- (p) => p.config.contributionKey === l
899
+ (f) => f.config.contributionKey === l
900
900
  );
901
- d && u.length > 0 && u.forEach((p, b) => {
902
- d.config.isRankable && typeof p.rank != "number" && (i.push(
903
- `${l}[${b}]: Extension point '${d.id}' expects 'rank' property`
901
+ d && u.length > 0 && u.forEach((f, g) => {
902
+ d.config.isRankable && typeof f.rank != "number" && (i.push(
903
+ `${l}[${g}]: Extension point '${d.id}' expects 'rank' property`
904
904
  ), a.push(
905
905
  "Add 'rank' property with numeric value for ordering"
906
- )), d.config.hasView && !p.experienceId && (i.push(
907
- `${l}[${b}]: Extension point '${d.id}' expects 'experienceId' for view-based contributions`
906
+ )), d.config.hasView && !f.experienceId && (i.push(
907
+ `${l}[${g}]: Extension point '${d.id}' expects 'experienceId' for view-based contributions`
908
908
  ), a.push(
909
909
  "Add 'experienceId' property linking to an experience definition"
910
910
  ));
@@ -957,7 +957,7 @@ class I {
957
957
  };
958
958
  }
959
959
  }
960
- class Ae {
960
+ class Ue {
961
961
  /**
962
962
  * Generate complete documentation for all extension points
963
963
  */
@@ -967,13 +967,13 @@ class Ae {
967
967
  includeTypeDefinitions: s = !0,
968
968
  includeLegacyExtensions: o = !0,
969
969
  includePluginHealth: a = !0
970
- } = e, r = I.getExtensionPoints(
970
+ } = e, r = R.getExtensionPoints(
971
971
  t,
972
972
  {
973
973
  includeLegacyExtensions: o,
974
974
  includeEmptyExtensionPoints: !0
975
975
  }
976
- ), c = I.calculateHealthStats(r);
976
+ ), c = R.calculateHealthStats(r);
977
977
  let l = this.generateHeader(c);
978
978
  return l += this.generateTableOfContents(r), l += this.generateOverviewSection(r, c), r.forEach((u) => {
979
979
  l += this.generateExtensionPointSection(u, {
@@ -1184,7 +1184,7 @@ No plugins currently registered for this extension point.
1184
1184
  `), s.sectionId && (i += `- **Section**: ${s.sectionId}
1185
1185
  `), s.rank !== void 0 && (i += `- **Rank**: ${s.rank}
1186
1186
  `), e) {
1187
- const o = I.analyzePlugin(s);
1187
+ const o = R.analyzePlugin(s);
1188
1188
  i += `- **Health**: ${this.getHealthEmoji(o.healthStatus)} ${o.healthStatus}
1189
1189
  `, o.capabilities.length > 0 && (i += `- **Capabilities**: ${o.capabilities.join(", ")}
1190
1190
  `);
@@ -1497,27 +1497,27 @@ console.log(validation.warnings); // Check for warnings
1497
1497
  }
1498
1498
  export {
1499
1499
  D as B,
1500
- Ae as D,
1501
- I as P,
1500
+ Ue as D,
1501
+ R as P,
1502
1502
  we as R,
1503
- Fe as a,
1504
- be as b,
1503
+ Se as a,
1504
+ ye as b,
1505
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,
1506
+ he as d,
1507
+ be as e,
1508
+ Ie as f,
1509
+ Re as g,
1510
+ Z as h,
1511
+ Ce as i,
1512
+ J as j,
1513
1513
  O as k,
1514
- Ee as l,
1515
- k as m,
1516
- Ue as n,
1517
- $e as o,
1514
+ xe as l,
1515
+ $ as m,
1516
+ Te as n,
1517
+ ve as o,
1518
1518
  Oe as p,
1519
1519
  De as q,
1520
- _e as r,
1521
- Te as v
1520
+ Fe as r,
1521
+ _e as v
1522
1522
  };
1523
- //# sourceMappingURL=documentation-generator-C0BDW8NY.js.map
1523
+ //# sourceMappingURL=documentation-generator-BdlPnORN.js.map