@gravitee/graphene-core 3.27.0-fix-found-363-array-field-title.2c7bdf6 → 3.27.0-fix-found-363-array-field-title.bcfeef3

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,8 +4,9 @@ interface SchemaFieldProps {
4
4
  readonly node: SchemaNode;
5
5
  readonly name?: string;
6
6
  readonly depth?: number;
7
+ readonly hideTitle?: boolean;
7
8
  }
8
- declare function SchemaField({ node, name, depth }: SchemaFieldProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
9
+ declare function SchemaField({ node, name, depth, hideTitle }: SchemaFieldProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
9
10
  export { SchemaField };
10
11
  export type { SchemaFieldProps };
11
12
  //# sourceMappingURL=SchemaField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaField.d.ts","sourceRoot":"","sources":["../../../src/composed/JsonSchemaForm/SchemaField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAgBhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAejD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAG1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAQD,iBAAS,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAS,EAAE,EAAE,gBAAgB,+TAgC/D;AAgFD,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":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAgBhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAejD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAG1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,iBAAS,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAS,EAAE,SAAS,EAAE,EAAE,gBAAgB,+TAgC1E;AAsFD,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/array/ArrayField.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD,UAAU,eAAe;IACvB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAUD,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,+BAkDzD;AAuED,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/array/ArrayField.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD,UAAU,eAAe;IACvB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAUD,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,+BAkDzD;AA0ED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -3,7 +3,8 @@ interface ObjectFieldProps {
3
3
  readonly node: SchemaNode;
4
4
  readonly name?: string;
5
5
  readonly depth: number;
6
+ readonly hideTitle?: boolean;
6
7
  }
7
- declare function ObjectField({ node, name, depth }: ObjectFieldProps): import("react").JSX.Element;
8
+ declare function ObjectField({ node, name, depth, hideTitle }: ObjectFieldProps): import("react").JSX.Element;
8
9
  export { ObjectField };
9
10
  //# sourceMappingURL=ObjectField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectField.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/object/ObjectField.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMrD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAQD,iBAAS,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,gBAAgB,+BAgD3D;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"ObjectField.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/object/ObjectField.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMrD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,iBAAS,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAgDtE;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -29367,7 +29367,7 @@ function MJ({ node: e, name: t, depth: n }) {
29367
29367
  });
29368
29368
  }
29369
29369
  function NJ({ index: e, path: t, itemsNode: n, depth: r, disabled: i, canRemove: a, onRemove: o, ctx: s }) {
29370
- let c = `${t}.${e}`;
29370
+ let c = `${t}.${e}`, l = `${n?.schema.title?.trim() || "Item"} ${e + 1}`;
29371
29371
  return /* @__PURE__ */ G(TC, {
29372
29372
  defaultOpen: !0,
29373
29373
  className: "border-b border-border/60 last:border-b-0",
@@ -29378,18 +29378,18 @@ function NJ({ index: e, path: t, itemsNode: n, depth: r, disabled: i, canRemove:
29378
29378
  children: /* @__PURE__ */ G("button", {
29379
29379
  type: "button",
29380
29380
  className: "group/array-item-trigger flex flex-1 items-center gap-2 px-1 py-2 text-left text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
29381
- "aria-label": `Toggle item ${e + 1}`,
29381
+ "aria-label": `Toggle ${l}`,
29382
29382
  children: [/* @__PURE__ */ W(se, {
29383
29383
  "aria-hidden": "true",
29384
29384
  className: "size-4 text-muted-foreground transition-transform duration-150 group-data-[state=closed]/array-item-trigger:-rotate-90"
29385
- }), /* @__PURE__ */ G("span", { children: ["Item ", e + 1] })]
29385
+ }), /* @__PURE__ */ W("span", { children: l })]
29386
29386
  })
29387
29387
  }), /* @__PURE__ */ W(Qv, {
29388
29388
  type: "button",
29389
29389
  variant: "ghost",
29390
29390
  size: "icon-xs",
29391
29391
  disabled: !a,
29392
- "aria-label": `Remove item ${e + 1}`,
29392
+ "aria-label": `Remove ${l}`,
29393
29393
  onClick: o,
29394
29394
  children: /* @__PURE__ */ W(B, { "aria-hidden": "true" })
29395
29395
  })]
@@ -29404,7 +29404,8 @@ function NJ({ index: e, path: t, itemsNode: n, depth: r, disabled: i, canRemove:
29404
29404
  children: /* @__PURE__ */ W(mY, {
29405
29405
  node: n,
29406
29406
  name: "",
29407
- depth: r + 1
29407
+ depth: r + 1,
29408
+ hideTitle: !0
29408
29409
  })
29409
29410
  })
29410
29411
  }) })]
@@ -29857,11 +29858,11 @@ function iY({ path: e, value: t }) {
29857
29858
  }
29858
29859
  //#endregion
29859
29860
  //#region src/composed/JsonSchemaForm/fields/object/ObjectField.tsx
29860
- function aY({ node: e, name: t, depth: n }) {
29861
- let r = D(), { schema: i } = e, a = t ? r.basePath ? `${r.basePath}.${t}` : t : r.basePath, o = EJ(i) || DJ(i), s = Ve(() => e.dependencyBranches ?? [], [e.dependencyBranches]), c = s.length > 0, l = (e.properties || o || c) && /* @__PURE__ */ W(m.Provider, {
29861
+ function aY({ node: e, name: t, depth: n, hideTitle: r }) {
29862
+ let i = D(), { schema: a } = e, o = t ? i.basePath ? `${i.basePath}.${t}` : t : i.basePath, s = EJ(a) || DJ(a), c = Ve(() => e.dependencyBranches ?? [], [e.dependencyBranches]), l = c.length > 0, u = (e.properties || s || l) && /* @__PURE__ */ W(m.Provider, {
29862
29863
  value: {
29863
- ...r,
29864
- basePath: a
29864
+ ...i,
29865
+ basePath: o
29865
29866
  },
29866
29867
  children: /* @__PURE__ */ G(T, { children: [
29867
29868
  e.properties && Array.from(e.properties).map(([e, t]) => /* @__PURE__ */ W(mY, {
@@ -29869,35 +29870,35 @@ function aY({ node: e, name: t, depth: n }) {
29869
29870
  name: e,
29870
29871
  depth: n + 1
29871
29872
  }, e)),
29872
- c && /* @__PURE__ */ W(XJ, {
29873
- branches: s,
29874
- basePath: a
29873
+ l && /* @__PURE__ */ W(XJ, {
29874
+ branches: c,
29875
+ basePath: o
29875
29876
  }),
29876
- s.map((e, t) => /* @__PURE__ */ W(aJ, {
29877
- condition: cJ(e.showIf, a),
29877
+ c.map((e, t) => /* @__PURE__ */ W(aJ, {
29878
+ condition: cJ(e.showIf, o),
29878
29879
  children: Array.from(e.properties).map(([e, t]) => /* @__PURE__ */ W(mY, {
29879
29880
  node: t,
29880
29881
  name: e,
29881
29882
  depth: n + 1
29882
29883
  }, e))
29883
29884
  }, `dep-${t}`)),
29884
- o && /* @__PURE__ */ W(rY, {
29885
+ s && /* @__PURE__ */ W(rY, {
29885
29886
  node: e,
29886
29887
  depth: n
29887
29888
  })
29888
29889
  ] })
29889
- }), u = typeof i.title == "string" && i.title.length > 0 || t !== void 0 && t.length > 0, d = i.gioConfig?.uiBorder === "full";
29890
- return n === 0 || !u ? /* @__PURE__ */ W(Ke, { children: l }) : /* @__PURE__ */ G(N, {
29891
- className: d ? "rounded-lg border border-border px-5 pt-2 pb-5" : void 0,
29890
+ }), d = typeof a.title == "string" && a.title.length > 0 || t !== void 0 && t.length > 0, f = a.gioConfig?.uiBorder === "full";
29891
+ return n === 0 || !d || r ? /* @__PURE__ */ W(Ke, { children: u }) : /* @__PURE__ */ G(N, {
29892
+ className: f ? "rounded-lg border border-border px-5 pt-2 pb-5" : void 0,
29892
29893
  children: [
29893
29894
  /* @__PURE__ */ W(y, {
29894
- className: d ? "px-2 text-base font-semibold" : "text-base font-semibold",
29895
- required: i.isRequired,
29896
- children: k(i, t)
29895
+ className: f ? "px-2 text-base font-semibold" : "text-base font-semibold",
29896
+ required: a.isRequired,
29897
+ children: k(a, t)
29897
29898
  }),
29898
- i.description && /* @__PURE__ */ W(v, { children: i.description }),
29899
- i.gioConfig?.banner && /* @__PURE__ */ W(j, { banner: i.gioConfig.banner }),
29900
- l
29899
+ a.description && /* @__PURE__ */ W(v, { children: a.description }),
29900
+ a.gioConfig?.banner && /* @__PURE__ */ W(j, { banner: a.gioConfig.banner }),
29901
+ u
29901
29902
  ]
29902
29903
  });
29903
29904
  }
@@ -30039,57 +30040,58 @@ function fY(e) {
30039
30040
  //#endregion
30040
30041
  //#region src/composed/JsonSchemaForm/SchemaField.tsx
30041
30042
  var pY = Ne(() => import("./CodeEditorField-QyRX-Ky-.js").then((e) => ({ default: e.CodeEditorField })));
30042
- function mY({ node: e, name: t, depth: n = 0 }) {
30043
- let { basePath: r } = D(), { schema: i } = e, a = t ?? "", o = t ? r ? `${r}.${t}` : t : r, s = Ve(() => [o], [o]), c = Ve(() => e.displayIf ? cJ(e.displayIf, r) : void 0, [e.displayIf, r]), l = Ve(() => e.disableIf ? cJ(e.disableIf, r) : void 0, [e.disableIf, r]);
30044
- if (i.deprecated === !0) return null;
30045
- let u = hY(e, a, t, n);
30046
- return u === null ? null : (l && (u = /* @__PURE__ */ W(oJ, {
30043
+ function mY({ node: e, name: t, depth: n = 0, hideTitle: r }) {
30044
+ let { basePath: i } = D(), { schema: a } = e, o = t ?? "", s = t ? i ? `${i}.${t}` : t : i, c = Ve(() => [s], [s]), l = Ve(() => e.displayIf ? cJ(e.displayIf, i) : void 0, [e.displayIf, i]), u = Ve(() => e.disableIf ? cJ(e.disableIf, i) : void 0, [e.disableIf, i]);
30045
+ if (a.deprecated === !0) return null;
30046
+ let d = hY(e, o, t, n, r);
30047
+ return d === null ? null : (u && (d = /* @__PURE__ */ W(oJ, {
30048
+ condition: u,
30049
+ children: d
30050
+ })), l ? /* @__PURE__ */ W(aJ, {
30047
30051
  condition: l,
30048
- children: u
30049
- })), c ? /* @__PURE__ */ W(aJ, {
30050
- condition: c,
30051
- unregisterOnHide: s,
30052
- children: u
30053
- }) : u);
30052
+ unregisterOnHide: c,
30053
+ children: d
30054
+ }) : d);
30054
30055
  }
30055
- function hY(e, t, n, r) {
30056
- let { schema: i } = e, a = gY(i.type);
30057
- return Array.isArray(i.enum) && i.enum.length > 0 || bJ(i) ? /* @__PURE__ */ W(UJ, {
30056
+ function hY(e, t, n, r, i) {
30057
+ let { schema: a } = e, o = gY(a.type);
30058
+ return Array.isArray(a.enum) && a.enum.length > 0 || bJ(a) ? /* @__PURE__ */ W(UJ, {
30058
30059
  node: e,
30059
30060
  name: t
30060
- }) : xJ(i) ? /* @__PURE__ */ W(GJ, {
30061
+ }) : xJ(a) ? /* @__PURE__ */ W(GJ, {
30061
30062
  node: e,
30062
30063
  name: t
30063
- }) : SJ(i) ? /* @__PURE__ */ W(FJ, {
30064
+ }) : SJ(a) ? /* @__PURE__ */ W(FJ, {
30064
30065
  node: e,
30065
30066
  name: t
30066
- }) : TJ(i) ? /* @__PURE__ */ W(ke, {
30067
+ }) : TJ(a) ? /* @__PURE__ */ W(ke, {
30067
30068
  fallback: null,
30068
30069
  children: /* @__PURE__ */ W(pY, {
30069
30070
  node: e,
30070
30071
  name: t
30071
30072
  })
30072
- }) : a === "null" ? /* @__PURE__ */ W(qJ, {}) : a === "boolean" ? /* @__PURE__ */ W(zJ, {
30073
+ }) : o === "null" ? /* @__PURE__ */ W(qJ, {}) : o === "boolean" ? /* @__PURE__ */ W(zJ, {
30073
30074
  node: e,
30074
30075
  name: t
30075
- }) : a === "integer" || a === "number" ? /* @__PURE__ */ W(JJ, {
30076
+ }) : o === "integer" || o === "number" ? /* @__PURE__ */ W(JJ, {
30076
30077
  node: e,
30077
30078
  name: t
30078
- }) : CJ(i) ? /* @__PURE__ */ W(lY, {
30079
+ }) : CJ(a) ? /* @__PURE__ */ W(lY, {
30079
30080
  node: e,
30080
30081
  name: t
30081
- }) : a === "string" ? /* @__PURE__ */ W(cY, {
30082
+ }) : o === "string" ? /* @__PURE__ */ W(cY, {
30082
30083
  node: e,
30083
30084
  name: t
30084
- }) : i.properties || a === "object" || EJ(i) || DJ(i) ? /* @__PURE__ */ W(aY, {
30085
+ }) : a.properties || o === "object" || EJ(a) || DJ(a) ? /* @__PURE__ */ W(aY, {
30085
30086
  node: e,
30086
30087
  name: n,
30087
- depth: r
30088
- }) : a === "array" && i.items && !Array.isArray(i.items) ? /* @__PURE__ */ W(MJ, {
30088
+ depth: r,
30089
+ hideTitle: i
30090
+ }) : o === "array" && a.items && !Array.isArray(a.items) ? /* @__PURE__ */ W(MJ, {
30089
30091
  node: e,
30090
30092
  name: n,
30091
30093
  depth: r
30092
- }) : (console.warn(`[JsonSchemaForm] No renderer for schema at "${n ?? "root"}" (${_Y(i)}). Field is omitted.`), null);
30094
+ }) : (console.warn(`[JsonSchemaForm] No renderer for schema at "${n ?? "root"}" (${_Y(a)}). Field is omitted.`), null);
30093
30095
  }
30094
30096
  function gY(e) {
30095
30097
  return Array.isArray(e) ? e.find((e) => e !== "null") ?? e[0] : e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/graphene-core",
3
- "version": "3.27.0-fix-found-363-array-field-title.2c7bdf6",
3
+ "version": "3.27.0-fix-found-363-array-field-title.bcfeef3",
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": [
@@ -102,7 +102,7 @@
102
102
  },
103
103
  "peerDependencies": {
104
104
  "@fontsource/dm-sans": ">=5.0.0",
105
- "@gravitee/graphene-core": "3.27.0-fix-found-363-array-field-title.2c7bdf6",
105
+ "@gravitee/graphene-core": "3.27.0-fix-found-363-array-field-title.bcfeef3",
106
106
  "@monaco-editor/react": "^4.7.0",
107
107
  "@tanstack/react-table": "^8.0.0",
108
108
  "@testing-library/dom": ">=10.0.0",