@redocly/theme 0.61.0 → 0.62.0-custom.0

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 (199) hide show
  1. package/lib/components/Admonition/Admonition.js +14 -18
  2. package/lib/components/Admonition/variables.dark.d.ts +1 -0
  3. package/lib/components/Admonition/variables.dark.js +18 -0
  4. package/lib/components/Admonition/variables.js +24 -28
  5. package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.d.ts +1 -0
  6. package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.js +12 -0
  7. package/lib/components/Badge/Badge.d.ts +2 -1
  8. package/lib/components/Badge/Badge.js +24 -2
  9. package/lib/components/Banner/Banner.js +19 -1
  10. package/lib/components/Banner/variables.js +1 -0
  11. package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
  12. package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +9 -6
  13. package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
  14. package/lib/components/Buttons/AIAssistantButton.js +7 -4
  15. package/lib/components/Catalog/CatalogEntities.js +10 -8
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +2 -2
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +5 -3
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +13 -11
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +7 -5
  21. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +9 -7
  22. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +1 -1
  23. package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -2
  24. package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -1
  25. package/lib/components/CodeBlock/CodeBlockControls.js +8 -6
  26. package/lib/components/Filter/FilterCheckboxes.js +1 -1
  27. package/lib/components/JsonViewer/JsonViewer.js +2 -2
  28. package/lib/components/JsonViewer/{Helpers.js → helpers.js} +2 -1
  29. package/lib/components/LanguagePicker/LanguagePicker.js +1 -1
  30. package/lib/components/Markdown/Markdown.js +2 -2
  31. package/lib/components/Menu/MenuItem.js +41 -15
  32. package/lib/components/Navbar/NavbarItem.js +1 -1
  33. package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.d.ts +1 -0
  34. package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.js +12 -0
  35. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +1 -0
  36. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +6 -0
  37. package/lib/components/PageActions/PageActions.js +25 -8
  38. package/lib/components/Search/SearchAiDialog.d.ts +4 -2
  39. package/lib/components/Search/SearchAiDialog.js +23 -4
  40. package/lib/components/Search/SearchAiMessage.d.ts +4 -2
  41. package/lib/components/Search/SearchAiMessage.js +82 -23
  42. package/lib/components/Search/SearchDialog.js +50 -25
  43. package/lib/components/Select/variables.js +2 -2
  44. package/lib/components/SvgViewer/SvgViewer.d.ts +15 -0
  45. package/lib/components/SvgViewer/SvgViewer.js +312 -0
  46. package/lib/components/SvgViewer/variables.d.ts +1 -0
  47. package/lib/components/SvgViewer/variables.dark.d.ts +1 -0
  48. package/lib/components/SvgViewer/variables.dark.js +8 -0
  49. package/lib/components/SvgViewer/variables.js +17 -0
  50. package/lib/components/Tag/Tag.js +1 -1
  51. package/lib/components/Tag/variables.dark.js +6 -0
  52. package/lib/components/Tag/variables.js +6 -0
  53. package/lib/components/Tooltip/Tooltip.d.ts +2 -3
  54. package/lib/components/Tooltip/Tooltip.js +66 -113
  55. package/lib/components/Tooltip/variables.dark.js +4 -0
  56. package/lib/components/Tooltip/variables.js +3 -3
  57. package/lib/components/UserMenu/LoginButton.d.ts +8 -2
  58. package/lib/components/UserMenu/LoginButton.js +4 -3
  59. package/lib/core/constants/search.d.ts +5 -1
  60. package/lib/core/constants/search.js +24 -1
  61. package/lib/core/hooks/search/use-search-dialog.js +2 -2
  62. package/lib/core/hooks/use-color-switcher.d.ts +1 -0
  63. package/lib/core/hooks/use-color-switcher.js +8 -1
  64. package/lib/core/hooks/use-mcp-config.js +2 -1
  65. package/lib/core/hooks/use-modal-scroll-lock.js +24 -10
  66. package/lib/core/hooks/use-outside-click.d.ts +3 -1
  67. package/lib/core/hooks/use-outside-click.js +8 -4
  68. package/lib/core/hooks/use-page-actions.d.ts +1 -1
  69. package/lib/core/hooks/use-page-actions.js +44 -11
  70. package/lib/core/hooks/use-product-picker.js +1 -1
  71. package/lib/core/hooks/use-unique-svg-ids.d.ts +6 -0
  72. package/lib/core/hooks/use-unique-svg-ids.js +15 -0
  73. package/lib/core/openapi/index.d.ts +1 -0
  74. package/lib/core/openapi/index.js +3 -1
  75. package/lib/core/styles/dark.js +4 -0
  76. package/lib/core/styles/global.js +31 -15
  77. package/lib/core/types/catalog.d.ts +1 -1
  78. package/lib/core/types/hooks.d.ts +23 -2
  79. package/lib/core/types/l10n.d.ts +1 -1
  80. package/lib/core/types/search.d.ts +24 -0
  81. package/lib/core/types/search.js +9 -1
  82. package/lib/core/utils/content-segments.d.ts +2 -0
  83. package/lib/core/utils/content-segments.js +22 -0
  84. package/lib/core/utils/index.d.ts +1 -0
  85. package/lib/core/utils/index.js +1 -0
  86. package/lib/core/utils/transform-revisions-to-version-history.js +8 -51
  87. package/lib/ext/process-scorecard.d.ts +5 -0
  88. package/lib/ext/process-scorecard.js +11 -0
  89. package/lib/icons/FitToViewIcon/FitToViewIcon.d.ts +9 -0
  90. package/lib/icons/FitToViewIcon/FitToViewIcon.js +25 -0
  91. package/lib/icons/WarningCycleIcon/WarningCycleIcon.d.ts +9 -0
  92. package/lib/icons/WarningCycleIcon/WarningCycleIcon.js +24 -0
  93. package/lib/index.d.ts +9 -0
  94. package/lib/index.js +9 -0
  95. package/lib/layouts/DocumentationLayout.js +4 -25
  96. package/lib/layouts/DocumentationLayoutBottom.d.ts +11 -0
  97. package/lib/layouts/DocumentationLayoutBottom.js +28 -0
  98. package/lib/layouts/DocumentationLayoutTop.d.ts +13 -0
  99. package/lib/layouts/DocumentationLayoutTop.js +33 -0
  100. package/lib/layouts/Forbidden.js +22 -18
  101. package/lib/markdoc/components/Cards/Card.js +1 -0
  102. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
  103. package/lib/markdoc/components/Heading/Heading.js +40 -2
  104. package/lib/markdoc/components/LoginButton/LoginButton.d.ts +9 -0
  105. package/lib/markdoc/components/LoginButton/LoginButton.js +48 -0
  106. package/lib/markdoc/components/Mermaid/Mermaid.js +70 -2
  107. package/lib/markdoc/components/default.d.ts +1 -0
  108. package/lib/markdoc/components/default.js +1 -0
  109. package/lib/markdoc/default.d.ts +6 -0
  110. package/lib/markdoc/default.js +2 -0
  111. package/lib/markdoc/tags/login-button.d.ts +2 -0
  112. package/lib/markdoc/tags/login-button.js +32 -0
  113. package/package.json +9 -9
  114. package/src/components/Admonition/Admonition.tsx +14 -18
  115. package/src/components/Admonition/variables.dark.ts +15 -0
  116. package/src/components/Admonition/variables.ts +24 -28
  117. package/src/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.tsx +10 -0
  118. package/src/components/Badge/Badge.tsx +18 -2
  119. package/src/components/Banner/Banner.tsx +23 -1
  120. package/src/components/Banner/variables.ts +1 -0
  121. package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -3
  122. package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +11 -8
  123. package/src/components/Breadcrumbs/Breadcrumbs.tsx +24 -15
  124. package/src/components/Buttons/AIAssistantButton.tsx +7 -4
  125. package/src/components/Catalog/CatalogEntities.tsx +10 -8
  126. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +1 -1
  127. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +7 -4
  128. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +1 -1
  129. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +13 -11
  130. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +7 -5
  131. package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +9 -7
  132. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +1 -2
  133. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
  134. package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +3 -1
  135. package/src/components/CodeBlock/CodeBlockControls.tsx +16 -10
  136. package/src/components/Filter/FilterCheckboxes.tsx +1 -1
  137. package/src/components/JsonViewer/JsonViewer.tsx +1 -2
  138. package/src/components/JsonViewer/{Helpers.tsx → helpers.tsx} +1 -0
  139. package/src/components/LanguagePicker/LanguagePicker.tsx +1 -1
  140. package/src/components/Markdown/Markdown.tsx +2 -2
  141. package/src/components/Menu/MenuItem.tsx +61 -16
  142. package/src/components/Navbar/NavbarItem.tsx +3 -1
  143. package/src/components/OpenApiDocs/hooks/AdditionalOverviewInfo.tsx +10 -0
  144. package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +2 -0
  145. package/src/components/PageActions/PageActions.tsx +38 -15
  146. package/src/components/Search/SearchAiDialog.tsx +31 -2
  147. package/src/components/Search/SearchAiMessage.tsx +103 -17
  148. package/src/components/Search/SearchDialog.tsx +70 -37
  149. package/src/components/Select/variables.ts +2 -2
  150. package/src/components/SvgViewer/SvgViewer.tsx +405 -0
  151. package/src/components/SvgViewer/variables.dark.ts +5 -0
  152. package/src/components/SvgViewer/variables.ts +14 -0
  153. package/src/components/Tag/Tag.tsx +2 -1
  154. package/src/components/Tag/variables.dark.ts +6 -0
  155. package/src/components/Tag/variables.ts +6 -0
  156. package/src/components/Tooltip/Tooltip.tsx +77 -120
  157. package/src/components/Tooltip/variables.dark.ts +4 -0
  158. package/src/components/Tooltip/variables.ts +3 -3
  159. package/src/components/UserMenu/LoginButton.tsx +23 -8
  160. package/src/core/constants/search.ts +27 -1
  161. package/src/core/hooks/__mocks__/use-theme-hooks.ts +10 -1
  162. package/src/core/hooks/search/use-search-dialog.ts +2 -2
  163. package/src/core/hooks/use-color-switcher.ts +10 -2
  164. package/src/core/hooks/use-mcp-config.ts +2 -1
  165. package/src/core/hooks/use-modal-scroll-lock.ts +29 -10
  166. package/src/core/hooks/use-outside-click.ts +16 -5
  167. package/src/core/hooks/use-page-actions.ts +66 -25
  168. package/src/core/hooks/use-product-picker.ts +1 -1
  169. package/src/core/hooks/use-unique-svg-ids.ts +12 -0
  170. package/src/core/openapi/index.ts +1 -0
  171. package/src/core/styles/dark.ts +4 -0
  172. package/src/core/styles/global.ts +31 -15
  173. package/src/core/types/catalog.ts +1 -1
  174. package/src/core/types/hooks.ts +29 -1
  175. package/src/core/types/l10n.ts +12 -1
  176. package/src/core/types/search.ts +19 -0
  177. package/src/core/utils/content-segments.ts +27 -0
  178. package/src/core/utils/index.ts +1 -0
  179. package/src/core/utils/transform-revisions-to-version-history.ts +8 -80
  180. package/src/ext/process-scorecard.ts +14 -0
  181. package/src/icons/FitToViewIcon/FitToViewIcon.tsx +26 -0
  182. package/src/icons/WarningCycleIcon/WarningCycleIcon.tsx +32 -0
  183. package/src/index.ts +9 -0
  184. package/src/layouts/DocumentationLayout.tsx +4 -30
  185. package/src/layouts/DocumentationLayoutBottom.tsx +42 -0
  186. package/src/layouts/DocumentationLayoutTop.tsx +52 -0
  187. package/src/layouts/Forbidden.tsx +36 -21
  188. package/src/markdoc/components/Cards/Card.tsx +1 -0
  189. package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
  190. package/src/markdoc/components/Heading/Heading.tsx +52 -4
  191. package/src/markdoc/components/LoginButton/LoginButton.tsx +38 -0
  192. package/src/markdoc/components/Mermaid/Mermaid.tsx +57 -8
  193. package/src/markdoc/components/default.ts +1 -0
  194. package/src/markdoc/default.ts +2 -0
  195. package/src/markdoc/tags/login-button.ts +30 -0
  196. package/lib/components/Tooltip/TooltipWrapper.d.ts +0 -12
  197. package/lib/components/Tooltip/TooltipWrapper.js +0 -34
  198. package/src/components/Tooltip/TooltipWrapper.tsx +0 -70
  199. /package/lib/components/JsonViewer/{Helpers.d.ts → helpers.d.ts} +0 -0
@@ -0,0 +1,312 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.SvgViewer = SvgViewer;
37
+ const react_1 = __importStar(require("react"));
38
+ const styled_components_1 = __importStar(require("styled-components"));
39
+ const hooks_1 = require("../../core/hooks");
40
+ const Button_1 = require("../../components/Button/Button");
41
+ const Tooltip_1 = require("../../components/Tooltip/Tooltip");
42
+ const AddIcon_1 = require("../../icons/AddIcon/AddIcon");
43
+ const SubtractIcon_1 = require("../../icons/SubtractIcon/SubtractIcon");
44
+ const CloseIcon_1 = require("../../icons/CloseIcon/CloseIcon");
45
+ const FitToViewIcon_1 = require("../../icons/FitToViewIcon/FitToViewIcon");
46
+ const MIN_SCALE_FACTOR = 0.1;
47
+ const MAX_SCALE_FACTOR = 5;
48
+ const ZOOM_STEP = 0.1;
49
+ const WHEEL_SENSITIVITY = 0.002;
50
+ const VIEWPORT_PADDING = 60;
51
+ const FIT_SCALE_FACTOR = 0.9;
52
+ function SvgViewer({ isOpen, onClose, children, labels = {}, }) {
53
+ const [scale, setScale] = (0, react_1.useState)(1);
54
+ const [baseScale, setBaseScale] = (0, react_1.useState)(1);
55
+ const [position, setPosition] = (0, react_1.useState)({ x: 0, y: 0 });
56
+ const [isDragging, setIsDragging] = (0, react_1.useState)(false);
57
+ const [dragStart, setDragStart] = (0, react_1.useState)({ x: 0, y: 0 });
58
+ const [pinchState, setPinchState] = (0, react_1.useState)(null);
59
+ const [isWheelZooming, setIsWheelZooming] = (0, react_1.useState)(false);
60
+ const wheelTimeoutRef = (0, react_1.useRef)(null);
61
+ const overlayRef = (0, react_1.useRef)(null);
62
+ const viewportRef = (0, react_1.useRef)(null);
63
+ const contentRef = (0, react_1.useRef)(null);
64
+ const renderedScaleRef = (0, react_1.useRef)(scale);
65
+ (0, hooks_1.useModalScrollLock)(isOpen);
66
+ // Keep track of the actually rendered scale for accurate measurements
67
+ (0, react_1.useLayoutEffect)(() => {
68
+ renderedScaleRef.current = scale;
69
+ }, [scale]);
70
+ const minScale = baseScale * MIN_SCALE_FACTOR;
71
+ const maxScale = baseScale * MAX_SCALE_FACTOR;
72
+ const clampScale = (0, react_1.useCallback)((value) => Math.min(maxScale, Math.max(minScale, value)), [minScale, maxScale]);
73
+ const calculateFitScale = (0, react_1.useCallback)(() => {
74
+ if (!viewportRef.current || !contentRef.current)
75
+ return 1;
76
+ const viewport = viewportRef.current.getBoundingClientRect();
77
+ const svg = contentRef.current.querySelector('svg');
78
+ if (!svg)
79
+ return 1;
80
+ const svgRect = svg.getBoundingClientRect();
81
+ if (!svgRect.width || !svgRect.height)
82
+ return 1;
83
+ // getBoundingClientRect returns transformed size, so compensate for current scale
84
+ const currentScale = renderedScaleRef.current || 1;
85
+ const naturalWidth = svgRect.width / currentScale;
86
+ const naturalHeight = svgRect.height / currentScale;
87
+ const availableWidth = viewport.width - VIEWPORT_PADDING * 2;
88
+ const availableHeight = viewport.height - VIEWPORT_PADDING * 2;
89
+ return (Math.min(availableWidth / naturalWidth, availableHeight / naturalHeight) * FIT_SCALE_FACTOR);
90
+ }, []);
91
+ const resetView = (0, react_1.useCallback)(() => {
92
+ setScale(baseScale);
93
+ setPosition({ x: 0, y: 0 });
94
+ }, [baseScale]);
95
+ const zoomIn = (0, react_1.useCallback)(() => {
96
+ setScale((s) => clampScale(s + baseScale * ZOOM_STEP));
97
+ }, [baseScale, clampScale]);
98
+ const zoomOut = (0, react_1.useCallback)(() => {
99
+ setScale((s) => clampScale(s - baseScale * ZOOM_STEP));
100
+ }, [baseScale, clampScale]);
101
+ const handleKeyDown = (0, react_1.useCallback)((e) => {
102
+ switch (e.key) {
103
+ case 'Escape':
104
+ onClose();
105
+ break;
106
+ case '+':
107
+ case '=':
108
+ zoomIn();
109
+ break;
110
+ case '-':
111
+ zoomOut();
112
+ break;
113
+ case '0':
114
+ resetView();
115
+ break;
116
+ }
117
+ }, [onClose, zoomIn, zoomOut, resetView]);
118
+ const handleWheel = (0, react_1.useCallback)((e) => {
119
+ e.preventDefault();
120
+ e.stopPropagation();
121
+ setIsWheelZooming(true);
122
+ if (wheelTimeoutRef.current)
123
+ clearTimeout(wheelTimeoutRef.current);
124
+ wheelTimeoutRef.current = setTimeout(() => setIsWheelZooming(false), 150);
125
+ const delta = -e.deltaY * WHEEL_SENSITIVITY;
126
+ setScale((s) => clampScale(s + s * delta));
127
+ }, [clampScale]);
128
+ const handleMouseDown = (0, react_1.useCallback)((e) => {
129
+ if (e.button !== 0)
130
+ return;
131
+ e.preventDefault();
132
+ setIsDragging(true);
133
+ setDragStart({ x: e.clientX - position.x, y: e.clientY - position.y });
134
+ }, [position]);
135
+ const handleMouseMove = (0, react_1.useCallback)((e) => {
136
+ if (!isDragging)
137
+ return;
138
+ setPosition({ x: e.clientX - dragStart.x, y: e.clientY - dragStart.y });
139
+ }, [isDragging, dragStart]);
140
+ const handleMouseUp = (0, react_1.useCallback)(() => setIsDragging(false), []);
141
+ const getTouchDistance = (touches) => {
142
+ if (touches.length !== 2)
143
+ return 0;
144
+ const dx = touches[0].clientX - touches[1].clientX;
145
+ const dy = touches[0].clientY - touches[1].clientY;
146
+ return Math.hypot(dx, dy);
147
+ };
148
+ const handleTouchStart = (0, react_1.useCallback)((e) => {
149
+ if (e.touches.length === 2) {
150
+ setPinchState({ distance: getTouchDistance(e.touches), scale });
151
+ }
152
+ else if (e.touches.length === 1) {
153
+ setIsDragging(true);
154
+ setDragStart({
155
+ x: e.touches[0].clientX - position.x,
156
+ y: e.touches[0].clientY - position.y,
157
+ });
158
+ }
159
+ }, [position, scale]);
160
+ const handleTouchMove = (0, react_1.useCallback)((e) => {
161
+ e.preventDefault();
162
+ if (e.touches.length === 2 && pinchState) {
163
+ const distance = getTouchDistance(e.touches);
164
+ setScale(clampScale(pinchState.scale * (distance / pinchState.distance)));
165
+ }
166
+ else if (e.touches.length === 1 && isDragging) {
167
+ setPosition({
168
+ x: e.touches[0].clientX - dragStart.x,
169
+ y: e.touches[0].clientY - dragStart.y,
170
+ });
171
+ }
172
+ }, [pinchState, isDragging, dragStart, clampScale]);
173
+ const handleTouchEnd = (0, react_1.useCallback)(() => {
174
+ setIsDragging(false);
175
+ setPinchState(null);
176
+ }, []);
177
+ (0, react_1.useEffect)(() => {
178
+ var _a;
179
+ if (!isOpen)
180
+ return;
181
+ setPosition({ x: 0, y: 0 });
182
+ (_a = overlayRef.current) === null || _a === void 0 ? void 0 : _a.focus();
183
+ // Wait for DOM to be ready before measuring
184
+ requestAnimationFrame(() => {
185
+ const fitScale = calculateFitScale();
186
+ setBaseScale(fitScale);
187
+ setScale(fitScale);
188
+ });
189
+ }, [isOpen, calculateFitScale]);
190
+ if (!isOpen)
191
+ return null;
192
+ const zoomPercentage = baseScale > 0 ? Math.round((scale / baseScale) * 100) : 100;
193
+ const isAnimating = !isDragging && !isWheelZooming && !pinchState;
194
+ return (react_1.default.createElement(Overlay, { ref: overlayRef, onClick: onClose, onKeyDown: handleKeyDown, tabIndex: 0, "aria-modal": "true", role: "dialog", "aria-label": labels.dialogLabel || 'SVG viewer' },
195
+ react_1.default.createElement(Viewport, { ref: viewportRef, onClick: (e) => e.stopPropagation(), onWheel: handleWheel, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, "$isDragging": isDragging },
196
+ react_1.default.createElement(Content, { ref: contentRef, "$isAnimating": isAnimating, style: {
197
+ transform: `translate(calc(-50% + ${position.x}px), calc(-50% + ${position.y}px)) scale(${scale})`,
198
+ } }, children),
199
+ react_1.default.createElement(Controls, null,
200
+ react_1.default.createElement(ControlGroup, null,
201
+ react_1.default.createElement(Tooltip_1.Tooltip, { tip: labels.zoomOut || 'Zoom out', placement: "top" },
202
+ react_1.default.createElement(ControlButton, { variant: "text", size: "small", icon: react_1.default.createElement(SubtractIcon_1.SubtractIcon, null), onClick: zoomOut, disabled: scale <= minScale })),
203
+ react_1.default.createElement(ZoomLabel, null,
204
+ zoomPercentage,
205
+ "%"),
206
+ react_1.default.createElement(Tooltip_1.Tooltip, { tip: labels.zoomIn || 'Zoom in', placement: "top" },
207
+ react_1.default.createElement(ControlButton, { variant: "text", size: "small", icon: react_1.default.createElement(AddIcon_1.AddIcon, null), onClick: zoomIn, disabled: scale >= maxScale })),
208
+ react_1.default.createElement(Divider, null),
209
+ react_1.default.createElement(Tooltip_1.Tooltip, { tip: labels.fitToView || 'Fit to view', placement: "top" },
210
+ react_1.default.createElement(ControlButton, { variant: "text", size: "small", icon: react_1.default.createElement(FitToViewIcon_1.FitToViewIcon, null), onClick: resetView })),
211
+ react_1.default.createElement(Tooltip_1.Tooltip, { tip: labels.close || 'Close', placement: "top" },
212
+ react_1.default.createElement(ControlButton, { variant: "text", size: "small", icon: react_1.default.createElement(CloseIcon_1.CloseIcon, null), onClick: onClose })))))));
213
+ }
214
+ const scaleIn = (0, styled_components_1.keyframes) `
215
+ from {
216
+ transform: scale(0.9);
217
+ }
218
+ to {
219
+ transform: scale(1);
220
+ }
221
+ `;
222
+ const slideUp = (0, styled_components_1.keyframes) `
223
+ from {
224
+ opacity: 0;
225
+ transform: translateX(-50%) translateY(10px);
226
+ }
227
+ to {
228
+ opacity: 1;
229
+ transform: translateX(-50%) translateY(0);
230
+ }
231
+ `;
232
+ const Overlay = styled_components_1.default.div `
233
+ position: fixed;
234
+ inset: 0;
235
+ background-color: var(--svg-viewer-overlay-bg-color);
236
+ backdrop-filter: blur(var(--spacing-unit));
237
+ z-index: var(--z-index-overlay, 1000);
238
+ display: flex;
239
+ align-items: center;
240
+ justify-content: center;
241
+ padding: var(--spacing-xxl);
242
+
243
+ &:focus {
244
+ outline: none;
245
+ }
246
+
247
+ @media (max-width: 768px) {
248
+ padding: var(--spacing-md);
249
+ }
250
+ `;
251
+ const Viewport = styled_components_1.default.div `
252
+ position: relative;
253
+ width: 100%;
254
+ height: 100%;
255
+ background-color: var(--svg-viewer-bg-color);
256
+ border-radius: var(--svg-viewer-border-radius);
257
+ overflow: hidden;
258
+ cursor: ${({ $isDragging }) => ($isDragging ? 'grabbing' : 'grab')};
259
+ touch-action: none;
260
+ box-shadow: var(--svg-viewer-box-shadow);
261
+ animation: ${scaleIn} 0.25s ease-in-out forwards;
262
+ `;
263
+ const Content = styled_components_1.default.div `
264
+ position: absolute;
265
+ top: 50%;
266
+ left: 50%;
267
+ transform-origin: center center;
268
+ user-select: none;
269
+ pointer-events: none;
270
+ transition: ${({ $isAnimating }) => ($isAnimating ? 'transform 0.25s ease-in-out' : 'none')};
271
+
272
+ svg {
273
+ display: block;
274
+ max-width: none !important;
275
+ }
276
+ `;
277
+ const Controls = styled_components_1.default.div `
278
+ position: absolute;
279
+ bottom: var(--spacing-sm);
280
+ left: 50%;
281
+ transform: translateX(-50%);
282
+ z-index: 10;
283
+ animation: ${slideUp} 0.3s ease-out 0.1s backwards;
284
+ `;
285
+ const ControlGroup = styled_components_1.default.div `
286
+ display: flex;
287
+ align-items: center;
288
+ gap: 2px;
289
+ padding: var(--spacing-xxs);
290
+ background: var(--bg-color-raised);
291
+ border: 1px solid var(--border-color-primary);
292
+ border-radius: var(--border-radius-lg);
293
+ box-shadow: var(--bg-raised-shadow);
294
+ `;
295
+ const ControlButton = (0, styled_components_1.default)(Button_1.Button) `
296
+ --button-icon-size: 16px;
297
+ `;
298
+ const ZoomLabel = styled_components_1.default.span `
299
+ min-width: 40px;
300
+ font-size: var(--font-size-sm);
301
+ font-weight: var(--font-weight-semibold);
302
+ color: var(--text-color-secondary);
303
+ text-align: center;
304
+ font-variant-numeric: tabular-nums;
305
+ `;
306
+ const Divider = styled_components_1.default.div `
307
+ width: 1px;
308
+ height: var(--spacing-base);
309
+ background: var(--border-color-primary);
310
+ margin: 0 var(--spacing-xxs);
311
+ `;
312
+ //# sourceMappingURL=SvgViewer.js.map
@@ -0,0 +1 @@
1
+ export declare const svgViewer: import("styled-components").FlattenSimpleInterpolation;
@@ -0,0 +1 @@
1
+ export declare const svgViewerDarkMode: import("styled-components").FlattenSimpleInterpolation;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.svgViewerDarkMode = void 0;
4
+ const styled_components_1 = require("styled-components");
5
+ exports.svgViewerDarkMode = (0, styled_components_1.css) `
6
+ --svg-viewer-bg-color: var(--color-warm-grey-9);
7
+ `;
8
+ //# sourceMappingURL=variables.dark.js.map
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.svgViewer = void 0;
4
+ const styled_components_1 = require("styled-components");
5
+ exports.svgViewer = (0, styled_components_1.css) `
6
+ /**
7
+ * @tokens SVG Viewer
8
+ */
9
+
10
+ --svg-viewer-overlay-bg-color: var(--bg-color-modal-overlay); // @presenter Color
11
+ --svg-viewer-bg-color: var(--bg-color); // @presenter Color
12
+ --svg-viewer-border-radius: var(--border-radius-xl); // @presenter BorderRadius
13
+ --svg-viewer-box-shadow: var(--bg-raised-shadow); // @presenter BoxShadow
14
+
15
+ // @tokens End
16
+ `;
17
+ //# sourceMappingURL=variables.js.map
@@ -177,7 +177,7 @@ const TagWrapper = styled_components_1.default.div.attrs(({ className, color, si
177
177
  ${({ textTransform }) => `text-transform: ${textTransform ? `${textTransform}` : 'var(--tag-text-transform)'};`}
178
178
 
179
179
  color: var(--tag-color);
180
- background-color: var(--tag-bg-color);
180
+ background-color: ${({ variant }) => variant === 'filled' ? 'var(--tag-bg-color)' : 'transparent'};
181
181
  ${({ borderless }) => borderless
182
182
  ? ''
183
183
  : `border: var(--tag-border-width) var(--tag-border-style) var(--tag-border-color);`}
@@ -184,6 +184,12 @@ exports.tagDarkMode = (0, styled_components_1.css) `
184
184
  --tag-bg-color-hover: #3A465F; // @presenter Color
185
185
  }
186
186
 
187
+ .tag-query {
188
+ --tag-color: #68cc97; // @presenter Color
189
+ --tag-bg-color: #1F3D2D; // @presenter Color
190
+ --tag-bg-color-hover: #34654B; // @presenter Color
191
+ }
192
+
187
193
  .tag-put {
188
194
  --tag-color: #e0a663; // @presenter Color
189
195
  --tag-bg-color: #3D2D1B; // @presenter Color
@@ -297,6 +297,12 @@ exports.tag = (0, styled_components_1.css) `
297
297
  --tag-bg-color-hover: #CEDDFD; // @presenter Color
298
298
  }
299
299
 
300
+ .tag-query {
301
+ --tag-color: #25b869; // @presenter Color
302
+ --tag-bg-color: #e5faef; // @presenter Color
303
+ --tag-bg-color-hover: #D4F7E5; // @presenter Color
304
+ }
305
+
300
306
  .tag-put {
301
307
  --tag-color: #f5901d; // @presenter Color
302
308
  --tag-bg-color: #fef1e2; // @presenter Color
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { JSX, PropsWithChildren, ReactNode } from 'react';
2
+ import type { ReactNode } from 'react';
3
3
  export type TooltipProps = {
4
4
  tip: string | ReactNode;
5
5
  isOpen?: boolean;
@@ -9,7 +9,6 @@ export type TooltipProps = {
9
9
  width?: string;
10
10
  dataTestId?: string;
11
11
  disabled?: boolean;
12
- arrowPosition?: 'top' | 'bottom' | 'left' | 'right' | 'center';
12
+ arrowPosition?: 'left' | 'right' | 'center';
13
13
  };
14
- export declare function TooltipComponent({ children, isOpen, tip, withArrow, placement, className, width, dataTestId, disabled, arrowPosition, }: PropsWithChildren<TooltipProps>): JSX.Element;
15
14
  export declare const Tooltip: React.NamedExoticComponent<React.PropsWithChildren<TooltipProps>>;