@stoplight/elements-core 9.0.3 → 9.0.4
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/components/Docs/Docs.d.ts +3 -1
- package/index.d.ts +2 -2
- package/index.esm.js +6 -8
- package/index.js +6 -8
- package/index.mjs +6 -8
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ export interface DocsProps extends BaseDocsProps {
|
|
|
44
44
|
useNodeForRefResolving?: boolean;
|
|
45
45
|
refResolver?: ReferenceResolver;
|
|
46
46
|
maxRefDepth?: number;
|
|
47
|
+
disableProps?: any;
|
|
47
48
|
}
|
|
48
49
|
export interface DocsComponentProps<T = unknown> extends BaseDocsProps {
|
|
49
50
|
data: T;
|
|
@@ -52,6 +53,7 @@ export interface DocsComponentProps<T = unknown> extends BaseDocsProps {
|
|
|
52
53
|
export declare const Docs: React.NamedExoticComponent<DocsProps>;
|
|
53
54
|
export interface ParsedDocsProps extends BaseDocsProps {
|
|
54
55
|
node: ParsedNode;
|
|
56
|
+
disableProps?: any;
|
|
55
57
|
}
|
|
56
|
-
export declare const ParsedDocs: ({ node, nodeUnsupported, ...commonProps }: ParsedDocsProps) => JSX.Element | null;
|
|
58
|
+
export declare const ParsedDocs: ({ node, nodeUnsupported, disableProps, ...commonProps }: ParsedDocsProps) => JSX.Element | null;
|
|
57
59
|
export { DocsSkeleton } from './Skeleton';
|
package/index.d.ts
CHANGED
|
@@ -32,8 +32,8 @@ export { useRouter } from './hooks/useRouter';
|
|
|
32
32
|
export { Styled, withStyles } from './styled';
|
|
33
33
|
export { Divider, Group, ITableOfContentsTree, Item, ParsedNode, RoutingProps, TableOfContentItem } from './types';
|
|
34
34
|
export { isHttpOperation, isHttpService, isHttpWebhookOperation } from './utils/guards';
|
|
35
|
+
export { resolveUrl } from './utils/http-spec/IServer';
|
|
35
36
|
export { ReferenceResolver } from './utils/ref-resolving/ReferenceResolver';
|
|
36
37
|
export { createResolvedObject } from './utils/ref-resolving/resolvedObject';
|
|
37
|
-
export {
|
|
38
|
+
export { resolveRelativeLink, slugify } from './utils/string';
|
|
38
39
|
export { createElementClass } from './web-components/createElementClass';
|
|
39
|
-
export { resolveUrl } from './utils/http-spec/IServer';
|
package/index.esm.js
CHANGED
|
@@ -2962,7 +2962,7 @@ const Body = ({ body, onChange, isHttpWebhookOperation = false, disableProps })
|
|
|
2962
2962
|
disablePropsConfig.forEach(configEntry => {
|
|
2963
2963
|
const { location, paths } = configEntry;
|
|
2964
2964
|
paths.forEach(item => {
|
|
2965
|
-
const fullPath = `${location}/${item.path}`;
|
|
2965
|
+
const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
|
|
2966
2966
|
absolutePathsToHide.push({ path: fullPath });
|
|
2967
2967
|
});
|
|
2968
2968
|
});
|
|
@@ -3155,7 +3155,7 @@ const Response = ({ response, onMediaTypeChange, disableProps, statusCode }) =>
|
|
|
3155
3155
|
const absolutePathsToHide = [];
|
|
3156
3156
|
configEntries.forEach(({ location, paths }) => {
|
|
3157
3157
|
paths.forEach(item => {
|
|
3158
|
-
absolutePathsToHide.push({ path: `${location}/${item.path}` });
|
|
3158
|
+
absolutePathsToHide.push({ path: location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}` });
|
|
3159
3159
|
});
|
|
3160
3160
|
});
|
|
3161
3161
|
return absolutePathsToHide;
|
|
@@ -3533,7 +3533,7 @@ const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOpti
|
|
|
3533
3533
|
disablePropsConfig.forEach((configEntry) => {
|
|
3534
3534
|
const { location, paths } = configEntry;
|
|
3535
3535
|
paths.forEach((item) => {
|
|
3536
|
-
const fullPath = `${location}/${item.path}`;
|
|
3536
|
+
const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
|
|
3537
3537
|
absolutePathsToHide.push({ path: fullPath });
|
|
3538
3538
|
});
|
|
3539
3539
|
});
|
|
@@ -3569,22 +3569,20 @@ const Model = withErrorBoundary(ModelComponent, { recoverableProps: ['data'] });
|
|
|
3569
3569
|
|
|
3570
3570
|
const Docs = React.memo((_a) => {
|
|
3571
3571
|
var _b;
|
|
3572
|
-
var { nodeType, nodeData, useNodeForRefResolving = false, refResolver, maxRefDepth, nodeHasChanged, renderExtensionAddon } = _a, commonProps = __rest(_a, ["nodeType", "nodeData", "useNodeForRefResolving", "refResolver", "maxRefDepth", "nodeHasChanged", "renderExtensionAddon"]);
|
|
3572
|
+
var { nodeType, nodeData, disableProps, useNodeForRefResolving = false, refResolver, maxRefDepth, nodeHasChanged, renderExtensionAddon } = _a, commonProps = __rest(_a, ["nodeType", "nodeData", "disableProps", "useNodeForRefResolving", "refResolver", "maxRefDepth", "nodeHasChanged", "renderExtensionAddon"]);
|
|
3573
3573
|
const parsedNode = useParsedData(nodeType, nodeData);
|
|
3574
3574
|
if (!parsedNode) {
|
|
3575
3575
|
(_b = commonProps.nodeUnsupported) === null || _b === void 0 ? void 0 : _b.call(commonProps, 'dataEmpty');
|
|
3576
3576
|
return null;
|
|
3577
3577
|
}
|
|
3578
|
-
let elem = React.createElement(ParsedDocs, Object.assign({ node: parsedNode }, commonProps));
|
|
3578
|
+
let elem = React.createElement(ParsedDocs, Object.assign({ node: parsedNode, disableProps: disableProps }, commonProps));
|
|
3579
3579
|
if (useNodeForRefResolving) {
|
|
3580
3580
|
elem = (React.createElement(InlineRefResolverProvider, { document: parsedNode.data, resolver: refResolver, maxRefDepth: maxRefDepth }, elem));
|
|
3581
3581
|
}
|
|
3582
3582
|
return (React.createElement(ElementsOptionsProvider, { nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon }, elem));
|
|
3583
3583
|
});
|
|
3584
3584
|
const ParsedDocs = (_a) => {
|
|
3585
|
-
var
|
|
3586
|
-
var { node, nodeUnsupported } = _a, commonProps = __rest(_a, ["node", "nodeUnsupported"]);
|
|
3587
|
-
const disableProps = (_b = node.data) === null || _b === void 0 ? void 0 : _b.disableProps;
|
|
3585
|
+
var { node, nodeUnsupported, disableProps } = _a, commonProps = __rest(_a, ["node", "nodeUnsupported", "disableProps"]);
|
|
3588
3586
|
switch (node.type) {
|
|
3589
3587
|
case 'article':
|
|
3590
3588
|
return React.createElement(Article, Object.assign({ data: node.data }, commonProps));
|
package/index.js
CHANGED
|
@@ -2984,7 +2984,7 @@ const Body = ({ body, onChange, isHttpWebhookOperation = false, disableProps })
|
|
|
2984
2984
|
disablePropsConfig.forEach(configEntry => {
|
|
2985
2985
|
const { location, paths } = configEntry;
|
|
2986
2986
|
paths.forEach(item => {
|
|
2987
|
-
const fullPath = `${location}/${item.path}`;
|
|
2987
|
+
const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
|
|
2988
2988
|
absolutePathsToHide.push({ path: fullPath });
|
|
2989
2989
|
});
|
|
2990
2990
|
});
|
|
@@ -3177,7 +3177,7 @@ const Response = ({ response, onMediaTypeChange, disableProps, statusCode }) =>
|
|
|
3177
3177
|
const absolutePathsToHide = [];
|
|
3178
3178
|
configEntries.forEach(({ location, paths }) => {
|
|
3179
3179
|
paths.forEach(item => {
|
|
3180
|
-
absolutePathsToHide.push({ path: `${location}/${item.path}` });
|
|
3180
|
+
absolutePathsToHide.push({ path: location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}` });
|
|
3181
3181
|
});
|
|
3182
3182
|
});
|
|
3183
3183
|
return absolutePathsToHide;
|
|
@@ -3555,7 +3555,7 @@ const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOpti
|
|
|
3555
3555
|
disablePropsConfig.forEach((configEntry) => {
|
|
3556
3556
|
const { location, paths } = configEntry;
|
|
3557
3557
|
paths.forEach((item) => {
|
|
3558
|
-
const fullPath = `${location}/${item.path}`;
|
|
3558
|
+
const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
|
|
3559
3559
|
absolutePathsToHide.push({ path: fullPath });
|
|
3560
3560
|
});
|
|
3561
3561
|
});
|
|
@@ -3591,22 +3591,20 @@ const Model = reactErrorBoundary.withErrorBoundary(ModelComponent, { recoverable
|
|
|
3591
3591
|
|
|
3592
3592
|
const Docs = React__namespace.memo((_a) => {
|
|
3593
3593
|
var _b;
|
|
3594
|
-
var { nodeType, nodeData, useNodeForRefResolving = false, refResolver, maxRefDepth, nodeHasChanged, renderExtensionAddon } = _a, commonProps = tslib.__rest(_a, ["nodeType", "nodeData", "useNodeForRefResolving", "refResolver", "maxRefDepth", "nodeHasChanged", "renderExtensionAddon"]);
|
|
3594
|
+
var { nodeType, nodeData, disableProps, useNodeForRefResolving = false, refResolver, maxRefDepth, nodeHasChanged, renderExtensionAddon } = _a, commonProps = tslib.__rest(_a, ["nodeType", "nodeData", "disableProps", "useNodeForRefResolving", "refResolver", "maxRefDepth", "nodeHasChanged", "renderExtensionAddon"]);
|
|
3595
3595
|
const parsedNode = useParsedData(nodeType, nodeData);
|
|
3596
3596
|
if (!parsedNode) {
|
|
3597
3597
|
(_b = commonProps.nodeUnsupported) === null || _b === void 0 ? void 0 : _b.call(commonProps, 'dataEmpty');
|
|
3598
3598
|
return null;
|
|
3599
3599
|
}
|
|
3600
|
-
let elem = React__namespace.createElement(ParsedDocs, Object.assign({ node: parsedNode }, commonProps));
|
|
3600
|
+
let elem = React__namespace.createElement(ParsedDocs, Object.assign({ node: parsedNode, disableProps: disableProps }, commonProps));
|
|
3601
3601
|
if (useNodeForRefResolving) {
|
|
3602
3602
|
elem = (React__namespace.createElement(InlineRefResolverProvider, { document: parsedNode.data, resolver: refResolver, maxRefDepth: maxRefDepth }, elem));
|
|
3603
3603
|
}
|
|
3604
3604
|
return (React__namespace.createElement(ElementsOptionsProvider, { nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon }, elem));
|
|
3605
3605
|
});
|
|
3606
3606
|
const ParsedDocs = (_a) => {
|
|
3607
|
-
var
|
|
3608
|
-
var { node, nodeUnsupported } = _a, commonProps = tslib.__rest(_a, ["node", "nodeUnsupported"]);
|
|
3609
|
-
const disableProps = (_b = node.data) === null || _b === void 0 ? void 0 : _b.disableProps;
|
|
3607
|
+
var { node, nodeUnsupported, disableProps } = _a, commonProps = tslib.__rest(_a, ["node", "nodeUnsupported", "disableProps"]);
|
|
3610
3608
|
switch (node.type) {
|
|
3611
3609
|
case 'article':
|
|
3612
3610
|
return React__namespace.createElement(Article, Object.assign({ data: node.data }, commonProps));
|
package/index.mjs
CHANGED
|
@@ -2962,7 +2962,7 @@ const Body = ({ body, onChange, isHttpWebhookOperation = false, disableProps })
|
|
|
2962
2962
|
disablePropsConfig.forEach(configEntry => {
|
|
2963
2963
|
const { location, paths } = configEntry;
|
|
2964
2964
|
paths.forEach(item => {
|
|
2965
|
-
const fullPath = `${location}/${item.path}`;
|
|
2965
|
+
const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
|
|
2966
2966
|
absolutePathsToHide.push({ path: fullPath });
|
|
2967
2967
|
});
|
|
2968
2968
|
});
|
|
@@ -3155,7 +3155,7 @@ const Response = ({ response, onMediaTypeChange, disableProps, statusCode }) =>
|
|
|
3155
3155
|
const absolutePathsToHide = [];
|
|
3156
3156
|
configEntries.forEach(({ location, paths }) => {
|
|
3157
3157
|
paths.forEach(item => {
|
|
3158
|
-
absolutePathsToHide.push({ path: `${location}/${item.path}` });
|
|
3158
|
+
absolutePathsToHide.push({ path: location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}` });
|
|
3159
3159
|
});
|
|
3160
3160
|
});
|
|
3161
3161
|
return absolutePathsToHide;
|
|
@@ -3533,7 +3533,7 @@ const ModelComponent = ({ data: unresolvedData, className, nodeTitle, layoutOpti
|
|
|
3533
3533
|
disablePropsConfig.forEach((configEntry) => {
|
|
3534
3534
|
const { location, paths } = configEntry;
|
|
3535
3535
|
paths.forEach((item) => {
|
|
3536
|
-
const fullPath = `${location}/${item.path}`;
|
|
3536
|
+
const fullPath = location === '#' ? item === null || item === void 0 ? void 0 : item.path : `${location}/${item.path}`;
|
|
3537
3537
|
absolutePathsToHide.push({ path: fullPath });
|
|
3538
3538
|
});
|
|
3539
3539
|
});
|
|
@@ -3569,22 +3569,20 @@ const Model = withErrorBoundary(ModelComponent, { recoverableProps: ['data'] });
|
|
|
3569
3569
|
|
|
3570
3570
|
const Docs = React.memo((_a) => {
|
|
3571
3571
|
var _b;
|
|
3572
|
-
var { nodeType, nodeData, useNodeForRefResolving = false, refResolver, maxRefDepth, nodeHasChanged, renderExtensionAddon } = _a, commonProps = __rest(_a, ["nodeType", "nodeData", "useNodeForRefResolving", "refResolver", "maxRefDepth", "nodeHasChanged", "renderExtensionAddon"]);
|
|
3572
|
+
var { nodeType, nodeData, disableProps, useNodeForRefResolving = false, refResolver, maxRefDepth, nodeHasChanged, renderExtensionAddon } = _a, commonProps = __rest(_a, ["nodeType", "nodeData", "disableProps", "useNodeForRefResolving", "refResolver", "maxRefDepth", "nodeHasChanged", "renderExtensionAddon"]);
|
|
3573
3573
|
const parsedNode = useParsedData(nodeType, nodeData);
|
|
3574
3574
|
if (!parsedNode) {
|
|
3575
3575
|
(_b = commonProps.nodeUnsupported) === null || _b === void 0 ? void 0 : _b.call(commonProps, 'dataEmpty');
|
|
3576
3576
|
return null;
|
|
3577
3577
|
}
|
|
3578
|
-
let elem = React.createElement(ParsedDocs, Object.assign({ node: parsedNode }, commonProps));
|
|
3578
|
+
let elem = React.createElement(ParsedDocs, Object.assign({ node: parsedNode, disableProps: disableProps }, commonProps));
|
|
3579
3579
|
if (useNodeForRefResolving) {
|
|
3580
3580
|
elem = (React.createElement(InlineRefResolverProvider, { document: parsedNode.data, resolver: refResolver, maxRefDepth: maxRefDepth }, elem));
|
|
3581
3581
|
}
|
|
3582
3582
|
return (React.createElement(ElementsOptionsProvider, { nodeHasChanged: nodeHasChanged, renderExtensionAddon: renderExtensionAddon }, elem));
|
|
3583
3583
|
});
|
|
3584
3584
|
const ParsedDocs = (_a) => {
|
|
3585
|
-
var
|
|
3586
|
-
var { node, nodeUnsupported } = _a, commonProps = __rest(_a, ["node", "nodeUnsupported"]);
|
|
3587
|
-
const disableProps = (_b = node.data) === null || _b === void 0 ? void 0 : _b.disableProps;
|
|
3585
|
+
var { node, nodeUnsupported, disableProps } = _a, commonProps = __rest(_a, ["node", "nodeUnsupported", "disableProps"]);
|
|
3588
3586
|
switch (node.type) {
|
|
3589
3587
|
case 'article':
|
|
3590
3588
|
return React.createElement(Article, Object.assign({ data: node.data }, commonProps));
|