@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
|
|
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
|
|
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};
|