@specverse/runtime 4.1.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.
- package/dist/runtime/views/core/entity-display.d.ts +31 -0
- package/dist/runtime/views/core/entity-display.d.ts.map +1 -0
- package/dist/runtime/views/core/entity-display.js +123 -0
- package/dist/runtime/views/core/entity-display.js.map +1 -0
- package/dist/runtime/views/core/field-classification.d.ts +65 -0
- package/dist/runtime/views/core/field-classification.d.ts.map +1 -0
- package/dist/runtime/views/core/field-classification.js +142 -0
- package/dist/runtime/views/core/field-classification.js.map +1 -0
- package/dist/runtime/views/core/index.d.ts +5 -0
- package/dist/runtime/views/core/index.d.ts.map +1 -0
- package/dist/runtime/views/core/index.js +5 -0
- package/dist/runtime/views/core/index.js.map +1 -0
- package/dist/runtime/views/core/pattern-engine.d.ts +54 -0
- package/dist/runtime/views/core/pattern-engine.d.ts.map +1 -0
- package/dist/runtime/views/core/pattern-engine.js +125 -0
- package/dist/runtime/views/core/pattern-engine.js.map +1 -0
- package/dist/runtime/views/core/types.d.ts +82 -0
- package/dist/runtime/views/core/types.d.ts.map +1 -0
- package/dist/runtime/views/core/types.js +10 -0
- package/dist/runtime/views/core/types.js.map +1 -0
- package/dist/runtime/views/index.d.ts +11 -0
- package/dist/runtime/views/index.d.ts.map +1 -0
- package/dist/runtime/views/index.js +11 -0
- package/dist/runtime/views/index.js.map +1 -0
- package/dist/runtime/views/react/components/DevShell.d.ts +26 -0
- package/dist/runtime/views/react/components/DevShell.d.ts.map +1 -0
- package/dist/runtime/views/react/components/DevShell.js +55 -0
- package/dist/runtime/views/react/components/DevShell.js.map +1 -0
- package/dist/runtime/views/react/components/ModelManager.d.ts +15 -0
- package/dist/runtime/views/react/components/ModelManager.d.ts.map +1 -0
- package/dist/runtime/views/react/components/ModelManager.js +182 -0
- package/dist/runtime/views/react/components/ModelManager.js.map +1 -0
- package/dist/runtime/views/react/components/ModelSelector.d.ts +13 -0
- package/dist/runtime/views/react/components/ModelSelector.d.ts.map +1 -0
- package/dist/runtime/views/react/components/ModelSelector.js +43 -0
- package/dist/runtime/views/react/components/ModelSelector.js.map +1 -0
- package/dist/runtime/views/react/components/RelationshipField.d.ts +20 -0
- package/dist/runtime/views/react/components/RelationshipField.d.ts.map +1 -0
- package/dist/runtime/views/react/components/RelationshipField.js +31 -0
- package/dist/runtime/views/react/components/RelationshipField.js.map +1 -0
- package/dist/runtime/views/react/components/RuntimeView.d.ts +20 -0
- package/dist/runtime/views/react/components/RuntimeView.d.ts.map +1 -0
- package/dist/runtime/views/react/components/RuntimeView.js +284 -0
- package/dist/runtime/views/react/components/RuntimeView.js.map +1 -0
- package/dist/runtime/views/react/components/ViewRouter.d.ts +22 -0
- package/dist/runtime/views/react/components/ViewRouter.d.ts.map +1 -0
- package/dist/runtime/views/react/components/ViewRouter.js +70 -0
- package/dist/runtime/views/react/components/ViewRouter.js.map +1 -0
- package/dist/runtime/views/react/components/ViewSidebar.d.ts +14 -0
- package/dist/runtime/views/react/components/ViewSidebar.d.ts.map +1 -0
- package/dist/runtime/views/react/components/ViewSidebar.js +11 -0
- package/dist/runtime/views/react/components/ViewSidebar.js.map +1 -0
- package/dist/runtime/views/react/components/ui/ResizeHandle.d.ts +13 -0
- package/dist/runtime/views/react/components/ui/ResizeHandle.d.ts.map +1 -0
- package/dist/runtime/views/react/components/ui/ResizeHandle.js +11 -0
- package/dist/runtime/views/react/components/ui/ResizeHandle.js.map +1 -0
- package/dist/runtime/views/react/context.d.ts +24 -0
- package/dist/runtime/views/react/context.d.ts.map +1 -0
- package/dist/runtime/views/react/context.js +32 -0
- package/dist/runtime/views/react/context.js.map +1 -0
- package/dist/runtime/views/react/hooks/useEntityHelpers.d.ts +25 -0
- package/dist/runtime/views/react/hooks/useEntityHelpers.d.ts.map +1 -0
- package/dist/runtime/views/react/hooks/useEntityHelpers.js +49 -0
- package/dist/runtime/views/react/hooks/useEntityHelpers.js.map +1 -0
- package/dist/runtime/views/react/hooks/useResizableSidebar.d.ts +18 -0
- package/dist/runtime/views/react/hooks/useResizableSidebar.d.ts.map +1 -0
- package/dist/runtime/views/react/hooks/useResizableSidebar.js +37 -0
- package/dist/runtime/views/react/hooks/useResizableSidebar.js.map +1 -0
- package/dist/runtime/views/react/hooks/useTheme.d.ts +15 -0
- package/dist/runtime/views/react/hooks/useTheme.d.ts.map +1 -0
- package/dist/runtime/views/react/hooks/useTheme.js +32 -0
- package/dist/runtime/views/react/hooks/useTheme.js.map +1 -0
- package/dist/runtime/views/react/index.d.ts +20 -0
- package/dist/runtime/views/react/index.d.ts.map +1 -0
- package/dist/runtime/views/react/index.js +23 -0
- package/dist/runtime/views/react/index.js.map +1 -0
- package/dist/runtime/views/tailwind/index.d.ts +8 -0
- package/dist/runtime/views/tailwind/index.d.ts.map +1 -0
- package/dist/runtime/views/tailwind/index.js +8 -0
- package/dist/runtime/views/tailwind/index.js.map +1 -0
- package/dist/runtime/views/tailwind/universal-adapter.d.ts +37 -0
- package/dist/runtime/views/tailwind/universal-adapter.d.ts.map +1 -0
- package/dist/runtime/views/tailwind/universal-adapter.js +616 -0
- package/dist/runtime/views/tailwind/universal-adapter.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useEntityHelpers — React hooks wrapping core field classification
|
|
3
|
+
*
|
|
4
|
+
* Uses RuntimeViewContext instead of instance-specific appStore.
|
|
5
|
+
*/
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { classifyFields, METADATA_FIELDS } from '../../core/field-classification.js';
|
|
8
|
+
import { getEntityDisplayName } from '../../core/entity-display.js';
|
|
9
|
+
import { useRuntimeContext } from '../context.js';
|
|
10
|
+
export { METADATA_FIELDS };
|
|
11
|
+
/**
|
|
12
|
+
* Hook to separate regular fields from metadata fields for table display.
|
|
13
|
+
*/
|
|
14
|
+
export function useFieldSeparation(attributes) {
|
|
15
|
+
return useMemo(() => classifyFields(attributes), [attributes]);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Hook to create a relationship resolver function.
|
|
19
|
+
* Uses entities from RuntimeViewProvider context.
|
|
20
|
+
*/
|
|
21
|
+
export function useRelationshipResolver() {
|
|
22
|
+
const { entities } = useRuntimeContext();
|
|
23
|
+
return useMemo(() => {
|
|
24
|
+
return (entity, relName, relDef) => {
|
|
25
|
+
if (!entities)
|
|
26
|
+
return '-';
|
|
27
|
+
const foreignKey = relDef.foreignKey || `${relName}Id`;
|
|
28
|
+
const fkValue = entity.data?.[foreignKey];
|
|
29
|
+
if (!fkValue)
|
|
30
|
+
return '-';
|
|
31
|
+
const targetModel = relDef.targetModel || relDef.model;
|
|
32
|
+
const targetEntities = entities[targetModel] || [];
|
|
33
|
+
const relatedEntity = targetEntities.find((e) => e.data?.id === fkValue || e.id === fkValue);
|
|
34
|
+
if (relatedEntity) {
|
|
35
|
+
return getEntityDisplayName(relatedEntity, entities);
|
|
36
|
+
}
|
|
37
|
+
return fkValue;
|
|
38
|
+
};
|
|
39
|
+
}, [entities]);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Combined hook for entity helpers.
|
|
43
|
+
*/
|
|
44
|
+
export function useEntityHelpers(attributes) {
|
|
45
|
+
const fieldSeparation = useFieldSeparation(attributes);
|
|
46
|
+
const resolveRelationship = useRelationshipResolver();
|
|
47
|
+
return { ...fieldSeparation, resolveRelationship };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=useEntityHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEntityHelpers.js","sourceRoot":"","sources":["../../../../../src/runtime/views/react/hooks/useEntityHelpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CA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AAM,UAAU,gBAAgB,CAAC,UAAmC;IAClE,MAAM,eAAe,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACvD,MAAM,mBAAmB,GAAG,uBAAuB,EAAE,CAAC;IACtD,OAAO,EAAE,GAAG,eAAe,EAAE,mBAAmB,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useResizableSidebar — Draggable Sidebar Width
|
|
3
|
+
*
|
|
4
|
+
* Provides resize-by-drag for sidebar panels.
|
|
5
|
+
*
|
|
6
|
+
* Will be fully populated from app-demo in Phase 4.
|
|
7
|
+
*/
|
|
8
|
+
export interface ResizableSidebarOptions {
|
|
9
|
+
defaultWidth?: number;
|
|
10
|
+
minWidth?: number;
|
|
11
|
+
maxWidth?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function useResizableSidebar(options?: ResizableSidebarOptions): {
|
|
14
|
+
width: number;
|
|
15
|
+
isResizing: boolean;
|
|
16
|
+
startResizing: () => void;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useResizableSidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizableSidebar.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/views/react/hooks/useResizableSidebar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,uBAA4B;;;;EAiCxE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useResizableSidebar — Draggable Sidebar Width
|
|
3
|
+
*
|
|
4
|
+
* Provides resize-by-drag for sidebar panels.
|
|
5
|
+
*
|
|
6
|
+
* Will be fully populated from app-demo in Phase 4.
|
|
7
|
+
*/
|
|
8
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
9
|
+
export function useResizableSidebar(options = {}) {
|
|
10
|
+
const { defaultWidth = 280, minWidth = 200, maxWidth = 600 } = options;
|
|
11
|
+
const [width, setWidth] = useState(defaultWidth);
|
|
12
|
+
const [isResizing, setIsResizing] = useState(false);
|
|
13
|
+
const startResizing = useCallback(() => {
|
|
14
|
+
setIsResizing(true);
|
|
15
|
+
}, []);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!isResizing)
|
|
18
|
+
return;
|
|
19
|
+
const handleMouseMove = (e) => {
|
|
20
|
+
const newWidth = Math.min(maxWidth, Math.max(minWidth, e.clientX));
|
|
21
|
+
setWidth(newWidth);
|
|
22
|
+
};
|
|
23
|
+
const handleMouseUp = () => {
|
|
24
|
+
setIsResizing(false);
|
|
25
|
+
document.body.style.cursor = '';
|
|
26
|
+
};
|
|
27
|
+
document.body.style.cursor = 'col-resize';
|
|
28
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
29
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
30
|
+
return () => {
|
|
31
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
32
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
33
|
+
};
|
|
34
|
+
}, [isResizing, minWidth, maxWidth]);
|
|
35
|
+
return { width, isResizing, startResizing };
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=useResizableSidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizableSidebar.js","sourceRoot":"","sources":["../../../../../src/runtime/views/react/hooks/useResizableSidebar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAQzD,MAAM,UAAU,mBAAmB,CAAC,UAAmC,EAAE;IACvE,MAAM,EAAE,YAAY,GAAG,GAAG,EAAE,QAAQ,GA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,CAAC,CAAC;IAErC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useTheme — Dark/Light Theme Toggle
|
|
3
|
+
*
|
|
4
|
+
* Persists theme preference to localStorage.
|
|
5
|
+
* Applies 'dark' class to <html> element for Tailwind dark mode.
|
|
6
|
+
*
|
|
7
|
+
* Will be populated from app-demo in Phase 4.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useTheme(): {
|
|
10
|
+
theme: "light" | "dark";
|
|
11
|
+
toggleTheme: () => void;
|
|
12
|
+
setTheme: (t: "light" | "dark") => void;
|
|
13
|
+
isDark: boolean;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/views/react/hooks/useTheme.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,wBAAgB,QAAQ;;;kBAiBD,OAAO,GAAG,MAAM;;EAItC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useTheme — Dark/Light Theme Toggle
|
|
3
|
+
*
|
|
4
|
+
* Persists theme preference to localStorage.
|
|
5
|
+
* Applies 'dark' class to <html> element for Tailwind dark mode.
|
|
6
|
+
*
|
|
7
|
+
* Will be populated from app-demo in Phase 4.
|
|
8
|
+
*/
|
|
9
|
+
import { useState, useEffect } from 'react';
|
|
10
|
+
const STORAGE_KEY = 'specverse-theme';
|
|
11
|
+
export function useTheme() {
|
|
12
|
+
const [theme, setThemeState] = useState(() => {
|
|
13
|
+
if (typeof window === 'undefined')
|
|
14
|
+
return 'dark';
|
|
15
|
+
return localStorage.getItem(STORAGE_KEY) || 'dark';
|
|
16
|
+
});
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const root = document.documentElement;
|
|
19
|
+
if (theme === 'dark') {
|
|
20
|
+
root.classList.add('dark');
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
root.classList.remove('dark');
|
|
24
|
+
}
|
|
25
|
+
localStorage.setItem(STORAGE_KEY, theme);
|
|
26
|
+
}, [theme]);
|
|
27
|
+
const toggleTheme = () => setThemeState((t) => (t === 'dark' ? 'light' : 'dark'));
|
|
28
|
+
const setTheme = (t) => setThemeState(t);
|
|
29
|
+
const isDark = theme === 'dark';
|
|
30
|
+
return { theme, toggleTheme, setTheme, isDark };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=useTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../../../../src/runtime/views/react/hooks/useTheme.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC,MAAM,UAAU,QAAQ;IACtB,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAmB,GAAG,EAAE;QAC7D,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,MAAM,CAAC;QACjD,OAAQ,YAAY,CAAC,OAAO,CAAC,WAAW,CAAsB,IAAI,MAAM,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;QACtC,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QACD,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,MAAM,QAAQ,GAAG,CAAC,CAAmB,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,KAAK,KAAK,MAAM,CAAC;IAEhC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @specverse/runtime/views/react
|
|
3
|
+
*
|
|
4
|
+
* React adapter for the SpecVerse view engine.
|
|
5
|
+
* Provides hooks, components, and the DevShell for rendering
|
|
6
|
+
* spec-driven and dev views in React applications.
|
|
7
|
+
*/
|
|
8
|
+
export { RuntimeViewProvider, useRuntimeContext, } from './context.js';
|
|
9
|
+
export { useTheme } from './hooks/useTheme.js';
|
|
10
|
+
export { useResizableSidebar } from './hooks/useResizableSidebar.js';
|
|
11
|
+
export { useEntityHelpers } from './hooks/useEntityHelpers.js';
|
|
12
|
+
export { RuntimeView } from './components/RuntimeView.js';
|
|
13
|
+
export { DevShell } from './components/DevShell.js';
|
|
14
|
+
export { ViewRouter } from './components/ViewRouter.js';
|
|
15
|
+
export { ViewSidebar } from './components/ViewSidebar.js';
|
|
16
|
+
export { ModelSelector } from './components/ModelSelector.js';
|
|
17
|
+
export { ModelManager } from './components/ModelManager.js';
|
|
18
|
+
export { RelationshipField } from './components/RelationshipField.js';
|
|
19
|
+
export { ResizeHandle } from './components/ui/ResizeHandle.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/views/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @specverse/runtime/views/react
|
|
3
|
+
*
|
|
4
|
+
* React adapter for the SpecVerse view engine.
|
|
5
|
+
* Provides hooks, components, and the DevShell for rendering
|
|
6
|
+
* spec-driven and dev views in React applications.
|
|
7
|
+
*/
|
|
8
|
+
// Context — connects runtime components to instance-specific data/hooks
|
|
9
|
+
export { RuntimeViewProvider, useRuntimeContext, } from './context.js';
|
|
10
|
+
// Hooks
|
|
11
|
+
export { useTheme } from './hooks/useTheme.js';
|
|
12
|
+
export { useResizableSidebar } from './hooks/useResizableSidebar.js';
|
|
13
|
+
export { useEntityHelpers } from './hooks/useEntityHelpers.js';
|
|
14
|
+
// Components
|
|
15
|
+
export { RuntimeView } from './components/RuntimeView.js';
|
|
16
|
+
export { DevShell } from './components/DevShell.js';
|
|
17
|
+
export { ViewRouter } from './components/ViewRouter.js';
|
|
18
|
+
export { ViewSidebar } from './components/ViewSidebar.js';
|
|
19
|
+
export { ModelSelector } from './components/ModelSelector.js';
|
|
20
|
+
export { ModelManager } from './components/ModelManager.js';
|
|
21
|
+
export { RelationshipField } from './components/RelationshipField.js';
|
|
22
|
+
export { ResizeHandle } from './components/ui/ResizeHandle.js';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtime/views/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wEAAwE;AACxE,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,QAAQ;AACR,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,aAAa;AACb,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @specverse/runtime/views/tailwind
|
|
3
|
+
*
|
|
4
|
+
* Universal Tailwind CSS adapter for rendering SpecVerse atomic
|
|
5
|
+
* components as Tailwind-styled HTML markup.
|
|
6
|
+
*/
|
|
7
|
+
export { createUniversalTailwindAdapter, type TailwindAdapterConfig, } from './universal-adapter.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/views/tailwind/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,8BAA8B,EAC9B,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @specverse/runtime/views/tailwind
|
|
3
|
+
*
|
|
4
|
+
* Universal Tailwind CSS adapter for rendering SpecVerse atomic
|
|
5
|
+
* components as Tailwind-styled HTML markup.
|
|
6
|
+
*/
|
|
7
|
+
export { createUniversalTailwindAdapter, } from './universal-adapter.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtime/views/tailwind/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,8BAA8B,GAE/B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universal Tailwind CSS Adapter
|
|
3
|
+
*
|
|
4
|
+
* Generates Tailwind-styled HTML markup for all 48 SpecVerse atomic
|
|
5
|
+
* component types plus composite/semantic types from inference.
|
|
6
|
+
*
|
|
7
|
+
* Framework-agnostic — produces HTML strings with Tailwind classes.
|
|
8
|
+
* Dark mode supported throughout via dark: prefix classes.
|
|
9
|
+
*
|
|
10
|
+
* Extracted from engines/instance-factories/applications/templates/react/tailwind-adapter-generator.ts
|
|
11
|
+
*/
|
|
12
|
+
export interface TailwindAdapterConfig {
|
|
13
|
+
/** Enable dark mode classes (default: true) */
|
|
14
|
+
darkMode?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface RenderContext {
|
|
17
|
+
properties?: Record<string, any>;
|
|
18
|
+
children?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Component adapter interface matching @specverse/types */
|
|
21
|
+
export interface ComponentAdapter {
|
|
22
|
+
name: string;
|
|
23
|
+
version: string;
|
|
24
|
+
description: string;
|
|
25
|
+
components: Record<string, {
|
|
26
|
+
render: (context: RenderContext) => string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a universal Tailwind adapter for all 48 atomic component types.
|
|
31
|
+
*
|
|
32
|
+
* Returns a ComponentAdapter that can render any registered component
|
|
33
|
+
* to Tailwind-styled HTML markup with dark mode support.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createUniversalTailwindAdapter(_config?: TailwindAdapterConfig): ComponentAdapter;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=universal-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"universal-adapter.d.ts","sourceRoot":"","sources":["../../../../src/runtime/views/tailwind/universal-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,aAAa;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5E;AAwpBD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,qBAA0B,GAAG,gBAAgB,CAiBpG"}
|