@symbo.ls/scratch 2.11.527 → 2.11.530

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/dist/cjs/index.js CHANGED
@@ -2543,9 +2543,9 @@ var setEach = (factoryName, props) => {
2543
2543
  const CONFIG2 = getActiveConfig();
2544
2544
  const FACTORY_NAME = factoryName.toUpperCase();
2545
2545
  const keys = Object.keys(props);
2546
- keys.map((key) => {
2546
+ keys.forEach((key) => {
2547
2547
  try {
2548
- setValue(FACTORY_NAME, props[key], key);
2548
+ return setValue(FACTORY_NAME, props[key], key);
2549
2549
  } catch (error) {
2550
2550
  if (CONFIG2.verbose)
2551
2551
  console.warn("Error setting", FACTORY_NAME, "value", props[key], key, error);
@@ -2599,12 +2599,30 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
2599
2599
  CONFIG2.__svg_cache = {};
2600
2600
  const keys = Object.keys(config);
2601
2601
  keys.map((key) => setEach(key, config[key]));
2602
- if (config.TYPOGRAPHY)
2603
- applyTypographySequence();
2604
- if (config.SPACING)
2605
- applySpacingSequence();
2606
- if (config.TIMING)
2607
- applyTimingSequence();
2602
+ if (config.TYPOGRAPHY) {
2603
+ try {
2604
+ applyTypographySequence();
2605
+ } catch (e) {
2606
+ if (CONFIG2.verbose)
2607
+ console.warn("Error applying typography sequence", e);
2608
+ }
2609
+ }
2610
+ if (config.SPACING) {
2611
+ try {
2612
+ applySpacingSequence();
2613
+ } catch (e) {
2614
+ if (CONFIG2.verbose)
2615
+ console.warn("Error applying typography sequence", e);
2616
+ }
2617
+ }
2618
+ if (config.TIMING) {
2619
+ try {
2620
+ applyTimingSequence();
2621
+ } catch (e) {
2622
+ if (CONFIG2.verbose)
2623
+ console.warn("Error applying typography sequence", e);
2624
+ }
2625
+ }
2608
2626
  applyDocument();
2609
2627
  applyReset();
2610
2628
  return CONFIG2;
package/dist/cjs/set.js CHANGED
@@ -1867,9 +1867,9 @@ var setEach = (factoryName, props) => {
1867
1867
  const CONFIG2 = getActiveConfig();
1868
1868
  const FACTORY_NAME = factoryName.toUpperCase();
1869
1869
  const keys = Object.keys(props);
1870
- keys.map((key) => {
1870
+ keys.forEach((key) => {
1871
1871
  try {
1872
- setValue(FACTORY_NAME, props[key], key);
1872
+ return setValue(FACTORY_NAME, props[key], key);
1873
1873
  } catch (error) {
1874
1874
  if (CONFIG2.verbose)
1875
1875
  console.warn("Error setting", FACTORY_NAME, "value", props[key], key, error);
@@ -1923,12 +1923,30 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
1923
1923
  CONFIG2.__svg_cache = {};
1924
1924
  const keys = Object.keys(config);
1925
1925
  keys.map((key) => setEach(key, config[key]));
1926
- if (config.TYPOGRAPHY)
1927
- applyTypographySequence();
1928
- if (config.SPACING)
1929
- applySpacingSequence();
1930
- if (config.TIMING)
1931
- applyTimingSequence();
1926
+ if (config.TYPOGRAPHY) {
1927
+ try {
1928
+ applyTypographySequence();
1929
+ } catch (e) {
1930
+ if (CONFIG2.verbose)
1931
+ console.warn("Error applying typography sequence", e);
1932
+ }
1933
+ }
1934
+ if (config.SPACING) {
1935
+ try {
1936
+ applySpacingSequence();
1937
+ } catch (e) {
1938
+ if (CONFIG2.verbose)
1939
+ console.warn("Error applying typography sequence", e);
1940
+ }
1941
+ }
1942
+ if (config.TIMING) {
1943
+ try {
1944
+ applyTimingSequence();
1945
+ } catch (e) {
1946
+ if (CONFIG2.verbose)
1947
+ console.warn("Error applying typography sequence", e);
1948
+ }
1949
+ }
1932
1950
  applyDocument();
1933
1951
  applyReset();
1934
1952
  return CONFIG2;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/scratch",
3
3
  "description": "Φ / CSS framework and methodology.",
4
4
  "author": "symbo.ls",
5
- "version": "2.11.527",
5
+ "version": "2.11.530",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
@@ -30,5 +30,5 @@
30
30
  "@symbo.ls/utils": "^2.11.512",
31
31
  "color-contrast-checker": "^1.5.0"
32
32
  },
33
- "gitHead": "e2c07300cd296386220c924b8f15b4856cb24ba1"
33
+ "gitHead": "62beb28912f644cdec696bc8703ed6396a1454cc"
34
34
  }
package/src/set.js CHANGED
@@ -78,9 +78,10 @@ export const setEach = (factoryName, props) => {
78
78
  const CONFIG = getActiveConfig()
79
79
  const FACTORY_NAME = factoryName.toUpperCase()
80
80
  const keys = Object.keys(props)
81
- keys.map(key => {
81
+
82
+ keys.forEach((key) => {
82
83
  try {
83
- setValue(FACTORY_NAME, props[key], key)
84
+ return setValue(FACTORY_NAME, props[key], key)
84
85
  } catch (error) {
85
86
  if (CONFIG.verbose) console.warn('Error setting', FACTORY_NAME, 'value', props[key], key, error)
86
87
  }
@@ -131,9 +132,21 @@ export const set = (recivedConfig, options = SET_OPTIONS) => {
131
132
  keys.map(key => setEach(key, config[key]))
132
133
 
133
134
  // apply generic configs
134
- if (config.TYPOGRAPHY) applyTypographySequence()
135
- if (config.SPACING) applySpacingSequence()
136
- if (config.TIMING) applyTimingSequence()
135
+ if (config.TYPOGRAPHY) {
136
+ try { applyTypographySequence() } catch (e) {
137
+ if (CONFIG.verbose) console.warn('Error applying typography sequence', e)
138
+ }
139
+ }
140
+ if (config.SPACING) {
141
+ try { applySpacingSequence() } catch (e) {
142
+ if (CONFIG.verbose) console.warn('Error applying typography sequence', e)
143
+ }
144
+ }
145
+ if (config.TIMING) {
146
+ try { applyTimingSequence() } catch (e) {
147
+ if (CONFIG.verbose) console.warn('Error applying typography sequence', e)
148
+ }
149
+ }
137
150
  applyDocument()
138
151
  applyReset()
139
152