desmost 0.7.1 → 0.7.2

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.
@@ -6,7 +6,7 @@ export class LatexIncantation extends ArgIncantation {
6
6
  arg_type = Incantation.ArgType.LATEX;
7
7
  apply(target, data) {
8
8
  target.type = "expression";
9
- target.latex = data;
9
+ target.latex = data === "" ? " " : data;
10
10
  }
11
11
  evaluate_arg(data) {
12
12
  return data;
@@ -1 +1 @@
1
- {"version":3,"file":"latex.js","sourceRoot":"","sources":["../../../src/magic/expr/latex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAa,MAAM,gBAAgB,CAAC;AAGxE,MAAM,OAAO,gBAAiB,SAAQ,cAAoB;IAEtC,WAAW,GACzB,2EAA2E,CAAA;IAE7D,UAAU,GAAK,OAAO,CAAA;IACtB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,KAAK,CAAA;IAE1D,KAAK,CAAC,MAA8B,EAAE,IAAY;QAEhD,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC;QAE3B,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAEQ,YAAY,CAAC,IAAY;QAEhC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
1
+ {"version":3,"file":"latex.js","sourceRoot":"","sources":["../../../src/magic/expr/latex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAa,MAAM,gBAAgB,CAAC;AAGxE,MAAM,OAAO,gBAAiB,SAAQ,cAAoB;IAEtC,WAAW,GACzB,2EAA2E,CAAA;IAE7D,UAAU,GAAK,OAAO,CAAA;IACtB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,KAAK,CAAA;IAE1D,KAAK,CAAC,MAA8B,EAAE,IAAY;QAEhD,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC;QAE3B,MAAM,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1C,CAAC;IAEQ,YAAY,CAAC,IAAY;QAEhC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -4,6 +4,6 @@ export declare class DesmosIncantation extends ArgIncantation<GLOBAL> {
4
4
  readonly identifier = "desmos";
5
5
  readonly requires_arg = false;
6
6
  readonly arg_type = Incantation.ArgType.OBJECT;
7
- apply(target: Desmos.Calculator, data: Desmos.GraphConfiguration & Desmos.GraphSettings): void;
7
+ apply(target: Desmos.Calculator, data?: Desmos.GraphConfiguration & Desmos.GraphSettings): void;
8
8
  }
9
9
  //# sourceMappingURL=desmos.d.ts.map
@@ -1 +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;CAIR"}
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,CAAC,EAAE,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC,aAAa,GACtD,IAAI;CAMR"}
@@ -5,7 +5,9 @@ export class DesmosIncantation extends ArgIncantation {
5
5
  requires_arg = false;
6
6
  arg_type = Incantation.ArgType.OBJECT;
7
7
  apply(target, data) {
8
- target.updateSettings(data);
8
+ if (data != undefined) {
9
+ target.updateSettings(data);
10
+ }
9
11
  }
10
12
  }
11
13
  //# sourceMappingURL=desmos.js.map
@@ -1 +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"}
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,IAAuD;QAGvD,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;YACtB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "desmost",
3
3
  "author": "Sup#2.0",
4
- "version": "0.7.1",
4
+ "version": "0.7.2",
5
5
  "license": "MIT",
6
6
 
7
7
  "description": "A tiny DSL for compiling LaTeX to Desmos",
@@ -14,7 +14,7 @@ export class LatexIncantation extends ArgIncantation<EXPR>
14
14
  {
15
15
  target.type = "expression";
16
16
  // @ts-expect-error: outdated types
17
- target.latex = data;
17
+ target.latex = data === "" ? " " : data;
18
18
  }
19
19
 
20
20
  override evaluate_arg(data: string): string
@@ -12,9 +12,11 @@ export class DesmosIncantation extends ArgIncantation<GLOBAL>
12
12
 
13
13
  override apply(
14
14
  target: Desmos.Calculator,
15
- data: Desmos.GraphConfiguration & Desmos.GraphSettings,
15
+ data?: Desmos.GraphConfiguration & Desmos.GraphSettings,
16
16
  ): void
17
17
  {
18
- target.updateSettings(data);
18
+ if (data != undefined) {
19
+ target.updateSettings(data);
20
+ }
19
21
  }
20
22
  }
@@ -151,9 +151,8 @@ onMount(() =>
151
151
  }
152
152
 
153
153
  return () => {
154
- for (let instance of desmos_instances) {
155
- instance.destroy();
156
- }
154
+ desmos_instances.forEach(d => d.destroy());
155
+ lazy_observers.forEach(o => o.disconnect());
157
156
  };
158
157
  });
159
158