core: Allow multiple imports

This commit is contained in:
JC Brand 2020-04-23 13:22:31 +02:00
parent 4b270359f6
commit 7e2552bd8c
47 changed files with 51 additions and 54 deletions

View File

@ -2,7 +2,7 @@ import { html } from 'lit-element';
import { CustomElement } from './element.js';
import { until } from 'lit-html/directives/until.js';
import DOMNavigator from "../dom-navigator";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
const u = converse.env.utils;

View File

@ -7,7 +7,7 @@
* @license Mozilla Public License (MPLv2)
*/
import { Events } from 'skeletor.js/src/events.js';
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
const u = converse.env.utils;

View File

@ -5,7 +5,7 @@
* @license Mozilla Public License (MPLv2)
*/
import "@converse/headless/converse-muc";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import tpl_bookmarks_list from "templates/bookmarks_list.js"
import tpl_muc_bookmark_form from "templates/muc_bookmark_form.js";
import { Model } from 'skeletor.js/src/model.js';

View File

@ -7,7 +7,7 @@ import "@converse/headless/converse-chatboxes";
import { Overview } from "skeletor.js/src/overview";
import { View } from "skeletor.js/src/view";
import { result } from "lodash";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import tpl_avatar from "templates/avatar.svg";
import tpl_background_logo from "templates/background_logo.html";
import tpl_chatboxes from "templates/chatboxes.html";

View File

@ -10,7 +10,7 @@ import { BootstrapModal } from "./converse-modal.js";
import { Overview } from "skeletor.js/src/overview";
import { debounce, isString } from "lodash";
import { html, render } from "lit-html";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_chatbox from "templates/chatbox.js";
import tpl_chatbox_head from "templates/chatbox_head.js";

View File

@ -7,7 +7,7 @@ import "converse-chatview";
import { Model } from 'skeletor.js/src/model.js';
import { View } from "skeletor.js/src/view";
import bootstrap from "bootstrap.native";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_brand_heading from "templates/converse_brand_heading.html";
import tpl_controlbox from "templates/controlbox.html";

View File

@ -6,7 +6,7 @@
import "converse-chatview";
import "converse-controlbox";
import { debounce } from "lodash";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import tpl_dragresize from "templates/dragresize.html";
const u = converse.env.utils;

View File

@ -7,7 +7,7 @@ import "@converse/headless/converse-muc";
import "converse-chatview";
import "converse-controlbox";
import "converse-singleton";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import tpl_brand_heading from "templates/inverse_brand_heading.html";

View File

@ -7,7 +7,7 @@ import "converse-chatview";
import { View } from 'skeletor.js/src/view.js';
import { __ } from '@converse/headless/i18n';
import { render } from "lit-html";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import tpl_chatbox from "templates/chatbox.js";
import tpl_headline_panel from "templates/headline_panel.js";

View File

@ -5,7 +5,7 @@
* @copyright 2020, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import { debounce } from 'lodash'

View File

@ -6,7 +6,7 @@
import "./utils/html";
import "@converse/headless/converse-emoji";
import URI from "urijs";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import { BootstrapModal } from "./converse-modal.js";
import { debounce } from 'lodash'
import { render } from "lit-html";

View File

@ -9,7 +9,7 @@ import { Overview } from "skeletor.js/src/overview";
import { View } from "skeletor.js/src/view";
import { __ } from '@converse/headless/i18n';
import { debounce, sum } from 'lodash';
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import tpl_chats_panel from "templates/chats_panel.html";
import tpl_toggle_chats from "templates/toggle_chats.html";
import tpl_trimmed_chat from "templates/trimmed_chat.html";

View File

@ -9,7 +9,7 @@ import { isString } from "lodash";
import { render } from 'lit-html';
import { __ } from '@converse/headless/i18n';
import bootstrap from "bootstrap.native";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_alert_component from "templates/alert.js";
import tpl_alert_modal from "templates/alert_modal.js";

View File

@ -13,7 +13,7 @@ import { BootstrapModal } from "./converse-modal.js";
import { render } from "lit-html";
import { __ } from '@converse/headless/i18n';
import RoomDetailsModal from 'modals/muc-details.js';
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import st from "@converse/headless/utils/stanza";
import tpl_add_chatroom_modal from "templates/add_chatroom_modal.js";

View File

@ -3,7 +3,7 @@
* @copyright 2020, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
const { Strophe, sizzle } = converse.env;

View File

@ -6,7 +6,7 @@
import { Collection } from "skeletor.js/src/collection";
import { View } from 'skeletor.js/src/view.js';
import { Model } from 'skeletor.js/src/model.js';
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import hello from "hellojs";
import tpl_oauth_providers from "templates/oauth_providers.js";

View File

@ -9,7 +9,7 @@ import "converse-profile";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { concat, debounce, difference, invokeMap, range, omit } from "lodash";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_toolbar_omemo from "templates/toolbar_omemo.html";

View File

@ -9,7 +9,7 @@ import "converse-modal";
import { BootstrapModal } from "./converse-modal.js";
import UserSettingsModal from "modals/user-settings";
import bootstrap from "bootstrap.native";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import sizzle from 'sizzle';
import tpl_chat_status_modal from "templates/chat_status_modal";

View File

@ -6,7 +6,7 @@
* @copyright 2020, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import { filter, reject } from 'lodash';
import log from "@converse/headless/log";

View File

@ -10,7 +10,7 @@ import "converse-controlbox";
import { __ } from '@converse/headless/i18n';
import { View } from "skeletor.js/src/view";
import { pick } from "lodash";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_form_input from "templates/form_input.html";
import tpl_form_username from "templates/form_username.html";

View File

@ -8,7 +8,7 @@
*/
import "@converse/headless/converse-muc";
import RoomDetailsModal from 'modals/muc-details.js';
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import tpl_rooms_list from "templates/rooms_list.js";
import { Model } from 'skeletor.js/src/model.js';
import { View } from 'skeletor.js/src/view.js';

View File

@ -11,7 +11,7 @@ import { BootstrapModal } from "./converse-modal.js";
import { View } from 'skeletor.js/src/view.js';
import { Model } from 'skeletor.js/src/model.js';
import { OrderedListView } from "skeletor.js/src/overview";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import tpl_add_contact_modal from "templates/add_contact_modal.js";
import tpl_group_header from "templates/group_header.html";

View File

@ -4,7 +4,7 @@
* @license Mozilla Public License (MPLv2)
* @description A plugin which restricts Converse to only one chat.
*/
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
converse.plugins.add('converse-singleton', {

View File

@ -11,7 +11,7 @@
* @license Mozilla Public License (MPLv2)
*/
import "converse-chatview";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
const u = converse.env.utils;

View File

@ -33,7 +33,7 @@ import "converse-uniview";
import "../sass/converse.scss";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
const WHITELISTED_PLUGINS = [
'converse-autocomplete',

View File

@ -1,4 +1,4 @@
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "@converse/headless/log";
import sizzle from 'sizzle';
import st from "./utils/stanza";

View File

@ -6,7 +6,7 @@
* @license Mozilla Public License (MPLv2)
*/
import "@converse/headless/converse-muc";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import log from "./log";

View File

@ -6,7 +6,7 @@
*/
import 'strophe.js/src/bosh';
import { Model } from 'skeletor.js/src/model.js';
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "./log";
const { Strophe } = converse.env;

View File

@ -4,7 +4,7 @@
* @license Mozilla Public License (MPLv2)
*/
import SHA1 from 'strophe.js/src/sha1';
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import { get } from "lodash";
const { Strophe, $build } = converse.env;

View File

@ -6,7 +6,7 @@
import { find, isMatch, isObject, isString, pick } from "lodash";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import converse from "./converse-core";
import { converse } from "./converse-core";
import filesize from "filesize";
import log from "./log";
import st from "./utils/stanza";

View File

@ -5,7 +5,7 @@
*/
import "./converse-emoji";
import { Collection } from "skeletor.js/src/collection";
import converse from "./converse-core";
import { converse } from "./converse-core";
import { isString } from "lodash";
import log from "./log";

View File

@ -3,12 +3,12 @@
* @copyright The Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import { __, i18n } from './i18n';
import { assignIn, debounce, invoke, isFunction, isObject, isString, pick } from 'lodash';
import { Collection } from "skeletor.js/src/collection";
import { Events } from 'skeletor.js/src/events.js';
import { Model } from 'skeletor.js/src/model.js';
import { Router } from 'skeletor.js/src/router.js';
import { __, i18n } from './i18n';
import { assignIn, debounce, invoke, isFunction, isObject, isString, pick } from 'lodash';
import 'strophe.js/src/websocket';
import './polyfill';
import * as strophe from 'strophe.js/src/core';
@ -162,9 +162,7 @@ const DEFAULT_SETTINGS = {
* @global
* @namespace _converse
*/
// Strictly speaking _converse is not a global, but we need to set it as
// such to get JSDoc to create the correct document site strucure.
const _converse = {
export const _converse = {
'templates': {},
'promises': {},
@ -1738,8 +1736,8 @@ function setUnloadEvent () {
}
}
export const converse = window.converse;
window.converse = window.converse || {};
/**
* ### The Public API
@ -1754,7 +1752,7 @@ window.converse = window.converse || {};
* @global
* @namespace converse
*/
Object.assign(window.converse, {
Object.assign(converse, {
CHAT_STATES: ['active', 'composing', 'gone', 'inactive', 'paused'],
@ -1914,4 +1912,3 @@ Object.assign(window.converse, {
* @example window.addEventListener('converse-loaded', () => converse.initialize());
*/
window.dispatchEvent(new CustomEvent('converse-loaded'));
export default converse;

View File

@ -7,7 +7,7 @@
import { isEmpty, isObject } from "lodash";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "./log";
import sizzle from "sizzle";

View File

@ -6,7 +6,7 @@
import { Model } from 'skeletor.js/src/model.js';
import { find, uniq } from "lodash";
import * as twemoji from "twemoji";
import converse from "./converse-core";
import { converse } from "./converse-core";
const u = converse.env.utils;

View File

@ -4,7 +4,7 @@
* @description XEP-0045 Multi-User Chat Views
*/
import { isString } from "lodash";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import st from "./utils/stanza";
const u = converse.env.utils;

View File

@ -7,7 +7,7 @@
import "./converse-disco";
import "./converse-rsm";
import { intersection, pick } from 'lodash'
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "./log";
import sizzle from "sizzle";

View File

@ -10,7 +10,7 @@ import "./converse-emoji";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { clone, debounce, intersection, invoke, isElement, isObject, isString, pick, uniq, zipObject } from "lodash";
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "./log";
import muc_utils from "./utils/muc";
import st from "./utils/stanza";

View File

@ -6,7 +6,7 @@
* @copyright 2020, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "./log";
const { Strophe, $iq } = converse.env;

View File

@ -4,7 +4,7 @@
* @license Mozilla Public License (MPLv2)
*/
import "./converse-disco";
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "./log";
const { Strophe, $iq } = converse.env;

View File

@ -7,7 +7,7 @@ import "@converse/headless/converse-status";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { invoke, isEmpty, isNaN, isString, propertyOf, sum } from "lodash";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import log from "./log";
const { Strophe, $iq, $pres, dayjs, sizzle } = converse.env;

View File

@ -6,7 +6,7 @@
* Some code taken from the Strophe RSM plugin, licensed under the MIT License
* Copyright 2006-2017 Strophe (https://github.com/strophe/strophejs)
*/
import converse from "./converse-core";
import { converse } from "./converse-core";
const { Strophe, $build } = converse.env;

View File

@ -4,7 +4,7 @@
* @license Mozilla Public License (MPLv2)
* @description Converse.js plugin which adds support for XEP-0198: Stream Management
*/
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "./log";
const { Strophe } = converse.env;

View File

@ -5,7 +5,7 @@
*/
import { isNaN, isObject, isString } from "lodash";
import { Model } from 'skeletor.js/src/model.js';
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
const { Strophe, $build, $pres } = converse.env;

View File

@ -7,7 +7,7 @@ import "./converse-status";
import { Collection } from "skeletor.js/src/collection";
import { Model } from 'skeletor.js/src/model.js';
import { has, isString } from "lodash";
import converse from "./converse-core";
import { converse } from "./converse-core";
import log from "@converse/headless/log";
import tpl_vcard from "./templates/vcard.html";

View File

@ -21,6 +21,6 @@ import "./converse-status"; // XEP-0199 XMPP Ping
import "./converse-vcard"; // XEP-0054 VCard-temp
/* END: Removable components */
import converse from "./converse-core";
import { converse } from "./converse-core";
export default converse;

View File

@ -4,7 +4,7 @@
* @description This is the MUC utilities module.
*/
import { difference, indexOf } from "lodash";
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import u from "./core";
const { Strophe, sizzle } = converse.env;

View File

@ -3,7 +3,7 @@ import { __ } from '@converse/headless/i18n';
import { html } from "lit-html";
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
import { until } from 'lit-html/directives/until.js';
import converse from "@converse/headless/converse-core";
import { converse } from "@converse/headless/converse-core";
import xss from "xss/dist/xss";
const u = converse.env.utils;