@cimplify/cli 0.10.1 → 0.11.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/{add-ZRSE2STJ.mjs → add-5ODVFWVR.mjs} +1 -1
- package/dist/{chunk-2ODNBO3D.mjs → chunk-PQUWRUVT.mjs} +2 -2
- package/dist/chunk-W3WLADJP.mjs +6455 -0
- package/dist/{chunk-QU6DN3WR.mjs → chunk-WF5HX2WB.mjs} +1 -1
- package/dist/dev-OF335HZZ.mjs +762 -0
- package/dist/dispatcher.mjs +10 -10
- package/dist/{doctor-6YCHMCZO.mjs → doctor-O2XLOCBB.mjs} +2 -2
- package/dist/{explain-CUVUG7O5.mjs → explain-327PXAY6.mjs} +1 -1
- package/dist/{introspect-J3REAIDU.mjs → introspect-P3BJ7WQL.mjs} +2 -2
- package/dist/{list-FCBWJ5DY.mjs → list-27TS2L47.mjs} +1 -1
- package/dist/{update-DI3MW7TW.mjs → update-TEHVCICJ.mjs} +1 -1
- package/package.json +2 -2
- package/templates/storefront-auto/app/layout.tsx +2 -0
- package/templates/storefront-auto/bun.lock +456 -8
- package/templates/storefront-auto/components/support-chat.tsx +34 -0
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/app/layout.tsx +2 -0
- package/templates/storefront-bakery/bun.lock +456 -8
- package/templates/storefront-bakery/components/support-chat.tsx +34 -0
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/app/layout.tsx +2 -0
- package/templates/storefront-fashion/bun.lock +456 -8
- package/templates/storefront-fashion/components/support-chat.tsx +34 -0
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/app/layout.tsx +2 -0
- package/templates/storefront-grocery/bun.lock +456 -8
- package/templates/storefront-grocery/components/support-chat.tsx +34 -0
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/app/layout.tsx +2 -0
- package/templates/storefront-pharmacy/bun.lock +456 -8
- package/templates/storefront-pharmacy/components/support-chat.tsx +34 -0
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/app/layout.tsx +2 -0
- package/templates/storefront-restaurant/bun.lock +454 -8
- package/templates/storefront-restaurant/components/support-chat.tsx +34 -0
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/app/layout.tsx +2 -0
- package/templates/storefront-retail/bun.lock +456 -8
- package/templates/storefront-retail/components/support-chat.tsx +34 -0
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/app/layout.tsx +2 -0
- package/templates/storefront-services/bun.lock +2 -2
- package/templates/storefront-services/components/support-chat.tsx +34 -0
- package/templates/storefront-services/package.json +1 -1
- package/dist/chunk-WBNI7PWA.mjs +0 -6455
- package/dist/dev-ABN3HOO2.mjs +0 -150
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useRouter } from "next/navigation";
|
|
4
|
+
import {
|
|
5
|
+
CHAT_ACTION_VIEW_ORDER,
|
|
6
|
+
CHAT_ACTION_VIEW_PRODUCT,
|
|
7
|
+
ChatWidget,
|
|
8
|
+
parseChatAction,
|
|
9
|
+
} from "@cimplify/sdk/react";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The support chat bubble, wired to this template's navigation: structured
|
|
13
|
+
* answers from the assistant carry product and order references, and taps
|
|
14
|
+
* land where this storefront shows them. Identity and currency come from
|
|
15
|
+
* the provider, so there is nothing to configure.
|
|
16
|
+
*/
|
|
17
|
+
export function SupportChat() {
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<ChatWidget
|
|
22
|
+
onGenUIAction={({ action }) => {
|
|
23
|
+
const parsed = parseChatAction(action);
|
|
24
|
+
if (!parsed) return;
|
|
25
|
+
if (parsed.verb === CHAT_ACTION_VIEW_PRODUCT) {
|
|
26
|
+
router.push(`/products/${encodeURIComponent(parsed.id)}`);
|
|
27
|
+
}
|
|
28
|
+
if (parsed.verb === CHAT_ACTION_VIEW_ORDER) {
|
|
29
|
+
router.push("/track-order");
|
|
30
|
+
}
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -7,6 +7,7 @@ import { Header } from "@/components/header";
|
|
|
7
7
|
import { Footer } from "@/components/footer";
|
|
8
8
|
import { ProductModal } from "@/components/product-modal";
|
|
9
9
|
import { CartDrawer } from "@/components/cart-drawer";
|
|
10
|
+
import { SupportChat } from "@/components/support-chat";
|
|
10
11
|
import { OrganizationJsonLd } from "@/components/json-ld";
|
|
11
12
|
import { Suspense } from "react";
|
|
12
13
|
import { brand } from "@/lib/brand";
|
|
@@ -64,6 +65,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
|
|
64
65
|
<ProductModal />
|
|
65
66
|
</Suspense>
|
|
66
67
|
<CartDrawer />
|
|
68
|
+
<SupportChat />
|
|
67
69
|
</Providers>
|
|
68
70
|
</body>
|
|
69
71
|
</html>
|