smbls 3.4.0 → 3.4.2

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.
@@ -73,7 +73,7 @@ const init = (config, options = SET_OPTIONS) => {
73
73
  },
74
74
  { newConfig: options.newConfig }
75
75
  );
76
- const FontFace = (0, import_scratch.getFontFaceString)(conf.FONT);
76
+ const FontFace = (0, import_scratch.getFontFaceString)(conf.font || conf.FONT);
77
77
  const useReset = conf.useReset;
78
78
  const useVariable = conf.useVariable;
79
79
  const useFontImport = conf.useFontImport;
@@ -83,20 +83,19 @@ const init = (config, options = SET_OPTIONS) => {
83
83
  const hasIcons = config.icons || config.ICONS;
84
84
  if (useFontImport) emotion.injectGlobal(FontFace);
85
85
  if (useVariable) emotion.injectGlobal({ ":root": conf.CSS_VARS });
86
- if (useReset) emotion.injectGlobal(conf.RESET);
87
- if (conf.ANIMATION) {
86
+ if (useReset) emotion.injectGlobal(conf.reset || conf.RESET);
87
+ const animations = conf.animation || conf.ANIMATION;
88
+ if (animations) {
88
89
  const keyframesCSS = {};
89
- for (const name in conf.ANIMATION) {
90
- keyframesCSS[`@keyframes ${name}`] = conf.ANIMATION[name];
90
+ for (const name in animations) {
91
+ keyframesCSS[`@keyframes ${name}`] = animations[name];
91
92
  }
92
93
  emotion.injectGlobal(keyframesCSS);
93
94
  }
94
- if (hasSvgs) (0, import_scratch.appendSVGSprite)(hasSvgs, { document: options.document });
95
- else if (useSvgSprite)
96
- (0, import_scratch.appendSVGSprite)(conf.SVG, { document: options.document });
97
- if (hasIcons) (0, import_scratch.appendSvgIconsSprite)(hasIcons, { document: options.document });
98
- else if (useIconSprite)
99
- (0, import_scratch.appendSvgIconsSprite)(conf.ICONS, { document: options.document });
95
+ if (hasSvgs || useSvgSprite)
96
+ (0, import_scratch.appendSVGSprite)(conf.svg || conf.SVG, { document: options.document });
97
+ if (hasIcons || useIconSprite)
98
+ (0, import_scratch.appendSvgIconsSprite)(conf.icons || conf.ICONS, { document: options.document });
100
99
  return conf;
101
100
  };
102
101
  const UPDATE_OPTIONS = {
@@ -41,7 +41,7 @@ const init = (config, options = SET_OPTIONS) => {
41
41
  },
42
42
  { newConfig: options.newConfig }
43
43
  );
44
- const FontFace = getFontFaceString(conf.FONT);
44
+ const FontFace = getFontFaceString(conf.font || conf.FONT);
45
45
  const useReset = conf.useReset;
46
46
  const useVariable = conf.useVariable;
47
47
  const useFontImport = conf.useFontImport;
@@ -51,20 +51,19 @@ const init = (config, options = SET_OPTIONS) => {
51
51
  const hasIcons = config.icons || config.ICONS;
52
52
  if (useFontImport) emotion.injectGlobal(FontFace);
53
53
  if (useVariable) emotion.injectGlobal({ ":root": conf.CSS_VARS });
54
- if (useReset) emotion.injectGlobal(conf.RESET);
55
- if (conf.ANIMATION) {
54
+ if (useReset) emotion.injectGlobal(conf.reset || conf.RESET);
55
+ const animations = conf.animation || conf.ANIMATION;
56
+ if (animations) {
56
57
  const keyframesCSS = {};
57
- for (const name in conf.ANIMATION) {
58
- keyframesCSS[`@keyframes ${name}`] = conf.ANIMATION[name];
58
+ for (const name in animations) {
59
+ keyframesCSS[`@keyframes ${name}`] = animations[name];
59
60
  }
60
61
  emotion.injectGlobal(keyframesCSS);
61
62
  }
62
- if (hasSvgs) appendSVGSprite(hasSvgs, { document: options.document });
63
- else if (useSvgSprite)
64
- appendSVGSprite(conf.SVG, { document: options.document });
65
- if (hasIcons) appendSvgIconsSprite(hasIcons, { document: options.document });
66
- else if (useIconSprite)
67
- appendSvgIconsSprite(conf.ICONS, { document: options.document });
63
+ if (hasSvgs || useSvgSprite)
64
+ appendSVGSprite(conf.svg || conf.SVG, { document: options.document });
65
+ if (hasIcons || useIconSprite)
66
+ appendSvgIconsSprite(conf.icons || conf.ICONS, { document: options.document });
68
67
  return conf;
69
68
  };
70
69
  const UPDATE_OPTIONS = {
@@ -116,7 +116,7 @@ var Smbls = (() => {
116
116
  },
117
117
  { newConfig: options.newConfig }
118
118
  );
119
- const FontFace = (0, import_scratch.getFontFaceString)(conf.FONT);
119
+ const FontFace = (0, import_scratch.getFontFaceString)(conf.font || conf.FONT);
120
120
  const useReset = conf.useReset;
121
121
  const useVariable = conf.useVariable;
122
122
  const useFontImport = conf.useFontImport;
@@ -126,20 +126,19 @@ var Smbls = (() => {
126
126
  const hasIcons = config.icons || config.ICONS;
127
127
  if (useFontImport) emotion.injectGlobal(FontFace);
128
128
  if (useVariable) emotion.injectGlobal({ ":root": conf.CSS_VARS });
129
- if (useReset) emotion.injectGlobal(conf.RESET);
130
- if (conf.ANIMATION) {
129
+ if (useReset) emotion.injectGlobal(conf.reset || conf.RESET);
130
+ const animations = conf.animation || conf.ANIMATION;
131
+ if (animations) {
131
132
  const keyframesCSS = {};
132
- for (const name in conf.ANIMATION) {
133
- keyframesCSS[`@keyframes ${name}`] = conf.ANIMATION[name];
133
+ for (const name in animations) {
134
+ keyframesCSS[`@keyframes ${name}`] = animations[name];
134
135
  }
135
136
  emotion.injectGlobal(keyframesCSS);
136
137
  }
137
- if (hasSvgs) (0, import_scratch.appendSVGSprite)(hasSvgs, { document: options.document });
138
- else if (useSvgSprite)
139
- (0, import_scratch.appendSVGSprite)(conf.SVG, { document: options.document });
140
- if (hasIcons) (0, import_scratch.appendSvgIconsSprite)(hasIcons, { document: options.document });
141
- else if (useIconSprite)
142
- (0, import_scratch.appendSvgIconsSprite)(conf.ICONS, { document: options.document });
138
+ if (hasSvgs || useSvgSprite)
139
+ (0, import_scratch.appendSVGSprite)(conf.svg || conf.SVG, { document: options.document });
140
+ if (hasIcons || useIconSprite)
141
+ (0, import_scratch.appendSvgIconsSprite)(conf.icons || conf.ICONS, { document: options.document });
143
142
  return conf;
144
143
  };
145
144
  var UPDATE_OPTIONS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smbls",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "license": "MIT",
5
5
  "repository": "https://github.com/symbo-ls/smbls",
6
6
  "gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
@@ -28,20 +28,20 @@
28
28
  "src"
29
29
  ],
30
30
  "dependencies": {
31
- "@symbo.ls/emotion": "^3.4.0",
32
- "@domql/report": "^3.4.0",
33
- "@domql/router": "^3.4.0",
34
- "@domql/utils": "^3.4.0",
35
- "@symbo.ls/cli": "^3.4.0",
36
- "@symbo.ls/default-config": "^3.4.0",
37
- "@symbo.ls/fetch": "^3.4.0",
38
- "@symbo.ls/scratch": "^3.4.0",
39
- "@symbo.ls/sync": "^3.4.0",
40
- "@symbo.ls/uikit": "^3.4.0",
41
- "@symbo.ls/smbls-utils": "^3.4.0",
42
- "attrs-in-props": "^3.4.0",
43
- "css-in-props": "^3.4.0",
44
- "domql": "^3.4.0"
31
+ "@symbo.ls/emotion": "^3.4.2",
32
+ "@domql/report": "^3.4.2",
33
+ "@domql/router": "^3.4.2",
34
+ "@domql/utils": "^3.4.2",
35
+ "@symbo.ls/cli": "^3.4.2",
36
+ "@symbo.ls/default-config": "^3.4.2",
37
+ "@symbo.ls/fetch": "^3.4.2",
38
+ "@symbo.ls/scratch": "^3.4.2",
39
+ "@symbo.ls/sync": "^3.4.2",
40
+ "@symbo.ls/uikit": "^3.4.2",
41
+ "@symbo.ls/smbls-utils": "^3.4.2",
42
+ "attrs-in-props": "^3.4.2",
43
+ "css-in-props": "^3.4.2",
44
+ "domql": "^3.4.2"
45
45
  },
46
46
  "publishConfig": {},
47
47
  "scripts": {
package/src/init.js CHANGED
@@ -54,7 +54,7 @@ export const init = (config, options = SET_OPTIONS) => {
54
54
  { newConfig: options.newConfig }
55
55
  )
56
56
 
57
- const FontFace = getFontFaceString(conf.FONT)
57
+ const FontFace = getFontFaceString(conf.font || conf.FONT)
58
58
 
59
59
  const useReset = conf.useReset
60
60
  const useVariable = conf.useVariable
@@ -66,24 +66,23 @@ export const init = (config, options = SET_OPTIONS) => {
66
66
 
67
67
  if (useFontImport) emotion.injectGlobal(FontFace)
68
68
  if (useVariable) emotion.injectGlobal({ ':root': conf.CSS_VARS })
69
- if (useReset) emotion.injectGlobal(conf.RESET)
69
+ if (useReset) emotion.injectGlobal(conf.reset || conf.RESET)
70
70
 
71
71
  // Register all ANIMATION entries as global @keyframes
72
- if (conf.ANIMATION) {
72
+ const animations = conf.animation || conf.ANIMATION
73
+ if (animations) {
73
74
  const keyframesCSS = {}
74
- for (const name in conf.ANIMATION) {
75
- keyframesCSS[`@keyframes ${name}`] = conf.ANIMATION[name]
75
+ for (const name in animations) {
76
+ keyframesCSS[`@keyframes ${name}`] = animations[name]
76
77
  }
77
78
  emotion.injectGlobal(keyframesCSS)
78
79
  }
79
80
 
80
- if (hasSvgs) appendSVGSprite(hasSvgs, { document: options.document })
81
- else if (useSvgSprite)
82
- appendSVGSprite(conf.SVG, { document: options.document })
81
+ if (hasSvgs || useSvgSprite)
82
+ appendSVGSprite(conf.svg || conf.SVG, { document: options.document })
83
83
 
84
- if (hasIcons) appendSvgIconsSprite(hasIcons, { document: options.document })
85
- else if (useIconSprite)
86
- appendSvgIconsSprite(conf.ICONS, { document: options.document })
84
+ if (hasIcons || useIconSprite)
85
+ appendSvgIconsSprite(conf.icons || conf.ICONS, { document: options.document })
87
86
 
88
87
  return conf
89
88
  }