@arcgis/api-extractor 6.0.0-next.2 → 6.0.0-next.20

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,23 +1,23 @@
1
1
  import { styleText as D } from "node:util";
2
- import { emitJsDocError as g, getApiNodeLabel as T } from "../utils/apiHelpers.js";
3
- import { b as A, e as W, d as S, g as L } from "./privateContext.js";
2
+ import { emitJsDocError as g, getApiNodeLabel as x } from "../utils/apiHelpers.js";
3
+ import { b as N, e as W, d as S, g as L } from "./privateContext.js";
4
4
  import { kebabToPascal as M } from "@arcgis/toolkit/string";
5
5
  import R from "typescript";
6
6
  function q(e, i, n) {
7
- return N(e, i, n) ?? void 0;
7
+ return I(e, i, n) ?? void 0;
8
8
  }
9
- function z(e, i, n, t) {
10
- const s = N(e, i, n);
11
- return s === void 0 ? t : s ?? void 0;
9
+ function z(e, i, n, t, o) {
10
+ let s = I(e, i, n);
11
+ return s === void 0 && o !== void 0 && (s = I(o, i, n)), s === void 0 ? t : s ?? void 0;
12
12
  }
13
- function N(e, i, n) {
13
+ function I(e, i, n) {
14
14
  const t = R.getLeadingCommentRanges(n.file.text, e.pos);
15
15
  if (t === void 0)
16
16
  return;
17
- let s;
17
+ let o;
18
18
  for (const l of t) {
19
19
  const d = n.file.text.slice(l.pos, l.end);
20
- d.startsWith("/**") && (s !== void 0 && n.config.strict && n.emitError(
20
+ d.startsWith("/**") && (o !== void 0 && n.config.strict && n.emitError(
21
21
  `Found multiple JSDoc comments for the same node. This is not allowed.
22
22
  If one of these was meant to be a file-level comment, read the documentation: https://webgis.esri.com/references/api-extractor/api-node-kinds#module-level-documentation
23
23
  If this is meant to be a function overload, read the documentation: https://webgis.esri.com/references/api-extractor/api-node-kinds#function-overloads`,
@@ -25,26 +25,26 @@ If this is meant to be a function overload, read the documentation: https://webg
25
25
  file: n.file,
26
26
  node: e
27
27
  }
28
- ), s = d);
28
+ ), o = d);
29
29
  }
30
- if (s === void 0)
30
+ if (o === void 0)
31
31
  return;
32
- const o = n.config.documentation.omitInternal;
33
- return J(s, i, o, n);
32
+ const s = n.config.documentation.omitInternal;
33
+ return J(o, i, s, n);
34
34
  }
35
35
  function J(e, i, n, t) {
36
36
  if (i && !e.includes("* @public") && (n || !e.includes("* @internal")))
37
37
  return null;
38
- const s = e.length - 2;
39
- let o = 3, l = "";
38
+ const o = e.length - 2;
39
+ let s = 3, l = "";
40
40
  const d = [];
41
41
  let r, k, h = !1;
42
- for (; o < s; ) {
42
+ for (; s < o; ) {
43
43
  let v = e.indexOf(`
44
- `, o);
45
- v === -1 && (v = s);
46
- let f = e.slice(o, v).trim();
47
- if (o = v + 1, f === "*" ? f = "" : f.startsWith("*") && (f[1] === " " ? f = f.slice(2) : t.config.strict ? t.emitError(
44
+ `, s);
45
+ v === -1 && (v = o);
46
+ let f = e.slice(s, v).trim();
47
+ if (s = v + 1, f === "*" ? f = "" : f.startsWith("*") && (f[1] === " " ? f = f.slice(2) : t.config.strict ? t.emitError(
48
48
  `For consistency, include a space character after '*' in JSDoc. Did not find it in "${e}"`,
49
49
  {
50
50
  file: t.file,
@@ -81,68 +81,68 @@ ${f}` : l += `${f}
81
81
  }
82
82
  function G(e, i) {
83
83
  for (let n = 0; n < i.docsTags.length; ++n) {
84
- const t = i.docsTags[n], { name: s, text: o } = t;
85
- s === "deprecated" ? e.deprecated = o || !0 : (e.docsTags ??= [], e.docsTags.push(t));
84
+ const t = i.docsTags[n], { name: o, text: s } = t;
85
+ o === "deprecated" ? e.deprecated = s || !0 : (e.docsTags ??= [], e.docsTags.push(t));
86
86
  }
87
87
  e.description = i.description;
88
88
  }
89
89
  function K(e, i) {
90
90
  for (let n = 0; n < i.docsTags.length; ++n) {
91
- const t = i.docsTags[n], { name: s, text: o } = t;
92
- if (s === "deprecated")
93
- e.deprecated = o || !0;
91
+ const t = i.docsTags[n], { name: o, text: s } = t;
92
+ if (o === "deprecated")
93
+ e.deprecated = s || !0;
94
94
  else if (t === y.private)
95
95
  e.privacy = "private";
96
- else if (s === "csspart")
97
- e.cssParts ??= [], e.cssParts.push(w(o));
98
- else if (s === "cssstate")
99
- e.cssStates ??= [], e.cssStates.push(w(o));
100
- else if (s === "slot")
101
- e.slots ??= [], e.slots.push(w(o));
102
- else if (s === "esriCompatibilityName") {
103
- const l = A(e);
104
- l.esriCompatibilityNames ??= [], l.esriCompatibilityNames.push(o ?? "");
105
- } else s === "readonly" || (e.docsTags ??= [], e.docsTags.push(t));
96
+ else if (o === "csspart")
97
+ e.cssParts ??= [], e.cssParts.push(w(s));
98
+ else if (o === "cssstate")
99
+ e.cssStates ??= [], e.cssStates.push(w(s));
100
+ else if (o === "slot")
101
+ e.slots ??= [], e.slots.push(w(s));
102
+ else if (o === "esriCompatibilityName") {
103
+ const l = N(e);
104
+ l.esriCompatibilityNames ??= [], l.esriCompatibilityNames.push(s ?? "");
105
+ } else o === "readonly" || (e.docsTags ??= [], e.docsTags.push(t));
106
106
  }
107
107
  e.description = i.description;
108
108
  }
109
109
  function Q(e, i) {
110
110
  const n = e, t = [];
111
- for (let s = 0; s < i.docsTags.length; ++s) {
112
- const o = i.docsTags[s], { name: l, text: d } = o;
111
+ for (let o = 0; o < i.docsTags.length; ++o) {
112
+ const s = i.docsTags[o], { name: l, text: d } = s;
113
113
  if (l === "deprecated")
114
114
  e.deprecated = d || !0;
115
- else if (o === y.private)
115
+ else if (s === y.private)
116
116
  e.privacy = "private";
117
117
  else if (l === "param")
118
- t.push(o);
118
+ t.push(s);
119
119
  else if (l === "returns")
120
- n.return.description = o.text;
120
+ n.return.description = s.text;
121
121
  else if (l === "esriCompatibilityName") {
122
122
  const r = S(e);
123
123
  r.esriCompatibilityNames ??= [], r.esriCompatibilityNames.push(d ?? "");
124
124
  } else
125
- e.docsTags ??= [], e.docsTags.push(o);
125
+ e.docsTags ??= [], e.docsTags.push(s);
126
126
  }
127
127
  return e.description = i.description, t;
128
128
  }
129
129
  function X(e, i) {
130
130
  for (let n = 0; n < i.docsTags.length; ++n) {
131
- const t = i.docsTags[n], { name: s, text: o } = t;
132
- s === "deprecated" ? e.deprecated = o || !0 : s === "default" ? e.default = o : t === y.readonly ? e.readonly = !0 : t === y.private ? e.privacy = "private" : (e.docsTags ??= [], e.docsTags.push(t));
131
+ const t = i.docsTags[n], { name: o, text: s } = t;
132
+ o === "deprecated" ? e.deprecated = s || !0 : o === "default" ? e.default = s : t === y.readonly ? e.readonly = !0 : t === y.private ? e.privacy = "private" : (e.docsTags ??= [], e.docsTags.push(t));
133
133
  }
134
134
  e.description = i.description;
135
135
  }
136
136
  function Y(e, i) {
137
137
  for (let n = 0; n < i.docsTags.length; ++n) {
138
- const t = i.docsTags[n], { name: s, text: o } = t;
139
- if (s === "deprecated")
140
- e.deprecated = o || !0;
141
- else if (s === "default")
142
- e.default = o;
143
- else if (s !== "readonly") if (s === "esriCompatibilityName") {
138
+ const t = i.docsTags[n], { name: o, text: s } = t;
139
+ if (o === "deprecated")
140
+ e.deprecated = s || !0;
141
+ else if (o === "default")
142
+ e.default = s;
143
+ else if (o !== "readonly") if (o === "esriCompatibilityName") {
144
144
  const l = W(e);
145
- l.esriCompatibilityNames ??= [], l.esriCompatibilityNames.push(o ?? "");
145
+ l.esriCompatibilityNames ??= [], l.esriCompatibilityNames.push(s ?? "");
146
146
  } else
147
147
  e.docsTags ??= [], e.docsTags.push(t);
148
148
  }
@@ -150,8 +150,8 @@ function Y(e, i) {
150
150
  }
151
151
  function Z(e, i) {
152
152
  for (let n = 0; n < i.docsTags.length; ++n) {
153
- const t = i.docsTags[n], { name: s, text: o } = t;
154
- s === "deprecated" ? e.deprecated = o || !0 : t === y.private ? e.privacy = "private" : (e.docsTags ??= [], e.docsTags.push(t));
153
+ const t = i.docsTags[n], { name: o, text: s } = t;
154
+ o === "deprecated" ? e.deprecated = s || !0 : t === y.private ? e.privacy = "private" : (e.docsTags ??= [], e.docsTags.push(t));
155
155
  }
156
156
  e.description = i.description;
157
157
  }
@@ -190,15 +190,15 @@ function w(e) {
190
190
  };
191
191
  let n, t = e.slice(0, i);
192
192
  if (t.startsWith("[") && t.endsWith("]")) {
193
- const o = t.slice(1, -1), l = o.indexOf("=");
194
- t = o.slice(0, l), n = o.slice(l + 1);
193
+ const s = t.slice(1, -1), l = s.indexOf("=");
194
+ t = s.slice(0, l), n = s.slice(l + 1);
195
195
  }
196
- const s = e.slice(i + 3);
196
+ const o = e.slice(i + 3);
197
197
  return {
198
198
  name: t,
199
199
  deprecated: void 0,
200
200
  summary: void 0,
201
- description: s,
201
+ description: o,
202
202
  docsTags: void 0,
203
203
  type: void 0,
204
204
  syntax: void 0,
@@ -225,15 +225,15 @@ const y = {
225
225
  };
226
226
  function ne(e, i) {
227
227
  if (typeof e == "string") {
228
- const n = e.replaceAll(F, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host);
229
- return e.includes("](.") && g(I, e, i), n;
228
+ const n = e.replaceAll(A, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host);
229
+ return e.includes("](.") && g(F, e, i), n;
230
230
  }
231
231
  return e;
232
232
  }
233
233
  function te(e, i) {
234
234
  if (e) {
235
- const n = e.replaceAll(F, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host);
236
- return n.includes("](.") && g(I, n, i), n;
235
+ const n = e.replaceAll(A, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host);
236
+ return n.includes("](.") && g(F, n, i), n;
237
237
  }
238
238
  return e;
239
239
  }
@@ -241,25 +241,25 @@ function se(e, i) {
241
241
  if (e !== void 0 && i.inheritedModuleName === void 0)
242
242
  for (let n = 0; n < e.length; ++n) {
243
243
  const t = e[n];
244
- t.text && (t.text = t.text.replaceAll(F, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host), t.text.includes("](.") && g(I, t.text, i));
244
+ t.text && (t.text = t.text.replaceAll(A, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host), t.text.includes("](.") && g(F, t.text, i));
245
245
  }
246
246
  }
247
- const I = "Unexpected relative markdown link. For links to API within the package use {@link}. For all other links, use absolute markdown. Documentation: https://webgis.esri.com/references/api-extractor/tags-reference#link)", F = /\{@link +([^}]+)\}/gu;
247
+ const F = "Unexpected relative markdown link. For links to API within the package use {@link}. For all other links, use absolute markdown. Documentation: https://webgis.esri.com/references/api-extractor/tags-reference#link)", A = /\{@link +([^}]+)\}/gu;
248
248
  function oe(e, i, n) {
249
249
  let t = n.indexOf(" ");
250
250
  t === -1 && (t = n.length);
251
- const s = n.slice(0, t);
252
- let o = n.slice(t + 1);
253
- if (s.startsWith("https://"))
251
+ const o = n.slice(0, t);
252
+ let s = n.slice(t + 1);
253
+ if (o.startsWith("https://"))
254
254
  return e.config.strict ? (g(
255
255
  "Did not expect absolute URLs in a @link tag. Please use markdown links for external links. See https://webgis.esri.com/references/api-extractor/tags-reference#link)",
256
256
  i,
257
257
  e
258
- ), "") : `[${o || s}](${s})`;
259
- const [l, d] = s.split("#"), [r, k] = l.split("!");
258
+ ), "") : `[${s || o}](${o})`;
259
+ const [l, d] = o.split("#"), [r, k] = l.split("!");
260
260
  if (r === "")
261
261
  return g(
262
- `Expected @link reference to start with a module name (before ! or #), but got: ${s}`,
262
+ `Expected @link reference to start with a module name (before ! or #), but got: ${o}`,
263
263
  i,
264
264
  e
265
265
  ), i;
@@ -295,7 +295,7 @@ function oe(e, i, n) {
295
295
  `Invalid reference syntax used. Class/mixin/custom element declarations must be referenced without specifying the class name. Expected ${D("green", r)}`,
296
296
  i,
297
297
  e
298
- ), i) : (P(e, i, c), `[${o || T(c)}](${b})`);
298
+ ), i) : (P(e, i, c), `[${s || x(c)}](${b})`);
299
299
  } else if (d !== void 0) {
300
300
  const c = h.path === f.path, a = v.index.class;
301
301
  if (a === void 0)
@@ -308,12 +308,12 @@ function oe(e, i, n) {
308
308
  i,
309
309
  e
310
310
  ), i;
311
- const $ = v.inheritance, x = typeof $ == "object" ? $ : void 0;
311
+ const $ = v.inheritance, T = typeof $ == "object" ? $ : void 0;
312
312
  let m;
313
313
  if (d.startsWith("event-")) {
314
314
  const u = d.slice(6);
315
- if (x !== void 0)
316
- m = x.indexedEvents?.[u];
315
+ if (T !== void 0)
316
+ m = T.indexedEvents?.[u];
317
317
  else if (a.events !== void 0)
318
318
  for (let p = 0; p < a.events.length; ++p) {
319
319
  const C = a.events[p];
@@ -324,8 +324,8 @@ function oe(e, i, n) {
324
324
  }
325
325
  } else if (d.startsWith("slot-")) {
326
326
  const u = d.slice(5);
327
- if (x !== void 0)
328
- m = x.indexedSlots?.[u];
327
+ if (T !== void 0)
328
+ m = T.indexedSlots?.[u];
329
329
  else if (a.slots !== void 0)
330
330
  for (let p = 0; p < a.slots.length; ++p) {
331
331
  const C = a.slots[p];
@@ -334,10 +334,10 @@ function oe(e, i, n) {
334
334
  break;
335
335
  }
336
336
  }
337
- m?.name === "" && (o ||= `${T(a)}.default-slot`);
337
+ m?.name === "" && (s ||= `${x(a)}.default-slot`);
338
338
  } else if (d.startsWith("--")) {
339
- if (x !== void 0)
340
- m = x.indexedCssProperties?.[d];
339
+ if (T !== void 0)
340
+ m = T.indexedCssProperties?.[d];
341
341
  else if (a.cssProperties !== void 0)
342
342
  for (let u = 0; u < a.cssProperties.length; ++u) {
343
343
  const p = a.cssProperties[u];
@@ -346,7 +346,7 @@ function oe(e, i, n) {
346
346
  break;
347
347
  }
348
348
  }
349
- } else if (x?.indexedMembers !== void 0 && (m = x.indexedMembers[d] ?? x.indexedMembers[`static ${d}`]), m === void 0 && a.members !== void 0) {
349
+ } else if (T?.indexedMembers !== void 0 && (m = T.indexedMembers[d] ?? T.indexedMembers[`static ${d}`]), m === void 0 && a.members !== void 0) {
350
350
  for (let u = 0; u < a.members.length; ++u) {
351
351
  const p = a.members[u];
352
352
  if (d === p.name) {
@@ -363,20 +363,20 @@ function oe(e, i, n) {
363
363
  }
364
364
  }
365
365
  }
366
- return m === void 0 ? (e.config.verify.detectBrokenLinks ? g("Failed to find the referenced class member", i, e) : e.silencedBrokenLinkCount += 1, i) : (P(e, i, m), `[${o || (c ? T(m) : `${T(a)}.${T(m)}`)}](${b})`);
366
+ return m === void 0 ? (e.config.verify.detectBrokenLinks ? g("Failed to find the referenced class member", i, e) : e.silencedBrokenLinkCount += 1, i) : (P(e, i, m), `[${s || (c ? x(m) : `${x(a)}.${x(m)}`)}](${b})`);
367
367
  } else {
368
368
  P(e, i, v.index.class);
369
- const c = v.index.class === void 0 ? B(r) : T(v.index.class);
370
- return `[${o || c}](${b})`;
369
+ const c = v.index.class === void 0 ? B(r) : x(v.index.class);
370
+ return `[${s || c}](${b})`;
371
371
  }
372
372
  }
373
373
  function O(e, i, n, t) {
374
- let s;
374
+ let o;
375
375
  if (t.isComponentProject && typeof t.config.documentation.getComponentDocsUrl == "function" && e.startsWith("components/")) {
376
- const o = e.slice(11), l = o.indexOf("/"), d = l === -1 ? o : o.slice(0, l), r = t.config.documentation.getComponentDocsUrl(d, M(d));
377
- r !== void 0 && (s = r + (l === -1 ? "" : o.slice(l + 1)));
376
+ const s = e.slice(11), l = s.indexOf("/"), d = l === -1 ? s : s.slice(0, l), r = t.config.documentation.getComponentDocsUrl(d, M(d));
377
+ r !== void 0 && (o = r + (l === -1 ? "" : s.slice(l + 1)));
378
378
  }
379
- return s ??= `${t.normalizedApiReferencePrefix}${e}/`, U(s, i, n);
379
+ return o ??= `${t.normalizedApiReferencePrefix}${e}/`, U(o, i, n);
380
380
  }
381
381
  function U(e, i, n) {
382
382
  return i !== void 0 ? n === void 0 ? `${e}#${encodeURIComponent(i)}` : `${e}#${encodeURIComponent(i)}-${encodeURIComponent(n)}` : n !== void 0 ? `${e}#${encodeURIComponent(n)}` : e;
@@ -1,140 +1,175 @@
1
- import { b as T } from "../chunks/links.js";
2
- function K({ modules: e }, t) {
3
- const o = {
1
+ import { b as O } from "../chunks/links.js";
2
+ function P(e, n) {
3
+ const o = [
4
+ ["Additions", (t) => t.added === !0 && !t.deprecated && !t.removed],
5
+ ["Deprecations", (t) => !!t.deprecated && !t.removed],
6
+ ["Removals", (t) => t.removed === !0]
7
+ ], c = [];
8
+ for (const [t, i] of o) {
9
+ const l = T(e, n, i);
10
+ l !== "" && c.push(`### ${t}
11
+
12
+ ${l}`);
13
+ }
14
+ return c.join(`
15
+
16
+ `);
17
+ }
18
+ function T({ modules: e }, n, o) {
19
+ const c = {
4
20
  children: /* @__PURE__ */ new Map(),
5
21
  members: []
6
22
  };
7
- for (let n = 0; n < e.length; ++n) {
8
- const i = e[n], w = i.path.split("/");
9
- let y = w;
10
- const M = w.at(-1);
11
- i.declarations.length === 1 && i.declarations[0].name === M && (y = w.slice(0, -1));
12
- let U = o;
13
- for (const g of y)
14
- U = D(U, g);
15
- for (let g = 0; g < i.declarations.length; ++g) {
16
- const f = i.declarations[g], S = B(f), O = f.removed === !0 ? void 0 : $(t, i.path, f, void 0), C = j(f), N = { label: S, viewUrl: O, change: C }, d = f, h = [];
17
- if (d.members !== void 0)
18
- for (let l = 0; l < d.members.length; ++l) {
19
- const r = d.members[l], m = r.kind === "field" ? "property" : r.kind === "call-signature" ? "call signature" : r.kind, p = v(m, r);
20
- if (p === void 0)
23
+ for (let i = 0; i < e.length; ++i) {
24
+ const l = e[i], k = l.path.split("/");
25
+ let y = k;
26
+ const M = k.at(-1);
27
+ l.declarations.length === 1 && l.declarations[0].name === M && (y = k.slice(0, -1));
28
+ let U = c;
29
+ for (const b of y)
30
+ U = N(U, b);
31
+ for (let b = 0; b < l.declarations.length; ++b) {
32
+ const u = l.declarations[b], j = E(u), B = u.removed === !0 ? void 0 : w(n, l.path, u, void 0), D = o(u) ? A(u) : void 0, x = { label: j, viewUrl: B, change: D }, h = u, p = [];
33
+ if (h.members !== void 0)
34
+ for (let d = 0; d < h.members.length; ++d) {
35
+ const s = h.members[d];
36
+ if (!o(s))
21
37
  continue;
22
- const s = F(r), a = r.removed === !0 ? void 0 : $(
23
- t,
24
- i.path,
25
- f,
26
- "name" in r ? r.name : `${f.name}Properties`
38
+ const v = s.kind === "field" ? "property" : s.kind === "call-signature" ? "call signature" : s.kind, f = g(v, s);
39
+ if (f === void 0)
40
+ continue;
41
+ const a = I(s), r = s.removed === !0 ? void 0 : w(
42
+ n,
43
+ l.path,
44
+ u,
45
+ "name" in s ? s.name : `${u.name}Properties`
27
46
  );
28
- h.push({ label: s, viewUrl: a, change: p });
47
+ p.push({ label: a, viewUrl: r, change: f });
29
48
  }
30
- if (d.events !== void 0)
31
- for (let l = 0; l < d.events.length; ++l) {
32
- const r = d.events[l], m = v("event", r);
33
- if (m === void 0)
49
+ if (h.events !== void 0)
50
+ for (let d = 0; d < h.events.length; ++d) {
51
+ const s = h.events[d];
52
+ if (!o(s))
53
+ continue;
54
+ const v = g("event", s);
55
+ if (v === void 0)
34
56
  continue;
35
- const p = r.removed === !0 ? void 0 : $(t, i.path, f, `event-${r.name}`);
36
- h.push({ label: `@${r.name}`, viewUrl: p, change: m });
57
+ const f = s.removed === !0 ? void 0 : w(n, l.path, u, `event-${s.name}`);
58
+ p.push({ label: `@${s.name}`, viewUrl: f, change: v });
37
59
  }
38
- if (typeof d.tagName == "string") {
39
- const l = d.slots, r = d.cssParts, m = d.cssProperties, p = d.cssStates;
40
- if (l !== void 0)
41
- for (let s = 0; s < l.length; ++s) {
42
- const a = l[s], u = v("slot", a);
43
- if (u === void 0)
60
+ if (typeof h.tagName == "string") {
61
+ const d = h.slots, s = h.cssParts, v = h.cssProperties, f = h.cssStates;
62
+ if (d !== void 0)
63
+ for (let a = 0; a < d.length; ++a) {
64
+ const r = d[a];
65
+ if (!o(r))
66
+ continue;
67
+ const m = g("slot", r);
68
+ if (m === void 0)
44
69
  continue;
45
- const b = a.removed === !0 ? void 0 : $(t, i.path, f, `slot-${a.name}`);
46
- h.push({ label: a.name, viewUrl: b, change: u });
70
+ const $ = r.removed === !0 ? void 0 : w(n, l.path, u, `slot-${r.name}`);
71
+ p.push({ label: r.name, viewUrl: $, change: m });
47
72
  }
48
- if (r !== void 0)
49
- for (let s = 0; s < r.length; ++s) {
50
- const a = r[s], u = v("css part", a);
51
- if (u === void 0)
73
+ if (s !== void 0)
74
+ for (let a = 0; a < s.length; ++a) {
75
+ const r = s[a];
76
+ if (!o(r))
52
77
  continue;
53
- h.push({ label: a.name, viewUrl: void 0, change: u });
78
+ const m = g("css part", r);
79
+ if (m === void 0)
80
+ continue;
81
+ p.push({ label: r.name, viewUrl: void 0, change: m });
54
82
  }
55
- if (m !== void 0)
56
- for (let s = 0; s < m.length; ++s) {
57
- const a = m[s], u = v("css property", a);
58
- if (u === void 0)
83
+ if (v !== void 0)
84
+ for (let a = 0; a < v.length; ++a) {
85
+ const r = v[a];
86
+ if (!o(r))
87
+ continue;
88
+ const m = g("css property", r);
89
+ if (m === void 0)
59
90
  continue;
60
- const b = a.removed === !0 ? void 0 : $(t, i.path, f, a.name);
61
- h.push({ label: a.name, viewUrl: b, change: u });
91
+ const $ = r.removed === !0 ? void 0 : w(n, l.path, u, r.name);
92
+ p.push({ label: r.name, viewUrl: $, change: m });
62
93
  }
63
- if (p !== void 0)
64
- for (let s = 0; s < p.length; ++s) {
65
- const a = p[s], u = v("css state", a);
66
- if (u === void 0)
94
+ if (f !== void 0)
95
+ for (let a = 0; a < f.length; ++a) {
96
+ const r = f[a];
97
+ if (!o(r))
98
+ continue;
99
+ const m = g("css state", r);
100
+ if (m === void 0)
67
101
  continue;
68
- h.push({ label: a.name, viewUrl: void 0, change: u });
102
+ p.push({ label: r.name, viewUrl: void 0, change: m });
69
103
  }
70
104
  }
71
- h.length > 0 ? E(U, N).members.push(...h) : C !== void 0 && U.members.push(N);
105
+ p.length > 0 ? F(U, x).members.push(...p) : D !== void 0 && U.members.push(x);
72
106
  }
73
107
  }
74
- const c = [];
75
- for (const n of o.children.values())
76
- L(n, "", c);
77
- return c.join(`
108
+ const t = [];
109
+ for (const i of c.children.values())
110
+ S(i, "", t);
111
+ return t.join(`
78
112
  `);
79
113
  }
80
- function D(e, t) {
81
- const o = e.children.get(t);
114
+ function N(e, n) {
115
+ const o = e.children.get(n);
82
116
  if (o !== void 0)
83
117
  return o;
84
- const c = { name: t, children: /* @__PURE__ */ new Map(), members: [], node: void 0 };
85
- return e.children.set(t, c), c;
118
+ const c = { name: n, children: /* @__PURE__ */ new Map(), members: [], node: void 0 };
119
+ return e.children.set(n, c), c;
86
120
  }
87
- function j(e) {
88
- const t = e.tagName !== void 0 ? "component" : e.kind === "interface" ? "type declaration" : e.kind;
89
- return v(t, e);
121
+ function A(e) {
122
+ const n = e.tagName !== void 0 ? "component" : e.kind === "interface" ? "type declaration" : e.kind;
123
+ return g(n, e);
90
124
  }
91
- function v(e, t) {
92
- const { added: o, removed: c, deprecated: n } = t;
93
- if (c) {
94
- const i = `**removed** ${e}`;
95
- return typeof n == "string" ? `${i} - deprecated ${x(n)}` : i;
96
- }
97
- if (n)
98
- return typeof n == "string" ? `**deprecated** ${e} ${x(n)}` : `**deprecated** ${e}`;
125
+ function g(e, n) {
126
+ const { added: o, removed: c, deprecated: t } = n;
127
+ if (c)
128
+ return typeof t == "string" ? `${e} - deprecated ${L(t)}` : e;
129
+ if (t)
130
+ return typeof t == "string" ? `**deprecated** ${e} ${L(t)}` : `**deprecated** ${e}`;
99
131
  if (o)
100
- return `**added** ${e}`;
132
+ return e;
101
133
  }
102
- function B(e) {
103
- const t = e.tagName;
104
- return typeof t == "string" && t.length > 0 ? t : k(e.name) + (e.kind === "function" ? "()" : "");
134
+ function E(e) {
135
+ const n = e.tagName;
136
+ return typeof n == "string" && n.length > 0 ? n : C(e.name) + (e.kind === "function" ? "()" : "");
105
137
  }
106
- function $(e, t, o, c) {
107
- const n = `${e}${t}/`;
108
- return T(n, o.kind === "class" ? void 0 : o.name, c);
138
+ function w(e, n, o, c) {
139
+ const t = `${e}${n}/`;
140
+ return O(t, o.kind === "class" ? void 0 : o.name, c);
109
141
  }
110
- function E(e, t) {
111
- const o = D(e, t.label);
112
- return o.node = t, o;
142
+ function F(e, n) {
143
+ const o = N(e, n.label);
144
+ return o.node = n, o;
113
145
  }
114
- function F(e) {
115
- return e.kind === "constructor" ? "constructor" : e.kind === "call-signature" ? "call signature" : e.kind === "method" ? `${k(e.name)}()` : k(e.name);
146
+ function I(e) {
147
+ return e.kind === "constructor" ? "constructor" : e.kind === "call-signature" ? "call signature" : e.kind === "method" ? `${C(e.name)}()` : C(e.name);
116
148
  }
117
- function k(e) {
149
+ function C(e) {
118
150
  return e.replace(/[\\\[\]\(\)]/gu, "\\$&");
119
151
  }
120
- function x(e) {
152
+ function L(e) {
121
153
  return e.split(`
122
154
  `)[0];
123
155
  }
124
- function L(e, t, o) {
125
- if (e.node) {
126
- const n = e.node.viewUrl === void 0 ? e.node.label : `[${e.node.label}](${e.node.viewUrl})`;
127
- e.node.change ? o.push(`${t}- ${n} - ${e.node.change}`) : o.push(`${t}- ${n}`);
128
- } else
129
- o.push(`${t}- ${e.name}/`);
130
- const c = `${t} `;
131
- for (const n of e.members) {
132
- const i = n.viewUrl === void 0 ? n.label : `[${n.label}](${n.viewUrl})`;
133
- n.change ? o.push(`${c}- ${i} - ${n.change}`) : o.push(`${c}- ${i}`);
156
+ function S(e, n, o) {
157
+ const c = `${n} `, t = [];
158
+ for (const i of e.members) {
159
+ const l = i.viewUrl === void 0 ? i.label : `[${i.label}](${i.viewUrl})`;
160
+ t.push(`${c}- ${l} - ${i.change}`);
161
+ }
162
+ for (const i of e.children.values())
163
+ S(i, c, t);
164
+ if (!(t.length === 0 && e.node?.change === void 0)) {
165
+ if (e.node) {
166
+ const i = e.node.viewUrl === void 0 ? e.node.label : `[${e.node.label}](${e.node.viewUrl})`;
167
+ e.node.change ? o.push(`${n}- ${i} - ${e.node.change}`) : o.push(`${n}- ${i}`);
168
+ } else
169
+ o.push(`${n}- ${e.name}/`);
170
+ o.push(...t);
134
171
  }
135
- for (const n of e.children.values())
136
- L(n, c, o);
137
172
  }
138
173
  export {
139
- K as apiDiffToMarkdown
174
+ P as apiDiffToMarkdown
140
175
  };