@cocreate/element-prototype 1.23.0 → 1.24.1
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 +20 -0
- package/docs/index.html +9 -23
- package/package.json +1 -1
- package/src/getValue.js +1 -1
- package/src/setValue.js +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [1.24.1](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.24.0...v1.24.1) (2024-06-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* type file uses storage ([6b0a434](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/6b0a43406a26312c1d500dc2fd17a097c33f74db))
|
|
7
|
+
|
|
8
|
+
# [1.24.0](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.23.0...v1.24.0) (2024-06-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump cocreate dependencies ([96ec548](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/96ec548571909ded9e59fdba8be52164538a6696))
|
|
14
|
+
* svg icon class ([549313d](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/549313d1b874189bb7a32660059943fce4177cdf))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* improved handling of valueType outerHtml ([de39d50](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/de39d502e2fcd1f910826433109c466184cc5b83))
|
|
20
|
+
|
|
1
21
|
# [1.23.0](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.22.3...v1.23.0) (2024-05-08)
|
|
2
22
|
|
|
3
23
|
|
package/docs/index.html
CHANGED
|
@@ -39,41 +39,31 @@
|
|
|
39
39
|
href="https://github.com/CoCreate-app/CoCreate-element-prototype"
|
|
40
40
|
target="_blank"
|
|
41
41
|
class="margin-right:15px"
|
|
42
|
-
><i
|
|
43
|
-
class="height:20px fill:#505050"
|
|
44
|
-
src="/assets/svg/github.svg"></i
|
|
42
|
+
><i src="/assets/svg/github.svg"></i
|
|
45
43
|
></a>
|
|
46
44
|
<a
|
|
47
45
|
class="margin-right:15px share"
|
|
48
46
|
share-network="twitter"
|
|
49
47
|
title="Share on twitter"
|
|
50
|
-
><i
|
|
51
|
-
class="height:20px fill:#505050"
|
|
52
|
-
src="/assets/svg/twitter.svg"></i
|
|
48
|
+
><i src="/assets/svg/twitter.svg"></i
|
|
53
49
|
></a>
|
|
54
50
|
<a
|
|
55
51
|
class="margin-right:15px share"
|
|
56
52
|
share-network="facebook"
|
|
57
53
|
title="Share on Facebook"
|
|
58
|
-
><i
|
|
59
|
-
class="height:20px fill:#505050"
|
|
60
|
-
src="/assets/svg/facebook.svg"></i
|
|
54
|
+
><i src="/assets/svg/facebook.svg"></i
|
|
61
55
|
></a>
|
|
62
56
|
<a
|
|
63
57
|
class="margin-right:15px share"
|
|
64
58
|
share-network="instagram"
|
|
65
59
|
title="Share on instagram"
|
|
66
|
-
><i
|
|
67
|
-
class="height:20px fill:#505050"
|
|
68
|
-
src="/assets/svg/instagram.svg"></i
|
|
60
|
+
><i src="/assets/svg/instagram.svg"></i
|
|
69
61
|
></a>
|
|
70
62
|
<a
|
|
71
63
|
class="margin-right:15px share"
|
|
72
64
|
share-network="share"
|
|
73
65
|
title="Share on share"
|
|
74
|
-
><i
|
|
75
|
-
class="height:20px fill:#505050"
|
|
76
|
-
src="/assets/svg/share-alt.svg"></i
|
|
66
|
+
><i src="/assets/svg/share-alt.svg"></i
|
|
77
67
|
></a>
|
|
78
68
|
</div>
|
|
79
69
|
</div>
|
|
@@ -196,7 +186,7 @@
|
|
|
196
186
|
toggle="code-height"
|
|
197
187
|
toggle-selector="#demo-code"
|
|
198
188
|
><i
|
|
199
|
-
class="height:18px
|
|
189
|
+
class="height:18px"
|
|
200
190
|
src="/assets/svg/eye.svg"></i
|
|
201
191
|
></a>
|
|
202
192
|
<a
|
|
@@ -207,18 +197,14 @@
|
|
|
207
197
|
hide="#eye-slash"
|
|
208
198
|
toggle="code-height"
|
|
209
199
|
toggle-selector="#demo-code"
|
|
210
|
-
><i
|
|
211
|
-
class="height:20px fill:#505050"
|
|
212
|
-
src="/assets/svg/eye-slash.svg"></i
|
|
200
|
+
><i src="/assets/svg/eye-slash.svg"></i
|
|
213
201
|
></a>
|
|
214
202
|
<a
|
|
215
203
|
class="margin-right:10px"
|
|
216
204
|
id="code"
|
|
217
205
|
show="#code-slash"
|
|
218
206
|
hide="#code, #demo-code"
|
|
219
|
-
><i
|
|
220
|
-
class="height:20px fill:#505050"
|
|
221
|
-
src="/assets/svg/code.svg"></i
|
|
207
|
+
><i src="/assets/svg/code.svg"></i
|
|
222
208
|
></a>
|
|
223
209
|
<a
|
|
224
210
|
class="margin-right:10px"
|
|
@@ -227,7 +213,7 @@
|
|
|
227
213
|
show="#code, #demo-code"
|
|
228
214
|
hide="#code-slash"
|
|
229
215
|
><i
|
|
230
|
-
class="
|
|
216
|
+
class="height:18px"
|
|
231
217
|
src="/assets/svg/code.svg"></i
|
|
232
218
|
></a>
|
|
233
219
|
<a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/element-prototype",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.1",
|
|
4
4
|
"description": "A simple element-prototype component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"element-prototype",
|
package/src/getValue.js
CHANGED
|
@@ -18,7 +18,7 @@ HTMLHeadingElement.prototype.getValue = function () {
|
|
|
18
18
|
// TODO: check if using a a switch case will provide better performance
|
|
19
19
|
const getValue = (element) => {
|
|
20
20
|
let value = element.value || element.getAttribute('value') || "";
|
|
21
|
-
if (element.hasAttribute('component') || element.hasAttribute('plugin')) {
|
|
21
|
+
if (element.hasAttribute('component') || element.hasAttribute('plugin') || element.type === 'file' || element.getAttribute('type') === 'file') {
|
|
22
22
|
value = storage.get(element)
|
|
23
23
|
storage.delete(element)
|
|
24
24
|
return value
|
package/src/setValue.js
CHANGED
|
@@ -116,10 +116,13 @@ const setValue = (el, value, dispatch) => {
|
|
|
116
116
|
if (valueType == 'outerHTML') {
|
|
117
117
|
let parentNode = el.parentNode;
|
|
118
118
|
if (parentNode) {
|
|
119
|
-
if (newElement.children
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
if (newElement.children.length > 0) {
|
|
120
|
+
let fragment = document.createDocumentFragment();
|
|
121
|
+
while (newElement.firstChild) {
|
|
122
|
+
fragment.appendChild(newElement.firstChild);
|
|
123
|
+
}
|
|
124
|
+
parentNode.replaceChild(fragment, el);
|
|
125
|
+
} else {
|
|
123
126
|
parentNode.replaceChild(newElement, el);
|
|
124
127
|
}
|
|
125
128
|
}
|