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
@@ -129,56 +129,55 @@ class TextEditorButtons {
129
129
 
130
130
  class TextEditorSelects {
131
131
  #id = require("randomstring").generate();
132
- #id_sb = require("randomstring").generate();
133
- #Select_main = document.createElement("chui_text_editor_select_box");
134
- #Select_second = document.createElement("text_editor_select_box");
132
+ #idSb = require("randomstring").generate();
133
+ #SelectMain = document.createElement("chui_text_editor_select_box");
134
+ #SelectSecond = document.createElement("text_editor_select_box");
135
135
  #input = document.createElement("input");
136
- #div_value = document.createElement("text_editor_div_value");
137
- #button_open = document.createElement("text_editor_select_button_open");
136
+ #divValue = document.createElement("text_editor_div_value");
137
+ #buttonOpen = document.createElement("text_editor_select_button_open");
138
138
  #dropdown = document.createElement("text_editor_selectbox_dropdown");
139
139
  constructor(options = { icon: String(), label: String() }) {
140
140
  if (options.icon !== undefined) {
141
- this.#div_value.innerHTML = options.icon;
141
+ this.#divValue.innerHTML = options.icon;
142
142
  // Значок — украшение: имя даёт сам селект
143
- this.#div_value.setAttribute("aria-hidden", "true");
143
+ this.#divValue.setAttribute("aria-hidden", "true");
144
144
  }
145
- if (options.label !== undefined) this.#Select_main.setAttribute("aria-label", options.label);
146
- this.#input.setAttribute("id", this.#id_sb);
145
+ if (options.label !== undefined) this.#SelectMain.setAttribute("aria-label", options.label);
146
+ this.#input.setAttribute("id", this.#idSb);
147
147
  this.#input.classList.add("text_editor_selectbox_input");
148
148
  this.#input.type = "text";
149
149
  this.#input.disabled = true;
150
150
  this.#input.style.display = "none";
151
- const glyph_open = new Icon(Icons.HARDWARE.KEYBOARD_ARROW_DOWN);
151
+ const glyphOpen = new Icon(Icons.HARDWARE.KEYBOARD_ARROW_DOWN);
152
152
  // Глиф-лигатура — украшение: без этого именем кнопки было бы «keyboard_arrow_down»
153
- glyph_open.set().setAttribute("aria-hidden", "true");
154
- this.#button_open.innerHTML = glyph_open.getHTML();
153
+ glyphOpen.set().setAttribute("aria-hidden", "true");
154
+ this.#buttonOpen.innerHTML = glyphOpen.getHTML();
155
155
  // Раскрывающийся селект: кнопка с состоянием и списком опций
156
- makeKeyboardButton(this.#button_open);
156
+ makeKeyboardButton(this.#buttonOpen);
157
157
  // Имя — самой кнопке: у контейнера селекта роли нет, и aria-label на нём не читается
158
- if (options.label !== undefined) this.#button_open.setAttribute("aria-label", options.label);
159
- this.#button_open.setAttribute("aria-haspopup", "listbox");
160
- this.#button_open.setAttribute("aria-expanded", "false");
158
+ if (options.label !== undefined) this.#buttonOpen.setAttribute("aria-label", options.label);
159
+ this.#buttonOpen.setAttribute("aria-haspopup", "listbox");
160
+ this.#buttonOpen.setAttribute("aria-expanded", "false");
161
161
  this.#dropdown.setAttribute("role", "listbox");
162
162
  this.#dropdown.setAttribute("id", this.#id);
163
- this.#button_open.setAttribute("aria-controls", this.#id);
164
- this.#dropdown.setAttribute("id", this.#id);
165
- this.#Select_second.appendChild(this.#input);
166
- this.#Select_second.appendChild(this.#div_value);
167
- this.#Select_second.appendChild(this.#button_open);
168
- this.#Select_second.appendChild(this.#dropdown);
163
+ this.#buttonOpen.setAttribute("aria-controls", this.#id);
164
+ this.#SelectSecond.appendChild(this.#input);
165
+ this.#SelectSecond.appendChild(this.#divValue);
166
+ this.#SelectSecond.appendChild(this.#buttonOpen);
167
+ this.#SelectSecond.appendChild(this.#dropdown);
169
168
  //LISTENERS
170
- this.#Select_second.addEventListener("click", (event) => {
171
- if (event.target.parentNode === this.#Select_second) {
169
+ this.#SelectSecond.addEventListener("click", (event) => {
170
+ if (event.target.parentNode === this.#SelectSecond) {
172
171
  this.#input.focus();
173
- this.#button_open.setAttribute("aria-expanded", "true");
174
- new Animation(this.#dropdown).fadeIn();
172
+ this.#buttonOpen.setAttribute("aria-expanded", "true");
173
+ new Animation(this.#dropdown).panelIn();
175
174
  TextEditorSelects.#setOptionDisplay(this.#dropdown);
176
- window.addEventListener("click", this.#window_click_event);
175
+ window.addEventListener("click", this.#windowClickEvent);
177
176
  }
178
177
  });
179
178
  this.#input.addEventListener("input", (event) => {
180
- let dropdown = this.#dropdown;
181
- for (let option of dropdown.childNodes) {
179
+ const dropdown = this.#dropdown;
180
+ for (const option of dropdown.childNodes) {
182
181
  if (!option.getAttribute("option_value").includes(event.target.value)) {
183
182
  option.style.display = "none";
184
183
  } else {
@@ -186,19 +185,19 @@ class TextEditorSelects {
186
185
  }
187
186
  }
188
187
  });
189
- this.#Select_main.appendChild(this.#Select_second);
188
+ this.#SelectMain.appendChild(this.#SelectSecond);
190
189
  }
191
- #window_click_event = (event) => {
192
- if (event.target.parentNode !== this.#Select_second) {
193
- window.removeEventListener("click", this.#window_click_event);
194
- this.#button_open.setAttribute("aria-expanded", "false");
190
+ #windowClickEvent = (event) => {
191
+ if (event.target.parentNode !== this.#SelectSecond) {
192
+ window.removeEventListener("click", this.#windowClickEvent);
193
+ this.#buttonOpen.setAttribute("aria-expanded", "false");
195
194
  new Animation(this.#dropdown).fadeOut();
196
195
  }
197
196
  };
198
197
  addOptionsFontSize(...options) {
199
- for (let opt of options) {
200
- let option = document.createElement(`text_editor_selectbox_option`);
201
- let fontSize = document.createElement("font");
198
+ for (const opt of options) {
199
+ const option = document.createElement(`text_editor_selectbox_option`);
200
+ const fontSize = document.createElement("font");
202
201
  fontSize.setAttribute("size", opt.value);
203
202
  fontSize.innerHTML = opt.name;
204
203
  option.setAttribute("option_value", opt.value);
@@ -212,9 +211,9 @@ class TextEditorSelects {
212
211
  }
213
212
  }
214
213
  addOptionsHeader(...options) {
215
- for (let opt of options) {
216
- let option = document.createElement(`text_editor_selectbox_option`);
217
- let header = document.createElement(`${opt.value.replace("<", "").replace(">", "")}`);
214
+ for (const opt of options) {
215
+ const option = document.createElement(`text_editor_selectbox_option`);
216
+ const header = document.createElement(`${opt.value.replace("<", "").replace(">", "")}`);
218
217
  header.innerHTML = opt.name;
219
218
  // Отступы снимает CSS по классу: прежде они ставились инлайном
220
219
  header.classList.add("text_editor_selectbox_option_header");
@@ -229,7 +228,7 @@ class TextEditorSelects {
229
228
  }
230
229
  }
231
230
  addValueChangeListener(listener = () => {}) {
232
- let observer = new MutationObserver((mutations) => {
231
+ const observer = new MutationObserver((mutations) => {
233
232
  mutations.forEach(listener);
234
233
  });
235
234
  observer.observe(this.#input, {
@@ -241,10 +240,10 @@ class TextEditorSelects {
241
240
  });
242
241
  }
243
242
  set() {
244
- return this.#Select_main;
243
+ return this.#SelectMain;
245
244
  }
246
245
  static #setOptionDisplay(element = new HTMLElement()) {
247
- for (let option of element.childNodes) {
246
+ for (const option of element.childNodes) {
248
247
  option.style.display = "block";
249
248
  }
250
249
  }
@@ -267,23 +266,23 @@ class TextEditorPanel {
267
266
  this.#editor = editor;
268
267
  // Управление
269
268
  if (controls.UNDO_REDO) {
270
- let button_undo = new TextEditorButtons({
269
+ const buttonUndo = new TextEditorButtons({
271
270
  icon: Icons.CONTENT.UNDO,
272
271
  command: Commands.UNDO,
273
272
  });
274
- let button_redo = new TextEditorButtons({
273
+ const buttonRedo = new TextEditorButtons({
275
274
  icon: Icons.CONTENT.REDO,
276
275
  command: Commands.REDO,
277
276
  });
278
- this.#addBlock(button_undo, button_redo);
277
+ this.#addBlock(buttonUndo, buttonRedo);
279
278
  }
280
279
  // formatBlock
281
280
  if (controls.BLOCK_FORMAT) {
282
- let select_headers = new TextEditorSelects({
281
+ const selectHeaders = new TextEditorSelects({
283
282
  icon: new Icon(Icons.EDITOR.TITLE).getHTML(),
284
283
  label: I18n.t("editor.paragraphAndHeading"),
285
284
  });
286
- select_headers.addOptionsHeader(
285
+ selectHeaders.addOptionsHeader(
287
286
  { name: "H1", value: "<h1>" },
288
287
  { name: "H2", value: "<h2>" },
289
288
  { name: "H3", value: "<h3>" },
@@ -293,24 +292,24 @@ class TextEditorPanel {
293
292
  { name: "Code", value: "<pre>" },
294
293
  { name: "Paragraph", value: "<P>" }
295
294
  );
296
- select_headers.addValueChangeListener((e) => {
295
+ selectHeaders.addValueChangeListener((e) => {
297
296
  document.execCommand("formatBlock", false, e.target.value);
298
297
  });
299
- this.#addBlock(select_headers);
300
- let button_format_quote = new TextEditorButtons({
298
+ this.#addBlock(selectHeaders);
299
+ const buttonFormatQuote = new TextEditorButtons({
301
300
  icon: Icons.EDITOR.FORMAT_QUOTE,
302
301
  command: Commands.FORMAT_BLOCK,
303
302
  value: "<BLOCKQUOTE>",
304
303
  label: I18n.t("editor.quote"),
305
304
  });
306
- this.#addBlock(button_format_quote);
305
+ this.#addBlock(buttonFormatQuote);
307
306
  }
308
307
  if (controls.FONT_SIZE) {
309
- let select_font_size = new TextEditorSelects({
308
+ const selectFontSize = new TextEditorSelects({
310
309
  icon: new Icon(Icons.EDITOR.FORMAT_SIZE).getHTML(),
311
310
  label: I18n.t("editor.fontSize"),
312
311
  });
313
- select_font_size.addOptionsFontSize(
312
+ selectFontSize.addOptionsFontSize(
314
313
  { name: "xx_small", value: "1" },
315
314
  { name: "x_small", value: "2" },
316
315
  { name: "small", value: "3" },
@@ -319,148 +318,148 @@ class TextEditorPanel {
319
318
  { name: "x_large", value: "6" },
320
319
  { name: "xx_large", value: "7" }
321
320
  );
322
- select_font_size.addValueChangeListener((e) => {
321
+ selectFontSize.addValueChangeListener((e) => {
323
322
  document.execCommand("fontSize", false, e.target.value);
324
323
  });
325
- this.#addBlock(select_font_size);
324
+ this.#addBlock(selectFontSize);
326
325
  }
327
326
  if (controls.REMOVE_FORMAT) {
328
- let button_removeFormat = new TextEditorButtons({
327
+ const buttonRemoveformat = new TextEditorButtons({
329
328
  icon: Icons.EDITOR.FORMAT_CLEAR,
330
329
  command: Commands.REMOVE_FORMAT,
331
330
  });
332
- this.#addBlock(button_removeFormat);
331
+ this.#addBlock(buttonRemoveformat);
333
332
  }
334
333
  // FORMAT
335
334
  if (controls.BOLD) {
336
- let button_bold_text = new TextEditorButtons({
335
+ const buttonBoldText = new TextEditorButtons({
337
336
  icon: Icons.EDITOR.FORMAT_BOLD,
338
337
  command: Commands.BOLD,
339
338
  });
340
- this.#addBlock(button_bold_text);
339
+ this.#addBlock(buttonBoldText);
341
340
  }
342
341
  if (controls.ITALIC) {
343
- let button_italic_text = new TextEditorButtons({
342
+ const buttonItalicText = new TextEditorButtons({
344
343
  icon: Icons.EDITOR.FORMAT_ITALIC,
345
344
  command: Commands.ITALIC,
346
345
  });
347
- this.#addBlock(button_italic_text);
346
+ this.#addBlock(buttonItalicText);
348
347
  }
349
348
  if (controls.STRIKE_THROUGH) {
350
- let button_strikeThrough = new TextEditorButtons({
349
+ const buttonStrikethrough = new TextEditorButtons({
351
350
  icon: Icons.EDITOR.FORMAT_STRIKETHROUGH,
352
351
  command: Commands.STRIKE_THROUGH,
353
352
  });
354
- this.#addBlock(button_strikeThrough);
353
+ this.#addBlock(buttonStrikethrough);
355
354
  }
356
355
  if (controls.UNDERLINE) {
357
- let button_underline = new TextEditorButtons({
356
+ const buttonUnderline = new TextEditorButtons({
358
357
  icon: Icons.EDITOR.FORMAT_UNDERLINED,
359
358
  command: Commands.UNDERLINE,
360
359
  });
361
- this.#addBlock(button_underline);
360
+ this.#addBlock(buttonUnderline);
362
361
  }
363
362
  //
364
363
  if (controls.SUPERSCRIPT) {
365
- let button_superscript = new TextEditorButtons({
364
+ const buttonSuperscript = new TextEditorButtons({
366
365
  icon: Icons.EDITOR.SUPERSCRIPT,
367
366
  command: Commands.SUPER_SCRIPT,
368
367
  });
369
- this.#addBlock(button_superscript);
368
+ this.#addBlock(buttonSuperscript);
370
369
  }
371
370
  if (controls.SUBSCRIPT) {
372
- let button_subscript = new TextEditorButtons({
371
+ const buttonSubscript = new TextEditorButtons({
373
372
  icon: Icons.EDITOR.SUBSCRIPT,
374
373
  command: Commands.SUB_SCRIPT,
375
374
  });
376
- this.#addBlock(button_subscript);
375
+ this.#addBlock(buttonSubscript);
377
376
  }
378
377
  //
379
378
  if (controls.JUSTIFY_LEFT) {
380
- let button_justifyLeft = new TextEditorButtons({
379
+ const buttonJustifyleft = new TextEditorButtons({
381
380
  icon: Icons.EDITOR.FORMAT_ALIGN_LEFT,
382
381
  command: Commands.JUSTIFY_LEFT,
383
382
  });
384
- this.#addBlock(button_justifyLeft);
383
+ this.#addBlock(buttonJustifyleft);
385
384
  }
386
385
  if (controls.JUSTIFY_CENTER) {
387
- let button_justifyCenter = new TextEditorButtons({
386
+ const buttonJustifycenter = new TextEditorButtons({
388
387
  icon: Icons.EDITOR.FORMAT_ALIGN_CENTER,
389
388
  command: Commands.JUSTIFY_CENTER,
390
389
  });
391
- this.#addBlock(button_justifyCenter);
390
+ this.#addBlock(buttonJustifycenter);
392
391
  }
393
392
  if (controls.JUSTIFY_RIGHT) {
394
- let button_justifyRight = new TextEditorButtons({
393
+ const buttonJustifyright = new TextEditorButtons({
395
394
  icon: Icons.EDITOR.FORMAT_ALIGN_RIGHT,
396
395
  command: Commands.JUSTIFY_RIGHT,
397
396
  });
398
- this.#addBlock(button_justifyRight);
397
+ this.#addBlock(buttonJustifyright);
399
398
  }
400
399
  if (controls.JUSTIFY_FULL) {
401
- let button_justifyFull = new TextEditorButtons({
400
+ const buttonJustifyfull = new TextEditorButtons({
402
401
  icon: Icons.EDITOR.FORMAT_ALIGN_JUSTIFY,
403
402
  command: Commands.JUSTIFY_FULL,
404
403
  });
405
- this.#addBlock(button_justifyFull);
404
+ this.#addBlock(buttonJustifyfull);
406
405
  }
407
406
  //
408
407
  if (controls.LISTS) {
409
- let button_list_one = new TextEditorButtons({
408
+ const buttonListOne = new TextEditorButtons({
410
409
  icon: Icons.EDITOR.FORMAT_LIST_NUMBERED,
411
410
  command: Commands.INSERT_ORDERED_LIST,
412
411
  });
413
- let button_list_two = new TextEditorButtons({
412
+ const buttonListTwo = new TextEditorButtons({
414
413
  icon: Icons.EDITOR.FORMAT_LIST_BULLETED,
415
414
  command: Commands.INSERT_UNORDERED_LIST,
416
415
  });
417
- this.#addBlock(button_list_one, button_list_two);
416
+ this.#addBlock(buttonListOne, buttonListTwo);
418
417
  }
419
418
  //
420
419
  // Создание ссылки
421
420
  if (controls.INSERT_LINK) {
422
- let button_unlink = new TextEditorButtons({
421
+ const buttonUnlink = new TextEditorButtons({
423
422
  icon: Icons.CONTENT.LINK_OFF,
424
423
  command: Commands.UNLINK,
425
424
  });
426
- let content_link = new ContentBlock({
425
+ const contentLink = new ContentBlock({
427
426
  direction: "column",
428
427
  wrap: "wrap",
429
428
  align: "center",
430
429
  justify: "flex-end",
431
430
  });
432
- content_link.setWidth("-webkit-fill-available");
433
- let content_link_header = new ContentBlock({
431
+ contentLink.setWidth("-webkit-fill-available");
432
+ const contentLinkHeader = new ContentBlock({
434
433
  direction: "row",
435
434
  wrap: "wrap",
436
435
  align: "center",
437
436
  justify: "space-between",
438
437
  disableMarginChild: true,
439
438
  });
440
- content_link_header.setWidth("-webkit-fill-available");
441
- let dialog_link = new Dialog({ width: "500px", height: "max-content", closeOutSideClick: true });
442
- let input_link_text = new TextInput({
439
+ contentLinkHeader.setWidth("-webkit-fill-available");
440
+ const dialogLink = new Dialog({ width: "500px", height: "max-content", closeOutSideClick: true });
441
+ const inputLinkText = new TextInput({
443
442
  title: I18n.t("editor.name"),
444
443
  placeholder: I18n.t("editor.name"),
445
444
  width: "-webkit-fill-available",
446
445
  disableFocus: false,
447
446
  });
448
- let input_link = new TextInput({
447
+ const inputLink = new TextInput({
449
448
  title: I18n.t("editor.link"),
450
449
  placeholder: "https://",
451
450
  width: "-webkit-fill-available",
452
451
  value: "https://example.ru",
453
452
  disableFocus: false,
454
453
  });
455
- content_link.add(input_link_text, input_link);
456
- dialog_link.addToBody(content_link);
457
- content_link_header.add(
454
+ contentLink.add(inputLinkText, inputLink);
455
+ dialogLink.addToBody(contentLink);
456
+ contentLinkHeader.add(
458
457
  new Button({
459
458
  icon: Icons.NAVIGATION.CLOSE,
460
459
  label: I18n.t("common.close"),
461
460
  clickEvent: () => {
462
461
  this.#editor.focus();
463
- dialog_link.close();
462
+ dialogLink.close();
464
463
  },
465
464
  }),
466
465
  new Label({ text: I18n.t("editor.addLink") }),
@@ -470,81 +469,81 @@ class TextEditorPanel {
470
469
  clickEvent: () => {
471
470
  this.#editor.focus();
472
471
  document.getSelection().removeAllRanges();
473
- document.getSelection().addRange(range_link);
474
- if (selection_link.toString() === "")
472
+ document.getSelection().addRange(rangeLink);
473
+ if (selectionLink.toString() === "")
475
474
  document.execCommand(
476
475
  "insertHTML",
477
476
  false,
478
- `<a href="${input_link.getValue()}">${input_link_text.getValue()}</a>`
477
+ `<a href="${inputLink.getValue()}">${inputLinkText.getValue()}</a>`
479
478
  );
480
- else document.execCommand(Commands.CREATE_LINK, false, input_link.getValue());
481
- dialog_link.close();
479
+ else document.execCommand(Commands.CREATE_LINK, false, inputLink.getValue());
480
+ dialogLink.close();
482
481
  },
483
482
  })
484
483
  );
485
- dialog_link.addToHeader(content_link_header);
486
- let selection_link = undefined;
487
- let range_link = undefined;
488
- let button_link = new TextEditorButtons({
484
+ dialogLink.addToHeader(contentLinkHeader);
485
+ let selectionLink = undefined;
486
+ let rangeLink = undefined;
487
+ const buttonLink = new TextEditorButtons({
489
488
  icon: Icons.CONTENT.LINK,
490
489
  disableFocus: true,
491
490
  label: I18n.t("editor.insertLink"),
492
491
  listener: () => {
493
492
  this.#editor.focus();
494
- selection_link = document.getSelection();
495
- range_link = selection_link.getRangeAt(0);
496
- input_link_text.setValue(selection_link.toString());
497
- if (selection_link.toString() === "") input_link_text.setDisabled(false);
498
- else input_link_text.setDisabled(true);
499
- dialog_link.open();
493
+ selectionLink = document.getSelection();
494
+ rangeLink = selectionLink.getRangeAt(0);
495
+ inputLinkText.setValue(selectionLink.toString());
496
+ if (selectionLink.toString() === "") inputLinkText.setDisabled(false);
497
+ else inputLinkText.setDisabled(true);
498
+ dialogLink.open();
500
499
  },
501
500
  });
502
- this.#addBlock(button_unlink, button_link, dialog_link);
501
+ this.#addBlock(buttonUnlink, buttonLink, dialogLink);
503
502
  }
504
503
  // ================
505
504
  // Создание таблицы
506
505
  if (controls.INSERT_TABLE) {
507
- let content_table_header = new ContentBlock({
506
+ const contentTableHeader = new ContentBlock({
508
507
  direction: "row",
509
508
  wrap: "wrap",
510
509
  align: "center",
511
510
  justify: "space-between",
512
511
  disableMarginChild: true,
513
512
  });
514
- content_table_header.setWidth("-webkit-fill-available");
515
- let content_table_2 = new ContentBlock({
513
+ contentTableHeader.setWidth("-webkit-fill-available");
514
+ const contentTable2 = new ContentBlock({
516
515
  direction: "row",
517
516
  wrap: "wrap",
518
517
  align: "center",
519
518
  justify: "space-around",
520
519
  });
521
- content_table_2.setWidth("-webkit-fill-available");
522
- let content_table = new ContentBlock({
520
+ contentTable2.setWidth("-webkit-fill-available");
521
+ const contentTable = new ContentBlock({
523
522
  direction: "row",
524
523
  wrap: "wrap",
525
524
  align: "center",
526
525
  justify: "space-around",
527
526
  });
528
- content_table.setWidth("-webkit-fill-available");
529
- let content_table_main = new ContentBlock({
527
+ contentTable.setWidth("-webkit-fill-available");
528
+ const contentTableMain = new ContentBlock({
530
529
  direction: "column",
531
530
  wrap: "wrap",
532
531
  align: "center",
533
532
  justify: "space-around",
534
533
  });
535
- content_table_main.setWidth("-webkit-fill-available");
536
- let checkBox_header = new CheckBox({ title: I18n.t("editor.addThead") });
537
- content_table_2.add(checkBox_header);
538
- let table_rows = new NumberInput({ title: I18n.t("editor.rows") });
539
- let table_cols = new NumberInput({ title: I18n.t("editor.columns") });
540
- content_table.add(table_rows, new Label("X"), table_cols);
534
+ contentTableMain.setWidth("-webkit-fill-available");
535
+ const checkboxHeader = new CheckBox({ title: I18n.t("editor.addThead") });
536
+ contentTable2.add(checkboxHeader);
537
+ const tableRows = new NumberInput({ title: I18n.t("editor.rows") });
538
+ const tableColumns = new NumberInput({ title: I18n.t("editor.columns") });
539
+ contentTable.add(tableRows, new Label("X"), tableColumns);
541
540
 
542
- content_table_header.add(
541
+ contentTableHeader.add(
543
542
  new Button({
544
543
  icon: Icons.NAVIGATION.CLOSE,
545
544
  label: I18n.t("common.close"),
546
545
  clickEvent: () => {
547
- dialog_table.close();
546
+ dialogTable.close();
548
547
  },
549
548
  }),
550
549
  new Label({ text: I18n.t("editor.addTable") }),
@@ -553,86 +552,86 @@ class TextEditorPanel {
553
552
  label: I18n.t("editor.addTable"),
554
553
  clickEvent: () => {
555
554
  let error = false;
556
- if (Number(table_rows.getValue()) === 0 && Number(table_cols.getValue()) === 0) {
555
+ if (Number(tableRows.getValue()) === 0 && Number(tableColumns.getValue()) === 0) {
557
556
  new Notification(I18n.t("editor.setColumnsAndRows"), Notification.STYLE.ERROR).show();
558
557
  error = true;
559
- } else if (Number(table_cols.getValue()) === 0) {
558
+ } else if (Number(tableColumns.getValue()) === 0) {
560
559
  new Notification(I18n.t("editor.setColumns"), Notification.STYLE.ERROR).show();
561
560
  error = true;
562
- } else if (Number(table_rows.getValue()) === 0) {
561
+ } else if (Number(tableRows.getValue()) === 0) {
563
562
  new Notification(I18n.t("editor.setRows"), Notification.STYLE.ERROR).show();
564
563
  error = true;
565
564
  }
566
565
  if (!error) {
567
- let table = document.createElement("table");
566
+ const table = document.createElement("table");
568
567
  table.classList.add("text_editor_table");
569
568
  // шапка
570
- if (checkBox_header.getValue()) {
571
- let head_table = table.createTHead();
572
- head_table.classList.add("text_editor_table_body");
573
- let head_row = head_table.insertRow(0);
574
- head_row.classList.add("text_editor_table_row");
575
- for (let j = 0; j < table_cols.getValue(); j++) {
576
- let cell = head_row.insertCell(j);
569
+ if (checkboxHeader.getValue()) {
570
+ const headTable = table.createTHead();
571
+ headTable.classList.add("text_editor_table_body");
572
+ const headRow = headTable.insertRow(0);
573
+ headRow.classList.add("text_editor_table_row");
574
+ for (let j = 0; j < tableColumns.getValue(); j++) {
575
+ const cell = headRow.insertCell(j);
577
576
  cell.classList.add("text_editor_table_cell");
578
577
  cell.innerText = `TH`;
579
578
  }
580
579
  }
581
580
  // тело таблицы
582
- let body_table = table.createTBody();
583
- body_table.classList.add("text_editor_table_body");
584
- for (let i = 0; i < table_rows.getValue(); i++) {
585
- let row = body_table.insertRow(i);
581
+ const bodyTable = table.createTBody();
582
+ bodyTable.classList.add("text_editor_table_body");
583
+ for (let i = 0; i < tableRows.getValue(); i++) {
584
+ const row = bodyTable.insertRow(i);
586
585
  row.classList.add("text_editor_table_row");
587
- for (let j = 0; j < table_cols.getValue(); j++) {
588
- let cell = row.insertCell(j);
586
+ for (let j = 0; j < tableColumns.getValue(); j++) {
587
+ const cell = row.insertCell(j);
589
588
  cell.classList.add("text_editor_table_cell");
590
589
  cell.innerText = `TB`;
591
590
  }
592
591
  }
593
592
  this.#editor.focus();
594
593
  document.execCommand(Commands.INSERT_HTML, false, table.outerHTML);
595
- dialog_table.close();
594
+ dialogTable.close();
596
595
  }
597
596
  },
598
597
  })
599
598
  );
600
599
 
601
- let dialog_table = new Dialog({ width: "500px", height: "max-content", closeOutSideClick: true });
602
- dialog_table.addToHeader(content_table_header);
603
- content_table_main.add(content_table_2, content_table);
604
- dialog_table.addToBody(content_table_main);
605
- let button_table = new TextEditorButtons({
600
+ const dialogTable = new Dialog({ width: "500px", height: "max-content", closeOutSideClick: true });
601
+ dialogTable.addToHeader(contentTableHeader);
602
+ contentTableMain.add(contentTable2, contentTable);
603
+ dialogTable.addToBody(contentTableMain);
604
+ const buttonTable = new TextEditorButtons({
606
605
  icon: Icons.EDITOR.TABLE_CHART,
607
606
  label: I18n.t("editor.insertTable"),
608
607
  listener: () => {
609
608
  this.#editor.focus();
610
- dialog_table.open();
609
+ dialogTable.open();
611
610
  },
612
611
  });
613
- this.#addBlock(button_table, dialog_table);
612
+ this.#addBlock(buttonTable, dialogTable);
614
613
  }
615
614
  // ================
616
615
  // Добавление изображения
617
616
  if (controls.INSERT_IMAGE) {
618
- let content_image_header = new ContentBlock({
617
+ const contentImageHeader = new ContentBlock({
619
618
  direction: "row",
620
619
  wrap: "wrap",
621
620
  align: "center",
622
621
  justify: "space-between",
623
622
  disableMarginChild: true,
624
623
  });
625
- content_image_header.setWidth("-webkit-fill-available");
626
- let file = new FileInput({
624
+ contentImageHeader.setWidth("-webkit-fill-available");
625
+ const file = new FileInput({
627
626
  title: I18n.t("editor.selectImage"),
628
627
  multiple: false,
629
628
  accept: [AcceptTypes.ALL_IMAGE],
630
629
  });
631
- content_image_header.add(
630
+ contentImageHeader.add(
632
631
  new Button({
633
632
  icon: Icons.NAVIGATION.CLOSE,
634
633
  label: I18n.t("common.close"),
635
- clickEvent: () => dialog_image.close(),
634
+ clickEvent: () => dialogImage.close(),
636
635
  }),
637
636
  new Label({ text: I18n.t("editor.addImage") }),
638
637
  new Button({
@@ -640,8 +639,8 @@ class TextEditorPanel {
640
639
  label: I18n.t("editor.addImage"),
641
640
  clickEvent: () => {
642
641
  this.#editor.focus();
643
- let image = file.getFile(0);
644
- let reader = new FileReader();
642
+ const image = file.getFile(0);
643
+ const reader = new FileReader();
645
644
  reader.addEventListener(
646
645
  "load",
647
646
  () => {
@@ -650,64 +649,64 @@ class TextEditorPanel {
650
649
  false
651
650
  );
652
651
  if (image) reader.readAsDataURL(image);
653
- dialog_image.close();
652
+ dialogImage.close();
654
653
  },
655
654
  })
656
655
  );
657
656
 
658
- let content_image = new ContentBlock({
657
+ const contentImage = new ContentBlock({
659
658
  direction: "column",
660
659
  wrap: "wrap",
661
660
  align: "center",
662
661
  justify: "flex-end",
663
662
  });
664
- content_image.setWidth("-webkit-fill-available");
665
- content_image.add(file);
666
- let dialog_image = new Dialog({ width: "500px", height: "max-content", closeOutSideClick: true });
667
- dialog_image.addToHeader(content_image_header);
668
- dialog_image.addToBody(content_image);
663
+ contentImage.setWidth("-webkit-fill-available");
664
+ contentImage.add(file);
665
+ const dialogImage = new Dialog({ width: "500px", height: "max-content", closeOutSideClick: true });
666
+ dialogImage.addToHeader(contentImageHeader);
667
+ dialogImage.addToBody(contentImage);
669
668
 
670
- let button_image = new TextEditorButtons({
669
+ const buttonImage = new TextEditorButtons({
671
670
  icon: Icons.EDITOR.INSERT_PHOTO,
672
671
  label: I18n.t("editor.insertImage"),
673
672
  listener: () => {
674
673
  this.#editor.focus();
675
- dialog_image.open();
674
+ dialogImage.open();
676
675
  },
677
676
  });
678
- this.#addBlock(button_image, dialog_image);
677
+ this.#addBlock(buttonImage, dialogImage);
679
678
  }
680
679
  // ======================
681
680
  if (controls.LINE_BREAK) {
682
- let button_line_break = new TextEditorButtons({
681
+ const buttonLineBreak = new TextEditorButtons({
683
682
  icon: Icons.EDITOR.INSERT_PAGE_BREAK,
684
683
  command: Commands.INSERT_LINE_BREAK,
685
684
  });
686
- this.#addBlock(button_line_break);
685
+ this.#addBlock(buttonLineBreak);
687
686
  }
688
687
  //
689
688
  if (controls.CONTENT_CONTROLS) {
690
- let button_COPY = new TextEditorButtons({
689
+ const buttonCopy = new TextEditorButtons({
691
690
  icon: Icons.CONTENT.CONTENT_COPY,
692
691
  command: Commands.COPY,
693
692
  });
694
- let button_CUT = new TextEditorButtons({
693
+ const buttonCut = new TextEditorButtons({
695
694
  icon: Icons.CONTENT.CONTENT_CUT,
696
695
  command: Commands.CUT,
697
696
  });
698
- let button_PASTE = new TextEditorButtons({
697
+ const buttonPaste = new TextEditorButtons({
699
698
  icon: Icons.CONTENT.CONTENT_PASTE,
700
699
  command: Commands.PASTE,
701
700
  });
702
- this.#addBlock(button_COPY, button_CUT, button_PASTE);
701
+ this.#addBlock(buttonCopy, buttonCut, buttonPaste);
703
702
  }
704
703
  // Панель — одна остановка Tab: стрелки и Home/End водят фокус по её пунктам,
705
704
  // иначе все кнопки и раскрывающиеся списки стояли бы в обходе Tab подряд
706
705
  new RovingKeyboard(this.#panel, { itemSelector: PANEL_ITEM_SELECTOR });
707
706
  }
708
707
  #addBlock(...childs) {
709
- let elem = document.createElement("text_editor_block");
710
- for (let child of childs) elem.appendChild(child.set());
708
+ const elem = document.createElement("text_editor_block");
709
+ for (const child of childs) elem.appendChild(child.set());
711
710
  this.#panel.appendChild(elem);
712
711
  }
713
712
  set() {