@constructive-io/schema-builder 0.2.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +12 -4
  3. package/dist/{core-WwCS0CKu.cjs → core-CVxnNLs7.cjs} +2 -2
  4. package/dist/{core-WwCS0CKu.cjs.map → core-CVxnNLs7.cjs.map} +1 -1
  5. package/dist/{core-kx6KjxE5.js → core-DJ5kA4r-.js} +2 -2
  6. package/dist/{core-kx6KjxE5.js.map → core-DJ5kA4r-.js.map} +1 -1
  7. package/dist/core.cjs +2 -2
  8. package/dist/core.d.cts +2 -2
  9. package/dist/core.d.ts +2 -2
  10. package/dist/core.js +2 -2
  11. package/dist/{create-table-card-pZ0Aq6rr.js → create-table-card-B6SMrt_g.js} +13 -7
  12. package/dist/{create-table-card-pZ0Aq6rr.js.map → create-table-card-B6SMrt_g.js.map} +1 -1
  13. package/dist/{create-table-card-BzNKfpXO.cjs → create-table-card-BrQ7pB_U.cjs} +13 -7
  14. package/dist/{create-table-card-BzNKfpXO.cjs.map → create-table-card-BrQ7pB_U.cjs.map} +1 -1
  15. package/dist/{empty-state-card-DMn8ADRq.cjs → empty-state-card-5t7LygTB.cjs} +2 -2
  16. package/dist/{empty-state-card-DMn8ADRq.cjs.map → empty-state-card-5t7LygTB.cjs.map} +1 -1
  17. package/dist/{empty-state-card-Dnn36JVH.js → empty-state-card-C-Nylatg.js} +2 -2
  18. package/dist/{empty-state-card-Dnn36JVH.js.map → empty-state-card-C-Nylatg.js.map} +1 -1
  19. package/dist/fields.cjs +1 -1
  20. package/dist/fields.d.cts +1 -2
  21. package/dist/fields.d.ts +1 -2
  22. package/dist/fields.js +1 -1
  23. package/dist/{index-p_NegPQ5.d.ts → index--9KTz1LB.d.cts} +3 -3
  24. package/dist/index-10idAfdb.d.cts +7 -0
  25. package/dist/index-BcdFaKFS.d.ts +7 -0
  26. package/dist/{index-9h0EROdb.d.cts → index-euaSKMQK.d.ts} +3 -3
  27. package/dist/index.cjs +79 -441
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +4 -4
  30. package/dist/index.d.ts +4 -4
  31. package/dist/index.js +79 -441
  32. package/dist/index.js.map +1 -1
  33. package/dist/{indexes-view-CJ1WQKdp.js → indexes-view-CBzYpKcd.js} +3 -3
  34. package/dist/{indexes-view-CJ1WQKdp.js.map → indexes-view-CBzYpKcd.js.map} +1 -1
  35. package/dist/{indexes-view-peIv6QUZ.cjs → indexes-view-D1K24ts1.cjs} +3 -3
  36. package/dist/{indexes-view-peIv6QUZ.cjs.map → indexes-view-D1K24ts1.cjs.map} +1 -1
  37. package/dist/indexes.cjs +1 -1
  38. package/dist/indexes.d.cts +1 -1
  39. package/dist/indexes.d.ts +1 -1
  40. package/dist/indexes.js +1 -1
  41. package/dist/{invalidate-database-entities-CmmOT3S0.js → invalidate-database-entities-BFCWf5Zf.js} +10 -8
  42. package/dist/{invalidate-database-entities-CmmOT3S0.js.map → invalidate-database-entities-BFCWf5Zf.js.map} +1 -1
  43. package/dist/{invalidate-database-entities-9DsT5NlP.cjs → invalidate-database-entities-Gs5k8A-M.cjs} +9 -7
  44. package/dist/invalidate-database-entities-Gs5k8A-M.cjs.map +1 -0
  45. package/dist/{policies-view-H1HTjpmv.cjs → policies-view-CkvGpJBo.cjs} +5 -5
  46. package/dist/{policies-view-H1HTjpmv.cjs.map → policies-view-CkvGpJBo.cjs.map} +1 -1
  47. package/dist/{policies-view-BRbpbyB6.js → policies-view-DTfAhX7G.js} +5 -5
  48. package/dist/{policies-view-BRbpbyB6.js.map → policies-view-DTfAhX7G.js.map} +1 -1
  49. package/dist/policies.cjs +3 -3
  50. package/dist/policies.d.cts +3 -3
  51. package/dist/policies.d.ts +3 -3
  52. package/dist/policies.js +3 -3
  53. package/dist/{policy-config-form-BwyK7DGV.js → policy-config-form-EEcQ9ywL.js} +3 -3
  54. package/dist/{policy-config-form-BwyK7DGV.js.map → policy-config-form-EEcQ9ywL.js.map} +1 -1
  55. package/dist/{policy-config-form-CefFo6Fw.cjs → policy-config-form-RP9010zj.cjs} +3 -3
  56. package/dist/{policy-config-form-CefFo6Fw.cjs.map → policy-config-form-RP9010zj.cjs.map} +1 -1
  57. package/dist/{query-DU-KZleN.cjs → query-BGtzUV7Y.cjs} +41 -20
  58. package/dist/query-BGtzUV7Y.cjs.map +1 -0
  59. package/dist/{query-BmN_qO0W.js → query-r6j8IjQB.js} +41 -20
  60. package/dist/query-r6j8IjQB.js.map +1 -0
  61. package/dist/{relationships-view-DbwFh5r-.js → relationships-view-C884EvGj.js} +5 -5
  62. package/dist/{relationships-view-DbwFh5r-.js.map → relationships-view-C884EvGj.js.map} +1 -1
  63. package/dist/{relationships-view-B5TAcPHU.cjs → relationships-view-DlBs-gCF.cjs} +5 -5
  64. package/dist/{relationships-view-B5TAcPHU.cjs.map → relationships-view-DlBs-gCF.cjs.map} +1 -1
  65. package/dist/relationships.cjs +1 -1
  66. package/dist/relationships.d.cts +1 -2
  67. package/dist/relationships.d.ts +1 -2
  68. package/dist/relationships.js +1 -1
  69. package/dist/{schema-builder-sidebar-VR-Ctidc.js → schema-builder-sidebar-DAgK7ZTu.js} +77 -16
  70. package/dist/schema-builder-sidebar-DAgK7ZTu.js.map +1 -0
  71. package/dist/{schema-builder-sidebar-Ctu621Vw.cjs → schema-builder-sidebar-L3TcQeQr.cjs} +81 -14
  72. package/dist/schema-builder-sidebar-L3TcQeQr.cjs.map +1 -0
  73. package/dist/{table-editor-IVp3B4nG.js → table-editor-B-5i1M79.js} +9 -9
  74. package/dist/{table-editor-IVp3B4nG.js.map → table-editor-B-5i1M79.js.map} +1 -1
  75. package/dist/{table-editor-C-hHz3DJ.cjs → table-editor-BdLdVZfh.cjs} +9 -9
  76. package/dist/{table-editor-C-hHz3DJ.cjs.map → table-editor-BdLdVZfh.cjs.map} +1 -1
  77. package/dist/tables.cjs +2 -2
  78. package/dist/tables.d.cts +1 -1
  79. package/dist/tables.d.ts +1 -1
  80. package/dist/tables.js +2 -2
  81. package/dist/testing.d.cts +1 -1
  82. package/dist/testing.d.ts +1 -1
  83. package/dist/types-CXNRA22N.d.cts +450 -0
  84. package/dist/types-CXNRA22N.d.ts +450 -0
  85. package/dist/{use-update-table-Dz6knGoH.js → use-update-table-DlLX9fdE.js} +2 -2
  86. package/dist/{use-update-table-Dz6knGoH.js.map → use-update-table-DlLX9fdE.js.map} +1 -1
  87. package/dist/{use-update-table-C7v3gRyG.cjs → use-update-table-vcoHVolI.cjs} +2 -2
  88. package/dist/{use-update-table-C7v3gRyG.cjs.map → use-update-table-vcoHVolI.cjs.map} +1 -1
  89. package/package.json +6 -4
  90. package/dist/index-CwQ9QpxA.d.ts +0 -7
  91. package/dist/index-DOWB1UBK.d.cts +0 -56
  92. package/dist/index-DOWB1UBK.d.ts +0 -56
  93. package/dist/index-Dgb_e3AP.d.cts +0 -7
  94. package/dist/invalidate-database-entities-9DsT5NlP.cjs.map +0 -1
  95. package/dist/query-BmN_qO0W.js.map +0 -1
  96. package/dist/query-DU-KZleN.cjs.map +0 -1
  97. package/dist/schema-builder-sidebar-Ctu621Vw.cjs.map +0 -1
  98. package/dist/schema-builder-sidebar-VR-Ctidc.js.map +0 -1
  99. package/dist/types-GUrH1Qny.d.cts +0 -200
  100. package/dist/types-GUrH1Qny.d.ts +0 -200
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.4.1](https://github.com/constructive-io/blocks/compare/@constructive-io/schema-builder@0.4.0...@constructive-io/schema-builder@0.4.1) (2026-07-30)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **registry:** align published dependency contracts ([e013f58](https://github.com/constructive-io/blocks/commit/e013f58d0755754ad8aa063e13bb1ad5f338781a))
12
+
13
+
14
+
15
+
16
+
17
+ # [0.4.0](https://github.com/constructive-io/blocks/compare/@constructive-io/schema-builder@0.2.1...@constructive-io/schema-builder@0.4.0) (2026-07-30)
18
+
19
+
20
+ ### Features
21
+
22
+ * **blocks:** polish application docs and previews ([a00d896](https://github.com/constructive-io/blocks/commit/a00d89629894f89c2063da9632836b992949197c))
23
+ * **registry:** add dashboard source blocks ([11483a0](https://github.com/constructive-io/blocks/commit/11483a0b5dafa501f6962186931ece2f4b02a416))
24
+
25
+
26
+
27
+
28
+
6
29
  ## [0.2.1](https://github.com/constructive-io/blocks/compare/@constructive-io/schema-builder@0.2.0...@constructive-io/schema-builder@0.2.1) (2026-07-29)
7
30
 
8
31
 
package/README.md CHANGED
@@ -1,15 +1,21 @@
1
- # `@constructive-io/schema-builder`
1
+ # Schema Builder
2
2
 
3
3
  Framework-agnostic React schema builder for Constructive applications. The host owns the TanStack Query client, authenticated data adapter, scope, color mode, navigation, active tab, and persisted preferences.
4
4
 
5
+ Configure the `@constructive` registry in `components.json`, then install the
6
+ source-owned editor:
7
+
8
+ ```bash
9
+ pnpm dlx shadcn@latest add @constructive/schema-builder
10
+ ```
11
+
5
12
  ```tsx
6
13
  import { QueryClientProvider } from '@tanstack/react-query';
7
14
  import {
8
15
  DEFAULT_SCHEMA_BUILDER_PREFERENCES,
9
16
  SchemaBuilder,
10
17
  defineSchemaBuilderAdapter
11
- } from '@constructive-io/schema-builder';
12
- import '@constructive-io/schema-builder/styles.css';
18
+ } from '@/components/schema-builder';
13
19
 
14
20
  const adapter = defineSchemaBuilderAdapter({
15
21
  // Implement the typed core/fields/relationships/indexes/policies/tables ports.
@@ -30,4 +36,6 @@ const adapter = defineSchemaBuilderAdapter({
30
36
  </QueryClientProvider>;
31
37
  ```
32
38
 
33
- Feature-level imports are available from `/core`, `/fields`, `/relationships`, `/indexes`, `/policies`, and `/tables`. A hermetic empty-state adapter for documentation and tests is available from `/testing`.
39
+ The installed root exports the full adapter, store, and editor surface. The
40
+ host adapter keeps generated SDKs, endpoints, authenticated operations, and
41
+ cache invalidation in the consuming application.
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- const require_query = require('./query-DU-KZleN.cjs');
2
+ const require_query = require('./query-BGtzUV7Y.cjs');
3
3
  let _tanstack_react_query = require("@tanstack/react-query");
4
4
 
5
5
  //#region src/core/mutation.ts
@@ -63,4 +63,4 @@ Object.defineProperty(exports, 'useSchemaBuilderMutation', {
63
63
  return useSchemaBuilderMutation;
64
64
  }
65
65
  });
66
- //# sourceMappingURL=core-WwCS0CKu.cjs.map
66
+ //# sourceMappingURL=core-CVxnNLs7.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-WwCS0CKu.cjs","names":["useSchemaBuilder","schemaBuilderQueryKey"],"sources":["../src/core/mutation.ts","../src/types.ts"],"mappings":";;;;;AA8BA,SAAgB,yBAKd,SACA,WACA,UAA2D,CAAC,GACf;CAC7C,MAAM,EAAE,SAAS,OAAO,iBAAiBA,+BAAiB;CAC1D,MAAM,wDAA6B;CAEnC,MAAM,cADa,QAAQ,QACG,CAAC;CAE/B,IAAI,OAAO,gBAAgB,YACzB,MAAM,IAAI,MAAM,oCAAoC,QAAQ,GAAG,WAAW;CAG5E,MAAM,EAAE,WAAW,GAAG,oBAAoB;CAC1C,MAAM,gBAAgB,gBAAgB;CAEtC,8CAAmB;EACjB,GAAG;EACH,aAAa,cACX,YAAY,WAAW;GAAE;GAAO;EAAU,CAAC;EAC7C,WAAW,OAAO,MAAM,WAAW,gBAAgB,YAAY;GAC7D,MAAM,YAAY,kBAAkB,EAClC,UAAUC,oCAAsB,OAAO,QAAQ,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAC/D,CAAC;GACD,eAAe;IAAE;IAAO;IAAS;GAAU,CAAC;GAC5C,MAAM,gBAAgB,MAAM,WAAW,gBAAgB,OAAO;EAChE;CACF,CAAC;AACH;;;;ACxCA,MAAa,qCAAyE;CACpF,yBAAyB;EACvB,KAAK;EACL,QAAQ;CACV;CACA,2BAA2B;CAC3B,8BAA8B;CAC9B,eAAe;CACf,sBAAsB;AACxB;AAiNA,SAAgB,2BAAkE,SAA6B;CAC7G,OAAO;AACT"}
1
+ {"version":3,"file":"core-CVxnNLs7.cjs","names":["useSchemaBuilder","schemaBuilderQueryKey"],"sources":["../src/core/mutation.ts","../src/types.ts"],"mappings":";;;;;AA8BA,SAAgB,yBAKd,SACA,WACA,UAA2D,CAAC,GACf;CAC7C,MAAM,EAAE,SAAS,OAAO,iBAAiBA,+BAAiB;CAC1D,MAAM,wDAA6B;CAEnC,MAAM,cADa,QAAQ,QACG,CAAC;CAE/B,IAAI,OAAO,gBAAgB,YACzB,MAAM,IAAI,MAAM,oCAAoC,QAAQ,GAAG,WAAW;CAG5E,MAAM,EAAE,WAAW,GAAG,oBAAoB;CAC1C,MAAM,gBAAgB,gBAAgB;CAEtC,8CAAmB;EACjB,GAAG;EACH,aAAa,cACX,YAAY,WAAW;GAAE;GAAO;EAAU,CAAC;EAC7C,WAAW,OAAO,MAAM,WAAW,gBAAgB,YAAY;GAC7D,MAAM,YAAY,kBAAkB,EAClC,UAAUC,oCAAsB,OAAO,QAAQ,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAC/D,CAAC;GACD,eAAe;IAAE;IAAO;IAAS;GAAU,CAAC;GAC5C,MAAM,gBAAgB,MAAM,WAAW,gBAAgB,OAAO;EAChE;CACF,CAAC;AACH;;;;ACxCA,MAAa,qCAAyE;CACpF,yBAAyB;EACvB,KAAK;EACL,QAAQ;CACV;CACA,2BAA2B;CAC3B,8BAA8B;CAC9B,eAAe;CACf,sBAAsB;AACxB;AAmNA,SAAgB,2BAAkE,SAA6B;CAC7G,OAAO;AACT"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { i as useSchemaBuilder, t as schemaBuilderQueryKey } from "./query-BmN_qO0W.js";
2
+ import { i as useSchemaBuilder, t as schemaBuilderQueryKey } from "./query-r6j8IjQB.js";
3
3
  import { useMutation, useQueryClient } from "@tanstack/react-query";
4
4
 
5
5
  //#region src/core/mutation.ts
@@ -46,4 +46,4 @@ function defineSchemaBuilderAdapter(adapter) {
46
46
 
47
47
  //#endregion
48
48
  export { defineSchemaBuilderAdapter as n, useSchemaBuilderMutation as r, DEFAULT_SCHEMA_BUILDER_PREFERENCES as t };
49
- //# sourceMappingURL=core-kx6KjxE5.js.map
49
+ //# sourceMappingURL=core-DJ5kA4r-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-kx6KjxE5.js","names":[],"sources":["../src/core/mutation.ts","../src/types.ts"],"mappings":";;;;;AA8BA,SAAgB,yBAKd,SACA,WACA,UAA2D,CAAC,GACf;CAC7C,MAAM,EAAE,SAAS,OAAO,iBAAiB,iBAAiB;CAC1D,MAAM,cAAc,eAAe;CAEnC,MAAM,cADa,QAAQ,QACG,CAAC;CAE/B,IAAI,OAAO,gBAAgB,YACzB,MAAM,IAAI,MAAM,oCAAoC,QAAQ,GAAG,WAAW;CAG5E,MAAM,EAAE,WAAW,GAAG,oBAAoB;CAC1C,MAAM,gBAAgB,gBAAgB;CAEtC,OAAO,YAAY;EACjB,GAAG;EACH,aAAa,cACX,YAAY,WAAW;GAAE;GAAO;EAAU,CAAC;EAC7C,WAAW,OAAO,MAAM,WAAW,gBAAgB,YAAY;GAC7D,MAAM,YAAY,kBAAkB,EAClC,UAAU,sBAAsB,OAAO,QAAQ,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAC/D,CAAC;GACD,eAAe;IAAE;IAAO;IAAS;GAAU,CAAC;GAC5C,MAAM,gBAAgB,MAAM,WAAW,gBAAgB,OAAO;EAChE;CACF,CAAC;AACH;;;;ACxCA,MAAa,qCAAyE;CACpF,yBAAyB;EACvB,KAAK;EACL,QAAQ;CACV;CACA,2BAA2B;CAC3B,8BAA8B;CAC9B,eAAe;CACf,sBAAsB;AACxB;AAiNA,SAAgB,2BAAkE,SAA6B;CAC7G,OAAO;AACT"}
1
+ {"version":3,"file":"core-DJ5kA4r-.js","names":[],"sources":["../src/core/mutation.ts","../src/types.ts"],"mappings":";;;;;AA8BA,SAAgB,yBAKd,SACA,WACA,UAA2D,CAAC,GACf;CAC7C,MAAM,EAAE,SAAS,OAAO,iBAAiB,iBAAiB;CAC1D,MAAM,cAAc,eAAe;CAEnC,MAAM,cADa,QAAQ,QACG,CAAC;CAE/B,IAAI,OAAO,gBAAgB,YACzB,MAAM,IAAI,MAAM,oCAAoC,QAAQ,GAAG,WAAW;CAG5E,MAAM,EAAE,WAAW,GAAG,oBAAoB;CAC1C,MAAM,gBAAgB,gBAAgB;CAEtC,OAAO,YAAY;EACjB,GAAG;EACH,aAAa,cACX,YAAY,WAAW;GAAE;GAAO;EAAU,CAAC;EAC7C,WAAW,OAAO,MAAM,WAAW,gBAAgB,YAAY;GAC7D,MAAM,YAAY,kBAAkB,EAClC,UAAU,sBAAsB,OAAO,QAAQ,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAC/D,CAAC;GACD,eAAe;IAAE;IAAO;IAAS;GAAU,CAAC;GAC5C,MAAM,gBAAgB,MAAM,WAAW,gBAAgB,OAAO;EAChE;CACF,CAAC;AACH;;;;ACxCA,MAAa,qCAAyE;CACpF,yBAAyB;EACvB,KAAK;EACL,QAAQ;CACV;CACA,2BAA2B;CAC3B,8BAA8B;CAC9B,eAAe;CACf,sBAAsB;AACxB;AAmNA,SAAgB,2BAAkE,SAA6B;CAC7G,OAAO;AACT"}
package/dist/core.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- const require_query = require('./query-DU-KZleN.cjs');
4
- const require_core = require('./core-WwCS0CKu.cjs');
3
+ const require_query = require('./query-BGtzUV7Y.cjs');
4
+ const require_core = require('./core-CVxnNLs7.cjs');
5
5
 
6
6
  exports.DEFAULT_SCHEMA_BUILDER_PREFERENCES = require_core.DEFAULT_SCHEMA_BUILDER_PREFERENCES;
7
7
  exports.SchemaBuilderProvider = require_query.SchemaBuilderProvider;
package/dist/core.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { C as SchemaBuilderSchema, D as SchemaBuilderTabRenderContext, E as SchemaBuilderTab, M as defineSchemaBuilderAdapter, O as SchemaBuilderTable, T as SchemaBuilderSidebarSections, a as SchemaBuilderCoreCapabilities, c as SchemaBuilderField, d as SchemaBuilderIndex, g as SchemaBuilderOperationContext, h as SchemaBuilderOperation, i as SchemaBuilderColorMode, j as SchemaBuilderVariables, m as SchemaBuilderNavigationTarget, n as SchemaBuilderAdapter, o as SchemaBuilderCoreTabId, p as SchemaBuilderInvalidationEvent, r as SchemaBuilderCollection, s as SchemaBuilderFeature, t as DEFAULT_SCHEMA_BUILDER_PREFERENCES, u as SchemaBuilderHostOptions, v as SchemaBuilderPolicy, w as SchemaBuilderScope, x as SchemaBuilderRelationship, y as SchemaBuilderPreferences } from "./types-GUrH1Qny.cjs";
2
- import { a as SchemaBuilderContextValue, c as useSchemaBuilder, d as createSchemaBuilderStore, f as getSchemaBuilderScopeKey, i as useSchemaBuilderQuery, l as useSchemaBuilderStore, n as useSchemaBuilderMutation, o as SchemaBuilderProvider, r as schemaBuilderQueryKey, s as SchemaBuilderProviderProps, t as SchemaBuilderMutationOptions, u as SchemaBuilderStoreState } from "./index-9h0EROdb.cjs";
1
+ import { C as SchemaBuilderSchema, D as SchemaBuilderTabRenderContext, E as SchemaBuilderTab, M as defineSchemaBuilderAdapter, O as SchemaBuilderTable, T as SchemaBuilderSidebarSections, a as SchemaBuilderCoreCapabilities, c as SchemaBuilderField, d as SchemaBuilderIndex, g as SchemaBuilderOperationContext, h as SchemaBuilderOperation, i as SchemaBuilderColorMode, j as SchemaBuilderVariables, m as SchemaBuilderNavigationTarget, n as SchemaBuilderAdapter, o as SchemaBuilderCoreTabId, p as SchemaBuilderInvalidationEvent, r as SchemaBuilderCollection, s as SchemaBuilderFeature, t as DEFAULT_SCHEMA_BUILDER_PREFERENCES, u as SchemaBuilderHostOptions, v as SchemaBuilderPolicy, w as SchemaBuilderScope, x as SchemaBuilderRelationship, y as SchemaBuilderPreferences } from "./types-CXNRA22N.cjs";
2
+ import { a as SchemaBuilderContextValue, c as useSchemaBuilder, d as createSchemaBuilderStore, f as getSchemaBuilderScopeKey, i as useSchemaBuilderQuery, l as useSchemaBuilderStore, n as useSchemaBuilderMutation, o as SchemaBuilderProvider, r as schemaBuilderQueryKey, s as SchemaBuilderProviderProps, t as SchemaBuilderMutationOptions, u as SchemaBuilderStoreState } from "./index--9KTz1LB.cjs";
3
3
  export { DEFAULT_SCHEMA_BUILDER_PREFERENCES, type SchemaBuilderAdapter, type SchemaBuilderCollection, type SchemaBuilderColorMode, type SchemaBuilderContextValue, type SchemaBuilderCoreCapabilities, type SchemaBuilderCoreTabId, type SchemaBuilderFeature, type SchemaBuilderField, type SchemaBuilderHostOptions, type SchemaBuilderIndex, type SchemaBuilderInvalidationEvent, type SchemaBuilderMutationOptions, type SchemaBuilderNavigationTarget, type SchemaBuilderOperation, type SchemaBuilderOperationContext, type SchemaBuilderPolicy, type SchemaBuilderPreferences, SchemaBuilderProvider, type SchemaBuilderProviderProps, type SchemaBuilderRelationship, type SchemaBuilderSchema, type SchemaBuilderScope, type SchemaBuilderSidebarSections, type SchemaBuilderStoreState, type SchemaBuilderTab, type SchemaBuilderTabRenderContext, type SchemaBuilderTable, type SchemaBuilderVariables, createSchemaBuilderStore, defineSchemaBuilderAdapter, getSchemaBuilderScopeKey, schemaBuilderQueryKey, useSchemaBuilder, useSchemaBuilderMutation, useSchemaBuilderQuery, useSchemaBuilderStore };
package/dist/core.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { C as SchemaBuilderSchema, D as SchemaBuilderTabRenderContext, E as SchemaBuilderTab, M as defineSchemaBuilderAdapter, O as SchemaBuilderTable, T as SchemaBuilderSidebarSections, a as SchemaBuilderCoreCapabilities, c as SchemaBuilderField, d as SchemaBuilderIndex, g as SchemaBuilderOperationContext, h as SchemaBuilderOperation, i as SchemaBuilderColorMode, j as SchemaBuilderVariables, m as SchemaBuilderNavigationTarget, n as SchemaBuilderAdapter, o as SchemaBuilderCoreTabId, p as SchemaBuilderInvalidationEvent, r as SchemaBuilderCollection, s as SchemaBuilderFeature, t as DEFAULT_SCHEMA_BUILDER_PREFERENCES, u as SchemaBuilderHostOptions, v as SchemaBuilderPolicy, w as SchemaBuilderScope, x as SchemaBuilderRelationship, y as SchemaBuilderPreferences } from "./types-GUrH1Qny.js";
2
- import { a as SchemaBuilderContextValue, c as useSchemaBuilder, d as createSchemaBuilderStore, f as getSchemaBuilderScopeKey, i as useSchemaBuilderQuery, l as useSchemaBuilderStore, n as useSchemaBuilderMutation, o as SchemaBuilderProvider, r as schemaBuilderQueryKey, s as SchemaBuilderProviderProps, t as SchemaBuilderMutationOptions, u as SchemaBuilderStoreState } from "./index-p_NegPQ5.js";
1
+ import { C as SchemaBuilderSchema, D as SchemaBuilderTabRenderContext, E as SchemaBuilderTab, M as defineSchemaBuilderAdapter, O as SchemaBuilderTable, T as SchemaBuilderSidebarSections, a as SchemaBuilderCoreCapabilities, c as SchemaBuilderField, d as SchemaBuilderIndex, g as SchemaBuilderOperationContext, h as SchemaBuilderOperation, i as SchemaBuilderColorMode, j as SchemaBuilderVariables, m as SchemaBuilderNavigationTarget, n as SchemaBuilderAdapter, o as SchemaBuilderCoreTabId, p as SchemaBuilderInvalidationEvent, r as SchemaBuilderCollection, s as SchemaBuilderFeature, t as DEFAULT_SCHEMA_BUILDER_PREFERENCES, u as SchemaBuilderHostOptions, v as SchemaBuilderPolicy, w as SchemaBuilderScope, x as SchemaBuilderRelationship, y as SchemaBuilderPreferences } from "./types-CXNRA22N.js";
2
+ import { a as SchemaBuilderContextValue, c as useSchemaBuilder, d as createSchemaBuilderStore, f as getSchemaBuilderScopeKey, i as useSchemaBuilderQuery, l as useSchemaBuilderStore, n as useSchemaBuilderMutation, o as SchemaBuilderProvider, r as schemaBuilderQueryKey, s as SchemaBuilderProviderProps, t as SchemaBuilderMutationOptions, u as SchemaBuilderStoreState } from "./index-euaSKMQK.js";
3
3
  export { DEFAULT_SCHEMA_BUILDER_PREFERENCES, type SchemaBuilderAdapter, type SchemaBuilderCollection, type SchemaBuilderColorMode, type SchemaBuilderContextValue, type SchemaBuilderCoreCapabilities, type SchemaBuilderCoreTabId, type SchemaBuilderFeature, type SchemaBuilderField, type SchemaBuilderHostOptions, type SchemaBuilderIndex, type SchemaBuilderInvalidationEvent, type SchemaBuilderMutationOptions, type SchemaBuilderNavigationTarget, type SchemaBuilderOperation, type SchemaBuilderOperationContext, type SchemaBuilderPolicy, type SchemaBuilderPreferences, SchemaBuilderProvider, type SchemaBuilderProviderProps, type SchemaBuilderRelationship, type SchemaBuilderSchema, type SchemaBuilderScope, type SchemaBuilderSidebarSections, type SchemaBuilderStoreState, type SchemaBuilderTab, type SchemaBuilderTabRenderContext, type SchemaBuilderTable, type SchemaBuilderVariables, createSchemaBuilderStore, defineSchemaBuilderAdapter, getSchemaBuilderScopeKey, schemaBuilderQueryKey, useSchemaBuilder, useSchemaBuilderMutation, useSchemaBuilderQuery, useSchemaBuilderStore };
package/dist/core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { a as useSchemaBuilderStore, i as useSchemaBuilder, n as useSchemaBuilderQuery, o as createSchemaBuilderStore, r as SchemaBuilderProvider, s as getSchemaBuilderScopeKey, t as schemaBuilderQueryKey } from "./query-BmN_qO0W.js";
3
- import { n as defineSchemaBuilderAdapter, r as useSchemaBuilderMutation, t as DEFAULT_SCHEMA_BUILDER_PREFERENCES } from "./core-kx6KjxE5.js";
2
+ import { a as useSchemaBuilderStore, i as useSchemaBuilder, n as useSchemaBuilderQuery, o as createSchemaBuilderStore, r as SchemaBuilderProvider, s as getSchemaBuilderScopeKey, t as schemaBuilderQueryKey } from "./query-r6j8IjQB.js";
3
+ import { n as defineSchemaBuilderAdapter, r as useSchemaBuilderMutation, t as DEFAULT_SCHEMA_BUILDER_PREFERENCES } from "./core-DJ5kA4r-.js";
4
4
 
5
5
  export { DEFAULT_SCHEMA_BUILDER_PREFERENCES, SchemaBuilderProvider, createSchemaBuilderStore, defineSchemaBuilderAdapter, getSchemaBuilderScopeKey, schemaBuilderQueryKey, useSchemaBuilder, useSchemaBuilderMutation, useSchemaBuilderQuery, useSchemaBuilderStore };
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { S as useCreateTableMutation, Y as cn, h as useSchemaBuilderRuntime, l as useSchemaBuilderSelectors, s as stripEmpty, t as invalidateDatabaseEntities } from "./invalidate-database-entities-CmmOT3S0.js";
3
- import { _ as injectSchemaFields, a as useCreateTableWithPolicies, g as getFieldsRequiringColumns, i as hasRequiredFieldsMissing, m as buildNodeData, o as usePolicyType, p as POLICY_TYPE_UI_CONFIG, r as getDefaultFormValues, s as usePolicyTypes, t as PolicyConfigForm, u as CRUD_OPERATIONS, v as injectSchemaFieldsIntoCompositeTree, x as useCreateTableGrant } from "./policy-config-form-BwyK7DGV.js";
2
+ import { S as useCreateTableMutation, Y as cn, h as useSchemaBuilderRuntime, l as useSchemaBuilderSelectors, s as stripEmpty, t as invalidateDatabaseEntities } from "./invalidate-database-entities-BFCWf5Zf.js";
3
+ import { _ as injectSchemaFields, a as useCreateTableWithPolicies, g as getFieldsRequiringColumns, i as hasRequiredFieldsMissing, m as buildNodeData, o as usePolicyType, p as POLICY_TYPE_UI_CONFIG, r as getDefaultFormValues, s as usePolicyTypes, t as PolicyConfigForm, u as CRUD_OPERATIONS, v as injectSchemaFieldsIntoCompositeTree, x as useCreateTableGrant } from "./policy-config-form-EEcQ9ywL.js";
4
4
  import { useCardStack } from "@constructive-io/ui/stack";
5
5
  import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -7213,7 +7213,7 @@ function PolicyTypeCard({ policyType, tableName, isSelected, onSelect, onKnowMor
7213
7213
  "data-chat-policy-title": policyType.title,
7214
7214
  "data-chat-policy-description": policyType.description,
7215
7215
  "data-chat-selected": String(isSelected),
7216
- className: cn(`relative flex w-full flex-col gap-3 rounded-lg border p-4 text-left
7216
+ className: cn(`relative flex w-full min-w-0 flex-col gap-3 rounded-lg border p-4 text-left
7217
7217
  transition-[background-color,border-color,box-shadow,scale] duration-150 ease-out
7218
7218
  motion-safe:has-[:active]:scale-[0.96]`, isSelected ? "border-primary bg-primary/5 ring-primary/20 ring-2" : "border-border/60 hover:border-border hover:bg-muted/50"),
7219
7219
  children: [/* @__PURE__ */ jsx("button", {
@@ -7273,7 +7273,7 @@ function BlankTableCard({ isSelected, onSelect }) {
7273
7273
  return /* @__PURE__ */ jsxs("button", {
7274
7274
  type: "button",
7275
7275
  onClick: onSelect,
7276
- className: cn(`relative flex w-full flex-col gap-3 rounded-lg border p-4 text-left
7276
+ className: cn(`relative flex w-full min-w-0 flex-col gap-3 rounded-lg border p-4 text-left
7277
7277
  transition-[background-color,border-color,box-shadow,scale] duration-150 ease-out motion-safe:active:scale-[0.96]`, isSelected ? "border-primary bg-primary/5 ring-primary/20 ring-2" : "border-border/60 hover:border-border hover:bg-muted/30 border-dashed"),
7278
7278
  children: [/* @__PURE__ */ jsx("div", {
7279
7279
  className: cn("flex h-28 items-center justify-center rounded-lg border border-dashed", isSelected ? "border-primary/30 bg-primary/5" : "border-border/40 bg-muted/20"),
@@ -7313,6 +7313,7 @@ const CreateTableCard = ({ mode = "create-table", tableId, tableName: propTableN
7313
7313
  const [selectedModel, setSelectedModel] = useState(null);
7314
7314
  const [wizardStep, setWizardStep] = useState("select");
7315
7315
  const [knowMoreCardId, setKnowMoreCardId] = useState(null);
7316
+ const tableNameInputRef = useRef(null);
7316
7317
  const [defaultsInitialized, setDefaultsInitialized] = useState(false);
7317
7318
  const [isScrolled, setIsScrolled] = useState(false);
7318
7319
  const scrollAreaRef = useCallback((node) => {
@@ -7326,6 +7327,11 @@ const CreateTableCard = ({ mode = "create-table", tableId, tableName: propTableN
7326
7327
  return removeScrollListener;
7327
7328
  }, []);
7328
7329
  const effectiveTableName = isAddPoliciesMode ? propTableName ?? "" : tableNameInput;
7330
+ useEffect(() => {
7331
+ if (wizardStep !== "select" || isAddPoliciesMode || typeof window.matchMedia !== "function") return;
7332
+ if (!window.matchMedia("(hover: hover) and (pointer: fine)").matches) return;
7333
+ tableNameInputRef.current?.focus({ preventScroll: true });
7334
+ }, [isAddPoliciesMode, wizardStep]);
7329
7335
  const stack = useCardStack();
7330
7336
  const { currentDatabase, currentSchema } = useSchemaBuilderSelectors();
7331
7337
  const databaseId = currentDatabase?.databaseId ?? "";
@@ -7597,12 +7603,12 @@ const CreateTableCard = ({ mode = "create-table", tableId, tableName: propTableN
7597
7603
  children: /* @__PURE__ */ jsx(Input, {
7598
7604
  id: "table-name",
7599
7605
  "data-testid": "table-name-input",
7606
+ ref: tableNameInputRef,
7600
7607
  value: tableNameInput,
7601
7608
  onChange: (e) => setTableNameInput(e.target.value),
7602
7609
  onBlur: () => setTableNameTouched(true),
7603
7610
  placeholder: "e.g., posts, comments, orders",
7604
7611
  autoComplete: "off",
7605
- autoFocus: true,
7606
7612
  className: cn("font-mono", tableNameTouched && tableNameError && "border-destructive")
7607
7613
  })
7608
7614
  })
@@ -7627,7 +7633,7 @@ const CreateTableCard = ({ mode = "create-table", tableId, tableName: propTableN
7627
7633
  })
7628
7634
  }),
7629
7635
  /* @__PURE__ */ jsxs("div", {
7630
- className: "grid gap-3 sm:grid-cols-2",
7636
+ className: "grid min-w-0 grid-cols-[minmax(0,1fr)] gap-3 sm:grid-cols-2",
7631
7637
  children: [policyTypes.map((policyType) => /* @__PURE__ */ jsx(PolicyTypeCard, {
7632
7638
  policyType,
7633
7639
  tableName: effectiveTableName.trim(),
@@ -7682,4 +7688,4 @@ const CreateTableCard = ({ mode = "create-table", tableId, tableName: propTableN
7682
7688
 
7683
7689
  //#endregion
7684
7690
  export { mapConditionNodeToAst as a, PolicyDiagramByKey as i, TablePolicyConfigCard as n, AST_NODE_TO_POLICY_TYPE as o, CompositePolicyBuilder as r, fromBackendPolicyTypeId as s, CreateTableCard as t };
7685
- //# sourceMappingURL=create-table-card-pZ0Aq6rr.js.map
7691
+ //# sourceMappingURL=create-table-card-B6SMrt_g.js.map