@gravitee/graphene-core 2.49.0-graphene-142-code-editor.6ff118a → 2.49.0-json-schema-form-context.da98610
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/{CodeEditor-mEBgpud-.js → Skeleton-C30qULzD.js} +461 -704
- package/dist/__stories__/fixtures/index.d.ts +1 -1
- package/dist/__stories__/fixtures/index.d.ts.map +1 -1
- package/dist/__stories__/fixtures/json-schema-form/disableIf.fixture.d.ts.map +1 -1
- package/dist/__stories__/fixtures/json-schema-form/displayIf.fixture.d.ts.map +1 -1
- package/dist/__stories__/fixtures/json-schema-form/index.d.ts +0 -1
- package/dist/__stories__/fixtures/json-schema-form/index.d.ts.map +1 -1
- package/dist/code-editor/index.js +228 -2
- package/dist/composed/AppLayout/AppLayout.d.ts.map +1 -1
- package/dist/composed/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/composed/CodeEditor/setupCodeEditor.d.ts +39 -34
- package/dist/composed/CodeEditor/setupCodeEditor.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/JsonSchemaForm.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/SchemaField.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/conditional/ConditionalGate.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/conditional/concretizeCondition.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/conditional/evalCondition.d.ts +6 -6
- package/dist/composed/JsonSchemaForm/conditional/evalCondition.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/fields/__test-utils__/setupJsonSchemaForm.d.ts +1 -0
- package/dist/composed/JsonSchemaForm/fields/__test-utils__/setupJsonSchemaForm.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/form-bindings/resolveAt.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/schema/buildIndex.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/schema/types.d.ts +3 -1
- package/dist/composed/JsonSchemaForm/schema/types.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/utils/readPath.d.ts +12 -0
- package/dist/composed/JsonSchemaForm/utils/readPath.d.ts.map +1 -0
- package/dist/composed/JsonSchemaForm/utils/schemaShape.d.ts +1 -2
- package/dist/composed/JsonSchemaForm/utils/schemaShape.d.ts.map +1 -1
- package/dist/index.js +8302 -8333
- package/dist/styles/custom-variants.css +15 -0
- package/dist/styles/globals.css +1 -1
- package/package.json +2 -2
- package/snippets/json-schema-form-simple.tsx +20 -2
- package/snippets/json-schema-form-with-meta.tsx +18 -3
- package/dist/__stories__/fixtures/json-schema-form/code-editor.fixture.d.ts +0 -14
- package/dist/__stories__/fixtures/json-schema-form/code-editor.fixture.d.ts.map +0 -1
- package/dist/composed/JsonSchemaForm/fields/code-editor/CodeEditorField.d.ts +0 -8
- package/dist/composed/JsonSchemaForm/fields/code-editor/CodeEditorField.d.ts.map +0 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export { sampleApps, sampleAppsExtended } from './shell/app-switcher.fixture';
|
|
6
6
|
export { sampleEnvironments, sampleEnvironmentsForSidebar } from './shell/environment-picker.fixture';
|
|
7
7
|
export { agentManagementApps, agentManagementNavGroups, contextNavGroups, contextPageTabKeys, findContextLabel, findNavLabel, pageLayoutNavGroups, sampleNavGroups, } from './navigation.fixture';
|
|
8
|
-
export { jsonSchemaFormArrayExampleSchema, jsonSchemaFormBannerSchema,
|
|
8
|
+
export { jsonSchemaFormArrayExampleSchema, jsonSchemaFormBannerSchema, jsonSchemaFormCombinatorsExampleSchema, jsonSchemaFormDependenciesSchema, jsonSchemaFormDeprecatedSchema, jsonSchemaFormDisableIfSchema, jsonSchemaFormDisplayIfSchema, jsonSchemaFormEnumExampleSchema, jsonSchemaFormPlaygroundSchema, } from './json-schema-form';
|
|
9
9
|
export { jsonSchemaFormObjectVariantsSchema } from './json-schema-form-object-variants.fixture';
|
|
10
10
|
export { catalogApis } from './apim/api-catalog.fixture';
|
|
11
11
|
export { samplePlans } from './apim/plans.fixture';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__stories__/fixtures/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAEtG,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__stories__/fixtures/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAEtG,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAC1B,sCAAsC,EACtC,gCAAgC,EAChC,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disableIf.fixture.d.ts","sourceRoot":"","sources":["../../../../src/__stories__/fixtures/json-schema-form/disableIf.fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAMlF,eAAO,MAAM,6BAA6B,EAAE,
|
|
1
|
+
{"version":3,"file":"disableIf.fixture.d.ts","sourceRoot":"","sources":["../../../../src/__stories__/fixtures/json-schema-form/disableIf.fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAMlF,eAAO,MAAM,6BAA6B,EAAE,UA6I3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"displayIf.fixture.d.ts","sourceRoot":"","sources":["../../../../src/__stories__/fixtures/json-schema-form/displayIf.fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAKlF,eAAO,MAAM,6BAA6B,EAAE,
|
|
1
|
+
{"version":3,"file":"displayIf.fixture.d.ts","sourceRoot":"","sources":["../../../../src/__stories__/fixtures/json-schema-form/displayIf.fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAKlF,eAAO,MAAM,6BAA6B,EAAE,UAwJ3C,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { jsonSchemaFormArrayExampleSchema } from './array.fixture';
|
|
2
2
|
export { jsonSchemaFormBannerSchema } from './banner.fixture';
|
|
3
|
-
export { jsonSchemaFormCodeEditorSchema } from './code-editor.fixture';
|
|
4
3
|
export { jsonSchemaFormCombinatorsExampleSchema } from './combinators.fixture';
|
|
5
4
|
export { jsonSchemaFormDependenciesSchema } from './dependencies.fixture';
|
|
6
5
|
export { jsonSchemaFormDeprecatedSchema } from './deprecated.fixture';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/__stories__/fixtures/json-schema-form/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/__stories__/fixtures/json-schema-form/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,sCAAsC,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,2 +1,228 @@
|
|
|
1
|
-
import { n as e, t } from "../
|
|
2
|
-
|
|
1
|
+
import { n as e, t } from "../Skeleton-C30qULzD.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { Editor as i, loader as a } from "@monaco-editor/react";
|
|
5
|
+
//#region src/composed/CodeEditor/setupCodeEditor.ts
|
|
6
|
+
var o = "__grapheneCodeEditorConfigured__", s = !!globalThis[o];
|
|
7
|
+
function c({ baseUrl: e, monaco: t }) {
|
|
8
|
+
if (!s) {
|
|
9
|
+
if (t !== void 0) a.config({ monaco: t });
|
|
10
|
+
else if (e !== void 0) a.config({ paths: { vs: e.replace(/\/+$/, "") } });
|
|
11
|
+
else return;
|
|
12
|
+
s = !0, globalThis[o] = !0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/composed/CodeEditor/theme/buildTheme.ts
|
|
17
|
+
var l = "graphene";
|
|
18
|
+
function u(e) {
|
|
19
|
+
let t = {}, n = [], r = document.createElement("div");
|
|
20
|
+
document.body.appendChild(r);
|
|
21
|
+
let i = getComputedStyle(r), a = document.createElement("canvas");
|
|
22
|
+
a.width = 1, a.height = 1;
|
|
23
|
+
let o = a.getContext("2d");
|
|
24
|
+
for (let a of e) {
|
|
25
|
+
if (!o) {
|
|
26
|
+
t[a] = "#000000";
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
r.style.backgroundColor = `var(${a})`;
|
|
30
|
+
let e = i.backgroundColor;
|
|
31
|
+
(e === "" || e === "rgba(0, 0, 0, 0)") && n.push(a), o.clearRect(0, 0, 1, 1), o.fillStyle = e, o.fillRect(0, 0, 1, 1);
|
|
32
|
+
let [s, c, l] = o.getImageData(0, 0, 1, 1).data;
|
|
33
|
+
t[a] = "#" + [
|
|
34
|
+
s,
|
|
35
|
+
c,
|
|
36
|
+
l
|
|
37
|
+
].map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
38
|
+
}
|
|
39
|
+
return document.body.removeChild(r), t;
|
|
40
|
+
}
|
|
41
|
+
function d() {
|
|
42
|
+
let e = document.documentElement.classList.contains("dark"), t = u([
|
|
43
|
+
"--background",
|
|
44
|
+
"--foreground",
|
|
45
|
+
"--border",
|
|
46
|
+
"--muted",
|
|
47
|
+
"--muted-foreground",
|
|
48
|
+
"--primary",
|
|
49
|
+
"--code-editor-string",
|
|
50
|
+
"--code-editor-keyword",
|
|
51
|
+
"--code-editor-number",
|
|
52
|
+
"--code-editor-type",
|
|
53
|
+
"--code-editor-special"
|
|
54
|
+
]), n = t["--background"], r = t["--foreground"], i = t["--border"], a = t["--muted"], o = t["--muted-foreground"], s = t["--primary"], c = t["--code-editor-string"], l = t["--code-editor-keyword"], d = t["--code-editor-number"], f = t["--code-editor-type"], p = t["--code-editor-special"], m = (e) => e.slice(1);
|
|
55
|
+
return {
|
|
56
|
+
base: e ? "vs-dark" : "vs",
|
|
57
|
+
inherit: !0,
|
|
58
|
+
rules: [
|
|
59
|
+
{
|
|
60
|
+
token: "string",
|
|
61
|
+
foreground: m(c)
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
token: "string.key.json",
|
|
65
|
+
foreground: m(f)
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
token: "keyword",
|
|
69
|
+
foreground: m(l)
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
token: "keyword.json",
|
|
73
|
+
foreground: m(p)
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
token: "number",
|
|
77
|
+
foreground: m(d)
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
token: "type",
|
|
81
|
+
foreground: m(f)
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
token: "tag",
|
|
85
|
+
foreground: m(l)
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
token: "attribute.name",
|
|
89
|
+
foreground: m(f)
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
token: "attribute.value",
|
|
93
|
+
foreground: m(c)
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
token: "comment",
|
|
97
|
+
foreground: m(o),
|
|
98
|
+
fontStyle: "italic"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
token: "comment.line",
|
|
102
|
+
foreground: m(o),
|
|
103
|
+
fontStyle: "italic"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
token: "comment.block",
|
|
107
|
+
foreground: m(o),
|
|
108
|
+
fontStyle: "italic"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
token: "identifier",
|
|
112
|
+
foreground: m(r)
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
token: "variable",
|
|
116
|
+
foreground: m(r)
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
token: "delimiter",
|
|
120
|
+
foreground: m(r)
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
colors: {
|
|
124
|
+
"editor.background": n,
|
|
125
|
+
"editor.foreground": r,
|
|
126
|
+
"editor.lineHighlightBackground": r + "08",
|
|
127
|
+
"editor.lineHighlightBorder": "#00000000",
|
|
128
|
+
"editor.selectionBackground": s + "4d",
|
|
129
|
+
"editor.inactiveSelectionBackground": s + "26",
|
|
130
|
+
"editorCursor.foreground": s,
|
|
131
|
+
"editorLineNumber.foreground": o,
|
|
132
|
+
"editorLineNumber.activeForeground": r,
|
|
133
|
+
"editorGutter.background": n,
|
|
134
|
+
"editorIndentGuide.background1": i,
|
|
135
|
+
"editorIndentGuide.activeBackground1": o,
|
|
136
|
+
"editorWidget.background": a,
|
|
137
|
+
"editorWidget.foreground": r,
|
|
138
|
+
"editorWidget.border": i,
|
|
139
|
+
"editorWidget.resizeBorder": i,
|
|
140
|
+
"widget.shadow": r + "1a",
|
|
141
|
+
"input.background": n,
|
|
142
|
+
"input.border": i,
|
|
143
|
+
"input.foreground": r,
|
|
144
|
+
"input.placeholderForeground": o,
|
|
145
|
+
"inputOption.activeBorder": s,
|
|
146
|
+
"inputOption.activeBackground": s + "26",
|
|
147
|
+
"inputOption.activeForeground": s,
|
|
148
|
+
"button.background": s,
|
|
149
|
+
"button.foreground": "#ffffff",
|
|
150
|
+
"editorSuggestWidget.background": n,
|
|
151
|
+
"editorSuggestWidget.border": i,
|
|
152
|
+
"editorSuggestWidget.selectedBackground": s + "26",
|
|
153
|
+
"scrollbarSlider.background": i + "80",
|
|
154
|
+
"scrollbarSlider.hoverBackground": i,
|
|
155
|
+
"scrollbarSlider.activeBackground": o + "80"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/composed/CodeEditor/CodeEditor.tsx
|
|
161
|
+
function f(e) {
|
|
162
|
+
e.editor.defineTheme(l, d()), e.editor.setTheme(l);
|
|
163
|
+
}
|
|
164
|
+
var p = (e) => {
|
|
165
|
+
f(e);
|
|
166
|
+
};
|
|
167
|
+
function m() {
|
|
168
|
+
let [e, t] = n.useState(typeof document < "u" && document.documentElement.classList.contains("dark"));
|
|
169
|
+
return n.useEffect(() => {
|
|
170
|
+
let e = new MutationObserver(() => {
|
|
171
|
+
t(document.documentElement.classList.contains("dark"));
|
|
172
|
+
});
|
|
173
|
+
return e.observe(document.documentElement, {
|
|
174
|
+
attributes: !0,
|
|
175
|
+
attributeFilter: ["class"]
|
|
176
|
+
}), () => e.disconnect();
|
|
177
|
+
}, []), e;
|
|
178
|
+
}
|
|
179
|
+
function h({ value: a, defaultValue: o, onChange: s, language: c = "plaintext", readOnly: u = !1, disabled: d = !1, height: h, className: g, options: _, onMount: v }) {
|
|
180
|
+
let y = m(), b = n.useRef(null), x = n.useRef(null);
|
|
181
|
+
n.useEffect(() => {
|
|
182
|
+
b.current && f(b.current);
|
|
183
|
+
}, [y]), n.useEffect(() => {}, []);
|
|
184
|
+
let S = n.useCallback((e, t) => {
|
|
185
|
+
b.current = t, x.current = e, v?.(e, t);
|
|
186
|
+
}, [v]), C = typeof h == "number" ? `${h}px` : h ?? "300px";
|
|
187
|
+
return /* @__PURE__ */ r("div", {
|
|
188
|
+
"data-slot": "code-editor",
|
|
189
|
+
"data-disabled": d ? "" : void 0,
|
|
190
|
+
"data-readonly": u && !d ? "" : void 0,
|
|
191
|
+
className: e("overflow-hidden rounded-lg border border-input bg-background", "data-disabled:pointer-events-none data-disabled:opacity-50", "data-readonly:bg-muted/30", g),
|
|
192
|
+
style: { height: C },
|
|
193
|
+
children: /* @__PURE__ */ r(i, {
|
|
194
|
+
height: "100%",
|
|
195
|
+
language: c,
|
|
196
|
+
value: a,
|
|
197
|
+
defaultValue: o,
|
|
198
|
+
theme: l,
|
|
199
|
+
onChange: s,
|
|
200
|
+
onMount: S,
|
|
201
|
+
beforeMount: p,
|
|
202
|
+
loading: /* @__PURE__ */ r(t, { className: "size-full" }),
|
|
203
|
+
options: {
|
|
204
|
+
readOnly: u || d,
|
|
205
|
+
minimap: { enabled: !1 },
|
|
206
|
+
scrollBeyondLastLine: !1,
|
|
207
|
+
automaticLayout: !0,
|
|
208
|
+
fontFamily: "ui-monospace, Menlo, Consolas, \"Cascadia Code\", \"Liberation Mono\", monospace",
|
|
209
|
+
fontSize: 13,
|
|
210
|
+
lineHeight: 20,
|
|
211
|
+
padding: {
|
|
212
|
+
top: 8,
|
|
213
|
+
bottom: 8
|
|
214
|
+
},
|
|
215
|
+
glyphMargin: !1,
|
|
216
|
+
renderLineHighlight: "line",
|
|
217
|
+
scrollbar: {
|
|
218
|
+
verticalScrollbarSize: 6,
|
|
219
|
+
horizontalScrollbarSize: 6
|
|
220
|
+
},
|
|
221
|
+
overviewRulerLanes: 0,
|
|
222
|
+
..._
|
|
223
|
+
}
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
export { h as CodeEditor, c as setupCodeEditor };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../../src/composed/AppLayout/AppLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAGtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAGhF,UA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ACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,sEAAsE;IACtE,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CAClC;AA6BD,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,QAAsB,EACtB,QAAgB,EAChB,QAAgB,EAChB,MAAM,EACN,SAAS,EACT,OAAO,EACP,OAAO,GACR,EAAE,eAAe,qBAwEjB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -4,56 +4,61 @@ export interface SetupCodeEditorOptions {
|
|
|
4
4
|
/**
|
|
5
5
|
* AMD / self-hosted: URL serving `node_modules/monaco-editor/min/vs`, e.g. `"/assets/monaco/vs"`.
|
|
6
6
|
* Use when Monaco is served as static files (e.g. CopyPlugin, Nginx, CDN) rather than bundled.
|
|
7
|
-
*
|
|
8
|
-
* Not required in the common case — `<CodeEditor>` auto-configures its loader with the bundled
|
|
9
|
-
* `monaco-editor` on first render. Reach for `baseUrl` only when self-hosting the AMD build.
|
|
10
7
|
*/
|
|
11
8
|
baseUrl?: string;
|
|
12
9
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* ESM / npm-bundled: the `monaco-editor` namespace import.
|
|
11
|
+
* Use for Rspack / webpack / Module Federation host shells where Monaco is bundled as ESM.
|
|
12
|
+
* @example
|
|
13
|
+
* import * as monaco from 'monaco-editor';
|
|
14
|
+
* setupCodeEditor({ monaco });
|
|
17
15
|
*/
|
|
18
16
|
monaco?: MonacoLoaderConfig['monaco'];
|
|
19
17
|
}
|
|
20
18
|
/**
|
|
21
|
-
*
|
|
19
|
+
* Configure Monaco's loader before the first `<CodeEditor>` mounts.
|
|
20
|
+
* Call once at app bootstrap — idempotent, first caller wins.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Two modes:
|
|
23
|
+
* - `{ baseUrl }` — AMD/self-hosted, points `@monaco-editor/react`'s loader at a local `vs` folder.
|
|
24
|
+
* - `{ monaco }` — ESM/bundled, passes the `monaco-editor` namespace to the loader so it uses
|
|
25
|
+
* the npm-installed instance instead of fetching from CDN. Required for Rspack / MF hosts.
|
|
25
26
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Idempotent — first caller wins. Module-scoped, so each federated shell must call it
|
|
30
|
-
* independently if it wants to override the auto-config default.
|
|
27
|
+
* If both `baseUrl` and `monaco` are passed, `monaco` wins and `baseUrl` is ignored (ESM > AMD).
|
|
28
|
+
* A DEV-only warning is emitted in that case — pick one and drop the other.
|
|
31
29
|
*
|
|
32
30
|
* @example
|
|
33
|
-
* //
|
|
31
|
+
* // ESM mode under Vite / Rspack — pair `setupCodeEditor({ monaco })` with a `MonacoEnvironment`
|
|
32
|
+
* // that resolves each language worker through `new URL(..., import.meta.url)` so the bundler
|
|
33
|
+
* // emits one chunk per worker, served from the same origin (CSP-safe, offline-capable).
|
|
34
|
+
* import * as monaco from 'monaco-editor';
|
|
34
35
|
* import { setupCodeEditor } from '@gravitee/graphene-core';
|
|
35
|
-
* setupCodeEditor({ baseUrl: '/assets/monaco/vs' });
|
|
36
|
-
*/
|
|
37
|
-
export declare function setupCodeEditor({ baseUrl, monaco }?: SetupCodeEditorOptions): void;
|
|
38
|
-
/**
|
|
39
|
-
* Configure the loader with the bundled `monaco-editor` so `<CodeEditor>` works out of the box,
|
|
40
|
-
* including in federated remotes whose own `loader` instance was never reached by the host's
|
|
41
|
-
* `setupCodeEditor` call.
|
|
42
36
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
37
|
+
* self.MonacoEnvironment = {
|
|
38
|
+
* getWorker(_workerId, label) {
|
|
39
|
+
* if (label === 'json') {
|
|
40
|
+
* return new Worker(new URL('monaco-editor/esm/vs/language/json/json.worker', import.meta.url));
|
|
41
|
+
* }
|
|
42
|
+
* if (label === 'css' || label === 'scss' || label === 'less') {
|
|
43
|
+
* return new Worker(new URL('monaco-editor/esm/vs/language/css/css.worker', import.meta.url));
|
|
44
|
+
* }
|
|
45
|
+
* if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
|
46
|
+
* return new Worker(new URL('monaco-editor/esm/vs/language/html/html.worker', import.meta.url));
|
|
47
|
+
* }
|
|
48
|
+
* if (label === 'typescript' || label === 'javascript') {
|
|
49
|
+
* return new Worker(new URL('monaco-editor/esm/vs/language/typescript/ts.worker', import.meta.url));
|
|
50
|
+
* }
|
|
51
|
+
* return new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker', import.meta.url));
|
|
52
|
+
* },
|
|
53
|
+
* };
|
|
50
54
|
*
|
|
51
|
-
*
|
|
55
|
+
* setupCodeEditor({ monaco });
|
|
52
56
|
*/
|
|
53
|
-
export declare function
|
|
57
|
+
export declare function setupCodeEditor({ baseUrl, monaco }: SetupCodeEditorOptions): void;
|
|
54
58
|
/**
|
|
55
|
-
* Whether
|
|
56
|
-
*
|
|
59
|
+
* Whether {@link setupCodeEditor} has been called. `<CodeEditor>` reads this to emit a dev-only
|
|
60
|
+
* warning when it mounts without an explicit init — otherwise Monaco silently falls back to the
|
|
61
|
+
* CDN, which breaks under a strict CSP or offline.
|
|
57
62
|
*/
|
|
58
63
|
export declare function isCodeEditorConfigured(): boolean;
|
|
59
64
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupCodeEditor.d.ts","sourceRoot":"","sources":["../../../src/composed/CodeEditor/setupCodeEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC
|
|
1
|
+
{"version":3,"file":"setupCodeEditor.d.ts","sourceRoot":"","sources":["../../../src/composed/CodeEditor/setupCodeEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;CACvC;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,sBAAsB,GAAG,IAAI,CAoBjF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSchemaForm.d.ts","sourceRoot":"","sources":["../../../src/composed/JsonSchemaForm/JsonSchemaForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,iBAAS,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAS,EAAE,QAAgB,EAAE,OAAO,EAAE,EAAE,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"JsonSchemaForm.d.ts","sourceRoot":"","sources":["../../../src/composed/JsonSchemaForm/JsonSchemaForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,iBAAS,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAS,EAAE,QAAgB,EAAE,OAAO,EAAE,EAAE,mBAAmB,+BAuCrG;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaField.d.ts","sourceRoot":"","sources":["../../../src/composed/JsonSchemaForm/SchemaField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SchemaField.d.ts","sourceRoot":"","sources":["../../../src/composed/JsonSchemaForm/SchemaField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAehD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AASjD,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;AAoED,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalGate.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/conditional/ConditionalGate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC;6FACyF;IACzF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ConditionalGate.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/conditional/ConditionalGate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC;6FACyF;IACzF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,oBAAoB,sCAwBvF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"concretizeCondition.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/conditional/concretizeCondition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD;;;;;;GAMG;AACH,iBAAS,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"concretizeCondition.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/conditional/concretizeCondition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD;;;;;;GAMG;AACH,iBAAS,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAI9F;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ResolvedCondition } from '../schema/types';
|
|
2
2
|
/**
|
|
3
|
-
* Evaluate a `ResolvedCondition` against
|
|
4
|
-
* `$eq` is satisfied when every (path → expected) pair matches; an array expected matches if the
|
|
5
|
-
* live value is `===` to any entry (poor man's `$in`). Empty `$eq` matches everything.
|
|
3
|
+
* Evaluate a `ResolvedCondition` against live form values + the form's external `context`.
|
|
6
4
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* `$eq` keys are looked up in `values` (the absolute RHF paths the gate watched via `useWatch`);
|
|
6
|
+
* `$eqContext` keys are read from `externalContext` by dot-path. Every pair must match; an array
|
|
7
|
+
* expected matches if the actual is `===` to any entry (poor man's `$in`). No constraints (empty
|
|
8
|
+
* `$eq` and no `$eqContext`) ⇒ matches everything.
|
|
9
9
|
*/
|
|
10
|
-
declare function evalCondition(condition: ResolvedCondition, values: ReadonlyMap<string, unknown>): boolean;
|
|
10
|
+
declare function evalCondition(condition: ResolvedCondition, values: ReadonlyMap<string, unknown>, externalContext?: Record<string, unknown>): boolean;
|
|
11
11
|
export { evalCondition };
|
|
12
12
|
//# sourceMappingURL=evalCondition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evalCondition.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/conditional/evalCondition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"evalCondition.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/conditional/evalCondition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD;;;;;;;GAOG;AACH,iBAAS,aAAa,CACpB,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACxC,OAAO,CAUT;AAQD,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -6,6 +6,7 @@ declare function setupJsonSchemaForm(options: {
|
|
|
6
6
|
readonly schema: JsonSchema;
|
|
7
7
|
readonly defaultValues?: Record<string, unknown>;
|
|
8
8
|
readonly disabled?: boolean;
|
|
9
|
+
readonly context?: Record<string, unknown>;
|
|
9
10
|
readonly render: (rootNode: SchemaNode) => ReactElement;
|
|
10
11
|
}): {
|
|
11
12
|
form: UseFormReturn<FieldValues>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupJsonSchemaForm.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/__test-utils__/setupJsonSchemaForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,WAAW,EAAW,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMrD,iBAAS,mBAAmB,CAAC,OAAO,EAAE;IACpC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAK,YAAY,CAAC;CACzD,GAAG;IAAE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAAC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"setupJsonSchemaForm.d.ts","sourceRoot":"","sources":["../../../../../src/composed/JsonSchemaForm/fields/__test-utils__/setupJsonSchemaForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,WAAW,EAAW,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMrD,iBAAS,mBAAmB,CAAC,OAAO,EAAE;IACpC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAK,YAAY,CAAC;CACzD,GAAG;IAAE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAAC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CA6B5E;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveAt.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/form-bindings/resolveAt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveAt.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/form-bindings/resolveAt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAiB,MAAM,iBAAiB,CAAC;AAG9E;;;;;;;;GAQG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG;IAAE,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAsBjH;AAgED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildIndex.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/schema/buildIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAK3E,OAAO,KAAK,EAAgC,WAAW,EAA6B,MAAM,SAAS,CAAC;AAgBpG,iBAAS,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,SAAK,GAAG,WAAW,CAKpE;
|
|
1
|
+
{"version":3,"file":"buildIndex.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/schema/buildIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAK3E,OAAO,KAAK,EAAgC,WAAW,EAA6B,MAAM,SAAS,CAAC;AAgBpG,iBAAS,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,SAAK,GAAG,WAAW,CAKpE;AAkPD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -81,10 +81,12 @@ interface DepBranch {
|
|
|
81
81
|
* { $eq: { '<rhfPath>': value | value[] } }
|
|
82
82
|
*
|
|
83
83
|
* Values are matched with `===`; an array value matches if the data is any one of the entries
|
|
84
|
-
* (poor man's `$in`).
|
|
84
|
+
* (poor man's `$in`). An empty condition matches everything. `context.X` keys are split out into
|
|
85
|
+
* `$eqContext` (read from the external `context` prop, not RHF state).
|
|
85
86
|
*/
|
|
86
87
|
interface ResolvedCondition {
|
|
87
88
|
readonly $eq: ReadonlyMap<string, unknown>;
|
|
89
|
+
readonly $eqContext?: ReadonlyMap<string, unknown>;
|
|
88
90
|
}
|
|
89
91
|
interface SchemaIndex {
|
|
90
92
|
readonly root: SchemaNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAA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C,KAAK,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAC9E;mEAC+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrD;;gDAE4C;IAC5C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IACnD;wDACoD;IACpD,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;CAC1B;AAED;;;GAGG;AACH,UAAU,SAAS;IACjB,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;mBAEe;IACf,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACtD;AAED;;;;;;;;;GASG;AACH,UAAU,iBAAiB;IACzB,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpD;AAED,UAAU,WAAW;IACnB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B;;0FAEsF;IACtF,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrD;;;;uEAImE;IACnE,QAAQ,CAAC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C;AAED,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a dot-separated path (`a.b.c`) out of a nested value. Returns `undefined` as soon as a
|
|
3
|
+
* segment is missing or an intermediate value is not a non-null object. An empty path reads the
|
|
4
|
+
* root value itself.
|
|
5
|
+
*
|
|
6
|
+
* Shared by the conditional gates (`evalCondition`, reading `$eqContext` from the external
|
|
7
|
+
* `context`) and the resolver (`resolveAt`'s `showIfMatches`, reading a discriminator value from
|
|
8
|
+
* the form data).
|
|
9
|
+
*/
|
|
10
|
+
declare function readPath(source: unknown, path: string): unknown;
|
|
11
|
+
export { readPath };
|
|
12
|
+
//# sourceMappingURL=readPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readPath.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/utils/readPath.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,iBAAS,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQxD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -2,8 +2,7 @@ import { JsonSchema } from '../models/json-schema.types';
|
|
|
2
2
|
declare function isOneOfConstSelect(schema: JsonSchema): boolean;
|
|
3
3
|
declare function isMultiSelectArray(schema: JsonSchema): boolean;
|
|
4
4
|
declare function isHeadersArray(schema: JsonSchema): boolean;
|
|
5
|
-
declare function isCodeEditor(schema: JsonSchema): boolean;
|
|
6
5
|
declare function isOneOfWithProperties(schema: JsonSchema): boolean;
|
|
7
6
|
declare function isAnyOfWithProperties(schema: JsonSchema): boolean;
|
|
8
|
-
export { isAnyOfWithProperties,
|
|
7
|
+
export { isAnyOfWithProperties, isHeadersArray, isMultiSelectArray, isOneOfConstSelect, isOneOfWithProperties };
|
|
9
8
|
//# sourceMappingURL=schemaShape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaShape.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/utils/schemaShape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAK9D,iBAAS,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAMvD;AAID,iBAAS,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAIvD;AAOD,iBAAS,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAEnD;
|
|
1
|
+
{"version":3,"file":"schemaShape.d.ts","sourceRoot":"","sources":["../../../../src/composed/JsonSchemaForm/utils/schemaShape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAK9D,iBAAS,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAMvD;AAID,iBAAS,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAIvD;AAOD,iBAAS,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAEnD;AAMD,iBAAS,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAO1D;AAKD,iBAAS,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAM1D;AAED,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC"}
|