x4js 1.4.20 → 1.4.21

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/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # x4
2
- x4 framework repository
1
+ # x4js
3
2
 
4
- You will find the documentation & tutorials [Here](https://github.com/rlibre/x4js/wiki/Introduction)
3
+ **x4js framework repository**
4
+
5
+ You will find the documentation & tutorials [Here](https://x4js.org)
package/lib/icon.js CHANGED
@@ -75,9 +75,15 @@ class Loader extends x4events_1.EventSource {
75
75
  const r = await fetch(url);
76
76
  if (r.ok) {
77
77
  const svg = await r.text();
78
- this.svgs.set(url, svg);
79
- //console.log( 'signal=', url );
80
- this.signal('loaded', EvLoaded(url, svg));
78
+ // check response, must be svg
79
+ if (!svg.startsWith("<svg")) {
80
+ console.error("svg loading error: ", svg);
81
+ this.signal('loaded', EvLoaded(url, ""));
82
+ }
83
+ else {
84
+ this.svgs.set(url, svg);
85
+ this.signal('loaded', EvLoaded(url, svg));
86
+ }
81
87
  }
82
88
  }
83
89
  };
package/lib/x4dom.d.ts CHANGED
@@ -1,5 +1,33 @@
1
1
  /**
2
- *
2
+ * ___ ___ __
3
+ * \ \_/ / / _
4
+ * \ / /_| |_
5
+ * / _ \____ _|
6
+ * /__/ \__\ |_|
7
+ *
8
+ * @file x4events.ts
9
+ * @author Etienne Cochard
10
+ *
11
+ * Copyright (c) 2019-2022 R-libre ingenierie
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
+ * of the Software, and to permit persons to whom the Software is furnished to do so,
18
+ * subject to the following conditions:
19
+ * The above copyright notice and this permission notice shall be included in all copies
20
+ * or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ **/
29
+ /**
30
+ * SSR preparation
3
31
  */
4
32
  interface IX4Document {
5
33
  createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];
package/lib/x4dom.js CHANGED
@@ -1,7 +1,32 @@
1
1
  "use strict";
2
2
  /**
3
- *
4
- */
3
+ * ___ ___ __
4
+ * \ \_/ / / _
5
+ * \ / /_| |_
6
+ * / _ \____ _|
7
+ * /__/ \__\ |_|
8
+ *
9
+ * @file x4events.ts
10
+ * @author Etienne Cochard
11
+ *
12
+ * Copyright (c) 2019-2022 R-libre ingenierie
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ * of this software and associated documentation files (the "Software"), to deal
16
+ * in the Software without restriction, including without limitation the rights
17
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
18
+ * of the Software, and to permit persons to whom the Software is furnished to do so,
19
+ * subject to the following conditions:
20
+ * The above copyright notice and this permission notice shall be included in all copies
21
+ * or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
24
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
25
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
+ **/
5
30
  Object.defineProperty(exports, "__esModule", { value: true });
6
31
  exports.x4document = void 0;
7
32
  exports.x4document = document;
package/lib/x4events.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * / _ \____ _|
6
6
  * /__/ \__\ |_|
7
7
  *
8
- * @file observable.ts
8
+ * @file x4events.ts
9
9
  * @author Etienne Cochard
10
10
  *
11
11
  * Copyright (c) 2019-2022 R-libre ingenierie
package/lib/x4events.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * / _ \____ _|
7
7
  * /__/ \__\ |_|
8
8
  *
9
- * @file observable.ts
9
+ * @file x4events.ts
10
10
  * @author Etienne Cochard
11
11
  *
12
12
  * Copyright (c) 2019-2022 R-libre ingenierie
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "1.4.20",
3
+ "version": "1.4.21",
4
4
  "description": "X4js core files",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/icon.ts CHANGED
@@ -100,10 +100,15 @@ class Loader extends EventSource<LoadingEventMap> {
100
100
  const r = await fetch( url );
101
101
  if( r.ok ) {
102
102
  const svg = await r.text();
103
- this.svgs.set( url, svg );
104
-
105
- //console.log( 'signal=', url );
106
- this.signal( 'loaded', EvLoaded(url,svg) );
103
+ // check response, must be svg
104
+ if( !svg.startsWith("<svg") ) {
105
+ console.error( "svg loading error: ", svg );
106
+ this.signal( 'loaded', EvLoaded(url,"") );
107
+ }
108
+ else {
109
+ this.svgs.set( url, svg );
110
+ this.signal( 'loaded', EvLoaded(url,svg) );
111
+ }
107
112
  }
108
113
  }
109
114
  }