@salla.sa/twilight-components 1.4.1 → 1.4.2
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/dist/cjs/salla-button_23.cjs.entry.js +17 -6
- package/dist/collection/components/salla-social-share/salla-social-share.js +23 -7
- package/dist/components/salla-social-share.js +17 -6
- package/dist/esm/salla-button_23.entry.js +17 -6
- package/dist/twilight-components/p-97363a29.entry.js +4 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-social-share/salla-social-share.d.ts +1 -2
- package/package.json +1 -1
- package/dist/twilight-components/p-f14b508a.entry.js +0 -4
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
7
7
|
|
|
8
8
|
const index$1 = require('./index-0d0167d5.js');
|
|
9
9
|
const Helper = require('./Helper-8ae6a805.js');
|
|
10
|
-
require('https://static.addtoany.com/menu/page.js');
|
|
11
10
|
|
|
12
11
|
const sallaButtonCss = "";
|
|
13
12
|
|
|
@@ -3115,15 +3114,27 @@ const SallaSocialShare = class {
|
|
|
3115
3114
|
this.platforms = this.allPlatforms;
|
|
3116
3115
|
}
|
|
3117
3116
|
componentWillLoad() {
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3117
|
+
let that = this;
|
|
3118
|
+
if (!document.getElementById('a2a-script')) {
|
|
3119
|
+
const script = document.createElement('script');
|
|
3120
|
+
script.src = 'https://static.addtoany.com/menu/page.js';
|
|
3121
|
+
script.setAttribute('id', 'a2a-script');
|
|
3122
|
+
script.onload = function () {
|
|
3123
|
+
// ? this will not work if there is one share component in the page
|
|
3124
|
+
window.a2a_config = window.a2a_config || {};
|
|
3125
|
+
window.a2a_config.linkurl = that.url ? that.url : window.location.href;
|
|
3126
|
+
window.a2a_config.linkname = that.urlName ? that.urlName : document.title;
|
|
3127
|
+
};
|
|
3128
|
+
document.body.appendChild(script);
|
|
3129
|
+
}
|
|
3130
|
+
else {
|
|
3131
|
+
return;
|
|
3132
|
+
}
|
|
3122
3133
|
salla.lang.onLoaded(() => {
|
|
3123
3134
|
window.a2a_config.locale = salla.lang.locale;
|
|
3124
3135
|
});
|
|
3125
3136
|
}
|
|
3126
|
-
open() {
|
|
3137
|
+
async open() {
|
|
3127
3138
|
this.opened = !this.opened;
|
|
3128
3139
|
if (this.opened) {
|
|
3129
3140
|
this.shareMenu.classList.add('opened');
|
|
@@ -8,7 +8,7 @@ import twitter from '../../assets/svg/twitter.svg';
|
|
|
8
8
|
import copy_link from '../../assets/svg/link.svg';
|
|
9
9
|
import email from '../../assets/svg/mail.svg';
|
|
10
10
|
import whatsapp from '../../assets/svg/whatsapp.svg';
|
|
11
|
-
|
|
11
|
+
// require("https://static.addtoany.com/menu/page.js");
|
|
12
12
|
import { Socials } from './interfaces';
|
|
13
13
|
export class SallaSocialShare {
|
|
14
14
|
constructor() {
|
|
@@ -29,15 +29,27 @@ export class SallaSocialShare {
|
|
|
29
29
|
this.platforms = this.allPlatforms;
|
|
30
30
|
}
|
|
31
31
|
componentWillLoad() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
let that = this;
|
|
33
|
+
if (!document.getElementById('a2a-script')) {
|
|
34
|
+
const script = document.createElement('script');
|
|
35
|
+
script.src = 'https://static.addtoany.com/menu/page.js';
|
|
36
|
+
script.setAttribute('id', 'a2a-script');
|
|
37
|
+
script.onload = function () {
|
|
38
|
+
// ? this will not work if there is one share component in the page
|
|
39
|
+
window.a2a_config = window.a2a_config || {};
|
|
40
|
+
window.a2a_config.linkurl = that.url ? that.url : window.location.href;
|
|
41
|
+
window.a2a_config.linkname = that.urlName ? that.urlName : document.title;
|
|
42
|
+
};
|
|
43
|
+
document.body.appendChild(script);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
36
48
|
salla.lang.onLoaded(() => {
|
|
37
49
|
window.a2a_config.locale = salla.lang.locale;
|
|
38
50
|
});
|
|
39
51
|
}
|
|
40
|
-
open() {
|
|
52
|
+
async open() {
|
|
41
53
|
this.opened = !this.opened;
|
|
42
54
|
if (this.opened) {
|
|
43
55
|
this.shareMenu.classList.add('opened');
|
|
@@ -153,7 +165,11 @@ export class SallaSocialShare {
|
|
|
153
165
|
"complexType": {
|
|
154
166
|
"signature": "() => Promise<void>",
|
|
155
167
|
"parameters": [],
|
|
156
|
-
"references": {
|
|
168
|
+
"references": {
|
|
169
|
+
"Promise": {
|
|
170
|
+
"location": "global"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
157
173
|
"return": "Promise<void>"
|
|
158
174
|
},
|
|
159
175
|
"docs": {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
|
-
import 'https://static.addtoany.com/menu/page.js';
|
|
6
5
|
import { d as defineCustomElement$2 } from './salla-button2.js';
|
|
7
6
|
|
|
8
7
|
/*
|
|
@@ -1380,15 +1379,27 @@ const SallaSocialShare$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
1380
1379
|
this.platforms = this.allPlatforms;
|
|
1381
1380
|
}
|
|
1382
1381
|
componentWillLoad() {
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1382
|
+
let that = this;
|
|
1383
|
+
if (!document.getElementById('a2a-script')) {
|
|
1384
|
+
const script = document.createElement('script');
|
|
1385
|
+
script.src = 'https://static.addtoany.com/menu/page.js';
|
|
1386
|
+
script.setAttribute('id', 'a2a-script');
|
|
1387
|
+
script.onload = function () {
|
|
1388
|
+
// ? this will not work if there is one share component in the page
|
|
1389
|
+
window.a2a_config = window.a2a_config || {};
|
|
1390
|
+
window.a2a_config.linkurl = that.url ? that.url : window.location.href;
|
|
1391
|
+
window.a2a_config.linkname = that.urlName ? that.urlName : document.title;
|
|
1392
|
+
};
|
|
1393
|
+
document.body.appendChild(script);
|
|
1394
|
+
}
|
|
1395
|
+
else {
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1387
1398
|
salla.lang.onLoaded(() => {
|
|
1388
1399
|
window.a2a_config.locale = salla.lang.locale;
|
|
1389
1400
|
});
|
|
1390
1401
|
}
|
|
1391
|
-
open() {
|
|
1402
|
+
async open() {
|
|
1392
1403
|
this.opened = !this.opened;
|
|
1393
1404
|
if (this.opened) {
|
|
1394
1405
|
this.shareMenu.classList.add('opened');
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-4e30ffd0.js';
|
|
5
5
|
import { H as Helper } from './Helper-e1d414a5.js';
|
|
6
|
-
import 'https://static.addtoany.com/menu/page.js';
|
|
7
6
|
|
|
8
7
|
const sallaButtonCss = "";
|
|
9
8
|
|
|
@@ -3111,15 +3110,27 @@ const SallaSocialShare = class {
|
|
|
3111
3110
|
this.platforms = this.allPlatforms;
|
|
3112
3111
|
}
|
|
3113
3112
|
componentWillLoad() {
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3113
|
+
let that = this;
|
|
3114
|
+
if (!document.getElementById('a2a-script')) {
|
|
3115
|
+
const script = document.createElement('script');
|
|
3116
|
+
script.src = 'https://static.addtoany.com/menu/page.js';
|
|
3117
|
+
script.setAttribute('id', 'a2a-script');
|
|
3118
|
+
script.onload = function () {
|
|
3119
|
+
// ? this will not work if there is one share component in the page
|
|
3120
|
+
window.a2a_config = window.a2a_config || {};
|
|
3121
|
+
window.a2a_config.linkurl = that.url ? that.url : window.location.href;
|
|
3122
|
+
window.a2a_config.linkname = that.urlName ? that.urlName : document.title;
|
|
3123
|
+
};
|
|
3124
|
+
document.body.appendChild(script);
|
|
3125
|
+
}
|
|
3126
|
+
else {
|
|
3127
|
+
return;
|
|
3128
|
+
}
|
|
3118
3129
|
salla.lang.onLoaded(() => {
|
|
3119
3130
|
window.a2a_config.locale = salla.lang.locale;
|
|
3120
3131
|
});
|
|
3121
3132
|
}
|
|
3122
|
-
open() {
|
|
3133
|
+
async open() {
|
|
3123
3134
|
this.opened = !this.opened;
|
|
3124
3135
|
if (this.opened) {
|
|
3125
3136
|
this.shareMenu.classList.add('opened');
|