@symbo.ls/init 2.11.450 → 2.11.453
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 +12 -7
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -17,8 +17,8 @@ import DYNAMIC_JSON from './dynamic.json'
|
|
|
17
17
|
|
|
18
18
|
const CONFIG = getActiveConfig()
|
|
19
19
|
|
|
20
|
-
const mergeWithLocalFile = (config = CONFIG,
|
|
21
|
-
const rcfile = isObject(
|
|
20
|
+
const mergeWithLocalFile = (config = CONFIG, options) => {
|
|
21
|
+
const rcfile = isObject(options.localFile) ? options.localFile : DYNAMIC_JSON || {}
|
|
22
22
|
const clonedFile = deepClone(rcfile.designSystem || {})
|
|
23
23
|
return deepMerge(config, clonedFile)
|
|
24
24
|
}
|
|
@@ -35,7 +35,7 @@ const SET_OPTIONS = {
|
|
|
35
35
|
|
|
36
36
|
export const init = (config, options = SET_OPTIONS) => {
|
|
37
37
|
const emotion = options.emotion || defaultEmotion
|
|
38
|
-
const resultConfig = mergeWithLocalFile(config || {})
|
|
38
|
+
const resultConfig = mergeWithLocalFile(config || {}, options)
|
|
39
39
|
|
|
40
40
|
const conf = set({
|
|
41
41
|
verbose: options.verbose,
|
|
@@ -76,15 +76,20 @@ const UPDATE_OPTIONS = {
|
|
|
76
76
|
emotion: defaultEmotion
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
export const
|
|
79
|
+
export const reinit = (config, options = UPDATE_OPTIONS) => {
|
|
80
80
|
const emotion = options.emotion || defaultEmotion
|
|
81
|
-
const resultConfig = mergeWithLocalFile(config || {},
|
|
81
|
+
const resultConfig = mergeWithLocalFile(config || {}, options)
|
|
82
|
+
const prevStyles = document.querySelector('[data-emotion="smbls"]')
|
|
83
|
+
console.log(prevStyles)
|
|
82
84
|
const conf = set({
|
|
83
85
|
verbose: false,
|
|
84
86
|
...resultConfig
|
|
85
87
|
})
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
if (!options.preventInject) {
|
|
89
|
+
emotion.injectGlobal({ ':root': conf.CSS_VARS })
|
|
90
|
+
emotion.injectGlobal(conf.RESET)
|
|
91
|
+
}
|
|
92
|
+
return conf
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
export const applyCSS = (styles, options = UPDATE_OPTIONS) => {
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/init",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.453",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"gitHead": "
|
|
5
|
+
"gitHead": "8e5458a957b9d2c75944023e2c31bab157034314",
|
|
6
6
|
"source": "index.js",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@domql/utils": "^2.5.0",
|
|
10
|
-
"@symbo.ls/default-config": "^2.11.
|
|
11
|
-
"@symbo.ls/emotion": "^2.11.
|
|
12
|
-
"@symbo.ls/scratch": "^2.11.
|
|
10
|
+
"@symbo.ls/default-config": "^2.11.453",
|
|
11
|
+
"@symbo.ls/emotion": "^2.11.453",
|
|
12
|
+
"@symbo.ls/scratch": "^2.11.453"
|
|
13
13
|
},
|
|
14
14
|
"browserslist": "> 0.5%, last 2 versions, not dead",
|
|
15
15
|
"devDependencies": {
|