@gravitee/graphene-core 2.58.0-fix-monaco-hover.20a0111 → 2.58.0-fix-monaco-hover.f2e6e9e
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/dist/composed/JsonSchemaForm/conditional/useDependencyBranchSync.d.ts +27 -0
- package/dist/composed/JsonSchemaForm/conditional/useDependencyBranchSync.d.ts.map +1 -0
- package/dist/composed/JsonSchemaForm/fields/object/ObjectField.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/fields/oneOf/OneOfField.d.ts.map +1 -1
- package/dist/index.js +363 -318
- package/package.json +2 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Control, FieldValues } from 'react-hook-form';
|
|
2
|
+
import { DepBranch } from '../schema/types';
|
|
3
|
+
/**
|
|
4
|
+
* Centralized state sync for an unfolded `dependencies.X.oneOf` block.
|
|
5
|
+
*
|
|
6
|
+
* Watches the discriminator(s) and `unregister`s every property declared by a non-active branch
|
|
7
|
+
* that is NOT also declared by an active branch. The aggregation matters when sibling branches
|
|
8
|
+
* share a property at the same RHF path: mcp-acl's `LITERAL` and `EXPRESSION` both declare
|
|
9
|
+
* `patternValue`, so a per-gate `unregisterOnHide` (one per hidden branch) would wipe the path
|
|
10
|
+
* that the active branch just registered, leaving the displayed input in the DOM while the form
|
|
11
|
+
* state has dropped it — invisible data loss that only surfaces on the next round-trip.
|
|
12
|
+
*/
|
|
13
|
+
declare function useDependencyBranchSync(control: Control<FieldValues>, branches: readonly DepBranch[], basePath: string, externalContext: Record<string, unknown> | undefined): void;
|
|
14
|
+
/**
|
|
15
|
+
* Mount-gated wrapper around `useDependencyBranchSync`. Render `<DependencyBranchSyncer>` only
|
|
16
|
+
* when the parent has dep-branches — the hook (and its `useWatch` subscription + effect) then
|
|
17
|
+
* runs solely for the ObjectField / OneOfField instances that need it. Lets callers express the
|
|
18
|
+
* "no deps, no overhead" intent declaratively (`{has && <Syncer .../>}`) instead of polluting
|
|
19
|
+
* the hook with a runtime-conditional path that would still pay the `useWatch` cost.
|
|
20
|
+
*/
|
|
21
|
+
interface DependencyBranchSyncerProps {
|
|
22
|
+
readonly branches: readonly DepBranch[];
|
|
23
|
+
readonly basePath: string;
|
|
24
|
+
}
|
|
25
|
+
declare function DependencyBranchSyncer({ branches, basePath }: DependencyBranchSyncerProps): null;
|
|
26
|
+
export { DependencyBranchSyncer, useDependencyBranchSync };
|
|
27
|
+
//# sourceMappingURL=useDependencyBranchSync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDependencyBranchSync.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/conditional/useDependencyBranchSync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,iBAAiB,CAAC;AAE3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD;;;;;;;;;GASG;AACH,iBAAS,uBAAuB,CAC9B,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,EAC7B,QAAQ,EAAE,SAAS,SAAS,EAAE,EAC9B,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACnD,IAAI,CA0DN;AAED;;;;;;GAMG;AACH,UAAU,2BAA2B;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,iBAAS,sBAAsB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,2BAA2B,GAAG,IAAI,CAIzF;AAED,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectField.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/object/ObjectField.tsx"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneOfField.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/oneOf/OneOfField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OneOfField.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/oneOf/OneOfField.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,UAAU,eAAe;IACvB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,sCA0GnD;AAiBD,OAAO,EAAE,UAAU,EAAE,CAAC"}
|