From 35728d7681dd668c0e6d7065033e7ea226ceede8 Mon Sep 17 00:00:00 2001
From: ilkin-overleaf <100852799+ilkin-overleaf@users.noreply.github.com>
Date: Mon, 30 Sep 2024 11:11:26 +0300
Subject: [PATCH] Merge pull request #20436 from overleaf/ii-bs5-editor-toolbar
[web] BS5 editor toolbar
GitOrigin-RevId: a517fd52d648d165e89231d6f5551c026a951c43
---
.../web/frontend/extracted-translations.json | 9 +
.../components/switch-to-editor-button.tsx | 26 +-
.../components/codemirror-toolbar.tsx | 21 +-
.../components/editor-switch.tsx | 11 +-
.../figure-modal/figure-modal-body.tsx | 6 +-
.../figure-modal/figure-modal-footer.tsx | 103 ++++----
.../figure-modal/figure-modal-options.tsx | 160 +++++++++----
.../figure-modal-source-picker.tsx | 76 +++---
.../components/figure-modal/figure-modal.tsx | 28 ++-
.../figure-modal/file-name-input.tsx | 38 +--
.../figure-modal/file-relocator.tsx | 45 ++--
.../figure-modal-other-project-source.tsx | 94 ++++----
.../figure-modal-project-source.tsx | 47 ++--
.../figure-modal-upload-source.tsx | 167 +++++++------
.../file-sources/figure-modal-url-source.tsx | 46 ++--
.../components/switch-to-pdf-button.jsx | 24 +-
.../components/toolbar/button-menu.tsx | 47 ++--
.../toolbar/insert-figure-dropdown.tsx | 49 ++--
.../components/toolbar/math-dropdown.tsx | 13 +-
.../components/toolbar/overflow.tsx | 38 +--
.../toolbar/section-heading-dropdown.tsx | 25 +-
.../toolbar/table-inserter-dropdown.tsx | 26 +-
.../components/toolbar/toolbar-button.tsx | 35 ++-
.../components/toolbar/toolbar-items.tsx | 59 ++++-
.../extensions/toolbar/toolbar-panel.ts | 20 +-
.../languages/latex/codemirror-dev-tools.ts | 2 +-
.../bootstrap-3/toggle-button-group.tsx | 99 ++++++++
.../components/bootstrap-5/dropdown-menu.tsx | 6 +-
.../features/ui/components/ol/ol-button.tsx | 15 +-
.../ui/components/ol/ol-form-checkbox.tsx | 2 +
.../ui/components/ol/ol-list-group-item.tsx | 42 ++++
.../ui/components/ol/ol-list-group.tsx | 34 +++
.../features/ui/components/ol/ol-overlay.tsx | 60 +++++
.../features/ui/components/ol/ol-popover.tsx | 85 +++++++
.../components/ol/ol-toggle-button-group.tsx | 42 ++++
.../ui/components/ol/ol-toggle-button.tsx | 48 ++++
.../js/shared/components/beta-badge.tsx | 33 ++-
.../frontend/js/shared/components/select.tsx | 226 ++++++++++++------
.../js/shared/components/switcher.tsx | 61 -----
.../web/frontend/stories/switcher.stories.tsx | 57 +++--
.../stylesheets/app/editor/figure-modal.less | 75 ++----
.../stylesheets/app/editor/toolbar.less | 4 +-
.../abstracts/variable-overrides.scss | 28 +++
.../bootstrap-5/base/bootstrap.scss | 2 +
.../bootstrap-5/components/all.scss | 4 +
.../bootstrap-5/components/beta-badges.scss | 11 +
.../bootstrap-5/components/form.scss | 2 +-
.../bootstrap-5/components/list-group.scss | 3 +
.../bootstrap-5/components/popover.scss | 15 ++
.../bootstrap-5/components/select.scss | 11 +
.../stylesheets/bootstrap-5/pages/all.scss | 1 +
.../pages/editor/figure-modal.scss | 89 +++++++
.../bootstrap-5/pages/editor/ide.scss | 7 +-
.../bootstrap-5/pages/editor/toolbar.scss | 164 +++++++++++++
.../stylesheets/components/button-groups.less | 14 ++
.../stylesheets/components/switcher.less | 37 ---
.../web/frontend/stylesheets/main-style.less | 1 -
services/web/locales/en.json | 9 +
.../shared/split-test-badge.spec.tsx | 26 +-
59 files changed, 1764 insertions(+), 764 deletions(-)
create mode 100644 services/web/frontend/js/features/ui/components/bootstrap-3/toggle-button-group.tsx
create mode 100644 services/web/frontend/js/features/ui/components/ol/ol-list-group-item.tsx
create mode 100644 services/web/frontend/js/features/ui/components/ol/ol-list-group.tsx
create mode 100644 services/web/frontend/js/features/ui/components/ol/ol-overlay.tsx
create mode 100644 services/web/frontend/js/features/ui/components/ol/ol-popover.tsx
create mode 100644 services/web/frontend/js/features/ui/components/ol/ol-toggle-button-group.tsx
create mode 100644 services/web/frontend/js/features/ui/components/ol/ol-toggle-button.tsx
delete mode 100644 services/web/frontend/js/shared/components/switcher.tsx
create mode 100644 services/web/frontend/stylesheets/bootstrap-5/components/beta-badges.scss
create mode 100644 services/web/frontend/stylesheets/bootstrap-5/components/list-group.scss
create mode 100644 services/web/frontend/stylesheets/bootstrap-5/components/popover.scss
create mode 100644 services/web/frontend/stylesheets/bootstrap-5/components/select.scss
create mode 100644 services/web/frontend/stylesheets/bootstrap-5/pages/editor/figure-modal.scss
delete mode 100644 services/web/frontend/stylesheets/components/switcher.less
diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json
index e94aa7e090..5cc37e7b00 100644
--- a/services/web/frontend/extracted-translations.json
+++ b/services/web/frontend/extracted-translations.json
@@ -1551,7 +1551,9 @@
"took_a_while": "",
"toolbar_bullet_list": "",
"toolbar_choose_section_heading_level": "",
+ "toolbar_code_visual_editor_switch": "",
"toolbar_decrease_indent": "",
+ "toolbar_editor": "",
"toolbar_format_bold": "",
"toolbar_format_italic": "",
"toolbar_increase_indent": "",
@@ -1562,7 +1564,10 @@
"toolbar_insert_inline_math": "",
"toolbar_insert_link": "",
"toolbar_insert_math": "",
+ "toolbar_insert_math_and_symbols": "",
+ "toolbar_insert_misc": "",
"toolbar_insert_table": "",
+ "toolbar_list_indentation": "",
"toolbar_numbered_list": "",
"toolbar_redo": "",
"toolbar_selected_projects": "",
@@ -1571,8 +1576,12 @@
"toolbar_selected_projects_restore": "",
"toolbar_table_insert_size_table": "",
"toolbar_table_insert_table_lowercase": "",
+ "toolbar_text_formatting": "",
+ "toolbar_text_style": "",
"toolbar_toggle_symbol_palette": "",
"toolbar_undo": "",
+ "toolbar_undo_redo_actions": "",
+ "toolbar_visibility": "",
"tooltip_hide_filetree": "",
"tooltip_hide_pdf": "",
"tooltip_show_filetree": "",
diff --git a/services/web/frontend/js/features/pdf-preview/components/switch-to-editor-button.tsx b/services/web/frontend/js/features/pdf-preview/components/switch-to-editor-button.tsx
index 3c1bf0cf57..ea5d55b3ad 100644
--- a/services/web/frontend/js/features/pdf-preview/components/switch-to-editor-button.tsx
+++ b/services/web/frontend/js/features/pdf-preview/components/switch-to-editor-button.tsx
@@ -1,6 +1,8 @@
import { useTranslation } from 'react-i18next'
-import { Button } from 'react-bootstrap'
import Icon from '../../../shared/components/icon'
+import MaterialIcon from '@/shared/components/material-icon'
+import OLButton from '@/features/ui/components/ol/ol-button'
+import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
import { useLayoutContext } from '../../../shared/context/layout-context'
function SwitchToEditorButton() {
@@ -21,17 +23,21 @@ function SwitchToEditorButton() {
}
return (
-
+