@gravitee/graphene-core 2.24.0 → 2.25.0-fix-type-array.9d9334f

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.
@@ -4,7 +4,7 @@ interface SchemaFieldProps {
4
4
  readonly name?: string;
5
5
  readonly depth?: number;
6
6
  }
7
- declare function SchemaField({ schema, name, depth }: SchemaFieldProps): import("react/jsx-runtime").JSX.Element;
7
+ declare function SchemaField({ schema, name, depth }: SchemaFieldProps): import("react/jsx-runtime").JSX.Element | null;
8
8
  export { SchemaField };
9
9
  export type { SchemaFieldProps };
10
10
  //# sourceMappingURL=SchemaField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaField.d.ts","sourceRoot":"","sources":["../../../src/composed/JsonSchemaForm/SchemaField.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,UAAU,gBAAgB;IACxB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAG5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAOD,iBAAS,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAS,EAAE,EAAE,gBAAgB,2CAiDjE;AAyBD,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"SchemaField.d.ts","sourceRoot":"","sources":["../../../src/composed/JsonSchemaForm/SchemaField.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,UAAU,gBAAgB;IACxB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAG5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAOD,iBAAS,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAS,EAAE,EAAE,gBAAgB,kDAsDjE;AAoBD,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -30852,7 +30852,7 @@ function pJ({ schema: e, name: t }) {
30852
30852
  //#region src/composed/JsonSchemaForm/SchemaField.tsx
30853
30853
  function mJ({ schema: e, name: t, depth: n = 0 }) {
30854
30854
  EK();
30855
- let r = t ?? "";
30855
+ let r = t ?? "", i = hJ(e.type);
30856
30856
  return Array.isArray(e.enum) && e.enum.length > 0 || tJ(e) ? /* @__PURE__ */ W(sJ, {
30857
30857
  schema: e,
30858
30858
  name: r
@@ -30862,40 +30862,27 @@ function mJ({ schema: e, name: t, depth: n = 0 }) {
30862
30862
  }) : rJ(e) ? /* @__PURE__ */ W(Xq, {
30863
30863
  schema: e,
30864
30864
  name: r
30865
- }) : e.type === "null" ? /* @__PURE__ */ W(uJ, {}) : e.type === "boolean" ? /* @__PURE__ */ W(eJ, {
30865
+ }) : i === "null" ? /* @__PURE__ */ W(uJ, {}) : i === "boolean" ? /* @__PURE__ */ W(eJ, {
30866
30866
  schema: e,
30867
30867
  name: r
30868
- }) : e.type === "integer" || e.type === "number" ? /* @__PURE__ */ W(dJ, {
30868
+ }) : i === "integer" || i === "number" ? /* @__PURE__ */ W(dJ, {
30869
30869
  schema: e,
30870
30870
  name: r
30871
- }) : e.type === "string" ? /* @__PURE__ */ W(pJ, {
30871
+ }) : i === "string" ? /* @__PURE__ */ W(pJ, {
30872
30872
  schema: e,
30873
30873
  name: r
30874
- }) : e.properties || e.type === "object" ? /* @__PURE__ */ W(fJ, {
30874
+ }) : e.properties || i === "object" ? /* @__PURE__ */ W(fJ, {
30875
30875
  schema: e,
30876
30876
  name: t,
30877
30877
  depth: n
30878
- }) : e.type === "array" && e.items && !Array.isArray(e.items) ? /* @__PURE__ */ W(qq, {
30878
+ }) : i === "array" && e.items && !Array.isArray(e.items) ? /* @__PURE__ */ W(qq, {
30879
30879
  schema: e,
30880
30880
  name: t,
30881
30881
  depth: n
30882
- }) : /* @__PURE__ */ W(hJ, {
30883
- schema: e,
30884
- name: t ?? "root",
30885
- depth: n
30886
- });
30882
+ }) : (console.warn(`[JsonSchemaForm] No renderer for schema at "${t ?? "root"}" (${gJ(e)}). Field is omitted.`), null);
30887
30883
  }
30888
- function hJ({ schema: e, name: t, depth: n }) {
30889
- return /* @__PURE__ */ G("div", {
30890
- className: "font-[ui-monospace,monospace] text-sm",
30891
- style: { paddingLeft: `${n}rem` },
30892
- children: [
30893
- "[",
30894
- gJ(e),
30895
- "] ",
30896
- t
30897
- ]
30898
- });
30884
+ function hJ(e) {
30885
+ return Array.isArray(e) ? e.find((e) => e !== "null") ?? e[0] : e;
30899
30886
  }
30900
30887
  function gJ(e) {
30901
30888
  return e.type ? Array.isArray(e.type) ? e.type.join("|") : e.type : e.oneOf ? "oneOf" : e.anyOf ? "anyOf" : e.allOf ? "allOf" : e.const === void 0 ? "unknown" : "const";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/graphene-core",
3
- "version": "2.24.0",
3
+ "version": "2.25.0-fix-type-array.9d9334f",
4
4
  "type": "module",
5
5
  "description": "Gravitee's Graphene design system: accessible React components, design tokens, icons, and shared ESLint/TypeScript configs. Built on shadcn/ui and Tailwind.",
6
6
  "keywords": [
@@ -91,6 +91,7 @@
91
91
  },
92
92
  "peerDependencies": {
93
93
  "@fontsource/dm-sans": ">=5.0.0",
94
+ "@gravitee/graphene-core": "2.25.0-fix-type-array.9d9334f",
94
95
  "@tanstack/react-table": "^8.0.0",
95
96
  "@testing-library/dom": ">=10.0.0",
96
97
  "@testing-library/react": ">=16.0.0",