@object-ui/plugin-designer 0.1.0
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/LICENSE +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1166 -0
- package/dist/index.umd.cjs +6 -0
- package/dist/src/CollaborationProvider.d.ts +36 -0
- package/dist/src/CollaborationProvider.d.ts.map +1 -0
- package/dist/src/DataModelDesigner.d.ts +27 -0
- package/dist/src/DataModelDesigner.d.ts.map +1 -0
- package/dist/src/PageDesigner.d.ts +27 -0
- package/dist/src/PageDesigner.d.ts.map +1 -0
- package/dist/src/ProcessDesigner.d.ts +33 -0
- package/dist/src/ProcessDesigner.d.ts.map +1 -0
- package/dist/src/ReportDesigner.d.ts +38 -0
- package/dist/src/ReportDesigner.d.ts.map +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.d.ts.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(R,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("@object-ui/core"),require("react"),require("lucide-react"),require("clsx"),require("tailwind-merge")):typeof define=="function"&&define.amd?define(["exports","@object-ui/core","react","lucide-react","clsx","tailwind-merge"],D):(R=typeof globalThis<"u"?globalThis:R||self,D(R.ObjectUIPluginDesigner={},R.ObjectUICore,R.React,R.lucideReact,R.clsx,R.tailwindMerge))})(this,(function(R,D,x,f,G,L){"use strict";var Y={exports:{}},M={};var Q;function he(){if(Q)return M;Q=1;var n=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function h(N,i,d){var b=null;if(d!==void 0&&(b=""+d),i.key!==void 0&&(b=""+i.key),"key"in i){d={};for(var S in i)S!=="key"&&(d[S]=i[S])}else d=i;return i=d.ref,{$$typeof:n,type:N,key:b,ref:i!==void 0?i:null,props:d}}return M.Fragment=u,M.jsx=h,M.jsxs=h,M}var F={};var q;function pe(){return q||(q=1,process.env.NODE_ENV!=="production"&&(function(){function n(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ye?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case o:return"Fragment";case c:return"Profiler";case r:return"StrictMode";case p:return"Suspense";case g:return"SuspenseList";case J:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case A:return"Portal";case C:return t.displayName||"Context";case s:return(t._context.displayName||"Context")+".Consumer";case m:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return a=t.displayName||null,a!==null?a:n(t.type)||"Memo";case I:a=t._payload,t=t._init;try{return n(t(a))}catch{}}return null}function u(t){return""+t}function h(t){try{u(t);var a=!1}catch{a=!0}if(a){a=console;var w=a.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return w.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),u(t)}}function N(t){if(t===o)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===I)return"<...>";try{var a=n(t);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function i(){var t=B.A;return t===null?null:t.getOwner()}function d(){return Error("react-stack-top-frame")}function b(t){if(oe.call(t,"key")){var a=Object.getOwnPropertyDescriptor(t,"key").get;if(a&&a.isReactWarning)return!1}return t.key!==void 0}function S(t,a){function w(){le||(le=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}w.isReactWarning=!0,Object.defineProperty(t,"key",{get:w,configurable:!0})}function l(){var t=n(this.type);return ie[t]||(ie[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function P(t,a,w,k,U,Z){var E=w.ref;return t={$$typeof:j,type:t,key:a,props:w,_owner:k},(E!==void 0?E:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:l}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function y(t,a,w,k,U,Z){var E=a.children;if(E!==void 0)if(k)if(ve(E)){for(k=0;k<E.length;k++)T(E[k]);Object.freeze&&Object.freeze(E)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else T(E);if(oe.call(a,"key")){E=n(t);var z=Object.keys(a).filter(function(we){return we!=="key"});k=0<z.length?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}",ue[E+k]||(z=0<z.length?"{"+z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,k,E,z,E),ue[E+k]=!0)}if(E=null,w!==void 0&&(h(w),E=""+w),b(a)&&(h(a.key),E=""+a.key),"key"in a){w={};for(var K in a)K!=="key"&&(w[K]=a[K])}else w=a;return E&&S(w,typeof t=="function"?t.displayName||t.name||"Unknown":t),P(t,E,w,i(),U,Z)}function T(t){v(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===I&&(t._payload.status==="fulfilled"?v(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function v(t){return typeof t=="object"&&t!==null&&t.$$typeof===j}var _=x,j=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),C=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),ye=Symbol.for("react.client.reference"),B=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,ve=Array.isArray,X=console.createTask?console.createTask:function(){return null};_={react_stack_bottom_frame:function(t){return t()}};var le,ie={},de=_.react_stack_bottom_frame.bind(_,d)(),ce=X(N(d)),ue={};F.Fragment=o,F.jsx=function(t,a,w){var k=1e4>B.recentlyCreatedOwnerStacks++;return y(t,a,w,!1,k?Error("react-stack-top-frame"):de,k?X(N(t)):ce)},F.jsxs=function(t,a,w){var k=1e4>B.recentlyCreatedOwnerStacks++;return y(t,a,w,!0,k?Error("react-stack-top-frame"):de,k?X(N(t)):ce)}})()),F}var $;function me(){return $||($=1,process.env.NODE_ENV==="production"?Y.exports=he():Y.exports=pe()),Y.exports}var e=me();function V(...n){return L.twMerge(G.clsx(n))}function ee({canvas:n={width:1200,height:800,gridSize:8,showGrid:!0,snapToGrid:!0},components:u=[],palette:h=xe,showComponentTree:N=!0,undoRedo:i=!0,readOnly:d=!1,onChange:b,className:S}){const[l,P]=x.useState(u),[y,T]=x.useState(null),[v,_]=x.useState(n.zoom??1),j=x.useMemo(()=>l.find(r=>r.id===y),[l,y]),A=x.useCallback((r,c)=>{if(d)return;const s={id:`comp-${Date.now()}`,type:r,label:c,position:{x:100,y:100,width:200,height:100},props:{}},C=[...l,s];P(C),T(s.id),b?.(C)},[l,d,b]),o=x.useCallback(r=>{if(d)return;const c=l.filter(s=>s.id!==r);P(c),y===r&&T(null),b?.(c)},[l,y,d,b]);return e.jsxs("div",{className:V("flex h-full w-full border rounded-lg overflow-hidden bg-background",S),children:[!d&&e.jsxs("div",{className:"w-60 border-r bg-muted/30 flex flex-col",children:[e.jsx("div",{className:"p-3 border-b font-medium text-sm",children:"Components"}),e.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:h.map(r=>e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground px-2 py-1 uppercase",children:r.label}),r.items.map(c=>e.jsxs("button",{onClick:()=>A(c.type,c.label),className:"w-full flex items-center gap-2 px-2 py-1.5 text-sm rounded hover:bg-accent text-left",children:[e.jsx(f.Plus,{className:"h-3 w-3"}),c.label]},c.type))]},r.name))})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 p-2 border-b bg-muted/20",children:[i&&!d&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"p-1.5 rounded hover:bg-accent",title:"Undo",children:e.jsx(f.Undo2,{className:"h-4 w-4"})}),e.jsx("button",{className:"p-1.5 rounded hover:bg-accent",title:"Redo",children:e.jsx(f.Redo2,{className:"h-4 w-4"})}),e.jsx("div",{className:"w-px h-5 bg-border mx-1"})]}),e.jsx("button",{className:"p-1.5 rounded hover:bg-accent",title:"Preview",children:e.jsx(f.Eye,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[Math.round(v*100),"%"]})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-muted/10 p-4",children:e.jsx("div",{className:"relative bg-background border rounded shadow-sm mx-auto",style:{width:n.width*v,height:n.height*v,backgroundImage:n.showGrid?"radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)":void 0,backgroundSize:n.showGrid&&n.gridSize?`${n.gridSize*v}px ${n.gridSize*v}px`:void 0},children:l.map(r=>e.jsxs("div",{className:V("absolute border rounded cursor-move select-none transition-shadow",y===r.id?"border-primary ring-2 ring-primary/20 shadow-md":"border-border hover:border-primary/50"),style:{left:r.position.x*v,top:r.position.y*v,width:typeof r.position.width=="number"?r.position.width*v:r.position.width,height:typeof r.position.height=="number"?r.position.height*v:r.position.height},onClick:()=>T(r.id),children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted/50 text-xs border-b",children:[e.jsx(f.GripVertical,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"truncate",children:r.label??r.type}),!d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),o(r.id)},className:"ml-auto p-0.5 rounded hover:bg-destructive/10",children:e.jsx(f.Trash2,{className:"h-3 w-3 text-destructive"})})]}),e.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:r.type})]},r.id))})})]}),N&&e.jsxs("div",{className:"w-60 border-l bg-muted/30 flex flex-col",children:[e.jsxs("div",{className:"p-3 border-b font-medium text-sm flex items-center gap-2",children:[e.jsx(f.Layers,{className:"h-4 w-4"}),"Component Tree"]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:l.length===0?e.jsx("div",{className:"text-xs text-muted-foreground text-center py-4",children:"No components added yet"}):l.map(r=>e.jsx("button",{onClick:()=>T(r.id),className:V("w-full flex items-center gap-2 px-2 py-1.5 text-sm rounded text-left",y===r.id?"bg-accent":"hover:bg-accent/50"),children:e.jsx("span",{className:"truncate",children:r.label??r.type})},r.id))}),j&&e.jsxs("div",{className:"border-t p-3",children:[e.jsx("div",{className:"text-xs font-medium mb-2",children:"Properties"}),e.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[e.jsxs("div",{children:["Type: ",j.type]}),e.jsxs("div",{children:["ID: ",j.id]}),e.jsxs("div",{children:["Position: ",j.position.x,", ",j.position.y]}),e.jsxs("div",{children:["Size: ",j.position.width," × ",j.position.height]})]})]})]})]})}const xe=[{name:"layout",label:"Layout",items:[{type:"container",label:"Container",defaultSize:{width:400,height:300}},{type:"flex",label:"Flex",defaultSize:{width:400,height:200}},{type:"grid",label:"Grid",defaultSize:{width:400,height:300}},{type:"card",label:"Card",defaultSize:{width:300,height:200}},{type:"tabs",label:"Tabs",defaultSize:{width:400,height:300}}]},{name:"form",label:"Form",items:[{type:"input",label:"Input",defaultSize:{width:300,height:60}},{type:"textarea",label:"Textarea",defaultSize:{width:300,height:120}},{type:"select",label:"Select",defaultSize:{width:300,height:60}},{type:"checkbox",label:"Checkbox",defaultSize:{width:200,height:40}},{type:"button",label:"Button",defaultSize:{width:120,height:40}}]},{name:"data",label:"Data",items:[{type:"table",label:"Table",defaultSize:{width:600,height:400}},{type:"chart",label:"Chart",defaultSize:{width:400,height:300}},{type:"list",label:"List",defaultSize:{width:300,height:400}},{type:"statistic",label:"Statistic",defaultSize:{width:200,height:100}}]}];function W(...n){return L.twMerge(G.clsx(n))}function te({entities:n=[],relationships:u=[],canvas:h={width:1200,height:800,showGrid:!0},showRelationshipLabels:N=!0,readOnly:i=!1,onEntitiesChange:d,onRelationshipsChange:b,className:S}){const[l,P]=x.useState(n),[y,T]=x.useState(u),[v,_]=x.useState(null),j=x.useCallback(()=>{if(i)return;const o={id:`entity-${Date.now()}`,name:`new_entity_${l.length+1}`,label:`New Entity ${l.length+1}`,fields:[{name:"id",type:"uuid",primaryKey:!0,required:!0},{name:"created_at",type:"datetime",required:!0},{name:"updated_at",type:"datetime",required:!0}],position:{x:50+l.length%4*280,y:50+Math.floor(l.length/4)*250}},r=[...l,o];P(r),_(o.id),d?.(r)},[l,i,d]),A=x.useCallback(o=>{if(i)return;const r=l.filter(s=>s.id!==o),c=y.filter(s=>s.sourceEntity!==o&&s.targetEntity!==o);P(r),T(c),v===o&&_(null),d?.(r),b?.(c)},[l,y,v,i,d,b]);return e.jsx("div",{className:W("flex h-full w-full border rounded-lg overflow-hidden bg-background",S),children:e.jsxs("div",{className:"flex flex-col w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 p-2 border-b bg-muted/20",children:[e.jsx(f.Database,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium text-sm",children:"Data Model Designer"}),e.jsx("div",{className:"flex-1"}),!i&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:j,className:"flex items-center gap-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90",children:[e.jsx(f.Plus,{className:"h-3 w-3"})," Add Entity"]}),e.jsxs("button",{className:"flex items-center gap-1 px-2 py-1 text-xs rounded bg-secondary text-secondary-foreground hover:bg-secondary/80",children:[e.jsx(f.Link2,{className:"h-3 w-3"})," Add Relationship"]})]})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-muted/10 p-4",children:e.jsxs("div",{className:"relative",style:{width:h.width,minHeight:h.height,backgroundImage:h.showGrid?"radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)":void 0,backgroundSize:h.showGrid?"20px 20px":void 0},children:[e.jsx("svg",{className:"absolute inset-0 pointer-events-none",width:h.width,height:h.height,children:y.map(o=>{const r=l.find(s=>s.id===o.sourceEntity),c=l.find(s=>s.id===o.targetEntity);return!r||!c?null:e.jsxs("g",{children:[e.jsx("line",{x1:r.position.x+120,y1:r.position.y+50,x2:c.position.x+120,y2:c.position.y+50,stroke:"hsl(var(--primary))",strokeWidth:"2",strokeDasharray:o.type==="many-to-many"?"5,5":void 0}),N&&o.label&&e.jsx("text",{x:(r.position.x+c.position.x)/2+120,y:(r.position.y+c.position.y)/2+50-8,textAnchor:"middle",className:"text-xs fill-muted-foreground",children:o.label})]},o.id)})}),l.map(o=>e.jsxs("div",{className:W("absolute rounded-lg border-2 bg-background shadow-sm w-60 select-none",v===o.id?"border-primary ring-2 ring-primary/20":"border-border hover:border-primary/50"),style:{left:o.position.x,top:o.position.y},onClick:()=>_(o.id),children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-t-lg font-medium text-sm",style:{backgroundColor:o.color??"hsl(var(--primary) / 0.1)"},children:[e.jsx(f.Database,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"truncate",children:o.label}),!i&&e.jsx("button",{onClick:r=>{r.stopPropagation(),A(o.id)},className:"ml-auto p-0.5 rounded hover:bg-destructive/20",children:e.jsx(f.Trash2,{className:"h-3 w-3 text-destructive"})})]}),e.jsx("div",{className:"px-3 py-1 divide-y",children:o.fields.map(r=>e.jsxs("div",{className:"flex items-center gap-2 py-1 text-xs",children:[e.jsxs("span",{className:W("font-mono",r.primaryKey&&"font-bold text-primary"),children:[r.primaryKey?"🔑 ":"",r.name]}),e.jsx("span",{className:"text-muted-foreground ml-auto",children:r.type}),r.required&&e.jsx("span",{className:"text-destructive",children:"*"})]},r.name))})]},o.id))]})})]})})}function H(...n){return L.twMerge(G.clsx(n))}function re({processName:n="New Process",nodes:u=[],edges:h=[],lanes:N,canvas:i={width:1400,height:800,showGrid:!0},showToolbar:d=!0,readOnly:b=!1,onNodesChange:S,onEdgesChange:l,className:P}){const[y,T]=x.useState(u),[v,_]=x.useState(h),[j,A]=x.useState(null),o=x.useCallback((s,C)=>{if(b)return;const m={id:`node-${Date.now()}`,type:s,label:C,position:{x:200+y.length*160,y:200}},p=[...y,m];T(p),A(m.id),S?.(p)},[y,b,S]),r=x.useCallback(s=>{if(b)return;const C=y.filter(p=>p.id!==s),m=v.filter(p=>p.source!==s&&p.target!==s);T(C),_(m),j===s&&A(null),S?.(C),l?.(m)},[y,v,j,b,S,l]),c=s=>{switch(s){case"start-event":return"rounded-full bg-green-100 border-green-500 text-green-700";case"end-event":return"rounded-full bg-red-100 border-red-500 text-red-700";case"exclusive-gateway":case"parallel-gateway":case"inclusive-gateway":case"event-based-gateway":return"rotate-45 bg-yellow-100 border-yellow-500 text-yellow-700";case"user-task":return"rounded bg-blue-100 border-blue-500 text-blue-700";case"service-task":case"script-task":return"rounded bg-purple-100 border-purple-500 text-purple-700";default:return"rounded bg-gray-100 border-gray-500 text-gray-700"}};return e.jsxs("div",{className:H("flex flex-col h-full w-full border rounded-lg overflow-hidden bg-background",P),children:[d&&e.jsxs("div",{className:"flex items-center gap-2 p-2 border-b bg-muted/20",children:[e.jsx(f.GitBranch,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium text-sm",children:n}),e.jsx("div",{className:"flex-1"}),!b&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("button",{onClick:()=>o("start-event","Start"),className:"flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",title:"Add Start Event",children:[e.jsx(f.Play,{className:"h-3 w-3 text-green-600"})," Start"]}),e.jsxs("button",{onClick:()=>o("user-task","User Task"),className:"flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",title:"Add User Task",children:[e.jsx(f.Square,{className:"h-3 w-3 text-blue-600"})," Task"]}),e.jsxs("button",{onClick:()=>o("exclusive-gateway","Decision"),className:"flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",title:"Add Gateway",children:[e.jsx(f.Diamond,{className:"h-3 w-3 text-yellow-600"})," Gateway"]}),e.jsxs("button",{onClick:()=>o("end-event","End"),className:"flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-accent",title:"Add End Event",children:[e.jsx(f.Square,{className:"h-3 w-3 text-red-600"})," End"]})]})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-muted/10 p-4",children:e.jsxs("div",{className:"relative",style:{width:i.width,minHeight:i.height,backgroundImage:i.showGrid?"radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)":void 0,backgroundSize:i.showGrid?"20px 20px":void 0},children:[e.jsxs("svg",{className:"absolute inset-0 pointer-events-none",width:i.width,height:i.height,children:[e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"10",refY:"3.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"hsl(var(--foreground))"})})}),v.map(s=>{const C=y.find(p=>p.id===s.source),m=y.find(p=>p.id===s.target);return!C||!m?null:e.jsx("line",{x1:C.position.x+60,y1:C.position.y+25,x2:m.position.x,y2:m.position.y+25,stroke:"hsl(var(--foreground) / 0.5)",strokeWidth:"2",markerEnd:"url(#arrowhead)"},s.id)})]}),y.map(s=>e.jsxs("div",{className:"absolute select-none",style:{left:s.position.x,top:s.position.y},onClick:()=>A(s.id),children:[e.jsx("div",{className:H("flex items-center justify-center border-2 min-w-[120px] min-h-[50px] px-3 py-2",c(s.type),j===s.id&&"ring-2 ring-primary shadow-md"),children:e.jsx("span",{className:H("text-xs font-medium",(s.type==="exclusive-gateway"||s.type==="parallel-gateway")&&"-rotate-45"),children:s.label})}),!b&&j===s.id&&e.jsx("button",{onClick:C=>{C.stopPropagation(),r(s.id)},className:"absolute -top-2 -right-2 p-0.5 rounded-full bg-destructive text-destructive-foreground shadow",children:e.jsx(f.Trash2,{className:"h-3 w-3"})})]},s.id))]})})]})}function se(...n){return L.twMerge(G.clsx(n))}const fe={A4:{width:595,height:842},A3:{width:842,height:1191},Letter:{width:612,height:792},Legal:{width:612,height:1008},Tabloid:{width:792,height:1224}};function ae({reportName:n="Untitled Report",objectName:u,pageSize:h="A4",orientation:N="portrait",margins:i={top:40,right:40,bottom:40,left:40},sections:d=[],showToolbar:b=!0,showPropertyPanel:S=!0,readOnly:l=!1,onSectionsChange:P,className:y}){const[T,v]=x.useState(d.length>0?d:[{type:"header",height:80,elements:[]},{type:"detail",height:400,elements:[],repeat:!0},{type:"footer",height:60,elements:[]}]),[_,j]=x.useState(null),A=fe[h],o=N==="landscape"?A.height:A.width,r=N==="landscape"?A.width:A.height,c=x.useCallback((m,p)=>{if(l)return;const g={id:`elem-${Date.now()}`,type:p,position:{x:i.left,y:10,width:200,height:30},properties:{text:p==="text"?"New Text":void 0,field:p==="field"?"field_name":void 0}},O=T.map((I,J)=>J===m?{...I,elements:[...I.elements,g]}:I);v(O),j(g.id),P?.(O)},[T,i.left,l,P]),s=x.useCallback(m=>{if(l)return;const p=T.map(g=>({...g,elements:g.elements.filter(O=>O.id!==m)}));v(p),_===m&&j(null),P?.(p)},[T,_,l,P]),C=m=>{switch(m){case"header":return"Report Header";case"page-header":return"Page Header";case"group-header":return"Group Header";case"detail":return"Detail";case"group-footer":return"Group Footer";case"page-footer":return"Page Footer";case"footer":return"Report Footer";default:return m}};return e.jsxs("div",{className:se("flex h-full w-full border rounded-lg overflow-hidden bg-background",y),children:[e.jsxs("div",{className:"flex-1 flex flex-col",children:[b&&e.jsxs("div",{className:"flex items-center gap-2 p-2 border-b bg-muted/20",children:[e.jsx(f.FileText,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium text-sm",children:n}),u&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u,")"]}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[h," ",N]})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-muted/10 p-4 flex justify-center",children:e.jsx("div",{className:"bg-white shadow-lg border",style:{width:o,minHeight:r},children:T.map((m,p)=>e.jsxs("div",{className:"relative border-b border-dashed border-gray-300",style:{minHeight:m.height},children:[e.jsxs("div",{className:"absolute left-0 top-0 px-2 py-0.5 bg-muted text-xs text-muted-foreground border-r border-b rounded-br",children:[C(m.type),m.repeat&&" ↻"]}),!l&&e.jsxs("div",{className:"absolute right-1 top-0 flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>c(p,"text"),className:"p-0.5 rounded hover:bg-accent",title:"Add Text",children:e.jsx(f.Type,{className:"h-3 w-3"})}),e.jsx("button",{onClick:()=>c(p,"field"),className:"p-0.5 rounded hover:bg-accent",title:"Add Field",children:e.jsx(f.Plus,{className:"h-3 w-3"})}),e.jsx("button",{onClick:()=>c(p,"image"),className:"p-0.5 rounded hover:bg-accent",title:"Add Image",children:e.jsx(f.ImageIcon,{className:"h-3 w-3"})}),e.jsx("button",{onClick:()=>c(p,"chart"),className:"p-0.5 rounded hover:bg-accent",title:"Add Chart",children:e.jsx(f.BarChart3,{className:"h-3 w-3"})}),e.jsx("button",{onClick:()=>c(p,"table"),className:"p-0.5 rounded hover:bg-accent",title:"Add Table",children:e.jsx(f.Table2,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"relative",style:{minHeight:m.height,paddingTop:24},children:m.elements.map(g=>e.jsxs("div",{className:se("absolute border rounded px-2 py-1 text-xs cursor-pointer",_===g.id?"border-primary ring-1 ring-primary/30 bg-primary/5":"border-dashed border-gray-400 hover:border-primary/50"),style:{left:g.position.x,top:(typeof g.position.y=="number"?g.position.y:0)+24,width:g.position.width,height:g.position.height},onClick:()=>j(g.id),children:[e.jsxs("span",{className:"text-muted-foreground",children:[g.type==="text"&&(g.properties.text??"Text"),g.type==="field"&&`{${g.properties.field??"field"}}`,g.type==="image"&&"🖼 Image",g.type==="chart"&&"📊 Chart",g.type==="table"&&"📋 Table"]}),!l&&_===g.id&&e.jsx("button",{onClick:O=>{O.stopPropagation(),s(g.id)},className:"absolute -top-2 -right-2 p-0.5 rounded-full bg-destructive text-destructive-foreground shadow",children:e.jsx(f.Trash2,{className:"h-2.5 w-2.5"})})]},g.id))})]},`${m.type}-${p}`))})})]}),S&&e.jsxs("div",{className:"w-56 border-l bg-muted/30 flex flex-col",children:[e.jsx("div",{className:"p-3 border-b font-medium text-sm",children:"Properties"}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:_?e.jsx("div",{className:"space-y-2 text-xs",children:e.jsxs("div",{className:"text-muted-foreground",children:["Element ID: ",_]})}):e.jsx("div",{className:"text-xs text-muted-foreground text-center py-4",children:"Select an element to view properties"})})]})]})}const ne=x.createContext(null);ne.displayName="CollaborationContext";function be({config:n,user:u,onOperation:h,children:N}){const i=x.useMemo(()=>!n.enabled||!u?[]:[{userId:u.id,userName:u.name,avatar:u.avatar,color:ge(u.id),status:"active",lastActivity:new Date().toISOString()}],[n.enabled,u]),d=n.enabled&&!!u,b=x.useCallback(l=>{if(!d||!u)return;const P={...l,id:`op-${Date.now()}`,userId:u.id,timestamp:new Date().toISOString(),version:Date.now()};h?.(P)},[d,u,h]),S=x.useMemo(()=>({users:i,isConnected:d,sendOperation:b,currentUserId:u?.id}),[i,d,b,u?.id]);return e.jsx(ne.Provider,{value:S,children:N})}function ge(n){const u=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#f97316"];let h=0;for(let N=0;N<n.length;N++)h=(h<<5)-h+n.charCodeAt(N)|0;return u[Math.abs(h)%u.length]}D.ComponentRegistry.register("page-designer",ee,{label:"Page Designer",category:"Designer",inputs:[{name:"canvas",type:"code",label:"Canvas Configuration"},{name:"components",type:"code",label:"Components"},{name:"showComponentTree",type:"boolean",label:"Show Component Tree",defaultValue:!0},{name:"undoRedo",type:"boolean",label:"Undo/Redo",defaultValue:!0},{name:"readOnly",type:"boolean",label:"Read Only",defaultValue:!1}]}),D.ComponentRegistry.register("data-model-designer",te,{label:"Data Model Designer",category:"Designer",inputs:[{name:"entities",type:"code",label:"Entities"},{name:"relationships",type:"code",label:"Relationships"},{name:"autoLayout",type:"boolean",label:"Auto Layout",defaultValue:!1},{name:"readOnly",type:"boolean",label:"Read Only",defaultValue:!1}]}),D.ComponentRegistry.register("process-designer",re,{label:"Process Designer (BPMN)",category:"Designer",inputs:[{name:"processName",type:"string",label:"Process Name"},{name:"nodes",type:"code",label:"Nodes"},{name:"edges",type:"code",label:"Edges"},{name:"showMinimap",type:"boolean",label:"Show Minimap",defaultValue:!1},{name:"showToolbar",type:"boolean",label:"Show Toolbar",defaultValue:!0},{name:"readOnly",type:"boolean",label:"Read Only",defaultValue:!1}]}),D.ComponentRegistry.register("report-designer",ae,{label:"Report Designer",category:"Designer",inputs:[{name:"reportName",type:"string",label:"Report Name"},{name:"objectName",type:"string",label:"Data Source Object"},{name:"sections",type:"code",label:"Sections"},{name:"showToolbar",type:"boolean",label:"Show Toolbar",defaultValue:!0},{name:"showPropertyPanel",type:"boolean",label:"Show Property Panel",defaultValue:!0},{name:"readOnly",type:"boolean",label:"Read Only",defaultValue:!1}]}),R.CollaborationProvider=be,R.DataModelDesigner=te,R.PageDesigner=ee,R.ProcessDesigner=re,R.ReportDesigner=ae,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CollaborationConfig, CollaborationPresence, CollaborationOperation } from '../../types/src';
|
|
3
|
+
export interface CollaborationContextValue {
|
|
4
|
+
/** Active users in the session */
|
|
5
|
+
users: CollaborationPresence[];
|
|
6
|
+
/** Whether collaboration is connected */
|
|
7
|
+
isConnected: boolean;
|
|
8
|
+
/** Send an operation to collaborators */
|
|
9
|
+
sendOperation: (operation: Omit<CollaborationOperation, 'id' | 'timestamp' | 'version'>) => void;
|
|
10
|
+
/** Current user ID */
|
|
11
|
+
currentUserId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CollaborationProviderProps {
|
|
14
|
+
/** Collaboration configuration */
|
|
15
|
+
config: CollaborationConfig;
|
|
16
|
+
/** Current user info */
|
|
17
|
+
user?: {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
avatar?: string;
|
|
21
|
+
};
|
|
22
|
+
/** Callback when an operation is received from another user */
|
|
23
|
+
onOperation?: (operation: CollaborationOperation) => void;
|
|
24
|
+
/** Children */
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Provider for multi-user collaborative editing.
|
|
29
|
+
* Manages WebSocket connection, presence, and operation broadcasting.
|
|
30
|
+
*/
|
|
31
|
+
export declare function CollaborationProvider({ config, user, onOperation, children, }: CollaborationProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Hook to access the collaboration context.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useCollaboration(): CollaborationContextValue | null;
|
|
36
|
+
//# sourceMappingURL=CollaborationProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollaborationProvider.d.ts","sourceRoot":"","sources":["../../src/CollaborationProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE3G,MAAM,WAAW,yBAAyB;IACxC,kCAAkC;IAClC,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,yCAAyC;IACzC,WAAW,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,aAAa,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE,IAAI,GAAG,WAAW,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;IACjG,sBAAsB;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAKD,MAAM,WAAW,0BAA0B;IACzC,kCAAkC;IAClC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,wBAAwB;IACxB,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,+DAA+D;IAC/D,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC1D,eAAe;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,IAAI,EACJ,WAAW,EACX,QAAQ,GACT,EAAE,0BAA0B,2CA4C5B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,yBAAyB,GAAG,IAAI,CAEnE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DataModelEntity, DataModelRelationship, DesignerCanvasConfig } from '../../types/src';
|
|
2
|
+
export interface DataModelDesignerProps {
|
|
3
|
+
/** Entities in the model */
|
|
4
|
+
entities?: DataModelEntity[];
|
|
5
|
+
/** Relationships between entities */
|
|
6
|
+
relationships?: DataModelRelationship[];
|
|
7
|
+
/** Canvas configuration */
|
|
8
|
+
canvas?: DesignerCanvasConfig;
|
|
9
|
+
/** Show relationship labels */
|
|
10
|
+
showRelationshipLabels?: boolean;
|
|
11
|
+
/** Auto-layout enabled */
|
|
12
|
+
autoLayout?: boolean;
|
|
13
|
+
/** Read-only mode */
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
/** Callback when entities change */
|
|
16
|
+
onEntitiesChange?: (entities: DataModelEntity[]) => void;
|
|
17
|
+
/** Callback when relationships change */
|
|
18
|
+
onRelationshipsChange?: (relationships: DataModelRelationship[]) => void;
|
|
19
|
+
/** Custom CSS class */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Data model designer for creating ER diagrams.
|
|
24
|
+
* Allows visual design of entities, fields, and relationships.
|
|
25
|
+
*/
|
|
26
|
+
export declare function DataModelDesigner({ entities: initialEntities, relationships: initialRelationships, canvas, showRelationshipLabels, readOnly, onEntitiesChange, onRelationshipsChange, className, }: DataModelDesignerProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=DataModelDesigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataModelDesigner.d.ts","sourceRoot":"","sources":["../../src/DataModelDesigner.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AASrG,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,qCAAqC;IACrC,aAAa,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACxC,2BAA2B;IAC3B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,+BAA+B;IAC/B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,0BAA0B;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IACzD,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,KAAK,IAAI,CAAC;IACzE,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EAAE,eAAoB,EAC9B,aAAa,EAAE,oBAAyB,EACxC,MAAqD,EACrD,sBAA6B,EAC7B,QAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,SAAS,GACV,EAAE,sBAAsB,2CA4KxB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DesignerComponent, DesignerCanvasConfig, DesignerPaletteCategory } from '../../types/src';
|
|
2
|
+
export interface PageDesignerProps {
|
|
3
|
+
/** Canvas configuration */
|
|
4
|
+
canvas?: DesignerCanvasConfig;
|
|
5
|
+
/** Initial components */
|
|
6
|
+
components?: DesignerComponent[];
|
|
7
|
+
/** Component palette categories */
|
|
8
|
+
palette?: DesignerPaletteCategory[];
|
|
9
|
+
/** Show component tree panel */
|
|
10
|
+
showComponentTree?: boolean;
|
|
11
|
+
/** Enable undo/redo */
|
|
12
|
+
undoRedo?: boolean;
|
|
13
|
+
/** Property editor */
|
|
14
|
+
propertyEditor?: boolean;
|
|
15
|
+
/** Read-only mode */
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
/** Callback when components change */
|
|
18
|
+
onChange?: (components: DesignerComponent[]) => void;
|
|
19
|
+
/** Custom CSS class */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Drag-and-drop page designer component.
|
|
24
|
+
* Allows visual composition of UI components on a canvas.
|
|
25
|
+
*/
|
|
26
|
+
export declare function PageDesigner({ canvas, components: initialComponents, palette, showComponentTree, undoRedo, readOnly, onChange, className, }: PageDesignerProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=PageDesigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageDesigner.d.ts","sourceRoot":"","sources":["../../src/PageDesigner.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAS1B,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,yBAAyB;IACzB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,mCAAmC;IACnC,OAAO,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACpC,gCAAgC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IACrD,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAoF,EACpF,UAAU,EAAE,iBAAsB,EAClC,OAAyB,EACzB,iBAAwB,EACxB,QAAe,EACf,QAAgB,EAChB,QAAQ,EACR,SAAS,GACV,EAAE,iBAAiB,2CAiMnB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BPMNNode, BPMNEdge, BPMNLane, DesignerCanvasConfig } from '../../types/src';
|
|
2
|
+
export interface ProcessDesignerProps {
|
|
3
|
+
/** Process name */
|
|
4
|
+
processName?: string;
|
|
5
|
+
/** Process version */
|
|
6
|
+
version?: string;
|
|
7
|
+
/** BPMN nodes */
|
|
8
|
+
nodes?: BPMNNode[];
|
|
9
|
+
/** BPMN edges */
|
|
10
|
+
edges?: BPMNEdge[];
|
|
11
|
+
/** Swim lanes */
|
|
12
|
+
lanes?: BPMNLane[];
|
|
13
|
+
/** Canvas configuration */
|
|
14
|
+
canvas?: DesignerCanvasConfig;
|
|
15
|
+
/** Show minimap */
|
|
16
|
+
showMinimap?: boolean;
|
|
17
|
+
/** Show toolbar */
|
|
18
|
+
showToolbar?: boolean;
|
|
19
|
+
/** Read-only mode */
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
/** Callback when nodes change */
|
|
22
|
+
onNodesChange?: (nodes: BPMNNode[]) => void;
|
|
23
|
+
/** Callback when edges change */
|
|
24
|
+
onEdgesChange?: (edges: BPMNEdge[]) => void;
|
|
25
|
+
/** Custom CSS class */
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Process designer for creating BPMN 2.0 workflows.
|
|
30
|
+
* Supports nodes, edges, lanes, and conditional flows.
|
|
31
|
+
*/
|
|
32
|
+
export declare function ProcessDesigner({ processName, nodes: initialNodes, edges: initialEdges, lanes: _lanes, canvas, showToolbar, readOnly, onNodesChange, onEdgesChange, className, }: ProcessDesignerProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=ProcessDesigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessDesigner.d.ts","sourceRoot":"","sources":["../../src/ProcessDesigner.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAS3F,MAAM,WAAW,oBAAoB;IACnC,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB;IACjB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,iBAAiB;IACjB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,iBAAiB;IACjB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,mBAAmB;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC5C,iCAAiC;IACjC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC5C,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAA2B,EAC3B,KAAK,EAAE,YAAiB,EACxB,KAAK,EAAE,YAAiB,EACxB,KAAK,EAAE,MAAM,EACb,MAAqD,EACrD,WAAkB,EAClB,QAAgB,EAChB,aAAa,EACb,aAAa,EACb,SAAS,GACV,EAAE,oBAAoB,2CAiMtB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReportDesignerSection } from '../../types/src';
|
|
2
|
+
export interface ReportDesignerProps {
|
|
3
|
+
/** Report name */
|
|
4
|
+
reportName?: string;
|
|
5
|
+
/** Data source object */
|
|
6
|
+
objectName?: string;
|
|
7
|
+
/** Page size */
|
|
8
|
+
pageSize?: 'A4' | 'A3' | 'Letter' | 'Legal' | 'Tabloid';
|
|
9
|
+
/** Page orientation */
|
|
10
|
+
orientation?: 'portrait' | 'landscape';
|
|
11
|
+
/** Page margins */
|
|
12
|
+
margins?: {
|
|
13
|
+
top: number;
|
|
14
|
+
right: number;
|
|
15
|
+
bottom: number;
|
|
16
|
+
left: number;
|
|
17
|
+
};
|
|
18
|
+
/** Report sections */
|
|
19
|
+
sections?: ReportDesignerSection[];
|
|
20
|
+
/** Show toolbar */
|
|
21
|
+
showToolbar?: boolean;
|
|
22
|
+
/** Show property panel */
|
|
23
|
+
showPropertyPanel?: boolean;
|
|
24
|
+
/** Preview mode */
|
|
25
|
+
previewMode?: boolean;
|
|
26
|
+
/** Read-only mode */
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
/** Callback when sections change */
|
|
29
|
+
onSectionsChange?: (sections: ReportDesignerSection[]) => void;
|
|
30
|
+
/** Custom CSS class */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Report designer for creating printable report layouts.
|
|
35
|
+
* Supports sections (header, detail, footer) with drag-and-drop elements.
|
|
36
|
+
*/
|
|
37
|
+
export declare function ReportDesigner({ reportName, objectName, pageSize, orientation, margins, sections: initialSections, showToolbar, showPropertyPanel, readOnly, onSectionsChange, className, }: ReportDesignerProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=ReportDesigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportDesigner.d.ts","sourceRoot":"","sources":["../../src/ReportDesigner.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAyB,MAAM,kBAAkB,CAAC;AASrF,MAAM,WAAW,mBAAmB;IAClC,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACxD,uBAAuB;IACvB,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IACvC,mBAAmB;IACnB,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,sBAAsB;IACtB,QAAQ,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACnC,mBAAmB;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,IAAI,CAAC;IAC/D,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,UAA8B,EAC9B,UAAU,EACV,QAAe,EACf,WAAwB,EACxB,OAAsD,EACtD,QAAQ,EAAE,eAAoB,EAC9B,WAAkB,EAClB,iBAAwB,EACxB,QAAgB,EAChB,gBAAgB,EAChB,SAAS,GACV,EAAE,mBAAmB,2CAqNrB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PageDesigner } from './PageDesigner';
|
|
2
|
+
import { DataModelDesigner } from './DataModelDesigner';
|
|
3
|
+
import { ProcessDesigner } from './ProcessDesigner';
|
|
4
|
+
import { ReportDesigner } from './ReportDesigner';
|
|
5
|
+
import { CollaborationProvider } from './CollaborationProvider';
|
|
6
|
+
export { PageDesigner, DataModelDesigner, ProcessDesigner, ReportDesigner, CollaborationProvider, };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,qBAAqB,GACtB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@object-ui/plugin-designer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"description": "Visual designer plugin for Object UI with page, data model, process, and report designers plus collaborative editing.",
|
|
7
|
+
"main": "dist/index.umd.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.umd.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
22
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
23
|
+
"@object-ui/core": "0.5.0",
|
|
24
|
+
"@object-ui/types": "0.5.0",
|
|
25
|
+
"@object-ui/components": "0.5.0",
|
|
26
|
+
"@object-ui/react": "0.5.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"clsx": "^2.1.0",
|
|
30
|
+
"lucide-react": "^0.344.0",
|
|
31
|
+
"tailwind-merge": "^2.2.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^25.2.2",
|
|
35
|
+
"@types/react": "^19.2.13",
|
|
36
|
+
"@types/react-dom": "^19.2.3",
|
|
37
|
+
"@vitejs/plugin-react": "^5.1.3",
|
|
38
|
+
"vite": "^7.3.1",
|
|
39
|
+
"vite-plugin-dts": "^4.5.4",
|
|
40
|
+
"vitest": "^4.0.18"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "vite build",
|
|
44
|
+
"clean": "rm -rf dist",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"lint": "eslint ."
|
|
47
|
+
}
|
|
48
|
+
}
|