react-visualizer 2.1.1 → 3.0.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.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "react-visualizer",
3
- "version": "2.1.1",
3
+ "version": "3.0.0",
4
4
  "description": "The visualizer in a react component",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
- "build": "babel src --out-dir dist --presets=es2015,react",
8
- "watch-test": "watchify test/app.js -o test/built.js -t [ babelify --presets [ es2015 react ] ]",
9
- "prepublishOnly": "npm run build"
7
+ "build": "esbuild 'src/*' --outdir=dist",
8
+ "watch-test": "esbuild test/app.js --bundle --outfile=test/built.js --watch",
9
+ "prepack": "npm run build"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
@@ -23,19 +23,13 @@
23
23
  },
24
24
  "homepage": "https://github.com/cheminfo/visualizer-react#readme",
25
25
  "peerDependencies": {
26
- "react": "^16.6.0"
26
+ "react": ">=18.0.0"
27
27
  },
28
28
  "devDependencies": {
29
- "babel-cli": "^6.26.0",
30
- "babel-preset-es2015": "^6.24.1",
31
- "babel-preset-react": "^6.24.1",
32
- "babelify": "^10.0.0",
33
- "browserify": "^16.2.3",
34
- "react": "^16.6.0",
35
- "react-dom": "^16.6.0",
36
- "watchify": "^3.11.0"
29
+ "esbuild": "^0.21.4",
30
+ "react": "^18.3.1",
31
+ "react-dom": "^18.3.1"
37
32
  },
38
- "dependencies": {},
39
33
  "files": [
40
34
  "dist"
41
35
  ]
package/History.md DELETED
@@ -1,170 +0,0 @@
1
- <a name="2.0.1"></a>
2
- ## [2.0.1](https://github.com/cheminfo/visualizer-react/compare/v2.0.0...v2.0.1) (2018-10-26)
3
-
4
-
5
- ### Bug Fixes
6
-
7
- * allowFullScreen is a boolean ([349bdfd](https://github.com/cheminfo/visualizer-react/commit/349bdfd))
8
-
9
-
10
-
11
- <a name="2.0.0"></a>
12
- # [2.0.0](https://github.com/cheminfo/visualizer-react/compare/v1.1.10...v2.0.0) (2018-10-25)
13
-
14
-
15
- ### Features
16
-
17
- * upgrade to React 16 ([20ded14](https://github.com/cheminfo/visualizer-react/commit/20ded14))
18
-
19
-
20
- ### BREAKING CHANGES
21
-
22
- * Upgrade to React 16
23
-
24
-
25
-
26
- <a name="1.1.9"></a>
27
- ## [1.1.9](https://github.com/cheminfo/visualizer-react/compare/v1.1.8...v1.1.9) (2016-11-21)
28
-
29
-
30
-
31
- <a name="1.1.8"></a>
32
- ## [1.1.8](https://github.com/cheminfo/visualizer-react/compare/v1.1.7...v1.1.8) (2016-11-21)
33
-
34
-
35
- ### Bug Fixes
36
-
37
- * if version is head make it capital letter ([7e98a68](https://github.com/cheminfo/visualizer-react/commit/7e98a68))
38
-
39
-
40
-
41
- <a name="1.1.7"></a>
42
- ## [1.1.7](https://github.com/cheminfo/visualizer-react/compare/v1.1.6...v1.1.7) (2016-09-29)
43
-
44
-
45
-
46
- <a name="1.1.6"></a>
47
- ## [1.1.6](https://github.com/cheminfo/visualizer-react/compare/v1.1.5...v1.1.6) (2016-03-24)
48
-
49
-
50
-
51
- <a name="1.1.5"></a>
52
- ## [1.1.5](https://github.com/cheminfo/visualizer-react/compare/v1.1.4...v1.1.5) (2016-03-07)
53
-
54
-
55
- ### Bug Fixes
56
-
57
- * make versions lowercase to match version in url correctly ([be86793](https://github.com/cheminfo/visualizer-react/commit/be86793))
58
-
59
-
60
-
61
- <a name="1.1.4"></a>
62
- ## [1.1.4](https://github.com/cheminfo/visualizer-react/compare/v1.1.3...v1.1.4) (2016-03-03)
63
-
64
-
65
-
66
- <a name="1.1.3"></a>
67
- ## [1.1.3](https://github.com/cheminfo/visualizer-react/compare/v1.1.2...v1.1.3) (2016-03-03)
68
-
69
-
70
-
71
- <a name="1.1.2"></a>
72
- ## [1.1.2](https://github.com/cheminfo/visualizer-react/compare/v1.1.1...v1.1.2) (2016-03-02)
73
-
74
-
75
-
76
- <a name="1.1.1"></a>
77
- ## [1.1.1](https://github.com/cheminfo/visualizer-react/compare/v1.1.0...v1.1.1) (2016-03-02)
78
-
79
-
80
-
81
- <a name="1.1.0"></a>
82
- # [1.1.0](https://github.com/cheminfo/visualizer-react/compare/v1.0.6...v1.1.0) (2015-11-13)
83
-
84
-
85
-
86
- <a name="1.0.6"></a>
87
- ## [1.0.6](https://github.com/cheminfo/visualizer-react/compare/v1.0.5...v1.0.6) (2015-11-04)
88
-
89
-
90
-
91
- <a name="1.0.5"></a>
92
- ## [1.0.5](https://github.com/cheminfo/visualizer-react/compare/v1.0.4...v1.0.5) (2015-11-03)
93
-
94
-
95
-
96
- <a name="1.0.4"></a>
97
- ## [1.0.4](https://github.com/cheminfo/visualizer-react/compare/v1.0.3...v1.0.4) (2015-11-03)
98
-
99
-
100
-
101
- <a name="1.0.3"></a>
102
- ## [1.0.3](https://github.com/cheminfo/visualizer-react/compare/v1.0.2...v1.0.3) (2015-11-03)
103
-
104
-
105
-
106
- <a name="1.0.2"></a>
107
- ## [1.0.2](https://github.com/cheminfo/visualizer-react/compare/v1.0.1...v1.0.2) (2015-11-03)
108
-
109
-
110
-
111
- <a name="1.0.1"></a>
112
- ## [1.0.1](https://github.com/cheminfo/visualizer-react/compare/v1.0.0...v1.0.1) (2015-11-02)
113
-
114
-
115
-
116
- <a name="1.0.0"></a>
117
- # [1.0.0](https://github.com/cheminfo/visualizer-react/compare/v0.2.3...v1.0.0) (2015-11-02)
118
-
119
-
120
-
121
- <a name="0.2.3"></a>
122
- ## [0.2.3](https://github.com/cheminfo/visualizer-react/compare/v0.2.2...v0.2.3) (2015-09-17)
123
-
124
-
125
-
126
- <a name="0.2.2"></a>
127
- ## [0.2.2](https://github.com/cheminfo/visualizer-react/compare/v0.2.1...v0.2.2) (2015-08-25)
128
-
129
-
130
-
131
- <a name="0.2.1"></a>
132
- ## [0.2.1](https://github.com/cheminfo/visualizer-react/compare/v0.2.0...v0.2.1) (2015-07-28)
133
-
134
-
135
-
136
- <a name="0.2.0"></a>
137
- # [0.2.0](https://github.com/cheminfo/visualizer-react/compare/v0.1.2...v0.2.0) (2015-07-28)
138
-
139
-
140
-
141
- <a name="0.1.2"></a>
142
- ## [0.1.2](https://github.com/cheminfo/visualizer-react/compare/v0.1.1...v0.1.2) (2015-07-28)
143
-
144
-
145
-
146
- <a name="0.1.1"></a>
147
- ## [0.1.1](https://github.com/cheminfo/visualizer-react/compare/v0.1.0...v0.1.1) (2015-07-28)
148
-
149
-
150
-
151
- <a name="0.1.0"></a>
152
- # [0.1.0](https://github.com/cheminfo/visualizer-react/compare/v0.0.4...v0.1.0) (2015-07-28)
153
-
154
-
155
-
156
- <a name="0.0.4"></a>
157
- ## [0.0.4](https://github.com/cheminfo/visualizer-react/compare/v0.0.3...v0.0.4) (2015-06-22)
158
-
159
-
160
-
161
- <a name="0.0.3"></a>
162
- ## [0.0.3](https://github.com/cheminfo/visualizer-react/compare/v0.0.2...v0.0.3) (2015-06-22)
163
-
164
-
165
-
166
- <a name="0.0.2"></a>
167
- ## 0.0.2 (2015-06-22)
168
-
169
-
170
-
package/dist/onload.js DELETED
@@ -1,77 +0,0 @@
1
- // The contents of this file should be copied to visualizer.js as a string if modified
2
- // It is not used directly in the project
3
-
4
- 'use strict';
5
-
6
- window.onload = function () {
7
- var url;
8
- var uri = new URI(window.location.href);
9
- var search = uri.fragment(true);
10
- var version;
11
- if (search.viewURL) {
12
- url = search.viewURL;
13
- }
14
- if (search.v) {
15
- version = addVisualizer(search.v);
16
- return;
17
- }
18
- if (!version) {
19
- version = '{{ fallbackVersion }}';
20
- }
21
- if (!search.loadversion || !url) {
22
- addVisualizer(version);
23
- } else {
24
- var viewReg = new RegExp('/view.json$');
25
- var docUrl = url.replace(viewReg, '');
26
- tryAjax(docUrl).then(function (data) {
27
- if (!data.version && (!data.$content || !data.$content.version)) throw new Error();
28
- return data;
29
- }).catch(function () {
30
- return tryAjax(url);
31
- }).then(function (data) {
32
- addVisualizer(data.version || data.$content.version);
33
- }).catch(function () {
34
- console.error('Could not load version');
35
- });
36
- }
37
-
38
- function addVisualizer(version) {
39
- var cdn = '{{ cdn }}';
40
- var visualizer = document.createElement('script');
41
- var prefix = cdn;
42
- var datamain = prefix + '/' + version + '/init';
43
- var requirejs = prefix + '/' + version + '/components/requirejs/require.js';
44
-
45
- visualizer.setAttribute('data-main', datamain);
46
- visualizer.setAttribute('src', requirejs);
47
- document.head.appendChild(visualizer);
48
- }
49
-
50
- function tryAjax(url) {
51
- return new Promise(function (resolve, reject) {
52
- $.ajax({
53
- url: url,
54
- dataType: 'json',
55
- type: 'GET',
56
- success: function success(data) {
57
- resolve(data);
58
- },
59
- error: function error() {
60
- $.ajax({
61
- url: url,
62
- dataType: 'json',
63
- type: 'GET',
64
- success: function success(data) {
65
- resolve(data);
66
- },
67
- error: function error(err) {
68
- console.error('load version error', err);
69
- reject(err);
70
- }
71
- });
72
- },
73
- xhrFields: { withCredentials: true }
74
- });
75
- });
76
- }
77
- };