@constructive-io/schema-builder 0.2.1 → 0.4.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 +12 -0
- package/README.md +12 -4
- package/dist/{core-WwCS0CKu.cjs → core-CVxnNLs7.cjs} +2 -2
- package/dist/{core-WwCS0CKu.cjs.map → core-CVxnNLs7.cjs.map} +1 -1
- package/dist/{core-kx6KjxE5.js → core-DJ5kA4r-.js} +2 -2
- package/dist/{core-kx6KjxE5.js.map → core-DJ5kA4r-.js.map} +1 -1
- package/dist/core.cjs +2 -2
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/{create-table-card-pZ0Aq6rr.js → create-table-card-B6SMrt_g.js} +13 -7
- package/dist/{create-table-card-pZ0Aq6rr.js.map → create-table-card-B6SMrt_g.js.map} +1 -1
- package/dist/{create-table-card-BzNKfpXO.cjs → create-table-card-BrQ7pB_U.cjs} +13 -7
- package/dist/{create-table-card-BzNKfpXO.cjs.map → create-table-card-BrQ7pB_U.cjs.map} +1 -1
- package/dist/{empty-state-card-DMn8ADRq.cjs → empty-state-card-5t7LygTB.cjs} +2 -2
- package/dist/{empty-state-card-DMn8ADRq.cjs.map → empty-state-card-5t7LygTB.cjs.map} +1 -1
- package/dist/{empty-state-card-Dnn36JVH.js → empty-state-card-C-Nylatg.js} +2 -2
- package/dist/{empty-state-card-Dnn36JVH.js.map → empty-state-card-C-Nylatg.js.map} +1 -1
- package/dist/fields.cjs +1 -1
- package/dist/fields.d.cts +1 -2
- package/dist/fields.d.ts +1 -2
- package/dist/fields.js +1 -1
- package/dist/{index-p_NegPQ5.d.ts → index--9KTz1LB.d.cts} +3 -3
- package/dist/index-10idAfdb.d.cts +7 -0
- package/dist/index-BcdFaKFS.d.ts +7 -0
- package/dist/{index-9h0EROdb.d.cts → index-euaSKMQK.d.ts} +3 -3
- package/dist/index.cjs +79 -441
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +79 -441
- package/dist/index.js.map +1 -1
- package/dist/{indexes-view-CJ1WQKdp.js → indexes-view-CBzYpKcd.js} +3 -3
- package/dist/{indexes-view-CJ1WQKdp.js.map → indexes-view-CBzYpKcd.js.map} +1 -1
- package/dist/{indexes-view-peIv6QUZ.cjs → indexes-view-D1K24ts1.cjs} +3 -3
- package/dist/{indexes-view-peIv6QUZ.cjs.map → indexes-view-D1K24ts1.cjs.map} +1 -1
- package/dist/indexes.cjs +1 -1
- package/dist/indexes.d.cts +1 -1
- package/dist/indexes.d.ts +1 -1
- package/dist/indexes.js +1 -1
- package/dist/{invalidate-database-entities-CmmOT3S0.js → invalidate-database-entities-BFCWf5Zf.js} +10 -8
- package/dist/{invalidate-database-entities-CmmOT3S0.js.map → invalidate-database-entities-BFCWf5Zf.js.map} +1 -1
- package/dist/{invalidate-database-entities-9DsT5NlP.cjs → invalidate-database-entities-Gs5k8A-M.cjs} +9 -7
- package/dist/invalidate-database-entities-Gs5k8A-M.cjs.map +1 -0
- package/dist/{policies-view-H1HTjpmv.cjs → policies-view-CkvGpJBo.cjs} +5 -5
- package/dist/{policies-view-H1HTjpmv.cjs.map → policies-view-CkvGpJBo.cjs.map} +1 -1
- package/dist/{policies-view-BRbpbyB6.js → policies-view-DTfAhX7G.js} +5 -5
- package/dist/{policies-view-BRbpbyB6.js.map → policies-view-DTfAhX7G.js.map} +1 -1
- package/dist/policies.cjs +3 -3
- package/dist/policies.d.cts +3 -3
- package/dist/policies.d.ts +3 -3
- package/dist/policies.js +3 -3
- package/dist/{policy-config-form-BwyK7DGV.js → policy-config-form-EEcQ9ywL.js} +3 -3
- package/dist/{policy-config-form-BwyK7DGV.js.map → policy-config-form-EEcQ9ywL.js.map} +1 -1
- package/dist/{policy-config-form-CefFo6Fw.cjs → policy-config-form-RP9010zj.cjs} +3 -3
- package/dist/{policy-config-form-CefFo6Fw.cjs.map → policy-config-form-RP9010zj.cjs.map} +1 -1
- package/dist/{query-DU-KZleN.cjs → query-BGtzUV7Y.cjs} +41 -20
- package/dist/query-BGtzUV7Y.cjs.map +1 -0
- package/dist/{query-BmN_qO0W.js → query-r6j8IjQB.js} +41 -20
- package/dist/query-r6j8IjQB.js.map +1 -0
- package/dist/{relationships-view-DbwFh5r-.js → relationships-view-C884EvGj.js} +5 -5
- package/dist/{relationships-view-DbwFh5r-.js.map → relationships-view-C884EvGj.js.map} +1 -1
- package/dist/{relationships-view-B5TAcPHU.cjs → relationships-view-DlBs-gCF.cjs} +5 -5
- package/dist/{relationships-view-B5TAcPHU.cjs.map → relationships-view-DlBs-gCF.cjs.map} +1 -1
- package/dist/relationships.cjs +1 -1
- package/dist/relationships.d.cts +1 -2
- package/dist/relationships.d.ts +1 -2
- package/dist/relationships.js +1 -1
- package/dist/{schema-builder-sidebar-VR-Ctidc.js → schema-builder-sidebar-DAgK7ZTu.js} +77 -16
- package/dist/schema-builder-sidebar-DAgK7ZTu.js.map +1 -0
- package/dist/{schema-builder-sidebar-Ctu621Vw.cjs → schema-builder-sidebar-L3TcQeQr.cjs} +81 -14
- package/dist/schema-builder-sidebar-L3TcQeQr.cjs.map +1 -0
- package/dist/{table-editor-IVp3B4nG.js → table-editor-B-5i1M79.js} +9 -9
- package/dist/{table-editor-IVp3B4nG.js.map → table-editor-B-5i1M79.js.map} +1 -1
- package/dist/{table-editor-C-hHz3DJ.cjs → table-editor-BdLdVZfh.cjs} +9 -9
- package/dist/{table-editor-C-hHz3DJ.cjs.map → table-editor-BdLdVZfh.cjs.map} +1 -1
- package/dist/tables.cjs +2 -2
- package/dist/tables.d.cts +1 -1
- package/dist/tables.d.ts +1 -1
- package/dist/tables.js +2 -2
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/types-CXNRA22N.d.cts +450 -0
- package/dist/types-CXNRA22N.d.ts +450 -0
- package/dist/{use-update-table-Dz6knGoH.js → use-update-table-DlLX9fdE.js} +2 -2
- package/dist/{use-update-table-Dz6knGoH.js.map → use-update-table-DlLX9fdE.js.map} +1 -1
- package/dist/{use-update-table-C7v3gRyG.cjs → use-update-table-vcoHVolI.cjs} +2 -2
- package/dist/{use-update-table-C7v3gRyG.cjs.map → use-update-table-vcoHVolI.cjs.map} +1 -1
- package/package.json +5 -3
- package/dist/index-CwQ9QpxA.d.ts +0 -7
- package/dist/index-DOWB1UBK.d.cts +0 -56
- package/dist/index-DOWB1UBK.d.ts +0 -56
- package/dist/index-Dgb_e3AP.d.cts +0 -7
- package/dist/invalidate-database-entities-9DsT5NlP.cjs.map +0 -1
- package/dist/query-BmN_qO0W.js.map +0 -1
- package/dist/query-DU-KZleN.cjs.map +0 -1
- package/dist/schema-builder-sidebar-Ctu621Vw.cjs.map +0 -1
- package/dist/schema-builder-sidebar-VR-Ctidc.js.map +0 -1
- package/dist/types-GUrH1Qny.d.cts +0 -200
- package/dist/types-GUrH1Qny.d.ts +0 -200
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **blocks:** polish application docs and previews ([a00d896](https://github.com/constructive-io/blocks/commit/a00d89629894f89c2063da9632836b992949197c))
|
|
12
|
+
* **registry:** add dashboard source blocks ([11483a0](https://github.com/constructive-io/blocks/commit/11483a0b5dafa501f6962186931ece2f4b02a416))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [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
19
|
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
#
|
|
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 '
|
|
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
|
-
|
|
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-
|
|
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-
|
|
66
|
+
//# sourceMappingURL=core-CVxnNLs7.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-
|
|
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-
|
|
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-
|
|
49
|
+
//# sourceMappingURL=core-DJ5kA4r-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-
|
|
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-
|
|
4
|
-
const require_core = require('./core-
|
|
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-
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
3
|
-
import { n as defineSchemaBuilderAdapter, r as useSchemaBuilderMutation, t as DEFAULT_SCHEMA_BUILDER_PREFERENCES } from "./core-
|
|
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-
|
|
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-
|
|
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-
|
|
7691
|
+
//# sourceMappingURL=create-table-card-B6SMrt_g.js.map
|