@blogmcp/sdk 0.6.0 → 0.6.1

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.
Files changed (74) hide show
  1. package/dist/core/index.js +2 -2
  2. package/dist/packages/mdx-render-vue/dist/composables/useGallery.js +12 -11
  3. package/dist/packages/mdx-render-vue/dist/composables/useTripMap.js +16 -16
  4. package/dist/packages/mdx-render-vue/dist/edit/TripMapEdit.vue.js +1 -1
  5. package/dist/packages/mdx-render-vue/dist/registry.js +21 -22
  6. package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue2.js +1 -1
  7. package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue2.js +1 -1
  8. package/dist/packages/mdx-render-vue/dist/render/button/Button.vue2.js +1 -1
  9. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue.js +1 -1
  10. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue.js +1 -1
  11. package/dist/packages/mdx-render-vue/dist/render/tripmap/TripMapDefault.vue.js +2 -2
  12. package/dist/react/KbMdxContent.js +7 -8
  13. package/dist/vue/components/KbMdxContent.vue2.js +6 -7
  14. package/package.json +3 -3
  15. package/dist/_virtual/constants.js +0 -4
  16. package/dist/_virtual/index.js +0 -2
  17. package/dist/_virtual/index2.js +0 -4
  18. package/dist/_virtual/index3.js +0 -2
  19. package/dist/_virtual/re.js +0 -4
  20. package/dist/node_modules/@braintree/sanitize-url/dist/constants.js +0 -8
  21. package/dist/node_modules/@braintree/sanitize-url/dist/index.js +0 -60
  22. package/dist/node_modules/dompurify/dist/purify.es.js +0 -662
  23. package/dist/node_modules/semver/classes/comparator.js +0 -56
  24. package/dist/node_modules/semver/classes/range.js +0 -148
  25. package/dist/node_modules/semver/classes/semver.js +0 -169
  26. package/dist/node_modules/semver/functions/clean.js +0 -14
  27. package/dist/node_modules/semver/functions/cmp.js +0 -39
  28. package/dist/node_modules/semver/functions/coerce.js +0 -33
  29. package/dist/node_modules/semver/functions/compare-build.js +0 -14
  30. package/dist/node_modules/semver/functions/compare-loose.js +0 -11
  31. package/dist/node_modules/semver/functions/compare.js +0 -11
  32. package/dist/node_modules/semver/functions/diff.js +0 -24
  33. package/dist/node_modules/semver/functions/eq.js +0 -11
  34. package/dist/node_modules/semver/functions/gt.js +0 -11
  35. package/dist/node_modules/semver/functions/gte.js +0 -11
  36. package/dist/node_modules/semver/functions/inc.js +0 -21
  37. package/dist/node_modules/semver/functions/lt.js +0 -11
  38. package/dist/node_modules/semver/functions/lte.js +0 -11
  39. package/dist/node_modules/semver/functions/major.js +0 -11
  40. package/dist/node_modules/semver/functions/minor.js +0 -11
  41. package/dist/node_modules/semver/functions/neq.js +0 -11
  42. package/dist/node_modules/semver/functions/parse.js +0 -21
  43. package/dist/node_modules/semver/functions/patch.js +0 -11
  44. package/dist/node_modules/semver/functions/prerelease.js +0 -14
  45. package/dist/node_modules/semver/functions/rcompare.js +0 -11
  46. package/dist/node_modules/semver/functions/rsort.js +0 -11
  47. package/dist/node_modules/semver/functions/satisfies.js +0 -18
  48. package/dist/node_modules/semver/functions/sort.js +0 -11
  49. package/dist/node_modules/semver/functions/valid.js +0 -14
  50. package/dist/node_modules/semver/index.js +0 -97
  51. package/dist/node_modules/semver/internal/constants.js +0 -28
  52. package/dist/node_modules/semver/internal/debug.js +0 -8
  53. package/dist/node_modules/semver/internal/identifiers.js +0 -18
  54. package/dist/node_modules/semver/internal/lrucache.js +0 -32
  55. package/dist/node_modules/semver/internal/parse-options.js +0 -10
  56. package/dist/node_modules/semver/internal/re.js +0 -32
  57. package/dist/node_modules/semver/ranges/gtr.js +0 -11
  58. package/dist/node_modules/semver/ranges/intersects.js +0 -11
  59. package/dist/node_modules/semver/ranges/ltr.js +0 -11
  60. package/dist/node_modules/semver/ranges/max-satisfying.js +0 -22
  61. package/dist/node_modules/semver/ranges/min-satisfying.js +0 -22
  62. package/dist/node_modules/semver/ranges/min-version.js +0 -42
  63. package/dist/node_modules/semver/ranges/outside.js +0 -44
  64. package/dist/node_modules/semver/ranges/simplify.js +0 -24
  65. package/dist/node_modules/semver/ranges/subset.js +0 -94
  66. package/dist/node_modules/semver/ranges/to-comparators.js +0 -11
  67. package/dist/node_modules/semver/ranges/valid.js +0 -17
  68. package/dist/packages/mdx-schema/dist/composables/useMdxParsing.js +0 -389
  69. package/dist/packages/mdx-schema/dist/metadata/index.js +0 -526
  70. package/dist/packages/mdx-schema/dist/prepareProps.js +0 -46
  71. package/dist/packages/mdx-schema/dist/styles/index.js +0 -147
  72. package/dist/packages/mdx-schema/dist/tripmap.js +0 -101
  73. package/dist/packages/mdx-schema/dist/types/index.js +0 -26
  74. package/dist/packages/sanitize/dist/html.js +0 -89
@@ -1,389 +0,0 @@
1
- const d = /<[A-Z][a-zA-Z]*[\s/>]/, A = /<([A-Z][a-zA-Z]*)\s*([^>]*)>([\s\S]*?)<\/\1>|<([A-Z][a-zA-Z]*)\s*((?:[^/]|\/(?!>))*)\/>/g;
2
- function g(t, i) {
3
- if (t[i] !== "{")
4
- return null;
5
- let e = 0, n = null;
6
- for (let u = i; u < t.length; u++) {
7
- const s = t[u];
8
- if (n) {
9
- if (s === "\\") {
10
- u++;
11
- continue;
12
- }
13
- s === n && (n = null);
14
- continue;
15
- }
16
- if (s === '"' || s === "'") {
17
- n = s;
18
- continue;
19
- }
20
- if (s === "{") {
21
- e++;
22
- continue;
23
- }
24
- if (s === "}" && (e--, e === 0))
25
- return { content: t.slice(i + 1, u), endIndex: u + 1 };
26
- }
27
- return null;
28
- }
29
- function x(t) {
30
- const i = {};
31
- if (!t.trim())
32
- return i;
33
- let e = 0;
34
- const n = t;
35
- for (; e < n.length; ) {
36
- for (; e < n.length && /\s/.test(n[e]); )
37
- e++;
38
- if (e >= n.length)
39
- break;
40
- const u = n.slice(e).match(/^(\w+)/);
41
- if (!u) {
42
- e++;
43
- continue;
44
- }
45
- const s = u[1];
46
- for (e += s.length; e < n.length && /\s/.test(n[e]); )
47
- e++;
48
- if (n[e] !== "=") {
49
- i[s] = !0;
50
- continue;
51
- }
52
- for (e++; e < n.length && /\s/.test(n[e]); )
53
- e++;
54
- if (n[e] === '"') {
55
- const l = n.indexOf('"', e + 1);
56
- if (l === -1) {
57
- i[s] = "";
58
- break;
59
- }
60
- i[s] = n.slice(e + 1, l), e = l + 1;
61
- } else if (n[e] === "{") {
62
- const l = g(n, e);
63
- if (l) {
64
- try {
65
- i[s] = JSON.parse(l.content);
66
- } catch {
67
- try {
68
- i[s] = JSON.parse(l.content.replace(/'/g, '"'));
69
- } catch {
70
- i[s] = l.content;
71
- }
72
- }
73
- e = l.endIndex;
74
- } else
75
- e++;
76
- } else
77
- e++;
78
- }
79
- return i;
80
- }
81
- function O(t) {
82
- const i = [];
83
- for (const [e, n] of Object.entries(t))
84
- n != null && (n === !0 ? i.push(e) : typeof n == "string" ? i.push(n.includes('"') ? `${e}={${JSON.stringify(n)}}` : `${e}="${n}"`) : typeof n == "number" ? i.push(`${e}={${n}}`) : typeof n == "boolean" ? i.push(`${e}={${n}}`) : i.push(`${e}={${JSON.stringify(n)}}`));
85
- return i.join(" ");
86
- }
87
- function b(t, i, e) {
88
- const n = O(i), u = n ? ` ${n}` : "";
89
- return e ? `<${t}${u}>
90
- ${e}
91
- </${t}>` : `<${t}${u} />`;
92
- }
93
- function _(t) {
94
- if (t.startsWith("---")) {
95
- const i = t.indexOf("---", 3);
96
- if (i !== -1)
97
- return t.substring(i + 3).trim();
98
- }
99
- return t;
100
- }
101
- function Z(t) {
102
- if (t.startsWith("---")) {
103
- const i = t.indexOf("---", 3);
104
- if (i !== -1)
105
- return t.substring(3, i).trim();
106
- }
107
- return null;
108
- }
109
- function M(t) {
110
- if (!t || !t.startsWith("---"))
111
- return 0;
112
- const i = t.indexOf("---", 3);
113
- if (i === -1)
114
- return 0;
115
- const e = i + 3, n = t.slice(e);
116
- return e + (n.length - n.trimStart().length);
117
- }
118
- function z(t, i) {
119
- if (i <= 0)
120
- return 1;
121
- const e = Math.min(i, t.length);
122
- let n = 1;
123
- for (let u = 0; u < e; u++)
124
- t[u] === `
125
- ` && n++;
126
- return n;
127
- }
128
- const m = 0, E = 1, w = 2, y = /^ {0,3}(`{3,}|~{3,})(.*)$/, S = /^ {0,3}(`{3,}|~{3,})[ \t]*$/;
129
- function $(t) {
130
- const i = new Uint8Array(t.length);
131
- if (!t || !t.includes("`") && !t.includes("~"))
132
- return i;
133
- const e = [], n = [];
134
- for (let l = 0; l <= t.length; ) {
135
- const o = t.indexOf(`
136
- `, l);
137
- if (e.push(l), n.push(o === -1 ? t.length : o), o === -1)
138
- break;
139
- l = o + 1;
140
- }
141
- const u = (l) => {
142
- const o = t.slice(e[l], n[l]);
143
- return o.endsWith("\r") ? o.slice(0, -1) : o;
144
- }, s = new Array(e.length).fill(!1);
145
- for (let l = 0; l < e.length; ) {
146
- const o = y.exec(u(l));
147
- if (!o) {
148
- l++;
149
- continue;
150
- }
151
- const c = o[1], f = c[0];
152
- if (f === "`" && o[2].includes("`")) {
153
- l++;
154
- continue;
155
- }
156
- let r = -1;
157
- for (let h = l + 1; h < e.length; h++) {
158
- const a = S.exec(u(h));
159
- if (a && a[1][0] === f && a[1].length >= c.length) {
160
- r = h;
161
- break;
162
- }
163
- }
164
- if (r === -1) {
165
- l++;
166
- continue;
167
- }
168
- i.fill(E, e[l], n[r]);
169
- for (let h = l; h <= r; h++)
170
- s[h] = !0;
171
- l = r + 1;
172
- }
173
- for (let l = 0; l < e.length; l++) {
174
- if (s[l])
175
- continue;
176
- const o = e[l], c = n[l];
177
- let f = o;
178
- for (; f < c; ) {
179
- if (t[f] !== "`") {
180
- f++;
181
- continue;
182
- }
183
- let r = 0;
184
- for (; f + r < c && t[f + r] === "`"; )
185
- r++;
186
- if (r >= 3 && t.slice(o, f).trim() === "") {
187
- f += r;
188
- continue;
189
- }
190
- let h = f + r, a = -1;
191
- for (; h < c; ) {
192
- if (t[h] !== "`") {
193
- h++;
194
- continue;
195
- }
196
- let p = 0;
197
- for (; h + p < c && t[h + p] === "`"; )
198
- p++;
199
- if (p === r) {
200
- a = h;
201
- break;
202
- }
203
- h += p;
204
- }
205
- if (a === -1) {
206
- f += r;
207
- continue;
208
- }
209
- i.fill(w, f, a + r), f = a + r;
210
- }
211
- }
212
- return i;
213
- }
214
- function k(t, i) {
215
- if (t[i] !== "<")
216
- return null;
217
- const e = t[i + 1];
218
- if (e === void 0 || e < "A" || e > "Z")
219
- return null;
220
- let n = i + 2;
221
- for (; n < t.length && /[a-zA-Z]/.test(t[n]); )
222
- n++;
223
- const u = t.slice(i + 1, n), s = t[n];
224
- if (s === void 0 || s !== ">" && s !== "/" && !/\s/.test(s))
225
- return null;
226
- for (; n < t.length && /\s/.test(t[n]); )
227
- n++;
228
- const l = n, o = (f) => {
229
- let r = f + 1;
230
- for (; r < t.length && (t[r] === " " || t[r] === " " || t[r] === "\r"); )
231
- r++;
232
- return r >= t.length || t[r] === `
233
- `;
234
- };
235
- let c = null;
236
- for (; n < t.length; ) {
237
- const f = t[n];
238
- if (c) {
239
- if (f === `
240
- ` && o(n))
241
- return null;
242
- f === c && (c = null), n++;
243
- continue;
244
- }
245
- if (f === '"' || f === "'") {
246
- c = f, n++;
247
- continue;
248
- }
249
- if (f === "{") {
250
- const r = g(t, n);
251
- if (!r)
252
- return null;
253
- n = r.endIndex;
254
- continue;
255
- }
256
- if (f === "/" && t[n + 1] === ">")
257
- return { name: u, propsSource: t.slice(l, n), tagEnd: n + 2, selfClosing: !0 };
258
- if (f === ">")
259
- return { name: u, propsSource: t.slice(l, n), tagEnd: n + 1, selfClosing: !1 };
260
- if (f === "<")
261
- return null;
262
- if (f === `
263
- `) {
264
- if (o(n)) {
265
- let r = n - 1;
266
- for (; r >= i && /\s/.test(t[r]); )
267
- r--;
268
- if (t[r] === "=")
269
- return null;
270
- }
271
- n++;
272
- continue;
273
- }
274
- n++;
275
- }
276
- return null;
277
- }
278
- function C(t, i, e, n, u) {
279
- const s = `</${i}`;
280
- let l = null;
281
- const o = u?.has(i) ?? !1, c = (r) => {
282
- const h = `<${i}`;
283
- let a = t.indexOf(h, e);
284
- for (; a !== -1 && a < r; ) {
285
- const p = t[a + h.length];
286
- if (p === void 0 || !/[a-zA-Z]/.test(p))
287
- return !0;
288
- a = t.indexOf(h, a + 1);
289
- }
290
- return !1;
291
- };
292
- let f = e;
293
- for (; f < t.length; ) {
294
- const r = t.indexOf(s, f);
295
- if (r === -1)
296
- break;
297
- let h = r + s.length;
298
- for (; h < t.length && /\s/.test(t[h]); )
299
- h++;
300
- if (t[h] === ">") {
301
- const a = { start: r, end: h + 1 };
302
- if (n[r] === m && !c(r))
303
- return a;
304
- if (!l && (l = a, o))
305
- return l;
306
- }
307
- f = r + s.length;
308
- }
309
- return l && u?.add(i), l;
310
- }
311
- function N(t) {
312
- if (!t)
313
- return [];
314
- if (!d.test(t))
315
- return [{ type: "html", content: t, start: 0, end: t.length }];
316
- const i = $(t), e = [], n = /* @__PURE__ */ new Set();
317
- let u = 0, s = 0, l = !1;
318
- for (; s < t.length; ) {
319
- const o = t.indexOf("<", s);
320
- if (o === -1)
321
- break;
322
- if (i[o] !== m) {
323
- s = o + 1;
324
- continue;
325
- }
326
- const c = k(t, o);
327
- if (!c) {
328
- s = o + 1;
329
- continue;
330
- }
331
- if (i[c.tagEnd - 1] === E) {
332
- s = o + 1;
333
- continue;
334
- }
335
- let f, r;
336
- if (c.selfClosing)
337
- f = c.tagEnd;
338
- else {
339
- const h = C(t, c.name, c.tagEnd, i, n);
340
- if (!h) {
341
- s = c.tagEnd;
342
- continue;
343
- }
344
- r = t.slice(c.tagEnd, h.start).trim(), f = h.end;
345
- }
346
- if (o > u) {
347
- const h = t.slice(u, o);
348
- h.trim() && e.push({ type: "html", content: h, start: u, end: o });
349
- }
350
- e.push({
351
- type: "component",
352
- name: c.name,
353
- propsSource: c.propsSource,
354
- props: x(c.propsSource),
355
- children: r,
356
- start: o,
357
- end: f
358
- }), l = !0, u = f, s = f;
359
- }
360
- if (u < t.length) {
361
- const o = t.slice(u);
362
- o.trim() && e.push({ type: "html", content: o, start: u, end: t.length });
363
- }
364
- return l ? e : t.trim() ? [{ type: "html", content: t, start: 0, end: t.length }] : [];
365
- }
366
- function I(t) {
367
- if (!d.test(t))
368
- return [{ type: "html", content: t }];
369
- const i = N(t).map((e) => e.type === "html" ? { type: "html", content: e.content } : { type: "component", name: e.name, props: e.props, children: e.children });
370
- return i.length === 0 && t.trim() ? [{ type: "html", content: t }] : i;
371
- }
372
- export {
373
- E as CODE_FENCE,
374
- w as CODE_INLINE,
375
- m as CODE_NONE,
376
- d as HAS_MDX_RE,
377
- A as MDX_COMPONENT_PATTERN,
378
- M as computeBodyOffset,
379
- $ as computeCodeMask,
380
- g as extractBraceExpression,
381
- Z as extractFrontmatter,
382
- I as extractMdxComponents,
383
- z as lineAtOffset,
384
- x as parseJsxProps,
385
- N as scanMdxNodes,
386
- b as serializeComponent,
387
- O as serializeProps,
388
- _ as stripFrontmatter
389
- };