amotify 0.2.143 → 0.2.145

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.
@@ -11,7 +11,9 @@ declare namespace RootViewController {
11
11
  baseStyles?: StyleTags.States;
12
12
  }>;
13
13
  Comps: {
14
- Button: React.FC<Button>;
14
+ Button: React.FC<Button & {
15
+ currentPath?: string;
16
+ }>;
15
17
  Title: React.FC<Box.DefaultInput>;
16
18
  Bar: React.FC<Box.DefaultInput>;
17
19
  };
@@ -23,8 +25,8 @@ declare namespace RootViewController {
23
25
  footerNavigation?: ReactElement;
24
26
  };
25
27
  type Button = Button.Input<ButtonTypes.ClearColors> & {
26
- uri?: string;
27
- uriGroup?: (string | RegExp) | (string | RegExp)[];
28
+ path?: string;
29
+ pathGroup?: (string | RegExp) | (string | RegExp)[];
28
30
  };
29
31
  type FNs = {
30
32
  updateCSSProperty: {
@@ -1 +1 @@
1
- import{b as s,c as h,d as y}from"../chunk-C5N2D3ZX.js";import{jsx as g,jsxs as B}from"react/jsx-runtime";import{useState as x,useEffect as N}from"react";import a,{UUID as R}from"jmini";import{$$fromRoot as c,Config as w,pageRouter as F}from"../@utils";import{Box as S,Flex as C,Column as P}from"../atoms";import{Button as H}from"./Button";import{LayoutClasses as f}from"../@styles/componentClasses";const d={Base:t=>{let n=t,{topNavigation:o,sideNavigation:e,footerNavigation:i,children:l,className:r}=n,u=y(n,["topNavigation","sideNavigation","footerNavigation","children","className"]);N(()=>{d.fn.updateCSSProperty.reset(),setTimeout(()=>{d.fn.updateCSSProperty.reset()},100);let p="ResizeCB",m="RemovePageEventCB";return a(window).addEvent({eventType:"resize",eventID:p,callback:()=>{w.get().screen.isPhonepoint()||a.interval.once(()=>{d.fn.updateCSSProperty.reset()},300,"__RVC_calcHeights")}}),()=>{a(window).removeEvent(m),a(window).removeEvent(p)}},[]);let v=l;return B(P,h(s({className:[r,f("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},u),{children:[o,B(C,{className:f("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[e,g(S,{className:f("Content"),position:"relative",flexSizing:0,width:0,children:v})]}),i]}))},TopNavigation:t=>{let r=t,{className:o,children:e}=r,i=y(r,["className","children"]),[l]=x(R());return N(()=>{d.fn.updateCSSProperty.topNav()},[]),g(C,h(s({"data-id":l,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},i),{id:"__RVC_TopNavigation",className:[o,f("TopNav")].join(" "),children:e}),l)},SideNavigation:t=>{let i=t,{className:o=""}=i,e=y(i,["className"]);return N(()=>{d.fn.updateCSSProperty.sideNav()},[]),g(S,h(s({className:[o,f("SideNav")].join(" "),flexSizing:"none",minHeight:"sideNavigationHeight"},e),{id:"__RVC_SideNavigation"}))},FooterNavigation:t=>{let r=t,{className:o="",baseStyles:e}=r,i=y(r,["className","baseStyles"]),[l]=x(R());return N(()=>{d.fn.updateCSSProperty.footer()},[]),g(C,h(s({"data-id":l,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},e),{id:"__RVC_FooterNavigation",className:[f("FooterNav"),o].join(" "),children:g(C,s({gap:1,flexWrap:!1,padding:"2/3",margin:"auto",width:1},i))}))},Comps:{Button:t=>{let v=t,{isActive:o,uri:e,uriGroup:i}=v,l=y(v,["isActive","uri","uriGroup"]),r=a.flatArray(i),u=location.pathname;{let n=!1;if(a.is.exist(e)&&a.is.string(e)){let p=[location.origin,e.replace(/\//,"")].join("/");n=u==new URL(p).pathname}if(!n&&r.length)for(let p of r)a.is.nullish(p)||u.match(new RegExp(String(p).escapeRegExChar()))&&(n=!0);o=o!=null?o:n}return g(H.Clear,s({isActive:o,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:n=>{a.is.exist(e)&&a.is.string(e)&&F.push(e,n.ctrlKey||n.metaKey)},color:"cloud",padding:["3/4",1],display:"flex",gap:"1/2",fontColor:"inherit",width:1,flexSizing:"none",flexWrap:!1,ssEffectsOnActive:"ripple.cloud",verticalAlign:"center",textAlign:"left",isSemiBoldFont:!0},l))},Bar:t=>g(S,s({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],isRounded:!0},t)),Title:t=>g(S,s({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},t))},fn:{updateCSSProperty:{topNav:()=>{let t=a(document.body),o=c("#__RVC_TopNavigation"),e=o.position().height||0,i=e;o.getStyleProperty("position")!="sticky"&&(i=0),t.setStyleProperty("--topNavHeight",e+"px").setStyleProperty("--topBase",i+"px")},footer:()=>{let t=a(document.body),e=c("#__RVC_FooterNavigation").position().height||0;t.setStyleProperty("--footerNavHeight",e+"px")},sideNav:()=>{let t=a(document.body),e=c("#__RVC_SideNavigation").position().width||0;t.setStyleProperty("--sideNavWidth",e+"px")},reset:()=>{let t=a(document.body),o=c("#__RVC_TopNavigation"),e=c("#__RVC_FooterNavigation"),i=c("#__RVC_SideNavigation"),l=o.position().height||0,r=l,u=e.position().height||0,v=i.position().width||0;o.getStyleProperty("position")!="sticky"&&(r=0);let n=window.innerHeight,p=window.innerWidth,m=n-l-u,_=p-v;t.setStyleProperty("--topNavHeight",l+"px").setStyleProperty("--topBase",r+"px").setStyleProperty("--footerNavHeight",u+"px").setStyleProperty("--viewHeight",n+"px").setStyleProperty("--sideNavHeight",m+"px").setStyleProperty("--contentHeight",m+"px").setStyleProperty("--contentWidth",_+"px")}}}};export{d as RootViewController,d as default};
1
+ import{b as s,c as N,d as f}from"../chunk-C5N2D3ZX.js";import{jsx as c,jsxs as B}from"react/jsx-runtime";import{useState as x,useEffect as m}from"react";import i,{UUID as R}from"jmini";import{$$fromRoot as y,Config as w,pageRouter as F}from"../@utils";import{Box as S,Flex as C,Column as P}from"../atoms";import{Button as H}from"./Button";import{LayoutClasses as h}from"../@styles/componentClasses";const g={Base:t=>{let d=t,{topNavigation:o,sideNavigation:e,footerNavigation:a,children:n,className:l}=d,u=f(d,["topNavigation","sideNavigation","footerNavigation","children","className"]);m(()=>{g.fn.updateCSSProperty.reset(),setTimeout(()=>{g.fn.updateCSSProperty.reset()},100);let r="ResizeCB",p="RemovePageEventCB";return i(window).addEvent({eventType:"resize",eventID:r,callback:()=>{w.get().screen.isPhonepoint()||i.interval.once(()=>{g.fn.updateCSSProperty.reset()},300,"__RVC_calcHeights")}}),()=>{i(window).removeEvent(p),i(window).removeEvent(r)}},[]);let v=n;return B(P,N(s({className:[l,h("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},u),{children:[o,B(C,{className:h("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[e,c(S,{className:h("Content"),position:"relative",flexSizing:0,width:0,children:v})]}),a]}))},TopNavigation:t=>{let l=t,{className:o,children:e}=l,a=f(l,["className","children"]),[n]=x(R());return m(()=>{g.fn.updateCSSProperty.topNav()},[]),c(C,N(s({"data-id":n,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},a),{id:"__RVC_TopNavigation",className:[o,h("TopNav")].join(" "),children:e}),n)},SideNavigation:t=>{let a=t,{className:o=""}=a,e=f(a,["className"]);return m(()=>{g.fn.updateCSSProperty.sideNav()},[]),c(S,N(s({className:[o,h("SideNav")].join(" "),flexSizing:"none",minHeight:"sideNavigationHeight"},e),{id:"__RVC_SideNavigation"}))},FooterNavigation:t=>{let l=t,{className:o="",baseStyles:e}=l,a=f(l,["className","baseStyles"]),[n]=x(R());return m(()=>{g.fn.updateCSSProperty.footer()},[]),c(C,N(s({"data-id":n,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},e),{id:"__RVC_FooterNavigation",className:[h("FooterNav"),o].join(" "),children:c(C,s({gap:1,flexWrap:!1,padding:"2/3",margin:"auto",width:1},a))}))},Comps:{Button:t=>{let d=t,{isActive:o,path:e,pathGroup:a,currentPath:n}=d,l=f(d,["isActive","path","pathGroup","currentPath"]),u=i.flatArray(a),v=n||location.pathname;{let r=!1;i.scope(()=>{i.is.string(e)&&(i.is.nullish(e)||(r=v.replace(/^\//,"").replace(/\/$/,"")==e.replace(/^\//,"").replace(/\/$/,"")))}),i.scope(()=>{if(!r&&u.length)for(let p of u){if(r)break;i.is.nullish(p)||(i.is.string(p)&&(p=String(p).escapeRegExChar()),v.match(new RegExp(p))&&(r=!0))}}),o=o!=null?o:r}return c(H.Clear,s({isActive:o,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:r=>{i.is.exist(e)&&i.is.string(e)&&F.push(e,r.ctrlKey||r.metaKey)},color:"cloud",padding:["3/4",1],display:"flex",gap:"1/2",fontColor:"inherit",width:1,flexSizing:"none",flexWrap:!1,ssEffectsOnActive:"ripple.cloud",verticalAlign:"center",textAlign:"left",isSemiBoldFont:!0},l))},Bar:t=>c(S,s({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],isRounded:!0},t)),Title:t=>c(S,s({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},t))},fn:{updateCSSProperty:{topNav:()=>{let t=i(document.body),o=y("#__RVC_TopNavigation"),e=o.position().height||0,a=e;o.getStyleProperty("position")!="sticky"&&(a=0),t.setStyleProperty("--topNavHeight",e+"px").setStyleProperty("--topBase",a+"px")},footer:()=>{let t=i(document.body),e=y("#__RVC_FooterNavigation").position().height||0;t.setStyleProperty("--footerNavHeight",e+"px")},sideNav:()=>{let t=i(document.body),e=y("#__RVC_SideNavigation").position().width||0;t.setStyleProperty("--sideNavWidth",e+"px")},reset:()=>{let t=i(document.body),o=y("#__RVC_TopNavigation"),e=y("#__RVC_FooterNavigation"),a=y("#__RVC_SideNavigation"),n=o.position().height||0,l=n,u=e.position().height||0,v=a.position().width||0;o.getStyleProperty("position")!="sticky"&&(l=0);let d=window.innerHeight,r=window.innerWidth,p=d-n-u,_=r-v;t.setStyleProperty("--topNavHeight",n+"px").setStyleProperty("--topBase",l+"px").setStyleProperty("--footerNavHeight",u+"px").setStyleProperty("--viewHeight",d+"px").setStyleProperty("--sideNavHeight",p+"px").setStyleProperty("--contentHeight",p+"px").setStyleProperty("--contentWidth",_+"px")}}}};export{g as RootViewController,g as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.2.143",
3
+ "version": "0.2.145",
4
4
  "description": "UI Component for React,NextJS,esbuild",
5
5
  "scripts": {
6
6
  "start": "run-p clean build:*",