@symbo.ls/init 2.6.7 → 2.6.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 +2 -3
- package/src/index.js +18 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/init",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
|
|
6
6
|
"source": "src/index.js",
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"@domql/utils": "latest",
|
|
33
33
|
"@symbo.ls/config-default": "latest",
|
|
34
34
|
"@symbo.ls/create-emotion": "latest",
|
|
35
|
-
"@symbo.ls/scratch": "latest"
|
|
36
|
-
"css-in-props": "latest"
|
|
35
|
+
"@symbo.ls/scratch": "latest"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@babel/core": "^7.18.10",
|
package/src/index.js
CHANGED
|
@@ -10,28 +10,39 @@ import { isObject, deepMerge } from '@domql/utils'
|
|
|
10
10
|
import { initDOMQLEmotion } from 'domql/packages/emotion'
|
|
11
11
|
|
|
12
12
|
import { emotion } from '@symbo.ls/create-emotion'
|
|
13
|
-
import { setClassname } from 'css-in-props'
|
|
13
|
+
// import { setClassname } from 'css-in-props'
|
|
14
14
|
|
|
15
15
|
import DYNAMIC_JSON from './dynamic.json'
|
|
16
16
|
|
|
17
17
|
const CONFIG = getActiveConfig()
|
|
18
18
|
|
|
19
19
|
const prepareInit = (config = {}, RC_FILE) => {
|
|
20
|
-
// const defaultConfig = merge(config, CONFIG_DEFAULT)
|
|
21
20
|
const rcfile = isObject(RC_FILE) ? RC_FILE : DYNAMIC_JSON || {}
|
|
22
21
|
return deepMerge(config, rcfile)
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
const SET_OPTIONS = {
|
|
25
|
+
emotion,
|
|
26
|
+
useVariable: true,
|
|
27
|
+
useReset: true,
|
|
28
|
+
initDOMQLDefine: true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const init = (config, RC_FILE, options = SET_OPTIONS) => {
|
|
26
32
|
if (options.initDOMQLDefine) initDOMQLEmotion(options.emotion, options)
|
|
27
33
|
|
|
28
|
-
const resultConfig = prepareInit(config)
|
|
34
|
+
const resultConfig = prepareInit(config, RC_FILE)
|
|
35
|
+
|
|
36
|
+
const conf = set({
|
|
37
|
+
verbose: false,
|
|
38
|
+
useReset: options.useReset,
|
|
39
|
+
...resultConfig
|
|
40
|
+
}, { newConfig: options.newConfig })
|
|
29
41
|
|
|
30
|
-
const conf = set({ verbose: false, ...resultConfig }, { newConfig: options.newConfig })
|
|
31
42
|
const FontFace = getFontFaceString(conf.FONT)
|
|
32
43
|
|
|
33
44
|
options.emotion.injectGlobal(FontFace)
|
|
34
|
-
if (
|
|
45
|
+
if (options.useReset) options.emotion.injectGlobal(conf.RESET)
|
|
35
46
|
|
|
36
47
|
return conf
|
|
37
48
|
}
|
|
@@ -41,6 +52,6 @@ export const updateReset = (options = { emotion }) => {
|
|
|
41
52
|
options.emotion.injectGlobal(CONFIG.RESET)
|
|
42
53
|
}
|
|
43
54
|
|
|
44
|
-
export const setClass = (props, options = { emotion }) => setClassname(props, options.emotion.css)
|
|
55
|
+
export const setClass = (props, options = { emotion }) => {}// setClassname(props, options.emotion.css)
|
|
45
56
|
|
|
46
57
|
export { CONFIG }
|