@motiadev/plugin-endpoint 0.7.2-beta.135-745094 → 0.7.2-beta.135-761859

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 (157) hide show
  1. package/dist/components/configuration-list-item.d.ts +12 -0
  2. package/dist/components/configuration-list-item.d.ts.map +1 -0
  3. package/dist/components/configuration-list-item.js +36 -0
  4. package/dist/components/configuration-list-item.js.map +1 -0
  5. package/dist/components/endpoint-badge.d.ts +8 -0
  6. package/dist/components/endpoint-badge.d.ts.map +1 -0
  7. package/dist/components/endpoint-badge.js +29 -0
  8. package/dist/components/endpoint-badge.js.map +1 -0
  9. package/dist/components/endpoint-item.d.ts +11 -0
  10. package/dist/components/endpoint-item.d.ts.map +1 -0
  11. package/dist/components/endpoint-item.js +5 -0
  12. package/dist/components/endpoint-item.js.map +1 -0
  13. package/dist/components/endpoint-path-preview.d.ts +8 -0
  14. package/dist/components/endpoint-path-preview.d.ts.map +1 -0
  15. package/dist/components/endpoint-path-preview.js +22 -0
  16. package/dist/components/endpoint-path-preview.js.map +1 -0
  17. package/dist/components/endpoint-path.d.ts +8 -0
  18. package/dist/components/endpoint-path.d.ts.map +1 -0
  19. package/dist/components/endpoint-path.js +26 -0
  20. package/dist/components/endpoint-path.js.map +1 -0
  21. package/dist/components/endpoints-search.d.ts +8 -0
  22. package/dist/components/endpoints-search.d.ts.map +1 -0
  23. package/dist/components/endpoints-search.js +10 -0
  24. package/dist/components/endpoints-search.js.map +1 -0
  25. package/dist/components/flow-group.d.ts +15 -0
  26. package/dist/components/flow-group.d.ts.map +1 -0
  27. package/dist/components/flow-group.js +13 -0
  28. package/dist/components/flow-group.js.map +1 -0
  29. package/dist/{json-editor.d.ts → components/json-editor.d.ts} +0 -1
  30. package/dist/components/json-editor.d.ts.map +1 -0
  31. package/dist/components/json-editor.js +68 -0
  32. package/dist/components/json-editor.js.map +1 -0
  33. package/dist/endpoints-page.d.ts.map +1 -1
  34. package/dist/endpoints-page.js +24 -10
  35. package/dist/endpoints-page.js.map +1 -1
  36. package/dist/hooks/use-endpoint-configuration.d.ts +78 -0
  37. package/dist/hooks/use-endpoint-configuration.d.ts.map +1 -0
  38. package/dist/hooks/use-endpoint-configuration.js +130 -0
  39. package/dist/hooks/use-endpoint-configuration.js.map +1 -0
  40. package/dist/hooks/use-get-endpoints.d.ts +4 -1
  41. package/dist/hooks/use-get-endpoints.d.ts.map +1 -1
  42. package/dist/hooks/use-get-endpoints.js +15 -1
  43. package/dist/hooks/use-get-endpoints.js.map +1 -1
  44. package/dist/hooks/use-json-schema-to-json.d.ts.map +1 -1
  45. package/dist/hooks/use-json-schema-to-json.js.map +1 -1
  46. package/dist/hooks/use-path-url.d.ts +2 -0
  47. package/dist/hooks/use-path-url.d.ts.map +1 -0
  48. package/dist/hooks/use-path-url.js +15 -0
  49. package/dist/hooks/use-path-url.js.map +1 -0
  50. package/dist/play/reponse-code/utils.d.ts +2 -0
  51. package/dist/play/reponse-code/utils.d.ts.map +1 -0
  52. package/dist/play/reponse-code/utils.js +73 -0
  53. package/dist/play/reponse-code/utils.js.map +1 -0
  54. package/dist/play/response-code.d.ts +7 -0
  55. package/dist/play/response-code.d.ts.map +1 -0
  56. package/dist/play/response-code.js +11 -0
  57. package/dist/play/response-code.js.map +1 -0
  58. package/dist/play/side-panel-body-tab.d.ts +7 -0
  59. package/dist/play/side-panel-body-tab.d.ts.map +1 -0
  60. package/dist/play/side-panel-body-tab.js +24 -0
  61. package/dist/play/side-panel-body-tab.js.map +1 -0
  62. package/dist/play/side-panel-headers-tab.d.ts +2 -0
  63. package/dist/play/side-panel-headers-tab.d.ts.map +1 -0
  64. package/dist/play/side-panel-headers-tab.js +26 -0
  65. package/dist/play/side-panel-headers-tab.js.map +1 -0
  66. package/dist/play/side-panel-params-tab.d.ts +6 -0
  67. package/dist/play/side-panel-params-tab.d.ts.map +1 -0
  68. package/dist/play/side-panel-params-tab.js +39 -0
  69. package/dist/play/side-panel-params-tab.js.map +1 -0
  70. package/dist/play/side-panel-response.d.ts +2 -0
  71. package/dist/play/side-panel-response.d.ts.map +1 -0
  72. package/dist/play/side-panel-response.js +21 -0
  73. package/dist/play/side-panel-response.js.map +1 -0
  74. package/dist/play/side-panel.d.ts +9 -0
  75. package/dist/play/side-panel.d.ts.map +1 -0
  76. package/dist/play/side-panel.js +25 -0
  77. package/dist/play/side-panel.js.map +1 -0
  78. package/dist/play/trigger-button.d.ts +7 -0
  79. package/dist/play/trigger-button.d.ts.map +1 -0
  80. package/dist/play/trigger-button.js +40 -0
  81. package/dist/play/trigger-button.js.map +1 -0
  82. package/dist/{endpoint-body-panel.d.ts → spec/spec-body-panel.d.ts} +2 -4
  83. package/dist/spec/spec-body-panel.d.ts.map +1 -0
  84. package/dist/spec/spec-body-panel.js +13 -0
  85. package/dist/spec/spec-body-panel.js.map +1 -0
  86. package/dist/spec/spec-path-params-panel.d.ts +8 -0
  87. package/dist/spec/spec-path-params-panel.d.ts.map +1 -0
  88. package/dist/spec/spec-path-params-panel.js +11 -0
  89. package/dist/spec/spec-path-params-panel.js.map +1 -0
  90. package/dist/spec/spec-query-params-panel.d.ts +8 -0
  91. package/dist/spec/spec-query-params-panel.d.ts.map +1 -0
  92. package/dist/spec/spec-query-params-panel.js +10 -0
  93. package/dist/spec/spec-query-params-panel.js.map +1 -0
  94. package/dist/{endpoint-response-schema.d.ts → spec/spec-response-schema.d.ts} +1 -1
  95. package/dist/spec/spec-response-schema.d.ts.map +1 -0
  96. package/dist/{endpoint-response-schema.js → spec/spec-response-schema.js} +3 -4
  97. package/dist/spec/spec-response-schema.js.map +1 -0
  98. package/dist/spec/spec-side-panel.d.ts +9 -0
  99. package/dist/spec/spec-side-panel.d.ts.map +1 -0
  100. package/dist/spec/spec-side-panel.js +22 -0
  101. package/dist/spec/spec-side-panel.js.map +1 -0
  102. package/dist/styles.css +713 -74
  103. package/dist/types/endpoint.d.ts +1 -0
  104. package/dist/types/endpoint.d.ts.map +1 -1
  105. package/package.json +3 -4
  106. package/dist/endpoint-badge.d.ts +0 -11
  107. package/dist/endpoint-badge.d.ts.map +0 -1
  108. package/dist/endpoint-badge.js +0 -23
  109. package/dist/endpoint-badge.js.map +0 -1
  110. package/dist/endpoint-body-panel.d.ts.map +0 -1
  111. package/dist/endpoint-body-panel.js +0 -17
  112. package/dist/endpoint-body-panel.js.map +0 -1
  113. package/dist/endpoint-call.d.ts +0 -8
  114. package/dist/endpoint-call.d.ts.map +0 -1
  115. package/dist/endpoint-call.js +0 -59
  116. package/dist/endpoint-call.js.map +0 -1
  117. package/dist/endpoint-description.d.ts +0 -8
  118. package/dist/endpoint-description.d.ts.map +0 -1
  119. package/dist/endpoint-description.js +0 -14
  120. package/dist/endpoint-description.js.map +0 -1
  121. package/dist/endpoint-path-params-panel.d.ts +0 -9
  122. package/dist/endpoint-path-params-panel.d.ts.map +0 -1
  123. package/dist/endpoint-path-params-panel.js +0 -18
  124. package/dist/endpoint-path-params-panel.js.map +0 -1
  125. package/dist/endpoint-query-params-panel.d.ts +0 -9
  126. package/dist/endpoint-query-params-panel.d.ts.map +0 -1
  127. package/dist/endpoint-query-params-panel.js +0 -17
  128. package/dist/endpoint-query-params-panel.js.map +0 -1
  129. package/dist/endpoint-response-schema.d.ts.map +0 -1
  130. package/dist/endpoint-response-schema.js.map +0 -1
  131. package/dist/endpoint-response.d.ts +0 -9
  132. package/dist/endpoint-response.d.ts.map +0 -1
  133. package/dist/endpoint-response.js +0 -51
  134. package/dist/endpoint-response.js.map +0 -1
  135. package/dist/endpoint-side-panel.d.ts +0 -9
  136. package/dist/endpoint-side-panel.d.ts.map +0 -1
  137. package/dist/endpoint-side-panel.js +0 -26
  138. package/dist/endpoint-side-panel.js.map +0 -1
  139. package/dist/hooks/use-global-store.d.ts +0 -27
  140. package/dist/hooks/use-global-store.d.ts.map +0 -1
  141. package/dist/hooks/use-global-store.js +0 -21
  142. package/dist/hooks/use-global-store.js.map +0 -1
  143. package/dist/json-editor.d.ts.map +0 -1
  144. package/dist/json-editor.js +0 -36
  145. package/dist/json-editor.js.map +0 -1
  146. package/dist/response-body.d.ts +0 -8
  147. package/dist/response-body.d.ts.map +0 -1
  148. package/dist/response-body.js +0 -7
  149. package/dist/response-body.js.map +0 -1
  150. package/dist/stores/use-global-store.d.ts +0 -27
  151. package/dist/stores/use-global-store.d.ts.map +0 -1
  152. package/dist/stores/use-global-store.js +0 -21
  153. package/dist/stores/use-global-store.js.map +0 -1
  154. package/dist/stores/use-theme-store.d.ts +0 -19
  155. package/dist/stores/use-theme-store.d.ts.map +0 -1
  156. package/dist/stores/use-theme-store.js +0 -27
  157. package/dist/stores/use-theme-store.js.map +0 -1
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { ConfigurationLitItem } from '../hooks/use-endpoint-configuration';
3
+ interface ConfigurationListItemProps {
4
+ value: ConfigurationLitItem;
5
+ id: string;
6
+ onUpdate: (key: string, field: 'name' | 'value' | 'active', value: string | boolean) => void;
7
+ onRemove?: (key: string) => void;
8
+ required?: boolean;
9
+ }
10
+ export declare const ConfigurationListItem: FC<ConfigurationListItemProps>;
11
+ export {};
12
+ //# sourceMappingURL=configuration-list-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration-list-item.d.ts","sourceRoot":"","sources":["../../src/components/configuration-list-item.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAuC,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAE1E,UAAU,0BAA0B;IAClC,KAAK,EAAE,oBAAoB,CAAA;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,KAAK,IAAI,CAAA;IAC5F,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAmFhE,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Checkbox, cn, Input } from '@motiadev/ui';
3
+ import { AlertCircle, Check, Trash2 } from 'lucide-react';
4
+ import { memo, useCallback, useRef, useState } from 'react';
5
+ export const ConfigurationListItem = memo(({ value, id, onUpdate, onRemove, required = false }) => {
6
+ const [activeConfiguration, setActiveConfiguration] = useState(null);
7
+ const [valueToDelete, setValueToDelete] = useState(null);
8
+ const deleteTimeout = useRef(undefined);
9
+ const isActive = activeConfiguration === id;
10
+ const onDelete = useCallback((key) => {
11
+ clearTimeout(deleteTimeout.current);
12
+ setValueToDelete(key);
13
+ deleteTimeout.current = setTimeout(() => {
14
+ setValueToDelete(null);
15
+ }, 5000);
16
+ }, [setValueToDelete]);
17
+ const onMouseOver = useCallback(() => {
18
+ if (required)
19
+ return;
20
+ setActiveConfiguration(id);
21
+ }, [id, required]);
22
+ const onMouseLeave = useCallback(() => {
23
+ if (required)
24
+ return;
25
+ setActiveConfiguration(null);
26
+ }, [required]);
27
+ return (_jsxs("div", { className: cn('grid grid-cols-[auto_1fr_auto] items-center py-2 px-4 bg-muted/30 rounded-lg gap-2', isActive && 'bg-card'), onMouseOver: onMouseOver, onMouseLeave: onMouseLeave, children: [_jsx(Checkbox, { checked: value.active, onCheckedChange: (checked) => onUpdate(id, 'active', checked), disabled: required, children: _jsx(Check, { className: "h-3 w-3" }) }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(Input, { readOnly: required, disabled: !value.active, variant: required ? 'outlineReadonly' : 'outline', id: `name-${id}`, defaultValue: value.name, onBlur: (e) => onUpdate(id, 'name', e.target.value), placeholder: "Name", className: "h-8" }), _jsx(Input, { disabled: !value.active, variant: 'outline', id: `value-${id}`, defaultValue: value.value, onBlur: (e) => onUpdate(id, 'value', e.target.value), placeholder: "Value", className: "h-8" })] }), _jsx(Button, { variant: "ghost", size: "icon", onClick: () => {
28
+ if (valueToDelete === id) {
29
+ onRemove?.(id);
30
+ }
31
+ else {
32
+ onDelete(id);
33
+ }
34
+ }, className: cn('h-6 w-6 opacity-0 transition-opacity duration-200', isActive && 'opacity-100'), title: valueToDelete === id && isActive ? 'Click again to remove' : 'Remove', children: valueToDelete === id ? _jsx(AlertCircle, { className: "h-3 w-3 text-destructive" }) : _jsx(Trash2, { className: "h-3 w-3" }) })] }));
35
+ });
36
+ //# sourceMappingURL=configuration-list-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration-list-item.js","sourceRoot":"","sources":["../../src/components/configuration-list-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAM,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAW/D,MAAM,CAAC,MAAM,qBAAqB,GAAmC,IAAI,CACvE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,EAAE,EAAE;IACtD,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IACnF,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IACvE,MAAM,aAAa,GAAG,MAAM,CAA6B,SAAS,CAAC,CAAA;IACnE,MAAM,QAAQ,GAAG,mBAAmB,KAAK,EAAE,CAAA;IAE3C,MAAM,QAAQ,GAAG,WAAW,CAC1B,CAAC,GAAW,EAAE,EAA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 interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ variant: ApiRouteMethod;
5
+ }
6
+ export declare const EndpointBadge: React.MemoExoticComponent<({ className, variant, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element>;
7
+ export {};
8
+ //# sourceMappingURL=endpoint-badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-badge.d.ts","sourceRoot":"","sources":["../../src/components/endpoint-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAuBlD,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/D,OAAO,EAAE,cAAc,CAAA;CACxB;AAED,eAAO,MAAM,aAAa,+DAA2C,UAAU,6CAK7E,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '@motiadev/ui';
3
+ import { memo } from 'react';
4
+ const getMethodStyles = (method) => {
5
+ switch (method.toUpperCase()) {
6
+ case 'POST':
7
+ return 'bg-[#258DC3]/15 text-[#258DC3]';
8
+ case 'GET':
9
+ return 'bg-[#709A2D]/15 text-[#709A2D]';
10
+ case 'DELETE':
11
+ return 'bg-[#DE2134]/15 text-[#DE2134]';
12
+ case 'PUT':
13
+ return 'bg-[#B9922D]/15 text-[#B9922D]';
14
+ case 'PATCH':
15
+ return 'bg-[#B9922D]/15 text-[#B9922D]';
16
+ case 'HEAD':
17
+ return 'bg-[#E221DF]/15 text-[#E221DF]';
18
+ case 'OPTIONS':
19
+ return 'bg-[#B9922D]/15 text-[#B9922D]';
20
+ default:
21
+ return 'bg-[#258DC3]/15 text-[#258DC3]'; // default to GET
22
+ }
23
+ };
24
+ export const EndpointBadge = memo(({ className, variant, ...props }) => {
25
+ const baseClasses = 'rounded-lg px-2 py-0.5 text-xs font-mono font-bold transition-colors';
26
+ const methodClasses = getMethodStyles(variant);
27
+ return _jsx("div", { className: cn(baseClasses, methodClasses, className), ...props });
28
+ });
29
+ //# sourceMappingURL=endpoint-badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-badge.js","sourceRoot":"","sources":["../../src/components/endpoint-badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAG5B,MAAM,eAAe,GAAG,CAAC,MAAsB,EAAU,EAAE;IACzD,QAAQ,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;QAC7B,KAAK,MAAM;YACT,OAAO,gCAAgC,CAAA;QACzC,KAAK,KAAK;YACR,OAAO,gCAAgC,CAAA;QACzC,KAAK,QAAQ;YACX,OAAO,gCAAgC,CAAA;QACzC,KAAK,KAAK;YACR,OAAO,gCAAgC,CAAA;QACzC,KAAK,OAAO;YACV,OAAO,gCAAgC,CAAA;QACzC,KAAK,MAAM;YACT,OAAO,gCAAgC,CAAA;QACzC,KAAK,SAAS;YACZ,OAAO,gCAAgC,CAAA;QACzC;YACE,OAAO,gCAAgC,CAAA,CAAC,iBAAiB;IAC7D,CAAC;AACH,CAAC,CAAA;AAMD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAc,EAAE,EAAE;IACjF,MAAM,WAAW,GAAG,sEAAsE,CAAA;IAC1F,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAE9C,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAA;AACjF,CAAC,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { FC } from 'react';
2
+ import { ApiEndpoint } from '../types/endpoint';
3
+ type EndpointItemProps = {
4
+ endpoint: ApiEndpoint;
5
+ isSelected: boolean;
6
+ isLast: boolean;
7
+ onSelect: (id: string) => void;
8
+ };
9
+ export declare const EndpointItem: FC<EndpointItemProps>;
10
+ export {};
11
+ //# sourceMappingURL=endpoint-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-item.d.ts","sourceRoot":"","sources":["../../src/components/endpoint-item.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/C,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,WAAW,CAAA;IACrB,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAgC9C,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '@motiadev/ui';
3
+ import { EndpointPath } from './endpoint-path';
4
+ export const EndpointItem = ({ endpoint, isSelected, isLast, onSelect }) => (_jsxs("div", { "data-testid": `endpoint-${endpoint.method}-${endpoint.path}`, onClick: () => onSelect(endpoint.id), className: cn('grid grid-cols-[auto_1fr] items-center justify-center px-[17px] select-none hover:bg-muted-foreground/10 cursor-pointer', isSelected && 'bg-muted-foreground/10'), children: [isLast ? (_jsx("svg", { width: "14", height: "34", viewBox: "0 0 12 34", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M6.5 16.5C6.50006 19.2614 8.7386 21.4999 11.5 21.5C11.7759 21.5003 12 21.724 12 22C12 22.276 11.7759 22.4997 11.5 22.5C8.18632 22.4999 5.50006 19.8137 5.5 16.5V0H6.5V16.5Z", className: "fill-[#555]" }) })) : (_jsx("svg", { width: "14", height: "34", viewBox: "0 0 12 34", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M6.5 0V11.5C6.50007 14.2614 8.73861 16.4999 11.5 16.5C11.7759 16.5003 12 16.724 12 17C12 17.276 11.7759 17.4997 11.5 17.5C9.41273 17.5 7.57486 16.4335 6.5 14.8164V34H5.5V0H6.5Z", className: "fill-[#555]" }) })), _jsx("div", { children: _jsxs("div", { className: "grid grid-cols-[auto_1fr] items-center gap-3 px-2", children: [_jsx(EndpointPath, { method: endpoint.method, path: endpoint.path }), _jsx("span", { className: "text-sm text-muted-foreground truncate", children: endpoint.description })] }) })] }));
5
+ //# sourceMappingURL=endpoint-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-item.js","sourceRoot":"","sources":["../../src/components/endpoint-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAS9C,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACjG,8BACe,YAAY,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,EAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,EACpC,SAAS,EAAE,EAAE,CACX,yHAAyH,EACzH,UAAU,IAAI,wBAAwB,CACvC,aAEA,MAAM,CAAC,CAAC,CAAC,CACR,cAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,YAC5F,eACE,CAAC,EAAC,6KAA6K,EAC/K,SAAS,EAAC,aAAa,GACvB,GACE,CACP,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,YAC5F,eACE,CAAC,EAAC,kLAAkL,EACpL,SAAS,EAAC,aAAa,GACvB,GACE,CACP,EAED,wBACE,eAAK,SAAS,EAAC,mDAAmD,aAChE,KAAC,YAAY,IAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAI,EAC9D,eAAM,SAAS,EAAC,wCAAwC,YAAE,QAAQ,CAAC,WAAW,GAAQ,IAClF,GACF,IACF,CACP,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ interface EndpointPathPreviewProps {
3
+ path: string;
4
+ baseUrl?: string;
5
+ }
6
+ export declare const EndpointPathPreview: FC<EndpointPathPreviewProps>;
7
+ export {};
8
+ //# sourceMappingURL=endpoint-path-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-path-preview.d.ts","sourceRoot":"","sources":["../../src/components/endpoint-path-preview.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAA;AAGpC,UAAU,wBAAwB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAyC5D,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, cn } from '@motiadev/ui';
3
+ import { Check, Copy } from 'lucide-react';
4
+ import { useState } from 'react';
5
+ import { usePathUrl } from '../hooks/use-path-url';
6
+ export const EndpointPathPreview = ({ path, baseUrl = window.location.origin }) => {
7
+ const pathUrl = usePathUrl(path);
8
+ const fullUrl = `${baseUrl}${pathUrl}`;
9
+ const [copied, setCopied] = useState(false);
10
+ const handleCopy = async () => {
11
+ try {
12
+ await navigator.clipboard.writeText(fullUrl);
13
+ setCopied(true);
14
+ setTimeout(() => setCopied(false), 2000);
15
+ }
16
+ catch (err) {
17
+ console.error('Failed to copy URL:', err);
18
+ }
19
+ };
20
+ return (_jsxs("div", { className: "grid grid-cols-[auto_1fr] items-center gap-5 px-5 relative border-b border-border", children: [_jsx("div", { className: "text-sm font-medium py-2", children: "URL Preview" }), _jsxs("div", { className: "bg-muted-foreground/10 box-border grid grid-cols-[1fr_auto] gap-1 h-6 items-center px-2 py-1 rounded border border-border", children: [_jsx("div", { className: "min-w-0", children: _jsx("div", { className: "font-medium text-xs text-muted-foreground truncate", title: fullUrl, children: fullUrl }) }), _jsx(Button, { onClick: handleCopy, className: cn('w-3 h-3 grid place-items-center transition-colors cursor-pointer', copied ? 'text-green-400' : 'text-muted-foreground'), variant: "icon", size: "small", "aria-label": "Copy URL", children: copied ? _jsx(Check, { className: "w-2.5 h-2.5" }) : _jsx(Copy, { className: "w-2.5 h-2.5" }) })] })] }));
21
+ };
22
+ //# sourceMappingURL=endpoint-path-preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-path-preview.js","sourceRoot":"","sources":["../../src/components/endpoint-path-preview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAOlD,MAAM,CAAC,MAAM,mBAAmB,GAAiC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE;IAC9G,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;IAChC,MAAM,OAAO,GAAG,GAAG,OAAO,GAAG,OAAO,EAAE,CAAA;IACtC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE3C,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;QAC5B,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YAC5C,SAAS,CAAC,IAAI,CAAC,CAAA;YACf,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC,CAAA;IAED,OAAO,CACL,eAAK,SAAS,EAAC,mFAAmF,aAChG,cAAK,SAAS,EAAC,0BAA0B,4BAAkB,EAE3D,eAAK,SAAS,EAAC,2HAA2H,aACxI,cAAK,SAAS,EAAC,SAAS,YACtB,cAAK,SAAS,EAAC,oDAAoD,EAAC,KAAK,EAAE,OAAO,YAC/E,OAAO,GACJ,GACF,EAEN,KAAC,MAAM,IACL,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,EAAE,CACX,kEAAkE,EAClE,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,uBAAuB,CACpD,EACD,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,OAAO,gBACD,UAAU,YAEpB,MAAM,CAAC,CAAC,CAAC,KAAC,KAAK,IAAC,SAAS,EAAC,aAAa,GAAG,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,GAAG,GACvE,IACL,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ interface EndpointPathProps {
3
+ method: string;
4
+ path: string;
5
+ }
6
+ export declare const EndpointPath: FC<EndpointPathProps>;
7
+ export {};
8
+ //# sourceMappingURL=endpoint-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-path.d.ts","sourceRoot":"","sources":["../../src/components/endpoint-path.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAA;AAInC,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb;AAMD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAiC9C,CAAA"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { EndpointBadge } from './endpoint-badge';
4
+ const PathSeparator = () => {
5
+ return _jsx("div", { className: "text-muted-foreground", children: "/" });
6
+ };
7
+ export const EndpointPath = ({ method, path }) => {
8
+ const pathView = useMemo(() => {
9
+ const parts = path.split('/').filter(Boolean);
10
+ const partsLength = parts.length - 1;
11
+ return parts.flatMap((part, index) => {
12
+ const isLast = index === partsLength;
13
+ const key = `part-${part}-${index}`;
14
+ const separator = isLast ? undefined : _jsx(PathSeparator, {}, `separator-${key}`);
15
+ if (part.startsWith(':')) {
16
+ return [
17
+ _jsx("div", { className: "bg-[#2862FE]/20 text-[#2862FE] rounded-sm px-1 py-0.5 text-sm font-mono font-bold font-medium", children: part }, key),
18
+ separator,
19
+ ];
20
+ }
21
+ return [_jsx("div", { children: part }, key), separator];
22
+ });
23
+ }, [path]);
24
+ return (_jsxs("div", { className: "grid grid-cols-[auto_1fr] gap-2 items-center", children: [_jsx(EndpointBadge, { variant: method, children: method }), _jsxs("span", { className: "font-mono font-bold whitespace-nowrap flex flex-row gap-2 items-center truncate", children: [_jsx(PathSeparator, {}), pathView] })] }));
25
+ };
26
+ //# sourceMappingURL=endpoint-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-path.js","sourceRoot":"","sources":["../../src/components/endpoint-path.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAA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a,KAAG,EAChB,QAAQ,IACJ,IACH,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ type EndpointsSearchProps = {
2
+ value: string;
3
+ onChange: (value: string) => void;
4
+ onClear: () => void;
5
+ };
6
+ export declare const EndpointsSearch: ({ value, onChange, onClear }: EndpointsSearchProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=endpoints-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints-search.d.ts","sourceRoot":"","sources":["../../src/components/endpoints-search.tsx"],"names":[],"mappings":"AAGA,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,8BAA8B,oBAAoB,4CAyBjF,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn, Input } from '@motiadev/ui';
3
+ import { Search, X } from 'lucide-react';
4
+ export const EndpointsSearch = ({ value, onChange, onClear }) => {
5
+ return (_jsx("div", { className: "p-2 border-b gap-4", "data-testid": "endpoints-search-container", children: _jsxs("div", { className: "relative", children: [_jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }), _jsx(Input, { variant: "shade", value: value, onChange: (e) => onChange(e.target.value), className: "px-9 font-medium", placeholder: "Search by Method or Path" }), _jsx(X, { className: cn('cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground', {
6
+ visible: value !== '',
7
+ invisible: value === '',
8
+ }), onClick: onClear })] }) }));
9
+ };
10
+ //# sourceMappingURL=endpoints-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints-search.js","sourceRoot":"","sources":["../../src/components/endpoints-search.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAQxC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAwB,EAAE,EAAE;IACpF,OAAO,CACL,cAAK,SAAS,EAAC,oBAAoB,iBAAa,4BAA4B,YAC1E,eAAK,SAAS,EAAC,UAAU,aACvB,KAAC,MAAM,IAAC,SAAS,EAAC,2EAA2E,GAAG,EAChG,KAAC,KAAK,IACJ,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,SAAS,EAAC,kBAAkB,EAC5B,WAAW,EAAC,0BAA0B,GACtC,EACF,KAAC,CAAC,IACA,SAAS,EAAE,EAAE,CACX,uHAAuH,EACvH;wBACE,OAAO,EAAE,KAAK,KAAK,EAAE;wBACrB,SAAS,EAAE,KAAK,KAAK,EAAE;qBACxB,CACF,EACD,OAAO,EAAE,OAAO,GAChB,IACE,GACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { FC } from 'react';
2
+ import { ApiEndpoint } from '../types/endpoint';
3
+ type FlowGroupProps = {
4
+ flow: string;
5
+ endpoints: ApiEndpoint[];
6
+ isOpen: boolean;
7
+ isSelected: boolean;
8
+ onToggle: (flow: string) => void;
9
+ onClearSelection: () => void;
10
+ selectedEndpointId?: string;
11
+ onSelectEndpoint: (id: string) => void;
12
+ };
13
+ export declare const FlowGroup: FC<FlowGroupProps>;
14
+ export {};
15
+ //# sourceMappingURL=flow-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-group.d.ts","sourceRoot":"","sources":["../../src/components/flow-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/C,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,WAAW,EAAE,CAAA;IACxB,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAyDxC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '@motiadev/ui';
3
+ import { ChevronDown } from 'lucide-react';
4
+ import { EndpointItem } from './endpoint-item';
5
+ export const FlowGroup = ({ flow, endpoints, isOpen, isSelected, onToggle, onClearSelection, selectedEndpointId, onSelectEndpoint, }) => {
6
+ return (_jsxs("div", { className: "pt-2", children: [_jsxs("button", { "data-testid": `flow-group-${flow}`, className: "w-full grid grid-cols-[auto_1fr] items-center gap-3 hover:bg-muted/40 cursor-pointer min-h-8.5 select-none hover:bg-muted-foreground/10 px-4", onClick: () => {
7
+ if (isSelected) {
8
+ onClearSelection();
9
+ }
10
+ onToggle(flow);
11
+ }, children: [_jsxs("div", { className: "grid grid-cols-1", children: [_jsx(ChevronDown, { className: cn('w-4 h-4 transition-transform duration-300 text-[#555]', { 'rotate-180 mt-2.5': isOpen }), strokeWidth: 1.5 }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "2", height: "10", viewBox: "0 0 2 10", fill: "none", className: cn('ml-[7px]', { hidden: !isOpen }), children: _jsx("path", { d: "M1.5 1C1.5 0.723858 1.27614 0.5 1 0.5C0.723858 0.5 0.5 0.723858 0.5 1H1H1.5ZM1 1H0.5V10H1H1.5V1H1Z", className: "fill-[#555]" }) })] }), _jsx("h3", { className: "text-sm font-medium text-left", children: flow })] }), _jsx("div", { className: cn('grid grid-cols-1 items-center justify-center', { hidden: !isOpen }), children: endpoints.map((endpoint, index) => (_jsx(EndpointItem, { endpoint: endpoint, isSelected: selectedEndpointId === endpoint.id, isLast: index === endpoints.length - 1, onSelect: onSelectEndpoint }, endpoint.id))) })] }));
12
+ };
13
+ //# sourceMappingURL=flow-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-group.js","sourceRoot":"","sources":["../../src/components/flow-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAa9C,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,EAC5C,IAAI,EACJ,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACD,EAAE,EAAE;IACnB,OAAO,CACL,eAAK,SAAS,EAAC,MAAM,aACnB,iCACe,cAAc,IAAI,EAAE,EACjC,SAAS,EAAC,8IAA8I,EACxJ,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,UAAU,EAAE,CAAC;wBACf,gBAAgB,EAAE,CAAA;oBACpB,CAAC;oBACD,QAAQ,CAAC,IAAI,CAAC,CAAA;gBAChB,CAAC,aAED,eAAK,SAAS,EAAC,kBAAkB,aAC/B,KAAC,WAAW,IACV,SAAS,EAAE,EAAE,CAAC,uDAAuD,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,CAAC,EACvG,WAAW,EAAE,GAAG,GAChB,EACF,cACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,YAE9C,eACE,CAAC,EAAC,oGAAoG,EACtG,SAAS,EAAC,aAAa,GACvB,GACE,IACF,EACN,aAAI,SAAS,EAAC,+BAA+B,YAAE,IAAI,GAAM,IAClD,EAET,cAAK,SAAS,EAAE,EAAE,CAAC,8CAA8C,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,YACpF,SAAS,CAAC,GAAG,CAAC,CAAC,QAAqB,EAAE,KAAa,EAAE,EAAE,CAAC,CACvD,KAAC,YAAY,IAEX,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,kBAAkB,KAAK,QAAQ,CAAC,EAAE,EAC9C,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,MAAM,GAAG,CAAC,EACtC,QAAQ,EAAE,gBAAgB,IAJrB,QAAQ,CAAC,EAAE,CAKhB,CACH,CAAC,GACE,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  type JsonEditorProps = {
3
3
  value: string;
4
- height?: number | string;
5
4
  schema?: Record<string, unknown>;
6
5
  onChange?: (value: string) => void;
7
6
  onValidate?: (isValid: boolean) => void;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-editor.d.ts","sourceRoot":"","sources":["../../src/components/json-editor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAA;AAE9C,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACvC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAoF1C,CAAA"}
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useThemeStore } from '@motiadev/ui';
3
+ import { Editor, useMonaco } from '@monaco-editor/react';
4
+ import { useEffect, useMemo } from 'react';
5
+ export const JsonEditor = ({ value, schema, onChange, onValidate, language = 'json', readOnly = false, }) => {
6
+ const monaco = useMonaco();
7
+ const theme = useThemeStore((state) => state.theme);
8
+ const editorTheme = useMemo(() => (theme === 'dark' ? 'transparent-dark' : 'transparent-light'), [theme]);
9
+ useEffect(() => {
10
+ if (!monaco)
11
+ return;
12
+ monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ isolatedModules: true });
13
+ monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
14
+ schemas: schema
15
+ ? [
16
+ {
17
+ uri: window.location.href,
18
+ fileMatch: ['*'],
19
+ schema,
20
+ },
21
+ ]
22
+ : [],
23
+ });
24
+ monaco.editor.defineTheme('transparent-light', {
25
+ base: 'vs',
26
+ inherit: true,
27
+ rules: [],
28
+ colors: {
29
+ 'editor.background': '#00000000',
30
+ 'editor.lineHighlightBackground': '#00000000',
31
+ 'editorLineNumber.foreground': '#999999',
32
+ 'editorLineNumber.activeForeground': '#000000',
33
+ focusBorder: '#00000000',
34
+ 'widget.border': '#00000000',
35
+ 'editor.border': '#00000000',
36
+ 'editorWidget.border': '#00000000',
37
+ },
38
+ });
39
+ monaco.editor.defineTheme('transparent-dark', {
40
+ base: 'vs-dark',
41
+ inherit: true,
42
+ rules: [],
43
+ colors: {
44
+ 'editor.background': '#00000000',
45
+ 'editor.lineHighlightBackground': '#00000000',
46
+ 'editorLineNumber.foreground': '#666666',
47
+ 'editorLineNumber.activeForeground': '#ffffff',
48
+ focusBorder: '#00000000',
49
+ 'widget.border': '#00000000',
50
+ 'editor.border': '#00000000',
51
+ 'editorWidget.border': '#00000000',
52
+ },
53
+ });
54
+ monaco.editor.setTheme(editorTheme);
55
+ }, [monaco, schema, editorTheme]);
56
+ return (_jsx(Editor, { "data-testid": "json-editor", language: language, value: value, theme: editorTheme, onChange: (value) => {
57
+ if (!value) {
58
+ onValidate?.(false);
59
+ }
60
+ onChange?.(value ?? '');
61
+ }, onValidate: (markers) => onValidate?.(markers.length === 0), options: {
62
+ readOnly,
63
+ scrollBeyondLastLine: false,
64
+ minimap: { enabled: false },
65
+ overviewRulerLanes: 0,
66
+ } }));
67
+ };
68
+ //# sourceMappingURL=json-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-editor.js","sourceRoot":"","sources":["../../src/components/json-editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAM,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAW9C,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,EAC9C,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,QAAQ,GAAG,MAAM,EACjB,QAAQ,GAAG,KAAK,GACjB,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,aAAa,CAAC,CAAC,KAAwB,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACtE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAAE,CAAC,KAAK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C,CAAA;QAEF,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;IACrC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAA;IAEjC,OAAO,CACL,KAAC,MAAM,mBACO,aAAa,EACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAyB,EAAE,EAAE;YACtC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,UAAU,EAAE,CAAC,KAAK,CAAC,CAAA;YACrB,CAAC;YACD,QAAQ,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;QACzB,CAAC,EACD,UAAU,EAAE,CAAC,OAAc,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,EAClE,OAAO,EAAE;YACP,QAAQ;YACR,oBAAoB,EAAE,KAAK;YAC3B,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;YAC3B,kBAAkB,EAAE,CAAC;SACtB,GACD,CACH,CAAA;AACH,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints-page.d.ts","sourceRoot":"","sources":["../src/endpoints-page.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,+CAiCzB,CAAA"}
1
+ {"version":3,"file":"endpoints-page.d.ts","sourceRoot":"","sources":["../src/endpoints-page.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa,+CAwDzB,CAAA"}
@@ -1,15 +1,29 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { EndpointBadge } from './endpoint-badge';
4
- import { EndpointSidePanel } from './endpoint-side-panel';
5
- import { useGetEndpoints } from './hooks/use-get-endpoints';
6
2
  import { cn } from '@motiadev/ui';
7
- import { useGlobalStore } from './hooks/use-global-store';
3
+ import { useCallback, useMemo, useState } from 'react';
4
+ import { EndpointsSearch } from './components/endpoints-search';
5
+ import { FlowGroup } from './components/flow-group';
6
+ import { useEndpointConfiguration } from './hooks/use-endpoint-configuration';
7
+ import { useGetEndpoints } from './hooks/use-get-endpoints';
8
+ import { SidePanel } from './play/side-panel';
8
9
  export const EndpointsPage = () => {
9
- const endpoints = useGetEndpoints();
10
- const selectedEndpointId = useGlobalStore((state) => state.selectedEndpointId);
11
- const selectEndpointId = useGlobalStore((state) => state.selectEndpointId);
12
- const selectedEndpoint = useMemo(() => selectedEndpointId && endpoints.find((endpoint) => endpoint.id === selectedEndpointId), [endpoints, selectedEndpointId]);
13
- return (_jsxs("div", { className: "flex flex-row", children: [_jsx("div", { className: "flex flex-col flex-1 overflow-y-auto", children: endpoints.map((endpoint) => (_jsx("div", { "data-testid": `endpoint-${endpoint.method}-${endpoint.path}`, className: cn(selectedEndpoint === endpoint && 'bg-muted-foreground/10', 'cursor-pointer select-none'), onClick: () => selectEndpointId(endpoint.id), children: _jsxs("div", { className: "flex flex-row gap-2 items-center hover:bg-muted-foreground/10 p-2", children: [_jsx(EndpointBadge, { variant: endpoint.method, children: endpoint.method.toUpperCase() }), _jsx("span", { className: "text-md font-mono font-bold whitespace-nowrap", children: endpoint.path }), _jsx("span", { className: "text-md text-muted-foreground truncate", children: endpoint.description })] }) }, `${endpoint.method} ${endpoint.path}`))) }), selectedEndpoint && (_jsx(EndpointSidePanel, { endpoint: selectedEndpoint, onClose: () => selectEndpointId(undefined) }))] }));
10
+ const { endpoints, groupedEndpoints } = useGetEndpoints();
11
+ const { selectedEndpointId, setSelectedEndpointId, toggleFlowGroupStatus, flowGroupStatus } = useEndpointConfiguration();
12
+ const selectedEndpoint = useMemo(() => endpoints.find((endpoint) => endpoint.id === selectedEndpointId), [endpoints, selectedEndpointId]);
13
+ const onClose = useCallback(() => {
14
+ setSelectedEndpointId('');
15
+ }, [setSelectedEndpointId]);
16
+ const [search, setSearch] = useState('');
17
+ const filteredEndpoints = useMemo(() => {
18
+ return Object.entries(groupedEndpoints).filter(([_, endpoints]) => {
19
+ return endpoints.some((endpoint) => endpoint.method?.toLowerCase().includes(search.toLowerCase()) ||
20
+ endpoint.path?.toLowerCase().includes(search.toLowerCase()));
21
+ });
22
+ }, [groupedEndpoints, search]);
23
+ return (_jsxs("div", { className: cn('grid h-full max-h-full', selectedEndpoint ? 'grid-cols-[300px_1fr] ' : 'grid-cols-1'), "data-testid": "endpoints-list", children: [_jsxs("div", { className: "grid grid-rows-[auto_1fr] h-full overflow-auto min-w-0", children: [_jsx(EndpointsSearch, { value: search, onChange: setSearch, onClear: () => setSearch('') }), _jsx("div", { className: "grid grid-cols-1 auto-rows-max overflow-auto min-w-0", children: filteredEndpoints.map(([flow, endpoints]) => {
24
+ const isSelected = endpoints.some((endpoint) => endpoint.id === selectedEndpointId);
25
+ const isOpen = !flowGroupStatus[flow] || isSelected || search !== '';
26
+ return (_jsx(FlowGroup, { flow: flow, endpoints: endpoints, isOpen: isOpen, isSelected: isSelected, onToggle: toggleFlowGroupStatus, onClearSelection: () => setSelectedEndpointId(''), selectedEndpointId: selectedEndpointId, onSelectEndpoint: setSelectedEndpointId }, flow));
27
+ }) })] }), selectedEndpoint && _jsx(SidePanel, { endpoint: selectedEndpoint, onClose: onClose })] }));
14
28
  };
15
29
  //# sourceMappingURL=endpoints-page.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints-page.js","sourceRoot":"","sources":["../src/endpoints-page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BA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AO,CACL,KAAC,SAAS,IAER,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAA0B,EACrC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,qBAAqB,EAC/B,gBAAgB,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC,EACjD,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,qBAAqB,IARlC,IAAI,CAST,CACH,CAAA;wBACH,CAAC,CAAC,GACE,IACF,EAEL,gBAAgB,IAAI,KAAC,SAAS,IAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAI,IAC5E,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,78 @@
1
+ export type ConfigurationLitItem = {
2
+ name: string;
3
+ value: string;
4
+ active: boolean;
5
+ };
6
+ export type Headers = {
7
+ [key: string]: ConfigurationLitItem;
8
+ };
9
+ export type Params = {
10
+ [key: string]: ConfigurationLitItem;
11
+ };
12
+ export type ResponseData = {
13
+ headers: Record<string, string>;
14
+ body: Record<string, any>;
15
+ statusCode: number;
16
+ executionTime: number;
17
+ };
18
+ type Actions = {
19
+ setResponse: (response: Response | undefined, startTime?: number) => void;
20
+ setHeaders: (headers: Headers) => void;
21
+ removeHeaders: (key: string) => void;
22
+ setBody: (body: string) => void;
23
+ setSelectedEndpointId: (selectedEndpointId: string | undefined) => void;
24
+ setQueryParams: (params: Params) => void;
25
+ removeQueryParams: (key: string) => void;
26
+ setPathParams: (pathParams: Params) => void;
27
+ removePathParams: (key: string) => void;
28
+ setBodyIsValid: (bodyIsValid: boolean) => void;
29
+ toggleFlowGroupStatus: (flow: string) => void;
30
+ };
31
+ type State = {
32
+ selectedEndpointId: string;
33
+ headers: Record<string, Headers>;
34
+ body: Record<string, string>;
35
+ bodyIsValid: Record<string, boolean>;
36
+ response: Record<string, ResponseData | undefined>;
37
+ queryParams: Record<string, Params>;
38
+ pathParams: Record<string, Params>;
39
+ flowGroupStatus: Record<string, boolean>;
40
+ };
41
+ export type UseEndpointConfiguration = State & Actions;
42
+ export declare const getHeadersSelector: (state: UseEndpointConfiguration) => Headers;
43
+ export declare const getBodyIsValidSelector: (state: UseEndpointConfiguration) => boolean;
44
+ export declare const getBodySelector: (state: UseEndpointConfiguration) => string;
45
+ export declare const getResponseSelector: (state: UseEndpointConfiguration) => ResponseData | undefined;
46
+ export declare const getQueryParamsSelector: (state: UseEndpointConfiguration) => Params;
47
+ export declare const getPathParamsSelector: (state: UseEndpointConfiguration) => Params;
48
+ export declare const useEndpointConfiguration: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<UseEndpointConfiguration>, "setState" | "persist"> & {
49
+ setState(partial: UseEndpointConfiguration | Partial<UseEndpointConfiguration> | ((state: UseEndpointConfiguration) => UseEndpointConfiguration | Partial<UseEndpointConfiguration>), replace?: false | undefined): unknown;
50
+ setState(state: UseEndpointConfiguration | ((state: UseEndpointConfiguration) => UseEndpointConfiguration), replace: true): unknown;
51
+ persist: {
52
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<UseEndpointConfiguration, unknown, unknown>>) => void;
53
+ clearStorage: () => void;
54
+ rehydrate: () => Promise<void> | void;
55
+ hasHydrated: () => boolean;
56
+ onHydrate: (fn: (state: UseEndpointConfiguration) => void) => () => void;
57
+ onFinishHydration: (fn: (state: UseEndpointConfiguration) => void) => () => void;
58
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<UseEndpointConfiguration, unknown, unknown>>;
59
+ };
60
+ }, "setState" | "devtools"> & {
61
+ setState(partial: UseEndpointConfiguration | Partial<UseEndpointConfiguration> | ((state: UseEndpointConfiguration) => UseEndpointConfiguration | Partial<UseEndpointConfiguration>), replace?: false | undefined, action?: (string | {
62
+ [x: string]: unknown;
63
+ [x: number]: unknown;
64
+ [x: symbol]: unknown;
65
+ type: string;
66
+ }) | undefined): unknown;
67
+ setState(state: UseEndpointConfiguration | ((state: UseEndpointConfiguration) => UseEndpointConfiguration), replace: true, action?: (string | {
68
+ [x: string]: unknown;
69
+ [x: number]: unknown;
70
+ [x: symbol]: unknown;
71
+ type: string;
72
+ }) | undefined): unknown;
73
+ devtools: {
74
+ cleanup: () => void;
75
+ };
76
+ }>;
77
+ export {};
78
+ //# sourceMappingURL=use-endpoint-configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-endpoint-configuration.d.ts","sourceRoot":"","sources":["../../src/hooks/use-endpoint-configuration.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAA;CACpC,CAAA;AAQD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACzE,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,qBAAqB,EAAE,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,KAAK,IAA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