@object-ui/plugin-timeline 16.1.0 → 17.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/CHANGELOG.md CHANGED
@@ -1,5 +1,176 @@
1
1
  # @object-ui/plugin-timeline
2
2
 
3
+ ## 17.1.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [62311b6]
8
+ - Updated dependencies [fc0272a]
9
+ - Updated dependencies [9e7349e]
10
+ - Updated dependencies [8864971]
11
+ - Updated dependencies [1cf0de7]
12
+ - Updated dependencies [752e18f]
13
+ - Updated dependencies [c785740]
14
+ - Updated dependencies [b41f401]
15
+ - Updated dependencies [19e9fa0]
16
+ - Updated dependencies [d61efd1]
17
+ - Updated dependencies [95b7214]
18
+ - Updated dependencies [7d9734d]
19
+ - Updated dependencies [6ae818e]
20
+ - Updated dependencies [9eb932b]
21
+ - Updated dependencies [746dd00]
22
+ - Updated dependencies [aebfa4f]
23
+ - Updated dependencies [38ca8be]
24
+ - Updated dependencies [3cb9646]
25
+ - Updated dependencies [68ef584]
26
+ - Updated dependencies [4952edf]
27
+ - Updated dependencies [7f0252e]
28
+ - Updated dependencies [c4d7b20]
29
+ - Updated dependencies [c769d3d]
30
+ - Updated dependencies [7639a61]
31
+ - Updated dependencies [94e63ef]
32
+ - Updated dependencies [c735bf7]
33
+ - Updated dependencies [02aef0c]
34
+ - Updated dependencies [6f29aa5]
35
+ - Updated dependencies [d21794c]
36
+ - Updated dependencies [c4db402]
37
+ - Updated dependencies [5319bf1]
38
+ - Updated dependencies [49e5671]
39
+ - Updated dependencies [9a04d25]
40
+ - Updated dependencies [b5b97e2]
41
+ - Updated dependencies [f59f2c1]
42
+ - Updated dependencies [07de839]
43
+ - Updated dependencies [2a40b5e]
44
+ - Updated dependencies [df613fa]
45
+ - Updated dependencies [4874117]
46
+ - Updated dependencies [ad0183a]
47
+ - Updated dependencies [ce08d55]
48
+ - Updated dependencies [eb4b740]
49
+ - Updated dependencies [5b084eb]
50
+ - Updated dependencies [aa1240a]
51
+ - Updated dependencies [2374a49]
52
+ - Updated dependencies [390c071]
53
+ - Updated dependencies [d10f526]
54
+ - Updated dependencies [2d5d594]
55
+ - Updated dependencies [ea7f477]
56
+ - Updated dependencies [379728f]
57
+ - Updated dependencies [7f23cd0]
58
+ - Updated dependencies [0ded602]
59
+ - Updated dependencies [24e0e0a]
60
+ - Updated dependencies [f8a95e5]
61
+ - Updated dependencies [3a6cf24]
62
+ - Updated dependencies [aa35561]
63
+ - Updated dependencies [03bd53b]
64
+ - Updated dependencies [3c1f321]
65
+ - Updated dependencies [a045a32]
66
+ - Updated dependencies [912496d]
67
+ - Updated dependencies [80edbd4]
68
+ - Updated dependencies [9867281]
69
+ - @object-ui/core@17.1.0
70
+ - @object-ui/components@17.1.0
71
+ - @object-ui/react@17.1.0
72
+ - @object-ui/types@17.1.0
73
+ - @object-ui/i18n@17.1.0
74
+ - @object-ui/mobile@17.1.0
75
+
76
+ ## 17.0.0
77
+
78
+ ### Patch Changes
79
+
80
+ - 7d46648: fix(hooks): stop calling translation hooks inside try/catch (objectui#2879)
81
+
82
+ Eleven call sites wrapped a React hook in `try`/`catch` to make it
83
+ "provider-safe". `useObjectTranslation` and `useObjectLabel` already are — they
84
+ read context optionally and fall back to react-i18next's global instance, and
85
+ never throw. The `catch` bought nothing and cost correctness: a throw _after_
86
+ the hook ran desyncs hook order on the next render, because React matches hooks
87
+ positionally. objectui#2595/#2596 fixed exactly this in `@object-ui/i18n`'s
88
+ `createSafeTranslation`; nine plugin-local re-implementations kept their own
89
+ copy of the bug, and two more (`ObjectTimeline`, `ObjectView`) were found by the
90
+ new lint rule below — `ObjectView` had even suppressed
91
+ `react-hooks/rules-of-hooks` inline to keep it.
92
+
93
+ - Six exact re-implementations now delegate to `createSafeTranslation`:
94
+ `plugin-detail`, `plugin-timeline`, `plugin-list`, `plugin-calendar`,
95
+ `plugin-grid`'s `ObjectGrid`, `plugin-designer`.
96
+ - `components`' `data-table` also delegates; `createSafeTranslation` now
97
+ returns `language` alongside `t` so consumers that localize dates don't need
98
+ a second hook call. Purely additive.
99
+ - `plugin-gantt` and `plugin-grid`'s `ImportWizard` keep their local hooks —
100
+ they fall back _per key_, which a single-probe factory cannot express and
101
+ which their comments justify (a host dictionary that covers common keys but
102
+ lags on newer ones). Only the `try`/`catch` is removed.
103
+ - `ObjectTimeline` and `ObjectView` call the hook directly and probe the
104
+ returned value, mirroring `useSafeFieldLabel`.
105
+
106
+ Adds `object-ui/no-try-catch-around-hook` (error) so a twelfth copy fails CI.
107
+ It only matches `use*` names, accepts member calls solely on `React` (so
108
+ `vi.useRealTimers()` is not a hook), and resets its try-depth inside nested
109
+ functions (so `renderHook(() => useThing())` inside a `try` is fine) — both
110
+ false positives were real code in this repo and are pinned in the rule's tests.
111
+
112
+ `eslint-rules/**/*.test.js` matched no vitest project glob, so the local
113
+ plugin's specs had never run in CI. They are now included; all three pass.
114
+
115
+ `ObjectTimeline`'s test mock of `@object-ui/react` omitted `useObjectLabel` —
116
+ the removed `try`/`catch` had been silently absorbing that gap. The mock is now
117
+ complete.
118
+
119
+ - Updated dependencies [7b21891]
120
+ - Updated dependencies [0b3be01]
121
+ - Updated dependencies [3c4d935]
122
+ - Updated dependencies [4b60d2d]
123
+ - Updated dependencies [952b978]
124
+ - Updated dependencies [de5e40c]
125
+ - Updated dependencies [1a03af6]
126
+ - Updated dependencies [3e886eb]
127
+ - Updated dependencies [cfc675e]
128
+ - Updated dependencies [20df08c]
129
+ - Updated dependencies [1767124]
130
+ - Updated dependencies [8ecf5a6]
131
+ - Updated dependencies [af705b9]
132
+ - Updated dependencies [0502a7c]
133
+ - Updated dependencies [7b35e4b]
134
+ - Updated dependencies [8fb1295]
135
+ - Updated dependencies [e16ed2d]
136
+ - Updated dependencies [c6fd752]
137
+ - Updated dependencies [f9bbddb]
138
+ - Updated dependencies [dfd3705]
139
+ - Updated dependencies [c77108c]
140
+ - Updated dependencies [2735de6]
141
+ - Updated dependencies [c19ac11]
142
+ - Updated dependencies [6dee2cb]
143
+ - Updated dependencies [e05f052]
144
+ - Updated dependencies [0502a7c]
145
+ - Updated dependencies [faad45e]
146
+ - Updated dependencies [09c6a17]
147
+ - Updated dependencies [c7cff19]
148
+ - Updated dependencies [ba73a02]
149
+ - Updated dependencies [cd09a7b]
150
+ - Updated dependencies [f1abf0e]
151
+ - Updated dependencies [f05b84e]
152
+ - Updated dependencies [9b4b952]
153
+ - Updated dependencies [2f947e4]
154
+ - Updated dependencies [7d46648]
155
+ - Updated dependencies [9b53d72]
156
+ - Updated dependencies [bb4aa25]
157
+ - Updated dependencies [75f1cdf]
158
+ - Updated dependencies [662bdf9]
159
+ - Updated dependencies [059a052]
160
+ - Updated dependencies [53642d4]
161
+ - Updated dependencies [8aae006]
162
+ - Updated dependencies [c6cfdf1]
163
+ - Updated dependencies [d147a13]
164
+ - Updated dependencies [c6aaed8]
165
+ - Updated dependencies [263f885]
166
+ - Updated dependencies [dc334da]
167
+ - @object-ui/components@17.0.0
168
+ - @object-ui/i18n@17.0.0
169
+ - @object-ui/react@17.0.0
170
+ - @object-ui/types@17.0.0
171
+ - @object-ui/core@17.0.0
172
+ - @object-ui/mobile@17.0.0
173
+
3
174
  ## 16.1.0
4
175
 
5
176
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectTimeline.d.ts","sourceRoot":"","sources":["../src/ObjectTimeline.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA8CnF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,cAAc,GAAG;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,4CAA4C;QAC5C,QAAQ,CAAC,EAAE,cAAc,CAAC;QAC1B,kDAAkD;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,sDAAsD;QACtD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,sDAAsD;QACtD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,oDAAoD;QACpD,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,oDAAoD;QACpD,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,kDAAkD;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,6CAA6C;QAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;QAE/D,OAAO,CAAC,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAA;KACF,CAAC;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgVxD,CAAA"}
1
+ {"version":3,"file":"ObjectTimeline.d.ts","sourceRoot":"","sources":["../src/ObjectTimeline.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAmDnF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,cAAc,GAAG;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,4CAA4C;QAC5C,QAAQ,CAAC,EAAE,cAAc,CAAC;QAC1B,kDAAkD;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,sDAAsD;QACtD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,sDAAsD;QACtD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,oDAAoD;QACpD,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,oDAAoD;QACpD,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,kDAAkD;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,6CAA6C;QAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;QAE/D,OAAO,CAAC,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAA;KACF,CAAC;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgVxD,CAAA"}
package/dist/index.js CHANGED
@@ -3,26 +3,76 @@ import { useCallback as t, useEffect as n, useMemo as r, useState as i } from "r
3
3
  import { NavigationOverlay as a, cn as o, cva as s, renderChildren as c } from "@object-ui/components";
4
4
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
5
  import { ComponentRegistry as d, buildExpandFields as f, extractRecords as p } from "@object-ui/core";
6
- import { useDataScope as m, useNavigationOverlay as h, useObjectLabel as g, useObjectTranslation as _, useSchemaContext as v } from "@object-ui/react";
7
- import { usePullToRefresh as ee } from "@object-ui/mobile";
6
+ import { useDataScope as m, useNavigationOverlay as h, useObjectLabel as g, useSchemaContext as _ } from "@object-ui/react";
7
+ import { usePullToRefresh as v } from "@object-ui/mobile";
8
8
  import { z as y } from "zod";
9
+ import { createSafeTranslation as b } from "@object-ui/i18n";
9
10
  //#region src/renderer.tsx
10
- var b = 10080 * 60 * 1e3;
11
- function x(e) {
11
+ var x = /* @__PURE__ */ new Set([
12
+ "hour",
13
+ "day",
14
+ "week",
15
+ "month",
16
+ "quarter",
17
+ "year"
18
+ ]);
19
+ function S(e) {
20
+ let t = e.scale ?? e.timeScale;
21
+ return typeof t == "string" && x.has(t) ? t : "month";
22
+ }
23
+ function C(e, t, n) {
24
+ let r = [], i = new Date(t), a = new Date(n);
25
+ if (Number.isNaN(i.getTime()) || Number.isNaN(a.getTime()) || i > a) return r;
26
+ let o = new Date(i);
27
+ switch (e) {
28
+ case "hour":
29
+ for (; o <= a;) r.push(o.toLocaleString("en-US", {
30
+ month: "short",
31
+ day: "numeric",
32
+ hour: "numeric"
33
+ })), o.setHours(o.getHours() + 1);
34
+ break;
35
+ case "day":
36
+ for (; o <= a;) r.push(o.toLocaleDateString("en-US", {
37
+ month: "short",
38
+ day: "numeric"
39
+ })), o.setDate(o.getDate() + 1);
40
+ break;
41
+ case "week": {
42
+ let e = 1;
43
+ for (; o <= a;) r.push(`Week ${e++}`), o.setDate(o.getDate() + 7);
44
+ break;
45
+ }
46
+ case "quarter":
47
+ for (o.setMonth(Math.floor(o.getMonth() / 3) * 3, 1); o <= a;) r.push(`Q${Math.floor(o.getMonth() / 3) + 1} ${o.getFullYear()}`), o.setMonth(o.getMonth() + 3);
48
+ break;
49
+ case "year":
50
+ for (o.setMonth(0, 1); o <= a;) r.push(String(o.getFullYear())), o.setFullYear(o.getFullYear() + 1);
51
+ break;
52
+ default:
53
+ for (; o <= a;) r.push(o.toLocaleDateString("en-US", {
54
+ month: "short",
55
+ year: "numeric"
56
+ })), o.setMonth(o.getMonth() + 1);
57
+ break;
58
+ }
59
+ return r;
60
+ }
61
+ function w(e) {
12
62
  let t = e.flatMap((e) => (e.items || []).flatMap((e) => [e.startDate, e.endDate])), n = Math.min(...t.map((e) => new Date(e).getTime())), r = Math.max(...t.map((e) => new Date(e).getTime()));
13
63
  return {
14
64
  minDate: new Date(n).toISOString().split("T")[0],
15
65
  maxDate: new Date(r).toISOString().split("T")[0]
16
66
  };
17
67
  }
18
- function S(e, t, n, r) {
68
+ function T(e, t, n, r) {
19
69
  let i = new Date(e).getTime(), a = new Date(t).getTime(), o = new Date(n).getTime(), s = new Date(r).getTime() - o, c = i - o, l = a - i;
20
70
  return {
21
71
  start: c / s * 100,
22
72
  width: l / s * 100
23
73
  };
24
74
  }
25
- function C(e, t) {
75
+ function E(e, t) {
26
76
  let n = new Date(e);
27
77
  return t === "short" ? n.toLocaleDateString() : t === "long" ? n.toLocaleDateString("en-US", {
28
78
  year: "numeric",
@@ -30,7 +80,7 @@ function C(e, t) {
30
80
  day: "numeric"
31
81
  }) : n.toISOString().split("T")[0];
32
82
  }
33
- function w({ label: e, color: t }) {
83
+ function D({ label: e, color: t }) {
34
84
  let n = t ? {
35
85
  backgroundColor: `${t}22`,
36
86
  color: t,
@@ -42,7 +92,7 @@ function w({ label: e, color: t }) {
42
92
  children: e
43
93
  });
44
94
  }
45
- function T(e) {
95
+ function O(e) {
46
96
  let t = [];
47
97
  for (let n of e) {
48
98
  let e = n.group == null ? "" : String(n.group), r = t[t.length - 1];
@@ -53,14 +103,14 @@ function T(e) {
53
103
  }
54
104
  return t;
55
105
  }
56
- var E = ({ schema: e, className: t, ...n }) => {
106
+ var k = ({ schema: e, className: t, ...n }) => {
57
107
  let { variant: r = "vertical", items: i = [], dateFormat: a = "short", onItemClick: s } = e;
58
108
  if (r === "vertical") {
59
- let e = T(i), r = e.some((e) => e.key !== ""), d = (e, t) => {
109
+ let e = O(i), r = e.some((e) => e.key !== ""), d = (e, t) => {
60
110
  let n = e.color ? {
61
111
  backgroundColor: `${e.color}33`,
62
112
  borderColor: e.color
63
- } : void 0, r = e.time ? C(e.time, a) : e.startDate ? C(e.startDate, a) : "", i = e.endDate && e.endDate !== e.startDate ? C(e.endDate, a) : "", d = Array.isArray(e.meta) ? e.meta : [];
113
+ } : void 0, r = e.time ? E(e.time, a) : e.startDate ? E(e.startDate, a) : "", i = e.endDate && e.endDate !== e.startDate ? E(e.endDate, a) : "", d = Array.isArray(e.meta) ? e.meta : [];
64
114
  return /* @__PURE__ */ u(I, {
65
115
  density: "compact",
66
116
  className: o(e.className, s && "cursor-pointer"),
@@ -87,7 +137,7 @@ var E = ({ schema: e, className: t, ...n }) => {
87
137
  }),
88
138
  d.length > 0 && /* @__PURE__ */ l("div", {
89
139
  className: "flex flex-wrap gap-1.5 mt-1 mb-1",
90
- children: d.map((e) => /* @__PURE__ */ l(w, {
140
+ children: d.map((e) => /* @__PURE__ */ l(D, {
91
141
  label: e.label,
92
142
  color: e.color
93
143
  }, e.key))
@@ -141,7 +191,7 @@ var E = ({ schema: e, className: t, ...n }) => {
141
191
  children: [
142
192
  e.time && /* @__PURE__ */ l(V, {
143
193
  dateTime: e.time,
144
- children: C(e.time, a)
194
+ children: E(e.time, a)
145
195
  }),
146
196
  e.title && /* @__PURE__ */ l(B, { children: e.title }),
147
197
  e.description && /* @__PURE__ */ l(H, {
@@ -155,26 +205,7 @@ var E = ({ schema: e, className: t, ...n }) => {
155
205
  }, t))
156
206
  });
157
207
  if (r === "gantt") {
158
- let r = x(i), c = e.minDate || r.minDate, d = e.maxDate || r.maxDate, f = e.timeScale || "month", p = (() => {
159
- let e = [], t = new Date(c), n = new Date(d);
160
- if (f === "month") {
161
- let r = new Date(t);
162
- for (; r <= n;) e.push(r.toLocaleDateString("en-US", {
163
- month: "short",
164
- year: "numeric"
165
- })), r.setMonth(r.getMonth() + 1);
166
- } else if (f === "week") {
167
- let r = new Date(t);
168
- for (; r <= n;) e.push(`Week ${Math.ceil((r.getTime() - t.getTime()) / b) + 1}`), r.setDate(r.getDate() + 7);
169
- } else if (f === "day") {
170
- let r = new Date(t);
171
- for (; r <= n;) e.push(r.toLocaleDateString("en-US", {
172
- month: "short",
173
- day: "numeric"
174
- })), r.setDate(r.getDate() + 1);
175
- }
176
- return e;
177
- })();
208
+ let r = w(i), c = e.minDate || r.minDate, d = e.maxDate || r.maxDate, f = C(S(e), c, d);
178
209
  return /* @__PURE__ */ u(G, {
179
210
  className: o("overflow-x-auto [-webkit-overflow-scrolling:touch]", t),
180
211
  ...n,
@@ -186,7 +217,7 @@ var E = ({ schema: e, className: t, ...n }) => {
186
217
  })
187
218
  }), /* @__PURE__ */ l(J, { children: /* @__PURE__ */ l("div", {
188
219
  className: "flex h-full",
189
- children: p.map((e, t) => /* @__PURE__ */ l("div", {
220
+ children: f.map((e, t) => /* @__PURE__ */ l("div", {
190
221
  className: "flex-1 px-1 sm:px-2 py-2 sm:py-3 border-r text-xs font-medium text-center",
191
222
  children: e
192
223
  }, t))
@@ -201,13 +232,13 @@ var E = ({ schema: e, className: t, ...n }) => {
201
232
  children: i.map((e, t) => /* @__PURE__ */ l(Y, {
202
233
  className: "relative",
203
234
  children: (e.items || []).map((n, r) => {
204
- let i = S(n.startDate, n.endDate, c, d);
235
+ let i = T(n.startDate, n.endDate, c, d);
205
236
  return /* @__PURE__ */ l(Z, {
206
237
  start: i.start,
207
238
  width: i.width,
208
239
  variant: n.variant || "default",
209
240
  onClick: () => s?.(n, e, t, r),
210
- title: `${n.title || ""}\n${C(n.startDate, a)} - ${C(n.endDate, a)}`,
241
+ title: `${n.title || ""}\n${E(n.startDate, a)} - ${E(n.endDate, a)}`,
211
242
  children: /* @__PURE__ */ l(Q, { children: n.title })
212
243
  }, r);
213
244
  })
@@ -218,7 +249,7 @@ var E = ({ schema: e, className: t, ...n }) => {
218
249
  }
219
250
  return null;
220
251
  };
221
- d.register("timeline", E, {
252
+ d.register("timeline", k, {
222
253
  namespace: "plugin-timeline",
223
254
  label: "Timeline",
224
255
  category: "data-display",
@@ -413,9 +444,7 @@ d.register("timeline", E, {
413
444
  }
414
445
  }
415
446
  });
416
- //#endregion
417
- //#region src/useTimelineTranslation.ts
418
- var D = {
447
+ var ee = b({
419
448
  "timeline.bucket.overdue": "Overdue",
420
449
  "timeline.bucket.today": "Today",
421
450
  "timeline.bucket.tomorrow": "Tomorrow",
@@ -429,40 +458,21 @@ var D = {
429
458
  "timeline.relative.yesterday": "Yesterday",
430
459
  "timeline.relative.inDays": "In {{n}} days",
431
460
  "timeline.relative.daysAgo": "{{n}} days ago"
432
- }, O = "timeline.bucket.today";
433
- function k(e, t) {
434
- let n = D[e] || e;
435
- if (t) for (let [e, r] of Object.entries(t)) n = n.replace(`{{${e}}}`, String(r));
436
- return n;
437
- }
438
- function A() {
439
- try {
440
- let e = _();
441
- return e.t(O) === O ? { t: k } : { t: e.t };
442
- } catch {
443
- return { t: k };
444
- }
445
- }
446
- //#endregion
447
- //#region src/ObjectTimeline.tsx
448
- function j() {
449
- try {
450
- return g();
451
- } catch {
452
- return {
453
- fieldOptionLabel: (e, t, n, r) => r,
454
- translateOptions: (e, t, n) => n,
455
- fieldLabel: (e, t, n) => n
456
- };
457
- }
461
+ }, "timeline.bucket.today"), A = {
462
+ fieldOptionLabel: (e, t, n, r) => r,
463
+ translateOptions: (e, t, n) => n,
464
+ fieldLabel: (e, t, n) => n
465
+ };
466
+ function te() {
467
+ return g() ?? A;
458
468
  }
459
- var M = y.object({
469
+ var j = y.object({
460
470
  title: y.string().optional(),
461
471
  date: y.string().optional(),
462
472
  description: y.string().optional(),
463
473
  variant: y.string().optional()
464
- }), te = y.object({
465
- mapping: M.optional(),
474
+ }), M = y.object({
475
+ mapping: j.optional(),
466
476
  objectName: y.string().optional(),
467
477
  titleField: y.string().optional(),
468
478
  dateField: y.string().optional(),
@@ -480,15 +490,15 @@ var M = y.object({
480
490
  "year"
481
491
  ]).optional()
482
492
  }), N = ({ schema: e, dataSource: o, className: s, onRowClick: c, onItemClick: d, ...g }) => {
483
- let [_, v] = i([]), [y, b] = i(() => {
493
+ let [_, y] = i([]), [b, x] = i(() => {
484
494
  let t = Array.isArray(e.items) && e.items.length > 0, n = Array.isArray(g.data) && g.data.length > 0;
485
495
  return !t && !n && !!e.objectName;
486
- }), [x, S] = i(null), [C, w] = i(0), [T, D] = i(null), O = e.timeline;
496
+ }), [S, C] = i(null), [w, T] = i(0), [E, D] = i(null), O = e.timeline;
487
497
  n(() => {
488
- let t = te.safeParse(e);
498
+ let t = M.safeParse(e);
489
499
  t.success || console.warn("[ObjectTimeline] Invalid timeline configuration:", t.error.format());
490
500
  }, [e]);
491
- let k = m(e.bind);
501
+ let A = m(e.bind);
492
502
  n(() => {
493
503
  let t = !0;
494
504
  return (async () => {
@@ -502,37 +512,37 @@ var M = y.object({
502
512
  t = !1;
503
513
  };
504
514
  }, [e.objectName, o]), n(() => {
505
- e.objectName && !k && !e.items && !g.data ? (async () => {
515
+ e.objectName && !A && !e.items && !g.data ? (async () => {
506
516
  if (!o || typeof o.find != "function" || !e.objectName) {
507
- b(!1);
517
+ x(!1);
508
518
  return;
509
519
  }
510
- b(!0);
520
+ x(!0);
511
521
  try {
512
- let t = f(T?.fields), n = p(await o.find(e.objectName, {
522
+ let t = f(E?.fields), n = p(await o.find(e.objectName, {
513
523
  options: { $top: 100 },
514
524
  ...t.length > 0 ? { $expand: t } : {}
515
525
  }));
516
- v(n);
526
+ y(n);
517
527
  } catch (e) {
518
- console.error(e), S(e);
528
+ console.error(e), C(e);
519
529
  } finally {
520
- b(!1);
530
+ x(!1);
521
531
  }
522
- })() : b(!1);
532
+ })() : x(!1);
523
533
  }, [
524
534
  e.objectName,
525
535
  o,
526
- k,
536
+ A,
527
537
  e.items,
528
538
  g.data,
529
- C,
530
- T
539
+ w,
540
+ E
531
541
  ]);
532
- let M = g.data || k || _, { t: N } = A(), { fieldOptionLabel: P } = j(), F = O?.titleField ?? e.mapping?.title ?? e.titleField ?? "name", I = O?.startDateField ?? e.mapping?.date ?? e.startDateField ?? e.dateField ?? "date", L = O?.endDateField ?? e.endDateField ?? I, R = e.mapping?.description ?? e.descriptionField ?? "description", z = e.mapping?.variant ?? "variant", B = O?.groupByField ?? e.groupByField, V = O?.colorField ?? e.colorField, H = r(() => {
542
+ let j = g.data || A || _, { t: N } = ee(), { fieldOptionLabel: P } = te(), F = O?.titleField ?? e.mapping?.title ?? e.titleField ?? "name", I = O?.startDateField ?? e.mapping?.date ?? e.startDateField ?? e.dateField ?? "date", L = O?.endDateField ?? e.endDateField ?? I, R = e.mapping?.description ?? e.descriptionField ?? "description", z = e.mapping?.variant ?? "variant", B = O?.groupByField ?? e.groupByField, V = O?.colorField ?? e.colorField, H = r(() => {
533
543
  if (e.items) return e.items;
534
- if (!M || !Array.isArray(M)) return [];
535
- let t = T?.fields ?? {}, n = e.objectName || "", r = (e) => {
544
+ if (!j || !Array.isArray(j)) return [];
545
+ let t = E?.fields ?? {}, n = e.objectName || "", r = (e) => {
536
546
  if (!e || !t[e]?.options) return {};
537
547
  let n = {};
538
548
  for (let r of t[e].options) r && r.value != null && (n[String(r.value)] = r);
@@ -552,7 +562,7 @@ var M = y.object({
552
562
  label: i?.label ? P(n, e, String(t), i.label) : String(t),
553
563
  color: i?.color
554
564
  };
555
- }, l = M.map((e) => {
565
+ }, l = j.map((e) => {
556
566
  let t = e[I], r = e[L], i = V ? e[V] : void 0, l = B ? e[B] : void 0, u = [];
557
567
  if (n) for (let t of a) {
558
568
  let n = c(t, e[t], o[t] || {});
@@ -597,8 +607,8 @@ var M = y.object({
597
607
  }));
598
608
  }, [
599
609
  e.items,
600
- M,
601
- T,
610
+ j,
611
+ E,
602
612
  e.objectName,
603
613
  F,
604
614
  I,
@@ -609,9 +619,9 @@ var M = y.object({
609
619
  B,
610
620
  N,
611
621
  P
612
- ]), { ref: U, isRefreshing: W, pullDistance: G } = ee({
622
+ ]), { ref: U, isRefreshing: W, pullDistance: G } = v({
613
623
  onRefresh: t(async () => {
614
- w((e) => e + 1);
624
+ T((e) => e + 1);
615
625
  }, []),
616
626
  enabled: !!e.objectName && !!o
617
627
  }), K = h({
@@ -628,12 +638,12 @@ var M = y.object({
628
638
  K.handleClick(t), d?.(t);
629
639
  }
630
640
  };
631
- return x ? /* @__PURE__ */ u("div", {
641
+ return S ? /* @__PURE__ */ u("div", {
632
642
  className: "p-4 text-destructive",
633
643
  "data-testid": "timeline-error",
634
644
  role: "alert",
635
- children: ["Error loading timeline: ", x.message]
636
- }) : y && (!H || H.length === 0) ? /* @__PURE__ */ u("div", {
645
+ children: ["Error loading timeline: ", S.message]
646
+ }) : b && (!H || H.length === 0) ? /* @__PURE__ */ u("div", {
637
647
  className: "flex flex-col h-full min-h-[200px] p-4 gap-3",
638
648
  "data-testid": "timeline-loading",
639
649
  role: "status",
@@ -664,7 +674,7 @@ var M = y.object({
664
674
  style: { height: G },
665
675
  children: W ? "Refreshing…" : "Pull to refresh"
666
676
  }),
667
- /* @__PURE__ */ l(E, { schema: J }),
677
+ /* @__PURE__ */ l(k, { schema: J }),
668
678
  K.isOverlay && /* @__PURE__ */ l(a, {
669
679
  ...K,
670
680
  title: "Timeline Item",
@@ -816,7 +826,7 @@ var Q = e.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l("div", {
816
826
  }));
817
827
  Q.displayName = "TimelineGanttBarContent";
818
828
  var $ = ({ schema: e, ...t }) => {
819
- let { dataSource: n } = v() || {};
829
+ let { dataSource: n } = _() || {};
820
830
  return /* @__PURE__ */ l(N, {
821
831
  schema: e,
822
832
  dataSource: n,
@@ -863,4 +873,4 @@ d.register("object-timeline", $, {
863
873
  }]
864
874
  });
865
875
  //#endregion
866
- export { N as ObjectTimeline, $ as ObjectTimelineRenderer, P as Timeline, z as TimelineContent, H as TimelineDescription, G as TimelineGantt, Z as TimelineGanttBar, Q as TimelineGanttBarContent, J as TimelineGanttGrid, K as TimelineGanttHeader, X as TimelineGanttLabel, Y as TimelineGanttRow, q as TimelineGanttRowLabels, U as TimelineHorizontal, W as TimelineHorizontalItem, I as TimelineItem, R as TimelineMarker, E as TimelineRenderer, V as TimelineTime, B as TimelineTitle, F as timelineItemVariants, L as timelineMarkerVariants };
876
+ export { N as ObjectTimeline, $ as ObjectTimelineRenderer, x as TIMELINE_SCALES, P as Timeline, z as TimelineContent, H as TimelineDescription, G as TimelineGantt, Z as TimelineGanttBar, Q as TimelineGanttBarContent, J as TimelineGanttGrid, K as TimelineGanttHeader, X as TimelineGanttLabel, Y as TimelineGanttRow, q as TimelineGanttRowLabels, U as TimelineHorizontal, W as TimelineHorizontalItem, I as TimelineItem, R as TimelineMarker, k as TimelineRenderer, V as TimelineTime, B as TimelineTitle, C as generateTimeScaleHeaders, S as resolveTimelineScale, F as timelineItemVariants, L as timelineMarkerVariants };
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@object-ui/components"),require("react/jsx-runtime"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/mobile"),require("zod")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@object-ui/components`,`react/jsx-runtime`,`@object-ui/core`,`@object-ui/react`,`@object-ui/mobile`,`zod`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginTimeline={},e.React,e.ObjectUIComponents,e.react_jsx_runtime,e.ObjectUICore,e.ObjectUIReact,e.ObjectUIMobile,e.zod))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var c=Object.create,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=d(t),a=0,o=i.length,s;a<o;a++)s=i[a],!p.call(e,s)&&s!==n&&l(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=u(t,s))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:c(f(e)),m(t||!e||!e.__esModule?l(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);var h=10080*60*1e3;function g(e){let t=e.flatMap(e=>(e.items||[]).flatMap(e=>[e.startDate,e.endDate])),n=Math.min(...t.map(e=>new Date(e).getTime())),r=Math.max(...t.map(e=>new Date(e).getTime()));return{minDate:new Date(n).toISOString().split(`T`)[0],maxDate:new Date(r).toISOString().split(`T`)[0]}}function _(e,t,n,r){let i=new Date(e).getTime(),a=new Date(t).getTime(),o=new Date(n).getTime(),s=new Date(r).getTime()-o,c=i-o,l=a-i;return{start:c/s*100,width:l/s*100}}function v(e,t){let n=new Date(e);return t===`short`?n.toLocaleDateString():t===`long`?n.toLocaleDateString(`en-US`,{year:`numeric`,month:`long`,day:`numeric`}):n.toISOString().split(`T`)[0]}function y({label:e,color:t}){let i=t?{backgroundColor:`${t}22`,color:t,borderColor:`${t}55`}:void 0;return(0,r.jsx)(`span`,{className:(0,n.cn)(`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium`,!t&&`bg-muted text-muted-foreground border-transparent`),style:i,children:e})}function b(e){let t=[];for(let n of e){let e=n.group==null?``:String(n.group),r=t[t.length-1];r&&r.key===e?r.items.push(n):t.push({key:e,items:[n]})}return t}var x=({schema:e,className:t,...i})=>{let{variant:a=`vertical`,items:o=[],dateFormat:s=`short`,onItemClick:c}=e;if(a===`vertical`){let e=b(o),a=e.some(e=>e.key!==``),l=(e,t)=>{let i=e.color?{backgroundColor:`${e.color}33`,borderColor:e.color}:void 0,a=e.time?v(e.time,s):e.startDate?v(e.startDate,s):``,o=e.endDate&&e.endDate!==e.startDate?v(e.endDate,s):``,l=Array.isArray(e.meta)?e.meta:[];return(0,r.jsxs)(M,{density:`compact`,className:(0,n.cn)(e.className,c&&`cursor-pointer`),onClick:()=>c?.(e),children:[(0,r.jsx)(P,{variant:e.color?`default`:e.variant||`default`,style:i,children:e.icon&&(0,r.jsx)(`span`,{className:`text-xs`,children:e.icon})}),(0,r.jsxs)(F,{children:[(a||o)&&(0,r.jsxs)(L,{dateTime:e.time||e.startDate,className:`!mb-1 text-xs`,children:[a,o&&(0,r.jsxs)(`span`,{className:`text-muted-foreground/70`,children:[` → `,o]})]}),e.title&&(0,r.jsx)(I,{className:`text-sm sm:text-base mb-1`,children:e.title}),l.length>0&&(0,r.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-1 mb-1`,children:l.map(e=>(0,r.jsx)(y,{label:e.label,color:e.color},e.key))}),e.description&&(0,r.jsx)(R,{className:`text-sm text-muted-foreground line-clamp-2 sm:line-clamp-none`,children:e.description}),e.content&&(0,n.renderChildren)(e.content)]})]},t)};return a?(0,r.jsx)(`div`,{className:(0,n.cn)(`px-4 sm:px-6 py-2`,t),...i,children:e.map((e,t)=>(0,r.jsxs)(`section`,{className:`mb-4`,children:[(0,r.jsxs)(`header`,{className:`sticky top-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-1.5 backdrop-blur bg-background/90 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-b`,children:[(0,r.jsx)(`span`,{children:e.key}),(0,r.jsx)(`span`,{className:`ml-2 text-muted-foreground/60 font-normal normal-case`,children:e.items.length})]}),(0,r.jsx)(A,{className:`mt-3`,children:e.items.map((e,n)=>l(e,`${t}-${n}`))})]},`${e.key}-${t}`))}):(0,r.jsx)(A,{className:t,...i,children:o.map((e,t)=>l(e,t))})}if(a===`horizontal`)return(0,r.jsx)(z,{className:(0,n.cn)(`overflow-x-auto [-webkit-overflow-scrolling:touch]`,t),...i,children:o.map((e,t)=>(0,r.jsxs)(B,{className:(0,n.cn)(e.className,c&&`cursor-pointer`),onClick:()=>c?.(e),children:[(0,r.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,r.jsx)(P,{variant:e.variant||`default`,children:e.icon&&(0,r.jsx)(`span`,{className:`text-xs`,children:e.icon})}),(0,r.jsxs)(`div`,{className:`mt-4 text-center`,children:[e.time&&(0,r.jsx)(L,{dateTime:e.time,children:v(e.time,s)}),e.title&&(0,r.jsx)(I,{children:e.title}),e.description&&(0,r.jsx)(R,{className:`text-center line-clamp-2 sm:line-clamp-none`,children:e.description}),e.content&&(0,n.renderChildren)(e.content)]})]}),t<o.length-1&&(0,r.jsx)(`div`,{className:`absolute left-full w-16 border-t-2 border-gray-200 top-3`})]},t))});if(a===`gantt`){let a=g(o),l=e.minDate||a.minDate,u=e.maxDate||a.maxDate,d=e.timeScale||`month`,f=(()=>{let e=[],t=new Date(l),n=new Date(u);if(d===`month`){let r=new Date(t);for(;r<=n;)e.push(r.toLocaleDateString(`en-US`,{month:`short`,year:`numeric`})),r.setMonth(r.getMonth()+1)}else if(d===`week`){let r=new Date(t);for(;r<=n;)e.push(`Week ${Math.ceil((r.getTime()-t.getTime())/h)+1}`),r.setDate(r.getDate()+7)}else if(d===`day`){let r=new Date(t);for(;r<=n;)e.push(r.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})),r.setDate(r.getDate()+1)}return e})();return(0,r.jsxs)(V,{className:(0,n.cn)(`overflow-x-auto [-webkit-overflow-scrolling:touch]`,t),...i,children:[(0,r.jsxs)(H,{children:[(0,r.jsx)(U,{className:`flex items-center px-2 sm:px-4 py-2 sm:py-3`,children:(0,r.jsx)(`span`,{className:`font-semibold text-xs sm:text-sm`,children:e.rowLabel||`Items`})}),(0,r.jsx)(W,{children:(0,r.jsx)(`div`,{className:`flex h-full`,children:f.map((e,t)=>(0,r.jsx)(`div`,{className:`flex-1 px-1 sm:px-2 py-2 sm:py-3 border-r text-xs font-medium text-center`,children:e},t))})})]}),(0,r.jsx)(`div`,{children:(0,r.jsxs)(`div`,{className:`flex`,children:[(0,r.jsx)(U,{children:o.map((e,t)=>(0,r.jsx)(G,{children:(0,r.jsx)(K,{title:e.label,className:`truncate`,children:e.label})},t))}),(0,r.jsx)(W,{className:`relative`,children:o.map((e,t)=>(0,r.jsx)(G,{className:`relative`,children:(e.items||[]).map((n,i)=>{let a=_(n.startDate,n.endDate,l,u);return(0,r.jsx)(q,{start:a.start,width:a.width,variant:n.variant||`default`,onClick:()=>c?.(n,e,t,i),title:`${n.title||``}\n${v(n.startDate,s)} - ${v(n.endDate,s)}`,children:(0,r.jsx)(J,{children:n.title})},i)})},t))})]})})]})}return null};i.ComponentRegistry.register(`timeline`,x,{namespace:`plugin-timeline`,label:`Timeline`,category:`data-display`,inputs:[{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],label:`Timeline Variant`,defaultValue:`vertical`},{name:`items`,type:`array`,label:`Timeline Items`,description:`For vertical/horizontal: Array of { time, title, description, variant, icon, content }. For gantt: Array of { label, items: [{ title, startDate, endDate, variant }] }`},{name:`dateFormat`,type:`enum`,enum:[`short`,`long`,`iso`],label:`Date Format`,defaultValue:`short`},{name:`timeScale`,type:`enum`,enum:[`day`,`week`,`month`],label:`Time Scale (Gantt only)`,defaultValue:`month`},{name:`rowLabel`,type:`string`,label:`Row Label (Gantt only)`,defaultValue:`Items`},{name:`minDate`,type:`string`,label:`Min Date (Gantt only)`,description:`Override auto-calculated min date (YYYY-MM-DD)`},{name:`maxDate`,type:`string`,label:`Max Date (Gantt only)`,description:`Override auto-calculated max date (YYYY-MM-DD)`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{variant:`vertical`,dateFormat:`short`,items:[{time:`2024-01-15`,title:`Project Started`,description:`Kickoff meeting and initial planning`,variant:`success`,icon:`🚀`},{time:`2024-02-01`,title:`First Milestone`,description:`Completed initial design phase`,variant:`info`,icon:`🎨`},{time:`2024-03-15`,title:`Beta Release`,description:`Released beta version to testers`,variant:`warning`,icon:`⚡`},{time:`2024-04-01`,title:`Launch`,description:`Official product launch`,variant:`success`,icon:`🎉`}]},examples:{vertical:{variant:`vertical`,dateFormat:`long`,items:[{time:`2024-01-15`,title:`Project Started`,description:`Kickoff meeting and initial planning`,variant:`success`},{time:`2024-02-01`,title:`First Milestone`,description:`Completed initial design phase`,variant:`info`}]},horizontal:{variant:`horizontal`,dateFormat:`short`,items:[{time:`2024-01-01`,title:`Q1`,description:`First quarter`,variant:`default`},{time:`2024-04-01`,title:`Q2`,description:`Second quarter`,variant:`info`},{time:`2024-07-01`,title:`Q3`,description:`Third quarter`,variant:`warning`},{time:`2024-10-01`,title:`Q4`,description:`Fourth quarter`,variant:`success`}]},gantt:{variant:`gantt`,dateFormat:`short`,timeScale:`month`,rowLabel:`Projects`,items:[{label:`Backend Development`,items:[{title:`API Design`,startDate:`2024-01-01`,endDate:`2024-01-31`,variant:`success`},{title:`Implementation`,startDate:`2024-02-01`,endDate:`2024-03-31`,variant:`info`}]},{label:`Frontend Development`,items:[{title:`UI Design`,startDate:`2024-01-15`,endDate:`2024-02-15`,variant:`warning`},{title:`Component Dev`,startDate:`2024-02-15`,endDate:`2024-04-15`,variant:`default`}]},{label:`Testing`,items:[{title:`QA Phase`,startDate:`2024-03-01`,endDate:`2024-04-30`,variant:`danger`}]}]}}});var S={"timeline.bucket.overdue":`Overdue`,"timeline.bucket.today":`Today`,"timeline.bucket.tomorrow":`Tomorrow`,"timeline.bucket.thisWeek":`This week`,"timeline.bucket.nextWeek":`Next week`,"timeline.bucket.later":`Later`,"timeline.bucket.noDate":`No date`,"timeline.bucket.unassigned":`Unassigned`,"timeline.relative.today":`Today`,"timeline.relative.tomorrow":`Tomorrow`,"timeline.relative.yesterday":`Yesterday`,"timeline.relative.inDays":`In {{n}} days`,"timeline.relative.daysAgo":`{{n}} days ago`},C=`timeline.bucket.today`;function w(e,t){let n=S[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}function T(){try{let e=(0,a.useObjectTranslation)();return e.t(C)===C?{t:w}:{t:e.t}}catch{return{t:w}}}function E(){try{return(0,a.useObjectLabel)()}catch{return{fieldOptionLabel:(e,t,n,r)=>r,translateOptions:(e,t,n)=>n,fieldLabel:(e,t,n)=>n}}}var D=s.z.object({title:s.z.string().optional(),date:s.z.string().optional(),description:s.z.string().optional(),variant:s.z.string().optional()}),O=s.z.object({mapping:D.optional(),objectName:s.z.string().optional(),titleField:s.z.string().optional(),dateField:s.z.string().optional(),startDateField:s.z.string().optional(),endDateField:s.z.string().optional(),descriptionField:s.z.string().optional(),groupByField:s.z.string().optional(),colorField:s.z.string().optional(),scale:s.z.enum([`hour`,`day`,`week`,`month`,`quarter`,`year`]).optional()}),k=({schema:e,dataSource:s,className:c,onRowClick:l,onItemClick:u,...d})=>{let[f,p]=(0,t.useState)([]),[m,h]=(0,t.useState)(()=>{let t=Array.isArray(e.items)&&e.items.length>0,n=Array.isArray(d.data)&&d.data.length>0;return!t&&!n&&!!e.objectName}),[g,_]=(0,t.useState)(null),[v,y]=(0,t.useState)(0),[b,S]=(0,t.useState)(null),C=e.timeline;(0,t.useEffect)(()=>{let t=O.safeParse(e);t.success||console.warn(`[ObjectTimeline] Invalid timeline configuration:`,t.error.format())},[e]);let w=(0,a.useDataScope)(e.bind);(0,t.useEffect)(()=>{let t=!0;return(async()=>{if(!(!s||typeof s.getObjectSchema!=`function`||!e.objectName))try{let n=await s.getObjectSchema(e.objectName);t&&S(n)}catch(e){console.warn(`Failed to fetch object def for ObjectTimeline`,e)}})(),()=>{t=!1}},[e.objectName,s]),(0,t.useEffect)(()=>{e.objectName&&!w&&!e.items&&!d.data?(async()=>{if(!s||typeof s.find!=`function`||!e.objectName){h(!1);return}h(!0);try{let t=(0,i.buildExpandFields)(b?.fields),n=(0,i.extractRecords)(await s.find(e.objectName,{options:{$top:100},...t.length>0?{$expand:t}:{}}));p(n)}catch(e){console.error(e),_(e)}finally{h(!1)}})():h(!1)},[e.objectName,s,w,e.items,d.data,v,b]);let D=d.data||w||f,{t:k}=T(),{fieldOptionLabel:A}=E(),j=C?.titleField??e.mapping?.title??e.titleField??`name`,M=C?.startDateField??e.mapping?.date??e.startDateField??e.dateField??`date`,N=C?.endDateField??e.endDateField??M,P=e.mapping?.description??e.descriptionField??`description`,F=e.mapping?.variant??`variant`,I=C?.groupByField??e.groupByField,L=C?.colorField??e.colorField,R=(0,t.useMemo)(()=>{if(e.items)return e.items;if(!D||!Array.isArray(D))return[];let t=b?.fields??{},n=e.objectName||``,r=e=>{if(!e||!t[e]?.options)return{};let n={};for(let r of t[e].options)r&&r.value!=null&&(n[String(r.value)]=r);return n},i=r(L),a=Array.isArray(C?.metaFields)?C.metaFields.filter(e=>typeof e==`string`&&e):[`status`,`priority`].filter(e=>t[e]),o={};for(let e of a)o[e]=r(e);let s=e=>{if(e==null||e===``)return;let t=i[String(e)];if(t?.color)return String(t.color);let n=String(e);if(/^#([0-9a-f]{3}){1,2}$/i.test(n)||n.startsWith(`rgb`)||n.startsWith(`hsl`))return n},c=(e,t,r)=>{if(t==null||t===``)return null;let i=r[String(t)];return{label:i?.label?A(n,e,String(t),i.label):String(t),color:i?.color}},l=D.map(e=>{let t=e[M],r=e[N],i=L?e[L]:void 0,l=I?e[I]:void 0,u=[];if(n)for(let t of a){let n=c(t,e[t],o[t]||{});n&&u.push({key:t,label:n.label,color:n.color})}return{title:e[j],time:t,startDate:t,endDate:r,description:e[P],variant:e[F]||`default`,color:s(i),group:l,meta:u,_data:e}});l.sort((e,t)=>(e.startDate?new Date(e.startDate).getTime():1/0)-(t.startDate?new Date(t.startDate).getTime():1/0));let u=new Date,d=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),f=d(u),p=864e5,m=f-(u.getDay()+6)%7*p+7*p,h=m+7*p,g=e=>{if(!e)return k(`timeline.bucket.noDate`);let t=d(new Date(e));return Number.isNaN(t)?k(`timeline.bucket.noDate`):t<f?k(`timeline.bucket.overdue`):t===f?k(`timeline.bucket.today`):t===f+p?k(`timeline.bucket.tomorrow`):k(t<m?`timeline.bucket.thisWeek`:t<h?`timeline.bucket.nextWeek`:`timeline.bucket.later`)};if(I&&!l.every(e=>e.group==null||e.group===``)){let e=r(I);return l.map(t=>{let n=c(I,t.group,e);return{...t,group:n?n.label:t.group!=null&&t.group!==``?String(t.group):k(`timeline.bucket.unassigned`)}})}return l.map(e=>({...e,group:g(e.startDate)}))},[e.items,D,b,e.objectName,j,M,N,P,F,L,I,k,A]),{ref:z,isRefreshing:B,pullDistance:V}=(0,o.usePullToRefresh)({onRefresh:(0,t.useCallback)(async()=>{y(e=>e+1)},[]),enabled:!!e.objectName&&!!s}),H=(0,a.useNavigationOverlay)({navigation:e.navigation,objectName:e.objectName,onRowClick:l??u}),U=C?.scale??e.scale,W={...e,items:R||[],className:c||e.className,...U?{timeScale:U}:{},onItemClick:e=>{let t=e._data||e;H.handleClick(t),u?.(t)}};return g?(0,r.jsxs)(`div`,{className:`p-4 text-destructive`,"data-testid":`timeline-error`,role:`alert`,children:[`Error loading timeline: `,g.message]}):m&&(!R||R.length===0)?(0,r.jsxs)(`div`,{className:`flex flex-col h-full min-h-[200px] p-4 gap-3`,"data-testid":`timeline-loading`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,r.jsx)(`span`,{className:`sr-only`,children:`Loading timeline…`}),[0,1,2,3].map(e=>(0,r.jsxs)(`div`,{className:`flex items-start gap-3`,style:{opacity:Math.max(.3,1-e*.18)},children:[(0,r.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-muted/70 animate-pulse mt-1.5 shrink-0`}),(0,r.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,r.jsx)(`div`,{className:`h-4 w-1/3 rounded bg-muted/70 animate-pulse`}),(0,r.jsx)(`div`,{className:`h-3 w-2/3 rounded bg-muted/50 animate-pulse`})]})]},e))]}):(0,r.jsxs)(`div`,{ref:z,className:`relative overflow-auto h-full min-w-0`,children:[V>0&&(0,r.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:V},children:B?`Refreshing…`:`Pull to refresh`}),(0,r.jsx)(x,{schema:W}),H.isOverlay&&(0,r.jsx)(n.NavigationOverlay,{...H,title:`Timeline Item`,children:e=>(0,r.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,r.jsxs)(`div`,{className:`flex flex-col`,children:[(0,r.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,r.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})},A=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`ol`,{ref:i,className:(0,n.cn)(`relative ml-3 border-l border-gray-200`,e),...t}));A.displayName=`Timeline`;var j=(0,n.cva)(`ml-6`,{variants:{density:{default:`mb-10`,compact:`mb-3`,comfortable:`mb-6`}},defaultVariants:{density:`default`}}),M=t.forwardRef(({className:e,density:t,...i},a)=>(0,r.jsx)(`li`,{ref:a,className:(0,n.cn)(j({density:t}),e),...i}));M.displayName=`TimelineItem`;var N=(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`}}),P=t.forwardRef(({className:e,variant:t=`default`,...i},a)=>(0,r.jsx)(`div`,{ref:a,className:(0,n.cn)(N({variant:t}),e),...i}));P.displayName=`TimelineMarker`;var F=t.forwardRef(({className:e,...t},n)=>(0,r.jsx)(`div`,{ref:n,className:e,...t}));F.displayName=`TimelineContent`;var I=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`h3`,{ref:i,className:(0,n.cn)(`font-semibold text-lg mb-1`,e),...t}));I.displayName=`TimelineTitle`;var L=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`time`,{ref:i,className:(0,n.cn)(`text-sm font-normal text-gray-500 mb-2 block`,e),...t}));L.displayName=`TimelineTime`;var R=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`p`,{ref:i,className:(0,n.cn)(`text-base text-gray-700`,e),...t}));R.displayName=`TimelineDescription`;var z=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`relative flex overflow-x-auto py-8`,e),...t}));z.displayName=`TimelineHorizontal`;var B=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`shrink-0 w-64 relative`,e),...t}));B.displayName=`TimelineHorizontalItem`;var V=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`relative w-full border rounded-lg overflow-hidden`,e),...t}));V.displayName=`TimelineGantt`;var H=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`flex border-b bg-gray-50`,e),...t}));H.displayName=`TimelineGanttHeader`;var U=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`w-48 border-r bg-white`,e),...t}));U.displayName=`TimelineGanttRowLabels`;var W=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`flex-1 overflow-x-auto`,e),...t}));W.displayName=`TimelineGanttGrid`;var G=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`flex items-center border-b min-h-12`,e),...t}));G.displayName=`TimelineGanttRow`;var K=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`px-4 py-2 font-medium text-sm truncate`,e),...t}));K.displayName=`TimelineGanttLabel`;var q=t.forwardRef(({className:e,start:t=0,width:i=100,variant:a=`default`,...o},s)=>(0,r.jsx)(`div`,{ref:s,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`}[a],e),style:{left:`${t}%`,width:`${i}%`},...o}));q.displayName=`TimelineGanttBar`;var J=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`px-2 py-1 text-white text-xs font-medium truncate`,e),...t}));J.displayName=`TimelineGanttBarContent`;var Y=({schema:e,...t})=>{let{dataSource:n}=(0,a.useSchemaContext)()||{};return(0,r.jsx)(k,{schema:e,dataSource:n,...t})};i.ComponentRegistry.register(`object-timeline`,Y,{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`}]}),i.ComponentRegistry.register(`timeline`,Y,{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=k,e.ObjectTimelineRenderer=Y,e.Timeline=A,e.TimelineContent=F,e.TimelineDescription=R,e.TimelineGantt=V,e.TimelineGanttBar=q,e.TimelineGanttBarContent=J,e.TimelineGanttGrid=W,e.TimelineGanttHeader=H,e.TimelineGanttLabel=K,e.TimelineGanttRow=G,e.TimelineGanttRowLabels=U,e.TimelineHorizontal=z,e.TimelineHorizontalItem=B,e.TimelineItem=M,e.TimelineMarker=P,e.TimelineRenderer=x,e.TimelineTime=L,e.TimelineTitle=I,e.timelineItemVariants=j,e.timelineMarkerVariants=N});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@object-ui/components"),require("react/jsx-runtime"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/mobile"),require("zod"),require("@object-ui/i18n")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@object-ui/components`,`react/jsx-runtime`,`@object-ui/core`,`@object-ui/react`,`@object-ui/mobile`,`zod`,`@object-ui/i18n`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginTimeline={},e.React,e.ObjectUIComponents,e.react_jsx_runtime,e.ObjectUICore,e.ObjectUIReact,e.ObjectUIMobile,e.zod,e._object_ui_i18n))})(this,function(e,t,n,r,i,a,o,s,c){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var l=Object.create,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:l(p(e)),h(t||!e||!e.__esModule?u(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);var g=new Set([`hour`,`day`,`week`,`month`,`quarter`,`year`]);function _(e){let t=e.scale??e.timeScale;return typeof t==`string`&&g.has(t)?t:`month`}function v(e,t,n){let r=[],i=new Date(t),a=new Date(n);if(Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||i>a)return r;let o=new Date(i);switch(e){case`hour`:for(;o<=a;)r.push(o.toLocaleString(`en-US`,{month:`short`,day:`numeric`,hour:`numeric`})),o.setHours(o.getHours()+1);break;case`day`:for(;o<=a;)r.push(o.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})),o.setDate(o.getDate()+1);break;case`week`:{let e=1;for(;o<=a;)r.push(`Week ${e++}`),o.setDate(o.getDate()+7);break}case`quarter`:for(o.setMonth(Math.floor(o.getMonth()/3)*3,1);o<=a;)r.push(`Q${Math.floor(o.getMonth()/3)+1} ${o.getFullYear()}`),o.setMonth(o.getMonth()+3);break;case`year`:for(o.setMonth(0,1);o<=a;)r.push(String(o.getFullYear())),o.setFullYear(o.getFullYear()+1);break;default:for(;o<=a;)r.push(o.toLocaleDateString(`en-US`,{month:`short`,year:`numeric`})),o.setMonth(o.getMonth()+1);break}return r}function y(e){let t=e.flatMap(e=>(e.items||[]).flatMap(e=>[e.startDate,e.endDate])),n=Math.min(...t.map(e=>new Date(e).getTime())),r=Math.max(...t.map(e=>new Date(e).getTime()));return{minDate:new Date(n).toISOString().split(`T`)[0],maxDate:new Date(r).toISOString().split(`T`)[0]}}function b(e,t,n,r){let i=new Date(e).getTime(),a=new Date(t).getTime(),o=new Date(n).getTime(),s=new Date(r).getTime()-o,c=i-o,l=a-i;return{start:c/s*100,width:l/s*100}}function x(e,t){let n=new Date(e);return t===`short`?n.toLocaleDateString():t===`long`?n.toLocaleDateString(`en-US`,{year:`numeric`,month:`long`,day:`numeric`}):n.toISOString().split(`T`)[0]}function S({label:e,color:t}){let i=t?{backgroundColor:`${t}22`,color:t,borderColor:`${t}55`}:void 0;return(0,r.jsx)(`span`,{className:(0,n.cn)(`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium`,!t&&`bg-muted text-muted-foreground border-transparent`),style:i,children:e})}function C(e){let t=[];for(let n of e){let e=n.group==null?``:String(n.group),r=t[t.length-1];r&&r.key===e?r.items.push(n):t.push({key:e,items:[n]})}return t}var w=({schema:e,className:t,...i})=>{let{variant:a=`vertical`,items:o=[],dateFormat:s=`short`,onItemClick:c}=e;if(a===`vertical`){let e=C(o),a=e.some(e=>e.key!==``),l=(e,t)=>{let i=e.color?{backgroundColor:`${e.color}33`,borderColor:e.color}:void 0,a=e.time?x(e.time,s):e.startDate?x(e.startDate,s):``,o=e.endDate&&e.endDate!==e.startDate?x(e.endDate,s):``,l=Array.isArray(e.meta)?e.meta:[];return(0,r.jsxs)(N,{density:`compact`,className:(0,n.cn)(e.className,c&&`cursor-pointer`),onClick:()=>c?.(e),children:[(0,r.jsx)(F,{variant:e.color?`default`:e.variant||`default`,style:i,children:e.icon&&(0,r.jsx)(`span`,{className:`text-xs`,children:e.icon})}),(0,r.jsxs)(I,{children:[(a||o)&&(0,r.jsxs)(R,{dateTime:e.time||e.startDate,className:`!mb-1 text-xs`,children:[a,o&&(0,r.jsxs)(`span`,{className:`text-muted-foreground/70`,children:[` → `,o]})]}),e.title&&(0,r.jsx)(L,{className:`text-sm sm:text-base mb-1`,children:e.title}),l.length>0&&(0,r.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-1 mb-1`,children:l.map(e=>(0,r.jsx)(S,{label:e.label,color:e.color},e.key))}),e.description&&(0,r.jsx)(z,{className:`text-sm text-muted-foreground line-clamp-2 sm:line-clamp-none`,children:e.description}),e.content&&(0,n.renderChildren)(e.content)]})]},t)};return a?(0,r.jsx)(`div`,{className:(0,n.cn)(`px-4 sm:px-6 py-2`,t),...i,children:e.map((e,t)=>(0,r.jsxs)(`section`,{className:`mb-4`,children:[(0,r.jsxs)(`header`,{className:`sticky top-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-1.5 backdrop-blur bg-background/90 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-b`,children:[(0,r.jsx)(`span`,{children:e.key}),(0,r.jsx)(`span`,{className:`ml-2 text-muted-foreground/60 font-normal normal-case`,children:e.items.length})]}),(0,r.jsx)(j,{className:`mt-3`,children:e.items.map((e,n)=>l(e,`${t}-${n}`))})]},`${e.key}-${t}`))}):(0,r.jsx)(j,{className:t,...i,children:o.map((e,t)=>l(e,t))})}if(a===`horizontal`)return(0,r.jsx)(B,{className:(0,n.cn)(`overflow-x-auto [-webkit-overflow-scrolling:touch]`,t),...i,children:o.map((e,t)=>(0,r.jsxs)(V,{className:(0,n.cn)(e.className,c&&`cursor-pointer`),onClick:()=>c?.(e),children:[(0,r.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,r.jsx)(F,{variant:e.variant||`default`,children:e.icon&&(0,r.jsx)(`span`,{className:`text-xs`,children:e.icon})}),(0,r.jsxs)(`div`,{className:`mt-4 text-center`,children:[e.time&&(0,r.jsx)(R,{dateTime:e.time,children:x(e.time,s)}),e.title&&(0,r.jsx)(L,{children:e.title}),e.description&&(0,r.jsx)(z,{className:`text-center line-clamp-2 sm:line-clamp-none`,children:e.description}),e.content&&(0,n.renderChildren)(e.content)]})]}),t<o.length-1&&(0,r.jsx)(`div`,{className:`absolute left-full w-16 border-t-2 border-gray-200 top-3`})]},t))});if(a===`gantt`){let a=y(o),l=e.minDate||a.minDate,u=e.maxDate||a.maxDate,d=v(_(e),l,u);return(0,r.jsxs)(H,{className:(0,n.cn)(`overflow-x-auto [-webkit-overflow-scrolling:touch]`,t),...i,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(W,{className:`flex items-center px-2 sm:px-4 py-2 sm:py-3`,children:(0,r.jsx)(`span`,{className:`font-semibold text-xs sm:text-sm`,children:e.rowLabel||`Items`})}),(0,r.jsx)(G,{children:(0,r.jsx)(`div`,{className:`flex h-full`,children:d.map((e,t)=>(0,r.jsx)(`div`,{className:`flex-1 px-1 sm:px-2 py-2 sm:py-3 border-r text-xs font-medium text-center`,children:e},t))})})]}),(0,r.jsx)(`div`,{children:(0,r.jsxs)(`div`,{className:`flex`,children:[(0,r.jsx)(W,{children:o.map((e,t)=>(0,r.jsx)(K,{children:(0,r.jsx)(q,{title:e.label,className:`truncate`,children:e.label})},t))}),(0,r.jsx)(G,{className:`relative`,children:o.map((e,t)=>(0,r.jsx)(K,{className:`relative`,children:(e.items||[]).map((n,i)=>{let a=b(n.startDate,n.endDate,l,u);return(0,r.jsx)(J,{start:a.start,width:a.width,variant:n.variant||`default`,onClick:()=>c?.(n,e,t,i),title:`${n.title||``}\n${x(n.startDate,s)} - ${x(n.endDate,s)}`,children:(0,r.jsx)(Y,{children:n.title})},i)})},t))})]})})]})}return null};i.ComponentRegistry.register(`timeline`,w,{namespace:`plugin-timeline`,label:`Timeline`,category:`data-display`,inputs:[{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],label:`Timeline Variant`,defaultValue:`vertical`},{name:`items`,type:`array`,label:`Timeline Items`,description:`For vertical/horizontal: Array of { time, title, description, variant, icon, content }. For gantt: Array of { label, items: [{ title, startDate, endDate, variant }] }`},{name:`dateFormat`,type:`enum`,enum:[`short`,`long`,`iso`],label:`Date Format`,defaultValue:`short`},{name:`timeScale`,type:`enum`,enum:[`day`,`week`,`month`],label:`Time Scale (Gantt only)`,defaultValue:`month`},{name:`rowLabel`,type:`string`,label:`Row Label (Gantt only)`,defaultValue:`Items`},{name:`minDate`,type:`string`,label:`Min Date (Gantt only)`,description:`Override auto-calculated min date (YYYY-MM-DD)`},{name:`maxDate`,type:`string`,label:`Max Date (Gantt only)`,description:`Override auto-calculated max date (YYYY-MM-DD)`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{variant:`vertical`,dateFormat:`short`,items:[{time:`2024-01-15`,title:`Project Started`,description:`Kickoff meeting and initial planning`,variant:`success`,icon:`🚀`},{time:`2024-02-01`,title:`First Milestone`,description:`Completed initial design phase`,variant:`info`,icon:`🎨`},{time:`2024-03-15`,title:`Beta Release`,description:`Released beta version to testers`,variant:`warning`,icon:`⚡`},{time:`2024-04-01`,title:`Launch`,description:`Official product launch`,variant:`success`,icon:`🎉`}]},examples:{vertical:{variant:`vertical`,dateFormat:`long`,items:[{time:`2024-01-15`,title:`Project Started`,description:`Kickoff meeting and initial planning`,variant:`success`},{time:`2024-02-01`,title:`First Milestone`,description:`Completed initial design phase`,variant:`info`}]},horizontal:{variant:`horizontal`,dateFormat:`short`,items:[{time:`2024-01-01`,title:`Q1`,description:`First quarter`,variant:`default`},{time:`2024-04-01`,title:`Q2`,description:`Second quarter`,variant:`info`},{time:`2024-07-01`,title:`Q3`,description:`Third quarter`,variant:`warning`},{time:`2024-10-01`,title:`Q4`,description:`Fourth quarter`,variant:`success`}]},gantt:{variant:`gantt`,dateFormat:`short`,timeScale:`month`,rowLabel:`Projects`,items:[{label:`Backend Development`,items:[{title:`API Design`,startDate:`2024-01-01`,endDate:`2024-01-31`,variant:`success`},{title:`Implementation`,startDate:`2024-02-01`,endDate:`2024-03-31`,variant:`info`}]},{label:`Frontend Development`,items:[{title:`UI Design`,startDate:`2024-01-15`,endDate:`2024-02-15`,variant:`warning`},{title:`Component Dev`,startDate:`2024-02-15`,endDate:`2024-04-15`,variant:`default`}]},{label:`Testing`,items:[{title:`QA Phase`,startDate:`2024-03-01`,endDate:`2024-04-30`,variant:`danger`}]}]}}});var T=(0,c.createSafeTranslation)({"timeline.bucket.overdue":`Overdue`,"timeline.bucket.today":`Today`,"timeline.bucket.tomorrow":`Tomorrow`,"timeline.bucket.thisWeek":`This week`,"timeline.bucket.nextWeek":`Next week`,"timeline.bucket.later":`Later`,"timeline.bucket.noDate":`No date`,"timeline.bucket.unassigned":`Unassigned`,"timeline.relative.today":`Today`,"timeline.relative.tomorrow":`Tomorrow`,"timeline.relative.yesterday":`Yesterday`,"timeline.relative.inDays":`In {{n}} days`,"timeline.relative.daysAgo":`{{n}} days ago`},`timeline.bucket.today`),E={fieldOptionLabel:(e,t,n,r)=>r,translateOptions:(e,t,n)=>n,fieldLabel:(e,t,n)=>n};function D(){return(0,a.useObjectLabel)()??E}var O=s.z.object({title:s.z.string().optional(),date:s.z.string().optional(),description:s.z.string().optional(),variant:s.z.string().optional()}),k=s.z.object({mapping:O.optional(),objectName:s.z.string().optional(),titleField:s.z.string().optional(),dateField:s.z.string().optional(),startDateField:s.z.string().optional(),endDateField:s.z.string().optional(),descriptionField:s.z.string().optional(),groupByField:s.z.string().optional(),colorField:s.z.string().optional(),scale:s.z.enum([`hour`,`day`,`week`,`month`,`quarter`,`year`]).optional()}),A=({schema:e,dataSource:s,className:c,onRowClick:l,onItemClick:u,...d})=>{let[f,p]=(0,t.useState)([]),[m,h]=(0,t.useState)(()=>{let t=Array.isArray(e.items)&&e.items.length>0,n=Array.isArray(d.data)&&d.data.length>0;return!t&&!n&&!!e.objectName}),[g,_]=(0,t.useState)(null),[v,y]=(0,t.useState)(0),[b,x]=(0,t.useState)(null),S=e.timeline;(0,t.useEffect)(()=>{let t=k.safeParse(e);t.success||console.warn(`[ObjectTimeline] Invalid timeline configuration:`,t.error.format())},[e]);let C=(0,a.useDataScope)(e.bind);(0,t.useEffect)(()=>{let t=!0;return(async()=>{if(!(!s||typeof s.getObjectSchema!=`function`||!e.objectName))try{let n=await s.getObjectSchema(e.objectName);t&&x(n)}catch(e){console.warn(`Failed to fetch object def for ObjectTimeline`,e)}})(),()=>{t=!1}},[e.objectName,s]),(0,t.useEffect)(()=>{e.objectName&&!C&&!e.items&&!d.data?(async()=>{if(!s||typeof s.find!=`function`||!e.objectName){h(!1);return}h(!0);try{let t=(0,i.buildExpandFields)(b?.fields),n=(0,i.extractRecords)(await s.find(e.objectName,{options:{$top:100},...t.length>0?{$expand:t}:{}}));p(n)}catch(e){console.error(e),_(e)}finally{h(!1)}})():h(!1)},[e.objectName,s,C,e.items,d.data,v,b]);let E=d.data||C||f,{t:O}=T(),{fieldOptionLabel:A}=D(),j=S?.titleField??e.mapping?.title??e.titleField??`name`,M=S?.startDateField??e.mapping?.date??e.startDateField??e.dateField??`date`,N=S?.endDateField??e.endDateField??M,P=e.mapping?.description??e.descriptionField??`description`,F=e.mapping?.variant??`variant`,I=S?.groupByField??e.groupByField,L=S?.colorField??e.colorField,R=(0,t.useMemo)(()=>{if(e.items)return e.items;if(!E||!Array.isArray(E))return[];let t=b?.fields??{},n=e.objectName||``,r=e=>{if(!e||!t[e]?.options)return{};let n={};for(let r of t[e].options)r&&r.value!=null&&(n[String(r.value)]=r);return n},i=r(L),a=Array.isArray(S?.metaFields)?S.metaFields.filter(e=>typeof e==`string`&&e):[`status`,`priority`].filter(e=>t[e]),o={};for(let e of a)o[e]=r(e);let s=e=>{if(e==null||e===``)return;let t=i[String(e)];if(t?.color)return String(t.color);let n=String(e);if(/^#([0-9a-f]{3}){1,2}$/i.test(n)||n.startsWith(`rgb`)||n.startsWith(`hsl`))return n},c=(e,t,r)=>{if(t==null||t===``)return null;let i=r[String(t)];return{label:i?.label?A(n,e,String(t),i.label):String(t),color:i?.color}},l=E.map(e=>{let t=e[M],r=e[N],i=L?e[L]:void 0,l=I?e[I]:void 0,u=[];if(n)for(let t of a){let n=c(t,e[t],o[t]||{});n&&u.push({key:t,label:n.label,color:n.color})}return{title:e[j],time:t,startDate:t,endDate:r,description:e[P],variant:e[F]||`default`,color:s(i),group:l,meta:u,_data:e}});l.sort((e,t)=>(e.startDate?new Date(e.startDate).getTime():1/0)-(t.startDate?new Date(t.startDate).getTime():1/0));let u=new Date,d=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),f=d(u),p=864e5,m=f-(u.getDay()+6)%7*p+7*p,h=m+7*p,g=e=>{if(!e)return O(`timeline.bucket.noDate`);let t=d(new Date(e));return Number.isNaN(t)?O(`timeline.bucket.noDate`):t<f?O(`timeline.bucket.overdue`):t===f?O(`timeline.bucket.today`):t===f+p?O(`timeline.bucket.tomorrow`):O(t<m?`timeline.bucket.thisWeek`:t<h?`timeline.bucket.nextWeek`:`timeline.bucket.later`)};if(I&&!l.every(e=>e.group==null||e.group===``)){let e=r(I);return l.map(t=>{let n=c(I,t.group,e);return{...t,group:n?n.label:t.group!=null&&t.group!==``?String(t.group):O(`timeline.bucket.unassigned`)}})}return l.map(e=>({...e,group:g(e.startDate)}))},[e.items,E,b,e.objectName,j,M,N,P,F,L,I,O,A]),{ref:z,isRefreshing:B,pullDistance:V}=(0,o.usePullToRefresh)({onRefresh:(0,t.useCallback)(async()=>{y(e=>e+1)},[]),enabled:!!e.objectName&&!!s}),H=(0,a.useNavigationOverlay)({navigation:e.navigation,objectName:e.objectName,onRowClick:l??u}),U=S?.scale??e.scale,W={...e,items:R||[],className:c||e.className,...U?{timeScale:U}:{},onItemClick:e=>{let t=e._data||e;H.handleClick(t),u?.(t)}};return g?(0,r.jsxs)(`div`,{className:`p-4 text-destructive`,"data-testid":`timeline-error`,role:`alert`,children:[`Error loading timeline: `,g.message]}):m&&(!R||R.length===0)?(0,r.jsxs)(`div`,{className:`flex flex-col h-full min-h-[200px] p-4 gap-3`,"data-testid":`timeline-loading`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,r.jsx)(`span`,{className:`sr-only`,children:`Loading timeline…`}),[0,1,2,3].map(e=>(0,r.jsxs)(`div`,{className:`flex items-start gap-3`,style:{opacity:Math.max(.3,1-e*.18)},children:[(0,r.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-muted/70 animate-pulse mt-1.5 shrink-0`}),(0,r.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,r.jsx)(`div`,{className:`h-4 w-1/3 rounded bg-muted/70 animate-pulse`}),(0,r.jsx)(`div`,{className:`h-3 w-2/3 rounded bg-muted/50 animate-pulse`})]})]},e))]}):(0,r.jsxs)(`div`,{ref:z,className:`relative overflow-auto h-full min-w-0`,children:[V>0&&(0,r.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:V},children:B?`Refreshing…`:`Pull to refresh`}),(0,r.jsx)(w,{schema:W}),H.isOverlay&&(0,r.jsx)(n.NavigationOverlay,{...H,title:`Timeline Item`,children:e=>(0,r.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,r.jsxs)(`div`,{className:`flex flex-col`,children:[(0,r.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,r.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})},j=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`ol`,{ref:i,className:(0,n.cn)(`relative ml-3 border-l border-gray-200`,e),...t}));j.displayName=`Timeline`;var M=(0,n.cva)(`ml-6`,{variants:{density:{default:`mb-10`,compact:`mb-3`,comfortable:`mb-6`}},defaultVariants:{density:`default`}}),N=t.forwardRef(({className:e,density:t,...i},a)=>(0,r.jsx)(`li`,{ref:a,className:(0,n.cn)(M({density:t}),e),...i}));N.displayName=`TimelineItem`;var P=(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`}}),F=t.forwardRef(({className:e,variant:t=`default`,...i},a)=>(0,r.jsx)(`div`,{ref:a,className:(0,n.cn)(P({variant:t}),e),...i}));F.displayName=`TimelineMarker`;var I=t.forwardRef(({className:e,...t},n)=>(0,r.jsx)(`div`,{ref:n,className:e,...t}));I.displayName=`TimelineContent`;var L=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`h3`,{ref:i,className:(0,n.cn)(`font-semibold text-lg mb-1`,e),...t}));L.displayName=`TimelineTitle`;var R=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`time`,{ref:i,className:(0,n.cn)(`text-sm font-normal text-gray-500 mb-2 block`,e),...t}));R.displayName=`TimelineTime`;var z=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`p`,{ref:i,className:(0,n.cn)(`text-base text-gray-700`,e),...t}));z.displayName=`TimelineDescription`;var B=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`relative flex overflow-x-auto py-8`,e),...t}));B.displayName=`TimelineHorizontal`;var V=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`shrink-0 w-64 relative`,e),...t}));V.displayName=`TimelineHorizontalItem`;var H=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`relative w-full border rounded-lg overflow-hidden`,e),...t}));H.displayName=`TimelineGantt`;var U=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`flex border-b bg-gray-50`,e),...t}));U.displayName=`TimelineGanttHeader`;var W=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`w-48 border-r bg-white`,e),...t}));W.displayName=`TimelineGanttRowLabels`;var G=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`flex-1 overflow-x-auto`,e),...t}));G.displayName=`TimelineGanttGrid`;var K=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`flex items-center border-b min-h-12`,e),...t}));K.displayName=`TimelineGanttRow`;var q=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`px-4 py-2 font-medium text-sm truncate`,e),...t}));q.displayName=`TimelineGanttLabel`;var J=t.forwardRef(({className:e,start:t=0,width:i=100,variant:a=`default`,...o},s)=>(0,r.jsx)(`div`,{ref:s,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`}[a],e),style:{left:`${t}%`,width:`${i}%`},...o}));J.displayName=`TimelineGanttBar`;var Y=t.forwardRef(({className:e,...t},i)=>(0,r.jsx)(`div`,{ref:i,className:(0,n.cn)(`px-2 py-1 text-white text-xs font-medium truncate`,e),...t}));Y.displayName=`TimelineGanttBarContent`;var X=({schema:e,...t})=>{let{dataSource:n}=(0,a.useSchemaContext)()||{};return(0,r.jsx)(A,{schema:e,dataSource:n,...t})};i.ComponentRegistry.register(`object-timeline`,X,{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`}]}),i.ComponentRegistry.register(`timeline`,X,{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=A,e.ObjectTimelineRenderer=X,e.TIMELINE_SCALES=g,e.Timeline=j,e.TimelineContent=I,e.TimelineDescription=z,e.TimelineGantt=H,e.TimelineGanttBar=J,e.TimelineGanttBarContent=Y,e.TimelineGanttGrid=G,e.TimelineGanttHeader=U,e.TimelineGanttLabel=q,e.TimelineGanttRow=K,e.TimelineGanttRowLabels=W,e.TimelineHorizontal=B,e.TimelineHorizontalItem=V,e.TimelineItem=N,e.TimelineMarker=F,e.TimelineRenderer=w,e.TimelineTime=R,e.TimelineTitle=L,e.generateTimeScaleHeaders=v,e.resolveTimelineScale=_,e.timelineItemVariants=M,e.timelineMarkerVariants=P});
@@ -7,6 +7,31 @@ import { TimelineSchema } from '@object-ui/types';
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
9
  import * as React from 'react';
10
+ /**
11
+ * The spec's timeline scale vocabulary (`ui/view.zod.ts`
12
+ * `TimelineConfigSchema.scale`). Exported for the spec-parity test.
13
+ */
14
+ export declare const TIMELINE_SCALES: ReadonlySet<string>;
15
+ /**
16
+ * Resolve the axis scale for the gantt variant. The spec key is `scale`;
17
+ * `timeScale` is this renderer's pre-spec dialect, kept for stored JSON —
18
+ * before #2942 ONLY `timeScale` was read, so every spec-authored `scale`
19
+ * (all six values) was silently ignored. An absent/unknown value keeps the
20
+ * renderer's historical `month` default. The `vertical` / `horizontal`
21
+ * variants are sequential event feeds with no time axis, so `scale` has
22
+ * nothing to bucket there by construction.
23
+ */
24
+ export declare function resolveTimelineScale(schema: {
25
+ scale?: unknown;
26
+ timeScale?: unknown;
27
+ }): string;
28
+ /**
29
+ * Gantt header labels for one scale across [minDate, maxDate]. Every spec
30
+ * scale produces a non-empty header row — `hour` / `quarter` / `year` used to
31
+ * fall through the month/week/day chain and return `[]`, blanking the axis
32
+ * (#2942). Exported for the spec-parity test.
33
+ */
34
+ export declare function generateTimeScaleHeaders(scale: string, minDate: string, maxDate: string): string[];
10
35
  export declare const TimelineRenderer: ({ schema, className, ...props }: {
11
36
  schema: TimelineSchema;
12
37
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAmHvD,eAAO,MAAM,gBAAgB,GAAI,iCAAiC;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,6BAoQjI,CAAC"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuBvD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAE9C,CAAC;AAEH;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAG7F;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAoDlG;AA4FD,eAAO,MAAM,gBAAgB,GAAI,iCAAiC;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,6BA+NjI,CAAC"}
@@ -12,11 +12,16 @@
12
12
  * embed) without an I18nProvider on the React tree.
13
13
  */
14
14
  export declare const TIMELINE_DEFAULT_TRANSLATIONS: Record<string, string>;
15
- declare function fallback(key: string, options?: Record<string, unknown>): string;
16
- export declare function useTimelineTranslation(): {
17
- t: typeof fallback;
15
+ /**
16
+ * Was a local re-implementation that wrapped the hook in try/catch — a
17
+ * rules-of-hooks violation (objectui#2879, same class as #2595/#2596).
18
+ * `useObjectTranslation` is provider-safe, so the probe alone is enough.
19
+ */
20
+ export declare const useTimelineTranslation: () => {
21
+ t: (key: string, options?: Record<string, unknown>) => string;
22
+ language: string;
18
23
  } | {
19
24
  t: import('i18next').TFunction<string, undefined>;
25
+ language: string;
20
26
  };
21
- export {};
22
27
  //# sourceMappingURL=useTimelineTranslation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTimelineTranslation.d.ts","sourceRoot":"","sources":["../src/useTimelineTranslation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAchE,CAAC;AAIF,iBAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAQxE;AAED,wBAAgB,sBAAsB;;;;EAWrC"}
1
+ {"version":3,"file":"useTimelineTranslation.d.ts","sourceRoot":"","sources":["../src/useTimelineTranslation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAchE,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;4BAlClC,CAAC;;;;;CAqCD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-timeline",
3
- "version": "16.1.0",
3
+ "version": "17.1.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Timeline component plugin for Object UI",
@@ -24,14 +24,15 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@objectstack/spec": "^16.0.0-rc.0",
27
+ "@objectstack/spec": "^17.0.0-rc.0",
28
28
  "class-variance-authority": "^0.7.1",
29
29
  "zod": "^4.4.3",
30
- "@object-ui/components": "16.1.0",
31
- "@object-ui/core": "16.1.0",
32
- "@object-ui/mobile": "16.1.0",
33
- "@object-ui/react": "16.1.0",
34
- "@object-ui/types": "16.1.0"
30
+ "@object-ui/components": "17.1.0",
31
+ "@object-ui/core": "17.1.0",
32
+ "@object-ui/i18n": "17.1.0",
33
+ "@object-ui/mobile": "17.1.0",
34
+ "@object-ui/react": "17.1.0",
35
+ "@object-ui/types": "17.1.0"
35
36
  },
36
37
  "peerDependencies": {
37
38
  "react": "^18.0.0 || ^19.0.0",
@@ -40,11 +41,11 @@
40
41
  "devDependencies": {
41
42
  "@types/react": "19.2.17",
42
43
  "@types/react-dom": "19.2.3",
43
- "@vitejs/plugin-react": "^6.0.3",
44
+ "@vitejs/plugin-react": "^6.0.4",
44
45
  "typescript": "^6.0.3",
45
46
  "vite": "^8.1.5",
46
47
  "vite-plugin-dts": "^5.0.3",
47
- "@object-ui/data-objectstack": "16.1.0"
48
+ "@object-ui/data-objectstack": "17.1.0"
48
49
  },
49
50
  "keywords": [
50
51
  "objectui",
@@ -73,7 +74,7 @@
73
74
  "build": "vite build",
74
75
  "test": "vitest run",
75
76
  "test:watch": "vitest",
76
- "type-check": "tsc --noEmit",
77
+ "type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
77
78
  "lint": "eslint ."
78
79
  }
79
80
  }