purgetss 3.0.4 → 3.1.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.
- package/.editorconfig +1 -1
- package/README.md +3 -3
- package/assets/fonts/bootstrap-icons.ttf +0 -0
- package/assets/fonts/tabler-icons.ttf +0 -0
- package/assets/images/blend-modes.png +0 -0
- package/assets/images/shadow.png +0 -0
- package/bin/purgetss +6 -5
- package/dist/bootstrapicons.js +1714 -0
- package/dist/bootstrapicons.tss +1692 -0
- package/dist/tablericons.js +95 -1
- package/dist/tablericons.tss +94 -0
- package/dist/tailwind.tss +3242 -411
- package/docs/configuring-guide.md +18 -5
- package/docs/glossary.md +3 -4
- package/docs/new-glossary.md +8313 -0
- package/docs/whats-new/v2.5.0.md +6 -6
- package/docs/whats-new/v3.0.4.md +7 -6
- package/docs/whats-new/v3.0.5.md +136 -0
- package/docs/whats-new/v3.1.0.md +614 -0
- package/docs/whats-new/v3.1.1.md +262 -0
- package/index.js +397 -246
- package/lib/build-bootstrap-icons-js.js +64 -0
- package/lib/build-bootstrap-icons-tss.js +50 -0
- package/lib/build-fonts-folder.js +7 -0
- package/lib/build-tailwind.js +78 -16
- package/lib/helpers.js +2027 -764
- package/lib/templates/bootstrap-icons/bootstrap-icons.css +1705 -0
- package/lib/templates/bootstrap-icons/bootstrap-icons.ttf +0 -0
- package/lib/templates/bootstrap-icons/reset.tss +6 -0
- package/lib/templates/bootstrap-icons/template.js +4 -0
- package/lib/templates/bootstrap-icons/template.tss +2 -0
- package/lib/templates/custom-template.tss +1 -1
- package/lib/templates/tablericons/template.js +1 -1
- package/lib/templates/tailwind/custom-template.tss +1 -1
- package/lib/templates/tailwind/template.tss +1 -1
- package/lib/test-function.js +9 -0
- package/package.json +8 -5
- package/purgetss.config.js +950 -0
package/index.js
CHANGED
|
@@ -45,10 +45,11 @@ const destConfigJSFile = cwd + '/purgetss/config.js';
|
|
|
45
45
|
const srcLibLI = path.resolve(__dirname, './dist/lineicons.js');
|
|
46
46
|
const srcLibBX = path.resolve(__dirname, './dist/boxicons.js');
|
|
47
47
|
const srcLibF7 = path.resolve(__dirname, './dist/framework7icons.js');
|
|
48
|
-
const
|
|
49
|
-
const srcPurgeTSSLibrary = path.resolve(__dirname, './dist/purgetss.ui.js');
|
|
48
|
+
const srcLibTI = path.resolve(__dirname, './dist/tablericons.js');
|
|
50
49
|
const srcLibFA = path.resolve(__dirname, './dist/fontawesome.js');
|
|
51
50
|
const srcLibMD = path.resolve(__dirname, './dist/materialdesignicons.js');
|
|
51
|
+
const srcLibBI = path.resolve(__dirname, './dist/bootstrapicons.js');
|
|
52
|
+
const srcPurgeTSSLibrary = path.resolve(__dirname, './dist/purgetss.ui.js');
|
|
52
53
|
|
|
53
54
|
//
|
|
54
55
|
const customTailwindFile = cwd + '/purgetss/tailwind.tss';
|
|
@@ -90,13 +91,16 @@ const srcFontAwesomeBetaFontFamilies = {
|
|
|
90
91
|
const srcFontsFolder = path.resolve(__dirname, './assets/fonts');
|
|
91
92
|
const srcResetTSSFile = path.resolve(__dirname, './dist/reset.tss');
|
|
92
93
|
const srcJMKFile = path.resolve(__dirname, './lib/templates/alloy.jmk');
|
|
94
|
+
|
|
95
|
+
const srcBoxIconsFontTSSFile = path.resolve(__dirname, './dist/boxicons.tss');
|
|
93
96
|
const srcFontAwesomeTSSFile = path.resolve(__dirname, './dist/fontawesome.tss');
|
|
94
97
|
const srcLineiconsFontTSSFile = path.resolve(__dirname, './dist/lineicons.tss');
|
|
95
|
-
const srcBoxIconsFontTSSFile = path.resolve(__dirname, './dist/boxicons.tss');
|
|
96
|
-
const srcFramework7FontTSSFile = path.resolve(__dirname, './dist/framework7icons.tss');
|
|
97
98
|
const srcTablerIconsFontTSSFile = path.resolve(__dirname, './dist/tablericons.tss');
|
|
98
|
-
const
|
|
99
|
+
const srcFramework7FontTSSFile = path.resolve(__dirname, './dist/framework7icons.tss');
|
|
99
100
|
const srcMaterialDesignIconsTSSFile = path.resolve(__dirname, './dist/materialdesignicons.tss');
|
|
101
|
+
const srcBootstrapIconsFontTSSFile = path.resolve(__dirname, './dist/bootstrapicons.tss');
|
|
102
|
+
|
|
103
|
+
const srcPurgetssConfigFile = path.resolve(__dirname, './lib/templates/purgetss.config.js');
|
|
100
104
|
//
|
|
101
105
|
|
|
102
106
|
//! Interfase
|
|
@@ -138,6 +142,7 @@ function copyFonts(options) {
|
|
|
138
142
|
copyFont('bx');
|
|
139
143
|
copyFont('f7');
|
|
140
144
|
copyFont('ti');
|
|
145
|
+
copyFont('bi');
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
if (options.modules) {
|
|
@@ -164,6 +169,7 @@ function copyFontLibraries(options) {
|
|
|
164
169
|
copyFontLibrary('bx');
|
|
165
170
|
copyFontLibrary('f7');
|
|
166
171
|
copyFontLibrary('ti');
|
|
172
|
+
copyFontLibrary('bi');
|
|
167
173
|
}
|
|
168
174
|
}
|
|
169
175
|
}
|
|
@@ -222,6 +228,8 @@ function purgeClasses(options) {
|
|
|
222
228
|
|
|
223
229
|
tempPurged += purgeTablerIcons(uniqueClasses, cleanUniqueClasses);
|
|
224
230
|
|
|
231
|
+
tempPurged += purgeBootstrapIcons(uniqueClasses, cleanUniqueClasses);
|
|
232
|
+
|
|
225
233
|
saveFile(destAppTSSFile, tempPurged);
|
|
226
234
|
|
|
227
235
|
logger.file('app.tss');
|
|
@@ -259,68 +267,80 @@ module.exports.init = init;
|
|
|
259
267
|
|
|
260
268
|
//! Command: create
|
|
261
269
|
function create(args, options) {
|
|
270
|
+
start();
|
|
262
271
|
const { exec } = require("child_process");
|
|
263
272
|
const commandExistsSync = require('command-exists').sync;
|
|
264
273
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
exec(`ti config app.idprefix && ti config app.workspace`, (error, stdout, stderr) => {
|
|
268
|
-
if (error) {
|
|
269
|
-
return logger.error(error);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// if (stderr) {
|
|
273
|
-
// return logger.warn(stderr);
|
|
274
|
-
// }
|
|
274
|
+
exec(`ti config app.idprefix && ti config app.workspace`, (error, stdout) => {
|
|
275
275
|
|
|
276
276
|
let results = stdout.split('\n');
|
|
277
|
-
|
|
278
277
|
let idPrefix = results[0];
|
|
279
278
|
let workspace = results[1];
|
|
280
279
|
|
|
281
|
-
if (
|
|
282
|
-
let theIDPrefix = `${idPrefix}.${args.name.replace(/ /g, '').replace(/_/g, '').toLowerCase()}`;
|
|
280
|
+
// if (error) return logger.error(error);
|
|
283
281
|
|
|
284
|
-
|
|
282
|
+
if (idPrefix !== 'app.idprefix not found' && workspace !== '') {
|
|
283
|
+
console.log('');
|
|
284
|
+
logger.info('Creating a new Titanium project');
|
|
285
285
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
286
|
+
let theIDPrefix = `${idPrefix}.${args.name.replace(/ /g, '').replace(/-/g, '').replace(/_/g, '').toLowerCase()}`;
|
|
287
|
+
|
|
288
|
+
let tiCreateCommand = `ti create -t app -p all -n "${args.name}" --no-prompt --id ${theIDPrefix}`;
|
|
290
289
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
// }
|
|
290
|
+
exec(tiCreateCommand, (error) => {
|
|
291
|
+
if (error) return logger.error(error);
|
|
294
292
|
|
|
295
|
-
|
|
293
|
+
let fonts = (options.vendor) ? `&& purgetss f -m -v=${options.vendor}` : '';
|
|
296
294
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
if (commandExistsSync('code')) {
|
|
300
|
-
theOpenCommand = 'code .';
|
|
301
|
-
} else if (commandExistsSync('subl')) {
|
|
302
|
-
theOpenCommand = 'subl .';
|
|
303
|
-
} else {
|
|
304
|
-
theOpenCommand = 'open .';
|
|
295
|
+
if (options.vendor) {
|
|
296
|
+
logger.info('Installing requested fonts');
|
|
305
297
|
}
|
|
306
298
|
|
|
307
|
-
let
|
|
308
|
-
let cdToProject = `cd ${workspace}/"${args.name}" && alloy new && purgetss w && purgetss b ${fonts} && ${theOpenCommand}`;
|
|
299
|
+
let cdToProject = `cd ${workspace}/"${args.name}" && alloy new && purgetss w && purgetss b ${fonts}`;
|
|
309
300
|
|
|
310
|
-
exec(cdToProject, (error
|
|
311
|
-
if (error)
|
|
312
|
-
|
|
301
|
+
exec(cdToProject, (error) => {
|
|
302
|
+
if (error) return logger.error(error);
|
|
303
|
+
|
|
304
|
+
let theOpenCommand;
|
|
305
|
+
if (commandExistsSync('code')) {
|
|
306
|
+
theOpenCommand = `cd ${workspace}/"${args.name}" && code .`;
|
|
307
|
+
} else if (commandExistsSync('subl')) {
|
|
308
|
+
theOpenCommand = `cd ${workspace}/"${args.name}" && subl .`;
|
|
309
|
+
} else {
|
|
310
|
+
theOpenCommand = `cd ${workspace}/"${args.name}" && open .`;
|
|
313
311
|
}
|
|
314
312
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
313
|
+
if (options.tailwind) {
|
|
314
|
+
logger.info('Installing Tailwind CSS');
|
|
315
|
+
|
|
316
|
+
let installTailwind = `cd ${workspace}/"${args.name}" && npm init -y && npm i tailwindcss -D && npx tailwindcss init`;
|
|
317
|
+
|
|
318
|
+
exec(installTailwind, (error) => {
|
|
319
|
+
if (error) return logger.error(error);
|
|
320
|
+
|
|
321
|
+
finish(chalk.yellow(`‘${args.name}’`) + ' project created successfully in');
|
|
318
322
|
|
|
319
|
-
|
|
323
|
+
exec(theOpenCommand, (error) => {
|
|
324
|
+
if (error) return logger.error(error);
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
} else {
|
|
328
|
+
finish(chalk.yellow(`‘${args.name}’`) + ' project created successfully in');
|
|
329
|
+
|
|
330
|
+
exec(theOpenCommand, (error) => {
|
|
331
|
+
if (error) return logger.error(error);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
320
334
|
});
|
|
321
335
|
});
|
|
322
336
|
} else {
|
|
323
|
-
|
|
337
|
+
console.log('');
|
|
338
|
+
logger.error('::Can’t create a Titanium project::');
|
|
339
|
+
logger.info('You need to have', chalk.green('`app.idprefix`'), 'and', chalk.green('`app.workspace`'), 'configured to create a Project with', chalk.green('`PurgeTSS`'));
|
|
340
|
+
console.log('');
|
|
341
|
+
logger.info('Please, set them like this:');
|
|
342
|
+
logger.info(chalk.green('ti config app.idprefix'), chalk.yellow("'com.your.reverse.domain'"));
|
|
343
|
+
logger.info(chalk.green('ti config app.workspace'), chalk.yellow("'path/to/your/workspace/directory'"));
|
|
324
344
|
}
|
|
325
345
|
});
|
|
326
346
|
}
|
|
@@ -491,6 +511,12 @@ function copyTablerIconsFonts() {
|
|
|
491
511
|
logger.info('tabler-icons Font copied to', chalk.yellow('./app/assets/fonts'), 'folder');
|
|
492
512
|
}
|
|
493
513
|
|
|
514
|
+
function copyBootstrapIconsFonts() {
|
|
515
|
+
// Bootstrap Icons Font
|
|
516
|
+
copyFile(srcFontsFolder + '/bootstrap-icons.ttf', 'bootstrap-icons.ttf');
|
|
517
|
+
logger.info('bootstrap-icons Font copied to', chalk.yellow('./app/assets/fonts'), 'folder');
|
|
518
|
+
}
|
|
519
|
+
|
|
494
520
|
function processFontawesomeStyles(data) {
|
|
495
521
|
let convertedTSSClasses = '';
|
|
496
522
|
|
|
@@ -701,18 +727,17 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
701
727
|
delete defaultColors.trueGray;
|
|
702
728
|
delete defaultColors.warmGray;
|
|
703
729
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}
|
|
730
|
+
// !Prepare values
|
|
731
|
+
configFile.theme.extend = configFile.theme.extend ?? {};
|
|
707
732
|
|
|
708
733
|
let allWidthsCombined = (configFile.theme.spacing) ? { ...{ full: '100%', auto: '', screen: '' }, ...configFile.theme.spacing } : { ...defaultTheme.width({ theme: () => (defaultTheme.spacing) }) };
|
|
709
734
|
let allHeightsCombined = (configFile.theme.spacing) ? { ...{ full: '100%', auto: '', screen: '' }, ...configFile.theme.spacing } : defaultTheme.height({ theme: () => (defaultTheme.spacing) });
|
|
710
735
|
|
|
711
736
|
let overwritten = {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
737
|
+
width: configFile.theme.width ?? allWidthsCombined,
|
|
738
|
+
height: configFile.theme.height ?? allHeightsCombined,
|
|
739
|
+
spacing: configFile.theme.spacing ?? { ...defaultTheme.spacing },
|
|
740
|
+
colors: configFile.theme.colors ?? { transparent: 'transparent', ...defaultColors },
|
|
716
741
|
}
|
|
717
742
|
|
|
718
743
|
let base = {
|
|
@@ -754,33 +779,9 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
754
779
|
configFile.theme['Window'] = _.merge({ default: { backgroundColor: '#ffffff' } }, configFile.theme.Window);
|
|
755
780
|
}
|
|
756
781
|
|
|
757
|
-
configFile.theme.
|
|
758
|
-
|
|
759
|
-
configFile.theme.backgroundColor = combineKeys(configFile.theme, base.colors, 'backgroundColor', true);
|
|
760
|
-
|
|
761
|
-
configFile.theme.backgroundSelectedColor = combineKeys(configFile.theme, base.colors, 'backgroundSelectedColor', true);
|
|
762
|
-
|
|
763
|
-
configFile.theme.barColor = combineKeys(configFile.theme, base.colors, 'barColor', true);
|
|
764
|
-
configFile.theme.navTintColor = combineKeys(configFile.theme, base.colors, 'navTintColor', true);
|
|
765
|
-
configFile.theme.tabsBackgroundColor = combineKeys(configFile.theme, base.colors, 'tabsBackgroundColor', true);
|
|
766
|
-
configFile.theme.titleColor = combineKeys(configFile.theme, base.colors, 'titleColor', true);
|
|
767
|
-
configFile.theme.activeTintColor = combineKeys(configFile.theme, base.colors, 'activeTintColor', true);
|
|
768
|
-
configFile.theme.activeTitleColor = combineKeys(configFile.theme, base.colors, 'activeTitleColor', true);
|
|
769
|
-
|
|
770
|
-
configFile.theme.borderColor = combineKeys(configFile.theme, base.colors, 'borderColor', true);
|
|
771
|
-
|
|
772
|
-
configFile.theme.pagingControlAlpha = (configFile.theme.opacity) ? _.merge(configFile.theme.opacity, configFile.theme.extend.opacity) : _.merge(defaultTheme.opacity, configFile.theme.extend.opacity);
|
|
773
|
-
|
|
774
|
-
configFile.theme.pagingControlTimeout = { ...defaultTheme.transitionDelay, ...configFile.theme.transitionDelay, ...configFile.theme.extend.transitionDelay };
|
|
775
|
-
|
|
776
|
-
configFile.theme.pagingControlColor = combineKeys(configFile.theme, base.colors, 'pagingControlColor', true);
|
|
777
|
-
|
|
778
|
-
configFile.theme.pageIndicatorColor = combineKeys(configFile.theme, base.colors, 'pageIndicatorColor', true);
|
|
779
|
-
|
|
780
|
-
configFile.theme.currentPageIndicatorColor = combineKeys(configFile.theme, base.colors, 'currentPageIndicatorColor', true);
|
|
781
|
-
|
|
782
|
-
configFile.theme.cacheSize = {};
|
|
782
|
+
let defaultBorderRadius = (configFile.theme.spacing || configFile.theme.borderRadius) ? {} : { ...defaultTheme.borderRadius, ...base.spacing };
|
|
783
783
|
|
|
784
|
+
// Some clean up
|
|
784
785
|
// pagingControlHeight
|
|
785
786
|
delete base.height['fit'];
|
|
786
787
|
delete base.height['max'];
|
|
@@ -788,116 +789,174 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
788
789
|
delete base.height['min-content'];
|
|
789
790
|
delete base.height['max-content'];
|
|
790
791
|
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
configFile.theme.
|
|
798
|
-
|
|
799
|
-
configFile.theme.
|
|
800
|
-
configFile.theme.
|
|
801
|
-
|
|
802
|
-
configFile.theme.
|
|
803
|
-
|
|
804
|
-
configFile.theme.
|
|
805
|
-
|
|
806
|
-
configFile.theme.
|
|
807
|
-
|
|
808
|
-
configFile.theme.
|
|
809
|
-
|
|
810
|
-
configFile.theme.fontFamily = combineKeys(configFile.theme, {}, 'fontFamily', false);
|
|
811
|
-
|
|
812
|
-
if (!Object.keys(configFile.theme.fontFamily).length) {
|
|
813
|
-
delete configFile.theme.fontFamily;
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
configFile.theme.gaps = combineKeys(configFile.theme, base.spacing, 'margin', true);
|
|
817
|
-
|
|
818
|
-
configFile.theme.gridFlow = {};
|
|
819
|
-
|
|
820
|
-
configFile.theme.gridSystem = {};
|
|
821
|
-
|
|
822
|
-
configFile.theme.gridColumnsStartEnd = {};
|
|
823
|
-
|
|
824
|
-
configFile.theme.textAlign = {};
|
|
792
|
+
// !Core Properties
|
|
793
|
+
|
|
794
|
+
// !Combine `key` values from configFile.theme with base.values or with default.values to generate classes
|
|
795
|
+
|
|
796
|
+
// Android Specific
|
|
797
|
+
configFile.theme.activeIconIsMask = {};
|
|
798
|
+
configFile.theme.activeTintColor = combineKeys(configFile.theme, base.colors, 'activeTintColor');
|
|
799
|
+
configFile.theme.activeTitleColor = combineKeys(configFile.theme, base.colors, 'activeTitleColor');
|
|
800
|
+
configFile.theme.activityEnterTransition = {};
|
|
801
|
+
configFile.theme.activityExitTransition = {};
|
|
802
|
+
configFile.theme.activityIndicatorStyle = {};
|
|
803
|
+
configFile.theme.activityReenterTransition = {};
|
|
804
|
+
configFile.theme.activityReturnTransition = {};
|
|
805
|
+
configFile.theme.activitySharedElementEnterTransition = {};
|
|
806
|
+
configFile.theme.activitySharedElementExitTransition = {};
|
|
807
|
+
configFile.theme.activitySharedElementReenterTransition = {};
|
|
808
|
+
configFile.theme.activitySharedElementReturnTransition = {};
|
|
809
|
+
configFile.theme.allowUserCustomization = {};
|
|
810
|
+
configFile.theme.autoAdjustScrollViewInsets = {};
|
|
825
811
|
configFile.theme.autocapitalization = {};
|
|
826
|
-
configFile.theme.
|
|
827
|
-
configFile.theme.
|
|
812
|
+
configFile.theme.autocorrect = {};
|
|
813
|
+
configFile.theme.autofillType = {};
|
|
828
814
|
configFile.theme.autoLink = {};
|
|
815
|
+
configFile.theme.autoreverse = {};
|
|
816
|
+
configFile.theme.backgroundBlendMode = {};
|
|
817
|
+
configFile.theme.backgroundColor = combineKeys(configFile.theme, base.colors, 'backgroundColor');
|
|
818
|
+
configFile.theme.backgroundLinearGradient = {};
|
|
819
|
+
configFile.theme.backgroundRadialGradient = {};
|
|
820
|
+
configFile.theme.backgroundSelectedColor = combineKeys(configFile.theme, base.colors, 'backgroundSelectedColor');
|
|
821
|
+
configFile.theme.barColor = combineKeys(configFile.theme, base.colors, 'barColor');
|
|
822
|
+
configFile.theme.barTitleColor = combineKeys(configFile.theme, base.colors, 'barTitleColor');
|
|
823
|
+
configFile.theme.barTitleShadow = {};
|
|
824
|
+
configFile.theme.barTitleShadowColor = combineKeys(configFile.theme, base.colors, 'barTitleShadowColor');;
|
|
825
|
+
configFile.theme.borderColor = combineKeys(configFile.theme, base.colors, 'borderColor');
|
|
826
|
+
configFile.theme.borderRadiusExtraStyles = combineKeys(configFile.theme, _.merge(defaultBorderRadius, configFile.theme.spacing, configFile.theme.extend.spacing), 'borderRadius');
|
|
829
827
|
configFile.theme.borderStyle = {};
|
|
828
|
+
configFile.theme.borderWidth = combineKeys(configFile.theme, defaultTheme.borderWidth, 'borderWidth');
|
|
829
|
+
configFile.theme.bottomNavigation = combineKeys(configFile.theme, base.spacing, 'bottomNavigation');
|
|
830
|
+
configFile.theme.bubbleParent = {};
|
|
831
|
+
configFile.theme.cacheSize = {};
|
|
832
|
+
configFile.theme.clipMode = {};
|
|
833
|
+
configFile.theme.currentPageIndicatorColor = combineKeys(configFile.theme, base.colors, 'currentPageIndicatorColor');
|
|
834
|
+
configFile.theme.disableBounce = {};
|
|
835
|
+
configFile.theme.displayCaps = {};
|
|
836
|
+
configFile.theme.displayUtilities = {};
|
|
837
|
+
configFile.theme.draggingConstraints = {};
|
|
838
|
+
configFile.theme.draggingType = {};
|
|
839
|
+
configFile.theme.dropShadow = {};
|
|
840
|
+
configFile.theme.dropShadowColor = combineKeys(configFile.theme, base.colors, 'dropShadowColor');
|
|
830
841
|
configFile.theme.editable = {};
|
|
831
842
|
configFile.theme.ellipsize = {};
|
|
832
843
|
configFile.theme.enableCopy = {};
|
|
833
844
|
configFile.theme.enableReturnKey = {};
|
|
845
|
+
configFile.theme.exitOnClose = {};
|
|
834
846
|
configFile.theme.extendBackground = {};
|
|
835
|
-
configFile.theme.
|
|
836
|
-
configFile.theme.
|
|
837
|
-
configFile.theme.
|
|
838
|
-
configFile.theme.
|
|
839
|
-
|
|
840
|
-
configFile.theme.
|
|
841
|
-
configFile.theme.
|
|
842
|
-
configFile.theme.
|
|
843
|
-
configFile.theme.
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
configFile.theme.
|
|
847
|
-
|
|
848
|
-
configFile.theme.
|
|
849
|
-
|
|
850
|
-
configFile.theme.displayUtilities = {};
|
|
851
|
-
|
|
852
|
-
configFile.theme.margin = combineKeys(configFile.theme, base.spacing, 'margin', true);
|
|
853
|
-
|
|
854
|
-
configFile.theme.padding = combineKeys(configFile.theme, base.spacing, 'padding', true);
|
|
855
|
-
|
|
856
|
-
configFile.theme.width = base.width;
|
|
847
|
+
configFile.theme.extendEdges = {};
|
|
848
|
+
configFile.theme.extendSafeArea = {};
|
|
849
|
+
configFile.theme.flagSecure = {};
|
|
850
|
+
configFile.theme.flip = {};
|
|
851
|
+
configFile.theme.fontFamily = combineKeys(configFile.theme, {}, 'fontFamily');
|
|
852
|
+
configFile.theme.fontSize = combineKeys(configFile.theme, defaultTheme.fontSize, 'fontSize');
|
|
853
|
+
configFile.theme.fontStyle = {};
|
|
854
|
+
configFile.theme.fontWeight = combineKeys(configFile.theme, defaultTheme.fontWeight, 'fontWeight');
|
|
855
|
+
configFile.theme.fullscreen = {};
|
|
856
|
+
configFile.theme.gap = combineKeys(configFile.theme, base.spacing, 'margin');
|
|
857
|
+
configFile.theme.gradientColorStops = combineKeys(configFile.theme, base.colors, 'gradientColorStops');
|
|
858
|
+
configFile.theme.gridColumnsStartEnd = {};
|
|
859
|
+
configFile.theme.gridFlow = {};
|
|
860
|
+
configFile.theme.gridSystem = {};
|
|
857
861
|
configFile.theme.height = base.height;
|
|
858
|
-
|
|
859
|
-
configFile.theme.
|
|
860
|
-
configFile.theme.
|
|
861
|
-
|
|
862
|
-
configFile.theme.
|
|
863
|
-
|
|
862
|
+
configFile.theme.hidesBackButton = {};
|
|
863
|
+
configFile.theme.hidesBarsOnSwipe = {};
|
|
864
|
+
configFile.theme.hidesBarsOnTap = {};
|
|
865
|
+
configFile.theme.hidesBarsWhenKeyboardAppears = {};
|
|
866
|
+
configFile.theme.hideShadow = {};
|
|
867
|
+
configFile.theme.hidesSearchBarWhenScrolling = {};
|
|
868
|
+
configFile.theme.homeIndicatorAutoHidden = {};
|
|
869
|
+
configFile.theme.iconIsMask = {};
|
|
870
|
+
configFile.theme.includeOpaqueBars = {};
|
|
871
|
+
configFile.theme.indicatorColor = combineKeys(configFile.theme, base.colors, 'indicatorColor');
|
|
864
872
|
configFile.theme.interactivity = {};
|
|
865
|
-
|
|
866
873
|
configFile.theme.items = {};
|
|
874
|
+
configFile.theme.keepScreenOn = {};
|
|
875
|
+
configFile.theme.keepSectionsInSearch = {};
|
|
876
|
+
configFile.theme.keyboardAppearance = {};
|
|
877
|
+
configFile.theme.keyboardDismissMode = {};
|
|
878
|
+
configFile.theme.keyboardType = {};
|
|
879
|
+
configFile.theme.largeTitleDisplayMode = {};
|
|
880
|
+
configFile.theme.largeTitleEnabled = {};
|
|
867
881
|
configFile.theme.layout = {};
|
|
868
|
-
configFile.theme.
|
|
869
|
-
configFile.theme.
|
|
870
|
-
configFile.theme.
|
|
871
|
-
configFile.theme.
|
|
872
|
-
configFile.theme.
|
|
873
|
-
configFile.theme.
|
|
874
|
-
configFile.theme.
|
|
875
|
-
configFile.theme.
|
|
876
|
-
configFile.theme.
|
|
877
|
-
configFile.theme.
|
|
878
|
-
configFile.theme.origin = { ...configFile.theme.origin, ...configFile.theme.extend.origin };
|
|
879
|
-
configFile.theme.scale = { ...defaultTheme.scale, ...configFile.theme.scale, ...configFile.theme.extend.scale };
|
|
880
|
-
configFile.theme.rotate = { ...defaultTheme.rotate, ...configFile.theme.rotate, ...configFile.theme.extend.rotate };
|
|
881
|
-
configFile.theme.transitionDelay = { ...defaultTheme.transitionDelay, ...configFile.theme.transitionDelay, ...configFile.theme.extend.transitionDelay };
|
|
882
|
-
configFile.theme.transitionDuration = { ...defaultTheme.transitionDuration, ...configFile.theme.transitionDuration, ...configFile.theme.extend.transitionDuration };
|
|
883
|
-
|
|
884
|
-
configFile.theme.bounce = {};
|
|
882
|
+
configFile.theme.lazyLoadingEnabled = {};
|
|
883
|
+
configFile.theme.loginKeyboardType = {};
|
|
884
|
+
configFile.theme.loginReturnKeyType = {};
|
|
885
|
+
configFile.theme.margin = combineKeys(configFile.theme, base.spacing, 'margin');
|
|
886
|
+
configFile.theme.modal = {};
|
|
887
|
+
configFile.theme.navBarHidden = {};
|
|
888
|
+
configFile.theme.navTintColor = combineKeys(configFile.theme, base.colors, 'navTintColor');
|
|
889
|
+
configFile.theme.opacity = combineKeys(configFile.theme, defaultTheme.opacity, 'opacity');
|
|
890
|
+
configFile.theme.orientationModes = {};
|
|
891
|
+
configFile.theme.origin = {};
|
|
885
892
|
configFile.theme.overlay = {};
|
|
886
|
-
configFile.theme.
|
|
887
|
-
configFile.theme.
|
|
888
|
-
configFile.theme.scrolling = {};
|
|
893
|
+
configFile.theme.padding = combineKeys(configFile.theme, base.spacing, 'padding');
|
|
894
|
+
configFile.theme.pageIndicatorColor = combineKeys(configFile.theme, base.colors, 'pageIndicatorColor');
|
|
889
895
|
configFile.theme.pagingControl = {};
|
|
896
|
+
configFile.theme.pagingControlAlpha = combineKeys(configFile.theme, defaultTheme.opacity, 'opacity');
|
|
897
|
+
configFile.theme.pagingControlColor = combineKeys(configFile.theme, base.colors, 'pagingControlColor');
|
|
898
|
+
configFile.theme.pagingControlHeight = base.height;
|
|
890
899
|
configFile.theme.pagingControlOnTop = {};
|
|
891
|
-
configFile.theme.
|
|
892
|
-
configFile.theme.
|
|
900
|
+
configFile.theme.pagingControlTimeout = combineKeys(configFile.theme, { ...{ '0': '0ms', '25': '25ms', '50': '50ms', '2000': '2000ms', '3000': '3000ms', '4000': '4000ms', '5000': '5000ms' }, ...defaultTheme.transitionDelay }, 'pagingControlTimeout');
|
|
901
|
+
configFile.theme.passwordKeyboardType = {};
|
|
902
|
+
configFile.theme.pickerType = {};
|
|
903
|
+
configFile.theme.placeholderColor = combineKeys(configFile.theme, base.colors, 'placeholderColor');
|
|
904
|
+
configFile.theme.placement = {};
|
|
905
|
+
configFile.theme.preventDefaultImage = {};
|
|
906
|
+
configFile.theme.repeat = {};
|
|
907
|
+
configFile.theme.returnKeyType = {};
|
|
908
|
+
configFile.theme.rotate = combineKeys(configFile.theme, defaultTheme.rotate, 'rotate');
|
|
909
|
+
configFile.theme.scale = combineKeys(configFile.theme, { ...{ 5: '.05', 10: '.10', 25: '.25' }, ...defaultTheme.scale }, 'scale');
|
|
910
|
+
configFile.theme.scrollableRegion = {};
|
|
911
|
+
configFile.theme.scrollIndicators = {};
|
|
912
|
+
configFile.theme.scrollingEnabled = {};
|
|
913
|
+
configFile.theme.scrollType = {};
|
|
914
|
+
configFile.theme.shadow = {};
|
|
915
|
+
configFile.theme.shadowColor = combineKeys(configFile.theme, base.colors, 'shadowColor');
|
|
916
|
+
configFile.theme.shiftMode = {};
|
|
917
|
+
configFile.theme.showAsAction = {};
|
|
918
|
+
configFile.theme.showCancel = {};
|
|
919
|
+
configFile.theme.smoothScrollOnTabClick = {};
|
|
920
|
+
configFile.theme.statusBar = {};
|
|
921
|
+
configFile.theme.sustainedPerformanceMode = {};
|
|
922
|
+
configFile.theme.swipeToClose = {};
|
|
923
|
+
configFile.theme.tabBarHidden = {};
|
|
924
|
+
configFile.theme.tabGroupStyle = {};
|
|
925
|
+
configFile.theme.tabsBackgroundColor = combineKeys(configFile.theme, base.colors, 'tabsBackgroundColor');
|
|
926
|
+
configFile.theme.tabsBackgroundSelectedColor = combineKeys(configFile.theme, base.colors, 'tabsBackgroundSelectedColor');
|
|
927
|
+
configFile.theme.tabsTranslucent = {};
|
|
928
|
+
configFile.theme.textAlign = {};
|
|
929
|
+
configFile.theme.textColor = combineKeys(configFile.theme, base.colors, 'textColor');
|
|
930
|
+
configFile.theme.tiMedia = {};
|
|
931
|
+
configFile.theme.tintColor = combineKeys(configFile.theme, base.colors, 'tintColor');
|
|
932
|
+
configFile.theme.titleColor = combineKeys(configFile.theme, base.colors, 'titleColor');
|
|
933
|
+
configFile.theme.touchFeedbackColor = combineKeys(configFile.theme, base.colors, 'touchFeedbackColor');
|
|
934
|
+
configFile.theme.transition = {};
|
|
935
|
+
configFile.theme.transitionDelay = combineKeys(configFile.theme, { ...{ '0': '0ms', '25': '25ms', '50': '50ms', '2000': '2000ms', '3000': '3000ms', '4000': '4000ms', '5000': '5000ms' }, ...defaultTheme.transitionDelay }, 'transitionDelay');
|
|
936
|
+
configFile.theme.transitionDuration = combineKeys(configFile.theme, { ...{ 0: '0ms', 25: '25ms', 50: '50ms' }, ...defaultTheme.transitionDuration }, 'transitionDuration');
|
|
937
|
+
configFile.theme.translucent = {};
|
|
938
|
+
configFile.theme.useSpinner = {};
|
|
939
|
+
configFile.theme.verticalAlignment = {};
|
|
940
|
+
configFile.theme.width = base.width;
|
|
941
|
+
configFile.theme.windowPixelFormat = {};
|
|
942
|
+
configFile.theme.windowSoftInputMode = {};
|
|
943
|
+
configFile.theme.zIndex = combineKeys(configFile.theme, defaultTheme.zIndex, 'zIndex');
|
|
893
944
|
|
|
945
|
+
// !Some final cleanup
|
|
894
946
|
delete configFile.theme.extend;
|
|
895
947
|
delete configFile.theme.colors;
|
|
896
948
|
delete configFile.theme.spacing;
|
|
897
949
|
delete configFile.theme.borderRadius;
|
|
898
950
|
|
|
899
|
-
|
|
900
|
-
delete configFile.theme
|
|
951
|
+
if (!Object.keys(configFile.theme.fontFamily).length) {
|
|
952
|
+
delete configFile.theme.fontFamily;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// !Delete corePlugins specified in the config file
|
|
956
|
+
let corePlugins = Array.isArray(configFile.corePlugins) ? configFile.corePlugins : Object.keys(configFile.corePlugins).map(key => key);
|
|
957
|
+
// convert Object to Array
|
|
958
|
+
_.each(corePlugins, value => {
|
|
959
|
+
delete configFile.theme[value];
|
|
901
960
|
});
|
|
902
961
|
|
|
903
962
|
let sorted = Object.entries(configFile.theme).sort().reduce((object, [key, value]) => (object[key] = value, object), {});
|
|
@@ -908,124 +967,173 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
908
967
|
|
|
909
968
|
tailwindStyles += `// config.js file updated on: ${getFileUpdatedDate(destConfigJSFile)}\n` + '\n// Custom Styles and Resets\n';
|
|
910
969
|
|
|
911
|
-
// console.log(JSON.stringify(sorted));
|
|
912
|
-
|
|
913
970
|
_.each(sorted, (value, key) => {
|
|
914
|
-
tailwindStyles +=
|
|
971
|
+
tailwindStyles += helpersToBuildCustomTailwindClasses(key, value);
|
|
915
972
|
});
|
|
916
973
|
|
|
917
|
-
// console.log(JSON.stringify(tailwindStyles));
|
|
918
|
-
|
|
919
974
|
fs.writeFileSync(customTailwindFile, helpers.applyProperties(tailwindStyles));
|
|
920
975
|
|
|
921
976
|
logger.info(chalk.yellow('./purgetss/tailwind.tss'), message);
|
|
922
977
|
}
|
|
923
978
|
|
|
924
979
|
//! Build tailwind's custom values
|
|
925
|
-
function
|
|
980
|
+
function helpersToBuildCustomTailwindClasses(key, value) {
|
|
926
981
|
switch (key) {
|
|
927
|
-
|
|
928
|
-
case '
|
|
929
|
-
case 'barColor': return helpers.barColor(value);
|
|
930
|
-
case 'titleColor': return helpers.titleColor(value);
|
|
982
|
+
|
|
983
|
+
case 'activeIconIsMask': return helpers.activeIconIsMask();
|
|
931
984
|
case 'activeTintColor': return helpers.activeTintColor(value);
|
|
932
985
|
case 'activeTitleColor': return helpers.activeTitleColor(value);
|
|
933
|
-
case '
|
|
934
|
-
case '
|
|
935
|
-
case '
|
|
936
|
-
case '
|
|
937
|
-
case '
|
|
938
|
-
case '
|
|
986
|
+
case 'activityEnterTransition': return helpers.activityEnterTransition();
|
|
987
|
+
case 'activityExitTransition': return helpers.activityExitTransition();
|
|
988
|
+
case 'activityIndicatorStyle': return helpers.activityIndicatorStyle();
|
|
989
|
+
case 'activityReenterTransition': return helpers.activityReenterTransition();
|
|
990
|
+
case 'activityReturnTransition': return helpers.activityReturnTransition();
|
|
991
|
+
case 'activitySharedElementEnterTransition': return helpers.activitySharedElementEnterTransition();
|
|
992
|
+
case 'activitySharedElementExitTransition': return helpers.activitySharedElementExitTransition();
|
|
993
|
+
case 'activitySharedElementReenterTransition': return helpers.activitySharedElementReenterTransition();
|
|
994
|
+
case 'activitySharedElementReturnTransition': return helpers.activitySharedElementReturnTransition();
|
|
995
|
+
case 'allowUserCustomization': return helpers.allowUserCustomization();
|
|
996
|
+
case 'autoAdjustScrollViewInsets': return helpers.autoAdjustScrollViewInsets();
|
|
997
|
+
case 'autocapitalization': return helpers.autocapitalization();
|
|
998
|
+
case 'autocorrect': return helpers.autocorrect();
|
|
999
|
+
case 'autofillType': return helpers.autofillType();
|
|
1000
|
+
case 'autoLink': return helpers.autoLink();
|
|
1001
|
+
case 'autoreverse': return helpers.autoreverse();
|
|
1002
|
+
case 'backgroundBlendMode': return helpers.backgroundBlendMode();
|
|
1003
|
+
case 'backgroundColor': return helpers.backgroundColor(value);
|
|
1004
|
+
case 'backgroundLinearGradient': return helpers.linearGradient();
|
|
1005
|
+
case 'backgroundRadialGradient': return helpers.radialGradient();
|
|
939
1006
|
case 'backgroundSelectedColor': return helpers.backgroundSelectedColor(value);
|
|
1007
|
+
case 'barColor': return helpers.barColor(value);
|
|
1008
|
+
case 'barTitleColor': return helpers.barTitleColor(value);
|
|
1009
|
+
case 'barTitleShadow': return helpers.barTitleShadow();
|
|
1010
|
+
case 'barTitleShadowColor': return helpers.barTitleShadowColor(value);
|
|
940
1011
|
case 'borderColor': return helpers.borderColor(value);
|
|
941
1012
|
case 'borderRadiusExtraStyles': return helpers.borderRadiusExtraStyles(value);
|
|
1013
|
+
case 'borderStyle': return helpers.borderStyle();
|
|
942
1014
|
case 'borderWidth': return helpers.borderWidth(value);
|
|
1015
|
+
case 'bottomNavigation': return helpers.bottomNavigation(value);
|
|
1016
|
+
case 'bubbleParent': return helpers.bubbleParent();
|
|
1017
|
+
case 'cacheSize': return helpers.cacheSize();
|
|
943
1018
|
case 'clipMode': return helpers.clipMode();
|
|
944
|
-
case '
|
|
945
|
-
case '
|
|
946
|
-
case '
|
|
1019
|
+
case 'currentPageIndicatorColor': return helpers.currentPageIndicatorColor(value);
|
|
1020
|
+
case 'disableBounce': return helpers.disableBounce();
|
|
1021
|
+
case 'displayCaps': return helpers.displayCaps();
|
|
1022
|
+
case 'displayUtilities': return helpers.displayUtilities();
|
|
947
1023
|
case 'draggingConstraints': return helpers.draggingConstraints();
|
|
948
1024
|
case 'draggingType': return helpers.draggingType();
|
|
949
|
-
case '
|
|
1025
|
+
case 'dropShadow': return helpers.dropShadow();
|
|
1026
|
+
case 'dropShadowColor': return helpers.dropShadowColor(value);
|
|
1027
|
+
case 'editable': return helpers.editable();
|
|
1028
|
+
case 'ellipsize': return helpers.ellipsize();
|
|
1029
|
+
case 'enableCopy': return helpers.enableCopy();
|
|
1030
|
+
case 'enableReturnKey': return helpers.enableReturnKey();
|
|
950
1031
|
case 'exitOnClose': return helpers.exitOnClose();
|
|
1032
|
+
case 'extendBackground': return helpers.extendBackground();
|
|
1033
|
+
case 'extendEdges': return helpers.extendEdges();
|
|
1034
|
+
case 'extendSafeArea': return helpers.extendSafeArea();
|
|
1035
|
+
case 'flagSecure': return helpers.flagSecure();
|
|
1036
|
+
case 'flip': return helpers.flip();
|
|
951
1037
|
case 'fontFamily': return helpers.fontFamily(value);
|
|
952
1038
|
case 'fontSize': return helpers.fontSize(value);
|
|
953
1039
|
case 'fontStyle': return helpers.fontStyle();
|
|
954
1040
|
case 'fontWeight': return helpers.fontWeight(value);
|
|
955
|
-
case '
|
|
1041
|
+
case 'fullscreen': return helpers.fullscreen();
|
|
1042
|
+
case 'gap': return helpers.gap(value);
|
|
956
1043
|
case 'gradientColorStops': return helpers.gradientColorStops(value);
|
|
957
1044
|
case 'gridColumnsStartEnd': return helpers.gridColumnsStartEnd();
|
|
958
1045
|
case 'gridFlow': return helpers.gridFlow();
|
|
959
1046
|
case 'gridSystem': return helpers.gridSystem();
|
|
960
1047
|
case 'height': return helpers.height(value);
|
|
961
|
-
case '
|
|
962
|
-
|
|
963
|
-
case '
|
|
964
|
-
case '
|
|
965
|
-
case '
|
|
966
|
-
case '
|
|
967
|
-
case '
|
|
968
|
-
case '
|
|
969
|
-
|
|
970
|
-
case '
|
|
971
|
-
case 'pagingControlTimeout': return helpers.pagingControlTimeout(value);
|
|
972
|
-
case 'pagingControlColor': return helpers.pagingControlColor(value);
|
|
973
|
-
case 'pageIndicatorColor': return helpers.pageIndicatorColor(value);
|
|
974
|
-
case 'currentPageIndicatorColor': return helpers.currentPageIndicatorColor(value);
|
|
975
|
-
case 'pagingControlHeight': return helpers.pagingControlHeight(value);
|
|
976
|
-
|
|
1048
|
+
case 'hidesBackButton': return helpers.hidesBackButton();
|
|
1049
|
+
case 'hidesBarsOnSwipe': return helpers.hidesBarsOnSwipe();
|
|
1050
|
+
case 'hidesBarsOnTap': return helpers.hidesBarsOnTap();
|
|
1051
|
+
case 'hidesBarsWhenKeyboardAppears': return helpers.hidesBarsWhenKeyboardAppears();
|
|
1052
|
+
case 'hideShadow': return helpers.hideShadow();
|
|
1053
|
+
case 'hidesSearchBarWhenScrolling': return helpers.hidesSearchBarWhenScrolling();
|
|
1054
|
+
case 'homeIndicatorAutoHidden': return helpers.homeIndicatorAutoHidden();
|
|
1055
|
+
case 'iconIsMask': return helpers.iconIsMask();
|
|
1056
|
+
case 'includeOpaqueBars': return helpers.includeOpaqueBars();
|
|
1057
|
+
case 'indicatorColor': return helpers.indicatorColor(value);
|
|
977
1058
|
case 'interactivity': return helpers.interactivity(value);
|
|
978
1059
|
case 'items': return helpers.items();
|
|
1060
|
+
case 'keepScreenOn': return helpers.keepScreenOn();
|
|
1061
|
+
case 'keepSectionsInSearch': return helpers.keepSectionsInSearch();
|
|
1062
|
+
case 'keyboardAppearance': return helpers.keyboardAppearance();
|
|
1063
|
+
case 'keyboardDismissMode': return helpers.keyboardDismissMode();
|
|
1064
|
+
case 'keyboardType': return helpers.keyboardType();
|
|
1065
|
+
case 'largeTitleDisplayMode': return helpers.largeTitleDisplayMode();
|
|
1066
|
+
case 'largeTitleEnabled': return helpers.largeTitleEnabled();
|
|
979
1067
|
case 'layout': return helpers.layout();
|
|
980
|
-
case '
|
|
1068
|
+
case 'lazyLoadingEnabled': return helpers.lazyLoadingEnabled();
|
|
1069
|
+
case 'loginKeyboardType': return helpers.loginKeyboardType();
|
|
1070
|
+
case 'loginReturnKeyType': return helpers.loginReturnKeyType();
|
|
981
1071
|
case 'margin': return helpers.margin(value);
|
|
982
|
-
|
|
1072
|
+
case 'modal': return helpers.modal();
|
|
1073
|
+
case 'navBarHidden': return helpers.navBarHidden();
|
|
1074
|
+
case 'navTintColor': return helpers.navTintColor(value);
|
|
983
1075
|
case 'opacity': return helpers.opacity(value);
|
|
1076
|
+
case 'orientationModes': return helpers.orientationModes();
|
|
1077
|
+
case 'origin': return helpers.origin();
|
|
1078
|
+
case 'overlay': return helpers.overlay();
|
|
984
1079
|
case 'padding': return helpers.padding(value);
|
|
1080
|
+
case 'pageIndicatorColor': return helpers.pageIndicatorColor(value);
|
|
1081
|
+
case 'pagingControl': return helpers.pagingControl();
|
|
1082
|
+
case 'pagingControlAlpha': return helpers.pagingControlAlpha(value);
|
|
1083
|
+
case 'pagingControlColor': return helpers.pagingControlColor(value);
|
|
1084
|
+
case 'pagingControlHeight': return helpers.pagingControlHeight(value);
|
|
1085
|
+
case 'pagingControlOnTop': return helpers.pagingControlOnTop();
|
|
1086
|
+
case 'pagingControlTimeout': return helpers.pagingControlTimeout(value);
|
|
1087
|
+
case 'passwordKeyboardType': return helpers.passwordKeyboardType();
|
|
1088
|
+
case 'pickerType': return helpers.pickerType();
|
|
985
1089
|
case 'placeholderColor': return helpers.placeholderColor(value);
|
|
986
1090
|
case 'placement': return helpers.placement();
|
|
987
|
-
case '
|
|
1091
|
+
case 'preventDefaultImage': return helpers.preventDefaultImage();
|
|
1092
|
+
case 'repeat': return helpers.repeat();
|
|
1093
|
+
case 'returnKeyType': return helpers.returnKeyType();
|
|
988
1094
|
case 'rotate': return helpers.rotate(value);
|
|
989
|
-
case 'origin': return helpers.origin(value);
|
|
990
1095
|
case 'scale': return helpers.scale(value);
|
|
991
1096
|
case 'scrollableRegion': return helpers.scrollableRegion();
|
|
992
1097
|
case 'scrollIndicators': return helpers.scrollIndicators();
|
|
1098
|
+
case 'scrollingEnabled': return helpers.scrollingEnabled();
|
|
993
1099
|
case 'scrollType': return helpers.scrollType();
|
|
994
1100
|
case 'shadow': return helpers.shadow();
|
|
995
1101
|
case 'shadowColor': return helpers.shadowColor(value);
|
|
996
|
-
case '
|
|
997
|
-
case '
|
|
998
|
-
case 'transitionDuration': return helpers.transitionDuration(value);
|
|
999
|
-
case 'textAlign': return helpers.textAlign();
|
|
1000
|
-
case 'autocapitalization': return helpers.autocapitalization();
|
|
1001
|
-
case 'autoLink': return helpers.autoLink();
|
|
1002
|
-
case 'borderStyle': return helpers.borderStyle();
|
|
1003
|
-
case 'cacheSize': return helpers.cacheSize();
|
|
1004
|
-
case 'editable': return helpers.editable();
|
|
1005
|
-
case 'ellipsize': return helpers.ellipsize();
|
|
1006
|
-
case 'enableCopy': return helpers.enableCopy();
|
|
1007
|
-
case 'enableReturnKey': return helpers.enableReturnKey();
|
|
1008
|
-
case 'extendBackground': return helpers.extendBackground();
|
|
1009
|
-
case 'keyboardAppearance': return helpers.keyboardAppearance();
|
|
1010
|
-
case 'keyboardType': return helpers.keyboardType();
|
|
1011
|
-
case 'returnKeyType': return helpers.returnKeyType();
|
|
1012
|
-
case 'autocorrect': return helpers.autocorrect();
|
|
1013
|
-
case 'autofillType': return helpers.autofillType();
|
|
1102
|
+
case 'shiftMode': return helpers.shiftMode();
|
|
1103
|
+
case 'showAsAction': return helpers.showAsAction();
|
|
1014
1104
|
case 'showCancel': return helpers.showCancel();
|
|
1105
|
+
case 'smoothScrollOnTabClick': return helpers.smoothScrollOnTabClick();
|
|
1106
|
+
case 'statusBar': return helpers.statusBar();
|
|
1107
|
+
case 'sustainedPerformanceMode': return helpers.sustainedPerformanceMode();
|
|
1108
|
+
case 'swipeToClose': return helpers.swipeToClose();
|
|
1109
|
+
case 'tabBarHidden': return helpers.tabBarHidden();
|
|
1110
|
+
case 'tabGroupStyle': return helpers.tabGroupStyle();
|
|
1111
|
+
case 'tabsBackgroundColor': return helpers.tabsBackgroundColor(value);
|
|
1112
|
+
case 'tabsBackgroundSelectedColor': return helpers.tabsBackgroundSelectedColor(value);
|
|
1113
|
+
case 'tabsTranslucent': return helpers.tabsTranslucent();
|
|
1114
|
+
case 'textAlign': return helpers.textAlign();
|
|
1015
1115
|
case 'textColor': return helpers.textColor(value);
|
|
1116
|
+
case 'tiMedia': return helpers.tiMedia();
|
|
1016
1117
|
case 'tintColor': return helpers.tintColor(value);
|
|
1118
|
+
case 'titleColor': return helpers.titleColor(value);
|
|
1017
1119
|
case 'touchFeedbackColor': return helpers.touchFeedbackColor(value);
|
|
1120
|
+
case 'transition': return helpers.transition(value);
|
|
1121
|
+
case 'transitionDelay': return helpers.transitionDelay(value);
|
|
1122
|
+
case 'transitionDuration': return helpers.transitionDuration(value);
|
|
1123
|
+
case 'translucent': return helpers.translucent();
|
|
1124
|
+
case 'useSpinner': return helpers.useSpinner(value);
|
|
1018
1125
|
case 'verticalAlignment': return helpers.verticalAlignment();
|
|
1019
1126
|
case 'width': return helpers.width(value);
|
|
1127
|
+
case 'windowPixelFormat': return helpers.windowPixelFormat();
|
|
1128
|
+
case 'windowSoftInputMode': return helpers.windowSoftInputMode();
|
|
1129
|
+
case 'zIndex': return helpers.zIndex(value);
|
|
1020
1130
|
|
|
1021
1131
|
default: return helpers.customRules(value, key);
|
|
1022
1132
|
}
|
|
1023
1133
|
}
|
|
1024
1134
|
|
|
1025
|
-
function combineKeys(values, base, key
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
return (values[key]) ? { ..._extras, ...values[key], ...values.extend[key] } : { ...base, ...values.extend[key] };
|
|
1135
|
+
function combineKeys(values, base, key) {
|
|
1136
|
+
return (values[key]) ? { ...values[key], ...values.extend[key] } : { ...base, ...values.extend[key] };
|
|
1029
1137
|
}
|
|
1030
1138
|
|
|
1031
1139
|
function extractClasses(currentText, currentFile) {
|
|
@@ -1111,6 +1219,11 @@ function copyFont(vendor) {
|
|
|
1111
1219
|
case 'tablericons':
|
|
1112
1220
|
copyTablerIconsFonts();
|
|
1113
1221
|
break;
|
|
1222
|
+
case 'bi':
|
|
1223
|
+
case 'bootstrap':
|
|
1224
|
+
case 'bootstrapicons':
|
|
1225
|
+
copyBootstrapIconsFonts();
|
|
1226
|
+
break;
|
|
1114
1227
|
}
|
|
1115
1228
|
}
|
|
1116
1229
|
|
|
@@ -1154,9 +1267,15 @@ function copyFontLibrary(vendor) {
|
|
|
1154
1267
|
case 'ti':
|
|
1155
1268
|
case 'tabler':
|
|
1156
1269
|
case 'tablericons':
|
|
1157
|
-
fs.copyFileSync(
|
|
1270
|
+
fs.copyFileSync(srcLibTI, destLibFolder + '/tablericons.js');
|
|
1158
1271
|
logger.info('Tabler Icons CommonJS module copied to', chalk.yellow('./app/lib'), 'folder');
|
|
1159
1272
|
break;
|
|
1273
|
+
case 'bi':
|
|
1274
|
+
case 'bootstrap':
|
|
1275
|
+
case 'bootstrapicons':
|
|
1276
|
+
fs.copyFileSync(srcLibBI, destLibFolder + '/bootstrapicons.js');
|
|
1277
|
+
logger.info('Bootstrap Icons CommonJS module copied to', chalk.yellow('./app/lib'), 'folder');
|
|
1278
|
+
break;
|
|
1160
1279
|
}
|
|
1161
1280
|
}
|
|
1162
1281
|
|
|
@@ -1213,7 +1332,7 @@ function finish(customMessage = 'Finished purging in') {
|
|
|
1213
1332
|
//! Purge Functions
|
|
1214
1333
|
//! Tailwind
|
|
1215
1334
|
function purgeTailwind(uniqueClasses) {
|
|
1216
|
-
let purgedClasses = '\n//
|
|
1335
|
+
let purgedClasses = '\n// Main styles\n';
|
|
1217
1336
|
let tailwindFile = (fs.existsSync(customTailwindFile)) ? customTailwindFile : defaultTailwindFile;
|
|
1218
1337
|
let tailwindClasses = fs.readFileSync(tailwindFile, 'utf8').split(/\r?\n/);
|
|
1219
1338
|
|
|
@@ -1248,56 +1367,70 @@ function purgeTailwind(uniqueClasses) {
|
|
|
1248
1367
|
}
|
|
1249
1368
|
});
|
|
1250
1369
|
|
|
1370
|
+
let comoArreglo = [];
|
|
1251
1371
|
tailwindClasses.forEach(tailwindClass => {
|
|
1252
1372
|
if (tailwindClass !== '' && !tailwindClass.includes('//')) {
|
|
1253
1373
|
let cleanTailwindClass = `${tailwindClass.split(':')[0].replace('.', '').replace(/'/g, '').replace(/ *\[[^\]]*]/, '')}`;
|
|
1254
1374
|
|
|
1255
1375
|
if (cleanUniqueClasses.indexOf(cleanTailwindClass) > -1) {
|
|
1256
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(cleanTailwindClass)]);
|
|
1376
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(cleanTailwindClass)]);
|
|
1377
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(cleanTailwindClass)]));
|
|
1257
1378
|
}
|
|
1258
1379
|
|
|
1259
1380
|
if (cleanUniqueClasses.indexOf(`ios:${cleanTailwindClass}`) > -1) {
|
|
1260
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`ios:${cleanTailwindClass}`)]);
|
|
1381
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`ios:${cleanTailwindClass}`)]);
|
|
1382
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`ios:${cleanTailwindClass}`)]));
|
|
1261
1383
|
}
|
|
1262
1384
|
|
|
1263
1385
|
if (cleanUniqueClasses.indexOf(`android:${cleanTailwindClass}`) > -1) {
|
|
1264
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`android:${cleanTailwindClass}`)]);
|
|
1386
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`android:${cleanTailwindClass}`)]);
|
|
1387
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`android:${cleanTailwindClass}`)]));
|
|
1265
1388
|
}
|
|
1266
1389
|
|
|
1267
1390
|
if (cleanUniqueClasses.indexOf(`tablet:${cleanTailwindClass}`) > -1) {
|
|
1268
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`tablet:${cleanTailwindClass}`)]);
|
|
1391
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`tablet:${cleanTailwindClass}`)]);
|
|
1392
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`tablet:${cleanTailwindClass}`)]));
|
|
1269
1393
|
}
|
|
1270
1394
|
|
|
1271
1395
|
if (cleanUniqueClasses.indexOf(`handheld:${cleanTailwindClass}`) > -1) {
|
|
1272
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`handheld:${cleanTailwindClass}`)]);
|
|
1396
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`handheld:${cleanTailwindClass}`)]);
|
|
1397
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`handheld:${cleanTailwindClass}`)]));
|
|
1273
1398
|
}
|
|
1274
1399
|
|
|
1275
1400
|
if (cleanUniqueClasses.indexOf(`open:${cleanTailwindClass}`) > -1) {
|
|
1276
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`open:${cleanTailwindClass}`)]);
|
|
1401
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`open:${cleanTailwindClass}`)]);
|
|
1402
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`open:${cleanTailwindClass}`)]));
|
|
1277
1403
|
}
|
|
1278
1404
|
|
|
1279
1405
|
if (cleanUniqueClasses.indexOf(`close:${cleanTailwindClass}`) > -1) {
|
|
1280
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`close:${cleanTailwindClass}`)]);
|
|
1406
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`close:${cleanTailwindClass}`)]);
|
|
1407
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`close:${cleanTailwindClass}`)]));
|
|
1281
1408
|
}
|
|
1282
1409
|
|
|
1283
1410
|
if (cleanUniqueClasses.indexOf(`drag:${cleanTailwindClass}`) > -1) {
|
|
1284
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`drag:${cleanTailwindClass}`)]);
|
|
1411
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`drag:${cleanTailwindClass}`)]);
|
|
1412
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`drag:${cleanTailwindClass}`)]));
|
|
1285
1413
|
}
|
|
1286
1414
|
|
|
1287
1415
|
if (cleanUniqueClasses.indexOf(`drop:${cleanTailwindClass}`) > -1) {
|
|
1288
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`drop:${cleanTailwindClass}`)]);
|
|
1416
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`drop:${cleanTailwindClass}`)]);
|
|
1417
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`drop:${cleanTailwindClass}`)]));
|
|
1289
1418
|
}
|
|
1290
1419
|
|
|
1291
1420
|
if (cleanUniqueClasses.indexOf(`complete:${cleanTailwindClass}`) > -1) {
|
|
1292
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`complete:${cleanTailwindClass}`)]);
|
|
1421
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`complete:${cleanTailwindClass}`)]);
|
|
1422
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`complete:${cleanTailwindClass}`)]));
|
|
1293
1423
|
}
|
|
1294
1424
|
|
|
1295
1425
|
if (cleanUniqueClasses.indexOf(`bounds:${cleanTailwindClass}`) > -1) {
|
|
1296
|
-
purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`bounds:${cleanTailwindClass}`)]);
|
|
1426
|
+
// purgedClasses += helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`bounds:${cleanTailwindClass}`)]);
|
|
1427
|
+
comoArreglo.push(helpers.checkPlatformAndDevice(tailwindClass, cleanUniqueClasses[cleanUniqueClasses.indexOf(`bounds:${cleanTailwindClass}`)]));
|
|
1297
1428
|
}
|
|
1298
1429
|
}
|
|
1299
1430
|
});
|
|
1300
1431
|
|
|
1432
|
+
purgedClasses += comoArreglo.join('');
|
|
1433
|
+
|
|
1301
1434
|
// Styles with color opacity modifiers
|
|
1302
1435
|
if (classesWithOpacityValues.length > 0) {
|
|
1303
1436
|
purgedClasses += '\n// Styles with color opacity modifiers\n';
|
|
@@ -1332,9 +1465,10 @@ function cleanClassNameFn(className) {
|
|
|
1332
1465
|
}
|
|
1333
1466
|
|
|
1334
1467
|
const arbitraryValuesTable = {
|
|
1335
|
-
// Check if they are really needed
|
|
1336
1468
|
'active-tint': '{ activeTintColor: {value} }',
|
|
1337
1469
|
'active-title': '{ activeTitleColor: {value} }',
|
|
1470
|
+
'bar-title': '{ titleAttributes : { color : {value} } }',
|
|
1471
|
+
'bar-title-shadow': '{ titleAttributes: { shadow: { color: {value} } } }',
|
|
1338
1472
|
'bar': '{ barColor: {value} }',
|
|
1339
1473
|
'bg-selected': '{ backgroundSelectedColor: {value} }',
|
|
1340
1474
|
'bg': '{ backgroundColor: {value} }',
|
|
@@ -1347,6 +1481,7 @@ const arbitraryValuesTable = {
|
|
|
1347
1481
|
'content': '{ contentWidth: {value}, contentHeight: {value} }',
|
|
1348
1482
|
'current-page': '{ currentPageIndicatorColor: {value} }',
|
|
1349
1483
|
'delay': '{ delay: {value} }',
|
|
1484
|
+
'drop-shadow': '{ shadowColor: {value} } }',
|
|
1350
1485
|
'duration': '{ duration: {value} }',
|
|
1351
1486
|
'feedback': '{ touchFeedback: true, touchFeedbackColor: {value} }',
|
|
1352
1487
|
'font': '{ fontWeight: {value} }',
|
|
@@ -1354,6 +1489,7 @@ const arbitraryValuesTable = {
|
|
|
1354
1489
|
'grid-cols': '{ width: Alloy.Globals.cols_{value} }',
|
|
1355
1490
|
'grid-rows': '{ height: Alloy.Globals.rows_{value} }',
|
|
1356
1491
|
'h': '{ height: {value}}',
|
|
1492
|
+
'indicator': '{ indicatorColor: {value} }',
|
|
1357
1493
|
'left': '{ left: {value} }',
|
|
1358
1494
|
'm': '{ top: {value}, right: {value}, bottom: {value}, left: {value} }',
|
|
1359
1495
|
'max-scale': '{ maxZoomScale: {value} }',
|
|
@@ -1368,6 +1504,9 @@ const arbitraryValuesTable = {
|
|
|
1368
1504
|
'opacity': '{ opacity: {value} }',
|
|
1369
1505
|
'origin': '{ anchorPoint: { x: {value}, y: {value1} } }',
|
|
1370
1506
|
'p': '{ padding: { top: {value}, right: {value}, bottom: {value}, left: {value} } }',
|
|
1507
|
+
'padding-bottom': '{ paddingBottom: {value} }',
|
|
1508
|
+
'padding-left': '{ paddingLeft: {value} }',
|
|
1509
|
+
'padding-right': '{ paddingRight: {value} }',
|
|
1371
1510
|
'page': '{ pageIndicatorColor: {value} }',
|
|
1372
1511
|
'paging-alpha': '{ pagingControlAlpha: {value} }',
|
|
1373
1512
|
'paging-color': '{ pagingControlColor: {value} }',
|
|
@@ -1386,11 +1525,11 @@ const arbitraryValuesTable = {
|
|
|
1386
1525
|
'tabs-bg': '{ tabsBackgroundColor: {value} }',
|
|
1387
1526
|
'text-color': '{ color: {value} }',
|
|
1388
1527
|
'text-size': '{ font: { fontSize: {value} } }',
|
|
1389
|
-
'tint': '{ tintColor: {value} }',
|
|
1528
|
+
'tint': '{ tint: {value}, tintColor: {value} }',
|
|
1390
1529
|
'title': '{ titleColor: {value} }',
|
|
1391
1530
|
'to': '{ backgroundGradient: { colors: [ {value} ] } }',
|
|
1392
1531
|
'top': '{ top: {value} }',
|
|
1393
|
-
'w': '{ width: {value} }'
|
|
1532
|
+
'w': '{ width: {value} }',
|
|
1394
1533
|
};
|
|
1395
1534
|
|
|
1396
1535
|
function formatArbitraryValues(arbitraryValue) {
|
|
@@ -1436,6 +1575,7 @@ function formatArbitraryValues(arbitraryValue) {
|
|
|
1436
1575
|
return `'.${arbitraryValue}': ` + _.replace(properties, new RegExp("{value}", "g"), helpers.parseValue(value, sign));
|
|
1437
1576
|
}
|
|
1438
1577
|
} else if (splitedContent.length === 3) {
|
|
1578
|
+
|
|
1439
1579
|
let rule = `${splitedContent[0]}-${splitedContent[1]}`;
|
|
1440
1580
|
|
|
1441
1581
|
let value = splitedContent[2].match(/(?<=\().*(?=\))/).pop();
|
|
@@ -1538,6 +1678,17 @@ function purgeTablerIcons(uniqueClasses, cleanUniqueClasses) {
|
|
|
1538
1678
|
return (purgedClasses === '\n// Tabler Icons styles\n') ? '' : purgedClasses;
|
|
1539
1679
|
}
|
|
1540
1680
|
|
|
1681
|
+
//! BootstrapIcons
|
|
1682
|
+
function purgeBootstrapIcons(uniqueClasses, cleanUniqueClasses) {
|
|
1683
|
+
let purgedClasses = '\n// Bootstrap Icons styles\n';
|
|
1684
|
+
|
|
1685
|
+
let sourceTSS = fs.readFileSync(srcBootstrapIconsFontTSSFile, 'utf8').split(/\r?\n/);
|
|
1686
|
+
|
|
1687
|
+
purgedClasses += processFontIcons(sourceTSS, uniqueClasses, 'Purging Bootstrap Icons styles...', cleanUniqueClasses, ['bi', 'bootstrap']);
|
|
1688
|
+
|
|
1689
|
+
return (purgedClasses === '\n// Bootstrap Icons styles\n') ? '' : purgedClasses;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1541
1692
|
function processFontIcons(sourceTSS, uniqueClasses, message, cleanUniqueClasses, fontFamily) {
|
|
1542
1693
|
let purgedClasses = '';
|
|
1543
1694
|
let soc = sourceTSS.toString();
|