@gravitee/graphene-core 2.55.0 → 2.56.0-fix-monaco-hover.c920ed9

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 (47) hide show
  1. package/dist/Skeleton-C30qULzD.js +1745 -0
  2. package/dist/__stories__/fixtures/index.d.ts +1 -1
  3. package/dist/__stories__/fixtures/index.d.ts.map +1 -1
  4. package/dist/__stories__/fixtures/json-schema-form/disableIf.fixture.d.ts.map +1 -1
  5. package/dist/__stories__/fixtures/json-schema-form/displayIf.fixture.d.ts.map +1 -1
  6. package/dist/__stories__/fixtures/json-schema-form/index.d.ts +0 -1
  7. package/dist/__stories__/fixtures/json-schema-form/index.d.ts.map +1 -1
  8. package/dist/code-editor/index.js +229 -2
  9. package/dist/composed/AppLayout/AppLayout.d.ts.map +1 -1
  10. package/dist/composed/CodeEditor/CodeEditor.d.ts.map +1 -1
  11. package/dist/composed/CodeEditor/setupCodeEditor.d.ts +39 -34
  12. package/dist/composed/CodeEditor/setupCodeEditor.d.ts.map +1 -1
  13. package/dist/composed/JsonSchemaForm/JsonSchemaForm.d.ts.map +1 -1
  14. package/dist/composed/JsonSchemaForm/SchemaField.d.ts.map +1 -1
  15. package/dist/composed/JsonSchemaForm/conditional/ConditionalGate.d.ts.map +1 -1
  16. package/dist/composed/JsonSchemaForm/conditional/concretizeCondition.d.ts.map +1 -1
  17. package/dist/composed/JsonSchemaForm/conditional/evalCondition.d.ts +6 -6
  18. package/dist/composed/JsonSchemaForm/conditional/evalCondition.d.ts.map +1 -1
  19. package/dist/composed/JsonSchemaForm/fields/__test-utils__/setupJsonSchemaForm.d.ts +0 -1
  20. package/dist/composed/JsonSchemaForm/fields/__test-utils__/setupJsonSchemaForm.d.ts.map +1 -1
  21. package/dist/composed/JsonSchemaForm/form-bindings/resolveAt.d.ts.map +1 -1
  22. package/dist/composed/JsonSchemaForm/models/json-schema.types.d.ts +5 -5
  23. package/dist/composed/JsonSchemaForm/models/json-schema.types.d.ts.map +1 -1
  24. package/dist/composed/JsonSchemaForm/schema/buildIndex.d.ts.map +1 -1
  25. package/dist/composed/JsonSchemaForm/schema/types.d.ts +1 -3
  26. package/dist/composed/JsonSchemaForm/schema/types.d.ts.map +1 -1
  27. package/dist/composed/JsonSchemaForm/utils/schemaShape.d.ts +1 -2
  28. package/dist/composed/JsonSchemaForm/utils/schemaShape.d.ts.map +1 -1
  29. package/dist/icons/index.d.ts +0 -1
  30. package/dist/icons/index.d.ts.map +1 -1
  31. package/dist/icons/index.js +2 -2
  32. package/dist/{icons-YplRdF9A.js → icons-DdCWtjqd.js} +38 -316
  33. package/dist/index.js +8251 -8317
  34. package/dist/styles/custom-variants.css +0 -15
  35. package/dist/styles/globals.css +1 -1
  36. package/package.json +2 -1
  37. package/snippets/json-schema-form-simple.tsx +2 -20
  38. package/snippets/json-schema-form-with-meta.tsx +3 -18
  39. package/dist/CodeEditor-Cnn11Gx1.js +0 -2010
  40. package/dist/__stories__/fixtures/json-schema-form/code-editor.fixture.d.ts +0 -14
  41. package/dist/__stories__/fixtures/json-schema-form/code-editor.fixture.d.ts.map +0 -1
  42. package/dist/composed/JsonSchemaForm/fields/code-editor/CodeEditorField.d.ts +0 -8
  43. package/dist/composed/JsonSchemaForm/fields/code-editor/CodeEditorField.d.ts.map +0 -1
  44. package/dist/composed/JsonSchemaForm/utils/readPath.d.ts +0 -12
  45. package/dist/composed/JsonSchemaForm/utils/readPath.d.ts.map +0 -1
  46. package/dist/icons/products/GioEdgeManagementIcon.d.ts +0 -3
  47. package/dist/icons/products/GioEdgeManagementIcon.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/graphene-core",
3
- "version": "2.55.0",
3
+ "version": "2.56.0-fix-monaco-hover.c920ed9",
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": [
@@ -95,6 +95,7 @@
95
95
  },
96
96
  "peerDependencies": {
97
97
  "@fontsource/dm-sans": ">=5.0.0",
98
+ "@gravitee/graphene-core": "2.56.0-fix-monaco-hover.c920ed9",
98
99
  "@monaco-editor/react": "^4.7.0",
99
100
  "@tanstack/react-table": "^8.0.0",
100
101
  "@testing-library/dom": ">=10.0.0",
@@ -24,23 +24,10 @@ interface PluginConfigPageProps {
24
24
  // at the call site). A fresh object on every parent render defeats the `defaultValues`
25
25
  // memo and re-seeds the form, wiping in-progress user edits.
26
26
  readonly initialValue?: Record<string, unknown>;
27
-
28
- // Host environment / feature flags / lock state read by `gioConfig.displayIf` /
29
- // `gioConfig.disableIf` conditions of the form `{ "context.X": value }`. Remove this prop
30
- // entirely if your schemas declare no `context.X` references.
31
- readonly environment: 'production' | 'staging' | 'dev';
32
- readonly readonlyMode: boolean;
33
-
34
27
  readonly onSave: (data: Record<string, unknown>) => void;
35
28
  }
36
29
 
37
- export function PluginConfigPage({
38
- pluginSchema,
39
- initialValue,
40
- environment,
41
- readonlyMode,
42
- onSave,
43
- }: PluginConfigPageProps) {
30
+ export function PluginConfigPage({ pluginSchema, initialValue, onSave }: PluginConfigPageProps) {
44
31
  // Memoize so `jsonSchemaResolver` does not recompile ajv on every parent render.
45
32
  const resolver = useMemo(() => jsonSchemaResolver(pluginSchema), [pluginSchema]);
46
33
  const defaultValues = useMemo(
@@ -48,11 +35,6 @@ export function PluginConfigPage({
48
35
  [pluginSchema, initialValue],
49
36
  );
50
37
 
51
- // Stable object identity for the `context` prop. An inline `context={{ environment, readonlyMode }}`
52
- // would create a new ref on every parent render and bust JsonSchemaForm's internal memo, re-rendering
53
- // every field. `useMemo` keyed on the actual values keeps the ref stable until they change.
54
- const formContext = useMemo(() => ({ environment, readonlyMode }), [environment, readonlyMode]);
55
-
56
38
  const form = useForm({
57
39
  resolver,
58
40
  defaultValues,
@@ -64,7 +46,7 @@ export function PluginConfigPage({
64
46
  // <FieldError> remain the single source of validation messages.
65
47
  return (
66
48
  <form noValidate onSubmit={form.handleSubmit(onSave)} className="flex flex-1 flex-col gap-4 p-8">
67
- <JsonSchemaForm schema={pluginSchema} control={form.control} name="" context={formContext} />
49
+ <JsonSchemaForm schema={pluginSchema} control={form.control} name="" />
68
50
  <Button type="submit">Save</Button>
69
51
  </form>
70
52
  );
@@ -40,14 +40,10 @@ type FormValues = z.infer<typeof metaSchema> & { config: Record<string, unknown>
40
40
  interface PluginConfigPageProps {
41
41
  readonly pluginSchema: JsonSchema;
42
42
  readonly initialValue?: Partial<FormValues>;
43
- // Host environment / feature flags read by `gioConfig.displayIf` / `gioConfig.disableIf`
44
- // conditions of the form `{ "context.X": value }`. Remove if your schemas declare no
45
- // `context.X` references.
46
- readonly environment: 'production' | 'staging' | 'dev';
47
43
  readonly onSave: (data: FormValues) => void;
48
44
  }
49
45
 
50
- export function PluginConfigPage({ pluginSchema, initialValue, environment, onSave }: PluginConfigPageProps) {
46
+ export function PluginConfigPage({ pluginSchema, initialValue, onSave }: PluginConfigPageProps) {
51
47
  // `basePath: 'config'` must match the `name` prop on <JsonSchemaForm> below.
52
48
  // Cast widens zodResolver to the composite values shape — each inner resolver reads
53
49
  // only its own slice of `values` at runtime, so the cast is sound.
@@ -70,10 +66,6 @@ export function PluginConfigPage({ pluginSchema, initialValue, environment, onSa
70
66
  [pluginSchema],
71
67
  );
72
68
 
73
- // Stable identity for the `context` prop on JsonSchemaForm — inline `{{ environment }}`
74
- // would create a fresh ref each render and re-render every field downstream.
75
- const formContext = useMemo(() => ({ environment }), [environment]);
76
-
77
69
  const form = useForm<FormValues>({
78
70
  resolver,
79
71
  mode: 'onTouched',
@@ -96,15 +88,8 @@ export function PluginConfigPage({ pluginSchema, initialValue, environment, onSa
96
88
  </Field>
97
89
 
98
90
  {/* Plugin sub-tree — fields registered under `values.config.*`. JsonSchemaForm is typed
99
- against the generic RHF FieldValues; cast widens the narrow composite control.
100
- `context` is memoized at the call site (here, via the `formContext` const below) so
101
- a fresh ref does not bust JsonSchemaForm's internal memo every parent render. */}
102
- <JsonSchemaForm
103
- schema={pluginSchema}
104
- control={form.control as unknown as Control}
105
- name="config"
106
- context={formContext}
107
- />
91
+ against the generic RHF FieldValues; cast widens the narrow composite control. */}
92
+ <JsonSchemaForm schema={pluginSchema} control={form.control as unknown as Control} name="config" />
108
93
 
109
94
  <Button type="submit">Save</Button>
110
95
  </form>