@elizaos/plugin-shopify-ui 2.0.3-beta.5 → 2.0.3-beta.7
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/CustomersPanel.d.ts +11 -0
- package/dist/CustomersPanel.d.ts.map +1 -0
- package/dist/CustomersPanel.js +86 -0
- package/dist/CustomersPanel.js.map +1 -0
- package/dist/InventoryLevelsPanel.d.ts +10 -0
- package/dist/InventoryLevelsPanel.d.ts.map +1 -0
- package/dist/InventoryLevelsPanel.js +190 -0
- package/dist/InventoryLevelsPanel.js.map +1 -0
- package/dist/OrdersPanel.d.ts +12 -0
- package/dist/OrdersPanel.d.ts.map +1 -0
- package/dist/OrdersPanel.js +170 -0
- package/dist/OrdersPanel.js.map +1 -0
- package/dist/ProductsPanel.d.ts +13 -0
- package/dist/ProductsPanel.d.ts.map +1 -0
- package/dist/ProductsPanel.js +419 -0
- package/dist/ProductsPanel.js.map +1 -0
- package/dist/ShopifyAppView.d.ts +3 -0
- package/dist/ShopifyAppView.d.ts.map +1 -0
- package/dist/ShopifyAppView.helpers.d.ts +11 -0
- package/dist/ShopifyAppView.helpers.d.ts.map +1 -0
- package/dist/ShopifyAppView.helpers.js +59 -0
- package/dist/ShopifyAppView.helpers.js.map +1 -0
- package/dist/ShopifyAppView.interact.d.ts +2 -0
- package/dist/ShopifyAppView.interact.d.ts.map +1 -0
- package/dist/ShopifyAppView.interact.js +93 -0
- package/dist/ShopifyAppView.interact.js.map +1 -0
- package/dist/ShopifyAppView.js +667 -0
- package/dist/ShopifyAppView.js.map +1 -0
- package/dist/ShopifyView.d.ts +18 -0
- package/dist/ShopifyView.d.ts.map +1 -0
- package/dist/ShopifyView.js +143 -0
- package/dist/ShopifyView.js.map +1 -0
- package/dist/StoreOverviewCard.d.ts +13 -0
- package/dist/StoreOverviewCard.d.ts.map +1 -0
- package/dist/StoreOverviewCard.js +23 -0
- package/dist/StoreOverviewCard.js.map +1 -0
- package/dist/components/ShopifySpatialView.d.ts +57 -0
- package/dist/components/ShopifySpatialView.d.ts.map +1 -0
- package/dist/components/ShopifySpatialView.js +419 -0
- package/dist/components/ShopifySpatialView.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +14 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +94 -0
- package/dist/plugin.js.map +1 -0
- package/dist/register-routes.d.ts +2 -0
- package/dist/register-routes.d.ts.map +1 -0
- package/dist/register-routes.js +6 -0
- package/dist/register-routes.js.map +1 -0
- package/dist/register-terminal-view.d.ts +15 -0
- package/dist/register-terminal-view.d.ts.map +1 -0
- package/dist/register-terminal-view.js +37 -0
- package/dist/register-terminal-view.js.map +1 -0
- package/dist/register.d.ts +2 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +17 -0
- package/dist/register.js.map +1 -0
- package/dist/routes.d.ts +18 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +518 -0
- package/dist/routes.js.map +1 -0
- package/dist/shopify-app.d.ts +11 -0
- package/dist/shopify-app.d.ts.map +1 -0
- package/dist/shopify-app.js +16 -0
- package/dist/shopify-app.js.map +1 -0
- package/dist/shopify-view-bundle.d.ts +3 -0
- package/dist/shopify-view-bundle.d.ts.map +1 -0
- package/dist/shopify-view-bundle.js +7 -0
- package/dist/shopify-view-bundle.js.map +1 -0
- package/dist/useShopifyDashboard.d.ts +118 -0
- package/dist/useShopifyDashboard.d.ts.map +1 -0
- package/dist/useShopifyDashboard.js +212 -0
- package/dist/useShopifyDashboard.js.map +1 -0
- package/dist/views/bundle.js +948 -0
- package/dist/views/bundle.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ShopifyAppView.tsx"],"sourcesContent":["import type { OverlayAppContext } from \"@elizaos/ui\";\nimport {\n Badge,\n Button,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n} from \"@elizaos/ui\";\nimport { useAgentElement } from \"@elizaos/ui/agent-surface\";\nimport {\n AlertTriangle,\n BarChart3,\n ChevronLeft,\n Globe2,\n KeyRound,\n type LucideIcon,\n Package,\n ShoppingBag,\n ShoppingCart,\n Store,\n Users,\n Wifi,\n WifiOff,\n} from \"lucide-react\";\nimport { useState } from \"react\";\nimport { CustomersPanel } from \"./CustomersPanel.js\";\nimport { InventoryLevelsPanel } from \"./InventoryLevelsPanel.js\";\nimport { OrdersPanel } from \"./OrdersPanel.js\";\nimport { ProductsPanel } from \"./ProductsPanel.js\";\nimport { StoreOverviewCard } from \"./StoreOverviewCard.js\";\nimport { useShopifyDashboard } from \"./useShopifyDashboard.js\";\n\nconst SH_ACCENT = \"var(--accent, #ff8a24)\";\nconst SH_TXT = \"var(--txt, #111)\";\nconst SH_MUTED = \"var(--muted, rgba(0,0,0,0.58))\";\n\nfunction SetupField({\n icon: Icon,\n label,\n description,\n envHint,\n}: {\n icon: LucideIcon;\n label: string;\n description: string;\n envHint: string;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n gap: 12,\n padding: \"10px 2px\",\n }}\n >\n <span\n style={{\n width: 34,\n height: 34,\n flexShrink: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: SH_ACCENT,\n }}\n >\n <Icon className=\"h-4 w-4\" />\n </span>\n <span\n style={{\n minWidth: 0,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n }}\n >\n <span style={{ fontSize: 13.5, fontWeight: 600, color: SH_TXT }}>\n {label}\n </span>\n <span\n className=\"sr-only\"\n style={{ fontSize: 12, color: SH_MUTED, lineHeight: 1.4 }}\n >\n {description}\n </span>\n <code\n style={{\n marginTop: 3,\n fontSize: 10.5,\n color: SH_MUTED,\n opacity: 0.75,\n fontFamily: \"ui-monospace, monospace\",\n }}\n >\n {envHint}\n </code>\n </span>\n </div>\n );\n}\n\nfunction ShopifySetupCard() {\n return (\n <div className=\"mx-auto w-full max-w-md\">\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n textAlign: \"center\",\n gap: 6,\n marginBottom: 18,\n }}\n >\n <div\n style={{\n width: 84,\n height: 84,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <ShoppingBag style={{ width: 38, height: 38, color: SH_ACCENT }} />\n </div>\n <h2\n style={{\n margin: \"12px 0 0\",\n fontSize: 20,\n fontWeight: 700,\n color: SH_TXT,\n }}\n >\n Connect your store\n </h2>\n <p\n className=\"sr-only\"\n style={{\n margin: 0,\n maxWidth: 320,\n fontSize: 13.5,\n color: SH_MUTED,\n lineHeight: 1.5,\n }}\n >\n Link a Shopify store to manage products, orders, and inventory right\n here.\n </p>\n </div>\n\n <div\n style={{\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 10,\n }}\n >\n <SetupField\n icon={Globe2}\n label=\"Store domain\"\n description=\"Your shop address, e.g. mystore.myshopify.com\"\n envHint=\"SHOPIFY_STORE_DOMAIN\"\n />\n <SetupField\n icon={KeyRound}\n label=\"Access token\"\n description=\"Admin API token with product, order & inventory scopes\"\n envHint=\"SHOPIFY_ACCESS_TOKEN\"\n />\n\n <div\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: 6,\n padding: \"2px 2px 6px\",\n }}\n >\n {[\n { label: \"Products\", icon: Package },\n { label: \"Orders\", icon: ShoppingCart },\n { label: \"Stock\", icon: BarChart3 },\n ].map(({ label, icon: Icon }) => (\n <span\n key={label}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"3px 0\",\n fontSize: 12,\n fontWeight: 600,\n color: SH_TXT,\n }}\n >\n <Icon style={{ width: 13, height: 13, color: SH_MUTED }} />\n {label}\n </span>\n ))}\n </div>\n\n <a\n href=\"/settings\"\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 8,\n height: 42,\n background: SH_ACCENT,\n color: \"var(--accent-foreground, #fff)\",\n fontSize: 14,\n fontWeight: 600,\n textDecoration: \"none\",\n }}\n >\n <Store className=\"h-4 w-4\" />\n Settings\n </a>\n </div>\n </div>\n );\n}\n\nfunction ConnectionStatus({\n connected,\n loading,\n domain,\n}: {\n connected: boolean;\n loading: boolean;\n domain?: string;\n}) {\n if (loading) {\n return <Skeleton className=\"h-6 w-24\" />;\n }\n\n if (connected && domain) {\n return (\n <div className=\"flex items-center gap-1.5 px-1 py-1\">\n <Wifi className=\"h-3.5 w-3.5 text-ok\" />\n <span className=\"max-w-[10rem] truncate text-xs font-medium text-ok\">\n {domain}\n </span>\n </div>\n );\n }\n\n return (\n <div className=\"flex items-center gap-1.5 px-1 py-1\">\n <WifiOff className=\"h-3.5 w-3.5 text-danger\" />\n <span className=\"text-xs font-medium text-danger\">Offline</span>\n </div>\n );\n}\n\ntype DashboardTab =\n | \"overview\"\n | \"products\"\n | \"orders\"\n | \"inventory\"\n | \"customers\";\n\nconst DASHBOARD_TABS: {\n value: DashboardTab;\n label: string;\n icon: LucideIcon;\n}[] = [\n { value: \"overview\", label: \"Overview\", icon: BarChart3 },\n { value: \"products\", label: \"Products\", icon: Package },\n { value: \"orders\", label: \"Orders\", icon: ShoppingCart },\n { value: \"inventory\", label: \"Inventory\", icon: BarChart3 },\n { value: \"customers\", label: \"Customers\", icon: Users },\n];\n\nfunction ShopifyDashboardTabTrigger({\n value,\n label,\n icon: Icon,\n active,\n}: {\n value: DashboardTab;\n label: string;\n icon: LucideIcon;\n active: boolean;\n}) {\n const { ref, agentProps } = useAgentElement<HTMLButtonElement>({\n id: `tab-${value}`,\n role: \"tab\",\n label,\n group: \"dashboard-tabs\",\n status: active ? \"active\" : \"inactive\",\n description: `Show the ${label} tab`,\n });\n return (\n <TabsTrigger\n ref={ref}\n value={value}\n className=\"h-9 w-9 gap-0 px-0 sm:w-auto sm:gap-1.5 sm:px-3\"\n aria-current={active ? \"true\" : undefined}\n title={label}\n {...agentProps}\n >\n <Icon className=\"h-3.5 w-3.5\" />\n <span className=\"hidden sm:inline\">{label}</span>\n </TabsTrigger>\n );\n}\n\nfunction OverviewTile({\n icon: Icon,\n label,\n value,\n accent,\n onClick,\n}: {\n icon: LucideIcon;\n label: string;\n value: string;\n accent: string;\n onClick: () => void;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group flex min-h-20 items-start gap-3 px-2 py-2 text-left transition-colors hover:bg-bg-muted/20\"\n title={label}\n >\n <span\n className={`flex h-9 w-9 shrink-0 items-center justify-center ${accent}`}\n >\n <Icon className=\"h-4 w-4\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-2xl font-semibold leading-none text-txt\">\n {value}\n </span>\n <span className=\"mt-2 block truncate text-xs font-medium text-muted\">\n {label}\n </span>\n </span>\n </button>\n );\n}\n\nexport function ShopifyAppView({ exitToApps }: OverlayAppContext) {\n const [activeTab, setActiveTab] = useState<DashboardTab>(\"overview\");\n\n const {\n status,\n statusLoading,\n statusError,\n\n products,\n productsTotal,\n productsPage,\n productsLoading,\n productsError,\n productSearch,\n setProductsPage,\n\n orders,\n ordersTotal,\n ordersLoading,\n ordersError,\n orderStatusFilter,\n setOrderStatusFilter,\n\n inventoryItems,\n inventoryLocations,\n inventoryLoading,\n inventoryError,\n\n customers,\n customersTotal,\n customersLoading,\n customersError,\n customerSearch,\n\n counts,\n } = useShopifyDashboard();\n\n const connected = status?.connected ?? false;\n const shop = status?.shop ?? null;\n const lowInventoryItems = inventoryItems.filter(\n (item) => item.available <= 5,\n );\n const urgentInventoryCount = lowInventoryItems.filter(\n (item) => item.available === 0,\n ).length;\n\n const backButton = useAgentElement<HTMLButtonElement>({\n id: \"action-back\",\n role: \"button\",\n label: \"Back to apps\",\n group: \"header\",\n description: \"Exit the Shopify dashboard and return to the apps grid\",\n });\n const viewAllOrdersButton = useAgentElement<HTMLButtonElement>({\n id: \"overview-view-all-orders\",\n role: \"button\",\n label: \"View all orders\",\n group: \"overview\",\n description: \"Jump to the orders tab from the overview summary\",\n onActivate: () => setActiveTab(\"orders\"),\n });\n const viewAllInventoryButton = useAgentElement<HTMLButtonElement>({\n id: \"overview-view-inventory\",\n role: \"button\",\n label: \"View inventory\",\n group: \"overview\",\n description: \"Jump to the inventory tab from the overview summary\",\n onActivate: () => setActiveTab(\"inventory\"),\n });\n\n return (\n <div\n data-testid=\"shopify-shell\"\n className=\"fixed inset-0 z-50 flex flex-col overflow-hidden bg-bg pb-[var(--safe-area-bottom,0px)] pl-[var(--safe-area-left,0px)] pr-[var(--safe-area-right,0px)] pt-[var(--safe-area-top,0px)] supports-[height:100dvh]:h-[100dvh]\"\n >\n <div className=\"flex shrink-0 items-center gap-3 px-3 py-2\">\n <Button\n ref={backButton.ref}\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n onClick={exitToApps}\n className=\"h-8 w-8 shrink-0\"\n aria-label=\"Back to apps\"\n {...backButton.agentProps}\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n\n <div className=\"flex min-w-0 items-center gap-2\">\n <span\n className=\"flex h-8 w-8 shrink-0 items-center justify-center\"\n style={{\n color: SH_ACCENT,\n }}\n >\n <Store className=\"h-4 w-4\" />\n </span>\n <span className=\"truncate text-sm font-semibold text-txt\">\n {shop?.name ?? \"Shopify\"}\n </span>\n </div>\n\n <div className=\"flex-1\" />\n\n <ConnectionStatus\n connected={connected}\n loading={statusLoading}\n domain={shop?.domain}\n />\n </div>\n\n <div className=\"min-h-0 flex-1 overflow-y-auto pb-[calc(7rem+var(--safe-area-bottom,0px))]\">\n {statusError ? (\n <div className=\"m-3 px-1 py-2 text-sm text-danger\">{statusError}</div>\n ) : null}\n\n {!statusLoading && !connected ? (\n <div className=\"flex min-h-full items-center justify-center px-4 py-10\">\n <ShopifySetupCard />\n </div>\n ) : statusLoading && !connected ? (\n <div className=\"flex min-h-full items-center justify-center\">\n <Skeleton className=\"mx-4 h-80 w-full max-w-lg\" />\n </div>\n ) : (\n <div className=\"mx-auto w-full max-w-3xl px-4 py-4\">\n <Tabs\n value={activeTab}\n onValueChange={(v) => setActiveTab(v as DashboardTab)}\n >\n <TabsList className=\"sticky top-3 z-10 mb-3 h-auto w-full justify-between gap-1 bg-transparent p-0 sm:w-auto sm:justify-start\">\n {DASHBOARD_TABS.map((tab) => (\n <ShopifyDashboardTabTrigger\n key={tab.value}\n value={tab.value}\n label={tab.label}\n icon={tab.icon}\n active={activeTab === tab.value}\n />\n ))}\n </TabsList>\n\n <TabsContent value=\"overview\">\n <div className=\"space-y-4\">\n {shop ? <StoreOverviewCard shop={shop} /> : null}\n\n <div className=\"grid gap-2 sm:grid-cols-2\">\n <OverviewTile\n icon={Package}\n label=\"Products\"\n value={counts.productCount.toLocaleString()}\n accent=\"text-muted-strong\"\n onClick={() => setActiveTab(\"products\")}\n />\n <OverviewTile\n icon={ShoppingCart}\n label=\"Orders\"\n value={counts.orderCount.toLocaleString()}\n accent=\"text-muted-strong\"\n onClick={() => setActiveTab(\"orders\")}\n />\n <OverviewTile\n icon={AlertTriangle}\n label=\"Low stock\"\n value={lowInventoryItems.length.toLocaleString()}\n accent={\n urgentInventoryCount > 0 ? \"text-danger\" : \"text-warn\"\n }\n onClick={() => setActiveTab(\"inventory\")}\n />\n <OverviewTile\n icon={Users}\n label=\"Customers\"\n value={counts.customerCount.toLocaleString()}\n accent=\"text-muted-strong\"\n onClick={() => setActiveTab(\"customers\")}\n />\n </div>\n\n <div className=\"space-y-3\">\n <div className=\"px-2 py-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <span\n className=\"inline-flex h-8 w-8 items-center justify-center text-muted-strong\"\n title=\"Recent orders\"\n >\n <ShoppingCart className=\"h-4 w-4\" aria-hidden />\n </span>\n {ordersTotal > 3 ? (\n <Button\n ref={viewAllOrdersButton.ref}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 px-2 text-xs-tight\"\n onClick={() => setActiveTab(\"orders\")}\n title={`View all ${ordersTotal.toLocaleString()} orders`}\n {...viewAllOrdersButton.agentProps}\n >\n +{(ordersTotal - 3).toLocaleString()}\n </Button>\n ) : null}\n </div>\n <div className=\"mt-2 space-y-1.5\">\n {ordersLoading && orders.length === 0 ? (\n <>\n <Skeleton className=\"h-8 w-full\" />\n <Skeleton className=\"h-8 w-full\" />\n <Skeleton className=\"h-8 w-full\" />\n </>\n ) : (\n orders.slice(0, 3).map((order) => (\n <div\n key={order.id}\n className=\"grid grid-cols-[5rem_minmax(0,1fr)_auto] items-center gap-2 px-2 py-1.5\"\n >\n <span className=\"text-xs font-semibold text-txt\">\n {order.name}\n </span>\n <span className=\"truncate text-xs-tight text-muted\">\n {order.email}\n </span>\n <span className=\"shrink-0 text-xs font-semibold text-txt\">\n {order.totalPrice} {order.currencyCode}\n </span>\n </div>\n ))\n )}\n {orders.length === 0 && !ordersLoading ? (\n <p className=\"text-xs text-muted\">None</p>\n ) : null}\n </div>\n </div>\n\n <div className=\"px-2 py-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <span\n className=\"inline-flex h-8 w-8 items-center justify-center text-muted-strong\"\n title=\"Low inventory\"\n >\n <Package className=\"h-4 w-4\" aria-hidden />\n </span>\n {lowInventoryItems.length > 3 ? (\n <Button\n ref={viewAllInventoryButton.ref}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-7 px-2 text-xs-tight\"\n onClick={() => setActiveTab(\"inventory\")}\n title=\"View inventory\"\n {...viewAllInventoryButton.agentProps}\n >\n +{(lowInventoryItems.length - 3).toLocaleString()}\n </Button>\n ) : null}\n </div>\n <div className=\"mt-2 space-y-1.5\">\n {inventoryLoading && inventoryItems.length === 0 ? (\n <>\n <Skeleton className=\"h-8 w-full\" />\n <Skeleton className=\"h-8 w-full\" />\n </>\n ) : (\n lowInventoryItems.slice(0, 3).map((item) => (\n <div\n key={`${item.id}:${item.locationName}`}\n className=\"flex items-center justify-between gap-2 px-2 py-1.5\"\n >\n <span className=\"min-w-0 flex-1 truncate text-xs font-semibold text-txt\">\n {item.productTitle}\n {item.variantTitle\n ? ` — ${item.variantTitle}`\n : \"\"}\n </span>\n <Badge\n variant={\n item.available === 0\n ? \"destructive\"\n : \"secondary\"\n }\n className=\"shrink-0 text-2xs\"\n >\n {item.available}\n </Badge>\n </div>\n ))\n )}\n {lowInventoryItems.length === 0 && !inventoryLoading ? (\n <p className=\"text-xs text-muted\">\n Stock levels look good.\n </p>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n </TabsContent>\n\n <TabsContent value=\"products\">\n <ProductsPanel\n products={products}\n total={productsTotal}\n page={productsPage}\n loading={productsLoading}\n error={productsError}\n search={productSearch}\n onPageChange={setProductsPage}\n />\n </TabsContent>\n\n <TabsContent value=\"orders\">\n <OrdersPanel\n orders={orders}\n total={ordersTotal}\n loading={ordersLoading}\n error={ordersError}\n statusFilter={orderStatusFilter}\n onStatusFilterChange={setOrderStatusFilter}\n />\n </TabsContent>\n\n <TabsContent value=\"inventory\">\n <InventoryLevelsPanel\n items={inventoryItems}\n locations={inventoryLocations}\n loading={inventoryLoading}\n error={inventoryError}\n />\n </TabsContent>\n\n <TabsContent value=\"customers\">\n <CustomersPanel\n customers={customers}\n total={customersTotal}\n loading={customersLoading}\n error={customersError}\n search={customerSearch}\n />\n </TabsContent>\n </Tabs>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":"AAoEQ,SAuekB,UAvelB,KAEF,YAFE;AAnER;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,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oBACP,MAAM;AAAA,oBACN,SAAS;AAAA,oBACT,OAAO;AAAA,oBACP,QAAQ;AAAA,oBACR,cAAc;AAAA;AAAA,gBAChB,GACF;AAAA,gBAEA,oBAAC,eAAY,OAAM,UACjB;AAAA,kBAAC;AAAA;AAAA,oBACC;AAAA,oBACA,OAAO;AAAA,oBACP,SAAS;AAAA,oBACT,OAAO;AAAA,oBACP,cAAc;AAAA,oBACd,sBAAsB;AAAA;AAAA,gBACxB,GACF;AAAA,gBAEA,oBAAC,eAAY,OAAM,aACjB;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO;AAAA,oBACP,WAAW;AAAA,oBACX,SAAS;AAAA,oBACT,OAAO;AAAA;AAAA,gBACT,GACF;AAAA,gBAEA,oBAAC,eAAY,OAAM,aACjB;AAAA,kBAAC;AAAA;AAAA,oBACC;AAAA,oBACA,OAAO;AAAA,oBACP,SAAS;AAAA,oBACT,OAAO;AAAA,oBACP,QAAQ;AAAA;AAAA,gBACV,GACF;AAAA;AAAA;AAAA,UACF,GACF;AAAA,WAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShopifyView — the single GUI/XR data wrapper for the Shopify surface.
|
|
3
|
+
*
|
|
4
|
+
* It owns the live store data (status / products / orders / inventory /
|
|
5
|
+
* customers polling via {@link useShopifyDashboard}, tab selection, search and
|
|
6
|
+
* filter state, pagination, and product creation) and renders the one
|
|
7
|
+
* presentational {@link ShopifySpatialView} inside a {@link SpatialSurface}.
|
|
8
|
+
* Omitting the `modality` prop lets `SpatialSurface` auto-detect GUI vs XR, so
|
|
9
|
+
* the SAME component serves both surfaces. The TUI surface renders the same
|
|
10
|
+
* `ShopifySpatialView` through the terminal registry (see
|
|
11
|
+
* `register-terminal-view.tsx`).
|
|
12
|
+
*
|
|
13
|
+
* The full-screen overlay app (`ShopifyAppView`, registered via `shopify-app.ts`)
|
|
14
|
+
* keeps its own richer Tabs/dialog chrome; this wrapper is the view-manager
|
|
15
|
+
* surface drawn from the cross-modal spatial source of truth.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ShopifyView(): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=ShopifyView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShopifyView.d.ts","sourceRoot":"","sources":["../src/ShopifyView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAWH,wBAAgB,WAAW,4CA6J1B"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SpatialSurface } from "@elizaos/ui/spatial";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
ShopifySpatialView
|
|
6
|
+
} from "./components/ShopifySpatialView.js";
|
|
7
|
+
import { useShopifyDashboard } from "./useShopifyDashboard.js";
|
|
8
|
+
function ShopifyView() {
|
|
9
|
+
const [activeTab, setActiveTab] = useState("overview");
|
|
10
|
+
const [createTitle, setCreateTitle] = useState("");
|
|
11
|
+
const [createError, setCreateError] = useState(null);
|
|
12
|
+
const {
|
|
13
|
+
status,
|
|
14
|
+
statusLoading,
|
|
15
|
+
statusError,
|
|
16
|
+
products,
|
|
17
|
+
productsTotal,
|
|
18
|
+
productsPage,
|
|
19
|
+
productsLoading,
|
|
20
|
+
productsError,
|
|
21
|
+
productSearch,
|
|
22
|
+
setProductSearch,
|
|
23
|
+
setProductsPage,
|
|
24
|
+
orders,
|
|
25
|
+
ordersTotal,
|
|
26
|
+
ordersLoading,
|
|
27
|
+
ordersError,
|
|
28
|
+
orderStatusFilter,
|
|
29
|
+
setOrderStatusFilter,
|
|
30
|
+
inventoryItems,
|
|
31
|
+
inventoryLocations,
|
|
32
|
+
inventoryLoading,
|
|
33
|
+
inventoryError,
|
|
34
|
+
customers,
|
|
35
|
+
customersTotal,
|
|
36
|
+
customersLoading,
|
|
37
|
+
customersError,
|
|
38
|
+
customerSearch,
|
|
39
|
+
setCustomerSearch,
|
|
40
|
+
counts,
|
|
41
|
+
refresh
|
|
42
|
+
} = useShopifyDashboard();
|
|
43
|
+
const createProduct = useCallback(async () => {
|
|
44
|
+
const title = createTitle.trim();
|
|
45
|
+
if (!title) {
|
|
46
|
+
setCreateError("Enter a product title.");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setCreateError(null);
|
|
50
|
+
try {
|
|
51
|
+
const res = await fetch("/api/shopify/products", {
|
|
52
|
+
method: "POST",
|
|
53
|
+
headers: { "Content-Type": "application/json" },
|
|
54
|
+
body: JSON.stringify({ title })
|
|
55
|
+
});
|
|
56
|
+
if (!res.ok) {
|
|
57
|
+
const text = await res.text().catch(() => "Unknown error");
|
|
58
|
+
throw new Error(text);
|
|
59
|
+
}
|
|
60
|
+
setCreateTitle("");
|
|
61
|
+
refresh();
|
|
62
|
+
} catch (err) {
|
|
63
|
+
setCreateError(
|
|
64
|
+
err instanceof Error ? err.message : "Failed to create product."
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}, [createTitle, refresh]);
|
|
68
|
+
const onAction = useCallback(
|
|
69
|
+
(action) => {
|
|
70
|
+
if (action.startsWith("tab:")) {
|
|
71
|
+
setActiveTab(action.slice("tab:".length));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (action.startsWith("products:search:")) {
|
|
75
|
+
setProductsPage(1);
|
|
76
|
+
setProductSearch(action.slice("products:search:".length));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (action.startsWith("products:create-title:")) {
|
|
80
|
+
setCreateError(null);
|
|
81
|
+
setCreateTitle(action.slice("products:create-title:".length));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (action.startsWith("orders:filter:")) {
|
|
85
|
+
setOrderStatusFilter(action.slice("orders:filter:".length));
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (action.startsWith("customers:search:")) {
|
|
89
|
+
setCustomerSearch(action.slice("customers:search:".length));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
switch (action) {
|
|
93
|
+
case "products:create":
|
|
94
|
+
void createProduct();
|
|
95
|
+
return;
|
|
96
|
+
case "products:prev-page":
|
|
97
|
+
setProductsPage(Math.max(1, productsPage - 1));
|
|
98
|
+
return;
|
|
99
|
+
case "products:next-page":
|
|
100
|
+
setProductsPage(productsPage + 1);
|
|
101
|
+
return;
|
|
102
|
+
case "refresh":
|
|
103
|
+
refresh();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
[
|
|
108
|
+
createProduct,
|
|
109
|
+
productsPage,
|
|
110
|
+
refresh,
|
|
111
|
+
setCustomerSearch,
|
|
112
|
+
setOrderStatusFilter,
|
|
113
|
+
setProductSearch,
|
|
114
|
+
setProductsPage
|
|
115
|
+
]
|
|
116
|
+
);
|
|
117
|
+
const loading = statusLoading || productsLoading || ordersLoading || inventoryLoading || customersLoading;
|
|
118
|
+
const error = createError ?? statusError ?? productsError ?? ordersError ?? inventoryError ?? customersError;
|
|
119
|
+
const snapshot = {
|
|
120
|
+
status,
|
|
121
|
+
tab: activeTab,
|
|
122
|
+
counts,
|
|
123
|
+
products,
|
|
124
|
+
productsTotal,
|
|
125
|
+
productsPage,
|
|
126
|
+
productSearch,
|
|
127
|
+
orders,
|
|
128
|
+
ordersTotal,
|
|
129
|
+
orderStatusFilter,
|
|
130
|
+
inventoryItems,
|
|
131
|
+
inventoryLocations,
|
|
132
|
+
customers,
|
|
133
|
+
customersTotal,
|
|
134
|
+
customerSearch,
|
|
135
|
+
loading,
|
|
136
|
+
error
|
|
137
|
+
};
|
|
138
|
+
return /* @__PURE__ */ jsx(SpatialSurface, { children: /* @__PURE__ */ jsx(ShopifySpatialView, { snapshot, onAction }) });
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
ShopifyView
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=ShopifyView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ShopifyView.tsx"],"sourcesContent":["/**\n * ShopifyView — the single GUI/XR data wrapper for the Shopify surface.\n *\n * It owns the live store data (status / products / orders / inventory /\n * customers polling via {@link useShopifyDashboard}, tab selection, search and\n * filter state, pagination, and product creation) and renders the one\n * presentational {@link ShopifySpatialView} inside a {@link SpatialSurface}.\n * Omitting the `modality` prop lets `SpatialSurface` auto-detect GUI vs XR, so\n * the SAME component serves both surfaces. The TUI surface renders the same\n * `ShopifySpatialView` through the terminal registry (see\n * `register-terminal-view.tsx`).\n *\n * The full-screen overlay app (`ShopifyAppView`, registered via `shopify-app.ts`)\n * keeps its own richer Tabs/dialog chrome; this wrapper is the view-manager\n * surface drawn from the cross-modal spatial source of truth.\n */\n\nimport { SpatialSurface } from \"@elizaos/ui/spatial\";\nimport { useCallback, useState } from \"react\";\nimport {\n type ShopifySnapshot,\n type ShopifyTab,\n ShopifySpatialView,\n} from \"./components/ShopifySpatialView.js\";\nimport { useShopifyDashboard } from \"./useShopifyDashboard.js\";\n\nexport function ShopifyView() {\n const [activeTab, setActiveTab] = useState<ShopifyTab>(\"overview\");\n const [createTitle, setCreateTitle] = useState(\"\");\n const [createError, setCreateError] = useState<string | null>(null);\n\n const {\n status,\n statusLoading,\n statusError,\n\n products,\n productsTotal,\n productsPage,\n productsLoading,\n productsError,\n productSearch,\n setProductSearch,\n setProductsPage,\n\n orders,\n ordersTotal,\n ordersLoading,\n ordersError,\n orderStatusFilter,\n setOrderStatusFilter,\n\n inventoryItems,\n inventoryLocations,\n inventoryLoading,\n inventoryError,\n\n customers,\n customersTotal,\n customersLoading,\n customersError,\n customerSearch,\n setCustomerSearch,\n\n counts,\n refresh,\n } = useShopifyDashboard();\n\n const createProduct = useCallback(async () => {\n const title = createTitle.trim();\n if (!title) {\n setCreateError(\"Enter a product title.\");\n return;\n }\n setCreateError(null);\n try {\n const res = await fetch(\"/api/shopify/products\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ title }),\n });\n if (!res.ok) {\n const text = await res.text().catch(() => \"Unknown error\");\n throw new Error(text);\n }\n setCreateTitle(\"\");\n refresh();\n } catch (err) {\n setCreateError(\n err instanceof Error ? err.message : \"Failed to create product.\",\n );\n }\n }, [createTitle, refresh]);\n\n const onAction = useCallback(\n (action: string) => {\n if (action.startsWith(\"tab:\")) {\n setActiveTab(action.slice(\"tab:\".length) as ShopifyTab);\n return;\n }\n if (action.startsWith(\"products:search:\")) {\n setProductsPage(1);\n setProductSearch(action.slice(\"products:search:\".length));\n return;\n }\n if (action.startsWith(\"products:create-title:\")) {\n setCreateError(null);\n setCreateTitle(action.slice(\"products:create-title:\".length));\n return;\n }\n if (action.startsWith(\"orders:filter:\")) {\n setOrderStatusFilter(action.slice(\"orders:filter:\".length));\n return;\n }\n if (action.startsWith(\"customers:search:\")) {\n setCustomerSearch(action.slice(\"customers:search:\".length));\n return;\n }\n switch (action) {\n case \"products:create\":\n void createProduct();\n return;\n case \"products:prev-page\":\n setProductsPage(Math.max(1, productsPage - 1));\n return;\n case \"products:next-page\":\n setProductsPage(productsPage + 1);\n return;\n case \"refresh\":\n refresh();\n return;\n }\n },\n [\n createProduct,\n productsPage,\n refresh,\n setCustomerSearch,\n setOrderStatusFilter,\n setProductSearch,\n setProductsPage,\n ],\n );\n\n const loading =\n statusLoading ||\n productsLoading ||\n ordersLoading ||\n inventoryLoading ||\n customersLoading;\n const error =\n createError ??\n statusError ??\n productsError ??\n ordersError ??\n inventoryError ??\n customersError;\n\n const snapshot: ShopifySnapshot = {\n status,\n tab: activeTab,\n counts,\n products,\n productsTotal,\n productsPage,\n productSearch,\n orders,\n ordersTotal,\n orderStatusFilter,\n inventoryItems,\n inventoryLocations,\n customers,\n customersTotal,\n customerSearch,\n loading,\n error,\n };\n\n return (\n <SpatialSurface>\n <ShopifySpatialView snapshot={snapshot} onAction={onAction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A;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SACE,oBAAC,kBACC,8BAAC,sBAAmB,UAAoB,UAAoB,GAC9D;AAEJ;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface StoreShop {
|
|
2
|
+
name: string;
|
|
3
|
+
domain: string;
|
|
4
|
+
plan: string;
|
|
5
|
+
email: string;
|
|
6
|
+
currencyCode: string;
|
|
7
|
+
}
|
|
8
|
+
interface StoreOverviewCardProps {
|
|
9
|
+
shop: StoreShop;
|
|
10
|
+
}
|
|
11
|
+
export declare function StoreOverviewCard({ shop }: StoreOverviewCardProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=StoreOverviewCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreOverviewCard.d.ts","sourceRoot":"","sources":["../src/StoreOverviewCard.tsx"],"names":[],"mappings":"AAEA,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,sBAAsB;IAC9B,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,sBAAsB,2CA0BjE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Store } from "lucide-react";
|
|
3
|
+
function StoreOverviewCard({ shop }) {
|
|
4
|
+
return /* @__PURE__ */ jsx("div", { className: "px-2 py-2", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
5
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-11 w-11 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx(Store, { className: "h-5 w-5 text-muted-strong" }) }),
|
|
6
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-lg font-semibold text-txt", children: shop.name }),
|
|
8
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-xs text-muted", children: [
|
|
9
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 font-medium text-ok", children: [
|
|
10
|
+
/* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-ok" }),
|
|
11
|
+
"live"
|
|
12
|
+
] }),
|
|
13
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-[12rem] truncate", children: shop.domain }),
|
|
14
|
+
/* @__PURE__ */ jsx("span", { children: shop.currencyCode })
|
|
15
|
+
] })
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ jsx("div", { className: "px-1 py-1 text-xs font-medium text-muted-strong", children: shop.plan })
|
|
18
|
+
] }) });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
StoreOverviewCard
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=StoreOverviewCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/StoreOverviewCard.tsx"],"sourcesContent":["import { Store } from \"lucide-react\";\n\ninterface StoreShop {\n name: string;\n domain: string;\n plan: string;\n email: string;\n currencyCode: string;\n}\n\ninterface StoreOverviewCardProps {\n shop: StoreShop;\n}\n\nexport function StoreOverviewCard({ shop }: StoreOverviewCardProps) {\n return (\n <div className=\"px-2 py-2\">\n <div className=\"flex flex-wrap items-center gap-3\">\n <div className=\"flex h-11 w-11 shrink-0 items-center justify-center\">\n <Store className=\"h-5 w-5 text-muted-strong\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-lg font-semibold text-txt\">\n {shop.name}\n </div>\n <div className=\"mt-1 flex flex-wrap items-center gap-2 text-xs text-muted\">\n <span className=\"inline-flex items-center gap-1.5 font-medium text-ok\">\n <span className=\"h-2 w-2 rounded-full bg-ok\" />\n live\n </span>\n <span className=\"max-w-[12rem] truncate\">{shop.domain}</span>\n <span>{shop.currencyCode}</span>\n </div>\n </div>\n <div className=\"px-1 py-1 text-xs font-medium text-muted-strong\">\n {shop.plan}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":"AAmBU,cAOE,YAPF;AAnBV,SAAS,aAAa;AAcf,SAAS,kBAAkB,EAAE,KAAK,GAA2B;AAClE,SACE,oBAAC,SAAI,WAAU,aACb,+BAAC,SAAI,WAAU,qCACb;AAAA,wBAAC,SAAI,WAAU,uDACb,8BAAC,SAAM,WAAU,6BAA4B,GAC/C;AAAA,IACA,qBAAC,SAAI,WAAU,kBACb;AAAA,0BAAC,SAAI,WAAU,2CACZ,eAAK,MACR;AAAA,MACA,qBAAC,SAAI,WAAU,6DACb;AAAA,6BAAC,UAAK,WAAU,wDACd;AAAA,8BAAC,UAAK,WAAU,8BAA6B;AAAA,UAAE;AAAA,WAEjD;AAAA,QACA,oBAAC,UAAK,WAAU,0BAA0B,eAAK,QAAO;AAAA,QACtD,oBAAC,UAAM,eAAK,cAAa;AAAA,SAC3B;AAAA,OACF;AAAA,IACA,oBAAC,SAAI,WAAU,mDACZ,eAAK,MACR;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShopifySpatialView - the Shopify store dashboard authored once with the
|
|
3
|
+
* spatial vocabulary, so it renders correctly wherever it is displayed:
|
|
4
|
+
*
|
|
5
|
+
* - GUI / XR - mounted in `<SpatialSurface>` (DOM; XR scales up).
|
|
6
|
+
* - TUI - rendered to real terminal lines by the agent terminal, via
|
|
7
|
+
* `registerSpatialTerminalView` (see `register-terminal-view.tsx`).
|
|
8
|
+
*
|
|
9
|
+
* It is purely presentational (a snapshot + an action callback in, primitives
|
|
10
|
+
* out) and imports only the cross-modality primitives plus type-only views of
|
|
11
|
+
* the dashboard data shapes, so it is safe to render in the Node agent process
|
|
12
|
+
* where the terminal lives (no React-DOM / browser runtime import).
|
|
13
|
+
*
|
|
14
|
+
* GUI Tabs map to spatial sections: the dashboard shows a counts strip
|
|
15
|
+
* (overview) and one focused commerce section per active tab. On every surface
|
|
16
|
+
* tab selection is a row of `Button`s; the host swaps `snapshot.tab` and
|
|
17
|
+
* re-renders, so the same authored view drives GUI tab clicks, XR spatial
|
|
18
|
+
* selection, and TUI grid sections from one source of truth.
|
|
19
|
+
*/
|
|
20
|
+
import type { ShopifyCustomer, ShopifyInventoryItem, ShopifyOrder, ShopifyProduct, ShopifyStatus } from "../useShopifyDashboard.ts";
|
|
21
|
+
export type ShopifyTab = "overview" | "products" | "orders" | "inventory" | "customers";
|
|
22
|
+
export interface ShopifySnapshot {
|
|
23
|
+
status: ShopifyStatus | null;
|
|
24
|
+
tab: ShopifyTab;
|
|
25
|
+
counts: {
|
|
26
|
+
productCount: number;
|
|
27
|
+
orderCount: number;
|
|
28
|
+
customerCount: number;
|
|
29
|
+
};
|
|
30
|
+
products: ShopifyProduct[];
|
|
31
|
+
productsTotal: number;
|
|
32
|
+
productsPage: number;
|
|
33
|
+
productSearch: string;
|
|
34
|
+
orders: ShopifyOrder[];
|
|
35
|
+
ordersTotal: number;
|
|
36
|
+
orderStatusFilter: string;
|
|
37
|
+
inventoryItems: ShopifyInventoryItem[];
|
|
38
|
+
inventoryLocations: string[];
|
|
39
|
+
customers: ShopifyCustomer[];
|
|
40
|
+
customersTotal: number;
|
|
41
|
+
customerSearch: string;
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
error?: string | null;
|
|
44
|
+
}
|
|
45
|
+
export interface ShopifySpatialViewProps {
|
|
46
|
+
snapshot: ShopifySnapshot;
|
|
47
|
+
/**
|
|
48
|
+
* Dispatch by agent id. Supported actions:
|
|
49
|
+
* `tab:<id>`, `refresh`,
|
|
50
|
+
* `products:search:<q>`, `products:create-title:<q>`, `products:create`,
|
|
51
|
+
* `products:prev-page`, `products:next-page`,
|
|
52
|
+
* `orders:filter:<status>`, `customers:search:<q>`.
|
|
53
|
+
*/
|
|
54
|
+
onAction?: (action: string) => void;
|
|
55
|
+
}
|
|
56
|
+
export declare function ShopifySpatialView({ snapshot, onAction, }: ShopifySpatialViewProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
//# sourceMappingURL=ShopifySpatialView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShopifySpatialView.d.ts","sourceRoot":"","sources":["../../src/components/ShopifySpatialView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAaH,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,UAAU,GAClB,UAAU,GACV,UAAU,GACV,QAAQ,GACR,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5E,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,oBAAoB,EAAE,CAAC;IACvC,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACv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