complexqa_frontend_core 1.17.1 → 1.17.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "complexqa_frontend_core",
3
- "version": "1.17.1",
3
+ "version": "1.17.2",
4
4
  "description": "core of web ",
5
5
  "type": "module",
6
6
  "exports": {
@@ -3,24 +3,56 @@
3
3
  * Используется в demo/index.html и в консоли браузера по документации.
4
4
  */
5
5
  import * as Core from './index.js';
6
+ import * as Utils from './utils/utils.js';
6
7
  import { ApiException } from './exceptions/ApiException.js';
7
8
  import { MenuConfigurationMain } from './app_configuration/menu_configuration_main.js';
8
9
  import { MenuConfigurationSecondary } from './app_configuration/menu_configuration_secondary.js';
9
- import { echo, echo_table } from './utils/utils.js';
10
10
 
11
- const DEV_GLOBALS = {
12
- ...Core,
11
+ const EXTRA_GLOBALS = {
13
12
  ApiException,
14
13
  MenuConfigurationMain,
15
14
  MenuConfigurationSecondary,
16
- echo,
17
- echo_table,
18
15
  };
19
16
 
20
- for (const [ name, value ] of Object.entries(DEV_GLOBALS))
17
+ /** Утилиты, которые должны быть доступны в консоли как глобальные функции */
18
+ const UTIL_GLOBAL_NAMES = [
19
+ 'is_array',
20
+ 'is_number',
21
+ 'is_object',
22
+ 'is_string',
23
+ 'echo',
24
+ 'echo_table',
25
+ 'count',
26
+ 'cls',
27
+ 'clone_object',
28
+ 'in_array',
29
+ ];
30
+
31
+ function assignDevGlobals()
21
32
  {
22
- if (value !== undefined)
33
+ for (const [ name, value ] of Object.entries(Core))
34
+ {
35
+ if (value !== undefined)
36
+ {
37
+ window[ name ] = value;
38
+ }
39
+ }
40
+
41
+ for (const [ name, value ] of Object.entries(EXTRA_GLOBALS))
23
42
  {
24
- window[ name ] = value;
43
+ if (value !== undefined)
44
+ {
45
+ window[ name ] = value;
46
+ }
47
+ }
48
+
49
+ for (const name of UTIL_GLOBAL_NAMES)
50
+ {
51
+ if (Utils[ name ] !== undefined)
52
+ {
53
+ window[ name ] = Utils[ name ];
54
+ }
25
55
  }
26
56
  }
57
+
58
+ assignDevGlobals();
package/publish/index.js CHANGED
@@ -36,6 +36,8 @@ export { DeveloperService } from './services/DeveloperService.js';
36
36
 
37
37
  export { GeneralException } from './exceptions/GeneralException.js';
38
38
 
39
+ export { is_array, is_number, is_object, is_string, echo, echo_table, count, cls, clone_object } from './utils/utils.js'
40
+
39
41
  /**
40
42
  *
41
43
  * @version v.0.1 (21/06/2025)