purgetss 5.3.13 → 5.3.14

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/lib/helpers.js CHANGED
@@ -2957,7 +2957,7 @@ function navBarHidden() {
2957
2957
  }
2958
2958
  exports.navBarHidden = navBarHidden;
2959
2959
 
2960
- function navigationMode(modifiersAndValues) {
2960
+ function navigationMode() {
2961
2961
  return processProperties({
2962
2962
  'prop': 'navigationMode',
2963
2963
  'component': 'Ti.Android.ActionBar'
@@ -4576,11 +4576,7 @@ function activeTab(modifiersAndValues) {
4576
4576
  exports.activeTab = activeTab;
4577
4577
 
4578
4578
  function backgroundLeftCap(modifiersAndValues) {
4579
- modifiersAndValues = removeFractions(modifiersAndValues);
4580
-
4581
- delete modifiersAndValues.full;
4582
- delete modifiersAndValues.auto;
4583
- delete modifiersAndValues.screen;
4579
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4584
4580
 
4585
4581
  return processProperties({
4586
4582
  'prop': 'backgroundLeftCap - iOS Only',
@@ -4594,11 +4590,7 @@ function backgroundLeftCap(modifiersAndValues) {
4594
4590
  exports.backgroundLeftCap = backgroundLeftCap;
4595
4591
 
4596
4592
  function backgroundPaddingBottom(modifiersAndValues) {
4597
- modifiersAndValues = removeFractions(modifiersAndValues);
4598
-
4599
- delete modifiersAndValues.full;
4600
- delete modifiersAndValues.auto;
4601
- delete modifiersAndValues.screen;
4593
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4602
4594
 
4603
4595
  return processProperties({
4604
4596
  'prop': 'backgroundPaddingBottom - iOS Only',
@@ -4612,11 +4604,7 @@ function backgroundPaddingBottom(modifiersAndValues) {
4612
4604
  exports.backgroundPaddingBottom = backgroundPaddingBottom;
4613
4605
 
4614
4606
  function backgroundPaddingLeft(modifiersAndValues) {
4615
- modifiersAndValues = removeFractions(modifiersAndValues);
4616
-
4617
- delete modifiersAndValues.full;
4618
- delete modifiersAndValues.auto;
4619
- delete modifiersAndValues.screen;
4607
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4620
4608
 
4621
4609
  return processProperties({
4622
4610
  'prop': 'backgroundPaddingLeft - iOS Only',
@@ -4630,11 +4618,7 @@ function backgroundPaddingLeft(modifiersAndValues) {
4630
4618
  exports.backgroundPaddingLeft = backgroundPaddingLeft;
4631
4619
 
4632
4620
  function backgroundPaddingRight(modifiersAndValues) {
4633
- modifiersAndValues = removeFractions(modifiersAndValues);
4634
-
4635
- delete modifiersAndValues.full;
4636
- delete modifiersAndValues.auto;
4637
- delete modifiersAndValues.screen;
4621
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4638
4622
 
4639
4623
  return processProperties({
4640
4624
  'prop': 'backgroundPaddingRight - iOS Only',
@@ -4648,11 +4632,7 @@ function backgroundPaddingRight(modifiersAndValues) {
4648
4632
  exports.backgroundPaddingRight = backgroundPaddingRight;
4649
4633
 
4650
4634
  function backgroundPaddingTop(modifiersAndValues) {
4651
- modifiersAndValues = removeFractions(modifiersAndValues);
4652
-
4653
- delete modifiersAndValues.full;
4654
- delete modifiersAndValues.auto;
4655
- delete modifiersAndValues.screen;
4635
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4656
4636
 
4657
4637
  return processProperties({
4658
4638
  'prop': 'backgroundPaddingTop - iOS Only',
@@ -4666,11 +4646,7 @@ function backgroundPaddingTop(modifiersAndValues) {
4666
4646
  exports.backgroundPaddingTop = backgroundPaddingTop;
4667
4647
 
4668
4648
  function backgroundTopCap(modifiersAndValues) {
4669
- modifiersAndValues = removeFractions(modifiersAndValues);
4670
-
4671
- delete modifiersAndValues.full;
4672
- delete modifiersAndValues.auto;
4673
- delete modifiersAndValues.screen;
4649
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4674
4650
 
4675
4651
  return processProperties({
4676
4652
  'prop': 'backgroundTopCap - iOS Only',
@@ -4723,6 +4699,21 @@ function borderRadius(modifiersAndValues) {
4723
4699
  }
4724
4700
  exports.borderRadius = borderRadius;
4725
4701
 
4702
+ function integersInHalf(modifiersAndValues) {
4703
+ _.each(modifiersAndValues, (value, key) => {
4704
+ if (key.includes('/')) {
4705
+ delete modifiersAndValues[key];
4706
+ } else if (['sm', 'md', 'lg', 'xl', '2xl', '3xl', 'px', 'DEFAULT'].includes(key)) {
4707
+ modifiersAndValues[key] = value;
4708
+ } else {
4709
+ modifiersAndValues[key] = 8 * parseFloat(value);
4710
+ }
4711
+ });
4712
+
4713
+ return modifiersAndValues;
4714
+ }
4715
+ exports.integersInHalf = integersInHalf;
4716
+
4726
4717
  function borderWidth(modifiersAndValues) {
4727
4718
  modifiersAndValues[1] = '1px';
4728
4719
  modifiersAndValues[10] = '10px';
@@ -4752,10 +4743,7 @@ function bottomNavigation(modifiersAndValues) {
4752
4743
  'padding-b': '{ paddingBottom: {value} }',
4753
4744
  }
4754
4745
 
4755
- modifiersAndValues = removeFractions(modifiersAndValues);
4756
- delete modifiersAndValues.full;
4757
- delete modifiersAndValues.auto;
4758
- delete modifiersAndValues.screen;
4746
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4759
4747
 
4760
4748
  return processProperties({
4761
4749
  'prop': 'padding, paddingTop, paddingLeft, paddingRight, paddingBottom - Android Only',
@@ -4782,7 +4770,7 @@ function cacheSize(modifiersAndValues) {
4782
4770
  exports.cacheSize = cacheSize;
4783
4771
 
4784
4772
  function columnCount(modifiersAndValues) {
4785
- delete modifiersAndValues[0];
4773
+ modifiersAndValues = removeFractions(modifiersAndValues, ['0']);
4786
4774
 
4787
4775
  let convertedStyles = processProperties({
4788
4776
  'prop': 'columnCount - iOS Only',
@@ -4836,10 +4824,7 @@ function countDownDuration(modifiersAndValues) {
4836
4824
  exports.countDownDuration = countDownDuration;
4837
4825
 
4838
4826
  function elevation(modifiersAndValues) {
4839
- delete modifiersAndValues[0];
4840
- delete modifiersAndValues.auto;
4841
- delete modifiersAndValues.full;
4842
- delete modifiersAndValues.screen;
4827
+ modifiersAndValues = removeFractions(modifiersAndValues, ['0', 'full', 'auto', 'screen']);
4843
4828
 
4844
4829
  _.each(modifiersAndValues, (value, key) => {
4845
4830
  if (key.includes('/')) {
@@ -4916,10 +4901,8 @@ exports.fontWeight = fontWeight;
4916
4901
 
4917
4902
  function gap(modifiersAndValues) {
4918
4903
  // SOME CLEANUP... VALUES NOT NEEDED HERE!.
4919
- modifiersAndValues = removeFractions(modifiersAndValues);
4920
-
4904
+ modifiersAndValues = removeFractions(modifiersAndValues, ['screen']);
4921
4905
  modifiersAndValues.auto = 'auto';
4922
- delete modifiersAndValues.screen;
4923
4906
 
4924
4907
  return processProperties({
4925
4908
  'prop': 'top, right, bottom, left - Gap for Grid System',
@@ -4939,11 +4922,7 @@ function gap(modifiersAndValues) {
4939
4922
  exports.gap = gap;
4940
4923
 
4941
4924
  function indentionLevel(modifiersAndValues) {
4942
- modifiersAndValues = removeFractions(modifiersAndValues);
4943
-
4944
- delete modifiersAndValues.full;
4945
- delete modifiersAndValues.auto;
4946
- delete modifiersAndValues.screen;
4925
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4947
4926
 
4948
4927
  return processProperties({
4949
4928
  'prop': 'indentionLevel - Android Only',
@@ -4957,11 +4936,7 @@ function indentionLevel(modifiersAndValues) {
4957
4936
  exports.indentionLevel = indentionLevel;
4958
4937
 
4959
4938
  function keyboardToolbarHeight(modifiersAndValues) {
4960
- modifiersAndValues = removeFractions(modifiersAndValues);
4961
-
4962
- delete modifiersAndValues.full;
4963
- delete modifiersAndValues.auto;
4964
- delete modifiersAndValues.screen;
4939
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4965
4940
 
4966
4941
  return processProperties({
4967
4942
  'prop': 'keyboardToolbarHeight - iOS Only',
@@ -4975,11 +4950,7 @@ function keyboardToolbarHeight(modifiersAndValues) {
4975
4950
  exports.keyboardToolbarHeight = keyboardToolbarHeight;
4976
4951
 
4977
4952
  function leftButtonPadding(modifiersAndValues) {
4978
- modifiersAndValues = removeFractions(modifiersAndValues);
4979
-
4980
- delete modifiersAndValues.full;
4981
- delete modifiersAndValues.auto;
4982
- delete modifiersAndValues.screen;
4953
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
4983
4954
 
4984
4955
  return processProperties({
4985
4956
  'prop': 'leftButtonPadding - iOS Only',
@@ -5005,7 +4976,7 @@ function leftWidth(modifiersAndValues) {
5005
4976
  exports.leftWidth = leftWidth;
5006
4977
 
5007
4978
  function lines(modifiersAndValues) {
5008
- delete modifiersAndValues[0];
4979
+ modifiersAndValues = removeFractions(modifiersAndValues, ['0']);
5009
4980
 
5010
4981
  return processProperties({
5011
4982
  'prop': 'lines - Android Only',
@@ -5019,10 +4990,7 @@ function lines(modifiersAndValues) {
5019
4990
  exports.lines = lines;
5020
4991
 
5021
4992
  function maxElevation(modifiersAndValues) {
5022
- delete modifiersAndValues[0];
5023
- delete modifiersAndValues.auto;
5024
- delete modifiersAndValues.full;
5025
- delete modifiersAndValues.screen;
4993
+ modifiersAndValues = removeFractions(modifiersAndValues, ['0', 'auto', 'full', 'screen']);
5026
4994
 
5027
4995
  _.each(modifiersAndValues, (value, key) => {
5028
4996
  if (key.includes('/')) {
@@ -5045,7 +5013,7 @@ function maxElevation(modifiersAndValues) {
5045
5013
  exports.maxElevation = maxElevation;
5046
5014
 
5047
5015
  function maxLines(modifiersAndValues) {
5048
- delete modifiersAndValues[0];
5016
+ modifiersAndValues = removeFractions(modifiersAndValues, ['0']);
5049
5017
  return processProperties({
5050
5018
  'prop': 'maxLines - Android Only',
5051
5019
  'component': 'Ti.UI.Label, Ti.UI.TextArea'
@@ -5058,11 +5026,7 @@ function maxLines(modifiersAndValues) {
5058
5026
  exports.maxLines = maxLines;
5059
5027
 
5060
5028
  function maxRowHeight(modifiersAndValues) {
5061
- modifiersAndValues = removeFractions(modifiersAndValues);
5062
-
5063
- delete modifiersAndValues.full;
5064
- delete modifiersAndValues.auto;
5065
- delete modifiersAndValues.screen;
5029
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
5066
5030
 
5067
5031
  return processProperties({
5068
5032
  'prop': 'maxRowHeight - iOS Only',
@@ -5076,7 +5040,9 @@ function maxRowHeight(modifiersAndValues) {
5076
5040
  exports.maxRowHeight = maxRowHeight;
5077
5041
 
5078
5042
  function maxZoomScale(modifiersAndValues) {
5079
- modifiersAndValues[1] = '.01';
5043
+ if (modifiersAndValues) {
5044
+ modifiersAndValues[1] = '.01';
5045
+ }
5080
5046
 
5081
5047
  return processProperties({
5082
5048
  'prop': 'maxZoomScale',
@@ -5106,11 +5072,7 @@ function minimumFontSize(modifiersAndValues) {
5106
5072
  exports.minimumFontSize = minimumFontSize;
5107
5073
 
5108
5074
  function minRowHeight(modifiersAndValues) {
5109
- modifiersAndValues = removeFractions(modifiersAndValues);
5110
-
5111
- delete modifiersAndValues.full;
5112
- delete modifiersAndValues.auto;
5113
- delete modifiersAndValues.screen;
5075
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
5114
5076
 
5115
5077
  return processProperties({
5116
5078
  'prop': 'minRowHeight - iOS Only',
@@ -5124,7 +5086,9 @@ function minRowHeight(modifiersAndValues) {
5124
5086
  exports.minRowHeight = minRowHeight;
5125
5087
 
5126
5088
  function minZoomScale(modifiersAndValues) {
5127
- modifiersAndValues[1] = '.01';
5089
+ if (modifiersAndValues) {
5090
+ modifiersAndValues[1] = '.01';
5091
+ }
5128
5092
 
5129
5093
  return processProperties({
5130
5094
  'prop': 'minZoomScale',
@@ -5136,11 +5100,7 @@ function minZoomScale(modifiersAndValues) {
5136
5100
  exports.minZoomScale = minZoomScale;
5137
5101
 
5138
5102
  function offsets(modifiersAndValues) {
5139
- modifiersAndValues = removeFractions(modifiersAndValues);
5140
-
5141
- delete modifiersAndValues.full;
5142
- delete modifiersAndValues.auto;
5143
- delete modifiersAndValues.screen;
5103
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
5144
5104
 
5145
5105
  let convertedStyles = processProperties({
5146
5106
  'prop': 'xOffset - Android Only',
@@ -5218,11 +5178,7 @@ function pagingControlAlpha(modifiersAndValues) {
5218
5178
  exports.pagingControlAlpha = pagingControlAlpha;
5219
5179
 
5220
5180
  function pagingControlHeight(modifiersAndValues) {
5221
- modifiersAndValues = removeFractions(modifiersAndValues);
5222
-
5223
- delete modifiersAndValues.full;
5224
- delete modifiersAndValues.auto;
5225
- delete modifiersAndValues.screen;
5181
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
5226
5182
 
5227
5183
  return processProperties({
5228
5184
  'prop': 'pagingControlHeight - iOS Only',
@@ -5248,7 +5204,7 @@ function pagingControlTimeout(modifiersAndValues) {
5248
5204
  exports.pagingControlTimeout = pagingControlTimeout;
5249
5205
 
5250
5206
  function repeat(modifiersAndValues) {
5251
- delete modifiersAndValues[0];
5207
+ modifiersAndValues = removeFractions(modifiersAndValues, ['0']);
5252
5208
 
5253
5209
  return processProperties({
5254
5210
  'prop': 'repeat',
@@ -5274,11 +5230,7 @@ function repeatCount(modifiersAndValues) {
5274
5230
  exports.repeatCount = repeatCount;
5275
5231
 
5276
5232
  function rightButtonPadding(modifiersAndValues) {
5277
- modifiersAndValues = removeFractions(modifiersAndValues);
5278
-
5279
- delete modifiersAndValues.full;
5280
- delete modifiersAndValues.auto;
5281
- delete modifiersAndValues.screen;
5233
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
5282
5234
 
5283
5235
  return processProperties({
5284
5236
  'prop': 'rightButtonPadding - iOS Only',
@@ -5338,7 +5290,7 @@ function addNegativeValues(modifiersAndValues) {
5338
5290
 
5339
5291
 
5340
5292
  function rowCount(modifiersAndValues) {
5341
- delete modifiersAndValues[0];
5293
+ modifiersAndValues = removeFractions(modifiersAndValues, ['0']);
5342
5294
 
5343
5295
  let convertedStyles = processProperties({
5344
5296
  'prop': 'rowCount - iOS Only',
@@ -5354,11 +5306,7 @@ function rowCount(modifiersAndValues) {
5354
5306
  exports.rowCount = rowCount;
5355
5307
 
5356
5308
  function rowHeight(modifiersAndValues) {
5357
- modifiersAndValues = removeFractions(modifiersAndValues);
5358
-
5359
- delete modifiersAndValues.full;
5360
- delete modifiersAndValues.auto;
5361
- delete modifiersAndValues.screen;
5309
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
5362
5310
 
5363
5311
  return processProperties({
5364
5312
  'prop': 'rowHeight',
@@ -5372,7 +5320,9 @@ function rowHeight(modifiersAndValues) {
5372
5320
  exports.rowHeight = rowHeight;
5373
5321
 
5374
5322
  function scale(modifiersAndValues) {
5375
- modifiersAndValues[1] = '.01';
5323
+ if (modifiersAndValues) {
5324
+ modifiersAndValues[1] = '.01';
5325
+ }
5376
5326
 
5377
5327
  return processProperties({
5378
5328
  'prop': 'scale',
@@ -5384,11 +5334,7 @@ function scale(modifiersAndValues) {
5384
5334
  exports.scale = scale;
5385
5335
 
5386
5336
  function sectionHeaderTopPadding(modifiersAndValues) {
5387
- modifiersAndValues = removeFractions(modifiersAndValues);
5388
-
5389
- delete modifiersAndValues.full;
5390
- delete modifiersAndValues.auto;
5391
- delete modifiersAndValues.screen;
5337
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
5392
5338
 
5393
5339
  return processProperties({
5394
5340
  'prop': 'sectionHeaderTopPadding - iOS Only',
@@ -5402,11 +5348,7 @@ function sectionHeaderTopPadding(modifiersAndValues) {
5402
5348
  exports.sectionHeaderTopPadding = sectionHeaderTopPadding;
5403
5349
 
5404
5350
  function separatorHeight(modifiersAndValues) {
5405
- modifiersAndValues = removeFractions(modifiersAndValues);
5406
-
5407
- delete modifiersAndValues.full;
5408
- delete modifiersAndValues.auto;
5409
- delete modifiersAndValues.screen;
5351
+ modifiersAndValues = removeFractions(modifiersAndValues, ['full', 'auto', 'screen']);
5410
5352
 
5411
5353
  return processProperties({
5412
5354
  'prop': 'separatorHeight - Android Only',
@@ -5420,10 +5362,7 @@ function separatorHeight(modifiersAndValues) {
5420
5362
  exports.separatorHeight = separatorHeight;
5421
5363
 
5422
5364
  function shadowRadius(modifiersAndValues) {
5423
- delete modifiersAndValues[0];
5424
- delete modifiersAndValues.full;
5425
- delete modifiersAndValues.auto;
5426
- delete modifiersAndValues.screen;
5365
+ modifiersAndValues = removeFractions(modifiersAndValues, ['0', 'auto', 'full', 'screen']);
5427
5366
 
5428
5367
  _.each(modifiersAndValues, (value, key) => {
5429
5368
  if (key.includes('/')) {
@@ -5499,7 +5438,9 @@ function zIndex(modifiersAndValues) {
5499
5438
  exports.zIndex = zIndex;
5500
5439
 
5501
5440
  function zoomScale(modifiersAndValues) {
5502
- modifiersAndValues[1] = '.01';
5441
+ if (modifiersAndValues) {
5442
+ modifiersAndValues[1] = '.01';
5443
+ }
5503
5444
 
5504
5445
  return processProperties({
5505
5446
  'prop': 'zoomScale',
@@ -6188,7 +6129,7 @@ function customRules(_value, _key) {
6188
6129
  exports.customRules = customRules;
6189
6130
 
6190
6131
  //! The son of Mother Goose
6191
- function applyProperties(twStyles) {
6132
+ function compileApplyDirectives(twStyles) {
6192
6133
  let twStylesArray = twStyles.split(/\r?\n/);
6193
6134
  _.each(_applyClasses, (value, modifier) => {
6194
6135
  let indexOfModifier = findIndexOf(`'${modifier}':`, twStylesArray);
@@ -6257,7 +6198,7 @@ function applyProperties(twStyles) {
6257
6198
 
6258
6199
  return twStylesArray.join('\n');
6259
6200
  }
6260
- exports.applyProperties = applyProperties;
6201
+ exports.compileApplyDirectives = compileApplyDirectives;
6261
6202
 
6262
6203
  const arbitraryValuesTable = {
6263
6204
  // Spacing
@@ -6611,6 +6552,7 @@ function processProperties(info, selectorAndDeclarationBlock, selectorsAndValues
6611
6552
 
6612
6553
  return convertedStyles;
6613
6554
  }
6555
+ exports.processProperties = processProperties;
6614
6556
 
6615
6557
  function viewShadowAndroid() {
6616
6558
  let convertedStyles = processComments({
@@ -6874,14 +6816,21 @@ function remove_last_character(element) {
6874
6816
  return element.slice(0, element.length - 1)
6875
6817
  }
6876
6818
 
6877
- function removeFractions(modifiersAndValues) {
6878
- _.each(modifiersAndValues, (value, key) => {
6819
+ function removeFractions(modifiersAndValues, extras = []) {
6820
+ let newModifiersAndValues = { ...modifiersAndValues };
6821
+ _.each(newModifiersAndValues, (value, key) => {
6879
6822
  if (key.includes('/')) {
6880
- delete modifiersAndValues[key];
6823
+ delete newModifiersAndValues[key];
6881
6824
  }
6882
6825
  });
6883
6826
 
6884
- return modifiersAndValues;
6827
+ if (extras.length) {
6828
+ _.each(extras, key => {
6829
+ delete newModifiersAndValues[key];
6830
+ });
6831
+ }
6832
+
6833
+ return newModifiersAndValues;
6885
6834
  }
6886
6835
  exports.removeFractions = removeFractions;
6887
6836
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purgetss",
3
- "version": "5.3.13",
3
+ "version": "5.3.14",
4
4
  "description": "An extension for Titanium SDK that contains a set of Tailwind-like classes to easily and quickly create beautifully designed mobile apps.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -46,14 +46,14 @@
46
46
  "command-exists": "^1.2.9",
47
47
  "fontname": "^1.0.0",
48
48
  "framework7-icons": "^5.0.5",
49
- "glob": "^8.0.1",
49
+ "glob": "^8.0.3",
50
50
  "is-installed-globally": "^0.4.0",
51
51
  "junk": "3.1.0",
52
52
  "lodash": "^4.17.21",
53
53
  "path": "^0.12.7",
54
54
  "prompts": "^2.4.2",
55
55
  "read-css": "^0.3.0",
56
- "tailwindcss": "^3.0.24",
56
+ "tailwindcss": "^3.1.4",
57
57
  "traverse": "^0.6.6",
58
58
  "update-notifier": "^5.1.0",
59
59
  "xml-js": "^1.6.11"