From cc6e99d44eaf9d76d64d99f240c98a88d9eee1e9 Mon Sep 17 00:00:00 2001 From: rugk Date: Sat, 7 May 2022 15:50:16 +0200 Subject: [PATCH 1/6] chore: install emoji-mart v5 --- .gitignore | 3 --- assets/texts/amoreviewnote.txt | 3 +-- src/package-lock.json | 39 ++++++++++++++++++++++++++++++++++ src/package.json | 18 ++++++++++++++++ 4 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 src/package-lock.json create mode 100644 src/package.json diff --git a/.gitignore b/.gitignore index a3a093a..015e043 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,3 @@ node_modules/ # do not commit emoji images src/popup/img/emoji-images/*.png - -# private AMO stuff -assets/texts/en/amo-review.txt diff --git a/assets/texts/amoreviewnote.txt b/assets/texts/amoreviewnote.txt index 42f0162..a68b748 100644 --- a/assets/texts/amoreviewnote.txt +++ b/assets/texts/amoreviewnote.txt @@ -1,4 +1,3 @@ -The submitted source code is just for embedding of emoji-mart, see https://github.com/rugk/emoji-mart-embed/ for the whole source online. -You can build that separately and include the whole resulting git repo in the add-on. All other parts of the add-on are unminified/untranspiled (JavaScript) files. +The submitted source code includes emoji-mart as a dependency: https://github.com/missive/emoji-mart The whole add-on source is also available at https://github.com/rugk/awesome-emoji-picker. diff --git a/src/package-lock.json b/src/package-lock.json new file mode 100644 index 0000000..a7edcc7 --- /dev/null +++ b/src/package-lock.json @@ -0,0 +1,39 @@ +{ + "name": "awesome-emoji-picker", + "version": "2.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "awesome-emoji-picker", + "version": "2.0.0", + "license": "ISC", + "dependencies": { + "@emoji-mart/data": "^1.0.1", + "emoji-mart": "^5.0.0" + } + }, + "node_modules/@emoji-mart/data": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@emoji-mart/data/-/data-1.0.1.tgz", + "integrity": "sha512-5X6DbIdyFvSFMfGdPkPd/yxQmtfMptZg5UUSL+afb39SdbPvobJY7VhzGM0IekxjszW3ygxZ2X5mVhy5AqF5vQ==" + }, + "node_modules/emoji-mart": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/emoji-mart/-/emoji-mart-5.0.0.tgz", + "integrity": "sha512-4O75LxV/RPOrtC9+0qhHhfPgJgW/Kwc4zv15h190liC3vJ/5RVibIrnPlDZ0xqYx0bPVOy3W/QcDTZY+jq1qOw==" + } + }, + "dependencies": { + "@emoji-mart/data": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@emoji-mart/data/-/data-1.0.1.tgz", + "integrity": "sha512-5X6DbIdyFvSFMfGdPkPd/yxQmtfMptZg5UUSL+afb39SdbPvobJY7VhzGM0IekxjszW3ygxZ2X5mVhy5AqF5vQ==" + }, + "emoji-mart": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/emoji-mart/-/emoji-mart-5.0.0.tgz", + "integrity": "sha512-4O75LxV/RPOrtC9+0qhHhfPgJgW/Kwc4zv15h190liC3vJ/5RVibIrnPlDZ0xqYx0bPVOy3W/QcDTZY+jq1qOw==" + } + } +} diff --git a/src/package.json b/src/package.json new file mode 100644 index 0000000..3abf693 --- /dev/null +++ b/src/package.json @@ -0,0 +1,18 @@ +{ + "name": "awesome-emoji-picker", + "version": "2.0.0", + "repository": { + "type": "git", + "url": "git+https://github.com/rugk/awesome-emoji-picker.git" + }, + "author": "rugk", + "license": "ISC", + "bugs": { + "url": "https://github.com/rugk/awesome-emoji-picker/issues" + }, + "homepage": "https://github.com/rugk/awesome-emoji-picker#readme", + "dependencies": { + "@emoji-mart/data": "^1.0.1", + "emoji-mart": "^5.0.0" + } +} From ce66548a11e80fa4e453ea2ee7b249b5acaf8817 Mon Sep 17 00:00:00 2001 From: rugk Date: Sat, 7 May 2022 17:46:55 +0200 Subject: [PATCH 2/6] Try as per main Readme --- src/popup/module/EmojiPicker.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/popup/module/EmojiPicker.js b/src/popup/module/EmojiPicker.js index 94f4af9..1420f71 100644 --- a/src/popup/module/EmojiPicker.js +++ b/src/popup/module/EmojiPicker.js @@ -5,6 +5,8 @@ */ import * as EmojiSelect from "./EmojiSelect.js"; +import data from "/node_modules/@emoji-mart/data"; +import * as EmojiMart from "/node_modules/emoji-mart/dist/index.js"; let emojiPicker = null; @@ -107,10 +109,6 @@ export function init(settings) { console.debug("Using these emoji-mart settings:", initProperties); - const promiseCreateElement = window.emojiMart.definePicker("emoji-picker", initProperties); - - return promiseCreateElement.then(() => { - emojiPicker = document.createElement("emoji-picker"); - document.body.appendChild(emojiPicker); - }); + const emojiPicker = new EmojiMart.Picker({ ...initProperties, data: data }); + document.body.appendChild(emojiPicker); } From 3649b495063010fe3df08c4fbab0b9d958552560 Mon Sep 17 00:00:00 2001 From: rugk Date: Thu, 26 May 2022 19:23:01 +0200 Subject: [PATCH 3/6] Update git submodules --- src/common/lib/emoji-mart-embed | 2 +- src/common/modules/AddonSettings | 2 +- src/common/modules/AutomaticSettings | 2 +- src/common/modules/BrowserCommunication | 2 +- src/common/modules/Localizer | 2 +- src/common/modules/Logger | 2 +- src/common/modules/MessageHandler | 2 +- src/common/modules/PermissionRequest | 2 +- src/common/modules/RandomTips | 2 +- src/tests/helper | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/lib/emoji-mart-embed b/src/common/lib/emoji-mart-embed index e7ac67e..3b84f7f 160000 --- a/src/common/lib/emoji-mart-embed +++ b/src/common/lib/emoji-mart-embed @@ -1 +1 @@ -Subproject commit e7ac67ea6f6d4fcf169b42eabe72d93d65b55b12 +Subproject commit 3b84f7ffdeb1e6a14487b192aa56b8d86964de84 diff --git a/src/common/modules/AddonSettings b/src/common/modules/AddonSettings index b5e57fc..7855b9d 160000 --- a/src/common/modules/AddonSettings +++ b/src/common/modules/AddonSettings @@ -1 +1 @@ -Subproject commit b5e57fc456395613f6e1e5825c0ab670528eb552 +Subproject commit 7855b9dbeb6cbb8861f2d6b5ae916bd756f525ea diff --git a/src/common/modules/AutomaticSettings b/src/common/modules/AutomaticSettings index f1d239c..fce7d28 160000 --- a/src/common/modules/AutomaticSettings +++ b/src/common/modules/AutomaticSettings @@ -1 +1 @@ -Subproject commit f1d239c2b1adfeeff4161c65c4e967bf6e6e78fc +Subproject commit fce7d28ce753354da18cad9cfe71c729ec46d424 diff --git a/src/common/modules/BrowserCommunication b/src/common/modules/BrowserCommunication index 6d66b4e..b0125e5 160000 --- a/src/common/modules/BrowserCommunication +++ b/src/common/modules/BrowserCommunication @@ -1 +1 @@ -Subproject commit 6d66b4e34c9d209bf72127f6128c11ae473b68f2 +Subproject commit b0125e55f3aa8631bf3224e9389a51879e0ace96 diff --git a/src/common/modules/Localizer b/src/common/modules/Localizer index 971b54a..da1f4c3 160000 --- a/src/common/modules/Localizer +++ b/src/common/modules/Localizer @@ -1 +1 @@ -Subproject commit 971b54a9f0761070644ad9fe7b93be80f0080fbf +Subproject commit da1f4c3edc616655a360b2a79b79514d8c077b55 diff --git a/src/common/modules/Logger b/src/common/modules/Logger index c628352..b60c36e 160000 --- a/src/common/modules/Logger +++ b/src/common/modules/Logger @@ -1 +1 @@ -Subproject commit c628352e5adadce6669bb001df03bd832e89cd3a +Subproject commit b60c36e7e9b9bdaa69dbb33dd89e288021085f31 diff --git a/src/common/modules/MessageHandler b/src/common/modules/MessageHandler index f7c6095..a2aa9f4 160000 --- a/src/common/modules/MessageHandler +++ b/src/common/modules/MessageHandler @@ -1 +1 @@ -Subproject commit f7c60958ff69b09f4eff8662562e7d2a1d1f0f78 +Subproject commit a2aa9f477e4dfa9a12b97c7bb4088255e381a191 diff --git a/src/common/modules/PermissionRequest b/src/common/modules/PermissionRequest index 451d517..9782593 160000 --- a/src/common/modules/PermissionRequest +++ b/src/common/modules/PermissionRequest @@ -1 +1 @@ -Subproject commit 451d517b56d2cfbccf242ad4ff72077286af3496 +Subproject commit 97825931f1893968b8da13adf4513e7922fff559 diff --git a/src/common/modules/RandomTips b/src/common/modules/RandomTips index 63ee239..0eaaf04 160000 --- a/src/common/modules/RandomTips +++ b/src/common/modules/RandomTips @@ -1 +1 @@ -Subproject commit 63ee23925a499a8dea529ab113a6583a4b1279fe +Subproject commit 0eaaf040f21526edb424a40af3fd4c9cbadb3beb diff --git a/src/tests/helper b/src/tests/helper index 3a12eb8..6ac02d4 160000 --- a/src/tests/helper +++ b/src/tests/helper @@ -1 +1 @@ -Subproject commit 3a12eb8f40e9f2ab8d8281ba19e0434c0059aa6b +Subproject commit 6ac02d401b38b642426d63d2b33b560d9b0df9af From 9954e0293169a598b749a801efa047bd9f9b933c Mon Sep 17 00:00:00 2001 From: rugk Date: Thu, 26 May 2022 19:32:03 +0200 Subject: [PATCH 4/6] Use CommonCss from TinyWebExt --- .gitmodules | 3 + src/common/common.css | 258 +---------------------------------- src/common/modules/CommonCss | 1 + 3 files changed, 5 insertions(+), 257 deletions(-) create mode 160000 src/common/modules/CommonCss diff --git a/.gitmodules b/.gitmodules index 4509f58..57c27e8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,3 +37,6 @@ [submodule "src/common/modules/EnvironmentDetector"] path = src/common/modules/EnvironmentDetector url = https://github.com/TinyWebEx/EnvironmentDetector +[submodule "src/common/modules/CommonCss"] + path = src/common/modules/CommonCss + url = https://github.com/TinyWebEx/CommonCss diff --git a/src/common/common.css b/src/common/common.css index f1fe89c..8ec08f4 100644 --- a/src/common/common.css +++ b/src/common/common.css @@ -1,257 +1 @@ -@import url("./variables.css"); - -body { - direction: __MSG_@@bidi_dir__; -} - -/* https://design.firefox.com/photon/components/links.html */ -a { - color: var(--blue-60); - text-decoration: none; -} - -a:focus { - border-radius: 4px; - box-shadow: 0 0 0 2px var(--blue-50), 0 0 0 6px var(--blue-50-a30); -} - -a:hover, a:active { - text-decoration: underline; -} - -a:active { - color: var(--blue-70); -} - -/* external link symbol */ -/* currently disabled, because it is not clear what an external link is, in our case */ -/*a:not([class])[href*="//"]::after { - background-image: url(/common/img/open-in-new.svg); - background-repeat: no-repeat; - background-size: 16px 16px; - content: ""; - display: inline-block; - height: 16px; - margin: -.3rem .15rem 0 .25rem; - vertical-align: middle; - width: 16px; -}*/ - -/* small classes in order to avoid inline CSS */ -.invisible { - display: none !important; -} - -.message-container { - position: relative; -} - -/* buttons https://design.firefox.com/photon/components/buttons.html */ -.micro-button { - min-height: 24px; - height: auto; - border-radius: 2px; - - padding-left: 8px; - padding-right: 8px; - - /* not documented, but looks ugly otherwise */ - padding-top: 2px; - padding-bottom: 2px; - - box-sizing: content-box; - - /* do not break over multiple lines */ - /* white-space: nowrap; */ - height: auto; /* currently, we rather prefer breaking until https://github.com/rugk/offline-qr-code/issues/12 is done */ -} - -/* use light color for dark backgrounds */ -.micro-button:hover.success, -.micro-button:active.success, -.micro-button:hover.warning, -.micro-button:active.warning, -.micro-button:hover.error, -.micro-button:active.error { - color: var(--white-100); -} - -.micro-button.info { - background-color: var(--grey-90-a10); -} -.micro-button:hover.info { - background-color: var(--grey-90-a20); -} -.micro-button:active.info { - background-color: var(--grey-90-a30); -} - -.micro-button.success { - background-color: var(--green-60); -} -.micro-button:hover.success { - background-color: var(--green-70); -} -.micro-button:active.success { - background-color: var(--green-80); -} - -.micro-button.warning { - background-color: var(--yellow-60); -} -.micro-button:hover.warning { - background-color: var(--yellow-70); -} -.micro-button:active.warning { - background-color: var(--yellow-80); -} - -.micro-button.error { - background-color: var(--red-70); - color: var(--white-100); -} -.micro-button:hover.error { - background-color: var(--red-80); -} -.micro-button:active.error { - background-color: var(--red-90); -} - -.micro-button:focus { - box-shadow: 0 0 0 1px #0a84ff inset, 0 0 0 1px #0a84ff, 0 0 0 4px rgba(10, 132, 255, 0.3) -} - -/* message box */ -/* follows https://design.firefox.com/photon/components/message-bars.html */ -.message-box { - padding: 4px; - - border-radius: 4px; - - /* use whole width */ - width: 100%; - min-height: 32px; - - /* make errors selectable, so users can copy them */ - -moz-user-select: text; - cursor: text; - - /* multiline */ - hypens: auto; - overflow-wrap: break-word; - - /* center-vertically */ - display: flex; - align-items: center; - - z-index: 2; - - /* fade-in transition */ - /* follow https://design.firefox.com/photon/motion/duration-and-easing.html */ - opacity: 1; - max-height: 100px; - - transition: opacity 150ms cubic-bezier(.07,.95,0,1), - max-height 200ms cubic-bezier(.07,.95,0,1); -} -.message-box.fade-hide { - max-height: 0px; - opacity: 0; - min-height: 0px; -} - -/* add margin when messages are stacked on each other */ -.message-box:not(.invisible) ~ .message-box:not(.invisible) { - margin-top: 8px; -} - -.error { - color: var(--white-100); - background-color: var(--red-60); -} - -.info { - color: var(--grey-90); - background-color: var(--grey-20); -} - -.success { - color: var(--green-90); - background-color: var(--green-50); -} - -.warning { - color: var(--yellow-90); - background-color: var(--yellow-50); -} - -/* message box action button */ -.message-action-button { - margin-left: 8px; - - /* center vertially */ - margin-top: auto; - margin-bottom: auto; - - /* some minimum margin to dismiss button or similar */ - margin-right: 4px; - - border: 0; - color: var(--grey-90); - - cursor: pointer; -} - -/* icons for the message boxes */ -.message-box::before { - display: inline-block; - - /* fixed size */ - background-size: 16px 16px; - width: 16px; - height: 16px; - min-width: 16px; - min-height: 16px; - - content: ""; - margin: 4px; -} - -.error::before { - background-image: url('/common/img/error-white.svg'); -} -.info::before { - background-image: url('/common/img/info-dark.svg'); -} -.success::before { - background-image: url('/common/img/check.svg'); -} -.warning::before { - background-image: url('/common/img/warning-dark.svg'); -} - -.icon-dismiss { - box-sizing: content-box; - padding: 2px; - - width: 24px; - height: 24px; - - margin-left: auto; - cursor: pointer; - - /* some animation on hover */ - transition: background-color 150ms cubic-bezier(.07,.95,0,1); -} -.icon-dismiss:hover { - background-color: var(--grey-90-a10); - border-radius: 2px; -} -.icon-dismiss:active { - background-color: var(--grey-90-a20); - border-radius: 2px; -} -.icon-dismiss:focus { - box-shadow: 0 0 0 1px var(--blue-50) inset, 0 0 0 1px var(--blue-50), 0 0 0 4px var(--blue-50-a30); - border-radius: 2px; -} +@import url("./modules/CommonCss/common.css"); \ No newline at end of file diff --git a/src/common/modules/CommonCss b/src/common/modules/CommonCss new file mode 160000 index 0000000..bdd81cc --- /dev/null +++ b/src/common/modules/CommonCss @@ -0,0 +1 @@ +Subproject commit bdd81cc7d19caeb324c9ccbbde19c624bf8429e2 From 24164bba65951df00d840f3296db98ca6f97ad21 Mon Sep 17 00:00:00 2001 From: rugk Date: Wed, 15 Jun 2022 21:41:32 +0200 Subject: [PATCH 5/6] Add combined-data.kjs from unpkg to make JS load --- package-lock.json | 6 ++++++ scripts/make.sh | 2 +- src/popup/index.html | 4 +--- src/popup/lib/combined-data.js | 1 + src/popup/module/EmojiPicker.js | 4 +++- 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 package-lock.json create mode 100644 src/popup/lib/combined-data.js diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d18f2be --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "awesome-emoji-picker", + "lockfileVersion": 2, + "requires": true, + "packages": {} +} diff --git a/scripts/make.sh b/scripts/make.sh index fbb9b3c..64da9e6 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -26,7 +26,7 @@ zip -r -FS "../build/$EXTENSION_NAME.xpi" ./* -x "tests/*" -x "**/tests/*" \ -x "**/.git" -x "**/.gitignore" -x "**/.gitmodules" -x "**/.gitkeep" \ -x "**/.eslintrc" \ -x "**/package.json" -x "**/package-lock.json" -x "**/webpack.config.js" \ - -x "popup/lib/emoji-mart-embed/src.js" \ + -x "node_modules/@emoji-mart/data" \ -x "**/.editorconfig" \ -x "**/.github/*" diff --git a/src/popup/index.html b/src/popup/index.html index 3329f5f..4b96f2a 100644 --- a/src/popup/index.html +++ b/src/popup/index.html @@ -4,13 +4,11 @@ - + - -