@kronor/dtv 8.0.0 → 8.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/dist/index.es.js CHANGED
@@ -35442,7 +35442,7 @@ function w2({
35442
35442
  /* @__PURE__ */ he.jsx(Dg, { className: "pi pi-search" }),
35443
35443
  /* @__PURE__ */ he.jsx(fa, { value: j.searchQuery, onChange: (le) => D(le.target.value), placeholder: "Search filters..." })
35444
35444
  ] }),
35445
- /* @__PURE__ */ he.jsx(
35445
+ t && /* @__PURE__ */ he.jsx(
35446
35446
  Fn,
35447
35447
  {
35448
35448
  type: "button",
@@ -35456,7 +35456,7 @@ function w2({
35456
35456
  }
35457
35457
  ),
35458
35458
  (r || p) && /* @__PURE__ */ he.jsx("h1", { className: "tw:text-2xl tw:mb-4 tw:font-bold", children: I.title }),
35459
- Ie && /* @__PURE__ */ he.jsx("div", { className: "tw:mb-6", children: /* @__PURE__ */ he.jsx(
35459
+ Ie && t && /* @__PURE__ */ he.jsx("div", { className: "tw:mb-6", children: /* @__PURE__ */ he.jsx(
35460
35460
  KC,
35461
35461
  {
35462
35462
  filterState: j.filterState,
@@ -23,8 +23,11 @@ export interface AppProps {
23
23
  * request function (`{ type: 'custom', requestAiFilter }`) that receives
24
24
  * the fully-built prompt and returns the model response (raw text or the
25
25
  * parsed filter-state object).
26
+ *
27
+ * Optional: when it is omitted the AI Filter Assistant is not offered at
28
+ * all, so a host with no AI provider does not have to stub one out.
26
29
  */
27
- aiIntegration: AIIntegration;
30
+ aiIntegration?: AIIntegration;
28
31
  /**
29
32
  * Optional already-parsed views.
30
33
  * When provided, `viewsJson` is ignored and no JSON parsing occurs.
@@ -79,10 +79,3 @@ export declare function filter<Row, const Expr extends FilterExpr>(args: {
79
79
  expression: Expr & ValidateFilterExprForRow<Row, Expr>;
80
80
  aiGenerated?: boolean;
81
81
  }): FilterSchema;
82
- export declare function filter(args: {
83
- rowType?: never;
84
- id: string;
85
- label: string;
86
- expression: FilterExpr;
87
- aiGenerated?: boolean;
88
- }): FilterSchema;
@@ -6,9 +6,10 @@ checked against that row: field paths have to exist, controls have to be able to
6
6
  produce the type of the field they filter, and operators have to be ones Hasura
7
7
  offers for that type.
8
8
 
9
- This is opt-in. A view that passes no row type keeps working exactly as before,
10
- and JSON views are unaffected (they are validated at runtime by the view
11
- parser, not by these types).
9
+ `filter()` requires `rowType`: a filter has to say which row it is built on.
10
+ Columns are still opt-in — a `column()` that passes no row type keeps working
11
+ exactly as before — and JSON views are unaffected (they are validated at
12
+ runtime by the view parser, not by these types).
12
13
 
13
14
  ## Getting the row type
14
15
 
@@ -227,7 +228,7 @@ with no `toQuery` at all is rejected too; it would do nothing at query time.
227
228
  ### Row-scoped builders
228
229
 
229
230
  `FilterExpr` accepts any field name and is checked when the expression reaches
230
- `filter({ rowType })`, which reports problems on the `filter()` call. Scoping
231
+ `filter()`, which reports problems on the `expression` it was given. Scoping
231
232
  the builder to the row instead gives the editor a row to work from:
232
233
 
233
234
  ```ts
@@ -239,10 +240,10 @@ F.like({ field: F.field.or('reference', 'customer.email'), control: FilterContro
239
240
  ```
240
241
 
241
242
  Field names complete as they are typed, and each problem is reported on the
242
- property that caused it — an unsupported operator on `field`, an unusable
243
- control on `control`. The results are ordinary `FilterExpr` values, so
244
- `filter({ rowType })` still checks them; the row-scoped builder is about where
245
- errors appear, not about checking more.
243
+ leaf property that caused it — an unsupported operator on `field`, an unusable
244
+ control on `control` — rather than on the whole expression. The results are
245
+ ordinary `FilterExpr` values, so `filter()` still checks them; the row-scoped
246
+ builder is about where errors appear, not about checking more.
246
247
 
247
248
  `hasuraDSLforRowType` and `queryForRowType` are the same idea for
248
249
  condition-producing transforms and for nested selections:
package/docs/typegen.md CHANGED
@@ -91,9 +91,10 @@ The generator also edits the view module itself, as a convenience: it imports
91
91
  do not have one yet. Calls that already pass `rowType` are left alone, so
92
92
  re-running the generator is safe.
93
93
 
94
- Passing `rowType` is what turns on checking of a view's columns and filters
95
- against its row — see [api/row-typed-views.md](api/row-typed-views.md). A view
96
- where no call ends up with a `rowType` gets no generated file.
94
+ Passing `rowType` is what turns on checking of a view's columns against its
95
+ row, and `DSL.filter(...)` requires it — see
96
+ [api/row-typed-views.md](api/row-typed-views.md). A view where no call ends up
97
+ with a `rowType` gets no generated file.
97
98
 
98
99
  ## What the run reports
99
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronor/dtv",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "Schema-driven, declarative table views with advanced filtering, data fetching and AI-assisted filter generation.",
5
5
  "repository": {
6
6
  "type": "git",