@thewhateverapp/tile-sdk 0.7.1 → 0.8.1
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/react/TileProvider.d.ts +2 -1
- package/dist/react/TileProvider.d.ts.map +1 -1
- package/dist/react/TileProvider.js +2 -2
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +2 -3
- package/dist/react/TileInitializer.d.ts +0 -25
- package/dist/react/TileInitializer.d.ts.map +0 -1
- package/dist/react/TileInitializer.js +0 -40
|
@@ -30,7 +30,8 @@ export interface TileContextValue {
|
|
|
30
30
|
export declare const TileContext: React.Context<TileContextValue | null>;
|
|
31
31
|
interface TileProviderProps {
|
|
32
32
|
children: React.ReactNode;
|
|
33
|
+
router?: any;
|
|
33
34
|
}
|
|
34
|
-
export declare function TileProvider({ children }: TileProviderProps): React.JSX.Element;
|
|
35
|
+
export declare function TileProvider({ children, router }: TileProviderProps): React.JSX.Element;
|
|
35
36
|
export {};
|
|
36
37
|
//# sourceMappingURL=TileProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileProvider.d.ts","sourceRoot":"","sources":["../../src/react/TileProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAiB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,OAAO,EAAE,CAAC,GAAG,E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IAC1B,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,iBAAiB,qBA0DnE"}
|
|
@@ -2,10 +2,10 @@ import React, { createContext, useEffect, useState } from 'react';
|
|
|
2
2
|
import { getTileBridge } from '../bridge/TileBridge';
|
|
3
3
|
import { StateClient } from '../state/StateClient';
|
|
4
4
|
export const TileContext = createContext(null);
|
|
5
|
-
export function TileProvider({ children }) {
|
|
5
|
+
export function TileProvider({ children, router }) {
|
|
6
6
|
const [isReady, setIsReady] = useState(false);
|
|
7
7
|
const [stateClient, setStateClient] = useState(null);
|
|
8
|
-
const bridge = getTileBridge();
|
|
8
|
+
const bridge = getTileBridge(router);
|
|
9
9
|
// Get tileId from environment variable
|
|
10
10
|
const tileId = typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_TILE_ID
|
|
11
11
|
? process.env.NEXT_PUBLIC_TILE_ID
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/react/index.js
CHANGED
|
@@ -2,4 +2,4 @@ export { TileProvider } from './TileProvider';
|
|
|
2
2
|
export { useTile } from './useTile';
|
|
3
3
|
export { TileContainer } from './TileContainer';
|
|
4
4
|
export { withTile } from './withTile';
|
|
5
|
-
|
|
5
|
+
// TileInitializer removed - router should be injected directly into TileProvider
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thewhateverapp/tile-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "SDK for building interactive tiles on The Whatever App platform",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -38,8 +38,7 @@
|
|
|
38
38
|
"author": "The Whatever App",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"react": "^18.0.0"
|
|
42
|
-
"next": "^14.0.0"
|
|
41
|
+
"react": "^18.0.0"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
44
|
"@types/react": "^18.2.48",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TileInitializer - Automatically initializes the TileBridge with Next.js router
|
|
3
|
-
*
|
|
4
|
-
* This component should be included in the app's root layout to enable
|
|
5
|
-
* tile navigation features. It's invisible and has no visual output.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```tsx
|
|
9
|
-
* // In app/layout.tsx
|
|
10
|
-
* import { TileInitializer } from '@thewhateverapp/tile-sdk/react';
|
|
11
|
-
*
|
|
12
|
-
* export default function RootLayout({ children }) {
|
|
13
|
-
* return (
|
|
14
|
-
* <html>
|
|
15
|
-
* <body>
|
|
16
|
-
* <TileInitializer />
|
|
17
|
-
* {children}
|
|
18
|
-
* </body>
|
|
19
|
-
* </html>
|
|
20
|
-
* );
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function TileInitializer(): null;
|
|
25
|
-
//# sourceMappingURL=TileInitializer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TileInitializer.d.ts","sourceRoot":"","sources":["../../src/react/TileInitializer.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,SAe9B"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import { useRouter } from 'next/navigation';
|
|
4
|
-
import { getTileBridge } from '../bridge/TileBridge';
|
|
5
|
-
/**
|
|
6
|
-
* TileInitializer - Automatically initializes the TileBridge with Next.js router
|
|
7
|
-
*
|
|
8
|
-
* This component should be included in the app's root layout to enable
|
|
9
|
-
* tile navigation features. It's invisible and has no visual output.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* // In app/layout.tsx
|
|
14
|
-
* import { TileInitializer } from '@thewhateverapp/tile-sdk/react';
|
|
15
|
-
*
|
|
16
|
-
* export default function RootLayout({ children }) {
|
|
17
|
-
* return (
|
|
18
|
-
* <html>
|
|
19
|
-
* <body>
|
|
20
|
-
* <TileInitializer />
|
|
21
|
-
* {children}
|
|
22
|
-
* </body>
|
|
23
|
-
* </html>
|
|
24
|
-
* );
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export function TileInitializer() {
|
|
29
|
-
const router = useRouter();
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
// Initialize TileBridge with router for navigation support
|
|
32
|
-
const bridge = getTileBridge(router);
|
|
33
|
-
console.log('[TileInitializer] ✅ TileBridge initialized with router', {
|
|
34
|
-
hasRouter: !!router,
|
|
35
|
-
routerMethods: router ? Object.keys(router) : [],
|
|
36
|
-
});
|
|
37
|
-
}, [router]);
|
|
38
|
-
// This component renders nothing - it only initializes the bridge
|
|
39
|
-
return null;
|
|
40
|
-
}
|