@mintlify/msft-sdk 1.1.61 → 1.1.63
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/api-playground/ApiPlayground/Response/DownloadFileButton.js +6 -5
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +13 -12
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +8 -7
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +3 -2
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +9 -8
- package/dist/api-playground/ApiPlayground/Response/index.js +4 -3
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +42 -21
- package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +13 -9
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +6 -5
- package/dist/api-playground/ApiPlayground/components/SendPill.js +3 -2
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +6 -5
- package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +3 -2
- package/dist/api-playground/EndpointFields/components/Description.js +6 -5
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js +9 -8
- package/dist/api-playground/EndpointFields/components/SectionHeading.js +8 -7
- package/dist/api-playground-2/ApiExamples.js +19 -20
- package/dist/api-playground-2/ApiFields.js +20 -247
- package/dist/api-playground-2/EndpointHeader.js +59 -47
- package/dist/api-playground-2/OperationPage.js +70 -66
- package/dist/api-playground-2/Playground.js +67 -83
- package/dist/api-playground-2/SchemaPage.js +22 -9
- package/dist/api-playground-2/components/EndpointFields/Body.js +40 -0
- package/dist/api-playground-2/components/EndpointFields/Parameters.js +90 -0
- package/dist/api-playground-2/components/EndpointFields/Response.js +146 -0
- package/dist/api-playground-2/components/EndpointFields/Security.js +88 -0
- package/dist/api-playground-2/components/EndpointFields/fields/ArrayParamField.js +93 -0
- package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +29 -11
- package/dist/api-playground-2/components/EndpointFields/fields/ObjectParamField.js +145 -0
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +60 -48
- package/dist/api-playground-2/components/EndpointFields/fields/SchemaField.js +230 -0
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +93 -89
- package/dist/api-playground-2/components/Example/GeneratedResponseExample.js +18 -17
- package/dist/api-playground-2/components/Example/RequestExample.js +92 -93
- package/dist/api-playground-2/components/Example/ResponseExample.js +19 -15
- package/dist/api-playground-2/components/Request/ParameterSection.js +20 -18
- package/dist/api-playground-2/components/Request/SecuritySection.js +53 -43
- package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +89 -40
- package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +12 -12
- package/dist/api-playground-2/components/Request/inputs/FileInput.js +16 -15
- package/dist/api-playground-2/components/Request/inputs/InputContainer.js +76 -57
- package/dist/api-playground-2/components/Request/inputs/NumberInput.js +10 -9
- package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +98 -80
- package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +55 -47
- package/dist/api-playground-2/components/Request/inputs/SelectInput.js +18 -17
- package/dist/api-playground-2/components/Request/inputs/StringInput.js +19 -18
- package/dist/api-playground-2/components/Request/inputs/TextInput.js +12 -11
- package/dist/api-playground-2/components/SendPillWrapper.js +35 -0
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +3 -5
- package/dist/api-playground-2/generators/createCookies.js +23 -0
- package/dist/api-playground-2/generators/createHeaders.js +53 -36
- package/dist/api-playground-2/generators/createQueryString.js +30 -0
- package/dist/api-playground-2/generators/generateAuthPlaceholder.js +14 -0
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +27 -25
- package/dist/api-playground-2/generators/generateRequest.js +47 -51
- package/dist/api-playground-2/generators/generateResponseExampleMap.js +15 -11
- package/dist/api-playground-2/generators/generateSnippet.js +1 -1
- package/dist/api-playground-2/generators/generateSnippetMap.js +13 -11
- package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +11 -11
- package/dist/api-playground-2/hooks/useInitializeInputs.js +185 -88
- package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +70 -25
- package/dist/api-playground-2/hooks/useSelectedBaseUrl.js +13 -0
- package/dist/api-playground-2/hooks/useSelectedExample.js +10 -0
- package/dist/api-playground-2/hooks/useSelectedRequestBodyContentType.js +12 -0
- package/dist/api-playground-2/hooks/useSelectedResponseContentType.js +12 -0
- package/dist/api-playground-2/hooks/useSelectedSecurityOption.js +31 -0
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +114 -101
- package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +23 -32
- package/dist/api-playground-2/schemaGraph/addTypeLabelsToSchema.js +50 -0
- package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +40 -24
- package/dist/api-playground-2/schemaGraph/getExampleBodyInputs.js +94 -0
- package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +56 -50
- package/dist/api-playground-2/schemaGraph/processExamples.js +117 -52
- package/dist/api-playground-2/schemaGraph/processSchema.js +10 -0
- package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +58 -28
- package/dist/api-playground-2/schemaGraph/reduceCompositions.js +220 -181
- package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +128 -89
- package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +15 -16
- package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +14 -12
- package/dist/api-playground-2/schemaGraph/utils.js +185 -147
- package/dist/common/guards.js +11 -19
- package/dist/components/Api/Expandable.js +10 -9
- package/dist/components/Api/Param.js +11 -13
- package/dist/components/Api/dropdown-menu.js +10 -9
- package/dist/components/content-components/code-group.js +4 -4
- package/dist/contexts/EndpointLocationContext.js +3 -3
- package/dist/hooks/useApiParamFieldOption.js +10 -0
- package/dist/hooks/useEndpoint.js +3 -3
- package/dist/hooks/useKeyboardShortcut.js +13 -13
- package/dist/hooks/useSendPlaygroundRequest.js +14 -146
- package/dist/httpsnippet/src/helpers/code-builder.js +27 -0
- package/dist/httpsnippet/src/helpers/escape.js +11 -0
- package/dist/httpsnippet/src/helpers/headers.js +13 -0
- package/dist/httpsnippet/src/helpers/reducer.js +7 -0
- package/dist/httpsnippet/src/helpers/shell.js +5 -0
- package/dist/httpsnippet/src/helpers/url-format.js +35 -0
- package/dist/httpsnippet/src/helpers/url-parse.js +76 -0
- package/dist/httpsnippet/src/index.js +157 -0
- package/dist/httpsnippet/src/targets/c/libcurl/client.js +22 -0
- package/dist/httpsnippet/src/targets/c/target.js +15 -0
- package/dist/httpsnippet/src/targets/clojure/clj_http/client.js +120 -0
- package/dist/httpsnippet/src/targets/clojure/target.js +14 -0
- package/dist/httpsnippet/src/targets/csharp/httpclient/client.js +76 -0
- package/dist/httpsnippet/src/targets/csharp/restsharp/client.js +63 -0
- package/dist/httpsnippet/src/targets/csharp/target.js +17 -0
- package/dist/httpsnippet/src/targets/go/native/client.js +24 -0
- package/dist/httpsnippet/src/targets/go/target.js +15 -0
- package/dist/httpsnippet/src/targets/http/http1.1/client.js +34 -0
- package/dist/httpsnippet/src/targets/http/target.js +14 -0
- package/dist/httpsnippet/src/targets/index.js +43 -0
- package/dist/httpsnippet/src/targets/java/asynchttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/java/nethttp/client.js +28 -0
- package/dist/httpsnippet/src/targets/java/okhttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/java/target.js +20 -0
- package/dist/httpsnippet/src/targets/java/unirest/client.js +23 -0
- package/dist/httpsnippet/src/targets/javascript/axios/client.js +50 -0
- package/dist/httpsnippet/src/targets/javascript/fetch/client.js +61 -0
- package/dist/httpsnippet/src/targets/javascript/jquery/client.js +51 -0
- package/dist/httpsnippet/src/targets/javascript/target.js +20 -0
- package/dist/httpsnippet/src/targets/javascript/xhr/client.js +49 -0
- package/dist/httpsnippet/src/targets/json/native/client.js +39 -0
- package/dist/httpsnippet/src/targets/json/target.js +14 -0
- package/dist/httpsnippet/src/targets/kotlin/okhttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/kotlin/target.js +14 -0
- package/dist/httpsnippet/src/targets/node/axios/client.js +40 -0
- package/dist/httpsnippet/src/targets/node/fetch/client.js +68 -0
- package/dist/httpsnippet/src/targets/node/native/client.js +45 -0
- package/dist/httpsnippet/src/targets/node/target.js +19 -0
- package/dist/httpsnippet/src/targets/objc/helpers.js +27 -0
- package/dist/httpsnippet/src/targets/objc/nsurlsession/client.js +63 -0
- package/dist/httpsnippet/src/targets/objc/target.js +14 -0
- package/dist/httpsnippet/src/targets/ocaml/cohttp/client.js +32 -0
- package/dist/httpsnippet/src/targets/ocaml/target.js +14 -0
- package/dist/httpsnippet/src/targets/php/curl/client.js +85 -0
- package/dist/httpsnippet/src/targets/php/guzzle/client.js +57 -0
- package/dist/httpsnippet/src/targets/php/helpers.js +65 -0
- package/dist/httpsnippet/src/targets/php/http1/client.js +28 -0
- package/dist/httpsnippet/src/targets/php/http2/client.js +55 -0
- package/dist/httpsnippet/src/targets/php/target.js +21 -0
- package/dist/httpsnippet/src/targets/powershell/common.js +19 -0
- package/dist/httpsnippet/src/targets/powershell/restmethod/client.js +14 -0
- package/dist/httpsnippet/src/targets/powershell/target.js +16 -0
- package/dist/httpsnippet/src/targets/powershell/webrequest/client.js +14 -0
- package/dist/httpsnippet/src/targets/python/helpers.js +33 -0
- package/dist/httpsnippet/src/targets/python/requests/client.js +74 -0
- package/dist/httpsnippet/src/targets/python/target.js +15 -0
- package/dist/httpsnippet/src/targets/r/httr/client.js +46 -0
- package/dist/httpsnippet/src/targets/r/target.js +14 -0
- package/dist/httpsnippet/src/targets/ruby/native/client.js +37 -0
- package/dist/httpsnippet/src/targets/ruby/target.js +14 -0
- package/dist/httpsnippet/src/targets/shell/curl/client.js +92 -0
- package/dist/httpsnippet/src/targets/shell/httpie/client.js +56 -0
- package/dist/httpsnippet/src/targets/shell/target.js +19 -0
- package/dist/httpsnippet/src/targets/shell/wget/client.js +30 -0
- package/dist/httpsnippet/src/targets/swift/helpers.js +38 -0
- package/dist/httpsnippet/src/targets/swift/target.js +14 -0
- package/dist/httpsnippet/src/targets/swift/urlsession/client.js +59 -0
- package/dist/index.d.ts +65 -58
- package/dist/index.js +109 -111
- package/dist/openapi/generateTypeStringFromSchema.js +2 -31
- package/dist/styles.css +1 -1
- package/package.json +17 -4
- package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
- package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
- package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
- package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
- package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
- package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
- package/dist/api-playground/ApiPlayground/index.js +0 -67
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
- package/dist/api-playground/EndpointFields/index.js +0 -7
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
- package/dist/common/potentiallyParseOpenApiString.js +0 -24
- package/dist/common/replaceSlashIndex.js +0 -6
- package/dist/common/slugToTitle.js +0 -10
- package/dist/constants/prism-languages.js +0 -19
- package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
- package/dist/contexts/MDXContentContext.js +0 -17
- package/dist/hooks/useApiPlaygroundInputs.js +0 -6
- package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
- package/dist/hooks/useBaseUrlOptions.js +0 -18
- package/dist/hooks/useComponentSchemas.js +0 -9
- package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
- package/dist/hooks/useGenerateNextItems.js +0 -11
- package/dist/hooks/useGenerateNextProperties.js +0 -11
- package/dist/hooks/useMDXContent.js +0 -6
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
- package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
- package/dist/hooks/usePrefilledInputs/index.js +0 -65
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
- package/dist/hooks/useSecurityOption.js +0 -10
- package/dist/hooks/useSetDefaultValue.js +0 -63
- package/dist/openapi/filterEnums.js +0 -20
- package/dist/openapi/generateNextAdditionalProperties.js +0 -7
- package/dist/openapi/generateNextItems.js +0 -7
- package/dist/openapi/generateNextProperties.js +0 -23
- package/dist/openapi/generateOptionLabels.js +0 -20
- package/dist/openapi/generateSimpleLabels.js +0 -4
- package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
- package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
- package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
- package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
- package/dist/utils/api-playground/defaults.js +0 -15
- package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
- package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
- package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
- package/dist/utils/flattenObject.js +0 -10
|
@@ -1,53 +1,63 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
p.current = t;
|
|
26
|
-
}
|
|
27
|
-
}, [t, n, r, i]), !n || n.length === 0) return null;
|
|
28
|
-
const u = n[t];
|
|
29
|
-
if (!u) return null;
|
|
30
|
-
const y = n.map((e) => ({
|
|
31
|
-
label: e.schema.title ?? "Authorization",
|
|
32
|
-
schema: e.schema
|
|
33
|
-
})), { schema: a } = u, h = S(u);
|
|
34
|
-
return /* @__PURE__ */ o(v, { name: "Authorization", rightElement: /* @__PURE__ */ o(() => /* @__PURE__ */ o(
|
|
1
|
+
import { jsx as i, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import y from "react";
|
|
3
|
+
import { useSelectedSecurityOption as f } from "../../hooks/useSelectedSecurityOption.js";
|
|
4
|
+
import { getSecurityOptionInputKeyPrefix as a } from "../../schemaGraph/utils.js";
|
|
5
|
+
import { Description as S } from "../../../api-playground/EndpointFields/components/Description.js";
|
|
6
|
+
import { cn as x } from "../../../utils/cn.js";
|
|
7
|
+
import { TypeDropdown as O } from "../TypeDropdown.js";
|
|
8
|
+
import { InputSectionContainer as g } from "./InputSectionContainer.js";
|
|
9
|
+
import { DifferentiatedInput as h } from "./inputs/DifferentiatedInput.js";
|
|
10
|
+
const N = ({ apiReferenceData: s }) => {
|
|
11
|
+
var c;
|
|
12
|
+
const { selectedSecurityOptionIndex: r, setSelectedSecurityOptionIndex: m } = f(), n = (c = s.dependencies) == null ? void 0 : c.processedSecurityOptions;
|
|
13
|
+
if (!n || n.length === 0) return null;
|
|
14
|
+
const p = n[r];
|
|
15
|
+
if (!p) return null;
|
|
16
|
+
const d = n.map((t) => {
|
|
17
|
+
var e;
|
|
18
|
+
return {
|
|
19
|
+
label: t.title,
|
|
20
|
+
schema: ((e = t.schemes[0]) == null ? void 0 : e.schema) ?? { type: "string" }
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return /* @__PURE__ */ i(g, { name: "Authorization", rightElement: /* @__PURE__ */ i(() => /* @__PURE__ */ i(
|
|
35
24
|
"div",
|
|
36
25
|
{
|
|
37
|
-
onClick: (
|
|
38
|
-
className:
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
|
|
26
|
+
onClick: (t) => t.stopPropagation(),
|
|
27
|
+
className: x("mint:text-xs mint:font-mono", n.length <= 1 && "mint:hidden"),
|
|
28
|
+
children: /* @__PURE__ */ i(
|
|
29
|
+
O,
|
|
41
30
|
{
|
|
42
|
-
options:
|
|
43
|
-
selectedIndex:
|
|
44
|
-
onSelectOption: (
|
|
45
|
-
|
|
31
|
+
options: d,
|
|
32
|
+
selectedIndex: r,
|
|
33
|
+
onSelectOption: (t) => {
|
|
34
|
+
m(t);
|
|
46
35
|
}
|
|
47
36
|
}
|
|
48
37
|
)
|
|
49
38
|
}
|
|
50
|
-
), {}), children:
|
|
39
|
+
), {}), children: p.schemes.map(({ scheme: t, schema: e, name: o }) => {
|
|
40
|
+
const l = a({ scheme: t, name: o });
|
|
41
|
+
return /* @__PURE__ */ u(y.Fragment, { children: [
|
|
42
|
+
e.description && e.type === "object" && /* @__PURE__ */ i(
|
|
43
|
+
S,
|
|
44
|
+
{
|
|
45
|
+
markdown: e.description,
|
|
46
|
+
className: "mint:text-gray-500 mint:dark:text-gray-400 mint:py-2"
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ i(
|
|
50
|
+
h,
|
|
51
|
+
{
|
|
52
|
+
name: o,
|
|
53
|
+
schema: e,
|
|
54
|
+
inputKeyPrefix: l,
|
|
55
|
+
skipContainer: e.type === "object"
|
|
56
|
+
},
|
|
57
|
+
`${t.type}-${o}`
|
|
58
|
+
)
|
|
59
|
+
] }, `${t.type}-${o}`);
|
|
60
|
+
}) });
|
|
51
61
|
};
|
|
52
62
|
export {
|
|
53
63
|
N as SecuritySection
|
|
@@ -1,51 +1,100 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { jsxs as q, Fragment as E, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { v4 as j } from "uuid";
|
|
3
|
+
import { useShallow as v } from "zustand/react/shallow";
|
|
4
|
+
import { getUniqueInputKey as I } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
5
|
+
import { isSchemaObject as f, getDifferentiatedType as K } from "../../../schemaGraph/utils.js";
|
|
6
|
+
import { AdditionalItemButton as D } from "../../../../api-playground/ApiPlayground/components/AdditionalItemButton.js";
|
|
7
|
+
import { cn as T } from "../../../../utils/cn.js";
|
|
8
|
+
import { usePlaygroundInputsStore as l } from "../../../hooks/usePlaygroundInputsStore.js";
|
|
9
|
+
import { DifferentiatedInput as N } from "./DifferentiatedInput.js";
|
|
10
|
+
const d = (e) => {
|
|
11
|
+
switch (K(e)) {
|
|
12
|
+
case "object":
|
|
13
|
+
return {};
|
|
14
|
+
case "array":
|
|
15
|
+
return [];
|
|
16
|
+
case "string":
|
|
17
|
+
case "enum<string>":
|
|
18
|
+
return "";
|
|
19
|
+
case "number":
|
|
20
|
+
case "integer":
|
|
21
|
+
case "enum<number>":
|
|
22
|
+
case "enum<integer>":
|
|
23
|
+
return 0;
|
|
24
|
+
case "boolean":
|
|
25
|
+
return !1;
|
|
26
|
+
case "null":
|
|
27
|
+
return null;
|
|
28
|
+
case "oneOf":
|
|
29
|
+
if (e.oneOf && Array.isArray(e.oneOf) && e.oneOf.length > 0) {
|
|
30
|
+
const u = e.oneOf[0];
|
|
31
|
+
if (f(u) && u.type !== "null")
|
|
32
|
+
return d(u);
|
|
33
|
+
if (e.oneOf.length > 1 && f(e.oneOf[1]))
|
|
34
|
+
return d(e.oneOf[1]);
|
|
24
35
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
return;
|
|
37
|
+
case "file":
|
|
38
|
+
return;
|
|
39
|
+
default:
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}, k = ({
|
|
43
|
+
schema: e,
|
|
44
|
+
depth: p,
|
|
45
|
+
parentNames: u,
|
|
46
|
+
inputKeyPrefix: m,
|
|
47
|
+
arrayIndices: a
|
|
48
|
+
}) => {
|
|
49
|
+
const h = l((t) => t.setInput), y = l((t) => t.deleteInput), O = l(v((t) => t.inputs)), b = j(), n = "items" in e && f(e.items) ? e.items : void 0;
|
|
50
|
+
if (!n) return null;
|
|
51
|
+
const A = "uniqueKey" in n ? n.uniqueKey : "";
|
|
52
|
+
let i = `${m}.${A}`;
|
|
53
|
+
a == null || a.forEach((t) => {
|
|
54
|
+
i = i.replace("[INDEX]", String(t));
|
|
55
|
+
}), i = i.replaceAll("[INDEX]", "");
|
|
56
|
+
const r = [];
|
|
57
|
+
Object.keys(O).forEach((t) => {
|
|
58
|
+
if (t.startsWith(i)) {
|
|
59
|
+
const s = t.substring(i.length).match(/^(\d+)/);
|
|
60
|
+
if (s) {
|
|
61
|
+
const c = parseInt(s[1] ?? "0", 10);
|
|
62
|
+
r.includes(c) || r.push(c);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}), r.sort((t, o) => t - o);
|
|
66
|
+
const S = r.length > 0 ? Math.max(...r) + 1 : 0, x = () => {
|
|
67
|
+
const t = [...a ?? [], S], o = I(m, n, t), s = d(n);
|
|
68
|
+
h(o, s);
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ q(E, { children: [
|
|
71
|
+
r.map((t) => {
|
|
72
|
+
const o = [...a ?? [], t], s = I(m, n, o), c = () => {
|
|
73
|
+
y(s);
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ g(
|
|
76
|
+
N,
|
|
30
77
|
{
|
|
31
|
-
schema:
|
|
32
|
-
|
|
33
|
-
depth: (
|
|
34
|
-
parentNames:
|
|
35
|
-
inputKeyPrefix:
|
|
78
|
+
schema: n,
|
|
79
|
+
arrayIndices: o,
|
|
80
|
+
depth: (p ?? 0) + 1,
|
|
81
|
+
parentNames: u,
|
|
82
|
+
inputKeyPrefix: m,
|
|
83
|
+
clearValue: c,
|
|
84
|
+
isArrayChild: !0
|
|
36
85
|
},
|
|
37
|
-
|
|
86
|
+
`item-${t}`
|
|
38
87
|
);
|
|
39
88
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
89
|
+
/* @__PURE__ */ g(
|
|
90
|
+
D,
|
|
42
91
|
{
|
|
43
92
|
label: "Add an item",
|
|
44
|
-
className:
|
|
45
|
-
onClick:
|
|
46
|
-
dataTestId: ("name" in
|
|
93
|
+
className: T(r.length > 0 && "mint:mt-4"),
|
|
94
|
+
onClick: x,
|
|
95
|
+
dataTestId: ("name" in n && n.name ? n.name : "") + "-add-item-button"
|
|
47
96
|
},
|
|
48
|
-
"add-item-button" +
|
|
97
|
+
"add-item-button" + b
|
|
49
98
|
)
|
|
50
99
|
] });
|
|
51
100
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { getDifferentiatedType as
|
|
3
|
-
import { ArrayInput as
|
|
4
|
-
import { FileInput as
|
|
2
|
+
import { getDifferentiatedType as a } from "../../../schemaGraph/utils.js";
|
|
3
|
+
import { ArrayInput as f } from "./ArrayInput.js";
|
|
4
|
+
import { FileInput as d } from "./FileInput.js";
|
|
5
5
|
import { InputContainer as t } from "./InputContainer.js";
|
|
6
6
|
import { NullInput as l } from "./NullInput.js";
|
|
7
7
|
import { NumberInput as i } from "./NumberInput.js";
|
|
8
8
|
import { ObjectInput as u } from "./ObjectInput.js";
|
|
9
|
-
import { OneOfInput as
|
|
9
|
+
import { OneOfInput as h } from "./OneOfInput.js";
|
|
10
10
|
import { SelectInput as r } from "./SelectInput.js";
|
|
11
|
-
import { StringInput as
|
|
11
|
+
import { StringInput as m } from "./StringInput.js";
|
|
12
12
|
import { TextInput as y } from "./TextInput.js";
|
|
13
13
|
const S = ({ ...e }) => {
|
|
14
|
-
switch (
|
|
14
|
+
switch (a(e.schema)) {
|
|
15
15
|
case "oneOf":
|
|
16
|
-
return /* @__PURE__ */ n(
|
|
16
|
+
return /* @__PURE__ */ n(h, { ...e });
|
|
17
17
|
case "string": {
|
|
18
|
-
const
|
|
19
|
-
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(
|
|
18
|
+
const c = e.isBody && e.depth === 0 || e.skipContainer ? y : m;
|
|
19
|
+
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(c, { ...e }) });
|
|
20
20
|
}
|
|
21
21
|
case "object":
|
|
22
22
|
return e.isBody && e.depth === 0 || e.skipContainer ? /* @__PURE__ */ n(u, { ...e }) : /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(u, { ...e }) });
|
|
@@ -25,7 +25,7 @@ const S = ({ ...e }) => {
|
|
|
25
25
|
case "integer":
|
|
26
26
|
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(i, { ...e, numberType: "integer" }) });
|
|
27
27
|
case "array":
|
|
28
|
-
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(
|
|
28
|
+
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(f, { ...e }) });
|
|
29
29
|
case "boolean":
|
|
30
30
|
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(r, { ...e, enumType: "boolean" }) });
|
|
31
31
|
case "enum<string>":
|
|
@@ -35,11 +35,11 @@ const S = ({ ...e }) => {
|
|
|
35
35
|
case "enum<integer>":
|
|
36
36
|
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(r, { ...e, enumType: "integer" }) });
|
|
37
37
|
case "file":
|
|
38
|
-
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(
|
|
38
|
+
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(d, { ...e }) });
|
|
39
39
|
case "null":
|
|
40
40
|
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(l, {}) });
|
|
41
41
|
default:
|
|
42
|
-
return
|
|
42
|
+
return /* @__PURE__ */ n(t, { ...e, children: /* @__PURE__ */ n(m, { ...e }) });
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as g, Fragment as x, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as y } from "react";
|
|
3
|
+
import { usePlaygroundInput as I } from "../../../hooks/usePlaygroundInputsStore.js";
|
|
4
|
+
import { getUniqueInputKey as k } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
5
|
+
import { getSchemaPlaceholder as w } from "../../../schemaGraph/utils.js";
|
|
6
|
+
import { useSelectedLocale as v } from "../../../../utils/locales/index.js";
|
|
7
|
+
import { cn as F } from "../../../../utils/cn.js";
|
|
8
|
+
const R = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndices: d }) => {
|
|
9
|
+
const p = v(), o = y(null), u = w(n) ?? "Drop a file here or click to upload", i = k(m, n, d), { value: r, setInput: s } = I(i), t = typeof window < "u" && r instanceof File ? r : void 0, f = (t == null ? void 0 : t.name) ?? u, h = (e) => {
|
|
9
10
|
var l;
|
|
10
|
-
|
|
11
|
+
s(i, (l = e.target.files) == null ? void 0 : l[0]);
|
|
11
12
|
};
|
|
12
|
-
return /* @__PURE__ */ x
|
|
13
|
+
return /* @__PURE__ */ g(x, { children: [
|
|
13
14
|
/* @__PURE__ */ a(
|
|
14
15
|
"button",
|
|
15
16
|
{
|
|
16
|
-
"aria-label":
|
|
17
|
-
className:
|
|
17
|
+
"aria-label": p["aria.fileUploadButton"],
|
|
18
|
+
className: F(
|
|
18
19
|
"mint:text-left mint:flex mint:text-playground-input mint:overflow-hidden",
|
|
19
20
|
t ? "mint:text-gray-900! mint:dark:text-gray-100!" : "mint:text-gray-400! mint:dark:text-white/30!"
|
|
20
21
|
),
|
|
@@ -22,7 +23,7 @@ const N = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndex: u }) => {
|
|
|
22
23
|
var e;
|
|
23
24
|
return (e = o.current) == null ? void 0 : e.click();
|
|
24
25
|
},
|
|
25
|
-
children:
|
|
26
|
+
children: f
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
29
|
/* @__PURE__ */ a(
|
|
@@ -30,7 +31,7 @@ const N = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndex: u }) => {
|
|
|
30
31
|
{
|
|
31
32
|
type: "file",
|
|
32
33
|
"data-testid": `${c ?? "file"}-input`,
|
|
33
|
-
onChange:
|
|
34
|
+
onChange: h,
|
|
34
35
|
ref: o,
|
|
35
36
|
className: "mint:hidden"
|
|
36
37
|
}
|
|
@@ -38,5 +39,5 @@ const N = ({ name: c, schema: n, inputKeyPrefix: m, arrayIndex: u }) => {
|
|
|
38
39
|
] });
|
|
39
40
|
};
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
R as FileInput
|
|
42
43
|
};
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { jsxs as e, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { isEnum as
|
|
4
|
-
import { ArrayCount as
|
|
5
|
-
import { ObjectExpandButton as
|
|
6
|
-
import {
|
|
7
|
-
import { Description as
|
|
8
|
-
import { InfoPill as
|
|
9
|
-
import {
|
|
1
|
+
import { jsxs as e, Fragment as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as O } from "react";
|
|
3
|
+
import { isEnum as T } from "../../../schemaGraph/utils.js";
|
|
4
|
+
import { ArrayCount as A } from "../../../../api-playground/ApiPlayground/components/ArrayCount.js";
|
|
5
|
+
import { ObjectExpandButton as P } from "../../../../api-playground/ApiPlayground/components/ObjectExpandButton.js";
|
|
6
|
+
import { TrashIcon as S } from "lucide-react";
|
|
7
|
+
import { Description as h } from "../../../../api-playground/EndpointFields/components/Description.js";
|
|
8
|
+
import { InfoPill as $, RequiredPill as q, DeprecatedPill as B } from "../../../../components/Api/Param.js";
|
|
9
|
+
import { useSelectedLocale as L } from "../../../../utils/locales/index.js";
|
|
10
|
+
import { containsMarkdownTable as R } from "../../../../utils/containsMarkdownTable.js";
|
|
10
11
|
import { cn as m } from "../../../../utils/cn.js";
|
|
11
|
-
const
|
|
12
|
-
name:
|
|
13
|
-
schema:
|
|
14
|
-
defaultExpanded:
|
|
15
|
-
typeDropdown:
|
|
16
|
-
|
|
12
|
+
const W = ({
|
|
13
|
+
name: o,
|
|
14
|
+
schema: i,
|
|
15
|
+
defaultExpanded: d = !0,
|
|
16
|
+
typeDropdown: x,
|
|
17
|
+
arrayIndices: l,
|
|
17
18
|
parentNames: n,
|
|
18
|
-
clearValue:
|
|
19
|
+
clearValue: p,
|
|
19
20
|
style: b,
|
|
20
|
-
explode:
|
|
21
|
-
children:
|
|
21
|
+
explode: u,
|
|
22
|
+
children: k,
|
|
23
|
+
isArrayChild: v
|
|
22
24
|
}) => {
|
|
23
|
-
const [
|
|
24
|
-
return /* @__PURE__ */ e(
|
|
25
|
+
const [c, w] = O(d), g = T(i) && i.description && R(i.description), y = i.type === "array", r = i.type === "object", j = r ? Object.keys(i.properties ?? {}).length : 0, f = l && l.length > 0 ? l[l.length - 1] : void 0, a = f != null && v;
|
|
26
|
+
return /* @__PURE__ */ e(s, { children: [
|
|
25
27
|
/* @__PURE__ */ e(
|
|
26
28
|
"div",
|
|
27
29
|
{
|
|
28
30
|
className: m(
|
|
29
31
|
"mint:flex mint:space-x-3 mint:items-start",
|
|
30
|
-
|
|
32
|
+
a && !r && "mint:flex mint:items-center"
|
|
31
33
|
),
|
|
32
34
|
children: [
|
|
33
|
-
|
|
35
|
+
a && /* @__PURE__ */ t(A, { className: m(r && "mint:mt-8"), children: f + 1 }),
|
|
34
36
|
/* @__PURE__ */ e(
|
|
35
37
|
"div",
|
|
36
38
|
{
|
|
37
39
|
className: m(
|
|
38
|
-
"mint:flex-1 mint:lg:grid-cols-2 mint:gap-x-12 mint:gap-y-4 mint:py-5 mint:max-w-full",
|
|
39
|
-
|
|
40
|
-
c && "mint:flex mint:flex-col",
|
|
40
|
+
"mint:flex-1 mint:grid mint:lg:grid-cols-2 mint:gap-x-12 mint:gap-y-4 mint:py-5 mint:max-w-full",
|
|
41
|
+
y && "mint:flex mint:flex-col",
|
|
41
42
|
r && "mint:gap-y-0 mint:flex mint:flex-col mint:border mint:border-gray-50 mint:dark:border-white/5 mint:rounded-xl mint:px-4 mint:py-0 mint:my-5",
|
|
42
|
-
|
|
43
|
+
a && "mint:py-1 mint:my-2"
|
|
43
44
|
),
|
|
44
45
|
children: [
|
|
45
46
|
/* @__PURE__ */ e(
|
|
@@ -48,8 +49,8 @@ const J = ({
|
|
|
48
49
|
className: m(
|
|
49
50
|
"mint:space-y-2",
|
|
50
51
|
r && "mint:py-5 mint:border-b mint:border-gray-50 mint:dark:border-white/5",
|
|
51
|
-
!
|
|
52
|
-
|
|
52
|
+
!c && "mint:border-none",
|
|
53
|
+
a && !r && "mint:flex mint:items-center"
|
|
53
54
|
),
|
|
54
55
|
children: [
|
|
55
56
|
/* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:justify-between mint:font-mono mint:font-bold", children: [
|
|
@@ -57,70 +58,88 @@ const J = ({
|
|
|
57
58
|
"div",
|
|
58
59
|
{
|
|
59
60
|
className: "mint:flex mint:flex-wrap mint:items-center mint:gap-2 mint:text-xs mint:truncate",
|
|
60
|
-
title: n && n.length > 0 ? `${n.join(".")}.${
|
|
61
|
+
title: n && n.length > 0 ? `${n.join(".")}.${o}` : o,
|
|
61
62
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
/* @__PURE__ */ t("div", { className: m("mint:text-sm mint:truncate", o == null && "mint:hidden"), children: n && n.length > 0 && b === "deepObject" && u ? /* @__PURE__ */ e(s, { children: [
|
|
64
|
+
/* @__PURE__ */ t("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: n.map((C, N) => /* @__PURE__ */ e(s, { children: [
|
|
65
|
+
C,
|
|
66
|
+
N === 0 ? "[" : "]["
|
|
66
67
|
] })) }),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
] }) : /* @__PURE__ */ e(
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ t("span", { className: "mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100", children: o }),
|
|
69
|
+
/* @__PURE__ */ t("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: "]" })
|
|
70
|
+
] }) : /* @__PURE__ */ e(s, { children: [
|
|
71
|
+
/* @__PURE__ */ t("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: n ? `${n.join(".")}.` : "" }),
|
|
72
|
+
/* @__PURE__ */ t("span", { className: "mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100", children: o })
|
|
72
73
|
] }) }),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
x ?? /* @__PURE__ */ t($, { className: "mint:text-wrap", children: i.typeLabel }),
|
|
75
|
+
i.isRequired && /* @__PURE__ */ t(q, {}),
|
|
76
|
+
i.deprecated && /* @__PURE__ */ t(B, {})
|
|
76
77
|
]
|
|
77
78
|
}
|
|
78
79
|
),
|
|
79
|
-
r && /* @__PURE__ */
|
|
80
|
-
|
|
80
|
+
r && /* @__PURE__ */ t(
|
|
81
|
+
P,
|
|
81
82
|
{
|
|
82
|
-
onClick: () =>
|
|
83
|
-
count:
|
|
84
|
-
labeled:
|
|
83
|
+
onClick: () => w(!c),
|
|
84
|
+
count: j,
|
|
85
|
+
labeled: d == !1
|
|
85
86
|
}
|
|
86
87
|
)
|
|
87
88
|
] }),
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
i.description && !g && /* @__PURE__ */ t(
|
|
90
|
+
h,
|
|
90
91
|
{
|
|
91
|
-
markdown:
|
|
92
|
+
markdown: i.description,
|
|
92
93
|
className: "mint:text-gray-500 mint:dark:text-gray-400"
|
|
93
94
|
}
|
|
94
95
|
)
|
|
95
96
|
]
|
|
96
97
|
}
|
|
97
98
|
),
|
|
98
|
-
|
|
99
|
+
c && /* @__PURE__ */ t(
|
|
99
100
|
"div",
|
|
100
101
|
{
|
|
101
102
|
className: m(
|
|
102
103
|
"mint:grid mint:grid-cols-1 mint:w-full mint:items-start mint:divide-y mint:divide-gray-50 mint:dark:divide-white/5",
|
|
103
|
-
|
|
104
|
+
y && "mint:divide-y-0"
|
|
104
105
|
),
|
|
105
|
-
children:
|
|
106
|
+
children: k
|
|
106
107
|
}
|
|
107
108
|
)
|
|
108
109
|
]
|
|
109
110
|
}
|
|
110
111
|
),
|
|
111
|
-
(
|
|
112
|
-
|
|
112
|
+
(l != null && l.length > 0 || n) && p && /* @__PURE__ */ t(
|
|
113
|
+
D,
|
|
113
114
|
{
|
|
114
115
|
className: m(r && "mint:mt-8", n && "mint:mt-7"),
|
|
115
|
-
onClick: () =>
|
|
116
|
+
onClick: () => p()
|
|
116
117
|
}
|
|
117
118
|
)
|
|
118
119
|
]
|
|
119
120
|
}
|
|
120
121
|
),
|
|
121
|
-
|
|
122
|
+
i.description && g && /* @__PURE__ */ t(h, { markdown: i.description, className: "mint:text-gray-500 mint:dark:text-gray-400" })
|
|
122
123
|
] });
|
|
124
|
+
}, D = ({
|
|
125
|
+
className: o,
|
|
126
|
+
onClick: i
|
|
127
|
+
}) => {
|
|
128
|
+
const d = L();
|
|
129
|
+
return /* @__PURE__ */ t(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
className: m(
|
|
133
|
+
"mint:px-1 mint:text-gray-400 mint:dark:text-gray-600 mint:hover:text-gray-600 mint:dark:hover:text-gray-400",
|
|
134
|
+
o
|
|
135
|
+
),
|
|
136
|
+
onClick: i,
|
|
137
|
+
"aria-label": d["aria.deleteItem"],
|
|
138
|
+
children: /* @__PURE__ */ t(S, { className: "mint:w-4 mint:h-4" })
|
|
139
|
+
}
|
|
140
|
+
);
|
|
123
141
|
};
|
|
124
142
|
export {
|
|
125
|
-
|
|
143
|
+
W as InputContainer,
|
|
144
|
+
D as InputContainerTrashButton
|
|
126
145
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
-
import { isInteger as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { isInteger as I, isNumber as b } from "../../../../common/guards.js";
|
|
3
|
+
import { usePlaygroundInput as N } from "../../../hooks/usePlaygroundInputsStore.js";
|
|
4
|
+
import { getUniqueInputKey as h } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
5
|
+
import { getSchemaPlaceholder as P } from "../../../schemaGraph/utils.js";
|
|
5
6
|
import { useSelectedLocale as v } from "../../../../utils/locales/index.js";
|
|
6
7
|
import { Ids as x } from "../../../types/index.js";
|
|
7
8
|
const A = ({
|
|
@@ -9,9 +10,9 @@ const A = ({
|
|
|
9
10
|
schema: n,
|
|
10
11
|
inputKeyPrefix: l,
|
|
11
12
|
numberType: s,
|
|
12
|
-
|
|
13
|
+
arrayIndices: m
|
|
13
14
|
}) => {
|
|
14
|
-
const
|
|
15
|
+
const p = v(), u = P(n), r = h(l, n, m), { value: c, setInput: o } = N(r), g = u ?? `enter ${a ?? "value"}`, i = n.type, f = ((e, t) => e === "integer" ? I(t) ? t : void 0 : b(t) ? t : void 0)(s, c), d = (e) => {
|
|
15
16
|
if (e.target.value.length === 0) {
|
|
16
17
|
o(r, void 0);
|
|
17
18
|
return;
|
|
@@ -29,14 +30,14 @@ const A = ({
|
|
|
29
30
|
{
|
|
30
31
|
id: x.APIPlaygroundInput,
|
|
31
32
|
className: "mint:flex-1 mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input",
|
|
32
|
-
placeholder:
|
|
33
|
-
"aria-label": u ??
|
|
33
|
+
placeholder: g,
|
|
34
|
+
"aria-label": u ?? p["aria.enterValue"].replace("{name}", a ?? "value"),
|
|
34
35
|
onKeyDown: (e) => {
|
|
35
36
|
(e.key === "e" || e.key === "." && i === "integer") && e.preventDefault();
|
|
36
37
|
},
|
|
37
38
|
type: "number",
|
|
38
|
-
value:
|
|
39
|
-
onChange:
|
|
39
|
+
value: f ?? "",
|
|
40
|
+
onChange: d
|
|
40
41
|
}
|
|
41
42
|
);
|
|
42
43
|
};
|