From 5a82478381deaaa057ea9e24e07c40f6b8d42d13 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 10 Dec 2020 16:39:27 +0100 Subject: [PATCH] Declare sizzle as a dependency for @converse/headless --- package-lock.json | 26 +++++++++----------------- package.json | 1 - src/components/adhoc-commands.js | 3 +-- src/components/emoji-picker-content.js | 3 ++- src/headless/package.json | 1 + src/headless/shared/connection.js | 2 +- src/modals/moderator-tools.js | 3 +-- src/modals/muc-commands.js | 3 +-- src/modals/muc-list.js | 3 +-- src/modals/profile.js | 3 ++- src/utils/html.js | 5 +++-- 11 files changed, 22 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9432e5189..21d7bb155 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2757,8 +2757,7 @@ "dependencies": { "filesize": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz", - "integrity": "sha512-LpCHtPQ3sFx67z+uh2HnSyWSLLu5Jxo21795uRDuar/EOuYWXib5EmPaGIBuSnRqH2IODiKA2k5re/K9OnN/Yg==" + "resolved": false }, "fs-extra": { "version": "8.1.0", @@ -2814,22 +2813,20 @@ }, "localforage": { "version": "1.7.3", - "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.7.3.tgz", - "integrity": "sha512-1TulyYfc4udS7ECSBT2vwJksWbkwwTX8BzeUIiq8Y07Riy7bDAAnxDaPU/tWyOVmQAcWJIEIFP9lPfBGqVoPgQ==", + "resolved": false, "requires": { "lie": "3.1.1" } }, "pluggable.js": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pluggable.js/-/pluggable.js-2.0.1.tgz", - "integrity": "sha512-SBt6v6Tbp20Jf8hU0cpcc/+HBHGMY8/Q+yA6Ih0tBQE8tfdZ6U4PRG0iNvUUjLx/hVyOP53n0UfGBymlfaaXCg==", + "resolved": false, "requires": { "lodash": "^4.17.11" } }, "skeletor.js": { - "version": "github:skeletorjs/skeletor#bf6d9c86f9fcf224fa9d9af5a25380b77aa4b561", + "version": "0.0.1", "from": "github:skeletorjs/skeletor#bf6d9c86f9fcf224fa9d9af5a25380b77aa4b561", "requires": { "lodash": "^4.17.14" @@ -2837,11 +2834,7 @@ }, "strophe.js": { "version": "github:strophe/strophejs#c4a94e59877c06dc2395f4ccbd26f3fee67a4c9f", - "from": "strophe.js@github:strophe/strophejs#c4a94e59877c06dc2395f4ccbd26f3fee67a4c9f", - "requires": { - "abab": "^2.0.3", - "xmldom": "^0.1.27" - } + "from": "strophe.js@github:strophe/strophejs#c4a94e59877c06dc2395f4ccbd26f3fee67a4c9f" }, "twemoji": { "version": "12.1.5", @@ -4628,9 +4621,9 @@ } }, "@octokit/types": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.1.0.tgz", - "integrity": "sha512-bMWBmg77MQTiRkOVyf50qK3QECWOEy43rLy/6fTWZ4HEwAhNfqzMcjiBDZAowkILwTrFvzE1CpP6gD0MuPHS+A==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.1.1.tgz", + "integrity": "sha512-btm3D6S7VkRrgyYF31etUtVY/eQ1KzrNRqhFt25KSe2mKlXuLXJilglRC6eDA2P6ou94BUnk/Kz5MPEolXgoiw==", "dev": true, "requires": { "@octokit/openapi-types": "^2.0.0", @@ -21354,8 +21347,7 @@ "sizzle": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/sizzle/-/sizzle-2.3.5.tgz", - "integrity": "sha512-mncpQHS12IwzOpuMReKd2matojaS5M5Ofms96LUKOOg8S1M7jIh90OQyd2I6sBoHpxg/HoduOJNDTvRCmnm0YA==", - "dev": true + "integrity": "sha512-mncpQHS12IwzOpuMReKd2matojaS5M5Ofms96LUKOOg8S1M7jIh90OQyd2I6sBoHpxg/HoduOJNDTvRCmnm0YA==" }, "slash": { "version": "2.0.0", diff --git a/package.json b/package.json index 9810538e3..842292dbc 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,6 @@ "run-headless-chromium": "^0.1.1", "sass-loader": "^8.0.2", "sinon": "^9.0.2", - "sizzle": "^2.3.5", "style-loader": "^0.23.1", "urijs": "^1.19.2", "webpack": "^4.43.0", diff --git a/src/components/adhoc-commands.js b/src/components/adhoc-commands.js index b4b3ee9ef..dca976aff 100644 --- a/src/components/adhoc-commands.js +++ b/src/components/adhoc-commands.js @@ -1,13 +1,12 @@ import 'shared/autocomplete/index.js'; import log from "@converse/headless/log"; -import sizzle from "sizzle"; import { CustomElement } from './element.js'; import { __ } from '../i18n'; import { api, converse } from "@converse/headless/core"; import { html } from "lit-html"; import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; -const { Strophe, $iq } = converse.env; +const { Strophe, $iq, sizzle } = converse.env; const u = converse.env.utils; diff --git a/src/components/emoji-picker-content.js b/src/components/emoji-picker-content.js index 7e3829caa..45799e800 100644 --- a/src/components/emoji-picker-content.js +++ b/src/components/emoji-picker-content.js @@ -1,9 +1,10 @@ -import sizzle from 'sizzle'; import { CustomElement } from './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"; +const { sizzle } = converse.env; + export default class EmojiPickerContent extends CustomElement { static get properties () { diff --git a/src/headless/package.json b/src/headless/package.json index fb4f22c2f..4254d8cb0 100644 --- a/src/headless/package.json +++ b/src/headless/package.json @@ -42,6 +42,7 @@ "localforage-webextensionstorage-driver": "^2.0.0", "lodash-es": "^4.17.15", "pluggable.js": "2.0.1", + "sizzle": "^2.3.5", "sprintf-js": "^1.1.2", "strophe.js": "1.4.1" } diff --git a/src/headless/shared/connection.js b/src/headless/shared/connection.js index 470437c57..e5898b50a 100644 --- a/src/headless/shared/connection.js +++ b/src/headless/shared/connection.js @@ -1,7 +1,7 @@ import log from "../log.js"; import sizzle from 'sizzle'; import u from '@converse/headless/utils/core'; -import { Strophe } from 'strophe.js/src/strophe'; +import { Strophe } from 'strophe.js/src/core'; import { _converse, api, clearSession, tearDown } from "../core.js"; import { debounce, isElement } from 'lodash'; diff --git a/src/modals/moderator-tools.js b/src/modals/moderator-tools.js index 0c6c94db7..d6baf01f9 100644 --- a/src/modals/moderator-tools.js +++ b/src/modals/moderator-tools.js @@ -1,12 +1,11 @@ import BootstrapModal from "./base.js"; import log from "@converse/headless/log"; -import sizzle from "sizzle"; import tpl_moderator_tools_modal from "./templates/moderator-tools.js"; import { AFFILIATIONS, ROLES } from "@converse/headless/plugins/muc/index.js"; import { __ } from '../i18n'; import { api, converse } from "@converse/headless/core"; -const { Strophe } = converse.env; +const { Strophe, sizzle } = converse.env; const u = converse.env.utils; let _converse; diff --git a/src/modals/muc-commands.js b/src/modals/muc-commands.js index 6bea7b283..48efb71a0 100644 --- a/src/modals/muc-commands.js +++ b/src/modals/muc-commands.js @@ -2,10 +2,9 @@ import BootstrapModal from "./base.js"; import { __ } from '../i18n'; import { api, converse } from "@converse/headless/core"; import log from "@converse/headless/log"; -import sizzle from "sizzle"; import tpl_muc_commands_modal from "../templates/muc_commands_modal.js"; -const { Strophe, $iq } = converse.env; +const { Strophe, $iq, sizzle } = converse.env; const u = converse.env.utils; diff --git a/src/modals/muc-list.js b/src/modals/muc-list.js index 5f09e1c0a..3b9fee663 100644 --- a/src/modals/muc-list.js +++ b/src/modals/muc-list.js @@ -1,6 +1,5 @@ import BootstrapModal from "./base.js"; import log from "@converse/headless/log"; -import sizzle from 'sizzle'; import st from "@converse/headless/utils/stanza"; import tpl_list_chatrooms_modal from "./templates/muc-list.js"; import tpl_room_description from "templates/room_description.html"; @@ -9,7 +8,7 @@ import { __ } from '../i18n'; import { _converse, api, converse } from "@converse/headless/core"; import { head } from "lodash-es"; -const { Strophe, $iq } = converse.env; +const { Strophe, $iq, sizzle } = converse.env; const u = converse.env.utils; diff --git a/src/modals/profile.js b/src/modals/profile.js index 743ff17b3..861eefcae 100644 --- a/src/modals/profile.js +++ b/src/modals/profile.js @@ -1,11 +1,12 @@ import BootstrapModal from "./base.js"; import bootstrap from "bootstrap.native"; import log from "@converse/headless/log"; -import sizzle from 'sizzle'; import tpl_profile_modal from "./templates/profile.js"; import { __ } from '../i18n'; import { _converse, api } from "@converse/headless/core"; +const { sizzle } = converse.env; + const ProfileModal = BootstrapModal.extend({ id: "user-profile-modal", diff --git a/src/utils/html.js b/src/utils/html.js index c1bd0e569..ba2c723e0 100644 --- a/src/utils/html.js +++ b/src/utils/html.js @@ -5,7 +5,6 @@ */ import URI from "urijs"; import log from '@converse/headless/log'; -import sizzle from "sizzle"; import tpl_audio from "../templates/audio.js"; import tpl_file from "../templates/file.js"; import tpl_form_captcha from "../templates/form_captcha.html"; @@ -19,10 +18,12 @@ import tpl_image from "../templates/image.js"; import tpl_select_option from "../templates/select_option.html"; import tpl_video from "../templates/video.js"; import u from "../headless/utils/core"; -import { api } from "@converse/headless/core"; +import { api, converse } from "@converse/headless/core"; import { html, render } from "lit-html"; import { isFunction } from "lodash-es"; +const { sizzle } = converse.env; + const APPROVED_URL_PROTOCOLS = ['http', 'https', 'xmpp', 'mailto']; function getAutoCompleteProperty (name, options) {