jails.stdlib 1.0.0 → 1.1.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  <div align="center">
3
- <h1>jails.std</h1>
3
+ <h1>jails.stdlib</h1>
4
4
  <h4>The Jails Standard Library</h4>
5
5
  </div>
6
6
 
@@ -9,14 +9,14 @@
9
9
  ## Installing
10
10
 
11
11
  ```
12
- npm install jails.std
12
+ npm install jails.stdlib
13
13
  ```
14
14
  or
15
15
 
16
16
  ```
17
- yarn add jails.std
17
+ yarn add jails.stdlib
18
18
  ```
19
19
 
20
20
  <br />
21
21
 
22
- See more details about each module inside their respective folders.
22
+ See more details about each module inside their respective folders.
@@ -10,7 +10,7 @@ TIt ensures only the latest async call resolves, ignoring all previous ones, so
10
10
  ### Usage
11
11
 
12
12
  ```js
13
- import { cancelable } from 'jails.std/cancelable'
13
+ import { cancelable } from 'jails.stdlib/cancelable'
14
14
 
15
15
  export const getService = () => {
16
16
  return new Promise((resolve, reject) => {
@@ -10,7 +10,7 @@ Delays a function's execution until after a specified pause in activity.
10
10
  ### Usage
11
11
 
12
12
  ```js
13
- import { debounce } from 'jails.std/debounce'
13
+ import { debounce } from 'jails.stdlib/debounce'
14
14
 
15
15
  const oninput = debounce(() => {
16
16
  console.log('debouncing input')
package/delay/README.md CHANGED
@@ -8,7 +8,7 @@ Delays the next `.then` promise chain.
8
8
  ### Usage
9
9
 
10
10
  ```js
11
- import { delay } from 'jails.std/delay'
11
+ import { delay } from 'jails.stdlib/delay'
12
12
 
13
13
  fetch('https://jsonplaceholder.typicode.com/todos/1')
14
14
  .then( response => response.json() )
@@ -2,7 +2,7 @@ var T = Object.defineProperty, B = Object.defineProperties;
2
2
  var C = Object.getOwnPropertyDescriptors;
3
3
  var D = Object.getOwnPropertySymbols;
4
4
  var G = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable;
5
- var A = (a, r, e) => r in a ? T(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e, b = (a, r) => {
5
+ var A = (a, r, e) => r in a ? T(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e, m = (a, r) => {
6
6
  for (var e in r || (r = {}))
7
7
  G.call(r, e) && A(a, e, r[e]);
8
8
  if (D)
@@ -10,85 +10,87 @@ var A = (a, r, e) => r in a ? T(a, r, { enumerable: !0, configurable: !0, writab
10
10
  H.call(r, e) && A(a, e, r[e]);
11
11
  return a;
12
12
  }, L = (a, r) => B(a, C(r));
13
- const M = "form-validation", v = "[data-validation]", J = "[data-mask]";
13
+ const M = "form-validation", g = "[data-validation]", J = "[data-mask]";
14
14
  function U({
15
15
  main: a,
16
16
  elm: r,
17
17
  state: e,
18
18
  on: n,
19
- emit: m,
19
+ emit: v,
20
20
  dependencies: y,
21
21
  trigger: F
22
22
  }) {
23
- var V;
24
- const { validations: g, masks: E } = y, f = (V = r.querySelector("input,select,textarea")) == null ? void 0 : V.form;
23
+ var k;
24
+ const { validations: h, masks: E } = y, f = (k = r.querySelector("input,select,textarea")) == null ? void 0 : k.form;
25
25
  let u = S(f);
26
26
  a((t) => {
27
- n("input", "input, textarea, select", z), n("input", J, $), n("input", v, h("input")), n("change", v, h("change")), n("blur", v, h("blur")), n("focus", "input, textarea, select", N), n("blur", "input, textarea, select", O), f.addEventListener("reset", j), f.addEventListener("submit", _), I();
28
- });
27
+ n("input", "input, textarea, select", z), n("input", J, $), n("input", g, p("input")), n("change", g, p("change")), n("blur", g, p("blur")), n("focus", "input, textarea, select", N), n("blur", "input, textarea, select", O), f.addEventListener("reset", j), f.addEventListener("submit", _), I();
28
+ }), r.setValues = (t) => {
29
+ e.set((s) => s.form.values = m(m({}, s.form.values), t));
30
+ };
29
31
  const I = () => {
30
- if (!g)
32
+ if (!h)
31
33
  throw new Error(
32
34
  "<form-validation> - No validations provided in dependencies"
33
35
  );
34
- const t = k();
35
- e.set((o) => o.form.values = t);
36
- }, k = () => {
36
+ const t = V();
37
+ e.set((s) => s.form.values = t);
38
+ }, V = () => {
37
39
  const t = {};
38
- return u.forEach((o) => t[o] = ""), t;
40
+ return u.forEach((s) => t[s] = ""), t;
39
41
  }, N = (t) => {
40
- const o = t.target.name;
41
- e.set((s) => {
42
- s.form.touched[o] = !0, s.form.focused[o] = !0;
42
+ const s = t.target.name;
43
+ e.set((o) => {
44
+ o.form.touched[s] = !0, o.form.focused[s] = !0;
43
45
  });
44
46
  }, O = (t) => {
45
- const o = t.target.name;
46
- e.set((s) => {
47
- s.form.focused[o] = !1;
47
+ const s = t.target.name;
48
+ e.set((o) => {
49
+ o.form.focused[s] = !1;
48
50
  });
49
- }, h = (t) => (o) => {
50
- const s = o.target, l = s.name, c = w(s, f), p = s.dataset.validation.split(/\s/), d = [], x = e.get();
51
- p.forEach((i) => {
52
- if (i in g) {
53
- const { ok: q, message: K } = g[i](
51
+ }, p = (t) => (s) => {
52
+ const o = s.target, i = o.name, c = w(o, f), b = o.dataset.validation.split(/\s/), d = [], x = e.get();
53
+ b.forEach((l) => {
54
+ if (l in h) {
55
+ const { ok: q, message: K } = h[l](
54
56
  c,
55
- s,
57
+ o,
56
58
  f
57
59
  );
58
60
  q || d.push(K);
59
61
  }
60
- }), d.length ? t === "input" ? (u.add(s.name), e.set((i) => {
61
- i.form.isValid = !1, x.form.errors[l] && d[0] != x.form.errors[l] && (i.form.errors[l] = d[0]);
62
- })) : (t === "blur" || t === "change") && (u.add(s.name), e.set((i) => {
63
- i.form.errors[l] = d[0], i.form.isValid = !1;
64
- })) : (u.delete(s.name), e.set((i) => {
65
- delete i.form.errors[l], u.size || (i.form.isValid = !0);
62
+ }), d.length ? t === "input" ? (u.add(o.name), e.set((l) => {
63
+ l.form.isValid = !1, x.form.errors[i] && d[0] != x.form.errors[i] && (l.form.errors[i] = d[0]);
64
+ })) : (t === "blur" || t === "change") && (u.add(o.name), e.set((l) => {
65
+ l.form.errors[i] = d[0], l.form.isValid = !1;
66
+ })) : (u.delete(o.name), e.set((l) => {
67
+ delete l.form.errors[i], u.size || (l.form.isValid = !0);
66
68
  }));
67
69
  }, z = (t) => {
68
- const { name: o } = t.target, s = w(t.target, f);
69
- e.set((l) => l.form.values[o] = s);
70
+ const { name: s } = t.target, o = w(t.target, f);
71
+ e.set((i) => i.form.values[s] = o);
70
72
  }, _ = (t) => {
71
- t.preventDefault(), F("blur", v);
72
- const s = e.get().form.errors;
73
- if (Object.keys(s).length)
74
- m(`${M}:error`, { errors: s });
73
+ t.preventDefault(), F("blur", g);
74
+ const o = e.get().form.errors;
75
+ if (Object.keys(o).length)
76
+ v(`${M}:error`, { errors: o });
75
77
  else {
76
78
  const c = Q(t.target);
77
- m(`${M}:submit`, b({}, c));
79
+ v(`${M}:submit`, m({}, c));
78
80
  }
79
81
  }, $ = (t) => {
80
- let o = t.target.value;
81
- const { mask: s } = t.target.dataset;
82
- s.split(/s/).forEach((c) => {
82
+ let s = t.target.value;
83
+ const { mask: o } = t.target.dataset;
84
+ o.split(/s/).forEach((c) => {
83
85
  if (c && c in E) {
84
- const p = E[c];
85
- o = p(o, t.target, t.target.form);
86
+ const b = E[c];
87
+ s = b(s, t.target, t.target.form);
86
88
  }
87
- }), e.set((c) => c.form.values[t.target.name] = o || "");
89
+ }), e.set((c) => c.form.values[t.target.name] = s || "");
88
90
  }, j = () => {
89
91
  u = S(f), e.set({
90
- form: L(b({}, P.form), {
91
- values: k()
92
+ form: L(m({}, P.form), {
93
+ values: V()
92
94
  })
93
95
  });
94
96
  };
@@ -103,8 +105,8 @@ const P = {
103
105
  }
104
106
  }, Q = (a) => {
105
107
  const r = new FormData(a), e = {};
106
- for (let [n, m] of r)
107
- e[n] = m;
108
+ for (let [n, v] of r)
109
+ e[n] = v;
108
110
  return { formData: r, data: e };
109
111
  }, w = (a, r) => {
110
112
  const { name: e, type: n } = a;
@@ -31,6 +31,10 @@ export default function formValidation({
31
31
  initialValues()
32
32
  })
33
33
 
34
+ elm.setValues = ( values ) => {
35
+ state.set(s => (s.form.values = { ...s.form.values, ...values }))
36
+ }
37
+
34
38
  const initialValues = () => {
35
39
  if (!validations) {
36
40
  throw new Error(
@@ -1 +1 @@
1
- (function(o,r){typeof exports=="object"&&typeof module!="undefined"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(o=typeof globalThis!="undefined"?globalThis:o||self,r(o["form-validation"]={}))})(this,(function(o){"use strict";var H=Object.defineProperty,J=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var w=(o,r,n)=>r in o?H(o,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[r]=n,k=(o,r)=>{for(var n in r||(r={}))R.call(r,n)&&w(o,n,r[n]);if(L)for(var n of L(r))U.call(r,n)&&w(o,n,r[n]);return o},O=(o,r)=>J(o,Q(r));const r="form-validation",n="[data-validation]",T="[data-mask]";function _({main:c,elm:f,state:t,on:i,emit:p,dependencies:F,trigger:I}){var S;const{validations:h,masks:y}=F,m=(S=f.querySelector("input,select,textarea"))==null?void 0:S.form;let v=x(m);c(e=>{i("input","input, textarea, select",q),i("input",T,P),i("input",n,b("input")),i("change",n,b("change")),i("blur",n,b("blur")),i("focus","input, textarea, select",z),i("blur","input, textarea, select",$),m.addEventListener("reset",B),m.addEventListener("submit",K),N()});const N=()=>{if(!h)throw new Error("<form-validation> - No validations provided in dependencies");const e=D();t.set(a=>a.form.values=e)},D=()=>{const e={};return v.forEach(a=>e[a]=""),e},z=e=>{const a=e.target.name;t.set(s=>{s.form.touched[a]=!0,s.form.focused[a]=!0})},$=e=>{const a=e.target.name;t.set(s=>{s.form.focused[a]=!1})},b=e=>a=>{const s=a.target,u=s.name,d=M(s,m),E=s.dataset.validation.split(/\s/),g=[],A=t.get();E.forEach(l=>{if(l in h){const{ok:C,message:G}=h[l](d,s,m);C||g.push(G)}}),g.length?e==="input"?(v.add(s.name),t.set(l=>{l.form.isValid=!1,A.form.errors[u]&&g[0]!=A.form.errors[u]&&(l.form.errors[u]=g[0])})):(e==="blur"||e==="change")&&(v.add(s.name),t.set(l=>{l.form.errors[u]=g[0],l.form.isValid=!1})):(v.delete(s.name),t.set(l=>{delete l.form.errors[u],v.size||(l.form.isValid=!0)}))},q=e=>{const{name:a}=e.target,s=M(e.target,m);t.set(u=>u.form.values[a]=s)},K=e=>{e.preventDefault(),I("blur",n);const s=t.get().form.errors;if(Object.keys(s).length)p(`${r}:error`,{errors:s});else{const d=j(e.target);p(`${r}:submit`,k({},d))}},P=e=>{let a=e.target.value;const{mask:s}=e.target.dataset;s.split(/s/).forEach(d=>{if(d&&d in y){const E=y[d];a=E(a,e.target,e.target.form)}}),t.set(d=>d.form.values[e.target.name]=a||"")},B=()=>{v=x(m),t.set({form:O(k({},V.form),{values:D()})})}}const V={form:{errors:{},values:{},touched:{},isValid:!1,focused:{}}},j=c=>{const f=new FormData(c),t={};for(let[i,p]of f)t[i]=p;return{formData:f,data:t}},M=(c,f)=>{const{name:t,type:i}=c;return i=="checkbox"?c.checked?c.value:"":f[t].value},x=c=>{const f=new Set;return Array.from(c.elements).filter(t=>t.name&&t.dataset.validation).forEach(t=>f.add(t.name)),f};o.default=_,o.model=V,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(a,r){typeof exports=="object"&&typeof module!="undefined"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(a=typeof globalThis!="undefined"?globalThis:a||self,r(a["form-validation"]={}))})(this,(function(a){"use strict";var H=Object.defineProperty,J=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var w=(a,r,n)=>r in a?H(a,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[r]=n,p=(a,r)=>{for(var n in r||(r={}))R.call(r,n)&&w(a,n,r[n]);if(L)for(var n of L(r))U.call(r,n)&&w(a,n,r[n]);return a},O=(a,r)=>J(a,Q(r));const r="form-validation",n="[data-validation]",T="[data-mask]";function _({main:f,elm:c,state:t,on:i,emit:h,dependencies:F,trigger:I}){var S;const{validations:b,masks:y}=F,m=(S=c.querySelector("input,select,textarea"))==null?void 0:S.form;let v=x(m);f(e=>{i("input","input, textarea, select",q),i("input",T,P),i("input",n,E("input")),i("change",n,E("change")),i("blur",n,E("blur")),i("focus","input, textarea, select",z),i("blur","input, textarea, select",$),m.addEventListener("reset",B),m.addEventListener("submit",K),N()}),c.setValues=e=>{t.set(s=>s.form.values=p(p({},s.form.values),e))};const N=()=>{if(!b)throw new Error("<form-validation> - No validations provided in dependencies");const e=D();t.set(s=>s.form.values=e)},D=()=>{const e={};return v.forEach(s=>e[s]=""),e},z=e=>{const s=e.target.name;t.set(o=>{o.form.touched[s]=!0,o.form.focused[s]=!0})},$=e=>{const s=e.target.name;t.set(o=>{o.form.focused[s]=!1})},E=e=>s=>{const o=s.target,u=o.name,d=M(o,m),V=o.dataset.validation.split(/\s/),g=[],A=t.get();V.forEach(l=>{if(l in b){const{ok:C,message:G}=b[l](d,o,m);C||g.push(G)}}),g.length?e==="input"?(v.add(o.name),t.set(l=>{l.form.isValid=!1,A.form.errors[u]&&g[0]!=A.form.errors[u]&&(l.form.errors[u]=g[0])})):(e==="blur"||e==="change")&&(v.add(o.name),t.set(l=>{l.form.errors[u]=g[0],l.form.isValid=!1})):(v.delete(o.name),t.set(l=>{delete l.form.errors[u],v.size||(l.form.isValid=!0)}))},q=e=>{const{name:s}=e.target,o=M(e.target,m);t.set(u=>u.form.values[s]=o)},K=e=>{e.preventDefault(),I("blur",n);const o=t.get().form.errors;if(Object.keys(o).length)h(`${r}:error`,{errors:o});else{const d=j(e.target);h(`${r}:submit`,p({},d))}},P=e=>{let s=e.target.value;const{mask:o}=e.target.dataset;o.split(/s/).forEach(d=>{if(d&&d in y){const V=y[d];s=V(s,e.target,e.target.form)}}),t.set(d=>d.form.values[e.target.name]=s||"")},B=()=>{v=x(m),t.set({form:O(p({},k.form),{values:D()})})}}const k={form:{errors:{},values:{},touched:{},isValid:!1,focused:{}}},j=f=>{const c=new FormData(f),t={};for(let[i,h]of c)t[i]=h;return{formData:c,data:t}},M=(f,c)=>{const{name:t,type:i}=f;return i=="checkbox"?f.checked?f.value:"":c[t].value},x=f=>{const c=new Set;return Array.from(f.elements).filter(t=>t.name&&t.dataset.validation).forEach(t=>c.add(t.name)),c};a.default=_,a.model=k,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -43,7 +43,7 @@ on('form-validation:error', ({ errors }) => {})
43
43
 
44
44
  ##### main.ts
45
45
  ```ts
46
- import * as formValidation from 'jails.std/form-validation'
46
+ import * as formValidation from 'jails.stdlib/form-validation'
47
47
  import rules from './my-custom-rules'
48
48
 
49
49
  jails.register('form-validation', formValidation, { ...rules })
@@ -114,4 +114,24 @@ export default {
114
114
  }
115
115
  ```
116
116
 
117
- To see how to inject this dependency, go back to the [usage](#usage) section.
117
+ To see how to inject this dependency, go back to the [usage](#usage) section.
118
+
119
+
120
+ ##### element.setValues(...data)
121
+
122
+ If you want to set programatically values to the fields, you just have to get the node of `form-validation` element and use the public method `setValues()` passing data with `name` and `value` pairs.
123
+
124
+
125
+ ```ts
126
+ export default function myComponent({ main, elm }) {
127
+
128
+ const formValidation = elm.querySelector('form-validation')
129
+
130
+ main(() => {
131
+ formValidation.setValues({
132
+ 'username': 'John Doe',
133
+ 'age': '41'
134
+ })
135
+ })
136
+ }
137
+ ```
@@ -10,7 +10,7 @@ Returns a promise when Css is loaded
10
10
  ### Usage
11
11
 
12
12
  ```ts
13
- import { importCss } from 'jails.std/import-css'
13
+ import { importCss } from 'jails.stdlib/import-css'
14
14
 
15
15
  importCss('https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css')
16
16
  .then( (event) => {
@@ -9,7 +9,7 @@ Returns a promise when Html is loaded. It accepts options from `fetch` api.
9
9
  ### Usage
10
10
 
11
11
  ```ts
12
- import { importHtml } from 'jails.std/import-html'
12
+ import { importHtml } from 'jails.stdlib/import-html'
13
13
 
14
14
  importHtml('https://html-mock.fly.dev/tag/table?class=table%20table-bordered')
15
15
  .then( ({ response: Response, html: string }) => {
@@ -10,7 +10,7 @@ Returns a promise when script is loaded
10
10
  ### Usage
11
11
 
12
12
  ```ts
13
- import { importJs } from 'jails.std/import-js'
13
+ import { importJs } from 'jails.stdlib/import-js'
14
14
 
15
15
  importJs('https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js')
16
16
  .then( (event) => {
@@ -9,7 +9,7 @@ A simple version to detect if device has touch. It checks if it has `touchstart`
9
9
  ### Usage
10
10
 
11
11
  ```js
12
- import { isTouch } from 'jails.std/is-touch'
12
+ import { isTouch } from 'jails.stdlib/is-touch'
13
13
 
14
14
  async function main () {
15
15
  console.log( isTouch() ) // true if there's touchstart on window, or false otherwise.
@@ -11,7 +11,7 @@ It also wraps it in `Promise` so it can be used with `await` for more convinienc
11
11
  ### Usage
12
12
 
13
13
  ```js
14
- import { isVisible } from 'jails.std/is-visible'
14
+ import { isVisible } from 'jails.stdlib/is-visible'
15
15
 
16
16
  async function main () {
17
17
 
@@ -11,7 +11,7 @@ It's in fact the [vanilla-lazyload](https://github.com/verlok/vanilla-lazyload)
11
11
 
12
12
  ```ts
13
13
 
14
- import { Lazyload } from 'jails.std/lazyload-image'
14
+ import { Lazyload } from 'jails.stdlib/lazyload-image'
15
15
 
16
16
  function main () {
17
17
 
@@ -28,7 +28,7 @@ The `messenger` utility provides a lightweight, secure interface for sending and
28
28
  ### Parent Page
29
29
 
30
30
  ```ts
31
- import { messenger } from 'jails.std/messenger'
31
+ import { messenger } from 'jails.stdlib/messenger'
32
32
 
33
33
  const msg = messenger({
34
34
  target: document.getElementById('myIframe'), // <iframe id="myIframe" />
package/mfe/README.md CHANGED
@@ -14,7 +14,7 @@ It can embed a full html, css, js from an external url.
14
14
 
15
15
  ```ts
16
16
 
17
- import { mfe } from 'jails.std/mfe'
17
+ import { mfe } from 'jails.stdlib/mfe'
18
18
 
19
19
  function main () {
20
20
 
@@ -34,7 +34,7 @@ It can also embed a single page app from a external `.js` file.
34
34
 
35
35
  ```ts
36
36
 
37
- import { mfe } from 'jails.std/mfe'
37
+ import { mfe } from 'jails.stdlib/mfe'
38
38
 
39
39
  function main () {
40
40
 
@@ -63,7 +63,7 @@ Example:
63
63
  `main.ts`
64
64
 
65
65
  ```ts
66
- import { Shell } from 'jails.std/mfe'
66
+ import { Shell } from 'jails.stdlib/mfe'
67
67
 
68
68
  export const shell = Shell({
69
69
  somevariable,
@@ -79,7 +79,7 @@ export const shell = Shell({
79
79
  `main.ts`
80
80
 
81
81
  ```ts
82
- import { Shell } from 'jails.std/mfe'
82
+ import { Shell } from 'jails.stdlib/mfe'
83
83
 
84
84
  export const shell = Shell({
85
85
  somevariable,
package/outlet/README.md CHANGED
@@ -17,7 +17,7 @@ render( url: string ) : Promise<target: HTMLElement>
17
17
  ```
18
18
 
19
19
  ```ts
20
- import { Oultet } from 'jails.std/outlet'
20
+ import { Oultet } from 'jails.stdlib/outlet'
21
21
 
22
22
  const target = document.querySelector('[data-outlet]')
23
23
  const outlet = Outlet({ target })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jails.stdlib",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "The Jails Standard Library",
5
5
  "types": "index.d.ts",
6
6
  "repository": {
@@ -9,7 +9,7 @@ Returns a query string value.
9
9
  ### Usage
10
10
 
11
11
  ```js
12
- import { querystring } from 'jails.std/querystring'
12
+ import { querystring } from 'jails.stdlib/querystring'
13
13
 
14
14
  // https://my-awesome-site.com?search=david
15
15
  const { search } = querystring()
package/router/README.md CHANGED
@@ -11,7 +11,7 @@ Documentation : https://github.com/baseprime/grapnel
11
11
  ## Usage
12
12
 
13
13
  ```js
14
- import { Router } from 'jails.std/router'
14
+ import { Router } from 'jails.stdlib/router'
15
15
 
16
16
  const router = new Router()
17
17
 
package/storage/README.md CHANGED
@@ -8,7 +8,7 @@ The storage is a wrapper for the localStorage and sessionStorage global objects.
8
8
  ### For local storage
9
9
 
10
10
  ```js
11
- import { storage } from 'jails.std/storage'
11
+ import { storage } from 'jails.stdlib/storage'
12
12
 
13
13
  //Save data
14
14
  storage.local.set('item', { my :'item' }); // Save data and return { my:'item' }
package/store/README.md CHANGED
@@ -12,7 +12,7 @@ Store( initialState: Object , actions: Object )
12
12
  ## Usage
13
13
 
14
14
  ```js
15
- import { Store } from 'jails.std/store'
15
+ import { Store } from 'jails.stdlib/store'
16
16
 
17
17
  const initialState = {
18
18
  loading: false,
@@ -28,7 +28,7 @@ The `thirdParty` will execute the text script code and then will load the cdn li
28
28
  This way you can have the control of third party code execution and when it should be executed inside your application flow.
29
29
 
30
30
  ```js
31
- import { thirdParty } from 'jails.std/third-party'
31
+ import { thirdParty } from 'jails.stdlib/third-party'
32
32
 
33
33
  export const analytics = thirdParty('analytics')
34
34
 
@@ -9,7 +9,7 @@ Limits a function's execution to at most once per specified time interval.
9
9
  ### Usage
10
10
 
11
11
  ```js
12
- import { throttle } from 'jails.std/throttle'
12
+ import { throttle } from 'jails.stdlib/throttle'
13
13
 
14
14
  const onscroll = throttle(() => {
15
15
  console.log('throttling scroll')