@wiris/mathtype-viewer 8.9.1 → 8.9.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.
package/tsconfig.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  /* Basic Options */
4
- "target": "ES5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5
- "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
4
+ "target": "ES5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
5
+ "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
6
6
  "lib": [
7
7
  "dom",
8
8
  "es6",
@@ -10,28 +10,28 @@
10
10
  "scripthost",
11
11
  "es2017",
12
12
  "es5",
13
- "es2015",
14
- ], /* Specify library files to be included in the compilation. */
13
+ "es2015"
14
+ ] /* Specify library files to be included in the compilation. */,
15
15
  // "allowJs": true, /* Allow javascript files to be compiled. */
16
16
  // "checkJs": true, /* Report errors in .js files. */
17
17
  // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
18
- "declaration": true, /* Generates corresponding '.d.ts' file. */
19
- "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
20
- "sourceMap": true, /* Generates corresponding '.map' file. */
18
+ "declaration": true /* Generates corresponding '.d.ts' file. */,
19
+ "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
20
+ "sourceMap": true /* Generates corresponding '.map' file. */,
21
21
  // "outFile": "./", /* Concatenate and emit output to single file. */
22
- "outDir": "./dist", /* Redirect output structure to the directory. */
23
- "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
22
+ "outDir": "./dist" /* Redirect output structure to the directory. */,
23
+ "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
24
24
  // "composite": true, /* Enable project compilation */es
25
- "removeComments": true, /* Do not emit comments to output. */
25
+ "removeComments": true /* Do not emit comments to output. */,
26
26
  // "noEmit": true, /* Do not emit outputs. */
27
27
  // "importHelpers": true, /* Import emit helpers from 'tslib'. */
28
- "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
28
+ "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
29
29
  // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
30
30
  "noEmitOnError": true,
31
31
 
32
32
  /* Strict Type-Checking Options */
33
33
  // "strict": true, /* Enable all strict type-checking options. */
34
- "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
34
+ "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
35
35
  // "strictNullChecks": true, /* Enable strict null checks. */
36
36
  // "strictFunctionTypes": true, /* Enable strict checking of function types. */
37
37
  // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
@@ -40,24 +40,25 @@
40
40
  // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
41
41
 
42
42
  /* Additional Checks */
43
- "noUnusedLocals": false, /* Report errors on unused locals. */
44
- "noUnusedParameters": false, /* Report errors on unused parameters. */
45
- "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
43
+ "noUnusedLocals": false /* Report errors on unused locals. */,
44
+ "noUnusedParameters": false /* Report errors on unused parameters. */,
45
+ "noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
46
46
  // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
47
47
 
48
48
  /* Module Resolution Options */
49
- "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
49
+ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
50
50
  // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
51
51
  // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
52
52
  // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
53
53
  "typeRoots": [
54
54
  "./typings",
55
55
  "../node_modules/@types",
56
+ "../../node_modules/@types",
56
57
  "./dist"
57
- ], /* List of folders to include type definitions from. */
58
+ ] /* List of folders to include type definitions from. */,
58
59
  // "types": [], /* Type declaration files to be included in compilation. */
59
60
  // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
60
- "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
61
+ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
61
62
  // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
62
63
 
63
64
  /* Source Map Options */
@@ -67,12 +68,14 @@
67
68
  // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
68
69
 
69
70
  /* Experimental Options */
70
- "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
71
+ "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
71
72
  // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
72
- "resolveJsonModule": true
73
+ "resolveJsonModule": true,
74
+ "types": ["jest"]
73
75
  },
74
76
  "exclude": [
75
77
  "node_modules", // would be the default
76
- "./dist"
78
+ "./dist",
79
+ "**/*.spec.ts"
77
80
  ]
78
- }
81
+ }
@@ -1,2 +1,2 @@
1
1
  declare module "Parser";
2
- declare module '@wiris/mathtype-html-integration-devkit/src/parser';
2
+ declare module "@wiris/mathtype-html-integration-devkit/src/parser";
package/webpack.config.js CHANGED
@@ -1,35 +1,35 @@
1
- const path = require('path');
1
+ const path = require("path");
2
2
 
3
3
  module.exports = (config, context) => {
4
4
  return {
5
- entry: './src/app.ts',
6
- mode: 'none',
5
+ entry: "./src/app.ts",
6
+ mode: "none",
7
7
  module: {
8
8
  rules: [
9
9
  {
10
10
  test: /\.tsx?$/,
11
- use: 'ts-loader',
11
+ use: "ts-loader",
12
12
  exclude: /node_modules/,
13
13
  },
14
14
  {
15
15
  test: /\.js$/,
16
16
  exclude: /node_modules/,
17
- use: ['babel-loader']
17
+ use: ["babel-loader"],
18
18
  },
19
19
  ],
20
20
  },
21
21
  resolve: {
22
- extensions: ['.tsx', '.ts', '.js'],
22
+ extensions: [".tsx", ".ts", ".js"],
23
23
  },
24
24
  output: {
25
- filename: 'WIRISplugins.js',
26
- path: path.resolve(__dirname, 'dist'),
25
+ filename: "WIRISplugins.js",
26
+ path: path.resolve(__dirname, "dist"),
27
27
  },
28
28
  devServer: {
29
29
  devMiddleware: {
30
30
  writeToDisk: true,
31
31
  },
32
- static: './',
32
+ static: "./",
33
33
  hot: true,
34
34
  port: 8001,
35
35
  open: true,
@@ -37,5 +37,5 @@ module.exports = (config, context) => {
37
37
  optimization: {
38
38
  minimize: true, // enabling this reduces file size and readability
39
39
  },
40
- }
40
+ };
41
41
  };
package/dist/utils.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export declare function htmlEntitiesToXmlEntities(text: string): string;
2
- export declare const corruptMathML: string[];
3
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAoBA,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoB9D;AAID,eAAO,MAAM,aAAa,UAAqG,CAAC"}
package/src/utils.ts DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * Takes a string possibly containing encoded entities (e.g.    ) and
3
- * returns the same string with these replaced by the UTF-8 characters they represent
4
- * @param {string} text - the string with encoded entities
5
- * @returns the same string with the entities decoded
6
- */
7
- function decodeEntities(text: string): string {
8
- const element = document.createElement('textarea');
9
- element.innerHTML = text;
10
- return element.value;
11
- }
12
-
13
- /**
14
- * Takes a string possibly containing encoded named HTML entities (e.g.  ) and
15
- * returns the same string with these replaced by the encoding that uses numbers (e.g.  ).
16
- * By its implementation, this method also possibly encodes special characters that were
17
- * previously unencoded.
18
- * @param {string} text - the string with encoded entities
19
- * @returns the same string with the entities decoded
20
- */
21
- export function htmlEntitiesToXmlEntities(text: string): string {
22
- text = decodeEntities(text);
23
-
24
- // Replaces the '<', '&', '>', and '"' characters to its HTMLEntity to avoid render issues.
25
- text = text.split('&').join('&amp;')
26
- .split('"<"').join('"&lt;"')
27
- .split('">"').join('"&gt;"')
28
- .split('><<').join('>&lt;<');
29
-
30
-
31
- let result = '';
32
- for (let i = 0; i < text.length; i++) {
33
- const character = text.charAt(i);
34
- if (text.charCodeAt(i) > 128) {
35
- result += '&#' + text.charCodeAt(i) + ';';
36
- } else {
37
- result += character;
38
- }
39
- }
40
- return result;
41
- }
42
-
43
- // Set of mathml and characters which don't have an accessible text associated
44
- // and can not be translated or transformed to LaTeX.
45
- export const corruptMathML = ['⟦', '&#10214;', '⟧', '&#10215;', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow'];