mtxuilib 0.0.487 → 0.0.488

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.
@@ -14,6 +14,7 @@ export declare const curdStore: {
14
14
  get: <Value>(atom: import("jotai").Atom<Value>) => Value;
15
15
  set: <Value_1, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
16
16
  sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
17
+ } & Partial<{
17
18
  dev_subscribe_store: (l: (action: {
18
19
  type: "write";
19
20
  flushed: Set<import("jotai").Atom<unknown>>;
@@ -47,16 +48,7 @@ export declare const curdStore: {
47
48
  u?: (() => void) | undefined;
48
49
  } | undefined;
49
50
  dev_restore_atoms: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>) => void;
50
- } | {
51
- get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
52
- set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: import("jotai").WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
53
- sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
54
- dev_subscribe_store?: undefined;
55
- dev_get_mounted_atoms?: undefined;
56
- dev_get_atom_state?: undefined;
57
- dev_get_mounted?: undefined;
58
- dev_restore_atoms?: undefined;
59
- };
51
+ }>;
60
52
  export declare const CurdViewView: (props: {
61
53
  idOrName: string;
62
54
  } & PropsWithChildren) => import("react").JSX.Element;
@@ -26,4 +26,6 @@ export declare const demo1Atom: import("jotai").WritableAtom<(get: <Value>(atom:
26
26
  export declare const example102Atom: import("jotai").PrimitiveAtom<string> & {
27
27
  init: string;
28
28
  };
29
- export declare const exampleAsyncExampleAtom: import("jotai").Atom<Promise<unknown>>;
29
+ export declare const fetchPosts: (url: string) => Promise<unknown>;
30
+ export declare const exampleAsyncExampleAtom2: import("jotai").WritableAtom<any, [value: any], void>;
31
+ export declare const cached101Atom: import("jotai").Atom<Promise<unknown>>;
@@ -1 +1 @@
1
- "use client";var p=(e,o,t)=>new Promise((c,m)=>{var x=l=>{try{r(t.next(l))}catch(s){m(s)}},A=l=>{try{r(t.throw(l))}catch(s){m(s)}},r=l=>l.done?c(l.value):Promise.resolve(l.value).then(x,A);r((t=t.apply(e,o)).next())});import{atom as n}from"jotai";const a=n(1),b=n({callback:e=>e*2}),h=n((e,o)=>({getValue1:()=>e(a)}),(e,o,t)=>(o(a,t),{set1:c=>{console.log("set1 called"),o(a,10)}})),f=n("valueexample102Atom "),u=n("https://jsonplaceholder.typicode.com/posts"),g=n(e=>p(void 0,null,function*(){const o=e(u);return console.log("to fetch url",o),yield(yield fetch(e(u),{next:{revalidate:0}})).json()}));export{h as demo1Atom,b as doublerAtom,f as example102Atom,g as exampleAsyncExampleAtom,a as exampleValue100Atom};
1
+ "use client";var c=(e,t,o)=>new Promise((p,u)=>{var x=s=>{try{a(o.next(s))}catch(l){u(l)}},i=s=>{try{a(o.throw(s))}catch(l){u(l)}},a=s=>s.done?p(s.value):Promise.resolve(s.value).then(x,i);a((o=o.apply(e,t)).next())});import{atom as n}from"jotai";import{atomWithCache as A}from"jotai-cache";const m=n(1),b=n({callback:e=>e*2}),g=n((e,t)=>({getValue1:()=>e(m)}),(e,t,o)=>(t(m,o),{set1:p=>{console.log("set1 called"),t(m,10)}})),v=n("valueexample102Atom "),w=e=>c(void 0,null,function*(){return yield(yield fetch(e,{next:{revalidate:0}})).json()}),r=n(null),V=n(e=>{if(e(r))return console.log("return atom value",e(r)),e(r)},(e,t,o)=>{console.log("exampleAsyncExampleAtom2 set",o),t(r,o)}),d=n("1"),j=A(e=>c(void 0,null,function*(){const t=e(d);return(yield fetch(`https://reqres.in/api/users/${t}?delay=1`,{next:{revalidate:0}})).json()}));export{j as cached101Atom,g as demo1Atom,b as doublerAtom,v as example102Atom,V as exampleAsyncExampleAtom2,m as exampleValue100Atom,w as fetchPosts};
@@ -1,2 +1,5 @@
1
- /// <reference types="react" />
1
+ import { PropsWithChildren } from 'react';
2
2
  export declare const AtomMain: () => import("react").JSX.Element;
3
+ export declare const CacheAtom1Example: () => import("react").JSX.Element;
4
+ export declare const ReactUseExample: () => import("react").JSX.Element;
5
+ export declare const HydratePosts: (props: PropsWithChildren) => import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{Fragment as v,jsx as t,jsxs as e}from"react/jsx-runtime";import{useAtom as o}from"jotai";import{useHydrateAtoms as u}from"jotai/utils";import{MtButton as i}from"../../ui/ui-mt/Button";import{demo1Atom as n,doublerAtom as c,example102Atom as m,exampleValue100Atom as x}from"./AtomExample1.atom";import{ExampleAsync1 as A}from"./ExampleAsync";const k=()=>{const[l]=o(c),a=l.callback(50),[p,d]=o(n),[r,b]=o(x);u([[m,"example102(hydratedValue)---"]]);const[s,V]=o(m);return e(v,{children:[e("div",{className:"bg-blue-100 p-2",children:["example102Atom:",s]}),e("div",{children:["exampleValue100Atom: ",r]}),e("div",{children:["doubledValue: ",a]}),e("div",{children:[t(i,{onClick:()=>{d(100)},children:"set1"}),t("pre",{children:JSON.stringify(p,null,2)})]}),t(A,{})]})};export{k as AtomMain};
1
+ "use client";var u=(e,s,o)=>new Promise((n,p)=>{var i=a=>{try{l(o.next(a))}catch(d){p(d)}},c=a=>{try{l(o.throw(a))}catch(d){p(d)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,c);l((o=o.apply(e,s)).next())});import{Fragment as A,jsx as t,jsxs as m}from"react/jsx-runtime";import{useAtom as r}from"jotai";import{useHydrateAtoms as f}from"jotai/utils";import{Suspense as b,use as x}from"react";import{AtomsHydrator as v}from"../../lib/jotai-helper";import{MtButton as g}from"../../ui/ui-mt/Button";import{cached101Atom as E,demo1Atom as C,doublerAtom as H,example102Atom as y,exampleAsyncExampleAtom2 as N,exampleValue100Atom as S}from"./AtomExample1.atom";import{ExampleAsync1 as V}from"./ExampleAsync";const D=()=>{const[e]=r(H),s=e.callback(50),[o,n]=r(C),[p,i]=r(S);f([[y,"example102(hydratedValue)---"]]);const[c,l]=r(y);return m(A,{children:[m("div",{className:"bg-blue-100 p-2",children:["example102Atom:",c]}),m("div",{children:[t(g,{onClick:()=>{n(100)},children:"set1"}),t("pre",{children:JSON.stringify(o,null,2)})]}),t(b,{fallback:t(A,{children:"loading HydratePosts "}),children:t(P,{children:t(V,{})})})]})},L=()=>{const[e,s]=r(E);return m("div",{className:"bg-blue-300 p-2",children:["CacheAtom1Example",t("pre",{children:JSON.stringify(e,null,2)})]})},h=()=>u(void 0,null,function*(){return yield fetch(new URL("/api.v1/demo/posts","http://localhost:3338").toString()).then(e=>e.json())}),j=()=>{const e=x(h());return m("div",{className:"max-h-96 overflow-scroll bg-red-200 p-2",children:["react use data:",t("pre",{children:JSON.stringify(e,null,2)})]})},P=e=>{const s=x(h()),{children:o}=e;return t(v,{atomValues:[[N,s]],children:o})};export{D as AtomMain,L as CacheAtom1Example,P as HydratePosts,j as ReactUseExample};
@@ -1,2 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  export declare const ExampleAsync1: () => import("react").JSX.Element;
3
+ export declare const ExampleAsync1Inner: () => import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import{useAtom as p}from"jotai";import{exampleAsyncExampleAtom as l}from"./AtomExample1.atom";const n=()=>{const[m,r]=p(l);return e("div",{className:"border bg-red-200 p-2",children:e("pre",{children:JSON.stringify(m,null,2)})})};export{n as ExampleAsync1};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{useAtom as m}from"jotai";import{exampleAsyncExampleAtom2 as l}from"./AtomExample1.atom";const c=()=>e("div",{className:"max-h-96 overflow-scroll border bg-red-200 p-2",children:e(s,{})}),s=()=>{const[r,t]=m(l);return e("div",{className:"border bg-red-200 p-2",children:r==null?void 0:r.map((n,o)=>e("li",{children:n.title},o))})};export{c as ExampleAsync1,s as ExampleAsync1Inner};
@@ -20,6 +20,7 @@ export declare const mailLayoutStore: {
20
20
  get: <Value>(atom: import("jotai").Atom<Value>) => Value;
21
21
  set: <Value_1, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
22
22
  sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
23
+ } & Partial<{
23
24
  dev_subscribe_store: (l: (action: {
24
25
  type: "write";
25
26
  flushed: Set<import("jotai").Atom<unknown>>;
@@ -53,16 +54,7 @@ export declare const mailLayoutStore: {
53
54
  u?: (() => void) | undefined;
54
55
  } | undefined;
55
56
  dev_restore_atoms: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>) => void;
56
- } | {
57
- get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
58
- set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: import("jotai").WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
59
- sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
60
- dev_subscribe_store?: undefined;
61
- dev_get_mounted_atoms?: undefined;
62
- dev_get_atom_state?: undefined;
63
- dev_get_mounted?: undefined;
64
- dev_restore_atoms?: undefined;
65
- };
57
+ }>;
66
58
  export declare const MailLayout: (props: {} & PropsWithChildren) => import("react").JSX.Element;
67
59
  export declare const MailLayoutSidenav: (props: PropsWithChildren) => import("react").JSX.Element;
68
60
  export declare const MailLayoutList: (props: PropsWithChildren) => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const appBackendUrlAtom: import("jotai").PrimitiveAtom<string> & {
2
+ init: string;
3
+ };
@@ -0,0 +1 @@
1
+ "use client";import{atom as t}from"jotai";const p=t("http://localhost:3338");export{p as appBackendUrlAtom};
@@ -2,6 +2,7 @@ export declare const novelStore: {
2
2
  get: <Value>(atom: import("jotai").Atom<Value>) => Value;
3
3
  set: <Value_1, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
4
4
  sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
5
+ } & Partial<{
5
6
  dev_subscribe_store: (l: (action: {
6
7
  type: "write";
7
8
  flushed: Set<import("jotai").Atom<unknown>>;
@@ -35,13 +36,4 @@ export declare const novelStore: {
35
36
  u?: (() => void) | undefined;
36
37
  } | undefined;
37
38
  dev_restore_atoms: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>) => void;
38
- } | {
39
- get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
40
- set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: import("jotai").WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
41
- sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
42
- dev_subscribe_store?: undefined;
43
- dev_get_mounted_atoms?: undefined;
44
- dev_get_atom_state?: undefined;
45
- dev_get_mounted?: undefined;
46
- dev_restore_atoms?: undefined;
47
- };
39
+ }>;