@datawheel/bespoke 0.10.0-beta.1 → 0.10.0-test.6
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/README.md +0 -8
- package/dist/auth.js +1 -1
- package/dist/cms.css +1 -1
- package/dist/cms.js +66 -38
- package/dist/explore.css +1 -1
- package/dist/explore.js +36 -8
- package/dist/index.js +1 -1
- package/dist/redux-store.js +4 -3
- package/dist/report.css +1 -1
- package/dist/report.js +42 -14
- package/dist/server.js +11 -10
- package/package.json +40 -76
- package/css/mixins.scss +0 -178
- package/dist/Search-BWmRyIa9.d.mts +0 -129
- package/dist/auth-BwgF4GT9.d.mts +0 -139
- package/dist/auth.d.mts +0 -42
- package/dist/cms.d.mts +0 -13
- package/dist/explore.d.mts +0 -40
- package/dist/index.d.mts +0 -24
- package/dist/redux-store.d.mts +0 -175
- package/dist/report.d.mts +0 -132
- package/dist/server.d.mts +0 -108
- package/dist/store-De3Xknzr.d.mts +0 -545
- package/dist/types-BcIo0oyw.d.mts +0 -847
package/README.md
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
# Reports
|
|
2
2
|
|
|
3
|
-
## Documentation
|
|
4
|
-
|
|
5
|
-
- **[Customization Guide](./docs/customization.md)** - Overview of styling and component customization options
|
|
6
|
-
- **[Styling Guide](./docs/customization/styles.md)** - Detailed CSS/SCSS customization reference
|
|
7
|
-
- **[Custom Components Guide](./docs/customization/components.md)** - How to override default components
|
|
8
|
-
|
|
9
3
|
## EnvVars
|
|
10
4
|
|
|
11
5
|
```
|
|
@@ -63,5 +57,3 @@ publicRuntimeConfig: {
|
|
|
63
57
|
```
|
|
64
58
|
|
|
65
59
|
And is gonna be offered as ENV_API and ENV_WHATEVER in the list of variables in the profile.
|
|
66
|
-
|
|
67
|
-
## SCSS Mixins
|
package/dist/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {useRouter}from'next/router';import {useEffect,useMemo}from'react';import {SessionProvider,useSession,signIn,signOut}from'next-auth/react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {Menu,Button,Text,Avatar}from'@mantine/core';import {IconUserCircle,IconLogout,IconEdit}from'@tabler/icons-react';import $ from'next/link';function T(o={required:false}){let{update:i,data:s,status:a}=useSession(o);return {update:i,user:s?.user,status:a,isLoading:a==="loading"}}var
|
|
1
|
+
import {useRouter}from'next/router';import {useEffect,useMemo}from'react';import {SessionProvider,useSession,signIn,signOut}from'next-auth/react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {Menu,Button,Text,Avatar}from'@mantine/core';import {IconUserCircle,IconLogout,IconEdit}from'@tabler/icons-react';import $ from'next/link';function T(o={required:false}){let{update:i,data:s,status:a}=useSession(o);return {update:i,user:s?.user,status:a,isLoading:a==="loading"}}var g=T;function w(o){let{SuccessComponent:i,FailureComponent:s}=o,a=new Set(o.allowedRoles);return function(n){let{user:m,status:r}=g(),l=useRouter();if(useEffect(()=>{r==="unauthenticated"&&signIn();},[r,l]),r==="loading")return jsx("div",{children:"Loading..."});if(!m)return jsx(s,{...n});let y=m.bespoke_roles||[];return a.size===0||y.some(t=>a.has(t))?jsx(i,{user:m,...n}):jsx(s,{...n})}}var N=SessionProvider;var p={ADMIN:"Admin",EDITOR:"Editor",WRITER:"Writer"},h={APP:"App",USER:"User"},z=o=>{let i=Object.values(p);return o?o.map(s=>({...s,type:i.includes(s.name)?h.APP:h.USER})):[]};function J({buttonProps:o={},editorMenuItemProps:i={},editorMenuItemRoute:s="/cms",logoutButtonProps:a={},menuProps:U={},options:n="",optionsPosition:m="bottom",translations:r={},withEditorMenuItem:l=true,withSession:y=true}){let{user:t,isLoading:P}=g(),b=useMemo(()=>t?.bespoke_roles||[],[t]),k=useMemo(()=>p&&Object.keys(p).length>0&&Object.keys(p).some(R=>b.includes(p[R])),[b]),x={leftIcon:jsx(IconUserCircle,{}),...o};if(t&&!P){let R={...i},M={color:"red",fullWidth:true,leftIcon:jsx(IconLogout,{size:14}),size:"xs",variant:"subtle",...a},v={shadow:"md",width:"auto",position:"bottom",...U},I=jsx($,{href:s,passHref:true,children:jsx(Menu.Item,{icon:jsx(IconEdit,{size:14}),...R,children:r["Go to editor"]||"Go to editor"})});return jsxs(Menu,{...v,children:[jsx(Menu.Target,{children:jsx(Button,{...x,children:`${r["Welcome message"]||`Hi, ${t.name||t.email}`}`})}),jsxs(Menu.Dropdown,{children:[m==="top"&&jsxs(Fragment,{children:[l&&k&&I,n,(n||l&&k)&&jsx(Menu.Divider,{})]}),y&&jsxs(Menu.Item,{component:"span",style:{pointerEvents:"none"},icon:jsx(Avatar,{src:t.picture,radius:"md"}),children:[jsx(Text,{size:"sm",weight:500,children:t.name}),jsx(Text,{color:"dimmed",size:"xs",children:t.email})]}),jsx(Button,{onClick:()=>signOut({callbackUrl:process.env.NEXT_PUBLIC_REPORTS_BASE_URL||"/"}),...M,children:r.Disconnect||"Disconnect"}),m==="bottom"&&jsxs(Fragment,{children:[(n||l&&k)&&jsx(Menu.Divider,{}),l&&k&&I,n]})]})]})}return jsx(Button,{onClick:()=>signIn(),loading:P,...x,children:P?r["Signing in"]||"Signing in...":r["Sign in"]||"Sign in"})}var X=J;export{X as BespokeLoginBtn,N as BespokeUserProvider,w as BespokeWithPageRoleAuthRequired,p as CMS_ROLES,z as addRoleTypes,g as useBespokeUser};
|
package/dist/cms.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.mantine-Prism-root.cr-variable{font-size:11px;padding:0}.mantine-Prism-root.cr-variable .mantine-Prism-code{background-color:transparent!important;padding:0}.cr-variable-accordion .mantine-Accordion-item{border-bottom:0}.cr-variable-accordion .mantine-Accordion-control{padding:2px}.cr-variable-accordion .mantine-Accordion-contentInner{padding:0}.cr-variable-accordion .mantine-Accordion-icon{margin-right:4px}.cr-monaco-container{height:100%}.selector-option-default-col{width:60px}.required:after{content:" *";color:red}.cr-block-output{align-items:stretch;margin:0;position:relative}.cr-block-output .cr-block-output-editor{display:flex;flex-direction:column}.cr-block-output .cr-block-output-mode-control{position:absolute;right:0;top:0}.mantine-Header-root~.mantine-AppShell-body{min-height:calc(100vh - 50px)}.cms-section-controls{height:0}.cms-section-controls button{background-color:#fff;opacity:0;transition:opacity .1s;z-index:2}.cms-section-container:hover>.cms-section-controls button{opacity:1}.cms-section-container:hover .cms-section-header,.cms-section-container:hover .cms-section-click-to-edit,.cms-section-header.active{opacity:1}.cms-section-container:hover .cms-section-overlay,.cms-section-container.isDragging .cms-section-overlay{opacity:.4}.cms-section-container .cms-section-content{min-height:20px}.mantine-Modal-body{max-height:90vw}.mantine-Prism-root pre{font-size:12px;line-height:1.25}
|