@autofictional/runtime 0.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/index.d.ts +21 -0
- package/dist/index.js +26 -0
- package/package.json +39 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
interface AutofictionalContextValue {
|
|
3
|
+
appId: string;
|
|
4
|
+
isInitialized: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const AutofictionalContext: React.Context<AutofictionalContextValue | null>;
|
|
7
|
+
export interface AutofictionalProviderProps {
|
|
8
|
+
appId: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* AutofictionalProvider - Runtime provider for autonomous sidebar adaptation
|
|
13
|
+
*
|
|
14
|
+
* NIGHT 1: Renders children without behavior (skeleton only)
|
|
15
|
+
*/
|
|
16
|
+
export declare function AutofictionalProvider({ appId, children }: AutofictionalProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Hook to access Autofictional context
|
|
19
|
+
*/
|
|
20
|
+
export declare function useAutofictional(): AutofictionalContextValue;
|
|
21
|
+
export { AutofictionalContext };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
const AutofictionalContext = createContext(null);
|
|
4
|
+
/**
|
|
5
|
+
* AutofictionalProvider - Runtime provider for autonomous sidebar adaptation
|
|
6
|
+
*
|
|
7
|
+
* NIGHT 1: Renders children without behavior (skeleton only)
|
|
8
|
+
*/
|
|
9
|
+
export function AutofictionalProvider({ appId, children }) {
|
|
10
|
+
const contextValue = {
|
|
11
|
+
appId,
|
|
12
|
+
isInitialized: true,
|
|
13
|
+
};
|
|
14
|
+
return (_jsx(AutofictionalContext.Provider, { value: contextValue, children: children }));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Hook to access Autofictional context
|
|
18
|
+
*/
|
|
19
|
+
export function useAutofictional() {
|
|
20
|
+
const context = useContext(AutofictionalContext);
|
|
21
|
+
if (!context) {
|
|
22
|
+
throw new Error('useAutofictional must be used within AutofictionalProvider');
|
|
23
|
+
}
|
|
24
|
+
return context;
|
|
25
|
+
}
|
|
26
|
+
export { AutofictionalContext };
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@autofictional/runtime",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Autofictional runtime provider for autonomous sidebar adaptation",
|
|
5
|
+
"author": "",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/andreamorales/autofictional.git",
|
|
12
|
+
"directory": "packages/runtime"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/andreamorales/autofictional#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/andreamorales/autofictional/issues"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"react": "^18.0.0",
|
|
28
|
+
"react-dom": "^18.0.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/react": "^18.2.0",
|
|
32
|
+
"@types/react-dom": "^18.2.0",
|
|
33
|
+
"typescript": "^5.0.0"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
|