@redocly/theme 0.59.0-next.1 → 0.59.0-next.3
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/LICENSE +7 -1
- package/lib/components/Accordion/Accordion.js +17 -7
- package/lib/components/Accordion/AccordionBody.js +17 -7
- package/lib/components/Admonition/Admonition.js +17 -7
- package/lib/components/Badge/Badge.js +17 -7
- package/lib/components/Breadcrumbs/Breadcrumb.js +17 -7
- package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +17 -7
- package/lib/components/Button/Button.js +17 -7
- package/lib/components/Buttons/AIAssistantButton.js +17 -7
- package/lib/components/Buttons/CopyButton.js +17 -7
- package/lib/components/Catalog/Catalog.d.ts +6 -0
- package/lib/components/Catalog/Catalog.js +7 -6
- package/lib/components/Catalog/CatalogEntities.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +17 -7
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +17 -7
- package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.js +17 -7
- package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.js +17 -7
- package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +17 -7
- package/lib/components/Catalog/CatalogSortButton.js +17 -7
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +17 -7
- package/lib/components/Catalog/CatalogViewModeToggle.js +17 -7
- package/lib/components/CatalogClassic/CatalogClassicActions.js +17 -7
- package/lib/components/CatalogClassic/CatalogClassicCard.js +17 -7
- package/lib/components/CatalogClassic/CatalogClassicHighlight.js +17 -7
- package/lib/components/CatalogClassic/CatalogClassicVirtualizedGroups.js +17 -7
- package/lib/components/CodeBlock/CodeBlock.js +17 -7
- package/lib/components/CodeBlock/CodeBlockContainer.js +17 -7
- package/lib/components/CodeBlock/CodeBlockTabs.js +17 -7
- package/lib/components/Dropdown/Dropdown.d.ts +16 -2
- package/lib/components/Dropdown/Dropdown.js +22 -12
- package/lib/components/Dropdown/DropdownMenuItem.js +17 -7
- package/lib/components/Feedback/Comment.js +17 -7
- package/lib/components/Feedback/Feedback.js +17 -7
- package/lib/components/Feedback/Mood.js +17 -7
- package/lib/components/Feedback/Rating.js +17 -7
- package/lib/components/Feedback/Reasons.js +17 -7
- package/lib/components/Feedback/Scale.js +17 -7
- package/lib/components/Feedback/Sentiment.js +17 -7
- package/lib/components/Feedback/Stars.js +17 -7
- package/lib/components/Filter/FilterContent.js +17 -7
- package/lib/components/Filter/FilterInput.js +17 -7
- package/lib/components/Image/Image.js +17 -7
- package/lib/components/JsonViewer/JsonViewer.js +17 -7
- package/lib/components/JsonViewer/helpers.js +17 -7
- package/lib/components/LastUpdated/LastUpdated.js +17 -7
- package/lib/components/Link/Link.js +17 -7
- package/lib/components/Markdown/Markdown.js +17 -7
- package/lib/components/Marker/Marker.js +17 -7
- package/lib/components/Menu/MenuContainer.js +17 -7
- package/lib/components/Menu/MenuItem.js +18 -8
- package/lib/components/Menu/MenuMobile.js +17 -7
- package/lib/components/Navbar/NavbarItem.js +3 -3
- package/lib/components/PageActions/PageActions.js +17 -7
- package/lib/components/PageNavigation/NextButton.js +17 -7
- package/lib/components/Panel/Panel.js +17 -7
- package/lib/components/Panel/PanelBody.js +17 -7
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +17 -7
- package/lib/components/Search/FilterFields/SearchFilterFieldTags.js +1 -2
- package/lib/components/Search/SearchAiConversationInput.d.ts +2 -1
- package/lib/components/Search/SearchAiConversationInput.js +28 -10
- package/lib/components/Search/SearchAiDialog.js +17 -7
- package/lib/components/Search/SearchDialog.js +23 -10
- package/lib/components/Search/SearchFilter.js +17 -7
- package/lib/components/Search/SearchGroups.js +19 -9
- package/lib/components/Search/SearchHighlight.js +17 -7
- package/lib/components/Search/SearchItem.js +17 -7
- package/lib/components/Search/SearchRecent.js +17 -7
- package/lib/components/Search/SearchShortcut.js +17 -7
- package/lib/components/Search/SearchSuggestedPages.js +17 -7
- package/lib/components/Search/SearchTrigger.js +17 -7
- package/lib/components/Search/variables.js +5 -1
- package/lib/components/Segmented/Segmented.js +17 -7
- package/lib/components/Select/Select.js +17 -7
- package/lib/components/Select/SelectInput.js +18 -8
- package/lib/components/Sidebar/Sidebar.js +17 -7
- package/lib/components/SidebarActions/styled.js +17 -7
- package/lib/components/SkipContent/SkipContent.js +17 -7
- package/lib/components/Switch/Switch.js +17 -7
- package/lib/components/TableOfContent/TableOfContent.js +17 -7
- package/lib/components/Tag/Tag.d.ts +2 -1
- package/lib/components/Tag/Tag.js +67 -18
- package/lib/components/Tag/variables.dark.js +135 -36
- package/lib/components/Tag/variables.js +78 -61
- package/lib/components/Tooltip/Tooltip.js +17 -7
- package/lib/components/VersionPicker/VersionPicker.js +17 -7
- package/lib/core/constants/search.d.ts +5 -4
- package/lib/core/constants/search.js +4 -5
- package/lib/core/contexts/CodeSnippetContext.js +17 -7
- package/lib/core/hooks/use-tabs.d.ts +3 -2
- package/lib/core/hooks/use-tabs.js +115 -57
- package/lib/core/templates/Markdown.js +17 -7
- package/lib/core/types/hooks.d.ts +6 -3
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/utils/download-code-walkthrough.js +17 -7
- package/lib/core/utils/get-file-icon.js +17 -7
- package/lib/icons/AiStarsIcon/AiStarsIcon.js +11 -2
- package/lib/icons/GenericIcon/GenericIcon.js +17 -7
- package/lib/icons/RedoclyIcon/RedoclyIcon.js +4 -7
- package/lib/icons/Spinner/Spinner.js +17 -7
- package/lib/index.js +17 -7
- package/lib/layouts/OIDCForbidden.js +17 -7
- package/lib/layouts/ThreePanelLayout.js +17 -7
- package/lib/markdoc/components/Cards/Cards.js +17 -7
- package/lib/markdoc/components/CodeGroup/CodeGroup.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodeContainer.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodeToggle.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/Input.js +17 -7
- package/lib/markdoc/components/Heading/Heading.js +17 -7
- package/lib/markdoc/components/HtmlBlock/HtmlBlock.js +17 -7
- package/lib/markdoc/components/InlineSvg/InlineSvg.js +17 -7
- package/lib/markdoc/components/MarkdocExample/MarkdocExample.js +17 -7
- package/lib/markdoc/components/Tabs/TabList.d.ts +3 -1
- package/lib/markdoc/components/Tabs/TabList.js +214 -54
- package/lib/markdoc/components/Tabs/Tabs.d.ts +2 -1
- package/lib/markdoc/components/Tabs/Tabs.js +74 -19
- package/lib/markdoc/default.d.ts +104 -1
- package/lib/markdoc/default.js +17 -7
- package/package.json +6 -6
- package/src/components/Catalog/Catalog.tsx +15 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +1 -1
- package/src/components/Dropdown/Dropdown.tsx +84 -79
- package/src/components/Menu/MenuItem.tsx +1 -0
- package/src/components/Navbar/NavbarItem.tsx +6 -5
- package/src/components/Search/FilterFields/SearchFilterFieldTags.tsx +3 -3
- package/src/components/Search/SearchAiConversationInput.tsx +12 -2
- package/src/components/Search/SearchDialog.tsx +6 -3
- package/src/components/Search/SearchGroups.tsx +2 -0
- package/src/components/Search/variables.ts +5 -1
- package/src/components/Select/SelectInput.tsx +1 -0
- package/src/components/Tag/Tag.tsx +36 -20
- package/src/components/Tag/variables.dark.ts +135 -36
- package/src/components/Tag/variables.ts +78 -61
- package/src/core/constants/search.ts +8 -4
- package/src/core/hooks/use-tabs.ts +168 -86
- package/src/core/types/hooks.ts +6 -1
- package/src/core/types/l10n.ts +1 -0
- package/src/icons/AiStarsIcon/AiStarsIcon.tsx +11 -2
- package/src/icons/RedoclyIcon/RedoclyIcon.tsx +4 -22
- package/src/markdoc/components/Tabs/TabList.tsx +312 -105
- package/src/markdoc/components/Tabs/Tabs.tsx +136 -11
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.TabButtonLink = exports.TabItem = exports.TabListContainer = void 0;
|
|
27
37
|
exports.TabList = TabList;
|
|
@@ -34,47 +44,144 @@ const DropdownMenuItem_1 = require("../../../components/Dropdown/DropdownMenuIte
|
|
|
34
44
|
const Button_1 = require("../../../components/Button/Button");
|
|
35
45
|
const hooks_1 = require("../../../core/hooks");
|
|
36
46
|
const utils_1 = require("../../../core/utils");
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Calculates optimal dropdown position relative to viewport to ensure visibility.
|
|
49
|
+
* Positions below the button by default, but moves above if insufficient space.
|
|
50
|
+
* Adjusts horizontal position to prevent overflow off screen edges.
|
|
51
|
+
*/
|
|
52
|
+
const calculateDropdownPosition = (buttonRect, dropdownRect) => {
|
|
53
|
+
const gap = 4;
|
|
54
|
+
const margin = 16;
|
|
55
|
+
const spaceBelow = window.innerHeight - buttonRect.bottom;
|
|
56
|
+
const spaceAbove = buttonRect.top;
|
|
57
|
+
// Position below button, or above if dropdown doesn't fit below
|
|
58
|
+
const top = spaceBelow < dropdownRect.height + gap && spaceAbove > spaceBelow
|
|
59
|
+
? buttonRect.top - gap
|
|
60
|
+
: buttonRect.bottom + gap;
|
|
61
|
+
// Align with button left edge, adjust if overflows screen
|
|
62
|
+
const idealLeft = buttonRect.left;
|
|
63
|
+
const rightEdge = idealLeft + dropdownRect.width;
|
|
64
|
+
const overflowsRight = rightEdge > window.innerWidth - margin;
|
|
65
|
+
const left = overflowsRight
|
|
66
|
+
? window.innerWidth - dropdownRect.width - margin
|
|
67
|
+
: Math.max(margin, idealLeft);
|
|
68
|
+
return { top, left };
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Manages dropdown positioning and updates on scroll/resize events for TabList.
|
|
72
|
+
*/
|
|
73
|
+
const useDropdownPosition = (hasOverflow, dropdownRef) => {
|
|
74
|
+
const [dropdownPosition, setDropdownPosition] = (0, react_1.useState)({});
|
|
75
|
+
const [isDropdownOpen, setIsDropdownOpen] = (0, react_1.useState)(false);
|
|
76
|
+
const updateDropdownPosition = (0, react_1.useCallback)(() => {
|
|
77
|
+
if (!dropdownRef.current)
|
|
78
|
+
return;
|
|
79
|
+
const button = dropdownRef.current.querySelector('button');
|
|
80
|
+
const dropdownMenu = dropdownRef.current.querySelector('div:last-child');
|
|
81
|
+
if (!button || !dropdownMenu)
|
|
82
|
+
return;
|
|
83
|
+
const buttonRect = button.getBoundingClientRect();
|
|
84
|
+
const dropdownRect = dropdownMenu.getBoundingClientRect();
|
|
85
|
+
const position = calculateDropdownPosition(buttonRect, dropdownRect);
|
|
86
|
+
setDropdownPosition(position);
|
|
87
|
+
}, [dropdownRef]);
|
|
88
|
+
// Track when dropdown menu appears and recalculate position
|
|
89
|
+
(0, react_1.useEffect)(() => {
|
|
90
|
+
if (!hasOverflow || !isDropdownOpen || !dropdownRef.current)
|
|
91
|
+
return;
|
|
92
|
+
const dropdownMenu = dropdownRef.current.querySelector('div:last-child');
|
|
93
|
+
if (!dropdownMenu)
|
|
94
|
+
return;
|
|
95
|
+
// ResizeObserver tracks both initial render and size changes
|
|
96
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
97
|
+
updateDropdownPosition();
|
|
98
|
+
});
|
|
99
|
+
resizeObserver.observe(dropdownMenu);
|
|
100
|
+
return () => resizeObserver.disconnect();
|
|
101
|
+
}, [hasOverflow, isDropdownOpen, dropdownRef, updateDropdownPosition]);
|
|
102
|
+
// Update position on scroll/resize
|
|
103
|
+
(0, react_1.useEffect)(() => {
|
|
104
|
+
if (!hasOverflow || !isDropdownOpen)
|
|
105
|
+
return;
|
|
106
|
+
window.addEventListener('scroll', updateDropdownPosition, true);
|
|
107
|
+
window.addEventListener('resize', updateDropdownPosition);
|
|
108
|
+
return () => {
|
|
109
|
+
window.removeEventListener('scroll', updateDropdownPosition, true);
|
|
110
|
+
window.removeEventListener('resize', updateDropdownPosition);
|
|
111
|
+
};
|
|
112
|
+
}, [hasOverflow, isDropdownOpen, updateDropdownPosition]);
|
|
113
|
+
return {
|
|
114
|
+
dropdownPosition,
|
|
115
|
+
isDropdownOpen,
|
|
116
|
+
setIsDropdownOpen,
|
|
117
|
+
setDropdownPosition,
|
|
118
|
+
updateDropdownPosition,
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
const renderTab = (child, index, size, setTabRef, handleKeyboard, onTabClick) => {
|
|
122
|
+
const { label, icon } = child.props;
|
|
123
|
+
const tabId = (0, utils_1.getTabId)(label, index);
|
|
124
|
+
return (react_1.default.createElement(Tab_1.Tab, { key: `key-${tabId}`, tabId: tabId, label: label, icon: icon, size: size, disabled: child.props.disable, setRef: (el) => setTabRef(el, index), onKeyDown: (event) => handleKeyboard(event, index), onClick: () => {
|
|
125
|
+
var _a, _b;
|
|
126
|
+
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
127
|
+
onTabClick(label);
|
|
128
|
+
} }));
|
|
129
|
+
};
|
|
130
|
+
function TabList({ childrenArray, size, activeTab, onTabChange, containerRef, onReadyChange, }) {
|
|
131
|
+
const dropdownRef = (0, react_1.useRef)(null);
|
|
132
|
+
const totalTabs = childrenArray.length;
|
|
133
|
+
const { overflowTabs, visibleTabs, handleKeyboard, onTabClick, setTabRef, isReady } = (0, hooks_1.useTabs)({
|
|
40
134
|
activeTab,
|
|
41
135
|
onTabChange,
|
|
42
|
-
containerRef
|
|
43
|
-
totalTabs
|
|
136
|
+
containerRef,
|
|
137
|
+
totalTabs,
|
|
44
138
|
});
|
|
139
|
+
(0, react_1.useEffect)(() => {
|
|
140
|
+
onReadyChange === null || onReadyChange === void 0 ? void 0 : onReadyChange(isReady);
|
|
141
|
+
}, [isReady, onReadyChange]);
|
|
45
142
|
const { highlightStyle } = useHighlightBarAnimation({
|
|
46
143
|
activeTab,
|
|
47
144
|
childrenArray,
|
|
48
145
|
overflowTabs,
|
|
49
|
-
tabsContainerRef,
|
|
146
|
+
tabsContainerRef: containerRef,
|
|
50
147
|
visibleTabs,
|
|
51
148
|
});
|
|
52
|
-
|
|
149
|
+
const hasOverflow = overflowTabs.length > 0;
|
|
150
|
+
const isMoreActive = hasOverflow &&
|
|
151
|
+
overflowTabs.some((i) => childrenArray[i] && activeTab === childrenArray[i].props.label);
|
|
152
|
+
// Show as selector when no visible tabs (all tabs in dropdown)
|
|
153
|
+
const showAsSelector = visibleTabs.length === 0 && hasOverflow;
|
|
154
|
+
const { dropdownPosition, setIsDropdownOpen, setDropdownPosition } = useDropdownPosition(hasOverflow, dropdownRef);
|
|
155
|
+
return (react_1.default.createElement(exports.TabListContainer, { role: "tablist", ref: containerRef },
|
|
53
156
|
react_1.default.createElement(HighlightBar, { size: size, style: highlightStyle },
|
|
54
157
|
react_1.default.createElement("div", null)),
|
|
55
158
|
childrenArray.map((child, index) => {
|
|
56
|
-
|
|
159
|
+
// Show all tabs before ready (for measurement), then only visible ones
|
|
160
|
+
const shouldRender = !isReady || visibleTabs.includes(index);
|
|
161
|
+
if (!shouldRender)
|
|
57
162
|
return null;
|
|
58
|
-
|
|
59
|
-
const tabId = (0, utils_1.getTabId)(label, index);
|
|
60
|
-
return (react_1.default.createElement(Tab_1.Tab, { key: `key-${tabId}`, tabId: tabId, label: label, icon: icon, size: size, disabled: child.props.disable, setRef: (el) => setTabRef(el, index), onKeyDown: (event) => handleKeyboard(event, index), onClick: () => {
|
|
61
|
-
var _a, _b;
|
|
62
|
-
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
63
|
-
onTabClick(label);
|
|
64
|
-
} }));
|
|
163
|
+
return renderTab(child, index, size, setTabRef, handleKeyboard, onTabClick);
|
|
65
164
|
}),
|
|
66
|
-
react_1.default.createElement(exports.TabItem, { size: size, active:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
165
|
+
hasOverflow && (react_1.default.createElement(exports.TabItem, { size: size, active: isMoreActive || showAsSelector, tabIndex: 0, className: "dropdown-tab" },
|
|
166
|
+
react_1.default.createElement(DropdownWrapper, { "$top": dropdownPosition.top, "$left": dropdownPosition.left, onClickCapture: () => {
|
|
167
|
+
setIsDropdownOpen(true);
|
|
168
|
+
} },
|
|
169
|
+
react_1.default.createElement(FixedPositionDropdown, { ref: dropdownRef, trigger: react_1.default.createElement(exports.TabButtonLink, { size: size, className: isMoreActive || showAsSelector ? 'active' : undefined }, showAsSelector ? react_1.default.createElement(TabButtonText, null, activeTab) : 'More'), alignment: "start", withArrow: true, onClose: () => {
|
|
170
|
+
setIsDropdownOpen(false);
|
|
171
|
+
setDropdownPosition({});
|
|
172
|
+
} },
|
|
173
|
+
react_1.default.createElement(DropdownMenu_1.DropdownMenu, null, overflowTabs.map((index) => {
|
|
174
|
+
const child = childrenArray[index];
|
|
175
|
+
if (!child)
|
|
176
|
+
return null;
|
|
177
|
+
const { label } = child.props;
|
|
178
|
+
const tabId = (0, utils_1.getTabId)(label, index);
|
|
179
|
+
return (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: `more-${tabId}`, active: activeTab === label, onAction: () => {
|
|
180
|
+
var _a, _b;
|
|
181
|
+
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
182
|
+
onTabClick(index);
|
|
183
|
+
}, disabled: child.props.disable }, label));
|
|
184
|
+
}))))))));
|
|
78
185
|
}
|
|
79
186
|
const useHighlightBarAnimation = (props) => {
|
|
80
187
|
const { childrenArray, activeTab, tabsContainerRef, visibleTabs, overflowTabs } = props;
|
|
@@ -89,18 +196,11 @@ const useHighlightBarAnimation = (props) => {
|
|
|
89
196
|
setHighlightStyle({ left: 0, width: 0 });
|
|
90
197
|
return;
|
|
91
198
|
}
|
|
92
|
-
|
|
93
|
-
if (!activeTabElement)
|
|
94
|
-
return;
|
|
199
|
+
// Remove active class from all tabs first
|
|
95
200
|
container.querySelectorAll('[data-label]').forEach((el) => {
|
|
96
201
|
el.classList.remove('active');
|
|
97
202
|
});
|
|
98
|
-
|
|
99
|
-
if (visibleTabs.includes(activeIndex)) {
|
|
100
|
-
activeTabElement.classList.add('active');
|
|
101
|
-
setHighlightStyle({ left: offsetLeft, width: offsetWidth });
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
203
|
+
// Check if active tab is in overflow first
|
|
104
204
|
if (overflowTabs.includes(activeIndex)) {
|
|
105
205
|
const moreButton = container.querySelector('button');
|
|
106
206
|
if (!moreButton)
|
|
@@ -113,6 +213,16 @@ const useHighlightBarAnimation = (props) => {
|
|
|
113
213
|
});
|
|
114
214
|
return;
|
|
115
215
|
}
|
|
216
|
+
// Active tab is visible, find its element
|
|
217
|
+
const activeTabElement = container.querySelector(`[data-label="${activeTab}"]`);
|
|
218
|
+
if (!activeTabElement)
|
|
219
|
+
return;
|
|
220
|
+
const { offsetLeft, offsetWidth } = activeTabElement;
|
|
221
|
+
if (visibleTabs.includes(activeIndex)) {
|
|
222
|
+
activeTabElement.classList.add('active');
|
|
223
|
+
setHighlightStyle({ left: offsetLeft, width: offsetWidth });
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
116
226
|
}, [activeTab, childrenArray, visibleTabs, overflowTabs, tabsContainerRef]);
|
|
117
227
|
return { highlightStyle };
|
|
118
228
|
};
|
|
@@ -122,15 +232,11 @@ exports.TabListContainer = styled_components_1.default.ul `
|
|
|
122
232
|
gap: var(--md-tabs-gap);
|
|
123
233
|
width: 100%;
|
|
124
234
|
min-width: 0;
|
|
125
|
-
position: relative;
|
|
126
235
|
|
|
127
236
|
&::before {
|
|
128
237
|
content: '';
|
|
129
238
|
position: absolute;
|
|
130
|
-
|
|
131
|
-
left: 0px;
|
|
132
|
-
right: 0px;
|
|
133
|
-
bottom: 0px;
|
|
239
|
+
inset: 0;
|
|
134
240
|
border: var(--md-tabs-border);
|
|
135
241
|
border-width: var(--md-tabs-border-width);
|
|
136
242
|
pointer-events: none;
|
|
@@ -138,11 +244,17 @@ exports.TabListContainer = styled_components_1.default.ul `
|
|
|
138
244
|
|
|
139
245
|
&& {
|
|
140
246
|
padding: var(--md-tabs-padding);
|
|
141
|
-
margin-block-end: 0;
|
|
142
247
|
margin: 0;
|
|
143
248
|
|
|
144
249
|
& > li {
|
|
145
|
-
margin-bottom:
|
|
250
|
+
margin-bottom: 0;
|
|
251
|
+
flex-shrink: 0;
|
|
252
|
+
|
|
253
|
+
&.dropdown-tab {
|
|
254
|
+
flex-shrink: 1;
|
|
255
|
+
min-width: 0;
|
|
256
|
+
max-width: 100%;
|
|
257
|
+
}
|
|
146
258
|
}
|
|
147
259
|
}
|
|
148
260
|
`;
|
|
@@ -152,7 +264,7 @@ exports.TabItem = styled_components_1.default.li `
|
|
|
152
264
|
cursor: pointer;
|
|
153
265
|
align-items: center;
|
|
154
266
|
padding: var(--md-tabs-tab-wrapper-padding);
|
|
155
|
-
z-index:
|
|
267
|
+
z-index: var(--z-index-surface);
|
|
156
268
|
|
|
157
269
|
${({ active, size }) => active
|
|
158
270
|
? (0, styled_components_1.css) `
|
|
@@ -189,6 +301,46 @@ exports.TabItem = styled_components_1.default.li `
|
|
|
189
301
|
}
|
|
190
302
|
}
|
|
191
303
|
`;
|
|
304
|
+
const DropdownWrapper = styled_components_1.default.div.attrs((props) => ({
|
|
305
|
+
style: Object.assign(Object.assign({}, (props.$top !== undefined && { '--dropdown-top': `${props.$top}px` })), (props.$left !== undefined && { '--dropdown-left': `${props.$left}px` })),
|
|
306
|
+
})) `
|
|
307
|
+
position: static;
|
|
308
|
+
z-index: var(--z-index-raised);
|
|
309
|
+
width: 100%;
|
|
310
|
+
min-width: 0;
|
|
311
|
+
`;
|
|
312
|
+
const FixedPositionDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown) `
|
|
313
|
+
position: static;
|
|
314
|
+
width: 100%;
|
|
315
|
+
min-width: 0;
|
|
316
|
+
|
|
317
|
+
> div:first-child {
|
|
318
|
+
width: 100%;
|
|
319
|
+
min-width: 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
> div:last-child {
|
|
323
|
+
position: fixed;
|
|
324
|
+
top: var(--dropdown-top, 0);
|
|
325
|
+
left: var(--dropdown-left, 0);
|
|
326
|
+
right: auto;
|
|
327
|
+
bottom: auto;
|
|
328
|
+
transform: none;
|
|
329
|
+
padding-top: 0;
|
|
330
|
+
max-width: min(400px, calc(100vw - 32px));
|
|
331
|
+
max-height: calc(100vh - var(--dropdown-top, 0) - 32px);
|
|
332
|
+
overflow-y: auto;
|
|
333
|
+
z-index: var(--z-index-raised);
|
|
334
|
+
|
|
335
|
+
ul {
|
|
336
|
+
li {
|
|
337
|
+
overflow: hidden;
|
|
338
|
+
text-overflow: ellipsis;
|
|
339
|
+
white-space: nowrap;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
`;
|
|
192
344
|
const HighlightBar = styled_components_1.default.div `
|
|
193
345
|
position: absolute;
|
|
194
346
|
top: 0;
|
|
@@ -208,11 +360,19 @@ const HighlightBar = styled_components_1.default.div `
|
|
|
208
360
|
border-radius: var(--md-tabs-${({ size }) => size}-active-tab-border-radius);
|
|
209
361
|
}
|
|
210
362
|
`;
|
|
363
|
+
const TabButtonText = styled_components_1.default.span `
|
|
364
|
+
overflow: hidden;
|
|
365
|
+
text-overflow: ellipsis;
|
|
366
|
+
white-space: nowrap;
|
|
367
|
+
flex: 1;
|
|
368
|
+
min-width: 0;
|
|
369
|
+
`;
|
|
211
370
|
exports.TabButtonLink = (0, styled_components_1.default)(Button_1.Button) `
|
|
212
371
|
color: var(--md-tabs-tab-text-color);
|
|
213
372
|
font-family: var(--md-tabs-tab-font-family);
|
|
214
373
|
font-style: var(--md-tabs-tab-font-style);
|
|
215
374
|
background-color: var(--md-tabs-tab-bg-color);
|
|
375
|
+
width: 100%;
|
|
216
376
|
|
|
217
377
|
transition:
|
|
218
378
|
background-color 300ms ease-in-out,
|
|
@@ -231,9 +391,9 @@ exports.TabButtonLink = (0, styled_components_1.default)(Button_1.Button) `
|
|
|
231
391
|
|
|
232
392
|
&.active {
|
|
233
393
|
color: var(--md-tabs-active-tab-text-color);
|
|
234
|
-
font-size: var(--md-tabs-${({ size }) => size}-active-tab-font-size);
|
|
235
394
|
font-family: var(--md-tabs-active-tab-font-family);
|
|
236
395
|
font-style: var(--md-tabs-active-tab-font-style);
|
|
396
|
+
font-size: var(--md-tabs-${({ size }) => size}-active-tab-font-size);
|
|
237
397
|
font-weight: var(--md-tabs-${({ size }) => size}-active-tab-font-weight);
|
|
238
398
|
line-height: var(--md-tabs-${({ size }) => size}-active-tab-line-height);
|
|
239
399
|
background-color: var(--md-tabs-active-tab-bg-color);
|
|
@@ -243,12 +403,12 @@ exports.TabButtonLink = (0, styled_components_1.default)(Button_1.Button) `
|
|
|
243
403
|
|
|
244
404
|
&:hover {
|
|
245
405
|
color: var(--md-tabs-hover-tab-text-color);
|
|
246
|
-
font-size: var(--md-tabs-${({ size }) => size}-hover-tab-font-size);
|
|
247
406
|
font-family: var(--md-tabs-hover-tab-font-family);
|
|
248
407
|
font-style: var(--md-tabs-hover-tab-font-style);
|
|
408
|
+
font-size: var(--md-tabs-${({ size }) => size}-hover-tab-font-size);
|
|
249
409
|
font-weight: var(--md-tabs-${({ size }) => size}-hover-tab-font-weight);
|
|
250
|
-
background-color: var(--md-tabs-hover-tab-bg-color);
|
|
251
410
|
line-height: var(--md-tabs-${({ size }) => size}-hover-tab-line-height);
|
|
411
|
+
background-color: var(--md-tabs-hover-tab-bg-color);
|
|
252
412
|
border-radius: var(--md-tabs-${({ size }) => size}-hover-tab-border-radius);
|
|
253
413
|
padding: var(--md-tabs-${({ size }) => size}-hover-tab-padding);
|
|
254
414
|
}
|
|
@@ -17,7 +17,8 @@ type TabsProps = {
|
|
|
17
17
|
className?: string;
|
|
18
18
|
size: TabsSize;
|
|
19
19
|
initialTab?: string;
|
|
20
|
+
forceReady?: boolean;
|
|
20
21
|
};
|
|
21
|
-
export declare function Tabs({ id, children, className, size, initialTab: propInitialTab, }: TabsProps): JSX.Element;
|
|
22
|
+
export declare function Tabs({ id, children, className, size, initialTab: propInitialTab, forceReady, }: TabsProps): JSX.Element;
|
|
22
23
|
export declare const TabContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
24
|
export {};
|
|
@@ -15,21 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
28
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
36
|
exports.TabContent = exports.TabsSize = void 0;
|
|
30
37
|
exports.Tabs = Tabs;
|
|
31
38
|
const react_1 = __importStar(require("react"));
|
|
32
|
-
const
|
|
39
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
40
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
|
33
41
|
const hooks_1 = require("../../../core/hooks");
|
|
34
42
|
const TabList_1 = require("../../../markdoc/components/Tabs/TabList");
|
|
35
43
|
const utils_1 = require("../../../core/utils");
|
|
@@ -38,22 +46,62 @@ var TabsSize;
|
|
|
38
46
|
TabsSize["SMALL"] = "small";
|
|
39
47
|
TabsSize["MEDIUM"] = "medium";
|
|
40
48
|
})(TabsSize || (exports.TabsSize = TabsSize = {}));
|
|
41
|
-
function Tabs({ id, children, className, size, initialTab: propInitialTab, }) {
|
|
49
|
+
function Tabs({ id, children, className, size, initialTab: propInitialTab, forceReady = false, }) {
|
|
42
50
|
var _a, _b;
|
|
43
|
-
const
|
|
51
|
+
const childrenArray = react_1.default.Children.toArray(children);
|
|
52
|
+
const [isReady, setIsReady] = (0, react_1.useState)(false);
|
|
53
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
44
54
|
const initialTab = (_b = propInitialTab !== null && propInitialTab !== void 0 ? propInitialTab : (_a = childrenArray[0]) === null || _a === void 0 ? void 0 : _a.props.label) !== null && _b !== void 0 ? _b : '';
|
|
45
|
-
const
|
|
46
|
-
(0, react_1.
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
const labelsHash = childrenArray.map((c) => c.props.label).join('|');
|
|
56
|
+
const handleReadyChange = (0, react_1.useCallback)((ready) => {
|
|
57
|
+
setIsReady(ready);
|
|
58
|
+
}, []);
|
|
59
|
+
// Reset isReady when children change (new page/tabs)
|
|
60
|
+
// Use useLayoutEffect to run synchronously before paint
|
|
61
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
62
|
+
setIsReady(false);
|
|
63
|
+
}, [labelsHash]);
|
|
64
|
+
const inRouter = (0, react_router_dom_1.useInRouterContext)();
|
|
65
|
+
return (react_1.default.createElement(TabsView, { id: id, className: className, size: size, childrenArray: childrenArray, initialTab: initialTab, useActiveTab: inRouter ? useActiveTabWithRouter : useActiveTabWithoutRouter, isReady: isReady || forceReady, labelsHash: labelsHash, containerRef: containerRef, onReadyChange: handleReadyChange }));
|
|
66
|
+
}
|
|
67
|
+
function TabsView({ id, className, size, childrenArray, useActiveTab, initialTab, isReady, labelsHash, containerRef, onReadyChange, }) {
|
|
68
|
+
const { activeTab, setActiveTab } = useActiveTab(initialTab, id, childrenArray);
|
|
69
|
+
return (react_1.default.createElement(TabsContainer, { "data-component-name": "Markdoc/Tabs/Tabs", className: className, key: id, "$isReady": isReady },
|
|
70
|
+
react_1.default.createElement(TabList_1.TabList, { key: labelsHash, size: size, childrenArray: childrenArray, activeTab: activeTab, onTabChange: setActiveTab, containerRef: containerRef, onReadyChange: onReadyChange }),
|
|
51
71
|
childrenArray.map((child, index) => {
|
|
52
72
|
const { label } = child.props;
|
|
53
73
|
const tabId = (0, utils_1.getTabId)(label, index);
|
|
54
74
|
return label === activeTab ? (react_1.default.createElement(exports.TabContent, { key: `content-${tabId}`, id: `panel-${tabId}`, "aria-labelledby": `tab-${tabId}`, tabIndex: 0, role: "tabpanel" }, child.props.children)) : null;
|
|
55
75
|
})));
|
|
56
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Validates that the active tab exists in children and resets to initial tab if not found.
|
|
79
|
+
* Ensures tab state remains consistent when tab structure changes.
|
|
80
|
+
*/
|
|
81
|
+
function useValidateActiveTab(activeTab, setActiveTab, childrenArray, initialTab) {
|
|
82
|
+
(0, react_1.useEffect)(() => {
|
|
83
|
+
const availableLabels = childrenArray.map((child) => child.props.label);
|
|
84
|
+
if (activeTab && !availableLabels.includes(activeTab) && availableLabels.length > 0) {
|
|
85
|
+
setActiveTab(initialTab);
|
|
86
|
+
}
|
|
87
|
+
}, [childrenArray, activeTab, initialTab, setActiveTab]);
|
|
88
|
+
}
|
|
89
|
+
const useActiveTabWithRouter = (initialTab, tabsId, childrenArray) => {
|
|
90
|
+
const { activeTab, setActiveTab } = (0, hooks_1.useActiveTab)({ initialTab, tabsId });
|
|
91
|
+
useValidateActiveTab(activeTab, setActiveTab, childrenArray, initialTab);
|
|
92
|
+
return {
|
|
93
|
+
activeTab,
|
|
94
|
+
setActiveTab,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
const useActiveTabWithoutRouter = (initialTab, _tabsId, childrenArray) => {
|
|
98
|
+
const [activeTab, setActiveTab] = (0, react_1.useState)(initialTab);
|
|
99
|
+
useValidateActiveTab(activeTab, setActiveTab, childrenArray, initialTab);
|
|
100
|
+
return {
|
|
101
|
+
activeTab,
|
|
102
|
+
setActiveTab,
|
|
103
|
+
};
|
|
104
|
+
};
|
|
57
105
|
const TabsContainer = styled_components_1.default.div `
|
|
58
106
|
position: relative;
|
|
59
107
|
color: var(--md-tabs-container-text-color);
|
|
@@ -70,6 +118,13 @@ const TabsContainer = styled_components_1.default.div `
|
|
|
70
118
|
margin: 0;
|
|
71
119
|
padding: 0;
|
|
72
120
|
}
|
|
121
|
+
|
|
122
|
+
${({ $isReady }) => !$isReady &&
|
|
123
|
+
(0, styled_components_1.css) `
|
|
124
|
+
opacity: 0;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
`}
|
|
73
128
|
`;
|
|
74
129
|
exports.TabContent = styled_components_1.default.div `
|
|
75
130
|
color: var(--md-tabs-content-text-color);
|
package/lib/markdoc/default.d.ts
CHANGED
|
@@ -4,8 +4,111 @@ export * from '../markdoc/attributes/img-srcset';
|
|
|
4
4
|
export * from '../markdoc/attributes/relative-path';
|
|
5
5
|
export * from '../markdoc/attributes/svg-content';
|
|
6
6
|
export * as components from '../markdoc/components/default';
|
|
7
|
+
import { admonition } from '../markdoc/tags/admonition';
|
|
8
|
+
import { html } from '../markdoc/tags/html';
|
|
9
|
+
import { markdocExample } from '../markdoc/tags/markdoc-example';
|
|
10
|
+
import { partial } from '../markdoc/tags/partial';
|
|
11
|
+
import { tab } from '../markdoc/tags/tab';
|
|
12
|
+
import { tabs } from '../markdoc/tags/tabs';
|
|
13
|
+
import { debug } from '../markdoc/tags/debug';
|
|
14
|
+
import { codeSnippet } from '../markdoc/tags/code-snippet';
|
|
15
|
+
import { inlineSvg } from '../markdoc/tags/inline-svg';
|
|
16
|
+
import { cards } from '../markdoc/tags/cards';
|
|
17
|
+
import { card } from '../markdoc/tags/card';
|
|
18
|
+
import { img } from '../markdoc/tags/img';
|
|
19
|
+
import { codeWalkthrough } from '../markdoc/tags/code-walkthrough';
|
|
20
|
+
import { codeStep } from '../markdoc/tags/code-step';
|
|
21
|
+
import { input } from '../markdoc/tags/input';
|
|
22
|
+
import { toggle } from '../markdoc/tags/code-toggle';
|
|
23
|
+
import { codeGroup } from '../markdoc/tags/code-group';
|
|
24
|
+
import { icon } from '../markdoc/tags/icon';
|
|
7
25
|
export declare const tags: {
|
|
8
|
-
[
|
|
26
|
+
[admonition.tagName]: import("@markdoc/markdoc").Schema & {
|
|
27
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
28
|
+
resolver?: string;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
[debug.tagName]: import("@markdoc/markdoc").Schema & {
|
|
32
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
33
|
+
resolver?: string;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
[html.tagName]: import("@markdoc/markdoc").Schema & {
|
|
37
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
38
|
+
resolver?: string;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
[markdocExample.tagName]: import("@markdoc/markdoc").Schema & {
|
|
42
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
43
|
+
resolver?: string;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
46
|
+
[partial.tagName]: import("@markdoc/markdoc").Schema & {
|
|
47
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
48
|
+
resolver?: string;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
[tab.tagName]: import("@markdoc/markdoc").Schema & {
|
|
52
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
53
|
+
resolver?: string;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
[tabs.tagName]: import("@markdoc/markdoc").Schema & {
|
|
57
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
58
|
+
resolver?: string;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
61
|
+
[codeSnippet.tagName]: import("@markdoc/markdoc").Schema & {
|
|
62
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
63
|
+
resolver?: string;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
[inlineSvg.tagName]: import("@markdoc/markdoc").Schema & {
|
|
67
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
68
|
+
resolver?: string;
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
[cards.tagName]: import("@markdoc/markdoc").Schema & {
|
|
72
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
73
|
+
resolver?: string;
|
|
74
|
+
}>;
|
|
75
|
+
};
|
|
76
|
+
[card.tagName]: import("@markdoc/markdoc").Schema & {
|
|
77
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
78
|
+
resolver?: string;
|
|
79
|
+
}>;
|
|
80
|
+
};
|
|
81
|
+
[img.tagName]: import("@markdoc/markdoc").Schema & {
|
|
82
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
83
|
+
resolver?: string;
|
|
84
|
+
}>;
|
|
85
|
+
};
|
|
86
|
+
[codeWalkthrough.tagName]: import("@markdoc/markdoc").Schema & {
|
|
87
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
88
|
+
resolver?: string;
|
|
89
|
+
}>;
|
|
90
|
+
};
|
|
91
|
+
[codeStep.tagName]: import("@markdoc/markdoc").Schema & {
|
|
92
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
93
|
+
resolver?: string;
|
|
94
|
+
}>;
|
|
95
|
+
};
|
|
96
|
+
[toggle.tagName]: import("@markdoc/markdoc").Schema & {
|
|
97
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
98
|
+
resolver?: string;
|
|
99
|
+
}>;
|
|
100
|
+
};
|
|
101
|
+
[input.tagName]: import("@markdoc/markdoc").Schema & {
|
|
102
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
103
|
+
resolver?: string;
|
|
104
|
+
}>;
|
|
105
|
+
};
|
|
106
|
+
[codeGroup.tagName]: import("@markdoc/markdoc").Schema & {
|
|
107
|
+
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
108
|
+
resolver?: string;
|
|
109
|
+
}>;
|
|
110
|
+
};
|
|
111
|
+
[icon.tagName]: import("@markdoc/markdoc").Schema & {
|
|
9
112
|
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
10
113
|
resolver?: string;
|
|
11
114
|
}>;
|
package/lib/markdoc/default.js
CHANGED
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
20
|
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.tags = exports.components = void 0;
|
|
30
40
|
/* Attributes */
|