@symbo.ls/init 1.1.7 → 1.1.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/init",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "license": "MIT",
5
5
  "gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
6
6
  "source": "src/index.js",
package/src/index.js CHANGED
@@ -2,41 +2,41 @@
2
2
 
3
3
  import {
4
4
  set,
5
- FONT,
6
5
  RESET,
7
6
  getFontFaceString,
8
7
  CONFIG
9
8
  } from '@symbo.ls/scratch'
10
9
 
11
- import { deepMerge, isObject } from '@domql/utils'
10
+ import { isObject, deepMerge } from '@domql/utils'
11
+ import { initDOMQLEmotion } from 'domql/packages/emotion'
12
12
 
13
- import CONFIG_DEFAULT from '@symbo.ls/config-default'
14
- import SYMBOLSRC_FILE from '../.symbolsrc.json'
13
+ import { emotion } from '@symbo.ls/create-emotion'
14
+ import { setClassname } from 'css-in-props'
15
15
 
16
16
  import DYNAMIC_JSON from './dynamic.json'
17
17
 
18
- import createEmotion from '@symbo.ls/create-emotion'
19
- import { setClassname } from 'css-in-props'
20
-
21
- const { css, injectGlobal } = createEmotion
18
+ const prepareInit = (config = {}, RC_FILE) => {
19
+ // const defaultConfig = merge(config, CONFIG_DEFAULT)
20
+ const rcfile = isObject(RC_FILE) ? RC_FILE : DYNAMIC_JSON || {}
21
+ return deepMerge(config, rcfile)
22
+ }
22
23
 
23
- export const init = (config, RC_FILE, options = { emotion: createEmotion }) => {
24
- const defaultConfig = config || CONFIG_DEFAULT || SYMBOLSRC_FILE
24
+ export const init = (config, RC_FILE, options = { emotion }) => {
25
+ initDOMQLEmotion(options.emotion)
25
26
 
26
- const rcfile = isObject(RC_FILE) ? RC_FILE : DYNAMIC_JSON
27
- const resultConfig = deepMerge(rcfile, defaultConfig)
27
+ const resultConfig = prepareInit(config)
28
28
 
29
29
  const conf = set({ verbose: false, ...resultConfig })
30
- const FontFace = getFontFaceString(FONT)
30
+ const FontFace = getFontFaceString(conf.FONT)
31
31
 
32
- injectGlobal(FontFace)
33
- if (conf.useReset) injectGlobal(RESET)
32
+ options.emotion.injectGlobal(FontFace)
33
+ if (conf.useReset) options.emotion.injectGlobal(conf.RESET)
34
34
 
35
35
  return conf
36
36
  }
37
37
 
38
- export const updateReset = () => injectGlobal(RESET)
38
+ export const updateReset = (options = { emotion }) => options.emotion.injectGlobal(RESET)
39
39
 
40
- export const setClass = props => setClassname(props, css)
40
+ export const setClass = (props, options = { emotion }) => setClassname(props, options.emotion.css)
41
41
 
42
42
  export { CONFIG }
package/.symbolsrc.json DELETED
@@ -1 +0,0 @@
1
- {"version":"0.0.1","COLOR":{"transparent":"rgba(0, 0, 0, 0)","black":"black","blue":"#0079FD","indigo":"#50E1FF","green":"#59AC56","red":"#FE5B47","yellow":"#EDCB38","orange":"#E2862F","brown":"#7D6755","pink":"#FD8ABF","purple":"#7345AF","white":"white"},"GRADIENT":{"gradient-dark":"linear-gradient(0deg,\n rgba(0,0,0,0.06) 0%,\n rgba(0,0,0,0.07) 100%\n )","gradient-dark-active":"linear-gradient(0deg,\n rgba(0,0,0,0.09) 0%,\n rgba(0,0,0,0.1) 100%\n )","gradient-light":"linear-gradient(\n 0deg,\n rgba(255,255,255,0.05) 0%,\n rgba(255,255,255,0.06) 100%\n )","gradient-light-active":"linear-gradient(\n 0deg,\n rgba(255,255,255,0.09) 0%,\n rgba(255,255,255,0.10) 100%\n )"},"THEME":{"document":{"variants":{"light":{"color":"black","background":"white"},"dark":{"color":"white","background":"black"}}},"primary":{"color":"white","background":"blue"},"secondary":{"variants":{"light":{"color":"white","background":"gradient-light"},"dark":{"color":"white","background":"gradient-dark-active"}}}},"FONT":{"Karla":[{"url":"https://symbols-fonts.s3.us-west-1.amazonaws.com/Karla/Karla-VariableFont_wght.ttf","fontWeight":"variable","fontStyle":"normal","fontDisplay":"swap","unicodeRange":"U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF"},{"url":"https://symbols-fonts.s3.us-west-1.amazonaws.com/Karla/Karla-VariableFont_wght.ttf","fontStyle":"normal","fontWeight":"variable","fontDisplay":"swap","unicodeRange":"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"}]},"FONT_FAMILY":{"StartWithKarla":{"default":true,"value":["\"Karla\""],"type":"serif"}}}