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 +4 -3
- package/lib/icon.js +9 -3
- package/lib/x4dom.d.ts +29 -1
- package/lib/x4dom.js +27 -2
- package/lib/x4events.d.ts +1 -1
- package/lib/x4events.js +1 -1
- package/package.json +1 -1
- package/src/icon.ts +9 -4
package/README.md
CHANGED
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
package/lib/x4events.js
CHANGED
package/package.json
CHANGED
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
}
|