@symbo.ls/init 3.1.1 → 3.2.3
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/index.js +23 -16
- package/package.json +7 -6
package/index.js
CHANGED
|
@@ -13,12 +13,14 @@ import { isObject, deepMerge, deepClone } from '@domql/utils'
|
|
|
13
13
|
import { emotion as defaultEmotion } from '@symbo.ls/emotion'
|
|
14
14
|
// import { setClassname } from 'css-in-props'
|
|
15
15
|
|
|
16
|
-
import DYNAMIC_JSON from './dynamic.json'
|
|
16
|
+
import DYNAMIC_JSON from './dynamic.json' with { type: 'json' }
|
|
17
17
|
|
|
18
18
|
const CONFIG = getActiveConfig()
|
|
19
19
|
|
|
20
20
|
const mergeWithLocalFile = (config = CONFIG, options) => {
|
|
21
|
-
const rcfile = isObject(options.localFile)
|
|
21
|
+
const rcfile = isObject(options.localFile)
|
|
22
|
+
? options.localFile
|
|
23
|
+
: DYNAMIC_JSON || {}
|
|
22
24
|
const clonedFile = deepClone(rcfile.designSystem || {})
|
|
23
25
|
return deepMerge(config, clonedFile)
|
|
24
26
|
}
|
|
@@ -37,17 +39,20 @@ export const init = (config, options = SET_OPTIONS) => {
|
|
|
37
39
|
const emotion = options.emotion || defaultEmotion
|
|
38
40
|
const resultConfig = mergeWithLocalFile(config || {}, options)
|
|
39
41
|
|
|
40
|
-
const conf = set(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const conf = set(
|
|
43
|
+
{
|
|
44
|
+
verbose: options.verbose,
|
|
45
|
+
useReset: options.useReset,
|
|
46
|
+
useFontImport: options.useFontImport,
|
|
47
|
+
useVariable: options.useVariable,
|
|
48
|
+
useSvgSprite: options.useSvgSprite,
|
|
49
|
+
useDocumentTheme: options.useDocumentTheme,
|
|
50
|
+
useIconSprite: options.useIconSprite,
|
|
51
|
+
useDefaultConfig: options.useDefaultConfig,
|
|
52
|
+
...resultConfig
|
|
53
|
+
},
|
|
54
|
+
{ newConfig: options.newConfig }
|
|
55
|
+
)
|
|
51
56
|
|
|
52
57
|
const FontFace = getFontFaceString(conf.FONT)
|
|
53
58
|
|
|
@@ -64,10 +69,12 @@ export const init = (config, options = SET_OPTIONS) => {
|
|
|
64
69
|
if (useReset) emotion.injectGlobal(conf.RESET)
|
|
65
70
|
|
|
66
71
|
if (hasSvgs) appendSVGSprite(hasSvgs, { document: options.document })
|
|
67
|
-
else if (useSvgSprite)
|
|
72
|
+
else if (useSvgSprite)
|
|
73
|
+
appendSVGSprite(conf.SVG, { document: options.document })
|
|
68
74
|
|
|
69
75
|
if (hasIcons) appendSvgIconsSprite(hasIcons, { document: options.document })
|
|
70
|
-
else if (useIconSprite)
|
|
76
|
+
else if (useIconSprite)
|
|
77
|
+
appendSvgIconsSprite(conf.ICONS, { document: options.document })
|
|
71
78
|
|
|
72
79
|
return conf
|
|
73
80
|
}
|
|
@@ -102,6 +109,6 @@ export const updateVars = (config, options = UPDATE_OPTIONS) => {
|
|
|
102
109
|
emotion.injectGlobal({ ':root': config.CSS_VARS })
|
|
103
110
|
}
|
|
104
111
|
|
|
105
|
-
export const setClass = (props, options = UPDATE_OPTIONS) => {}// setClassname(props, options.emotion.css)
|
|
112
|
+
export const setClass = (props, options = UPDATE_OPTIONS) => {} // setClassname(props, options.emotion.css)
|
|
106
113
|
|
|
107
114
|
export { DYNAMIC_JSON }
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/init",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"gitHead": "
|
|
5
|
+
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
6
6
|
"source": "index.js",
|
|
7
7
|
"main": "index.js",
|
|
8
|
+
"type": "module",
|
|
8
9
|
"dependencies": {
|
|
9
|
-
"@domql/utils": "^3.
|
|
10
|
-
"@symbo.ls/default-config": "^3.
|
|
11
|
-
"@symbo.ls/emotion": "^3.
|
|
12
|
-
"@symbo.ls/scratch": "^3.
|
|
10
|
+
"@domql/utils": "^3.2.3",
|
|
11
|
+
"@symbo.ls/default-config": "^3.2.3",
|
|
12
|
+
"@symbo.ls/emotion": "^3.2.3",
|
|
13
|
+
"@symbo.ls/scratch": "^3.2.3"
|
|
13
14
|
},
|
|
14
15
|
"browserslist": "> 0.5%, last 2 versions, not dead",
|
|
15
16
|
"devDependencies": {
|