@emeryld/rrroutes-openapi 2.5.6 → 2.5.7

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.
@@ -1,9 +1,16 @@
1
+ import { ReactNode } from 'react';
1
2
  import { PlaygroundInputs } from '../../stores/clientStore.js';
2
3
  import { PlaygroundRouteMeta } from '../../stores/playgroundStore.js';
3
4
  type EndpointPlaygroundProps = {
4
5
  initialRoute?: PlaygroundRouteMeta;
5
6
  initialLabel?: string;
6
7
  onOpenStandalone?: (inputs: PlaygroundInputs) => void;
8
+ renderLayout: (slots: {
9
+ topOverlay: ReactNode;
10
+ bottomOverlay: ReactNode | null;
11
+ content: ReactNode;
12
+ settingsButton: ReactNode;
13
+ }) => ReactNode;
7
14
  };
8
- export default function EndpointPlayground({ initialRoute, initialLabel, onOpenStandalone, }: EndpointPlaygroundProps): import("react/jsx-runtime").JSX.Element;
15
+ export default function EndpointPlayground({ initialRoute, initialLabel, onOpenStandalone, renderLayout, }: EndpointPlaygroundProps): import("react/jsx-runtime").JSX.Element;
9
16
  export {};
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ import { PlaygroundKeyValueRow } from '../../stores/playgroundStore.js';
3
+ type KeyValueEditorProps = {
4
+ title: string;
5
+ rows: PlaygroundKeyValueRow[];
6
+ onChange: (rows: PlaygroundKeyValueRow[]) => void;
7
+ actions?: ReactNode;
8
+ defaultExpanded?: boolean;
9
+ disableAccordion?: boolean;
10
+ summaryToggleButton?: ReactNode;
11
+ showFieldMeta?: boolean;
12
+ };
13
+ export default function KeyValueEditor({ title, rows, onChange, actions, defaultExpanded, disableAccordion, summaryToggleButton, showFieldMeta, }: KeyValueEditorProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -1,20 +1,19 @@
1
- import { PlaygroundInputs } from '../../stores/clientStore.js';
2
1
  import { PlaygroundKeyValueRow, PlaygroundTab } from '../../stores/playgroundStore.js';
3
2
  import { SerializableSchema } from '../../types/types.endpoint.js';
4
3
  import { type EndpointOption } from '../../utils/endpoints.js';
4
+ import type { PlaygroundRunnerResult } from './usePlaygroundRunner.js';
5
5
  type PlaygroundEditorProps = {
6
6
  tab: PlaygroundTab;
7
7
  onUpdateTab: (updater: (prev: PlaygroundTab) => PlaygroundTab) => void;
8
- onOpenStandalone?: (inputs: PlaygroundInputs) => void;
9
8
  endpointOptions: EndpointOption[];
10
9
  isOptionsLoading: boolean;
11
10
  onSearchChange: (term: string) => void;
12
11
  onEndpointSelect: (selection: EndpointOption | string | null) => void;
12
+ runner: PlaygroundRunnerResult | null;
13
13
  };
14
- export default function PlaygroundEditor({ tab, onUpdateTab, onOpenStandalone, endpointOptions, isOptionsLoading, onSearchChange, onEndpointSelect, }: PlaygroundEditorProps): import("react/jsx-runtime").JSX.Element;
14
+ export default function PlaygroundEditor({ tab, onUpdateTab, endpointOptions, isOptionsLoading, onSearchChange, onEndpointSelect, runner, }: PlaygroundEditorProps): import("react/jsx-runtime").JSX.Element;
15
15
  export declare function mergeRows(baseRows: PlaygroundKeyValueRow[], values?: Record<string, unknown>): PlaygroundKeyValueRow[];
16
16
  export declare function buildKeyValueRows(schema?: SerializableSchema): PlaygroundKeyValueRow[];
17
17
  export declare function rowsToRecord(rows: PlaygroundKeyValueRow[]): Record<string, string>;
18
18
  export declare function formatBodyValue(value: unknown, hasSchema: boolean): string;
19
- export declare function scaffoldBodyFromSchema(schema?: SerializableSchema): unknown;
20
19
  export {};
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { PlaygroundInputs } from '../../stores/clientStore.js';
3
+ import { PlaygroundTab } from '../../stores/playgroundStore.js';
4
+ type PlaygroundRunPanelProps = {
5
+ tab: PlaygroundTab;
6
+ isRunning: boolean;
7
+ onRun: () => void;
8
+ onOpenStandalone?: (inputs: PlaygroundInputs) => void;
9
+ runButtonSlot?: ReactNode;
10
+ };
11
+ export default function PlaygroundRunPanel({ tab, isRunning, onRun, onOpenStandalone, runButtonSlot, }: PlaygroundRunPanelProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { PlaygroundTab } from '../../stores/playgroundStore.js';
2
- type PlaygroundTabsProps = {
2
+ type PlaygroundTopTabsProps = {
3
3
  tabs: PlaygroundTab[];
4
4
  activeTabId: string | null;
5
5
  isLoading: boolean;
@@ -7,5 +7,5 @@ type PlaygroundTabsProps = {
7
7
  onAdd: () => void;
8
8
  onClose: (tabId: string) => void;
9
9
  };
10
- export default function PlaygroundTabs({ tabs, activeTabId, isLoading, onSelect, onAdd, onClose, }: PlaygroundTabsProps): import("react/jsx-runtime").JSX.Element;
10
+ export default function PlaygroundTopTabs({ tabs, activeTabId, isLoading, onSelect, onAdd, onClose, }: PlaygroundTopTabsProps): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -0,0 +1,8 @@
1
+ import { PlaygroundTab } from '../../stores/playgroundStore.js';
2
+ export type PlaygroundRunnerResult = {
3
+ isRunning: boolean;
4
+ bodyError: string | null;
5
+ setBodyError: (value: string | null) => void;
6
+ run: () => Promise<void>;
7
+ };
8
+ export declare function usePlaygroundRunner(tab: PlaygroundTab | null, onUpdateTab: (updater: (prev: PlaygroundTab) => PlaygroundTab) => void): PlaygroundRunnerResult;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ type PlaygroundOverlayLayoutProps = {
3
+ top?: ReactNode;
4
+ bottom?: ReactNode;
5
+ children: ReactNode;
6
+ };
7
+ /**
8
+ * Layout component that renders optional fixed overlays above and below
9
+ * the playground content. It measures overlay heights and applies equivalent
10
+ * padding so scrollable content never hides underneath them.
11
+ */
12
+ export default function PlaygroundOverlayLayout({ top, bottom, children, }: PlaygroundOverlayLayoutProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ type UseMeasuredElementResult<T extends HTMLElement> = {
2
+ ref: (node: T | null) => void;
3
+ height: number;
4
+ };
5
+ /**
6
+ * Observes an element with ResizeObserver and exposes its current height.
7
+ * Useful for aligning spacer padding with overlay content height.
8
+ */
9
+ export declare function useMeasuredElement<T extends HTMLElement>(): UseMeasuredElementResult<T>;
10
+ export {};
@@ -1,4 +1,4 @@
1
- import type { SocketEventType } from '../types/types.socket.js';
1
+ import type { SocketEventType } from '../../types/types.socket.js';
2
2
  type SocketEventDetailModalProps = {
3
3
  open: boolean;
4
4
  event: SocketEventType | null;
@@ -1,4 +1,4 @@
1
- import type { SocketEventType } from '../types/types.socket.js';
1
+ import type { SocketEventType } from '../../types/types.socket.js';
2
2
  type SocketEventsTableProps = {
3
3
  events: SocketEventType[];
4
4
  onSelect?: (event: SocketEventType, ordered: SocketEventType[]) => void;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import type { PlaygroundKeyValueRow } from './playgroundStore.js';
3
+ type PlaygroundSettingsContextValue = {
4
+ defaultHeaders: PlaygroundKeyValueRow[];
5
+ setDefaultHeaders: (rows: PlaygroundKeyValueRow[]) => void;
6
+ resetDefaultHeaders: () => void;
7
+ };
8
+ export declare function PlaygroundSettingsProvider({ children, }: {
9
+ children: ReactNode;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export declare function usePlaygroundSettings(): PlaygroundSettingsContextValue;
12
+ export {};
@@ -1,7 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  import type { MethodType } from '../types/types.base';
3
- import type { SerializableSchema } from '../types/types.endpoint';
3
+ import type { SerializableSchema, EndpointType } from '../types/types.endpoint';
4
4
  export type PlaygroundKeyValueRow = {
5
+ id: string;
5
6
  key: string;
6
7
  value: string;
7
8
  enabled: boolean;
@@ -35,6 +36,7 @@ export type PlaygroundRouteMeta = {
35
36
  path: string;
36
37
  summary?: string;
37
38
  contract?: PlaygroundRouteContract;
39
+ stability?: EndpointType['stability'];
38
40
  };
39
41
  export type PlaygroundTab = {
40
42
  id: string;
@@ -0,0 +1 @@
1
+ export declare function nowIso(): string;
@@ -0,0 +1,15 @@
1
+ import type { PlaygroundKeyValueRow } from '../stores/playgroundStore.js';
2
+ export declare function makeRowId(): string;
3
+ type CreateRowArgs = {
4
+ id?: string;
5
+ key?: string;
6
+ value?: string;
7
+ enabled?: boolean;
8
+ typeHint?: string;
9
+ description?: string;
10
+ };
11
+ export declare function createKeyValueRow({ id, key, value, enabled, typeHint, description, }?: CreateRowArgs): PlaygroundKeyValueRow;
12
+ export declare function cloneKeyValueRows(rows: PlaygroundKeyValueRow[], { preserveIds }?: {
13
+ preserveIds?: boolean;
14
+ }): PlaygroundKeyValueRow[];
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { PlaygroundKeyValueRow } from '../stores/playgroundStore.js';
2
+ import type { SerializableSchema } from '../types/types.endpoint.js';
3
+ export declare function describeSchemaType(schema?: SerializableSchema): string | undefined;
4
+ export declare function scaffoldBodyFromSchema(schema?: SerializableSchema): unknown;
5
+ export declare function scaffoldKeyValue(schema?: SerializableSchema): string;
6
+ export declare function fillRowDefaults(rows: PlaygroundKeyValueRow[], schema?: SerializableSchema): PlaygroundKeyValueRow[];
7
+ export declare function fillJsonDefaults(existing: unknown, schema?: SerializableSchema): unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/rrroutes-openapi",
3
- "version": "2.5.6",
3
+ "version": "2.5.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",