@5minds/processcube_app_sdk 0.0.1-feature-eae327-lksd17bq → 0.0.1-feature-e827cb-lktsremv

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.
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react/experimental" />
2
2
  import React from 'react';
3
- export declare const NotificationIcon: ({ onTaskClick, newTasksApiUrl, loadingComponent, errorComponent, }: {
3
+ export declare const NotificationIcon: ({ onTaskClick, newTasksApiUrl, refreshInterval, loadingComponent, errorComponent, }: {
4
4
  onTaskClick: (taskId: string) => void;
5
5
  newTasksApiUrl: string;
6
+ refreshInterval?: number | undefined;
6
7
  loadingComponent?: React.ReactNode;
7
8
  errorComponent?: React.ReactNode;
8
9
  }) => string | number | true | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | React.PromiseLikeOfReactNode;
package/client/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";"use client";var b=Object.create;var s=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var w=(o,r)=>{for(var n in r)s(o,n,{get:r[n],enumerable:!0})},c=(o,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of v(r))!I.call(o,i)&&i!==n&&s(o,i,{get:()=>r[i],enumerable:!(a=y(r,i))||a.enumerable});return o};var P=(o,r,n)=>(n=o!=null?b(S(o)):{},c(r||!o||!o.__esModule?s(n,"default",{value:o,enumerable:!0}):n,o)),k=o=>c(s({},"__esModule",{value:!0}),o);var N={};w(N,{DynamicLink:()=>C,NotificationIcon:()=>B});module.exports=k(N);var W=require("client-only");var p=require("next/navigation"),d=require("react/jsx-runtime");function C({href:o,children:r}){let n=(0,p.useRouter)();return(0,d.jsx)("a",{href:o,onClick:a=>{a.preventDefault(),n.replace(o),n.refresh()},children:r})}var u=require("react"),f=require("react-icons/fi"),e=require("@chakra-ui/react"),g=P(require("swr"),1),t=require("react/jsx-runtime"),T=o=>fetch(o).then(r=>r.json()),B=({onTaskClick:o,newTasksApiUrl:r,loadingComponent:n=null,errorComponent:a=null})=>{let[i,m]=(0,u.useState)([]),{data:h,error:x}=(0,g.default)(r,T,{refreshInterval:3e3,onSuccess:l=>{m(l)}});return x&&a?a:!h&&n?n:(0,t.jsx)(e.ChakraProvider,{children:(0,t.jsx)(e.Box,{children:(0,t.jsxs)(e.Popover,{placement:"right-end",closeOnBlur:!1,children:[(0,t.jsx)(e.PopoverTrigger,{children:(0,t.jsxs)(e.Flex,{position:"relative",align:"center",children:[(0,t.jsx)(e.IconButton,{icon:(0,t.jsx)(f.FiBell,{fontSize:"1.25rem"}),"aria-label":"Settings",bg:"gray.300"}),i.length>0&&(0,t.jsx)(e.Box,{bg:"red",w:"20px",h:"20px",borderRadius:"50%",position:"absolute",top:"-10px",right:"-10px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"0.8rem",color:"white",children:i.length})]})}),(0,t.jsxs)(e.PopoverContent,{color:"black",bg:"gray.100",borderColor:"blue.800",children:[i.length===0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.PopoverHeader,{pt:4,fontWeight:"bold",border:"0",children:"Keine neuen Aufgaben"}),(0,t.jsx)(e.PopoverArrow,{bg:"blue.800"}),(0,t.jsx)(e.PopoverCloseButton,{})]}),i.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.PopoverHeader,{pt:4,fontWeight:"bold",border:"0",children:"Neue Aufgaben"}),(0,t.jsx)(e.PopoverArrow,{bg:"blue.800"}),(0,t.jsx)(e.PopoverCloseButton,{}),(0,t.jsx)(e.PopoverBody,{children:(0,t.jsx)(e.Center,{maxW:"sm",mx:"auto",py:{base:"4",md:"8"},children:(0,t.jsx)(e.Stack,{spacing:"5",flex:"1",children:(0,t.jsx)(e.List,{listStyleType:"none",children:(0,t.jsx)(e.Stack,{spacing:"3",width:"full",children:i.map(l=>l?(0,t.jsx)(e.ListItem,{value:l.flowNodeInstanceId,backgroundColor:"white",p:"4",boxShadow:"sm",position:"relative",borderRadius:"lg",children:(0,t.jsxs)(e.Stack,{shouldWrapChildren:!0,spacing:"4",children:[(0,t.jsxs)(e.Flex,{justify:"space-between",alignItems:"center",children:[(0,t.jsx)(e.Text,{textStyle:"sm",fontWeight:"medium",color:"fg.emphasized",children:l.processModelId}),(0,t.jsx)(e.Button,{size:"xs",colorScheme:"blue",onClick:()=>o(l.flowNodeInstanceId),children:"X"})]}),(0,t.jsxs)(e.Flex,{justify:"space-between",alignItems:"center",children:[(0,t.jsx)(e.Text,{textStyle:"xs",color:"fg.subtle",fontWeight:"medium",children:l.flowNodeName}),l.startedAt&&(0,t.jsx)(e.Text,{textStyle:"xs",color:"gray.500",textAlign:"right",children:new Date(l.startedAt).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})})]})]})},l.flowNodeInstanceId):null)})})})})})]})]})]})})})};0&&(module.exports={DynamicLink,NotificationIcon});
1
+ "use strict";"use client";var I=Object.create;var c=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var k=(t,r)=>{for(var n in r)c(t,n,{get:r[n],enumerable:!0})},p=(t,r,n,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of w(r))!P.call(t,i)&&i!==n&&c(t,i,{get:()=>r[i],enumerable:!(l=v(r,i))||l.enumerable});return t};var C=(t,r,n)=>(n=t!=null?I(S(t)):{},p(r||!t||!t.__esModule?c(n,"default",{value:t,enumerable:!0}):n,t)),N=t=>p(c({},"__esModule",{value:!0}),t);var A={};k(A,{DynamicLink:()=>T,NotificationIcon:()=>R});module.exports=N(A);var M=require("client-only");var f=require("next/navigation"),u=require("react/jsx-runtime");function T({href:t,children:r}){let n=(0,f.useRouter)();return(0,u.jsx)("a",{href:t,onClick:l=>{l.preventDefault(),n.replace(t),n.refresh()},children:r})}var g=require("react"),m=require("react-icons/fi"),e=require("@chakra-ui/react"),h=C(require("swr"),1),o=require("react/jsx-runtime"),B=t=>fetch(t).then(r=>r.json()),R=({onTaskClick:t,newTasksApiUrl:r,refreshInterval:n=5e3,loadingComponent:l=null,errorComponent:i=null})=>{let[s,d]=(0,g.useState)([]),{data:x,error:b}=(0,h.default)(r,B,{refreshInterval:n,onSuccess:a=>{d(a)}});return b&&i?i:!x&&l?l:(0,o.jsx)(e.ChakraProvider,{children:(0,o.jsx)(e.Box,{children:(0,o.jsxs)(e.Popover,{placement:"right-end",closeOnBlur:!1,children:[(0,o.jsx)(e.PopoverTrigger,{children:(0,o.jsxs)(e.Flex,{position:"relative",align:"center",children:[(0,o.jsx)(e.IconButton,{icon:(0,o.jsx)(m.FiBell,{fontSize:"1.25rem"}),"aria-label":"Settings",bg:"gray.300"}),s.length>0&&(0,o.jsx)(e.Box,{bg:"red",w:"20px",h:"20px",borderRadius:"50%",position:"absolute",top:"-10px",right:"-10px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"0.8rem",color:"white",children:s.length})]})}),(0,o.jsxs)(e.PopoverContent,{color:"black",bg:"gray.100",borderColor:"blue.800",children:[s.length===0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.PopoverHeader,{pt:4,fontWeight:"bold",border:"0",children:"Keine neuen Aufgaben"}),(0,o.jsx)(e.PopoverArrow,{bg:"blue.800"}),(0,o.jsx)(e.PopoverCloseButton,{})]}),s.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.PopoverHeader,{pt:4,fontWeight:"bold",border:"0",children:"Neue Aufgaben"}),(0,o.jsx)(e.PopoverArrow,{bg:"blue.800"}),(0,o.jsx)(e.PopoverCloseButton,{}),(0,o.jsx)(e.PopoverBody,{children:(0,o.jsx)(e.Center,{maxW:"sm",mx:"auto",py:{base:"4",md:"8"},children:(0,o.jsx)(e.Stack,{spacing:"5",flex:"1",children:(0,o.jsx)(e.List,{listStyleType:"none",children:(0,o.jsx)(e.Stack,{spacing:"3",width:"full",children:s.map(a=>a?(0,o.jsx)(e.ListItem,{value:a.flowNodeInstanceId,backgroundColor:"white",p:"4",boxShadow:"sm",position:"relative",borderRadius:"lg",children:(0,o.jsxs)(e.Stack,{shouldWrapChildren:!0,spacing:"4",children:[(0,o.jsxs)(e.Flex,{justify:"space-between",alignItems:"center",children:[(0,o.jsx)(e.Text,{textStyle:"sm",fontWeight:"medium",color:"fg.emphasized",children:a.processModelId}),(0,o.jsx)(e.Button,{size:"xs",colorScheme:"blue",onClick:()=>{t(a.flowNodeInstanceId),d(s.filter(y=>y.flowNodeInstanceId!==a.flowNodeInstanceId))},children:"X"})]}),(0,o.jsxs)(e.Flex,{justify:"space-between",alignItems:"center",children:[(0,o.jsx)(e.Text,{textStyle:"xs",color:"fg.subtle",fontWeight:"medium",children:a.flowNodeName}),a.startedAt&&(0,o.jsx)(e.Text,{textStyle:"xs",color:"gray.500",textAlign:"right",children:new Date(a.startedAt).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})})]})]})},a.flowNodeInstanceId):null)})})})})})]})]})]})})})};0&&(module.exports={DynamicLink,NotificationIcon});
package/client/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import"client-only";import{useRouter as y}from"next/navigation";import{jsx as v}from"react/jsx-runtime";function z({href:r,children:n}){let i=y();return v("a",{href:r,onClick:a=>{a.preventDefault(),i.replace(r),i.refresh()},children:n})}import{useState as S}from"react";import{FiBell as I}from"react-icons/fi";import{IconButton as w,Box as d,Flex as s,Popover as P,Button as k,PopoverHeader as u,PopoverContent as C,PopoverArrow as f,PopoverCloseButton as g,PopoverBody as T,PopoverTrigger as B,ChakraProvider as N,ListItem as R,Text as c,Center as A,List as D,Stack as p}from"@chakra-ui/react";import L from"swr";import{Fragment as m,jsx as e,jsxs as o}from"react/jsx-runtime";var W=r=>fetch(r).then(n=>n.json()),q=({onTaskClick:r,newTasksApiUrl:n,loadingComponent:i=null,errorComponent:a=null})=>{let[l,h]=S([]),{data:x,error:b}=L(n,W,{refreshInterval:3e3,onSuccess:t=>{h(t)}});return b&&a?a:!x&&i?i:e(N,{children:e(d,{children:o(P,{placement:"right-end",closeOnBlur:!1,children:[e(B,{children:o(s,{position:"relative",align:"center",children:[e(w,{icon:e(I,{fontSize:"1.25rem"}),"aria-label":"Settings",bg:"gray.300"}),l.length>0&&e(d,{bg:"red",w:"20px",h:"20px",borderRadius:"50%",position:"absolute",top:"-10px",right:"-10px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"0.8rem",color:"white",children:l.length})]})}),o(C,{color:"black",bg:"gray.100",borderColor:"blue.800",children:[l.length===0&&o(m,{children:[e(u,{pt:4,fontWeight:"bold",border:"0",children:"Keine neuen Aufgaben"}),e(f,{bg:"blue.800"}),e(g,{})]}),l.length>0&&o(m,{children:[e(u,{pt:4,fontWeight:"bold",border:"0",children:"Neue Aufgaben"}),e(f,{bg:"blue.800"}),e(g,{}),e(T,{children:e(A,{maxW:"sm",mx:"auto",py:{base:"4",md:"8"},children:e(p,{spacing:"5",flex:"1",children:e(D,{listStyleType:"none",children:e(p,{spacing:"3",width:"full",children:l.map(t=>t?e(R,{value:t.flowNodeInstanceId,backgroundColor:"white",p:"4",boxShadow:"sm",position:"relative",borderRadius:"lg",children:o(p,{shouldWrapChildren:!0,spacing:"4",children:[o(s,{justify:"space-between",alignItems:"center",children:[e(c,{textStyle:"sm",fontWeight:"medium",color:"fg.emphasized",children:t.processModelId}),e(k,{size:"xs",colorScheme:"blue",onClick:()=>r(t.flowNodeInstanceId),children:"X"})]}),o(s,{justify:"space-between",alignItems:"center",children:[e(c,{textStyle:"xs",color:"fg.subtle",fontWeight:"medium",children:t.flowNodeName}),t.startedAt&&e(c,{textStyle:"xs",color:"gray.500",textAlign:"right",children:new Date(t.startedAt).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})})]})]})},t.flowNodeInstanceId):null)})})})})})]})]})]})})})};export{z as DynamicLink,q as NotificationIcon};
1
+ "use client";import"client-only";import{useRouter as v}from"next/navigation";import{jsx as w}from"react/jsx-runtime";function H({href:r,children:a}){let i=v();return w("a",{href:r,onClick:l=>{l.preventDefault(),i.replace(r),i.refresh()},children:a})}import{useState as S}from"react";import{FiBell as P}from"react-icons/fi";import{IconButton as k,Box as u,Flex as s,Popover as C,Button as N,PopoverHeader as g,PopoverContent as T,PopoverArrow as m,PopoverCloseButton as h,PopoverBody as B,PopoverTrigger as R,ChakraProvider as A,ListItem as D,Text as c,Center as L,List as F,Stack as d}from"@chakra-ui/react";import W from"swr";import{Fragment as x,jsx as e,jsxs as t}from"react/jsx-runtime";var z=r=>fetch(r).then(a=>a.json()),J=({onTaskClick:r,newTasksApiUrl:a,refreshInterval:i=5e3,loadingComponent:l=null,errorComponent:p=null})=>{let[n,f]=S([]),{data:b,error:y}=W(a,z,{refreshInterval:i,onSuccess:o=>{f(o)}});return y&&p?p:!b&&l?l:e(A,{children:e(u,{children:t(C,{placement:"right-end",closeOnBlur:!1,children:[e(R,{children:t(s,{position:"relative",align:"center",children:[e(k,{icon:e(P,{fontSize:"1.25rem"}),"aria-label":"Settings",bg:"gray.300"}),n.length>0&&e(u,{bg:"red",w:"20px",h:"20px",borderRadius:"50%",position:"absolute",top:"-10px",right:"-10px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"0.8rem",color:"white",children:n.length})]})}),t(T,{color:"black",bg:"gray.100",borderColor:"blue.800",children:[n.length===0&&t(x,{children:[e(g,{pt:4,fontWeight:"bold",border:"0",children:"Keine neuen Aufgaben"}),e(m,{bg:"blue.800"}),e(h,{})]}),n.length>0&&t(x,{children:[e(g,{pt:4,fontWeight:"bold",border:"0",children:"Neue Aufgaben"}),e(m,{bg:"blue.800"}),e(h,{}),e(B,{children:e(L,{maxW:"sm",mx:"auto",py:{base:"4",md:"8"},children:e(d,{spacing:"5",flex:"1",children:e(F,{listStyleType:"none",children:e(d,{spacing:"3",width:"full",children:n.map(o=>o?e(D,{value:o.flowNodeInstanceId,backgroundColor:"white",p:"4",boxShadow:"sm",position:"relative",borderRadius:"lg",children:t(d,{shouldWrapChildren:!0,spacing:"4",children:[t(s,{justify:"space-between",alignItems:"center",children:[e(c,{textStyle:"sm",fontWeight:"medium",color:"fg.emphasized",children:o.processModelId}),e(N,{size:"xs",colorScheme:"blue",onClick:()=>{r(o.flowNodeInstanceId),f(n.filter(I=>I.flowNodeInstanceId!==o.flowNodeInstanceId))},children:"X"})]}),t(s,{justify:"space-between",alignItems:"center",children:[e(c,{textStyle:"xs",color:"fg.subtle",fontWeight:"medium",children:o.flowNodeName}),o.startedAt&&e(c,{textStyle:"xs",color:"gray.500",textAlign:"right",children:new Date(o.startedAt).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})})]})]})},o.flowNodeInstanceId):null)})})})})})]})]})]})})})};export{H as DynamicLink,J as NotificationIcon};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/processcube_app_sdk",
3
- "version": "0.0.1-feature-eae327-lksd17bq",
3
+ "version": "0.0.1-feature-e827cb-lktsremv",
4
4
  "description": "The SDK for ProcessCube Apps",
5
5
  "type": "module",
6
6
  "main": "common/index.cjs",