hr-design-system-handlebars 1.114.15 → 1.114.16

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/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v1.114.16 (Tue Nov 19 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Seo/optimize copy to clipboard [#1162](https://github.com/mumprod/hr-design-system-handlebars/pull/1162) ([@vascoeduardo](https://github.com/vascoeduardo) [@eduardo-hr](https://github.com/eduardo-hr))
6
+
7
+ #### Authors: 2
8
+
9
+ - [@eduardo-hr](https://github.com/eduardo-hr)
10
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
11
+
12
+ ---
13
+
1
14
  # v1.114.15 (Tue Nov 19 2024)
2
15
 
3
16
  #### 🐛 Bug Fix
@@ -162,8 +162,8 @@
162
162
  "ext_service_datapolicy_accept_permanently_text": "Externe Inhalte von <b>{0}</b> zukünftig immer anzeigen.",
163
163
  "ext_service_datapolicy_accept_button_text": "Inhalt anzeigen",
164
164
  "ext_service_datapolicy_headline": "Externen Inhalt von {0} anzeigen?",
165
- "ext_service_datapolicy_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Beim Laden des Inhalts werden Daten an den Anbieter und ggf. weitere Dritte übertragen. Nähere Informationen erhältst du in unseren ",
166
- "ext_service_datapolicy_no_js_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Da du in deinem Browser Javascript deaktiviert hast, kann dieser hier nicht angezeigt werden. Der nachfolgende Link öffnet den Inhalt auf der Seite des Anbieters.",
165
+ "ext_service_datapolicy_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Beim Laden des Inhalts werden Daten an den Anbieter und ggf. weitere Dritte übertragen. Nähere Informationen erhalten Sie in unseren ",
166
+ "ext_service_datapolicy_no_js_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Da Sie in Ihrem Browser Javascript deaktiviert haben, kann dieser hier nicht angezeigt werden. Der nachfolgende Link öffnet den Inhalt auf der Seite des Anbieters.",
167
167
  "ext_service_datapolicy_no_js_link": "{0}-Inhalt öffnen",
168
168
  "story_infobox_intro_sr": "Weitere Informationen",
169
169
  "story_infobox_outro_sr": "Ende der weiteren Informationen",
@@ -3678,7 +3678,7 @@ article.indexTextDS .indexTextHighlighted .link {
3678
3678
  border-bottom-color: var(--color-secondary-ds);
3679
3679
  }
3680
3680
  .counter-reset {
3681
- counter-reset: cnt1732025534722;
3681
+ counter-reset: cnt1732026418051;
3682
3682
  }
3683
3683
  .placeholder-text-xs::-webkit-input-placeholder {
3684
3684
  font-size: 0.75rem;
@@ -4092,7 +4092,7 @@ article.indexTextDS .indexTextHighlighted .link {
4092
4092
  --tw-ring-color: rgba(255, 255, 255, 0.5);
4093
4093
  }
4094
4094
  .-ordered {
4095
- counter-increment: cnt1732025534722 1;
4095
+ counter-increment: cnt1732026418051 1;
4096
4096
  }
4097
4097
  .-ordered::before {
4098
4098
  position: absolute;
@@ -4110,7 +4110,7 @@ article.indexTextDS .indexTextHighlighted .link {
4110
4110
  --tw-text-opacity: 1;
4111
4111
  color: rgba(0, 0, 0, 1);
4112
4112
  color: rgba(0, 0, 0, var(--tw-text-opacity));
4113
- content: counter(cnt1732025534722);
4113
+ content: counter(cnt1732026418051);
4114
4114
  }
4115
4115
  /*! ****************************/
4116
4116
  /*! DataPolicy stuff */
@@ -6,6 +6,7 @@ export default (module) => ({
6
6
  isDesktop: true,
7
7
  sharingModuleWasNeverShown: true,
8
8
  desktopSharingModuleWasNeverShown: true,
9
+ copySuccess: false,
9
10
  toggle() {
10
11
 
11
12
  var isMobileApple = /^iP/.test(navigator.platform) || /^Mac/.test(navigator.platform) && navigator.maxTouchPoints > 4;
@@ -51,6 +52,21 @@ export default (module) => ({
51
52
  uxAction('socialShareClick::'+module+'Desktop::shown');
52
53
  this.desktopSharingModuleWasNeverShown = false;
53
54
  }
55
+ },
56
+ copyToClipboard(url) {
57
+
58
+ navigator.clipboard
59
+ .writeText(url)
60
+ .then(() => {
61
+ console.log("successfully copied");
62
+ this.copySuccess = true
63
+ window.setTimeout(() => {
64
+ this.copySuccess = false
65
+ }, 2000)
66
+ })
67
+ .catch(() => {
68
+ console.log("something went wrong with copy");
69
+ });
54
70
  }
55
71
 
56
72
  })
@@ -1,6 +1,8 @@
1
1
  {{~#with this.copyToClipboardLink}}
2
- <li x-data="copyHandler()" x-on:click="copyToClipboard" class="relative">
3
- <button class="{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
2
+ <li class="relative">
3
+ <button
4
+ x-on:click="copyToClipboard('{{this}}')"
5
+ class="{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
4
6
  title="{{loca "share_copy_linktitle" }}"
5
7
  data-url="{{this}}"
6
8
  {{#with ../_trackingData}}
@@ -14,30 +16,6 @@
14
16
  {{loca "share_copy_message" }}
15
17
  </div>
16
18
  </li>
17
- <script>
18
- function copyHandler(){
19
- return {
20
- copySuccess: false,
21
- copyToClipboard(event) {
22
- const clickedContainer = event.currentTarget.parentNode
23
- const url = clickedContainer.querySelector ("button:first-of-type").getAttribute('data-url');
24
- //TODO: maby do this with a magical helper in alpine
25
- navigator.clipboard
26
- .writeText(url)
27
- .then(() => {
28
- console.log("successfully copied");
29
- this.copySuccess = true
30
- window.setTimeout(() => {
31
- this.copySuccess = false
32
- }, 2000)
33
- })
34
- .catch(() => {
35
- console.log("something went wrong with copy");
36
- });
37
- }
38
- }
39
- }
40
- </script>
41
19
  {{/with}}
42
20
  {{~#with this.twitterLink ~}}
43
21
  <li>
@@ -1,6 +1,8 @@
1
1
  {{~#with this.copyToClipboardLink}}
2
- <li x-data="copyHandler()" x-on:click="copyToClipboard" class="relative">
3
- <button class="{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
2
+ <li class="relative">
3
+ <button
4
+ x-on:click="copyToClipboard('{{this}}')"
5
+ class="{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
4
6
  title="{{loca "share_copy_linktitle" }}"
5
7
  data-url="{{this}}"
6
8
  {{#with ../_trackingData}}
@@ -14,30 +16,6 @@
14
16
  {{loca "share_copy_message" }}
15
17
  </div>
16
18
  </li>
17
- <script>
18
- function copyHandler(){
19
- return {
20
- copySuccess: false,
21
- copyToClipboard(event) {
22
- const clickedContainer = event.currentTarget.parentNode
23
- const url = clickedContainer.querySelector ("button:first-of-type").getAttribute('data-url');
24
- //TODO: maby do this with a magical helper in alpine
25
- navigator.clipboard
26
- .writeText(url)
27
- .then(() => {
28
- console.log("successfully copied");
29
- this.copySuccess = true
30
- window.setTimeout(() => {
31
- this.copySuccess = false
32
- }, 2000)
33
- })
34
- .catch(() => {
35
- console.log("something went wrong with copy");
36
- });
37
- }
38
- }
39
- }
40
- </script>
41
19
  {{/with}}
42
20
  {{~#with this.twitterLink ~}}
43
21
  <li>
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
8
8
  "repository": "https://github.com/szuelch/hr-design-system-handlebars",
9
- "version": "1.114.15",
9
+ "version": "1.114.16",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "storybook dev -p 6006 public",
@@ -162,8 +162,8 @@
162
162
  "ext_service_datapolicy_accept_permanently_text": "Externe Inhalte von <b>{0}</b> zukünftig immer anzeigen.",
163
163
  "ext_service_datapolicy_accept_button_text": "Inhalt anzeigen",
164
164
  "ext_service_datapolicy_headline": "Externen Inhalt von {0} anzeigen?",
165
- "ext_service_datapolicy_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Beim Laden des Inhalts werden Daten an den Anbieter und ggf. weitere Dritte übertragen. Nähere Informationen erhältst du in unseren ",
166
- "ext_service_datapolicy_no_js_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Da du in deinem Browser Javascript deaktiviert hast, kann dieser hier nicht angezeigt werden. Der nachfolgende Link öffnet den Inhalt auf der Seite des Anbieters.",
165
+ "ext_service_datapolicy_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Beim Laden des Inhalts werden Daten an den Anbieter und ggf. weitere Dritte übertragen. Nähere Informationen erhalten Sie in unseren ",
166
+ "ext_service_datapolicy_no_js_text": "An dieser Stelle befindet sich ein von unserer Redaktion empfohlener Inhalt von <b>{0}</b>. Da Sie in Ihrem Browser Javascript deaktiviert haben, kann dieser hier nicht angezeigt werden. Der nachfolgende Link öffnet den Inhalt auf der Seite des Anbieters.",
167
167
  "ext_service_datapolicy_no_js_link": "{0}-Inhalt öffnen",
168
168
  "story_infobox_intro_sr": "Weitere Informationen",
169
169
  "story_infobox_outro_sr": "Ende der weiteren Informationen",
@@ -6,6 +6,7 @@ export default (module) => ({
6
6
  isDesktop: true,
7
7
  sharingModuleWasNeverShown: true,
8
8
  desktopSharingModuleWasNeverShown: true,
9
+ copySuccess: false,
9
10
  toggle() {
10
11
 
11
12
  var isMobileApple = /^iP/.test(navigator.platform) || /^Mac/.test(navigator.platform) && navigator.maxTouchPoints > 4;
@@ -51,6 +52,21 @@ export default (module) => ({
51
52
  uxAction('socialShareClick::'+module+'Desktop::shown');
52
53
  this.desktopSharingModuleWasNeverShown = false;
53
54
  }
55
+ },
56
+ copyToClipboard(url) {
57
+
58
+ navigator.clipboard
59
+ .writeText(url)
60
+ .then(() => {
61
+ console.log("successfully copied");
62
+ this.copySuccess = true
63
+ window.setTimeout(() => {
64
+ this.copySuccess = false
65
+ }, 2000)
66
+ })
67
+ .catch(() => {
68
+ console.log("something went wrong with copy");
69
+ });
54
70
  }
55
71
 
56
72
  })
@@ -1,6 +1,8 @@
1
1
  {{~#with this.copyToClipboardLink}}
2
- <li x-data="copyHandler()" x-on:click="copyToClipboard" class="relative">
3
- <button class="{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
2
+ <li class="relative">
3
+ <button
4
+ x-on:click="copyToClipboard('{{this}}')"
5
+ class="{{#with ../_trackingData}} js-load{{/with}} flex order-2 ds-button font-heading active:scale-95 w-8 h-8"
4
6
  title="{{loca "share_copy_linktitle" }}"
5
7
  data-url="{{this}}"
6
8
  {{#with ../_trackingData}}
@@ -14,30 +16,6 @@
14
16
  {{loca "share_copy_message" }}
15
17
  </div>
16
18
  </li>
17
- <script>
18
- function copyHandler(){
19
- return {
20
- copySuccess: false,
21
- copyToClipboard(event) {
22
- const clickedContainer = event.currentTarget.parentNode
23
- const url = clickedContainer.querySelector ("button:first-of-type").getAttribute('data-url');
24
- //TODO: maby do this with a magical helper in alpine
25
- navigator.clipboard
26
- .writeText(url)
27
- .then(() => {
28
- console.log("successfully copied");
29
- this.copySuccess = true
30
- window.setTimeout(() => {
31
- this.copySuccess = false
32
- }, 2000)
33
- })
34
- .catch(() => {
35
- console.log("something went wrong with copy");
36
- });
37
- }
38
- }
39
- }
40
- </script>
41
19
  {{/with}}
42
20
  {{~#with this.twitterLink ~}}
43
21
  <li>