@quarto/jupyterlab-quarto 0.1.41 → 0.1.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. package/README.md +2 -3
  2. package/package.json +1 -1
  3. package/style/base.css +4 -0
  4. package/lib/__tests__/index.spec.d.ts +0 -6
  5. package/lib/__tests__/index.spec.js +0 -60
  6. package/lib/__tests__/index.spec.js.map +0 -1
  7. package/lib/__tests__/myextension.spec.d.ts +0 -6
  8. package/lib/__tests__/myextension.spec.js +0 -10
  9. package/lib/__tests__/myextension.spec.js.map +0 -1
  10. package/lib/ast/ast.d.ts +0 -3
  11. package/lib/ast/ast.js +0 -38
  12. package/lib/ast/ast.js.map +0 -1
  13. package/lib/const.d.ts +0 -5
  14. package/lib/const.js +0 -11
  15. package/lib/const.js.map +0 -1
  16. package/lib/hooks/codemirror.d.ts +0 -4
  17. package/lib/hooks/codemirror.js +0 -51
  18. package/lib/hooks/codemirror.js.map +0 -1
  19. package/lib/index.d.ts +0 -6
  20. package/lib/index.js +0 -59
  21. package/lib/index.js.map +0 -1
  22. package/lib/manager.d.ts +0 -8
  23. package/lib/manager.js +0 -116
  24. package/lib/manager.js.map +0 -1
  25. package/lib/plugins/callouts.d.ts +0 -3
  26. package/lib/plugins/callouts.js +0 -208
  27. package/lib/plugins/callouts.js.map +0 -1
  28. package/lib/plugins/cites.d.ts +0 -3
  29. package/lib/plugins/cites.js +0 -147
  30. package/lib/plugins/cites.js.map +0 -1
  31. package/lib/plugins/decorator.d.ts +0 -3
  32. package/lib/plugins/decorator.js +0 -58
  33. package/lib/plugins/decorator.js.map +0 -1
  34. package/lib/plugins/divs.d.ts +0 -6
  35. package/lib/plugins/divs.js +0 -99
  36. package/lib/plugins/divs.js.map +0 -1
  37. package/lib/plugins/figure-divs.d.ts +0 -3
  38. package/lib/plugins/figure-divs.js +0 -52
  39. package/lib/plugins/figure-divs.js.map +0 -1
  40. package/lib/plugins/figures.d.ts +0 -17
  41. package/lib/plugins/figures.js +0 -98
  42. package/lib/plugins/figures.js.map +0 -1
  43. package/lib/plugins/gridtables/common/gridtables/GetCells.d.ts +0 -8
  44. package/lib/plugins/gridtables/common/gridtables/GetCells.js +0 -44
  45. package/lib/plugins/gridtables/common/gridtables/GetCells.js.map +0 -1
  46. package/lib/plugins/gridtables/common/gridtables/GetColumnWidths.d.ts +0 -8
  47. package/lib/plugins/gridtables/common/gridtables/GetColumnWidths.js +0 -26
  48. package/lib/plugins/gridtables/common/gridtables/GetColumnWidths.js.map +0 -1
  49. package/lib/plugins/gridtables/common/markdown-it/ColumnAlignments.d.ts +0 -8
  50. package/lib/plugins/gridtables/common/markdown-it/ColumnAlignments.js +0 -12
  51. package/lib/plugins/gridtables/common/markdown-it/ColumnAlignments.js.map +0 -1
  52. package/lib/plugins/gridtables/common/markdown-it/EmitTable.d.ts +0 -5
  53. package/lib/plugins/gridtables/common/markdown-it/EmitTable.js +0 -66
  54. package/lib/plugins/gridtables/common/markdown-it/EmitTable.js.map +0 -1
  55. package/lib/plugins/gridtables/common/markdown-it/GetCharCodeAtStartOfLine.d.ts +0 -9
  56. package/lib/plugins/gridtables/common/markdown-it/GetCharCodeAtStartOfLine.js +0 -18
  57. package/lib/plugins/gridtables/common/markdown-it/GetCharCodeAtStartOfLine.js.map +0 -1
  58. package/lib/plugins/gridtables/common/markdown-it/GetLine.d.ts +0 -3
  59. package/lib/plugins/gridtables/common/markdown-it/GetLine.js +0 -9
  60. package/lib/plugins/gridtables/common/markdown-it/GetLine.js.map +0 -1
  61. package/lib/plugins/gridtables/common/markdown-it/ParseTable.d.ts +0 -4
  62. package/lib/plugins/gridtables/common/markdown-it/ParseTable.js +0 -161
  63. package/lib/plugins/gridtables/common/markdown-it/ParseTable.js.map +0 -1
  64. package/lib/plugins/gridtables/common/markdown-it/ParseTableResult.d.ts +0 -13
  65. package/lib/plugins/gridtables/common/markdown-it/ParseTableResult.js +0 -17
  66. package/lib/plugins/gridtables/common/markdown-it/ParseTableResult.js.map +0 -1
  67. package/lib/plugins/gridtables/index.d.ts +0 -2
  68. package/lib/plugins/gridtables/index.js +0 -8
  69. package/lib/plugins/gridtables/index.js.map +0 -1
  70. package/lib/plugins/gridtables/interfaces/markdown-it/IState.d.ts +0 -11
  71. package/lib/plugins/gridtables/interfaces/markdown-it/IState.js +0 -5
  72. package/lib/plugins/gridtables/interfaces/markdown-it/IState.js.map +0 -1
  73. package/lib/plugins/gridtables/interfaces/markdown-it/IToken.d.ts +0 -7
  74. package/lib/plugins/gridtables/interfaces/markdown-it/IToken.js +0 -5
  75. package/lib/plugins/gridtables/interfaces/markdown-it/IToken.js.map +0 -1
  76. package/lib/plugins/gridtables/interfaces/markdown-it/TRuleFunction.d.ts +0 -4
  77. package/lib/plugins/gridtables/interfaces/markdown-it/TRuleFunction.js +0 -5
  78. package/lib/plugins/gridtables/interfaces/markdown-it/TRuleFunction.js.map +0 -1
  79. package/lib/plugins/gridtables/rules/gridtable.d.ts +0 -4
  80. package/lib/plugins/gridtables/rules/gridtable.js +0 -25
  81. package/lib/plugins/gridtables/rules/gridtable.js.map +0 -1
  82. package/lib/plugins/math.d.ts +0 -5
  83. package/lib/plugins/math.js +0 -174
  84. package/lib/plugins/math.js.map +0 -1
  85. package/lib/plugins/mermaid/index.d.ts +0 -3
  86. package/lib/plugins/mermaid/index.js +0 -53
  87. package/lib/plugins/mermaid/index.js.map +0 -1
  88. package/lib/plugins/shortcodes.d.ts +0 -4
  89. package/lib/plugins/shortcodes.js +0 -32
  90. package/lib/plugins/shortcodes.js.map +0 -1
  91. package/lib/plugins/spans.d.ts +0 -3
  92. package/lib/plugins/spans.js +0 -38
  93. package/lib/plugins/spans.js.map +0 -1
  94. package/lib/plugins/table-captions.d.ts +0 -3
  95. package/lib/plugins/table-captions.js +0 -74
  96. package/lib/plugins/table-captions.js.map +0 -1
  97. package/lib/plugins/yaml.d.ts +0 -3
  98. package/lib/plugins/yaml.js +0 -309
  99. package/lib/plugins/yaml.js.map +0 -1
  100. package/lib/providers/attrs.d.ts +0 -2
  101. package/lib/providers/attrs.js +0 -15
  102. package/lib/providers/attrs.js.map +0 -1
  103. package/lib/providers/callouts.d.ts +0 -2
  104. package/lib/providers/callouts.js +0 -15
  105. package/lib/providers/callouts.js.map +0 -1
  106. package/lib/providers/cites.d.ts +0 -2
  107. package/lib/providers/cites.js +0 -15
  108. package/lib/providers/cites.js.map +0 -1
  109. package/lib/providers/decorator.d.ts +0 -2
  110. package/lib/providers/decorator.js +0 -15
  111. package/lib/providers/decorator.js.map +0 -1
  112. package/lib/providers/deflist.d.ts +0 -2
  113. package/lib/providers/deflist.js +0 -15
  114. package/lib/providers/deflist.js.map +0 -1
  115. package/lib/providers/divs.d.ts +0 -2
  116. package/lib/providers/divs.js +0 -27
  117. package/lib/providers/divs.js.map +0 -1
  118. package/lib/providers/figure-divs.d.ts +0 -2
  119. package/lib/providers/figure-divs.js +0 -15
  120. package/lib/providers/figure-divs.js.map +0 -1
  121. package/lib/providers/figures.d.ts +0 -2
  122. package/lib/providers/figures.js +0 -15
  123. package/lib/providers/figures.js.map +0 -1
  124. package/lib/providers/footnotes.d.ts +0 -2
  125. package/lib/providers/footnotes.js +0 -15
  126. package/lib/providers/footnotes.js.map +0 -1
  127. package/lib/providers/gridtables.d.ts +0 -2
  128. package/lib/providers/gridtables.js +0 -15
  129. package/lib/providers/gridtables.js.map +0 -1
  130. package/lib/providers/math.d.ts +0 -2
  131. package/lib/providers/math.js +0 -104
  132. package/lib/providers/math.js.map +0 -1
  133. package/lib/providers/mermaid.d.ts +0 -2
  134. package/lib/providers/mermaid.js +0 -13
  135. package/lib/providers/mermaid.js.map +0 -1
  136. package/lib/providers/provider.d.ts +0 -4
  137. package/lib/providers/provider.js +0 -12
  138. package/lib/providers/provider.js.map +0 -1
  139. package/lib/providers/shortcodes.d.ts +0 -2
  140. package/lib/providers/shortcodes.js +0 -15
  141. package/lib/providers/shortcodes.js.map +0 -1
  142. package/lib/providers/spans.d.ts +0 -2
  143. package/lib/providers/spans.js +0 -15
  144. package/lib/providers/spans.js.map +0 -1
  145. package/lib/providers/sub.d.ts +0 -2
  146. package/lib/providers/sub.js +0 -15
  147. package/lib/providers/sub.js.map +0 -1
  148. package/lib/providers/sup.d.ts +0 -2
  149. package/lib/providers/sup.js +0 -15
  150. package/lib/providers/sup.js.map +0 -1
  151. package/lib/providers/table-captions.d.ts +0 -2
  152. package/lib/providers/table-captions.js +0 -15
  153. package/lib/providers/table-captions.js.map +0 -1
  154. package/lib/providers/tasklists.d.ts +0 -2
  155. package/lib/providers/tasklists.js +0 -15
  156. package/lib/providers/tasklists.js.map +0 -1
  157. package/lib/providers/yaml.d.ts +0 -2
  158. package/lib/providers/yaml.js +0 -15
  159. package/lib/providers/yaml.js.map +0 -1
  160. package/lib/types.d.ts +0 -44
  161. package/lib/types.js +0 -1
  162. package/lib/types.js.map +0 -1
  163. package/lib/utils/html.d.ts +0 -12
  164. package/lib/utils/html.js +0 -45
  165. package/lib/utils/html.js.map +0 -1
  166. package/lib/utils/markdownit.d.ts +0 -16
  167. package/lib/utils/markdownit.js +0 -44
  168. package/lib/utils/markdownit.js.map +0 -1
  169. package/lib/utils/tok.d.ts +0 -8
  170. package/lib/utils/tok.js +0 -13
  171. package/lib/utils/tok.js.map +0 -1
  172. package/lib/widgets.d.ts +0 -15
  173. package/lib/widgets.js +0 -57
  174. package/lib/widgets.js.map +0 -1
@@ -1,104 +0,0 @@
1
- /*
2
- * math.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { mathjaxPlugin } from '../plugins/math';
8
- import { markdownItExtension } from './provider';
9
- export const math = markdownItExtension({
10
- id: '@quarto/math',
11
- title: 'LaTex Math',
12
- plugin: async () => {
13
- return [mathjaxPlugin];
14
- },
15
- hooks: {
16
- postRender: {
17
- run: (node) => {
18
- // Inject mathjax
19
- const mathjaxId = "MathJax-script";
20
- const mathJaxScript = document.getElementById(mathjaxId);
21
- if (!mathJaxScript) {
22
- const configEl = document.createElement("script");
23
- configEl.innerText = `
24
-
25
- MathJax = {
26
- svg: {
27
- fontCache: 'global'
28
- },
29
- startup: {
30
- typeset: false,
31
- pageReady: () => {
32
- MathJax.startup.promise.then(() => {
33
-
34
- const typesetMath = (els) => {
35
- MathJax.startup.promise = MathJax.startup.promise
36
- .then(() => {
37
- return MathJax.typesetPromise(els); }
38
- )
39
- .catch((err) => console.log('Typeset failed: ' + err.message));
40
- return MathJax.startup.promise;
41
- };
42
-
43
- const typesetCellObserver = new MutationObserver((mutationList, observer) => {
44
- const els = mutationList.map((list) => list.target);
45
- const typesetEls = [];
46
- for (const el of els) {
47
- const childMathEls = el.querySelectorAll('.quarto-inline-math, .quarto-display-math');
48
- if (childMathEls && childMathEls.length > 0) {
49
- typesetEls.push(...childMathEls);
50
- }
51
- }
52
- typesetMath(typesetEls);
53
- });
54
-
55
- const containerObserver = new MutationObserver((mutationList, observer) => {
56
- const nodes = [];
57
- mutationList.forEach((record) => {
58
- for (const node of record.addedNodes) {
59
- nodes.push(node);
60
- }
61
- });
62
-
63
- const markdownNodes = nodes.filter((node) => {
64
- return node.class.contains("jp-MarkdownCell");
65
- }).forEach((node) => {
66
- typesetCellObserver.observe(node, { childList: true, subtree: true });
67
- });
68
-
69
- });
70
-
71
- const nbContainer = document.querySelector('.jp-Notebook');
72
- if (nbContainer !== null) {
73
- containerObserver.observe(nbContainer, { childList: true });
74
- }
75
-
76
- const mathEls = document.body.querySelectorAll('.quarto-inline-math, .quarto-display-math');
77
- return typesetMath([...mathEls]).then(() => {
78
- for (const mathEl of mathEls) {
79
- typesetCellObserver.observe(mathEl.parentElement, { childList: true, subtree: true });
80
- }
81
- });
82
- });
83
- },
84
- }
85
- };`;
86
- document.head.appendChild(configEl);
87
- const polyFillEl = document.createElement("script");
88
- polyFillEl.setAttribute("src", "https://polyfill.io/v3/polyfill.min.js?features=es6");
89
- document.head.appendChild(polyFillEl);
90
- const scriptEl = document.createElement("script");
91
- scriptEl.id = mathjaxId;
92
- scriptEl.setAttribute("src", "https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js");
93
- document.head.appendChild(scriptEl);
94
- }
95
- return Promise.resolve();
96
- }
97
- }
98
- }
99
- });
100
- /*
101
- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
102
- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
103
-
104
- */
@@ -1 +0,0 @@
1
- {"version":3,"file":"math.js","sourceRoot":"","sources":["../../src/providers/math.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAC;IACtC,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,OAAO,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC;IACD,KAAK,EAAE;QACL,UAAU,EAAE;YACV,GAAG,EAAE,CAAC,IAAiB,EAAE,EAAE;gBAEzB,iBAAiB;gBACjB,MAAM,SAAS,GAAG,gBAAgB,CAAC;gBACnC,MAAM,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;gBACzD,IAAI,CAAC,aAAa,EAAE;oBAElB,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;oBAClD,QAAQ,CAAC,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8D5B,CAAC;oBACM,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;oBAGpC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;oBACpD,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,qDAAqD,CAAC,CAAC;oBACtF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;oBAEtC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;oBAClD,QAAQ,CAAC,EAAE,GAAG,SAAS,CAAC;oBACxB,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,iEAAiE,CAAC,CAAC;oBAChG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;iBACrC;gBAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;YAC3B,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAEH;;;;EAIE"}
@@ -1,2 +0,0 @@
1
- export declare const mermaid: import("@jupyterlab/application").JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
2
- //# sourceMappingURL=mermaid.d.ts.map
@@ -1,13 +0,0 @@
1
- /*
2
- * mermaid.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import mermaidPlugin from '../plugins/mermaid';
8
- import { markdownItExtension } from './provider';
9
- export const mermaid = markdownItExtension({ id: '@quarto/mermaid',
10
- title: 'Mermaid',
11
- plugin: async () => {
12
- return [mermaidPlugin];
13
- } });
@@ -1 +0,0 @@
1
- {"version":3,"file":"mermaid.js","sourceRoot":"","sources":["../../src/providers/mermaid.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CACxC,EAAC,EAAE,EAAE,iBAAiB;IACtB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,OAAO,CAAC,aAAa,CAAC,CAAC;IACzB,CAAC,EAAC,CACH,CAAC"}
@@ -1,4 +0,0 @@
1
- import { JupyterFrontEndPlugin } from '@jupyterlab/application';
2
- import { MarkdownItPluginProvider } from '../types';
3
- export declare function markdownItExtension(provider: MarkdownItPluginProvider): JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
4
- //# sourceMappingURL=provider.d.ts.map
@@ -1,12 +0,0 @@
1
- import { kMarkdownItMgr, kPackageNamespace } from '../const';
2
- export function markdownItExtension(provider) {
3
- return {
4
- id: `${kPackageNamespace}:${provider.id}`,
5
- autoStart: true,
6
- requires: [kMarkdownItMgr],
7
- activate: (_app, manager) => {
8
- console.log(`Quarto MarkdownIt plugin ${provider.id} is activated!`);
9
- manager.registerPlugin(provider);
10
- }
11
- };
12
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/providers/provider.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7D,MAAM,UAAU,mBAAmB,CAAC,QAAkC;IAClE,OAAO;QACH,EAAE,EAAE,GAAG,iBAAiB,IAAI,QAAQ,CAAC,EAAE,EAAE;QACzC,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,cAAc,CAAC;QAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,OAA0B,EAAE,EAAE;YAC3C,OAAO,CAAC,GAAG,CAAC,4BAA4B,QAAQ,CAAC,EAAE,gBAAgB,CAAC,CAAC;YACrE,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;KAC2B,CAAC;AACrC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const shortcodes: import("@jupyterlab/application").JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
2
- //# sourceMappingURL=shortcodes.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * shortcodes.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { shortcodePlugin } from '../plugins/shortcodes';
8
- import { markdownItExtension } from './provider';
9
- export const shortcodes = markdownItExtension({
10
- id: '@quarto/shortcode',
11
- title: 'Shortcodes',
12
- plugin: async () => {
13
- return [shortcodePlugin];
14
- }
15
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"shortcodes.js","sourceRoot":"","sources":["../../src/providers/shortcodes.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,UAAU,GAAG,mBAAmB,CAAC;IAC5C,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const spans: import("@jupyterlab/application").JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
2
- //# sourceMappingURL=spans.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * spans.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { spansPlugin } from "../plugins/spans";
8
- import { markdownItExtension } from "./provider";
9
- export const spans = markdownItExtension({
10
- id: '@quarto/spans',
11
- title: 'Pandoc bracketed spans',
12
- plugin: async () => {
13
- return [spansPlugin];
14
- },
15
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"spans.js","sourceRoot":"","sources":["../../src/providers/spans.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAAC;IACvC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,OAAO,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const sub: import("@jupyterlab/application").JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
2
- //# sourceMappingURL=sub.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * sub.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { markdownItExtension } from './provider';
8
- export const sub = markdownItExtension({
9
- id: '@quarto/sub',
10
- title: 'Subscript Text',
11
- plugin: async () => {
12
- const plugin = await import('markdown-it-sub');
13
- return [plugin.default];
14
- }
15
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"sub.js","sourceRoot":"","sources":["../../src/providers/sub.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,GAAG,GAAG,mBAAmB,CAAC;IACrC,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,GAAG,MAAM,MAAM,CACzB,iBAAiB,CAClB,CAAC;QACF,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const sup: import("@jupyterlab/application").JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
2
- //# sourceMappingURL=sup.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * sup.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { markdownItExtension } from './provider';
8
- export const sup = markdownItExtension({
9
- id: '@quarto/sup',
10
- title: 'Superscript Text',
11
- plugin: async () => {
12
- const plugin = await import('markdown-it-sup');
13
- return [plugin.default];
14
- }
15
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"sup.js","sourceRoot":"","sources":["../../src/providers/sup.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,GAAG,GAAG,mBAAmB,CAAC;IACrC,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,GAAG,MAAM,MAAM,CACzB,iBAAiB,CAClB,CAAC;QACF,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const tableCaptions: import("@jupyterlab/application").JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
2
- //# sourceMappingURL=table-captions.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * table-captions.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { tableCaptionPlugin } from '../plugins/table-captions';
8
- import { markdownItExtension } from './provider';
9
- export const tableCaptions = markdownItExtension({
10
- id: '@quarto/tableCaptions',
11
- title: 'Quarto Table Captions',
12
- plugin: async () => {
13
- return [tableCaptionPlugin];
14
- }
15
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"table-captions.js","sourceRoot":"","sources":["../../src/providers/table-captions.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;IAC/C,EAAE,EAAE,uBAAuB;IAC3B,KAAK,EAAE,uBAAuB;IAC9B,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const tasklists: import("@jupyterlab/application").JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
2
- //# sourceMappingURL=tasklists.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * tasklists.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { markdownItExtension } from './provider';
8
- export const tasklists = markdownItExtension({
9
- id: '@quarto/tasklists',
10
- title: 'Task Lists',
11
- plugin: async () => {
12
- const plugin = await import('markdown-it-task-lists');
13
- return [plugin.default];
14
- }
15
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"tasklists.js","sourceRoot":"","sources":["../../src/providers/tasklists.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAC;IAC3C,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,GAAG,MAAM,MAAM,CACzB,wBAAwB,CACzB,CAAC;QACF,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const yaml: import("@jupyterlab/application").JupyterFrontEndPlugin<void, import("@jupyterlab/application").JupyterFrontEnd.IShell, "desktop" | "mobile">;
2
- //# sourceMappingURL=yaml.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * yaml-block.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { markdownitFrontMatterPlugin } from "../plugins/yaml";
8
- import { markdownItExtension } from "./provider";
9
- export const yaml = markdownItExtension({
10
- id: '@quarto/yaml',
11
- title: 'Quarto Yaml',
12
- plugin: async () => {
13
- return [markdownitFrontMatterPlugin];
14
- }
15
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"yaml.js","sourceRoot":"","sources":["../../src/providers/yaml.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAC;IACtC,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACvC,CAAC;CACF,CAAC,CAAC"}
package/lib/types.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import MarkdownIt from 'markdown-it';
2
- import { RenderedMarkdown } from './widgets';
3
- import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
4
- import { ISanitizer } from '@jupyterlab/apputils';
5
- export interface MarkdownItManager {
6
- registerPlugin(provider: MarkdownItPluginProvider): void;
7
- getRenderer(widget: RenderedMarkdown, options?: MarkdownIt.Options): Promise<Renderer>;
8
- }
9
- export interface Ranked {
10
- rank?: number;
11
- }
12
- export interface MarkdownItPlugin {
13
- (md: MarkdownIt, ...params: any[]): void;
14
- }
15
- export interface Hook<A, V> extends Ranked {
16
- run(arg: A): Promise<V>;
17
- }
18
- export interface MarkdownItPluginProvider extends Ranked {
19
- id: string;
20
- title: string;
21
- plugin(): Promise<[MarkdownItPlugin, ...any]>;
22
- options?(widget: RenderedMarkdown): Partial<MarkdownIt.Options>;
23
- hooks?: {
24
- preParse?: Hook<string, string>;
25
- postRender?: Hook<HTMLElement, void>;
26
- };
27
- }
28
- export interface RenderOptions {
29
- host: HTMLElement;
30
- source: string;
31
- trusted: boolean;
32
- sanitizer: ISanitizer;
33
- resolver: IRenderMime.IResolver | null;
34
- linkHandler: IRenderMime.ILinkHandler | null;
35
- shouldTypeset: boolean;
36
- renderer: Renderer;
37
- latexTypesetter: IRenderMime.ILatexTypesetter | null;
38
- }
39
- export interface Renderer {
40
- render(content: string): string;
41
- preParse(node: string): Promise<string>;
42
- postRender(node: HTMLElement): Promise<void>;
43
- }
44
- //# sourceMappingURL=types.d.ts.map
package/lib/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- import Token from "markdown-it/lib/token";
2
- export interface DecoratorOptions {
3
- customClass?: string;
4
- hide: {
5
- id?: boolean;
6
- classes?: boolean;
7
- attributes?: boolean;
8
- };
9
- }
10
- export declare const decorator: (contents: string[], customClass?: string) => string;
11
- export declare const attributeDecorator: (token: Token, options?: DecoratorOptions) => string;
12
- //# sourceMappingURL=html.d.ts.map
package/lib/utils/html.js DELETED
@@ -1,45 +0,0 @@
1
- /*
2
- * html.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { readAttrValue } from "./markdownit";
8
- export const decorator = (contents, customClass) => {
9
- if (contents.length > 0) {
10
- // Provide a decorator with the attributes
11
- return `<div class="quarto-attribute-decorator${customClass ? ' ' + customClass : ""}">${contents.map(decoratorSpan).join("")}</div>`;
12
- }
13
- else {
14
- // There is no decorator - no attributes
15
- return "";
16
- }
17
- };
18
- export const attributeDecorator = (token, options) => {
19
- var _a;
20
- // id
21
- const id = readAttrValue("id", token.attrs);
22
- // classes
23
- const clz = readAttrValue("class", token.attrs);
24
- // other attributes
25
- const otherAttrs = (_a = token.attrs) === null || _a === void 0 ? void 0 : _a.filter((attr) => { return attr[0] !== "id" && attr[0] !== "class"; });
26
- // Create a decorator for the div
27
- const contents = [];
28
- if (id && !(options === null || options === void 0 ? void 0 : options.hide.id)) {
29
- contents.push(`#${id}`);
30
- }
31
- if (clz && !(options === null || options === void 0 ? void 0 : options.hide.classes)) {
32
- const clzStr = clz.split(" ").map((cls) => `.${cls}`).join(" ");
33
- contents.push(clzStr);
34
- }
35
- if (otherAttrs && otherAttrs.length > 0 && !(options === null || options === void 0 ? void 0 : options.hide.attributes)) {
36
- const otherAttrStr = otherAttrs === null || otherAttrs === void 0 ? void 0 : otherAttrs.map((attr) => {
37
- return `${attr[0]}="${attr[1]}"`;
38
- }).join(" ");
39
- contents.push(otherAttrStr);
40
- }
41
- return decorator(contents, options === null || options === void 0 ? void 0 : options.customClass);
42
- };
43
- const decoratorSpan = (contents) => {
44
- return `<span class="quarto-attribute-decorator-content">${contents}</span>`;
45
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/utils/html.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAGF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAW7C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAkB,EAAE,WAAoB,EAAE,EAAE;IACpE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,0CAA0C;QAC1C,OAAO,yCAAyC,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAA;KACtI;SAAM;QACL,wCAAwC;QACxC,OAAO,EAAE,CAAC;KACX;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAY,EAAE,OAA0B,EAAE,EAAE;;IAC7E,KAAK;IACL,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAE5C,UAAU;IACV,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,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC7B;IACD,OAAO,SAAS,CAAC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC,CAAC;AACnD,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,EAAE;IACzC,OAAO,oDAAoD,QAAQ,SAAS,CAAA;AAC9E,CAAC,CAAA"}
@@ -1,16 +0,0 @@
1
- export declare const hasClass: (clz: string, attrs: null | [
2
- string,
3
- string
4
- ][]) => boolean | undefined;
5
- export declare const readAttrValue: (name: string, attrs: null | [
6
- string,
7
- string
8
- ][]) => string | undefined;
9
- export declare const addClass: (clz: string, attrs: null | [
10
- string,
11
- string
12
- ][]) => [
13
- string,
14
- string
15
- ][];
16
- //# sourceMappingURL=markdownit.d.ts.map
@@ -1,44 +0,0 @@
1
- /*
2
- * markdownit.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- export const hasClass = (clz, attrs) => {
8
- if (attrs === null) {
9
- return false;
10
- }
11
- const classes = readAttrValue("class", attrs);
12
- if (classes === null) {
13
- return false;
14
- }
15
- else {
16
- return classes === null || classes === void 0 ? void 0 : classes.split(" ").includes(clz);
17
- }
18
- };
19
- export const readAttrValue = (name, attrs) => {
20
- if (attrs === null) {
21
- return undefined;
22
- }
23
- const attr = attrs.find((attr) => { return attr[0] === name; });
24
- return attr ? attr[1] : undefined;
25
- };
26
- export const addClass = (clz, attrs) => {
27
- if (attrs === null) {
28
- attrs = [];
29
- attrs.push(["class", clz]);
30
- return attrs;
31
- }
32
- else {
33
- const clzIdx = attrs.findIndex((attr) => attr[0] === "class");
34
- if (clzIdx >= 0) {
35
- const currentClz = attrs[clzIdx];
36
- attrs[clzIdx] = ["class", `${currentClz[1]} ${clz}`.trim()];
37
- return attrs;
38
- }
39
- else {
40
- attrs.push(["class", clz]);
41
- return attrs;
42
- }
43
- }
44
- };
@@ -1 +0,0 @@
1
-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CAAC,KAAK,OAAO,CAAC,CAAC;QAC9D,IAAI,MAAM,IAAI,CAAC,EAAE;YACf,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5D,OAAO,KAAK,CAAC;SACd;aAAM;YACL,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;YAC1B,OAAO,KAAK,CAAC;SACd;KACF;AACH,CAAC,CAAA"}
@@ -1,8 +0,0 @@
1
- export declare const kTokParaOpen = "paragraph_open";
2
- export declare const kTokParaClose = "paragraph_close";
3
- export declare const kTokInline = "inline";
4
- export declare const kTokTableOpen = "table_open";
5
- export declare const kTokTableClose = "table_close";
6
- export declare const kTokText = "text";
7
- export declare const kTokHeadingOpen = "heading_open";
8
- //# sourceMappingURL=tok.d.ts.map
package/lib/utils/tok.js DELETED
@@ -1,13 +0,0 @@
1
- /*
2
- * tok.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- export const kTokParaOpen = "paragraph_open";
8
- export const kTokParaClose = "paragraph_close";
9
- export const kTokInline = "inline";
10
- export const kTokTableOpen = "table_open";
11
- export const kTokTableClose = "table_close";
12
- export const kTokText = "text";
13
- export const kTokHeadingOpen = "heading_open";
@@ -1 +0,0 @@
1
- {"version":3,"file":"tok.js","sourceRoot":"","sources":["../../src/utils/tok.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAGF,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE/B,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC"}
package/lib/widgets.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { RenderedHTMLCommon } from '@jupyterlab/rendermime';
2
- import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
3
- import { Message } from '@lumino/messaging';
4
- import { MarkdownItManager, Renderer } from './types';
5
- export declare class RenderedMarkdown extends RenderedHTMLCommon {
6
- constructor(options: IRenderMime.IRendererOptions, manager: MarkdownItManager);
7
- private markdownItManager;
8
- render(model: IRenderMime.IMimeModel): Promise<void>;
9
- renderer: Renderer | null;
10
- /**
11
- * A message handler invoked on an `'after-attach'` message.
12
- */
13
- onAfterAttach(msg: Message): void;
14
- }
15
- //# sourceMappingURL=widgets.d.ts.map
package/lib/widgets.js DELETED
@@ -1,57 +0,0 @@
1
- /*
2
- * widgets.ts
3
- *
4
- * Copyright (C) 2020-2023 Posit Software, PBC
5
- *
6
- */
7
- import { RenderedHTMLCommon, renderHTML } from '@jupyterlab/rendermime';
8
- // A mime rendered that renders Quarto Markdown
9
- export class RenderedMarkdown extends RenderedHTMLCommon {
10
- constructor(options, manager) {
11
- super(options);
12
- this.renderer = null;
13
- this.addClass('quarto-rendered-md');
14
- this.markdownItManager = manager;
15
- }
16
- // Renders a mime model
17
- async render(model) {
18
- if (this.renderer === null) {
19
- this.renderer = await this.markdownItManager.getRenderer(this, {});
20
- }
21
- const { host, source, renderer, ...others } = {
22
- host: this.node,
23
- source: String(model.data[this.mimeType]),
24
- trusted: model.trusted,
25
- resolver: this.resolver,
26
- sanitizer: this.sanitizer,
27
- linkHandler: this.linkHandler,
28
- shouldTypeset: this.isAttached,
29
- renderer: this.renderer,
30
- latexTypesetter: this.latexTypesetter
31
- };
32
- // Transform source
33
- const markup = await renderer.preParse(source);
34
- // Clear the content if there is no source.
35
- if (!markup) {
36
- host.textContent = '';
37
- return;
38
- }
39
- // Render HTML.
40
- await renderHTML({
41
- host,
42
- source: renderer.render(markup),
43
- ...others,
44
- shouldTypeset: false
45
- });
46
- await renderer.postRender(host);
47
- }
48
- /**
49
- * A message handler invoked on an `'after-attach'` message.
50
- */
51
- onAfterAttach(msg) {
52
- // Don't render math automatically
53
- // if (this.latexTypesetter ) {
54
- // this.latexTypesetter.typeset(this.node);
55
- // }
56
- }
57
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"widgets.js","sourceRoot":"","sources":["../src/widgets.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AACF,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKxE,+CAA+C;AAC/C,MAAM,OAAO,gBAAiB,SAAQ,kBAAkB;IAEtD,YAAY,OAAqC,EAAE,OAA0B;QAC3E,KAAK,CAAC,OAAO,CAAC,CAAC;QA0CjB,aAAQ,GAAoB,IAAI,CAAC;QAzC/B,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC;IACnC,CAAC;IAGD,uBAAuB;IACvB,KAAK,CAAC,MAAM,CAAC,KAA6B;QACxC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE;YAC1B,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACpE;QAED,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG;YAC5C,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzC,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IA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