@cocreate/local-storage 1.6.5 → 1.6.7
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 +18 -0
- package/docs/index.html +15 -15
- package/package.json +3 -2
- package/src/index.js +14 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [1.6.7](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.6.6...v1.6.7) (2023-05-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* replace fontawesome with svg ([0e1d370](https://github.com/CoCreate-app/CoCreate-local-storage/commit/0e1d370ab8a6199231454aff231abd747d753e07))
|
|
7
|
+
|
|
8
|
+
## [1.6.6](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.6.5...v1.6.6) (2023-04-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* added sessionId rendering ([cedcf58](https://github.com/CoCreate-app/CoCreate-local-storage/commit/cedcf588e2b21f450e2445b15b60676d350e5786))
|
|
14
|
+
* fullscreen target updated to fullscreen fullscreen-target ([51d5524](https://github.com/CoCreate-app/CoCreate-local-storage/commit/51d55240188af7cd5b1614d0fe0f7b3fead999c1))
|
|
15
|
+
* package-lock.json and pnpm-lock.yaml added to .gitignore ([7c0d2dd](https://github.com/CoCreate-app/CoCreate-local-storage/commit/7c0d2dd5cebf1059cabfc692c20bc78afb6ddb2c))
|
|
16
|
+
* removed toogle fullscreen icons. now using css content ([4571be4](https://github.com/CoCreate-app/CoCreate-local-storage/commit/4571be48e6d7034ddaad6101f681dfa4e7df28c1))
|
|
17
|
+
* typo this.get ([72676a7](https://github.com/CoCreate-app/CoCreate-local-storage/commit/72676a73389e20f1e563657a1083431ae01da570))
|
|
18
|
+
|
|
1
19
|
## [1.6.5](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.6.4...v1.6.5) (2023-04-24)
|
|
2
20
|
|
|
3
21
|
|
package/docs/index.html
CHANGED
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
<div class="display:flex align-items:center transition:0.3s padding-left:10px" share-network="true" share-text="Simple component to save and fetch data for inputs, textarea, selects from localstorage. easilly configuable with attributes and/or JavaScript API."
|
|
35
35
|
share-title="CoCreate-local-storage" share-height="600" share-width="700" share-media="https://cdn.cocreate.app/docs/local-storage.png" hover="display:block!important" hover-target=".social-networks">
|
|
36
36
|
<div class="display:none social-networks">
|
|
37
|
-
<a class="margin-right:15px" share-network='twitter' title="Share on twitter"><i class="
|
|
38
|
-
<a class="margin-right:15px" share-network='facebook' title="Share on Facebook"><i class="
|
|
39
|
-
<a class="margin-right:15px" share-network='instagram' title="Share on instagram"><i class="
|
|
37
|
+
<a class="margin-right:15px" share-network='twitter' title="Share on twitter"><i class="height:20px fill:#505050" src="/assets/svg/twitter.svg"></i></a>
|
|
38
|
+
<a class="margin-right:15px" share-network='facebook' title="Share on Facebook"><i class="height:20px fill:#505050" src="/assets/svg/facebook.svg"></i></a>
|
|
39
|
+
<a class="margin-right:15px" share-network='instagram' title="Share on instagram"><i class="height:20px fill:#505050" src="/assets/svg/instagram.svg"></i></a>
|
|
40
40
|
</div>
|
|
41
|
-
<a class="margin-right:15px" share-network='share' title="Share on share"><i class="
|
|
41
|
+
<a class="margin-right:15px" share-network='share' title="Share on share"><i class="height:20px fill:#505050" src="/assets/svg/share-alt.svg"></i></a>
|
|
42
42
|
</div>
|
|
43
|
-
<a href="https://github.com/CoCreate-app/CoCreate-local-storage" target="_blank" class="margin-right:15px"><i class="
|
|
43
|
+
<a href="https://github.com/CoCreate-app/CoCreate-local-storage" target="_blank" class="margin-right:15px"><i class="height:20px fill:#505050" src="/assets/svg/github.svg"></i></a>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
<h1 class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">A Simple component similar to CoCreate-input & CoCreate-fetch which Save and fetch data for inputs, textarea, selects from localstorage. Easily configured using HTML5 attributes and/or JavaScript API</h1>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<div id="local-storage-install" class="border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#local-storage-install-section">
|
|
50
50
|
<span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target='[href="#local-storage-install"]'>
|
|
51
51
|
<h2 class="padding:5px_0px">Install</h2>
|
|
52
|
-
<a class="margin-left:10px display:none" href="#local-storage-install"><i class="
|
|
52
|
+
<a class="margin-left:10px display:none" href="#local-storage-install"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
|
|
53
53
|
</span>
|
|
54
54
|
</div>
|
|
55
55
|
<pre><code class="language-bash">npm i @cocreate/local-storage</code></pre>
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<div id="local-storage-usage" class="margin-top:80px border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#local-storage-usage-section">
|
|
60
60
|
<span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target='[href="#local-storage-usage"]'>
|
|
61
61
|
<h2 class="padding:5px_0px">Usage</h2>
|
|
62
|
-
<a class="margin-left:10px display:none" href="#local-storage-usage"><i class="
|
|
62
|
+
<a class="margin-left:10px display:none" href="#local-storage-usage"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
|
|
63
63
|
</span>
|
|
64
64
|
</div>
|
|
65
65
|
<div class="">
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
<div id="local-storage-attributes" class="margin-top:80px border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#local-storage-attributes-section">
|
|
75
75
|
<span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target='[href="#local-storage-attributes"]'>
|
|
76
76
|
<h2 class="padding:5px_0px">Attributes</h2>
|
|
77
|
-
<a class="margin-left:10px display:none" href="#local-storage-attributes"><i class="
|
|
77
|
+
<a class="margin-left:10px display:none" href="#local-storage-attributes"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
|
|
78
78
|
</span>
|
|
79
79
|
</div>
|
|
80
80
|
<ul class="list-style-type:none ">
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<div id="local-storage-demo" class="border-bottom:1px_solid_lightgrey" scroll scroll-intersect="color:dodgerblue" scroll-target="#local-storage-demo-section">
|
|
95
95
|
<span class="display:flex align-items:center width:fit-content" hover="display:block!important" hover-target='[href="#local-storage-demo"]'>
|
|
96
96
|
<h2 class="padding:5px_0px">Demo</h2>
|
|
97
|
-
<a class="margin-left:10px display:none" href="#local-storage-demo"><i class="
|
|
97
|
+
<a class="margin-left:10px display:none" href="#local-storage-demo"><i class="height:20px fill:#505050" src="/assets/svg/link.svg"></i></a>
|
|
98
98
|
</span>
|
|
99
99
|
</div>
|
|
100
100
|
<div class="position:sticky top:0 padding:15px_0px height:100vh">
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
</div>
|
|
112
112
|
|
|
113
113
|
<div class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
|
|
114
|
-
<a class="margin-right:10px" id="eye" show="#eye-slash" hide="#eye, #demo-preview" toggle="code-height" toggle-target="#demo-code"><i class="
|
|
115
|
-
<a class="margin-right:10px" hidden id="eye-slash" show="#eye, #demo-preview" hide="#eye-slash" toggle="code-height" toggle-target="#demo-code"><i class="
|
|
116
|
-
<a class="margin-right:10px" id="code" show="#code-slash" hide="#code, #demo-code"><i class="
|
|
117
|
-
<a class="margin-right:10px" hidden id="code-slash" show="#code, #demo-code" hide="#code-slash"><i class="
|
|
118
|
-
<a class="margin-right:5px" fullscreen target="#playground"
|
|
114
|
+
<a class="margin-right:10px" id="eye" show="#eye-slash" hide="#eye, #demo-preview" toggle="code-height" toggle-target="#demo-code"><i class="height:18px fill:#505050" src="/assets/svg/eye.svg"></i></a>
|
|
115
|
+
<a class="margin-right:10px" hidden id="eye-slash" show="#eye, #demo-preview" hide="#eye-slash" toggle="code-height" toggle-target="#demo-code"><i class="height:20px fill:#505050" src="/assets/svg/eye-slash.svg"></i></a>
|
|
116
|
+
<a class="margin-right:10px" id="code" show="#code-slash" hide="#code, #demo-code"><i class="height:20px fill:#505050" src="/assets/svg/code.svg"></i></a>
|
|
117
|
+
<a class="margin-right:10px" hidden id="code-slash" show="#code, #demo-code" hide="#code-slash"><i class="display:flex height:18px fill:#505050" src="/assets/svg/code.svg"></i></a>
|
|
118
|
+
<a class="margin-right:5px" fullscreen fullscreen-target="#playground"></a>
|
|
119
119
|
</div>
|
|
120
120
|
|
|
121
121
|
</div>
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
|
|
126
126
|
</div>
|
|
127
127
|
<button href="https://github.com/CoCreate-app/CoCreate-local-storage/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
|
|
128
|
-
<i class="
|
|
128
|
+
<i class="height:20px fill:#505050" src="/assets/svg/pencil-alt.svg"></i>
|
|
129
129
|
</button>
|
|
130
130
|
</main>
|
|
131
131
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/local-storage",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"description": "A Simple component similar to CoCreate-input & CoCreate-fetch which Save and fetch data for inputs, textarea, selects from localstorage. Easily configured using HTML5 attributes and/or JavaScript API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"local-storage",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@cocreate/actions": "^1.8.2",
|
|
63
|
-
"@cocreate/docs": "^1.7.1"
|
|
63
|
+
"@cocreate/docs": "^1.7.1",
|
|
64
|
+
"@cocreate/observer": "^1.7.1"
|
|
64
65
|
}
|
|
65
66
|
}
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import observer from '@cocreate/observer';
|
|
1
2
|
import action from '@cocreate/actions'
|
|
2
3
|
|
|
3
4
|
const CoCreateLocalStorage = {
|
|
@@ -24,7 +25,7 @@ const CoCreateLocalStorage = {
|
|
|
24
25
|
},
|
|
25
26
|
|
|
26
27
|
initElement: function(element) {
|
|
27
|
-
this.
|
|
28
|
+
this.getItem(element)
|
|
28
29
|
element.addEventListener('input', (e) => {
|
|
29
30
|
let isRealtime = element.getAttribute('realtime')
|
|
30
31
|
if (isRealtime == "false") return;
|
|
@@ -113,11 +114,23 @@ const CoCreateLocalStorage = {
|
|
|
113
114
|
this.support = false;
|
|
114
115
|
} catch(e) {
|
|
115
116
|
this.support = false;
|
|
117
|
+
} finally {
|
|
118
|
+
if (this.support)
|
|
119
|
+
this.init()
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
|
|
125
|
+
// observer.init({
|
|
126
|
+
// name: 'CoCreateLocalstorage',
|
|
127
|
+
// observe: ['addedNodes'],
|
|
128
|
+
// target: '[localstorage-key]',
|
|
129
|
+
// callback: function(mutation) {
|
|
130
|
+
// CoCreateLocalStorage._initSessionIds(mutation.target);
|
|
131
|
+
// }
|
|
132
|
+
// });
|
|
133
|
+
|
|
121
134
|
action.init({
|
|
122
135
|
name: "localStorage",
|
|
123
136
|
endEvent: "localStorage",
|