@object-ui/runner 4.0.10 → 4.0.11
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/CHANGELOG.md +11 -0
- package/dist/assets/{KanbanEnhanced-3CAK1caq.js → KanbanEnhanced-4AlnLhWh.js} +1 -1
- package/dist/assets/KanbanImpl-B80z5o8a.js +1 -0
- package/dist/assets/{index-DBCb2UYh.js → index-BuaY1SgQ.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +7 -7
- package/dist/assets/KanbanImpl-D1_jcOnH.js +0 -1
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Object UI React Example</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BuaY1SgQ.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/react-DSvSf3Zy.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/ResponsiveContainer-zAl9bAr4.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-C2TyjWkq.js">
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/runner",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.11",
|
|
5
5
|
"description": "Universal Object UI Application Runner",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"homepage": "https://www.objectui.org/docs/utilities/runner",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"react-dom": "19.2.6",
|
|
22
22
|
"tailwind-merge": "^3.6.0",
|
|
23
23
|
"tailwindcss-animate": "^1.0.7",
|
|
24
|
-
"@object-ui/components": "4.0.
|
|
25
|
-
"@object-ui/core": "4.0.
|
|
26
|
-
"@object-ui/plugin-charts": "4.0.
|
|
27
|
-
"@object-ui/plugin-kanban": "4.0.
|
|
28
|
-
"@object-ui/react": "4.0.
|
|
29
|
-
"@object-ui/types": "4.0.
|
|
24
|
+
"@object-ui/components": "4.0.11",
|
|
25
|
+
"@object-ui/core": "4.0.11",
|
|
26
|
+
"@object-ui/plugin-charts": "4.0.11",
|
|
27
|
+
"@object-ui/plugin-kanban": "4.0.11",
|
|
28
|
+
"@object-ui/react": "4.0.11",
|
|
29
|
+
"@object-ui/types": "4.0.11"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@tailwindcss/postcss": "^4.3.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-DSvSf3Zy.js";import{j as n}from"./ResponsiveContainer-zAl9bAr4.js";import{t as r}from"./plus-GsT6aNpZ.js";import{a as i,c as a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./index-DBCb2UYh.js";import{a as g,c as _,d as v,f as y,i as b,l as x,n as S,o as C,r as w,s as T,t as E,u as D}from"./sortable.esm-jpjNE514.js";var O=e(t(),1),k=n(),A=(...e)=>e.filter(Boolean).join(` `),j=`Uncategorized`;function M(e,t){if(!t||t.length===0)return{};for(let n of t){let t=e[n.field];if(t==null)continue;let r=!1,i=String(t);switch(n.operator){case`equals`:r=i===String(n.value);break;case`not_equals`:r=i!==String(n.value);break;case`contains`:r=i.toLowerCase().includes(String(n.value).toLowerCase());break;case`in`:r=Array.isArray(n.value)&&n.value.includes(i);break}if(r)return{...n.backgroundColor?{backgroundColor:n.backgroundColor}:{},...n.borderColor?{borderColor:n.borderColor}:{}}}return{}}function N({card:e,onCardClick:t,conditionalFormatting:n}){let{attributes:r,listeners:o,setNodeRef:s,transform:u,transition:f,isDragging:m}=w({id:e.id}),h={transform:y.Transform.toString(u),transition:f,opacity:m?.5:void 0},g=M(e,n);return(0,k.jsx)(`div`,{ref:s,style:h,...r,...o,role:`listitem`,"aria-label":e.title,onClick:()=>t?.(e),children:(0,k.jsxs)(c,{className:`mb-2 cursor-grab active:cursor-grabbing border-border border-l-4 border-l-primary/40 bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group touch-manipulation`,style:g,children:[e.coverImage&&(0,k.jsx)(`div`,{className:`w-full h-32 overflow-hidden rounded-t-lg`,children:(0,k.jsx)(`img`,{src:e.coverImage,alt:``,className:`w-full h-full object-cover`,loading:`lazy`})}),(0,k.jsxs)(p,{className:`p-2 sm:p-4`,children:[(0,k.jsx)(a,{className:`text-xs sm:text-sm font-medium tracking-tight text-foreground group-hover:text-primary transition-colors`,children:e.title}),e.description&&(0,k.jsx)(d,{className:`text-xs text-muted-foreground line-clamp-2 sm:line-clamp-none`,children:e.description})]}),e.badges&&e.badges.length>0&&(0,k.jsx)(i,{className:`p-2 sm:p-4 pt-0`,children:(0,k.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.badges.map((e,t)=>(0,k.jsx)(l,{variant:e.colorClass?`outline`:e.variant||`default`,className:A(`text-xs font-normal`,e.colorClass),children:e.label},t))})})]})})}function P({columnId:e,onAdd:t}){let[n,i]=O.useState(!1),[a,o]=O.useState(``),s=O.useRef(null),c=()=>{let n=a.trim();n&&(t(e,n),o(``)),i(!1)};return n?(0,k.jsx)(`div`,{className:`mt-2 space-y-2`,children:(0,k.jsx)(f,{ref:s,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),c()):e.key===`Escape`&&(o(``),i(!1))},onBlur:c,placeholder:`Enter card title...`,className:`text-sm`,autoFocus:!0})}):(0,k.jsxs)(h,{variant:`ghost`,size:`sm`,className:`w-full mt-2 text-muted-foreground hover:text-foreground`,onClick:()=>{i(!0),setTimeout(()=>s.current?.focus(),0)},children:[(0,k.jsx)(r,{className:`h-4 w-4 mr-1`}),`Add Card`]})}function F({column:e,cards:t,onCardClick:n,quickAdd:r,onQuickAdd:i,conditionalFormatting:a,columnStyle:o}){let s=t||[],{setNodeRef:c}=w({id:e.id,data:{type:`column`}}),d=e.limit&&s.length>=e.limit,f=o&&o.width!=null?`shrink-0`:`w-[85vw] sm:w-80 shrink-0`;return(0,k.jsxs)(`div`,{ref:c,role:`group`,"aria-label":e.title,style:o,className:A(`flex flex-col rounded-lg border border-border bg-muted/20 snap-start max-h-full min-h-0`,f,e.className),children:[(0,k.jsx)(`div`,{className:`p-3 sm:p-4 border-b border-border/50 bg-muted/30 rounded-t-lg`,children:(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(`h3`,{id:`kanban-col-${e.id}`,className:` text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase truncate`,children:e.title}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(l,{variant:`secondary`,className:`text-xs tabular-nums`,children:[s.length,e.limit&&` / ${e.limit}`]}),d&&(0,k.jsx)(l,{variant:`destructive`,className:`text-xs`,children:`Full`})]})]})}),(0,k.jsxs)(u,{className:`flex-1 p-4`,children:[(0,k.jsx)(E,{items:s.map(e=>e.id),strategy:b,children:(0,k.jsxs)(`div`,{className:`space-y-2`,role:`list`,"aria-label":`${e.title} cards`,children:[s.length===0&&(0,k.jsx)(`div`,{className:`flex flex-col items-center justify-center py-8 text-muted-foreground/50`,children:(0,k.jsx)(`span`,{className:`text-xs`,children:`No cards`})}),s.map(e=>(0,k.jsx)(N,{card:e,onCardClick:n,conditionalFormatting:a},e.id))]})}),r&&i&&(0,k.jsx)(P,{columnId:e.id,onAdd:i})]})]})}function I({children:e}){return(0,k.jsx)(k.Fragment,{children:e(o())})}function L({columns:e,onCardMove:t,onCardClick:n,className:r,quickAdd:i,onQuickAdd:a,coverImageField:o,conditionalFormatting:c,swimlaneField:l}){return s()?(0,k.jsx)(I,{children:s=>(0,k.jsx)(R,{columns:e,onCardMove:t,onCardClick:n,className:r,dnd:s,quickAdd:i,onQuickAdd:a,coverImageField:o,conditionalFormatting:c,swimlaneField:l})}):(0,k.jsx)(R,{columns:e,onCardMove:t,onCardClick:n,className:r,dnd:null,quickAdd:i,onQuickAdd:a,coverImageField:o,conditionalFormatting:c,swimlaneField:l})}function R({columns:e,onCardMove:t,onCardClick:n,className:r,dnd:i,quickAdd:a,onQuickAdd:o,coverImageField:s,conditionalFormatting:c,swimlaneField:l}){let[u,d]=O.useState(null),f=O.useRef(null),{width:p}=m(f),h=O.useMemo(()=>p?p<480?{width:Math.max(p-32,220)}:p<720?{width:280}:{width:320}:{},[p]),y=l?`objectui:kanban-collapsed:${l}`:null,[w,M]=O.useState(()=>{if(!y)return new Set;try{let e=localStorage.getItem(y);if(e){let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}}catch{}return new Set}),P=O.useMemo(()=>(e||[]).map(e=>({...e,cards:e.cards||[]})),[e]),[I,L]=O.useState(P);O.useEffect(()=>{L(P)},[P]);let R=O.useMemo(()=>{if(!l)return null;let e=I.flatMap(e=>e.cards),t=new Set;return e.forEach(e=>{let n=e[l];t.add(n==null?j:String(n))}),Array.from(t).sort()},[I,l]),z=O.useCallback(e=>{M(t=>{let n=new Set(t);if(n.has(e)?n.delete(e):n.add(e),y)try{localStorage.setItem(y,JSON.stringify([...n]))}catch{}return n})},[y]),B=v(D(T,{activationConstraint:{distance:5}}),D(_,{activationConstraint:{delay:200,tolerance:5}})),V=e=>{let{active:t}=e,n=U(t.id);if(d(n),i&&n){let e=W(n.id);e&&i.startDrag({id:n.id,type:`kanban-card`,data:n,sourceId:e.id})}},H=e=>{let{active:n,over:r}=e;if(d(null),!r){i&&i.endDrag();return}let a=n.id,o=r.id;if(a===o){i&&i.endDrag();return}let s=W(a),c=W(o)||G(o);if(!s||!c){i&&i.endDrag();return}if(s.id===c.id){let e=[...s.cards],t=S(e,e.findIndex(e=>e.id===a),e.findIndex(e=>e.id===o));L(e=>e.map(e=>e.id===s.id?{...e,cards:t}:e))}else{let e=[...s.cards],n=[...c.cards],r=e.findIndex(e=>e.id===a),i=o===c.id?n.length:n.findIndex(e=>e.id===o),[l]=e.splice(r,1);n.splice(i,0,l),L(t=>t.map(t=>t.id===s.id?{...t,cards:e}:t.id===c.id?{...t,cards:n}:t)),t&&t(a,s.id,c.id,i)}i&&i.endDrag(c.id)},U=O.useCallback(e=>{for(let t of I){let n=t.cards.find(t=>t.id===e);if(n)return n}return null},[I]),W=O.useCallback(e=>I.find(t=>t.cards.some(t=>t.id===e))||null,[I]),G=O.useCallback(e=>I.find(t=>t.id===e)||null,[I]);return(0,k.jsxs)(g,{sensors:B,collisionDetection:x,onDragStart:V,onDragEnd:H,children:[(0,k.jsxs)(`div`,{ref:f,className:`flex flex-col min-w-0 min-h-0 h-full`,children:[(0,k.jsxs)(`div`,{className:`flex sm:hidden items-center justify-between px-3 pb-2 text-xs text-muted-foreground`,children:[(0,k.jsxs)(`span`,{children:[I.length,` columns`]}),(0,k.jsx)(`span`,{children:`← Swipe to navigate →`})]}),R?(0,k.jsxs)(`div`,{className:A(`flex flex-col gap-2 px-4 sm:px-6 py-3 sm:py-4 min-w-0 overflow-hidden`,r),role:`region`,"aria-label":`Kanban board with swimlanes`,children:[(0,k.jsx)(`div`,{className:`flex gap-3 sm:gap-4 pl-36 sm:pl-44 overflow-x-auto`,children:I.map(e=>(0,k.jsxs)(`div`,{className:`w-[85vw] sm:w-80 shrink-0 text-center`,children:[(0,k.jsx)(`span`,{className:` text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase`,children:e.title}),(0,k.jsxs)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:[`(`,e.cards.length,`)`]})]},e.id))}),R.map(e=>{let t=w.has(e),r=I.reduce((t,n)=>t+n.cards.filter(t=>(t[l]==null?j:String(t[l]))===e).length,0);return(0,k.jsxs)(`div`,{className:`border rounded-lg bg-muted/10`,children:[(0,k.jsxs)(`button`,{className:`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-muted/30 transition-colors`,onClick:()=>z(e),"aria-expanded":!t,children:[(0,k.jsx)(`span`,{className:A(`transition-transform text-xs`,t?``:`rotate-90`),children:`▶`}),(0,k.jsx)(`span`,{className:` text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e}),(0,k.jsxs)(`span`,{className:` text-xs text-muted-foreground`,children:[`(`,r,`)`]})]}),!t&&(0,k.jsx)(`div`,{className:`flex gap-3 sm:gap-4 overflow-x-auto px-2 pb-3 pl-36 sm:pl-44`,children:I.map(t=>{let r=t.cards.filter(t=>(t[l]==null?j:String(t[l]))===e);return(0,k.jsx)(`div`,{className:`w-[85vw] sm:w-80 shrink-0 min-h-[60px] rounded-md bg-card/20 p-2`,children:(0,k.jsx)(E,{items:r.map(e=>e.id),strategy:b,children:(0,k.jsx)(`div`,{className:`space-y-2`,role:`list`,"aria-label":`${t.title} - ${e} cards`,children:r.map(e=>(0,k.jsx)(N,{card:e,onCardClick:n,conditionalFormatting:c},e.id))})})},t.id)})})]},e)})]}):(0,k.jsx)(`div`,{className:A(`flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory px-4 sm:px-6 py-3 sm:py-4 [-webkit-overflow-scrolling:touch] min-w-0 min-h-0 h-full`,r),role:`region`,"aria-label":`Kanban board`,children:I.map(e=>(0,k.jsx)(F,{column:e,cards:e.cards,onCardClick:n,quickAdd:a,onQuickAdd:o,conditionalFormatting:c,columnStyle:h},e.id))})]}),(0,k.jsx)(C,{children:(0,k.jsx)(`div`,{"aria-live":`assertive`,"aria-label":u?`Dragging ${u.title}`:void 0,children:u?(0,k.jsx)(N,{card:u,conditionalFormatting:c}):null})})]})}export{L as default};
|