Selaa lähdekoodia

Add dayjs as dependency to @converse/headless

JC Brand 4 vuotta sitten
vanhempi
commit
14f0ed43c5
4 muutettua tiedostoa jossa 8 lisäystä ja 5 poistoa
  1. 0 1
      package.json
  2. 1 0
      src/headless/package.json
  3. 3 2
      src/i18n/index.js
  4. 4 2
      src/modals/templates/message-versions.js

+ 0 - 1
package.json

@@ -118,7 +118,6 @@
     "@fortawesome/fontawesome-free": "5.14.0",
     "bootstrap": "^4.6.0",
     "bootstrap.native": "^2.0.27",
-    "dayjs": "1.10.4",
     "favico.js-slevomat": "^0.3.11",
     "jed": "1.1.1",
     "lit": "^2.0.0-rc.1",

+ 1 - 0
src/headless/package.json

@@ -38,6 +38,7 @@
   "devDependencies": {},
   "dependencies": {
     "@converse/skeletor": "conversejs/skeletor#f354bc530493a17d031f6f9c524cc34e073908e3",
+    "dayjs": "1.10.4",
     "filesize": "^6.1.0",
     "localforage": "^1.9.0",
     "localforage-driver-memory": "^1.0.5",

+ 3 - 2
src/i18n/index.js

@@ -5,9 +5,10 @@
  * @description This is the internationalization module
  */
 import Jed from 'jed';
-import dayjs from 'dayjs';
 import log from "@converse/headless/log";
-import { _converse, api, i18n } from '@converse/headless/core';
+import { _converse, api, converse, i18n } from '@converse/headless/core';
+
+const { dayjs } = converse.env;
 
 
 function detectLocale (library_check) {

+ 4 - 2
src/modals/templates/message-versions.js

@@ -1,7 +1,9 @@
-import dayjs from 'dayjs';
-import { __ } from '../../i18n';
+import { __ } from 'i18n';
 import { html } from "lit";
 import { modal_close_button, modal_header_close_button } from "./buttons.js"
+import { converse } from '@converse/headless/core';
+
+const { dayjs } = converse.env;
 
 
 export default (o) => html`