@symbo.ls/scratch 2.33.27 → 2.33.29

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
@@ -616,6 +616,27 @@ var __spreadValues = (a, b) => {
616
616
  return a;
617
617
  };
618
618
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
619
+ function exec(param, element, state, context, opts = {}) {
620
+ if (!element) element = this;
621
+ if (isFunction(param)) {
622
+ try {
623
+ const result = param.call(
624
+ element,
625
+ element,
626
+ state || element.state,
627
+ context || element.context
628
+ );
629
+ if (result && typeof result.then === "function") {
630
+ return result;
631
+ }
632
+ return result;
633
+ } catch (e) {
634
+ element.log(param);
635
+ element.warn("Error executing function", e, opts);
636
+ }
637
+ }
638
+ return param;
639
+ }
619
640
  var merge = (element, obj, excludeFrom = []) => {
620
641
  for (const e in obj) {
621
642
  const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
@@ -1398,7 +1419,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
1398
1419
  const transformedValues = valuesArr.map((v) => {
1399
1420
  return getSequenceValue(v, sequenceProps);
1400
1421
  });
1401
- return transformedValues.join(symbol + " ");
1422
+ return transformedValues.join(" " + symbol + " ");
1402
1423
  }).join("");
1403
1424
  };
1404
1425
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -2459,8 +2480,8 @@ var splitTransition = (transition) => {
2459
2480
  if (!arr.length) return;
2460
2481
  return arr.map(transformTransition).join(",");
2461
2482
  };
2462
- var transformSize = (propertyName, val, props = {}, opts = {}) => {
2463
- let value = val || props[propertyName];
2483
+ function transformSize(propertyName, val, props = {}, opts = {}) {
2484
+ let value = exec.call(this, val || props[propertyName]);
2464
2485
  if (isUndefined(value) && isNull(value)) return;
2465
2486
  let fnPrefix;
2466
2487
  if (isString(value)) {
@@ -2476,12 +2497,12 @@ var transformSize = (propertyName, val, props = {}, opts = {}) => {
2476
2497
  }
2477
2498
  }
2478
2499
  return opts.ratio ? getSpacingBasedOnRatio(props, propertyName, value, fnPrefix) : getSpacingByKey(value, propertyName, void 0, fnPrefix);
2479
- };
2480
- var transformSizeRatio = (propertyName, props) => {
2500
+ }
2501
+ function transformSizeRatio(propertyName, props) {
2481
2502
  return transformSize(propertyName, null, props, {
2482
2503
  ratio: true
2483
2504
  });
2484
- };
2505
+ }
2485
2506
 
2486
2507
  // src/set.js
2487
2508
  var setCases = (val, key) => {
package/dist/cjs/set.js CHANGED
@@ -1104,7 +1104,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
1104
1104
  const transformedValues = valuesArr.map((v) => {
1105
1105
  return getSequenceValue(v, sequenceProps);
1106
1106
  });
1107
- return transformedValues.join(symbol + " ");
1107
+ return transformedValues.join(" " + symbol + " ");
1108
1108
  }).join("");
1109
1109
  };
1110
1110
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -1125,7 +1125,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
1125
1125
  const transformedValues = valuesArr.map((v) => {
1126
1126
  return getSequenceValue(v, sequenceProps);
1127
1127
  });
1128
- return transformedValues.join(symbol + " ");
1128
+ return transformedValues.join(" " + symbol + " ");
1129
1129
  }).join("");
1130
1130
  };
1131
1131
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -1033,7 +1033,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
1033
1033
  const transformedValues = valuesArr.map((v) => {
1034
1034
  return getSequenceValue(v, sequenceProps);
1035
1035
  });
1036
- return transformedValues.join(symbol + " ");
1036
+ return transformedValues.join(" " + symbol + " ");
1037
1037
  }).join("");
1038
1038
  };
1039
1039
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -962,7 +962,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
962
962
  const transformedValues = valuesArr.map((v) => {
963
963
  return getSequenceValue(v, sequenceProps);
964
964
  });
965
- return transformedValues.join(symbol + " ");
965
+ return transformedValues.join(" " + symbol + " ");
966
966
  }).join("");
967
967
  };
968
968
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -947,7 +947,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
947
947
  const transformedValues = valuesArr.map((v) => {
948
948
  return getSequenceValue(v, sequenceProps);
949
949
  });
950
- return transformedValues.join(symbol + " ");
950
+ return transformedValues.join(" " + symbol + " ");
951
951
  }).join("");
952
952
  };
953
953
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -960,7 +960,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
960
960
  const transformedValues = valuesArr.map((v) => {
961
961
  return getSequenceValue(v, sequenceProps);
962
962
  });
963
- return transformedValues.join(symbol + " ");
963
+ return transformedValues.join(" " + symbol + " ");
964
964
  }).join("");
965
965
  };
966
966
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -385,6 +385,27 @@ var __spreadValues = (a, b) => {
385
385
  return a;
386
386
  };
387
387
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
388
+ function exec(param, element, state, context, opts = {}) {
389
+ if (!element) element = this;
390
+ if (isFunction(param)) {
391
+ try {
392
+ const result = param.call(
393
+ element,
394
+ element,
395
+ state || element.state,
396
+ context || element.context
397
+ );
398
+ if (result && typeof result.then === "function") {
399
+ return result;
400
+ }
401
+ return result;
402
+ } catch (e) {
403
+ element.log(param);
404
+ element.warn("Error executing function", e, opts);
405
+ }
406
+ }
407
+ return param;
408
+ }
388
409
  var deepMerge = (element, extend, excludeFrom = [], level = Infinity) => {
389
410
  for (const e in extend) {
390
411
  const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
@@ -1042,7 +1063,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
1042
1063
  const transformedValues = valuesArr.map((v) => {
1043
1064
  return getSequenceValue(v, sequenceProps);
1044
1065
  });
1045
- return transformedValues.join(symbol + " ");
1066
+ return transformedValues.join(" " + symbol + " ");
1046
1067
  }).join("");
1047
1068
  };
1048
1069
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -1355,8 +1376,8 @@ var splitTransition = (transition) => {
1355
1376
  if (!arr.length) return;
1356
1377
  return arr.map(transformTransition).join(",");
1357
1378
  };
1358
- var transformSize = (propertyName, val, props = {}, opts = {}) => {
1359
- let value = val || props[propertyName];
1379
+ function transformSize(propertyName, val, props = {}, opts = {}) {
1380
+ let value = exec.call(this, val || props[propertyName]);
1360
1381
  if (isUndefined(value) && isNull(value)) return;
1361
1382
  let fnPrefix;
1362
1383
  if (isString(value)) {
@@ -1372,10 +1393,10 @@ var transformSize = (propertyName, val, props = {}, opts = {}) => {
1372
1393
  }
1373
1394
  }
1374
1395
  return opts.ratio ? getSpacingBasedOnRatio(props, propertyName, value, fnPrefix) : getSpacingByKey(value, propertyName, void 0, fnPrefix);
1375
- };
1376
- var transformSizeRatio = (propertyName, props) => {
1396
+ }
1397
+ function transformSizeRatio(propertyName, props) {
1377
1398
  return transformSize(propertyName, null, props, {
1378
1399
  ratio: true
1379
1400
  });
1380
- };
1401
+ }
1381
1402
  // @preserve-env
@@ -1208,7 +1208,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
1208
1208
  const transformedValues = valuesArr.map((v) => {
1209
1209
  return getSequenceValue(v, sequenceProps);
1210
1210
  });
1211
- return transformedValues.join(symbol + " ");
1211
+ return transformedValues.join(" " + symbol + " ");
1212
1212
  }).join("");
1213
1213
  };
1214
1214
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
@@ -992,7 +992,7 @@ var getSequenceValueBySymbols = (value, sequenceProps) => {
992
992
  const transformedValues = valuesArr.map((v) => {
993
993
  return getSequenceValue(v, sequenceProps);
994
994
  });
995
- return transformedValues.join(symbol + " ");
995
+ return transformedValues.join(" " + symbol + " ");
996
996
  }).join("");
997
997
  };
998
998
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps, fnPrefix) => {
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.33.27",
5
+ "version": "2.33.29",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
@@ -25,9 +25,9 @@
25
25
  "prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
26
26
  },
27
27
  "dependencies": {
28
- "@domql/utils": "^2.33.27",
29
- "@symbo.ls/utils": "^2.33.27",
28
+ "@domql/utils": "^2.33.29",
29
+ "@symbo.ls/utils": "^2.33.29",
30
30
  "color-contrast-checker": "^1.5.0"
31
31
  },
32
- "gitHead": "305c78c0cd824b365d3e464dc3ede6b250c8baf1"
32
+ "gitHead": "4a29b29c86a47fa047345b16120cc426bbe57f41"
33
33
  }
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { isNull, isString, isObject, isUndefined } from '@domql/utils'
3
+ import { isNull, isString, isObject, isUndefined, exec } from '@domql/utils'
4
4
  import { getActiveConfig } from '../factory'
5
5
  import {
6
6
  getSpacingByKey,
@@ -145,8 +145,8 @@ export const splitTransition = (transition) => {
145
145
  return arr.map(transformTransition).join(',')
146
146
  }
147
147
 
148
- export const transformSize = (propertyName, val, props = {}, opts = {}) => {
149
- let value = val || props[propertyName]
148
+ export function transformSize(propertyName, val, props = {}, opts = {}) {
149
+ let value = exec.call(this, val || props[propertyName])
150
150
 
151
151
  if (isUndefined(value) && isNull(value)) return
152
152
 
@@ -171,7 +171,7 @@ export const transformSize = (propertyName, val, props = {}, opts = {}) => {
171
171
  : getSpacingByKey(value, propertyName, undefined, fnPrefix)
172
172
  }
173
173
 
174
- export const transformSizeRatio = (propertyName, props) => {
174
+ export function transformSizeRatio(propertyName, props) {
175
175
  return transformSize(propertyName, null, props, {
176
176
  ratio: true
177
177
  })
@@ -321,7 +321,7 @@ export const getSequenceValueBySymbols = (value, sequenceProps) => {
321
321
  const transformedValues = valuesArr.map((v) => {
322
322
  return getSequenceValue(v, sequenceProps)
323
323
  })
324
- return transformedValues.join(symbol + ' ')
324
+ return transformedValues.join(' ' + symbol + ' ')
325
325
  })
326
326
  .join('')
327
327
  }
@@ -5,7 +5,7 @@ import { getActiveConfig } from '../factory'
5
5
 
6
6
  const isDev = isNotProduction()
7
7
 
8
- export const generateSprite = icons => {
8
+ export const generateSprite = (icons) => {
9
9
  const CONFIG = getActiveConfig()
10
10
 
11
11
  let sprite = ''
@@ -19,7 +19,7 @@ export const generateSprite = icons => {
19
19
  return sprite
20
20
  }
21
21
 
22
- const parseRootAttributes = htmlString => {
22
+ const parseRootAttributes = (htmlString) => {
23
23
  const val = htmlString.default || htmlString
24
24
  if (!isString(val)) {
25
25
  if (isDev) console.warn('parseRootAttributes:', val, 'is not a string')