{"_id":"@basetime/a2w-claims-modal","_rev":"2-2bf163a043d49ffba38f8e58f0224c0a","name":"@basetime/a2w-claims-modal","dist-tags":{"latest":"0.1.15"},"versions":{"0.1.14":{"name":"@basetime/a2w-claims-modal","version":"0.1.14","keywords":["claims","modal","react","wallet","widget"],"license":"UNLICENSED","_id":"@basetime/a2w-claims-modal@0.1.14","maintainers":[{"name":"basetime-io","email":"dev@basetime.io"},{"name":"anthonyzupancic","email":"anthonymzupancic@gmail.com"},{"name":"web-headzoo","email":"sean@headzoo.io"},{"name":"levergreen","email":"lowell.evergreen@avagate.com"}],"homepage":"https://github.com/basetime/addtowallet#readme","bugs":{"url":"https://github.com/basetime/addtowallet/issues"},"dist":{"shasum":"6261846f6e79187067dfa5f0ab1ea09397ea573b","tarball":"https://registry.npmjs.org/@basetime/a2w-claims-modal/-/a2w-claims-modal-0.1.14.tgz","fileCount":28,"integrity":"sha512-nlLTYIwjoe5CquanIMMyw9nzZayMsktfek0TMSav8YD+cqt5ywFsnFuNEPGTiPUUgTOIrmugWsP7cJ1k1JsS8g==","signatures":[{"sig":"MEYCIQC0zy+GywUn9fJXmcwKO7woGbHMizJG3QhkfINxg9nBpQIhAJTrAdQQoJAal2p7cjxDqU0vP2qwpIRsw09/Kl0WRfKQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":126334},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":"22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"29cfeb601d328ebd23696c5bfed8ccb5bfd92477","scripts":{"lint":"eslint --ext .ts,.tsx ./src","test":"jest","build":"NODE_ENV=production node build.mjs","watch":"node build.mjs watch","prepack":"pnpm build:npm && pnpm build:types","build:npm":"NODE_ENV=production node build-npm.mjs","watch:npm":"node build-npm.mjs watch","test:watch":"jest --watchAll","build:types":"pnpm tsc -p tsconfig.build.json","pack:dry-run":"pnpm prepack && rm -rf .pack && mkdir -p .pack && pnpm pack --pack-destination .pack && tar -tf .pack/*.tgz"},"_npmUser":{"name":"web-headzoo","email":"sean@headzoo.io"},"repository":{"url":"git+https://github.com/basetime/addtowallet.git","type":"git","directory":"app/claims-modal"},"_npmVersion":"10.9.0","description":"Embeddable claims modal for Add to Wallet flows.","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@8.15.8","devDependencies":{"jest":"^29.7.0","react":"^18.3.0","eslint":"^8.9.0","esbuild":"^0.27.2","ts-jest":"^29.2.4","react-dom":"^18.1.0","typescript":"^5.5.3","@jest/types":"^29.6.3","@types/jest":"^29.5.12","@types/node":"^17.0.39","@types/react":"^18.0.12","@emotion/react":"^11.9.0","@emotion/styled":"^11.8.1","@types/react-dom":"^18.0.5","eslint-plugin-jsdoc":"^48.2.2","eslint-config-google":"^0.14.0","eslint-plugin-import":"^2.25.4","jest-environment-jsdom":"^29.7.0","@typescript-eslint/parser":"^5.27.1","eslint-plugin-a2w-recommended":"file:../frontend/.eslint/a2w-recommended","@typescript-eslint/eslint-plugin":"^5.12.0","eslint-import-resolver-typescript":"^2.7.1"},"peerDependencies":{"react":"^18.3.0","react-dom":"^18.1.0","@emotion/react":"^11.9.0","@emotion/styled":"^11.8.1"},"_npmOperationalInternal":{"tmp":"tmp/a2w-claims-modal_0.1.14_1775228987418_0.11730807655081188","host":"s3://npm-registry-packages-npm-production"}},"0.1.15":{"name":"@basetime/a2w-claims-modal","version":"0.1.15","description":"Embeddable claims modal for Add to Wallet flows.","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"keywords":["claims","modal","react","wallet","widget"],"license":"UNLICENSED","repository":{"type":"git","url":"git+https://github.com/basetime/addtowallet.git","directory":"app/claims-modal"},"scripts":{"build":"NODE_ENV=production node build.mjs","build:npm":"NODE_ENV=production node build-npm.mjs","build:types":"pnpm tsc -p tsconfig.build.json","watch":"node build.mjs watch","watch:npm":"node build-npm.mjs watch","lint":"eslint --ext .ts,.tsx ./src","prepack":"pnpm build:npm && pnpm build:types","pack:dry-run":"pnpm prepack && rm -rf .pack && mkdir -p .pack && pnpm pack --pack-destination .pack && tar -tf .pack/*.tgz","test":"jest","test:watch":"jest --watchAll"},"engines":{"node":"22.12.0"},"packageManager":"pnpm@8.15.8","peerDependencies":{"@emotion/cache":"^11.14.0","@emotion/react":"^11.9.0","@emotion/styled":"^11.8.1","react":"^18.3.0","react-dom":"^18.1.0"},"devDependencies":{"@emotion/cache":"^11.14.0","@emotion/react":"^11.9.0","@emotion/styled":"^11.8.1","@jest/types":"^29.6.3","@types/jest":"^29.5.12","@types/node":"^17.0.39","@types/react":"^18.0.12","@types/react-dom":"^18.0.5","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.27.1","esbuild":"^0.27.2","eslint":"^8.9.0","eslint-config-google":"^0.14.0","eslint-import-resolver-typescript":"^2.7.1","eslint-plugin-a2w-recommended":"file:../frontend/.eslint/a2w-recommended","eslint-plugin-import":"^2.25.4","eslint-plugin-jsdoc":"^48.2.2","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","react":"^18.3.0","react-dom":"^18.1.0","ts-jest":"^29.2.4","typescript":"^5.5.3"},"_id":"@basetime/a2w-claims-modal@0.1.15","gitHead":"8e6db6d36841804409f59be4b56c1630c339f38e","bugs":{"url":"https://github.com/basetime/addtowallet/issues"},"homepage":"https://github.com/basetime/addtowallet#readme","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-znNrKxyGsdo5u7JgeQbHcFSYv9uMAugK2j4xJLN8Zhsx0Aw4zz/pbQnnX6YIcKb8NdKEvs7kn7OYZZMb/9pBeA==","shasum":"07b708d63913ef3c5b2babaa24d7568fb9fd7ee6","tarball":"https://registry.npmjs.org/@basetime/a2w-claims-modal/-/a2w-claims-modal-0.1.15.tgz","fileCount":28,"unpackedSize":132469,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFKvMsp9tKR2qMrn97r75pI49ywBoUJKMXcujXCo+Jz6AiABM0+xg0O4+xxuMLMDpgJ3iHsIIyW6jBwnKs0sqv/bLg=="}]},"_npmUser":{"name":"web-headzoo","email":"sean@headzoo.io"},"directories":{},"maintainers":[{"name":"basetime-io","email":"dev@basetime.io"},{"name":"anthonyzupancic","email":"anthonymzupancic@gmail.com"},{"name":"web-headzoo","email":"sean@headzoo.io"},{"name":"levergreen","email":"lowell.evergreen@avagate.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/a2w-claims-modal_0.1.15_1775478531631_0.8012094554554201"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-03T15:09:47.344Z","modified":"2026-04-06T12:28:52.260Z","0.1.14":"2026-04-03T15:09:47.613Z","0.1.15":"2026-04-06T12:28:51.782Z"},"bugs":{"url":"https://github.com/basetime/addtowallet/issues"},"license":"UNLICENSED","homepage":"https://github.com/basetime/addtowallet#readme","keywords":["claims","modal","react","wallet","widget"],"repository":{"type":"git","url":"git+https://github.com/basetime/addtowallet.git","directory":"app/claims-modal"},"description":"Embeddable claims modal for Add to Wallet flows.","maintainers":[{"name":"basetime-io","email":"dev@basetime.io"},{"name":"anthonyzupancic","email":"anthonymzupancic@gmail.com"},{"name":"web-headzoo","email":"sean@headzoo.io"},{"name":"levergreen","email":"lowell.evergreen@avagate.com"}],"readme":"# Claims Modal\n\nCreates a claims page popup modal that's embedded in pages with the following code.\n\n```html\n<script type=\"module\">\n  import { createClaimModal } from 'https://cdn.addtowallet.io/js/claim/modal/v0.1.15/claimsmodal.js';\n\n  const modal = createClaimModal({\n    baseUrl: 'https://staging.addtowallet.io',\n  });\n  modal.open({\n    campaign: '123456',\n    jwt: 'xxxxx.xxxx',\n  });\n</script>\n```\n\nThe same API is also available as an npm package:\n\n```ts\nimport { createClaimModal } from '@basetime/a2w-claims-modal';\n\nconst modal = createClaimModal({\n  baseUrl: 'https://staging.addtowallet.io',\n});\nmodal.open({\n  campaign: '123456',\n  jwt: 'xxxxx.xxxx',\n});\n```\n\nYou can also control which same-origin document the modal mounts into by passing `frame`:\n\n```html\n<script type=\"module\">\n  import { createClaimModal } from 'https://cdn.addtowallet.io/js/claim/modal/v0.1.15/claimsmodal.js';\n\n  const modal = createClaimModal({\n    frame: window.parent,\n  });\n\n  modal.open({\n    campaign: '123456',\n    jwt: 'xxxxx.xxxx',\n  });\n</script>\n```\n\n`app/claims-modal` is the standalone workspace for the popup claims modal.\n\nIt owns the modal bundle that can be embedded on a page and opened with `createClaimModal()`. The modal uses the shared claims UI that is also consumed by the full claims page flow elsewhere in the monorepo.\n\n## Create Options\n\n`createClaimModal()` accepts the following create options:\n\n- `design`: Partial claims page design overrides.\n- `baseUrl`: Optional backend origin used for relative modal requests. When omitted, the modal falls back to the build-time `BASE_URL` and then `window.location.origin`.\n- `target`: The element or selector where the modal mount node should be added.\n- `frame`: A same-origin `Window` or `HTMLIFrameElement` used to resolve the document for selectors, mount nodes, and injected assets.\n\nWhen `frame` is omitted, the modal uses the current page document.\n\nIf both `frame` and a string `target` are provided, the selector is resolved inside the frame document.\n\nSame-origin access is required when using `frame`. Cross-origin parent frames and iframes cannot be mounted into directly.\n\n## What This App Does\n\nThis workspace builds the browser bundle for the popup claims experience.\n\n- Entry point: `src/claimsmodal.tsx`\n- Build output: `build/claimsmodal.js`\n- npm entry point: `dist/index.js`\n- Package name: `@basetime/a2w-claims-modal`\n\nThe bundle is intended to be loaded by backend-rendered pages such as `app/backend/src/templates/claimmodal.html.twig`.\n\n## Install From npm\n\nInstall the published package together with its runtime peer dependencies:\n\n```bash\npnpm add @basetime/a2w-claims-modal react react-dom @emotion/react @emotion/styled\n```\n\nThe npm package is intended for browser-based React applications and exports:\n\n- `createClaimModal`\n- Public TypeScript types for the modal API\n\nThe existing CDN bundle remains available for `<script type=\"module\">` usage.\n\n## Install\n\nFrom the repository root:\n\n```bash\npnpm install\n```\n\nThis workspace uses:\n\n- Node `22.12.0`\n- pnpm `8.15.8`\n\nIf you want to work from inside the workspace directory:\n\n```bash\ncd app/claims-modal\n```\n\n## Watch\n\nUse the following URL to create popups for testing.\n\nhttps://localhost:5009/claimmodal\n\nTo rebuild the modal bundle on file changes:\n\n```bash\npnpm watch\n```\n\nThis runs `node build.mjs watch` and writes the bundle to:\n\n```text\napp/claims-modal/build/claimsmodal.js\n```\n\nNote: this watch command rebuilds the modal workspace output. If you are testing through backend-served `/assets/...` URLs, make sure the backend asset copy step is also up to date.\n\n## Build\n\nTo create a production build:\n\n```bash\npnpm build\n```\n\nThis runs:\n\n```bash\nNODE_ENV=production node build.mjs\n```\n\nThe build script uses the shared builder in `packages/builder/build.mjs` and emits an ESM bundle with source maps.\n\nTo create the npm package bundle:\n\n```bash\npnpm build:npm\n```\n\nThis writes the npm entry to:\n\n```text\napp/claims-modal/dist/index.js\n```\n\nTo emit the npm package type declarations:\n\n```bash\npnpm build:types\n```\n\n## Deploy To CDN\n\nThe workspace includes a deployment script for publishing the built modal bundle to the CDN.\n\nDeployment metadata is stored in:\n\n```text\napp/claims-modal/claimsmodal-cdn.json\n```\n\nThe current deploy script is:\n\n```text\napp/claims-modal/claimsmodal-build.sh\n```\n\nTo build and deploy the modal bundle:\n\n```bash\n./claimsmodal-build.sh\n```\n\nThe script will:\n\n- Run `pnpm build`\n- Read the current version from `claimsmodal-cdn.json`\n- Increment the patch version\n- Upload the contents of `build/` to `gs://cdn.addtowallet.io/js/claim/modal/v<version>`\n- Write the new version back to `claimsmodal-cdn.json`\n\nExample CDN output path:\n\n```text\nhttps://cdn.addtowallet.io/js/claim/modal/v0.1.14/claimsmodal.js\n```\n\nBefore deploying, make sure you have:\n\n- Access to the correct Google Cloud project and bucket\n- `gcloud` installed and authenticated\n- `jq` installed locally, since the script uses it to update the version file\n\n## Helpful Commands\n\nLint the workspace:\n\n```bash\npnpm lint\n```\n\nRun tests:\n\n```bash\npnpm test\n```\n\nRun tests in watch mode:\n\n```bash\npnpm test:watch\n```\n\nCreate the publishable npm tarball preview:\n\n```bash\npnpm pack:dry-run\n```\n","readmeFilename":"README.md"}