amotify 0.3.26 → 0.3.28

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.
@@ -20,9 +20,22 @@ declare namespace RootViewController {
20
20
  fn: FNs;
21
21
  };
22
22
  type Base = Box.DefaultInput & {
23
+ /**
24
+ * @deprecated Use `topNav` instead
25
+ */
23
26
  topNavigation?: ReactElement;
27
+ /**
28
+ * @deprecated Use `leftNav` instead
29
+ */
24
30
  sideNavigation?: ReactElement;
31
+ /**
32
+ * @deprecated Use `footerNav` instead
33
+ */
25
34
  footerNavigation?: ReactElement;
35
+ topNav?: ReactElement;
36
+ leftNav?: ReactElement;
37
+ rightNav?: ReactElement;
38
+ footerNav?: ReactElement;
26
39
  };
27
40
  type Button = Button.Input<ButtonTypes.ClearColors> & {
28
41
  path?: string;
@@ -1 +1 @@
1
- import{b as d,c as m,d as v}from"../chunk-C5N2D3ZX.js";import{jsx as h,jsxs as P}from"react/jsx-runtime";import{useState as R,useEffect as S}from"react";import a,{UUID as H}from"jmini";import{$$fromRoot as c,Config as A,pageRouter as T}from"../@utils";import{Box as C,Flex as x,Column as V}from"../atoms";import{Button as E}from"./Button";import{LayoutClasses as y}from"../@styles/componentClasses";const t={Base:o=>{let g=o,{topNavigation:i,sideNavigation:e,footerNavigation:r,children:l,className:s}=g,f=v(g,["topNavigation","sideNavigation","footerNavigation","children","className"]);S(()=>{t.fn.updateCSSProperty.reset(),setTimeout(()=>{t.fn.updateCSSProperty.reset()},100);let n="ResizeCB",p="RemovePageEventCB";return a(window).onEvent("resize",()=>{A.get().screen.isPhonepoint()||a.interval.once(()=>{t.fn.updateCSSProperty.reset()},300,"__RVC_calcHeights")},{eventID:n}),()=>{a(window).removeEvent(p),a(window).removeEvent(n)}},[]);let u=l;return P(V,m(d({className:[s,y("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},f),{children:[i,P(x,{className:y("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[e,h(C,{className:y("Content"),position:"relative",flexSizing:0,width:0,children:u})]}),r]}))},TopNavigation:o=>{let s=o,{className:i,children:e}=s,r=v(s,["className","children"]),[l]=R(H());return S(()=>{t.fn.updateCSSProperty.topNav()},[]),h(x,m(d({"data-id":l,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},r),{id:"__RVC_TopNavigation",className:[i,y("TopNav")].join(" "),children:e}),l)},SideNavigation:o=>{let r=o,{className:i=""}=r,e=v(r,["className"]);return S(()=>{t.fn.updateCSSProperty.sideNav()},[]),h(C,m(d({className:[i,y("SideNav")].join(" "),flexSizing:"none",minHeight:"sideNavigationHeight"},e),{id:"__RVC_SideNavigation"}))},FooterNavigation:o=>{let s=o,{className:i="",baseStyles:e}=s,r=v(s,["className","baseStyles"]),[l]=R(H());return S(()=>{t.fn.updateCSSProperty.footer()},[]),h(x,m(d({"data-id":l,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},e),{id:"__RVC_FooterNavigation",className:[y("FooterNav"),i].join(" "),children:h(x,d({gap:1,flexWrap:!1,padding:"2/3",margin:"auto",width:1},r))}))},Comps:{Button:o=>{let g=o,{isActive:i,path:e,pathGroup:r,currentPath:l}=g,s=v(g,["isActive","path","pathGroup","currentPath"]),f=a.Arrayify(r),u=l||location.pathname;{let n=!1;a.scope(()=>{a.isString(e)&&(a.isNullish(e)||(n=u.replace(/^\//,"").replace(/\/$/,"")==e.replace(/^\//,"").replace(/\/$/,"")))}),a.scope(()=>{if(!n&&f.length)for(let p of f){if(n)break;a.isNullish(p)||(a.isString(p)&&(p=String(p).escapeRegExChar()),u.match(new RegExp(p))&&(n=!0))}}),i=i!=null?i:n}return h(E.Clear,d({isActive:i,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:n=>{a.isExist(e)&&a.isString(e)&&T.push(e,n.ctrlKey||n.metaKey)},color:"cloud",padding:["3/4",1],display:"flex",gap:"1/2",fontColor:"inherit",flexSizing:"none",flexWrap:!1,ssEffectsOnActive:"ripple.cloud",verticalAlign:"center",textAlign:"left",isSemiBoldFont:!0},s))},Bar:o=>h(C,d({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],isRounded:!0},o)),Title:o=>h(C,d({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},o))},fn:{updateCSSProperty:{topNav:()=>{let o=a(document.body),i=c("#__RVC_TopNavigation"),e=i.position().height||0,r=e;i.getStyleProperty("position")!="sticky"&&(r=0),t.fn.topNavHeight=e,t.fn.topBase=r,o.setStyleProperty("--topNavHeight",e+"px").setStyleProperty("--topBase",r+"px")},footer:()=>{let o=a(document.body),e=c("#__RVC_FooterNavigation").position().height||0;t.fn.footerNavHeight=e,o.setStyleProperty("--footerNavHeight",e+"px")},sideNav:()=>{let o=a(document.body),e=c("#__RVC_SideNavigation").position().width||0;t.fn.sideNavHeight=e,o.setStyleProperty("--sideNavWidth",e+"px")},reset:()=>{let o=a(document.body),i=c("#__RVC_TopNavigation"),e=c("#__RVC_FooterNavigation"),r=c("#__RVC_SideNavigation"),l=i.position().height||0,s=l,f=e.position().height||0,u=r.position().width||0;i.getStyleProperty("position")!="sticky"&&(s=0);let g=window.innerHeight,n=window.innerWidth,p=g-l-f,B=n-u;t.fn.viewHeight=g,t.fn.viewWidth=n,t.fn.contentHeight=p,t.fn.contentWidth=B,t.fn.topBase=s,t.fn.sideNavHeight=u,t.fn.topNavHeight=l,t.fn.footerNavHeight=f;{let N=getComputedStyle(document.documentElement),w=N.getPropertyValue("--safe-area-top"),_=N.getPropertyValue("--safe-area-bottom"),b=N.getPropertyValue("--safe-area-left"),F=N.getPropertyValue("--safe-area-right");t.fn.safeAreaTop=parseInt(w,10)||0,t.fn.safeAreaBottom=parseInt(_,10)||0,t.fn.safeAreaLeft=parseInt(b,10)||0,t.fn.safeAreaRight=parseInt(F,10)||0}o.setStyleProperty("--viewHeight",g+"px").setStyleProperty("--viewWidth",n+"px").setStyleProperty("--contentHeight",p+"px").setStyleProperty("--contentWidth",B+"px").setStyleProperty("--topBase",s+"px").setStyleProperty("--topNavHeight",l+"px").setStyleProperty("--footerNavHeight",f+"px").setStyleProperty("--sideNavHeight",p+"px")}},viewHeight:0,viewWidth:0,contentHeight:0,contentWidth:0,topBase:0,sideNavHeight:0,topNavHeight:0,footerNavHeight:0,safeAreaTop:0,safeAreaBottom:0,safeAreaLeft:0,safeAreaRight:0}};export{t as RootViewController,t as default};
1
+ import{b as g,c as y,d as c}from"../chunk-C5N2D3ZX.js";import{jsx as h,jsxs as _}from"react/jsx-runtime";import{useState as P,useEffect as x}from"react";import a,{UUID as w}from"jmini";import{$$fromRoot as m,Config as A,pageRouter as E}from"../@utils";import{Box as R,Flex as B,Column as T}from"../atoms";import{Button as V}from"./Button";import{LayoutClasses as N}from"../@styles/componentClasses";const t={Base:o=>{let u=o,{topNavigation:i,sideNavigation:e,footerNavigation:r,topNav:l,leftNav:s,rightNav:f,footerNav:v,children:d,className:n}=u,p=c(u,["topNavigation","sideNavigation","footerNavigation","topNav","leftNav","rightNav","footerNav","children","className"]);x(()=>{t.fn.updateCSSProperty.reset(),setTimeout(()=>{t.fn.updateCSSProperty.reset()},100);let C="ResizeCB",H="RemovePageEventCB";return a(window).onEvent("resize",()=>{A.get().screen.isPhonepoint()||a.interval.once(()=>{t.fn.updateCSSProperty.reset()},300,"__RVC_calcHeights")},{eventID:C}),()=>{a(window).removeEvent(H),a(window).removeEvent(C)}},[]);let S=d;return _(T,y(g({className:[n,N("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},p),{children:[l||i,_(B,{className:N("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[s||e,h(R,{className:N("Content"),position:"relative",flexSizing:0,width:0,children:S}),f]}),v||r]}))},TopNavigation:o=>{let s=o,{className:i,children:e}=s,r=c(s,["className","children"]),[l]=P(w());return x(()=>{t.fn.updateCSSProperty.topNav()},[]),h(B,y(g({"data-id":l,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},r),{id:"__RVC_TopNavigation",className:[i,N("TopNav")].join(" "),children:e}),l)},SideNavigation:o=>{let r=o,{className:i=""}=r,e=c(r,["className"]);return x(()=>{t.fn.updateCSSProperty.sideNav()},[]),h(R,y(g({className:[i,N("SideNav")].join(" "),flexSizing:"none",minHeight:"sideNavigationHeight"},e),{id:"__RVC_SideNavigation"}))},FooterNavigation:o=>{let s=o,{className:i="",baseStyles:e}=s,r=c(s,["className","baseStyles"]),[l]=P(w());return x(()=>{t.fn.updateCSSProperty.footer()},[]),h(B,y(g({"data-id":l,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},e),{id:"__RVC_FooterNavigation",className:[N("FooterNav"),i].join(" "),children:h(B,g({gap:1,flexWrap:!1,padding:"2/3",margin:"auto",width:1},r))}))},Comps:{Button:o=>{let d=o,{isActive:i,path:e,pathGroup:r,currentPath:l}=d,s=c(d,["isActive","path","pathGroup","currentPath"]),f=a.Arrayify(r),v=l||location.pathname;{let n=!1;a.scope(()=>{a.isString(e)&&(a.isNullish(e)||(n=v.replace(/^\//,"").replace(/\/$/,"")==e.replace(/^\//,"").replace(/\/$/,"")))}),a.scope(()=>{if(!n&&f.length)for(let p of f){if(n)break;a.isNullish(p)||(a.isString(p)&&(p=String(p).escapeRegExChar()),v.match(new RegExp(p))&&(n=!0))}}),i=i!=null?i:n}return h(V.Clear,g({isActive:i,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:n=>{a.isExist(e)&&a.isString(e)&&E.push(e,n.ctrlKey||n.metaKey)},color:"cloud",padding:["3/4",1],display:"flex",gap:"1/2",fontColor:"inherit",flexSizing:"none",flexWrap:!1,ssEffectsOnActive:"ripple.cloud",verticalAlign:"center",textAlign:"left",isSemiBoldFont:!0},s))},Bar:o=>h(R,g({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],isRounded:!0},o)),Title:o=>h(R,g({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},o))},fn:{updateCSSProperty:{topNav:()=>{let o=a(document.body),i=m("#__RVC_TopNavigation"),e=i.position().height||0,r=e;i.getStyleProperty("position")!="sticky"&&(r=0),t.fn.topNavHeight=e,t.fn.topBase=r,o.setStyleProperty("--topNavHeight",e+"px").setStyleProperty("--topBase",r+"px")},footer:()=>{let o=a(document.body),e=m("#__RVC_FooterNavigation").position().height||0;t.fn.footerNavHeight=e,o.setStyleProperty("--footerNavHeight",e+"px")},sideNav:()=>{let o=a(document.body),e=m("#__RVC_SideNavigation").position().width||0;t.fn.sideNavHeight=e,o.setStyleProperty("--sideNavWidth",e+"px")},reset:()=>{let o=a(document.body),i=m("#__RVC_TopNavigation"),e=m("#__RVC_FooterNavigation"),r=m("#__RVC_SideNavigation"),l=i.position().height||0,s=l,f=e.position().height||0,v=r.position().width||0;i.getStyleProperty("position")!="sticky"&&(s=0);let d=window.innerHeight,n=window.innerWidth,p=d-l-f,S=n-v;t.fn.viewHeight=d,t.fn.viewWidth=n,t.fn.contentHeight=p,t.fn.contentWidth=S,t.fn.topBase=s,t.fn.sideNavHeight=v,t.fn.topNavHeight=l,t.fn.footerNavHeight=f;{let u=getComputedStyle(document.documentElement),C=u.getPropertyValue("--safe-area-top"),H=u.getPropertyValue("--safe-area-bottom"),b=u.getPropertyValue("--safe-area-left"),F=u.getPropertyValue("--safe-area-right");t.fn.safeAreaTop=parseInt(C,10)||0,t.fn.safeAreaBottom=parseInt(H,10)||0,t.fn.safeAreaLeft=parseInt(b,10)||0,t.fn.safeAreaRight=parseInt(F,10)||0}o.setStyleProperty("--viewHeight",d+"px").setStyleProperty("--viewWidth",n+"px").setStyleProperty("--contentHeight",p+"px").setStyleProperty("--contentWidth",S+"px").setStyleProperty("--topBase",s+"px").setStyleProperty("--topNavHeight",l+"px").setStyleProperty("--footerNavHeight",f+"px").setStyleProperty("--sideNavHeight",p+"px")}},viewHeight:0,viewWidth:0,contentHeight:0,contentWidth:0,topBase:0,sideNavHeight:0,topNavHeight:0,footerNavHeight:0,safeAreaTop:0,safeAreaBottom:0,safeAreaLeft:0,safeAreaRight:0}};export{t as RootViewController,t as default};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ReactElement } from '../@declares';
2
+ import { ReactElement, StyleProps } from '../@declares';
3
3
  import { Box } from '../atoms';
4
4
  declare namespace Accordion {
5
5
  type Input = Box.DefaultInput & {
@@ -7,7 +7,12 @@ declare namespace Accordion {
7
7
  override?: boolean;
8
8
  accordionID?: string;
9
9
  slideAnimation?: 'none' | 'fast' | 'slow';
10
+ wrapperStyles?: StyleProps.BasicElement;
10
11
  children: ReactElement;
12
+ onLabelRender?: React.FC<{
13
+ isOpen: boolean;
14
+ onToggle(): void;
15
+ }>;
11
16
  onToggleEvent?: {
12
17
  (open: boolean): void;
13
18
  };
@@ -1 +1 @@
1
- import{b as u,d as D}from"../chunk-C5N2D3ZX.js";import{jsx as C}from"react/jsx-runtime";import a,{UUID as w,useStore as r}from"jmini";import{useState as l,useEffect as H,useRef as b}from"react";import{$$fromRoot as d}from"../@utils";import{Box as O}from"../atoms";import{AccordionClasses as _}from"../@styles/componentClasses";const E=o=>{o=u({},o);let x=o,{accordionID:e="",slideAnimation:v="fast",defaultOpen:f=!1,override:R=!1}=x,y=D(x,["accordionID","slideAnimation","defaultOpen","override"]),[p]=l(w()),[m]=l(w()),[c,s]=l(f),[g,A]=l(0);R&&c!=f&&s(f);const I=b(!1);return H(()=>{a.scope(()=>{let n=d('[data-accordion-content-id="'+m+'"]')[0];if(!n)return;let i=n.offsetHeight,t=0;v=="fast"?(t=i/1e3,t=Math.max(t,.2)):v=="slow"&&(t=i/300),A(i),d("#"+p).css({transition:t+"s"})}),a.scope(()=>{e&&r.set({["Accordion-"+e]:{open:()=>{s(!0)},close:()=>{s(!1)},toggle:()=>{s(n=>!n)}}})})},[]),r.update({["Accordion-"+e]:{isOpen:!!c}}),H(()=>{let n=d("#"+p),i=d('[data-accordion-content-id="'+m+'"]')[0];I.current||(I.current=!0),a.scope(()=>{if(!i||a.isNullish(g))return;let t=i.offsetHeight;g!=t&&A(t),g&&n.css({maxHeight:t+1+"px"}).await(100),c?n.css({maxHeight:"unset",overflow:(o==null?void 0:o.overflow)||"unset"}):n.css({maxHeight:"0px",overflow:"hidden"})})},[c]),C(O,{className:[_("Wrap"),_("Open_"+c)].join(" "),id:p,children:C(O,u({"data-accordion-content-id":m},y))})},h=E;h.fn={open:o=>{let e=r.get("Accordion-"+o);!e||e.open()},close:o=>{let e=r.get("Accordion-"+o);!e||e.close()},toggle:o=>{let e=r.get("Accordion-"+o);!e||e.toggle()},isOpen:o=>{let e=r.get("Accordion-"+o);if(e)return e.isOpen}};export{h as Accordion,h as default};
1
+ import{b as l,c as b,d as H}from"../chunk-C5N2D3ZX.js";import{jsx as A,jsxs as L}from"react/jsx-runtime";import d,{UUID as w,useStore as c}from"jmini";import{useState as p,useEffect as y,useRef as B}from"react";import{$$fromRoot as f}from"../@utils";import{Box as E,Column as S}from"../atoms";import{AccordionClasses as N}from"../@styles/componentClasses";const $=o=>{o=l({},o);let C=o,{accordionID:e="",slideAnimation:I="fast",defaultOpen:g=!1,override:F=!1,onLabelRender:x,onToggleEvent:O,wrapperStyles:a}=C,T=H(C,["accordionID","slideAnimation","defaultOpen","override","onLabelRender","onToggleEvent","wrapperStyles"]),[m]=p(w()),[u]=p(w()),[i,s]=p(g),[h,D]=p(0);F&&i!=g&&s(g);const R=B(!1);return y(()=>{d.scope(()=>{let t=f('[data-accordion-content-id="'+u+'"]')[0];if(!t)return;let r=t.offsetHeight,n=0;I=="fast"?(n=r/1e3,n=Math.max(n,.2)):I=="slow"&&(n=r/300),D(r),f("#"+m).css({transition:n+"s"})}),d.scope(()=>{e&&c.set({["Accordion-"+e]:{open:()=>{s(!0)},close:()=>{s(!1)},toggle:()=>{s(t=>!t)}}})})},[]),c.update({["Accordion-"+e]:{isOpen:!!i}}),y(()=>{let t=f("#"+m),r=f('[data-accordion-content-id="'+u+'"]')[0];R.current||(R.current=!0),d.scope(()=>{if(!r||d.isNullish(h))return;O&&O(i);let n=r.offsetHeight;h!=n&&D(n),h&&t.css({maxHeight:n+1+"px"}).await(100),i?t.css({maxHeight:"unset",overflow:(o==null?void 0:o.overflow)||"unset"}):t.css({maxHeight:"0px",overflow:"hidden"})})},[i]),L(S,b(l({gap:0},a),{className:[N("Wrap"),(a==null?void 0:a.className)||""].join(" "),children:[x&&A(x,{isOpen:i,onToggle:()=>{s(t=>!t)}}),A(E,{id:m,className:N("Open_"+i),children:A(E,l({"data-accordion-content-id":u},T))})]}))},v=$;v.fn={open:o=>{let e=c.get("Accordion-"+o);!e||e.open()},close:o=>{let e=c.get("Accordion-"+o);!e||e.close()},toggle:o=>{let e=c.get("Accordion-"+o);!e||e.toggle()},isOpen:o=>{let e=c.get("Accordion-"+o);if(e)return e.isOpen}};export{v as Accordion,v as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "description": "UI Component for React,NextJS,esbuild",
5
5
  "scripts": {
6
6
  "start": "run-p clean build:*",