@symbo.ls/atoms 1.2.16 → 1.2.20
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/Svg.js +11 -9
- package/package.json +2 -2
package/Svg.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { init } from '@symbo.ls/init'
|
|
3
|
+
// import { init } from '@symbo.ls/init'
|
|
4
4
|
|
|
5
5
|
// create SVG symbol
|
|
6
6
|
export const Svg = {
|
|
@@ -17,23 +17,25 @@ export const Svg = {
|
|
|
17
17
|
const useSvgSprite = props.spriteId || (context.system && context.system.useSvgSprite)
|
|
18
18
|
const useSVGSymbol = icon => `<use xlink:href="#${icon}" />`
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const { init } = require('@symbo.ls/init')
|
|
21
|
+
|
|
22
|
+
if (!useSvgSprite && props.src) return props.src
|
|
23
|
+
|
|
24
|
+
const spriteId = props.spriteId
|
|
23
25
|
if (spriteId) return useSVGSymbol(spriteId)
|
|
24
|
-
|
|
26
|
+
|
|
25
27
|
const symbolId = Symbol.for(props.src)
|
|
26
28
|
let SVGKey = SVG[symbolId]
|
|
27
29
|
if (SVGKey && SVG[SVGKey]) return useSVGSymbol(SVGKey)
|
|
28
|
-
|
|
30
|
+
|
|
29
31
|
SVGKey = SVG[symbolId] = Math.random()
|
|
30
|
-
|
|
31
|
-
svg: { [SVGKey]: props.src }
|
|
32
|
+
init({
|
|
33
|
+
svg: { [SVGKey]: props.src }
|
|
32
34
|
}, null, {
|
|
33
35
|
document: context.document,
|
|
34
36
|
emotion: context.emotion
|
|
35
37
|
})
|
|
36
|
-
|
|
38
|
+
|
|
37
39
|
return useSVGSymbol(SVGKey)
|
|
38
40
|
}
|
|
39
41
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/atoms",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "b63f1feeaceb4cd5257bca1bee630dd3b28f5cd2",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@domql/utils": "latest",
|
|
9
9
|
"@symbo.ls/create-emotion": "latest",
|