@redocly/theme 0.64.0-next.1 → 0.64.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.
Files changed (223) hide show
  1. package/lib/components/Admonition/Admonition.d.ts +1 -1
  2. package/lib/components/Admonition/Admonition.js +2 -0
  3. package/lib/components/Admonition/variables.dark.js +3 -0
  4. package/lib/components/Admonition/variables.js +13 -0
  5. package/lib/components/Banner/Banner.js +3 -3
  6. package/lib/components/Button/variables.dark.js +2 -2
  7. package/lib/components/Button/variables.js +3 -3
  8. package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -3
  9. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -6
  10. package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
  11. package/lib/components/Catalog/CatalogEntities.js +1 -1
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -8
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +3 -1
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -0
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -1
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +2 -6
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +5 -5
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +15 -7
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +3 -3
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -1
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -3
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +14 -2
  27. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +1 -1
  28. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
  29. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
  30. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
  31. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +3 -3
  32. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +13 -3
  33. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +4 -3
  34. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +3 -2
  35. package/lib/components/Catalog/CatalogEntityTypeIcon.js +9 -9
  36. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -3
  37. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -3
  38. package/lib/components/Catalog/CatalogPageDescription.js +1 -1
  39. package/lib/components/Catalog/CatalogSortButton.d.ts +4 -5
  40. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +6 -2
  41. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -2
  42. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.d.ts +5 -0
  43. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.js +45 -0
  44. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +5 -3
  45. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +2 -3
  46. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +3 -2
  47. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
  48. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +15 -5
  49. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +3 -2
  50. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -2
  51. package/lib/components/Catalog/CatalogTags.d.ts +11 -0
  52. package/lib/components/Catalog/CatalogTags.js +62 -0
  53. package/lib/components/Catalog/variables.js +22 -14
  54. package/lib/components/Filter/variables.js +1 -1
  55. package/lib/components/Link/Link.js +2 -2
  56. package/lib/components/Menu/MenuItem.js +1 -0
  57. package/lib/components/Menu/variables.dark.js +2 -0
  58. package/lib/components/Menu/variables.js +4 -3
  59. package/lib/components/Search/SearchDialog.js +118 -116
  60. package/lib/components/SvgViewer/variables.dark.js +1 -1
  61. package/lib/components/Switch/variables.dark.js +2 -2
  62. package/lib/components/Switch/variables.js +1 -1
  63. package/lib/components/TableOfContent/TableOfContent.js +1 -0
  64. package/lib/components/TableOfContent/variables.js +3 -2
  65. package/lib/components/Toast/Toast.d.ts +14 -0
  66. package/lib/components/Toast/Toast.js +239 -0
  67. package/lib/components/Toast/variables.d.ts +1 -0
  68. package/lib/components/Toast/variables.js +64 -0
  69. package/lib/components/Tooltip/JsTooltip.js +1 -1
  70. package/lib/core/constants/catalog.d.ts +1 -1
  71. package/lib/core/constants/catalog.js +1 -1
  72. package/lib/core/constants/toast.d.ts +1 -0
  73. package/lib/core/constants/toast.js +5 -0
  74. package/lib/core/contexts/Toast/ToastContext.d.ts +2 -0
  75. package/lib/core/contexts/Toast/ToastContext.js +6 -0
  76. package/lib/core/contexts/Toast/ToastProvider.d.ts +3 -0
  77. package/lib/core/contexts/Toast/ToastProvider.js +156 -0
  78. package/lib/core/contexts/index.d.ts +2 -0
  79. package/lib/core/contexts/index.js +2 -0
  80. package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
  81. package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
  82. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
  83. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
  84. package/lib/core/hooks/index.d.ts +3 -0
  85. package/lib/core/hooks/index.js +3 -0
  86. package/lib/core/hooks/use-toast-logic.d.ts +18 -0
  87. package/lib/core/hooks/use-toast-logic.js +141 -0
  88. package/lib/core/hooks/use-toast.d.ts +11 -0
  89. package/lib/core/hooks/use-toast.js +17 -0
  90. package/lib/core/styles/dark.d.ts +3 -1
  91. package/lib/core/styles/dark.js +37 -33
  92. package/lib/core/styles/global.d.ts +6 -2
  93. package/lib/core/styles/global.js +56 -46
  94. package/lib/core/styles/palette.d.ts +6 -0
  95. package/lib/core/styles/palette.dark.d.ts +3 -0
  96. package/lib/core/styles/palette.dark.js +201 -0
  97. package/lib/core/styles/palette.js +175 -0
  98. package/lib/core/types/catalog.d.ts +23 -7
  99. package/lib/core/types/hooks.d.ts +6 -4
  100. package/lib/core/types/index.d.ts +1 -0
  101. package/lib/core/types/search.d.ts +1 -0
  102. package/lib/core/types/toast.d.ts +23 -0
  103. package/lib/core/types/toast.js +3 -0
  104. package/lib/core/utils/get-auto-dismiss-duration.d.ts +2 -0
  105. package/lib/core/utils/get-auto-dismiss-duration.js +15 -0
  106. package/lib/core/utils/index.d.ts +1 -0
  107. package/lib/core/utils/index.js +1 -0
  108. package/lib/icons/CheckboxIcon/CheckboxIcon.js +6 -4
  109. package/lib/icons/CheckboxIcon/variables.dark.js +2 -1
  110. package/lib/icons/CheckboxIcon/variables.js +3 -3
  111. package/lib/icons/IdeaIcon/IdeaIcon.d.ts +9 -0
  112. package/lib/icons/IdeaIcon/IdeaIcon.js +24 -0
  113. package/lib/icons/NewChatIcon/NewChatIcon.d.ts +11 -0
  114. package/lib/icons/NewChatIcon/NewChatIcon.js +25 -0
  115. package/lib/index.d.ts +5 -1
  116. package/lib/index.js +5 -1
  117. package/lib/markdoc/components/Heading/Heading.js +2 -2
  118. package/lib/markdoc/components/Mermaid/Mermaid.js +0 -2
  119. package/lib/markdoc/components/Tabs/variables.js +3 -3
  120. package/lib/markdoc/components/default.d.ts +0 -1
  121. package/lib/markdoc/components/default.js +0 -1
  122. package/lib/markdoc/tags/admonition.js +1 -1
  123. package/package.json +2 -2
  124. package/src/components/Admonition/Admonition.tsx +3 -1
  125. package/src/components/Admonition/variables.dark.ts +3 -0
  126. package/src/components/Admonition/variables.ts +13 -0
  127. package/src/components/Banner/Banner.tsx +7 -7
  128. package/src/components/Button/variables.dark.ts +2 -2
  129. package/src/components/Button/variables.ts +3 -3
  130. package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
  131. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
  132. package/src/components/Catalog/CatalogEntities.tsx +3 -3
  133. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
  134. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +3 -1
  135. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  136. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  137. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
  138. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
  139. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
  140. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
  141. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
  142. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
  143. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
  144. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
  145. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
  146. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
  147. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
  148. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  149. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
  150. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
  151. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
  152. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
  153. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
  154. package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
  155. package/src/components/Catalog/CatalogSortButton.tsx +5 -6
  156. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
  157. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
  158. package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
  159. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
  160. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
  161. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
  162. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
  163. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
  164. package/src/components/Catalog/CatalogTags.tsx +115 -0
  165. package/src/components/Catalog/variables.ts +22 -14
  166. package/src/components/Filter/variables.ts +1 -1
  167. package/src/components/Link/Link.tsx +1 -1
  168. package/src/components/Menu/MenuItem.tsx +5 -1
  169. package/src/components/Menu/variables.dark.ts +2 -0
  170. package/src/components/Menu/variables.ts +4 -3
  171. package/src/components/Search/SearchDialog.tsx +299 -293
  172. package/src/components/SvgViewer/variables.dark.ts +1 -1
  173. package/src/components/Switch/variables.dark.ts +2 -2
  174. package/src/components/Switch/variables.ts +1 -1
  175. package/src/components/TableOfContent/TableOfContent.tsx +1 -0
  176. package/src/components/TableOfContent/variables.ts +3 -2
  177. package/src/components/Toast/Toast.tsx +289 -0
  178. package/src/components/Toast/variables.ts +61 -0
  179. package/src/components/Tooltip/JsTooltip.tsx +1 -1
  180. package/src/core/constants/catalog.ts +1 -1
  181. package/src/core/constants/toast.ts +1 -0
  182. package/src/core/contexts/Toast/ToastContext.tsx +5 -0
  183. package/src/core/contexts/Toast/ToastProvider.tsx +206 -0
  184. package/src/core/contexts/index.ts +2 -0
  185. package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
  186. package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
  187. package/src/core/hooks/index.ts +3 -0
  188. package/src/core/hooks/use-toast-logic.ts +203 -0
  189. package/src/core/hooks/use-toast.ts +47 -0
  190. package/src/core/styles/dark.ts +9 -4
  191. package/src/core/styles/global.ts +30 -20
  192. package/src/core/styles/palette.dark.ts +199 -0
  193. package/src/core/styles/palette.ts +173 -0
  194. package/src/core/types/catalog.ts +24 -8
  195. package/src/core/types/hooks.ts +5 -10
  196. package/src/core/types/index.ts +1 -0
  197. package/src/core/types/search.ts +1 -0
  198. package/src/core/types/toast.ts +28 -0
  199. package/src/core/utils/get-auto-dismiss-duration.ts +20 -0
  200. package/src/core/utils/index.ts +1 -0
  201. package/src/icons/CheckboxIcon/CheckboxIcon.tsx +26 -17
  202. package/src/icons/CheckboxIcon/variables.dark.ts +2 -1
  203. package/src/icons/CheckboxIcon/variables.ts +3 -3
  204. package/src/icons/IdeaIcon/IdeaIcon.tsx +32 -0
  205. package/src/icons/NewChatIcon/NewChatIcon.tsx +39 -0
  206. package/src/index.ts +5 -1
  207. package/src/markdoc/components/Heading/Heading.tsx +2 -1
  208. package/src/markdoc/components/Mermaid/Mermaid.tsx +0 -2
  209. package/src/markdoc/components/Tabs/variables.ts +3 -3
  210. package/src/markdoc/components/default.ts +0 -1
  211. package/src/markdoc/tags/admonition.ts +1 -1
  212. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
  213. package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
  214. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +0 -7
  215. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +0 -95
  216. package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +0 -1
  217. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +0 -1
  218. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +0 -8
  219. package/lib/markdoc/components/ExcalidrawDiagram/variables.js +0 -15
  220. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
  221. package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +0 -85
  222. package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +0 -5
  223. package/src/markdoc/components/ExcalidrawDiagram/variables.ts +0 -12
@@ -1,57 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CatalogTagsWithTooltip = CatalogTagsWithTooltip;
7
- const react_1 = __importDefault(require("react"));
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
- const constants_1 = require("../../core/constants");
10
- const Tag_1 = require("../../components/Tag/Tag");
11
- const Tooltip_1 = require("../../components/Tooltip/Tooltip");
12
- const CatalogHighlight_1 = require("../../components/Catalog/CatalogHighlight");
13
- const hooks_1 = require("../../core/hooks");
14
- const CatalogAvatar_1 = require("../../components/Catalog/CatalogAvatar");
15
- function CatalogTagsWithTooltip({ items, itemsToShow = 1, showPlaceholder = false, showAvatars, tagProps, }) {
16
- const { useTranslate } = (0, hooks_1.useThemeHooks)();
17
- const { translate } = useTranslate();
18
- if (!items || items.length === 0) {
19
- if (showPlaceholder) {
20
- return (react_1.default.createElement(CatalogTagsNotConnectedWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" }, translate('catalog.notConnected', 'Not connected')));
21
- }
22
- return null;
23
- }
24
- if (items.length <= itemsToShow) {
25
- return (react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" }, items.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
26
- icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
27
- }), { maxLength: constants_1.CATALOG_TAG_MAX_LENGTH }),
28
- react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item))))));
29
- }
30
- const displayedItems = items.slice(0, itemsToShow);
31
- const remainingCount = items.length - itemsToShow;
32
- return (react_1.default.createElement(Tooltip_1.Tooltip, { tip: items.join(', '), placement: "bottom", className: "catalog", width: "400px" },
33
- react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" },
34
- displayedItems.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
35
- icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
36
- }), { textTransform: "none", maxLength: constants_1.CATALOG_TAG_MAX_LENGTH }),
37
- react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item)))),
38
- react_1.default.createElement(MoreTagsButton, null,
39
- "+",
40
- remainingCount,
41
- " ",
42
- translate('catalog.tags.more', 'more')))));
43
- }
44
- const CatalogTagsWrapper = styled_components_1.default.div `
45
- display: flex;
46
- flex-wrap: wrap;
47
- `;
48
- const MoreTagsButton = styled_components_1.default.span `
49
- font-size: var(--catalog-tags-more-button-font-size);
50
- margin-left: var(--catalog-tags-more-button-margin-left);
51
- `;
52
- const CatalogTagsNotConnectedWrapper = styled_components_1.default.span `
53
- font-size: var(--catalog-tags-not-connected-font-size);
54
- line-height: var(--catalog-tags-not-connected-line-height);
55
- color: var(--catalog-tags-not-connected-color);
56
- `;
57
- //# sourceMappingURL=CatalogTagsWithTooltip.js.map
@@ -1,7 +0,0 @@
1
- import type { JSX } from 'react';
2
- type ExcalidrawDiagramProps = {
3
- diagramHtml: string;
4
- className?: string;
5
- };
6
- export declare function ExcalidrawDiagram({ diagramHtml, className }: ExcalidrawDiagramProps): JSX.Element;
7
- export {};
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
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
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.ExcalidrawDiagram = ExcalidrawDiagram;
40
- const react_1 = __importStar(require("react"));
41
- const styled_components_1 = __importDefault(require("styled-components"));
42
- const utils_1 = require("../../../core/utils");
43
- const hooks_1 = require("../../../core/hooks");
44
- const SvgViewer_1 = require("../../../components/SvgViewer/SvgViewer");
45
- function ExcalidrawDiagram({ diagramHtml, className }) {
46
- const { useTranslate } = (0, hooks_1.useThemeHooks)();
47
- const { translate } = useTranslate();
48
- const [isOpen, setIsOpen] = (0, react_1.useState)(false);
49
- const open = () => setIsOpen(true);
50
- const close = () => setIsOpen(false);
51
- return (react_1.default.createElement(react_1.default.Fragment, null,
52
- react_1.default.createElement(Wrapper, { className: (0, utils_1.concatClassNames)('excalidraw-wrapper', className), dangerouslySetInnerHTML: { __html: diagramHtml }, "data-component-name": "Markdoc/ExcalidrawDiagram/ExcalidrawDiagram", onClick: open, onKeyDown: (e) => (e.key === 'Enter' || e.key === ' ') && open(), role: "button", tabIndex: 0, "aria-label": translate('excalidraw.openFullscreen', 'Click to open diagram in fullscreen') }),
53
- react_1.default.createElement(SvgViewer_1.SvgViewer, { isOpen: isOpen, onClose: close, labels: {
54
- zoomIn: translate('excalidraw.zoomIn', 'Zoom in'),
55
- zoomOut: translate('excalidraw.zoomOut', 'Zoom out'),
56
- fitToView: translate('excalidraw.reset', 'Fit to view'),
57
- close: translate('excalidraw.close', 'Close'),
58
- dialogLabel: translate('excalidraw.viewer', 'Excalidraw diagram viewer'),
59
- } },
60
- react_1.default.createElement(ViewerContent, { dangerouslySetInnerHTML: { __html: diagramHtml } }))));
61
- }
62
- const Wrapper = styled_components_1.default.div `
63
- background-color: var(--excalidraw-bg-color);
64
- border-radius: var(--excalidraw-border-radius);
65
- cursor: pointer;
66
- transition: box-shadow 0.2s ease;
67
- overflow: hidden;
68
-
69
- &:hover,
70
- &:focus {
71
- outline: none;
72
- box-shadow: 0 0 0 2px var(--border-color-input-focus);
73
- }
74
-
75
- svg {
76
- max-width: 100%;
77
- height: auto;
78
- display: block;
79
-
80
- > rect {
81
- fill: var(--excalidraw-bg-color);
82
- }
83
- }
84
-
85
- & + & {
86
- margin-top: var(--spacing-md);
87
- }
88
- `;
89
- const ViewerContent = styled_components_1.default.div `
90
- svg {
91
- display: block;
92
- max-width: none !important;
93
- }
94
- `;
95
- //# sourceMappingURL=ExcalidrawDiagram.js.map
@@ -1 +0,0 @@
1
- export declare const excalidraw: import("styled-components").FlattenSimpleInterpolation;
@@ -1 +0,0 @@
1
- export declare const excalidrawDarkMode: import("styled-components").FlattenSimpleInterpolation;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.excalidrawDarkMode = void 0;
4
- const styled_components_1 = require("styled-components");
5
- exports.excalidrawDarkMode = (0, styled_components_1.css) `
6
- --excalidraw-bg-color: var(--bg-color); // @presenter Color
7
- `;
8
- //# sourceMappingURL=variables.dark.js.map
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.excalidraw = void 0;
4
- const styled_components_1 = require("styled-components");
5
- exports.excalidraw = (0, styled_components_1.css) `
6
- /**
7
- * @tokens Excalidraw
8
- */
9
-
10
- --excalidraw-bg-color: var(--bg-color); // @presenter Color
11
- --excalidraw-border-radius: var(--border-radius-lg); // @presenter BorderRadius
12
-
13
- // @tokens End
14
- `;
15
- //# sourceMappingURL=variables.js.map
@@ -1,101 +0,0 @@
1
- import React, { JSX } from 'react';
2
- import styled from 'styled-components';
3
-
4
- import { CATALOG_TAG_MAX_LENGTH } from '@redocly/theme/core/constants';
5
- import { Tag, TagProps } from '@redocly/theme/components/Tag/Tag';
6
- import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
7
- import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
8
- import { useThemeHooks } from '@redocly/theme/core/hooks';
9
- import { CatalogAvatar } from '@redocly/theme/components/Catalog/CatalogAvatar';
10
-
11
- export type CatalogTagsWithTooltipProps = {
12
- items: string[];
13
- itemsToShow?: number;
14
- showPlaceholder?: boolean;
15
- tagProps?: TagProps;
16
- showAvatars?: boolean;
17
- };
18
-
19
- export function CatalogTagsWithTooltip({
20
- items,
21
- itemsToShow = 1,
22
- showPlaceholder = false,
23
- showAvatars,
24
- tagProps,
25
- }: CatalogTagsWithTooltipProps): JSX.Element | null {
26
- const { useTranslate } = useThemeHooks();
27
- const { translate } = useTranslate();
28
-
29
- if (!items || items.length === 0) {
30
- if (showPlaceholder) {
31
- return (
32
- <CatalogTagsNotConnectedWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
33
- {translate('catalog.notConnected', 'Not connected')}
34
- </CatalogTagsNotConnectedWrapper>
35
- );
36
- }
37
- return null;
38
- }
39
-
40
- if (items.length <= itemsToShow) {
41
- return (
42
- <CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
43
- {items.map((item, index) => (
44
- <Tag
45
- key={`${item}-${index}`}
46
- {...tagProps}
47
- {...(showAvatars && {
48
- icon: <CatalogAvatar value={item} size="small" />,
49
- })}
50
- maxLength={CATALOG_TAG_MAX_LENGTH}
51
- >
52
- <CatalogHighlight>{item}</CatalogHighlight>
53
- </Tag>
54
- ))}
55
- </CatalogTagsWrapper>
56
- );
57
- }
58
-
59
- const displayedItems = items.slice(0, itemsToShow);
60
- const remainingCount = items.length - itemsToShow;
61
-
62
- return (
63
- <Tooltip tip={items.join(', ')} placement="bottom" className="catalog" width="400px">
64
- <CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
65
- {displayedItems.map((item, index) => (
66
- <Tag
67
- key={`${item}-${index}`}
68
- {...tagProps}
69
- {...(showAvatars && {
70
- icon: <CatalogAvatar value={item} size="small" />,
71
- })}
72
- textTransform="none"
73
- maxLength={CATALOG_TAG_MAX_LENGTH}
74
- >
75
- <CatalogHighlight>{item}</CatalogHighlight>
76
- </Tag>
77
- ))}
78
-
79
- <MoreTagsButton>
80
- +{remainingCount} {translate('catalog.tags.more', 'more')}
81
- </MoreTagsButton>
82
- </CatalogTagsWrapper>
83
- </Tooltip>
84
- );
85
- }
86
-
87
- const CatalogTagsWrapper = styled.div`
88
- display: flex;
89
- flex-wrap: wrap;
90
- `;
91
-
92
- const MoreTagsButton = styled.span`
93
- font-size: var(--catalog-tags-more-button-font-size);
94
- margin-left: var(--catalog-tags-more-button-margin-left);
95
- `;
96
-
97
- const CatalogTagsNotConnectedWrapper = styled.span`
98
- font-size: var(--catalog-tags-not-connected-font-size);
99
- line-height: var(--catalog-tags-not-connected-line-height);
100
- color: var(--catalog-tags-not-connected-color);
101
- `;
@@ -1,85 +0,0 @@
1
- import React, { useState } from 'react';
2
- import styled from 'styled-components';
3
-
4
- import type { JSX } from 'react';
5
-
6
- import { concatClassNames } from '@redocly/theme/core/utils';
7
- import { useThemeHooks } from '@redocly/theme/core/hooks';
8
- import { SvgViewer } from '@redocly/theme/components/SvgViewer/SvgViewer';
9
-
10
- type ExcalidrawDiagramProps = {
11
- diagramHtml: string;
12
- className?: string;
13
- };
14
-
15
- export function ExcalidrawDiagram({ diagramHtml, className }: ExcalidrawDiagramProps): JSX.Element {
16
- const { useTranslate } = useThemeHooks();
17
- const { translate } = useTranslate();
18
- const [isOpen, setIsOpen] = useState(false);
19
-
20
- const open = () => setIsOpen(true);
21
- const close = () => setIsOpen(false);
22
-
23
- return (
24
- <>
25
- <Wrapper
26
- className={concatClassNames('excalidraw-wrapper', className)}
27
- dangerouslySetInnerHTML={{ __html: diagramHtml }}
28
- data-component-name="Markdoc/ExcalidrawDiagram/ExcalidrawDiagram"
29
- onClick={open}
30
- onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') && open()}
31
- role="button"
32
- tabIndex={0}
33
- aria-label={translate('excalidraw.openFullscreen', 'Click to open diagram in fullscreen')}
34
- />
35
- <SvgViewer
36
- isOpen={isOpen}
37
- onClose={close}
38
- labels={{
39
- zoomIn: translate('excalidraw.zoomIn', 'Zoom in'),
40
- zoomOut: translate('excalidraw.zoomOut', 'Zoom out'),
41
- fitToView: translate('excalidraw.reset', 'Fit to view'),
42
- close: translate('excalidraw.close', 'Close'),
43
- dialogLabel: translate('excalidraw.viewer', 'Excalidraw diagram viewer'),
44
- }}
45
- >
46
- <ViewerContent dangerouslySetInnerHTML={{ __html: diagramHtml }} />
47
- </SvgViewer>
48
- </>
49
- );
50
- }
51
-
52
- const Wrapper = styled.div`
53
- background-color: var(--excalidraw-bg-color);
54
- border-radius: var(--excalidraw-border-radius);
55
- cursor: pointer;
56
- transition: box-shadow 0.2s ease;
57
- overflow: hidden;
58
-
59
- &:hover,
60
- &:focus {
61
- outline: none;
62
- box-shadow: 0 0 0 2px var(--border-color-input-focus);
63
- }
64
-
65
- svg {
66
- max-width: 100%;
67
- height: auto;
68
- display: block;
69
-
70
- > rect {
71
- fill: var(--excalidraw-bg-color);
72
- }
73
- }
74
-
75
- & + & {
76
- margin-top: var(--spacing-md);
77
- }
78
- `;
79
-
80
- const ViewerContent = styled.div`
81
- svg {
82
- display: block;
83
- max-width: none !important;
84
- }
85
- `;
@@ -1,5 +0,0 @@
1
- import { css } from "styled-components";
2
-
3
- export const excalidrawDarkMode = css`
4
- --excalidraw-bg-color: var(--bg-color); // @presenter Color
5
- `;
@@ -1,12 +0,0 @@
1
- import { css } from "styled-components";
2
-
3
- export const excalidraw = css`
4
- /**
5
- * @tokens Excalidraw
6
- */
7
-
8
- --excalidraw-bg-color: var(--bg-color); // @presenter Color
9
- --excalidraw-border-radius: var(--border-radius-lg); // @presenter BorderRadius
10
-
11
- // @tokens End
12
- `;