@tramvai/tokens-common 5.50.0 → 5.53.74

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/action.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Action } from '@tramvai/tokens-core';
1
+ import { Action, type SyncTapableHookInstance } from '@tramvai/tokens-core';
2
2
  import type { TramvaiAction, PageAction } from '@tramvai/types-actions-state-context';
3
3
  import type { ExecutionContext } from './execution';
4
4
  /**
@@ -15,6 +15,32 @@ export declare const ACTION_REGISTRY_TOKEN: ActionsRegistry & {
15
15
  export declare const ACTION_EXECUTION_TOKEN: ActionExecution & {
16
16
  __type?: "base token" | undefined;
17
17
  };
18
+ export interface ActionStartHookData {
19
+ action: Action | TramvaiAction<any, any, any>;
20
+ deferred?: boolean;
21
+ context: ExecutionContext | null;
22
+ start: number;
23
+ }
24
+ export interface ActionEndHookData {
25
+ action: Action | TramvaiAction<any, any, any>;
26
+ deferred?: boolean;
27
+ error?: Error & {
28
+ originalMessage?: string;
29
+ };
30
+ context: ExecutionContext | null;
31
+ forbidden?: string;
32
+ end: number;
33
+ }
34
+ /**
35
+ * @description
36
+ * Hooks for action execution
37
+ */
38
+ export declare const ACTION_EXECUTION_HOOKS_TOKEN: {
39
+ startExecution: SyncTapableHookInstance<ActionStartHookData>;
40
+ endExecution: SyncTapableHookInstance<ActionEndHookData>;
41
+ } & {
42
+ __type?: "base token" | undefined;
43
+ };
18
44
  /**
19
45
  * @description
20
46
  * Instance that executes actions on navigations
package/lib/action.es.js CHANGED
@@ -10,6 +10,11 @@ const ACTION_REGISTRY_TOKEN = createToken('actionRegistry');
10
10
  * Instance that executes actions
11
11
  */
12
12
  const ACTION_EXECUTION_TOKEN = createToken('actionExecution');
13
+ /**
14
+ * @description
15
+ * Hooks for action execution
16
+ */
17
+ const ACTION_EXECUTION_HOOKS_TOKEN = createToken('actionExecutionHooks');
13
18
  /**
14
19
  * @description
15
20
  * Instance that executes actions on navigations
@@ -29,4 +34,4 @@ const ACTION_CONDITIONALS = createToken('actionConditionals', {
29
34
  const LIMIT_ACTION_GLOBAL_TIME_RUN = createToken('limitActionGlobalTimeRun');
30
35
  const DEFERRED_ACTIONS_MAP_TOKEN = createToken('tramvai deferred actions map');
31
36
 
32
- export { ACTION_CONDITIONALS, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN, DEFERRED_ACTIONS_MAP_TOKEN, LIMIT_ACTION_GLOBAL_TIME_RUN };
37
+ export { ACTION_CONDITIONALS, ACTION_EXECUTION_HOOKS_TOKEN, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN, DEFERRED_ACTIONS_MAP_TOKEN, LIMIT_ACTION_GLOBAL_TIME_RUN };
package/lib/action.js CHANGED
@@ -14,6 +14,11 @@ const ACTION_REGISTRY_TOKEN = dippy.createToken('actionRegistry');
14
14
  * Instance that executes actions
15
15
  */
16
16
  const ACTION_EXECUTION_TOKEN = dippy.createToken('actionExecution');
17
+ /**
18
+ * @description
19
+ * Hooks for action execution
20
+ */
21
+ const ACTION_EXECUTION_HOOKS_TOKEN = dippy.createToken('actionExecutionHooks');
17
22
  /**
18
23
  * @description
19
24
  * Instance that executes actions on navigations
@@ -34,6 +39,7 @@ const LIMIT_ACTION_GLOBAL_TIME_RUN = dippy.createToken('limitActionGlobalTimeRun
34
39
  const DEFERRED_ACTIONS_MAP_TOKEN = dippy.createToken('tramvai deferred actions map');
35
40
 
36
41
  exports.ACTION_CONDITIONALS = ACTION_CONDITIONALS;
42
+ exports.ACTION_EXECUTION_HOOKS_TOKEN = ACTION_EXECUTION_HOOKS_TOKEN;
37
43
  exports.ACTION_EXECUTION_TOKEN = ACTION_EXECUTION_TOKEN;
38
44
  exports.ACTION_PAGE_RUNNER_TOKEN = ACTION_PAGE_RUNNER_TOKEN;
39
45
  exports.ACTION_REGISTRY_TOKEN = ACTION_REGISTRY_TOKEN;
package/lib/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { ADDITIONAL_BUNDLE_TOKEN, BUNDLE_MANAGER_TOKEN } from './bundle.es.js';
2
2
  export { CONTEXT_TOKEN } from './context.es.js';
3
- export { ACTION_CONDITIONALS, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN, DEFERRED_ACTIONS_MAP_TOKEN, LIMIT_ACTION_GLOBAL_TIME_RUN } from './action.es.js';
3
+ export { ACTION_CONDITIONALS, ACTION_EXECUTION_HOOKS_TOKEN, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN, DEFERRED_ACTIONS_MAP_TOKEN, LIMIT_ACTION_GLOBAL_TIME_RUN } from './action.es.js';
4
4
  export { HOOK_TOKEN } from './hook.es.js';
5
5
  export { PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, ROOT_PUBSUB_TOKEN } from './pubsub.es.js';
6
6
  export { CACHE_METRICS_SERVER_TOKEN } from './cacheMetrics.es.js';
package/lib/index.js CHANGED
@@ -24,6 +24,7 @@ exports.ADDITIONAL_BUNDLE_TOKEN = bundle.ADDITIONAL_BUNDLE_TOKEN;
24
24
  exports.BUNDLE_MANAGER_TOKEN = bundle.BUNDLE_MANAGER_TOKEN;
25
25
  exports.CONTEXT_TOKEN = context.CONTEXT_TOKEN;
26
26
  exports.ACTION_CONDITIONALS = action.ACTION_CONDITIONALS;
27
+ exports.ACTION_EXECUTION_HOOKS_TOKEN = action.ACTION_EXECUTION_HOOKS_TOKEN;
27
28
  exports.ACTION_EXECUTION_TOKEN = action.ACTION_EXECUTION_TOKEN;
28
29
  exports.ACTION_PAGE_RUNNER_TOKEN = action.ACTION_PAGE_RUNNER_TOKEN;
29
30
  exports.ACTION_REGISTRY_TOKEN = action.ACTION_REGISTRY_TOKEN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tokens-common",
3
- "version": "5.50.0",
3
+ "version": "5.53.74",
4
4
  "description": "Tramvai tokens for @tramvai/module-common",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.es.js",
@@ -18,14 +18,14 @@
18
18
  "watch": "tsc -w"
19
19
  },
20
20
  "dependencies": {
21
- "@tinkoff/url": "0.11.2",
22
- "@tramvai/react": "5.50.0",
23
- "@tramvai/tokens-core": "5.50.0"
21
+ "@tinkoff/url": "0.11.3",
22
+ "@tramvai/react": "5.53.74",
23
+ "@tramvai/tokens-core": "5.53.74"
24
24
  },
25
25
  "peerDependencies": {
26
- "@tinkoff/dippy": "0.11.4",
27
- "@tinkoff/logger": "0.10.507",
28
- "@tramvai/types-actions-state-context": "5.50.0",
26
+ "@tinkoff/dippy": "0.11.5",
27
+ "@tinkoff/logger": "^0.10.507",
28
+ "@tramvai/types-actions-state-context": "5.53.74",
29
29
  "react": ">=16.8",
30
30
  "tslib": "^2.4.0"
31
31
  },