ablok-components 0.3.124 → 0.3.125
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/ablok-components.css +1 -1
- package/dist/ablok-components.umd.js +1 -1
- package/dist/components/molecules/link-sharing/link-sharing.vue.d.ts +2 -0
- package/dist/components/molecules/link-sharing/link-sharing.vue_vue_type_script_setup_true_lang.js +40 -19
- package/dist/i18n.d.ts +1 -0
- package/dist/locales/en.d.ts +1 -0
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
|
|
|
44
44
|
mailto: boolean;
|
|
45
45
|
clipboard: boolean;
|
|
46
46
|
bluesky: boolean;
|
|
47
|
+
os: boolean;
|
|
47
48
|
};
|
|
48
49
|
};
|
|
49
50
|
}>, {}, {}, {}, {}, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').PublicProps, Readonly<import('../../../../vue/dist/vue.esm-bundler.js').ExtractPropTypes<{
|
|
@@ -89,6 +90,7 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
|
|
|
89
90
|
mailto: boolean;
|
|
90
91
|
clipboard: boolean;
|
|
91
92
|
bluesky: boolean;
|
|
93
|
+
os: boolean;
|
|
92
94
|
};
|
|
93
95
|
};
|
|
94
96
|
}>> & Readonly<{}>, {
|
package/dist/components/molecules/link-sharing/link-sharing.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -26,9 +26,12 @@ var f = { class: "link-sharing" }, p = {
|
|
|
26
26
|
key: 6,
|
|
27
27
|
class: "col-12 col-md-6"
|
|
28
28
|
}, M = ["href"], N = { class: "caption" }, P = {
|
|
29
|
+
key: 7,
|
|
30
|
+
class: "col-12 col-md-6"
|
|
31
|
+
}, F = { class: "caption" }, I = {
|
|
29
32
|
key: 1,
|
|
30
33
|
class: "link-sharing__instructions pt-5"
|
|
31
|
-
},
|
|
34
|
+
}, L = { class: "row" }, R = { class: "col-12 text-center py-0" }, z = { class: "mb-5" }, B = (e) => e.replace(/<(?:.|\n)*?>/gm, ""), V = /*@__PURE__*/ s({
|
|
32
35
|
__name: "link-sharing",
|
|
33
36
|
props: {
|
|
34
37
|
url: {
|
|
@@ -57,69 +60,87 @@ var f = { class: "link-sharing" }, p = {
|
|
|
57
60
|
whatsapp: !0,
|
|
58
61
|
mailto: !0,
|
|
59
62
|
clipboard: !0,
|
|
60
|
-
bluesky: !0
|
|
63
|
+
bluesky: !0,
|
|
64
|
+
os: !0
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
67
|
},
|
|
64
68
|
setup(s) {
|
|
65
|
-
let
|
|
66
|
-
t(() => encodeURIComponent(
|
|
67
|
-
let
|
|
68
|
-
async function
|
|
69
|
+
let V = s, H = l(!1), U = t(() => encodeURIComponent(V.url));
|
|
70
|
+
t(() => encodeURIComponent(V.media));
|
|
71
|
+
let W = t(() => B(V.text)), G = t(() => !!(navigator && navigator.userAgent && /Mobi|Android/i.test(navigator.userAgent))), K = t(() => !!(navigator && navigator.canShare));
|
|
72
|
+
async function q() {
|
|
69
73
|
let e = document.createElement("textarea");
|
|
70
|
-
document.body.appendChild(e), e.value =
|
|
74
|
+
document.body.appendChild(e), e.value = V.url, e.select(), e.setSelectionRange(0, 99999), navigator.clipboard.writeText(e.value), document.body.removeChild(e);
|
|
75
|
+
}
|
|
76
|
+
async function J() {
|
|
77
|
+
if (K.value) {
|
|
78
|
+
let e = {
|
|
79
|
+
title: V.subject,
|
|
80
|
+
text: W.value,
|
|
81
|
+
url: V.url
|
|
82
|
+
};
|
|
83
|
+
await navigator.canShare(e) && await navigator.share(e).catch((e) => {
|
|
84
|
+
console.log("shareError", e);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
71
87
|
}
|
|
72
|
-
return (t, l) => (c(), r("div", f, [
|
|
88
|
+
return (t, l) => (c(), r("div", f, [H.value ? (c(), r("div", I, [i("div", L, [i("div", R, [i("div", z, [
|
|
73
89
|
i("p", null, u(t.$t("sharing.instructions", { service: "Instagram" })), 1),
|
|
74
90
|
i("p", null, [i("strong", null, u(Array.isArray(s.hashtags) ? s.hashtags.join(", ") : s.hashtags), 1)]),
|
|
75
91
|
i("button", {
|
|
76
92
|
type: "button",
|
|
77
93
|
class: "btn btn-text",
|
|
78
|
-
onClick: l[1] ||= d((e) =>
|
|
94
|
+
onClick: l[1] ||= d((e) => H.value = !H.value, ["prevent"])
|
|
79
95
|
}, [o(e, { symbol: "arrow-left" }), a(" " + u(t.$t("common.back")), 1)])
|
|
80
96
|
])])])])) : (c(), r("div", p, [i("div", m, [
|
|
81
97
|
s.services.facebook ? (c(), r("div", h, [i("a", {
|
|
82
98
|
class: "link-sharing__link btn btn-primary",
|
|
83
|
-
href: `https://www.facebook.com/sharer/sharer.php?u=${
|
|
99
|
+
href: `https://www.facebook.com/sharer/sharer.php?u=${U.value}`,
|
|
84
100
|
target: "_blank",
|
|
85
101
|
rel: "noopener"
|
|
86
102
|
}, [o(e, { symbol: "facebook" }), i("span", _, u(t.$t("sharing.facebook")), 1)], 8, g)])) : n("", !0),
|
|
87
103
|
s.services.bluesky ? (c(), r("div", v, [i("a", {
|
|
88
104
|
class: "link-sharing__link btn btn-primary",
|
|
89
|
-
href: `https://bsky.app/intent/compose?text=${
|
|
105
|
+
href: `https://bsky.app/intent/compose?text=${W.value}${W.value ? "%20" : ""}${s.url}`,
|
|
90
106
|
target: "_blank",
|
|
91
107
|
rel: "noopener"
|
|
92
108
|
}, [o(e, { symbol: "bluesky-logo" }), i("span", b, u(t.$t("sharing.bluesky")), 1)], 8, y)])) : n("", !0),
|
|
93
109
|
s.services.instagram ? (c(), r("div", x, [i("button", {
|
|
94
110
|
type: "button",
|
|
95
111
|
class: "link-sharing__link btn btn-primary",
|
|
96
|
-
onClick: l[0] ||= d((e) =>
|
|
112
|
+
onClick: l[0] ||= d((e) => H.value = !H.value, ["prevent"])
|
|
97
113
|
}, [o(e, { symbol: "instagram" }), i("span", S, u(t.$t("sharing.instagram")), 1)])])) : n("", !0),
|
|
98
114
|
s.services.linkedin ? (c(), r("div", C, [i("a", {
|
|
99
115
|
class: "link-sharing__link btn btn-primary",
|
|
100
|
-
href: `https://www.linkedin.com/shareArticle?mini=true&url=${
|
|
116
|
+
href: `https://www.linkedin.com/shareArticle?mini=true&url=${U.value}&title=${s.subject}`,
|
|
101
117
|
target: "_blank",
|
|
102
118
|
rel: "noopener"
|
|
103
119
|
}, [o(e, { symbol: "linkedin" }), i("span", T, u(t.$t("sharing.linkedin")), 1)], 8, w)])) : n("", !0),
|
|
104
|
-
s.services.whatsapp &&
|
|
120
|
+
s.services.whatsapp && G.value ? (c(), r("div", E, [i("a", {
|
|
105
121
|
class: "link-sharing__link btn btn-primary",
|
|
106
|
-
href: `whatsapp://send?text=${
|
|
122
|
+
href: `whatsapp://send?text=${U.value}`,
|
|
107
123
|
target: "_blank",
|
|
108
124
|
rel: "noopener"
|
|
109
125
|
}, [o(e, { symbol: "whatsapp" }), i("span", O, u(t.$t("sharing.whatsapp")), 1)], 8, D)])) : n("", !0),
|
|
110
126
|
s.services.clipboard ? (c(), r("div", k, [i("button", {
|
|
111
127
|
type: "button",
|
|
112
128
|
class: "link-sharing__link btn btn-primary",
|
|
113
|
-
onClick: d(
|
|
129
|
+
onClick: d(q, ["prevent", "stop"])
|
|
114
130
|
}, [o(e, { symbol: "copy" }), i("span", A, u(t.$t("sharing.clipboard")), 1)])])) : n("", !0),
|
|
115
131
|
s.services.mailto ? (c(), r("div", j, [i("a", {
|
|
116
132
|
class: "link-sharing__link btn btn-primary",
|
|
117
|
-
href: `mailto:?subject=${s.subject}&body=${
|
|
133
|
+
href: `mailto:?subject=${s.subject}&body=${W.value}%0D%0A${s.url}`,
|
|
118
134
|
target: "_blank",
|
|
119
135
|
rel: "noopener"
|
|
120
|
-
}, [o(e, { symbol: "mail" }), i("span", N, u(t.$t("sharing.mailto")), 1)], 8, M)])) : n("", !0)
|
|
136
|
+
}, [o(e, { symbol: "mail" }), i("span", N, u(t.$t("sharing.mailto")), 1)], 8, M)])) : n("", !0),
|
|
137
|
+
s.services.os && K.value ? (c(), r("div", P, [i("button", {
|
|
138
|
+
type: "button",
|
|
139
|
+
class: "link-sharing__link btn btn-primary",
|
|
140
|
+
onClick: d(J, ["prevent"])
|
|
141
|
+
}, [o(e, { symbol: "share" }), i("span", F, u(t.$t("sharing.os")), 1)])])) : n("", !0)
|
|
121
142
|
])]))]));
|
|
122
143
|
}
|
|
123
144
|
});
|
|
124
145
|
//#endregion
|
|
125
|
-
export {
|
|
146
|
+
export { V as default, B as stripHtml };
|
package/dist/i18n.d.ts
CHANGED
package/dist/locales/en.d.ts
CHANGED