amotify 0.2.233 → 0.2.234
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/dist/@declares/property.d.ts +1 -0
- package/dist/@utils/LaunchReactApp.d.ts +5 -3
- package/dist/atoms/Box.d.ts +2 -2
- package/dist/atoms/Box.js +1 -1
- package/dist/atoms/Logo.d.ts +14 -14
- package/dist/atoms/Logo.js +3 -3
- package/dist/fn/Button.d.ts +3 -3
- package/dist/fn/Button.js +1 -1
- package/dist/fn/Effect/index.d.ts +2 -2
- package/dist/fn/Input/Autocomplete.d.ts +3 -3
- package/dist/fn/Input/Autocomplete.js +1 -1
- package/dist/fn/Input/List.d.ts +12 -12
- package/dist/fn/Input/List.js +1 -1
- package/dist/fn/Input/Search.d.ts +1 -1
- package/dist/fn/Input/Search.js +1 -1
- package/dist/fn/Input/Segmented.d.ts +7 -7
- package/dist/fn/Input/Segmented.js +1 -1
- package/dist/fn/Input/Select.d.ts +1 -1
- package/dist/fn/Input/TextField.d.ts +1 -1
- package/dist/fn/Input/Time/index.d.ts +9 -9
- package/dist/fn/Input/Time/index.js +1 -1
- package/dist/fn/Loader/index.d.ts +1 -1
- package/dist/fn/Loader/index.js +1 -1
- package/dist/fn/Sheet.d.ts +3 -3
- package/dist/fn/Sheet.js +1 -1
- package/dist/fn/Snackbar.d.ts +3 -3
- package/dist/fn/Snackbar.js +1 -1
- package/dist/fn/Table/Data.d.ts +1 -1
- package/dist/fn/Table/Wrapper.d.ts +1 -1
- package/dist/fn/Table/Wrapper.js +1 -1
- package/dist/fn/Tooltips.d.ts +1 -1
- package/dist/index.d.ts +24 -24
- package/dist/mols/List.d.ts +6 -6
- package/dist/mols/List.js +1 -1
- package/dist/mols/Literal.d.ts +1 -1
- package/dist/mols/Literal.js +1 -1
- package/package.json +6 -6
- package/demo/next/src/app/(hooks)/useClientEffect.tsx +0 -83
- package/demo/next/src/app/(router)/designbook/page.tsx +0 -2891
- package/demo/next/src/app/(router)/page.tsx +0 -206
- package/demo/next/src/app/apis/test/route.ts +0 -9
- package/demo/next/src/app/layout.tsx +0 -26
- package/demo/next/src/server/app.ts +0 -42
- package/demo/next/src/server/fin.ts +0 -11
- package/demo/next/src/server/index.ts +0 -4
package/dist/fn/Loader/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as p}from"../../chunk-C5N2D3ZX.js";import{jsx as
|
|
1
|
+
import{b as p}from"../../chunk-C5N2D3ZX.js";import{jsx as a}from"react/jsx-runtime";import{useStore as n}from"jmini";import{Config as d,$$fromRoot as l}from"../../@utils";import{LoaderClasses as m}from"../../@styles/componentClasses";import{Mini as s}from"./mini";import{Corner as L}from"./corner";const i=e=>{let t=e.color;return{S:o=>a(s,p({size:"S",color:t},o)),R:o=>a(s,p({size:"R",color:t},o)),L:o=>a(s,p({size:"L",color:t},o)),XL:o=>a(s,p({size:"XL",color:t},o)),MAX:o=>a(s,p({size:"MAX",color:t},o))}},c={Wrapper:()=>a(L,{}),Theme:i({color:"theme"}),Posi:i({color:"posi"}),Nega:i({color:"nega"}),Warn:i({color:"warn"}),White:i({color:"white"}),Cloud:i({color:"cloud"}),fn:{corner:{active:()=>{let e=n.get("Loader-corner-"+d.get().sessionUID+"-corner");e&&e.active()},stop:()=>{let e=n.get("Loader-corner-"+d.get().sessionUID+"-corner");e&&e.stop()}},mini:{active:(e="")=>{l("."+m("MiniLoader")).for(t=>{let{dataset:{componentId:o}={}}=t;if(!o)return;let r=n.get(o);r&&r.active&&r.active(e)})},stop:(e="")=>{l("."+m("MiniLoader")).for(t=>{let{dataset:{componentId:o}={}}=t;if(!o)return;let r=n.get(o);r&&r.stop&&r.stop(e)})},stopALL:()=>{l("."+m("MiniLoader")).for(e=>{let{dataset:{componentId:t}={}}=e;if(!t)return;let o=n.get(t);o&&o.stopForce&&o.stopForce()})}},stopALL:()=>{c.fn.corner.stop(),c.fn.mini.stopALL()}}};export{c as Loader,c as default};
|
package/dist/fn/Sheet.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import React from 'react';
|
|
|
4
4
|
import { Box } from '../atoms';
|
|
5
5
|
declare namespace Sheet {
|
|
6
6
|
type Methods = {
|
|
7
|
-
Wrapper(): JSX.Element;
|
|
7
|
+
Wrapper(): React.JSX.Element;
|
|
8
8
|
Element<T extends keyof TypesInput>(p: Omit<TypesInput[T], 'content'> & {
|
|
9
9
|
type: T;
|
|
10
10
|
isOpen: boolean;
|
|
11
11
|
children: ReactElement;
|
|
12
|
-
}): JSX.Element;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
13
|
image(params: Omit<UniInput, 'content'>, src: string | string[]): void;
|
|
14
14
|
open<T extends keyof TypesInput>(type: T, params: TypesInput[T], defaultOpen?: boolean | 'inherit'): void;
|
|
15
15
|
resize(p: {
|
|
@@ -71,7 +71,7 @@ declare namespace Sheet {
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
type Sizes = 'S' | 'R' | 'L' | '2L' | '3L' | 'MAX';
|
|
74
|
-
type Content = ReactElement | (() => JSX.Element);
|
|
74
|
+
type Content = ReactElement | (() => React.JSX.Element);
|
|
75
75
|
type CloseOptions = {
|
|
76
76
|
closeAtPageTransit?: boolean;
|
|
77
77
|
closeAtEscapeKeyDown?: boolean;
|
package/dist/fn/Sheet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as m,c as b,d as G}from"../chunk-C5N2D3ZX.js";import{Fragment as ae,jsx as h,jsxs as F}from"react/jsx-runtime";import d,{UUID as Z,Time as le,useStore as w}from"jmini";import{useState as U,useEffect as H,useRef as pe}from"react";import{$$fromRoot as K,Config as X}from"../@utils";import{Box as R,Flex as ue,Img as he,FAI as re,Column as oe,Grid as ce}from"../atoms";import{Row as ne}from"../mols";import{Button as ie}from"./Button";import{SheetClasses as g}from"../@styles/componentClasses";import de from"./Plate";const x={currentIndex:0,openQueue:{},getSessionStates:()=>{let t=w.get("sessionStates-"+X.get().sessionUID);return t||null},getNewSheetStates:t=>{var u;let e=b(m({sheetGroups:t.sheetGroups||[],backgroundEffect:!0,overwrap:t.type=="custom",hold_state:!1,closeAtPageTransit:!0,closeAtEscapeKeyDown:!0,closeAtAroundClick:t.type=="custom"},t),{sheetID:t.sheetID||Z(),isOpen:!0,created_at:le()});if(e.type=="custom"){let a=e;a.parent=a.parent||((u=a==null?void 0:a.event)==null?void 0:u.currentTarget),e=a}return e}},$={Wrapper:()=>{let[t,e]=U([]),u={val_sheets:t,set_sheets:e},a="sessionStates-"+X.get().sessionUID;return w.set({[a]:u}),H(()=>{let c="Sheet-"+X.get().sessionUID;w.set({[c]:{add:(r,s)=>{let i=w.get(c);if(!i)return;let o=x.getNewSheetStates(r);if(x.openQueue[o.sheetID])return;if(x.openQueue[o.sheetID]=!0,s!="inherit"&&(o.isOpen=s!=null?s:!0),!!i.find(o.sheetID)){e(C=>{let E=[...C],D=E.findIndex(L=>L.sheetID==o.sheetID);return D==-1||(E[D]=o),E}),delete x.openQueue[o.sheetID];return}e(C=>[o,...C])},find:r=>{let s=x.getSessionStates();if(!s)return null;let{val_sheets:i}=s;return i.find(o=>o.sheetID==r)}}}),d(X.get().appRoot).removeEvent(["SheetEvent.keyUp","SheetEvent.Click"]).addEvent({eventType:"keyup",eventID:"SheetEvent.keyUp",callback:function(r){let{key:s,metaKey:i}=r;if(s=="Escape"||s==","&&i){let o=x.getSessionStates();if(!o)return;let{val_sheets:v}=o,C=v.filter(D=>D.isOpen);if(!C.length)return;let E=C.reduce((D,L)=>D.created_at.value>L.created_at.value?D:L);A.close(E.sheetID,s)}}}).addEvent({eventType:"click",eventID:"SheetEvent.Click",callback:function(r){let s=x.getSessionStates();if(!s)return;let{val_sheets:i}=s,o=r.target;if(!o||o!=null&&o.closest("."+g("CustomSheet")))return;let v=i.filter(C=>C.type=="custom");v.length&&v.forEach(C=>{let{parent:E}=C;if(!C.closeAtAroundClick)return;let D=K(E)[0];E!==o&&D!==o&&(d(D).find(o).length||A.close(C.sheetID))})}})},[]),h(ae,{children:t.map(c=>h($.Core,b(m({},u),{val_sheet:c,patch_sheet:r=>{e(s=>{let i=[...s],o=i.findIndex(v=>v.sheetID==c.sheetID);return o==-1||(i[o]=m(m({},i[o]),r)),i})},delete_sheet:()=>{e(r=>{let s=[...r],i=s.findIndex(o=>o.sheetID==c.sheetID);return i==-1||s.splice(i,1),s})}}),c.sheetID))})},sheetCategory:t=>t=="custom"?"custom":t.startsWith("drawer")?"drawer":"normal",sheetPosition:t=>t=="drawer.left"?"left":t=="drawer.right"?"right":t=="drawer.bottom"?"bottom":"",Core:t=>{let{val_sheet:e,patch_sheet:u}=t,[a,c]=U(x.currentIndex+2),[r]=U(Z()),s=e.type!="custom"&&!e.overwrap;H(()=>{x.currentIndex++,d.scope(()=>{if(!e.closeAtParentBlur)return;let o=d(e.parent);o[0]&&o.addEvent({eventID:"SheetClosation-"+e.sheetID,eventType:"mouseout",callback:()=>{o.removeEvent("SheetClosation-"+e.sheetID),u({isOpen:!1})}})}),w.set({[e.sheetID]:{resize:o=>{if(e.type=="drawer.bottom"){let v=w.get(r);v&&v.resize&&v.resize(o)}else(e.type.includes("normal")||e.type.includes("drawer"))&&u({size:o})},close:o=>{u({isOpen:!1})},open:()=>{u({isOpen:!0})}}})},[]),H(()=>{d.scope(()=>{let o=K("#"+r);if(e.isOpen){e.hold_state&&c(x.currentIndex+1),o.await(10).removeClass(g("Hide")).await(10).addClass(g("Open")).callback(()=>{delete x.openQueue[e.sheetID],e.onOpen&&e.onOpen()});return}o.await(10).removeClass(g("Open")).await(251).addClass(g("Hide")).callback(()=>{if(e.onClose&&e.onClose(),s&&X.get().browserIs!="safari"&&d(X.get().appRoot).focus(),e.hold_state)return u({isOpen:!1});t.delete_sheet()})})},[e.isOpen]);let i=$.Types[{topLeft:"Normal",topCenter:"Normal",topRight:"Normal",middleLeft:"Normal",middleCenter:"Normal",middleRight:"Normal",bottomLeft:"Normal",bottomCenter:"Normal",bottomRight:"Normal","drawer.left":"Edge","drawer.right":"Edge","drawer.bottom":"Bottom",custom:"Custom"}[e.type]];return h(R,{className:["AMOTIFY_be",g("Wrap"),g("Tcate_"+$.sheetCategory(e.type)),g("Tpos_"+$.sheetPosition(e.type)),g("isMainSheet_"+s)].join(" "),width:1,ssAbsoluteCovered:!0,position:"fixed",freeCSS:{zIndex:a},id:r,children:F(oe,{className:g("Content"),gap:0,height:"viewHeight",overflow:"auto",transition:"middle",children:[!!s&&h(R,{className:g("TapSensor"),position:"sticky",top:0,height:0,width:1,flexSizing:"none",children:h(R,{backgroundColor:"trans",height:"viewHeight",position:"absolute",top:0,width:1,className:g("TapContent"),onClick:o=>{var C;((C=e.closeAtAroundClick)==null||C)&&A.close(e.sheetID)}})}),h(i,m({componentId:r},e))]})},r)},Types:{Normal:t=>{let k=t,{sheetID:e,sheetGroups:u,bodyScrolls:a,content:c,className:r="",type:s,size:i="R",freeCSS:o,onOpen:v,onClose:C,closeAtAroundClick:E,closeAtEscapeKeyDown:D,closeAtPageTransit:L,closeAtParentBlur:J,closeAtSwipeDown:Y,hold_state:q,overwrap:ee,isOpen:te,backgroundEffect:N}=k,M=G(k,["sheetID","sheetGroups","bodyScrolls","content","className","type","size","freeCSS","onOpen","onClose","closeAtAroundClick","closeAtEscapeKeyDown","closeAtPageTransit","closeAtParentBlur","closeAtSwipeDown","hold_state","overwrap","isOpen","backgroundEffect"]),T={},y=[];return s.match(/top/)?(y.push("top"),T.marginBottom="auto"):s.match(/middle/)?(y.push("center"),T.marginTop="auto",T.marginBottom="auto"):s.match(/bottom/)&&(y.push("bottom"),T.marginTop="auto"),s.match(/left/i)?(y.push("left"),T.marginRight="auto"):s.match(/center/i)?(y.push("center"),T.marginLeft="auto",T.marginRight="auto"):s.match(/right/i)&&(y.push("right"),T.marginLeft="auto"),h(R,b(m(m({className:[g("BB"),r].join(" "),padding:1,transition:"short",opacity:"trans"},M),T),{freeCSS:m({width:{S:"26rem",R:"36rem",L:"44rem","2L":"60rem","3L":"72rem",MAX:"100%"}[i],maxWidth:"96vw",transformOrigin:y.join(" ")},o),children:d.is.function(c)?h(c,{}):c}))},Edge:t=>{let M=t,{sheetID:e,sheetGroups:u,bodyScrolls:a,type:c,content:r,className:s="",size:i="R",onOpen:o,onClose:v,closeAtAroundClick:C,closeAtEscapeKeyDown:E,closeAtPageTransit:D,closeAtParentBlur:L,closeAtSwipeDown:J,hold_state:Y,overwrap:q,isOpen:ee,backgroundEffect:te}=M,N=G(M,["sheetID","sheetGroups","bodyScrolls","type","content","className","size","onOpen","onClose","closeAtAroundClick","closeAtEscapeKeyDown","closeAtPageTransit","closeAtParentBlur","closeAtSwipeDown","hold_state","overwrap","isOpen","backgroundEffect"]);return h(R,b(m(b(m({className:[g("BB"),s].join(" ")},c=="drawer.right"?{marginLeft:"auto"}:c=="drawer.left"?{marginRight:"auto"}:{}),{opacity:"trans",transition:"short",position:"relative",backgroundColor:"layer.1",flexSizing:"none",minHeight:"viewHeight",boxShadow:"3.remark"}),N),{freeCSS:m({width:{S:"20rem",R:"27rem",L:"32rem","2L":"40rem","3L":"58rem",MAX:"100vw"}[i],maxWidth:"96vw"},N.freeCSS),children:d.is.function(r)?h(r,{}):r}))},Bottom:t=>{let j=t,{componentId:e,sheetID:u,sheetGroups:a,bodyScrolls:c,content:r,size:s="R",sizeChanged:i,baseStyles:o,onOpen:v,onClose:C,closeAtAroundClick:E,closeAtEscapeKeyDown:D,closeAtPageTransit:L,closeAtParentBlur:J,closeAtSwipeDown:Y=!0,hold_state:q,overwrap:ee,isOpen:te,backgroundEffect:N}=j,M=G(j,["componentId","sheetID","sheetGroups","bodyScrolls","content","size","sizeChanged","baseStyles","onOpen","onClose","closeAtAroundClick","closeAtEscapeKeyDown","closeAtPageTransit","closeAtParentBlur","closeAtSwipeDown","hold_state","overwrap","isOpen","backgroundEffect"]),T=d.getScreenSize(),y=[0,.2,.6,.95],k={ZERO:0,S:1,R:2,L:3,"2L":3,"3L":3,MAX:3},[W,Q]=U(s),[I,_]=U({process:!1,processStart:0,originY:0,originValue:0,viewHeight:0,value:y[k[s]]});w.update({[e]:{val_edit:I,resize:S=>{let f=y[k[S]];_(p=>b(m({},p),{value:f})),Q(S)}}});const B={Start:S=>{d(document).addEvent({eventID:"BottomSheetMouseMove",eventType:"mousemove",callback:B.Move,options:{passive:!1}}).addEvent({eventID:"BottomSheetTouchMove",eventType:"touchmove",callback:B.Move,options:{passive:!1}}).addEvent({eventID:"BottomSheetMouseUp",eventType:"mouseup",callback:B.End}).addEvent({eventID:"BottomSheetTouchEnd",eventType:"touchend",callback:B.End});let f=d.getCursor(S),p=b(m({},I),{process:!0,processStart:new Date().getTime(),originY:f.y,originValue:I.value,viewHeight:d.getScreenSize().height});w.update({[e]:{val_edit:p}}),_(p)},Move:S=>{var O;let f=(O=w.get(e))==null?void 0:O.val_edit;if(!f.process)return;let z=(d.getCursor(S).y-f.originY)/f.viewHeight,n=f.originValue-z;if(n>.95)n=.95+(n-.95)*.5;else if(n<.2){let P=.2-n;P-=.1,n=.1+(.1-P)*.5}return _(b(m({},f),{value:n})),S.preventDefault(),S.stopPropagation(),!1},End:S=>{var n;let f=(n=w.get(e))==null?void 0:n.val_edit;if(!f.process)return;d(document).removeEvent(["BottomSheetMouseMove","BottomSheetTouchMove","BottomSheetMouseUp","BottomSheetTouchEnd"]);let p=0;if(f.value<.1||(f.value<.5?p=1:f.value>.75?p=3:p=2),new Date().getTime()-f.processStart<300){let O=d.getCursor(S).y-f.originY;if(Math.abs(O)>=20){let P=+(O<0)*2-1;p+=P,p=Math.min(Math.max(p,0),y.length-1)}}p==0&&(Y||(p=1)),Q(["ZERO","S","R","L"][p]),_(b(m({},f),{value:y[p],process:!1}))}},V=pe(!1);return H(()=>{V.current?W=="ZERO"?Y&&A.close(u):setTimeout(()=>{t.sizeChanged&&t.sizeChanged(W)},250):V.current=!0},[W]),h(R,{className:g("BB"),margin:[0,"auto"],marginTop:"auto",opacity:"trans",width:1,transition:"long",freeCSS:m({maxWidth:12*60,height:T.height*I.value},I.process?{transition:"0s"}:{}),children:F(oe,b(m({gap:0,flexSizing:"none",borderTopLeftRadius:"1.tone.primary",borderTopRightRadius:"1.tone.primary",borderBottom:"unset",boxShadow:"3.remark",position:"relative",overflow:"hidden",height:1},o),{children:[F(ne.Separate,{padding:1,backgroundColor:"layer.1",position:"relative",freeCSS:{userSelect:"none"},children:[h(R,{ssSphere:2.5}),h(ne.Center,{onPointerDown:B.Start,flexSizing:0,padding:"2/3",ssPushable:!0,isRounded:!0,freeCSS:{cursor:"grab",userSelect:"none"},children:h(R,{unitWidth:6,unitHeight:"1/2",backgroundColor:"layer.4",isRounded:!0,className:g("DragBar")})}),h(ie.Sub,{color:"cloud",ssSphere:2.5,onClick:()=>{A.close(u)},children:h(re.X,{})})]}),h(R,b(m({backgroundColor:"layer.1",flexSizing:0,overflow:"auto"},M),{children:d.is.function(r)?h(r,{}):r}))]}))})},Custom:t=>{let j=t,{sheetID:e,sheetGroups:u,bodyScrolls:a,event:c,parent:r,nextToCursor:s,gravityPoint:i=22,content:o,closeAtAroundClick:v,closeAtEscapeKeyDown:C,closeAtPageTransit:E,closeAtParentBlur:D,closeAtSwipeDown:L,hold_state:J,onOpen:Y,onClose:q,overwrap:ee,isOpen:te,resize:N,backgroundEffect:M}=j,T=G(j,["sheetID","sheetGroups","bodyScrolls","event","parent","nextToCursor","gravityPoint","content","closeAtAroundClick","closeAtEscapeKeyDown","closeAtPageTransit","closeAtParentBlur","closeAtSwipeDown","hold_state","onOpen","onClose","overwrap","isOpen","resize","backgroundEffect"]),[y]=U(Z()),k=d.is.element(r)||d.is.jmini(r)?d(r):K(r),W='[data-sheet-id="'+y+'"]',Q='[data-sheet-content="'+y+'"]';i=i;let I=i%5||5,_=Math.ceil(i/5);const B={Init:()=>{if(s&&c){let l=d.getScreenSize(),se=d.getCursor(c);return{top:se.y-l.pageYOffset,left:se.x-l.pageXOffset}}let S={};if(!k||!k[0])return S;let{top:f,right:p,bottom:z,left:n,height:O,width:P}=k.position();return[1,2].includes(I)?S.left=n:I==3?S.left=n+P/2:[4,5].includes(I)&&(S.left=p),i<=10?S.top=f:i<=15?S.top=f+O/2:i<=25&&(S.top=z),S},Adjust:()=>{let S=K(W).position(),f=K(Q).position(),p=k.position(),z=d.getScreenSize(),n={};for(let l in f)n[l]=f[l];if(d.scope(()=>{if(t.nextToCursor)return;let l=0;_==1?l=p.top-n.bottom:_==2?l=p.top-n.top:_==3?l=p.top-n.top+(p.height-n.height)/2:_==4?l=p.bottom-n.bottom:_==5&&(l=p.bottom-n.top),n.top+=l,n.bottom+=l}),d.scope(()=>{if(t.nextToCursor)return;let l=0;I==1?l=p.left-n.right:I==2?l=p.left-n.left:I==3?l=p.left-n.left+(p.width-n.width)/2:I==4?l=p.right-n.right:I==5&&(l=p.right-n.left),n.left+=l,n.right+=l}),n.top<0){let l=-n.top;n.top+=l,n.bottom+=l}if(n.bottom>z.height){let l=n.bottom-z.height;n.top-=l,n.bottom-=l}if(n.left<0){let l=-n.left;n.left+=l,n.right+=l}if(n.right>z.width){let l=n.right-z.width;n.left-=l,n.right-=l}let O=n.top-f.top,P=n.left-f.left;d(W).css({top:S.top+O+"px",left:S.left+P+"px"})}};let[V]=U(B.Init());return H(()=>{K(W).await(10).addClass(g("Open")).await(200).callback(()=>{(N==null||N)&&B.Adjust()}),w.update({["customSheet-"+t.sheetID]:{reposition:()=>{B.Adjust()}}})},[]),k[0]?h(R,{className:[g("BB"),g("CustomSheet")].join(" "),"data-sheet-id":y,transition:"long",position:"absolute",width:0,height:0,opacity:"trans",flexCenter:!0,freeCSS:V,children:h(ue,{position:"absolute",className:[g("GPT"),g("GPT_"+i),g("Col_"+I),g("Row_"+_)].join(" "),children:h(R,b(m({"data-sheet-content":y,flexSizing:"none",maxHeight:"viewHeight"},T),{freeCSS:m({maxWidth:"98vw"},T.freeCSS),children:d.is.function(o)?h(o,{}):o}))})}):null}}},A={Wrapper:()=>h($.Wrapper,{}),Element:t=>{let c=t,{isOpen:e,children:u}=c,a=G(c,["isOpen","children"]);return H(()=>{if(e){A.open(t.type,b(m({},a),{content:u}));return}a.sheetID&&A.close(a.sheetID)},[e]),h(ae,{})},image:(t,e)=>{let u=t.sheetID||Z(),r=t,{type:a}=r,c=G(r,["type"]);A.open(a||"topCenter",b(m({size:"MAX"},c),{sheetID:u,freeCSS:{maxWidth:"100vw"},content:()=>{let[s]=U(d.flatArray(e));return h(de,{children:F(oe,{children:[h(ne.Right,{children:F(ie.Sub.S,{color:"cloud",isRounded:!0,onClick:()=>{A.close(u)},children:[h(re.X,{})," \u9589\u3058\u308B"]})}),h(ce.Layout,{gap:1,gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"repeat(2,auto)",gridChildTemplates:[["span 3",0],["span 2","span 2"],[0,0],[0,0],[0,"span 2"],["span 2",0],[0,0],[0,0]],children:s.map((i,o)=>h(he,{ssCardBox:!0,position:"relative",flexCenter:!0,src:i},o))})]})})}}))},open:(t,e,u)=>{e.sheetID=(e.sheetID||"").replace(/\./g,"-"),e.type=t;let a=w.get("Sheet-"+X.get().sessionUID);a&&a.add(e,u)},resize:t=>{t.sheetID=(t.sheetID||"").replace(/\./g,"-");let e=w.get(t.sheetID);e&&e.resize&&e.resize(t.size)},customSheet:{reposition:t=>{let e=w.get("customSheet-"+t);e&&e.reposition&&e.reposition()}},close:function(t,e,u){let a=x.getSessionStates();if(!a)return;let{val_sheets:c}=a;t=t==null?void 0:t.replace(/\./g,"-");let r=c.find(i=>i.sheetID==t);if(!r||e=="Escape"&&!r.closeAtEscapeKeyDown)return;let s=w.get(r.sheetID);s&&s.close&&s.close(u)},closeGroup:t=>{let e=x.getSessionStates();if(!e)return;let{val_sheets:u}=e;t=(t||"").replace(/\./g,"-");for(let a of u)a.sheetGroups&&a.sheetGroups==t&&A.close(a.sheetID)},closeAll:t=>{let e=x.getSessionStates();if(!e)return;let{val_sheets:u}=e;for(let a of u)t&&!a.closeAtPageTransit||A.close(a.sheetID,"pageTransit",!0)},Body:t=>h(R,m({className:g("BaseBody"),backgroundColor:"layer.1",borderRadius:"1.tone.primary",position:"relative",boxShadow:"3.remark",transition:"long"},t))};export{A as Sheet,A as default};
|
|
1
|
+
import{b as m,c as b,d as G}from"../chunk-C5N2D3ZX.js";import{Fragment as ae,jsx as h,jsxs as F}from"react/jsx-runtime";import d,{UUID as Z,Time as le,useStore as w}from"jmini";import{useState as U,useEffect as H,useRef as pe}from"react";import{$$fromRoot as K,Config as X}from"../@utils";import{Box as A,Flex as ue,Img as he,FAI as re,Column as oe,Grid as ce}from"../atoms";import{Row as ne}from"../mols";import{Button as ie}from"./Button";import{SheetClasses as g}from"../@styles/componentClasses";import de from"./Plate";const x={currentIndex:0,openQueue:{},getSessionStates:()=>{let t=w.get("sessionStates-"+X.get().sessionUID);return t||null},getNewSheetStates:t=>{var u;let e=b(m({sheetGroups:t.sheetGroups||[],backgroundEffect:!0,overwrap:t.type=="custom",hold_state:!1,closeAtPageTransit:!0,closeAtEscapeKeyDown:!0,closeAtAroundClick:t.type=="custom"},t),{sheetID:t.sheetID||Z(),isOpen:!0,created_at:le()});if(e.type=="custom"){let a=e;a.parent=a.parent||((u=a==null?void 0:a.event)==null?void 0:u.currentTarget),e=a}return e}},$={Wrapper:()=>{let[t,e]=U([]),u={val_sheets:t,set_sheets:e},a="sessionStates-"+X.get().sessionUID;return w.set({[a]:u}),H(()=>{let c="Sheet-"+X.get().sessionUID;w.set({[c]:{add:(r,s)=>{let i=w.get(c);if(!i)return;let o=x.getNewSheetStates(r);if(x.openQueue[o.sheetID])return;if(x.openQueue[o.sheetID]=!0,s!="inherit"&&(o.isOpen=s!=null?s:!0),!!i.find(o.sheetID)){e(C=>{let R=[...C],D=R.findIndex(L=>L.sheetID==o.sheetID);return D==-1||(R[D]=o),R}),delete x.openQueue[o.sheetID];return}e(C=>[o,...C])},find:r=>{let s=x.getSessionStates();if(!s)return null;let{val_sheets:i}=s;return i.find(o=>o.sheetID==r)}}}),d(X.get().appRoot).removeEvent(["SheetEvent.keyUp","SheetEvent.Click"]).addEvent({eventType:"keyup",eventID:"SheetEvent.keyUp",callback:function(r){let{key:s,metaKey:i}=r;if(s=="Escape"||s==","&&i){let o=x.getSessionStates();if(!o)return;let{val_sheets:v}=o,C=v.filter(D=>D.isOpen);if(!C.length)return;let R=C.reduce((D,L)=>D.created_at.value>L.created_at.value?D:L);E.close(R.sheetID,s)}}}).addEvent({eventType:"click",eventID:"SheetEvent.Click",callback:function(r){let s=x.getSessionStates();if(!s)return;let{val_sheets:i}=s,o=r.target;if(!o||o!=null&&o.closest("."+g("CustomSheet")))return;let v=i.filter(C=>C.type=="custom");v.length&&v.forEach(C=>{let{parent:R}=C;if(!C.closeAtAroundClick)return;let D=K(R)[0];R!==o&&D!==o&&(d(D).find(o).length||E.close(C.sheetID))})}})},[]),h(ae,{children:t.map(c=>h($.Core,b(m({},u),{val_sheet:c,patch_sheet:r=>{e(s=>{let i=[...s],o=i.findIndex(v=>v.sheetID==c.sheetID);return o==-1||(i[o]=m(m({},i[o]),r)),i})},delete_sheet:()=>{e(r=>{let s=[...r],i=s.findIndex(o=>o.sheetID==c.sheetID);return i==-1||s.splice(i,1),s})}}),c.sheetID))})},sheetCategory:t=>t=="custom"?"custom":t.startsWith("drawer")?"drawer":"normal",sheetPosition:t=>t=="drawer.left"?"left":t=="drawer.right"?"right":t=="drawer.bottom"?"bottom":"",Core:t=>{let{val_sheet:e,patch_sheet:u}=t,[a,c]=U(x.currentIndex+2),[r]=U(Z()),s=e.type!="custom"&&!e.overwrap;H(()=>{x.currentIndex++,d.scope(()=>{if(!e.closeAtParentBlur)return;let o=d(e.parent);o[0]&&o.addEvent({eventID:"SheetClosation-"+e.sheetID,eventType:"mouseout",callback:()=>{o.removeEvent("SheetClosation-"+e.sheetID),u({isOpen:!1})}})}),w.set({[e.sheetID]:{resize:o=>{if(e.type=="drawer.bottom"){let v=w.get(r);v&&v.resize&&v.resize(o)}else(e.type.includes("normal")||e.type.includes("drawer"))&&u({size:o})},close:o=>{u({isOpen:!1})},open:()=>{u({isOpen:!0})}}})},[]),H(()=>{d.scope(()=>{let o=K("#"+r);if(e.isOpen){e.hold_state&&c(x.currentIndex+1),o.await(10).removeClass(g("Hide")).await(10).addClass(g("Open")).callback(()=>{delete x.openQueue[e.sheetID],e.onOpen&&e.onOpen()});return}o.await(10).removeClass(g("Open")).await(251).addClass(g("Hide")).callback(()=>{if(e.onClose&&e.onClose(),s&&X.get().browserIs!="safari"&&d(X.get().appRoot).focus(),e.hold_state)return u({isOpen:!1});t.delete_sheet()})})},[e.isOpen]);let i=$.Types[{topLeft:"Normal",topCenter:"Normal",topRight:"Normal",middleLeft:"Normal",middleCenter:"Normal",middleRight:"Normal",bottomLeft:"Normal",bottomCenter:"Normal",bottomRight:"Normal","drawer.left":"Edge","drawer.right":"Edge","drawer.bottom":"Bottom",custom:"Custom"}[e.type]];return h(A,{className:["AMOTIFY_be",g("Wrap"),g("Tcate_"+$.sheetCategory(e.type)),g("Tpos_"+$.sheetPosition(e.type)),g("isMainSheet_"+s)].join(" "),width:1,ssAbsoluteCovered:!0,position:"fixed",freeCSS:{zIndex:a},id:r,children:F(oe,{className:g("Content"),gap:0,height:"viewHeight",overflow:"auto",transition:"middle",children:[!!s&&h(A,{className:g("TapSensor"),position:"sticky",top:0,height:0,width:1,flexSizing:"none",children:h(A,{backgroundColor:"trans",height:"viewHeight",position:"absolute",top:0,width:1,className:g("TapContent"),onClick:o=>{var C;((C=e.closeAtAroundClick)==null||C)&&E.close(e.sheetID)}})}),h(i,m({componentId:r},e))]})},r)},Types:{Normal:t=>{let k=t,{sheetID:e,sheetGroups:u,bodyScrolls:a,content:c,className:r="",type:s,size:i="R",freeCSS:o,onOpen:v,onClose:C,closeAtAroundClick:R,closeAtEscapeKeyDown:D,closeAtPageTransit:L,closeAtParentBlur:J,closeAtSwipeDown:Y,hold_state:q,overwrap:ee,isOpen:te,backgroundEffect:N}=k,M=G(k,["sheetID","sheetGroups","bodyScrolls","content","className","type","size","freeCSS","onOpen","onClose","closeAtAroundClick","closeAtEscapeKeyDown","closeAtPageTransit","closeAtParentBlur","closeAtSwipeDown","hold_state","overwrap","isOpen","backgroundEffect"]),T={},y=[];return s.match(/top/)?(y.push("top"),T.marginBottom="auto"):s.match(/middle/)?(y.push("center"),T.marginTop="auto",T.marginBottom="auto"):s.match(/bottom/)&&(y.push("bottom"),T.marginTop="auto"),s.match(/left/i)?(y.push("left"),T.marginRight="auto"):s.match(/center/i)?(y.push("center"),T.marginLeft="auto",T.marginRight="auto"):s.match(/right/i)&&(y.push("right"),T.marginLeft="auto"),h(A,b(m(m({className:[g("BB"),r].join(" "),padding:1,transition:"short",opacity:"trans"},M),T),{freeCSS:m({width:{S:"26rem",R:"36rem",L:"44rem","2L":"60rem","3L":"72rem",MAX:"100%"}[i],maxWidth:"96vw",transformOrigin:y.join(" ")},o),children:d.is.function(c)?h(c,{}):c}))},Edge:t=>{let M=t,{sheetID:e,sheetGroups:u,bodyScrolls:a,type:c,content:r,className:s="",size:i="R",onOpen:o,onClose:v,closeAtAroundClick:C,closeAtEscapeKeyDown:R,closeAtPageTransit:D,closeAtParentBlur:L,closeAtSwipeDown:J,hold_state:Y,overwrap:q,isOpen:ee,backgroundEffect:te}=M,N=G(M,["sheetID","sheetGroups","bodyScrolls","type","content","className","size","onOpen","onClose","closeAtAroundClick","closeAtEscapeKeyDown","closeAtPageTransit","closeAtParentBlur","closeAtSwipeDown","hold_state","overwrap","isOpen","backgroundEffect"]);return h(A,b(m(b(m({className:[g("BB"),s].join(" ")},c=="drawer.right"?{marginLeft:"auto"}:c=="drawer.left"?{marginRight:"auto"}:{}),{opacity:"trans",transition:"short",position:"relative",backgroundColor:"layer.1",flexSizing:"none",minHeight:"viewHeight",boxShadow:"3.remark"}),N),{freeCSS:m({width:{S:"20rem",R:"27rem",L:"32rem","2L":"40rem","3L":"58rem",MAX:"100vw"}[i],maxWidth:"96vw"},N.freeCSS),children:d.is.function(r)?h(r,{}):r}))},Bottom:t=>{let j=t,{componentId:e,sheetID:u,sheetGroups:a,bodyScrolls:c,content:r,size:s="R",sizeChanged:i,baseStyles:o,onOpen:v,onClose:C,closeAtAroundClick:R,closeAtEscapeKeyDown:D,closeAtPageTransit:L,closeAtParentBlur:J,closeAtSwipeDown:Y=!0,hold_state:q,overwrap:ee,isOpen:te,backgroundEffect:N}=j,M=G(j,["componentId","sheetID","sheetGroups","bodyScrolls","content","size","sizeChanged","baseStyles","onOpen","onClose","closeAtAroundClick","closeAtEscapeKeyDown","closeAtPageTransit","closeAtParentBlur","closeAtSwipeDown","hold_state","overwrap","isOpen","backgroundEffect"]),T=d.getScreenSize(),y=[0,.2,.6,.95],k={ZERO:0,S:1,R:2,L:3,"2L":3,"3L":3,MAX:3},[W,Q]=U(s),[I,_]=U({process:!1,processStart:0,originY:0,originValue:0,viewHeight:0,value:y[k[s]]});w.update({[e]:{val_edit:I,resize:S=>{let f=y[k[S]];_(p=>b(m({},p),{value:f})),Q(S)}}});const B={Start:S=>{d(document).addEvent({eventID:"BottomSheetMouseMove",eventType:"mousemove",callback:B.Move,options:{passive:!1}}).addEvent({eventID:"BottomSheetTouchMove",eventType:"touchmove",callback:B.Move,options:{passive:!1}}).addEvent({eventID:"BottomSheetMouseUp",eventType:"mouseup",callback:B.End}).addEvent({eventID:"BottomSheetTouchEnd",eventType:"touchend",callback:B.End});let f=d.getCursor(S),p=b(m({},I),{process:!0,processStart:new Date().getTime(),originY:f.y,originValue:I.value,viewHeight:d.getScreenSize().height});w.update({[e]:{val_edit:p}}),_(p)},Move:S=>{var O;let f=(O=w.get(e))==null?void 0:O.val_edit;if(!f.process)return;let z=(d.getCursor(S).y-f.originY)/f.viewHeight,n=f.originValue-z;if(n>.95)n=.95+(n-.95)*.5;else if(n<.2){let P=.2-n;P-=.1,n=.1+(.1-P)*.5}return _(b(m({},f),{value:n})),S.preventDefault(),S.stopPropagation(),!1},End:S=>{var n;let f=(n=w.get(e))==null?void 0:n.val_edit;if(!f.process)return;d(document).removeEvent(["BottomSheetMouseMove","BottomSheetTouchMove","BottomSheetMouseUp","BottomSheetTouchEnd"]);let p=0;if(f.value<.1||(f.value<.5?p=1:f.value>.75?p=3:p=2),new Date().getTime()-f.processStart<300){let O=d.getCursor(S).y-f.originY;if(Math.abs(O)>=20){let P=+(O<0)*2-1;p+=P,p=Math.min(Math.max(p,0),y.length-1)}}p==0&&(Y||(p=1)),Q(["ZERO","S","R","L"][p]),_(b(m({},f),{value:y[p],process:!1}))}},V=pe(!1);return H(()=>{V.current?W=="ZERO"?Y&&E.close(u):setTimeout(()=>{t.sizeChanged&&t.sizeChanged(W)},250):V.current=!0},[W]),h(A,{className:g("BB"),margin:[0,"auto"],marginTop:"auto",opacity:"trans",width:1,transition:"long",freeCSS:m({maxWidth:12*60,height:T.height*I.value},I.process?{transition:"0s"}:{}),children:F(oe,b(m({gap:0,flexSizing:"none",borderTopLeftRadius:"1.tone.primary",borderTopRightRadius:"1.tone.primary",borderBottom:"unset",boxShadow:"3.remark",position:"relative",overflow:"hidden",height:1},o),{children:[F(ne.Separate,{padding:1,backgroundColor:"layer.1",position:"relative",freeCSS:{userSelect:"none"},children:[h(A,{ssSphere:2.5}),h(ne.Center,{onPointerDown:B.Start,flexSizing:0,padding:"2/3",ssPushable:!0,isRounded:!0,freeCSS:{cursor:"grab",userSelect:"none"},children:h(A,{unitWidth:6,unitHeight:"1/2",backgroundColor:"layer.4",isRounded:!0,className:g("DragBar")})}),h(ie.Sub,{color:"cloud",ssSphere:2.5,onClick:()=>{E.close(u)},children:h(re.X,{})})]}),h(A,b(m({backgroundColor:"layer.1",flexSizing:0,overflow:"auto"},M),{children:d.is.function(r)?h(r,{}):r}))]}))})},Custom:t=>{let j=t,{sheetID:e,sheetGroups:u,bodyScrolls:a,event:c,parent:r,nextToCursor:s,gravityPoint:i=22,content:o,closeAtAroundClick:v,closeAtEscapeKeyDown:C,closeAtPageTransit:R,closeAtParentBlur:D,closeAtSwipeDown:L,hold_state:J,onOpen:Y,onClose:q,overwrap:ee,isOpen:te,resize:N,backgroundEffect:M}=j,T=G(j,["sheetID","sheetGroups","bodyScrolls","event","parent","nextToCursor","gravityPoint","content","closeAtAroundClick","closeAtEscapeKeyDown","closeAtPageTransit","closeAtParentBlur","closeAtSwipeDown","hold_state","onOpen","onClose","overwrap","isOpen","resize","backgroundEffect"]),[y]=U(Z()),k=d.is.element(r)||d.is.jmini(r)?d(r):K(r),W='[data-sheet-id="'+y+'"]',Q='[data-sheet-content="'+y+'"]';i=i;let I=i%5||5,_=Math.ceil(i/5);const B={Init:()=>{if(s&&c){let l=d.getScreenSize(),se=d.getCursor(c);return{top:se.y-l.pageYOffset,left:se.x-l.pageXOffset}}let S={};if(!k||!k[0])return S;let{top:f,right:p,bottom:z,left:n,height:O,width:P}=k.position();return[1,2].includes(I)?S.left=n:I==3?S.left=n+P/2:[4,5].includes(I)&&(S.left=p),i<=10?S.top=f:i<=15?S.top=f+O/2:i<=25&&(S.top=z),S},Adjust:()=>{let S=K(W).position(),f=K(Q).position(),p=k.position(),z=d.getScreenSize(),n={};for(let l in f)n[l]=f[l];if(d.scope(()=>{if(t.nextToCursor)return;let l=0;_==1?l=p.top-n.bottom:_==2?l=p.top-n.top:_==3?l=p.top-n.top+(p.height-n.height)/2:_==4?l=p.bottom-n.bottom:_==5&&(l=p.bottom-n.top),n.top+=l,n.bottom+=l}),d.scope(()=>{if(t.nextToCursor)return;let l=0;I==1?l=p.left-n.right:I==2?l=p.left-n.left:I==3?l=p.left-n.left+(p.width-n.width)/2:I==4?l=p.right-n.right:I==5&&(l=p.right-n.left),n.left+=l,n.right+=l}),n.top<0){let l=-n.top;n.top+=l,n.bottom+=l}if(n.bottom>z.height){let l=n.bottom-z.height;n.top-=l,n.bottom-=l}if(n.left<0){let l=-n.left;n.left+=l,n.right+=l}if(n.right>z.width){let l=n.right-z.width;n.left-=l,n.right-=l}let O=n.top-f.top,P=n.left-f.left;d(W).css({top:S.top+O+"px",left:S.left+P+"px"})}};let[V]=U(B.Init());return H(()=>{K(W).await(10).addClass(g("Open")).await(200).callback(()=>{(N==null||N)&&B.Adjust()}),w.update({["customSheet-"+t.sheetID]:{reposition:()=>{B.Adjust()}}})},[]),k[0]?h(A,{className:[g("BB"),g("CustomSheet")].join(" "),"data-sheet-id":y,transition:"long",position:"absolute",width:0,height:0,opacity:"trans",flexCenter:!0,freeCSS:V,children:h(ue,{position:"absolute",className:[g("GPT"),g("GPT_"+i),g("Col_"+I),g("Row_"+_)].join(" "),children:h(A,b(m({"data-sheet-content":y,flexSizing:"none",maxHeight:"viewHeight"},T),{freeCSS:m({maxWidth:"98vw"},T.freeCSS),children:d.is.function(o)?h(o,{}):o}))})}):null}}},E={Wrapper:()=>h($.Wrapper,{}),Element:t=>{let c=t,{isOpen:e,children:u}=c,a=G(c,["isOpen","children"]);return H(()=>{if(e){E.open(t.type,b(m({},a),{content:u}));return}a.sheetID&&E.close(a.sheetID)},[e]),h(ae,{})},image:(t,e)=>{let u=t.sheetID||Z(),r=t,{type:a}=r,c=G(r,["type"]);E.open(a||"topCenter",b(m({size:"MAX"},c),{sheetID:u,freeCSS:{maxWidth:"100vw"},content:()=>{let[s]=U(d.flatArray(e));return h(de,{children:F(oe,{children:[h(ne.Right,{children:F(ie.Sub.S,{color:"cloud",isRounded:!0,onClick:()=>{E.close(u)},children:[h(re.X,{})," \u9589\u3058\u308B"]})}),h(ce.Layout,{gap:1,gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"repeat(2,auto)",gridChildTemplates:[["span 3",0],["span 2","span 2"],[0,0],[0,0],[0,"span 2"],["span 2",0],[0,0],[0,0]],children:s.map((i,o)=>h(he,{ssCardBox:!0,position:"relative",flexCenter:!0,src:i},o))})]})})}}))},open:(t,e,u)=>{e.sheetID=(e.sheetID||"").replace(/\./g,"-"),e.type=t;let a=w.get("Sheet-"+X.get().sessionUID);a&&a.add(e,u)},resize:t=>{t.sheetID=(t.sheetID||"").replace(/\./g,"-");let e=w.get(t.sheetID);e&&e.resize&&e.resize(t.size)},customSheet:{reposition:t=>{let e=w.get("customSheet-"+t);e&&e.reposition&&e.reposition()}},close:function(t,e,u){let a=x.getSessionStates();if(!a)return;let{val_sheets:c}=a;t=t==null?void 0:t.replace(/\./g,"-");let r=c.find(i=>i.sheetID==t);if(!r||e=="Escape"&&!r.closeAtEscapeKeyDown)return;let s=w.get(r.sheetID);s&&s.close&&s.close(u)},closeGroup:t=>{let e=x.getSessionStates();if(!e)return;let{val_sheets:u}=e;t=(t||"").replace(/\./g,"-");for(let a of u)a.sheetGroups&&a.sheetGroups==t&&E.close(a.sheetID)},closeAll:t=>{let e=x.getSessionStates();if(!e)return;let{val_sheets:u}=e;for(let a of u)t&&!a.closeAtPageTransit||E.close(a.sheetID,"pageTransit",!0)},Body:t=>h(A,m({className:g("BaseBody"),backgroundColor:"layer.1",borderRadius:"1.tone.primary",position:"relative",boxShadow:"3.remark",transition:"long"},t))};export{E as Sheet,E as default};
|
package/dist/fn/Snackbar.d.ts
CHANGED
|
@@ -6,14 +6,14 @@ declare namespace Snackbar {
|
|
|
6
6
|
add(props: AddInput): Snackbar.Methods;
|
|
7
7
|
remove(snackID: string): Snackbar.Methods;
|
|
8
8
|
removeALL(): Snackbar.Methods;
|
|
9
|
-
Wrapper(): JSX.Element;
|
|
9
|
+
Wrapper(): React.JSX.Element;
|
|
10
10
|
};
|
|
11
11
|
type AddInput = Omit<Box.DefaultInput, 'children'> & {
|
|
12
|
-
children?: ReactElement | (() => JSX.Element);
|
|
12
|
+
children?: ReactElement | (() => React.JSX.Element);
|
|
13
13
|
customChildren?: {
|
|
14
14
|
(p: {
|
|
15
15
|
close(): void;
|
|
16
|
-
}): JSX.Element;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
17
|
};
|
|
18
18
|
snackID?: string;
|
|
19
19
|
secondsToClose?: number;
|
package/dist/fn/Snackbar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as m,c as p,d as D}from"../chunk-C5N2D3ZX.js";import{Fragment as
|
|
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 i}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 R,FAI as B}from"../atoms";import{Row as E}from"../mols";import{Button as F}from"./Button";import{SnackbarClasses as h}from"../@styles/componentClasses";const u={add:function(o){let t=i.get("Snackbar-"+I.get().sessionUID);return t&&t.add(o),this},remove:function(o){let t=i.get("Snackbar-"+I.get().sessionUID);return t&&t.remove(o),this},removeALL:function(){let o=i.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),[l,c]=g(o.secondsToClose||10);b(()=>{let v=w('[data-component-id="'+n+'"]');setTimeout(()=>{v.addClass(h("FadeIn"))},10),i.set({["Snackbar-"+t]:{remove:()=>{v.addClass(h("FadeOut"))}}})},[]),b(()=>{x.interval.once(()=>{l<=0||c(l-1)},1e3,"Snackbar-"+n),l===0&&u.remove(t)},[l]);let S=a(_,{});return e?S=a(e,{close:()=>{u.remove(t)}}):S=y(E.Separate,{verticalAlign:"top",children:[a(A,{padding:["1/4",0],flexSizing:0,children:x.is.function(d)?a(d,{}):d}),a(F.Clear,{color:"layer",backgroundColor:"layer.4.opa.low",fontColor:"white",ssSphere:2.5,onClick:()=>{u.remove(t)},children:a(B.X,{})})]}),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(()=>{i.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=i.get("Snackbar-"+e);s&&s.remove&&(s.remove(),setTimeout(()=>{let n=r.findIndex(c=>c.snackID==e);if(n==-1)return;let l=[...r];l.splice(n,1),f(l)},210))},removeALL:()=>{f([])}}})},[r.length]);let d=r.map(e=>M(L.Cell,p(m({},e),{key:e.snackID})));return a(R,{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/dist/fn/Table/Data.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TableTypes } from '.';
|
|
|
3
3
|
declare namespace Wrapper {
|
|
4
4
|
type Input = TableTypes.UniInput & {
|
|
5
5
|
type: TableTypes.Types;
|
|
6
|
-
JSXChildren: (p: any) => JSX.Element;
|
|
6
|
+
JSXChildren: (p: any) => React.JSX.Element;
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
declare const Wrapper: React.FC<Wrapper.Input>;
|
package/dist/fn/Table/Wrapper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,c as l,d as p}from"../../chunk-C5N2D3ZX.js";import{jsx as s}from"react/jsx-runtime";import{UUID as
|
|
1
|
+
import{b as t,c as l,d as p}from"../../chunk-C5N2D3ZX.js";import{jsx as s}from"react/jsx-runtime";import{UUID as c}from"jmini";import{GenerateHTMLProps as C}from"../../@utils";import d from"../../atoms/Box";import{DefaultCellStyles as S}from"./cellStyling";import{TableClasses as r}from"../../@styles/componentClasses";const n=y=>{let e=t({},y),{JSXChildren:i}=e;(!e.tone||e.tone=="auto")&&(e.tone="border",e.type=="drag"&&(e.tone="rowBorder"));let o=l(t({tableID:e.tableID||c(),tone:e.tone},e),{cellStyles:t(t({},S(e.type,e.tone)),e.cellStyles)});e.tone!="plain"&&(o=t({backgroundColor:"layer.1",borderRadius:"1.tone.primary"},o));let a=C(o),{className:m,style:f}=a,b=p(a,["className","style"]),T=[m,r("Wrap"),r("TableType_"+e.type),r("RowClickable_"+!!o.onRowClick)].join(" ");return s(d,{className:T,style:f,children:s(i,t({},b))})};export{n as Wrapper,n as default};
|
package/dist/fn/Tooltips.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -11,27 +11,27 @@ import * as fn from './fn';
|
|
|
11
11
|
export * from './fn';
|
|
12
12
|
declare const amotify: {
|
|
13
13
|
RootViewController: fn.RootViewController.Methods;
|
|
14
|
-
Plate:
|
|
15
|
-
PageViewController:
|
|
14
|
+
Plate: React.FC<fn.Plate.Input>;
|
|
15
|
+
PageViewController: React.FC<fn.PageViewController.Input>;
|
|
16
16
|
SwipeView: (p: fn.SwipeView.Input) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
TabBar:
|
|
17
|
+
TabBar: React.FC<fn.TabBar.Input>;
|
|
18
18
|
Effect: {
|
|
19
19
|
Ripple: import("./fn/Effect/Ripple").Ripple.Methods;
|
|
20
20
|
Pudding: import("./fn/Effect/Pudding").Pudding.Methods;
|
|
21
|
-
FadeIn:
|
|
22
|
-
FadeUp:
|
|
21
|
+
FadeIn: React.FC<import("./fn/Effect/Fade").FadeIn.Input>;
|
|
22
|
+
FadeUp: React.FC<import("./fn/Effect/Fade").FadeUp.Input>;
|
|
23
23
|
};
|
|
24
24
|
Button: fn.Button.Methods;
|
|
25
25
|
Label: fn.Label.Methods;
|
|
26
26
|
Anchor: fn.Anchor.Methods;
|
|
27
27
|
Input: typeof fn.Input;
|
|
28
|
-
RequiredSign:
|
|
29
|
-
RequiredShortSign:
|
|
30
|
-
OmitSign:
|
|
31
|
-
LeftIndicator:
|
|
32
|
-
RightIndicator:
|
|
33
|
-
RightIcon:
|
|
34
|
-
LeftIcon:
|
|
28
|
+
RequiredSign: React.FC<atoms.Span.Input>;
|
|
29
|
+
RequiredShortSign: React.FC<atoms.Span.Input>;
|
|
30
|
+
OmitSign: React.FC<atoms.Span.Input>;
|
|
31
|
+
LeftIndicator: React.FC<fn.Parts.Input>;
|
|
32
|
+
RightIndicator: React.FC<fn.Parts.Input>;
|
|
33
|
+
RightIcon: React.FC<fn.Parts.Input>;
|
|
34
|
+
LeftIcon: React.FC<fn.Parts.Input>;
|
|
35
35
|
Table: typeof fn.Table;
|
|
36
36
|
Sheet: fn.Sheet.Methods;
|
|
37
37
|
Snackbar: fn.Snackbar.Methods;
|
|
@@ -39,24 +39,24 @@ declare const amotify: {
|
|
|
39
39
|
Tooltips: fn.Tooltips.Methods;
|
|
40
40
|
Tips: fn.Tips.Methods;
|
|
41
41
|
Cropper: fn.Cropper.Methods;
|
|
42
|
-
PageNotFound:
|
|
42
|
+
PageNotFound: React.FC<fn.PageNotFound.Input>;
|
|
43
43
|
Accordion: mols.Accordion.Methods;
|
|
44
|
-
LinkifyText:
|
|
45
|
-
List:
|
|
44
|
+
LinkifyText: React.FC<mols.LinkifyText.Input>;
|
|
45
|
+
List: React.FC<mols.List.Input>;
|
|
46
46
|
ListItem: mols.ListItem.Methods;
|
|
47
47
|
Row: mols.Row.Methods;
|
|
48
48
|
Literal: mols.Literal.Methods;
|
|
49
|
-
Span:
|
|
50
|
-
P:
|
|
51
|
-
Flex:
|
|
52
|
-
FlexBr:
|
|
53
|
-
FlexMargin:
|
|
54
|
-
Column:
|
|
55
|
-
Box: <T extends
|
|
49
|
+
Span: React.FC<atoms.Span.Input>;
|
|
50
|
+
P: React.FC<atoms.P.Input>;
|
|
51
|
+
Flex: React.FC<atoms.Box.DefaultInput>;
|
|
52
|
+
FlexBr: React.FC<atoms.Box.DefaultInput>;
|
|
53
|
+
FlexMargin: React.FC<atoms.Box.DefaultInput>;
|
|
54
|
+
Column: React.FC<atoms.Box.DefaultInput>;
|
|
55
|
+
Box: <T extends React.ElementType<any, keyof React.JSX.IntrinsicElements> = "div">(p: atoms.Box.Input<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
56
56
|
FAI: atoms.FAI.Methods;
|
|
57
|
-
Img:
|
|
57
|
+
Img: React.FC<atoms.Img.Input>;
|
|
58
58
|
Logo: atoms.Logo.Methods;
|
|
59
|
-
Placeholder:
|
|
59
|
+
Placeholder: React.FC<atoms.Placeholder.Input>;
|
|
60
60
|
Card: atoms.Card.Methods;
|
|
61
61
|
Grid: atoms.Grid.Methodds;
|
|
62
62
|
Config: utils.Config.Methods;
|
package/dist/mols/List.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare namespace List {
|
|
|
8
8
|
};
|
|
9
9
|
type Input = StyleTags.BasicElement & {
|
|
10
10
|
ListChildCallback?: {
|
|
11
|
-
(p: ListChildCallbackProps): JSX.Element;
|
|
11
|
+
(p: ListChildCallbackProps): React.JSX.Element;
|
|
12
12
|
};
|
|
13
13
|
children?: ReactElement;
|
|
14
14
|
items?: ReactElement[];
|
|
@@ -19,13 +19,13 @@ declare namespace ListItem {
|
|
|
19
19
|
type Input = Flex.Input;
|
|
20
20
|
namespace Methods {
|
|
21
21
|
type Component = {
|
|
22
|
-
(p: Input): JSX.Element;
|
|
22
|
+
(p: Input): React.JSX.Element;
|
|
23
23
|
};
|
|
24
24
|
type FNs = {
|
|
25
|
-
Center: (p: Input) => JSX.Element;
|
|
26
|
-
Left: (p: Input) => JSX.Element;
|
|
27
|
-
Right: (p: Input) => JSX.Element;
|
|
28
|
-
Separate: (p: Input) => JSX.Element;
|
|
25
|
+
Center: (p: Input) => React.JSX.Element;
|
|
26
|
+
Left: (p: Input) => React.JSX.Element;
|
|
27
|
+
Right: (p: Input) => React.JSX.Element;
|
|
28
|
+
Separate: (p: Input) => React.JSX.Element;
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
type Methods = Methods.Component & Methods.FNs;
|
package/dist/mols/List.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r,c as s,d}from"../chunk-C5N2D3ZX.js";import{jsx as e}from"react/jsx-runtime";import{Box as o}from"../atoms";import{Row as p}from"../mols";const u=t=>{let m=t,{items:
|
|
1
|
+
import{b as r,c as s,d}from"../chunk-C5N2D3ZX.js";import{jsx as e}from"react/jsx-runtime";import{Box as o}from"../atoms";import{Row as p}from"../mols";const u=t=>{let m=t,{items:c=[],ListChildCallback:a}=m,l=d(m,["items","ListChildCallback"]);a=a||h;let x=c.map((C,i)=>e(a,{children:C,index:i},i));return e(o,s(r({htmlTag:"ul",children:x},l),{freeCSS:r({listStyle:"none"},l.freeCSS)}))},h=t=>e(o,r({htmlTag:"li",padding:"3/4",gap:"1/2",borderBottom:!0,flexWrap:!0},t)),n=h;n.Center=t=>e(o,{htmlTag:"li",children:e(p.Center,r({width:1,padding:"3/4",borderBottom:!0,flexWrap:!0},t))}),n.Left=t=>e(o,{htmlTag:"li",children:e(p.Left,r({width:1,padding:"3/4",borderBottom:!0,flexWrap:!0},t))}),n.Right=t=>e(o,{htmlTag:"li",children:e(p.Right,r({width:1,padding:"3/4",borderBottom:!0,flexWrap:!0},t))}),n.Separate=t=>e(o,{htmlTag:"li",children:e(p.Separate,r({width:1,padding:"3/4",borderBottom:!0,flexWrap:!0},t))});export{u as List,n as ListItem};
|
package/dist/mols/Literal.d.ts
CHANGED
package/dist/mols/Literal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,c as n}from"../chunk-C5N2D3ZX.js";import{jsx as
|
|
1
|
+
import{b as e,c as n}from"../chunk-C5N2D3ZX.js";import{jsx as o}from"react/jsx-runtime";import{Box as i,Span as l}from"../atoms";const p=t=>o(i,e({},t)),a=p;a.Title=t=>o(p,e({fontSize:"6.title",fontWeight:"3.semiBold"},t)),a.SubTitle=t=>o(p,e({fontSize:"5.subTitle",fontWeight:"3.semiBold"},t)),a.ThirdTitle=t=>o(p,e({fontSize:"4.thirdTitle",fontWeight:"3.semiBold"},t)),a.Paragraph=t=>o(p,e({fontSize:"3.paragraph",fontWeight:"3.semiBold"},t)),a.Description=t=>o(p,n(e({},t),{freeCSS:e({whiteSpace:"pre-wrap"},t.freeCSS)})),a.Supplement=t=>o(p,e({fontSize:"1.mini"},t)),a.NowrapSpan=t=>o(l,n(e({},t),{freeCSS:e({whiteSpace:"nowrap"},t.freeCSS)}));export{a as Literal,a as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amotify",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.234",
|
|
4
4
|
"description": "UI Component for React,NextJS,esbuild",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "run-p clean build:*",
|
|
@@ -88,14 +88,14 @@
|
|
|
88
88
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
89
89
|
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
90
90
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
91
|
-
"@fortawesome/react-fontawesome": "^
|
|
91
|
+
"@fortawesome/react-fontawesome": "^3.1.1",
|
|
92
92
|
"dotenv": "^17.0.1",
|
|
93
93
|
"jmini": "^0.0.102",
|
|
94
|
-
"react": "^
|
|
94
|
+
"react": "^19.2.3"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@types/express": "^4.17.21",
|
|
98
|
-
"@types/react": "^
|
|
98
|
+
"@types/react": "^19.2.3",
|
|
99
99
|
"ejs": "^3.1.10",
|
|
100
100
|
"esbuild": "^0.23.0",
|
|
101
101
|
"esbuild-sass-plugin": "^3.3.1",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"npm-run-all": "^4.1.5",
|
|
107
107
|
"postcss-modules": "^6.0.0",
|
|
108
108
|
"prop-types": "^15.8.1",
|
|
109
|
-
"react-dom": "^
|
|
110
|
-
"react-router-dom": "^
|
|
109
|
+
"react-dom": "^19.2.3",
|
|
110
|
+
"react-router-dom": "^7.11.0",
|
|
111
111
|
"ts-loader": "^9.5.1",
|
|
112
112
|
"ts-node": "^10.9.2",
|
|
113
113
|
"ts-node-dev": "^2.0.0",
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useRouter,
|
|
5
|
-
usePathname
|
|
6
|
-
} from 'next/navigation'
|
|
7
|
-
|
|
8
|
-
import $$,{ Fetcher,UUID } from 'jmini'
|
|
9
|
-
import {
|
|
10
|
-
useEffect,
|
|
11
|
-
useState
|
|
12
|
-
} from 'react'
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
Config,
|
|
16
|
-
LaunchReactApp,
|
|
17
|
-
pageRouter,
|
|
18
|
-
RootViewController,
|
|
19
|
-
Column,
|
|
20
|
-
Box,
|
|
21
|
-
useRouterEffect,
|
|
22
|
-
} from '../../../../../dist/index'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const Page = ( p: {
|
|
26
|
-
children: React.ReactNode
|
|
27
|
-
} ) => {
|
|
28
|
-
let pathname = usePathname()
|
|
29
|
-
|
|
30
|
-
useRouterEffect( { pathname } )
|
|
31
|
-
|
|
32
|
-
return <RootViewController.Base>
|
|
33
|
-
<Column
|
|
34
|
-
gap={ 0 }
|
|
35
|
-
position='relative'
|
|
36
|
-
minHeight={ 'contentHeight' }
|
|
37
|
-
freeCSS={ {
|
|
38
|
-
zIndex: 2
|
|
39
|
-
} }
|
|
40
|
-
>
|
|
41
|
-
<Box flexSizing={ 0 }>
|
|
42
|
-
{ p.children }
|
|
43
|
-
</Box>
|
|
44
|
-
</Column>
|
|
45
|
-
</RootViewController.Base>
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const UseClientEffect = ( args: {
|
|
49
|
-
children: React.ReactNode
|
|
50
|
-
} ) => {
|
|
51
|
-
usePathname()
|
|
52
|
-
let router = useRouter()
|
|
53
|
-
let [ val_init,set_init ] = useState( false )
|
|
54
|
-
|
|
55
|
-
useEffect( () => {
|
|
56
|
-
if ( val_init ) return
|
|
57
|
-
|
|
58
|
-
Config.launch( {
|
|
59
|
-
appRoot: $$( '#RakumeoAppBody' )[ 0 ],
|
|
60
|
-
|
|
61
|
-
roundness: $$.localStorage.get( 'prf.roundness' ) ?? 4,
|
|
62
|
-
themeColor: $$.localStorage.get( 'prf.themeColor' ) || 'ninja',
|
|
63
|
-
darkMode: $$.localStorage.get( 'prf.darkMode' ) || 'light'
|
|
64
|
-
} )
|
|
65
|
-
|
|
66
|
-
pageRouter.setPushEffect( ( url ) => {
|
|
67
|
-
router.push( url )
|
|
68
|
-
} )
|
|
69
|
-
pageRouter.setBackEffect( () => {
|
|
70
|
-
router.back()
|
|
71
|
-
} )
|
|
72
|
-
|
|
73
|
-
set_init( true )
|
|
74
|
-
},[ val_init ] )
|
|
75
|
-
|
|
76
|
-
if ( !val_init ) return null
|
|
77
|
-
|
|
78
|
-
return <LaunchReactApp>
|
|
79
|
-
<Page children={ args.children } />
|
|
80
|
-
</LaunchReactApp>
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export { UseClientEffect }
|