@symbo.ls/scratch 2.11.524 → 2.11.527

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
@@ -774,7 +774,7 @@ var mixTwoRgba = (colorA, colorB, range = 0.5) => {
774
774
  var opacify = (color, opacity) => {
775
775
  const arr = colorStringToRgbaArray(color);
776
776
  if (!arr) {
777
- if (ENV === "test" || ENV === "development")
777
+ if (ENV === "testing" || ENV === "development")
778
778
  console.warn(color + " color is not rgba");
779
779
  return;
780
780
  }
@@ -1416,6 +1416,8 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1416
1416
  };
1417
1417
 
1418
1418
  // src/utils/sprite.js
1419
+ var ENV2 = "development";
1420
+ var isDev = ENV2 === "development" || ENV2 === "testing";
1419
1421
  var generateSprite = (icons) => {
1420
1422
  const CONFIG2 = getActiveConfig();
1421
1423
  let sprite = "";
@@ -1431,7 +1433,9 @@ var generateSprite = (icons) => {
1431
1433
  var parseRootAttributes = (htmlString) => {
1432
1434
  const val = htmlString.default || htmlString;
1433
1435
  if (!isString(val)) {
1434
- return console.warn(`parseRootAttributes: ${val} is not a string`);
1436
+ if (isDev)
1437
+ console.warn("parseRootAttributes:", val, "is not a string");
1438
+ return;
1435
1439
  }
1436
1440
  const match = val.match(/<svg\s+(.*?)>/);
1437
1441
  if (!match || !match[1]) {
@@ -1945,6 +1949,7 @@ var runThroughMedia = (FACTORY2) => {
1945
1949
  }
1946
1950
  };
1947
1951
  var applyHeadings = (props) => {
1952
+ var _a;
1948
1953
  const CONFIG2 = getActiveConfig();
1949
1954
  if (props.h1Matches) {
1950
1955
  const unit = props.unit;
@@ -1953,8 +1958,10 @@ var applyHeadings = (props) => {
1953
1958
  for (const k in HEADINGS) {
1954
1959
  const headerName = `h${parseInt(k) + 1}`;
1955
1960
  const headerStyle = templates[headerName];
1961
+ if (!HEADINGS[k])
1962
+ continue;
1956
1963
  templates[headerName] = {
1957
- fontSize: CONFIG2.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
1964
+ fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${HEADINGS[k].scaling}${unit}`,
1958
1965
  margin: headerStyle ? headerStyle.margin : 0,
1959
1966
  lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
1960
1967
  letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
@@ -2536,7 +2543,14 @@ var setEach = (factoryName, props) => {
2536
2543
  const CONFIG2 = getActiveConfig();
2537
2544
  const FACTORY_NAME = factoryName.toUpperCase();
2538
2545
  const keys = Object.keys(props);
2539
- keys.map((key) => setValue(FACTORY_NAME, props[key], key));
2546
+ keys.map((key) => {
2547
+ try {
2548
+ setValue(FACTORY_NAME, props[key], key);
2549
+ } catch (error) {
2550
+ if (CONFIG2.verbose)
2551
+ console.warn("Error setting", FACTORY_NAME, "value", props[key], key, error);
2552
+ }
2553
+ });
2540
2554
  return CONFIG2[FACTORY_NAME];
2541
2555
  };
2542
2556
  var SET_OPTIONS = {};
package/dist/cjs/set.js CHANGED
@@ -1108,10 +1108,14 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1108
1108
  };
1109
1109
 
1110
1110
  // src/utils/sprite.js
1111
+ var ENV = "development";
1112
+ var isDev = ENV === "development" || ENV === "testing";
1111
1113
  var parseRootAttributes = (htmlString) => {
1112
1114
  const val = htmlString.default || htmlString;
1113
1115
  if (!isString(val)) {
1114
- return console.warn(`parseRootAttributes: ${val} is not a string`);
1116
+ if (isDev)
1117
+ console.warn("parseRootAttributes:", val, "is not a string");
1118
+ return;
1115
1119
  }
1116
1120
  const match = val.match(/<svg\s+(.*?)>/);
1117
1121
  if (!match || !match[1]) {
@@ -1551,6 +1555,7 @@ var runThroughMedia = (FACTORY2) => {
1551
1555
  }
1552
1556
  };
1553
1557
  var applyHeadings = (props) => {
1558
+ var _a;
1554
1559
  const CONFIG2 = getActiveConfig();
1555
1560
  if (props.h1Matches) {
1556
1561
  const unit = props.unit;
@@ -1559,8 +1564,10 @@ var applyHeadings = (props) => {
1559
1564
  for (const k in HEADINGS) {
1560
1565
  const headerName = `h${parseInt(k) + 1}`;
1561
1566
  const headerStyle = templates[headerName];
1567
+ if (!HEADINGS[k])
1568
+ continue;
1562
1569
  templates[headerName] = {
1563
- fontSize: CONFIG2.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
1570
+ fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${HEADINGS[k].scaling}${unit}`,
1564
1571
  margin: headerStyle ? headerStyle.margin : 0,
1565
1572
  lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
1566
1573
  letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
@@ -1860,7 +1867,14 @@ var setEach = (factoryName, props) => {
1860
1867
  const CONFIG2 = getActiveConfig();
1861
1868
  const FACTORY_NAME = factoryName.toUpperCase();
1862
1869
  const keys = Object.keys(props);
1863
- keys.map((key) => setValue(FACTORY_NAME, props[key], key));
1870
+ keys.map((key) => {
1871
+ try {
1872
+ setValue(FACTORY_NAME, props[key], key);
1873
+ } catch (error) {
1874
+ if (CONFIG2.verbose)
1875
+ console.warn("Error setting", FACTORY_NAME, "value", props[key], key, error);
1876
+ }
1877
+ });
1864
1878
  return CONFIG2[FACTORY_NAME];
1865
1879
  };
1866
1880
  var SET_OPTIONS = {};
@@ -1126,6 +1126,8 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1126
1126
  };
1127
1127
 
1128
1128
  // src/utils/sprite.js
1129
+ var ENV = "development";
1130
+ var isDev = ENV === "development" || ENV === "testing";
1129
1131
  var generateSprite = (icons) => {
1130
1132
  const CONFIG2 = getActiveConfig();
1131
1133
  let sprite = "";
@@ -1141,7 +1143,9 @@ var generateSprite = (icons) => {
1141
1143
  var parseRootAttributes = (htmlString) => {
1142
1144
  const val = htmlString.default || htmlString;
1143
1145
  if (!isString(val)) {
1144
- return console.warn(`parseRootAttributes: ${val} is not a string`);
1146
+ if (isDev)
1147
+ console.warn("parseRootAttributes:", val, "is not a string");
1148
+ return;
1145
1149
  }
1146
1150
  const match = val.match(/<svg\s+(.*?)>/);
1147
1151
  if (!match || !match[1]) {
@@ -1621,6 +1625,7 @@ var runThroughMedia = (FACTORY2) => {
1621
1625
  }
1622
1626
  };
1623
1627
  var applyHeadings = (props) => {
1628
+ var _a;
1624
1629
  const CONFIG2 = getActiveConfig();
1625
1630
  if (props.h1Matches) {
1626
1631
  const unit = props.unit;
@@ -1629,8 +1634,10 @@ var applyHeadings = (props) => {
1629
1634
  for (const k in HEADINGS) {
1630
1635
  const headerName = `h${parseInt(k) + 1}`;
1631
1636
  const headerStyle = templates[headerName];
1637
+ if (!HEADINGS[k])
1638
+ continue;
1632
1639
  templates[headerName] = {
1633
- fontSize: CONFIG2.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
1640
+ fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${HEADINGS[k].scaling}${unit}`,
1634
1641
  margin: headerStyle ? headerStyle.margin : 0,
1635
1642
  lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
1636
1643
  letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
@@ -652,6 +652,8 @@ var getActiveConfig = (def) => {
652
652
  };
653
653
 
654
654
  // src/utils/sprite.js
655
+ var ENV = "development";
656
+ var isDev = ENV === "development" || ENV === "testing";
655
657
  var generateSprite = (icons) => {
656
658
  const CONFIG2 = getActiveConfig();
657
659
  let sprite = "";
@@ -667,7 +669,9 @@ var generateSprite = (icons) => {
667
669
  var parseRootAttributes = (htmlString) => {
668
670
  const val = htmlString.default || htmlString;
669
671
  if (!isString(val)) {
670
- return console.warn(`parseRootAttributes: ${val} is not a string`);
672
+ if (isDev)
673
+ console.warn("parseRootAttributes:", val, "is not a string");
674
+ return;
671
675
  }
672
676
  const match = val.match(/<svg\s+(.*?)>/);
673
677
  if (!match || !match[1]) {
@@ -993,6 +993,7 @@ var runThroughMedia = (FACTORY2) => {
993
993
  }
994
994
  };
995
995
  var applyHeadings = (props) => {
996
+ var _a;
996
997
  const CONFIG2 = getActiveConfig();
997
998
  if (props.h1Matches) {
998
999
  const unit = props.unit;
@@ -1001,8 +1002,10 @@ var applyHeadings = (props) => {
1001
1002
  for (const k in HEADINGS) {
1002
1003
  const headerName = `h${parseInt(k) + 1}`;
1003
1004
  const headerStyle = templates[headerName];
1005
+ if (!HEADINGS[k])
1006
+ continue;
1004
1007
  templates[headerName] = {
1005
- fontSize: CONFIG2.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
1008
+ fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${HEADINGS[k].scaling}${unit}`,
1006
1009
  margin: headerStyle ? headerStyle.margin : 0,
1007
1010
  lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
1008
1011
  letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
@@ -223,7 +223,7 @@ var mixTwoRgba = (colorA, colorB, range = 0.5) => {
223
223
  var opacify = (color, opacity) => {
224
224
  const arr = colorStringToRgbaArray(color);
225
225
  if (!arr) {
226
- if (ENV === "test" || ENV === "development")
226
+ if (ENV === "testing" || ENV === "development")
227
227
  console.warn(color + " color is not rgba");
228
228
  return;
229
229
  }
@@ -596,7 +596,7 @@ var mixTwoRgba = (colorA, colorB, range = 0.5) => {
596
596
  var opacify = (color, opacity) => {
597
597
  const arr = colorStringToRgbaArray(color);
598
598
  if (!arr) {
599
- if (ENV === "test" || ENV === "development")
599
+ if (ENV === "testing" || ENV === "development")
600
600
  console.warn(color + " color is not rgba");
601
601
  return;
602
602
  }
@@ -1225,6 +1225,8 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1225
1225
  };
1226
1226
 
1227
1227
  // src/utils/sprite.js
1228
+ var ENV2 = "development";
1229
+ var isDev = ENV2 === "development" || ENV2 === "testing";
1228
1230
  var generateSprite = (icons) => {
1229
1231
  const CONFIG2 = getActiveConfig();
1230
1232
  let sprite = "";
@@ -1240,7 +1242,9 @@ var generateSprite = (icons) => {
1240
1242
  var parseRootAttributes = (htmlString) => {
1241
1243
  const val = htmlString.default || htmlString;
1242
1244
  if (!isString(val)) {
1243
- return console.warn(`parseRootAttributes: ${val} is not a string`);
1245
+ if (isDev)
1246
+ console.warn("parseRootAttributes:", val, "is not a string");
1247
+ return;
1244
1248
  }
1245
1249
  const match = val.match(/<svg\s+(.*?)>/);
1246
1250
  if (!match || !match[1]) {
@@ -361,6 +361,8 @@ var getActiveConfig = (def) => {
361
361
  };
362
362
 
363
363
  // src/utils/sprite.js
364
+ var ENV = "development";
365
+ var isDev = ENV === "development" || ENV === "testing";
364
366
  var generateSprite = (icons) => {
365
367
  const CONFIG2 = getActiveConfig();
366
368
  let sprite = "";
@@ -376,7 +378,9 @@ var generateSprite = (icons) => {
376
378
  var parseRootAttributes = (htmlString) => {
377
379
  const val = htmlString.default || htmlString;
378
380
  if (!isString(val)) {
379
- return console.warn(`parseRootAttributes: ${val} is not a string`);
381
+ if (isDev)
382
+ console.warn("parseRootAttributes:", val, "is not a string");
383
+ return;
380
384
  }
381
385
  const match = val.match(/<svg\s+(.*?)>/);
382
386
  if (!match || !match[1]) {
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.524",
5
+ "version": "2.11.527",
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": "11ddc293abaa696dce80d4fb0356a27f0a0f476c"
33
+ "gitHead": "e2c07300cd296386220c924b8f15b4856cb24ba1"
34
34
  }
package/src/set.js CHANGED
@@ -78,7 +78,13 @@ 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 => setValue(FACTORY_NAME, props[key], key))
81
+ keys.map(key => {
82
+ try {
83
+ setValue(FACTORY_NAME, props[key], key)
84
+ } catch (error) {
85
+ if (CONFIG.verbose) console.warn('Error setting', FACTORY_NAME, 'value', props[key], key, error)
86
+ }
87
+ })
82
88
 
83
89
  return CONFIG[FACTORY_NAME]
84
90
  }
@@ -76,8 +76,9 @@ export const applyHeadings = (props) => {
76
76
  for (const k in HEADINGS) {
77
77
  const headerName = `h${parseInt(k) + 1}`
78
78
  const headerStyle = templates[headerName]
79
+ if (!HEADINGS[k]) continue
79
80
  templates[headerName] = {
80
- fontSize: CONFIG.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
81
+ fontSize: CONFIG.useVariable ? `var(${HEADINGS[k]?.variable})` : `${HEADINGS[k].scaling}${unit}`,
81
82
  margin: headerStyle ? headerStyle.margin : 0,
82
83
  lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
83
84
  letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
@@ -152,7 +152,7 @@ export const mixTwoRgba = (colorA, colorB, range = 0.5) => {
152
152
  export const opacify = (color, opacity) => {
153
153
  const arr = colorStringToRgbaArray(color)
154
154
  if (!arr) {
155
- if (ENV === 'test' || ENV === 'development') console.warn(color + ' color is not rgba')
155
+ if (ENV === 'testing' || ENV === 'development') console.warn(color + ' color is not rgba')
156
156
  return
157
157
  }
158
158
  arr[3] = opacity
@@ -3,6 +3,9 @@
3
3
  import { isArray, isString } from '@domql/utils'
4
4
  import { getActiveConfig } from '../factory'
5
5
 
6
+ const ENV = process.env.NODE_ENV || 'development'
7
+ const isDev = ENV === 'development' || ENV === 'testing'
8
+
6
9
  export const generateSprite = (icons) => {
7
10
  const CONFIG = getActiveConfig()
8
11
 
@@ -20,7 +23,8 @@ export const generateSprite = (icons) => {
20
23
  const parseRootAttributes = (htmlString) => {
21
24
  const val = htmlString.default || htmlString
22
25
  if (!isString(val)) {
23
- return console.warn(`parseRootAttributes: ${val} is not a string`)
26
+ if (isDev) console.warn('parseRootAttributes:', val, 'is not a string')
27
+ return
24
28
  }
25
29
 
26
30
  const match = val.match(/<svg\s+(.*?)>/)