chuijs 4.0.3 → 4.0.4

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 (258) hide show
  1. package/CHANGELOG.md +536 -0
  2. package/framework/appLayout/default/chui_app_layout.js +361 -303
  3. package/framework/appLayout/default/global_style.css +243 -89
  4. package/framework/appLayout/default/main_theme_style.css +188 -101
  5. package/framework/components/chui_accordion/accordion.js +17 -17
  6. package/framework/components/chui_accordion/styles.css +7 -7
  7. package/framework/components/chui_action_sheet/action_sheet.js +35 -32
  8. package/framework/components/chui_action_sheet/styles.css +10 -4
  9. package/framework/components/chui_actions_bar/actions_bar.js +338 -0
  10. package/framework/components/chui_actions_bar/styles.css +139 -0
  11. package/framework/components/chui_affix/affix.js +4 -4
  12. package/framework/components/chui_affix/styles.css +5 -0
  13. package/framework/components/chui_alert/alert.js +11 -5
  14. package/framework/components/chui_alert/styles.css +7 -0
  15. package/framework/components/chui_avatar/avatar.js +13 -13
  16. package/framework/components/chui_avatar/styles.css +1 -1
  17. package/framework/components/chui_avatar_group/avatar_group.js +4 -4
  18. package/framework/components/chui_avatar_group/styles.css +1 -1
  19. package/framework/components/chui_backtop/backtop.js +25 -2
  20. package/framework/components/chui_backtop/styles.css +21 -0
  21. package/framework/components/chui_badge/badge.js +15 -15
  22. package/framework/components/chui_badge/styles.css +6 -6
  23. package/framework/components/chui_banner/banner.js +222 -0
  24. package/framework/components/chui_banner/styles.css +170 -0
  25. package/framework/components/chui_breadcrumb/styles.css +1 -1
  26. package/framework/components/chui_button/button.js +24 -28
  27. package/framework/components/chui_button/styles.css +5 -5
  28. package/framework/components/chui_calendar/calendar.js +6 -6
  29. package/framework/components/chui_card/card.js +14 -14
  30. package/framework/components/chui_card_scroll/card_scroll.js +169 -0
  31. package/framework/components/chui_card_scroll/styles.css +86 -0
  32. package/framework/components/chui_chat/chat.js +73 -51
  33. package/framework/components/chui_chat/styles.css +18 -7
  34. package/framework/components/chui_clipboard_history/clipboard_history.js +25 -20
  35. package/framework/components/chui_clipboard_history/styles.css +10 -8
  36. package/framework/components/chui_code/code.js +8 -8
  37. package/framework/components/chui_code/styles.css +2 -2
  38. package/framework/components/chui_code_editor/code_editor.js +26 -26
  39. package/framework/components/chui_code_editor/styles.css +3 -3
  40. package/framework/components/chui_command_palette/command_palette.js +29 -29
  41. package/framework/components/chui_command_palette/styles.css +5 -5
  42. package/framework/components/chui_console/console.js +9 -9
  43. package/framework/components/chui_console/styles.css +5 -2
  44. package/framework/components/chui_content_block/content_block.js +2 -2
  45. package/framework/components/chui_context_menu/context_menu.js +162 -54
  46. package/framework/components/chui_context_menu/styles.css +82 -8
  47. package/framework/components/chui_custom_element/custom_element.js +11 -11
  48. package/framework/components/chui_data_grid/data_grid.js +268 -268
  49. package/framework/components/chui_data_grid/styles.css +14 -14
  50. package/framework/components/chui_descriptions/styles.css +1 -1
  51. package/framework/components/chui_details/details.js +12 -12
  52. package/framework/components/chui_details/styles.css +7 -7
  53. package/framework/components/chui_diff_viewer/diff_viewer.js +88 -88
  54. package/framework/components/chui_diff_viewer/styles.css +9 -9
  55. package/framework/components/chui_divider/divider.js +6 -6
  56. package/framework/components/chui_divider/styles.css +2 -2
  57. package/framework/components/chui_drawer/drawer.js +37 -14
  58. package/framework/components/chui_drawer/styles.css +18 -4
  59. package/framework/components/chui_drop_zone/drop_zone.js +6 -6
  60. package/framework/components/chui_drop_zone/styles.css +10 -6
  61. package/framework/components/chui_fieldset/fieldset.js +6 -6
  62. package/framework/components/chui_fieldset/styles.css +5 -5
  63. package/framework/components/chui_file_explorer/file_explorer.js +115 -115
  64. package/framework/components/chui_file_explorer/styles.css +6 -6
  65. package/framework/components/chui_form/form.js +11 -11
  66. package/framework/components/chui_gantt/gantt.js +41 -41
  67. package/framework/components/chui_gantt/styles.css +5 -5
  68. package/framework/components/chui_graphs/graphs.js +82 -46
  69. package/framework/components/chui_graphs/styles.css +26 -5
  70. package/framework/components/chui_hero/hero.js +63 -20
  71. package/framework/components/chui_hero/styles.css +176 -7
  72. package/framework/components/chui_html_block/html_block.js +5 -5
  73. package/framework/components/chui_html_block/styles.css +1 -1
  74. package/framework/components/chui_hx/styles.css +2 -2
  75. package/framework/components/chui_icons/icons.js +7 -7
  76. package/framework/components/chui_icons/styles.css +2 -1
  77. package/framework/components/chui_inputs/chui_check_box/styles.css +12 -3
  78. package/framework/components/chui_inputs/chui_chips/chips.js +92 -31
  79. package/framework/components/chui_inputs/chui_chips/styles.css +28 -5
  80. package/framework/components/chui_inputs/chui_color_picker/color_picker.js +20 -15
  81. package/framework/components/chui_inputs/chui_color_picker/styles.css +7 -7
  82. package/framework/components/chui_inputs/chui_combo_box/combo_box.js +58 -58
  83. package/framework/components/chui_inputs/chui_combo_box/styles.css +9 -9
  84. package/framework/components/chui_inputs/chui_date/date.js +93 -95
  85. package/framework/components/chui_inputs/chui_date/styles.css +8 -8
  86. package/framework/components/chui_inputs/chui_date_range/date_range.js +22 -22
  87. package/framework/components/chui_inputs/chui_date_range/styles.css +3 -3
  88. package/framework/components/chui_inputs/chui_datetime/datetime.js +12 -12
  89. package/framework/components/chui_inputs/chui_datetime/styles.css +3 -3
  90. package/framework/components/chui_inputs/chui_email/email.js +10 -10
  91. package/framework/components/chui_inputs/chui_email/styles.css +6 -6
  92. package/framework/components/chui_inputs/chui_file/file.js +8 -8
  93. package/framework/components/chui_inputs/chui_file/styles.css +12 -9
  94. package/framework/components/chui_inputs/chui_hotkey/hotkey.js +39 -39
  95. package/framework/components/chui_inputs/chui_hotkey/styles.css +6 -6
  96. package/framework/components/chui_inputs/chui_masked/masked.js +44 -44
  97. package/framework/components/chui_inputs/chui_masked/styles.css +5 -5
  98. package/framework/components/chui_inputs/chui_mention/mention.js +13 -13
  99. package/framework/components/chui_inputs/chui_mention/styles.css +14 -8
  100. package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +147 -137
  101. package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +14 -8
  102. package/framework/components/chui_inputs/chui_number/number.js +42 -45
  103. package/framework/components/chui_inputs/chui_number/styles.css +6 -6
  104. package/framework/components/chui_inputs/chui_otp/otp.js +32 -32
  105. package/framework/components/chui_inputs/chui_otp/styles.css +5 -5
  106. package/framework/components/chui_inputs/chui_password/password.js +30 -36
  107. package/framework/components/chui_inputs/chui_password/styles.css +7 -7
  108. package/framework/components/chui_inputs/chui_radio_button/styles.css +2 -2
  109. package/framework/components/chui_inputs/chui_rating/rating.js +28 -28
  110. package/framework/components/chui_inputs/chui_rating/styles.css +3 -3
  111. package/framework/components/chui_inputs/chui_select_box/select_box.js +54 -54
  112. package/framework/components/chui_inputs/chui_select_box/styles.css +10 -10
  113. package/framework/components/chui_inputs/chui_slider/slider.js +14 -14
  114. package/framework/components/chui_inputs/chui_slider/styles.css +5 -4
  115. package/framework/components/chui_inputs/chui_text/styles.css +7 -7
  116. package/framework/components/chui_inputs/chui_text/text.js +13 -17
  117. package/framework/components/chui_inputs/chui_text_area/styles.css +8 -8
  118. package/framework/components/chui_inputs/chui_text_area/text_area.js +23 -23
  119. package/framework/components/chui_inputs/chui_time/styles.css +13 -17
  120. package/framework/components/chui_inputs/chui_time/time.js +35 -24
  121. package/framework/components/chui_inputs/chui_toggle/styles.css +10 -3
  122. package/framework/components/chui_inputs/chui_toggle/toggle.js +16 -16
  123. package/framework/components/chui_json_editor/json_editor.js +87 -87
  124. package/framework/components/chui_json_editor/styles.css +5 -5
  125. package/framework/components/chui_json_viewer/json_viewer.js +80 -80
  126. package/framework/components/chui_json_viewer/styles.css +6 -6
  127. package/framework/components/chui_kanban/kanban.js +27 -27
  128. package/framework/components/chui_kanban/styles.css +8 -4
  129. package/framework/components/chui_kbd/styles.css +1 -1
  130. package/framework/components/chui_label/label.js +17 -17
  131. package/framework/components/chui_label/styles.css +1 -1
  132. package/framework/components/chui_link/link.js +9 -9
  133. package/framework/components/chui_link/styles.css +11 -4
  134. package/framework/components/chui_list/list.js +11 -11
  135. package/framework/components/chui_list/styles.css +2 -2
  136. package/framework/components/chui_markdown_editor/markdown_editor.js +66 -66
  137. package/framework/components/chui_markdown_editor/styles.css +5 -5
  138. package/framework/components/chui_media/audio.js +240 -246
  139. package/framework/components/chui_media/audio_styles.css +41 -23
  140. package/framework/components/chui_media/image.js +49 -46
  141. package/framework/components/chui_media/image_compare.js +35 -35
  142. package/framework/components/chui_media/image_compare_styles.css +5 -5
  143. package/framework/components/chui_media/image_styles.css +1 -1
  144. package/framework/components/chui_media/video.js +148 -148
  145. package/framework/components/chui_media/video_styles.css +27 -11
  146. package/framework/components/chui_menu_bar/menu_bar.js +54 -54
  147. package/framework/components/chui_menu_bar/styles.css +10 -10
  148. package/framework/components/chui_message_bar/message_bar.js +551 -0
  149. package/framework/components/chui_message_bar/styles.css +248 -0
  150. package/framework/components/chui_modal/modal.js +37 -13
  151. package/framework/components/chui_notification/notification.js +76 -54
  152. package/framework/components/chui_notification/notification_download.js +26 -81
  153. package/framework/components/chui_notification/notification_download_card.js +115 -0
  154. package/framework/components/chui_notification/notification_download_progress.css +2 -2
  155. package/framework/components/chui_notification/notification_download_progress.js +70 -108
  156. package/framework/components/chui_notification/notification_update.js +31 -31
  157. package/framework/components/chui_notification/status_plate.css +3 -3
  158. package/framework/components/chui_notification/styles.css +6 -1
  159. package/framework/components/chui_notification/styles_download.css +1 -1
  160. package/framework/components/chui_notification/styles_update.css +2 -2
  161. package/framework/components/chui_org_chart/org_chart.js +29 -29
  162. package/framework/components/chui_org_chart/styles.css +2 -2
  163. package/framework/components/chui_pagination/pagination.js +3 -3
  164. package/framework/components/chui_pagination/styles.css +1 -1
  165. package/framework/components/chui_paragraph/styles.css +2 -2
  166. package/framework/components/chui_popover/popover.js +29 -23
  167. package/framework/components/chui_popover/styles.css +1 -1
  168. package/framework/components/chui_popups/popups.js +124 -124
  169. package/framework/components/chui_popups/styles.css +5 -5
  170. package/framework/components/chui_print_button/print_button.js +15 -10
  171. package/framework/components/chui_progress_bar/progress_bar.js +34 -12
  172. package/framework/components/chui_progress_bar/styles.css +4 -4
  173. package/framework/components/chui_progress_ring/progress_ring.js +15 -15
  174. package/framework/components/chui_progress_ring/styles.css +1 -1
  175. package/framework/components/chui_qrcode/qrcode.js +12 -12
  176. package/framework/components/chui_query_builder/query_builder.js +46 -46
  177. package/framework/components/chui_query_builder/styles.css +4 -4
  178. package/framework/components/chui_radio_group/styles.css +1 -1
  179. package/framework/components/chui_result/result.js +15 -15
  180. package/framework/components/chui_result/styles.css +3 -3
  181. package/framework/components/chui_scheduler/scheduler.js +74 -74
  182. package/framework/components/chui_scheduler/styles.css +5 -5
  183. package/framework/components/chui_screen_spinner/screen_spinner.js +167 -0
  184. package/framework/components/chui_screen_spinner/styles.css +49 -0
  185. package/framework/components/chui_segmented_control/segmented_control.js +63 -6
  186. package/framework/components/chui_segmented_control/styles.css +32 -6
  187. package/framework/components/chui_settings/settings.js +45 -46
  188. package/framework/components/chui_settings/styles.css +4 -4
  189. package/framework/components/chui_shortcut_help/shortcut_help.js +32 -34
  190. package/framework/components/chui_sidebar_nav/sidebar_nav.js +98 -29
  191. package/framework/components/chui_sidebar_nav/styles.css +9 -3
  192. package/framework/components/chui_slideshow/slideshow.js +85 -85
  193. package/framework/components/chui_slideshow/styles.css +6 -6
  194. package/framework/components/chui_spinner/spinner.js +10 -10
  195. package/framework/components/chui_split_button/split_button.js +30 -12
  196. package/framework/components/chui_split_button/styles.css +21 -5
  197. package/framework/components/chui_splitter/splitter.js +11 -11
  198. package/framework/components/chui_splitter/styles.css +2 -2
  199. package/framework/components/chui_statistic/statistic.js +47 -47
  200. package/framework/components/chui_status_bar/styles.css +2 -2
  201. package/framework/components/chui_stepper/stepper.js +202 -31
  202. package/framework/components/chui_stepper/styles.css +79 -14
  203. package/framework/components/chui_sticky_bar/sticky_bar.js +44 -13
  204. package/framework/components/chui_sticky_bar/styles.css +10 -8
  205. package/framework/components/chui_tabs/chui_tabs.js +74 -26
  206. package/framework/components/chui_tabs/styles.css +40 -12
  207. package/framework/components/chui_text_editor/styles.css +7 -7
  208. package/framework/components/chui_text_editor/text_editor.js +56 -56
  209. package/framework/components/chui_text_editor/text_editor_panel.js +173 -174
  210. package/framework/components/chui_theme_toggle/theme_toggle.js +21 -5
  211. package/framework/components/chui_timeline/styles.css +3 -1
  212. package/framework/components/chui_toast_queue/styles.css +11 -11
  213. package/framework/components/chui_toast_queue/toast_queue.js +30 -27
  214. package/framework/components/chui_toolbar/styles.css +2 -2
  215. package/framework/components/chui_tooltip/styles.css +2 -2
  216. package/framework/components/chui_tooltip/tooltip.js +3 -3
  217. package/framework/components/chui_tour/styles.css +8 -8
  218. package/framework/components/chui_tour/tour.js +72 -72
  219. package/framework/components/chui_transfer/styles.css +6 -6
  220. package/framework/components/chui_transfer/transfer.js +93 -106
  221. package/framework/components/chui_tree_table/styles.css +4 -4
  222. package/framework/components/chui_tree_table/tree_table.js +45 -45
  223. package/framework/components/chui_tree_view/styles.css +10 -8
  224. package/framework/components/chui_tree_view/tree_view.js +185 -183
  225. package/framework/components/chui_user_bar/styles.css +145 -0
  226. package/framework/components/chui_user_bar/user_bar.js +402 -0
  227. package/framework/components/chui_user_list_bar/styles.css +173 -0
  228. package/framework/components/chui_user_list_bar/user_list_bar.js +485 -0
  229. package/framework/components/chui_watermark/watermark.js +17 -17
  230. package/framework/components/chui_webview/webview.js +9 -9
  231. package/framework/components/chui_write_bar/styles.css +172 -0
  232. package/framework/components/chui_write_bar/write_bar.js +320 -0
  233. package/framework/main_window.js +1234 -0
  234. package/framework/modules/chui_a11y/chui_a11y.js +78 -79
  235. package/framework/modules/chui_animations/animations.js +77 -15
  236. package/framework/modules/chui_animations/motion.js +120 -0
  237. package/framework/modules/chui_animations/styles.css +36 -3
  238. package/framework/modules/chui_functions.js +31 -27
  239. package/framework/modules/chui_highlight/styles.css +13 -10
  240. package/framework/modules/chui_i18n/chui_i18n.js +3 -3
  241. package/framework/modules/chui_i18n/locales/feedback.js +62 -0
  242. package/framework/modules/chui_i18n/locales/navigation.js +4 -0
  243. package/framework/modules/chui_json/chui_json.js +2 -2
  244. package/framework/modules/chui_logger/chui_logger.js +23 -8
  245. package/framework/modules/chui_page/page.js +10 -10
  246. package/framework/modules/chui_palette/palette.js +61 -0
  247. package/framework/modules/chui_qr/chui_qr.js +23 -23
  248. package/framework/modules/chui_scrollbar/chui_scrollbar.js +45 -45
  249. package/framework/modules/chui_scrollbar/styles.css +3 -3
  250. package/framework/modules/chui_services/chui_services.js +8 -8
  251. package/framework/modules/chui_services/desktop.js +77 -71
  252. package/framework/modules/chui_sortable/chui_sortable.js +17 -17
  253. package/framework/modules/chui_validate/chui_validate.js +3 -3
  254. package/framework/tray_bar/chui_menu_items.js +2 -2
  255. package/index.d.ts +266 -34
  256. package/index.js +20 -1168
  257. package/package.json +6 -4
  258. package/framework/components/telegram_bot/chui_telegram_bot.js +0 -191
@@ -9,11 +9,11 @@ chui_ap_main {
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  border-radius: var(--radius_md);
12
- background: var(--ap_main_background);
12
+ background: var(--player_background);
13
13
  border: 1px solid var(--border_color);
14
14
  overflow: hidden;
15
- --seek-before-width: 0%;
16
- --volume-before-width: 0%;
15
+ --seek_before_width: 0%;
16
+ --volume_before_width: 0%;
17
17
  min-width: 460px;
18
18
  height: max-content;
19
19
  }
@@ -40,21 +40,21 @@ chui_ap_main[data_pin] {
40
40
  chui_ap_main[data_pin="bottom"] {
41
41
  inset-inline: 0;
42
42
  bottom: 0;
43
- margin: var(--margin);
43
+ margin: var(--block_margin);
44
44
  }
45
45
 
46
46
  chui_ap_main[data_pin="top"] {
47
47
  inset-inline: 0;
48
48
  top: 0;
49
- margin: var(--margin);
49
+ margin: var(--block_margin);
50
50
  }
51
51
 
52
52
  /* Боковые закрепления — компактная полоса у края, по центру высоты окна */
53
53
  chui_ap_main[data_pin="left"],
54
54
  chui_ap_main[data_pin="right"] {
55
55
  inset-block: 0;
56
- width: min(460px, calc(100% - 2 * var(--margin)));
57
- margin: auto var(--margin);
56
+ width: min(460px, calc(100% - 2 * var(--block_margin)));
57
+ margin: auto var(--block_margin);
58
58
  }
59
59
 
60
60
  chui_ap_main[data_pin="left"] {
@@ -112,7 +112,7 @@ chui_ap_seek_buf {
112
112
  width: 0;
113
113
  height: var(--player_track_height);
114
114
  border-radius: var(--radius_pill);
115
- background: var(--ap_slider_buf_background);
115
+ background: var(--player_slider_buffer_background);
116
116
  position: absolute;
117
117
  inset-inline-start: 6px;
118
118
  max-width: calc(100% - 12px);
@@ -148,8 +148,8 @@ chui_ap_info chui_label {
148
148
  #chui_ap_seek {
149
149
  background-image: linear-gradient(
150
150
  to right,
151
- var(--blue_prime_background) 0 var(--seek-before-width, 0%),
152
- var(--ap_slider_background) var(--seek-before-width, 0%) 100%
151
+ var(--blue_prime_background) 0 var(--seek_before_width, 0%),
152
+ var(--player_slider_background) var(--seek_before_width, 0%) 100%
153
153
  );
154
154
  }
155
155
 
@@ -158,16 +158,16 @@ chui_ap_info chui_label {
158
158
  #chui_ap_volume {
159
159
  background-image: linear-gradient(
160
160
  to right,
161
- var(--text_color) 0 var(--volume-before-width, 0%),
162
- var(--ap_slider_background) var(--volume-before-width, 0%) 100%
161
+ var(--text_color) 0 var(--volume_before_width, 0%),
162
+ var(--player_slider_background) var(--volume_before_width, 0%) 100%
163
163
  );
164
164
  }
165
165
 
166
166
  #chui_ap_volume:disabled {
167
167
  background-image: linear-gradient(
168
168
  to right,
169
- var(--ap_slider_buf_background) 0 var(--volume-before-width, 0%),
170
- var(--ap_slider_background) var(--volume-before-width, 0%) 100%
169
+ var(--player_slider_buffer_background) 0 var(--volume_before_width, 0%),
170
+ var(--player_slider_background) var(--volume_before_width, 0%) 100%
171
171
  );
172
172
  }
173
173
 
@@ -191,9 +191,17 @@ chui_ap_info chui_label {
191
191
  width: 9px;
192
192
  border-radius: 50%;
193
193
  background-color: var(--player_thumb_background);
194
- box-shadow: 0 0 0 2px var(--ap_main_background);
194
+ box-shadow: 0 0 0 2px var(--player_background);
195
195
  cursor: pointer;
196
196
  margin-top: calc((var(--player_track_height) - 9px) / 2);
197
+ /* Рост под курсором — тот же переход: своё время у ручки есть только здесь,
198
+ общее правило до псевдоэлементов бегунка не достаёт */
199
+ transition:
200
+ height var(--motion_fast) var(--motion_ease),
201
+ width var(--motion_fast) var(--motion_ease),
202
+ margin-top var(--motion_fast) var(--motion_ease),
203
+ background-color var(--motion_fast) var(--motion_ease),
204
+ box-shadow var(--motion_fast) var(--motion_ease);
197
205
  }
198
206
 
199
207
  /* У выключенной полосы ползунка нет: она и так приглушена заливкой */
@@ -215,7 +223,7 @@ chui_ap_main:hover #chui_ap_volume:not(:disabled)::-webkit-slider-thumb,
215
223
  margin-top: calc((var(--player_track_height) - 12px) / 2);
216
224
  background-color: var(--player_thumb_background);
217
225
  box-shadow:
218
- 0 0 0 2px var(--ap_main_background),
226
+ 0 0 0 2px var(--player_background),
219
227
  var(--box_shadow_main);
220
228
  }
221
229
 
@@ -269,6 +277,14 @@ chui_ap_volume_icon {
269
277
  cursor: pointer;
270
278
  }
271
279
 
280
+ /* Кегль глифа — ключом плеера: у `chui_icon` есть своё правило (размер шапки),
281
+ поэтому размер задаётся значку, а не кнопке. Прежде число стояло в коде (пять мест) */
282
+ chui_ap_play_pause chui_icon,
283
+ chui_ap_fx_icon chui_icon,
284
+ chui_ap_volume_icon chui_icon {
285
+ font-size: var(--player_icon_size);
286
+ }
287
+
272
288
  /* Главная кнопка — светлый круг с глифом цвета подложки, как у Spotify: роль акцента
273
289
  в плеере занята полосами прогресса, а круг читается кнопкой воспроизведения */
274
290
  chui_ap_play_pause {
@@ -313,6 +329,8 @@ chui_ap_fx_dropdown {
313
329
 
314
330
  chui_ap_fx_dropdown.fx_open {
315
331
  display: block;
332
+ /* Раскрытие панели — общим кадром: прежде секция вставала на место рывком */
333
+ animation: chui_panel_in var(--motion_base) var(--motion_spring);
316
334
  }
317
335
 
318
336
  /* Открытая кнопка — как у прочих выпадающих: состояние держит тонировка акцента */
@@ -333,7 +351,7 @@ chui_ap_equalizer_main {
333
351
  /* === ПРЕСЕТЫ И ВЫКЛЮЧАТЕЛЬ ЭКВАЛАЙЗЕРА === */
334
352
  /* Поле пресетов и выключатель — общекитовые `Select` и `Toggle`, вложенные в полосу панели:
335
353
  клавиатура, роли и состояния у них свои, а здесь только размеры. У `Select` ширина взята
336
- токеном страницы (`--control_width`), у `Toggle` — свои поля `--margin`, из-за которых
354
+ токеном страницы (`--control_width`), у `Toggle` — свои поля `--block_margin`, из-за которых
337
355
  выключатель не вставал к краю */
338
356
  chui_ap_equalizer_controls chui_selectbox {
339
357
  flex: 0 1 260px;
@@ -419,7 +437,7 @@ chui_eq_slider_main slider_label:first-child {
419
437
  color: var(--text_color);
420
438
  text-align: center;
421
439
  opacity: 0;
422
- transition: opacity 0.12s ease;
440
+ transition: opacity var(--motion_fast) var(--motion_ease);
423
441
  pointer-events: none;
424
442
  }
425
443
 
@@ -470,13 +488,13 @@ chui_eq_slider_main:focus-within slider_label:first-child {
470
488
  background-repeat: no-repeat;
471
489
  /* Заливка идёт от низа до ручки: полоса заливки короче рельса ровно на размер ручки
472
490
  и стоит по центру, поэтому её края совпадают с крайними положениями ручки при любом
473
- значении (`--fx-before-width` считает скрипт, как у полос прогресса и громкости) */
491
+ значении (`--fx_before_width` считает скрипт, как у полос прогресса и громкости) */
474
492
  background-size: 100% calc(100% - var(--fx_knob));
475
493
  background-position: center;
476
494
  background-image: linear-gradient(
477
495
  to top,
478
- var(--blue_prime_background) 0 var(--fx-before-width),
479
- transparent var(--fx-before-width)
496
+ var(--blue_prime_background) 0 var(--fx_before_width),
497
+ transparent var(--fx_before_width)
480
498
  );
481
499
  }
482
500
 
@@ -505,8 +523,8 @@ chui_eq_slider_main:focus-within slider_label:first-child {
505
523
  accent-color: var(--text_color_disabled);
506
524
  background-image: linear-gradient(
507
525
  to top,
508
- var(--text_color_disabled) 0 var(--fx-before-width),
509
- transparent var(--fx-before-width)
526
+ var(--text_color_disabled) 0 var(--fx_before_width),
527
+ transparent var(--fx_before_width)
510
528
  );
511
529
  }
512
530
 
@@ -4,12 +4,12 @@ const { I18n } = require("../../modules/chui_i18n/chui_i18n");
4
4
  const { makeKeyboardButton } = require("../../modules/chui_a11y/chui_a11y");
5
5
  // image-size 2.x отдаёт объект с функцией внутри (сборка ESM + CJS-обёртка), а 1.x — саму
6
6
  // функцию: разворачиваем оба варианта, чтобы модуль не зависел от установленной версии
7
- const image_size = require("image-size");
8
- const sizeOf = typeof image_size === "function" ? image_size : image_size.imageSize;
7
+ const imageSizeModule = require("image-size");
8
+ const sizeOf = typeof imageSizeModule === "function" ? imageSizeModule : imageSizeModule.imageSize;
9
9
  const { Icon, Icons } = require("../chui_icons/icons");
10
10
 
11
11
  class Image {
12
- #chui_image = document.createElement("chui_image");
12
+ #chuiImage = document.createElement("chui_image");
13
13
  #image = document.createElement("img");
14
14
  #alt = "";
15
15
  #decorative = false;
@@ -28,31 +28,31 @@ class Image {
28
28
  ) {
29
29
  require("../../modules/chui_functions").setStyles(__dirname + "/image_styles.css", "chUiJS_Image");
30
30
  // Внешний отступ снимает класс: его читает CSS
31
- if (options.disableMargin) this.#chui_image.classList.add("image_no_margin");
31
+ if (options.disableMargin) this.#chuiImage.classList.add("image_no_margin");
32
32
  // Источник — необязательная опция: пустая заготовка пути раньше читалась как файл (ENOENT)
33
33
  const path = optionOr(options.path, undefined);
34
34
  const base64 = optionOr(options.base64, undefined);
35
- const http_path = optionOr(options.httpPath, undefined);
35
+ const httpPath = optionOr(options.httpPath, undefined);
36
36
  if (path !== undefined)
37
37
  this.#image.setAttribute(
38
38
  "src",
39
39
  `data:image/png;base64,${require("fs").readFileSync(path).toString("base64")}`
40
40
  );
41
41
  if (base64 !== undefined) this.#image.setAttribute("src", `data:image/png;base64,${base64}`);
42
- if (http_path !== undefined) this.#image.setAttribute("src", http_path);
43
- if (options.width !== undefined) this.#chui_image.style.width = options.width;
44
- if (options.height !== undefined) this.#chui_image.style.height = options.height;
42
+ if (httpPath !== undefined) this.#image.setAttribute("src", httpPath);
43
+ if (options.width !== undefined) this.#chuiImage.style.width = options.width;
44
+ if (options.height !== undefined) this.#chuiImage.style.height = options.height;
45
45
  if (options.width !== undefined) this.#image.style.width = options.width;
46
46
  if (options.height !== undefined) this.#image.style.height = options.height;
47
- this.#chui_image.appendChild(this.#image);
47
+ this.#chuiImage.appendChild(this.#image);
48
48
  // Alt по умолчанию пустой: без атрибута скринридер читал бы вместо подписи data-URL картинки
49
49
  this.setAlt(options.alt === undefined ? "" : options.alt);
50
50
  if (options.decorative !== undefined) this.setDecorative(options.decorative === true);
51
51
 
52
52
  if (options.openPopup) {
53
- this.#chui_image.addEventListener("click", () => {
53
+ this.#chuiImage.addEventListener("click", () => {
54
54
  let popup;
55
- let widow_size = document.body.getBoundingClientRect();
55
+ const windowSize = document.body.getBoundingClientRect();
56
56
  if (options.path !== undefined) {
57
57
  //
58
58
  let imageSet;
@@ -80,24 +80,27 @@ class Image {
80
80
  }
81
81
  }
82
82
  if (options.base64 !== undefined) {
83
- let image_size;
84
- let imageSet;
85
- let img = Buffer.from(options.base64, "base64");
86
- let dimensions = sizeOf(img);
87
- if (dimensions.height > widow_size.height) {
88
- image_size = ["auto", `${widow_size.height}px`];
89
- } else if (dimensions.width > widow_size.width) {
90
- image_size = [`${widow_size.height}px`, "auto"];
83
+ let imageSize;
84
+ const img = Buffer.from(options.base64, "base64");
85
+ const dimensions = sizeOf(img);
86
+ // Картинка вписывается в окно по той стороне, которой не хватает: высокая
87
+ // ограничивается высотой окна, широкая — шириной. Прежде в широкой ветке
88
+ // стояла высота окна (опечатка): картинка 1600×400 в окне 1000×800
89
+ // получала ширину 800 px вместо 1000
90
+ if (dimensions.height > windowSize.height) {
91
+ imageSize = ["auto", `${windowSize.height}px`];
92
+ } else if (dimensions.width > windowSize.width) {
93
+ imageSize = [`${windowSize.width}px`, "auto"];
91
94
  } else {
92
- image_size = ["auto", `auto`];
95
+ imageSize = ["auto", "auto"];
93
96
  }
94
97
  //
95
- imageSet = new Image({
98
+ const imageSet = new Image({
96
99
  disableMargin: true,
97
100
  openPopup: false,
98
101
  base64: options.base64,
99
- width: image_size[0],
100
- height: image_size[1],
102
+ width: imageSize[0],
103
+ height: imageSize[1],
101
104
  });
102
105
  popup = new ImagePopup(imageSet.set(), "max-content", "max-content");
103
106
  }
@@ -107,11 +110,11 @@ class Image {
107
110
  }
108
111
  }
109
112
  setWidth(value) {
110
- this.#chui_image.style.width = value;
113
+ this.#chuiImage.style.width = value;
111
114
  this.#image.style.width = value;
112
115
  }
113
116
  setHeight(value) {
114
- this.#chui_image.style.height = value;
117
+ this.#chuiImage.style.height = value;
115
118
  this.#image.style.height = value;
116
119
  }
117
120
  /** Подпись изображения (пустая строка — декоративное) */
@@ -129,52 +132,52 @@ class Image {
129
132
  /** Декоративное изображение прячется от скринридера целиком (`aria-hidden`) */
130
133
  setDecorative(boolean = Boolean()) {
131
134
  this.#decorative = boolean;
132
- if (this.#decorative) this.#chui_image.setAttribute("aria-hidden", "true");
133
- else this.#chui_image.removeAttribute("aria-hidden");
135
+ if (this.#decorative) this.#chuiImage.setAttribute("aria-hidden", "true");
136
+ else this.#chuiImage.removeAttribute("aria-hidden");
134
137
  this.#image.setAttribute("alt", this.#decorative ? "" : this.#alt);
135
138
  return this;
136
139
  }
137
140
  set() {
138
- return this.#chui_image;
141
+ return this.#chuiImage;
139
142
  }
140
143
  }
141
144
 
142
145
  class ImagePopup {
143
146
  #id = require("randomstring").generate();
144
- #chui_image_popup = document.createElement(`chui_image_popup`);
145
- #popup_content = document.createElement("popup_content_test");
146
- #image_popup_content = document.createElement("image_popup_content");
147
- #close_popup = document.createElement("image_popup_close");
147
+ #chuiImagePopup = document.createElement(`chui_image_popup`);
148
+ #popupContent = document.createElement("popup_content_test");
149
+ #imagePopupContent = document.createElement("image_popup_content");
150
+ #closePopup = document.createElement("image_popup_close");
148
151
  constructor(image, width, height) {
149
- this.#chui_image_popup.id = this.#id;
152
+ this.#chuiImagePopup.id = this.#id;
150
153
  //ADDS
151
- this.#image_popup_content.style.width = width;
152
- this.#image_popup_content.style.height = height;
153
- this.#image_popup_content.appendChild(image);
154
+ this.#imagePopupContent.style.width = width;
155
+ this.#imagePopupContent.style.height = height;
156
+ this.#imagePopupContent.appendChild(image);
154
157
 
155
- this.#close_popup.innerHTML = new Icon(Icons.NAVIGATION.CLOSE, "30px", "").getHTML();
158
+ this.#closePopup.innerHTML = new Icon(Icons.NAVIGATION.CLOSE, "30px", "").getHTML();
156
159
  // Крестик без подписи читался бы как «кнопка» без имени: значок помечен aria-hidden,
157
160
  // а роль и Enter/Space даёт общий хелпер — клавиатурой слой тоже закрывается
158
- makeKeyboardButton(this.#close_popup);
159
- this.#close_popup.setAttribute("aria-label", I18n.t("common.close"));
160
- this.#close_popup.addEventListener("click", () => this.close());
161
+ makeKeyboardButton(this.#closePopup);
162
+ this.#closePopup.setAttribute("aria-label", I18n.t("common.close"));
163
+ this.#closePopup.addEventListener("click", () => this.close());
161
164
 
162
- this.#popup_content.appendChild(this.#image_popup_content);
163
- this.#popup_content.appendChild(this.#close_popup);
164
- this.#chui_image_popup.appendChild(this.#popup_content);
165
+ this.#popupContent.appendChild(this.#imagePopupContent);
166
+ this.#popupContent.appendChild(this.#closePopup);
167
+ this.#chuiImagePopup.appendChild(this.#popupContent);
165
168
  }
166
169
  open() {
167
- let dialog = this.#chui_image_popup;
170
+ const dialog = this.#chuiImagePopup;
168
171
  new Animation(dialog).fadeIn();
169
172
  new Animation(dialog.firstChild).scaleIn();
170
173
  }
171
174
  close() {
172
- let dialog = this.#chui_image_popup;
175
+ const dialog = this.#chuiImagePopup;
173
176
  new Animation(dialog.firstChild).scaleOut();
174
177
  new Animation(dialog).fadeOutAndRemove();
175
178
  }
176
179
  set() {
177
- return this.#chui_image_popup;
180
+ return this.#chuiImagePopup;
178
181
  }
179
182
  }
180
183
 
@@ -54,19 +54,19 @@ class ImageCompare {
54
54
  #after = document.createElement("img");
55
55
  #handle = document.createElement("image_compare_handle");
56
56
  #grip = document.createElement("image_compare_grip");
57
- #badge_before = document.createElement("image_compare_badge");
58
- #badge_after = document.createElement("image_compare_badge");
57
+ #badgeBefore = document.createElement("image_compare_badge");
58
+ #badgeAfter = document.createElement("image_compare_badge");
59
59
  #value = 50;
60
60
  #step = 1;
61
61
  #orientation = ImageCompare.ORIENTATION.HORIZONTAL;
62
62
  #labels = true;
63
63
  #disabled = false;
64
64
  #dragging = false;
65
- #label_text = undefined;
66
- #before_alt = undefined;
67
- #after_alt = undefined;
68
- #on_change = undefined;
69
- #change_listeners = [];
65
+ #labelText = undefined;
66
+ #beforeAlt = undefined;
67
+ #afterAlt = undefined;
68
+ #onChange = undefined;
69
+ #changeListeners = [];
70
70
 
71
71
  constructor(
72
72
  options = {
@@ -91,11 +91,11 @@ class ImageCompare {
91
91
  ImageCompare.#counter += 1;
92
92
  this.#id = options.id === undefined ? `chui_image_compare_${ImageCompare.#counter}` : options.id;
93
93
  this.#root.id = this.#id;
94
- this.#label_text = options.label === undefined ? undefined : options.label;
95
- this.#before_alt = options.beforeAlt;
96
- this.#after_alt = options.afterAlt;
94
+ this.#labelText = options.label === undefined ? undefined : options.label;
95
+ this.#beforeAlt = options.beforeAlt;
96
+ this.#afterAlt = options.afterAlt;
97
97
  this.#labels = options.labels !== false;
98
- this.#on_change = options.onChange;
98
+ this.#onChange = options.onChange;
99
99
  if (options.width !== undefined) this.#root.style.width = options.width;
100
100
  if (options.height !== undefined) this.#root.style.setProperty("--image_compare_height", options.height);
101
101
  if (options.value !== undefined) this.#value = this.#clamp(options.value);
@@ -114,8 +114,8 @@ class ImageCompare {
114
114
  this.#after.className = "image_compare_image";
115
115
  this.#before.setAttribute("draggable", "false");
116
116
  this.#after.setAttribute("draggable", "false");
117
- this.#before.setAttribute("alt", this.#altText(this.#before_alt, "media.imageCompareBefore"));
118
- this.#after.setAttribute("alt", this.#altText(this.#after_alt, "media.imageCompareAfter"));
117
+ this.#before.setAttribute("alt", this.#altText(this.#beforeAlt, "media.imageCompareBefore"));
118
+ this.#after.setAttribute("alt", this.#altText(this.#afterAlt, "media.imageCompareAfter"));
119
119
  // Ручка ведёт себя как ползунок: имя берётся из заголовка или из опции label
120
120
  this.#handle.setAttribute("role", "slider");
121
121
  this.#handle.setAttribute("tabindex", "0");
@@ -125,22 +125,22 @@ class ImageCompare {
125
125
  else
126
126
  this.#handle.setAttribute(
127
127
  "aria-label",
128
- this.#label_text === undefined ? I18n.t("media.imageCompareLabel") : this.#label_text
128
+ this.#labelText === undefined ? I18n.t("media.imageCompareLabel") : this.#labelText
129
129
  );
130
130
  this.#grip.setAttribute("aria-hidden", "true");
131
131
  this.#grip.innerText = "‹ ›";
132
- this.#badge_before.className = "image_compare_badge image_compare_badge_before";
133
- this.#badge_after.className = "image_compare_badge image_compare_badge_after";
134
- this.#badge_before.innerText = I18n.t("media.imageCompareBefore");
135
- this.#badge_after.innerText = I18n.t("media.imageCompareAfter");
132
+ this.#badgeBefore.className = "image_compare_badge image_compare_badge_before";
133
+ this.#badgeAfter.className = "image_compare_badge image_compare_badge_after";
134
+ this.#badgeBefore.innerText = I18n.t("media.imageCompareBefore");
135
+ this.#badgeAfter.innerText = I18n.t("media.imageCompareAfter");
136
136
 
137
137
  this.#handle.appendChild(this.#grip);
138
138
  this.#clip.appendChild(this.#after);
139
139
  this.#frame.appendChild(this.#before);
140
140
  this.#frame.appendChild(this.#clip);
141
141
  this.#frame.appendChild(this.#handle);
142
- this.#frame.appendChild(this.#badge_before);
143
- this.#frame.appendChild(this.#badge_after);
142
+ this.#frame.appendChild(this.#badgeBefore);
143
+ this.#frame.appendChild(this.#badgeAfter);
144
144
  this.#root.appendChild(this.#frame);
145
145
 
146
146
  // Перетаскивание идёт с захватом указателя на кадре: слушателей окна не нужно
@@ -209,7 +209,7 @@ class ImageCompare {
209
209
  return this;
210
210
  }
211
211
  addChangeListener(listener = () => {}) {
212
- this.#change_listeners.push(listener);
212
+ this.#changeListeners.push(listener);
213
213
  return this;
214
214
  }
215
215
  set() {
@@ -218,8 +218,8 @@ class ImageCompare {
218
218
 
219
219
  // === ВНУТРЕННЕЕ ===
220
220
  #emit() {
221
- for (const listener of this.#change_listeners) listener(this.#value);
222
- if (this.#on_change !== undefined) this.#on_change(this.#value);
221
+ for (const listener of this.#changeListeners) listener(this.#value);
222
+ if (this.#onChange !== undefined) this.#onChange(this.#value);
223
223
  }
224
224
  #clamp(value) {
225
225
  return Math.max(0, Math.min(100, Number(value) || 0));
@@ -254,22 +254,22 @@ class ImageCompare {
254
254
  this.#syncBadges(this.#value, 100 - this.#value);
255
255
  return;
256
256
  }
257
- const from_end = this.#isRTL();
257
+ const fromEnd = this.#isRTL();
258
258
  this.#handle.style.top = "";
259
- this.#handle.style.left = from_end ? "" : percent;
260
- this.#handle.style.right = from_end ? percent : "";
261
- this.#clip.style.clipPath = from_end ? `inset(0 ${percent} 0 0)` : `inset(0 0 0 ${percent})`;
262
- this.#syncBadges(from_end ? 100 - this.#value : this.#value, from_end ? this.#value : 100 - this.#value);
259
+ this.#handle.style.left = fromEnd ? "" : percent;
260
+ this.#handle.style.right = fromEnd ? percent : "";
261
+ this.#clip.style.clipPath = fromEnd ? `inset(0 ${percent} 0 0)` : `inset(0 0 0 ${percent})`;
262
+ this.#syncBadges(fromEnd ? 100 - this.#value : this.#value, fromEnd ? this.#value : 100 - this.#value);
263
263
  }
264
264
  /**
265
265
  * Подпись стороны видна, только если её половина кадра достаточно широка:
266
266
  * иначе «До» оказалось бы поверх картинки «после» и путало бы.
267
267
  */
268
- #syncBadges(before_part, after_part) {
269
- const enough = this.#labels !== false && before_part >= BADGE_MIN_PART;
270
- const enough_after = this.#labels !== false && after_part >= BADGE_MIN_PART;
271
- this.#badge_before.style.display = enough ? "" : "none";
272
- this.#badge_after.style.display = enough_after ? "" : "none";
268
+ #syncBadges(beforePart, afterPart) {
269
+ const enough = this.#labels !== false && beforePart >= BADGE_MIN_PART;
270
+ const enoughAfter = this.#labels !== false && afterPart >= BADGE_MIN_PART;
271
+ this.#badgeBefore.style.display = enough ? "" : "none";
272
+ this.#badgeAfter.style.display = enoughAfter ? "" : "none";
273
273
  }
274
274
  /** Доля кадра под указателем: в RTL отсчёт идёт с другого края */
275
275
  #percentAt(clientX, clientY) {
@@ -278,8 +278,8 @@ class ImageCompare {
278
278
  if (this.#orientation === ImageCompare.ORIENTATION.VERTICAL) {
279
279
  return ((clientY - rect.top) / rect.height) * 100;
280
280
  }
281
- const from_start = ((clientX - rect.left) / rect.width) * 100;
282
- return this.#isRTL() ? 100 - from_start : from_start;
281
+ const fromStart = ((clientX - rect.left) / rect.width) * 100;
282
+ return this.#isRTL() ? 100 - fromStart : fromStart;
283
283
  }
284
284
 
285
285
  // === ОБРАБОТЧИКИ ===
@@ -4,14 +4,14 @@ chui_image_compare {
4
4
  flex-direction: column;
5
5
  height: max-content;
6
6
  width: max-content;
7
- margin: var(--margin);
7
+ margin: var(--block_margin);
8
8
  font-size: var(--font_default_size);
9
9
  color: var(--text_color);
10
10
  }
11
11
 
12
12
  image_compare_title {
13
13
  display: block;
14
- margin: var(--margin);
14
+ margin: var(--block_margin);
15
15
  font-size: var(--font_labels_size);
16
16
  font-weight: 500;
17
17
  color: var(--text_color);
@@ -73,8 +73,8 @@ image_compare_handle {
73
73
  justify-content: center;
74
74
  width: 2px;
75
75
  margin-inline: -1px;
76
- background: var(--background_color);
77
- box-shadow: 0 0 8px rgb(0 0 0 / 25%);
76
+ background: var(--element_background_2);
77
+ box-shadow: var(--box_shadow_halo);
78
78
  cursor: ew-resize;
79
79
  outline: none;
80
80
  }
@@ -102,7 +102,7 @@ image_compare_grip {
102
102
  width: 34px;
103
103
  height: 34px;
104
104
  border-radius: 50%;
105
- background: var(--background_color);
105
+ background: var(--element_background_2);
106
106
  border: 1px solid var(--border_color);
107
107
  box-shadow: var(--box_shadow_drop);
108
108
  color: var(--text_color);
@@ -2,7 +2,7 @@ chui_image {
2
2
  height: max-content;
3
3
  width: max-content;
4
4
  border-radius: var(--radius_md);
5
- margin: var(--margin);
5
+ margin: var(--block_margin);
6
6
  display: flex;
7
7
  }
8
8