chuijs 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +113 -0
- package/README.md +43 -632
- package/framework/appLayout/default/chui_app_layout.js +314 -273
- package/framework/appLayout/default/global_style.css +93 -53
- package/framework/components/chui_accordion/accordion.js +29 -26
- package/framework/components/chui_accordion/styles.css +6 -5
- package/framework/components/chui_action_sheet/action_sheet.js +59 -33
- package/framework/components/chui_action_sheet/styles.css +2 -1
- package/framework/components/chui_affix/affix.js +11 -6
- package/framework/components/chui_alert/alert.js +23 -14
- package/framework/components/chui_avatar/avatar.js +23 -22
- package/framework/components/chui_avatar_group/avatar_group.js +21 -19
- package/framework/components/chui_backtop/backtop.js +35 -19
- package/framework/components/chui_badge/badge.js +15 -13
- package/framework/components/chui_breadcrumb/breadcrumb.js +15 -13
- package/framework/components/chui_button/button.js +42 -22
- package/framework/components/chui_button/styles.css +2 -2
- package/framework/components/chui_calendar/calendar.js +12 -10
- package/framework/components/chui_card/card.js +43 -23
- package/framework/components/chui_chat/chat.js +72 -33
- package/framework/components/chui_clipboard_history/clipboard_history.js +30 -21
- package/framework/components/chui_clipboard_history/styles.css +4 -2
- package/framework/components/chui_code/code.js +2 -2
- package/framework/components/chui_code/styles.css +2 -2
- package/framework/components/chui_code_editor/code_editor.js +47 -31
- package/framework/components/chui_code_editor/styles.css +3 -2
- package/framework/components/chui_command_palette/command_palette.js +60 -37
- package/framework/components/chui_console/console.js +5 -5
- package/framework/components/chui_console/styles.css +1 -1
- package/framework/components/chui_content_block/content_block.js +33 -19
- package/framework/components/chui_content_block/styles.css +2 -2
- package/framework/components/chui_context_menu/context_menu.js +9 -4
- package/framework/components/chui_custom_element/custom_element.js +22 -15
- package/framework/components/chui_data_grid/data_grid.js +396 -234
- package/framework/components/chui_data_grid/styles.css +10 -8
- package/framework/components/chui_descriptions/descriptions.js +34 -17
- package/framework/components/chui_details/details.js +32 -26
- package/framework/components/chui_details/styles.css +5 -4
- package/framework/components/chui_diff_viewer/diff_viewer.js +91 -66
- package/framework/components/chui_diff_viewer/styles.css +1 -1
- package/framework/components/chui_divider/divider.js +13 -11
- package/framework/components/chui_drawer/drawer.js +27 -25
- package/framework/components/chui_drop_zone/drop_zone.js +31 -21
- package/framework/components/chui_empty_state/empty_state.js +20 -15
- package/framework/components/chui_fieldset/fieldset.js +37 -20
- package/framework/components/chui_fieldset/styles.css +1 -1
- package/framework/components/chui_file_explorer/file_explorer.js +157 -86
- package/framework/components/chui_file_explorer/styles.css +2 -1
- package/framework/components/chui_form/form.js +31 -19
- package/framework/components/chui_form/styles.css +1 -1
- package/framework/components/chui_gantt/gantt.js +64 -40
- package/framework/components/chui_graphs/graphs.js +301 -200
- package/framework/components/chui_graphs/styles.css +1 -1
- package/framework/components/chui_hero/hero.js +40 -22
- package/framework/components/chui_html_block/html_block.js +6 -6
- package/framework/components/chui_html_block/styles.css +2 -2
- package/framework/components/chui_hx/hx.js +3 -3
- package/framework/components/chui_hx/styles.css +11 -4
- package/framework/components/chui_icons/icons.js +2109 -2109
- package/framework/components/chui_icons/styles.css +2 -2
- package/framework/components/chui_inputs/chui_check_box/check_box.js +31 -19
- package/framework/components/chui_inputs/chui_check_box/styles.css +18 -18
- package/framework/components/chui_inputs/chui_chips/chips.js +50 -40
- package/framework/components/chui_inputs/chui_chips/styles.css +4 -2
- package/framework/components/chui_inputs/chui_color_picker/color_picker.js +36 -24
- package/framework/components/chui_inputs/chui_combo_box/combo_box.js +100 -82
- package/framework/components/chui_inputs/chui_combo_box/styles.css +14 -12
- package/framework/components/chui_inputs/chui_date/date.js +102 -66
- package/framework/components/chui_inputs/chui_date/styles.css +12 -11
- package/framework/components/chui_inputs/chui_date_range/date_range.js +40 -29
- package/framework/components/chui_inputs/chui_datetime/datetime.js +35 -27
- package/framework/components/chui_inputs/chui_email/email.js +43 -31
- package/framework/components/chui_inputs/chui_email/styles.css +5 -5
- package/framework/components/chui_inputs/chui_file/file.js +68 -41
- package/framework/components/chui_inputs/chui_file/styles.css +13 -12
- package/framework/components/chui_inputs/chui_hotkey/hotkey.js +61 -36
- package/framework/components/chui_inputs/chui_masked/masked.js +39 -28
- package/framework/components/chui_inputs/chui_mention/mention.js +77 -30
- package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +173 -153
- package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +9 -7
- package/framework/components/chui_inputs/chui_number/number.js +58 -41
- package/framework/components/chui_inputs/chui_number/styles.css +7 -7
- package/framework/components/chui_inputs/chui_otp/otp.js +38 -29
- package/framework/components/chui_inputs/chui_password/password.js +58 -36
- package/framework/components/chui_inputs/chui_password/styles.css +8 -8
- package/framework/components/chui_inputs/chui_radio_button/radio_button.js +37 -25
- package/framework/components/chui_inputs/chui_radio_button/styles.css +20 -20
- package/framework/components/chui_inputs/chui_rating/rating.js +26 -22
- package/framework/components/chui_inputs/chui_select_box/select_box.js +102 -78
- package/framework/components/chui_inputs/chui_select_box/styles.css +11 -11
- package/framework/components/chui_inputs/chui_slider/slider.js +29 -26
- package/framework/components/chui_inputs/chui_slider/styles.css +2 -1
- package/framework/components/chui_inputs/chui_text/styles.css +8 -8
- package/framework/components/chui_inputs/chui_text/text.js +65 -44
- package/framework/components/chui_inputs/chui_text_area/styles.css +6 -6
- package/framework/components/chui_inputs/chui_text_area/text_area.js +51 -28
- package/framework/components/chui_inputs/chui_time/styles.css +5 -3
- package/framework/components/chui_inputs/chui_time/time.js +38 -27
- package/framework/components/chui_inputs/chui_toggle/styles.css +3 -3
- package/framework/components/chui_inputs/chui_toggle/toggle.js +16 -16
- package/framework/components/chui_json_editor/json_editor.js +53 -43
- package/framework/components/chui_json_viewer/json_viewer.js +52 -33
- package/framework/components/chui_json_viewer/styles.css +3 -2
- package/framework/components/chui_kanban/kanban.js +52 -34
- package/framework/components/chui_kbd/kbd.js +12 -10
- package/framework/components/chui_label/label.js +14 -12
- package/framework/components/chui_label/styles.css +2 -2
- package/framework/components/chui_link/link.js +27 -20
- package/framework/components/chui_list/list.js +31 -27
- package/framework/components/chui_list/styles.css +2 -1
- package/framework/components/chui_markdown_editor/markdown_editor.js +60 -44
- package/framework/components/chui_media/audio.js +326 -227
- package/framework/components/chui_media/audio_styles.css +40 -21
- package/framework/components/chui_media/image.js +70 -38
- package/framework/components/chui_media/image_compare.js +52 -21
- package/framework/components/chui_media/image_styles.css +3 -3
- package/framework/components/chui_media/video.js +155 -62
- package/framework/components/chui_media/video_styles.css +33 -16
- package/framework/components/chui_menu_bar/menu_bar.js +26 -24
- package/framework/components/chui_menu_bar/styles.css +4 -2
- package/framework/components/chui_modal/modal.js +44 -43
- package/framework/components/chui_modal/styles.css +3 -2
- package/framework/components/chui_notification/notification.js +50 -34
- package/framework/components/chui_notification/notification_download.js +31 -25
- package/framework/components/chui_notification/notification_download_progress.css +3 -2
- package/framework/components/chui_notification/notification_download_progress.js +47 -41
- package/framework/components/chui_notification/notification_update.js +23 -16
- package/framework/components/chui_notification/status_plate.js +2 -2
- package/framework/components/chui_notification/styles_download.css +1 -1
- package/framework/components/chui_notification/styles_update.css +1 -1
- package/framework/components/chui_org_chart/org_chart.js +74 -35
- package/framework/components/chui_pagination/pagination.js +62 -27
- package/framework/components/chui_paragraph/paragraph.js +2 -2
- package/framework/components/chui_paragraph/styles.css +1 -1
- package/framework/components/chui_popover/popover.js +49 -28
- package/framework/components/chui_popups/popups.js +137 -108
- package/framework/components/chui_popups/styles.css +2 -2
- package/framework/components/chui_print_button/print_button.js +33 -23
- package/framework/components/chui_progress_bar/progress_bar.js +23 -15
- package/framework/components/chui_progress_bar/styles.css +2 -2
- package/framework/components/chui_progress_ring/progress_ring.js +17 -15
- package/framework/components/chui_qrcode/qrcode.js +75 -31
- package/framework/components/chui_query_builder/query_builder.js +216 -123
- package/framework/components/chui_radio_group/radio_group.js +36 -26
- package/framework/components/chui_radio_group/styles.css +1 -1
- package/framework/components/chui_result/result.js +26 -16
- package/framework/components/chui_scheduler/scheduler.js +57 -35
- package/framework/components/chui_scheduler/styles.css +6 -2
- package/framework/components/chui_segmented_control/segmented_control.js +27 -21
- package/framework/components/chui_settings/settings.js +122 -48
- package/framework/components/chui_shortcut_help/shortcut_help.js +55 -32
- package/framework/components/chui_sidebar_nav/sidebar_nav.js +33 -23
- package/framework/components/chui_skeleton/skeleton.js +29 -24
- package/framework/components/chui_slideshow/slideshow.js +60 -41
- package/framework/components/chui_slideshow/styles.css +18 -12
- package/framework/components/chui_spinner/spinner.js +8 -8
- package/framework/components/chui_spinner/styles.css +0 -1
- package/framework/components/chui_split_button/split_button.js +23 -18
- package/framework/components/chui_split_button/styles.css +1 -1
- package/framework/components/chui_splitter/splitter.js +35 -28
- package/framework/components/chui_statistic/statistic.js +65 -38
- package/framework/components/chui_status_bar/status_bar.js +11 -9
- package/framework/components/chui_stepper/stepper.js +27 -22
- package/framework/components/chui_sticky_bar/sticky_bar.js +9 -4
- package/framework/components/chui_sticky_bar/styles.css +3 -1
- package/framework/components/chui_tabs/chui_tabs.js +28 -22
- package/framework/components/chui_tabs/styles.css +3 -3
- package/framework/components/chui_text_editor/styles.css +20 -19
- package/framework/components/chui_text_editor/text_editor.js +85 -61
- package/framework/components/chui_text_editor/text_editor_panel.js +346 -284
- package/framework/components/chui_theme_toggle/theme_toggle.js +27 -22
- package/framework/components/chui_timeline/timeline.js +14 -12
- package/framework/components/chui_toast_queue/toast_queue.js +52 -46
- package/framework/components/chui_toolbar/toolbar.js +20 -13
- package/framework/components/chui_tooltip/tooltip.js +37 -24
- package/framework/components/chui_tour/styles.css +8 -3
- package/framework/components/chui_tour/tour.js +61 -27
- package/framework/components/chui_transfer/styles.css +2 -1
- package/framework/components/chui_transfer/transfer.js +75 -42
- package/framework/components/chui_tree_table/tree_table.js +43 -29
- package/framework/components/chui_tree_view/styles.css +4 -2
- package/framework/components/chui_tree_view/tree_view.js +142 -99
- package/framework/components/chui_watermark/watermark.js +24 -16
- package/framework/components/chui_webview/styles.css +2 -2
- package/framework/components/chui_webview/webview.js +62 -50
- package/framework/components/telegram_bot/chui_telegram_bot.js +71 -64
- package/framework/modules/chui_a11y/chui_a11y.js +77 -46
- package/framework/modules/chui_animations/animations.js +42 -42
- package/framework/modules/chui_animations/styles.css +1 -1
- package/framework/modules/chui_bridge/preload.js +56 -26
- package/framework/modules/chui_functions.js +52 -50
- package/framework/modules/chui_highlight/chui_highlight.js +25 -22
- package/framework/modules/chui_i18n/chui_i18n.js +9 -7
- package/framework/modules/chui_i18n/locales/a11y.js +5 -5
- package/framework/modules/chui_i18n/locales/app_layout.js +5 -5
- package/framework/modules/chui_i18n/locales/calendar.js +3 -3
- package/framework/modules/chui_i18n/locales/common.js +3 -3
- package/framework/modules/chui_i18n/locales/data.js +36 -26
- package/framework/modules/chui_i18n/locales/editors.js +40 -13
- package/framework/modules/chui_i18n/locales/feedback.js +3 -3
- package/framework/modules/chui_i18n/locales/forms.js +8 -8
- package/framework/modules/chui_i18n/locales/graphics.js +8 -8
- package/framework/modules/chui_i18n/locales/media.js +4 -4
- package/framework/modules/chui_i18n/locales/navigation.js +8 -8
- package/framework/modules/chui_i18n/locales/validate.js +3 -3
- package/framework/modules/chui_json/chui_json.js +9 -9
- package/framework/modules/chui_layout/chui_layout.js +12 -10
- package/framework/modules/chui_logger/chui_logger.js +29 -25
- package/framework/modules/chui_page/page.js +33 -27
- package/framework/modules/chui_page/styles.css +3 -26
- package/framework/modules/chui_qr/chui_qr.js +158 -67
- package/framework/modules/chui_scrollbar/chui_scrollbar.js +35 -24
- package/framework/modules/chui_scrollbar/styles.css +3 -1
- package/framework/modules/chui_services/chui_channels.js +76 -11
- package/framework/modules/chui_services/chui_services.js +39 -31
- package/framework/modules/chui_services/desktop.js +149 -30
- package/framework/modules/chui_sortable/chui_sortable.js +17 -12
- package/framework/modules/chui_validate/chui_validate.js +7 -4
- package/framework/tray_bar/chui_menu_items.js +136 -46
- package/index.d.ts +4814 -0
- package/index.js +449 -334
- package/package.json +79 -68
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {I18n} = require("../../modules/chui_i18n/chui_i18n");
|
|
1
|
+
const { I18n } = require("../../modules/chui_i18n/chui_i18n");
|
|
2
2
|
|
|
3
3
|
class Calendar {
|
|
4
4
|
constructor(year, month) {
|
|
@@ -11,14 +11,16 @@ class Calendar {
|
|
|
11
11
|
new Array(7),
|
|
12
12
|
new Array(7),
|
|
13
13
|
new Array(7),
|
|
14
|
-
new Array(7)
|
|
14
|
+
new Array(7),
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
// Названия дней недели берёт локаль текущего языка (воскресенье — 0):
|
|
18
18
|
// семь подряд идущих дней месяца покрывают все дни недели
|
|
19
19
|
for (let day = 0; day < 7; day++) {
|
|
20
20
|
const sample = new Date(this.year, this.month, day + 1);
|
|
21
|
-
this.calendar[0][sample.getDay()] = sample
|
|
21
|
+
this.calendar[0][sample.getDay()] = sample
|
|
22
|
+
.toLocaleString(I18n.getLocale(), { weekday: "short" })
|
|
23
|
+
.toUpperCase();
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
this.list = [];
|
|
@@ -37,11 +39,11 @@ class Calendar {
|
|
|
37
39
|
while (this.date.getMonth() === this.month) {
|
|
38
40
|
let dayToPush = this.date;
|
|
39
41
|
let days = [];
|
|
40
|
-
days.push(dayToPush.toLocaleString(I18n.getLocale(), {day:
|
|
41
|
-
days.push(dayToPush.toLocaleString(I18n.getLocale(), {weekday:
|
|
42
|
-
days.push(dayToPush.toLocaleString(I18n.getLocale(), {month:
|
|
42
|
+
days.push(dayToPush.toLocaleString(I18n.getLocale(), { day: "numeric" }));
|
|
43
|
+
days.push(dayToPush.toLocaleString(I18n.getLocale(), { weekday: "short" }).toUpperCase());
|
|
44
|
+
days.push(dayToPush.toLocaleString(I18n.getLocale(), { month: "long" }).toUpperCase());
|
|
43
45
|
this.date.setDate(this.date.getDate() + 1);
|
|
44
|
-
this.list.push(days)
|
|
46
|
+
this.list.push(days);
|
|
45
47
|
}
|
|
46
48
|
let index = 1;
|
|
47
49
|
for (let day of this.list) {
|
|
@@ -60,10 +62,10 @@ class Calendar {
|
|
|
60
62
|
return new Date();
|
|
61
63
|
}
|
|
62
64
|
getMonthName() {
|
|
63
|
-
return new Date(this.year, this.month).toLocaleString(I18n.getLocale(), {month:
|
|
65
|
+
return new Date(this.year, this.month).toLocaleString(I18n.getLocale(), { month: "long" }).toUpperCase();
|
|
64
66
|
}
|
|
65
67
|
getDayName() {
|
|
66
|
-
return new Date(this.year, this.month).toLocaleString(I18n.getLocale(), { weekday:
|
|
68
|
+
return new Date(this.year, this.month).toLocaleString(I18n.getLocale(), { weekday: "long" }).toUpperCase();
|
|
67
69
|
}
|
|
68
70
|
getDate() {
|
|
69
71
|
return new Date(this.year, this.month).getDate();
|
|
@@ -79,4 +81,4 @@ class Calendar {
|
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
exports.Calendar = Calendar
|
|
84
|
+
exports.Calendar = Calendar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {Icon} = require("../chui_icons/icons");
|
|
2
|
-
const {optionOr} = require("../../modules/chui_functions");
|
|
1
|
+
const { Icon } = require("../chui_icons/icons");
|
|
2
|
+
const { optionOr } = require("../../modules/chui_functions");
|
|
3
3
|
|
|
4
4
|
class Card {
|
|
5
5
|
#chui_card = document.createElement("chui_card");
|
|
@@ -9,17 +9,19 @@ class Card {
|
|
|
9
9
|
#title;
|
|
10
10
|
#description;
|
|
11
11
|
#body = document.createElement("card_body");
|
|
12
|
-
constructor(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
constructor(
|
|
13
|
+
options = {
|
|
14
|
+
id: String(),
|
|
15
|
+
title: String(),
|
|
16
|
+
description: String(),
|
|
17
|
+
icon: String(),
|
|
18
|
+
width: String(),
|
|
19
|
+
height: String(),
|
|
20
|
+
style: String(),
|
|
21
|
+
components: [],
|
|
22
|
+
}
|
|
23
|
+
) {
|
|
24
|
+
require("../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_Card");
|
|
23
25
|
if (options.id !== undefined) this.#chui_card.id = options.id;
|
|
24
26
|
const style = optionOr(options.style, undefined);
|
|
25
27
|
if (style !== undefined) this.#chui_card.classList.add(style);
|
|
@@ -32,19 +34,33 @@ class Card {
|
|
|
32
34
|
if (options.components !== undefined) this.add(...options.components);
|
|
33
35
|
}
|
|
34
36
|
// GET
|
|
35
|
-
getId() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
getId() {
|
|
38
|
+
return this.#chui_card.id;
|
|
39
|
+
}
|
|
40
|
+
getTitle() {
|
|
41
|
+
return this.#title === undefined ? "" : this.#title.innerText;
|
|
42
|
+
}
|
|
43
|
+
getDescription() {
|
|
44
|
+
return this.#description === undefined ? "" : this.#description.innerText;
|
|
45
|
+
}
|
|
46
|
+
getBody() {
|
|
47
|
+
return this.#body;
|
|
48
|
+
}
|
|
39
49
|
// SET
|
|
40
|
-
setId(id = String()) {
|
|
50
|
+
setId(id = String()) {
|
|
51
|
+
this.#chui_card.id = id;
|
|
52
|
+
}
|
|
41
53
|
// Пустая строка — «не задана»: `classList.add("")` бросает исключение
|
|
42
54
|
setStyle(style = String()) {
|
|
43
55
|
const known = optionOr(style, undefined);
|
|
44
56
|
if (known !== undefined) this.#chui_card.classList.add(known);
|
|
45
57
|
}
|
|
46
|
-
setWidth(width = String()) {
|
|
47
|
-
|
|
58
|
+
setWidth(width = String()) {
|
|
59
|
+
this.#chui_card.style.width = width;
|
|
60
|
+
}
|
|
61
|
+
setHeight(height = String()) {
|
|
62
|
+
this.#chui_card.style.height = height;
|
|
63
|
+
}
|
|
48
64
|
setIcon(icon = String()) {
|
|
49
65
|
if (this.#icon === undefined) {
|
|
50
66
|
this.#icon = document.createElement("card_icon");
|
|
@@ -70,7 +86,9 @@ class Card {
|
|
|
70
86
|
add(...components) {
|
|
71
87
|
for (let component of components) this.#body.appendChild(component.set());
|
|
72
88
|
}
|
|
73
|
-
clear() {
|
|
89
|
+
clear() {
|
|
90
|
+
this.#body.innerHTML = "";
|
|
91
|
+
}
|
|
74
92
|
// Шапка создаётся при первом обращении и всегда стоит выше тела
|
|
75
93
|
#headNode() {
|
|
76
94
|
if (this.#head === undefined) {
|
|
@@ -87,7 +105,9 @@ class Card {
|
|
|
87
105
|
return this.#titles;
|
|
88
106
|
}
|
|
89
107
|
// RENDER
|
|
90
|
-
set() {
|
|
108
|
+
set() {
|
|
109
|
+
return this.#chui_card;
|
|
110
|
+
}
|
|
91
111
|
}
|
|
92
112
|
|
|
93
|
-
exports.Card = Card
|
|
113
|
+
exports.Card = Card;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const { setStyles, markdownToHtml, optionOr } = require(
|
|
2
|
-
const { Avatar } = require(
|
|
3
|
-
const { Icon, Icons } = require(
|
|
4
|
-
const { I18n } = require(
|
|
1
|
+
const { setStyles, markdownToHtml, optionOr } = require("../../modules/chui_functions");
|
|
2
|
+
const { Avatar } = require("../chui_avatar/avatar");
|
|
3
|
+
const { Icon, Icons } = require("../chui_icons/icons");
|
|
4
|
+
const { I18n } = require("../../modules/chui_i18n/chui_i18n");
|
|
5
5
|
|
|
6
6
|
/** Значки состояния отправленного сообщения: в пути, доставлено, прочитано, ошибка */
|
|
7
7
|
const STATUS_ICONS = {
|
|
8
8
|
sending: Icons.ACTIONS.SCHEDULE,
|
|
9
9
|
sent: Icons.NAVIGATION.CHECK,
|
|
10
10
|
read: Icons.ACTIONS.DONE_ALL,
|
|
11
|
-
failed: Icons.ALERT.ERROR_OUTLINE
|
|
11
|
+
failed: Icons.ALERT.ERROR_OUTLINE,
|
|
12
12
|
};
|
|
13
13
|
/** Прокрутка считается «у нижнего края», если до него осталось меньше этого, px */
|
|
14
14
|
const NEAR_BOTTOM = 80;
|
|
@@ -63,7 +63,7 @@ class Chat {
|
|
|
63
63
|
SENDING: "sending",
|
|
64
64
|
SENT: "sent",
|
|
65
65
|
READ: "read",
|
|
66
|
-
FAILED: "failed"
|
|
66
|
+
FAILED: "failed",
|
|
67
67
|
};
|
|
68
68
|
static #counter = 0;
|
|
69
69
|
|
|
@@ -94,12 +94,24 @@ class Chat {
|
|
|
94
94
|
#last_date = undefined;
|
|
95
95
|
#last_group = undefined;
|
|
96
96
|
|
|
97
|
-
constructor(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
constructor(
|
|
98
|
+
options = {
|
|
99
|
+
id: String(),
|
|
100
|
+
title: String(),
|
|
101
|
+
subtitle: String(),
|
|
102
|
+
messages: [],
|
|
103
|
+
own: String(),
|
|
104
|
+
placeholder: String(),
|
|
105
|
+
sendText: String(),
|
|
106
|
+
sendLabel: String(),
|
|
107
|
+
composer: Boolean(),
|
|
108
|
+
height: String(),
|
|
109
|
+
width: String(),
|
|
110
|
+
dateSeparators: Boolean(),
|
|
111
|
+
onSend: undefined,
|
|
112
|
+
onMessageClick: undefined,
|
|
113
|
+
}
|
|
114
|
+
) {
|
|
103
115
|
setStyles(__dirname + "/styles.css", "chUiJS_Chat");
|
|
104
116
|
Chat.#counter += 1;
|
|
105
117
|
this.#id = options.id === undefined ? `chui_chat_${Chat.#counter}` : options.id;
|
|
@@ -130,7 +142,8 @@ class Chat {
|
|
|
130
142
|
this.#composer.setAttribute("aria-label", I18n.t("feedback.chatComposer"));
|
|
131
143
|
this.#input.className = "chat_input";
|
|
132
144
|
this.#input.rows = 1;
|
|
133
|
-
this.#input.placeholder =
|
|
145
|
+
this.#input.placeholder =
|
|
146
|
+
this.#placeholder === undefined ? I18n.t("feedback.chatPlaceholder") : this.#placeholder;
|
|
134
147
|
this.#input.setAttribute("aria-label", I18n.t("feedback.chatComposer"));
|
|
135
148
|
this.#send_button.type = "button";
|
|
136
149
|
this.#send_button.className = "chat_send";
|
|
@@ -162,16 +175,32 @@ class Chat {
|
|
|
162
175
|
}
|
|
163
176
|
|
|
164
177
|
// GET
|
|
165
|
-
getId() {
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
getId() {
|
|
179
|
+
return this.#id;
|
|
180
|
+
}
|
|
181
|
+
getTitle() {
|
|
182
|
+
return this.#title.innerText;
|
|
183
|
+
}
|
|
184
|
+
getSubtitle() {
|
|
185
|
+
return this.#subtitle.innerText;
|
|
186
|
+
}
|
|
168
187
|
/** Текст в поле ввода — то, что ещё не отправлено */
|
|
169
|
-
getValue() {
|
|
188
|
+
getValue() {
|
|
189
|
+
return this.#input.value;
|
|
190
|
+
}
|
|
170
191
|
/** Копии сообщений: правка копии не меняет журнал */
|
|
171
|
-
getMessages() {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
192
|
+
getMessages() {
|
|
193
|
+
return this.#messages.map((message) => Object.assign({}, message));
|
|
194
|
+
}
|
|
195
|
+
isTyping() {
|
|
196
|
+
return this.#typing_name !== undefined;
|
|
197
|
+
}
|
|
198
|
+
isDisabled() {
|
|
199
|
+
return this.#disabled;
|
|
200
|
+
}
|
|
201
|
+
getLog() {
|
|
202
|
+
return this.#log;
|
|
203
|
+
}
|
|
175
204
|
|
|
176
205
|
// SET
|
|
177
206
|
setTitle(text = String()) {
|
|
@@ -212,7 +241,9 @@ class Chat {
|
|
|
212
241
|
this.#send_listeners.push(listener);
|
|
213
242
|
return this;
|
|
214
243
|
}
|
|
215
|
-
set() {
|
|
244
|
+
set() {
|
|
245
|
+
return this.#root;
|
|
246
|
+
}
|
|
216
247
|
|
|
217
248
|
// СООБЩЕНИЯ
|
|
218
249
|
/** Полная замена списка: журнал собирается заново, группы схлопываются по автору и дню */
|
|
@@ -253,13 +284,14 @@ class Chat {
|
|
|
253
284
|
setTyping(name = undefined) {
|
|
254
285
|
this.#typing_name = name;
|
|
255
286
|
this.#typing.hidden = name === undefined;
|
|
256
|
-
this.#typing.innerText = name === undefined ? "" : I18n.t("feedback.chatTyping", {name: name});
|
|
287
|
+
this.#typing.innerText = name === undefined ? "" : I18n.t("feedback.chatTyping", { name: name });
|
|
257
288
|
return this;
|
|
258
289
|
}
|
|
259
290
|
scrollToBottom(smooth = true) {
|
|
260
291
|
// Плавная прокрутка — движение; при `prefers-reduced-motion` она идёт сразу
|
|
261
292
|
const behavior = smooth && this.#reducedMotion() === false ? "smooth" : "auto";
|
|
262
|
-
if (typeof this.#log.scrollTo === "function")
|
|
293
|
+
if (typeof this.#log.scrollTo === "function")
|
|
294
|
+
this.#log.scrollTo({ top: this.#log.scrollHeight, behavior: behavior });
|
|
263
295
|
else this.#log.scrollTop = this.#log.scrollHeight;
|
|
264
296
|
return this;
|
|
265
297
|
}
|
|
@@ -276,7 +308,7 @@ class Chat {
|
|
|
276
308
|
author: this.#own,
|
|
277
309
|
own: true,
|
|
278
310
|
time: Date.now(),
|
|
279
|
-
status: Chat.STATUS.SENDING
|
|
311
|
+
status: Chat.STATUS.SENDING,
|
|
280
312
|
});
|
|
281
313
|
this.#input.value = "";
|
|
282
314
|
this.#syncSendState();
|
|
@@ -344,7 +376,11 @@ class Chat {
|
|
|
344
376
|
/** Группа для сообщения: та же, если автор и день совпадают, иначе новая */
|
|
345
377
|
#groupFor(message) {
|
|
346
378
|
const author = this.#authorOf(message);
|
|
347
|
-
if (
|
|
379
|
+
if (
|
|
380
|
+
this.#last_group !== undefined &&
|
|
381
|
+
this.#last_group.author === author &&
|
|
382
|
+
this.#last_group.day === this.#last_date
|
|
383
|
+
) {
|
|
348
384
|
return this.#last_group;
|
|
349
385
|
}
|
|
350
386
|
const node = document.createElement("chat_group");
|
|
@@ -356,14 +392,14 @@ class Chat {
|
|
|
356
392
|
if (message.own !== true) {
|
|
357
393
|
avatar = new Avatar({
|
|
358
394
|
name: author,
|
|
359
|
-
image: message.avatar === undefined ? undefined : {path: message.avatar},
|
|
395
|
+
image: message.avatar === undefined ? undefined : { path: message.avatar },
|
|
360
396
|
size: Avatar.SIZE.SMALL,
|
|
361
|
-
decorative: true
|
|
397
|
+
decorative: true,
|
|
362
398
|
});
|
|
363
399
|
node.prepend(avatar.set());
|
|
364
400
|
}
|
|
365
401
|
this.#log.appendChild(node);
|
|
366
|
-
this.#last_group = {node: node, bubbles: bubbles, avatar: avatar, author: author, day: this.#last_date};
|
|
402
|
+
this.#last_group = { node: node, bubbles: bubbles, avatar: avatar, author: author, day: this.#last_date };
|
|
367
403
|
return this.#last_group;
|
|
368
404
|
}
|
|
369
405
|
#bubble(message, first) {
|
|
@@ -418,7 +454,10 @@ class Chat {
|
|
|
418
454
|
status.dataset.status = message.status;
|
|
419
455
|
status.setAttribute("aria-label", this.#statusLabel(message.status));
|
|
420
456
|
status.setAttribute("role", "img");
|
|
421
|
-
status.innerHTML = new Icon(
|
|
457
|
+
status.innerHTML = new Icon(
|
|
458
|
+
STATUS_ICONS[message.status] === undefined ? STATUS_ICONS.sent : STATUS_ICONS[message.status],
|
|
459
|
+
"13px"
|
|
460
|
+
).getHTML();
|
|
422
461
|
meta.appendChild(status);
|
|
423
462
|
}
|
|
424
463
|
return meta;
|
|
@@ -442,10 +481,10 @@ class Chat {
|
|
|
442
481
|
if (this.#dayKey(date) === this.#dayKey(now)) return I18n.t("common.today");
|
|
443
482
|
const yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
|
|
444
483
|
if (this.#dayKey(date) === this.#dayKey(yesterday)) return I18n.t("common.yesterday");
|
|
445
|
-
return new Intl.DateTimeFormat(I18n.getLocale(), {day: "numeric", month: "long"}).format(date);
|
|
484
|
+
return new Intl.DateTimeFormat(I18n.getLocale(), { day: "numeric", month: "long" }).format(date);
|
|
446
485
|
}
|
|
447
486
|
#timeLabel(date) {
|
|
448
|
-
return new Intl.DateTimeFormat(I18n.getLocale(), {hour: "2-digit", minute: "2-digit"}).format(date);
|
|
487
|
+
return new Intl.DateTimeFormat(I18n.getLocale(), { hour: "2-digit", minute: "2-digit" }).format(date);
|
|
449
488
|
}
|
|
450
489
|
|
|
451
490
|
// === ОБРАБОТЧИКИ ===
|
|
@@ -464,7 +503,7 @@ class Chat {
|
|
|
464
503
|
};
|
|
465
504
|
}
|
|
466
505
|
|
|
467
|
-
exports.Chat = Chat
|
|
506
|
+
exports.Chat = Chat;
|
|
468
507
|
|
|
469
508
|
// Описание сообщения собирает фабрика — как у ContextMenu и SplitButton
|
|
470
509
|
Chat.Message = (options = {}) => Object.assign({}, options);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const {setStyles, optionOr} = require(
|
|
2
|
-
const {Icon, Icons} = require(
|
|
3
|
-
const {Desktop} = require(
|
|
4
|
-
const {I18n} = require(
|
|
1
|
+
const { setStyles, optionOr } = require("../../modules/chui_functions");
|
|
2
|
+
const { Icon, Icons } = require("../chui_icons/icons");
|
|
3
|
+
const { Desktop } = require("../../modules/chui_services/desktop");
|
|
4
|
+
const { I18n } = require("../../modules/chui_i18n/chui_i18n");
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Панель истории буфера обмена: последние тексты, которые приложение кладло в буфер.
|
|
@@ -38,15 +38,17 @@ class ClipboardHistory {
|
|
|
38
38
|
#unsubscribe = undefined;
|
|
39
39
|
#bound = false;
|
|
40
40
|
|
|
41
|
-
constructor(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
constructor(
|
|
42
|
+
options = {
|
|
43
|
+
id: String(),
|
|
44
|
+
title: String(),
|
|
45
|
+
emptyText: String(),
|
|
46
|
+
truncate: Number(),
|
|
47
|
+
label: String(),
|
|
48
|
+
showClear: Boolean(),
|
|
49
|
+
onChange: undefined,
|
|
50
|
+
}
|
|
51
|
+
) {
|
|
50
52
|
setStyles(__dirname + "/styles.css", "chUiJS_ClipboardHistory");
|
|
51
53
|
ClipboardHistory.#counter += 1;
|
|
52
54
|
this.#id = options.id === undefined ? `chui_clipboard_history_${ClipboardHistory.#counter}` : options.id;
|
|
@@ -81,9 +83,12 @@ class ClipboardHistory {
|
|
|
81
83
|
this.#render(items);
|
|
82
84
|
});
|
|
83
85
|
this.#bound = true;
|
|
84
|
-
Desktop.clipboard.history
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
Desktop.clipboard.history
|
|
87
|
+
.list()
|
|
88
|
+
.then((items) => {
|
|
89
|
+
if (this.#bound) this.#render(items);
|
|
90
|
+
})
|
|
91
|
+
.catch(() => {});
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
// GET
|
|
@@ -141,7 +146,9 @@ class ClipboardHistory {
|
|
|
141
146
|
const text = this.#items[index];
|
|
142
147
|
if (text === undefined) return Promise.resolve(this.getItems());
|
|
143
148
|
return Desktop.clipboard.history.copy(text).then((items) => {
|
|
144
|
-
this.#announce(
|
|
149
|
+
this.#announce(
|
|
150
|
+
I18n.t("graphics.clipboardCopied", { value: ClipboardHistory.#short(text, this.#truncate) })
|
|
151
|
+
);
|
|
145
152
|
return items;
|
|
146
153
|
});
|
|
147
154
|
}
|
|
@@ -198,7 +205,7 @@ class ClipboardHistory {
|
|
|
198
205
|
copy.type = "button";
|
|
199
206
|
copy.className = "clipboard_history_text";
|
|
200
207
|
copy.dataset.action = "copy";
|
|
201
|
-
copy.setAttribute("aria-label", I18n.t("graphics.clipboardCopy", {value: label}));
|
|
208
|
+
copy.setAttribute("aria-label", I18n.t("graphics.clipboardCopy", { value: label }));
|
|
202
209
|
copy.title = text;
|
|
203
210
|
const icon = document.createElement("clipboard_history_icon");
|
|
204
211
|
icon.innerHTML = new Icon(Icons.CONTENT.CONTENT_COPY, "16px").getHTML();
|
|
@@ -211,7 +218,7 @@ class ClipboardHistory {
|
|
|
211
218
|
remove.type = "button";
|
|
212
219
|
remove.className = "clipboard_history_remove";
|
|
213
220
|
remove.dataset.action = "remove";
|
|
214
|
-
remove.setAttribute("aria-label", I18n.t("graphics.clipboardRemove", {value: label}));
|
|
221
|
+
remove.setAttribute("aria-label", I18n.t("graphics.clipboardRemove", { value: label }));
|
|
215
222
|
remove.innerHTML = new Icon(Icons.ACTIONS.DELETE, "16px").getHTML();
|
|
216
223
|
item.appendChild(copy);
|
|
217
224
|
item.appendChild(remove);
|
|
@@ -228,8 +235,10 @@ class ClipboardHistory {
|
|
|
228
235
|
};
|
|
229
236
|
|
|
230
237
|
#onClear = () => {
|
|
231
|
-
this.clear()
|
|
238
|
+
this.clear()
|
|
239
|
+
.then(() => this.#announce(I18n.t("graphics.clipboardCleared")))
|
|
240
|
+
.catch(() => {});
|
|
232
241
|
};
|
|
233
242
|
}
|
|
234
243
|
|
|
235
|
-
exports.ClipboardHistory = ClipboardHistory
|
|
244
|
+
exports.ClipboardHistory = ClipboardHistory;
|
|
@@ -65,7 +65,8 @@ clipboard_history_item {
|
|
|
65
65
|
display: flex;
|
|
66
66
|
align-items: center;
|
|
67
67
|
gap: 6px;
|
|
68
|
-
padding-block: 2px 2px;
|
|
68
|
+
padding-block: 2px 2px;
|
|
69
|
+
padding-inline: 4px var(--main_padding);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
clipboard_history_item + clipboard_history_item {
|
|
@@ -93,7 +94,8 @@ button.clipboard_history_text:hover {
|
|
|
93
94
|
background: var(--element_background_hover);
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
button.clipboard_history_text:focus-visible,
|
|
97
|
+
button.clipboard_history_text:focus-visible,
|
|
98
|
+
button.clipboard_history_remove:focus-visible {
|
|
97
99
|
outline: var(--focus_outline);
|
|
98
100
|
outline-offset: var(--focus_outline_offset);
|
|
99
101
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
class CodeBlock {
|
|
2
2
|
#chui_code = document.createElement(`code`);
|
|
3
3
|
constructor(text = String(), options = { textAlign: String(), wordBreak: String(), width: String() }) {
|
|
4
|
-
require(
|
|
4
|
+
require("../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_code");
|
|
5
5
|
this.#chui_code.innerText = text;
|
|
6
6
|
this.#chui_code.classList.add("chui_code");
|
|
7
7
|
if (options.textAlign !== undefined) this.#chui_code.style.textAlign = options.textAlign;
|
|
@@ -16,4 +16,4 @@ class CodeBlock {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
exports.CodeBlock = CodeBlock
|
|
19
|
+
exports.CodeBlock = CodeBlock;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
background: var(--element_background_2);
|
|
12
12
|
border: 1px solid var(--border_color);
|
|
13
13
|
border-radius: var(--border_radius);
|
|
14
|
-
font-family:
|
|
14
|
+
font-family: "chui_mono", monospace;
|
|
15
15
|
font-size: var(--font_default_size);
|
|
16
16
|
font-weight: 400;
|
|
17
17
|
line-height: 1.5;
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
white-space: pre-wrap;
|
|
20
20
|
/* Длинная строка прокручивается внутри блока, а не раздвигает карточку */
|
|
21
21
|
overflow-x: auto;
|
|
22
|
-
}
|
|
22
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const {setStyles} = require(
|
|
2
|
-
const {highlight, escapeHtml} = require(
|
|
3
|
-
const {I18n} = require(
|
|
1
|
+
const { setStyles } = require("../../modules/chui_functions");
|
|
2
|
+
const { highlight, escapeHtml } = require("../../modules/chui_highlight/chui_highlight");
|
|
3
|
+
const { I18n } = require("../../modules/chui_i18n/chui_i18n");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Редактор кода: поле ввода с подсветкой синтаксиса и нумерацией строк.
|
|
@@ -38,7 +38,7 @@ class CodeEditor {
|
|
|
38
38
|
JAVASCRIPT: "javascript",
|
|
39
39
|
JSON: "json",
|
|
40
40
|
CSS: "css",
|
|
41
|
-
PLAIN: "plain"
|
|
41
|
+
PLAIN: "plain",
|
|
42
42
|
};
|
|
43
43
|
static #counter = 0;
|
|
44
44
|
|
|
@@ -59,22 +59,24 @@ class CodeEditor {
|
|
|
59
59
|
#on_change = undefined;
|
|
60
60
|
#on_save = undefined;
|
|
61
61
|
|
|
62
|
-
constructor(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
constructor(
|
|
63
|
+
options = {
|
|
64
|
+
id: String(),
|
|
65
|
+
value: String(),
|
|
66
|
+
language: String(),
|
|
67
|
+
title: String(),
|
|
68
|
+
label: String(),
|
|
69
|
+
placeholder: String(),
|
|
70
|
+
height: String(),
|
|
71
|
+
wide: Boolean(),
|
|
72
|
+
lineNumbers: Boolean(),
|
|
73
|
+
readOnly: Boolean(),
|
|
74
|
+
tabSize: Number(),
|
|
75
|
+
onChange: undefined,
|
|
76
|
+
onSave: undefined,
|
|
77
|
+
}
|
|
78
|
+
) {
|
|
79
|
+
require("../../modules/chui_fonts").installMono();
|
|
78
80
|
setStyles(__dirname + "/styles.css", "chUiJS_CodeEditor");
|
|
79
81
|
CodeEditor.#counter += 1;
|
|
80
82
|
this.#id = options.id === undefined ? `chui_code_editor_${CodeEditor.#counter}` : options.id;
|
|
@@ -232,7 +234,10 @@ class CodeEditor {
|
|
|
232
234
|
// === ВНУТРЕННЕЕ ===
|
|
233
235
|
#applyLabel() {
|
|
234
236
|
const language = this.#language === CodeEditor.LANGUAGE.PLAIN ? I18n.t("editor.noHighlight") : this.#language;
|
|
235
|
-
this.#input.setAttribute(
|
|
237
|
+
this.#input.setAttribute(
|
|
238
|
+
"aria-label",
|
|
239
|
+
this.#label === undefined ? I18n.t("editor.codeEditor", { language: language }) : this.#label
|
|
240
|
+
);
|
|
236
241
|
}
|
|
237
242
|
|
|
238
243
|
/** Значение + перерисовка подсветки и нумерации; `caret` — куда вернуть каретку */
|
|
@@ -255,7 +260,9 @@ class CodeEditor {
|
|
|
255
260
|
this.#code.innerHTML = highlight(value, this.#language);
|
|
256
261
|
}
|
|
257
262
|
const lines = value.split("\n").length;
|
|
258
|
-
this.#lines.innerText = this.#line_numbers
|
|
263
|
+
this.#lines.innerText = this.#line_numbers
|
|
264
|
+
? Array.from({ length: lines }, (_, index) => index + 1).join("\n")
|
|
265
|
+
: "";
|
|
259
266
|
this.#syncScroll();
|
|
260
267
|
}
|
|
261
268
|
|
|
@@ -311,8 +318,14 @@ class CodeEditor {
|
|
|
311
318
|
}
|
|
312
319
|
const from = value.lastIndexOf("\n", start - 1) + 1;
|
|
313
320
|
const block = value.slice(from, end);
|
|
314
|
-
const shifted = block
|
|
315
|
-
|
|
321
|
+
const shifted = block
|
|
322
|
+
.split("\n")
|
|
323
|
+
.map((line) => `\t${line}`)
|
|
324
|
+
.join("\n");
|
|
325
|
+
this.#applyValue(
|
|
326
|
+
`${value.slice(0, from)}${shifted}${value.slice(end)}`,
|
|
327
|
+
start + 1 + (shifted.length - block.length)
|
|
328
|
+
);
|
|
316
329
|
}
|
|
317
330
|
|
|
318
331
|
/** Shift+Tab: убрать один отступ у выделенных строк */
|
|
@@ -323,14 +336,17 @@ class CodeEditor {
|
|
|
323
336
|
const from = value.lastIndexOf("\n", start - 1) + 1;
|
|
324
337
|
const block = value.slice(from, end);
|
|
325
338
|
let removed = 0;
|
|
326
|
-
const shifted = block
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
339
|
+
const shifted = block
|
|
340
|
+
.split("\n")
|
|
341
|
+
.map((line) => {
|
|
342
|
+
const match = line.match(/^[ \t]/);
|
|
343
|
+
if (match === null) return line;
|
|
344
|
+
removed += 1;
|
|
345
|
+
return line.slice(1);
|
|
346
|
+
})
|
|
347
|
+
.join("\n");
|
|
332
348
|
this.#applyValue(`${value.slice(0, from)}${shifted}${value.slice(end)}`, Math.max(from, start - removed));
|
|
333
349
|
}
|
|
334
350
|
}
|
|
335
351
|
|
|
336
|
-
exports.CodeEditor = CodeEditor
|
|
352
|
+
exports.CodeEditor = CodeEditor;
|
|
@@ -11,7 +11,7 @@ chui_code_editor {
|
|
|
11
11
|
background: var(--element_background_2);
|
|
12
12
|
border: 1px solid var(--border_color);
|
|
13
13
|
border-radius: var(--border_radius);
|
|
14
|
-
font-family:
|
|
14
|
+
font-family: "chui_mono", monospace;
|
|
15
15
|
font-size: var(--font_default_size);
|
|
16
16
|
overflow: hidden;
|
|
17
17
|
}
|
|
@@ -51,7 +51,8 @@ code_editor_lines {
|
|
|
51
51
|
bottom: 0;
|
|
52
52
|
width: var(--code_editor_gutter);
|
|
53
53
|
box-sizing: border-box;
|
|
54
|
-
padding-block: 8px 8px;
|
|
54
|
+
padding-block: 8px 8px;
|
|
55
|
+
padding-inline: 8px 6px;
|
|
55
56
|
overflow: hidden;
|
|
56
57
|
text-align: end;
|
|
57
58
|
white-space: pre;
|