amotify 0.2.119 → 0.2.120

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.
@@ -5,6 +5,7 @@ declare namespace Snackbar {
5
5
  type Methods = {
6
6
  add(props: AddInput): Snackbar.Methods;
7
7
  remove(snackID: string): Snackbar.Methods;
8
+ removeALL(): Snackbar.Methods;
8
9
  Wrapper(): JSX.Element;
9
10
  };
10
11
  type AddInput = Omit<Box.DefaultInput, 'children'> & {
@@ -1 +1 @@
1
- import{b as c,c as m,d as v}from"../chunk-C5N2D3ZX.js";import{Fragment as F,jsx as r,jsxs as M}from"react/jsx-runtime";import{createElement as R}from"react";import x,{UUID as f,useStore as p}from"jmini";import{Config as C,$$fromRoot as B}from"../@utils";import{useState as k,useEffect as S}from"react";import{Box as w,Flex as E,FAI as T}from"../atoms";import{Row as _}from"../mols";import{Button as y}from"./Button";import{SnackbarClasses as I}from"../@styles/componentClasses";const u={add:function(s){let t=p.get("Snackbar-"+C.get().sessionUID);return t&&t.add(s),this},remove:function(s){let t=p.get("Snackbar-"+C.get().sessionUID);return t&&t.remove(s),this},Wrapper:()=>r(A.Wrapper,{})},A={Cell:s=>{let b=s,{snackID:t,secondsToClose:o,componentID:g=f(),children:i,customChildren:e}=b,a=v(b,["snackID","secondsToClose","componentID","children","customChildren"]),[n]=k(g),[l,d]=k(s.secondsToClose||10);S(()=>{let D=B('[data-component-id="'+n+'"]');setTimeout(()=>{D.addClass(I("FadeIn"))},10),p.set({["Snackbar-"+t]:{remove:()=>{D.addClass(I("FadeOut"))}}})},[]),S(()=>{x.interval.once(()=>{l<=0||d(l-1)},1e3,"Snackbar-"+n),l===0&&u.remove(t)},[l]);let h=r(F,{});return e?h=r(e,{close:()=>{u.remove(t)}}):h=M(_.Separate,{verticalAlign:"top",children:[r(w,{padding:["1/4",0],flexSizing:0,children:x.is.function(i)?r(i,{}):i}),r(y.Clear,{color:"layer",backgroundColor:"layer.4.opa.low",fontColor:"white",ssSphere:2.5,onClick:()=>{u.remove(t)},children:r(T.Times,{})})]}),r(w,m(c({className:I("Cell"),componentID:n,onMouseOver:()=>{d(-1)},onMouseOut:()=>{d(o||10)},opacity:"trans",width:1,padding:"2/3",marginBottom:1,borderRadius:"1.tone.primary",fontColor:"white",boxShadow:"1.remark",backgroundColor:"dark",transition:"middle"},a),{children:h}))},Wrapper:()=>{let[s,t]=k(f()),[o,g]=k([]);S(()=>{p.set({["Snackbar-"+C.get().sessionUID]:{add:e=>{e.snackID=e.snackID||f();let a=o.findIndex(n=>n.snackID==e.snackID);if(a==-1)o.unshift(m(c({},e),{snackID:e.snackID}));else{let n=[...o];n[a]=m(c({},e),{snackID:e.snackID}),o=n}t(f())},remove:e=>{let a=p.get("Snackbar-"+e);a&&a.remove&&(a.remove(),setTimeout(()=>{let n=o.findIndex(d=>d.snackID==e);if(n==-1)return;let l=[...o];l.splice(n,1),g(l)},210))}}})},[o.length]);let i=o.map(e=>R(A.Cell,m(c({},e),{key:e.snackID})));return r(E,{className:["AMOTIFY_be","AMOTIFY_be_snackbar",I("Wrapper")].join(" "),position:"fixed",right:0,bottom:0,paddingLeft:0,paddingRight:1,paddingBottom:"safeAreaBottom",verticalAlign:"bottom",overflow:"auto",UnderBreakPointStyles:{left:0,paddingLeft:1,width:"auto"},children:i})}};export{u as Snackbar,u as default};
1
+ import{b as m,c as p,d as D}from"../chunk-C5N2D3ZX.js";import{Fragment as _,jsx as a,jsxs as y}from"react/jsx-runtime";import{createElement as M}from"react";import x,{UUID as k,useStore as l}from"jmini";import{Config as I,$$fromRoot as w}from"../@utils";import{useState as g,useEffect as b}from"react";import{Box as A,Flex as B,FAI as E}from"../atoms";import{Row as F}from"../mols";import{Button as T}from"./Button";import{SnackbarClasses as h}from"../@styles/componentClasses";const u={add:function(o){let t=l.get("Snackbar-"+I.get().sessionUID);return t&&t.add(o),this},remove:function(o){let t=l.get("Snackbar-"+I.get().sessionUID);return t&&t.remove(o),this},removeALL:function(){let o=l.get("Snackbar-"+I.get().sessionUID);return o&&o.removeALL(),this},Wrapper:()=>a(L.Wrapper,{})},L={Cell:o=>{let C=o,{snackID:t,secondsToClose:r,componentID:f=k(),children:d,customChildren:e}=C,s=D(C,["snackID","secondsToClose","componentID","children","customChildren"]),[n]=g(f),[i,c]=g(o.secondsToClose||10);b(()=>{let v=w('[data-component-id="'+n+'"]');setTimeout(()=>{v.addClass(h("FadeIn"))},10),l.set({["Snackbar-"+t]:{remove:()=>{v.addClass(h("FadeOut"))}}})},[]),b(()=>{x.interval.once(()=>{i<=0||c(i-1)},1e3,"Snackbar-"+n),i===0&&u.remove(t)},[i]);let S=a(_,{});return e?S=a(e,{close:()=>{u.remove(t)}}):S=y(F.Separate,{verticalAlign:"top",children:[a(A,{padding:["1/4",0],flexSizing:0,children:x.is.function(d)?a(d,{}):d}),a(T.Clear,{color:"layer",backgroundColor:"layer.4.opa.low",fontColor:"white",ssSphere:2.5,onClick:()=>{u.remove(t)},children:a(E.Times,{})})]}),a(A,p(m({className:h("Cell"),componentID:n,onMouseOver:()=>{c(-1)},onMouseOut:()=>{c(r||10)},opacity:"trans",width:1,padding:"2/3",marginBottom:1,borderRadius:"1.tone.primary",fontColor:"white",boxShadow:"1.remark",backgroundColor:"dark",transition:"middle"},s),{children:S}))},Wrapper:()=>{let[o,t]=g(k()),[r,f]=g([]);b(()=>{l.set({["Snackbar-"+I.get().sessionUID]:{add:e=>{e.snackID=e.snackID||k();let s=r.findIndex(n=>n.snackID==e.snackID);if(s==-1)r.unshift(p(m({},e),{snackID:e.snackID}));else{let n=[...r];n[s]=p(m({},e),{snackID:e.snackID}),r=n}t(k())},remove:e=>{let s=l.get("Snackbar-"+e);s&&s.remove&&(s.remove(),setTimeout(()=>{let n=r.findIndex(c=>c.snackID==e);if(n==-1)return;let i=[...r];i.splice(n,1),f(i)},210))},removeALL:()=>{f([])}}})},[r.length]);let d=r.map(e=>M(L.Cell,p(m({},e),{key:e.snackID})));return a(B,{className:["AMOTIFY_be","AMOTIFY_be_snackbar",h("Wrapper")].join(" "),position:"fixed",right:0,bottom:0,paddingLeft:0,paddingRight:1,paddingBottom:"safeAreaBottom",verticalAlign:"bottom",overflow:"auto",UnderBreakPointStyles:{left:0,paddingLeft:1,width:"auto"},children:d})}};export{u as Snackbar,u as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.2.119",
3
+ "version": "0.2.120",
4
4
  "description": "UI Component for React,NextJS,esbuild",
5
5
  "scripts": {
6
6
  "start": "run-p clean build:*",