desmost 0.1.0

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 (281) hide show
  1. package/dist/compiler/compile.d.ts +32 -0
  2. package/dist/compiler/compile.d.ts.map +1 -0
  3. package/dist/compiler/compile.js +101 -0
  4. package/dist/compiler/compile.js.map +1 -0
  5. package/dist/compiler/evaluate.d.ts +18 -0
  6. package/dist/compiler/evaluate.d.ts.map +1 -0
  7. package/dist/compiler/evaluate.js +83 -0
  8. package/dist/compiler/evaluate.js.map +1 -0
  9. package/dist/compiler/index.d.ts +3 -0
  10. package/dist/compiler/index.d.ts.map +1 -0
  11. package/dist/compiler/index.js +2 -0
  12. package/dist/compiler/index.js.map +1 -0
  13. package/dist/compiler/options.d.ts +54 -0
  14. package/dist/compiler/options.d.ts.map +1 -0
  15. package/dist/compiler/options.js +15 -0
  16. package/dist/compiler/options.js.map +1 -0
  17. package/dist/desmos.d.ts +12 -0
  18. package/dist/desmos.d.ts.map +1 -0
  19. package/dist/desmos.js +13 -0
  20. package/dist/desmos.js.map +1 -0
  21. package/dist/errors.d.ts +45 -0
  22. package/dist/errors.d.ts.map +1 -0
  23. package/dist/errors.js +38 -0
  24. package/dist/errors.js.map +1 -0
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +2 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/magic/expr/index.d.ts +3 -0
  30. package/dist/magic/expr/index.d.ts.map +1 -0
  31. package/dist/magic/expr/index.js +8 -0
  32. package/dist/magic/expr/index.js.map +1 -0
  33. package/dist/magic/expr/latex.d.ts +10 -0
  34. package/dist/magic/expr/latex.d.ts.map +1 -0
  35. package/dist/magic/expr/latex.js +16 -0
  36. package/dist/magic/expr/latex.js.map +1 -0
  37. package/dist/magic/expr/text.d.ts +9 -0
  38. package/dist/magic/expr/text.d.ts.map +1 -0
  39. package/dist/magic/expr/text.js +13 -0
  40. package/dist/magic/expr/text.js.map +1 -0
  41. package/dist/magic/global/dark-mode.d.ts +7 -0
  42. package/dist/magic/global/dark-mode.d.ts.map +1 -0
  43. package/dist/magic/global/dark-mode.js +11 -0
  44. package/dist/magic/global/dark-mode.js.map +1 -0
  45. package/dist/magic/global/desmos.d.ts +9 -0
  46. package/dist/magic/global/desmos.d.ts.map +1 -0
  47. package/dist/magic/global/desmos.js +11 -0
  48. package/dist/magic/global/desmos.js.map +1 -0
  49. package/dist/magic/global/index.d.ts +3 -0
  50. package/dist/magic/global/index.d.ts.map +1 -0
  51. package/dist/magic/global/index.js +10 -0
  52. package/dist/magic/global/index.js.map +1 -0
  53. package/dist/magic/global/viewport.d.ts +16 -0
  54. package/dist/magic/global/viewport.d.ts.map +1 -0
  55. package/dist/magic/global/viewport.js +12 -0
  56. package/dist/magic/global/viewport.js.map +1 -0
  57. package/dist/magic/incantation.d.ts +74 -0
  58. package/dist/magic/incantation.d.ts.map +1 -0
  59. package/dist/magic/incantation.js +81 -0
  60. package/dist/magic/incantation.js.map +1 -0
  61. package/dist/magic/index.d.ts +6 -0
  62. package/dist/magic/index.d.ts.map +1 -0
  63. package/dist/magic/index.js +5 -0
  64. package/dist/magic/index.js.map +1 -0
  65. package/dist/magic/local/anim.d.ts +7 -0
  66. package/dist/magic/local/anim.d.ts.map +1 -0
  67. package/dist/magic/local/anim.js +11 -0
  68. package/dist/magic/local/anim.js.map +1 -0
  69. package/dist/magic/local/colour.d.ts +12 -0
  70. package/dist/magic/local/colour.d.ts.map +1 -0
  71. package/dist/magic/local/colour.js +27 -0
  72. package/dist/magic/local/colour.js.map +1 -0
  73. package/dist/magic/local/dashed.d.ts +7 -0
  74. package/dist/magic/local/dashed.d.ts.map +1 -0
  75. package/dist/magic/local/dashed.js +10 -0
  76. package/dist/magic/local/dashed.js.map +1 -0
  77. package/dist/magic/local/fill.d.ts +13 -0
  78. package/dist/magic/local/fill.d.ts.map +1 -0
  79. package/dist/magic/local/fill.js +12 -0
  80. package/dist/magic/local/fill.js.map +1 -0
  81. package/dist/magic/local/hide.d.ts +7 -0
  82. package/dist/magic/local/hide.d.ts.map +1 -0
  83. package/dist/magic/local/hide.js +10 -0
  84. package/dist/magic/local/hide.js.map +1 -0
  85. package/dist/magic/local/index.d.ts +3 -0
  86. package/dist/magic/local/index.d.ts.map +1 -0
  87. package/dist/magic/local/index.js +24 -0
  88. package/dist/magic/local/index.js.map +1 -0
  89. package/dist/magic/local/line.d.ts +15 -0
  90. package/dist/magic/local/line.d.ts.map +1 -0
  91. package/dist/magic/local/line.js +17 -0
  92. package/dist/magic/local/line.js.map +1 -0
  93. package/dist/magic/local/no-line.d.ts +7 -0
  94. package/dist/magic/local/no-line.d.ts.map +1 -0
  95. package/dist/magic/local/no-line.js +10 -0
  96. package/dist/magic/local/no-line.js.map +1 -0
  97. package/dist/magic/local/point.d.ts +15 -0
  98. package/dist/magic/local/point.d.ts.map +1 -0
  99. package/dist/magic/local/point.js +17 -0
  100. package/dist/magic/local/point.js.map +1 -0
  101. package/dist/magic/local/secret.d.ts +7 -0
  102. package/dist/magic/local/secret.d.ts.map +1 -0
  103. package/dist/magic/local/secret.js +10 -0
  104. package/dist/magic/local/secret.js.map +1 -0
  105. package/dist/magic/local/slider.d.ts +15 -0
  106. package/dist/magic/local/slider.d.ts.map +1 -0
  107. package/dist/magic/local/slider.js +13 -0
  108. package/dist/magic/local/slider.js.map +1 -0
  109. package/dist/parser/ast.d.ts +40 -0
  110. package/dist/parser/ast.d.ts.map +1 -0
  111. package/dist/parser/ast.js +13 -0
  112. package/dist/parser/ast.js.map +1 -0
  113. package/dist/parser/desmost-parser.d.ts +105 -0
  114. package/dist/parser/desmost-parser.d.ts.map +1 -0
  115. package/dist/parser/desmost-parser.js +379 -0
  116. package/dist/parser/desmost-parser.js.map +1 -0
  117. package/dist/parser/generic-parser.d.ts +62 -0
  118. package/dist/parser/generic-parser.d.ts.map +1 -0
  119. package/dist/parser/generic-parser.js +143 -0
  120. package/dist/parser/generic-parser.js.map +1 -0
  121. package/dist/parser/index.d.ts +8 -0
  122. package/dist/parser/index.d.ts.map +1 -0
  123. package/dist/parser/index.js +8 -0
  124. package/dist/parser/index.js.map +1 -0
  125. package/dist/src/compiler/compile.d.ts +32 -0
  126. package/dist/src/compiler/compile.d.ts.map +1 -0
  127. package/dist/src/compiler/compile.js +101 -0
  128. package/dist/src/compiler/compile.js.map +1 -0
  129. package/dist/src/compiler/evaluate.d.ts +18 -0
  130. package/dist/src/compiler/evaluate.d.ts.map +1 -0
  131. package/dist/src/compiler/evaluate.js +83 -0
  132. package/dist/src/compiler/evaluate.js.map +1 -0
  133. package/dist/src/compiler/index.d.ts +3 -0
  134. package/dist/src/compiler/index.d.ts.map +1 -0
  135. package/dist/src/compiler/index.js +2 -0
  136. package/dist/src/compiler/index.js.map +1 -0
  137. package/dist/src/compiler/options.d.ts +54 -0
  138. package/dist/src/compiler/options.d.ts.map +1 -0
  139. package/dist/src/compiler/options.js +15 -0
  140. package/dist/src/compiler/options.js.map +1 -0
  141. package/dist/src/desmos.d.ts +12 -0
  142. package/dist/src/desmos.d.ts.map +1 -0
  143. package/dist/src/desmos.js +13 -0
  144. package/dist/src/desmos.js.map +1 -0
  145. package/dist/src/errors.d.ts +45 -0
  146. package/dist/src/errors.d.ts.map +1 -0
  147. package/dist/src/errors.js +38 -0
  148. package/dist/src/errors.js.map +1 -0
  149. package/dist/src/index.d.ts +2 -0
  150. package/dist/src/index.d.ts.map +1 -0
  151. package/dist/src/index.js +2 -0
  152. package/dist/src/index.js.map +1 -0
  153. package/dist/src/magic/expr/index.d.ts +3 -0
  154. package/dist/src/magic/expr/index.d.ts.map +1 -0
  155. package/dist/src/magic/expr/index.js +8 -0
  156. package/dist/src/magic/expr/index.js.map +1 -0
  157. package/dist/src/magic/expr/latex.d.ts +10 -0
  158. package/dist/src/magic/expr/latex.d.ts.map +1 -0
  159. package/dist/src/magic/expr/latex.js +16 -0
  160. package/dist/src/magic/expr/latex.js.map +1 -0
  161. package/dist/src/magic/expr/text.d.ts +9 -0
  162. package/dist/src/magic/expr/text.d.ts.map +1 -0
  163. package/dist/src/magic/expr/text.js +13 -0
  164. package/dist/src/magic/expr/text.js.map +1 -0
  165. package/dist/src/magic/global/dark-mode.d.ts +7 -0
  166. package/dist/src/magic/global/dark-mode.d.ts.map +1 -0
  167. package/dist/src/magic/global/dark-mode.js +11 -0
  168. package/dist/src/magic/global/dark-mode.js.map +1 -0
  169. package/dist/src/magic/global/desmos.d.ts +9 -0
  170. package/dist/src/magic/global/desmos.d.ts.map +1 -0
  171. package/dist/src/magic/global/desmos.js +11 -0
  172. package/dist/src/magic/global/desmos.js.map +1 -0
  173. package/dist/src/magic/global/index.d.ts +3 -0
  174. package/dist/src/magic/global/index.d.ts.map +1 -0
  175. package/dist/src/magic/global/index.js +10 -0
  176. package/dist/src/magic/global/index.js.map +1 -0
  177. package/dist/src/magic/global/viewport.d.ts +16 -0
  178. package/dist/src/magic/global/viewport.d.ts.map +1 -0
  179. package/dist/src/magic/global/viewport.js +12 -0
  180. package/dist/src/magic/global/viewport.js.map +1 -0
  181. package/dist/src/magic/incantation.d.ts +74 -0
  182. package/dist/src/magic/incantation.d.ts.map +1 -0
  183. package/dist/src/magic/incantation.js +81 -0
  184. package/dist/src/magic/incantation.js.map +1 -0
  185. package/dist/src/magic/index.d.ts +6 -0
  186. package/dist/src/magic/index.d.ts.map +1 -0
  187. package/dist/src/magic/index.js +5 -0
  188. package/dist/src/magic/index.js.map +1 -0
  189. package/dist/src/magic/local/anim.d.ts +7 -0
  190. package/dist/src/magic/local/anim.d.ts.map +1 -0
  191. package/dist/src/magic/local/anim.js +11 -0
  192. package/dist/src/magic/local/anim.js.map +1 -0
  193. package/dist/src/magic/local/colour.d.ts +12 -0
  194. package/dist/src/magic/local/colour.d.ts.map +1 -0
  195. package/dist/src/magic/local/colour.js +27 -0
  196. package/dist/src/magic/local/colour.js.map +1 -0
  197. package/dist/src/magic/local/dashed.d.ts +7 -0
  198. package/dist/src/magic/local/dashed.d.ts.map +1 -0
  199. package/dist/src/magic/local/dashed.js +10 -0
  200. package/dist/src/magic/local/dashed.js.map +1 -0
  201. package/dist/src/magic/local/fill.d.ts +13 -0
  202. package/dist/src/magic/local/fill.d.ts.map +1 -0
  203. package/dist/src/magic/local/fill.js +12 -0
  204. package/dist/src/magic/local/fill.js.map +1 -0
  205. package/dist/src/magic/local/hide.d.ts +7 -0
  206. package/dist/src/magic/local/hide.d.ts.map +1 -0
  207. package/dist/src/magic/local/hide.js +10 -0
  208. package/dist/src/magic/local/hide.js.map +1 -0
  209. package/dist/src/magic/local/index.d.ts +3 -0
  210. package/dist/src/magic/local/index.d.ts.map +1 -0
  211. package/dist/src/magic/local/index.js +24 -0
  212. package/dist/src/magic/local/index.js.map +1 -0
  213. package/dist/src/magic/local/line.d.ts +15 -0
  214. package/dist/src/magic/local/line.d.ts.map +1 -0
  215. package/dist/src/magic/local/line.js +17 -0
  216. package/dist/src/magic/local/line.js.map +1 -0
  217. package/dist/src/magic/local/no-line.d.ts +7 -0
  218. package/dist/src/magic/local/no-line.d.ts.map +1 -0
  219. package/dist/src/magic/local/no-line.js +10 -0
  220. package/dist/src/magic/local/no-line.js.map +1 -0
  221. package/dist/src/magic/local/point.d.ts +15 -0
  222. package/dist/src/magic/local/point.d.ts.map +1 -0
  223. package/dist/src/magic/local/point.js +17 -0
  224. package/dist/src/magic/local/point.js.map +1 -0
  225. package/dist/src/magic/local/secret.d.ts +7 -0
  226. package/dist/src/magic/local/secret.d.ts.map +1 -0
  227. package/dist/src/magic/local/secret.js +10 -0
  228. package/dist/src/magic/local/secret.js.map +1 -0
  229. package/dist/src/magic/local/slider.d.ts +15 -0
  230. package/dist/src/magic/local/slider.d.ts.map +1 -0
  231. package/dist/src/magic/local/slider.js +13 -0
  232. package/dist/src/magic/local/slider.js.map +1 -0
  233. package/dist/src/parser/ast.d.ts +40 -0
  234. package/dist/src/parser/ast.d.ts.map +1 -0
  235. package/dist/src/parser/ast.js +13 -0
  236. package/dist/src/parser/ast.js.map +1 -0
  237. package/dist/src/parser/desmost-parser.d.ts +105 -0
  238. package/dist/src/parser/desmost-parser.d.ts.map +1 -0
  239. package/dist/src/parser/desmost-parser.js +379 -0
  240. package/dist/src/parser/desmost-parser.js.map +1 -0
  241. package/dist/src/parser/generic-parser.d.ts +62 -0
  242. package/dist/src/parser/generic-parser.d.ts.map +1 -0
  243. package/dist/src/parser/generic-parser.js +143 -0
  244. package/dist/src/parser/generic-parser.js.map +1 -0
  245. package/dist/src/parser/index.d.ts +8 -0
  246. package/dist/src/parser/index.d.ts.map +1 -0
  247. package/dist/src/parser/index.js +8 -0
  248. package/dist/src/parser/index.js.map +1 -0
  249. package/package.json +58 -0
  250. package/src/compiler/compile.ts +127 -0
  251. package/src/compiler/evaluate.ts +121 -0
  252. package/src/compiler/index.ts +2 -0
  253. package/src/compiler/options.ts +77 -0
  254. package/src/desmos.ts +13 -0
  255. package/src/errors.ts +46 -0
  256. package/src/index.ts +1 -0
  257. package/src/magic/.template.ts +22 -0
  258. package/src/magic/expr/index.ts +11 -0
  259. package/src/magic/expr/latex.ts +24 -0
  260. package/src/magic/expr/text.ts +19 -0
  261. package/src/magic/global/dark-mode.ts +17 -0
  262. package/src/magic/global/desmos.ts +20 -0
  263. package/src/magic/global/index.ts +13 -0
  264. package/src/magic/global/viewport.ts +25 -0
  265. package/src/magic/incantation.ts +142 -0
  266. package/src/magic/index.ts +6 -0
  267. package/src/magic/local/anim.ts +17 -0
  268. package/src/magic/local/colour.ts +38 -0
  269. package/src/magic/local/dashed.ts +16 -0
  270. package/src/magic/local/fill.ts +24 -0
  271. package/src/magic/local/hide.ts +16 -0
  272. package/src/magic/local/index.ts +27 -0
  273. package/src/magic/local/line.ts +29 -0
  274. package/src/magic/local/no-line.ts +16 -0
  275. package/src/magic/local/point.ts +29 -0
  276. package/src/magic/local/secret.ts +16 -0
  277. package/src/magic/local/slider.ts +27 -0
  278. package/src/parser/ast.ts +60 -0
  279. package/src/parser/desmost-parser.ts +486 -0
  280. package/src/parser/generic-parser.ts +191 -0
  281. package/src/parser/index.ts +8 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desmos.d.ts","sourceRoot":"","sources":["../../../src/magic/global/desmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG1E,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAE3D,SAAkB,WAAW,gFACmD;IAEhF,SAAkB,UAAU,YAAa;IACzC,SAAkB,YAAY,SAAQ;IACtC,SAAkB,QAAQ,8BAAiC;IAElD,KAAK,CACZ,MAAM,EAAE,MAAM,CAAC,UAAU,EACzB,IAAI,EAAE,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC,aAAa,GACrD,IAAI,CAGN;CACF"}
@@ -0,0 +1,11 @@
1
+ import { Incantation, ArgIncantation } from "../incantation";
2
+ export class DesmosIncantation extends ArgIncantation {
3
+ description = "Set the configuration of the calculator via `Calculator.updateSettings()`.";
4
+ identifier = "desmos";
5
+ requires_arg = false;
6
+ arg_type = Incantation.ArgType.OBJECT;
7
+ apply(target, data) {
8
+ target.updateSettings(data);
9
+ }
10
+ }
11
+ //# sourceMappingURL=desmos.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desmos.js","sourceRoot":"","sources":["../../../src/magic/global/desmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAG1E,MAAM,OAAO,iBAAkB,SAAQ,cAAsB;IAEzC,WAAW,GACzB,4EAA4E,CAAA;IAE9D,UAAU,GAAK,QAAQ,CAAA;IACvB,YAAY,GAAG,KAAK,CAAA;IACpB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CACZ,MAAyB,EACzB,IAAsD;QAGtD,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import { Incantation, type GLOBAL } from "../incantation";
2
+ export declare const GLOBAL_INCANTATIONS: Incantation<GLOBAL>[];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/magic/global/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAO1D,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAC,EAKpD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Incantation } from "../incantation";
2
+ import { DesmosIncantation } from "./desmos";
3
+ import { ViewportIncantation } from "./viewport";
4
+ import { DarkModeIncantation } from "./dark-mode";
5
+ export const GLOBAL_INCANTATIONS = [
6
+ new DesmosIncantation(),
7
+ new ViewportIncantation(),
8
+ new DarkModeIncantation(),
9
+ ];
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/magic/global/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD,MAAM,CAAC,MAAM,mBAAmB,GAChC;IACE,IAAI,iBAAiB,EAAE;IACvB,IAAI,mBAAmB,EAAE;IACzB,IAAI,mBAAmB,EAAE;CAC1B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Incantation, ArgIncantation, type GLOBAL } from "../incantation";
2
+ interface ViewportBounds {
3
+ left: number;
4
+ right: number;
5
+ bottom: number;
6
+ top: number;
7
+ }
8
+ export declare class ViewportIncantation extends ArgIncantation<GLOBAL> {
9
+ readonly description = "Set the bounds of the viewport via `Calculator.setMathBounds()`.";
10
+ readonly identifier = "viewport";
11
+ readonly requires_arg = true;
12
+ readonly arg_type = Incantation.ArgType.OBJECT;
13
+ apply(target: Desmos.Calculator, data: ViewportBounds): void;
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=viewport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../../src/magic/global/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG1E,UAAU,cAAc;IAEtB,IAAI,EAAI,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAI,MAAM,CAAC;CAC/B;AAGD,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAE7D,SAAkB,WAAW,sEACyC;IAEtE,SAAkB,UAAU,cAAe;IAC3C,SAAkB,YAAY,QAAO;IACrC,SAAkB,QAAQ,8BAAiC;IAE3D,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,cAAc,QAIpD;CACF"}
@@ -0,0 +1,12 @@
1
+ import { Incantation, ArgIncantation } from "../incantation";
2
+ export class ViewportIncantation extends ArgIncantation {
3
+ description = "Set the bounds of the viewport via `Calculator.setMathBounds()`.";
4
+ identifier = "viewport";
5
+ requires_arg = true;
6
+ arg_type = Incantation.ArgType.OBJECT;
7
+ apply(target, data) {
8
+ // TODO validate bounds
9
+ target.setMathBounds(data);
10
+ }
11
+ }
12
+ //# sourceMappingURL=viewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../../../src/magic/global/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAU1E,MAAM,OAAO,mBAAoB,SAAQ,cAAsB;IAE3C,WAAW,GACzB,kEAAkE,CAAA;IAEpD,UAAU,GAAK,UAAU,CAAA;IACzB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAE3D,KAAK,CAAC,MAAyB,EAAE,IAAoB;QAEnD,uBAAuB;QACvB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,74 @@
1
+ import { type Unrecoverable } from "../errors";
2
+ /**
3
+ * An *Incantation* is like a slash command that tells Desmost to do something - like changing the properties of an expression, or applying some settings to the calculator as a whole.
4
+ *
5
+ * Incantations must be prefixed by a `/`. They look like this:
6
+ *
7
+ * ```math
8
+ * /viewport{ left: -1, right: 1 }
9
+ * /hidden :: x = 69
10
+ * /text :: Never gonna give you up
11
+ * ```
12
+ *
13
+ * Incantations that accept an argument derive from `ArgIncantation`.
14
+ */
15
+ export declare abstract class Incantation<Effect extends Incantation.Effect = Incantation.Effect> {
16
+ /** Short user-facing description of what the incantation does. */
17
+ abstract readonly description: string;
18
+ /** The raw text sequence that matches this incantation, such as `viewport` or `hidden`. */
19
+ abstract readonly identifier: string;
20
+ /** An alternative `.identifier`, strictly for localisation purposes only. */
21
+ readonly alias?: string;
22
+ /** Apply this incantation's effect to `target`, using the provided `data` if required. */
23
+ abstract apply(target: Effect extends GLOBAL ? Desmos.Calculator : Desmos.ExpressionState, data?: unknown): void;
24
+ /** Error if the `actual` type of the given expression is not `required`. */
25
+ protected require_expr_type<T extends Desmos.ExpressionState["type"]>(actual: unknown, required: T): asserts actual is T;
26
+ }
27
+ /**
28
+ * An incantation that accepts an argument.
29
+ */
30
+ export declare abstract class ArgIncantation<Effect extends Incantation.Effect = Incantation.Effect> extends Incantation<Effect> {
31
+ /** Does this incantation always require an argument to be passed? */
32
+ readonly requires_arg: boolean;
33
+ /** What type of argument does this incantation accept? */
34
+ abstract readonly arg_type: Incantation.ArgType;
35
+ /**
36
+ * Evaluate the argument provided to this incantation, throwing if an error is encountered.
37
+ *
38
+ * For instance, for `/viewport{ left: -1, right: 1 }`, this returns the POJO `{ left: -1, right: 1 }`.
39
+ *
40
+ * ## Notes
41
+ *
42
+ * Child incantation classes should override this method, though the defaults should cover most cases (except `ArgType.ENUM`).
43
+ */
44
+ evaluate_arg(raw: string): Unrecoverable<unknown>;
45
+ }
46
+ export declare namespace Incantation {
47
+ /** The kind of effect an incantation produces - it either modifies only one block, or modifies the calculator as a whole. */
48
+ enum Effect {
49
+ /** An incantation that affects the entire Desmos calculator state, like `/desmos` or `/viewport`. */
50
+ GLOBAL = 0,
51
+ /** An incantation that affects only the expression immediately following it, like `/hide` or `/slider`. */
52
+ LOCAL = 1,
53
+ /** An incantation that produces an expression, like `/latex` or `/text`. */
54
+ EXPR = 2
55
+ }
56
+ /** The type of argument an incantation accepts, which affects how it is parsed. */
57
+ enum ArgType {
58
+ /** Any arbitrary user text content, where characters like `"` and `'` don't have semantic meaning and can be ignored. */
59
+ STRING = "String",
60
+ /** LaTeX, which should have balanced `{}` braces. */
61
+ LATEX = "LaTeX",
62
+ /** Specific value from an allowed set of values, which will map to an enum value in the Desmos API. */
63
+ ENUM = "Enum",
64
+ /** JavaScript object fields, where characters like `{}` and `"` all have semantic meaning, and must be balanced. */
65
+ OBJECT = "Object"
66
+ }
67
+ }
68
+ /** An incantation that affects the entire Desmos calculator state, like `/desmos` or `/viewport`. */
69
+ export type GLOBAL = Incantation.Effect.GLOBAL;
70
+ /** An incantation that affects only the expression immediately following it, like `/hide` or `/slider`. */
71
+ export type LOCAL = Incantation.Effect.LOCAL;
72
+ /** An incantation that produces an expression, like `/latex` or `/text`. */
73
+ export type EXPR = Incantation.Effect.EXPR;
74
+ //# sourceMappingURL=incantation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incantation.d.ts","sourceRoot":"","sources":["../../src/magic/incantation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAGnE;;;;;;;;;;;;GAYG;AACH,8BAAsB,WAAW,CAC/B,MAAM,SAAS,WAAW,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;IAGtD,kEAAkE;IAClE,kBAAyB,WAAW,EAAE,MAAM,CAAA;IAE5C,2FAA2F;IAC3F,kBAAyB,UAAU,EAAE,MAAM,CAAA;IAE3C,6EAA6E;IAC7E,SAAgB,KAAK,CAAC,EAAE,MAAM,CAAA;IAG9B,0FAA0F;IAC1F,SAAgB,KAAK,CACnB,MAAM,EAAE,MAAM,SAAS,MAAM,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,eAAe,EAC1E,IAAI,CAAC,EAAE,OAAO,GACb,IAAI,CAAA;IAEP,4EAA4E;IAC5E,SAAS,CAAC,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,EAClE,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,GACV,OAAO,CAAC,MAAM,IAAI,CAAC,CAQrB;CACF;AAGD;;GAEG;AACH,8BAAsB,cAAc,CAClC,MAAM,SAAS,WAAW,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAEtD,SAAQ,WAAW,CAAC,MAAM,CAAC;IAE3B,qEAAqE;IACrE,SAAgB,YAAY,EAAE,OAAO,CAAO;IAE5C,0DAA0D;IAC1D,kBAAyB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAA;IAGtD;;;;;;;;OAQG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAgBvD;CACF;AAGD,yBAAiB,WAAW,CAC5B;IACE,6HAA6H;IAC7H,KAAY,MAAM;QAEhB,qGAAqG;QACrG,MAAM,IAAA;QAEN,2GAA2G;QAC3G,KAAK,IAAA;QAEL,4EAA4E;QAC5E,IAAI,IAAA;KACL;IAED,mFAAmF;IACnF,KAAY,OAAO;QAEjB,yHAAyH;QACzH,MAAM,WAAW;QAEjB,qDAAqD;QACrD,KAAK,UAAU;QAEf,uGAAuG;QACvG,IAAI,SAAS;QAEb,oHAAoH;QACpH,MAAM,WAAW;KAClB;CACF;AAKD,qGAAqG;AACrG,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;AAE/C,2GAA2G;AAC3G,MAAM,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;AAE7C,4EAA4E;AAC5E,MAAM,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC"}
@@ -0,0 +1,81 @@
1
+ import Json5 from "json5";
2
+ import { UnrecoverableError } from "../errors";
3
+ /**
4
+ * An *Incantation* is like a slash command that tells Desmost to do something - like changing the properties of an expression, or applying some settings to the calculator as a whole.
5
+ *
6
+ * Incantations must be prefixed by a `/`. They look like this:
7
+ *
8
+ * ```math
9
+ * /viewport{ left: -1, right: 1 }
10
+ * /hidden :: x = 69
11
+ * /text :: Never gonna give you up
12
+ * ```
13
+ *
14
+ * Incantations that accept an argument derive from `ArgIncantation`.
15
+ */
16
+ export class Incantation {
17
+ /** An alternative `.identifier`, strictly for localisation purposes only. */
18
+ alias;
19
+ /** Error if the `actual` type of the given expression is not `required`. */
20
+ require_expr_type(actual, required) {
21
+ if ((actual ?? "expression") !== required) {
22
+ throw new UnrecoverableError.IllegalIncantation(`/${this.identifier} can only applied to ${required === "expression" ? "latex" : required} expressions, but target block has type: ${actual}`);
23
+ }
24
+ }
25
+ }
26
+ /**
27
+ * An incantation that accepts an argument.
28
+ */
29
+ export class ArgIncantation extends Incantation {
30
+ /** Does this incantation always require an argument to be passed? */
31
+ requires_arg = true;
32
+ /**
33
+ * Evaluate the argument provided to this incantation, throwing if an error is encountered.
34
+ *
35
+ * For instance, for `/viewport{ left: -1, right: 1 }`, this returns the POJO `{ left: -1, right: 1 }`.
36
+ *
37
+ * ## Notes
38
+ *
39
+ * Child incantation classes should override this method, though the defaults should cover most cases (except `ArgType.ENUM`).
40
+ */
41
+ evaluate_arg(raw) {
42
+ switch (this.arg_type) {
43
+ case Incantation.ArgType.STRING: return raw;
44
+ case Incantation.ArgType.LATEX: return raw;
45
+ case Incantation.ArgType.ENUM: return raw;
46
+ case Incantation.ArgType.OBJECT:
47
+ try {
48
+ return Json5.parse(`{${raw}}`);
49
+ }
50
+ catch (e) {
51
+ // @ts-expect-error: fine
52
+ throw new UnrecoverableError.InvalidArgument(e.message);
53
+ }
54
+ }
55
+ }
56
+ }
57
+ (function (Incantation) {
58
+ /** The kind of effect an incantation produces - it either modifies only one block, or modifies the calculator as a whole. */
59
+ let Effect;
60
+ (function (Effect) {
61
+ /** An incantation that affects the entire Desmos calculator state, like `/desmos` or `/viewport`. */
62
+ Effect[Effect["GLOBAL"] = 0] = "GLOBAL";
63
+ /** An incantation that affects only the expression immediately following it, like `/hide` or `/slider`. */
64
+ Effect[Effect["LOCAL"] = 1] = "LOCAL";
65
+ /** An incantation that produces an expression, like `/latex` or `/text`. */
66
+ Effect[Effect["EXPR"] = 2] = "EXPR";
67
+ })(Effect = Incantation.Effect || (Incantation.Effect = {}));
68
+ /** The type of argument an incantation accepts, which affects how it is parsed. */
69
+ let ArgType;
70
+ (function (ArgType) {
71
+ /** Any arbitrary user text content, where characters like `"` and `'` don't have semantic meaning and can be ignored. */
72
+ ArgType["STRING"] = "String";
73
+ /** LaTeX, which should have balanced `{}` braces. */
74
+ ArgType["LATEX"] = "LaTeX";
75
+ /** Specific value from an allowed set of values, which will map to an enum value in the Desmos API. */
76
+ ArgType["ENUM"] = "Enum";
77
+ /** JavaScript object fields, where characters like `{}` and `"` all have semantic meaning, and must be balanced. */
78
+ ArgType["OBJECT"] = "Object";
79
+ })(ArgType = Incantation.ArgType || (Incantation.ArgType = {}));
80
+ })(Incantation || (Incantation = {}));
81
+ //# sourceMappingURL=incantation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incantation.js","sourceRoot":"","sources":["../../src/magic/incantation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAsB,MAAM,WAAW,CAAC;AAGnE;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,WAAW;IAU/B,6EAA6E;IAC7D,KAAK,CAAS;IAS9B,4EAA4E;IAClE,iBAAiB,CACzB,MAAe,EACf,QAAW;QAGX,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,KAAK,QAAQ,EACzC,CAAC;YACC,MAAM,IAAI,kBAAkB,CAAC,kBAAkB,CAC7C,IAAI,IAAI,CAAC,UAAU,wBAAwB,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,4CAA4C,MAAM,EAAE,CAC9I,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAGD;;GAEG;AACH,MAAM,OAAgB,cAGpB,SAAQ,WAAmB;IAE3B,qEAAqE;IACrD,YAAY,GAAY,IAAI,CAAA;IAM5C;;;;;;;;OAQG;IACI,YAAY,CAAC,GAAW;QAE7B,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtB,KAAK,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC;YAC5C,KAAK,WAAW,CAAC,OAAO,CAAC,KAAK,EAAG,OAAO,GAAG,CAAC;YAC5C,KAAK,WAAW,CAAC,OAAO,CAAC,IAAI,EAAI,OAAO,GAAG,CAAC;YAE5C,KAAK,WAAW,CAAC,OAAO,CAAC,MAAM;gBAC7B,IAAI,CAAC;oBACH,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;gBACjC,CAAC;gBACD,OAAO,CAAC,EAAE,CAAC;oBACT,yBAAyB;oBACzB,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC1D,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAGD,WAAiB,WAAW;IAE1B,6HAA6H;IAC7H,IAAY,MAUX;IAVD,WAAY,MAAM;QAEhB,qGAAqG;QACrG,uCAAM,CAAA;QAEN,2GAA2G;QAC3G,qCAAK,CAAA;QAEL,4EAA4E;QAC5E,mCAAI,CAAA;IACN,CAAC,EAVW,MAAM,GAAN,YAAA,MAAM,KAAN,YAAA,MAAM,QAUjB;IAED,mFAAmF;IACnF,IAAY,OAaX;IAbD,WAAY,OAAO;QAEjB,yHAAyH;QACzH,4BAAiB,CAAA;QAEjB,qDAAqD;QACrD,0BAAe,CAAA;QAEf,uGAAuG;QACvG,wBAAa,CAAA;QAEb,oHAAoH;QACpH,4BAAiB,CAAA;IACnB,CAAC,EAbW,OAAO,GAAP,YAAA,OAAO,KAAP,YAAA,OAAO,QAalB;AACH,CAAC,EA9BgB,WAAW,KAAX,WAAW,QA8B3B"}
@@ -0,0 +1,6 @@
1
+ export { Incantation, ArgIncantation } from "./incantation";
2
+ export type { GLOBAL, LOCAL, EXPR } from "./incantation";
3
+ export { GLOBAL_INCANTATIONS } from "./global";
4
+ export { LOCAL_INCANTATIONS } from "./local";
5
+ export { EXPR_INCANTATIONS } from "./expr";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/magic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { Incantation, ArgIncantation } from "./incantation";
2
+ export { GLOBAL_INCANTATIONS } from "./global";
3
+ export { LOCAL_INCANTATIONS } from "./local";
4
+ export { EXPR_INCANTATIONS } from "./expr";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/magic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Incantation, type LOCAL } from "../incantation";
2
+ export declare class AnimIncantation extends Incantation<LOCAL> {
3
+ readonly description = "Animates the slider of a block.";
4
+ readonly identifier = "anim";
5
+ apply(target: Desmos.ExpressionState): void;
6
+ }
7
+ //# sourceMappingURL=anim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anim.d.ts","sourceRoot":"","sources":["../../../src/magic/local/anim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzD,qBAAa,eAAgB,SAAQ,WAAW,CAAC,KAAK,CAAC;IAErD,SAAkB,WAAW,qCACQ;IAErC,SAAkB,UAAU,UAAS;IAE5B,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,QAK5C;CACF"}
@@ -0,0 +1,11 @@
1
+ import { Incantation } from "../incantation";
2
+ export class AnimIncantation extends Incantation {
3
+ description = "Animates the slider of a block.";
4
+ identifier = "anim";
5
+ apply(target) {
6
+ super.require_expr_type(target.type, "expression");
7
+ // @ts-expect-error: outdated types
8
+ target.playing = true;
9
+ }
10
+ }
11
+ //# sourceMappingURL=anim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anim.js","sourceRoot":"","sources":["../../../src/magic/local/anim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAGzD,MAAM,OAAO,eAAgB,SAAQ,WAAkB;IAEnC,WAAW,GACzB,iCAAiC,CAAA;IAEnB,UAAU,GAAG,MAAM,CAAA;IAE5B,KAAK,CAAC,MAA8B;QAE3C,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,mCAAmC;QACnC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { Incantation, ArgIncantation, type LOCAL } from "../incantation";
2
+ import { DesmosColour } from "../../desmos";
3
+ export declare class ColourIncantation extends ArgIncantation<LOCAL> {
4
+ readonly description = "";
5
+ readonly identifier = "color";
6
+ readonly alias = "colour";
7
+ readonly requires_arg = true;
8
+ readonly arg_type = Incantation.ArgType.ENUM;
9
+ apply(target: Desmos.ExpressionState, data: DesmosColour): void;
10
+ evaluate_arg(data: string): DesmosColour;
11
+ }
12
+ //# sourceMappingURL=colour.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colour.d.ts","sourceRoot":"","sources":["../../../src/magic/local/colour.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAE1D,SAAkB,WAAW,MACvB;IAEN,SAAkB,UAAU,WAAY;IACxC,SAAkB,KAAK,YAAkB;IACzC,SAAkB,YAAY,QAAO;IACrC,SAAkB,QAAQ,4BAA+B;IAEhD,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE,IAAI,EAAE,YAAY,QAIhE;IAEQ,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAchD;CACF"}
@@ -0,0 +1,27 @@
1
+ import { Incantation, ArgIncantation } from "../incantation";
2
+ import { UnrecoverableError } from "../../errors";
3
+ import { DesmosColour } from "../../desmos";
4
+ export class ColourIncantation extends ArgIncantation {
5
+ description = "";
6
+ identifier = "color";
7
+ alias = "colour";
8
+ requires_arg = true;
9
+ arg_type = Incantation.ArgType.ENUM;
10
+ apply(target, data) {
11
+ super.require_expr_type(target.type, "expression");
12
+ target.color = data;
13
+ }
14
+ evaluate_arg(data) {
15
+ switch (data.trim()) {
16
+ case "RED": return DesmosColour.RED;
17
+ case "BLUE": return DesmosColour.BLUE;
18
+ case "GREEN": return DesmosColour.GREEN;
19
+ case "PURPLE": return DesmosColour.PURPLE;
20
+ case "ORANGE": return DesmosColour.ORANGE;
21
+ case "BLACK": return DesmosColour.BLACK;
22
+ default:
23
+ throw new UnrecoverableError(`Invalid colour: \`${data}\``);
24
+ }
25
+ }
26
+ }
27
+ //# sourceMappingURL=colour.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colour.js","sourceRoot":"","sources":["../../../src/magic/local/colour.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,OAAO,iBAAkB,SAAQ,cAAqB;IAExC,WAAW,GACzB,EAAE,CAAA;IAEY,UAAU,GAAK,OAAO,CAAA;IACtB,KAAK,GAAU,QAAQ,CAAA;IACvB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAA;IAEhD,KAAK,CAAC,MAA8B,EAAE,IAAkB;QAE/D,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAEQ,YAAY,CAAC,IAAY;QAEhC,QAAQ,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YACpB,KAAK,KAAK,EAAK,OAAO,YAAY,CAAC,GAAG,CAAC;YACvC,KAAK,MAAM,EAAI,OAAO,YAAY,CAAC,IAAI,CAAC;YACxC,KAAK,OAAO,EAAG,OAAO,YAAY,CAAC,KAAK,CAAC;YACzC,KAAK,QAAQ,EAAE,OAAO,YAAY,CAAC,MAAM,CAAC;YAC1C,KAAK,QAAQ,EAAE,OAAO,YAAY,CAAC,MAAM,CAAC;YAC1C,KAAK,OAAO,EAAG,OAAO,YAAY,CAAC,KAAK,CAAC;YACzC;gBACE,MAAM,IAAI,kBAAkB,CAC1B,qBAAqB,IAAI,IAAI,CAC9B,CAAC;QACN,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import { Incantation, type LOCAL } from "../incantation";
2
+ export declare class DashedIncantation extends Incantation<LOCAL> {
3
+ readonly description = "Render a block as a dashed line.";
4
+ readonly identifier = "dashed";
5
+ apply(target: Desmos.ExpressionState): void;
6
+ }
7
+ //# sourceMappingURL=dashed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashed.d.ts","sourceRoot":"","sources":["../../../src/magic/local/dashed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzD,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,KAAK,CAAC;IAEvD,SAAkB,WAAW,sCACS;IAEtC,SAAkB,UAAU,YAAW;IAE9B,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,QAI5C;CACF"}
@@ -0,0 +1,10 @@
1
+ import { Incantation } from "../incantation";
2
+ export class DashedIncantation extends Incantation {
3
+ description = "Render a block as a dashed line.";
4
+ identifier = "dashed";
5
+ apply(target) {
6
+ super.require_expr_type(target.type, "expression");
7
+ target.lineStyle = Desmos.Styles.DASHED;
8
+ }
9
+ }
10
+ //# sourceMappingURL=dashed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashed.js","sourceRoot":"","sources":["../../../src/magic/local/dashed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAGzD,MAAM,OAAO,iBAAkB,SAAQ,WAAkB;IAErC,WAAW,GACzB,kCAAkC,CAAA;IAEpB,UAAU,GAAG,QAAQ,CAAA;IAE9B,KAAK,CAAC,MAA8B;QAE3C,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import { Incantation, ArgIncantation, type LOCAL } from "../incantation";
2
+ interface FillOptions {
3
+ opacity: number;
4
+ }
5
+ export declare class FillIncantation extends ArgIncantation<LOCAL> {
6
+ readonly description = "Change fill styles for a rendered block.";
7
+ readonly identifier = "fill";
8
+ readonly requires_arg = true;
9
+ readonly arg_type = Incantation.ArgType.OBJECT;
10
+ apply(target: Desmos.ExpressionState, data: FillOptions): void;
11
+ }
12
+ export {};
13
+ //# sourceMappingURL=fill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/magic/local/fill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzE,UAAU,WAAW;IAEnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,qBAAa,eAAgB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAExD,SAAkB,WAAW,8CACiB;IAE9C,SAAkB,UAAU,UAAW;IACvC,SAAkB,YAAY,QAAO;IACrC,SAAkB,QAAQ,8BAAiC;IAElD,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE,IAAI,EAAE,WAAW,QAI/D;CACF"}
@@ -0,0 +1,12 @@
1
+ import { Incantation, ArgIncantation } from "../incantation";
2
+ export class FillIncantation extends ArgIncantation {
3
+ description = "Change fill styles for a rendered block.";
4
+ identifier = "fill";
5
+ requires_arg = true;
6
+ arg_type = Incantation.ArgType.OBJECT;
7
+ apply(target, data) {
8
+ super.require_expr_type(target.type, "expression");
9
+ target.fillOpacity = data.opacity;
10
+ }
11
+ }
12
+ //# sourceMappingURL=fill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fill.js","sourceRoot":"","sources":["../../../src/magic/local/fill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AASzE,MAAM,OAAO,eAAgB,SAAQ,cAAqB;IAEtC,WAAW,GACzB,0CAA0C,CAAA;IAE5B,UAAU,GAAK,MAAM,CAAA;IACrB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CAAC,MAA8B,EAAE,IAAiB;QAE9D,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC;IACpC,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import { Incantation, type LOCAL } from "../incantation";
2
+ export declare class HideIncantation extends Incantation<LOCAL> {
3
+ readonly description = "Hide rendering for a block. This includes graphs, points, polygons, etc.";
4
+ readonly identifier = "hide";
5
+ apply(target: Desmos.ExpressionState): void;
6
+ }
7
+ //# sourceMappingURL=hide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hide.d.ts","sourceRoot":"","sources":["../../../src/magic/local/hide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzD,qBAAa,eAAgB,SAAQ,WAAW,CAAC,KAAK,CAAC;IAErD,SAAkB,WAAW,8EACiD;IAE9E,SAAkB,UAAU,UAAS;IAErC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,QAInC;CACF"}
@@ -0,0 +1,10 @@
1
+ import { Incantation } from "../incantation";
2
+ export class HideIncantation extends Incantation {
3
+ description = "Hide rendering for a block. This includes graphs, points, polygons, etc.";
4
+ identifier = "hide";
5
+ apply(target) {
6
+ super.require_expr_type(target.type, "expression");
7
+ target.hidden = true;
8
+ }
9
+ }
10
+ //# sourceMappingURL=hide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hide.js","sourceRoot":"","sources":["../../../src/magic/local/hide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAGzD,MAAM,OAAO,eAAgB,SAAQ,WAAkB;IAEnC,WAAW,GACzB,0EAA0E,CAAA;IAE5D,UAAU,GAAG,MAAM,CAAA;IAErC,KAAK,CAAC,MAA8B;QAElC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import { Incantation, type LOCAL } from "../incantation";
2
+ export declare const LOCAL_INCANTATIONS: Incantation<LOCAL>[];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/magic/local/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAczD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,KAAK,CAAC,EAYlD,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Incantation } from "../incantation";
2
+ import { AnimIncantation } from "./anim";
3
+ import { ColourIncantation } from "./colour";
4
+ import { DashedIncantation } from "./dashed";
5
+ import { FillIncantation } from "./fill";
6
+ import { HideIncantation } from "./hide";
7
+ import { LineIncantation } from "./line";
8
+ import { NoLineIncantation } from "./no-line";
9
+ import { PointIncantation } from "./point";
10
+ import { SecretIncantation } from "./secret";
11
+ import { SliderIncantation } from "./slider";
12
+ export const LOCAL_INCANTATIONS = [
13
+ new AnimIncantation(),
14
+ new ColourIncantation(),
15
+ new DashedIncantation(),
16
+ new FillIncantation(),
17
+ new HideIncantation(),
18
+ new LineIncantation(),
19
+ new NoLineIncantation(),
20
+ new PointIncantation(),
21
+ new SecretIncantation(),
22
+ new SliderIncantation(),
23
+ ];
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/magic/local/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,MAAM,CAAC,MAAM,kBAAkB,GAC/B;IACE,IAAI,eAAe,EAAE;IACrB,IAAI,iBAAiB,EAAE;IACvB,IAAI,iBAAiB,EAAE;IACvB,IAAI,eAAe,EAAE;IACrB,IAAI,eAAe,EAAE;IACrB,IAAI,eAAe,EAAE;IACrB,IAAI,iBAAiB,EAAE;IACvB,IAAI,gBAAgB,EAAE;IACtB,IAAI,iBAAiB,EAAE;IACvB,IAAI,iBAAiB,EAAE;CACxB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Incantation, ArgIncantation, type LOCAL } from "../incantation";
2
+ interface LineOptions {
3
+ style?: keyof typeof Desmos.Styles;
4
+ width?: number;
5
+ opacity?: number;
6
+ }
7
+ export declare class LineIncantation extends ArgIncantation<LOCAL> {
8
+ readonly description = "Change line styles for a rendered block.";
9
+ readonly identifier = "line";
10
+ readonly requires_arg = true;
11
+ readonly arg_type = Incantation.ArgType.OBJECT;
12
+ apply(target: Desmos.ExpressionState, data: LineOptions): void;
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/magic/local/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzE,UAAU,WAAW;IAEnB,KAAK,CAAC,EAAI,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC;IACrC,KAAK,CAAC,EAAI,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,qBAAa,eAAgB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAExD,SAAkB,WAAW,8CACiB;IAE9C,SAAkB,UAAU,UAAW;IACvC,SAAkB,YAAY,QAAO;IACrC,SAAkB,QAAQ,8BAAiC;IAElD,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE,IAAI,EAAE,WAAW,QAO/D;CACF"}
@@ -0,0 +1,17 @@
1
+ import { Incantation, ArgIncantation } from "../incantation";
2
+ export class LineIncantation extends ArgIncantation {
3
+ description = "Change line styles for a rendered block.";
4
+ identifier = "line";
5
+ requires_arg = true;
6
+ arg_type = Incantation.ArgType.OBJECT;
7
+ apply(target, data) {
8
+ super.require_expr_type(target.type, "expression");
9
+ if (data.style != undefined)
10
+ target.lineStyle = data.style;
11
+ if (data.width != undefined)
12
+ target.lineWidth = data.width;
13
+ if (data.opacity != undefined)
14
+ target.lineOpacity = data.opacity;
15
+ }
16
+ }
17
+ //# sourceMappingURL=line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.js","sourceRoot":"","sources":["../../../src/magic/local/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAWzE,MAAM,OAAO,eAAgB,SAAQ,cAAqB;IAEtC,WAAW,GACzB,0CAA0C,CAAA;IAE5B,UAAU,GAAK,MAAM,CAAA;IACrB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CAAC,MAA8B,EAAE,IAAiB;QAE9D,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAEnD,IAAI,IAAI,CAAC,KAAK,IAAI,SAAS;YAAI,MAAM,CAAC,SAAS,GAAK,IAAI,CAAC,KAAK,CAAC;QAC/D,IAAI,IAAI,CAAC,KAAK,IAAI,SAAS;YAAI,MAAM,CAAC,SAAS,GAAK,IAAI,CAAC,KAAK,CAAC;QAC/D,IAAI,IAAI,CAAC,OAAO,IAAI,SAAS;YAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC;IACnE,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import { Incantation, type LOCAL } from "../incantation";
2
+ export declare class NoLineIncantation extends Incantation<LOCAL> {
3
+ readonly description = "Disable rendering lines for a block.";
4
+ readonly identifier = "no-line";
5
+ apply(target: Desmos.ExpressionState): void;
6
+ }
7
+ //# sourceMappingURL=no-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-line.d.ts","sourceRoot":"","sources":["../../../src/magic/local/no-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzD,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,KAAK,CAAC;IAEvD,SAAkB,WAAW,0CACa;IAE1C,SAAkB,UAAU,aAAY;IAE/B,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,QAI5C;CACF"}
@@ -0,0 +1,10 @@
1
+ import { Incantation } from "../incantation";
2
+ export class NoLineIncantation extends Incantation {
3
+ description = "Disable rendering lines for a block.";
4
+ identifier = "no-line";
5
+ apply(target) {
6
+ super.require_expr_type(target.type, "expression");
7
+ target.lines = false;
8
+ }
9
+ }
10
+ //# sourceMappingURL=no-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-line.js","sourceRoot":"","sources":["../../../src/magic/local/no-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAGzD,MAAM,OAAO,iBAAkB,SAAQ,WAAkB;IAErC,WAAW,GACzB,sCAAsC,CAAA;IAExB,UAAU,GAAG,SAAS,CAAA;IAE/B,KAAK,CAAC,MAA8B;QAE3C,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import { Incantation, ArgIncantation, type LOCAL } from "../incantation";
2
+ interface PointStyles {
3
+ style?: keyof typeof Desmos.Styles;
4
+ size?: number;
5
+ opacity?: number;
6
+ }
7
+ export declare class PointIncantation extends ArgIncantation<LOCAL> {
8
+ readonly description = "";
9
+ readonly identifier = "point";
10
+ readonly requires_arg = true;
11
+ readonly arg_type = Incantation.ArgType.OBJECT;
12
+ apply(target: Desmos.ExpressionState, data: Partial<PointStyles>): void;
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=point.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/magic/local/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzE,UAAU,WAAW;IAEnB,KAAK,CAAC,EAAI,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC;IACrC,IAAI,CAAC,EAAK,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,qBAAa,gBAAiB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAEzD,SAAkB,WAAW,MACvB;IAEN,SAAkB,UAAU,WAAY;IACxC,SAAkB,YAAY,QAAO;IACrC,SAAkB,QAAQ,8BAAiC;IAElD,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,QAOxE;CACF"}
@@ -0,0 +1,17 @@
1
+ import { Incantation, ArgIncantation } from "../incantation";
2
+ export class PointIncantation extends ArgIncantation {
3
+ description = "";
4
+ identifier = "point";
5
+ requires_arg = true;
6
+ arg_type = Incantation.ArgType.OBJECT;
7
+ apply(target, data) {
8
+ super.require_expr_type(target.type, "expression");
9
+ if (data.style != undefined)
10
+ target.pointStyle = data.style;
11
+ if (data.size != undefined)
12
+ target.pointSize = data.size;
13
+ if (data.opacity != undefined)
14
+ target.pointOpacity = data.opacity;
15
+ }
16
+ }
17
+ //# sourceMappingURL=point.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"point.js","sourceRoot":"","sources":["../../../src/magic/local/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAWzE,MAAM,OAAO,gBAAiB,SAAQ,cAAqB;IAEvC,WAAW,GACzB,EAAE,CAAA;IAEY,UAAU,GAAK,OAAO,CAAA;IACtB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CAAC,MAA8B,EAAE,IAA0B;QAEvE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAEnD,IAAI,IAAI,CAAC,KAAK,IAAM,SAAS;YAAG,MAAM,CAAC,UAAU,GAAK,IAAI,CAAC,KAAK,CAAC;QACjE,IAAI,IAAI,CAAC,IAAI,IAAO,SAAS;YAAG,MAAM,CAAC,SAAS,GAAM,IAAI,CAAC,IAAI,CAAC;QAChE,IAAI,IAAI,CAAC,OAAO,IAAI,SAAS;YAAG,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC;IACrE,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import { Incantation, type LOCAL } from "../incantation";
2
+ export declare class SecretIncantation extends Incantation<LOCAL> {
3
+ readonly description = "Turn a block into a secret expression, which is hidden from the end user.";
4
+ readonly identifier = "secret";
5
+ apply(target: Desmos.ExpressionState): void;
6
+ }
7
+ //# sourceMappingURL=secret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../../src/magic/local/secret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGzD,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,KAAK,CAAC;IAEvD,SAAkB,WAAW,+EACkD;IAE/E,SAAkB,UAAU,YAAW;IAE9B,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,QAI5C;CACF"}