@declarion/react 0.446.0 → 0.516.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.
Files changed (43) hide show
  1. package/dist-lib/components/agents/AgentChatPanel.impl.js +349 -332
  2. package/dist-lib/components/detail-layout/DetailAuditStrip.js +1 -1
  3. package/dist-lib/components/detail-layout/EvidenceBlock.js +36 -24
  4. package/dist-lib/components/detail-layout/FieldRow.js +56 -60
  5. package/dist-lib/components/detail-layout/FieldsBlock.js +48 -47
  6. package/dist-lib/components/detail-layout/PropertiesBlock.js +42 -41
  7. package/dist-lib/components/detail-layout/labelLayout.js +35 -0
  8. package/dist-lib/components/fields/JsonField.js +128 -125
  9. package/dist-lib/components/fields/StringField.js +10 -25
  10. package/dist-lib/components/fields/StructureField.js +125 -167
  11. package/dist-lib/components/fields/ValueRows.js +114 -0
  12. package/dist-lib/components/fields/cells/factories/id.js +10 -0
  13. package/dist-lib/components/fields/cells/factories/nextRun.js +18 -27
  14. package/dist-lib/components/fields/cells/factories/refLink.js +15 -41
  15. package/dist-lib/components/fields/cells/registry.js +25 -23
  16. package/dist-lib/components/file-widgets/DocumentCard.js +142 -142
  17. package/dist-lib/components/file-widgets/helpers.js +32 -19
  18. package/dist-lib/components/file-widgets/host.js +4 -1
  19. package/dist-lib/components/list/PeekFieldCell.js +57 -55
  20. package/dist-lib/components/list/QuickPeek.js +109 -121
  21. package/dist-lib/components/pages/SmartDetailPage.impl.js +403 -400
  22. package/dist-lib/components/pages/SmartListPage.impl.js +260 -260
  23. package/dist-lib/components/pages/list/ListCardRow.js +101 -100
  24. package/dist-lib/components/pages/list/cardProjection.js +117 -112
  25. package/dist-lib/components/pages/list/useListQuery.js +1 -1
  26. package/dist-lib/components/pages/list/useListRowInteraction.js +68 -65
  27. package/dist-lib/components/primitives/IdBadge.js +27 -0
  28. package/dist-lib/components/primitives/RowField.js +11 -43
  29. package/dist-lib/components/shared/CopyButton.js +13 -18
  30. package/dist-lib/components/shared/RefChip.js +33 -0
  31. package/dist-lib/declarion-react.css +1 -1
  32. package/dist-lib/hooks/useAgentConversation.js +134 -110
  33. package/dist-lib/hooks/useCopy.js +18 -0
  34. package/dist-lib/index.d.ts +55 -20
  35. package/dist-lib/index.js +116 -111
  36. package/dist-lib/lib/realtime-reconcile.js +70 -59
  37. package/dist-lib/lib/reference.js +52 -34
  38. package/dist-lib/lib/short-id.js +12 -0
  39. package/dist-lib/testing.d.ts +1 -1
  40. package/dist-lib/types/schema.js +84 -80
  41. package/dist-lib/{useResponsiveMode-3hOLBkey.d.ts → useResponsiveMode-BObVfNyN.d.ts} +7 -2
  42. package/package.json +1 -1
  43. package/dist-lib/components/primitives/RecordIdBadge.js +0 -25
@@ -57,38 +57,38 @@ var n = 4, r = 2, i = 2, a = [
57
57
  ]);
58
58
  function f(e) {
59
59
  let { entity: t, screen: n, savedViewColumns: r } = e, i = n?.card;
60
- if (i) return v(t, i, "screen_card");
61
- if (t?.card) return v(t, t.card, "entity_card");
62
- let a = x(t, n, r);
63
- return y(t, a.columns, a.source);
60
+ if (i) return y(t, i, "screen_card");
61
+ if (t?.card) return y(t, t.card, "entity_card");
62
+ let a = S(t, n, r);
63
+ return b(t, a.columns, a.source);
64
64
  }
65
65
  function p(e) {
66
- let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new Q(), p = r === "cards" ? a.renderFields : C(t, i, { explicit: !0 }), _ = r === "cards" ? g(t, n) : [];
67
- for (let e of p) f.addField(e, "render"), J(t, e, f, "render");
68
- for (let e of _) p.includes(e) || (f.addField(e, "variant"), J(t, e, f, "variant"));
69
- let v = F(t, f), y = P(t, f), b = B(t, [
66
+ let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new $(), p = r === "cards" ? a.renderFields : w(t, i, { explicit: !0 }), _ = r === "cards" ? g(t, n) : [];
67
+ for (let e of p) f.addField(e, "render"), Y(t, e, f, "render");
68
+ for (let e of _) p.includes(e) || (f.addField(e, "variant"), Y(t, e, f, "variant"));
69
+ let v = I(t, f), y = F(t, f), b = V(t, [
70
70
  o,
71
71
  s,
72
72
  c
73
- ], f), x = h(t, n, f), S = V(t, l, f), w = H(t, n, d, f), T = m(t, [
73
+ ], f), x = h(t, n, f), S = H(t, l, f), C = U(t, n, d, f), T = m(t, [
74
74
  p,
75
75
  _,
76
- w
76
+ C
77
77
  ], f);
78
78
  if (u) for (let e of v) f.addField(e, "detail_handoff");
79
- let E = new Z();
79
+ let E = new Q();
80
80
  for (let e of v) E.add(e);
81
81
  for (let e of y) E.add(e);
82
82
  for (let e of b) E.add(e);
83
83
  for (let e of x) E.add(e);
84
84
  for (let e of _) E.add(e);
85
85
  for (let e of S) E.add(e);
86
- for (let e of w) E.add(e);
86
+ for (let e of C) E.add(e);
87
87
  for (let e of T) E.add(e);
88
- let D = new Z();
89
- for (let e of p) q(t, e, D, f);
90
- for (let e of E.values()) q(t, e, D, f);
91
- let O = D.values(), k = Y(f);
88
+ let D = new Q();
89
+ for (let e of p) J(t, e, D, f);
90
+ for (let e of E.values()) J(t, e, D, f);
91
+ let O = D.values(), k = X(f);
92
92
  return {
93
93
  renderFields: p,
94
94
  dependencyFields: E.values().filter((e) => !p.includes(e)),
@@ -101,15 +101,15 @@ function p(e) {
101
101
  };
102
102
  }
103
103
  function m(e, t, n) {
104
- let r = new Z();
104
+ let r = new Q();
105
105
  for (let i of t.flat()) {
106
- let t = X(e, i), a = t.kind === "field" ? t.field.display?.currency_field : void 0;
106
+ let t = Z(e, i), a = t.kind === "field" ? t.field.display?.currency_field : void 0;
107
107
  a && (r.add(a), n.addField(a, "currency"));
108
108
  }
109
109
  return r.values();
110
110
  }
111
111
  function h(e, t, n) {
112
- let r = new Z(), i = (t) => {
112
+ let r = new Q(), i = (t) => {
113
113
  for (let n of t) n.and ? i(n.and) : n.or ? i(n.or) : n.field && e?.fields.has(n.field) && r.add(n.field);
114
114
  };
115
115
  for (let t of e?.variants?.items() ?? []) t.when && i(t.when);
@@ -118,7 +118,7 @@ function h(e, t, n) {
118
118
  return r.values();
119
119
  }
120
120
  function g(e, t, n) {
121
- let r = new Z();
121
+ let r = new Q();
122
122
  for (let i of f({
123
123
  entity: e,
124
124
  screen: t,
@@ -138,19 +138,24 @@ function g(e, t, n) {
138
138
  function _(e, t, n) {
139
139
  if (!e || t?.on_row_click !== "peek" || t.quick_peek?.enabled === !1) return [];
140
140
  let r = t.quick_peek?.fields;
141
- if (r && r.length > 0) return C(e, r, { explicit: !0 });
141
+ if (r && r.length > 0) return w(e, r.map((e) => e.code), { explicit: !0 });
142
142
  let i = t.quick_peek?.sections;
143
143
  if (i && i.length > 0) {
144
- let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new Z();
145
- U(r?.items, new Set(i.map(String)), a);
146
- let o = C(e, a.values(), { explicit: !0 });
144
+ let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new Q();
145
+ W(r?.items, new Set(i.map(String)), a);
146
+ let o = w(e, a.values(), { explicit: !0 });
147
147
  if (o.length > 0) return o;
148
148
  }
149
- return K(e);
149
+ return q(e);
150
150
  }
151
- function v(e, t, r) {
152
- let i = t.max_body_fields ?? n, a = w(e, t.title_field, { explicit: !0 }), o = w(e, t.subtitle_field, { explicit: !0 }), s = C(e, t.badge_fields ?? [], { explicit: !0 }), c = C(e, t.fields ?? [], { explicit: !0 }), l = C(e, t.meta_fields ?? [], { explicit: !0 });
153
- return b({
151
+ function v(e) {
152
+ let t = /* @__PURE__ */ new Map();
153
+ for (let n of e?.quick_peek?.fields ?? []) n.structure && t.set(n.code, n.structure);
154
+ return t;
155
+ }
156
+ function y(e, t, r) {
157
+ let i = t.max_body_fields ?? n, a = T(e, t.title_field, { explicit: !0 }), o = T(e, t.subtitle_field, { explicit: !0 }), s = w(e, t.badge_fields ?? [], { explicit: !0 }), c = w(e, t.fields ?? [], { explicit: !0 }), l = w(e, t.meta_fields ?? [], { explicit: !0 });
158
+ return x({
154
159
  source: r,
155
160
  explicit: !0,
156
161
  titleField: a,
@@ -163,29 +168,29 @@ function v(e, t, r) {
163
168
  maxBodyFields: i
164
169
  });
165
170
  }
166
- function y(e, t, a) {
167
- let o = C(e, t, { explicit: !1 }), s = n, c = w(e, e?.display?.display_field, { explicit: !1 }), l = c ?? T(e, o, {
171
+ function b(e, t, a) {
172
+ let o = w(e, t, { explicit: !1 }), s = n, c = T(e, e?.display?.display_field, { explicit: !1 }), l = c ?? E(e, o, {
168
173
  allowLong: !1,
169
174
  allowAuto: !1
170
- }), u = c !== void 0, d = l ? /* @__PURE__ */ new Set([l]) : void 0, f = o.find((t) => !d?.has(t) && D(e, t)), p = new Set([l, f].filter((e) => !!e)), m = k(e, o).filter((e) => !p.has(e)).slice(0, r);
175
+ }), u = c !== void 0, d = l ? /* @__PURE__ */ new Set([l]) : void 0, f = o.find((t) => !d?.has(t) && O(e, t)), p = new Set([l, f].filter((e) => !!e)), m = A(e, o).filter((e) => !p.has(e)).slice(0, r);
171
176
  for (let e of m) p.add(e);
172
- let h = o.filter((t) => !p.has(t) && A(e, t)).slice(0, i);
177
+ let h = o.filter((t) => !p.has(t) && j(e, t)).slice(0, i);
173
178
  for (let e of h) p.add(e);
174
- return b({
179
+ return x({
175
180
  source: a,
176
181
  explicit: !1,
177
182
  titleField: l,
178
183
  titleUsesDisplay: u,
179
184
  subtitleField: f,
180
185
  badgeFields: m,
181
- bodyFields: o.filter((t) => !p.has(t) && E(e, t)).slice(0, s),
186
+ bodyFields: o.filter((t) => !p.has(t) && D(e, t)).slice(0, s),
182
187
  metaFields: h,
183
188
  hideEmptyFields: !0,
184
189
  maxBodyFields: s
185
190
  });
186
191
  }
187
- function b(e) {
188
- let t = new Z(), n = [], r = (r, i) => {
192
+ function x(e) {
193
+ let t = new Q(), n = [], r = (r, i) => {
189
194
  r && !t.has(r) && (t.add(r), n.push({
190
195
  field: r,
191
196
  bucket: i,
@@ -212,7 +217,7 @@ function b(e) {
212
217
  sourcePrecedence: a
213
218
  };
214
219
  }
215
- function x(e, t, n) {
220
+ function S(e, t, n) {
216
221
  return n && n.length > 0 ? {
217
222
  source: "saved_view_columns",
218
223
  columns: n
@@ -224,10 +229,10 @@ function x(e, t, n) {
224
229
  columns: t.columns
225
230
  } : {
226
231
  source: "entity_inference",
227
- columns: S(e)
232
+ columns: C(e)
228
233
  };
229
234
  }
230
- function S(e) {
235
+ function C(e) {
231
236
  if (!e) return [];
232
237
  let t = [];
233
238
  e.display.display_field && t.push(e.display.display_field);
@@ -237,15 +242,15 @@ function S(e) {
237
242
  if (e.evidence_covered && t.push("$evidence"), e.files) for (let [n] of e.files) t.push(n);
238
243
  return t;
239
244
  }
240
- function C(e, t, n) {
241
- let r = new Z();
245
+ function w(e, t, n) {
246
+ let r = new Q();
242
247
  for (let i of t) {
243
- let t = w(e, i, n);
248
+ let t = T(e, i, n);
244
249
  t && r.add(t);
245
250
  }
246
251
  return r.values();
247
252
  }
248
- function w(e, t, n) {
253
+ function T(e, t, n) {
249
254
  if (!t || o.has(t)) return;
250
255
  if (!e) return t.startsWith("$") ? void 0 : t;
251
256
  if (t.startsWith("$status.")) {
@@ -261,63 +266,63 @@ function w(e, t, n) {
261
266
  let r = e.fields.get(t), i = e.files?.get(t);
262
267
  if ((r || i) && (n.explicit || !(r && r.display?.is_listable === !1) && !(i && i.display?.is_listable === !1))) return t;
263
268
  }
264
- function T(e, t, n) {
265
- return t.find((t) => n.exclude?.has(t) || !n.allowAuto && M(e, t) || !n.allowLong && N(e, t) ? !1 : j(e, t));
266
- }
267
- function E(e, t) {
268
- return !(!j(e, t) || M(e, t) || N(e, t));
269
+ function E(e, t, n) {
270
+ return t.find((t) => n.exclude?.has(t) || !n.allowAuto && N(e, t) || !n.allowLong && P(e, t) ? !1 : M(e, t));
269
271
  }
270
272
  function D(e, t) {
271
- if (M(e, t)) return !1;
272
- let n = X(e, t);
273
- return n.kind === "field" && u.has(n.field.type);
273
+ return !(!M(e, t) || N(e, t) || P(e, t));
274
274
  }
275
275
  function O(e, t) {
276
+ if (N(e, t)) return !1;
277
+ let n = Z(e, t);
278
+ return n.kind === "field" && u.has(n.field.type);
279
+ }
280
+ function k(e, t) {
276
281
  if (t.startsWith("$status.") || t.startsWith("$property.") || t === "$evidence") return !0;
277
- let n = X(e, t);
282
+ let n = Z(e, t);
278
283
  return n.kind === "field" && c.has(n.field.type);
279
284
  }
280
- function k(e, t) {
281
- let n = new Z();
285
+ function A(e, t) {
286
+ let n = new Q();
282
287
  for (let e of t) (e.startsWith("$status.") || e.startsWith("$property.") || e === "$evidence") && n.add(e);
283
- for (let r of t) O(e, r) && n.add(r);
288
+ for (let r of t) k(e, r) && n.add(r);
284
289
  return n.values();
285
290
  }
286
- function A(e, t) {
287
- if (M(e, t)) return !1;
288
- let n = X(e, t);
289
- return n.kind === "field" && l.has(n.field.type);
290
- }
291
291
  function j(e, t) {
292
- return X(e, t).kind !== "missing";
292
+ if (N(e, t)) return !1;
293
+ let n = Z(e, t);
294
+ return n.kind === "field" && l.has(n.field.type);
293
295
  }
294
296
  function M(e, t) {
295
- let n = X(e, t);
296
- return n.kind === "field" && (n.field.primary === !0 || n.field.auto === !0);
297
+ return Z(e, t).kind !== "missing";
297
298
  }
298
299
  function N(e, t) {
299
- let n = X(e, t);
300
- return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" && s.has(n.field.type);
300
+ let n = Z(e, t);
301
+ return n.kind === "field" && (n.field.primary === !0 || n.field.auto === !0);
301
302
  }
302
303
  function P(e, t) {
304
+ let n = Z(e, t);
305
+ return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" && s.has(n.field.type);
306
+ }
307
+ function F(e, t) {
303
308
  let n = e?.tenant_key;
304
- return !n || X(e, n).kind === "missing" ? [] : (t.addField(n, "row_tenant"), [n]);
309
+ return !n || Z(e, n).kind === "missing" ? [] : (t.addField(n, "row_tenant"), [n]);
305
310
  }
306
- function F(e, n) {
311
+ function I(e, n) {
307
312
  if (!e) return [];
308
- let r = new Z();
313
+ let r = new Q();
309
314
  for (let i of t(e)) r.add(i), n.addField(i, "identity");
310
- let i = w(e, e.display.display_field, { explicit: !0 });
311
- i && (r.add(i), n.addField(i, "display"), J(e, i, n, "display"));
312
- for (let t of I(e.display.display_template)) {
313
- let i = w(e, t, { explicit: !0 });
314
- i && (r.add(i), n.addField(i, "display_template"), J(e, i, n, "display_template"));
315
+ let i = T(e, e.display.display_field, { explicit: !0 });
316
+ i && (r.add(i), n.addField(i, "display"), Y(e, i, n, "display"));
317
+ for (let t of L(e.display.display_template)) {
318
+ let i = T(e, t, { explicit: !0 });
319
+ i && (r.add(i), n.addField(i, "display_template"), Y(e, i, n, "display_template"));
315
320
  }
316
321
  return r.values();
317
322
  }
318
- function I(e) {
323
+ function L(e) {
319
324
  if (!e) return [];
320
- let t = new Z(), n = 0;
325
+ let t = new Q(), n = 0;
321
326
  for (; n < e.length;) {
322
327
  let r = e.indexOf("${", n);
323
328
  if (r < 0) break;
@@ -325,14 +330,14 @@ function I(e) {
325
330
  n = r + 2;
326
331
  continue;
327
332
  }
328
- let i = L(e, r + 2);
333
+ let i = R(e, r + 2);
329
334
  if (i < 0) break;
330
- for (let n of R(e.slice(r + 2, i))) t.add(n);
335
+ for (let n of z(e.slice(r + 2, i))) t.add(n);
331
336
  n = i + 1;
332
337
  }
333
338
  return t.values();
334
339
  }
335
- function L(e, t) {
340
+ function R(e, t) {
336
341
  let n = 0;
337
342
  for (let r = t; r < e.length; r += 1) {
338
343
  let t = e[r];
@@ -344,46 +349,46 @@ function L(e, t) {
344
349
  }
345
350
  return -1;
346
351
  }
347
- function R(e) {
348
- let t = new Z(), n = 0;
352
+ function z(e) {
353
+ let t = new Q(), n = 0;
349
354
  for (; n < e.length;) {
350
355
  let r = e.indexOf("row.", n);
351
356
  if (r < 0) break;
352
- if (r > 0 && z(e.charCodeAt(r - 1))) {
357
+ if (r > 0 && B(e.charCodeAt(r - 1))) {
353
358
  n = r + 4;
354
359
  continue;
355
360
  }
356
361
  let i = r + 4, a = i;
357
- for (; a < e.length && z(e.charCodeAt(a));) a += 1;
362
+ for (; a < e.length && B(e.charCodeAt(a));) a += 1;
358
363
  a > i && t.add(e.slice(i, a)), n = a;
359
364
  }
360
365
  return t.values();
361
366
  }
362
- function z(e) {
367
+ function B(e) {
363
368
  return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 95;
364
369
  }
365
- function B(e, t, n) {
366
- let r = new Z();
370
+ function V(e, t, n) {
371
+ let r = new Q();
367
372
  for (let i of t) for (let t of i ?? []) for (let i of [
368
373
  ...t.action.visible_if ?? [],
369
374
  ...t.action.enabled_if ?? [],
370
375
  ...t.action.conditions ?? []
371
376
  ]) {
372
- let t = w(e, i.field, { explicit: !0 });
373
- t && (r.add(t), n.addField(t, "condition"), J(e, t, n, "condition"));
377
+ let t = T(e, i.field, { explicit: !0 });
378
+ t && (r.add(t), n.addField(t, "condition"), Y(e, t, n, "condition"));
374
379
  }
375
380
  return r.values();
376
381
  }
377
- function V(t, n, r) {
378
- let i = typeof n == "string" ? e(n) : n ?? [], a = new Z();
382
+ function H(t, n, r) {
383
+ let i = typeof n == "string" ? e(n) : n ?? [], a = new Q();
379
384
  for (let e of i) {
380
- let n = w(t, e.field, { explicit: !0 });
381
- n && (a.add(n), r.addField(n, "sort"), J(t, n, r, "sort"));
385
+ let n = T(t, e.field, { explicit: !0 });
386
+ n && (a.add(n), r.addField(n, "sort"), Y(t, n, r, "sort"));
382
387
  }
383
388
  return a.values();
384
389
  }
385
- function H(e, t, n, r) {
386
- let i = new Z(), a = t?.variants?.items() ?? [];
390
+ function U(e, t, n, r) {
391
+ let i = new Q(), a = t?.variants?.items() ?? [];
387
392
  if (a.length === 0 || a.some((e) => e.quick_peek === void 0)) for (let r of _(e, t, n)) i.add(r);
388
393
  for (let r of a) {
389
394
  if (r.quick_peek === void 0) continue;
@@ -393,20 +398,20 @@ function H(e, t, n, r) {
393
398
  };
394
399
  for (let t of _(e, a, n)) i.add(t);
395
400
  }
396
- for (let t of i.values()) r.addField(t, "quick_peek"), J(e, t, r, "quick_peek");
401
+ for (let t of i.values()) r.addField(t, "quick_peek"), Y(e, t, r, "quick_peek");
397
402
  return i.values();
398
403
  }
399
- function U(e, t, n) {
404
+ function W(e, t, n) {
400
405
  if (Array.isArray(e)) {
401
406
  for (let r of e) if (r && typeof r == "object") {
402
407
  if ("section" in r) {
403
- let e = r.section, i = G(e?.name);
404
- i && t.has(i) && W(e?.items, n);
405
- } else "fields" in r && W([r], n);
408
+ let e = r.section, i = K(e?.name);
409
+ i && t.has(i) && G(e?.items, n);
410
+ } else "fields" in r && G([r], n);
406
411
  }
407
412
  }
408
413
  }
409
- function W(e, t) {
414
+ function G(e, t) {
410
415
  if (Array.isArray(e)) {
411
416
  for (let n of e) if (n && typeof n == "object") {
412
417
  if ("fields" in n) {
@@ -419,11 +424,11 @@ function W(e, t) {
419
424
  }
420
425
  }
421
426
  }
422
- "section" in n && W(n.section?.items, t);
427
+ "section" in n && G(n.section?.items, t);
423
428
  }
424
429
  }
425
430
  }
426
- function G(e) {
431
+ function K(e) {
427
432
  if (typeof e == "string") return e;
428
433
  if (e && typeof e == "object") {
429
434
  let t = Object.values(e).find((e) => typeof e == "string");
@@ -431,7 +436,7 @@ function G(e) {
431
436
  }
432
437
  return "";
433
438
  }
434
- function K(e) {
439
+ function q(e) {
435
440
  let t = [];
436
441
  for (let [n, r] of e.fields) {
437
442
  if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
@@ -440,12 +445,12 @@ function K(e) {
440
445
  }
441
446
  return t;
442
447
  }
443
- function q(e, t, n, r) {
448
+ function J(e, t, n, r) {
444
449
  if (!t || t.startsWith("$")) return;
445
- let i = X(e, t);
450
+ let i = Z(e, t);
446
451
  i.kind !== "missing" && (n.add(t), i.kind === "file" && r.addField(t, "file_metadata"));
447
452
  }
448
- function J(e, t, n, r) {
453
+ function Y(e, t, n, r) {
449
454
  if (t.startsWith("$status.")) {
450
455
  n.addExpand("statuses", "status_expand"), r !== "status_expand" && n.addExpand("statuses", r), r !== "status_expand" && n.addField(t, r);
451
456
  return;
@@ -460,14 +465,14 @@ function J(e, t, n, r) {
460
465
  n.addExpand("evidence", "evidence_expand"), r !== "evidence_expand" && n.addExpand("evidence", r), r !== "evidence_expand" && n.addField(t, r);
461
466
  return;
462
467
  }
463
- let i = X(e, t);
464
- i.kind === "field" && i.field.type === "ref" && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
468
+ let i = Z(e, t), a = i.kind === "file" ? i.file : i.kind === "field" ? i.field.files : void 0;
469
+ (i.kind === "field" && i.field.type === "ref" || a?.attachment_fields) && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
465
470
  }
466
- function Y(e) {
471
+ function X(e) {
467
472
  let t = e.snapshot().expand, n = [];
468
473
  return t.refs && n.push("refs"), t.statuses && n.push("statuses"), t.properties && n.push("properties"), t.evidence && n.push("evidence"), n;
469
474
  }
470
- function X(e, t) {
475
+ function Z(e, t) {
471
476
  if (!e) return { kind: t.startsWith("$") ? "synthetic" : "missing" };
472
477
  if (t.startsWith("$status.")) return e.status_groups?.[t.slice(8)] ? { kind: "synthetic" } : { kind: "missing" };
473
478
  if (t.startsWith("$property.")) return e.properties?.[t.slice(10)] ? { kind: "synthetic" } : { kind: "missing" };
@@ -483,7 +488,7 @@ function X(e, t) {
483
488
  file: r
484
489
  } : { kind: "missing" };
485
490
  }
486
- var Z = class {
491
+ var Q = class {
487
492
  #e = [];
488
493
  #t = /* @__PURE__ */ new Set();
489
494
  add(e) {
@@ -495,7 +500,7 @@ var Z = class {
495
500
  values() {
496
501
  return [...this.#e];
497
502
  }
498
- }, Q = class {
503
+ }, $ = class {
499
504
  #e = /* @__PURE__ */ new Map();
500
505
  #t = /* @__PURE__ */ new Map();
501
506
  addField(e, t) {
@@ -515,4 +520,4 @@ var Z = class {
515
520
  r ? r.includes(n) || r.push(n) : e.set(t, [n]);
516
521
  }
517
522
  };
518
- export { I as extractDisplayTemplateFields, f as resolveCard, p as resolveListProjection, _ as resolveQuickPeekFieldNames, g as resolveVariantRenderFields };
523
+ export { L as extractDisplayTemplateFields, v as quickPeekFieldStructures, f as resolveCard, p as resolveListProjection, _ as resolveQuickPeekFieldNames, g as resolveVariantRenderFields };
@@ -2,7 +2,7 @@ import { entityCountQueryKey as e, entityDataQueryKey as t, entityDataQueryOptio
2
2
  import { cursorEntityDataQueryKey as a, useCursorEntityData as o } from "../../../hooks/useCursorEntityData.js";
3
3
  import { useRegisterRetainedQuery as s } from "../../../hooks/usePageStateRuntime.js";
4
4
  import { correctEstimateAgainstWindow as c } from "../../../lib/format-count.js";
5
- import { bindRowReferences as l } from "../../../lib/reference.js";
5
+ import { bindUnboundRowReferences as l } from "../../../lib/reference.js";
6
6
  import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
7
7
  import { useQueryClient as m } from "@tanstack/react-query";
8
8
  // src/components/pages/list/useListQuery.ts
@@ -6,116 +6,119 @@ import { coerceDisplayString as a } from "../../../lib/display-value.js";
6
6
  import { classifyRowClick as o, isInteractiveRowTarget as s } from "../../../lib/rowClickGesture.js";
7
7
  import { effectiveScreenForRecord as c } from "../../../lib/variants.js";
8
8
  import { buildEntityDetailHref as l, extractPkValues as u, fieldDisplayName as d, getDisplayValue as f, isUserEditableField as p, pkValuesToDetailId as m, rowSetInTenant as h } from "../../../types/schema.js";
9
- import { resolveQuickPeekFieldNames as g } from "./cardProjection.js";
10
- import { rowSelectionKey as _ } from "./useListSelection.js";
11
- import { useText as v } from "../../../hooks/useText.js";
12
- import { useRowTenant as y } from "../../../hooks/useRowTenant.js";
13
- import { useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as w } from "react";
9
+ import { quickPeekFieldStructures as g, resolveQuickPeekFieldNames as _ } from "./cardProjection.js";
10
+ import { rowSelectionKey as v } from "./useListSelection.js";
11
+ import { useText as y } from "../../../hooks/useText.js";
12
+ import { useRowTenant as b } from "../../../hooks/useRowTenant.js";
13
+ import { useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
14
14
  // src/components/pages/list/useListRowInteraction.ts
15
- function T({ entity: T, screen: E, screens: D, entities: O, searchParams: k, tabNavigate: A, commitScreenTabSearch: j, isPhone: M, canUpdate: N }) {
16
- let P = v(), F = y(T), [I, L] = w(null), [R, z] = w(null), B = C(null), V = C(null);
17
- x(() => () => {
18
- V.current && clearTimeout(V.current.timer);
15
+ function E({ entity: E, screen: D, screens: O, entities: k, searchParams: A, tabNavigate: j, commitScreenTabSearch: M, isPhone: N, canUpdate: P }) {
16
+ let F = y(), I = b(E), [L, R] = T(null), [z, B] = T(null), V = w(null), H = w(null);
17
+ S(() => () => {
18
+ H.current && clearTimeout(H.current.timer);
19
19
  }, []);
20
- let H = E?.on_row_click === "peek" && E.quick_peek?.enabled !== !1 && !M, U = b((e, t) => {
21
- if (!T || !E) return;
22
- let r = u(T, e), i = m(T, r), a = l(E, T, D, r);
20
+ let U = D?.on_row_click === "peek" && D.quick_peek?.enabled !== !1 && !N, W = x((e, t) => {
21
+ if (!E || !D) return;
22
+ let r = u(E, e), i = m(E, r), a = l(D, E, O, r);
23
23
  if (!a) return;
24
24
  if (t?.draft) {
25
25
  n(i, t.draft);
26
26
  let [e, r] = a.split("?", 2), o = new URLSearchParams(r ?? "");
27
27
  o.set("edit", "true"), a = `${e}?${o.toString()}`;
28
28
  }
29
- let o = f(P, e, T) ?? P(T.display.name), s = E.display?.icon || T.display.icon;
30
- j(k.toString()), A(a, {
29
+ let o = f(F, e, E) ?? F(E.display.name), s = D.display?.icon || E.display.icon;
30
+ M(A.toString()), j(a, {
31
31
  title: o,
32
32
  icon: s
33
33
  });
34
34
  }, [
35
- P,
36
- T,
35
+ F,
37
36
  E,
38
37
  D,
39
- k,
38
+ O,
40
39
  A,
41
- j
42
- ]), W = i(b((e) => {
43
- let t = B.current;
44
- t && z({
40
+ j,
41
+ M
42
+ ]), G = i(x((e) => {
43
+ let t = V.current;
44
+ t && B({
45
45
  x: e.x,
46
46
  y: e.y,
47
47
  row: t
48
48
  });
49
- }, [])), G = b((e, t) => {
50
- if (W.consumePressFired() || s(e.target)) return;
51
- if (!H || !T) {
52
- U(t);
49
+ }, [])), K = x((e, t) => {
50
+ if (G.consumePressFired() || s(e.target)) return;
51
+ if (!U || !E) {
52
+ W(t);
53
53
  return;
54
54
  }
55
- let n = _(T, t);
56
- if (o(V.current, n) === "double") {
57
- clearTimeout(V.current.timer), V.current = null, L(null), U(t);
55
+ let n = v(E, t);
56
+ if (o(H.current, n) === "double") {
57
+ clearTimeout(H.current.timer), H.current = null, R(null), W(t);
58
58
  return;
59
59
  }
60
- V.current && clearTimeout(V.current.timer);
60
+ H.current && clearTimeout(H.current.timer);
61
61
  let r = setTimeout(() => {
62
- V.current = null, L(t);
62
+ H.current = null, R(t);
63
63
  }, 250);
64
- V.current = {
64
+ H.current = {
65
65
  rowId: n,
66
66
  timer: r
67
67
  };
68
68
  }, [
69
- T,
70
- H,
69
+ E,
71
70
  U,
72
- W
71
+ W,
72
+ G
73
73
  ]);
74
74
  return {
75
- peekAllowed: H,
76
- peekRow: I,
77
- setPeekRow: L,
78
- peekFields: S(() => {
79
- if (!H || !T || !I) return [];
80
- let e = c(T, E, I), t = N && h(T, I, F.tenantId);
81
- return g(T, e, D).map((e) => {
82
- if (T.files?.get(e)) return {
75
+ peekAllowed: U,
76
+ peekRow: L,
77
+ setPeekRow: R,
78
+ peekFields: C(() => {
79
+ if (!U || !E || !L) return [];
80
+ let e = c(E, D, L), t = P && h(E, L, I.tenantId), n = g(e);
81
+ return _(E, e, O).map((e) => {
82
+ if (E.files?.get(e)) return {
83
83
  key: e,
84
- label: r(P, T, e, O),
84
+ label: r(F, E, e, k),
85
85
  kind: "file",
86
86
  readOnly: !t
87
87
  };
88
- let n = T.fields.get(e), i = t && p(n) && !n.ref && n.files?.mode !== "rich_text_inline";
88
+ let i = E.fields.get(e), a = n.get(e), o = !a && t && p(i) && !i.ref && i.files?.mode !== "rich_text_inline";
89
89
  return {
90
90
  key: e,
91
- label: d(P, n, e, O),
91
+ label: d(F, i, e, k),
92
92
  kind: "field",
93
- field: n,
94
- readOnly: !i
93
+ field: a ? {
94
+ ...i,
95
+ structure: a
96
+ } : i,
97
+ readOnly: !o
95
98
  };
96
99
  });
97
100
  }, [
98
- P,
99
- H,
100
- I,
101
- T,
101
+ F,
102
+ U,
103
+ L,
102
104
  E,
103
- O,
104
105
  D,
105
- N,
106
- F
106
+ k,
107
+ O,
108
+ P,
109
+ I
107
110
  ]),
108
- peekActions: S(() => T?.actions ?? {}, [T?.actions]),
109
- peekExecute: b(async (n, r, i) => {
110
- let o = T?.fields.names().find((e) => T.fields.get(e)?.primary), s = o && I ? [a(I[o])] : void 0, c = r.entity ? `${r.entity}.${n}` : n;
111
+ peekActions: C(() => E?.actions ?? {}, [E?.actions]),
112
+ peekExecute: x(async (n, r, i) => {
113
+ let o = E?.fields.names().find((e) => E.fields.get(e)?.primary), s = o && L ? [a(L[o])] : void 0, c = r.entity ? `${r.entity}.${n}` : n;
111
114
  return t(c, e(i, s));
112
- }, [T, I]),
113
- contextMenu: R,
114
- setContextMenu: z,
115
- pressedRow: B,
116
- longPress: W,
117
- onRowClick: G,
118
- navigateToDetail: U
115
+ }, [E, L]),
116
+ contextMenu: z,
117
+ setContextMenu: B,
118
+ pressedRow: V,
119
+ longPress: G,
120
+ onRowClick: K,
121
+ navigateToDetail: W
119
122
  };
120
123
  }
121
- export { T as useListRowInteraction };
124
+ export { E as useListRowInteraction };