@thewhateverapp/tile-sdk 0.5.6 → 0.6.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.
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TileInitializer.d.ts","sourceRoot":"","sources":["../../src/react/TileInitializer.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,SAc9B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
getTileBridge(router);
|
|
33
|
+
if (process.env.NODE_ENV === 'development') {
|
|
34
|
+
console.log('[TileInitializer] TileBridge initialized with router');
|
|
35
|
+
}
|
|
36
|
+
}, [router]);
|
|
37
|
+
// This component renders nothing - it only initializes the bridge
|
|
38
|
+
return null;
|
|
39
|
+
}
|
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;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thewhateverapp/tile-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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,11 +38,13 @@
|
|
|
38
38
|
"author": "The Whatever App",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"react": "^18.0.0"
|
|
41
|
+
"react": "^18.0.0",
|
|
42
|
+
"next": "^14.0.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/react": "^18.2.48",
|
|
45
46
|
"eslint": "^9.39.1",
|
|
47
|
+
"next": "^14.2.0",
|
|
46
48
|
"typescript": "^5.3.3"
|
|
47
49
|
},
|
|
48
50
|
"scripts": {
|