@thewhateverapp/tile-sdk 0.8.0 → 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/package.json
CHANGED
|
@@ -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
|
-
}
|