@htmlbricks/hb-messages-box 0.20.10 → 0.20.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/release/manifest.json +18 -18
- package/release/release.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@htmlbricks/hb-messages-box",
|
|
3
3
|
"displayName": "Svelte-Bootstrap messages-box",
|
|
4
4
|
"description": "Svelte-Bootstrap messages-box",
|
|
5
|
-
"version": "0.20.
|
|
5
|
+
"version": "0.20.12",
|
|
6
6
|
"main": "release/release.js",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"webcomponents"
|
|
76
76
|
],
|
|
77
77
|
"contributors": [],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "89b7167e53c12fd897008a70ab8dc3380796a8dc",
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@htmlbricks/hb-messages-list": "^0.20.
|
|
81
|
-
"@htmlbricks/hb-messages-send": "^0.20.
|
|
80
|
+
"@htmlbricks/hb-messages-list": "^0.20.12",
|
|
81
|
+
"@htmlbricks/hb-messages-send": "^0.20.12",
|
|
82
82
|
"style-to-object": "^0.3.0"
|
|
83
83
|
}
|
|
84
84
|
}
|
package/release/manifest.json
CHANGED
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
{
|
|
278
278
|
"id": "1",
|
|
279
279
|
"text": "Hello",
|
|
280
|
-
"timestamp": "2024-07-
|
|
280
|
+
"timestamp": "2024-07-14T16:11:17.058Z",
|
|
281
281
|
"type": "text",
|
|
282
282
|
"status": "sent",
|
|
283
283
|
"authorId": "1"
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
{
|
|
286
286
|
"id": "2",
|
|
287
287
|
"text": "Hi",
|
|
288
|
-
"timestamp": "2024-07-
|
|
288
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
289
289
|
"type": "text",
|
|
290
290
|
"status": "received",
|
|
291
291
|
"authorId": "2"
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
{
|
|
319
319
|
"id": "1",
|
|
320
320
|
"text": "Hello",
|
|
321
|
-
"timestamp": "2024-07-
|
|
321
|
+
"timestamp": "2024-07-14T16:11:17.058Z",
|
|
322
322
|
"type": "text",
|
|
323
323
|
"status": "sent",
|
|
324
324
|
"authorId": "1"
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
{
|
|
327
327
|
"id": "2",
|
|
328
328
|
"text": "Hi",
|
|
329
|
-
"timestamp": "2024-07-
|
|
329
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
330
330
|
"type": "text",
|
|
331
331
|
"status": "received",
|
|
332
332
|
"authorId": "2"
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
{
|
|
357
357
|
"id": "1",
|
|
358
358
|
"text": "Hello",
|
|
359
|
-
"timestamp": "2024-07-
|
|
359
|
+
"timestamp": "2024-07-14T16:11:17.058Z",
|
|
360
360
|
"type": "text",
|
|
361
361
|
"status": "sent",
|
|
362
362
|
"authorId": "1"
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
{
|
|
365
365
|
"id": "2",
|
|
366
366
|
"text": "Hi",
|
|
367
|
-
"timestamp": "2024-07-
|
|
367
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
368
368
|
"type": "text",
|
|
369
369
|
"status": "received",
|
|
370
370
|
"authorId": "2"
|
|
@@ -372,7 +372,7 @@
|
|
|
372
372
|
{
|
|
373
373
|
"id": "3",
|
|
374
374
|
"text": "How are you?",
|
|
375
|
-
"timestamp": "2024-07-
|
|
375
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
376
376
|
"type": "text",
|
|
377
377
|
"status": "received",
|
|
378
378
|
"authorId": "2"
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
{
|
|
381
381
|
"id": "4",
|
|
382
382
|
"text": "I'm fine, thanks",
|
|
383
|
-
"timestamp": "2024-07-
|
|
383
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
384
384
|
"type": "text",
|
|
385
385
|
"status": "sent",
|
|
386
386
|
"authorId": "1"
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
{
|
|
389
389
|
"id": "5",
|
|
390
390
|
"text": "What about you?",
|
|
391
|
-
"timestamp": "2024-07-
|
|
391
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
392
392
|
"type": "text",
|
|
393
393
|
"status": "received",
|
|
394
394
|
"authorId": "2"
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
{
|
|
397
397
|
"id": "6",
|
|
398
398
|
"text": "I'm fine too, thanks for asking",
|
|
399
|
-
"timestamp": "2024-07-
|
|
399
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
400
400
|
"type": "text",
|
|
401
401
|
"status": "sent",
|
|
402
402
|
"authorId": "1"
|
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
{
|
|
405
405
|
"id": "7",
|
|
406
406
|
"text": "You're welcome",
|
|
407
|
-
"timestamp": "2024-07-
|
|
407
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
408
408
|
"type": "text",
|
|
409
409
|
"status": "received",
|
|
410
410
|
"authorId": "2"
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
{
|
|
413
413
|
"id": "8",
|
|
414
414
|
"text": "Bye",
|
|
415
|
-
"timestamp": "2024-07-
|
|
415
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
416
416
|
"type": "text",
|
|
417
417
|
"status": "sent",
|
|
418
418
|
"authorId": "1"
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
{
|
|
421
421
|
"id": "9",
|
|
422
422
|
"text": "Bye",
|
|
423
|
-
"timestamp": "2024-07-
|
|
423
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
424
424
|
"type": "text",
|
|
425
425
|
"status": "received",
|
|
426
426
|
"authorId": "2"
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
{
|
|
429
429
|
"id": "10",
|
|
430
430
|
"text": "See you later",
|
|
431
|
-
"timestamp": "2024-07-
|
|
431
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
432
432
|
"type": "text",
|
|
433
433
|
"status": "sent",
|
|
434
434
|
"authorId": "1"
|
|
@@ -436,7 +436,7 @@
|
|
|
436
436
|
{
|
|
437
437
|
"id": "11",
|
|
438
438
|
"text": "See you later",
|
|
439
|
-
"timestamp": "2024-07-
|
|
439
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
440
440
|
"type": "text",
|
|
441
441
|
"status": "received",
|
|
442
442
|
"authorId": "2"
|
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
{
|
|
445
445
|
"id": "12",
|
|
446
446
|
"text": "Bye",
|
|
447
|
-
"timestamp": "2024-07-
|
|
447
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
448
448
|
"type": "text",
|
|
449
449
|
"status": "sent",
|
|
450
450
|
"authorId": "1"
|
|
@@ -452,7 +452,7 @@
|
|
|
452
452
|
{
|
|
453
453
|
"id": "13",
|
|
454
454
|
"text": "Bye",
|
|
455
|
-
"timestamp": "2024-07-
|
|
455
|
+
"timestamp": "2024-07-14T16:11:53.058Z",
|
|
456
456
|
"type": "text",
|
|
457
457
|
"status": "received",
|
|
458
458
|
"authorId": "2"
|
|
@@ -494,5 +494,5 @@
|
|
|
494
494
|
"size": {},
|
|
495
495
|
"iifePath": "release/release.js",
|
|
496
496
|
"repoName": "@htmlbricks/hb-messages-box",
|
|
497
|
-
"version": "0.20.
|
|
497
|
+
"version": "0.20.12"
|
|
498
498
|
}
|
package/release/release.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode&&t.parentNode.removeChild(t)}function l(t){return document.createElement(t)}function u(){return t=" ",document.createTextNode(t);var t}function d(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function f(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:d(t,e,n)}function p(t){const e={};for(const n of t)e[n.name]=n.value;return e}let h;function m(t){h=t}function g(){if(!h)throw new Error("Function called outside component initialization");return h}function v(){const t=g();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const s=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(e,n,{cancelable:o});return r.slice().forEach((e=>{e.call(t,s)})),!s.defaultPrevented}return!0}}const y=[],$=[];let w=[];const x=[],b=Promise.resolve();let D=!1;function E(t){w.push(t)}const _=new Set;let k=0;function C(){if(0!==k)return;const t=h;do{try{for(;k<y.length;){const t=y[k];k++,m(t),I(t.$$)}}catch(t){throw y.length=0,k=0,t}for(m(null),y.length=0,k=0;$.length;)$.pop()();for(let t=0;t<w.length;t+=1){const e=w[t];_.has(e)||(_.add(e),e())}w.length=0}while(y.length);for(;x.length;)x.pop()();D=!1,_.clear(),m(t)}function I(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(E)}}const L=new Set;function A(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];w.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),w=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function N(t,e){-1===t.$$.dirty[0]&&(y.push(t),D||(D=!0,b.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function T(s,a,i,l,u,d,f,p=[-1]){const g=h;m(s);const v=s.$$={fragment:null,ctx:[],props:d,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(g?g.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:a.target||g.$$.root};f&&f(v.root);let y=!1;if(v.ctx=i?i(s,a.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return v.ctx&&u(v.ctx[t],v.ctx[t]=o)&&(!v.skip_bound&&v.bound[t]&&v.bound[t](o),y&&N(s,t)),e})):[],v.update(),y=!0,o(v.before_update),v.fragment=!!l&&l(v.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);v.fragment&&v.fragment.l(t),t.forEach(c)}else v.fragment&&v.fragment.c();a.intro&&(($=s.$$.fragment)&&$.i&&(L.delete($),$.i(w))),function(t,n,s,a){const{fragment:i,after_update:c}=t.$$;i&&i.m(n,s),a||E((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),c.forEach(E)}(s,a.target,a.anchor,a.customElement),C()}var $,w;m(g)}let S;"function"==typeof HTMLElement&&(S=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){A(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var j="0.20.10",O=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,P=/\n/g,M=/^\s*/,B=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H=/^:\s*/,R=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,W=/^[;\s]*/,z=/^\s+|\s+$/g,F="";function q(t){return t?t.replace(z,F):F}var J=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var r,s,a=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function r(t){var e=t.match(P);e&&(n+=e.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function s(){var t={line:n,column:o};return function(e){return e.position=new a(t),l(),e}}function a(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function i(r){var s=new Error(e.source+":"+n+":"+o+": "+r);if(s.reason=r,s.filename=e.source,s.line=n,s.column=o,s.source=t,!e.silent)throw s}function c(e){var n=e.exec(t);if(n){var o=n[0];return r(o),t=t.slice(o.length),n}}function l(){c(M)}function u(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=s();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;F!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,F===t.charAt(n-1))return i("End of comment missing");var a=t.slice(2,n-2);return o+=2,r(a),t=t.slice(n),o+=2,e({type:"comment",comment:a})}}function f(){var t=s(),e=c(B);if(e){if(d(),!c(H))return i("property missing ':'");var n=c(R),o=t({type:"declaration",property:q(e[0].replace(O,F)),value:n?q(n[0].replace(O,F)):F});return c(W),o}}return a.prototype.content=t,l(),function(){var t,e=[];for(u(e);t=f();)!1!==t&&(e.push(t),u(e));return e}()}(t),i="function"==typeof e,c=0,l=a.length;c<l;c++)r=(n=a[c]).property,s=n.value,i?e(r,s,n):s&&(o||(o={}),o[r]=s);return o};var K,V=(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var s=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},a=0,i=Object.keys(t);a<i.length;a++)s(i[a]);return r},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var r=document.createElement("script");r.id=n+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,s="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(s=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),s},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var s="",a=t.getDefaultLang();if(!o||a!==o){var i=null==n?void 0:n[a];(null==i?void 0:i[e])&&(s=i[e])}return s},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n}(K={exports:{}},K.exports),K.exports),Y=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,s=e.length;r<s;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},G={vars:[],parts:[{name:"testpart",description:"test css part on 2 div tag"}]};Y(Y([],[{id:"1",text:"Hello",timestamp:new Date(Date.now()-36e3),type:"text",status:"sent",authorId:"1"},{id:"2",text:"Hi",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"}],!0),[{id:"3",text:"How are you?",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"4",text:"I'm fine, thanks",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"5",text:"What about you?",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"6",text:"I'm fine too, thanks for asking",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"7",text:"You're welcome",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"8",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"9",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"10",text:"See you later",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"11",text:"See you later",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"12",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"13",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"}],!1);var Q={vars:[],parts:[{name:"testpart",description:"test css part on 2 div tag"}]};function U(t){let e,n,o,r,s,p,h;return{c(){e=l("div"),n=l("hb-messages-list"),o=u(),r=l("div"),s=l("hb-messages-send"),f(n,"messages",t[0]),f(n,"authors",t[1]),f(n,"options",t[2]),f(n,"style",t[4]),f(n,"class","msglist"),f(n,"part","msglist"),d(e,"id","message-list"),f(s,"text",t[3]),f(s,"part","msgsend"),f(s,"class","msgsend"),f(s,"style",t[5]),d(r,"id","prompt")},m(c,l){var u,d,f,m;i(c,e,l),a(e,n),i(c,o,l),i(c,r,l),a(r,s),p||(u=s,d="sendMessage",f=t[11],u.addEventListener(d,f,m),h=()=>u.removeEventListener(d,f,m),p=!0)},p(t,e){1&e&&f(n,"messages",t[0]),2&e&&f(n,"authors",t[1]),4&e&&f(n,"options",t[2]),16&e&&f(n,"style",t[4]),8&e&&f(s,"text",t[3]),32&e&&f(s,"style",t[5])},d(t){t&&c(e),t&&c(o),t&&c(r),p=!1,h()}}}function X(e){let n,o=e[1]?.length&&e[0]?.length&&U(e);return{c(){n=l("div"),o&&o.c(),this.c=t,d(n,"id","container")},m(t,e){i(t,n,e),o&&o.m(n,null)},p(t,[e]){t[1]?.length&&t[0]?.length?o?o.p(t,e):(o=U(t),o.c(),o.m(n,null)):o&&(o.d(1),o=null)},i:t,o:t,d(t){t&&c(n),o&&o.d()}}}function Z(t,e,n){const o=g(),r=v();let s,a,{id:i}=e,{style:c}=e,{messages:l}=e,{authors:u}=e,{options:d}=e,{message:f}=e,p="",h="";function m(t){if(!t.file&&!t.text)return console.warn("no message to received",t);!function(t,e){r(t,e),o.dispatchEvent&&o.dispatchEvent(new CustomEvent(t,{detail:e}))}("sendMessage",t),n(3,a=t.text),n(3,a="")}V.addComponent({repoName:"@htmlbricks/hb-messages-list",version:j}),V.addComponent({repoName:"@htmlbricks/hb-messages-send",version:j});return t.$$set=t=>{"id"in t&&n(7,i=t.id),"style"in t&&n(9,c=t.style),"messages"in t&&n(0,l=t.messages),"authors"in t&&n(1,u=t.authors),"options"in t&&n(2,d=t.options),"message"in t&&n(8,f=t.message)},t.$$.update=()=>{if(1928&t.$$.dirty){if(i||n(7,i=""),c&&(n(10,s=J(c)),n(4,p=V.getChildStyleToPass(s,null==G?void 0:G.vars)),n(5,h=V.getChildStyleToPass(s,null==Q?void 0:Q.vars))),"string"==typeof f)try{n(8,f=JSON.parse(f))}catch(t){console.error("error parsing message",t)}f||n(8,f={text:""}),a||""===a||n(3,a=(null==f?void 0:f.text)?f.text:"")}},[l,u,d,a,p,h,m,i,f,c,s,t=>m(t.detail)]}class tt extends S{constructor(t){super();const e=document.createElement("style");e.textContent='@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{font-family:"Roboto", sans-serif}#container{display:flex;flex-direction:column;height:100vh}#message-list{flex:1;overflow-y:auto;margin-bottom:200px}#prompt{height:100px;background-color:red;position:fixed;bottom:0;width:100%;z-index:100}.msgsend{background-color:red;display:block}',this.shadowRoot.appendChild(e),T(this,{target:this.shadowRoot,props:p(this.attributes),customElement:!0},Z,X,s,{id:7,style:9,messages:0,authors:1,options:2,message:8},null),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),C()))}static get observedAttributes(){return["id","style","messages","authors","options","message"]}get id(){return this.$$.ctx[7]}set id(t){this.$$set({id:t}),C()}get style(){return this.$$.ctx[9]}set style(t){this.$$set({style:t}),C()}get messages(){return this.$$.ctx[0]}set messages(t){this.$$set({messages:t}),C()}get authors(){return this.$$.ctx[1]}set authors(t){this.$$set({authors:t}),C()}get options(){return this.$$.ctx[2]}set options(t){this.$$set({options:t}),C()}get message(){return this.$$.ctx[8]}set message(t){this.$$set({message:t}),C()}}return customElements.define("hb-messages-box",tt),tt}();
|
|
1
|
+
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode&&t.parentNode.removeChild(t)}function l(t){return document.createElement(t)}function u(){return t=" ",document.createTextNode(t);var t}function d(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function f(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:d(t,e,n)}function p(t){const e={};for(const n of t)e[n.name]=n.value;return e}let h;function m(t){h=t}function g(){if(!h)throw new Error("Function called outside component initialization");return h}function v(){const t=g();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const s=function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(e,n,{cancelable:o});return r.slice().forEach((e=>{e.call(t,s)})),!s.defaultPrevented}return!0}}const y=[],$=[];let w=[];const x=[],b=Promise.resolve();let D=!1;function E(t){w.push(t)}const _=new Set;let k=0;function C(){if(0!==k)return;const t=h;do{try{for(;k<y.length;){const t=y[k];k++,m(t),I(t.$$)}}catch(t){throw y.length=0,k=0,t}for(m(null),y.length=0,k=0;$.length;)$.pop()();for(let t=0;t<w.length;t+=1){const e=w[t];_.has(e)||(_.add(e),e())}w.length=0}while(y.length);for(;x.length;)x.pop()();D=!1,_.clear(),m(t)}function I(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(E)}}const L=new Set;function A(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];w.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),w=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function N(t,e){-1===t.$$.dirty[0]&&(y.push(t),D||(D=!0,b.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function T(s,a,i,l,u,d,f,p=[-1]){const g=h;m(s);const v=s.$$={fragment:null,ctx:[],props:d,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(g?g.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:a.target||g.$$.root};f&&f(v.root);let y=!1;if(v.ctx=i?i(s,a.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return v.ctx&&u(v.ctx[t],v.ctx[t]=o)&&(!v.skip_bound&&v.bound[t]&&v.bound[t](o),y&&N(s,t)),e})):[],v.update(),y=!0,o(v.before_update),v.fragment=!!l&&l(v.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);v.fragment&&v.fragment.l(t),t.forEach(c)}else v.fragment&&v.fragment.c();a.intro&&(($=s.$$.fragment)&&$.i&&(L.delete($),$.i(w))),function(t,n,s,a){const{fragment:i,after_update:c}=t.$$;i&&i.m(n,s),a||E((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),c.forEach(E)}(s,a.target,a.anchor,a.customElement),C()}var $,w;m(g)}let S;"function"==typeof HTMLElement&&(S=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){A(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var j="0.20.12",O=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,P=/\n/g,M=/^\s*/,B=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H=/^:\s*/,R=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,W=/^[;\s]*/,z=/^\s+|\s+$/g,F="";function q(t){return t?t.replace(z,F):F}var J=function(t,e){var n,o=null;if(!t||"string"!=typeof t)return o;for(var r,s,a=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,o=1;function r(t){var e=t.match(P);e&&(n+=e.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function s(){var t={line:n,column:o};return function(e){return e.position=new a(t),l(),e}}function a(t){this.start=t,this.end={line:n,column:o},this.source=e.source}function i(r){var s=new Error(e.source+":"+n+":"+o+": "+r);if(s.reason=r,s.filename=e.source,s.line=n,s.column=o,s.source=t,!e.silent)throw s}function c(e){var n=e.exec(t);if(n){var o=n[0];return r(o),t=t.slice(o.length),n}}function l(){c(M)}function u(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=s();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;F!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,F===t.charAt(n-1))return i("End of comment missing");var a=t.slice(2,n-2);return o+=2,r(a),t=t.slice(n),o+=2,e({type:"comment",comment:a})}}function f(){var t=s(),e=c(B);if(e){if(d(),!c(H))return i("property missing ':'");var n=c(R),o=t({type:"declaration",property:q(e[0].replace(O,F)),value:n?q(n[0].replace(O,F)):F});return c(W),o}}return a.prototype.content=t,l(),function(){var t,e=[];for(u(e);t=f();)!1!==t&&(e.push(t),u(e));return e}()}(t),i="function"==typeof e,c=0,l=a.length;c<l;c++)r=(n=a[c]).property,s=n.value,i?e(r,s,n):s&&(o||(o={}),o[r]=s);return o};var K,V=(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var s=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},a=0,i=Object.keys(t);a<i.length;a++)s(i[a]);return r},e.addComponent=function(t){var e,n=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!n)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(n+"-script"))try{var r=document.createElement("script");r.id=n+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,s="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(s=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),s},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var s="",a=t.getDefaultLang();if(!o||a!==o){var i=null==n?void 0:n[a];(null==i?void 0:i[e])&&(s=i[e])}return s},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n}(K={exports:{}},K.exports),K.exports),Y=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,s=e.length;r<s;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},G={vars:[],parts:[{name:"testpart",description:"test css part on 2 div tag"}]};Y(Y([],[{id:"1",text:"Hello",timestamp:new Date(Date.now()-36e3),type:"text",status:"sent",authorId:"1"},{id:"2",text:"Hi",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"}],!0),[{id:"3",text:"How are you?",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"4",text:"I'm fine, thanks",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"5",text:"What about you?",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"6",text:"I'm fine too, thanks for asking",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"7",text:"You're welcome",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"8",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"9",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"10",text:"See you later",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"11",text:"See you later",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"},{id:"12",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"sent",authorId:"1"},{id:"13",text:"Bye",timestamp:new Date(Date.now()),type:"text",status:"received",authorId:"2"}],!1);var Q={vars:[],parts:[{name:"testpart",description:"test css part on 2 div tag"}]};function U(t){let e,n,o,r,s,p,h;return{c(){e=l("div"),n=l("hb-messages-list"),o=u(),r=l("div"),s=l("hb-messages-send"),f(n,"messages",t[0]),f(n,"authors",t[1]),f(n,"options",t[2]),f(n,"style",t[4]),f(n,"class","msglist"),f(n,"part","msglist"),d(e,"id","message-list"),f(s,"text",t[3]),f(s,"part","msgsend"),f(s,"class","msgsend"),f(s,"style",t[5]),d(r,"id","prompt")},m(c,l){var u,d,f,m;i(c,e,l),a(e,n),i(c,o,l),i(c,r,l),a(r,s),p||(u=s,d="sendMessage",f=t[11],u.addEventListener(d,f,m),h=()=>u.removeEventListener(d,f,m),p=!0)},p(t,e){1&e&&f(n,"messages",t[0]),2&e&&f(n,"authors",t[1]),4&e&&f(n,"options",t[2]),16&e&&f(n,"style",t[4]),8&e&&f(s,"text",t[3]),32&e&&f(s,"style",t[5])},d(t){t&&c(e),t&&c(o),t&&c(r),p=!1,h()}}}function X(e){let n,o=e[1]?.length&&e[0]?.length&&U(e);return{c(){n=l("div"),o&&o.c(),this.c=t,d(n,"id","container")},m(t,e){i(t,n,e),o&&o.m(n,null)},p(t,[e]){t[1]?.length&&t[0]?.length?o?o.p(t,e):(o=U(t),o.c(),o.m(n,null)):o&&(o.d(1),o=null)},i:t,o:t,d(t){t&&c(n),o&&o.d()}}}function Z(t,e,n){const o=g(),r=v();let s,a,{id:i}=e,{style:c}=e,{messages:l}=e,{authors:u}=e,{options:d}=e,{message:f}=e,p="",h="";function m(t){if(!t.file&&!t.text)return console.warn("no message to received",t);!function(t,e){r(t,e),o.dispatchEvent&&o.dispatchEvent(new CustomEvent(t,{detail:e}))}("sendMessage",t),n(3,a=t.text),n(3,a="")}V.addComponent({repoName:"@htmlbricks/hb-messages-list",version:j}),V.addComponent({repoName:"@htmlbricks/hb-messages-send",version:j});return t.$$set=t=>{"id"in t&&n(7,i=t.id),"style"in t&&n(9,c=t.style),"messages"in t&&n(0,l=t.messages),"authors"in t&&n(1,u=t.authors),"options"in t&&n(2,d=t.options),"message"in t&&n(8,f=t.message)},t.$$.update=()=>{if(1928&t.$$.dirty){if(i||n(7,i=""),c&&(n(10,s=J(c)),n(4,p=V.getChildStyleToPass(s,null==G?void 0:G.vars)),n(5,h=V.getChildStyleToPass(s,null==Q?void 0:Q.vars))),"string"==typeof f)try{n(8,f=JSON.parse(f))}catch(t){console.error("error parsing message",t)}f||n(8,f={text:""}),a||""===a||n(3,a=(null==f?void 0:f.text)?f.text:"")}},[l,u,d,a,p,h,m,i,f,c,s,t=>m(t.detail)]}class tt extends S{constructor(t){super();const e=document.createElement("style");e.textContent='@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@latest/font/bootstrap-icons.css");:host{font-family:"Roboto", sans-serif}#container{display:flex;flex-direction:column;height:100vh}#message-list{flex:1;overflow-y:auto;margin-bottom:200px}#prompt{height:100px;background-color:red;position:fixed;bottom:0;width:100%;z-index:100}.msgsend{background-color:red;display:block}',this.shadowRoot.appendChild(e),T(this,{target:this.shadowRoot,props:p(this.attributes),customElement:!0},Z,X,s,{id:7,style:9,messages:0,authors:1,options:2,message:8},null),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),C()))}static get observedAttributes(){return["id","style","messages","authors","options","message"]}get id(){return this.$$.ctx[7]}set id(t){this.$$set({id:t}),C()}get style(){return this.$$.ctx[9]}set style(t){this.$$set({style:t}),C()}get messages(){return this.$$.ctx[0]}set messages(t){this.$$set({messages:t}),C()}get authors(){return this.$$.ctx[1]}set authors(t){this.$$set({authors:t}),C()}get options(){return this.$$.ctx[2]}set options(t){this.$$set({options:t}),C()}get message(){return this.$$.ctx[8]}set message(t){this.$$set({message:t}),C()}}return customElements.define("hb-messages-box",tt),tt}();
|
|
2
2
|
//# sourceMappingURL=release.js.map
|