@taiga-ui/icons 2.22.0 → 2.26.0

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.
Files changed (55) hide show
  1. package/README.md +7 -3
  2. package/all.d.ts +180 -178
  3. package/bundles/taiga-ui-icons-scripts.umd.js +368 -0
  4. package/bundles/taiga-ui-icons-scripts.umd.js.map +1 -0
  5. package/bundles/taiga-ui-icons-scripts.umd.min.js +2 -0
  6. package/bundles/taiga-ui-icons-scripts.umd.min.js.map +1 -0
  7. package/bundles/taiga-ui-icons.umd.js +181 -177
  8. package/bundles/taiga-ui-icons.umd.js.map +1 -1
  9. package/bundles/taiga-ui-icons.umd.min.js +1 -1
  10. package/bundles/taiga-ui-icons.umd.min.js.map +1 -1
  11. package/esm2015/all.js +181 -179
  12. package/esm2015/scripts/convert-all-compile-file-to-all-file.js +48 -0
  13. package/esm2015/scripts/delete-all-to-compile-file.js +10 -0
  14. package/esm2015/scripts/index.js +6 -0
  15. package/esm2015/scripts/post-prettier-format.js +9 -0
  16. package/esm2015/scripts/prepare-all-to-compile-file.js +13 -0
  17. package/esm2015/scripts/rollup-svgo.js +32 -0
  18. package/esm2015/scripts/taiga-ui-icons-scripts.js +5 -0
  19. package/esm5/all.js +181 -179
  20. package/esm5/scripts/convert-all-compile-file-to-all-file.js +54 -0
  21. package/esm5/scripts/delete-all-to-compile-file.js +10 -0
  22. package/esm5/scripts/index.js +6 -0
  23. package/esm5/scripts/post-prettier-format.js +10 -0
  24. package/esm5/scripts/prepare-all-to-compile-file.js +25 -0
  25. package/esm5/scripts/rollup-svgo.js +44 -0
  26. package/esm5/scripts/taiga-ui-icons-scripts.js +5 -0
  27. package/fesm2015/taiga-ui-icons-scripts.js +115 -0
  28. package/fesm2015/taiga-ui-icons-scripts.js.map +1 -0
  29. package/fesm2015/taiga-ui-icons.js +180 -178
  30. package/fesm2015/taiga-ui-icons.js.map +1 -1
  31. package/fesm5/taiga-ui-icons-scripts.js +144 -0
  32. package/fesm5/taiga-ui-icons-scripts.js.map +1 -0
  33. package/fesm5/taiga-ui-icons.js +180 -178
  34. package/fesm5/taiga-ui-icons.js.map +1 -1
  35. package/package.json +1 -1
  36. package/scripts/convert-all-compile-file-to-all-file.d.ts +8 -0
  37. package/scripts/delete-all-to-compile-file.d.ts +1 -0
  38. package/scripts/index.d.ts +5 -0
  39. package/scripts/package.json +13 -0
  40. package/scripts/post-prettier-format.d.ts +1 -0
  41. package/scripts/prepare-all-to-compile-file.d.ts +1 -0
  42. package/scripts/rollup-svgo.d.ts +8 -0
  43. package/scripts/taiga-ui-icons-scripts.d.ts +4 -0
  44. package/scripts/taiga-ui-icons-scripts.metadata.json +1 -0
  45. package/src/tuiIconBellOffLarge.svg +5 -5
  46. package/src/tuiIconClose.svg +14 -0
  47. package/src/tuiIconCode.svg +2 -2
  48. package/src/tuiIconCodeLarge.svg +2 -2
  49. package/src/tuiIconElectron.svg +6 -6
  50. package/src/tuiIconMaestro.svg +3 -3
  51. package/src/tuiIconMastercard.svg +3 -3
  52. package/src/tuiIconMir.svg +7 -7
  53. package/src/tuiIconRotate.svg +29 -0
  54. package/src/tuiIconVisa.svg +5 -5
  55. package/taiga-ui-icons.metadata.json +1 -1
@@ -0,0 +1,144 @@
1
+ import { __awaiter, __generator, __assign, __values } from 'tslib';
2
+ import { rollup } from 'rollup';
3
+ import typescript from 'rollup-plugin-typescript2';
4
+ import { createFilter } from '@rollup/pluginutils';
5
+ import { optimize } from 'svgo';
6
+ import { unlinkSync, readFileSync, writeFileSync, readdirSync } from 'fs';
7
+ import prettier from 'prettier';
8
+
9
+ function rollupSvgo(_a) {
10
+ var _b = _a === void 0 ? {} : _a, _c = _b.include, include = _c === void 0 ? '**/*.svg' : _c, exclude = _b.exclude, options = _b.options;
11
+ var filter = createFilter(include, exclude);
12
+ return {
13
+ name: 'rollupSvgo',
14
+ transform: function (svgString, id) {
15
+ return __awaiter(this, void 0, void 0, function () {
16
+ var skip, optimizedSvg, err_1;
17
+ return __generator(this, function (_a) {
18
+ switch (_a.label) {
19
+ case 0:
20
+ skip = !filter(id);
21
+ if (skip) {
22
+ console.info('\x1b[33m%s\x1b[0m', '[skip]', id);
23
+ return [2 /*return*/];
24
+ }
25
+ optimizedSvg = null;
26
+ _a.label = 1;
27
+ case 1:
28
+ _a.trys.push([1, 3, , 4]);
29
+ return [4 /*yield*/, optimize(svgString, __assign({ path: id }, options))];
30
+ case 2:
31
+ optimizedSvg = _a.sent();
32
+ console.info('\x1b[32m%s\x1b[0m', '[success]', id);
33
+ return [3 /*break*/, 4];
34
+ case 3:
35
+ err_1 = _a.sent();
36
+ console.error('\x1b[31m%s\x1b[0m', '[error]', id, "\n" + svgString, "\n" + err_1);
37
+ process.exit(1);
38
+ return [3 /*break*/, 4];
39
+ case 4: return [2 /*return*/, {
40
+ code: "export default " + JSON.stringify(optimizedSvg === null || optimizedSvg === void 0 ? void 0 : optimizedSvg.data),
41
+ map: { mappings: '' },
42
+ }];
43
+ }
44
+ });
45
+ });
46
+ },
47
+ };
48
+ }
49
+
50
+ var banner = "\n/**\n * @description:\n * DO NOT CHANGE THIS FILE. AUTOGENERATED\n */\n";
51
+ function convertAllCompileFileToAllFile(config) {
52
+ return __awaiter(this, void 0, void 0, function () {
53
+ var from, to, prt2Options, inputOptions, bundle;
54
+ return __generator(this, function (_a) {
55
+ switch (_a.label) {
56
+ case 0:
57
+ from = config.from, to = config.to, prt2Options = config.prt2Options;
58
+ inputOptions = {
59
+ input: from,
60
+ output: { preferConst: true },
61
+ plugins: [
62
+ typescript(prt2Options !== null && prt2Options !== void 0 ? prt2Options : { cacheRoot: 'node_modules/.cache/.rpt2_cache' }),
63
+ rollupSvgo({
64
+ include: '**/*.svg',
65
+ options: {
66
+ plugins: [
67
+ {
68
+ name: 'preset-default',
69
+ params: {
70
+ overrides: {
71
+ removeViewBox: false,
72
+ collapseGroups: false,
73
+ cleanupIDs: false,
74
+ removeUnknownsAndDefaults: false,
75
+ },
76
+ },
77
+ },
78
+ ],
79
+ },
80
+ }),
81
+ ],
82
+ };
83
+ return [4 /*yield*/, rollup(inputOptions)];
84
+ case 1:
85
+ bundle = _a.sent();
86
+ return [4 /*yield*/, bundle.write({
87
+ banner: banner,
88
+ file: to,
89
+ format: 'es',
90
+ preferConst: true,
91
+ })];
92
+ case 2:
93
+ _a.sent();
94
+ return [2 /*return*/];
95
+ }
96
+ });
97
+ });
98
+ }
99
+
100
+ function deleteAllToCompileFile(allToCompilePath) {
101
+ if (Array.isArray(allToCompilePath)) {
102
+ allToCompilePath.forEach(function (file) { return unlinkSync(file); });
103
+ }
104
+ else {
105
+ unlinkSync(allToCompilePath);
106
+ }
107
+ }
108
+
109
+ function postPrettierFormat(filePath, prettierConfig) {
110
+ var bundledBody = readFileSync(filePath, 'utf8');
111
+ var options = prettier.resolveConfig.sync(prettierConfig !== null && prettierConfig !== void 0 ? prettierConfig : 'prettier.config.js');
112
+ var formatted = prettier.format(bundledBody, __assign(__assign({}, options), { parser: 'typescript' }));
113
+ writeFileSync(filePath, formatted);
114
+ }
115
+
116
+ function prepareAllToCompileFile(iconsSrc, allToCompilePath) {
117
+ var e_1, _a;
118
+ var icons = readdirSync(iconsSrc).filter(function (file) { return file.split('.').pop() === 'svg'; });
119
+ var importDeclarations = '';
120
+ var exportDeclarations = '';
121
+ try {
122
+ for (var icons_1 = __values(icons), icons_1_1 = icons_1.next(); !icons_1_1.done; icons_1_1 = icons_1.next()) {
123
+ var iconPath = icons_1_1.value;
124
+ var fileName = iconPath.split('.').shift();
125
+ importDeclarations += "import " + fileName + " from './src/" + fileName + ".svg';\n";
126
+ exportDeclarations += fileName + ", ";
127
+ }
128
+ }
129
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
130
+ finally {
131
+ try {
132
+ if (icons_1_1 && !icons_1_1.done && (_a = icons_1.return)) _a.call(icons_1);
133
+ }
134
+ finally { if (e_1) throw e_1.error; }
135
+ }
136
+ writeFileSync(allToCompilePath, importDeclarations + " \n export { " + exportDeclarations + " }");
137
+ }
138
+
139
+ /**
140
+ * Generated bundle index. Do not edit.
141
+ */
142
+
143
+ export { convertAllCompileFileToAllFile, deleteAllToCompileFile, postPrettierFormat, prepareAllToCompileFile, rollupSvgo };
144
+ //# sourceMappingURL=taiga-ui-icons-scripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taiga-ui-icons-scripts.js","sources":["ng://@taiga-ui/icons/scripts/rollup-svgo.ts","ng://@taiga-ui/icons/scripts/convert-all-compile-file-to-all-file.ts","ng://@taiga-ui/icons/scripts/delete-all-to-compile-file.ts","ng://@taiga-ui/icons/scripts/post-prettier-format.ts","ng://@taiga-ui/icons/scripts/prepare-all-to-compile-file.ts","ng://@taiga-ui/icons/scripts/taiga-ui-icons-scripts.ts"],"sourcesContent":["import {createFilter} from '@rollup/pluginutils';\nimport {Plugin, TransformResult} from 'rollup';\nimport {optimize, OptimizedSvg, OptimizeOptions} from 'svgo';\n\nexport interface RollupSvgoConfig {\n readonly include?: string;\n\n readonly exclude?: string;\n\n readonly options?: OptimizeOptions;\n}\n\nexport function rollupSvgo({\n include = '**/*.svg',\n exclude,\n options,\n}: RollupSvgoConfig = {}): Plugin {\n const filter = createFilter(include, exclude);\n\n return {\n name: 'rollupSvgo',\n async transform(svgString: string, id: string): Promise<TransformResult> {\n const skip: boolean = !filter(id);\n\n if (skip) {\n console.info('\\x1b[33m%s\\x1b[0m', '[skip]', id);\n\n return;\n }\n\n let optimizedSvg: OptimizedSvg | null = null;\n\n try {\n optimizedSvg = await optimize(svgString, {path: id, ...options});\n\n console.info('\\x1b[32m%s\\x1b[0m', '[success]', id);\n } catch (err) {\n console.error(\n '\\x1b[31m%s\\x1b[0m',\n '[error]',\n id,\n `\\n${svgString}`,\n `\\n${err}`,\n );\n\n process.exit(1);\n }\n\n return {\n code: `export default ${JSON.stringify(optimizedSvg?.data)}`,\n map: {mappings: ''},\n };\n },\n };\n}\n","import {rollup, RollupOptions} from 'rollup';\nimport typescript, {RPT2Options} from 'rollup-plugin-typescript2';\n\nimport {rollupSvgo} from './rollup-svgo';\n\nconst banner = `\n/**\n * @description:\n * DO NOT CHANGE THIS FILE. AUTOGENERATED\n */\n`;\n\ninterface Options {\n prt2Options?: RPT2Options;\n from: string;\n to: string;\n}\n\nexport async function convertAllCompileFileToAllFile(config: Options): Promise<void> {\n const {from, to, prt2Options} = config;\n\n const inputOptions: RollupOptions = {\n input: from,\n output: {preferConst: true},\n plugins: [\n typescript(prt2Options ?? {cacheRoot: 'node_modules/.cache/.rpt2_cache'}),\n rollupSvgo({\n include: '**/*.svg',\n options: {\n plugins: [\n {\n name: 'preset-default',\n params: {\n overrides: {\n removeViewBox: false,\n collapseGroups: false,\n cleanupIDs: false,\n removeUnknownsAndDefaults: false,\n },\n },\n },\n ],\n },\n }),\n ],\n };\n\n const bundle = await rollup(inputOptions);\n\n await bundle.write({\n banner,\n file: to,\n format: 'es',\n preferConst: true,\n });\n}\n","import {unlinkSync} from 'fs';\n\nexport function deleteAllToCompileFile(allToCompilePath: string | string[]): void {\n if (Array.isArray(allToCompilePath)) {\n allToCompilePath.forEach(file => unlinkSync(file));\n } else {\n unlinkSync(allToCompilePath);\n }\n}\n","import {readFileSync, writeFileSync} from 'fs';\nimport prettier from 'prettier';\n\nexport function postPrettierFormat(filePath: string, prettierConfig?: string): void {\n const bundledBody = readFileSync(filePath, 'utf8');\n const options = prettier.resolveConfig.sync(prettierConfig ?? 'prettier.config.js');\n const formatted = prettier.format(bundledBody, {...options, parser: 'typescript'});\n\n writeFileSync(filePath, formatted);\n}\n","import {readdirSync, writeFileSync} from 'fs';\n\nexport function prepareAllToCompileFile(\n iconsSrc: string,\n allToCompilePath: string,\n): void {\n const icons: string[] = readdirSync(iconsSrc).filter(\n file => file.split('.').pop() === 'svg',\n );\n\n let importDeclarations = '';\n let exportDeclarations = '';\n\n for (const iconPath of icons) {\n const fileName = iconPath.split('.').shift();\n\n importDeclarations += `import ${fileName} from './src/${fileName}.svg';\\n`;\n exportDeclarations += `${fileName}, `;\n }\n\n writeFileSync(\n allToCompilePath,\n `${importDeclarations} \\n export { ${exportDeclarations} }`,\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAYgB,UAAU,CAAC,EAIH;QAJG,4BAIH,EAHpB,eAAoB,EAApB,yCAAoB,EACpB,oBAAO,EACP,oBAAO;IAEP,IAAM,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE9C,OAAO;QACH,IAAI,EAAE,YAAY;QACZ,SAAS,EAAf,UAAgB,SAAiB,EAAE,EAAU;;;;;;4BACnC,IAAI,GAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;4BAElC,IAAI,IAAI,EAAE;gCACN,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;gCAEhD,sBAAO;6BACV;4BAEG,YAAY,GAAwB,IAAI,CAAC;;;;4BAG1B,qBAAM,QAAQ,CAAC,SAAS,aAAG,IAAI,EAAE,EAAE,IAAK,OAAO,EAAE,EAAA;;4BAAhE,YAAY,GAAG,SAAiD,CAAC;4BAEjE,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;;;;4BAEnD,OAAO,CAAC,KAAK,CACT,mBAAmB,EACnB,SAAS,EACT,EAAE,EACF,OAAK,SAAW,EAChB,OAAK,KAAK,CACb,CAAC;4BAEF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;gCAGpB,sBAAO;gCACH,IAAI,EAAE,oBAAkB,IAAI,CAAC,SAAS,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAG;gCAC5D,GAAG,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAC;6BACtB,EAAC;;;;SACL;KACJ,CAAC;AACN;;ACjDA,IAAM,MAAM,GAAG,2EAKd,CAAC;SAQoB,8BAA8B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