tnp-core 21.0.156 → 21.0.158

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 (59) hide show
  1. package/VERIFIED-BUILD-DATA.jsonc +3 -3
  2. package/bin/start.js +1 -1
  3. package/browser/fesm2022/tnp-core-browser.mjs +45 -1
  4. package/browser/fesm2022/tnp-core-browser.mjs.map +1 -1
  5. package/browser/package.json +1 -1
  6. package/browser/types/tnp-core-browser.d.ts +22 -2
  7. package/browser-prod/fesm2022/tnp-core-browser-prod.mjs +45 -1
  8. package/browser-prod/fesm2022/tnp-core-browser-prod.mjs.map +1 -1
  9. package/browser-prod/package.json +1 -1
  10. package/browser-prod/types/tnp-core-browser-prod.d.ts +22 -2
  11. package/cli.backend.js +2 -2
  12. package/lib/build-info._auto-generated_.d.ts +1 -1
  13. package/lib/build-info._auto-generated_.js +1 -1
  14. package/lib/helpers.js +7 -7
  15. package/lib/helpers.js.map +1 -1
  16. package/lib/index.d.ts +1 -0
  17. package/lib/index.js +1 -0
  18. package/lib/index.js.map +1 -1
  19. package/lib/package.json +1 -1
  20. package/lib/taon-state-machine.d.ts +20 -0
  21. package/lib/taon-state-machine.js +54 -0
  22. package/lib/taon-state-machine.js.map +1 -0
  23. package/lib/taon-state-machine.test.d.ts +1 -0
  24. package/lib-esm/app.hosts.d.ts +2 -2
  25. package/lib-esm/app.hosts.js +4 -4
  26. package/lib-esm/app.js +1 -1
  27. package/lib-esm/app.js.map +1 -1
  28. package/lib-esm/cli.backend.d.ts +1 -1
  29. package/lib-esm/cli.backend.js +1 -1
  30. package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
  31. package/lib-esm/lib/build-info._auto-generated_.js +1 -1
  32. package/lib-esm/lib/helpers.js +7 -7
  33. package/lib-esm/lib/helpers.js.map +1 -1
  34. package/lib-esm/lib/index.d.ts +1 -0
  35. package/lib-esm/lib/index.js +1 -0
  36. package/lib-esm/lib/index.js.map +1 -1
  37. package/lib-esm/lib/taon-state-machine.d.ts +20 -0
  38. package/lib-esm/lib/taon-state-machine.js +50 -0
  39. package/lib-esm/lib/taon-state-machine.js.map +1 -0
  40. package/lib-prod/build-info._auto-generated_.d.ts +1 -1
  41. package/lib-prod/build-info._auto-generated_.js +1 -1
  42. package/lib-prod/helpers.js +7 -7
  43. package/lib-prod/helpers.js.map +1 -1
  44. package/lib-prod/index.d.ts +1 -0
  45. package/lib-prod/index.js +1 -0
  46. package/lib-prod/index.js.map +1 -1
  47. package/lib-prod/package.json +1 -1
  48. package/lib-prod/taon-state-machine.d.ts +20 -0
  49. package/lib-prod/taon-state-machine.js +50 -0
  50. package/lib-prod/taon-state-machine.js.map +1 -0
  51. package/package.json +3 -2
  52. package/websql/fesm2022/tnp-core-websql.mjs +45 -1
  53. package/websql/fesm2022/tnp-core-websql.mjs.map +1 -1
  54. package/websql/package.json +1 -1
  55. package/websql/types/tnp-core-websql.d.ts +22 -2
  56. package/websql-prod/fesm2022/tnp-core-websql-prod.mjs +45 -1
  57. package/websql-prod/fesm2022/tnp-core-websql-prod.mjs.map +1 -1
  58. package/websql-prod/package.json +1 -1
  59. package/websql-prod/types/tnp-core-websql-prod.d.ts +22 -2
@@ -1,5 +1,5 @@
1
1
  {
2
- "commitHash": "d19c6a5639284c2b38dcdf093f47e0719f285935",
3
- "commitName": "feat: handle magic rename rules for md tags render",
4
- "commitDate": "22-08-2026 14:28:57"
2
+ "commitHash": "459cd49214a899c27793037da98778ea384703ad",
3
+ "commitName": "release: v21.0.157",
4
+ "commitDate": "26-08-2026 00:51:02"
5
5
  }
package/bin/start.js CHANGED
@@ -1,4 +1,4 @@
1
- global.frameworkName = 'tnp-core';
1
+ global.frameworkName = 'tnp-core';
2
2
  Error.stackTraceLimit = 100;
3
3
  global.i0 = {
4
4
  defineInjectable: function () { }
@@ -13449,6 +13449,50 @@ var UtilsMdDocs;
13449
13449
  //#endregion
13450
13450
  })(UtilsMdDocs || (UtilsMdDocs = {}));
13451
13451
 
13452
+ class TaonStateMachine {
13453
+ constructor(config) {
13454
+ this.config = config;
13455
+ this._currentValue = config.defaultValue;
13456
+ this.currentStateSubject = new BehaviorSubject(config.defaultValue);
13457
+ this.currentState$ = this.currentStateSubject.asObservable();
13458
+ }
13459
+ get debugMode() {
13460
+ return !!this.config?.debugMode;
13461
+ }
13462
+ get currentValue() {
13463
+ return this._currentValue;
13464
+ }
13465
+ canSet(nextStateRaw) {
13466
+ const nextState = this.config.modifyStateBeforeSetting?.(nextStateRaw, this._currentValue, this.debugMode) ?? nextStateRaw;
13467
+ if (!_.isMap(this.config.allowedStateMap)) {
13468
+ return true;
13469
+ }
13470
+ const allowed = this.config.allowedStateMap.get(this._currentValue) ?? [];
13471
+ return allowed.includes(nextState);
13472
+ }
13473
+ set(nextStateRaw) {
13474
+ const previousState = this._currentValue;
13475
+ const nextState = this.config.modifyStateBeforeSetting?.(nextStateRaw, previousState, this.debugMode) ?? nextStateRaw;
13476
+ if (_.isMap(this.config.allowedStateMap)) {
13477
+ const allowed = this.config.allowedStateMap.get(previousState) ?? [];
13478
+ if (!allowed.includes(nextState)) {
13479
+ const message = `Invalid state transition: ` +
13480
+ `${String(previousState)} -> ${String(nextState)}`;
13481
+ if (this.config.throwOnInvalidTransition) {
13482
+ throw new Error(message);
13483
+ }
13484
+ this.debugMode && console.warn(message);
13485
+ return false;
13486
+ }
13487
+ }
13488
+ this._currentValue = nextState;
13489
+ // Notify observers only after successful transition.
13490
+ this.currentStateSubject.next(nextState);
13491
+ void this.config.effect?.(nextState, previousState, this.debugMode);
13492
+ return true;
13493
+ }
13494
+ }
13495
+
13452
13496
  const jsoncFormattingOptions = {
13453
13497
  insertSpaces: true,
13454
13498
  tabSize: 2,
@@ -13980,5 +14024,5 @@ var index = {};
13980
14024
  * Generated bundle index. Do not edit.
13981
14025
  */
13982
14026
 
13983
- export { $, BaselineSiteJoinprefix, CLI, CoreConfig, CoreModels, DbBinaryFormatEnum, ExecAsyncVscodeError, FilePathMetaData, FilesNames, GlobalLibTypeName, GlobalStorage, GlobalTaskManager, GlobalTaskManagerClass, Helpers, LibTypeArr, LibTypeEnum, PREFIXES, REGEX_REGION, TAGS, Utils, UtilsBinary, UtilsCli, UtilsCliClassMethod, UtilsDotFile, UtilsEtcHosts, UtilsExecProc, UtilsFilesFolders, UtilsFilesFoldersSync, UtilsI18n, UtilsJson, UtilsMdDocs, UtilsMessages, UtilsMigrations, UtilsNetwork, UtilsOs, UtilsProcess, UtilsProcessLogger, UtilsProgress, UtilsProjects, UtilsStdinStdoutLogger, UtilsString, UtilsStringRegex, UtilsSudo, UtilsTerminal, UtilsTime, UtilsWaitNotifier, UtilsYaml, _, appRelatedFiles, areTrustedForPatchUpdate, axios, backendNodejsOnlyFiles, backendWebsqlNodejsFiles, baseTaonDevProjectsNames, chalk, child_process, chokidar, config, crossPlatformPath, dateformat, dockerTemplates, dotTaonFolder, dotTnpFolder, encoding, execAsyncVscode, extAllowedToExportAndReplaceTSJSCodeFiles, extAllowedToReplace, extForSassLikeFiles, extForStyles, extTemplatesFiles, fg, fileName, filesNotAllowedToClean, folderName, frameworkName, frameworkNameBe, frontEndOnly, frontendFiles, fse, glob, globalSpinner, http, https, isCloudflareWorker, isElevated, micromatch, mkdirp, ncp, notAllowedNames, notAllowedProjectNames, notNeededForExportFiles, os, path, ps, psList, requireDefault, requiredForDev, rimraf, spawn, startAsync, taonActionFromParent, taonBasePathToGlobalDockerTemplatesFn, taonContainers, taonCutNextLineCut, taonPackageName, taonProjects, taonRepoPathUserInUserDirFn, taonSkipCut, tempFoldersName, tnpPackageName, updateJsoncContent, urlRepoTaon, urlRepoTaonContainers, win32Path };
14027
+ export { $, BaselineSiteJoinprefix, CLI, CoreConfig, CoreModels, DbBinaryFormatEnum, ExecAsyncVscodeError, FilePathMetaData, FilesNames, GlobalLibTypeName, GlobalStorage, GlobalTaskManager, GlobalTaskManagerClass, Helpers, LibTypeArr, LibTypeEnum, PREFIXES, REGEX_REGION, TAGS, TaonStateMachine, Utils, UtilsBinary, UtilsCli, UtilsCliClassMethod, UtilsDotFile, UtilsEtcHosts, UtilsExecProc, UtilsFilesFolders, UtilsFilesFoldersSync, UtilsI18n, UtilsJson, UtilsMdDocs, UtilsMessages, UtilsMigrations, UtilsNetwork, UtilsOs, UtilsProcess, UtilsProcessLogger, UtilsProgress, UtilsProjects, UtilsStdinStdoutLogger, UtilsString, UtilsStringRegex, UtilsSudo, UtilsTerminal, UtilsTime, UtilsWaitNotifier, UtilsYaml, _, appRelatedFiles, areTrustedForPatchUpdate, axios, backendNodejsOnlyFiles, backendWebsqlNodejsFiles, baseTaonDevProjectsNames, chalk, child_process, chokidar, config, crossPlatformPath, dateformat, dockerTemplates, dotTaonFolder, dotTnpFolder, encoding, execAsyncVscode, extAllowedToExportAndReplaceTSJSCodeFiles, extAllowedToReplace, extForSassLikeFiles, extForStyles, extTemplatesFiles, fg, fileName, filesNotAllowedToClean, folderName, frameworkName, frameworkNameBe, frontEndOnly, frontendFiles, fse, glob, globalSpinner, http, https, isCloudflareWorker, isElevated, micromatch, mkdirp, ncp, notAllowedNames, notAllowedProjectNames, notNeededForExportFiles, os, path, ps, psList, requireDefault, requiredForDev, rimraf, spawn, startAsync, taonActionFromParent, taonBasePathToGlobalDockerTemplatesFn, taonContainers, taonCutNextLineCut, taonPackageName, taonProjects, taonRepoPathUserInUserDirFn, taonSkipCut, tempFoldersName, tnpPackageName, updateJsoncContent, urlRepoTaon, urlRepoTaonContainers, win32Path };
13984
14028
  //# sourceMappingURL=tnp-core-browser.mjs.map