@cisri/json-schema-selector 1.0.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/README.md +98 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +152 -0
- package/dist/json-schema-selector.d.ts +36 -0
- package/dist/json-schema-selector.d.ts.map +1 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# @cisri/json-schema-selector
|
|
2
|
+
|
|
3
|
+
A dialog-based JSON Schema selector business component built on shadcn/ui.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @cisri/json-schema-selector
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Peer Dependencies
|
|
12
|
+
|
|
13
|
+
This component relies on the following libraries. Make sure they are installed in your project:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add react react-dom @radix-ui/react-dialog @radix-ui/react-scroll-area @radix-ui/react-separator @radix-ui/react-slot class-variance-authority clsx lucide-react tailwind-merge
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { JsonSchemaSelector, JsonSchemaEntry } from '@cisri/json-schema-selector';
|
|
23
|
+
|
|
24
|
+
const entries: JsonSchemaEntry[] = [
|
|
25
|
+
{
|
|
26
|
+
id: 'user',
|
|
27
|
+
name: 'User',
|
|
28
|
+
description: 'User schema',
|
|
29
|
+
schema: { type: 'object', properties: { name: { type: 'string' } } },
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export default function App() {
|
|
34
|
+
return (
|
|
35
|
+
<JsonSchemaSelector
|
|
36
|
+
entries={entries}
|
|
37
|
+
onSelect={(entry) => console.log('selected', entry)}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Tailwind 配置
|
|
44
|
+
|
|
45
|
+
Ensure your `tailwind.config.ts` `content` array includes the package path so all component classes are scanned:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
content: [
|
|
49
|
+
'./node_modules/@cisri/json-schema-selector/dist/**/*.{js,cjs}',
|
|
50
|
+
];
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 自定义样式
|
|
54
|
+
|
|
55
|
+
This component is built on top of shadcn/ui CSS variables (such as `--card`, `--primary`, `--muted`, etc.). You can override the appearance by redefining CSS variables or passing `className` / `classNames`:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<JsonSchemaSelector
|
|
59
|
+
entries={entries}
|
|
60
|
+
onSelect={(entry) => console.log('selected', entry)}
|
|
61
|
+
classNames={{
|
|
62
|
+
root: 'inline-block',
|
|
63
|
+
dialogContent: 'w-[720px] max-w-full',
|
|
64
|
+
list: 'bg-muted/30',
|
|
65
|
+
schemaPreview: 'border-border',
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
/* Override global theme via CSS variables */
|
|
72
|
+
:root {
|
|
73
|
+
--card: 0 0% 100%;
|
|
74
|
+
--card-foreground: 222 84% 5%;
|
|
75
|
+
--primary: 221 83% 53%;
|
|
76
|
+
--primary-foreground: 210 40% 98%;
|
|
77
|
+
--muted: 210 40% 96%;
|
|
78
|
+
--muted-foreground: 215 16% 47%;
|
|
79
|
+
--border: 214 32% 91%;
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Props
|
|
84
|
+
|
|
85
|
+
| Prop | Type | Description |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `entries` | `JsonSchemaEntry[]` | List of schema entries to select from. |
|
|
88
|
+
| `selectedId` | `string` | ID of the currently selected entry. |
|
|
89
|
+
| `onSelect` | `(entry: JsonSchemaEntry) => void` | Callback when an entry is confirmed. |
|
|
90
|
+
| `onSearch` | `(keyword: string) => void` | Optional external search handler. |
|
|
91
|
+
| `searchDebounceMs` | `number` | Debounce delay for local search (default: `300`). |
|
|
92
|
+
| `loading` | `boolean` | Show skeleton loaders. |
|
|
93
|
+
| `trigger` | `React.ReactNode` | Custom trigger element. |
|
|
94
|
+
| `title` | `string` | Dialog title. |
|
|
95
|
+
| `emptyText` | `string` | Text shown when no entries match. |
|
|
96
|
+
| `searchPlaceholder` | `string` | Search input placeholder. |
|
|
97
|
+
| `className` | `string` | Additional classes for the root element. |
|
|
98
|
+
| `classNames` | `JsonSchemaSelectorClassNames` | Style overrides for sub-components. |
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),c=require("@cisri/core"),I=require("@cisri/json-schema-core"),o=require("@cisri/shadcn"),J=require("lucide-react");function O(r,d){const[u,l]=i.useState(r);return i.useEffect(()=>{const m=window.setTimeout(()=>l(r),d);return()=>window.clearTimeout(m)},[r,d]),u}function S({label:r,value:d,className:u}){const l=i.useMemo(()=>JSON.stringify(d,null,2),[d]);return e.jsxs("div",{className:c.cn("flex flex-col gap-2",u),children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground",children:r}),e.jsx("pre",{className:"rounded-md border border-border bg-muted/50 p-3 font-mono text-xs overflow-auto max-h-[240px]",children:l})]})}function B({entries:r,selectedId:d,onSelect:u,onSearch:l,searchDebounceMs:m=300,loading:D=!1,trigger:k,title:y="选择 Schema",emptyText:q="暂无可用 schema",searchPlaceholder:E="搜索 schema...",className:P,classNames:t}){const[f,b]=i.useState(!1),[p,v]=i.useState(""),w=O(p,m),[x,g]=i.useState(d??null),h=x;i.useEffect(()=>{f&&(l==null||l(w))},[w,l,f]),i.useEffect(()=>{f&&(g(d??null),v(""))},[f,d]);const s=i.useMemo(()=>{if(l)return r;const n=p.toLowerCase();return r.filter(j=>{var C;return j.name.toLowerCase().includes(n)||(((C=j.description)==null?void 0:C.toLowerCase().includes(n))??!1)})},[r,p,l]);i.useEffect(()=>{h&&!s.some(n=>n.id===h)&&g(null)},[h,s]);const a=i.useMemo(()=>r.find(n=>n.id===h)??null,[r,h]),M=i.useMemo(()=>a?I.generateSampleData(a.schema):null,[a]),T=i.useCallback(()=>{const n=r.find(j=>j.id===x);n&&(u(n),b(!1))},[r,u,x]);return e.jsx("div",{className:c.cn(t==null?void 0:t.root,P),children:e.jsxs(o.Dialog,{open:f,onOpenChange:b,children:[e.jsx(o.DialogTrigger,{asChild:!0,children:k??e.jsx(o.Button,{type:"button",className:t==null?void 0:t.trigger,children:"选择 Schema"})}),e.jsxs(o.DialogContent,{className:c.cn("flex max-h-[80vh] flex-col overflow-hidden p-0",t==null?void 0:t.dialogContent),children:[e.jsxs(o.DialogHeader,{className:"px-6 pt-6",children:[e.jsx(o.DialogTitle,{children:y}),e.jsx(o.DialogDescription,{children:"在左侧选择 schema,右侧可查看结构和示例数据。"})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:c.cn("flex w-1/3 flex-col border-r border-border p-4",t==null?void 0:t.list),children:[e.jsxs("div",{className:"relative mb-3",children:[e.jsx(J.Search,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(o.Input,{value:p,onChange:n=>v(n.target.value),placeholder:E,className:c.cn("pl-9",t==null?void 0:t.searchInput),"aria-label":"搜索 schema"})]}),D?e.jsxs("div",{className:"space-y-2",children:[e.jsx(o.Skeleton,{className:"h-10 w-full"}),e.jsx(o.Skeleton,{className:"h-10 w-full"}),e.jsx(o.Skeleton,{className:"h-10 w-full"})]}):s.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:q}):e.jsx(o.ScrollArea,{className:"flex-1",children:e.jsx("div",{"aria-label":"schema 列表",className:"space-y-1 pr-3",children:s.map(n=>e.jsxs("button",{type:"button","aria-label":n.name,"aria-pressed":x===n.id,onClick:()=>g(n.id),className:c.cn("w-full rounded-md border border-transparent px-3 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",x===n.id&&"border-border bg-muted",t==null?void 0:t.listItem),children:[e.jsx("div",{className:"font-medium",children:n.name}),n.description&&e.jsx("div",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:n.description})]},n.id))})})]}),e.jsx("div",{className:c.cn("flex w-2/3 flex-col gap-4 overflow-auto p-4",t==null?void 0:t.previewPanel),children:a?e.jsxs(e.Fragment,{children:[e.jsx(S,{label:"Schema",value:a.schema,className:t==null?void 0:t.schemaPreview}),e.jsx(S,{label:"示例数据",value:M,className:t==null?void 0:t.samplePreview})]}):e.jsx("div",{className:"flex h-full flex-col items-center justify-center text-sm text-muted-foreground",children:"请从左侧选择一个 schema 以预览"})})]}),e.jsx(o.Separator,{}),e.jsxs(o.DialogFooter,{className:c.cn("px-6 pb-6 pt-2",t==null?void 0:t.footer),children:[e.jsx(o.Button,{type:"button",variant:"outline",onClick:()=>b(!1),children:"取消"}),e.jsx(o.Button,{type:"button",onClick:T,disabled:!x,children:"确定"})]})]})]})})}exports.JsonSchemaSelector=B;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EACV,eAAe,EACf,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { jsx as t, jsxs as n, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useEffect as g, useMemo as v, useCallback as H } from "react";
|
|
3
|
+
import { cn as l } from "@cisri/core";
|
|
4
|
+
import { generateSampleData as M } from "@cisri/json-schema-core";
|
|
5
|
+
import { Dialog as q, DialogTrigger as z, Button as k, DialogContent as G, DialogHeader as Q, DialogTitle as R, DialogDescription as U, Input as V, Skeleton as y, ScrollArea as W, Separator as X, DialogFooter as Y } from "@cisri/shadcn";
|
|
6
|
+
import { Search as Z } from "lucide-react";
|
|
7
|
+
function _(r, d) {
|
|
8
|
+
const [u, i] = b(r);
|
|
9
|
+
return g(() => {
|
|
10
|
+
const w = window.setTimeout(() => i(r), d);
|
|
11
|
+
return () => window.clearTimeout(w);
|
|
12
|
+
}, [r, d]), u;
|
|
13
|
+
}
|
|
14
|
+
function T({
|
|
15
|
+
label: r,
|
|
16
|
+
value: d,
|
|
17
|
+
className: u
|
|
18
|
+
}) {
|
|
19
|
+
const i = v(() => JSON.stringify(d, null, 2), [d]);
|
|
20
|
+
return /* @__PURE__ */ n("div", { className: l("flex flex-col gap-2", u), children: [
|
|
21
|
+
/* @__PURE__ */ t("h4", { className: "text-xs font-medium text-muted-foreground", children: r }),
|
|
22
|
+
/* @__PURE__ */ t("pre", { className: "rounded-md border border-border bg-muted/50 p-3 font-mono text-xs overflow-auto max-h-[240px]", children: i })
|
|
23
|
+
] });
|
|
24
|
+
}
|
|
25
|
+
function re({
|
|
26
|
+
entries: r,
|
|
27
|
+
selectedId: d,
|
|
28
|
+
onSelect: u,
|
|
29
|
+
onSearch: i,
|
|
30
|
+
searchDebounceMs: w = 300,
|
|
31
|
+
loading: j = !1,
|
|
32
|
+
trigger: E,
|
|
33
|
+
title: J = "选择 Schema",
|
|
34
|
+
emptyText: L = "暂无可用 schema",
|
|
35
|
+
searchPlaceholder: O = "搜索 schema...",
|
|
36
|
+
className: F,
|
|
37
|
+
classNames: e
|
|
38
|
+
}) {
|
|
39
|
+
const [f, C] = b(!1), [a, P] = b(""), I = _(a, w), [c, D] = b(d ?? null), h = c;
|
|
40
|
+
g(() => {
|
|
41
|
+
f && (i == null || i(I));
|
|
42
|
+
}, [I, i, f]), g(() => {
|
|
43
|
+
f && (D(d ?? null), P(""));
|
|
44
|
+
}, [f, d]);
|
|
45
|
+
const m = v(() => {
|
|
46
|
+
if (i) return r;
|
|
47
|
+
const o = a.toLowerCase();
|
|
48
|
+
return r.filter(
|
|
49
|
+
(x) => {
|
|
50
|
+
var S;
|
|
51
|
+
return x.name.toLowerCase().includes(o) || (((S = x.description) == null ? void 0 : S.toLowerCase().includes(o)) ?? !1);
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}, [r, a, i]);
|
|
55
|
+
g(() => {
|
|
56
|
+
h && !m.some((o) => o.id === h) && D(null);
|
|
57
|
+
}, [h, m]);
|
|
58
|
+
const p = v(
|
|
59
|
+
() => r.find((o) => o.id === h) ?? null,
|
|
60
|
+
[r, h]
|
|
61
|
+
), K = v(
|
|
62
|
+
() => p ? M(p.schema) : null,
|
|
63
|
+
[p]
|
|
64
|
+
), A = H(() => {
|
|
65
|
+
const o = r.find((x) => x.id === c);
|
|
66
|
+
o && (u(o), C(!1));
|
|
67
|
+
}, [r, u, c]);
|
|
68
|
+
return /* @__PURE__ */ t("div", { className: l(e == null ? void 0 : e.root, F), children: /* @__PURE__ */ n(q, { open: f, onOpenChange: C, children: [
|
|
69
|
+
/* @__PURE__ */ t(z, { asChild: !0, children: E ?? /* @__PURE__ */ t(k, { type: "button", className: e == null ? void 0 : e.trigger, children: "选择 Schema" }) }),
|
|
70
|
+
/* @__PURE__ */ n(
|
|
71
|
+
G,
|
|
72
|
+
{
|
|
73
|
+
className: l(
|
|
74
|
+
"flex max-h-[80vh] flex-col overflow-hidden p-0",
|
|
75
|
+
e == null ? void 0 : e.dialogContent
|
|
76
|
+
),
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ n(Q, { className: "px-6 pt-6", children: [
|
|
79
|
+
/* @__PURE__ */ t(R, { children: J }),
|
|
80
|
+
/* @__PURE__ */ t(U, { children: "在左侧选择 schema,右侧可查看结构和示例数据。" })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ n("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
83
|
+
/* @__PURE__ */ n("div", { className: l("flex w-1/3 flex-col border-r border-border p-4", e == null ? void 0 : e.list), children: [
|
|
84
|
+
/* @__PURE__ */ n("div", { className: "relative mb-3", children: [
|
|
85
|
+
/* @__PURE__ */ t(Z, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
86
|
+
/* @__PURE__ */ t(
|
|
87
|
+
V,
|
|
88
|
+
{
|
|
89
|
+
value: a,
|
|
90
|
+
onChange: (o) => P(o.target.value),
|
|
91
|
+
placeholder: O,
|
|
92
|
+
className: l("pl-9", e == null ? void 0 : e.searchInput),
|
|
93
|
+
"aria-label": "搜索 schema"
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }),
|
|
97
|
+
j ? /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
98
|
+
/* @__PURE__ */ t(y, { className: "h-10 w-full" }),
|
|
99
|
+
/* @__PURE__ */ t(y, { className: "h-10 w-full" }),
|
|
100
|
+
/* @__PURE__ */ t(y, { className: "h-10 w-full" })
|
|
101
|
+
] }) : m.length === 0 ? /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: L }) : /* @__PURE__ */ t(W, { className: "flex-1", children: /* @__PURE__ */ t("div", { "aria-label": "schema 列表", className: "space-y-1 pr-3", children: m.map((o) => /* @__PURE__ */ n(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
type: "button",
|
|
105
|
+
"aria-label": o.name,
|
|
106
|
+
"aria-pressed": c === o.id,
|
|
107
|
+
onClick: () => D(o.id),
|
|
108
|
+
className: l(
|
|
109
|
+
"w-full rounded-md border border-transparent px-3 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
110
|
+
c === o.id && "border-border bg-muted",
|
|
111
|
+
e == null ? void 0 : e.listItem
|
|
112
|
+
),
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ t("div", { className: "font-medium", children: o.name }),
|
|
115
|
+
o.description && /* @__PURE__ */ t("div", { className: "mt-0.5 line-clamp-2 text-xs text-muted-foreground", children: o.description })
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
o.id
|
|
119
|
+
)) }) })
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ t("div", { className: l("flex w-2/3 flex-col gap-4 overflow-auto p-4", e == null ? void 0 : e.previewPanel), children: p ? /* @__PURE__ */ n(B, { children: [
|
|
122
|
+
/* @__PURE__ */ t(
|
|
123
|
+
T,
|
|
124
|
+
{
|
|
125
|
+
label: "Schema",
|
|
126
|
+
value: p.schema,
|
|
127
|
+
className: e == null ? void 0 : e.schemaPreview
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ t(
|
|
131
|
+
T,
|
|
132
|
+
{
|
|
133
|
+
label: "示例数据",
|
|
134
|
+
value: K,
|
|
135
|
+
className: e == null ? void 0 : e.samplePreview
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
] }) : /* @__PURE__ */ t("div", { className: "flex h-full flex-col items-center justify-center text-sm text-muted-foreground", children: "请从左侧选择一个 schema 以预览" }) })
|
|
139
|
+
] }),
|
|
140
|
+
/* @__PURE__ */ t(X, {}),
|
|
141
|
+
/* @__PURE__ */ n(Y, { className: l("px-6 pb-6 pt-2", e == null ? void 0 : e.footer), children: [
|
|
142
|
+
/* @__PURE__ */ t(k, { type: "button", variant: "outline", onClick: () => C(!1), children: "取消" }),
|
|
143
|
+
/* @__PURE__ */ t(k, { type: "button", onClick: A, disabled: !c, children: "确定" })
|
|
144
|
+
] })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] }) });
|
|
149
|
+
}
|
|
150
|
+
export {
|
|
151
|
+
re as JsonSchemaSelector
|
|
152
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { JsonSchema } from '@cisri/json-schema-core';
|
|
3
|
+
export interface JsonSchemaEntry {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
schema: JsonSchema;
|
|
8
|
+
}
|
|
9
|
+
export interface JsonSchemaSelectorClassNames {
|
|
10
|
+
root?: string;
|
|
11
|
+
trigger?: string;
|
|
12
|
+
dialogContent?: string;
|
|
13
|
+
searchInput?: string;
|
|
14
|
+
list?: string;
|
|
15
|
+
listItem?: string;
|
|
16
|
+
previewPanel?: string;
|
|
17
|
+
schemaPreview?: string;
|
|
18
|
+
samplePreview?: string;
|
|
19
|
+
footer?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface JsonSchemaSelectorProps {
|
|
22
|
+
entries: JsonSchemaEntry[];
|
|
23
|
+
selectedId?: string;
|
|
24
|
+
onSelect: (entry: JsonSchemaEntry) => void;
|
|
25
|
+
onSearch?: (keyword: string) => void;
|
|
26
|
+
searchDebounceMs?: number;
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
trigger?: React.ReactNode;
|
|
29
|
+
title?: string;
|
|
30
|
+
emptyText?: string;
|
|
31
|
+
searchPlaceholder?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
classNames?: JsonSchemaSelectorClassNames;
|
|
34
|
+
}
|
|
35
|
+
export declare function JsonSchemaSelector({ entries, selectedId, onSelect, onSearch, searchDebounceMs, loading, trigger, title, emptyText, searchPlaceholder, className, classNames, }: JsonSchemaSelectorProps): React.JSX.Element;
|
|
36
|
+
//# sourceMappingURL=json-schema-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-selector.d.ts","sourceRoot":"","sources":["../src/json-schema-selector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAkB1D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,4BAA4B,CAAC;CAC3C;AA+BD,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,gBAAsB,EACtB,OAAe,EACf,OAAO,EACP,KAAmB,EACnB,SAAyB,EACzB,iBAAkC,EAClC,SAAS,EACT,UAAU,GACX,EAAE,uBAAuB,qBAmKzB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cisri/json-schema-selector",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "JSON Schema selector business component based on shadcn/ui",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@cisri/core": "1.0.0",
|
|
25
|
+
"@cisri/json-schema-core": "1.0.0",
|
|
26
|
+
"@cisri/shadcn": "1.0.0"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
30
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
31
|
+
"lucide-react": "^0.300.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"lucide-react": {
|
|
35
|
+
"optional": false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@testing-library/jest-dom": "^6.4.5",
|
|
40
|
+
"@testing-library/react": "^15.0.7",
|
|
41
|
+
"@testing-library/user-event": "^14.5.2",
|
|
42
|
+
"@types/react": "^18.3.0",
|
|
43
|
+
"@types/react-dom": "^18.3.0",
|
|
44
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
45
|
+
"jsdom": "^24.0.0",
|
|
46
|
+
"react": "^18.3.1",
|
|
47
|
+
"react-dom": "^18.3.1",
|
|
48
|
+
"typescript": "^5.4.5",
|
|
49
|
+
"vite": "^5.2.11",
|
|
50
|
+
"vitest": "^1.6.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc && vite build",
|
|
54
|
+
"test": "vitest run",
|
|
55
|
+
"test:watch": "vitest"
|
|
56
|
+
}
|
|
57
|
+
}
|