{"_id":"@botanicastudios/preview-app-bridge-remix","_rev":"3-d3851a9ade18a9859b2996b96f41bec1","name":"@botanicastudios/preview-app-bridge-remix","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@botanicastudios/preview-app-bridge-remix","version":"0.0.1","keywords":["shopify","app-bridge","react","preview","development","mock"],"author":{"name":"Your Development Team"},"license":"UNLICENSED","_id":"@botanicastudios/preview-app-bridge-remix@0.0.1","maintainers":[{"name":"tnjm","email":"toby.m@rsden.com"}],"dist":{"shasum":"b7ed94095a8cf38d20573393b9bf45942b6ea38d","tarball":"https://registry.npmjs.org/@botanicastudios/preview-app-bridge-remix/-/preview-app-bridge-remix-0.0.1.tgz","fileCount":46,"integrity":"sha512-MpUYl35iirscOFZ1/CojsFhofCIXbKkvXzvxgz4DXLVBVlVmmUGrUn9rt80sbe3UjAfXzA/9Vf1v7QdiTiDnDQ==","signatures":[{"sig":"MEUCIAr3kgfmloZOaCNw91O8sccnX4uQnORyp9IEvWskrAXFAiEAlsdARKV0wxH9zoZ9KiGMsOpV2q9iWoFRAj18M9HTeSA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":249453},"main":"index.ts","type":"module","types":"index.ts","exports":{".":{"types":"./index.ts","import":"./index.ts"},"./*":{"types":"./*","import":"./*"},"./vite-plugins/shopify-preview-mode-plugin-enhanced":{"types":"./vite-plugins/shopify-preview-mode-plugin-enhanced.ts","import":"./dist/vite-plugins/shopify-preview-mode-plugin-enhanced.js"}},"scripts":{"build":"tsc -p ./tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"tnjm","email":"toby.m@rsden.com"},"repository":{"url":"local","type":"git"},"_npmVersion":"10.9.2","description":"A comprehensive React package for Shopify App Bridge preview functionality. This package provides mock implementations and preview components that allow developers to build and test Shopify apps without requiring a full Shopify environment.","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^6.2.2","typescript":"^5.2.2","@types/node":"^24.5.0"},"peerDependencies":{"react":">=16.8.0","@shopify/polaris":">=10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/preview-app-bridge-remix_0.0.1_1758026125197_0.24531161634388","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@botanicastudios/preview-app-bridge-remix","version":"0.0.2","keywords":["shopify","app-bridge","react","preview","development","mock"],"author":{"name":"Your Development Team"},"license":"UNLICENSED","_id":"@botanicastudios/preview-app-bridge-remix@0.0.2","maintainers":[{"name":"tnjm","email":"toby.m@rsden.com"}],"dist":{"shasum":"4299f14d076f89e663e6ae346f9b94ba63c044a8","tarball":"https://registry.npmjs.org/@botanicastudios/preview-app-bridge-remix/-/preview-app-bridge-remix-0.0.2.tgz","fileCount":46,"integrity":"sha512-S9gv69os7rb6jceZtoYqlyUQ2f/hyrkQPeNxiZIzwPJIi7Ei3f1ITh6moViR5mz9RvL7NfO3IgaYGw0UZqcGVw==","signatures":[{"sig":"MEUCIQCw7XwU0xDFQi/Cj93/i32NJPC5Pxokj0+vCEBuKlokSAIgUmNjojAhCxIwLqSORf0Y91se8xsqblNBdzKPSZDmBgg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":250404},"main":"index.ts","type":"module","types":"index.ts","exports":{".":{"types":"./index.ts","import":"./index.ts"},"./*":{"types":"./*","import":"./*"},"./vite-plugins/shopify-preview-mode-plugin-enhanced":{"types":"./vite-plugins/shopify-preview-mode-plugin-enhanced.ts","import":"./dist/vite-plugins/shopify-preview-mode-plugin-enhanced.js"}},"scripts":{"build":"tsc -p ./tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"tnjm","email":"toby.m@rsden.com"},"repository":{"url":"local","type":"git"},"_npmVersion":"10.9.2","description":"A comprehensive React package for Shopify App Bridge preview functionality. This package provides mock implementations and preview components that allow developers to build and test Shopify apps without requiring a full Shopify environment.","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^6.2.2","typescript":"^5.2.2","@types/node":"^24.5.0"},"peerDependencies":{"react":">=16.8.0","@shopify/polaris":">=10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/preview-app-bridge-remix_0.0.2_1758026437331_0.7740806401450668","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@botanicastudios/preview-app-bridge-remix","version":"0.0.3","description":"A comprehensive React package for Shopify App Bridge preview functionality. This package provides mock implementations and preview components that allow developers to build and test Shopify apps without requiring a full Shopify environment.","type":"module","main":"index.ts","types":"index.ts","keywords":["shopify","app-bridge","react","preview","development","mock"],"author":{"name":"Your Development Team"},"license":"UNLICENSED","peerDependencies":{"@shopify/polaris":">=10.0.0","react":">=16.8.0"},"devDependencies":{"@types/node":"^24.5.0","typescript":"^5.2.2","vite":"^6.2.2"},"scripts":{"build":"tsc -p ./tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"exports":{".":{"types":"./index.ts","import":"./index.ts"},"./vite-plugins/shopify-preview-mode-plugin-enhanced":{"types":"./vite-plugins/shopify-preview-mode-plugin-enhanced.ts","import":"./dist/vite-plugins/shopify-preview-mode-plugin-enhanced.js"},"./*":{"types":"./*","import":"./*"}},"repository":{"type":"git","url":"local"},"_id":"@botanicastudios/preview-app-bridge-remix@0.0.3","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-2Fh1tyX6NuCnD3xeVB9RX8T6knDkzOTFX02VIfjP2L7ju7kdvZ2pyCymHOvQkqITGCwTWwgmVnOgSv4cqUL5kA==","shasum":"5ce9d1067adfceb11fe278c64d7575daaff15100","tarball":"https://registry.npmjs.org/@botanicastudios/preview-app-bridge-remix/-/preview-app-bridge-remix-0.0.3.tgz","fileCount":46,"unpackedSize":250291,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDnXYeUhTiNJY1WdFJGLE+DnQHeoeyuaUf6maqNDUoeXQIgN3i3ThuldG+a90IUZHCfaZL6Qw2FA5kF6b0l8WQ2vEQ="}]},"_npmUser":{"name":"tnjm","email":"toby.m@rsden.com"},"directories":{},"maintainers":[{"name":"tnjm","email":"toby.m@rsden.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/preview-app-bridge-remix_0.0.3_1758026536660_0.17792772371084808"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-16T12:35:25.098Z","modified":"2025-09-16T12:42:17.080Z","0.0.1":"2025-09-16T12:35:25.371Z","0.0.2":"2025-09-16T12:40:37.500Z","0.0.3":"2025-09-16T12:42:16.870Z"},"author":{"name":"Your Development Team"},"license":"UNLICENSED","keywords":["shopify","app-bridge","react","preview","development","mock"],"repository":{"type":"git","url":"local"},"description":"A comprehensive React package for Shopify App Bridge preview functionality. This package provides mock implementations and preview components that allow developers to build and test Shopify apps without requiring a full Shopify environment.","maintainers":[{"name":"tnjm","email":"toby.m@rsden.com"}],"readme":"# Preview App Bridge React\n\nA comprehensive React package for Shopify App Bridge preview functionality. This package provides mock implementations and preview components that allow developers to build and test Shopify apps without requiring a full Shopify environment.\n\n## Features\n\n### Components\n- **Modal**: Preview modal component with App Bridge-like functionality\n- **TitleBar**: Preview title bar with actions and breadcrumbs\n- **PreviewTitleBar**: Enhanced title bar for preview mode\n- **NavMenu**: Navigation menu component\n- **PreviewNavMenu**: Enhanced nav menu for preview mode\n- **SaveBar**: Save bar component for form workflows\n- **ResourcePicker**: Resource picker component with mock data\n- **PortalTitleBar**: Portal-based title bar component\n\n### Hooks\n- **useAppBridge**: Hook for accessing App Bridge functionality\n- **useAppBridgeContext**: Hook for accessing App Bridge context\n\n### Context\n- **AppBridgeProvider**: Provider component for App Bridge context\n- **AppBridgeContext**: React context for App Bridge state\n\n### APIs\n- **toast**: Toast notification API\n- **loading**: Loading state management API\n- **resourcePicker**: Resource picker API with mock data\n- **picker**: Generic picker API\n- **reviews**: Review request API\n\n### Services\n- **TokenGenerator**: JWT token generation and caching service\n- **RequestInterceptor**: Request interception service\n- **GraphQLClient**: GraphQL client with mock capabilities\n\n### Server Utilities\n- **JWTSigner**: Server-side JWT signing utilities\n\n## Installation\n\nThis package is designed to be used as a local module within your Shopify app project.\n\n## Usage\n\n### Basic Setup\n\n```tsx\nimport React from 'react';\nimport { AppBridgeProvider } from 'preview-app-bridge-react';\n\nfunction App() {\n  return (\n    <AppBridgeProvider>\n      {/* Your app components */}\n    </AppBridgeProvider>\n  );\n}\n```\n\n### Using the Hook\n\n```tsx\nimport React from 'react';\nimport { useAppBridge } from 'preview-app-bridge-react';\nimport { Button } from '@shopify/polaris';\n\nfunction MyComponent() {\n  const shopify = useAppBridge();\n  \n  const handleSelectProducts = async () => {\n    try {\n      const products = await shopify.resourcePicker({\n        type: 'product',\n        multiple: true,\n      });\n      \n      shopify.toast.show(`Selected ${products.length} products`);\n    } catch (error) {\n      shopify.toast.error('Failed to select products');\n    }\n  };\n  \n  return (\n    <Button onClick={handleSelectProducts}>\n      Select Products\n    </Button>\n  );\n}\n```\n\n### Using Components\n\n```tsx\nimport React, { useState } from 'react';\nimport { Modal, TitleBar } from 'preview-app-bridge-react';\n\nfunction MyPage() {\n  const [modalOpen, setModalOpen] = useState(false);\n  \n  return (\n    <>\n      <TitleBar\n        title=\"My Page\"\n        primaryAction={{\n          content: 'Open Modal',\n          onAction: () => setModalOpen(true),\n        }}\n      />\n      \n      <Modal\n        open={modalOpen}\n        onClose={() => setModalOpen(false)}\n        title=\"Example Modal\"\n        primaryAction={{\n          content: 'Save',\n          onAction: () => {\n            // Handle save\n            setModalOpen(false);\n          },\n        }}\n      >\n        <p>Modal content goes here</p>\n      </Modal>\n    </>\n  );\n}\n```\n\n## Development Mode\n\nThe package includes auto-initialization functionality that can be enabled in preview mode:\n\n```tsx\nimport { initializePreviewAppBridge } from 'preview-app-bridge-react';\n\n// Initialize preview mode (typically in your app's entry point)\nif (process.env.NODE_ENV === 'development') {\n  initializePreviewAppBridge();\n}\n```\n\n## File Structure\n\n```\npreview-app-bridge-react/\n├── index.ts                      # Main package exports\n├── package.json                  # Package configuration\n├── components/                   # React components\n│   ├── Modal.tsx\n│   ├── TitleBar.tsx\n│   ├── NavMenu.tsx\n│   └── ...\n├── hooks/                        # React hooks\n│   ├── useAppBridge.tsx\n│   └── index.ts\n├── context/                      # React context\n│   ├── AppBridgeContext.tsx\n│   └── index.ts\n├── apis/                         # Mock APIs\n│   ├── toast.ts\n│   ├── loading.ts\n│   ├── resource-picker.ts\n│   └── ...\n├── services/                     # Utility services\n│   ├── token-generator.ts\n│   ├── request-interceptor.ts\n│   └── ...\n├── types/                        # TypeScript type definitions\n│   └── index.ts\n├── server/                       # Server-side utilities\n│   └── jwt-signer.ts\n├── auto-init.ts                  # Auto-initialization\n├── examples.ts                   # Usage examples\n└── comprehensive-usage-example.tsx\n```\n\n## TypeScript Support\n\nThis package is built with TypeScript and provides comprehensive type definitions for all components, hooks, and APIs.\n\n## License\n\nMIT","readmeFilename":"README.md"}