@stoplight/elements-core 9.0.12 → 9.0.13-beta-0.1

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/index.mjs CHANGED
@@ -54,6 +54,7 @@ import omitBy from 'lodash/omitBy.js';
54
54
  import { QueryClient, useQueryClient, QueryClientProvider } from 'react-query';
55
55
  import { StaticRouter } from 'react-router-dom/server.js';
56
56
  import $RefParser from '@stoplight/json-schema-ref-parser';
57
+ import * as PropTypes from 'prop-types';
57
58
  import isEqual from 'lodash/isEqual.js';
58
59
  import * as ReactDOM from 'react-dom';
59
60
 
@@ -113,6 +114,8 @@ const isResolvedObjectProxy = (someObject) => {
113
114
  return !!someObject[originalObjectSymbol];
114
115
  };
115
116
  const getOriginalObject = (resolvedObject) => {
117
+ if (!resolvedObject)
118
+ return resolvedObject;
116
119
  const originalObject = resolvedObject[originalObjectSymbol] || resolvedObject;
117
120
  if (!originalObject) {
118
121
  return resolvedObject;
@@ -2738,13 +2741,358 @@ const PanelContent = ({ schemes }) => {
2738
2741
  })));
2739
2742
  };
2740
2743
 
2744
+ const TYPES = ['string', 'integer', 'boolean', 'any', 'number'];
2745
+ function resolvePointer(obj, pointer) {
2746
+ const parts = pointer.replace(/^#\//, '').split('/');
2747
+ return parts.reduce((acc, key) => acc && acc[key], obj);
2748
+ }
2749
+ function detectCircularPath(path) {
2750
+ const ignored = ['properties', 'items'];
2751
+ const parts = path.split('/').filter(part => !ignored.includes(part));
2752
+ for (let i = 0; i < parts.length - 1; i++) {
2753
+ const current = parts[i];
2754
+ const rest = parts.slice(i + 1);
2755
+ if (rest.includes(current)) {
2756
+ return true;
2757
+ }
2758
+ }
2759
+ return false;
2760
+ }
2761
+ function dereference(node, root, visited = new WeakSet(), depth = 0, maxDepth = 10) {
2762
+ if (!node || typeof node !== 'object')
2763
+ return node;
2764
+ if (depth > maxDepth)
2765
+ return node;
2766
+ if (node.$ref || node['x-iata-$ref']) {
2767
+ let refPath = node.$ref || node['x-iata-$ref'];
2768
+ if (refPath.includes('#/%24defs')) {
2769
+ refPath = refPath.replace('#/%24defs', '$defs');
2770
+ }
2771
+ else {
2772
+ refPath = refPath.replace('__bundled__', 'definitions');
2773
+ }
2774
+ if (visited.has(node))
2775
+ return { circular: true, $ref: refPath, title: node.title, type: 'any', description: node.description };
2776
+ visited.add(node);
2777
+ const target = resolvePointer(root, refPath);
2778
+ if (!target)
2779
+ return node;
2780
+ const result = Object.assign({}, target);
2781
+ if ('description' in node)
2782
+ result.description = node.description;
2783
+ if ('title' in node)
2784
+ result.title = node.title;
2785
+ return dereference(result, root, visited, depth + 1, maxDepth);
2786
+ }
2787
+ if (Array.isArray(node)) {
2788
+ return node.map(item => dereference(item, root, visited, depth + 1, maxDepth));
2789
+ }
2790
+ const result = {};
2791
+ for (const key in node) {
2792
+ result[key] = dereference(node[key], root, visited, depth + 1, maxDepth);
2793
+ }
2794
+ return result;
2795
+ }
2796
+ const trimSlashes = (str) => {
2797
+ return str.replace(/^\/|\/$/g, '');
2798
+ };
2799
+ function isPropertiesAllHidden(path, hideData) {
2800
+ const current = trimSlashes(path);
2801
+ const parts = current.split('/');
2802
+ for (let i = parts.length; i >= 2; i--) {
2803
+ if (parts[i - 1] === 'properties') {
2804
+ const ancestorPropPath = parts.slice(0, i).join('/');
2805
+ const block = hideData.find(h => trimSlashes(h.path) === ancestorPropPath && ancestorPropPath.endsWith('/properties'));
2806
+ if (block && block.required === undefined) {
2807
+ return true;
2808
+ }
2809
+ }
2810
+ }
2811
+ return false;
2812
+ }
2813
+ function isRequiredOverride(path, hideData) {
2814
+ const entry = hideData.find(h => trimSlashes(h.path) === trimSlashes(path));
2815
+ return entry && typeof entry.required === 'boolean' ? entry.required : undefined;
2816
+ }
2817
+ function isPathHidden(path, hideData, complexData) {
2818
+ const isComplex = checkIfIsComplex(path, complexData);
2819
+ if (isComplex === null) {
2820
+ return false;
2821
+ }
2822
+ else if (isComplex) {
2823
+ const normalizedPath = trimSlashes(path);
2824
+ const direct = hideData.find(h => trimSlashes(h.path) === normalizedPath);
2825
+ if (direct && direct.required === undefined)
2826
+ return true;
2827
+ if (isPropertiesAllHidden(path, hideData))
2828
+ return true;
2829
+ for (const h of hideData) {
2830
+ const hPath = trimSlashes(h.path);
2831
+ if (h.required !== undefined)
2832
+ continue;
2833
+ if (normalizedPath.length > hPath.length &&
2834
+ normalizedPath.startsWith(hPath) &&
2835
+ (hPath.endsWith('/items') || (hPath.match(/\/items\/[^\/]+$/) && normalizedPath.startsWith(hPath + '/')))) {
2836
+ return true;
2837
+ }
2838
+ }
2839
+ return false;
2840
+ }
2841
+ else {
2842
+ return !hideData.some(h => h.path === path || h.path.startsWith(path + '/'));
2843
+ }
2844
+ }
2845
+ const checkIfIsComplex = (path, complexData) => {
2846
+ let isComplex = null;
2847
+ for (const complex of complexData) {
2848
+ if (path.startsWith(complex.location)) {
2849
+ isComplex = complex === null || complex === void 0 ? void 0 : complex.isComplex;
2850
+ break;
2851
+ }
2852
+ }
2853
+ return isComplex;
2854
+ };
2855
+ const LazySchemaTreePreviewer = ({ schema, root = schema, title, level = 1, path = '', hideData = [], complexData = [], parentRequired, propertyKey, _subType, }) => {
2856
+ var _a, _b, _c, _d;
2857
+ const [expanded, setExpanded] = useState(false);
2858
+ const [selectedSchemaIndex, setSelectedSchemaIndex] = useState(0);
2859
+ const [showSchemaDropdown, setShowSchemaDropdown] = useState(false);
2860
+ const [isHoveringSelector, setIsHoveringSelector] = useState(false);
2861
+ const isRoot = level === 1 && (title === undefined || path === '');
2862
+ useEffect(() => {
2863
+ setSelectedSchemaIndex(0);
2864
+ }, [schema === null || schema === void 0 ? void 0 : schema.anyOf, schema === null || schema === void 0 ? void 0 : schema.oneOf]);
2865
+ const thisNodeRequiredOverride = isRequiredOverride(path, hideData);
2866
+ const shouldHideAllChildren = (isRoot && hideData.some(h => trimSlashes(h.path) === 'properties' && h.required === undefined)) ||
2867
+ (!isRoot && isPropertiesAllHidden(path, hideData));
2868
+ const shouldHideNode = useMemo(() => {
2869
+ if (isRoot)
2870
+ return false;
2871
+ if (isPathHidden(path, hideData, complexData) && thisNodeRequiredOverride === undefined)
2872
+ return true;
2873
+ return false;
2874
+ }, [path, hideData, isRoot, thisNodeRequiredOverride, complexData]);
2875
+ if (!schema || shouldHideNode) {
2876
+ return null;
2877
+ }
2878
+ const displayTitle = level === 1 && (title === undefined || path === '') ? '' : (_a = title !== null && title !== void 0 ? title : schema === null || schema === void 0 ? void 0 : schema.title) !== null && _a !== void 0 ? _a : 'Node';
2879
+ const handleToggle = () => {
2880
+ const circular = detectCircularPath(path);
2881
+ if (!circular) {
2882
+ setExpanded(prev => !prev);
2883
+ }
2884
+ };
2885
+ const renderChildren = () => {
2886
+ var _a, _b, _c, _d;
2887
+ if (shouldHideAllChildren)
2888
+ return null;
2889
+ if (!expanded && !isRoot)
2890
+ return null;
2891
+ const children = [];
2892
+ if ((schema === null || schema === void 0 ? void 0 : schema.type) === 'object' && ((schema === null || schema === void 0 ? void 0 : schema.properties) || (schema === null || schema === void 0 ? void 0 : schema.allOf) || (schema === null || schema === void 0 ? void 0 : schema.anyOf) || (schema === null || schema === void 0 ? void 0 : schema.oneOf))) {
2893
+ let props = schema === null || schema === void 0 ? void 0 : schema.properties;
2894
+ if (schema === null || schema === void 0 ? void 0 : schema.allOf) {
2895
+ schema === null || schema === void 0 ? void 0 : schema.allOf.forEach((item) => {
2896
+ props = Object.assign(Object.assign({}, props), item.properties);
2897
+ });
2898
+ }
2899
+ if ((schema === null || schema === void 0 ? void 0 : schema.anyOf) && (schema === null || schema === void 0 ? void 0 : schema.anyOf.length) > 0) {
2900
+ const selectedSchema = (schema === null || schema === void 0 ? void 0 : schema.anyOf[selectedSchemaIndex]) || (schema === null || schema === void 0 ? void 0 : schema.anyOf[0]);
2901
+ props = Object.assign(Object.assign({}, props), selectedSchema.properties);
2902
+ }
2903
+ if ((schema === null || schema === void 0 ? void 0 : schema.oneOf) && (schema === null || schema === void 0 ? void 0 : schema.oneOf.length) > 0) {
2904
+ const selectedSchema = (schema === null || schema === void 0 ? void 0 : schema.oneOf[selectedSchemaIndex]) || (schema === null || schema === void 0 ? void 0 : schema.oneOf[0]);
2905
+ props = Object.assign(Object.assign({}, props), selectedSchema.properties);
2906
+ }
2907
+ for (const [key, child] of Object.entries(props || {})) {
2908
+ const childPath = `${path}/properties/${key}`;
2909
+ const childRequiredOverride = isRequiredOverride(childPath, hideData);
2910
+ const shouldHideChild = isPathHidden(childPath, hideData, complexData) && childRequiredOverride === undefined;
2911
+ const resolved = dereference(child, root);
2912
+ if (!shouldHideChild) {
2913
+ children.push(React__default.createElement("li", { key: key },
2914
+ React__default.createElement(LazySchemaTreePreviewer, { schema: resolved, root: root, title: key, level: level + 1, path: childPath, hideData: hideData, complexData: complexData, parentRequired: schema === null || schema === void 0 ? void 0 : schema.required, propertyKey: key, _subType: (_a = resolved === null || resolved === void 0 ? void 0 : resolved.items) === null || _a === void 0 ? void 0 : _a.type })));
2915
+ }
2916
+ }
2917
+ }
2918
+ else if ((schema === null || schema === void 0 ? void 0 : schema.type) === 'array' &&
2919
+ (schema === null || schema === void 0 ? void 0 : schema.items) &&
2920
+ Object.keys(schema === null || schema === void 0 ? void 0 : schema.items).length > 0 &&
2921
+ !((_b = schema === null || schema === void 0 ? void 0 : schema.items) === null || _b === void 0 ? void 0 : _b.circular)) {
2922
+ const resolvedItems = dereference(schema === null || schema === void 0 ? void 0 : schema.items, root);
2923
+ const itemsPath = `${path}/items`;
2924
+ if (resolvedItems && resolvedItems.type === 'object' && resolvedItems.properties) {
2925
+ for (const [key, child] of Object.entries(resolvedItems.properties)) {
2926
+ const childPath = `${itemsPath}/properties/${key}`;
2927
+ const childRequiredOverride = isRequiredOverride(childPath, hideData);
2928
+ const shouldHideChild = isPathHidden(childPath, hideData, complexData) && childRequiredOverride === undefined;
2929
+ const resolved = dereference(child, root);
2930
+ if (!shouldHideChild) {
2931
+ children.push(React__default.createElement("li", { key: key },
2932
+ React__default.createElement(LazySchemaTreePreviewer, { schema: resolved, root: root, title: key, level: level + 2, path: childPath, hideData: hideData, complexData: complexData, parentRequired: resolvedItems.required, propertyKey: key, _subType: (_c = resolvedItems === null || resolvedItems === void 0 ? void 0 : resolvedItems.items) === null || _c === void 0 ? void 0 : _c.type })));
2933
+ }
2934
+ }
2935
+ }
2936
+ else if (resolvedItems && resolvedItems.type === 'array' && resolvedItems.items.length > 0) {
2937
+ const childPath = `${path}/items`;
2938
+ const childRequiredOverride = isRequiredOverride(childPath, hideData);
2939
+ const shouldHideChild = isPathHidden(childPath, hideData, complexData) && childRequiredOverride === undefined;
2940
+ if (!shouldHideChild) {
2941
+ children.push(React__default.createElement("li", { key: "items" },
2942
+ React__default.createElement(LazySchemaTreePreviewer, { schema: resolvedItems, root: root, title: "items", level: level + 1, path: childPath, hideData: hideData, complexData: complexData, parentRequired: schema === null || schema === void 0 ? void 0 : schema.required, propertyKey: "items", _subType: (_d = resolvedItems === null || resolvedItems === void 0 ? void 0 : resolvedItems.items) === null || _d === void 0 ? void 0 : _d.type })));
2943
+ }
2944
+ }
2945
+ }
2946
+ return children.length > 0 ? React__default.createElement("ul", { className: "ml-6 border-l border-gray-200 pl-2" }, children) : null;
2947
+ };
2948
+ const combinedSchemaSelector = () => {
2949
+ var _a;
2950
+ return (React__default.createElement(React__default.Fragment, null,
2951
+ React__default.createElement(Box, { pos: "fixed", top: 0, left: 0, right: 0, bottom: 0, bg: "transparent", style: { zIndex: 999 }, onClick: () => setShowSchemaDropdown(false) }),
2952
+ React__default.createElement(Box, { pos: "absolute", bg: "canvas", rounded: true, boxShadow: "md", style: {
2953
+ zIndex: 1000,
2954
+ top: '100%',
2955
+ left: 0,
2956
+ minWidth: '150px',
2957
+ maxWidth: '200px',
2958
+ marginTop: '2px',
2959
+ border: '1px solid rgba(0, 0, 0, 0.1)',
2960
+ }, fontSize: "sm", onClick: (e) => e.stopPropagation() }, (_a = ((schema === null || schema === void 0 ? void 0 : schema.anyOf) || (schema === null || schema === void 0 ? void 0 : schema.oneOf))) === null || _a === void 0 ? void 0 : _a.map((schemaOption, index) => (React__default.createElement(Box, { key: index, px: 3, py: 2, cursor: "pointer", bg: selectedSchemaIndex === index ? 'primary-tint' : 'canvas', fontSize: "xs", display: "flex", alignItems: "center", style: {
2961
+ borderBottom: index < ((schema === null || schema === void 0 ? void 0 : schema.anyOf) || (schema === null || schema === void 0 ? void 0 : schema.oneOf)).length - 1 ? '1px solid rgba(0, 0, 0, 0.1)' : 'none',
2962
+ gap: '8px',
2963
+ }, onMouseEnter: (e) => {
2964
+ if (selectedSchemaIndex !== index) {
2965
+ e.currentTarget.style.backgroundColor = 'var(--sl-color-canvas-tint)';
2966
+ }
2967
+ }, onMouseLeave: (e) => {
2968
+ if (selectedSchemaIndex !== index) {
2969
+ e.currentTarget.style.backgroundColor = 'var(--sl-color-canvas)';
2970
+ }
2971
+ }, onClick: () => {
2972
+ setSelectedSchemaIndex(index);
2973
+ setShowSchemaDropdown(false);
2974
+ } },
2975
+ React__default.createElement(Box, { flex: 1, color: "body" }, schemaOption.type || 'object'),
2976
+ selectedSchemaIndex === index && (React__default.createElement(Box, { color: "primary", fontSize: "xs" }, "\u2713"))))))));
2977
+ };
2978
+ const renderMinEnums = (schema) => {
2979
+ if (!schema || typeof schema !== 'object')
2980
+ return null;
2981
+ const boxStyle = {
2982
+ background: 'rgba(245, 247, 250, 0.5)',
2983
+ border: '1px solid #a0aec0',
2984
+ borderRadius: '4px',
2985
+ padding: '0px 2px',
2986
+ display: 'inline-block',
2987
+ overflowWrap: 'break-word',
2988
+ textAlign: 'left',
2989
+ maxWidth: 'fit-content',
2990
+ maxHeight: 'fit-content',
2991
+ };
2992
+ if ('minItems' in schema) {
2993
+ const schemaWithMinItems = schema;
2994
+ if (typeof schemaWithMinItems.minItems === 'number') {
2995
+ return (React__default.createElement(Box, { className: "sl-text-muted", fontFamily: "ui", fontWeight: "normal", mr: 2, style: boxStyle }, `>=${schemaWithMinItems.minItems} items`));
2996
+ }
2997
+ }
2998
+ if ('enum' in schema && Array.isArray(schema.enum)) {
2999
+ return (React__default.createElement("div", null,
3000
+ "Allowed values:",
3001
+ ' ',
3002
+ schema.enum.map((val, idx) => (React__default.createElement(Box, { key: idx, className: "sl-text-muted", fontFamily: "ui", fontWeight: "normal", mr: 2, style: boxStyle }, val)))));
3003
+ }
3004
+ return null;
3005
+ };
3006
+ const isRequired = parentRequired && propertyKey && parentRequired.includes(propertyKey);
3007
+ let showRequiredLabel = false;
3008
+ const hideDataEntry = hideData.find(hideEntry => trimSlashes(hideEntry.path) === trimSlashes(path));
3009
+ if ((hideDataEntry === null || hideDataEntry === void 0 ? void 0 : hideDataEntry.required) === true || ((hideDataEntry === null || hideDataEntry === void 0 ? void 0 : hideDataEntry.required) === undefined && isRequired)) {
3010
+ showRequiredLabel = true;
3011
+ }
3012
+ if (schema === null || schema === void 0 ? void 0 : schema.$ref) {
3013
+ schema = dereference(schema, root);
3014
+ }
3015
+ return (React__default.createElement("div", { className: "mb-1" },
3016
+ React__default.createElement(Flex, { maxW: "full", pl: 3, py: 2, "data-test": "schema-row", pos: "relative" },
3017
+ React__default.createElement(VStack, { spacing: 1, maxW: "full", className: "w-full" },
3018
+ React__default.createElement(Flex, { onClick: !isRoot ? handleToggle : undefined, className: `w-full ${isRoot ? '' : 'cursor-pointer'}` },
3019
+ !isRoot ? (React__default.createElement(Box, { mr: 2, className: "sl-font-mono sl-font-semibold sl-mr-2" },
3020
+ !TYPES.includes(schema === null || schema === void 0 ? void 0 : schema.type) &&
3021
+ !detectCircularPath(path) &&
3022
+ !((_b = schema === null || schema === void 0 ? void 0 : schema.items) === null || _b === void 0 ? void 0 : _b.circular) &&
3023
+ !(schema === null || schema === void 0 ? void 0 : schema.circular) ? (React__default.createElement("i", { role: "img", "aria-hidden": "true", className: `sl-icon fal ${expanded ? 'fa-chevron-down' : 'fa-chevron-right'} fa-fw fa-sm` })) : (React__default.createElement("span", { className: "sl-icon fal fa-fw fa-sm", "aria-hidden": "true" })),
3024
+ ' ' + displayTitle)) : null,
3025
+ !isRoot ? (React__default.createElement(Box, { mr: 2, pos: "relative" },
3026
+ React__default.createElement(Box, { display: "inline-flex", alignItems: "center", onMouseEnter: () => {
3027
+ if ((schema === null || schema === void 0 ? void 0 : schema.anyOf) || (schema === null || schema === void 0 ? void 0 : schema.oneOf)) {
3028
+ setIsHoveringSelector(true);
3029
+ }
3030
+ }, onMouseLeave: () => {
3031
+ if (!showSchemaDropdown) {
3032
+ setIsHoveringSelector(false);
3033
+ }
3034
+ }, onClick: (e) => {
3035
+ if ((schema === null || schema === void 0 ? void 0 : schema.anyOf) || (schema === null || schema === void 0 ? void 0 : schema.oneOf)) {
3036
+ e.stopPropagation();
3037
+ setShowSchemaDropdown(prev => !prev);
3038
+ }
3039
+ }, style: {
3040
+ cursor: (schema === null || schema === void 0 ? void 0 : schema.anyOf) || (schema === null || schema === void 0 ? void 0 : schema.oneOf) ? 'pointer' : 'default',
3041
+ } },
3042
+ React__default.createElement("span", { className: "sl-truncate sl-text-muted" },
3043
+ (() => {
3044
+ let typeDisplay = (schema === null || schema === void 0 ? void 0 : schema.type) === 'object' && (schema === null || schema === void 0 ? void 0 : schema.title) ? schema === null || schema === void 0 ? void 0 : schema.title : (schema === null || schema === void 0 ? void 0 : schema.type) || (root === null || root === void 0 ? void 0 : root.title);
3045
+ if ((schema === null || schema === void 0 ? void 0 : schema.anyOf) && (schema === null || schema === void 0 ? void 0 : schema.anyOf.length) > 0) {
3046
+ return `any of ${typeDisplay}`;
3047
+ }
3048
+ else if ((schema === null || schema === void 0 ? void 0 : schema.oneOf) && (schema === null || schema === void 0 ? void 0 : schema.oneOf.length) > 0) {
3049
+ return `one of ${typeDisplay}`;
3050
+ }
3051
+ return typeDisplay;
3052
+ })(),
3053
+ (schema === null || schema === void 0 ? void 0 : schema.items) && ((_c = schema === null || schema === void 0 ? void 0 : schema.items) === null || _c === void 0 ? void 0 : _c.title) !== undefined ? ` [${(_d = schema === null || schema === void 0 ? void 0 : schema.items) === null || _d === void 0 ? void 0 : _d.title}] ` : null),
3054
+ ((schema === null || schema === void 0 ? void 0 : schema.anyOf) || (schema === null || schema === void 0 ? void 0 : schema.oneOf)) && (React__default.createElement(Box, { display: "inline-flex", alignItems: "center", ml: 1, style: {
3055
+ opacity: isHoveringSelector ? 1 : 0.6,
3056
+ transition: 'opacity 0.2s',
3057
+ } },
3058
+ React__default.createElement("i", { className: "sl-icon fas fa-chevron-down", style: {
3059
+ fontSize: '10px',
3060
+ opacity: 0.6,
3061
+ } })))),
3062
+ React__default.createElement("span", { className: "text-gray-500" }, (schema === null || schema === void 0 ? void 0 : schema.format) !== undefined ? `<${schema === null || schema === void 0 ? void 0 : schema.format}>` : null),
3063
+ ((schema === null || schema === void 0 ? void 0 : schema.anyOf) || (schema === null || schema === void 0 ? void 0 : schema.oneOf)) && showSchemaDropdown && combinedSchemaSelector())) : null),
3064
+ React__default.createElement(Flex, { pl: 1, w: "full", align: "start", direction: "col", style: { overflow: 'visible', paddingLeft: '20px' } },
3065
+ (schema === null || schema === void 0 ? void 0 : schema.description) && (React__default.createElement(Box, { fontFamily: "ui", fontWeight: "light" },
3066
+ React__default.createElement("span", { className: "sl-prose sl-markdown-viewer", style: { fontSize: '12px' } }, schema === null || schema === void 0 ? void 0 : schema.description))),
3067
+ !isRoot && (schema === null || schema === void 0 ? void 0 : schema.examples) !== undefined && (React__default.createElement(Flex, { align: "center", mb: 1, style: { flexWrap: 'wrap' } },
3068
+ React__default.createElement("span", { className: "text-gray-500", style: { marginRight: 8, flexShrink: 0 } }, "Example"),
3069
+ React__default.createElement(Box, { className: "sl-text-muted", fontFamily: "ui", fontWeight: "normal", mr: 2, style: {
3070
+ background: 'rgba(245, 247, 250, 0.5)',
3071
+ border: '1px solid #a0aec0',
3072
+ borderRadius: '4px',
3073
+ padding: '4px 8px',
3074
+ display: 'inline-block',
3075
+ overflowWrap: 'break-word',
3076
+ textAlign: 'left',
3077
+ maxWidth: '530px',
3078
+ } }, JSON.stringify(schema === null || schema === void 0 ? void 0 : schema.examples))))),
3079
+ React__default.createElement(Flex, { pl: 1, w: "full", align: "start", direction: "col", style: { overflow: 'visible', paddingLeft: '20px' } }, schema &&
3080
+ typeof schema === 'object' &&
3081
+ ('minItems' in schema || 'enum' in schema) &&
3082
+ renderMinEnums(schema))),
3083
+ !isRoot && (React__default.createElement("label", { className: "inline-flex items-top ml-2" },
3084
+ React__default.createElement(Box, { mr: 2, fontFamily: "ui", fontWeight: "normal" }, showRequiredLabel && (React__default.createElement("div", { className: "sl-ml-2 sl-text-warning" },
3085
+ React__default.createElement("span", { style: { marginLeft: '10px' } }, "required"))))))),
3086
+ renderChildren()));
3087
+ };
3088
+
2741
3089
  const isBodyEmpty = (body) => {
2742
3090
  if (!body)
2743
3091
  return true;
2744
3092
  const { contents = [], description } = body;
2745
3093
  return contents.length === 0 && !(description === null || description === void 0 ? void 0 : description.trim());
2746
3094
  };
2747
- const Body = ({ body, onChange, isHttpWebhookOperation = false }) => {
3095
+ const Body = ({ body, onChange, isHttpWebhookOperation = false, disableProps }) => {
2748
3096
  var _a;
2749
3097
  const [refResolver, maxRefDepth] = useSchemaInlineRefResolver();
2750
3098
  const [chosenContent, setChosenContent] = React.useState(0);
@@ -2757,13 +3105,36 @@ const Body = ({ body, onChange, isHttpWebhookOperation = false }) => {
2757
3105
  const { contents = [], description } = body;
2758
3106
  const schema = (_a = contents[chosenContent]) === null || _a === void 0 ? void 0 : _a.schema;
2759
3107
  const descriptionChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId: body.id, attr: 'description' });
3108
+ const getMaskProperties = () => {
3109
+ const disablePropsConfig = disableProps || [];
3110
+ const absolutePathsToHide = [];
3111
+ disablePropsConfig.forEach(configEntry => {
3112
+ const { location, paths, isComplex } = configEntry;
3113
+ if (paths.length === 0 && !isComplex) {
3114
+ absolutePathsToHide.push({ path: location });
3115
+ }
3116
+ else {
3117
+ paths.forEach((item) => {
3118
+ const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
3119
+ let object = { path: fullPath };
3120
+ if (item.hasOwnProperty('required')) {
3121
+ object = Object.assign(Object.assign({}, object), { required: item === null || item === void 0 ? void 0 : item.required });
3122
+ }
3123
+ absolutePathsToHide.push(object);
3124
+ });
3125
+ }
3126
+ });
3127
+ return absolutePathsToHide;
3128
+ };
3129
+ const shouldUseLazySchema = disableProps === null || disableProps === void 0 ? void 0 : disableProps.some(entry => entry.isComplex === true);
3130
+ console.log('!!!!! shouldUseLazySchema body!!!!', shouldUseLazySchema);
2760
3131
  return (React.createElement(VStack, { spacing: 6 },
2761
3132
  React.createElement(SectionSubtitle, { title: "Body", id: "request-body" }, contents.length > 0 && (React.createElement(Flex, { flex: 1, justify: "end" },
2762
3133
  React.createElement(Select, { "aria-label": "Request Body Content Type", value: String(chosenContent), onChange: value => setChosenContent(parseInt(String(value), 10)), options: contents.map((content, index) => ({ label: content.mediaType, value: index })), size: "sm" })))),
2763
3134
  description && (React.createElement(Box, { pos: "relative" },
2764
3135
  React.createElement(MarkdownViewer, { markdown: description }),
2765
3136
  React.createElement(NodeAnnotation, { change: descriptionChanged }))),
2766
- isJSONSchema(schema) && (React.createElement(JsonSchemaViewer, { resolveRef: refResolver, maxRefDepth: maxRefDepth, schema: getOriginalObject(schema), viewMode: isHttpWebhookOperation ? 'standalone' : 'write', renderRootTreeLines: true, nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon }))));
3137
+ schema && shouldUseLazySchema ? (React.createElement(LazySchemaTreePreviewer, { schema: schema, hideData: getMaskProperties(), complexData: disableProps })) : (isJSONSchema(schema) && (React.createElement(JsonSchemaViewer, { resolveRef: refResolver, maxRefDepth: maxRefDepth, schema: getOriginalObject(schema), viewMode: isHttpWebhookOperation ? 'standalone' : 'write', renderRootTreeLines: true, nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon })))));
2767
3138
  };
2768
3139
  Body.displayName = 'HttpOperation.Body';
2769
3140
 
@@ -2830,7 +3201,7 @@ const httpOperationParamsToSchema = ({ parameters, parameterType }) => {
2830
3201
  return schema;
2831
3202
  };
2832
3203
 
2833
- const Request = ({ operation: { request, request: { path: pathParams = [], headers: headerParams = [], cookie: cookieParams = [], body, query: queryParams = [], } = {}, security, }, hideSecurityInfo, onChange, isHttpWebhookOperation = false, }) => {
3204
+ const Request = ({ operation: { request, request: { path: pathParams = [], headers: headerParams = [], cookie: cookieParams = [], body, query: queryParams = [], } = {}, security, }, hideSecurityInfo, onChange, isHttpWebhookOperation = false, disableProps, }) => {
2834
3205
  if (!request || typeof request !== 'object')
2835
3206
  return null;
2836
3207
  const bodyIsEmpty = isBodyEmpty(body);
@@ -2858,7 +3229,7 @@ const Request = ({ operation: { request, request: { path: pathParams = [], heade
2858
3229
  cookieParams.length > 0 && (React.createElement(VStack, { spacing: 5 },
2859
3230
  React.createElement(SectionSubtitle, { title: "Cookies", id: "request-cookies" }),
2860
3231
  React.createElement(Parameters, { parameterType: "cookie", parameters: cookieParams }))),
2861
- body && React.createElement(Body, { onChange: onChange, body: body, isHttpWebhookOperation: isHttpWebhookOperation })));
3232
+ body && (React.createElement(Body, { onChange: onChange, body: body, isHttpWebhookOperation: isHttpWebhookOperation, disableProps: disableProps }))));
2862
3233
  };
2863
3234
  Request.displayName = 'HttpOperation.Request';
2864
3235
  const schemeExpandedState = atomWithStorage('HttpOperation_security_expanded', {});
@@ -2889,7 +3260,7 @@ const OptionalMessage$1 = () => {
2889
3260
  return React.createElement(Callout, { appearance: "outline" }, OptionalSecurityMessage);
2890
3261
  };
2891
3262
 
2892
- const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTypeChange, isCompact, }) => {
3263
+ const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTypeChange, isCompact, disableProps, }) => {
2893
3264
  var _a, _b;
2894
3265
  const responses = sortBy(uniqBy(unsortedResponses, r => r.code), r => r.code);
2895
3266
  const [activeResponseId, setActiveResponseId] = React.useState((_b = (_a = responses[0]) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : '');
@@ -2922,11 +3293,12 @@ const Responses = ({ responses: unsortedResponses, onStatusCodeChange, onMediaTy
2922
3293
  const tabResponses = (React.createElement(TabList, { density: "compact" }, responses.map(({ code }) => (React.createElement(Tab, { key: code, id: code, intent: codeToIntentVal(code) }, code)))));
2923
3294
  return (React.createElement(VStack, { spacing: 8, as: Tabs, selectedId: activeResponseId, onChange: setActiveResponseId, appearance: "pill" },
2924
3295
  React.createElement(SectionTitle, { title: "Responses", isCompact: isCompact }, isCompact ? compactResponses : tabResponses),
2925
- isCompact ? (React.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange })) : (React.createElement(TabPanels, { p: 0 }, responses.map(response => (React.createElement(TabPanel, { key: response.code, id: response.code },
2926
- React.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange }))))))));
3296
+ isCompact ? (React.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange, disableProps: disableProps, statusCode: activeResponseId })) : (React.createElement(TabPanels, { p: 0 }, responses.map(response => (React.createElement(TabPanel, { key: response.code, id: response.code },
3297
+ React.createElement(Response, { response: response, onMediaTypeChange: onMediaTypeChange, disableProps: disableProps, statusCode: response.code }))))))));
2927
3298
  };
2928
3299
  Responses.displayName = 'HttpOperation.Responses';
2929
- const Response = ({ response, onMediaTypeChange }) => {
3300
+ const Response = ({ response, onMediaTypeChange, disableProps, statusCode }) => {
3301
+ var _a, _b;
2930
3302
  const { contents = [], headers = [], description } = response;
2931
3303
  const [chosenContent, setChosenContent] = React.useState(0);
2932
3304
  const [refResolver, maxRefDepth] = useSchemaInlineRefResolver();
@@ -2937,6 +3309,29 @@ const Response = ({ response, onMediaTypeChange }) => {
2937
3309
  responseContent && (onMediaTypeChange === null || onMediaTypeChange === void 0 ? void 0 : onMediaTypeChange(responseContent.mediaType));
2938
3310
  }, [responseContent]);
2939
3311
  const descriptionChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId: response.id, attr: 'description' });
3312
+ const getMaskProperties = () => {
3313
+ if (!disableProps || !statusCode)
3314
+ return [];
3315
+ const configEntries = disableProps[statusCode] || [];
3316
+ const absolutePathsToHide = [];
3317
+ configEntries.forEach(({ location, paths, isComplex }) => {
3318
+ if (paths.length === 0 && !isComplex) {
3319
+ absolutePathsToHide.push({ path: location });
3320
+ }
3321
+ else {
3322
+ paths.forEach((item) => {
3323
+ const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
3324
+ let object = { path: fullPath };
3325
+ if (item.hasOwnProperty('required')) {
3326
+ object = Object.assign(Object.assign({}, object), { required: item === null || item === void 0 ? void 0 : item.required });
3327
+ }
3328
+ absolutePathsToHide.push(object);
3329
+ });
3330
+ }
3331
+ });
3332
+ return absolutePathsToHide;
3333
+ };
3334
+ const shouldUseLazySchema = (_b = (statusCode && ((_a = disableProps === null || disableProps === void 0 ? void 0 : disableProps[statusCode]) === null || _a === void 0 ? void 0 : _a.some(entry => entry.isComplex)))) !== null && _b !== void 0 ? _b : false;
2940
3335
  return (React.createElement(VStack, { spacing: 8, pt: 8 },
2941
3336
  description && (React.createElement(Box, { pos: "relative" },
2942
3337
  React.createElement(MarkdownViewer, { markdown: description }),
@@ -2948,7 +3343,7 @@ const Response = ({ response, onMediaTypeChange }) => {
2948
3343
  React.createElement(SectionSubtitle, { title: "Body", id: "response-body" },
2949
3344
  React.createElement(Flex, { flex: 1, justify: "end" },
2950
3345
  React.createElement(Select, { "aria-label": "Response Body Content Type", value: String(chosenContent), onChange: value => setChosenContent(parseInt(String(value), 10)), options: contents.map((content, index) => ({ label: content.mediaType, value: index })), size: "sm" }))),
2951
- schema && (React.createElement(JsonSchemaViewer, { schema: getOriginalObject(schema), resolveRef: refResolver, maxRefDepth: maxRefDepth, viewMode: "read", parentCrumbs: ['responses', response.code], renderRootTreeLines: true, nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon }))))));
3346
+ schema && shouldUseLazySchema ? (React.createElement(LazySchemaTreePreviewer, { schema: schema, path: "", hideData: getMaskProperties(), complexData: disableProps && statusCode ? disableProps[statusCode] : [] })) : (React.createElement(JsonSchemaViewer, { schema: getOriginalObject(schema), resolveRef: refResolver, maxRefDepth: maxRefDepth, viewMode: "read", parentCrumbs: ['responses', response.code], renderRootTreeLines: true, nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon }))))));
2952
3347
  };
2953
3348
  Response.displayName = 'HttpOperation.Response';
2954
3349
  const codeToIntentVal = (code) => {
@@ -2997,7 +3392,7 @@ const Callback = ({ data, isCompact }) => {
2997
3392
  };
2998
3393
  Callbacks.displayName = 'HttpOperation.Callback';
2999
3394
 
3000
- const HttpOperationComponent = React.memo(({ className, data: unresolvedData, layoutOptions, tryItCredentialsPolicy, tryItCorsProxy }) => {
3395
+ const HttpOperationComponent = React.memo(({ className, data: unresolvedData, layoutOptions, tryItCredentialsPolicy, tryItCorsProxy, disableProps }) => {
3001
3396
  var _a;
3002
3397
  const { nodeHasChanged } = useOptionsCtx();
3003
3398
  const data = useResolvedObject(unresolvedData);
@@ -3028,11 +3423,11 @@ const HttpOperationComponent = React.memo(({ className, data: unresolvedData, la
3028
3423
  React.createElement(MarkdownViewer, { className: "HttpOperation__Description", markdown: data.description }),
3029
3424
  React.createElement(NodeAnnotation, { change: descriptionChanged }))),
3030
3425
  React.createElement(NodeVendorExtensions, { data: data }),
3031
- React.createElement(Request, { onChange: setTextRequestBodyIndex, operation: data, hideSecurityInfo: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideSecurityInfo, isHttpWebhookOperation: isHttpWebhookOperation(data) }),
3032
- data.responses && (React.createElement(Responses, { responses: data.responses, onMediaTypeChange: setResponseMediaType, onStatusCodeChange: setResponseStatusCode, isCompact: isCompact })),
3426
+ React.createElement(Request, { onChange: setTextRequestBodyIndex, operation: data, hideSecurityInfo: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideSecurityInfo, isHttpWebhookOperation: isHttpWebhookOperation(data), disableProps: disableProps === null || disableProps === void 0 ? void 0 : disableProps.request }),
3427
+ data.responses && (React.createElement(Responses, { responses: data.responses, onMediaTypeChange: setResponseMediaType, onStatusCodeChange: setResponseStatusCode, isCompact: isCompact, disableProps: disableProps === null || disableProps === void 0 ? void 0 : disableProps.response })),
3033
3428
  ((_a = data.callbacks) === null || _a === void 0 ? void 0 : _a.length) ? React.createElement(Callbacks, { callbacks: data.callbacks, isCompact: isCompact }) : null,
3034
3429
  isCompact && tryItPanel));
3035
- return (React.createElement(TwoColumnLayout, { ref: layoutRef, className: cn('HttpOperation', className), header: header, left: description, right: !isCompact && tryItPanel }));
3430
+ return (React.createElement(TwoColumnLayout, { ref: layoutRef, className: cn('HttpOperation', className), header: header, left: description, right: !(disableProps === null || disableProps === void 0 ? void 0 : disableProps.hideOperationTryIt) && !isCompact && tryItPanel }));
3036
3431
  });
3037
3432
  HttpOperationComponent.displayName = 'HttpOperation.Component';
3038
3433
  const HttpOperation = withErrorBoundary(HttpOperationComponent, {
@@ -3283,7 +3678,7 @@ const HttpServiceComponent = React.memo(({ data: unresolvedData, location = {},
3283
3678
  HttpServiceComponent.displayName = 'HttpService.Component';
3284
3679
  const HttpService = withErrorBoundary(HttpServiceComponent, { recoverableProps: ['data'] });
3285
3680
 
3286
- const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOptions, exportProps, }) => {
3681
+ const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOptions, exportProps, disableProps, }) => {
3287
3682
  var _a, _b;
3288
3683
  const [resolveRef, maxRefDepth] = useSchemaInlineRefResolver();
3289
3684
  const data = useResolvedObject(unresolvedData);
@@ -3306,14 +3701,40 @@ const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOpti
3306
3701
  exportProps && !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideExport) && !isCompact && React.createElement(ExportButton, Object.assign({}, exportProps))));
3307
3702
  const modelExamples = !(layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.hideModelExamples) && React.createElement(ModelExamples, { data: data, isCollapsible: isCompact });
3308
3703
  const descriptionChanged = nodeHasChanged === null || nodeHasChanged === void 0 ? void 0 : nodeHasChanged({ nodeId, attr: 'description' });
3704
+ const getMaskProperties = () => {
3705
+ const disablePropsConfig = disableProps === null || disableProps === void 0 ? void 0 : disableProps.models;
3706
+ const absolutePathsToHide = [];
3707
+ if (disableProps === null || disableProps === void 0 ? void 0 : disableProps.models) {
3708
+ disablePropsConfig.forEach((configEntry) => {
3709
+ const { location, paths, isComplex } = configEntry;
3710
+ if (paths.length === 0 && !isComplex) {
3711
+ absolutePathsToHide.push({ path: location });
3712
+ }
3713
+ else {
3714
+ paths.forEach((item) => {
3715
+ const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
3716
+ let object = { path: fullPath };
3717
+ if (item.hasOwnProperty('required')) {
3718
+ object = Object.assign(Object.assign({}, object), { required: item === null || item === void 0 ? void 0 : item.required });
3719
+ }
3720
+ absolutePathsToHide.push(object);
3721
+ });
3722
+ }
3723
+ });
3724
+ }
3725
+ return absolutePathsToHide;
3726
+ };
3727
+ const shouldUseLazySchema = disableProps && (disableProps === null || disableProps === void 0 ? void 0 : disableProps.models)
3728
+ ? disableProps.models.some((entry) => entry.isComplex === true)
3729
+ : false;
3309
3730
  const description = (React.createElement(VStack, { spacing: 10 },
3310
3731
  data.description && data.type === 'object' && (React.createElement(Box, { pos: "relative" },
3311
3732
  React.createElement(MarkdownViewer, { role: "textbox", markdown: data.description }),
3312
3733
  React.createElement(NodeAnnotation, { change: descriptionChanged }))),
3313
3734
  React.createElement(NodeVendorExtensions, { data: data }),
3314
- isCompact && modelExamples,
3315
- React.createElement(JsonSchemaViewer, { resolveRef: resolveRef, maxRefDepth: maxRefDepth, schema: getOriginalObject(data), nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon, skipTopLevelDescription: true })));
3316
- return (React.createElement(TwoColumnLayout, { ref: layoutRef, className: cn('Model', className), header: header, left: description, right: !isCompact && modelExamples }));
3735
+ !(disableProps === null || disableProps === void 0 ? void 0 : disableProps.hideModelTryIt) && isCompact && modelExamples,
3736
+ data && shouldUseLazySchema ? (React.createElement(LazySchemaTreePreviewer, { schema: data, hideData: getMaskProperties(), complexData: disableProps === null || disableProps === void 0 ? void 0 : disableProps.models })) : (React.createElement(JsonSchemaViewer, { resolveRef: resolveRef, maxRefDepth: maxRefDepth, schema: getOriginalObject(data), nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon, skipTopLevelDescription: true }))));
3737
+ return (React.createElement(TwoColumnLayout, { ref: layoutRef, className: cn('Model', className), header: header, left: description, right: !(disableProps === null || disableProps === void 0 ? void 0 : disableProps.hideModelTryIt) && !isCompact && modelExamples }));
3317
3738
  };
3318
3739
  const ModelExamples = React.memo(({ data, isCollapsible = false }) => {
3319
3740
  var _a;
@@ -3335,30 +3756,41 @@ const Model = withErrorBoundary(ModelComponent, { recoverableProps: ['data'] });
3335
3756
 
3336
3757
  const Docs = React.memo((_a) => {
3337
3758
  var _b;
3338
- var { nodeType, nodeData, useNodeForRefResolving = false, refResolver, maxRefDepth, nodeHasChanged, renderExtensionAddon } = _a, commonProps = __rest(_a, ["nodeType", "nodeData", "useNodeForRefResolving", "refResolver", "maxRefDepth", "nodeHasChanged", "renderExtensionAddon"]);
3759
+ var { nodeType, nodeData, disableProps, useNodeForRefResolving = false, refResolver, maxRefDepth, nodeHasChanged, renderExtensionAddon } = _a, commonProps = __rest(_a, ["nodeType", "nodeData", "disableProps", "useNodeForRefResolving", "refResolver", "maxRefDepth", "nodeHasChanged", "renderExtensionAddon"]);
3339
3760
  const parsedNode = useParsedData(nodeType, nodeData);
3340
3761
  if (!parsedNode) {
3341
3762
  (_b = commonProps.nodeUnsupported) === null || _b === void 0 ? void 0 : _b.call(commonProps, 'dataEmpty');
3342
3763
  return null;
3343
3764
  }
3344
- let elem = React.createElement(ParsedDocs, Object.assign({ node: parsedNode }, commonProps));
3765
+ let elem = React.createElement(ParsedDocs, Object.assign({ node: parsedNode, disableProps: disableProps }, commonProps));
3345
3766
  if (useNodeForRefResolving) {
3346
3767
  elem = (React.createElement(InlineRefResolverProvider, { document: parsedNode.data, resolver: refResolver, maxRefDepth: maxRefDepth }, elem));
3347
3768
  }
3348
3769
  return (React.createElement(ElementsOptionsProvider, { nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon }, elem));
3349
3770
  });
3771
+ const getTryItVisibility = (disableProps) => {
3772
+ var _a, _b, _c, _d;
3773
+ if (!disableProps)
3774
+ return { hideOperationTryIt: false, hideModelTryIt: false };
3775
+ const requestHasComplex = (_b = (_a = disableProps.request) === null || _a === void 0 ? void 0 : _a.some(item => item.isComplex)) !== null && _b !== void 0 ? _b : false;
3776
+ const responseHasComplex = Object.values(disableProps.response || {}).some(arr => arr.some(item => item.isComplex));
3777
+ const hideOperationTryIt = requestHasComplex || responseHasComplex;
3778
+ const hideModelTryIt = (_d = (_c = disableProps.models) === null || _c === void 0 ? void 0 : _c.some(item => item.isComplex)) !== null && _d !== void 0 ? _d : false;
3779
+ return { hideOperationTryIt, hideModelTryIt };
3780
+ };
3350
3781
  const ParsedDocs = (_a) => {
3351
- var { node, nodeUnsupported } = _a, commonProps = __rest(_a, ["node", "nodeUnsupported"]);
3782
+ var { node, nodeUnsupported, disableProps } = _a, commonProps = __rest(_a, ["node", "nodeUnsupported", "disableProps"]);
3783
+ const { hideOperationTryIt, hideModelTryIt } = getTryItVisibility(disableProps);
3352
3784
  switch (node.type) {
3353
3785
  case 'article':
3354
3786
  return React.createElement(Article, Object.assign({ data: node.data }, commonProps));
3355
3787
  case 'http_operation':
3356
3788
  case 'http_webhook':
3357
- return React.createElement(HttpOperation, Object.assign({ data: node.data }, commonProps));
3789
+ return React.createElement(HttpOperation, Object.assign({ data: node.data, disableProps: Object.assign(Object.assign({}, disableProps), { hideOperationTryIt }) }, commonProps));
3358
3790
  case 'http_service':
3359
3791
  return React.createElement(HttpService, Object.assign({ data: node.data }, commonProps));
3360
3792
  case 'model':
3361
- return React.createElement(Model, Object.assign({ data: node.data }, commonProps));
3793
+ return React.createElement(Model, Object.assign({ data: node.data, disableProps: Object.assign(Object.assign({}, disableProps), { hideModelTryIt }) }, commonProps));
3362
3794
  default:
3363
3795
  nodeUnsupported === null || nodeUnsupported === void 0 ? void 0 : nodeUnsupported('invalidType');
3364
3796
  return null;
@@ -4104,12 +4536,25 @@ const doBundle = (data, baseUrl) => {
4104
4536
  }
4105
4537
  };
4106
4538
 
4107
- const Styled = ({ children }) => {
4108
- return (React.createElement(Box, { className: "sl-elements sl-antialiased", fontFamily: "ui", fontSize: "base", color: "body", h: "full" }, children));
4539
+ const scopeClassName = 'sl-elements';
4540
+ class Styled extends React.Component {
4541
+ getChildContext() {
4542
+ return {
4543
+ blueprintPortalClassName: scopeClassName,
4544
+ };
4545
+ }
4546
+ render() {
4547
+ return (React.createElement(Box, { className: "sl-elements sl-antialiased", fontFamily: "ui", fontSize: "base", color: "body", h: "full" }, this.props.children));
4548
+ }
4549
+ }
4550
+ Styled.childContextTypes = {
4551
+ blueprintPortalClassName: PropTypes.string,
4109
4552
  };
4110
4553
  function withStyles(Component) {
4111
- const Inner = props => (React.createElement(Styled, null,
4112
- React.createElement(Component, Object.assign({}, props))));
4554
+ const Inner = props => {
4555
+ return (React.createElement(Styled, null,
4556
+ React.createElement(Component, Object.assign({}, props))));
4557
+ };
4113
4558
  Inner.displayName = `withStyles(${getDisplayName(Component)})`;
4114
4559
  return Inner;
4115
4560
  }
@@ -4159,7 +4604,7 @@ const createElementClass = (Component, propDescriptors) => {
4159
4604
  }
4160
4605
  disconnectedCallback() {
4161
4606
  if (this._mountPoint) {
4162
- ReactDOM.render(null, this._mountPoint);
4607
+ ReactDOM.unmountComponentAtNode(this._mountPoint);
4163
4608
  this.removeChild(this._mountPoint);
4164
4609
  this._mountPoint = undefined;
4165
4610
  }