{"_id":"@abhilashgoswami/document-core","_rev":"2-5e3f5308b350c5f818cde0f13d640410","name":"@abhilashgoswami/document-core","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.6":{"name":"@abhilashgoswami/document-core","version":"0.0.6","author":{"name":"abhilash.goswami@phamax.ch"},"license":"MIT","_id":"@abhilashgoswami/document-core@0.0.6","maintainers":[{"name":"abhilashgoswami","email":"abhilash.goswami@phamax.ch"}],"dist":{"shasum":"b93acbb71031c1fde42a6823cc2d92ee3b7c5b56","tarball":"https://registry.npmjs.org/@abhilashgoswami/document-core/-/document-core-0.0.6.tgz","fileCount":31,"integrity":"sha512-tS3RXDMswjH09194pq3buvFhEB/bqVbOAPb8BYz3ZEtOKz5uJTcxljspW/uXRHekvuaON44RJkdHAKG1tYDQZQ==","signatures":[{"sig":"MEYCIQC10q4RZHmJd0ldaf7ThYUstG0vs+1+iMwrG/AL8J/zGAIhAN7r5irvjo3ACXSus6IVCA+td1m/tyvmv0s3g+Hf4gLH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15309},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"7861dd0dccac322c63120638a3f958ac0f2e2ed9","scripts":{"build":"npx tsc"},"_npmUser":{"name":"abhilashgoswami","email":"abhilash.goswami@phamax.ch"},"_npmVersion":"10.8.2","description":"Tools to render waypoint-style documents (core package)","directories":{},"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"peerDependencies":{"zod":"^1 || ^2 || ^3","react":"^16 || ^17 || ^18"},"_npmOperationalInternal":{"tmp":"tmp/document-core_0.0.6_1724661995806_0.8972404288405709","host":"s3://npm-registry-packages"}},"0.0.7":{"name":"@abhilashgoswami/document-core","version":"0.0.7","author":{"name":"abhilash.goswami@phamax.ch"},"license":"MIT","_id":"@abhilashgoswami/document-core@0.0.7","maintainers":[{"name":"abhilashgoswami","email":"abhilash.goswami@phamax.ch"}],"dist":{"shasum":"e432de7283e51acc8f59a85993bab8cf8a41dc25","tarball":"https://registry.npmjs.org/@abhilashgoswami/document-core/-/document-core-0.0.7.tgz","fileCount":23,"integrity":"sha512-13VyFzHMQNgXClyEv5Dw7ilHRuQjOnCO/qlVwEVjpsOqYfcXxQBzap08fYCyNHrgTCWMsXpubBQJ9grGyP3rsg==","signatures":[{"sig":"MEQCIGBXUadU52Etb6vigwXTzMdobqVGAi7/h9vAxCejYqk5AiB8WTnhylXYWY8KQ59ZknLbehaYzTVwnyqGKZz6AYa8Mw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11360},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"7861dd0dccac322c63120638a3f958ac0f2e2ed9","scripts":{"build":"npx tsc"},"_npmUser":{"name":"abhilashgoswami","email":"abhilash.goswami@phamax.ch"},"_npmVersion":"10.8.2","description":"Tools to render waypoint-style documents (core package)","directories":{},"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"peerDependencies":{"zod":"^1 || ^2 || ^3","react":"^16 || ^17 || ^18"},"_npmOperationalInternal":{"tmp":"tmp/document-core_0.0.7_1724662721861_0.26129560735369073","host":"s3://npm-registry-packages"}},"0.0.8":{"name":"@abhilashgoswami/document-core","version":"0.0.8","description":"Tools to render waypoint-style documents (core package)","type":"module","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"scripts":{"build":"rollup -c rollup.config.mjs && node scripts/post-build.js"},"author":{"name":"abhilash.goswami@phamax.ch"},"license":"MIT","peerDependencies":{"react":"^16 || ^17 || ^18","zod":"^1 || ^2 || ^3"},"devDependencies":{"@testing-library/react":"^14.2.1","@types/insane":"^1.0.0","@rollup/plugin-typescript":"^11.1.6","rollup":"^4.21.0","tslib":"^2.7.0"},"_id":"@abhilashgoswami/document-core@0.0.8","gitHead":"8afe6fda8985b8732efaac90e675692a45992866","_nodeVersion":"18.20.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-FpVMw15vLwsU22ol2u5zwQwFCJxfpFxhGz+JHQwnoR9TifMeaZ33m/57qJXSt1gOD9PfPocIgTsp+OJhL8/0yA==","shasum":"618e08d8f63d96e7c8066bca46eded273b94ad6d","tarball":"https://registry.npmjs.org/@abhilashgoswami/document-core/-/document-core-0.0.8.tgz","fileCount":16,"unpackedSize":10949,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBFWWdG9SmliQlFPA2p1kqLGlTA/Quz7UugGW7cuehLQIhAOd4ezt1JHNoOGG0Jt8gYRzHUb0GtO0tmvFTMHgIpPbZ"}]},"_npmUser":{"name":"abhilashgoswami","email":"abhilash.goswami@phamax.ch"},"directories":{},"maintainers":[{"name":"abhilashgoswami","email":"abhilash.goswami@phamax.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/document-core_0.0.8_1724668575463_0.5291298831015792"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-26T08:46:35.719Z","modified":"2024-08-26T10:36:15.775Z","0.0.6":"2024-08-26T08:46:35.934Z","0.0.7":"2024-08-26T08:58:42.036Z","0.0.8":"2024-08-26T10:36:15.611Z"},"author":{"name":"abhilash.goswami@phamax.ch"},"license":"MIT","description":"Tools to render waypoint-style documents (core package)","maintainers":[{"name":"abhilashgoswami","email":"abhilash.goswami@phamax.ch"}],"readme":"# @usewaypoint/document-core\r\n\r\nThis is the core library used to build the email messages at [Waypoint](https://www.usewaypoint.com). It is non-opinionated and light on dependencies so that it can be used to compose complex documents.\r\n\r\n> [!WARNING]\r\n> This library is still under development and the final interface is subject\r\n> to change\r\n\r\n## Installation\r\n\r\n**Installation with npm**\r\n\r\n```\r\nnpm install --save @usewaypoint/document-core\r\n```\r\n\r\n## Usage\r\n\r\nThe root of the library is the `DocumentBlocksDictionary` dictionary. This is a mapping of block names to an object with a zod schema and a corresponding React Component.\r\n\r\n```\r\nconst dictionary = {\r\n  Alert: {\r\n    schema: z.object({\r\n      message: z.string(),\r\n    }),\r\n    Component: ({ message }: { message: string }) => {\r\n      return <div>{message.toUpperCase()}</div>\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nThis dictionary object is passed as an argument to the builder functions.\r\n\r\n### `buildBlockComponent`\r\n\r\n```\r\nconst Block = buildBlockComponent(dictionary);\r\n\r\n<Block type=\"Alert\" data={{message: 'Hello World' }} />\r\n```\r\n\r\n### `buildBlockConfigurationSchema`\r\n\r\n```\r\nconst Schema = buildBlockConfigurationSchema(dictionary);\r\n\r\nconst parsedData = Schema.safeParse({\r\n  type: 'Alert',\r\n  data: { message: 'Hello World' },\r\n});\r\n```\r\n","readmeFilename":"README.md"}