@marimo-team/islands 0.15.1 → 0.15.3

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 (189) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DIy_POzQ.js → ConnectedDataExplorerComponent-DfvW3rBn.js} +323 -328
  2. package/dist/{ImageComparisonComponent-4ehfWTqN.js → ImageComparisonComponent-XaJshw7d.js} +13 -13
  3. package/dist/{_baseUniq-Duh9chhg.js → _baseUniq-dN9WKF9m.js} +67 -67
  4. package/dist/any-language-editor-CpFniVi-.js +27 -0
  5. package/dist/{arc-BXrety1g.js → arc-BOhn-m2C.js} +1 -1
  6. package/dist/{architectureDiagram-KFL7JDKH-3xVup6Z2.js → architectureDiagram-W76B3OCA-Bpg85ZKv.js} +144 -144
  7. package/dist/assets/{worker-COGufAQn.js → worker-Y-Q4G-N2.js} +30 -26
  8. package/dist/asterisk-DS281yxp.js +271 -0
  9. package/dist/{blockDiagram-ZYB65J3Q-eEZ6LTIH.js → blockDiagram-QIGZ2CNN-DS1kOHlW.js} +10 -10
  10. package/dist/{c4Diagram-AAMF2YG6-BqjOo55d.js → c4Diagram-FPNF74CW-CyRVKssw.js} +8 -8
  11. package/dist/{channel-BkhHQVue.js → channel-BilGXox7.js} +1 -1
  12. package/dist/{chunk-ANTBXLJU-BkLYh6ot.js → chunk-4BX2VUAB-CZR39zCO.js} +1 -1
  13. package/dist/{chunk-WVR4S24B-DpdvazVp.js → chunk-55IACEB6-BIH-MYov.js} +1 -1
  14. package/dist/{chunk-GLLZNHP4-BGaltx6Q.js → chunk-FMBD7UC4-4PZXFZE8.js} +1 -1
  15. package/dist/{chunk-JBRWN2VN-BZ3JgjiU.js → chunk-K7UQS3LO-CEvWKznk.js} +117 -117
  16. package/dist/{chunk-NRVI72HA-XO3jKXGr.js → chunk-QN33PNHL-D5LO5Jq_.js} +1 -1
  17. package/dist/{chunk-FHKO5MBM-BqvR49qe.js → chunk-QZHKN3VN-6gwUonWI.js} +1 -1
  18. package/dist/{chunk-LXBSTHXV-CJgOmuuc.js → chunk-TVAH2DTR-3gm06QdU.js} +7 -7
  19. package/dist/{chunk-OMD6QJNC-1rwXYaVn.js → chunk-TZMSLE5B-Cm8Iy9bO.js} +1 -1
  20. package/dist/{classDiagram-v2-QTMF73CY-_BeLc0pY.js → classDiagram-KNZD7YFC-DC529O_z.js} +2 -2
  21. package/dist/{classDiagram-3BZAVTQC-_BeLc0pY.js → classDiagram-v2-RKCZMP56-DC529O_z.js} +2 -2
  22. package/dist/{clone-DhXjmfNH.js → clone-CLoRX3j6.js} +1 -1
  23. package/dist/cose-bilkent-S5V4N54A-qf5DlS6Y.js +2609 -0
  24. package/dist/{cytoscape.esm-BYnVVhJX.js → cytoscape.esm-DfdJODL8.js} +34 -34
  25. package/dist/{dagre-2BBEFEWP-DoebA2zc.js → dagre-5GWH7T2D-Ceocls0m.js} +6 -6
  26. package/dist/{data-grid-overlay-editor-DYmc5v9I.js → data-grid-overlay-editor-AqDS_UKe.js} +11 -11
  27. package/dist/{diagram-4IRLE6MV-CxnJ439S.js → diagram-N5W7TBWH-CP66oSiv.js} +59 -60
  28. package/dist/{diagram-RP2FKANI-C-v51IXB.js → diagram-QEK2KX5R-_YD4kxxi.js} +15 -15
  29. package/dist/{diagram-GUPCWM2R-B7MLfHE7.js → diagram-S2PKOQOG-Cnj8T-OP.js} +10 -10
  30. package/dist/dockerfile-Cm8cRYCN.js +194 -0
  31. package/dist/ebnf-DUPDuY4r.js +78 -0
  32. package/dist/{erDiagram-HZWUO2LU-Cv1Slpwd.js → erDiagram-AWTI2OKA-CGnvoHx6.js} +8 -8
  33. package/dist/fcl-CPC2WYrI.js +103 -0
  34. package/dist/{flowDiagram-THRYKUMA-CnjAkcKg.js → flowDiagram-PVAE7QVJ-DG-pr9R9.js} +9 -9
  35. package/dist/{ganttDiagram-WV7ZQ7D5-CRQQ5cqP.js → ganttDiagram-OWAHRB6G-JmChtxvn.js} +34 -34
  36. package/dist/{gitGraphDiagram-OJR772UL-a7Wl_pP8.js → gitGraphDiagram-NY62KEGX-D8wLfOPd.js} +4 -4
  37. package/dist/{glide-data-editor-DrSTYUHP.js → glide-data-editor-9nC3iCIZ.js} +33 -33
  38. package/dist/{graph-Dq4lx1WI.js → graph-CoRe7vAN.js} +3 -3
  39. package/dist/http-D9LttvKF.js +44 -0
  40. package/dist/{index-B_t2cVfJ.js → index-6qYeHHjQ.js} +33090 -32892
  41. package/dist/{index-BhnWrXVh.js → index-BpzLh4Qe.js} +7711 -7711
  42. package/dist/{index-DSAnCCyV.js → index-BthgsgYX.js} +6 -6
  43. package/dist/{index-pBmAzQJl.js → index-MCx5v1x0.js} +2 -2
  44. package/dist/index-jkm77Jrz.js +98 -0
  45. package/dist/{infoDiagram-6WOFNB3A-B4pr_cke.js → infoDiagram-STP46IZ2-BlXxvOrR.js} +2 -2
  46. package/dist/{journeyDiagram-FFXJYRFH-CF8H9tcV.js → journeyDiagram-BIP6EPQ6-CNRYs_Fc.js} +24 -26
  47. package/dist/{kanban-definition-KOZQBZVT-BYfBCo4W.js → kanban-definition-6OIFK2YF-B9HeMAuP.js} +14 -14
  48. package/dist/{layout-D8_YOjKz.js → layout-m2vOUiW1.js} +81 -81
  49. package/dist/{linear-Be5SurQB.js → linear-DU6Q5CX3.js} +35 -35
  50. package/dist/{main-8IC_V2L6.js → main-BD2KGFpU.js} +74594 -68034
  51. package/dist/main.js +1 -1
  52. package/dist/{mermaid-B4v-qVXz.js → mermaid-HVCtvbyx.js} +6160 -7493
  53. package/dist/min-DcGMA4e_.js +80 -0
  54. package/dist/mindmap-definition-Q6HEUPPD-BW8UmIDQ.js +785 -0
  55. package/dist/nginx-zDPm3Z74.js +89 -0
  56. package/dist/{number-overlay-editor-XASk1ikZ.js → number-overlay-editor-D8Hl0Syo.js} +19 -19
  57. package/dist/{pieDiagram-DBDJKBY4-DhPX65dy.js → pieDiagram-ADFJNKIX-Bg-3zg5U.js} +17 -17
  58. package/dist/{quadrantDiagram-YPSRARAO-BjPa8bg5.js → quadrantDiagram-LMRXKWRM-BO4IG6Yz.js} +6 -6
  59. package/dist/{react-plotly-C_6SNkG9.js → react-plotly-dkvHVuRb.js} +3577 -3577
  60. package/dist/{requirementDiagram-EGVEC5DT-CtN_U9bI.js → requirementDiagram-4UW4RH46-5sdTguSM.js} +7 -7
  61. package/dist/{sankeyDiagram-HRAUVNP4-DVi73SZP.js → sankeyDiagram-GR3RE2ED-Buhlv9OI.js} +5 -5
  62. package/dist/sequenceDiagram-C3RYC4MD-C3qsM2UP.js +2519 -0
  63. package/dist/{slides-component-ML7vxRcD.js → slides-component-D209A0-s.js} +66 -66
  64. package/dist/solr-BNlsLglM.js +41 -0
  65. package/dist/spreadsheet-C-cy4P5N.js +49 -0
  66. package/dist/{stateDiagram-UUKSUZ4H-qZ62tNIz.js → stateDiagram-KXAO66HF-CopJ7G6P.js} +5 -5
  67. package/dist/{stateDiagram-v2-EYPG3UTE-BZEyTMgl.js → stateDiagram-v2-UMBNRL4Z-CejL8AKf.js} +2 -2
  68. package/dist/style.css +1 -1
  69. package/dist/tiddlywiki-5wqsXtSk.js +155 -0
  70. package/dist/tiki-__Kn3CeS.js +181 -0
  71. package/dist/{time-CZ2vTSO2.js → time-BwSBitlN.js} +58 -58
  72. package/dist/{timeline-definition-3HZDQTIS-DbWMwd1x.js → timeline-definition-XQNQX7LJ-DzMNTX-C.js} +10 -12
  73. package/dist/{timer-BYwnU4DF.js → timer-B0-z63CM.js} +16 -16
  74. package/dist/{treemap-75Q7IDZK-CocR-oAZ.js → treemap-75Q7IDZK-zeJG07dk.js} +14 -14
  75. package/dist/{vega-component-BrYek_kz.js → vega-component-CUkiTayd.js} +30 -30
  76. package/dist/{xychartDiagram-FDP5SA34-CYiUdiy5.js → xychartDiagram-6GGTOJPD-DiENNXMS.js} +7 -7
  77. package/package.json +39 -39
  78. package/src/__mocks__/notebook.ts +3 -0
  79. package/src/__mocks__/requests.ts +3 -0
  80. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +12 -12
  81. package/src/__tests__/chat-utils.test.ts +26 -211
  82. package/src/components/ai/ai-model-dropdown.tsx +25 -9
  83. package/src/components/app-config/ai-config.tsx +7 -0
  84. package/src/components/chat/chat-components.tsx +71 -0
  85. package/src/components/chat/chat-panel.tsx +481 -291
  86. package/src/components/chat/chat-utils.ts +50 -0
  87. package/src/components/chat/markdown-renderer.tsx +3 -7
  88. package/src/components/chat/tool-call-accordion.tsx +5 -5
  89. package/src/components/datasources/__tests__/utils.test.ts +6 -0
  90. package/src/components/datasources/column-preview.tsx +1 -3
  91. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  92. package/src/components/editor/ai/add-cell-with-ai.tsx +20 -15
  93. package/src/components/editor/ai/ai-completion-editor.tsx +22 -3
  94. package/src/components/editor/ai/completion-handlers.tsx +2 -4
  95. package/src/components/editor/ai/completion-utils.ts +85 -11
  96. package/src/components/editor/alerts/startup-logs-alert.tsx +72 -0
  97. package/src/components/editor/chrome/panels/datasources-panel.tsx +3 -1
  98. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +3 -1
  99. package/src/components/editor/chrome/panels/documentation-panel.tsx +3 -1
  100. package/src/components/editor/chrome/panels/error-panel.tsx +3 -1
  101. package/src/components/editor/chrome/panels/file-explorer-panel.tsx +3 -1
  102. package/src/components/editor/chrome/panels/logs-panel.tsx +3 -1
  103. package/src/components/editor/chrome/panels/outline-panel.tsx +3 -1
  104. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -2
  105. package/src/components/editor/chrome/panels/scratchpad-panel.tsx +3 -1
  106. package/src/components/editor/chrome/panels/secrets-panel.tsx +3 -1
  107. package/src/components/editor/chrome/panels/snippets-panel.tsx +3 -1
  108. package/src/components/editor/chrome/panels/tracing-panel.tsx +3 -1
  109. package/src/components/editor/chrome/panels/variable-panel.tsx +3 -1
  110. package/src/components/editor/chrome/wrapper/app-chrome.tsx +38 -28
  111. package/src/components/editor/controls/command-palette-button.tsx +1 -1
  112. package/src/components/editor/controls/command-palette.tsx +5 -4
  113. package/src/components/editor/controls/state.ts +4 -0
  114. package/src/components/editor/package-alert.tsx +108 -58
  115. package/src/components/editor/renderers/CellArray.tsx +2 -0
  116. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +0 -1
  117. package/src/components/pages/edit-page.tsx +7 -3
  118. package/src/core/ai/chat-utils.ts +26 -43
  119. package/src/core/ai/config.ts +1 -1
  120. package/src/core/ai/context/__tests__/registry.test.ts +277 -3
  121. package/src/core/ai/context/context.ts +11 -1
  122. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +378 -0
  123. package/src/core/ai/context/providers/__tests__/error.test.ts +3 -2
  124. package/src/core/ai/context/providers/__tests__/file.test.ts +119 -0
  125. package/src/core/ai/context/providers/cell-output.ts +349 -0
  126. package/src/core/ai/context/providers/common.ts +5 -1
  127. package/src/core/ai/context/providers/file.ts +287 -0
  128. package/src/core/ai/context/registry.ts +79 -0
  129. package/src/core/ai/state.ts +22 -5
  130. package/src/core/alerts/state.ts +71 -3
  131. package/src/core/cells/cell.ts +2 -2
  132. package/src/core/cells/cells.ts +1 -1
  133. package/src/core/cells/logs.ts +1 -1
  134. package/src/core/cells/runs.ts +6 -5
  135. package/src/core/codemirror/ai/resources.ts +47 -5
  136. package/src/core/codemirror/ai/state.ts +12 -0
  137. package/src/core/codemirror/language/__tests__/sql.test.ts +45 -0
  138. package/src/core/codemirror/markdown/__tests__/commands.test.ts +1 -0
  139. package/src/core/codemirror/theme/dark.ts +1 -1
  140. package/src/core/config/capabilities.ts +1 -1
  141. package/src/core/datasets/__tests__/data-source.test.ts +24 -0
  142. package/src/core/errors/__tests__/errors.test.ts +2 -0
  143. package/src/core/islands/bridge.ts +1 -0
  144. package/src/core/islands/main.ts +1 -0
  145. package/src/core/kernel/messages.ts +12 -6
  146. package/src/core/layout/layout.ts +3 -3
  147. package/src/core/network/requests-network.ts +8 -0
  148. package/src/core/network/requests-static.ts +1 -0
  149. package/src/core/network/requests-toasting.ts +1 -0
  150. package/src/core/network/types.ts +4 -1
  151. package/src/core/wasm/bridge.ts +18 -2
  152. package/src/core/wasm/worker/bootstrap.ts +3 -1
  153. package/src/core/wasm/worker/getMarimoWheel.ts +3 -8
  154. package/src/core/wasm/worker/types.ts +3 -0
  155. package/src/core/websocket/useMarimoWebSocket.tsx +7 -1
  156. package/src/css/app/Cell.css +42 -21
  157. package/src/css/app/codemirror.css +5 -1
  158. package/src/css/globals.css +3 -0
  159. package/src/css/md.css +1 -1
  160. package/src/plugins/impl/MicrophonePlugin.tsx +2 -2
  161. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -9
  162. package/src/plugins/impl/chat/chat-ui.tsx +129 -110
  163. package/src/plugins/impl/chat/types.ts +5 -8
  164. package/src/plugins/impl/code/__tests__/language.test.ts +15 -0
  165. package/src/plugins/impl/code/any-language-editor.tsx +11 -8
  166. package/src/plugins/layout/MimeRenderPlugin.tsx +3 -6
  167. package/src/stories/cell.stories.tsx +6 -0
  168. package/src/stories/layout/vertical/one-column.stories.tsx +215 -0
  169. package/src/theme/useTheme.ts +11 -6
  170. package/src/utils/__tests__/blob.test.ts +37 -0
  171. package/src/utils/arrays.ts +13 -0
  172. package/src/utils/fileToBase64.ts +21 -6
  173. package/src/utils/json/base64.ts +5 -2
  174. package/src/utils/numbers.ts +9 -7
  175. package/dist/any-language-editor-Cvakxnzg.js +0 -45
  176. package/dist/asn1-jKiBa2Ya.js +0 -95
  177. package/dist/clojure-CCKyeQKf.js +0 -800
  178. package/dist/css-BkF-NPzE.js +0 -1553
  179. package/dist/index-CfrpOVe5.js +0 -341
  180. package/dist/index-DIFrY2JV.js +0 -288
  181. package/dist/javascript-C2yteZeJ.js +0 -691
  182. package/dist/min-Q4QXsXWR.js +0 -80
  183. package/dist/mindmap-definition-LNHGMQRG-CebaDS3t.js +0 -3234
  184. package/dist/mllike-BSnXJBGA.js +0 -272
  185. package/dist/pug-CwAQJzGR.js +0 -248
  186. package/dist/python-BkR3uSy8.js +0 -313
  187. package/dist/rpm-IznJm2Xc.js +0 -57
  188. package/dist/sequenceDiagram-WFGC7UMF-C8jImRwI.js +0 -2284
  189. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
@@ -1,691 +0,0 @@
1
- function fr(x) {
2
- var br = x.statementIndent, ur = x.jsonld, pr = x.json || ur, k = x.typescript, U = x.wordCharacters || /[\w$\xa1-\uffff]/, wr = function() {
3
- function r(v) {
4
- return { type: v, style: "keyword" };
5
- }
6
- var e = r("keyword a"), t = r("keyword b"), f = r("keyword c"), u = r("keyword d"), c = r("operator"), m = { type: "atom", style: "atom" };
7
- return {
8
- if: r("if"),
9
- while: e,
10
- with: e,
11
- else: t,
12
- do: t,
13
- try: t,
14
- finally: t,
15
- return: u,
16
- break: u,
17
- continue: u,
18
- new: r("new"),
19
- delete: f,
20
- void: f,
21
- throw: f,
22
- debugger: r("debugger"),
23
- var: r("var"),
24
- const: r("var"),
25
- let: r("var"),
26
- function: r("function"),
27
- catch: r("catch"),
28
- for: r("for"),
29
- switch: r("switch"),
30
- case: r("case"),
31
- default: r("default"),
32
- in: c,
33
- typeof: c,
34
- instanceof: c,
35
- true: m,
36
- false: m,
37
- null: m,
38
- undefined: m,
39
- NaN: m,
40
- Infinity: m,
41
- this: r("this"),
42
- class: r("class"),
43
- super: r("atom"),
44
- yield: f,
45
- export: r("export"),
46
- import: r("import"),
47
- extends: f,
48
- await: f
49
- };
50
- }(), hr = /[+\-*&%=<>!?|~^@]/, Or = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
51
- function qr(r) {
52
- for (var e = false, t, f = false; (t = r.next()) != null; ) {
53
- if (!e) {
54
- if (t == "/" && !f) return;
55
- t == "[" ? f = true : f && t == "]" && (f = false);
56
- }
57
- e = !e && t == "\\";
58
- }
59
- }
60
- var D, G;
61
- function p(r, e, t) {
62
- return D = r, G = t, e;
63
- }
64
- function S(r, e) {
65
- var t = r.next();
66
- if (t == '"' || t == "'")
67
- return e.tokenize = Nr(t), e.tokenize(r, e);
68
- if (t == "." && r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))
69
- return p("number", "number");
70
- if (t == "." && r.match(".."))
71
- return p("spread", "meta");
72
- if (/[\[\]{}\(\),;\:\.]/.test(t))
73
- return p(t);
74
- if (t == "=" && r.eat(">"))
75
- return p("=>", "operator");
76
- if (t == "0" && r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))
77
- return p("number", "number");
78
- if (/\d/.test(t))
79
- return r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/), p("number", "number");
80
- if (t == "/")
81
- return r.eat("*") ? (e.tokenize = H, H(r, e)) : r.eat("/") ? (r.skipToEnd(), p("comment", "comment")) : ce(r, e, 1) ? (qr(r), r.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/), p("regexp", "string.special")) : (r.eat("="), p("operator", "operator", r.current()));
82
- if (t == "`")
83
- return e.tokenize = L, L(r, e);
84
- if (t == "#" && r.peek() == "!")
85
- return r.skipToEnd(), p("meta", "meta");
86
- if (t == "#" && r.eatWhile(U))
87
- return p("variable", "property");
88
- if (t == "<" && r.match("!--") || t == "-" && r.match("->") && !/\S/.test(r.string.slice(0, r.start)))
89
- return r.skipToEnd(), p("comment", "comment");
90
- if (hr.test(t))
91
- return (t != ">" || !e.lexical || e.lexical.type != ">") && (r.eat("=") ? (t == "!" || t == "=") && r.eat("=") : /[<>*+\-|&?]/.test(t) && (r.eat(t), t == ">" && r.eat(t))), t == "?" && r.eat(".") ? p(".") : p("operator", "operator", r.current());
92
- if (U.test(t)) {
93
- r.eatWhile(U);
94
- var f = r.current();
95
- if (e.lastType != ".") {
96
- if (wr.propertyIsEnumerable(f)) {
97
- var u = wr[f];
98
- return p(u.type, u.style, f);
99
- }
100
- if (f == "async" && r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
101
- return p("async", "keyword", f);
102
- }
103
- return p("variable", "variable", f);
104
- }
105
- }
106
- function Nr(r) {
107
- return function(e, t) {
108
- var f = false, u;
109
- if (ur && e.peek() == "@" && e.match(Or))
110
- return t.tokenize = S, p("jsonld-keyword", "meta");
111
- for (; (u = e.next()) != null && !(u == r && !f); )
112
- f = !f && u == "\\";
113
- return f || (t.tokenize = S), p("string", "string");
114
- };
115
- }
116
- function H(r, e) {
117
- for (var t = false, f; f = r.next(); ) {
118
- if (f == "/" && t) {
119
- e.tokenize = S;
120
- break;
121
- }
122
- t = f == "*";
123
- }
124
- return p("comment", "comment");
125
- }
126
- function L(r, e) {
127
- for (var t = false, f; (f = r.next()) != null; ) {
128
- if (!t && (f == "`" || f == "$" && r.eat("{"))) {
129
- e.tokenize = S;
130
- break;
131
- }
132
- t = !t && f == "\\";
133
- }
134
- return p("quasi", "string.special", r.current());
135
- }
136
- var Br = "([{}])";
137
- function ar(r, e) {
138
- e.fatArrowAt && (e.fatArrowAt = null);
139
- var t = r.string.indexOf("=>", r.start);
140
- if (!(t < 0)) {
141
- if (k) {
142
- var f = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start, t));
143
- f && (t = f.index);
144
- }
145
- for (var u = 0, c = false, m = t - 1; m >= 0; --m) {
146
- var v = r.string.charAt(m), y = Br.indexOf(v);
147
- if (y >= 0 && y < 3) {
148
- if (!u) {
149
- ++m;
150
- break;
151
- }
152
- if (--u == 0) {
153
- v == "(" && (c = true);
154
- break;
155
- }
156
- } else if (y >= 3 && y < 6)
157
- ++u;
158
- else if (U.test(v))
159
- c = true;
160
- else if (/["'\/`]/.test(v))
161
- for (; ; --m) {
162
- if (m == 0) return;
163
- var K = r.string.charAt(m - 1);
164
- if (K == v && r.string.charAt(m - 2) != "\\") {
165
- m--;
166
- break;
167
- }
168
- }
169
- else if (c && !u) {
170
- ++m;
171
- break;
172
- }
173
- }
174
- c && !u && (e.fatArrowAt = m);
175
- }
176
- }
177
- var Fr = {
178
- atom: true,
179
- number: true,
180
- variable: true,
181
- string: true,
182
- regexp: true,
183
- this: true,
184
- import: true,
185
- "jsonld-keyword": true
186
- };
187
- function xr(r, e, t, f, u, c) {
188
- this.indented = r, this.column = e, this.type = t, this.prev = u, this.info = c, f != null && (this.align = f);
189
- }
190
- function Jr(r, e) {
191
- for (var t = r.localVars; t; t = t.next)
192
- if (t.name == e) return true;
193
- for (var f = r.context; f; f = f.prev)
194
- for (var t = f.vars; t; t = t.next)
195
- if (t.name == e) return true;
196
- }
197
- function Mr(r, e, t, f, u) {
198
- var c = r.cc;
199
- for (i.state = r, i.stream = u, i.marked = null, i.cc = c, i.style = e, r.lexical.hasOwnProperty("align") || (r.lexical.align = true); ; ) {
200
- var m = c.length ? c.pop() : pr ? b : w;
201
- if (m(t, f)) {
202
- for (; c.length && c[c.length - 1].lex; )
203
- c.pop()();
204
- return i.marked ? i.marked : t == "variable" && Jr(r, f) ? "variableName.local" : e;
205
- }
206
- }
207
- }
208
- var i = { state: null, marked: null, cc: null };
209
- function o() {
210
- for (var r = arguments.length - 1; r >= 0; r--) i.cc.push(arguments[r]);
211
- }
212
- function n() {
213
- return o.apply(null, arguments), true;
214
- }
215
- function or(r, e) {
216
- for (var t = e; t; t = t.next) if (t.name == r) return true;
217
- return false;
218
- }
219
- function q(r) {
220
- var e = i.state;
221
- if (i.marked = "def", e.context) {
222
- if (e.lexical.info == "var" && e.context && e.context.block) {
223
- var t = gr(r, e.context);
224
- if (t != null) {
225
- e.context = t;
226
- return;
227
- }
228
- } else if (!or(r, e.localVars)) {
229
- e.localVars = new Q(r, e.localVars);
230
- return;
231
- }
232
- }
233
- x.globalVars && !or(r, e.globalVars) && (e.globalVars = new Q(r, e.globalVars));
234
- }
235
- function gr(r, e) {
236
- if (e)
237
- if (e.block) {
238
- var t = gr(r, e.prev);
239
- return t ? t == e.prev ? e : new P(t, e.vars, true) : null;
240
- } else return or(r, e.vars) ? e : new P(e.prev, new Q(r, e.vars), false);
241
- else return null;
242
- }
243
- function X(r) {
244
- return r == "public" || r == "private" || r == "protected" || r == "abstract" || r == "readonly";
245
- }
246
- function P(r, e, t) {
247
- this.prev = r, this.vars = e, this.block = t;
248
- }
249
- function Q(r, e) {
250
- this.name = r, this.next = e;
251
- }
252
- var Dr = new Q("this", new Q("arguments", null));
253
- function E() {
254
- i.state.context = new P(i.state.context, i.state.localVars, false), i.state.localVars = Dr;
255
- }
256
- function Y() {
257
- i.state.context = new P(i.state.context, i.state.localVars, true), i.state.localVars = null;
258
- }
259
- E.lex = Y.lex = true;
260
- function T() {
261
- i.state.localVars = i.state.context.vars, i.state.context = i.state.context.prev;
262
- }
263
- T.lex = true;
264
- function s(r, e) {
265
- var t = function() {
266
- var f = i.state, u = f.indented;
267
- if (f.lexical.type == "stat") u = f.lexical.indented;
268
- else for (var c = f.lexical; c && c.type == ")" && c.align; c = c.prev)
269
- u = c.indented;
270
- f.lexical = new xr(u, i.stream.column(), r, null, f.lexical, e);
271
- };
272
- return t.lex = true, t;
273
- }
274
- function a() {
275
- var r = i.state;
276
- r.lexical.prev && (r.lexical.type == ")" && (r.indented = r.lexical.indented), r.lexical = r.lexical.prev);
277
- }
278
- a.lex = true;
279
- function l(r) {
280
- function e(t) {
281
- return t == r ? n() : r == ";" || t == "}" || t == ")" || t == "]" ? o() : n(e);
282
- }
283
- return e;
284
- }
285
- function w(r, e) {
286
- return r == "var" ? n(s("vardef", e), mr, l(";"), a) : r == "keyword a" ? n(s("form"), sr, w, a) : r == "keyword b" ? n(s("form"), w, a) : r == "keyword d" ? i.stream.match(/^\s*$/, false) ? n() : n(s("stat"), N, l(";"), a) : r == "debugger" ? n(l(";")) : r == "{" ? n(s("}"), Y, rr, a, T) : r == ";" ? n() : r == "if" ? (i.state.lexical.info == "else" && i.state.cc[i.state.cc.length - 1] == a && i.state.cc.pop()(), n(s("form"), sr, w, a, zr)) : r == "function" ? n(j) : r == "for" ? n(s("form"), Y, _r, w, T, a) : r == "class" || k && e == "interface" ? (i.marked = "keyword", n(s("form", r == "class" ? r : e), Sr, a)) : r == "variable" ? k && e == "declare" ? (i.marked = "keyword", n(w)) : k && (e == "module" || e == "enum" || e == "type") && i.stream.match(/^\s*\w/, false) ? (i.marked = "keyword", e == "enum" ? n($r) : e == "type" ? n(jr, l("operator"), d, l(";")) : n(s("form"), V, l("{"), s("}"), rr, a, a)) : k && e == "namespace" ? (i.marked = "keyword", n(s("form"), b, w, a)) : k && e == "abstract" ? (i.marked = "keyword", n(w)) : n(s("stat"), Kr) : r == "switch" ? n(
287
- s("form"),
288
- sr,
289
- l("{"),
290
- s("}", "switch"),
291
- Y,
292
- rr,
293
- a,
294
- a,
295
- T
296
- ) : r == "case" ? n(b, l(":")) : r == "default" ? n(l(":")) : r == "catch" ? n(s("form"), E, Lr, w, a, T) : r == "export" ? n(s("stat"), fe, a) : r == "import" ? n(s("stat"), ue, a) : r == "async" ? n(w) : e == "@" ? n(b, w) : o(s("stat"), b, l(";"), a);
297
- }
298
- function Lr(r) {
299
- if (r == "(") return n(O, l(")"));
300
- }
301
- function b(r, e) {
302
- return vr(r, e, false);
303
- }
304
- function g(r, e) {
305
- return vr(r, e, true);
306
- }
307
- function sr(r) {
308
- return r != "(" ? o() : n(s(")"), N, l(")"), a);
309
- }
310
- function vr(r, e, t) {
311
- if (i.state.fatArrowAt == i.stream.start) {
312
- var f = t ? Tr : yr;
313
- if (r == "(") return n(E, s(")"), h(O, ")"), a, l("=>"), f, T);
314
- if (r == "variable") return o(E, V, l("=>"), f, T);
315
- }
316
- var u = t ? B : I;
317
- return Fr.hasOwnProperty(r) ? n(u) : r == "function" ? n(j, u) : r == "class" || k && e == "interface" ? (i.marked = "keyword", n(s("form"), ie, a)) : r == "keyword c" || r == "async" ? n(t ? g : b) : r == "(" ? n(s(")"), N, l(")"), a, u) : r == "operator" || r == "spread" ? n(t ? g : b) : r == "[" ? n(s("]"), oe, a, u) : r == "{" ? R(C, "}", null, u) : r == "quasi" ? o(Z, u) : r == "new" ? n(Qr(t)) : n();
318
- }
319
- function N(r) {
320
- return r.match(/[;\}\)\],]/) ? o() : o(b);
321
- }
322
- function I(r, e) {
323
- return r == "," ? n(N) : B(r, e, false);
324
- }
325
- function B(r, e, t) {
326
- var f = t == false ? I : B, u = t == false ? b : g;
327
- if (r == "=>") return n(E, t ? Tr : yr, T);
328
- if (r == "operator")
329
- return /\+\+|--/.test(e) || k && e == "!" ? n(f) : k && e == "<" && i.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false) ? n(s(">"), h(d, ">"), a, f) : e == "?" ? n(b, l(":"), u) : n(u);
330
- if (r == "quasi")
331
- return o(Z, f);
332
- if (r != ";") {
333
- if (r == "(") return R(g, ")", "call", f);
334
- if (r == ".") return n(Ur, f);
335
- if (r == "[") return n(s("]"), N, l("]"), a, f);
336
- if (k && e == "as")
337
- return i.marked = "keyword", n(d, f);
338
- if (r == "regexp")
339
- return i.state.lastType = i.marked = "operator", i.stream.backUp(i.stream.pos - i.stream.start - 1), n(u);
340
- }
341
- }
342
- function Z(r, e) {
343
- return r != "quasi" ? o() : e.slice(e.length - 2) != "${" ? n(Z) : n(N, Pr);
344
- }
345
- function Pr(r) {
346
- if (r == "}")
347
- return i.marked = "string.special", i.state.tokenize = L, n(Z);
348
- }
349
- function yr(r) {
350
- return ar(i.stream, i.state), o(r == "{" ? w : b);
351
- }
352
- function Tr(r) {
353
- return ar(i.stream, i.state), o(r == "{" ? w : g);
354
- }
355
- function Qr(r) {
356
- return function(e) {
357
- return e == "." ? n(r ? Wr : Rr) : e == "variable" && k ? n(Cr, r ? B : I) : o(r ? g : b);
358
- };
359
- }
360
- function Rr(r, e) {
361
- if (e == "target")
362
- return i.marked = "keyword", n(I);
363
- }
364
- function Wr(r, e) {
365
- if (e == "target")
366
- return i.marked = "keyword", n(B);
367
- }
368
- function Kr(r) {
369
- return r == ":" ? n(a, w) : o(I, l(";"), a);
370
- }
371
- function Ur(r) {
372
- if (r == "variable")
373
- return i.marked = "property", n();
374
- }
375
- function C(r, e) {
376
- if (r == "async")
377
- return i.marked = "property", n(C);
378
- if (r == "variable" || i.style == "keyword") {
379
- if (i.marked = "property", e == "get" || e == "set") return n(Gr);
380
- var t;
381
- return k && i.state.fatArrowAt == i.stream.start && (t = i.stream.match(/^\s*:\s*/, false)) && (i.state.fatArrowAt = i.stream.pos + t[0].length), n($);
382
- } else {
383
- if (r == "number" || r == "string")
384
- return i.marked = ur ? "property" : i.style + " property", n($);
385
- if (r == "jsonld-keyword")
386
- return n($);
387
- if (k && X(e))
388
- return i.marked = "keyword", n(C);
389
- if (r == "[")
390
- return n(b, F, l("]"), $);
391
- if (r == "spread")
392
- return n(g, $);
393
- if (e == "*")
394
- return i.marked = "keyword", n(C);
395
- if (r == ":")
396
- return o($);
397
- }
398
- }
399
- function Gr(r) {
400
- return r != "variable" ? o($) : (i.marked = "property", n(j));
401
- }
402
- function $(r) {
403
- if (r == ":") return n(g);
404
- if (r == "(") return o(j);
405
- }
406
- function h(r, e, t) {
407
- function f(u, c) {
408
- if (t ? t.indexOf(u) > -1 : u == ",") {
409
- var m = i.state.lexical;
410
- return m.info == "call" && (m.pos = (m.pos || 0) + 1), n(function(v, y) {
411
- return v == e || y == e ? o() : o(r);
412
- }, f);
413
- }
414
- return u == e || c == e ? n() : t && t.indexOf(";") > -1 ? o(r) : n(l(e));
415
- }
416
- return function(u, c) {
417
- return u == e || c == e ? n() : o(r, f);
418
- };
419
- }
420
- function R(r, e, t) {
421
- for (var f = 3; f < arguments.length; f++)
422
- i.cc.push(arguments[f]);
423
- return n(s(e, t), h(r, e), a);
424
- }
425
- function rr(r) {
426
- return r == "}" ? n() : o(w, rr);
427
- }
428
- function F(r, e) {
429
- if (k) {
430
- if (r == ":") return n(d);
431
- if (e == "?") return n(F);
432
- }
433
- }
434
- function Hr(r, e) {
435
- if (k && (r == ":" || e == "in")) return n(d);
436
- }
437
- function Vr(r) {
438
- if (k && r == ":")
439
- return i.stream.match(/^\s*\w+\s+is\b/, false) ? n(b, Xr, d) : n(d);
440
- }
441
- function Xr(r, e) {
442
- if (e == "is")
443
- return i.marked = "keyword", n();
444
- }
445
- function d(r, e) {
446
- if (e == "keyof" || e == "typeof" || e == "infer" || e == "readonly")
447
- return i.marked = "keyword", n(e == "typeof" ? g : d);
448
- if (r == "variable" || e == "void")
449
- return i.marked = "type", n(A);
450
- if (e == "|" || e == "&") return n(d);
451
- if (r == "string" || r == "number" || r == "atom") return n(A);
452
- if (r == "[") return n(s("]"), h(d, "]", ","), a, A);
453
- if (r == "{") return n(s("}"), lr, a, A);
454
- if (r == "(") return n(h(dr, ")"), Yr, A);
455
- if (r == "<") return n(h(d, ">"), d);
456
- if (r == "quasi") return o(cr, A);
457
- }
458
- function Yr(r) {
459
- if (r == "=>") return n(d);
460
- }
461
- function lr(r) {
462
- return r.match(/[\}\)\]]/) ? n() : r == "," || r == ";" ? n(lr) : o(W, lr);
463
- }
464
- function W(r, e) {
465
- if (r == "variable" || i.style == "keyword")
466
- return i.marked = "property", n(W);
467
- if (e == "?" || r == "number" || r == "string")
468
- return n(W);
469
- if (r == ":")
470
- return n(d);
471
- if (r == "[")
472
- return n(l("variable"), Hr, l("]"), W);
473
- if (r == "(")
474
- return o(M, W);
475
- if (!r.match(/[;\}\)\],]/))
476
- return n();
477
- }
478
- function cr(r, e) {
479
- return r != "quasi" ? o() : e.slice(e.length - 2) != "${" ? n(cr) : n(d, Zr);
480
- }
481
- function Zr(r) {
482
- if (r == "}")
483
- return i.marked = "string.special", i.state.tokenize = L, n(cr);
484
- }
485
- function dr(r, e) {
486
- return r == "variable" && i.stream.match(/^\s*[?:]/, false) || e == "?" ? n(dr) : r == ":" ? n(d) : r == "spread" ? n(dr) : o(d);
487
- }
488
- function A(r, e) {
489
- if (e == "<") return n(s(">"), h(d, ">"), a, A);
490
- if (e == "|" || r == "." || e == "&") return n(d);
491
- if (r == "[") return n(d, l("]"), A);
492
- if (e == "extends" || e == "implements")
493
- return i.marked = "keyword", n(d);
494
- if (e == "?") return n(d, l(":"), d);
495
- }
496
- function Cr(r, e) {
497
- if (e == "<") return n(s(">"), h(d, ">"), a, A);
498
- }
499
- function er() {
500
- return o(d, re);
501
- }
502
- function re(r, e) {
503
- if (e == "=") return n(d);
504
- }
505
- function mr(r, e) {
506
- return e == "enum" ? (i.marked = "keyword", n($r)) : o(V, F, _, ne);
507
- }
508
- function V(r, e) {
509
- if (k && X(e))
510
- return i.marked = "keyword", n(V);
511
- if (r == "variable")
512
- return q(e), n();
513
- if (r == "spread") return n(V);
514
- if (r == "[") return R(ee, "]");
515
- if (r == "{") return R(Ar, "}");
516
- }
517
- function Ar(r, e) {
518
- return r == "variable" && !i.stream.match(/^\s*:/, false) ? (q(e), n(_)) : (r == "variable" && (i.marked = "property"), r == "spread" ? n(V) : r == "}" ? o() : r == "[" ? n(b, l("]"), l(":"), Ar) : n(l(":"), V, _));
519
- }
520
- function ee() {
521
- return o(V, _);
522
- }
523
- function _(r, e) {
524
- if (e == "=") return n(g);
525
- }
526
- function ne(r) {
527
- if (r == ",") return n(mr);
528
- }
529
- function zr(r, e) {
530
- if (r == "keyword b" && e == "else") return n(s("form", "else"), w, a);
531
- }
532
- function _r(r, e) {
533
- if (e == "await") return n(_r);
534
- if (r == "(") return n(s(")"), te, a);
535
- }
536
- function te(r) {
537
- return r == "var" ? n(mr, J) : r == "variable" ? n(J) : o(J);
538
- }
539
- function J(r, e) {
540
- return r == ")" ? n() : r == ";" ? n(J) : e == "in" || e == "of" ? (i.marked = "keyword", n(b, J)) : o(b, J);
541
- }
542
- function j(r, e) {
543
- if (e == "*")
544
- return i.marked = "keyword", n(j);
545
- if (r == "variable")
546
- return q(e), n(j);
547
- if (r == "(") return n(E, s(")"), h(O, ")"), a, Vr, w, T);
548
- if (k && e == "<") return n(s(">"), h(er, ">"), a, j);
549
- }
550
- function M(r, e) {
551
- if (e == "*")
552
- return i.marked = "keyword", n(M);
553
- if (r == "variable")
554
- return q(e), n(M);
555
- if (r == "(") return n(E, s(")"), h(O, ")"), a, Vr, T);
556
- if (k && e == "<") return n(s(">"), h(er, ">"), a, M);
557
- }
558
- function jr(r, e) {
559
- if (r == "keyword" || r == "variable")
560
- return i.marked = "type", n(jr);
561
- if (e == "<")
562
- return n(s(">"), h(er, ">"), a);
563
- }
564
- function O(r, e) {
565
- return e == "@" && n(b, O), r == "spread" ? n(O) : k && X(e) ? (i.marked = "keyword", n(O)) : k && r == "this" ? n(F, _) : o(V, F, _);
566
- }
567
- function ie(r, e) {
568
- return r == "variable" ? Sr(r, e) : nr(r, e);
569
- }
570
- function Sr(r, e) {
571
- if (r == "variable")
572
- return q(e), n(nr);
573
- }
574
- function nr(r, e) {
575
- if (e == "<") return n(s(">"), h(er, ">"), a, nr);
576
- if (e == "extends" || e == "implements" || k && r == ",")
577
- return e == "implements" && (i.marked = "keyword"), n(k ? d : b, nr);
578
- if (r == "{") return n(s("}"), z, a);
579
- }
580
- function z(r, e) {
581
- if (r == "async" || r == "variable" && (e == "static" || e == "get" || e == "set" || k && X(e)) && i.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false))
582
- return i.marked = "keyword", n(z);
583
- if (r == "variable" || i.style == "keyword")
584
- return i.marked = "property", n(tr, z);
585
- if (r == "number" || r == "string") return n(tr, z);
586
- if (r == "[")
587
- return n(b, F, l("]"), tr, z);
588
- if (e == "*")
589
- return i.marked = "keyword", n(z);
590
- if (k && r == "(") return o(M, z);
591
- if (r == ";" || r == ",") return n(z);
592
- if (r == "}") return n();
593
- if (e == "@") return n(b, z);
594
- }
595
- function tr(r, e) {
596
- if (e == "!" || e == "?") return n(tr);
597
- if (r == ":") return n(d, _);
598
- if (e == "=") return n(g);
599
- var t = i.state.lexical.prev, f = t && t.info == "interface";
600
- return o(f ? M : j);
601
- }
602
- function fe(r, e) {
603
- return e == "*" ? (i.marked = "keyword", n(kr, l(";"))) : e == "default" ? (i.marked = "keyword", n(b, l(";"))) : r == "{" ? n(h(Er, "}"), kr, l(";")) : o(w);
604
- }
605
- function Er(r, e) {
606
- if (e == "as")
607
- return i.marked = "keyword", n(l("variable"));
608
- if (r == "variable") return o(g, Er);
609
- }
610
- function ue(r) {
611
- return r == "string" ? n() : r == "(" ? o(b) : r == "." ? o(I) : o(ir, Ir, kr);
612
- }
613
- function ir(r, e) {
614
- return r == "{" ? R(ir, "}") : (r == "variable" && q(e), e == "*" && (i.marked = "keyword"), n(ae));
615
- }
616
- function Ir(r) {
617
- if (r == ",") return n(ir, Ir);
618
- }
619
- function ae(r, e) {
620
- if (e == "as")
621
- return i.marked = "keyword", n(ir);
622
- }
623
- function kr(r, e) {
624
- if (e == "from")
625
- return i.marked = "keyword", n(b);
626
- }
627
- function oe(r) {
628
- return r == "]" ? n() : o(h(g, "]"));
629
- }
630
- function $r() {
631
- return o(s("form"), V, l("{"), s("}"), h(se, "}"), a, a);
632
- }
633
- function se() {
634
- return o(V, _);
635
- }
636
- function le(r, e) {
637
- return r.lastType == "operator" || r.lastType == "," || hr.test(e.charAt(0)) || /[,.]/.test(e.charAt(0));
638
- }
639
- function ce(r, e, t) {
640
- return e.tokenize == S && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType) || e.lastType == "quasi" && /\{\s*$/.test(r.string.slice(0, r.pos - t));
641
- }
642
- return {
643
- name: x.name,
644
- startState: function(r) {
645
- var e = {
646
- tokenize: S,
647
- lastType: "sof",
648
- cc: [],
649
- lexical: new xr(-r, 0, "block", false),
650
- localVars: x.localVars,
651
- context: x.localVars && new P(null, null, false),
652
- indented: 0
653
- };
654
- return x.globalVars && typeof x.globalVars == "object" && (e.globalVars = x.globalVars), e;
655
- },
656
- token: function(r, e) {
657
- if (r.sol() && (e.lexical.hasOwnProperty("align") || (e.lexical.align = false), e.indented = r.indentation(), ar(r, e)), e.tokenize != H && r.eatSpace()) return null;
658
- var t = e.tokenize(r, e);
659
- return D == "comment" ? t : (e.lastType = D == "operator" && (G == "++" || G == "--") ? "incdec" : D, Mr(e, t, D, G, r));
660
- },
661
- indent: function(r, e, t) {
662
- if (r.tokenize == H || r.tokenize == L) return null;
663
- if (r.tokenize != S) return 0;
664
- var f = e && e.charAt(0), u = r.lexical, c;
665
- if (!/^\s*else\b/.test(e)) for (var m = r.cc.length - 1; m >= 0; --m) {
666
- var v = r.cc[m];
667
- if (v == a) u = u.prev;
668
- else if (v != zr && v != T) break;
669
- }
670
- for (; (u.type == "stat" || u.type == "form") && (f == "}" || (c = r.cc[r.cc.length - 1]) && (c == I || c == B) && !/^[,\.=+\-*:?[\(]/.test(e)); )
671
- u = u.prev;
672
- br && u.type == ")" && u.prev.type == "stat" && (u = u.prev);
673
- var y = u.type, K = f == y;
674
- return y == "vardef" ? u.indented + (r.lastType == "operator" || r.lastType == "," ? u.info.length + 1 : 0) : y == "form" && f == "{" ? u.indented : y == "form" ? u.indented + t.unit : y == "stat" ? u.indented + (le(r, e) ? br || t.unit : 0) : u.info == "switch" && !K && x.doubleIndentSwitch != false ? u.indented + (/^(?:case|default)\b/.test(e) ? t.unit : 2 * t.unit) : u.align ? u.column + (K ? 0 : 1) : u.indented + (K ? 0 : t.unit);
675
- },
676
- languageData: {
677
- indentOnInput: /^\s*(?:case .*?:|default:|\{|\})$/,
678
- commentTokens: pr ? void 0 : { line: "//", block: { open: "/*", close: "*/" } },
679
- closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] },
680
- wordChars: "$"
681
- }
682
- };
683
- }
684
- const de = fr({ name: "javascript" });
685
- fr({ name: "json", json: true });
686
- const me = fr({ name: "json", jsonld: true });
687
- fr({ name: "typescript", typescript: true });
688
- export {
689
- de as javascript,
690
- me as jsonld
691
- };