@loftyshaky/shared 0.0.29 → 0.0.33

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 (294) hide show
  1. package/_locales/de/messages.json +128 -0
  2. package/_locales/en/messages.json +127 -118
  3. package/_locales/ru/messages.json +124 -115
  4. package/app.d.ts +0 -0
  5. package/app.js +1 -59
  6. package/chunk-main-a8db968c.js +1 -0
  7. package/{chunk-main-c1ba20e7.js → chunk-main-ce8981a6.js} +1 -1
  8. package/chunk-main-d9f34ef9.js +1 -0
  9. package/ext.d.ts +0 -0
  10. package/ext.js +1 -1544
  11. package/index.d.ts +1 -1
  12. package/index.js +1 -4
  13. package/inputs.d.ts +0 -0
  14. package/inputs.js +1 -3
  15. package/js/ext/env.js +16 -16
  16. package/js/ext/locales.js +42 -42
  17. package/js/ext/manifest.js +58 -58
  18. package/js/ext/webpack.config.js +113 -113
  19. package/js/package/plugins/rollup-plugin-copy.js +169 -169
  20. package/js/package/plugins/watcher.js +54 -48
  21. package/js/package/terser.js +18 -18
  22. package/js/project_name.js +5 -5
  23. package/js/projects_path.js +5 -5
  24. package/js/task_scheduler.js +39 -31
  25. package/package.json +14 -14
  26. package/scss/settings/ext_version.scss +7 -7
  27. package/scss/settings/index.scss +7 -7
  28. package/scss/settings/main.scss +19 -18
  29. package/scss/settings/scrollbar.scss +12 -4
  30. package/scss/settings/section_btns.scss +40 -39
  31. package/scss/settings/sections.scss +22 -22
  32. package/scss/settings/transitions.scss +20 -20
  33. package/scss/shared/all.scss +3 -3
  34. package/scss/shared/btns.scss +30 -26
  35. package/scss/shared/checkboxes.scss +38 -38
  36. package/scss/shared/color_pickers.scss +94 -94
  37. package/scss/shared/colors.scss +85 -75
  38. package/scss/shared/crash_handler.scss +36 -36
  39. package/scss/shared/css_vars.scss +4 -4
  40. package/scss/shared/embed/error.scss +96 -96
  41. package/scss/shared/embed/font_face.scss +5 -5
  42. package/scss/shared/embed/loading_screen.scss +35 -35
  43. package/scss/shared/embed/no_tr.scss +3 -3
  44. package/scss/shared/focus.scss +78 -78
  45. package/scss/shared/help.scss +66 -66
  46. package/scss/shared/hr.scss +6 -0
  47. package/scss/shared/index.scss +28 -26
  48. package/scss/shared/input_btns.scss +11 -11
  49. package/scss/shared/inputs.scss +69 -73
  50. package/scss/shared/inset_border.scss +20 -20
  51. package/scss/shared/link_btns.scss +12 -12
  52. package/scss/shared/links.scss +11 -11
  53. package/scss/shared/mixins.scss +130 -130
  54. package/scss/shared/mods.scss +35 -22
  55. package/scss/shared/range.scss +46 -45
  56. package/scss/shared/scrollbar.scss +35 -32
  57. package/scss/shared/selects.scss +14 -14
  58. package/scss/shared/text.scss +20 -20
  59. package/scss/shared/textareas.scss +7 -7
  60. package/scss/shared/themes/colors/dark.scss +17 -17
  61. package/scss/shared/themes/colors/light.scss +17 -17
  62. package/scss/shared/themes/colors/very_dark.scss +17 -17
  63. package/scss/shared/themes/general/dark_theme.scss +7 -7
  64. package/scss/shared/themes/general/light_theme.scss +7 -7
  65. package/scss/shared/themes/general/template.scss +241 -212
  66. package/scss/shared/themes/general/template_focus.scss +48 -54
  67. package/scss/shared/themes/general/very_dark_theme.scss +7 -7
  68. package/scss/shared/transitions.scss +31 -30
  69. package/scss/shared/upload_box.scss +67 -0
  70. package/scss/shared/vars.scss +18 -17
  71. package/settings.d.ts +1 -1
  72. package/settings.js +1 -3
  73. package/ts/error_modules/crash_handler/components/body.d.ts +0 -0
  74. package/ts/error_modules/crash_handler/components/index.d.ts +0 -0
  75. package/ts/error_modules/crash_handler/components/prop_types/body.d.ts +0 -0
  76. package/ts/error_modules/crash_handler/components/prop_types/index.d.ts +0 -0
  77. package/ts/error_modules/crash_handler/data/fatal_error.d.ts +0 -0
  78. package/ts/error_modules/crash_handler/data/index.d.ts +0 -0
  79. package/ts/error_modules/crash_handler/data/visibility.d.ts +0 -0
  80. package/ts/error_modules/crash_handler/scripts/index.d.ts +0 -0
  81. package/ts/error_modules/crash_handler/scripts/page.d.ts +0 -0
  82. package/ts/error_modules/css/scripts/index.d.ts +0 -0
  83. package/ts/error_modules/css/scripts/main.d.ts +0 -0
  84. package/ts/error_modules/error/components/body.d.ts +0 -0
  85. package/ts/error_modules/error/components/close_btn.d.ts +0 -0
  86. package/ts/error_modules/error/components/ext_name.d.ts +0 -0
  87. package/ts/error_modules/error/components/index.d.ts +0 -0
  88. package/ts/error_modules/error/components/msg.d.ts +0 -0
  89. package/ts/error_modules/error/components/prop_types/body.d.ts +0 -0
  90. package/ts/error_modules/error/components/prop_types/index.d.ts +0 -0
  91. package/ts/error_modules/error/data/index.d.ts +0 -0
  92. package/ts/error_modules/error/data/main.d.ts +0 -0
  93. package/ts/error_modules/error/data/msg.d.ts +0 -0
  94. package/ts/error_modules/error/data/state.d.ts +0 -0
  95. package/ts/error_modules/error/interfaces/error.d.ts +0 -0
  96. package/ts/error_modules/error/interfaces/error_obj.d.ts +0 -0
  97. package/ts/error_modules/error/interfaces/index.d.ts +0 -0
  98. package/ts/error_modules/error/interfaces/observable_keys.d.ts +0 -0
  99. package/ts/error_modules/error/interfaces/show_error.d.ts +0 -0
  100. package/ts/error_modules/error/interfaces/timeout_observable_keys.d.ts +0 -0
  101. package/ts/error_modules/error/scripts/globals.d.ts +1 -0
  102. package/ts/error_modules/error/scripts/index.d.ts +0 -0
  103. package/ts/error_modules/internal.d.ts +0 -0
  104. package/ts/inputs/color/components/body.d.ts +0 -0
  105. package/ts/inputs/color/components/color_picker.d.ts +0 -0
  106. package/ts/inputs/color/components/fill_shadow.d.ts +0 -0
  107. package/ts/inputs/color/components/index.d.ts +0 -0
  108. package/ts/inputs/color/components/prop_types/body.d.ts +0 -0
  109. package/ts/inputs/color/components/prop_types/color_picker.d.ts +0 -0
  110. package/ts/inputs/color/components/prop_types/fill_shadow.d.ts +0 -0
  111. package/ts/inputs/color/components/prop_types/index.d.ts +0 -0
  112. package/ts/inputs/color/components/prop_types/visualization.d.ts +0 -0
  113. package/ts/inputs/color/components/visualization.d.ts +0 -0
  114. package/ts/inputs/color/data/color.d.ts +2 -1
  115. package/ts/inputs/color/data/index.d.ts +0 -0
  116. package/ts/inputs/color/data/visibility.d.ts +2 -0
  117. package/ts/inputs/color/interfaces/color.d.ts +0 -0
  118. package/ts/inputs/color/interfaces/color_picker_state.d.ts +0 -0
  119. package/ts/inputs/color/interfaces/color_picker_state_one.d.ts +0 -0
  120. package/ts/inputs/color/interfaces/i.d.ts +0 -0
  121. package/ts/inputs/color/interfaces/index.d.ts +0 -0
  122. package/ts/inputs/color/obj/color.d.ts +3 -0
  123. package/ts/inputs/color/obj/index.d.ts +0 -0
  124. package/ts/inputs/color/scripts/color_picker.d.ts +0 -0
  125. package/ts/inputs/color/scripts/index.d.ts +0 -0
  126. package/ts/inputs/color/scripts/position.d.ts +0 -0
  127. package/ts/inputs/components/btn.d.ts +0 -0
  128. package/ts/inputs/components/checkbox.d.ts +0 -0
  129. package/ts/inputs/components/file.d.ts +0 -0
  130. package/ts/inputs/components/help.d.ts +0 -0
  131. package/ts/inputs/components/help_btn.d.ts +0 -0
  132. package/ts/inputs/components/hr.d.ts +3 -0
  133. package/ts/inputs/components/index.d.ts +2 -0
  134. package/ts/inputs/components/input_item.d.ts +0 -0
  135. package/ts/inputs/components/label.d.ts +0 -0
  136. package/ts/inputs/components/link.d.ts +0 -0
  137. package/ts/inputs/components/link_btn.d.ts +0 -0
  138. package/ts/inputs/components/prop_types/btn.d.ts +0 -0
  139. package/ts/inputs/components/prop_types/checkbox.d.ts +0 -0
  140. package/ts/inputs/components/prop_types/file.d.ts +0 -0
  141. package/ts/inputs/components/prop_types/help.d.ts +0 -0
  142. package/ts/inputs/components/prop_types/help_btn.d.ts +0 -0
  143. package/ts/inputs/components/prop_types/hr.d.ts +4 -0
  144. package/ts/inputs/components/prop_types/index.d.ts +2 -0
  145. package/ts/inputs/components/prop_types/input_item.d.ts +0 -0
  146. package/ts/inputs/components/prop_types/label.d.ts +0 -0
  147. package/ts/inputs/components/prop_types/link.d.ts +0 -0
  148. package/ts/inputs/components/prop_types/link_btn.d.ts +2 -3
  149. package/ts/inputs/components/prop_types/range.d.ts +0 -0
  150. package/ts/inputs/components/prop_types/section.d.ts +0 -0
  151. package/ts/inputs/components/prop_types/section_btn.d.ts +0 -0
  152. package/ts/inputs/components/prop_types/section_content.d.ts +0 -0
  153. package/ts/inputs/components/prop_types/select.d.ts +0 -0
  154. package/ts/inputs/components/prop_types/text.d.ts +0 -0
  155. package/ts/inputs/components/prop_types/text_btn.d.ts +1 -1
  156. package/ts/inputs/components/prop_types/textarea.d.ts +0 -0
  157. package/ts/inputs/components/prop_types/upload_box.d.ts +4 -0
  158. package/ts/inputs/components/range.d.ts +0 -0
  159. package/ts/inputs/components/section.d.ts +0 -0
  160. package/ts/inputs/components/section_btn.d.ts +0 -0
  161. package/ts/inputs/components/section_content.d.ts +0 -0
  162. package/ts/inputs/components/select.d.ts +0 -0
  163. package/ts/inputs/components/text.d.ts +0 -0
  164. package/ts/inputs/components/text_btn.d.ts +0 -0
  165. package/ts/inputs/components/textarea.d.ts +0 -0
  166. package/ts/inputs/components/upload_box.d.ts +3 -0
  167. package/ts/inputs/data/help.d.ts +0 -0
  168. package/ts/inputs/data/index.d.ts +2 -0
  169. package/ts/inputs/data/input_width.d.ts +4 -3
  170. package/ts/inputs/data/label.d.ts +0 -0
  171. package/ts/inputs/data/nested_input.d.ts +4 -2
  172. package/ts/inputs/data/text.d.ts +21 -0
  173. package/ts/inputs/data/upload_box.d.ts +20 -0
  174. package/ts/inputs/data/val.d.ts +0 -0
  175. package/ts/inputs/interfaces/index.d.ts +2 -0
  176. package/ts/inputs/interfaces/input.d.ts +1 -1
  177. package/ts/inputs/interfaces/inputs.d.ts +0 -0
  178. package/ts/inputs/interfaces/links.d.ts +0 -0
  179. package/ts/inputs/interfaces/options.d.ts +0 -0
  180. package/ts/inputs/interfaces/sections.d.ts +0 -0
  181. package/ts/inputs/interfaces/state_cond.d.ts +4 -0
  182. package/ts/inputs/interfaces/text_btn.d.ts +7 -0
  183. package/ts/inputs/internal.d.ts +0 -0
  184. package/ts/inputs/obj/btn.d.ts +0 -0
  185. package/ts/inputs/obj/checkbox.d.ts +0 -0
  186. package/ts/inputs/obj/file.d.ts +2 -0
  187. package/ts/inputs/obj/hr.d.ts +5 -0
  188. package/ts/inputs/obj/index.d.ts +3 -0
  189. package/ts/inputs/obj/input_base.d.ts +12 -2
  190. package/ts/inputs/obj/link.d.ts +0 -0
  191. package/ts/inputs/obj/link_btn.d.ts +5 -0
  192. package/ts/inputs/obj/option.d.ts +1 -1
  193. package/ts/inputs/obj/range.d.ts +0 -0
  194. package/ts/inputs/obj/section.d.ts +1 -0
  195. package/ts/inputs/obj/select.d.ts +0 -0
  196. package/ts/inputs/obj/text.d.ts +5 -1
  197. package/ts/inputs/obj/textarea.d.ts +0 -0
  198. package/ts/inputs/obj/upload_box.d.ts +14 -0
  199. package/ts/inputs/scripts/index.d.ts +1 -0
  200. package/ts/inputs/scripts/resolve.d.ts +0 -0
  201. package/ts/inputs/scripts/upload_box.d.ts +8 -0
  202. package/ts/settings/components/body.d.ts +0 -0
  203. package/ts/settings/components/index.d.ts +0 -0
  204. package/ts/settings/components/prop_types/body.d.ts +0 -0
  205. package/ts/settings/components/prop_types/index.d.ts +0 -0
  206. package/ts/settings/data/back_up.d.ts +1 -1
  207. package/ts/settings/data/index.d.ts +0 -0
  208. package/ts/settings/data/sections.d.ts +7 -1
  209. package/ts/settings/init.d.ts +0 -0
  210. package/ts/settings/internal.d.ts +2 -0
  211. package/ts/settings/optional_permissions/data/index.d.ts +1 -0
  212. package/ts/settings/optional_permissions/data/main.d.ts +11 -0
  213. package/ts/settings/optional_permissions/interfaces/index.d.ts +1 -0
  214. package/ts/settings/optional_permissions/interfaces/optional_permission_checkbox_dict.d.ts +3 -0
  215. package/ts/settings/scripts/index.d.ts +0 -0
  216. package/ts/settings/scripts/theme.d.ts +3 -1
  217. package/ts/shared/app.d.ts +0 -0
  218. package/ts/shared/app_ext_globals.d.ts +0 -0
  219. package/ts/shared/css_vars/scripts/index.d.ts +0 -0
  220. package/ts/shared/css_vars/scripts/main.d.ts +0 -0
  221. package/ts/shared/data/data/index.d.ts +0 -0
  222. package/ts/shared/data/data/main.d.ts +0 -0
  223. package/ts/shared/data/interfaces/index.d.ts +0 -0
  224. package/ts/shared/data/interfaces/val.d.ts +0 -0
  225. package/ts/shared/ext.d.ts +0 -0
  226. package/ts/shared/ext_version/components/body.d.ts +0 -0
  227. package/ts/shared/ext_version/components/index.d.ts +0 -0
  228. package/ts/shared/functions.d.ts +1 -0
  229. package/ts/shared/globals.d.ts +0 -0
  230. package/ts/shared/init.d.ts +0 -0
  231. package/ts/shared/internal.d.ts +0 -1
  232. package/ts/shared/keep_alive/scripts/index.d.ts +0 -0
  233. package/ts/shared/keep_alive/scripts/tabs.d.ts +0 -0
  234. package/ts/shared/loading_screen/components/body.d.ts +2 -3
  235. package/ts/shared/loading_screen/components/index.d.ts +0 -0
  236. package/ts/shared/loading_screen/data/index.d.ts +0 -0
  237. package/ts/shared/loading_screen/data/main.d.ts +0 -0
  238. package/ts/shared/no_tr/scripts/index.d.ts +0 -0
  239. package/ts/shared/no_tr/scripts/main.d.ts +0 -0
  240. package/ts/shared/svg.d.ts +0 -0
  241. package/ts/shared/t.d.ts +0 -0
  242. package/ts/shared/tab_index/interfaces/index.d.ts +0 -0
  243. package/ts/shared/tab_index/interfaces/set_Input_type_event.d.ts +0 -0
  244. package/ts/shared/tab_index/scripts/index.d.ts +0 -0
  245. package/ts/shared/tab_index/scripts/main.d.ts +0 -0
  246. package/ts/shared/theme/scripts/index.d.ts +0 -0
  247. package/ts/shared/theme/scripts/main.d.ts +3 -1
  248. package/ts/shared/tr/components/base_tr.d.ts +0 -0
  249. package/ts/shared/tr/components/index.d.ts +0 -0
  250. package/ts/shared/tr/components/prop_types/base_tr.d.ts +1 -1
  251. package/ts/shared/tr/components/prop_types/index.d.ts +0 -0
  252. package/ts/shared/tr/data/index.d.ts +0 -0
  253. package/ts/shared/tr/data/transition.d.ts +0 -0
  254. package/ts/shared/tr/interfaces/index.d.ts +0 -0
  255. package/ts/shared/tr/interfaces/transitions.d.ts +0 -0
  256. package/ts/shared/tr/obj/index.d.ts +0 -0
  257. package/ts/shared/tr/obj/transition.d.ts +0 -0
  258. package/ts/shared/utils/scripts/index.d.ts +0 -0
  259. package/ts/shared/utils/scripts/main.d.ts +0 -0
  260. package/ts/shared/vars.d.ts +0 -0
  261. package/ts/shared/viewport/scripts/index.d.ts +0 -0
  262. package/ts/shared/viewport/scripts/main.d.ts +0 -0
  263. package/ts/shared/x.d.ts +4 -0
  264. package/chunk-internal-05069733.js +0 -28889
  265. package/chunk-internal-0e86bea1.js +0 -28888
  266. package/chunk-internal-1054c026.js +0 -439
  267. package/chunk-internal-10fcbd6e.js +0 -28888
  268. package/chunk-internal-17104e8a.js +0 -439
  269. package/chunk-internal-1fda41e4.js +0 -439
  270. package/chunk-internal-22bc2aa7.js +0 -439
  271. package/chunk-internal-26c6c7eb.js +0 -28889
  272. package/chunk-internal-39c8cbc4.js +0 -28895
  273. package/chunk-internal-3f8764a1.js +0 -28890
  274. package/chunk-internal-406e6f55.js +0 -439
  275. package/chunk-internal-42553e09.js +0 -439
  276. package/chunk-internal-473c60e9.js +0 -439
  277. package/chunk-internal-5233cfd5.js +0 -439
  278. package/chunk-internal-6f38e4bc.js +0 -439
  279. package/chunk-internal-6f7bb16f.js +0 -439
  280. package/chunk-internal-80d0ac77.js +0 -439
  281. package/chunk-internal-8a4fdf23.js +0 -440
  282. package/chunk-internal-92e0896b.js +0 -28890
  283. package/chunk-internal-945c597e.js +0 -28889
  284. package/chunk-internal-a5af61b1.js +0 -439
  285. package/chunk-internal-a7da665a.js +0 -439
  286. package/chunk-internal-ac104a4c.js +0 -28890
  287. package/chunk-internal-acb4137b.js +0 -28889
  288. package/chunk-internal-d829c972.js +0 -439
  289. package/chunk-internal-f1d22e9b.js +0 -28888
  290. package/chunk-internal-f314bc08.js +0 -28889
  291. package/chunk-main-5ee63fec.js +0 -1
  292. package/chunk-main-854911f4.js +0 -1
  293. package/ts/shared/loading_screen/components/prop_types/body.d.ts +0 -8
  294. package/ts/shared/loading_screen/components/prop_types/index.d.ts +0 -1
@@ -1,439 +0,0 @@
1
- import { _ as __awaiter, o as observer, s as svg, B as Body$2, m as makeObservable, b as observable, d as action, r as runInAction, e as computed } from './chunk-internal-acb4137b.js';
2
- import React__default, { useEffect } from 'react';
3
-
4
- global.show_err_ribbon = (error_obj, error_code, { error_msg_key = '', silent = false, persistent = false, exit = false, hide_delay = Main$1.i().hide_delay, is_notification = false, notification_msg_key = '', } = {}) => Main$1.i().show_error(error_obj, error_code, {
5
- error_msg_key,
6
- silent,
7
- persistent,
8
- exit,
9
- hide_delay,
10
- is_notification,
11
- notification_msg_key,
12
- });
13
- global.err = (f, error_code, { error_msg_key = '', silent = false, persistent = false, exit = false, hide_delay = Main$1.i().hide_delay, } = {}) => {
14
- try {
15
- return f();
16
- }
17
- catch (error_obj) {
18
- Main$1.i().show_error(error_obj, error_code, {
19
- error_msg_key,
20
- silent,
21
- persistent,
22
- exit,
23
- hide_delay,
24
- });
25
- }
26
- return undefined;
27
- };
28
- global.err_async = (f, error_code, { error_msg_key = '', silent = false, persistent = false, exit = false, hide_delay = Main$1.i().hide_delay, } = {}) => __awaiter(void 0, void 0, void 0, function* () {
29
- try {
30
- return yield f();
31
- }
32
- catch (error_obj) {
33
- Main$1.i().show_error(error_obj, error_code, {
34
- error_msg_key,
35
- silent,
36
- persistent,
37
- exit,
38
- hide_delay,
39
- });
40
- }
41
- return undefined;
42
- });
43
- global.throw_err = (msg) => {
44
- throw new Error(msg);
45
- };
46
- global.err_obj = (msg) => new Error(msg);
47
-
48
- const Body$1 = observer(class Body extends React__default.Component {
49
- static getDerivedStateFromError() {
50
- Visibility.i().show_reload_ui_screen();
51
- }
52
- componentDidCatch(err_obj) {
53
- show_err_ribbon(err_obj, 'shr_1000', { error_msg_key: 'cant_render_ui' });
54
- }
55
- render() {
56
- if (Visibility.i().page_is_crashed) {
57
- return (React__default.createElement("div", { className: 'reload_ui_btn_w' },
58
- React__default.createElement("button", { className: x.cls(['btn', 'reload_ui']), type: 'button', onClick: Page.i().reload }, ext.msg('reload_ui_btn_text'))));
59
- }
60
- const { children } = this.props;
61
- return children;
62
- }
63
- });
64
-
65
- var index$8 = /*#__PURE__*/Object.freeze({
66
- __proto__: null,
67
- Body: Body$1
68
- });
69
-
70
- const Body = observer((props) => {
71
- useEffect(() => {
72
- const { app_id } = props;
73
- Main.i().load({ app_id });
74
- }, [props]);
75
- return (React__default.createElement("div", { className: x.cls([
76
- 'main',
77
- 'error',
78
- State.i().is_highlighted_cls,
79
- State.i().is_notification_cls,
80
- ]), role: 'none', style: {
81
- display: State.i().is_visible_style,
82
- }, onMouseDown: State.i().clear_all_reset_state_timeouts },
83
- React__default.createElement(ExtName, null),
84
- React__default.createElement(Msg$1, null),
85
- React__default.createElement(CloseBtn, null)));
86
- });
87
-
88
- const CloseBtn = observer(() => (React__default.createElement("button", { className: 'close_btn', type: 'button', onClick: () => State.i().change_state({
89
- observable_key: 'is_visible',
90
- state: false,
91
- }) },
92
- React__default.createElement(svg.Close, null))));
93
-
94
- const ExtName = () => (React__default.createElement("span", { className: 'ext_name' },
95
- `${ext.msg('name') || we.runtime.getManifest().name} `,
96
- React__default.createElement(Body$2, null)));
97
-
98
- const Msg$1 = observer(() => (React__default.createElement("div", { className: 'msg' },
99
- Msg.i().main_msg,
100
- State.i().is_notification ? undefined : (React__default.createElement(React__default.Fragment, null,
101
- React__default.createElement("button", { type: 'button', className: x.cls([
102
- 'more_info_btn',
103
- Msg.i().more_info_btn_is_visible_cls,
104
- ]), onClick: () => Msg.i().change_visibility_of_advanced_msg({ is_visible: true }) }, ext.msg('error_more_info_btn_text')),
105
- React__default.createElement("div", { className: Msg.i().advanced_msg_is_visible_cls }, Msg.i().advanced_msg))))));
106
-
107
- var index$7 = /*#__PURE__*/Object.freeze({
108
- __proto__: null,
109
- Body: Body,
110
- CloseBtn: CloseBtn,
111
- ExtName: ExtName,
112
- Msg: Msg$1
113
- });
114
-
115
- class Main$2 {
116
- // eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function
117
- constructor() {
118
- this.catch_fatal_error = (callback) => __awaiter(this, void 0, void 0, function* () {
119
- if (page === 'background') {
120
- callback();
121
- }
122
- else if (is_ext) {
123
- const background_page_is_available = yield ext.send_msg_resp({
124
- msg: 'check_if_background_page_is_available',
125
- });
126
- if (background_page_is_available) {
127
- callback();
128
- }
129
- }
130
- else {
131
- callback();
132
- }
133
- });
134
- }
135
- static i() {
136
- // eslint-disable-next-line no-return-assign
137
- return this.i0 || (this.i0 = new this());
138
- }
139
- }
140
-
141
- class Visibility {
142
- constructor() {
143
- this.page_is_crashed = false; // true = shows reload ui screen
144
- this.show_reload_ui_screen = () => {
145
- this.page_is_crashed = true;
146
- };
147
- makeObservable(this, {
148
- page_is_crashed: observable,
149
- show_reload_ui_screen: action,
150
- });
151
- }
152
- static i() {
153
- // eslint-disable-next-line no-return-assign
154
- return this.i0 || (this.i0 = new this());
155
- }
156
- }
157
-
158
- var index$6 = /*#__PURE__*/Object.freeze({
159
- __proto__: null,
160
- Main: Main$2,
161
- Visibility: Visibility
162
- });
163
-
164
- class Main$1 {
165
- constructor() {
166
- this.hide_delay = 5000;
167
- this.highlight_time = 300;
168
- /*
169
- error_msg_key = a key to access to localized version of error message in [locale] messages.json file
170
- silent = don't show (true) / show (false) error ribbon
171
- persistent = don't hide (true) / hide (false) error ribbon after 5 seconds
172
- exit = terminate code execution (true) / show error message; don't terminate code execution (false)
173
- */
174
- this.show_error = (error_obj, error_code, { error_msg_key = '', silent = false, persistent = false, exit = false, hide_delay = this.hide_delay, is_notification = false, notification_msg_key = '', } = {}) => {
175
- Main$2.i().catch_fatal_error(() => {
176
- const show_error_ui = !x.in_service_worker && !silent && (!error_obj || !error_obj.silent);
177
- if (show_error_ui) {
178
- if (is_notification) {
179
- State.i().change_state({
180
- observable_key: 'is_notification',
181
- state: true,
182
- });
183
- Msg.i().notification_msg_key = notification_msg_key;
184
- }
185
- else {
186
- State.i().change_state({
187
- observable_key: 'is_notification',
188
- state: false,
189
- });
190
- }
191
- State.i().change_state({
192
- observable_key: 'is_visible',
193
- state: true,
194
- }); // show error ribbon
195
- State.i().change_state({
196
- observable_key: 'is_highlighted',
197
- state: true,
198
- }); // highlight error ribbon
199
- State.i().clear_all_reset_state_timeouts();
200
- if ((!error_obj || !error_obj.persistent) && !persistent) {
201
- State.i().run_reset_state_timeout({
202
- observable_key: 'is_visible',
203
- delay: hide_delay + this.highlight_time,
204
- });
205
- }
206
- State.i().run_reset_state_timeout({
207
- observable_key: 'is_highlighted',
208
- delay: this.highlight_time,
209
- });
210
- }
211
- if (error_obj && error_code) {
212
- if (show_error_ui) {
213
- Msg.i().change_visibility_of_advanced_msg({ is_visible: false });
214
- }
215
- const error_msg_pre = ext.msg(`${error_obj.error_msg || error_msg_key}_error`);
216
- const error_msg_final = error_msg_pre ? ` ${error_msg_pre}` : '';
217
- runInAction(() => err(() => {
218
- Msg.i().basic_msg = `${ext.msg('an_error_occured_msg') + error_msg_final}`;
219
- Msg.i().advanced_msg = `${ext.msg('error_code_label') + (error_obj.error_code || error_code)}\n${ext.msg('error_type_label') + error_obj.name}\n${ext.msg('error_msg_label') + error_obj.message}`;
220
- }, 'shr_1195'));
221
- if (error_obj.exit || exit) {
222
- const updated_error_obj = error_obj;
223
- const set_updated_error_obj_propery = ({ key, undefined_property, }) => {
224
- updated_error_obj[key] = n(error_obj[key])
225
- ? error_obj[key]
226
- : undefined_property;
227
- };
228
- set_updated_error_obj_propery({
229
- key: 'error_code',
230
- undefined_property: error_code,
231
- });
232
- set_updated_error_obj_propery({
233
- key: 'error_msg',
234
- undefined_property: error_msg_key,
235
- });
236
- set_updated_error_obj_propery({
237
- key: 'silent',
238
- undefined_property: silent,
239
- });
240
- set_updated_error_obj_propery({
241
- key: 'persistent',
242
- undefined_property: persistent,
243
- });
244
- set_updated_error_obj_propery({
245
- key: 'exit',
246
- undefined_property: exit,
247
- });
248
- set_updated_error_obj_propery({
249
- key: 'hide_delay',
250
- undefined_property: hide_delay,
251
- });
252
- throw updated_error_obj;
253
- }
254
- else {
255
- this.output_error(error_obj, error_code);
256
- }
257
- }
258
- });
259
- };
260
- this.output_error = (error_obj, error_code) => {
261
- const line = '---------------------------';
262
- const separator_top = `${line}\n`;
263
- const separator_bottom = `\n${line}`;
264
- const error_code_and_msg = `${separator_top}Code: ${error_code}\nMessage: ${error_obj.message}`;
265
- const console_output = error_obj.stack
266
- ? `${error_code_and_msg}\nStack: ${error_obj.stack + separator_bottom}`
267
- : error_code_and_msg + separator_bottom;
268
- //< console output
269
- // eslint-disable-next-line no-console
270
- console.error(console_output);
271
- };
272
- makeObservable(this, {
273
- show_error: action,
274
- });
275
- }
276
- static i() {
277
- // eslint-disable-next-line no-return-assign
278
- return this.i0 || (this.i0 = new this());
279
- }
280
- }
281
-
282
- class Msg {
283
- constructor() {
284
- this.advanced_msg_is_visible = false;
285
- this.basic_msg = '';
286
- this.advanced_msg = '';
287
- this.notification_msg_key = '';
288
- this.change_visibility_of_advanced_msg = ({ is_visible }) => {
289
- this.advanced_msg_is_visible = is_visible;
290
- };
291
- makeObservable(this, {
292
- advanced_msg_is_visible: observable,
293
- basic_msg: observable,
294
- advanced_msg: observable,
295
- notification_msg_key: observable,
296
- main_msg: computed,
297
- advanced_msg_is_visible_cls: computed,
298
- more_info_btn_is_visible_cls: computed,
299
- change_visibility_of_advanced_msg: action,
300
- });
301
- }
302
- static i() {
303
- // eslint-disable-next-line no-return-assign
304
- return this.i0 || (this.i0 = new this());
305
- }
306
- get advanced_msg_is_visible_cls() {
307
- return this.advanced_msg_is_visible ? '' : 'none';
308
- }
309
- get more_info_btn_is_visible_cls() {
310
- return this.advanced_msg_is_visible ? 'none' : '';
311
- }
312
- get main_msg() {
313
- return State.i().is_notification
314
- ? ext.msg(this.notification_msg_key)
315
- : this.basic_msg;
316
- }
317
- }
318
-
319
- class State {
320
- constructor() {
321
- this.is_loaded = false;
322
- this.is_visible = false;
323
- this.is_highlighted = false; // true = error ribbon is yellow / false = error ribbon is red
324
- this.is_notification = false;
325
- this.change_state = ({ observable_key, state, }) => {
326
- this[observable_key] = state;
327
- };
328
- this.run_reset_state_timeout = ({ observable_key, delay, }) => {
329
- this[`${observable_key}_timeout`] = global.setTimeout(() => {
330
- this.change_state({
331
- observable_key,
332
- state: false,
333
- }); // hide error ribbon / dehighlight error ribbon
334
- }, delay);
335
- };
336
- this.clear_all_reset_state_timeouts = () => {
337
- if (n(this.is_visible_timeout) && n(this.is_highlighted_timeout)) {
338
- clearTimeout(this.is_visible_timeout);
339
- clearTimeout(this.is_highlighted_timeout);
340
- }
341
- };
342
- makeObservable(this, {
343
- is_loaded: observable,
344
- is_visible: observable,
345
- is_highlighted: observable,
346
- is_notification: observable,
347
- is_visible_style: computed,
348
- is_highlighted_cls: computed,
349
- change_state: action,
350
- });
351
- }
352
- static i() {
353
- // eslint-disable-next-line no-return-assign
354
- return this.i0 || (this.i0 = new this());
355
- }
356
- get is_visible_style() {
357
- return this.is_loaded && this.is_visible ? '' : 'none';
358
- }
359
- get is_highlighted_cls() {
360
- return this.is_highlighted ? 'is_highlighted' : '';
361
- }
362
- get is_notification_cls() {
363
- return this.is_notification ? 'is_notification' : '';
364
- }
365
- }
366
-
367
- var index$5 = /*#__PURE__*/Object.freeze({
368
- __proto__: null,
369
- Main: Main$1,
370
- Msg: Msg,
371
- State: State
372
- });
373
-
374
- class Page {
375
- // eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function
376
- constructor() {
377
- this.reload = () => {
378
- global.location.reload();
379
- };
380
- }
381
- static i() {
382
- // eslint-disable-next-line no-return-assign
383
- return this.i0 || (this.i0 = new this());
384
- }
385
- }
386
-
387
- var index$4 = /*#__PURE__*/Object.freeze({
388
- __proto__: null,
389
- Page: Page
390
- });
391
-
392
- class Main {
393
- // eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function
394
- constructor() {
395
- this.load = ({ app_id }) => {
396
- x.css('font_face', document.head, `font_face_link_${app_id}`);
397
- const error_root = s(`.error_${app_id}`);
398
- if (n(error_root)) {
399
- const error_shadow = n(error_root.shadowRoot)
400
- ? error_root.shadowRoot
401
- : undefined;
402
- if (error_shadow) {
403
- const error_css = x.css('error', error_shadow);
404
- if (n(error_css)) {
405
- x.bind(error_css, 'load', () => {
406
- State.i().change_state({
407
- observable_key: 'is_loaded',
408
- state: true,
409
- });
410
- });
411
- }
412
- }
413
- }
414
- };
415
- }
416
- static i() {
417
- // eslint-disable-next-line no-return-assign
418
- return this.i0 || (this.i0 = new this());
419
- }
420
- }
421
-
422
- var index$3 = /*#__PURE__*/Object.freeze({
423
- __proto__: null,
424
- Main: Main
425
- });
426
-
427
- var index$2 = /*#__PURE__*/Object.freeze({
428
- __proto__: null
429
- });
430
-
431
- var index$1 = /*#__PURE__*/Object.freeze({
432
- __proto__: null
433
- });
434
-
435
- var index = /*#__PURE__*/Object.freeze({
436
- __proto__: null
437
- });
438
-
439
- export { Main$1 as M, index$7 as a, index$6 as b, index$8 as i };