dwv 0.30.3 → 0.30.4

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/changelog.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.30.4](https://github.com/ivmartel/dwv/releases/tag/v0.30.4) - 10/12/2021
4
+
5
+ ### Fixed
6
+
7
+ - Load i18next plugins as modules [#1057](https://github.com/ivmartel/dwv/issues/1057)
8
+ - Update overlays after event data change [#1056](https://github.com/ivmartel/dwv/issues/1056)
9
+
10
+ ### Dependencies
11
+
12
+ - Replace i18next-xhr-backend with i18next-http-backend [#1049](https://github.com/ivmartel/dwv/issues/1049)
13
+
14
+ ---
15
+
3
16
  ## [v0.30.3](https://github.com/ivmartel/dwv/releases/tag/v0.30.3) - 09/12/2021
4
17
 
5
18
  ### Fixed
package/dist/dwv.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! dwv 0.30.3 2021-12-09 16:13:34 */
1
+ /*! dwv 0.30.4 2021-12-10 19:20:41 */
2
2
  // Inspired from umdjs
3
3
  // See https://github.com/umdjs/umd/blob/master/templates/returnExports.js
4
4
  (function (root, factory) {
@@ -6,7 +6,7 @@
6
6
  // AMD. Register as an anonymous module.
7
7
  define([
8
8
  'i18next',
9
- 'i18next-xhr-backend',
9
+ 'i18next-http-backend',
10
10
  'i18next-browser-languagedetector',
11
11
  'jszip',
12
12
  'konva',
@@ -17,11 +17,10 @@
17
17
  // only CommonJS-like environments that support module.exports,
18
18
  // like Node.
19
19
 
20
- // i18next-xhr-backend: requires XMlHttpRequest
21
20
  // Konva: requires 'canvas'
22
21
  module.exports = factory(
23
22
  require('i18next'),
24
- require('i18next-xhr-backend'),
23
+ require('i18next-http-backend'),
25
24
  require('i18next-browser-languagedetector'),
26
25
  require('jszip'),
27
26
  require('konva/cmj'),
@@ -31,7 +30,7 @@
31
30
  // Browser globals (root is window)
32
31
  root.dwv = factory(
33
32
  root.i18next,
34
- root.i18nextXHRBackend,
33
+ root.i18nextHttpBackend,
35
34
  root.i18nextBrowserLanguageDetector,
36
35
  root.JSZip,
37
36
  root.Konva,
@@ -40,7 +39,7 @@
40
39
  }
41
40
  }(this, function (
42
41
  i18next,
43
- i18nextXHRBackend,
42
+ i18nextHttpBackend,
44
43
  i18nextBrowserLanguageDetector,
45
44
  JSZip,
46
45
  Konva,
@@ -49,20 +48,27 @@
49
48
  // similar to what browserify does but reversed
50
49
  // https://www.contentful.com/blog/2017/01/17/the-global-object-in-javascript/
51
50
  var window = typeof window !== 'undefined' ?
52
- window : typeof self !== 'undefined' ?
53
- self : typeof global !== 'undefined' ?
54
- global : {};
55
-
56
- // latest i18next (>v17) does not export default
57
- // see #862 and https://github.com/i18next/i18next/commit/7c6c235
58
- if (typeof i18next !== 'undefined' &&
59
- typeof i18next.t === 'undefined') {
51
+ window : typeof self !== 'undefined' ?
52
+ self : typeof global !== 'undefined' ?
53
+ global : {};
54
+
55
+ // if it has a default, treat it as ESM
56
+ var isEsmModule = function (mod) {
57
+ return typeof mod !== 'undefined' &&
58
+ typeof mod.default !== 'undefined';
59
+ }
60
+ // i18next (>v17) comes as a module, see #862
61
+ if (isEsmModule(i18next)) {
60
62
  i18next = i18next.default;
61
63
  }
62
-
64
+ if (isEsmModule(i18nextHttpBackend)) {
65
+ i18nextHttpBackend = i18nextHttpBackend.default;
66
+ }
67
+ if (isEsmModule(i18nextBrowserLanguageDetector)) {
68
+ i18nextBrowserLanguageDetector = i18nextBrowserLanguageDetector.default;
69
+ }
63
70
  // Konva (>=v8) comes as a module, see #1044
64
- if (typeof Konva !== 'undefined' &&
65
- typeof Konva.Group === 'undefined') {
71
+ if (isEsmModule(Konva)) {
66
72
  Konva = Konva.default;
67
73
  }
68
74
 
@@ -4398,7 +4404,7 @@ dwv.dicom = dwv.dicom || {};
4398
4404
  * @returns {string} The version of the library.
4399
4405
  */
4400
4406
  dwv.getVersion = function () {
4401
- return '0.30.3';
4407
+ return '0.30.4';
4402
4408
  };
4403
4409
 
4404
4410
  /**
@@ -32351,12 +32357,12 @@ var dwv = dwv || {};
32351
32357
  */
32352
32358
  var i18next = i18next || {};
32353
32359
  /**
32354
- * The i18nextXHRBackend namespace.
32360
+ * The i18nextHttpBackend namespace.
32355
32361
  *
32356
- * @external i18nextXHRBackend
32357
- * @see https://github.com/i18next/i18next-xhr-backend
32362
+ * @external i18nextHttpBackend
32363
+ * @see https://github.com/i18next/i18next-http-backend
32358
32364
  */
32359
- var i18nextXHRBackend = i18nextXHRBackend || {};
32365
+ var i18nextHttpBackend = i18nextHttpBackend || {};
32360
32366
  /**
32361
32367
  * The i18nextBrowserLanguageDetector namespace.
32362
32368
  *
@@ -32390,8 +32396,8 @@ dwv.i18nInitialise = function (language, localesPath) {
32390
32396
  load: 'languageOnly',
32391
32397
  backend: {loadPath: lpath + '/locales/{{lng}}/{{ns}}.json'}
32392
32398
  };
32393
- // use the XHR backend to get translation files
32394
- var i18n = i18next.use(i18nextXHRBackend);
32399
+ // use the HTTP backend to get translation files
32400
+ var i18n = i18next.use(i18nextHttpBackend);
32395
32401
  // use browser language or the specified one
32396
32402
  if (lng === 'auto') {
32397
32403
  i18n.use(i18nextBrowserLanguageDetector);