@symbo.ls/init 1.1.8 → 1.1.9
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/package.json +1 -1
- package/src/index.js +11 -7
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
set,
|
|
5
|
-
|
|
6
|
-
getFontFaceString
|
|
7
|
-
CONFIG
|
|
5
|
+
getActiveConfig,
|
|
6
|
+
getFontFaceString
|
|
8
7
|
} from '@symbo.ls/scratch'
|
|
9
8
|
|
|
10
9
|
import { isObject, deepMerge } from '@domql/utils'
|
|
@@ -15,18 +14,20 @@ import { setClassname } from 'css-in-props'
|
|
|
15
14
|
|
|
16
15
|
import DYNAMIC_JSON from './dynamic.json'
|
|
17
16
|
|
|
17
|
+
const CONFIG = getActiveConfig()
|
|
18
|
+
|
|
18
19
|
const prepareInit = (config = {}, RC_FILE) => {
|
|
19
20
|
// const defaultConfig = merge(config, CONFIG_DEFAULT)
|
|
20
21
|
const rcfile = isObject(RC_FILE) ? RC_FILE : DYNAMIC_JSON || {}
|
|
21
22
|
return deepMerge(config, rcfile)
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
export const init = (config, RC_FILE, options = { emotion }) => {
|
|
25
|
-
initDOMQLEmotion(options.emotion)
|
|
25
|
+
export const init = (config, RC_FILE, options = { emotion, initDOMQLDefine: true }) => {
|
|
26
|
+
if (options.initDOMQLDefine) initDOMQLEmotion(options.emotion, options)
|
|
26
27
|
|
|
27
28
|
const resultConfig = prepareInit(config)
|
|
28
29
|
|
|
29
|
-
const conf = set({ verbose: false, ...resultConfig })
|
|
30
|
+
const conf = set({ verbose: false, ...resultConfig }, { newConfig: options.newConfig })
|
|
30
31
|
const FontFace = getFontFaceString(conf.FONT)
|
|
31
32
|
|
|
32
33
|
options.emotion.injectGlobal(FontFace)
|
|
@@ -35,7 +36,10 @@ export const init = (config, RC_FILE, options = { emotion }) => {
|
|
|
35
36
|
return conf
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
export const updateReset = (options = { emotion }) =>
|
|
39
|
+
export const updateReset = (options = { emotion }) => {
|
|
40
|
+
const CONFIG = getActiveConfig()
|
|
41
|
+
options.emotion.injectGlobal(CONFIG.RESET)
|
|
42
|
+
}
|
|
39
43
|
|
|
40
44
|
export const setClass = (props, options = { emotion }) => setClassname(props, options.emotion.css)
|
|
41
45
|
|