diff --git a/src/plugins/chatview/bottom_panel.js b/src/plugins/chatview/bottom_panel.js index 8136150c8..d7bf2b1a5 100644 --- a/src/plugins/chatview/bottom_panel.js +++ b/src/plugins/chatview/bottom_panel.js @@ -1,5 +1,5 @@ -import tpl_chatbox_message_form from 'templates/chatbox_message_form.js'; -import tpl_toolbar from 'templates/toolbar.js'; +import tpl_chatbox_message_form from './templates/chatbox_message_form.js'; +import tpl_toolbar from './templates/toolbar.js'; import { ElementView } from '@converse/skeletor/src/element.js'; import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core"; diff --git a/src/plugins/chatview/heading.js b/src/plugins/chatview/heading.js index bbfc95c8e..29e61dcac 100644 --- a/src/plugins/chatview/heading.js +++ b/src/plugins/chatview/heading.js @@ -1,6 +1,6 @@ import UserDetailsModal from 'modals/user-details.js'; import debounce from 'lodash/debounce'; -import tpl_chatbox_head from 'templates/chatbox_head.js'; +import tpl_chatbox_head from './templates/chatbox_head.js'; import { ElementView } from '@converse/skeletor/src/element.js'; import { __ } from 'i18n'; import { _converse, api } from "@converse/headless/core"; diff --git a/src/plugins/chatview/index.js b/src/plugins/chatview/index.js index 8fadccf78..79aad1411 100644 --- a/src/plugins/chatview/index.js +++ b/src/plugins/chatview/index.js @@ -3,14 +3,14 @@ * @copyright 2020, the Converse.js contributors * @license Mozilla Public License (MPLv2) */ -import '../../components/chat_content.js'; import '../../components/help_messages.js'; -import '../../components/toolbar.js'; import '../chatboxviews/index.js'; import '../modal.js'; -import { _converse, api, converse } from '@converse/headless/core'; +import 'shared/chat/chat-content.js'; +import 'shared/chat/toolbar.js'; import ChatBoxView from './view.js'; import chatview_api from './api.js'; +import { _converse, api, converse } from '@converse/headless/core'; const { Strophe } = converse.env; diff --git a/src/templates/chatbox_head.js b/src/plugins/chatview/templates/chatbox_head.js similarity index 95% rename from src/templates/chatbox_head.js rename to src/plugins/chatview/templates/chatbox_head.js index 9173c520d..2c864751b 100644 --- a/src/templates/chatbox_head.js +++ b/src/plugins/chatview/templates/chatbox_head.js @@ -1,6 +1,6 @@ import { _converse } from '@converse/headless/core'; import { html } from "lit-html"; -import { renderAvatar } from './directives/avatar.js'; +import { renderAvatar } from 'templates/directives/avatar.js'; import { until } from 'lit-html/directives/until.js'; diff --git a/src/templates/chatbox_message_form.js b/src/plugins/chatview/templates/chatbox_message_form.js similarity index 100% rename from src/templates/chatbox_message_form.js rename to src/plugins/chatview/templates/chatbox_message_form.js diff --git a/src/templates/toolbar.js b/src/plugins/chatview/templates/toolbar.js similarity index 100% rename from src/templates/toolbar.js rename to src/plugins/chatview/templates/toolbar.js diff --git a/src/plugins/muc-views/index.js b/src/plugins/muc-views/index.js index 71b9bf565..50478f8f1 100644 --- a/src/plugins/muc-views/index.js +++ b/src/plugins/muc-views/index.js @@ -7,6 +7,8 @@ import '../chatview/index.js'; import '../modal.js'; import './adhoc-commands.js'; +import 'shared/chat/chat-content.js'; +import 'shared/chat/toolbar.js'; import MUCView from './muc.js'; import MUCConfigForm from './config-form.js'; import MUCPasswordForm from './password-form.js'; diff --git a/src/plugins/muc-views/sidebar.js b/src/plugins/muc-views/sidebar.js index 8a162b8f4..c49198f7d 100644 --- a/src/plugins/muc-views/sidebar.js +++ b/src/plugins/muc-views/sidebar.js @@ -1,5 +1,5 @@ import 'shared/autocomplete/index.js'; -import tpl_muc_sidebar from "templates/muc_sidebar.js"; +import tpl_muc_sidebar from "./templates/muc_sidebar.js"; import { CustomElement } from 'components/element.js'; import { api, converse } from "@converse/headless/core"; diff --git a/src/templates/muc_sidebar.js b/src/plugins/muc-views/templates/muc_sidebar.js similarity index 97% rename from src/templates/muc_sidebar.js rename to src/plugins/muc-views/templates/muc_sidebar.js index 3d6e9fd80..cb1a8d173 100644 --- a/src/templates/muc_sidebar.js +++ b/src/plugins/muc-views/templates/muc_sidebar.js @@ -1,5 +1,5 @@ import { html } from "lit-html"; -import { __ } from '../i18n'; +import { __ } from 'i18n'; import tpl_occupant from "./occupant.js"; diff --git a/src/templates/occupant.js b/src/plugins/muc-views/templates/occupant.js similarity index 98% rename from src/templates/occupant.js rename to src/plugins/muc-views/templates/occupant.js index ed01cb3d0..61b507184 100644 --- a/src/templates/occupant.js +++ b/src/plugins/muc-views/templates/occupant.js @@ -1,5 +1,5 @@ import { html } from "lit-html"; -import { __ } from '../i18n'; +import { __ } from 'i18n'; const occupant_title = (o) => { diff --git a/src/components/chat_content.js b/src/shared/chat/chat-content.js similarity index 97% rename from src/components/chat_content.js rename to src/shared/chat/chat-content.js index eeacc6a89..1d97f58e1 100644 --- a/src/components/chat_content.js +++ b/src/shared/chat/chat-content.js @@ -1,6 +1,6 @@ import "./message-history"; import debounce from 'lodash/debounce'; -import { CustomElement } from './element.js'; +import { CustomElement } from 'components/element.js'; import { _converse, api } from "@converse/headless/core"; import { html } from 'lit-element'; diff --git a/src/components/emoji-picker-content.js b/src/shared/chat/emoji-picker-content.js similarity index 96% rename from src/components/emoji-picker-content.js rename to src/shared/chat/emoji-picker-content.js index 45799e800..a1ac64c5e 100644 --- a/src/components/emoji-picker-content.js +++ b/src/shared/chat/emoji-picker-content.js @@ -1,7 +1,7 @@ -import { CustomElement } from './element.js'; +import { CustomElement } from 'components/element.js'; import { _converse, converse, api } from "@converse/headless/core"; import { html } from "lit-element"; -import { tpl_all_emojis, tpl_search_results } from "../templates/emoji_picker.js"; +import { tpl_all_emojis, tpl_search_results } from "./templates/emoji-picker.js"; const { sizzle } = converse.env; diff --git a/src/components/emoji-picker.js b/src/shared/chat/emoji-picker.js similarity index 98% rename from src/components/emoji-picker.js rename to src/shared/chat/emoji-picker.js index 371613f0d..e484658ea 100644 --- a/src/components/emoji-picker.js +++ b/src/shared/chat/emoji-picker.js @@ -1,12 +1,12 @@ import "./emoji-picker-content.js"; -import DOMNavigator from "../shared/dom-navigator"; +import DOMNavigator from "shared/dom-navigator"; import debounce from 'lodash/debounce'; -import { BaseDropdown } from "./dropdown.js"; -import { CustomElement } from './element.js'; -import { __ } from '../i18n'; +import { BaseDropdown } from "components/dropdown.js"; +import { CustomElement } from 'components/element.js'; +import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core"; import { html } from "lit-element"; -import { tpl_emoji_picker } from "../templates/emoji_picker.js"; +import { tpl_emoji_picker } from "./templates/emoji-picker.js"; import { until } from 'lit-html/directives/until.js'; const u = converse.env.utils; diff --git a/src/components/message-history.js b/src/shared/chat/message-history.js similarity index 97% rename from src/components/message-history.js rename to src/shared/chat/message-history.js index 24af94815..e141761ae 100644 --- a/src/components/message-history.js +++ b/src/shared/chat/message-history.js @@ -1,8 +1,8 @@ import "./message"; import dayjs from 'dayjs'; -import tpl_new_day from "../templates//new_day.js"; -import { CustomElement } from './element.js'; -import { __ } from '../i18n'; +import tpl_new_day from "templates/new_day.js"; +import { CustomElement } from 'components/element.js'; +import { __ } from 'i18n'; import { _converse, api } from "@converse/headless/core"; import { html } from 'lit-element'; import { repeat } from 'lit-html/directives/repeat.js'; diff --git a/src/components/message.js b/src/shared/chat/message.js similarity index 96% rename from src/components/message.js rename to src/shared/chat/message.js index 0dfde56e6..fffe77eee 100644 --- a/src/components/message.js +++ b/src/shared/chat/message.js @@ -1,16 +1,16 @@ -import '../shared/registry'; -import './dropdown.js'; -import './message-actions.js'; -import './message-body.js'; -import MessageVersionsModal from '../modals/message-versions.js'; +import 'shared/registry'; +import 'components/dropdown.js'; +import 'components/message-actions.js'; +import 'components/message-body.js'; +import MessageVersionsModal from 'modals/message-versions.js'; import OccupantModal from 'modals/occupant.js'; import UserDetailsModal from 'modals/user-details.js'; import dayjs from 'dayjs'; import filesize from 'filesize'; -import tpl_chat_message from '../templates/chat_message.js'; -import tpl_spinner from '../templates/spinner.js'; -import { CustomElement } from './element.js'; -import { __ } from '../i18n'; +import tpl_chat_message from './templates/message.js'; +import tpl_spinner from 'templates/spinner.js'; +import { CustomElement } from 'components/element.js'; +import { __ } from 'i18n'; import { _converse, api, converse } from '@converse/headless/core'; import { getDerivedMessageProps } from './message-history'; import { html } from 'lit-element'; diff --git a/src/templates/emoji_picker.js b/src/shared/chat/templates/emoji-picker.js similarity index 99% rename from src/templates/emoji_picker.js rename to src/shared/chat/templates/emoji-picker.js index 4572cb835..fc4c77409 100644 --- a/src/templates/emoji_picker.js +++ b/src/shared/chat/templates/emoji-picker.js @@ -1,4 +1,4 @@ -import { __ } from '../i18n'; +import { __ } from 'i18n'; import { _converse, converse, api } from "@converse/headless/core"; import { html } from "lit-html"; diff --git a/src/templates/chat_message.js b/src/shared/chat/templates/message.js similarity index 96% rename from src/templates/chat_message.js rename to src/shared/chat/templates/message.js index 50f1ab418..71f8bc682 100644 --- a/src/templates/chat_message.js +++ b/src/shared/chat/templates/message.js @@ -1,7 +1,7 @@ import 'shared/chat/unfurl'; -import { __ } from '../i18n'; +import { __ } from 'i18n'; import { html } from "lit-html"; -import { renderAvatar } from './../templates/directives/avatar'; +import { renderAvatar } from 'templates/directives/avatar'; export default (o) => { diff --git a/src/components/toolbar.js b/src/shared/chat/toolbar.js similarity index 98% rename from src/components/toolbar.js rename to src/shared/chat/toolbar.js index 0e475d287..bfac2b2d5 100644 --- a/src/components/toolbar.js +++ b/src/shared/chat/toolbar.js @@ -1,6 +1,6 @@ import "./emoji-picker.js"; -import { CustomElement } from './element.js'; -import { __ } from '../i18n'; +import { CustomElement } from 'components/element.js'; +import { __ } from 'i18n'; import { _converse, api, converse } from "@converse/headless/core"; import { html } from 'lit-element'; import { until } from 'lit-html/directives/until.js';