@object-ui/plugin-timeline 3.3.2 → 4.0.1

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 CHANGED
@@ -1,5 +1,53 @@
1
1
  # @object-ui/plugin-timeline
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @object-ui/types@4.0.1
8
+ - @object-ui/core@4.0.1
9
+ - @object-ui/react@4.0.1
10
+ - @object-ui/components@4.0.1
11
+ - @object-ui/mobile@4.0.1
12
+
13
+ ## 4.0.0
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+ - @object-ui/types@4.0.0
19
+ - @object-ui/components@4.0.0
20
+ - @object-ui/core@4.0.0
21
+ - @object-ui/mobile@4.0.0
22
+ - @object-ui/react@4.0.0
23
+
24
+ ## 3.4.0
25
+
26
+ ### Patch Changes
27
+
28
+ - b2be122: fix(mobile): round 2 — kanban readability, calendar default view, timeline dot clipping
29
+
30
+ **Kanban**
31
+ - Remove `font-mono` from card titles, descriptions, column headers, and empty-state labels — CRM cards no longer render in a monospace font.
32
+ - Constrain column body height (`max-h-full min-h-0` + `h-full` on the layout root) so `ScrollArea` activates and cards don't bleed past the viewport bottom.
33
+ - Opportunistically derive `description` (e.g. `$60K · Acme Corp · @owner`) and up to two `badges` (priority/severity/industry/rating) in `ObjectKanban` when the schema/source omits them, giving mobile cards more context at a glance.
34
+
35
+ **Calendar**
36
+ - `ObjectCalendar` previously hardcoded `view={schema.defaultView ?? 'month'}`, making the view-selector dropdown a no-op. Wire the `view` state through to the `<Calendar>` prop so user selection is respected.
37
+ - On mobile (viewport < 768 px) coerce `day` defaults to `month` via a synchronous lazy initialiser and a resize/orientation effect — avoids the useless 24-hour empty-hour grid for date-only events.
38
+
39
+ **Timeline**
40
+ - Add `ml-3` to the `<Timeline>` `<ol>` so the `absolute -left-3` marker dots are no longer clipped at the scroll-container edge.
41
+
42
+ - Updated dependencies [a2d7023]
43
+ - Updated dependencies [f1ca238]
44
+ - Updated dependencies [de881ef]
45
+ - @object-ui/components@3.4.0
46
+ - @object-ui/mobile@3.4.0
47
+ - @object-ui/types@3.4.0
48
+ - @object-ui/core@3.4.0
49
+ - @object-ui/react@3.4.0
50
+
3
51
  ## 3.3.2
4
52
 
5
53
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3362,7 +3362,7 @@ var Da = Zi({
3362
3362
  });
3363
3363
  }, ka = e.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ (0, _.jsx)("ol", {
3364
3364
  ref: n,
3365
- className: a("relative border-l border-gray-200", e),
3365
+ className: a("relative ml-3 border-l border-gray-200", e),
3366
3366
  ...t
3367
3367
  }));
3368
3368
  ka.displayName = "Timeline";
@@ -66,4 +66,4 @@ React keys must be passed directly to JSX without using spread:
66
66
 
67
67
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=se,s=!w.jitless,c=s&&ce.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?on([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function ln(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!L(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>R(e,r,T())))}),t)}var un=x(`$ZodUnion`,(e,t)=>{U.init(e,t),A(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),A(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),A(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),A(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>k(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ln(t,r,e,i)):ln(o,r,e,i)}}),dn=x(`$ZodIntersection`,(e,t)=>{U.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>pn(e,t,n)):pn(e,i,a)}});function fn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(N(e)&&N(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=fn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=fn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),L(e))return e;let o=fn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var mn=x(`$ZodEnum`,(e,t)=>{U.init(e,t);let n=ne(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ue.has(typeof e)).map(e=>typeof e==`string`?P(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),hn=x(`$ZodTransform`,(e,t)=>{U.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new C(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new S;return n.value=i,n.fallback=!0,n}});function gn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var _n=x(`$ZodOptional`,(e,t)=>{U.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,A(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),A(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${k(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>gn(e,r)):gn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),vn=x(`$ZodExactOptional`,(e,t)=>{_n.init(e,t),A(e._zod,`values`,()=>t.innerType._zod.values),A(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),yn=x(`$ZodNullable`,(e,t)=>{U.init(e,t),A(e._zod,`optin`,()=>t.innerType._zod.optin),A(e._zod,`optout`,()=>t.innerType._zod.optout),A(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${k(e.source)}|null)$`):void 0}),A(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),bn=x(`$ZodDefault`,(e,t)=>{U.init(e,t),e._zod.optin=`optional`,A(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>xn(e,t)):xn(r,t)}});function xn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Sn=x(`$ZodPrefault`,(e,t)=>{U.init(e,t),e._zod.optin=`optional`,A(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Cn=x(`$ZodNonOptional`,(e,t)=>{U.init(e,t),A(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>wn(t,e)):wn(i,e)}});function wn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Tn=x(`$ZodCatch`,(e,t)=>{U.init(e,t),e._zod.optin=`optional`,A(e._zod,`optout`,()=>t.innerType._zod.optout),A(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>R(e,n,T()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>R(e,n,T()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),En=x(`$ZodPipe`,(e,t)=>{U.init(e,t),A(e._zod,`values`,()=>t.in._zod.values),A(e._zod,`optin`,()=>t.in._zod.optin),A(e._zod,`optout`,()=>t.out._zod.optout),A(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Dn(e,t.in,n)):Dn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Dn(e,t.out,n)):Dn(r,t.out,n)}});function Dn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var On=x(`$ZodReadonly`,(e,t)=>{U.init(e,t),A(e._zod,`propValues`,()=>t.innerType._zod.propValues),A(e._zod,`values`,()=>t.innerType._zod.values),A(e._zod,`optin`,()=>t.innerType?._zod?.optin),A(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(kn):kn(r)}});function kn(e){return e.value=Object.freeze(e.value),e}var An=x(`$ZodCustom`,(e,t)=>{V.init(e,t),U.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>jn(t,n,r,e));jn(i,n,r,e)}});function jn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(z(e))}}var Mn,Nn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Pn(){return new Nn}(Mn=globalThis).__zod_globalRegistry??(Mn.__zod_globalRegistry=Pn());var K=globalThis.__zod_globalRegistry;function Fn(e,t){return new e({type:`string`,...I(t)})}function In(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}function Ln(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}function Rn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...I(t)})}function zn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...I(t)})}function Bn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...I(t)})}function Vn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...I(t)})}function Hn(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...I(t)})}function Un(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...I(t)})}function Wn(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...I(t)})}function Gn(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...I(t)})}function Kn(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...I(t)})}function qn(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...I(t)})}function Jn(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...I(t)})}function Yn(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...I(t)})}function Xn(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...I(t)})}function Zn(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...I(t)})}function Qn(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...I(t)})}function $n(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...I(t)})}function er(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...I(t)})}function tr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...I(t)})}function nr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...I(t)})}function rr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...I(t)})}function ir(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...I(t)})}function ar(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...I(t)})}function or(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...I(t)})}function sr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...I(t)})}function cr(e){return new e({type:`unknown`})}function lr(e,t){return new e({type:`never`,...I(t)})}function ur(e,t){return new ht({check:`max_length`,...I(t),maximum:e})}function dr(e,t){return new gt({check:`min_length`,...I(t),minimum:e})}function fr(e,t){return new _t({check:`length_equals`,...I(t),length:e})}function pr(e,t){return new vt({check:`string_format`,format:`regex`,...I(t),pattern:e})}function mr(e){return new yt({check:`string_format`,format:`lowercase`,...I(e)})}function hr(e){return new bt({check:`string_format`,format:`uppercase`,...I(e)})}function gr(e,t){return new xt({check:`string_format`,format:`includes`,...I(t),includes:e})}function _r(e,t){return new St({check:`string_format`,format:`starts_with`,...I(t),prefix:e})}function vr(e,t){return new Ct({check:`string_format`,format:`ends_with`,...I(t),suffix:e})}function q(e){return new wt({check:`overwrite`,tx:e})}function yr(e){return q(t=>t.normalize(e))}function br(){return q(e=>e.trim())}function xr(){return q(e=>e.toLowerCase())}function Sr(){return q(e=>e.toUpperCase())}function Cr(){return q(e=>ae(e))}function wr(e,t,n){return new e({type:`array`,element:t,...I(n)})}function Tr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}function Er(e,t){let n=Dr(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(z(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(z(r))}},e(t.value,t)),t);return n}function Dr(e,t){let n=new V({check:`custom`,...I(t)});return n._zod.check=e,n}function Or(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??K,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function J(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,J(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Y(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function kr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
68
68
 
69
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ar(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Mr(t,`input`,e.processors),output:Mr(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Y(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Y(r.element,n);if(r.type===`set`)return Y(r.valueType,n);if(r.type===`lazy`)return Y(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Y(r.innerType,n);if(r.type===`intersection`)return Y(r.left,n)||Y(r.right,n);if(r.type===`record`||r.type===`map`)return Y(r.keyType,n)||Y(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Y(r.in,n)||Y(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Y(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Y(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Y(e,n))return!0;return!!(r.rest&&Y(r.rest,n))}return!1}var jr=(e,t={})=>n=>{let r=Or({...n,processors:t});return J(e,r),kr(r,e),Ar(r,e)},Mr=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Or({...i??{},target:a,io:t,processors:n});return J(e,o),kr(o,e),Ar(o,e)},Nr={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Pr=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Nr[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Fr=(e,t,n,r)=>{n.not={}},Ir=(e,t,n,r)=>{let i=e._zod.def,a=ne(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Lr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Rr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},zr=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=J(a.element,t,{...r,path:[...r.path,`items`]})},Br=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=J(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=J(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Vr=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>J(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Hr=(e,t,n,r)=>{let i=e._zod.def,a=J(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=J(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ur=(e,t,n,r)=>{let i=e._zod.def,a=J(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Wr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Kr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},qr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Jr=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;J(o,t,r);let s=t.seen.get(e);s.ref=o},Yr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Xr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zr=x(`ZodISODateTime`,(e,t)=>{zt.init(e,t),$.init(e,t)});function Qr(e){return ir(Zr,e)}var $r=x(`ZodISODate`,(e,t)=>{Bt.init(e,t),$.init(e,t)});function ei(e){return ar($r,e)}var ti=x(`ZodISOTime`,(e,t)=>{Vt.init(e,t),$.init(e,t)});function ni(e){return or(ti,e)}var ri=x(`ZodISODuration`,(e,t)=>{Ht.init(e,t),$.init(e,t)});function ii(e){return sr(ri,e)}var X=x(`ZodError`,(e,t)=>{we.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>De(e,t)},flatten:{value:t=>Ee(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,E,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,E,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ai=Oe(X),oi=ke(X),si=Ae(X),ci=B(X),li=Ne(X),ui=Pe(X),di=Fe(X),fi=Ie(X),pi=Le(X),mi=Re(X),hi=ze(X),gi=Be(X),_i=new WeakMap;function vi(e,t,n){let r=Object.getPrototypeOf(e),i=_i.get(r);if(i||(i=new Set,_i.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Z=x(`ZodType`,(e,t)=>(U.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Mr(e,`input`),output:Mr(e,`output`)}}),e.toJSONSchema=jr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>ai(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>si(e,t,n),e.parseAsync=async(t,n)=>oi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ci(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>li(e,t,n),e.decode=(t,n)=>ui(e,t,n),e.encodeAsync=async(t,n)=>di(e,t,n),e.decodeAsync=async(t,n)=>fi(e,t,n),e.safeEncode=(t,n)=>pi(e,t,n),e.safeDecode=(t,n)=>mi(e,t,n),e.safeEncodeAsync=async(t,n)=>hi(e,t,n),e.safeDecodeAsync=async(t,n)=>gi(e,t,n),vi(e,`ZodType`,{check(...e){let t=this.def;return this.clone(M(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(xa(e,t))},superRefine(e,t){return this.check(Sa(e,t))},overwrite(e){return this.check(q(e))},optional(){return ra(this)},exactOptional(){return aa(this)},nullable(){return sa(this)},nullish(){return ra(sa(this))},nonoptional(e){return pa(this,e)},array(){return Gi(this)},or(e){return Yi([this,e])},and(e){return Zi(this,e)},transform(e){return _a(this,ta(e))},default(e){return la(this,e)},prefault(e){return da(this,e)},catch(e){return ha(this,e)},pipe(e){return _a(this,e)},readonly(){return ya(this)},describe(e){let t=this.clone();return K.add(t,{description:e}),t},meta(...e){if(e.length===0)return K.get(this);let t=this.clone();return K.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return K.get(e)?.description},configurable:!0}),e)),yi=x(`_ZodString`,(e,t)=>{Dt.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pr(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,vi(e,`_ZodString`,{regex(...e){return this.check(pr(...e))},includes(...e){return this.check(gr(...e))},startsWith(...e){return this.check(_r(...e))},endsWith(...e){return this.check(vr(...e))},min(...e){return this.check(dr(...e))},max(...e){return this.check(ur(...e))},length(...e){return this.check(fr(...e))},nonempty(...e){return this.check(dr(1,...e))},lowercase(e){return this.check(mr(e))},uppercase(e){return this.check(hr(e))},trim(){return this.check(br())},normalize(...e){return this.check(yr(...e))},toLowerCase(){return this.check(xr())},toUpperCase(){return this.check(Sr())},slugify(){return this.check(Cr())}})}),bi=x(`ZodString`,(e,t)=>{Dt.init(e,t),yi.init(e,t),e.email=t=>e.check(In(xi,t)),e.url=t=>e.check(Hn(wi,t)),e.jwt=t=>e.check(rr(zi,t)),e.emoji=t=>e.check(Un(Ti,t)),e.guid=t=>e.check(Ln(Si,t)),e.uuid=t=>e.check(Rn(Ci,t)),e.uuidv4=t=>e.check(zn(Ci,t)),e.uuidv6=t=>e.check(Bn(Ci,t)),e.uuidv7=t=>e.check(Vn(Ci,t)),e.nanoid=t=>e.check(Wn(Ei,t)),e.guid=t=>e.check(Ln(Si,t)),e.cuid=t=>e.check(Gn(Di,t)),e.cuid2=t=>e.check(Kn(Oi,t)),e.ulid=t=>e.check(qn(ki,t)),e.base64=t=>e.check(er(Ii,t)),e.base64url=t=>e.check(tr(Li,t)),e.xid=t=>e.check(Jn(Ai,t)),e.ksuid=t=>e.check(Yn(ji,t)),e.ipv4=t=>e.check(Xn(Mi,t)),e.ipv6=t=>e.check(Zn(Ni,t)),e.cidrv4=t=>e.check(Qn(Pi,t)),e.cidrv6=t=>e.check($n(Fi,t)),e.e164=t=>e.check(nr(Ri,t)),e.datetime=t=>e.check(Qr(t)),e.date=t=>e.check(ei(t)),e.time=t=>e.check(ni(t)),e.duration=t=>e.check(ii(t))});function Q(e){return Fn(bi,e)}var $=x(`ZodStringFormat`,(e,t)=>{W.init(e,t),yi.init(e,t)}),xi=x(`ZodEmail`,(e,t)=>{At.init(e,t),$.init(e,t)}),Si=x(`ZodGUID`,(e,t)=>{Ot.init(e,t),$.init(e,t)}),Ci=x(`ZodUUID`,(e,t)=>{kt.init(e,t),$.init(e,t)}),wi=x(`ZodURL`,(e,t)=>{jt.init(e,t),$.init(e,t)}),Ti=x(`ZodEmoji`,(e,t)=>{Mt.init(e,t),$.init(e,t)}),Ei=x(`ZodNanoID`,(e,t)=>{Nt.init(e,t),$.init(e,t)}),Di=x(`ZodCUID`,(e,t)=>{Pt.init(e,t),$.init(e,t)}),Oi=x(`ZodCUID2`,(e,t)=>{Ft.init(e,t),$.init(e,t)}),ki=x(`ZodULID`,(e,t)=>{It.init(e,t),$.init(e,t)}),Ai=x(`ZodXID`,(e,t)=>{Lt.init(e,t),$.init(e,t)}),ji=x(`ZodKSUID`,(e,t)=>{Rt.init(e,t),$.init(e,t)}),Mi=x(`ZodIPv4`,(e,t)=>{Ut.init(e,t),$.init(e,t)}),Ni=x(`ZodIPv6`,(e,t)=>{Wt.init(e,t),$.init(e,t)}),Pi=x(`ZodCIDRv4`,(e,t)=>{Gt.init(e,t),$.init(e,t)}),Fi=x(`ZodCIDRv6`,(e,t)=>{Kt.init(e,t),$.init(e,t)}),Ii=x(`ZodBase64`,(e,t)=>{Jt.init(e,t),$.init(e,t)}),Li=x(`ZodBase64URL`,(e,t)=>{Xt.init(e,t),$.init(e,t)}),Ri=x(`ZodE164`,(e,t)=>{Zt.init(e,t),$.init(e,t)}),zi=x(`ZodJWT`,(e,t)=>{$t.init(e,t),$.init(e,t)}),Bi=x(`ZodUnknown`,(e,t)=>{en.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Vi(){return cr(Bi)}var Hi=x(`ZodNever`,(e,t)=>{tn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fr(e,t,n,r)});function Ui(e){return lr(Hi,e)}var Wi=x(`ZodArray`,(e,t)=>{rn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zr(e,t,n,r),e.element=t.element,vi(e,`ZodArray`,{min(e,t){return this.check(dr(e,t))},nonempty(e){return this.check(dr(1,e))},max(e,t){return this.check(ur(e,t))},length(e,t){return this.check(fr(e,t))},unwrap(){return this.element}})});function Gi(e,t){return wr(Wi,e,t)}var Ki=x(`ZodObject`,(e,t)=>{cn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Br(e,t,n,r),A(e,`shape`,()=>t.shape),vi(e,`ZodObject`,{keyof(){return $i(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Vi()})},loose(){return this.clone({...this._zod.def,catchall:Vi()})},strict(){return this.clone({...this._zod.def,catchall:Ui()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return me(this,e)},safeExtend(e){return he(this,e)},merge(e){return ge(this,e)},pick(e){return fe(this,e)},omit(e){return pe(this,e)},partial(...e){return _e(na,this,e[0])},required(...e){return ve(fa,this,e[0])}})});function qi(e,t){return new Ki({type:`object`,shape:e??{},...I(t)})}var Ji=x(`ZodUnion`,(e,t)=>{un.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vr(e,t,n,r),e.options=t.options});function Yi(e,t){return new Ji({type:`union`,options:e,...I(t)})}var Xi=x(`ZodIntersection`,(e,t)=>{dn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hr(e,t,n,r)});function Zi(e,t){return new Xi({type:`intersection`,left:e,right:t})}var Qi=x(`ZodEnum`,(e,t)=>{mn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ir(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Qi({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Qi({...t,checks:[],...I(r),entries:i})}});function $i(e,t){return new Qi({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}var ea=x(`ZodTransform`,(e,t)=>{hn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rr(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new C(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(z(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(z(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function ta(e){return new ea({type:`transform`,transform:e})}var na=x(`ZodOptional`,(e,t)=>{_n.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ra(e){return new na({type:`optional`,innerType:e})}var ia=x(`ZodExactOptional`,(e,t)=>{vn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function aa(e){return new ia({type:`optional`,innerType:e})}var oa=x(`ZodNullable`,(e,t)=>{yn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ur(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sa(e){return new oa({type:`nullable`,innerType:e})}var ca=x(`ZodDefault`,(e,t)=>{bn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function la(e,t){return new ca({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var ua=x(`ZodPrefault`,(e,t)=>{Sn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function da(e,t){return new ua({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var fa=x(`ZodNonOptional`,(e,t)=>{Cn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pa(e,t){return new fa({type:`nonoptional`,innerType:e,...I(t)})}var ma=x(`ZodCatch`,(e,t)=>{Tn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ha(e,t){return new ma({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var ga=x(`ZodPipe`,(e,t)=>{En.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jr(e,t,n,r),e.in=t.in,e.out=t.out});function _a(e,t){return new ga({type:`pipe`,in:e,out:t})}var va=x(`ZodReadonly`,(e,t)=>{On.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ya(e){return new va({type:`readonly`,innerType:e})}var ba=x(`ZodCustom`,(e,t)=>{An.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lr(e,t,n,r)});function xa(e,t={}){return Tr(ba,e,t)}function Sa(e,t){return Er(e,t)}var Ca=qi({mapping:qi({title:Q().optional(),date:Q().optional(),description:Q().optional(),variant:Q().optional()}).optional(),objectName:Q().optional(),titleField:Q().optional(),dateField:Q().optional(),startDateField:Q().optional(),endDateField:Q().optional(),descriptionField:Q().optional(),groupByField:Q().optional(),colorField:Q().optional(),scale:$i([`hour`,`day`,`week`,`month`,`quarter`,`year`]).optional()}),wa=({schema:e,dataSource:o,className:s,onRowClick:c,onItemClick:l,...u})=>{let[d,f]=(0,t.useState)([]),[p,m]=(0,t.useState)(!1),[h,_]=(0,t.useState)(null),[ee,te]=(0,t.useState)(0),[v,b]=(0,t.useState)(null),x=e.timeline;(0,t.useEffect)(()=>{let t=Ca.safeParse(e);t.success||console.warn(`[ObjectTimeline] Invalid timeline configuration:`,t.error.format())},[e]);let S=(0,i.useDataScope)(e.bind);(0,t.useEffect)(()=>{let t=!0;return(async()=>{if(!(!o||typeof o.getObjectSchema!=`function`||!e.objectName))try{let n=await o.getObjectSchema(e.objectName);t&&b(n)}catch(e){console.warn(`Failed to fetch object def for ObjectTimeline`,e)}})(),()=>{t=!1}},[e.objectName,o]),(0,t.useEffect)(()=>{e.objectName&&!S&&!e.items&&!u.data&&(async()=>{if(!(!o||typeof o.find!=`function`||!e.objectName)){m(!0);try{let t=(0,r.buildExpandFields)(v?.fields);f((0,r.extractRecords)(await o.find(e.objectName,{options:{$top:100},...t.length>0?{$expand:t}:{}})))}catch(e){console.error(e),_(e)}finally{m(!1)}}})()},[e.objectName,o,S,e.items,u.data,ee,v]);let C=u.data||S||d,w=e.items;if(!w&&C&&Array.isArray(C)){let t=x?.titleField??e.mapping?.title??e.titleField??`name`,n=x?.startDateField??e.mapping?.date??e.startDateField??e.dateField??`date`,r=x?.endDateField??e.endDateField??n,i=e.mapping?.description??e.descriptionField??`description`,a=e.mapping?.variant??`variant`,o=x?.groupByField??e.groupByField,s=x?.colorField??e.colorField;w=C.map(e=>({title:e[t],time:e[n],startDate:e[n],endDate:e[r],description:e[i],variant:e[a]||`default`,...o?{group:e[o]}:{},...s?{color:e[s]}:{},_data:e}))}let{ref:T,isRefreshing:ne,pullDistance:E}=(0,a.usePullToRefresh)({onRefresh:(0,t.useCallback)(async()=>{te(e=>e+1)},[]),enabled:!!e.objectName&&!!o}),D=(0,i.useNavigationOverlay)({navigation:e.navigation,objectName:e.objectName,onRowClick:c??l}),O=x?.scale??e.scale,k={...e,items:w||[],className:s||e.className,...O?{timeScale:O}:{},onItemClick:e=>{let t=e._data||e;D.handleClick(t),l?.(t)}};return h?(0,g.jsxs)(`div`,{className:`p-4 text-red-500`,children:[`Error loading timeline: `,h.message]}):(0,g.jsxs)(`div`,{ref:T,className:`relative overflow-auto h-full min-w-0`,children:[E>0&&(0,g.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:E},children:ne?`Refreshing…`:`Pull to refresh`}),(0,g.jsx)(y,{schema:k}),D.isOverlay&&(0,g.jsx)(n.NavigationOverlay,{...D,title:`Timeline Item`,children:e=>(0,g.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,g.jsxs)(`div`,{className:`flex flex-col`,children:[(0,g.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,g.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})},Ta=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`ol`,{ref:r,className:(0,n.cn)(`relative border-l border-gray-200`,e),...t}));Ta.displayName=`Timeline`;var Ea=(0,n.cva)(`ml-6`,{variants:{density:{default:`mb-10`,compact:`mb-3`,comfortable:`mb-6`}},defaultVariants:{density:`default`}}),Da=t.forwardRef(({className:e,density:t,...r},i)=>(0,g.jsx)(`li`,{ref:i,className:(0,n.cn)(Ea({density:t}),e),...r}));Da.displayName=`TimelineItem`;var Oa=(0,n.cva)(`absolute -left-3 w-6 h-6 rounded-full border-2 flex items-center justify-center`,{variants:{variant:{default:`bg-blue-200 border-blue-400`,success:`bg-emerald-200 border-emerald-500`,warning:`bg-amber-200 border-amber-500`,danger:`bg-red-200 border-red-500`,info:`bg-purple-200 border-purple-500`,todo:`bg-slate-200 border-slate-400`,"in-progress":`bg-blue-200 border-blue-500`,done:`bg-emerald-200 border-emerald-500`}},defaultVariants:{variant:`default`}}),ka=t.forwardRef(({className:e,variant:t=`default`,...r},i)=>(0,g.jsx)(`div`,{ref:i,className:(0,n.cn)(Oa({variant:t}),e),...r}));ka.displayName=`TimelineMarker`;var Aa=t.forwardRef(({className:e,...t},n)=>(0,g.jsx)(`div`,{ref:n,className:e,...t}));Aa.displayName=`TimelineContent`;var ja=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`h3`,{ref:r,className:(0,n.cn)(`font-semibold text-lg mb-1`,e),...t}));ja.displayName=`TimelineTitle`;var Ma=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`time`,{ref:r,className:(0,n.cn)(`text-sm font-normal text-gray-500 mb-2 block`,e),...t}));Ma.displayName=`TimelineTime`;var Na=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`p`,{ref:r,className:(0,n.cn)(`text-base text-gray-700`,e),...t}));Na.displayName=`TimelineDescription`;var Pa=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`relative flex overflow-x-auto py-8`,e),...t}));Pa.displayName=`TimelineHorizontal`;var Fa=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`flex-shrink-0 w-64 relative`,e),...t}));Fa.displayName=`TimelineHorizontalItem`;var Ia=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`relative w-full border rounded-lg overflow-hidden`,e),...t}));Ia.displayName=`TimelineGantt`;var La=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`flex border-b bg-gray-50`,e),...t}));La.displayName=`TimelineGanttHeader`;var Ra=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`w-48 border-r bg-white`,e),...t}));Ra.displayName=`TimelineGanttRowLabels`;var za=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`flex-1 overflow-x-auto`,e),...t}));za.displayName=`TimelineGanttGrid`;var Ba=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`flex items-center border-b min-h-12`,e),...t}));Ba.displayName=`TimelineGanttRow`;var Va=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`px-4 py-2 font-medium text-sm truncate`,e),...t}));Va.displayName=`TimelineGanttLabel`;var Ha=t.forwardRef(({className:e,start:t=0,width:r=100,variant:i=`default`,...a},o)=>(0,g.jsx)(`div`,{ref:o,className:(0,n.cn)(`absolute h-8 rounded-md transition-colors cursor-pointer`,{default:`bg-blue-500 hover:bg-blue-600`,success:`bg-green-500 hover:bg-green-600`,warning:`bg-yellow-500 hover:bg-yellow-600`,danger:`bg-red-500 hover:bg-red-600`,info:`bg-purple-500 hover:bg-purple-600`}[i],e),style:{left:`${t}%`,width:`${r}%`},...a}));Ha.displayName=`TimelineGanttBar`;var Ua=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`px-2 py-1 text-white text-xs font-medium truncate`,e),...t}));Ua.displayName=`TimelineGanttBarContent`;var Wa=({schema:e,...t})=>{let{dataSource:n}=(0,i.useSchemaContext)()||{};return(0,g.jsx)(wa,{schema:e,dataSource:n,...t})};r.ComponentRegistry.register(`object-timeline`,Wa,{namespace:`plugin-timeline`,label:`Object Timeline`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],defaultValue:`vertical`}]}),r.ComponentRegistry.register(`timeline`,Wa,{namespace:`view`,label:`Timeline View`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],defaultValue:`vertical`}]}),e.ObjectTimeline=wa,e.ObjectTimelineRenderer=Wa,e.Timeline=Ta,e.TimelineContent=Aa,e.TimelineDescription=Na,e.TimelineGantt=Ia,e.TimelineGanttBar=Ha,e.TimelineGanttBarContent=Ua,e.TimelineGanttGrid=za,e.TimelineGanttHeader=La,e.TimelineGanttLabel=Va,e.TimelineGanttRow=Ba,e.TimelineGanttRowLabels=Ra,e.TimelineHorizontal=Pa,e.TimelineHorizontalItem=Fa,e.TimelineItem=Da,e.TimelineMarker=ka,e.TimelineRenderer=y,e.TimelineTime=Ma,e.TimelineTitle=ja,e.timelineItemVariants=Ea,e.timelineMarkerVariants=Oa});
69
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ar(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Mr(t,`input`,e.processors),output:Mr(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Y(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Y(r.element,n);if(r.type===`set`)return Y(r.valueType,n);if(r.type===`lazy`)return Y(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Y(r.innerType,n);if(r.type===`intersection`)return Y(r.left,n)||Y(r.right,n);if(r.type===`record`||r.type===`map`)return Y(r.keyType,n)||Y(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Y(r.in,n)||Y(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Y(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Y(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Y(e,n))return!0;return!!(r.rest&&Y(r.rest,n))}return!1}var jr=(e,t={})=>n=>{let r=Or({...n,processors:t});return J(e,r),kr(r,e),Ar(r,e)},Mr=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Or({...i??{},target:a,io:t,processors:n});return J(e,o),kr(o,e),Ar(o,e)},Nr={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Pr=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Nr[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Fr=(e,t,n,r)=>{n.not={}},Ir=(e,t,n,r)=>{let i=e._zod.def,a=ne(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Lr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Rr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},zr=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=J(a.element,t,{...r,path:[...r.path,`items`]})},Br=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=J(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=J(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Vr=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>J(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Hr=(e,t,n,r)=>{let i=e._zod.def,a=J(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=J(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ur=(e,t,n,r)=>{let i=e._zod.def,a=J(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Wr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Kr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},qr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Jr=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;J(o,t,r);let s=t.seen.get(e);s.ref=o},Yr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Xr=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zr=x(`ZodISODateTime`,(e,t)=>{zt.init(e,t),$.init(e,t)});function Qr(e){return ir(Zr,e)}var $r=x(`ZodISODate`,(e,t)=>{Bt.init(e,t),$.init(e,t)});function ei(e){return ar($r,e)}var ti=x(`ZodISOTime`,(e,t)=>{Vt.init(e,t),$.init(e,t)});function ni(e){return or(ti,e)}var ri=x(`ZodISODuration`,(e,t)=>{Ht.init(e,t),$.init(e,t)});function ii(e){return sr(ri,e)}var X=x(`ZodError`,(e,t)=>{we.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>De(e,t)},flatten:{value:t=>Ee(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,E,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,E,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ai=Oe(X),oi=ke(X),si=Ae(X),ci=B(X),li=Ne(X),ui=Pe(X),di=Fe(X),fi=Ie(X),pi=Le(X),mi=Re(X),hi=ze(X),gi=Be(X),_i=new WeakMap;function vi(e,t,n){let r=Object.getPrototypeOf(e),i=_i.get(r);if(i||(i=new Set,_i.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Z=x(`ZodType`,(e,t)=>(U.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Mr(e,`input`),output:Mr(e,`output`)}}),e.toJSONSchema=jr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>ai(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>si(e,t,n),e.parseAsync=async(t,n)=>oi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ci(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>li(e,t,n),e.decode=(t,n)=>ui(e,t,n),e.encodeAsync=async(t,n)=>di(e,t,n),e.decodeAsync=async(t,n)=>fi(e,t,n),e.safeEncode=(t,n)=>pi(e,t,n),e.safeDecode=(t,n)=>mi(e,t,n),e.safeEncodeAsync=async(t,n)=>hi(e,t,n),e.safeDecodeAsync=async(t,n)=>gi(e,t,n),vi(e,`ZodType`,{check(...e){let t=this.def;return this.clone(M(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(xa(e,t))},superRefine(e,t){return this.check(Sa(e,t))},overwrite(e){return this.check(q(e))},optional(){return ra(this)},exactOptional(){return aa(this)},nullable(){return sa(this)},nullish(){return ra(sa(this))},nonoptional(e){return pa(this,e)},array(){return Gi(this)},or(e){return Yi([this,e])},and(e){return Zi(this,e)},transform(e){return _a(this,ta(e))},default(e){return la(this,e)},prefault(e){return da(this,e)},catch(e){return ha(this,e)},pipe(e){return _a(this,e)},readonly(){return ya(this)},describe(e){let t=this.clone();return K.add(t,{description:e}),t},meta(...e){if(e.length===0)return K.get(this);let t=this.clone();return K.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return K.get(e)?.description},configurable:!0}),e)),yi=x(`_ZodString`,(e,t)=>{Dt.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pr(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,vi(e,`_ZodString`,{regex(...e){return this.check(pr(...e))},includes(...e){return this.check(gr(...e))},startsWith(...e){return this.check(_r(...e))},endsWith(...e){return this.check(vr(...e))},min(...e){return this.check(dr(...e))},max(...e){return this.check(ur(...e))},length(...e){return this.check(fr(...e))},nonempty(...e){return this.check(dr(1,...e))},lowercase(e){return this.check(mr(e))},uppercase(e){return this.check(hr(e))},trim(){return this.check(br())},normalize(...e){return this.check(yr(...e))},toLowerCase(){return this.check(xr())},toUpperCase(){return this.check(Sr())},slugify(){return this.check(Cr())}})}),bi=x(`ZodString`,(e,t)=>{Dt.init(e,t),yi.init(e,t),e.email=t=>e.check(In(xi,t)),e.url=t=>e.check(Hn(wi,t)),e.jwt=t=>e.check(rr(zi,t)),e.emoji=t=>e.check(Un(Ti,t)),e.guid=t=>e.check(Ln(Si,t)),e.uuid=t=>e.check(Rn(Ci,t)),e.uuidv4=t=>e.check(zn(Ci,t)),e.uuidv6=t=>e.check(Bn(Ci,t)),e.uuidv7=t=>e.check(Vn(Ci,t)),e.nanoid=t=>e.check(Wn(Ei,t)),e.guid=t=>e.check(Ln(Si,t)),e.cuid=t=>e.check(Gn(Di,t)),e.cuid2=t=>e.check(Kn(Oi,t)),e.ulid=t=>e.check(qn(ki,t)),e.base64=t=>e.check(er(Ii,t)),e.base64url=t=>e.check(tr(Li,t)),e.xid=t=>e.check(Jn(Ai,t)),e.ksuid=t=>e.check(Yn(ji,t)),e.ipv4=t=>e.check(Xn(Mi,t)),e.ipv6=t=>e.check(Zn(Ni,t)),e.cidrv4=t=>e.check(Qn(Pi,t)),e.cidrv6=t=>e.check($n(Fi,t)),e.e164=t=>e.check(nr(Ri,t)),e.datetime=t=>e.check(Qr(t)),e.date=t=>e.check(ei(t)),e.time=t=>e.check(ni(t)),e.duration=t=>e.check(ii(t))});function Q(e){return Fn(bi,e)}var $=x(`ZodStringFormat`,(e,t)=>{W.init(e,t),yi.init(e,t)}),xi=x(`ZodEmail`,(e,t)=>{At.init(e,t),$.init(e,t)}),Si=x(`ZodGUID`,(e,t)=>{Ot.init(e,t),$.init(e,t)}),Ci=x(`ZodUUID`,(e,t)=>{kt.init(e,t),$.init(e,t)}),wi=x(`ZodURL`,(e,t)=>{jt.init(e,t),$.init(e,t)}),Ti=x(`ZodEmoji`,(e,t)=>{Mt.init(e,t),$.init(e,t)}),Ei=x(`ZodNanoID`,(e,t)=>{Nt.init(e,t),$.init(e,t)}),Di=x(`ZodCUID`,(e,t)=>{Pt.init(e,t),$.init(e,t)}),Oi=x(`ZodCUID2`,(e,t)=>{Ft.init(e,t),$.init(e,t)}),ki=x(`ZodULID`,(e,t)=>{It.init(e,t),$.init(e,t)}),Ai=x(`ZodXID`,(e,t)=>{Lt.init(e,t),$.init(e,t)}),ji=x(`ZodKSUID`,(e,t)=>{Rt.init(e,t),$.init(e,t)}),Mi=x(`ZodIPv4`,(e,t)=>{Ut.init(e,t),$.init(e,t)}),Ni=x(`ZodIPv6`,(e,t)=>{Wt.init(e,t),$.init(e,t)}),Pi=x(`ZodCIDRv4`,(e,t)=>{Gt.init(e,t),$.init(e,t)}),Fi=x(`ZodCIDRv6`,(e,t)=>{Kt.init(e,t),$.init(e,t)}),Ii=x(`ZodBase64`,(e,t)=>{Jt.init(e,t),$.init(e,t)}),Li=x(`ZodBase64URL`,(e,t)=>{Xt.init(e,t),$.init(e,t)}),Ri=x(`ZodE164`,(e,t)=>{Zt.init(e,t),$.init(e,t)}),zi=x(`ZodJWT`,(e,t)=>{$t.init(e,t),$.init(e,t)}),Bi=x(`ZodUnknown`,(e,t)=>{en.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Vi(){return cr(Bi)}var Hi=x(`ZodNever`,(e,t)=>{tn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fr(e,t,n,r)});function Ui(e){return lr(Hi,e)}var Wi=x(`ZodArray`,(e,t)=>{rn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zr(e,t,n,r),e.element=t.element,vi(e,`ZodArray`,{min(e,t){return this.check(dr(e,t))},nonempty(e){return this.check(dr(1,e))},max(e,t){return this.check(ur(e,t))},length(e,t){return this.check(fr(e,t))},unwrap(){return this.element}})});function Gi(e,t){return wr(Wi,e,t)}var Ki=x(`ZodObject`,(e,t)=>{cn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Br(e,t,n,r),A(e,`shape`,()=>t.shape),vi(e,`ZodObject`,{keyof(){return $i(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Vi()})},loose(){return this.clone({...this._zod.def,catchall:Vi()})},strict(){return this.clone({...this._zod.def,catchall:Ui()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return me(this,e)},safeExtend(e){return he(this,e)},merge(e){return ge(this,e)},pick(e){return fe(this,e)},omit(e){return pe(this,e)},partial(...e){return _e(na,this,e[0])},required(...e){return ve(fa,this,e[0])}})});function qi(e,t){return new Ki({type:`object`,shape:e??{},...I(t)})}var Ji=x(`ZodUnion`,(e,t)=>{un.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vr(e,t,n,r),e.options=t.options});function Yi(e,t){return new Ji({type:`union`,options:e,...I(t)})}var Xi=x(`ZodIntersection`,(e,t)=>{dn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hr(e,t,n,r)});function Zi(e,t){return new Xi({type:`intersection`,left:e,right:t})}var Qi=x(`ZodEnum`,(e,t)=>{mn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ir(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Qi({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Qi({...t,checks:[],...I(r),entries:i})}});function $i(e,t){return new Qi({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}var ea=x(`ZodTransform`,(e,t)=>{hn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rr(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new C(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(z(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(z(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function ta(e){return new ea({type:`transform`,transform:e})}var na=x(`ZodOptional`,(e,t)=>{_n.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ra(e){return new na({type:`optional`,innerType:e})}var ia=x(`ZodExactOptional`,(e,t)=>{vn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function aa(e){return new ia({type:`optional`,innerType:e})}var oa=x(`ZodNullable`,(e,t)=>{yn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ur(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sa(e){return new oa({type:`nullable`,innerType:e})}var ca=x(`ZodDefault`,(e,t)=>{bn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function la(e,t){return new ca({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var ua=x(`ZodPrefault`,(e,t)=>{Sn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function da(e,t){return new ua({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var fa=x(`ZodNonOptional`,(e,t)=>{Cn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pa(e,t){return new fa({type:`nonoptional`,innerType:e,...I(t)})}var ma=x(`ZodCatch`,(e,t)=>{Tn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ha(e,t){return new ma({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var ga=x(`ZodPipe`,(e,t)=>{En.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jr(e,t,n,r),e.in=t.in,e.out=t.out});function _a(e,t){return new ga({type:`pipe`,in:e,out:t})}var va=x(`ZodReadonly`,(e,t)=>{On.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yr(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ya(e){return new va({type:`readonly`,innerType:e})}var ba=x(`ZodCustom`,(e,t)=>{An.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lr(e,t,n,r)});function xa(e,t={}){return Tr(ba,e,t)}function Sa(e,t){return Er(e,t)}var Ca=qi({mapping:qi({title:Q().optional(),date:Q().optional(),description:Q().optional(),variant:Q().optional()}).optional(),objectName:Q().optional(),titleField:Q().optional(),dateField:Q().optional(),startDateField:Q().optional(),endDateField:Q().optional(),descriptionField:Q().optional(),groupByField:Q().optional(),colorField:Q().optional(),scale:$i([`hour`,`day`,`week`,`month`,`quarter`,`year`]).optional()}),wa=({schema:e,dataSource:o,className:s,onRowClick:c,onItemClick:l,...u})=>{let[d,f]=(0,t.useState)([]),[p,m]=(0,t.useState)(!1),[h,_]=(0,t.useState)(null),[ee,te]=(0,t.useState)(0),[v,b]=(0,t.useState)(null),x=e.timeline;(0,t.useEffect)(()=>{let t=Ca.safeParse(e);t.success||console.warn(`[ObjectTimeline] Invalid timeline configuration:`,t.error.format())},[e]);let S=(0,i.useDataScope)(e.bind);(0,t.useEffect)(()=>{let t=!0;return(async()=>{if(!(!o||typeof o.getObjectSchema!=`function`||!e.objectName))try{let n=await o.getObjectSchema(e.objectName);t&&b(n)}catch(e){console.warn(`Failed to fetch object def for ObjectTimeline`,e)}})(),()=>{t=!1}},[e.objectName,o]),(0,t.useEffect)(()=>{e.objectName&&!S&&!e.items&&!u.data&&(async()=>{if(!(!o||typeof o.find!=`function`||!e.objectName)){m(!0);try{let t=(0,r.buildExpandFields)(v?.fields);f((0,r.extractRecords)(await o.find(e.objectName,{options:{$top:100},...t.length>0?{$expand:t}:{}})))}catch(e){console.error(e),_(e)}finally{m(!1)}}})()},[e.objectName,o,S,e.items,u.data,ee,v]);let C=u.data||S||d,w=e.items;if(!w&&C&&Array.isArray(C)){let t=x?.titleField??e.mapping?.title??e.titleField??`name`,n=x?.startDateField??e.mapping?.date??e.startDateField??e.dateField??`date`,r=x?.endDateField??e.endDateField??n,i=e.mapping?.description??e.descriptionField??`description`,a=e.mapping?.variant??`variant`,o=x?.groupByField??e.groupByField,s=x?.colorField??e.colorField;w=C.map(e=>({title:e[t],time:e[n],startDate:e[n],endDate:e[r],description:e[i],variant:e[a]||`default`,...o?{group:e[o]}:{},...s?{color:e[s]}:{},_data:e}))}let{ref:T,isRefreshing:ne,pullDistance:E}=(0,a.usePullToRefresh)({onRefresh:(0,t.useCallback)(async()=>{te(e=>e+1)},[]),enabled:!!e.objectName&&!!o}),D=(0,i.useNavigationOverlay)({navigation:e.navigation,objectName:e.objectName,onRowClick:c??l}),O=x?.scale??e.scale,k={...e,items:w||[],className:s||e.className,...O?{timeScale:O}:{},onItemClick:e=>{let t=e._data||e;D.handleClick(t),l?.(t)}};return h?(0,g.jsxs)(`div`,{className:`p-4 text-red-500`,children:[`Error loading timeline: `,h.message]}):(0,g.jsxs)(`div`,{ref:T,className:`relative overflow-auto h-full min-w-0`,children:[E>0&&(0,g.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:E},children:ne?`Refreshing…`:`Pull to refresh`}),(0,g.jsx)(y,{schema:k}),D.isOverlay&&(0,g.jsx)(n.NavigationOverlay,{...D,title:`Timeline Item`,children:e=>(0,g.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,g.jsxs)(`div`,{className:`flex flex-col`,children:[(0,g.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,g.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})},Ta=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`ol`,{ref:r,className:(0,n.cn)(`relative ml-3 border-l border-gray-200`,e),...t}));Ta.displayName=`Timeline`;var Ea=(0,n.cva)(`ml-6`,{variants:{density:{default:`mb-10`,compact:`mb-3`,comfortable:`mb-6`}},defaultVariants:{density:`default`}}),Da=t.forwardRef(({className:e,density:t,...r},i)=>(0,g.jsx)(`li`,{ref:i,className:(0,n.cn)(Ea({density:t}),e),...r}));Da.displayName=`TimelineItem`;var Oa=(0,n.cva)(`absolute -left-3 w-6 h-6 rounded-full border-2 flex items-center justify-center`,{variants:{variant:{default:`bg-blue-200 border-blue-400`,success:`bg-emerald-200 border-emerald-500`,warning:`bg-amber-200 border-amber-500`,danger:`bg-red-200 border-red-500`,info:`bg-purple-200 border-purple-500`,todo:`bg-slate-200 border-slate-400`,"in-progress":`bg-blue-200 border-blue-500`,done:`bg-emerald-200 border-emerald-500`}},defaultVariants:{variant:`default`}}),ka=t.forwardRef(({className:e,variant:t=`default`,...r},i)=>(0,g.jsx)(`div`,{ref:i,className:(0,n.cn)(Oa({variant:t}),e),...r}));ka.displayName=`TimelineMarker`;var Aa=t.forwardRef(({className:e,...t},n)=>(0,g.jsx)(`div`,{ref:n,className:e,...t}));Aa.displayName=`TimelineContent`;var ja=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`h3`,{ref:r,className:(0,n.cn)(`font-semibold text-lg mb-1`,e),...t}));ja.displayName=`TimelineTitle`;var Ma=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`time`,{ref:r,className:(0,n.cn)(`text-sm font-normal text-gray-500 mb-2 block`,e),...t}));Ma.displayName=`TimelineTime`;var Na=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`p`,{ref:r,className:(0,n.cn)(`text-base text-gray-700`,e),...t}));Na.displayName=`TimelineDescription`;var Pa=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`relative flex overflow-x-auto py-8`,e),...t}));Pa.displayName=`TimelineHorizontal`;var Fa=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`flex-shrink-0 w-64 relative`,e),...t}));Fa.displayName=`TimelineHorizontalItem`;var Ia=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`relative w-full border rounded-lg overflow-hidden`,e),...t}));Ia.displayName=`TimelineGantt`;var La=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`flex border-b bg-gray-50`,e),...t}));La.displayName=`TimelineGanttHeader`;var Ra=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`w-48 border-r bg-white`,e),...t}));Ra.displayName=`TimelineGanttRowLabels`;var za=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`flex-1 overflow-x-auto`,e),...t}));za.displayName=`TimelineGanttGrid`;var Ba=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`flex items-center border-b min-h-12`,e),...t}));Ba.displayName=`TimelineGanttRow`;var Va=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`px-4 py-2 font-medium text-sm truncate`,e),...t}));Va.displayName=`TimelineGanttLabel`;var Ha=t.forwardRef(({className:e,start:t=0,width:r=100,variant:i=`default`,...a},o)=>(0,g.jsx)(`div`,{ref:o,className:(0,n.cn)(`absolute h-8 rounded-md transition-colors cursor-pointer`,{default:`bg-blue-500 hover:bg-blue-600`,success:`bg-green-500 hover:bg-green-600`,warning:`bg-yellow-500 hover:bg-yellow-600`,danger:`bg-red-500 hover:bg-red-600`,info:`bg-purple-500 hover:bg-purple-600`}[i],e),style:{left:`${t}%`,width:`${r}%`},...a}));Ha.displayName=`TimelineGanttBar`;var Ua=t.forwardRef(({className:e,...t},r)=>(0,g.jsx)(`div`,{ref:r,className:(0,n.cn)(`px-2 py-1 text-white text-xs font-medium truncate`,e),...t}));Ua.displayName=`TimelineGanttBarContent`;var Wa=({schema:e,...t})=>{let{dataSource:n}=(0,i.useSchemaContext)()||{};return(0,g.jsx)(wa,{schema:e,dataSource:n,...t})};r.ComponentRegistry.register(`object-timeline`,Wa,{namespace:`plugin-timeline`,label:`Object Timeline`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],defaultValue:`vertical`}]}),r.ComponentRegistry.register(`timeline`,Wa,{namespace:`view`,label:`Timeline View`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],defaultValue:`vertical`}]}),e.ObjectTimeline=wa,e.ObjectTimelineRenderer=Wa,e.Timeline=Ta,e.TimelineContent=Aa,e.TimelineDescription=Na,e.TimelineGantt=Ia,e.TimelineGanttBar=Ha,e.TimelineGanttBarContent=Ua,e.TimelineGanttGrid=za,e.TimelineGanttHeader=La,e.TimelineGanttLabel=Va,e.TimelineGanttRow=Ba,e.TimelineGanttRowLabels=Ra,e.TimelineHorizontal=Pa,e.TimelineHorizontalItem=Fa,e.TimelineItem=Da,e.TimelineMarker=ka,e.TimelineRenderer=y,e.TimelineTime=Ma,e.TimelineTitle=ja,e.timelineItemVariants=Ea,e.timelineMarkerVariants=Oa});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-timeline",
3
- "version": "3.3.2",
3
+ "version": "4.0.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Timeline component plugin for Object UI",
@@ -27,11 +27,11 @@
27
27
  "@objectstack/spec": "^4.0.4",
28
28
  "class-variance-authority": "^0.7.1",
29
29
  "zod": "^4.4.3",
30
- "@object-ui/components": "3.3.2",
31
- "@object-ui/core": "3.3.2",
32
- "@object-ui/mobile": "3.3.2",
33
- "@object-ui/react": "3.3.2",
34
- "@object-ui/types": "3.3.2"
30
+ "@object-ui/components": "4.0.1",
31
+ "@object-ui/core": "4.0.1",
32
+ "@object-ui/mobile": "4.0.1",
33
+ "@object-ui/react": "4.0.1",
34
+ "@object-ui/types": "4.0.1"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^18.0.0 || ^19.0.0",
@@ -43,8 +43,8 @@
43
43
  "@vitejs/plugin-react": "^6.0.1",
44
44
  "typescript": "^6.0.3",
45
45
  "vite": "^8.0.10",
46
- "vite-plugin-dts": "^4.5.4",
47
- "@object-ui/data-objectstack": "3.3.2"
46
+ "vite-plugin-dts": "^5.0.0",
47
+ "@object-ui/data-objectstack": "4.0.1"
48
48
  },
49
49
  "keywords": [
50
50
  "objectui",