@salesforcedevs/docs-components 0.0.2 → 0.0.3-edit

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 (108) hide show
  1. package/lwc.config.json +27 -2
  2. package/package.json +19 -8
  3. package/src/modules/README.md +41 -0
  4. package/src/modules/doc/amfModelParser/amfModelParser.ts +674 -0
  5. package/src/modules/doc/amfReference/amfReference.css +25 -0
  6. package/src/modules/doc/amfReference/amfReference.html +60 -0
  7. package/src/modules/doc/amfReference/amfReference.ts +1494 -0
  8. package/src/modules/doc/amfReference/constants.ts +76 -0
  9. package/src/modules/doc/amfReference/types.ts +125 -0
  10. package/src/modules/doc/amfTopic/amfTopic.css +21 -0
  11. package/src/modules/doc/amfTopic/amfTopic.html +3 -0
  12. package/src/modules/doc/amfTopic/amfTopic.ts +111 -0
  13. package/src/modules/doc/amfTopic/types.ts +56 -0
  14. package/src/modules/doc/amfTopic/utils.ts +136 -0
  15. package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
  16. package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
  17. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +71 -0
  18. package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
  19. package/src/modules/doc/breadcrumbs/breadcrumbs.html +58 -0
  20. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +183 -0
  21. package/src/modules/doc/chat/README.md +179 -0
  22. package/src/modules/doc/chat/chat.css +818 -0
  23. package/src/modules/doc/chat/chat.html +241 -0
  24. package/src/modules/doc/chat/chat.ts +586 -0
  25. package/src/modules/doc/componentPlayground/componentPlayground.css +22 -0
  26. package/src/modules/doc/componentPlayground/componentPlayground.html +20 -0
  27. package/src/modules/doc/componentPlayground/componentPlayground.ts +29 -0
  28. package/src/modules/doc/content/content.css +388 -4
  29. package/src/modules/doc/content/content.html +3 -2
  30. package/src/modules/doc/content/content.ts +319 -45
  31. package/src/modules/doc/contentCallout/contentCallout.css +59 -0
  32. package/src/modules/doc/contentCallout/contentCallout.html +22 -0
  33. package/src/modules/doc/contentCallout/contentCallout.ts +65 -0
  34. package/src/modules/doc/contentLayout/contentLayout.css +1 -0
  35. package/src/modules/doc/contentLayout/contentLayout.html +72 -0
  36. package/src/modules/doc/contentLayout/contentLayout.ts +531 -0
  37. package/src/modules/doc/contentMedia/contentMedia.css +49 -0
  38. package/src/modules/doc/contentMedia/contentMedia.html +23 -0
  39. package/src/modules/doc/contentMedia/contentMedia.ts +34 -0
  40. package/src/modules/doc/doDont/doDont.css +47 -0
  41. package/src/modules/doc/doDont/doDont.html +27 -0
  42. package/src/modules/doc/doDont/doDont.ts +17 -0
  43. package/src/modules/doc/editFile/editFile.css +505 -0
  44. package/src/modules/doc/editFile/editFile.html +164 -0
  45. package/src/modules/doc/editFile/editFile.ts +213 -0
  46. package/src/modules/doc/header/header.css +132 -0
  47. package/src/modules/doc/header/header.html +55 -0
  48. package/src/modules/doc/header/header.ts +120 -0
  49. package/src/modules/doc/heading/heading.css +33 -0
  50. package/src/modules/doc/heading/heading.html +14 -0
  51. package/src/modules/doc/heading/heading.ts +67 -0
  52. package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
  53. package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
  54. package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
  55. package/src/modules/doc/headingContent/headingContent.css +53 -0
  56. package/src/modules/doc/headingContent/headingContent.html +13 -0
  57. package/src/modules/doc/headingContent/headingContent.ts +30 -0
  58. package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +1 -0
  59. package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +68 -0
  60. package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +168 -0
  61. package/src/modules/doc/nav/nav.css +8 -2
  62. package/src/modules/doc/nav/nav.html +10 -7
  63. package/src/modules/doc/nav/nav.ts +33 -29
  64. package/src/modules/doc/overview/overview.css +40 -0
  65. package/src/modules/doc/overview/overview.html +34 -0
  66. package/src/modules/doc/overview/overview.ts +12 -0
  67. package/src/modules/doc/phase/phase.css +70 -0
  68. package/src/modules/doc/phase/phase.html +38 -0
  69. package/src/modules/doc/phase/phase.ts +93 -0
  70. package/src/modules/doc/specificationContent/specificationContent.css +36 -0
  71. package/src/modules/doc/specificationContent/specificationContent.html +171 -0
  72. package/src/modules/doc/specificationContent/specificationContent.ts +127 -0
  73. package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
  74. package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
  75. package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
  76. package/src/modules/doc/toc/toc.css +14 -0
  77. package/src/modules/doc/toc/toc.html +99 -22
  78. package/src/modules/doc/toc/toc.ts +11 -6
  79. package/src/modules/doc/toolbar/toolbar.css +8 -0
  80. package/src/modules/doc/toolbar/toolbar.html +32 -15
  81. package/src/modules/doc/toolbar/toolbar.ts +69 -30
  82. package/src/modules/doc/versionPicker/versionPicker.css +64 -0
  83. package/src/modules/doc/versionPicker/versionPicker.html +38 -0
  84. package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
  85. package/src/modules/doc/xmlContent/types.ts +120 -0
  86. package/src/modules/doc/xmlContent/utils.ts +163 -0
  87. package/src/modules/doc/xmlContent/xmlContent.css +54 -0
  88. package/src/modules/doc/xmlContent/xmlContent.html +52 -0
  89. package/src/modules/doc/xmlContent/xmlContent.ts +792 -0
  90. package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
  91. package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +131 -0
  92. package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
  93. package/src/modules/docHelpers/status/status.css +22 -0
  94. package/src/modules/docUtils/searchSyncer/searchSyncer.ts +86 -0
  95. package/src/modules/docUtils/utils/__mocks__/coveo.analytics.ts +16 -0
  96. package/src/modules/docUtils/utils/coveo.analytics.d.ts +10 -0
  97. package/src/modules/docUtils/utils/utils.ts +32 -0
  98. package/src/modules/doc/container/__benchmarks__/container.benchmarkrenamed.js +0 -18
  99. package/src/modules/doc/container/container.css +0 -8
  100. package/src/modules/doc/container/container.html +0 -11
  101. package/src/modules/doc/container/container.stories.ts +0 -15
  102. package/src/modules/doc/container/container.ts +0 -164
  103. package/src/modules/doc/content/prismjs.css +0 -184
  104. package/src/modules/doc/content/prismjs.html +0 -3
  105. package/src/modules/doc/content/prismjs.ts +0 -853
  106. package/src/modules/doc/prismcss/prismcss.css +0 -184
  107. package/src/modules/doc/search/search.html +0 -1
  108. package/src/modules/doc/search/search.ts +0 -6
@@ -1,853 +0,0 @@
1
- var _self =
2
- "undefined" != typeof window
3
- ? window
4
- : "undefined" != typeof WorkerGlobalScope &&
5
- self instanceof WorkerGlobalScope
6
- ? self
7
- : {},
8
- Prism = (function (u) {
9
- var g = /\blang(?:uage)?-([\w-]+)\b/i,
10
- t = 0,
11
- T = {
12
- manual: u.Prism && u.Prism.manual,
13
- disableWorkerMessageHandler:
14
- u.Prism && u.Prism.disableWorkerMessageHandler,
15
- util: {
16
- encode: function e(t) {
17
- return t instanceof z
18
- ? new z(t.type, e(t.content), t.alias)
19
- : Array.isArray(t)
20
- ? t.map(e)
21
- : t
22
- .replace(/&/g, "&")
23
- .replace(/</g, "&lt;")
24
- .replace(/\u00a0/g, " ");
25
- },
26
- type: function (e) {
27
- return Object.prototype.toString.call(e).slice(8, -1);
28
- },
29
- objId: function (e) {
30
- return (
31
- e.__id ||
32
- Object.defineProperty(e, "__id", {
33
- value: ++t
34
- }),
35
- e.__id
36
- );
37
- },
38
- clone: function n(e, a) {
39
- var r, t;
40
- switch (((a = a || {}), T.util.type(e))) {
41
- case "Object":
42
- if (((t = T.util.objId(e)), a[t])) return a[t];
43
- for (var s in ((r = {}), (a[t] = r), e))
44
- e.hasOwnProperty(s) && (r[s] = n(e[s], a));
45
- return r;
46
- case "Array":
47
- return ((t = T.util.objId(e)), a[t])
48
- ? a[t]
49
- : ((r = []),
50
- (a[t] = r),
51
- e.forEach(function (e, t) {
52
- r[t] = n(e, a);
53
- }),
54
- r);
55
- default:
56
- return e;
57
- }
58
- },
59
- getLanguage: function (e) {
60
- for (; e && !g.test(e.className); ) e = e.parentElement;
61
- return e
62
- ? (e.className.match(g) || [
63
- ,
64
- "none"
65
- ])[1].toLowerCase()
66
- : "none";
67
- },
68
- currentScript: function () {
69
- if ("undefined" == typeof document) return null;
70
- if ("currentScript" in document)
71
- return document.currentScript;
72
- try {
73
- throw new Error();
74
- } catch (e) {
75
- var t = (/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(
76
- e.stack
77
- ) || [])[1];
78
- if (t) {
79
- var n = document.getElementsByTagName("script");
80
- for (var a in n) if (n[a].src == t) return n[a];
81
- }
82
- return null;
83
- }
84
- },
85
- isActive: function (e, t, n) {
86
- for (var a = "no-" + t; e; ) {
87
- var r = e.classList;
88
- if (r.contains(t)) return !0;
89
- if (r.contains(a)) return !1;
90
- e = e.parentElement;
91
- }
92
- return !!n;
93
- }
94
- },
95
- languages: {
96
- extend: function (e, t) {
97
- var n = T.util.clone(T.languages[e]);
98
- for (var a in t) n[a] = t[a];
99
- return n;
100
- },
101
- insertBefore: function (n, e, t, a) {
102
- var r = (a = a || T.languages)[n],
103
- s = {};
104
- for (var i in r)
105
- if (r.hasOwnProperty(i)) {
106
- if (i == e)
107
- for (var l in t)
108
- t.hasOwnProperty(l) && (s[l] = t[l]);
109
- t.hasOwnProperty(i) || (s[i] = r[i]);
110
- }
111
- var o = a[n];
112
- return (
113
- (a[n] = s),
114
- T.languages.DFS(T.languages, function (e, t) {
115
- t === o && e != n && (this[e] = s);
116
- }),
117
- s
118
- );
119
- },
120
- DFS: function e(t, n, a, r) {
121
- r = r || {};
122
- var s,
123
- i,
124
- l = T.util.objId;
125
- for (var o in t) {
126
- t.hasOwnProperty(o) &&
127
- (n.call(t, o, t[o], a || o),
128
- (s = t[o]),
129
- "Object" !== (i = T.util.type(s)) || r[l(s)]
130
- ? "Array" !== i ||
131
- r[l(s)] ||
132
- ((r[l(s)] = !0), e(s, n, o, r))
133
- : ((r[l(s)] = !0), e(s, n, null, r)));
134
- }
135
- }
136
- },
137
- plugins: {},
138
- highlightAll: function (e, t) {
139
- T.highlightAllUnder(document, e, t);
140
- },
141
- highlightAllUnder: function (e, t, n) {
142
- var a = {
143
- callback: n,
144
- container: e,
145
- selector:
146
- 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
147
- };
148
- T.hooks.run("before-highlightall", a),
149
- (a.elements = Array.prototype.slice.apply(
150
- a.container.querySelectorAll(a.selector)
151
- )),
152
- T.hooks.run("before-all-elements-highlight", a);
153
- for (var r, s = 0; (r = a.elements[s++]); )
154
- T.highlightElement(r, !0 === t, a.callback);
155
- },
156
- highlightElement: function (e, t, n) {
157
- var a = T.util.getLanguage(e),
158
- r = T.languages[a];
159
- e.className =
160
- e.className.replace(g, "").replace(/\s+/g, " ") +
161
- " language-" +
162
- a;
163
- var s = e.parentElement;
164
- s &&
165
- "pre" === s.nodeName.toLowerCase() &&
166
- (s.className =
167
- s.className.replace(g, "").replace(/\s+/g, " ") +
168
- " language-" +
169
- a);
170
- var i,
171
- l = {
172
- element: e,
173
- language: a,
174
- grammar: r,
175
- code: e.textContent
176
- };
177
- function o(e) {
178
- (l.highlightedCode = e),
179
- T.hooks.run("before-insert", l),
180
- (l.element.innerHTML = l.highlightedCode),
181
- T.hooks.run("after-highlight", l),
182
- T.hooks.run("complete", l),
183
- n && n.call(l.element);
184
- }
185
- if ((T.hooks.run("before-sanity-check", l), !l.code))
186
- return (
187
- T.hooks.run("complete", l),
188
- void (n && n.call(l.element))
189
- );
190
- T.hooks.run("before-highlight", l),
191
- l.grammar
192
- ? t && u.Worker
193
- ? (((i = new Worker(
194
- T.filename
195
- )).onmessage = function (e) {
196
- o(e.data);
197
- }),
198
- i.postMessage(
199
- JSON.stringify({
200
- language: l.language,
201
- code: l.code,
202
- immediateClose: !0
203
- })
204
- ))
205
- : o(T.highlight(l.code, l.grammar, l.language))
206
- : o(T.util.encode(l.code));
207
- },
208
- highlight: function (e, t, n) {
209
- var a = { code: e, grammar: t, language: n };
210
- return (
211
- T.hooks.run("before-tokenize", a),
212
- (a.tokens = T.tokenize(a.code, a.grammar)),
213
- T.hooks.run("after-tokenize", a),
214
- z.stringify(T.util.encode(a.tokens), a.language)
215
- );
216
- },
217
- tokenize: function (e, t) {
218
- var n = t.rest;
219
- if (n) {
220
- for (var a in n) t[a] = n[a];
221
- delete t.rest;
222
- }
223
- var r = new s();
224
- return (
225
- N(r, r.head, e),
226
- (function e(t, n, a, r, s, i) {
227
- for (var l in a)
228
- if (a.hasOwnProperty(l) && a[l]) {
229
- var o = a[l];
230
- o = Array.isArray(o) ? o : [o];
231
- for (var u = 0; u < o.length; ++u) {
232
- if (i && i.cause == l + "," + u) return;
233
- var g,
234
- c = o[u],
235
- d = c.inside,
236
- p = !!c.lookbehind,
237
- m = !!c.greedy,
238
- h = 0,
239
- f = c.alias;
240
- m &&
241
- !c.pattern.global &&
242
- ((g = c.pattern
243
- .toString()
244
- .match(/[imsuy]*$/)[0]),
245
- (c.pattern = RegExp(
246
- c.pattern.source,
247
- g + "g"
248
- )));
249
- for (
250
- var v = c.pattern || c,
251
- y = r.next,
252
- b = s;
253
- y !== n.tail &&
254
- !(i && b >= i.reach);
255
- b += y.value.length, y = y.next
256
- ) {
257
- var F = y.value;
258
- if (n.length > t.length) return;
259
- if (!(F instanceof z)) {
260
- var k,
261
- x,
262
- w,
263
- A,
264
- P,
265
- $,
266
- S = 1;
267
- if (m && y != n.tail.prev) {
268
- v.lastIndex = b;
269
- var _ = v.exec(t);
270
- if (!_) break;
271
- var E =
272
- _.index +
273
- (p && _[1]
274
- ? _[1].length
275
- : 0),
276
- j =
277
- _.index +
278
- _[0].length,
279
- C = b;
280
- for (
281
- C += y.value.length;
282
- C <= E;
283
-
284
- )
285
- (y = y.next),
286
- (C +=
287
- y.value.length);
288
- if (
289
- ((C -= y.value.length),
290
- (b = C),
291
- y.value instanceof z)
292
- )
293
- continue;
294
- for (
295
- var O = y;
296
- O !== n.tail &&
297
- (C < j ||
298
- "string" ==
299
- typeof O.value);
300
- O = O.next
301
- )
302
- S++,
303
- (C +=
304
- O.value.length);
305
- S--,
306
- (F = t.slice(b, C)),
307
- (_.index -= b);
308
- } else {
309
- v.lastIndex = 0;
310
- var _ = v.exec(F);
311
- }
312
- _ &&
313
- (p &&
314
- (h = _[1]
315
- ? _[1].length
316
- : 0),
317
- (E = _.index + h),
318
- (k = _[0].slice(h)),
319
- (j = E + k.length),
320
- (x = F.slice(0, E)),
321
- (w = F.slice(j)),
322
- (A = b + F.length),
323
- i &&
324
- A > i.reach &&
325
- (i.reach = A),
326
- (P = y.prev),
327
- x &&
328
- ((P = N(n, P, x)),
329
- (b += x.length)),
330
- L(n, P, S),
331
- ($ = new z(
332
- l,
333
- d
334
- ? T.tokenize(k, d)
335
- : k,
336
- f,
337
- k
338
- )),
339
- (y = N(n, P, $)),
340
- w && N(n, y, w),
341
- 1 < S &&
342
- e(t, n, a, y.prev, b, {
343
- cause: l + "," + u,
344
- reach: A
345
- }));
346
- }
347
- }
348
- }
349
- }
350
- })(e, r, t, r.head, 0),
351
- (function (e) {
352
- var t = [],
353
- n = e.head.next;
354
- for (; n !== e.tail; )
355
- t.push(n.value), (n = n.next);
356
- return t;
357
- })(r)
358
- );
359
- },
360
- hooks: {
361
- all: {},
362
- add: function (e, t) {
363
- var n = T.hooks.all;
364
- (n[e] = n[e] || []), n[e].push(t);
365
- },
366
- run: function (e, t) {
367
- var n = T.hooks.all[e];
368
- if (n && n.length)
369
- for (var a, r = 0; (a = n[r++]); ) a(t);
370
- }
371
- },
372
- Token: z
373
- };
374
- function z(e, t, n, a) {
375
- (this.type = e),
376
- (this.content = t),
377
- (this.alias = n),
378
- (this.length = 0 | (a || "").length);
379
- }
380
- function s() {
381
- var e = { value: null, prev: null, next: null },
382
- t = { value: null, prev: e, next: null };
383
- (e.next = t), (this.head = e), (this.tail = t), (this.length = 0);
384
- }
385
- function N(e, t, n) {
386
- var a = t.next,
387
- r = { value: n, prev: t, next: a };
388
- return (t.next = r), (a.prev = r), e.length++, r;
389
- }
390
- function L(e, t, n) {
391
- for (var a = t.next, r = 0; r < n && a !== e.tail; r++) a = a.next;
392
- ((t.next = a).prev = t), (e.length -= r);
393
- }
394
- if (
395
- ((u.Prism = T),
396
- (z.stringify = function t(e, n) {
397
- if ("string" == typeof e) return e;
398
- if (Array.isArray(e)) {
399
- var a = "";
400
- return (
401
- e.forEach(function (e) {
402
- a += t(e, n);
403
- }),
404
- a
405
- );
406
- }
407
- var r = {
408
- type: e.type,
409
- content: t(e.content, n),
410
- tag: "span",
411
- classes: ["token", e.type],
412
- attributes: {},
413
- language: n
414
- },
415
- s = e.alias;
416
- s &&
417
- (Array.isArray(s)
418
- ? Array.prototype.push.apply(r.classes, s)
419
- : r.classes.push(s)),
420
- T.hooks.run("wrap", r);
421
- var i = "";
422
- for (var l in r.attributes)
423
- i +=
424
- " " +
425
- l +
426
- '="' +
427
- (r.attributes[l] || "").replace(/"/g, "&quot;") +
428
- '"';
429
- return (
430
- "<" +
431
- r.tag +
432
- ' class="' +
433
- r.classes.join(" ") +
434
- '"' +
435
- i +
436
- ">" +
437
- r.content +
438
- "</" +
439
- r.tag +
440
- ">"
441
- );
442
- }),
443
- !u.document)
444
- )
445
- return (
446
- u.addEventListener &&
447
- (T.disableWorkerMessageHandler ||
448
- u.addEventListener(
449
- "message",
450
- function (e) {
451
- var t = JSON.parse(e.data),
452
- n = t.language,
453
- a = t.code,
454
- r = t.immediateClose;
455
- u.postMessage(
456
- T.highlight(a, T.languages[n], n)
457
- ),
458
- r && u.close();
459
- },
460
- !1
461
- )),
462
- T
463
- );
464
- var e,
465
- n = T.util.currentScript();
466
- function a() {
467
- T.manual || T.highlightAll();
468
- }
469
- return (
470
- n &&
471
- ((T.filename = n.src),
472
- n.hasAttribute("data-manual") && (T.manual = !0)),
473
- T.manual ||
474
- ("loading" === (e = document.readyState) ||
475
- ("interactive" === e && n && n.defer)
476
- ? document.addEventListener("DOMContentLoaded", a)
477
- : window.requestAnimationFrame
478
- ? window.requestAnimationFrame(a)
479
- : window.setTimeout(a, 16)),
480
- T
481
- );
482
- })(_self);
483
- "undefined" != typeof module && module.exports && (module.exports = Prism),
484
- "undefined" != typeof global && (global.Prism = Prism),
485
- (Prism.languages.markup = {
486
- comment: /<!--[\s\S]*?-->/,
487
- prolog: /<\?[\s\S]+?\?>/,
488
- doctype: {
489
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
490
- greedy: !0,
491
- inside: {
492
- "internal-subset": {
493
- pattern: /(\[)[\s\S]+(?=\]>$)/,
494
- lookbehind: !0,
495
- greedy: !0,
496
- inside: null
497
- },
498
- string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 },
499
- punctuation: /^<!|>$|[[\]]/,
500
- "doctype-tag": /^DOCTYPE/,
501
- name: /[^\s<>'"]+/
502
- }
503
- },
504
- cdata: /<!\[CDATA\[[\s\S]*?]]>/i,
505
- tag: {
506
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
507
- greedy: !0,
508
- inside: {
509
- tag: {
510
- pattern: /^<\/?[^\s>\/]+/,
511
- inside: { punctuation: /^<\/?/, namespace: /^[^\s>\/:]+:/ }
512
- },
513
- "attr-value": {
514
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
515
- inside: {
516
- punctuation: [
517
- { pattern: /^=/, alias: "attr-equals" },
518
- /"|'/
519
- ]
520
- }
521
- },
522
- punctuation: /\/?>/,
523
- "attr-name": {
524
- pattern: /[^\s>\/]+/,
525
- inside: { namespace: /^[^\s>\/:]+:/ }
526
- }
527
- }
528
- },
529
- entity: [
530
- { pattern: /&[\da-z]{1,8};/i, alias: "named-entity" },
531
- /&#x?[\da-f]{1,8};/i
532
- ]
533
- }),
534
- (Prism.languages.markup.tag.inside["attr-value"].inside.entity =
535
- Prism.languages.markup.entity),
536
- (Prism.languages.markup.doctype.inside["internal-subset"].inside =
537
- Prism.languages.markup),
538
- Prism.hooks.add("wrap", function (e) {
539
- "entity" === e.type &&
540
- (e.attributes.title = e.content.replace(/&amp;/, "&"));
541
- }),
542
- Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
543
- value: function (e, t) {
544
- var n = {};
545
- (n["language-" + t] = {
546
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
547
- lookbehind: !0,
548
- inside: Prism.languages[t]
549
- }),
550
- (n.cdata = /^<!\[CDATA\[|\]\]>$/i);
551
- var a = {
552
- "included-cdata": {
553
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
554
- inside: n
555
- }
556
- };
557
- a["language-" + t] = {
558
- pattern: /[\s\S]+/,
559
- inside: Prism.languages[t]
560
- };
561
- var r = {};
562
- (r[e] = {
563
- pattern: RegExp(
564
- /(<__[\s\S]*?>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(
565
- /__/g,
566
- function () {
567
- return e;
568
- }
569
- ),
570
- "i"
571
- ),
572
- lookbehind: !0,
573
- greedy: !0,
574
- inside: a
575
- }),
576
- Prism.languages.insertBefore("markup", "cdata", r);
577
- }
578
- }),
579
- (Prism.languages.html = Prism.languages.markup),
580
- (Prism.languages.mathml = Prism.languages.markup),
581
- (Prism.languages.svg = Prism.languages.markup),
582
- (Prism.languages.xml = Prism.languages.extend("markup", {})),
583
- (Prism.languages.ssml = Prism.languages.xml),
584
- (Prism.languages.atom = Prism.languages.xml),
585
- (Prism.languages.rss = Prism.languages.xml),
586
- (function (e) {
587
- var t = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
588
- (e.languages.css = {
589
- comment: /\/\*[\s\S]*?\*\//,
590
- atrule: {
591
- pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,
592
- inside: {
593
- rule: /^@[\w-]+/,
594
- "selector-function-argument": {
595
- pattern: /(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,
596
- lookbehind: !0,
597
- alias: "selector"
598
- },
599
- keyword: {
600
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
601
- lookbehind: !0
602
- }
603
- }
604
- },
605
- url: {
606
- pattern: RegExp(
607
- "\\burl\\((?:" +
608
- t.source +
609
- "|" +
610
- /(?:[^\\\r\n()"']|\\[\s\S])*/.source +
611
- ")\\)",
612
- "i"
613
- ),
614
- greedy: !0,
615
- inside: {
616
- function: /^url/i,
617
- punctuation: /^\(|\)$/,
618
- string: {
619
- pattern: RegExp("^" + t.source + "$"),
620
- alias: "url"
621
- }
622
- }
623
- },
624
- selector: RegExp(
625
- "[^{}\\s](?:[^{};\"']|" + t.source + ")*?(?=\\s*\\{)"
626
- ),
627
- string: { pattern: t, greedy: !0 },
628
- property: /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
629
- important: /!important\b/i,
630
- function: /[-a-z0-9]+(?=\()/i,
631
- punctuation: /[(){};:,]/
632
- }),
633
- (e.languages.css.atrule.inside.rest = e.languages.css);
634
- var n = e.languages.markup;
635
- n &&
636
- (n.tag.addInlined("style", "css"),
637
- e.languages.insertBefore(
638
- "inside",
639
- "attr-value",
640
- {
641
- "style-attr": {
642
- pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,
643
- inside: {
644
- "attr-name": {
645
- pattern: /^\s*style/i,
646
- inside: n.tag.inside
647
- },
648
- punctuation: /^\s*=\s*['"]|['"]\s*$/,
649
- "attr-value": {
650
- pattern: /.+/i,
651
- inside: e.languages.css
652
- }
653
- },
654
- alias: "language-css"
655
- }
656
- },
657
- n.tag
658
- ));
659
- })(Prism),
660
- (Prism.languages.clike = {
661
- comment: [
662
- { pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0 },
663
- { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }
664
- ],
665
- string: {
666
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
667
- greedy: !0
668
- },
669
- "class-name": {
670
- pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
671
- lookbehind: !0,
672
- inside: { punctuation: /[.\\]/ }
673
- },
674
- keyword: /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
675
- boolean: /\b(?:true|false)\b/,
676
- function: /\w+(?=\()/,
677
- number: /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,
678
- operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
679
- punctuation: /[{}[\];(),.:]/
680
- }),
681
- (Prism.languages.javascript = Prism.languages.extend("clike", {
682
- "class-name": [
683
- Prism.languages.clike["class-name"],
684
- {
685
- pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,
686
- lookbehind: !0
687
- }
688
- ],
689
- keyword: [
690
- { pattern: /((?:^|})\s*)(?:catch|finally)\b/, lookbehind: !0 },
691
- {
692
- pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
693
- lookbehind: !0
694
- }
695
- ],
696
- number: /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
697
- function: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
698
- operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
699
- })),
700
- (Prism.languages.javascript[
701
- "class-name"
702
- ][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/),
703
- Prism.languages.insertBefore("javascript", "keyword", {
704
- regex: {
705
- pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
706
- lookbehind: !0,
707
- greedy: !0
708
- },
709
- "function-variable": {
710
- pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,
711
- alias: "function"
712
- },
713
- parameter: [
714
- {
715
- pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,
716
- lookbehind: !0,
717
- inside: Prism.languages.javascript
718
- },
719
- {
720
- pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,
721
- inside: Prism.languages.javascript
722
- },
723
- {
724
- pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,
725
- lookbehind: !0,
726
- inside: Prism.languages.javascript
727
- },
728
- {
729
- pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,
730
- lookbehind: !0,
731
- inside: Prism.languages.javascript
732
- }
733
- ],
734
- constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
735
- }),
736
- Prism.languages.insertBefore("javascript", "string", {
737
- "template-string": {
738
- pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,
739
- greedy: !0,
740
- inside: {
741
- "template-punctuation": { pattern: /^`|`$/, alias: "string" },
742
- interpolation: {
743
- pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,
744
- lookbehind: !0,
745
- inside: {
746
- "interpolation-punctuation": {
747
- pattern: /^\${|}$/,
748
- alias: "punctuation"
749
- },
750
- rest: Prism.languages.javascript
751
- }
752
- },
753
- string: /[\s\S]+/
754
- }
755
- }
756
- }),
757
- Prism.languages.markup &&
758
- Prism.languages.markup.tag.addInlined("script", "javascript"),
759
- (Prism.languages.js = Prism.languages.javascript),
760
- (function () {
761
- var o, u, g, c, d, a, e;
762
- function p(e, t) {
763
- var n = (n = e.className).replace(a, " ") + " language-" + t;
764
- e.className = n.replace(/\s+/g, " ").trim();
765
- }
766
- "undefined" != typeof self &&
767
- self.Prism &&
768
- self.document &&
769
- ((o = window.Prism),
770
- (u = {
771
- js: "javascript",
772
- py: "python",
773
- rb: "ruby",
774
- ps1: "powershell",
775
- psm1: "powershell",
776
- sh: "bash",
777
- bat: "batch",
778
- h: "c",
779
- tex: "latex"
780
- }),
781
- (d =
782
- "pre[data-src]:not([" +
783
- (g = "data-src-status") +
784
- '="loaded"]):not([' +
785
- g +
786
- '="' +
787
- (c = "loading") +
788
- '"])'),
789
- (a = /\blang(?:uage)?-([\w-]+)\b/i),
790
- o.hooks.add("before-highlightall", function (e) {
791
- e.selector += ", " + d;
792
- }),
793
- o.hooks.add("before-sanity-check", function (e) {
794
- var t,
795
- n,
796
- a,
797
- r,
798
- s,
799
- i,
800
- l = e.element;
801
- l.matches(d) &&
802
- ((e.code = ""),
803
- l.setAttribute(g, c),
804
- ((t = l.appendChild(
805
- document.createElement("CODE")
806
- )).textContent = "Loading…"),
807
- (n = l.getAttribute("data-src")),
808
- "none" === (r = e.language) &&
809
- ((a = (/\.(\w+)$/.exec(n) || [, "none"])[1]),
810
- (r = u[a] || a)),
811
- p(t, r),
812
- p(l, r),
813
- (s = o.plugins.autoloader) && s.loadLanguages(r),
814
- (i = new XMLHttpRequest()).open("GET", n, !0),
815
- (i.onreadystatechange = function () {
816
- 4 == i.readyState &&
817
- (i.status < 400 && i.responseText
818
- ? (l.setAttribute(g, "loaded"),
819
- (t.textContent = i.responseText),
820
- o.highlightElement(t))
821
- : (l.setAttribute(g, "failed"),
822
- 400 <= i.status
823
- ? (t.textContent =
824
- "✖ Error " +
825
- i.status +
826
- " while fetching file: " +
827
- i.statusText)
828
- : (t.textContent =
829
- "✖ Error: File does not exist or is empty")));
830
- }),
831
- i.send(null));
832
- }),
833
- (e = !(o.plugins.fileHighlight = {
834
- highlight: function (e) {
835
- for (
836
- var t, n = (e || document).querySelectorAll(d), a = 0;
837
- (t = n[a++]);
838
-
839
- )
840
- o.highlightElement(t);
841
- }
842
- })),
843
- (o.fileHighlight = function () {
844
- e ||
845
- (console.warn(
846
- "Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."
847
- ),
848
- (e = !0)),
849
- o.plugins.fileHighlight.highlight.apply(this, arguments);
850
- }));
851
- })();
852
-
853
- export default Prism;