@cocreate/local-storage 1.22.0 → 2.0.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/CONTRIBUTING.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # Contributing to CoCreate-local-storage
2
2
 
3
- This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-local-storage/graphs/contributors).
4
- You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-local-storage/pulls),
5
- [propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-local-storage/issues).
3
+ This project is work of [many contributors](https://github.com/CoCreateJS/local-storage/graphs/contributors).
4
+ You're encouraged to submit [pull requests](https://github.com/CoCreateJS/local-storage/pulls),
5
+ [propose features and discuss issues](https://github.com/CoCreateJS/local-storage/issues).
6
6
 
7
7
  In the examples below, substitute your Github username for `contributor` in URLs.
8
8
 
9
9
  ## Fork the Project
10
10
 
11
- Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-local-storage) and check out your copy.
11
+ Fork the [project on Github](https://github.com/CoCreateJS/local-storage) and check out your copy.
12
12
 
13
13
  ```
14
14
  git local-storage https://github.com/contributor/CoCreate-local-storage.git
15
15
  cd CoCreate-local-storage
16
- git remote add upstream https://gitlab.com/cocreatejs/CoCreate-local-storage.git
16
+ git remote add upstream https://github.com/CoCreateJS/local-storage.git
17
17
  ```
18
18
 
19
19
  ## Create a Topic Branch
@@ -75,7 +75,7 @@ git push origin my-feature-branch
75
75
 
76
76
  ## Make a Pull Request
77
77
 
78
- Go to [https://github.com/CoCreate-app/CoCreate-local-storage](https://github.com/CoCreate-app/CoCreate-local-storage) and select your feature branch.
78
+ Go to [https://github.com/CoCreateJS/local-storage](https://github.com/CoCreateJS/local-storage) and select your feature branch.
79
79
  Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
80
80
 
81
81
  ## Rebase
package/README.md CHANGED
@@ -1,28 +1,28 @@
1
1
  # CoCreate-local-storage
2
2
 
3
- 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 Take it for a spin in our [playground!](https://cocreate.app/docs/local-storage)
3
+ 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 Take it for a spin in our [playground!](https://CoCreateJS.com/docs/local-storage)
4
4
 
5
- ![minified](https://img.badgesize.io/https://cdn.cocreate.app/local-storage/latest/CoCreate-local-storage.min.js?style=flat-square&label=minified&color=orange)
6
- ![gzip](https://img.badgesize.io/https://cdn.cocreate.app/local-storage/latest/CoCreate-local-storage.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow)
7
- ![brotli](https://img.badgesize.io/https://cdn.cocreate.app/local-storage/latest/CoCreate-local-storage.min.js?compression=brotli&style=flat-square&label=brotli)
8
- ![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-local-storage?style=flat-square)
9
- ![License](https://img.shields.io/github/license/CoCreate-app/CoCreate-local-storage?style=flat-square)
5
+ ![minified](https://img.badgesize.io/https://cdn.CoCreateJS.com/local-storage/latest/CoCreate-local-storage.min.js?style=flat-square&label=minified&color=orange)
6
+ ![gzip](https://img.badgesize.io/https://cdn.CoCreateJS.com/local-storage/latest/CoCreate-local-storage.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow)
7
+ ![brotli](https://img.badgesize.io/https://cdn.CoCreateJS.com/local-storage/latest/CoCreate-local-storage.min.js?compression=brotli&style=flat-square&label=brotli)
8
+ ![GitHub latest release](https://img.shields.io/github/v/release/CoCreateJS/local-storage?style=flat-square)
9
+ ![License](https://img.shields.io/github/license/CoCreateJS/local-storage?style=flat-square)
10
10
  ![Hiring](https://img.shields.io/static/v1?style=flat-square&label=&message=Hiring&color=blueviolet)
11
11
 
12
- ![CoCreate-local-storage](https://cdn.cocreate.app/docs/CoCreate-local-storage.gif)
12
+ ![CoCreate-local-storage](https://cdn.CoCreateJS.com/docs/CoCreate-local-storage.gif)
13
13
 
14
- ## [Docs & Demo](https://cocreate.app/docs/local-storage)
14
+ ## [Docs & Demo](https://CoCreateJS.com/docs/local-storage)
15
15
 
16
- For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/local-storage)
16
+ For a complete guide and working demo refer to the [doumentation](https://CoCreateJS.com/docs/local-storage)
17
17
 
18
18
  ## CDN
19
19
 
20
20
  ```html
21
- <script src="https://cdn.cocreate.app/local-storage/latest/CoCreate-local-storage.min.js"></script>
21
+ <script src="https://cdn.CoCreateJS.com/local-storage/latest/CoCreate-local-storage.min.js"></script>
22
22
  ```
23
23
 
24
24
  ```html
25
- <script src="https://cdn.cocreate.app/local-storage/latest/CoCreate-local-storage.min.css"></script>
25
+ <script src="https://cdn.CoCreateJS.com/local-storage/latest/CoCreate-local-storage.min.css"></script>
26
26
  ```
27
27
 
28
28
  ## NPM
@@ -50,13 +50,13 @@ $ yarn install @cocreate/local-storage
50
50
 
51
51
  # Announcements
52
52
 
53
- All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-local-storage/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-local-storage/releases). You may also subscribe to email for releases and breaking changes.
53
+ All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreateJS/local-storage/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreateJS/local-storage/releases). You may also subscribe to email for releases and breaking changes.
54
54
 
55
55
  <a name="roadmap"></a>
56
56
 
57
57
  # Roadmap
58
58
 
59
- If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-local-storage/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-local-storage/pulls). We would love to hear your feedback.
59
+ If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreateJS/local-storage/issues) and [pull requests](https://github.com/CoCreateJS/local-storage/pulls). We would love to hear your feedback.
60
60
 
61
61
  <a name="about"></a>
62
62
 
@@ -64,7 +64,7 @@ If you are interested in the future direction of this project, please take a loo
64
64
 
65
65
  CoCreate-local-storage is guided and supported by the CoCreate Developer Experience Team.
66
66
 
67
- Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries.
67
+ Please Email the Developer Experience Team [here](mailto:develop@CoCreateJS.com) in case of any queries.
68
68
 
69
69
  CoCreate-local-storage is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC.
70
70
 
@@ -72,9 +72,9 @@ CoCreate-local-storage is maintained and funded by CoCreate. The names and logos
72
72
 
73
73
  # How to Contribute
74
74
 
75
- We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-local-storage/blob/master/CONTRIBUTING.md) guide for details.
75
+ We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreateJS/local-storage/blob/master/CONTRIBUTING.md) guide for details.
76
76
 
77
- We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/CoCreate-local-storage/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-local-storage/pulls) or merely upvote or comment on existing issues or pull requests.
77
+ We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreateJS/local-storage/issues) and [pull requests](https://github.com/CoCreateJS/local-storage/pulls) or merely upvote or comment on existing issues or pull requests.
78
78
 
79
79
  We appreciate your continued support, thank you!
80
80
 
@@ -82,4 +82,4 @@ We appreciate your continued support, thank you!
82
82
  <a name="license"></a>
83
83
  # License
84
84
 
85
- [The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-local-storage/blob/master/LICENSE)
85
+ [The MIT License (MIT)](https://github.com/CoCreateJS/local-storage/blob/master/LICENSE)
package/demo/index.html CHANGED
@@ -86,6 +86,6 @@
86
86
  </form>
87
87
 
88
88
  <!--<script src="../dist/CoCreate-local-storage.js"></script>-->
89
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
89
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
90
90
  </body>
91
91
  </html>
package/docs/index.html CHANGED
@@ -9,7 +9,7 @@
9
9
  rel="icon"
10
10
  type="image/png"
11
11
  sizes="32x32"
12
- href="https://cocreate.app/images/favicon.ico" />
12
+ href="https://CoCreateJS.com/images/favicon.ico" />
13
13
  <meta
14
14
  name="description"
15
15
  content="Simple component to save and fetch data for inputs, textarea, selects from localstorage. easilly configuable with attributes and/or JavaScript API." />
@@ -19,13 +19,13 @@
19
19
  <meta name="robots" content="index,follow" />
20
20
  <meta
21
21
  property="og:image"
22
- content="https://cdn.cocreate.app/docs/local-storage.png" />
22
+ content="https://cdn.CoCreateJS.com/docs/local-storage.png" />
23
23
 
24
24
  <!-- CoCreate CSS CDN-->
25
25
 
26
26
  <link
27
27
  rel="stylesheet"
28
- href="https://ws.cocreate.app/docs.css"
28
+ href="https://ws.CoCreateJS.com/docs.css"
29
29
  array="apples"
30
30
  object="6069ff5042ef8ff5175a5c8d"
31
31
  key="css"
@@ -74,7 +74,7 @@
74
74
  share-title="CoCreate-local-storage"
75
75
  share-height="600"
76
76
  share-width="700"
77
- share-media="https://cdn.cocreate.app/docs/local-storage.png"
77
+ share-media="https://cdn.CoCreateJS.com/docs/local-storage.png"
78
78
  hover="display:block!important"
79
79
  hover-query=".social-networks">
80
80
  <div class="display:none social-networks">
@@ -105,7 +105,7 @@
105
105
  ></a>
106
106
  </div>
107
107
  <a
108
- href="https://github.com/CoCreate-app/CoCreate-local-storage"
108
+ href="https://github.com/CoCreateJS/CoCreate-local-storage"
109
109
  target="_blank"
110
110
  class="margin-right:15px"
111
111
  ><i src="/assets/svg/github.svg"></i
@@ -144,7 +144,7 @@
144
144
  <p class="padding:10px_0px line-height:1.5">
145
145
  Or you can use cdn link:
146
146
  </p>
147
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/local-storage/latest/CoCreate-local-storage.min.js&lt;/script&gt;</code></pre>
147
+ <pre><code class="language-html">&lt;script&gt;https://cdn.CoCreateJS.com/local-storage/latest/CoCreate-local-storage.min.js&lt;/script&gt;</code></pre>
148
148
 
149
149
  <div
150
150
  id="local-storage-usage"
@@ -329,13 +329,13 @@
329
329
  </div>
330
330
  </div>
331
331
  <button
332
- href="https://github.com/CoCreate-app/CoCreate-local-storage/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
332
+ href="https://github.com/CoCreateJS/CoCreate-local-storage/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
333
333
  target="_blank"
334
334
  class="display:flex justify-content:center align-items:center position:fixed bottom:15px right:15px height:50px width:50px border-radius:50% box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
335
335
  <i src="../assets/svg/pencil-alt.svg"></i>
336
336
  </button>
337
337
  </main>
338
338
 
339
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
339
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
340
340
  </body>
341
341
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/local-storage",
3
- "version": "1.22.0",
3
+ "version": "2.0.1",
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",
@@ -22,25 +22,25 @@
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "git+https://gitlab.com/cocreatejs/CoCreate-local-storage.git"
25
+ "url": "git+https://github.com/CoCreateJS/local-storage.git"
26
26
  },
27
27
  "author": "CoCreate LLC",
28
28
  "license": "MIT",
29
29
  "bugs": {
30
- "url": "https://github.com/CoCreate-app/CoCreate-local-storage/issues"
30
+ "url": "https://github.com/CoCreateJS/local-storage/issues"
31
31
  },
32
- "homepage": "https://cocreate.app/docs/local-storage",
32
+ "homepage": "https://CoCreateJS.com/docs/local-storage",
33
33
  "funding": {
34
34
  "type": "GitHub Sponsors ❤",
35
- "url": "https://github.com/sponsors/CoCreate-app"
35
+ "url": "https://github.com/sponsors/CoCreateJS"
36
36
  },
37
37
  "main": "./src/index.js",
38
38
  "dependencies": {
39
- "@cocreate/actions": "^1.24.0",
40
- "@cocreate/observer": "^1.23.0"
39
+ "@cocreate/actions": "^2.0.0",
40
+ "@cocreate/observer": "^2.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@cocreate/webpack": "^1.9.0"
43
+ "@cocreate/webpack": "^2.0.0"
44
44
  },
45
45
  "allowScripts": {
46
46
  "@cocreate/actions@1.21.4": true,
package/src/index.js CHANGED
@@ -4,6 +4,11 @@ import Actions from "@cocreate/actions";
4
4
  let support = true;
5
5
  const storage = new Map();
6
6
 
7
+ /**
8
+ *
9
+ * @public
10
+ * @environment client
11
+ */
7
12
  function init() {
8
13
  var elements = document.querySelectorAll(
9
14
  "[localstorage-set], [localstorage-get], [sessionstorage-set], [sessionstorage-get]"
@@ -36,6 +41,8 @@ function init() {
36
41
  /**
37
42
  * Initializes a collection of elements.
38
43
  * @param {Array<Element>} elements - An array of elements to be initialized.
44
+ * @public
45
+ * @environment client
39
46
  */
40
47
  function initElements(elements) {
41
48
  for (let element of elements) initElement(element);
@@ -44,6 +51,8 @@ function initElements(elements) {
44
51
  /**
45
52
  * Initializes a single element.
46
53
  * @param {Element} element - The element to initialize. This function expects an 'Element' type.
54
+ * @public
55
+ * @environment client
47
56
  */
48
57
  function initElement(element) {
49
58
  const types = ["localstorage", "sessionstorage"];
@@ -104,6 +113,8 @@ function initElement(element) {
104
113
  * @param key
105
114
  * @param type - 'localstorage' or 'sessionstorage'
106
115
  * @return { Mixed } The value associated with the key or undefined if not found.
116
+ * @public
117
+ * @environment client
107
118
  */
108
119
  function getItem(key, type = "localstorage") {
109
120
  if (support) {
@@ -117,6 +128,8 @@ function getItem(key, type = "localstorage") {
117
128
  * @param key - key name to store the value under
118
129
  * @param value - value to store
119
130
  * @param type - 'localstorage' or 'sessionstorage'
131
+ * @public
132
+ * @environment client
120
133
  */
121
134
  function setItem(key, value, type = "localstorage") {
122
135
  try {
@@ -161,6 +174,8 @@ function setItem(key, value, type = "localstorage") {
161
174
  /**
162
175
  * @param key - The key name to delete from the storage
163
176
  * @param type - 'localstorage' or 'sessionstorage'
177
+ * @public
178
+ * @environment client
164
179
  */
165
180
  function removeItem(key, type = "localstorage") {
166
181
  if (support) {
@@ -175,6 +190,8 @@ function removeItem(key, type = "localstorage") {
175
190
  * @param action
176
191
  *
177
192
  * @return { undefined } No return
193
+ * @public
194
+ * @environment client
178
195
  */
179
196
  async function runStorage(action) {
180
197
  const form = action.form;
@@ -219,18 +236,33 @@ async function runStorage(action) {
219
236
  );
220
237
  }
221
238
 
239
+ /**
240
+ *
241
+ * @public
242
+ * @environment client
243
+ */
222
244
  const localStorage = {
223
245
  getItem: (key) => getItem(key, "localstorage"),
224
246
  setItem: (key, value) => setItem(key, value, "localstorage"),
225
247
  removeItem: (key) => removeItem(key, "localstorage")
226
248
  };
227
249
 
250
+ /**
251
+ *
252
+ * @public
253
+ * @environment client
254
+ */
228
255
  const sessionStorage = {
229
256
  getItem: (key) => getItem(key, "sessionstorage"),
230
257
  setItem: (key, value) => setItem(key, value, "sessionstorage"),
231
258
  removeItem: (key) => removeItem(key, "sessionstorage")
232
259
  };
233
260
 
261
+ /**
262
+ *
263
+ * @public
264
+ * @environment client
265
+ */
234
266
  function checkSupport() {
235
267
  // Check if the browser supports Web Storage.
236
268
  if (!("localStorage" in window) || !("sessionStorage" in window)) {
@@ -310,4 +342,50 @@ export default {
310
342
  checkSupport,
311
343
  localStorage,
312
344
  sessionStorage
313
- };
345
+ };
346
+
347
+ /**
348
+ *
349
+ * @name realtime
350
+ * @kind attribute
351
+ * @environment client
352
+ */
353
+
354
+ /**
355
+ * 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
356
+ *
357
+ * @module local-storage
358
+ * @environment client
359
+ */
360
+
361
+ /**
362
+ * Declarative selectors recognized by this module.
363
+ *
364
+ * @name declarative-selectors
365
+ * @kind member
366
+ * @selectors
367
+ * @environment client
368
+ * @example
369
+ * ```json
370
+ * [
371
+ * "[localstorage-set], [sessionstorage-set]"
372
+ * ]
373
+ * ```
374
+ */
375
+
376
+ /**
377
+ * Declarative actions supported or registered by this module.
378
+ *
379
+ * @name declarative-actions
380
+ * @kind member
381
+ * @actions
382
+ * @environment client
383
+ * @example
384
+ * ```json
385
+ * [
386
+ * {
387
+ * "name": "localStorage"
388
+ * }
389
+ * ]
390
+ * ```
391
+ */