tnp-helpers 19.0.19 → 19.0.21

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 (45) hide show
  1. package/browser/fesm2022/tnp-helpers.mjs +90 -18
  2. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  3. package/browser/lib/base/classes/base-vscode.d.ts +13 -4
  4. package/browser/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  5. package/browser/lib/build-info._auto-generated_.d.ts +1 -1
  6. package/browser/lib/utils.d.ts +7 -0
  7. package/browser/package.json +1 -1
  8. package/client/fesm2022/tnp-helpers.mjs +90 -18
  9. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  10. package/client/lib/base/classes/base-vscode.d.ts +13 -4
  11. package/client/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  12. package/client/lib/build-info._auto-generated_.d.ts +1 -1
  13. package/client/lib/utils.d.ts +7 -0
  14. package/client/package.json +1 -1
  15. package/lib/base/classes/base-git.js +3 -3
  16. package/lib/base/classes/base-git.js.map +1 -1
  17. package/lib/base/classes/base-global-command-line.backend.d.ts +1 -0
  18. package/lib/base/classes/base-global-command-line.backend.js +23 -8
  19. package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
  20. package/lib/base/classes/base-vscode.d.ts +13 -4
  21. package/lib/base/classes/base-vscode.js +22 -14
  22. package/lib/base/classes/base-vscode.js.map +1 -1
  23. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  24. package/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  25. package/lib/build-info._auto-generated_.d.ts +1 -1
  26. package/lib/build-info._auto-generated_.js +1 -1
  27. package/lib/helpers/for-browser/angular.helper.js +2 -2
  28. package/lib/old/base-component.js +2 -2
  29. package/lib/old/base-formly-component.js +2 -2
  30. package/lib/old/dual-component-ctrl.js +2 -2
  31. package/lib/utils.d.ts +7 -0
  32. package/lib/utils.js +66 -2
  33. package/lib/utils.js.map +1 -1
  34. package/package.json +6 -1
  35. package/scss/global.scss +44 -0
  36. package/scss/index.scss +2 -0
  37. package/scss/lib/index.scss +1 -0
  38. package/tmp-environment.json +6 -6
  39. package/websql/fesm2022/tnp-helpers.mjs +90 -18
  40. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  41. package/websql/lib/base/classes/base-vscode.d.ts +13 -4
  42. package/websql/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  43. package/websql/lib/build-info._auto-generated_.d.ts +1 -1
  44. package/websql/lib/utils.d.ts +7 -0
  45. package/websql/package.json +1 -1
@@ -1305,10 +1305,10 @@ var UtilsTypescript;
1305
1305
  /* */
1306
1306
  /* */
1307
1307
  /* */
1308
+ /* */
1308
1309
  return (void 0);
1309
1310
  }
1310
1311
  UtilsTypescript.wrapContentClassMembersDecoratorsWithRegion = wrapContentClassMembersDecoratorsWithRegion;
1311
- //#endregion
1312
1312
  })(UtilsTypescript || (UtilsTypescript = {}));
1313
1313
  //#endregion
1314
1314
  //#region utils http
@@ -1482,6 +1482,71 @@ var UtilsQuickFixes;
1482
1482
  };
1483
1483
  })(UtilsQuickFixes || (UtilsQuickFixes = {}));
1484
1484
  //#endregion
1485
+ //#region utils vscode
1486
+ var UtilsVSCode;
1487
+ (function (UtilsVSCode) {
1488
+ UtilsVSCode.calculateContrastingHexColor = (hex) => {
1489
+ // Normalize shorthand format like "#abc" → "#aabbcc"
1490
+ if (hex.length === 4) {
1491
+ hex =
1492
+ '#' +
1493
+ hex
1494
+ .slice(1)
1495
+ .split('')
1496
+ .map(ch => ch + ch)
1497
+ .join('');
1498
+ }
1499
+ const r = parseInt(hex.slice(1, 3), 16);
1500
+ const g = parseInt(hex.slice(3, 5), 16);
1501
+ const b = parseInt(hex.slice(5, 7), 16);
1502
+ // YIQ contrast formula
1503
+ const yiq = (r * 299 + g * 587 + b * 114) / 1000;
1504
+ return yiq >= 128 ? '#000000' : '#ffffff';
1505
+ };
1506
+ // Convert HSL to HEX if you need HEX output
1507
+ const hslToHex = (hsl) => {
1508
+ const [_, hStr, sStr, lStr] = hsl.match(/hsl\((\d+), (\d+)%?, (\d+)%?\)/);
1509
+ let h = parseInt(hStr) / 360;
1510
+ let s = parseInt(sStr) / 100;
1511
+ let l = parseInt(lStr) / 100;
1512
+ const hue2rgb = (p, q, t) => {
1513
+ if (t < 0)
1514
+ t += 1;
1515
+ if (t > 1)
1516
+ t -= 1;
1517
+ if (t < 1 / 6)
1518
+ return p + (q - p) * 6 * t;
1519
+ if (t < 1 / 2)
1520
+ return q;
1521
+ if (t < 2 / 3)
1522
+ return p + (q - p) * (2 / 3 - t) * 6;
1523
+ return p;
1524
+ };
1525
+ let r, g, b;
1526
+ if (s === 0) {
1527
+ r = g = b = l; // achromatic
1528
+ }
1529
+ else {
1530
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
1531
+ const p = 2 * l - q;
1532
+ r = hue2rgb(p, q, h + 1 / 3);
1533
+ g = hue2rgb(p, q, h);
1534
+ b = hue2rgb(p, q, h - 1 / 3);
1535
+ }
1536
+ const toHex = (x) => {
1537
+ const hex = Math.round(x * 255).toString(16);
1538
+ return hex.length === 1 ? '0' + hex : hex;
1539
+ };
1540
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
1541
+ };
1542
+ UtilsVSCode.generateFancyColor = () => {
1543
+ const h = Math.floor(Math.random() * 360); // full hue range
1544
+ const s = Math.floor(40 + Math.random() * 30); // 40–70% saturation
1545
+ const l = Math.floor(35 + Math.random() * 25); // 35–60% lightness
1546
+ return hslToHex(`hsl(${h}, ${s}%, ${l}%)`);
1547
+ };
1548
+ })(UtilsVSCode || (UtilsVSCode = {}));
1549
+ //#endregion
1485
1550
 
1486
1551
  class HelpersArrayObj {
1487
1552
  from(s) {
@@ -5796,7 +5861,7 @@ class PortsWorker extends BaseCliWorker {
5796
5861
  // THIS FILE IS GENERATED - DO NOT MODIFY
5797
5862
  const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
5798
5863
  const PROJECT_NPM_NAME = 'tnp-helpers';
5799
- const CURRENT_PACKAGE_VERSION = '19.0.19';
5864
+ const CURRENT_PACKAGE_VERSION = '19.0.21';
5800
5865
  // THIS FILE IS GENERATED - DO NOT MODIFY
5801
5866
 
5802
5867
  //#endregion
@@ -10865,14 +10930,24 @@ class BaseGit extends BaseFeatureForProject {
10865
10930
  }
10866
10931
 
10867
10932
  class BaseVscodeHelpers extends BaseFeatureForProject {
10868
- constructor() {
10869
- super(...arguments);
10933
+ saveCurrentSettings() {
10934
+ /* */
10935
+ /* */
10936
+ /* */
10937
+ /* */
10938
+ /* */
10939
+ return (void 0);
10940
+ }
10941
+ constructor(project) {
10942
+ super(project);
10870
10943
  /**
10871
10944
  * settings.json relative path
10872
10945
  */
10873
- this.settingsJson = '.vscode/settings.json';
10874
- this.extensionsJson = '.vscode/extensions.json';
10875
- //#endregion
10946
+ this.relativePathSettingsJsonVscode = '.vscode/settings.json';
10947
+ this.relativePathExtensionJsonVScode = '.vscode/extensions.json';
10948
+ this.currentSettingsValue =
10949
+ Helpers.readJsonC(project.pathFor(this.relativePathSettingsJsonVscode)) ||
10950
+ {};
10876
10951
  }
10877
10952
  //#region extensions
10878
10953
  get extensions() {
@@ -11003,7 +11078,13 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
11003
11078
  }
11004
11079
  //#endregion
11005
11080
  //#region recraete window title
11006
- recreateWindowTitle() {
11081
+ recreateWindowTitle(options) {
11082
+ /* */
11083
+ /* */
11084
+ /* */
11085
+ /* */
11086
+ /* */
11087
+ /* */
11007
11088
  /* */
11008
11089
  /* */
11009
11090
  /* */
@@ -11439,15 +11520,6 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
11439
11520
  /* */
11440
11521
  return (void 0);
11441
11522
  }
11442
- //#endregion
11443
- //#region fields & getters / vscode settings
11444
- get vscodeSettingsJson() {
11445
- /* */
11446
- /* */
11447
- /* */
11448
- /* */
11449
- return (void 0);
11450
- }
11451
11523
  }
11452
11524
 
11453
11525
  //#endregion
@@ -14548,5 +14620,5 @@ const Helpers = HelpersTaon.Instance;
14548
14620
  * Generated bundle index. Do not edit.
14549
14621
  */
14550
14622
 
14551
- export { BaseCliWorker, BaseCliWorkerConfig, BaseCliWorkerController, BaseCliWorkerTerminalUI, BaseCompilerForProject, BaseDebounceCompilerForProject, BaseFeatureForProject, BaseGit, BaseJsonFileReader, BaseLibraryBuild, BaseLinkedProjects, BaseNodeModules, BaseNpmHelpers, BasePackageJson, BaseProcessManger, BaseProject, BaseProjectResolver, BaseProjectTypeArr, BaseQuickFixes, BaseReleaseProcess, BaseVscodeHelpers, CommandConfig, CommandProcess, CommandProcessState, CommitData, CoreAngularProject, CoreProject, CoreTypescriptProject, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, PackageJsonDependencyObjArr, Port, PortStatusArr, PortsController, PortsWorker, ProgressData, UtilsHttp, UtilsMd, UtilsNpm, UtilsQuickFixes, UtilsTypescript, Validators, executeCommand };
14623
+ export { BaseCliWorker, BaseCliWorkerConfig, BaseCliWorkerController, BaseCliWorkerTerminalUI, BaseCompilerForProject, BaseDebounceCompilerForProject, BaseFeatureForProject, BaseGit, BaseJsonFileReader, BaseLibraryBuild, BaseLinkedProjects, BaseNodeModules, BaseNpmHelpers, BasePackageJson, BaseProcessManger, BaseProject, BaseProjectResolver, BaseProjectTypeArr, BaseQuickFixes, BaseReleaseProcess, BaseVscodeHelpers, CommandConfig, CommandProcess, CommandProcessState, CommitData, CoreAngularProject, CoreProject, CoreTypescriptProject, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, PackageJsonDependencyObjArr, Port, PortStatusArr, PortsController, PortsWorker, ProgressData, UtilsHttp, UtilsMd, UtilsNpm, UtilsQuickFixes, UtilsTypescript, UtilsVSCode, Validators, executeCommand };
14552
14624
  //# sourceMappingURL=tnp-helpers.mjs.map