@kosdev-code/kos-ui-plugin 2.1.10 → 2.1.11

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.
@@ -23,7 +23,7 @@ Object.defineProperty(E, "__esModule", { value: !0 });
23
23
  E.loadRemoteModule = E.setRemoteDefinitions = E.setRemoteUrlResolver = void 0;
24
24
  let R, D;
25
25
  const O = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map();
26
- let j = !1;
26
+ let N = !1;
27
27
  function J(n) {
28
28
  D = n;
29
29
  }
@@ -58,7 +58,7 @@ const Q = (n, t) => new Promise((e, i) => {
58
58
  async function X(n) {
59
59
  if (!D && !R)
60
60
  throw new Error("Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.");
61
- j || (j = !0, await __webpack_init_sharing__("default"));
61
+ N || (N = !0, await __webpack_init_sharing__("default"));
62
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`);
@@ -78,8 +78,17 @@ async function X(n) {
78
78
  })(F);
79
79
  const Ne = /* @__PURE__ */ z({
80
80
  __proto__: null
81
- }, [F]);
81
+ }, [F]), V = [];
82
82
  function ee(n) {
83
+ V.push(n);
84
+ }
85
+ function te(n, t, e) {
86
+ return V.reduce(
87
+ (i, s) => s(i, t, e),
88
+ n
89
+ );
90
+ }
91
+ function ne(n) {
83
92
  var t;
84
93
  try {
85
94
  if ("shape" in n) {
@@ -104,7 +113,7 @@ function ee(n) {
104
113
  return console.warn("Failed to extract schema field info:", e), [];
105
114
  }
106
115
  }
107
- class te {
116
+ class ie {
108
117
  constructor() {
109
118
  C(this, "issues", []);
110
119
  }
@@ -127,7 +136,7 @@ class te {
127
136
  return [...this.issues];
128
137
  }
129
138
  }
130
- class ne {
139
+ class se {
131
140
  constructor() {
132
141
  C(this, "cache", /* @__PURE__ */ new Map());
133
142
  }
@@ -141,20 +150,10 @@ class ne {
141
150
  this.cache.clear();
142
151
  }
143
152
  }
144
- const I = new ne();
153
+ const I = new se();
145
154
  function Ke(n) {
146
155
  return I.get(n);
147
156
  }
148
- const K = [];
149
- function ie(n) {
150
- K.push(n);
151
- }
152
- function se(n, t, e) {
153
- return K.reduce(
154
- (i, s) => s(i, t, e),
155
- n
156
- );
157
- }
158
157
  class oe {
159
158
  constructor() {
160
159
  C(this, "extensionPoints", /* @__PURE__ */ new Map());
@@ -173,10 +172,10 @@ class oe {
173
172
  return;
174
173
  }
175
174
  const i = this.createReducer(t);
176
- ie(i), e.isRegistered = !0;
175
+ ee(i), e.isRegistered = !0;
177
176
  }
178
177
  };
179
- return t.schema && (e.getSchemaFieldInfo = () => ee(t.schema)), this.extensionPoints.set(t.id, e), e;
178
+ return t.schema && (e.getSchemaFieldInfo = () => ne(t.schema)), this.extensionPoints.set(t.id, e), e;
180
179
  }
181
180
  createReducer(t) {
182
181
  return (e, i, s) => {
@@ -193,7 +192,7 @@ class oe {
193
192
  contributions: i
194
193
  };
195
194
  if (t.validate) {
196
- const d = new te();
195
+ const d = new ie();
197
196
  if (t.validate(
198
197
  r,
199
198
  d
@@ -277,10 +276,21 @@ class oe {
277
276
  hasExtensionPoint(t) {
278
277
  return this.extensionPoints.has(t);
279
278
  }
279
+ /**
280
+ * Get the Zod schema for an extension point
281
+ * Returns undefined if the extension point doesn't have a schema
282
+ */
283
+ getExtensionPointSchema(t) {
284
+ const e = this.extensionPoints.get(t);
285
+ return e == null ? void 0 : e.config.schema;
286
+ }
280
287
  }
281
- const V = new oe();
288
+ const A = new oe();
282
289
  function b() {
283
- return V;
290
+ return A;
291
+ }
292
+ function Ve(n) {
293
+ return A.getExtensionPointSchema(n);
284
294
  }
285
295
  function re(n = {}) {
286
296
  const {
@@ -299,7 +309,7 @@ function re(n = {}) {
299
309
  };
300
310
  }
301
311
  function ae(n) {
302
- return V.define(n);
312
+ return A.define(n);
303
313
  }
304
314
  const ce = {
305
315
  $timestamp: () => Date.now(),
@@ -567,14 +577,14 @@ async function Ie(n) {
567
577
  );
568
578
  return window.KosPlugins.extensions = i, { extensionPoints: i, getExtensions: (o) => i[o] || [], remotes: t, extensions: e };
569
579
  }
570
- const N = {
580
+ const K = {
571
581
  controlPourDefinitions: {},
572
582
  experiences: {}
573
583
  };
574
584
  function Se(n) {
575
585
  return n ? Object.keys(n).reduce(Re(n), {
576
- ...N
577
- }) : N;
586
+ ...K
587
+ }) : K;
578
588
  }
579
589
  async function Fe(n) {
580
590
  if (!n)
@@ -618,14 +628,14 @@ async function Fe(n) {
618
628
  console.warn(`Failed to load InitPlugin from ${o.remote}:`, a);
619
629
  }
620
630
  }
621
- const t = Se(n), e = t.experiences, s = se(
631
+ const t = Se(n), e = t.experiences, s = te(
622
632
  {},
623
633
  t,
624
634
  e
625
635
  );
626
636
  return window.KosPlugins = window.KosPlugins || {}, window.KosPlugins.__extensions = s, s;
627
637
  }
628
- async function Ve(n) {
638
+ async function Me(n) {
629
639
  const { getExtensions: t } = await Ie();
630
640
  return t(n);
631
641
  }
@@ -635,7 +645,7 @@ const _e = (n = null) => (n || window.location.search.replace("?", "")).split("&
635
645
  }).reduce((t, [e, i]) => (t[e] = i, t), {}), Oe = () => {
636
646
  const n = window.location.origin, t = _e();
637
647
  return (t == null ? void 0 : t.host) || n;
638
- }, Me = async (n) => {
648
+ }, Le = async (n) => {
639
649
  var x;
640
650
  const t = Oe(), e = n ?? {}, {
641
651
  pluginBaseUrl: i = t,
@@ -651,7 +661,7 @@ const _e = (n = null) => (n || window.location.search.replace("?", "")).split("&
651
661
  ), h = a == null ? void 0 : a.group, d = f == null ? void 0 : f.reduce((m, g) => {
652
662
  const _ = (o == null ? void 0 : o[g.id]) ?? `${i}${g.path}`;
653
663
  if (g.descriptor) {
654
- const A = (g.descriptor.extensions || []).reduce((P, y) => {
664
+ const j = (g.descriptor.extensions || []).reduce((P, y) => {
655
665
  const k = y.groups || [];
656
666
  return (!h || k.includes(h)) && P.push(y), P;
657
667
  }, []), v = g.descriptor.contributes || {};
@@ -669,11 +679,11 @@ const _e = (n = null) => (n || window.location.search.replace("?", "")).split("&
669
679
  return P;
670
680
  },
671
681
  {}
672
- ), q = !!g.descriptor.init && (A.length > 0 || $);
682
+ ), q = !!g.descriptor.init && (j.length > 0 || $);
673
683
  m[g.id] = {
674
684
  section: g.name,
675
685
  basePath: `${_}remoteEntry.js`,
676
- extensions: A,
686
+ extensions: j,
677
687
  contributes: L,
678
688
  remote: g.descriptor.id,
679
689
  init: q
@@ -691,7 +701,7 @@ const _e = (n = null) => (n || window.location.search.replace("?", "")).split("&
691
701
  }, {});
692
702
  return F.setRemoteDefinitions(p), p;
693
703
  };
694
- function Le(n, t, e = !1) {
704
+ function qe(n, t, e = !1) {
695
705
  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) => {
696
706
  const a = typeof s.rank == "number" ? s.rank : 1 / 0, r = typeof o.rank == "number" ? o.rank : 1 / 0;
697
707
  if (a === r) {
@@ -709,13 +719,13 @@ const M = w.object({
709
719
  }), Te = M.extend({
710
720
  rank: w.number().int().min(0).optional().describe("Optional ranking for ordering (higher = preferred)")
711
721
  });
712
- function qe(n, t, e) {
722
+ function Be(n, t, e) {
713
723
  const i = n.safeParse(t);
714
724
  return i.success ? !0 : (i.error.errors.forEach((s) => {
715
725
  e.addError(`${s.path.join(".")}: ${s.message}`);
716
726
  }), !1);
717
727
  }
718
- function Be(n, t, e) {
728
+ function He(n, t, e) {
719
729
  t && !t.includes(".") && e.addWarning(
720
730
  `${n} '${t}' should typically include dot notation (e.g., 'category.item')`
721
731
  );
@@ -725,10 +735,10 @@ function De(n, t, e = 1e3) {
725
735
  `Rank ${n} seems unusually high - consider using lower values for better ordering`
726
736
  );
727
737
  }
728
- function He(n, t = {}) {
738
+ function We(n, t = {}) {
729
739
  return (t.rankable ? Te : M).extend(n);
730
740
  }
731
- function We(n, t, e = 1e3) {
741
+ function Ge(n, t, e = 1e3) {
732
742
  typeof n == "object" && n !== null && "rank" in n && De(n.rank, t, e);
733
743
  }
734
744
  class T {
@@ -983,7 +993,7 @@ class T {
983
993
  };
984
994
  }
985
995
  }
986
- class Ge {
996
+ class ze {
987
997
  /**
988
998
  * Generate complete documentation for all extension points
989
999
  */
@@ -1523,27 +1533,28 @@ console.log(validation.warnings); // Check for warnings
1523
1533
  }
1524
1534
  export {
1525
1535
  M as B,
1526
- Ge as D,
1536
+ ze as D,
1527
1537
  T as P,
1528
1538
  Te as R,
1529
- Me as a,
1539
+ Le as a,
1530
1540
  Ie as b,
1531
1541
  b as c,
1532
1542
  Re as d,
1533
1543
  Se as e,
1534
- Ve as f,
1544
+ Me as f,
1535
1545
  Ke as g,
1536
1546
  ae as h,
1537
1547
  Ne as i,
1538
- re as j,
1539
- V as k,
1548
+ Ve as j,
1549
+ A as k,
1540
1550
  Fe as l,
1541
1551
  F as m,
1542
- Be as n,
1543
- De as o,
1544
- He as p,
1552
+ re as n,
1553
+ He as o,
1554
+ De as p,
1545
1555
  We as q,
1546
- Le as r,
1547
- qe as v
1556
+ qe as r,
1557
+ Ge as s,
1558
+ Be as v
1548
1559
  };
1549
- //# sourceMappingURL=documentation-generator-DZ1-wZzF.js.map
1560
+ //# sourceMappingURL=documentation-generator-auruIa_o.js.map