@abi-software/map-utilities 1.0.1-beta.1 → 1.0.1-beta.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-utilities",
3
- "version": "1.0.1-beta.1",
3
+ "version": "1.0.1-beta.3",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -55,10 +55,23 @@ export default {
55
55
  this.autoHideTimeout = 600;
56
56
 
57
57
  try {
58
- await navigator.clipboard.writeText(this.content);
58
+ const htmlContent = this.content.replaceAll('\n', '');
59
+ const tempElement = document.createElement('div');
60
+ tempElement.innerHTML = this.content;
61
+ const plainTextContent = tempElement.textContent || tempElement.innerText || '';
62
+
63
+ const htmlBlob = new Blob([htmlContent], { type: 'text/html' });
64
+ const textBlob = new Blob([plainTextContent], { type: 'text/plain' });
65
+
66
+ const clipboardItem = new ClipboardItem({
67
+ 'text/html': htmlBlob,
68
+ 'text/plain': textBlob
69
+ });
70
+
71
+ await navigator.clipboard.write([clipboardItem]);
59
72
  } catch (err) {
60
73
  console.error(
61
- "Error when trying to use navigator.clipboard.writeText()",
74
+ "Error when trying to use navigator.clipboard.write()",
62
75
  err
63
76
  );
64
77
  copiedSuccessfully = false;
@@ -82,7 +95,7 @@ export default {
82
95
  .copy-clipboard-button {
83
96
  margin-left: 0px !important;
84
97
  margin-top: 0px !important;
85
- padding: 0.25rem;
98
+ padding: 0.25rem !important;
86
99
  font-size: 14px !important;
87
100
  transition: all 0.25s ease;
88
101
 
@@ -90,15 +103,16 @@ export default {
90
103
  &:focus,
91
104
  &:active {
92
105
  color: $app-primary-color !important;
93
- background: transparent;
106
+ background: transparent !important;
94
107
  border-color: transparent !important;
108
+ box-shadow: none !important;
95
109
  }
96
110
 
97
111
  &.light {
98
112
  &,
99
113
  &:focus,
100
114
  &:active {
101
- background: #fff;
115
+ background: #fff !important;
102
116
  border-color: #fff !important;
103
117
  }
104
118
  }