{"_id":"@botanicastudios/stl-viewer","_rev":"2-ceabd8167a0fc6bb01b45cb1e7a90871","name":"@botanicastudios/stl-viewer","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@botanicastudios/stl-viewer","version":"0.0.1","keywords":["stl","viewer","3d","web-component","three.js"],"author":{"name":"Travis Geis"},"license":"MIT","_id":"@botanicastudios/stl-viewer@0.0.1","maintainers":[{"name":"tnjm","email":"toby.m@rsden.com"}],"homepage":"https://github.com/botanicastudios/stl-viewer","bugs":{"url":"https://github.com/botanicastudios/stl-viewer/issues"},"dist":{"shasum":"e6b382b5eefe3d75957b6e369cf0d27627ea7423","tarball":"https://registry.npmjs.org/@botanicastudios/stl-viewer/-/stl-viewer-0.0.1.tgz","fileCount":5,"integrity":"sha512-qK4DEEZN1krYCfAE7NYG0/LuPglloMcrRs+Ul/pldeKRi+9vu5Tq0ouBG3MfiQLN/tUmBQnP8V1ZL6xdi8DKiA==","signatures":[{"sig":"MEYCIQCj2L5aLD8Pm2BTnovD3+k/b6vVLWgmkpVuJRRCqRzZXAIhALQgHI7ndrS3jVU+h9AOhJDwFzlLZoZyiXtiMpiAkMAU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1059280},"main":"dist/stl-viewer.umd.cjs","type":"module","unpkg":"dist/stl-viewer.umd.cjs","module":"dist/stl-viewer.js","gitHead":"54e7231b0ca8a3981980402131afcd189dd02af6","scripts":{"dev":"vite","build":"vite build","prepublishOnly":"npm run build"},"_npmUser":{"name":"tnjm","email":"toby.m@rsden.com"},"jsdelivr":"dist/stl-viewer.umd.cjs","repository":{"url":"git+https://github.com/botanicastudios/stl-viewer.git","type":"git"},"_npmVersion":"10.7.0","description":"A simple and lightweight STL file viewer web component","directories":{},"_nodeVersion":"18.20.3","dependencies":{"three":"^0.159.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.10"},"_npmOperationalInternal":{"tmp":"tmp/stl-viewer_0.0.1_1746661389703_0.3846183276727464","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@botanicastudios/stl-viewer","version":"0.0.2","description":"A simple and lightweight STL file viewer web component","type":"module","main":"dist/stl-viewer.iife.js","module":"dist/stl-viewer.js","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/botanicastudios/stl-viewer.git"},"homepage":"https://github.com/botanicastudios/stl-viewer","bugs":{"url":"https://github.com/botanicastudios/stl-viewer/issues"},"jsdelivr":"dist/stl-viewer.iife.js","unpkg":"dist/stl-viewer.iife.js","scripts":{"dev":"vite --config vite.dev.js","build":"vite build","prepublishOnly":"npm run build"},"keywords":["stl","viewer","3d","web-component","three.js"],"author":{"name":"Travis Geis"},"license":"MIT","dependencies":{"three":"^0.159.0"},"devDependencies":{"vite":"^5.0.10"},"_id":"@botanicastudios/stl-viewer@0.0.2","gitHead":"0fafe250de41f5eab386fb980a686c684b85673e","_nodeVersion":"18.20.3","_npmVersion":"10.7.0","dist":{"integrity":"sha512-NLfyI3AVsWGomAoEEEMbbjC/Qr67B1+WmMyses3Lmwqz1LTOv03MZGOWWQ6pRNPf4CpJDKCSgTmvO12/PYDu8Q==","shasum":"92f9d79ef8f2a255d964e542e289182e81ed753d","tarball":"https://registry.npmjs.org/@botanicastudios/stl-viewer/-/stl-viewer-0.0.2.tgz","fileCount":5,"unpackedSize":1065316,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDiu1jvX7RE7GyS0HKQZCA+vmsoEAAUslECQzIAodPoWQIhAO6AzUGEjnwrIHz06YanEi4XmOudrQLpjpBuQKQp2WGv"}]},"_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/stl-viewer_0.0.2_1746665169625_0.580310471499708"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-07T23:43:09.633Z","modified":"2025-05-08T00:46:10.030Z","0.0.1":"2025-05-07T23:43:09.950Z","0.0.2":"2025-05-08T00:46:09.843Z"},"bugs":{"url":"https://github.com/botanicastudios/stl-viewer/issues"},"author":{"name":"Travis Geis"},"license":"MIT","homepage":"https://github.com/botanicastudios/stl-viewer","keywords":["stl","viewer","3d","web-component","three.js"],"repository":{"type":"git","url":"git+https://github.com/botanicastudios/stl-viewer.git"},"description":"A simple and lightweight STL file viewer web component","maintainers":[{"name":"tnjm","email":"toby.m@rsden.com"}],"readme":"# STL Viewer Web Component\n\nA simple and lightweight STL file viewer web component built with Three.js and bundled with Vite.\n\n## Installation\n\n### NPM\n\n```bash\n# Install from npm\nnpm install @botanicastudios/stl-viewer\n\n# Or include directly from jsDelivr\n<script src=\"https://cdn.jsdelivr.net/npm/@botanicastudios/stl-viewer@0.0.1/dist/stl-viewer.iife.js\"></script>\n```\n\nFor development:\n\n```bash\n# Clone repository and install dependencies\nnpm install\n\n# Run development server\nnpm run dev\n\n# Build for production\nnpm run build\n```\n\n## Usage\n\nAfter installing, include the script in your HTML and use the custom element. There are two ways to use this component:\n\n### 1. Using the IIFE Build (Auto-Registration)\n\nThis approach automatically registers the custom element, making it simpler to use:\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <style>\n      stl-viewer {\n        width: 500px;\n        height: 500px;\n        display: block;\n      }\n    </style>\n    <!-- Include the IIFE build which auto-registers the component -->\n    <script src=\"node_modules/@botanicastudios/stl-viewer/dist/stl-viewer.iife.js\"></script>\n  </head>\n  <body>\n    <!-- Use the component with a path to your STL file -->\n    <stl-viewer\n      model=\"path/to/your/model.stl\"\n      autorotate=\"initial\"\n    ></stl-viewer>\n  </body>\n</html>\n```\n\n### 2. Using ES Module Build (Manual Registration)\n\nThis approach gives you more control and is better for modern build systems:\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <style>\n      stl-viewer {\n        width: 500px;\n        height: 500px;\n        display: block;\n      }\n    </style>\n  </head>\n  <body>\n    <!-- Create a container for the viewer -->\n    <div id=\"stl-container\"></div>\n\n    <!-- Import as an ES module -->\n    <script type=\"module\">\n      import { STLViewer } from \"./node_modules/@botanicastudios/stl-viewer/dist/stl-viewer.js\";\n\n      // Register the element if not already registered\n      if (!customElements.get(\"stl-viewer\")) {\n        customElements.define(\"stl-viewer\", STLViewer);\n      }\n\n      // Create and use the element\n      const viewer = document.createElement(\"stl-viewer\");\n      viewer.setAttribute(\"model\", \"path/to/your/model.stl\");\n      viewer.setAttribute(\"autorotate\", \"initial\");\n      viewer.style.width = \"100%\";\n      viewer.style.height = \"100%\";\n      document.getElementById(\"stl-container\").appendChild(viewer);\n    </script>\n  </body>\n</html>\n```\n\n### Using jsDelivr CDN\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <style>\n      stl-viewer {\n        width: 500px;\n        height: 500px;\n        display: block;\n      }\n    </style>\n    <!-- Include the IIFE version from jsDelivr -->\n    <script src=\"https://cdn.jsdelivr.net/npm/@botanicastudios/stl-viewer@0.0.1/dist/stl-viewer.iife.js\"></script>\n  </head>\n  <body>\n    <!-- Use the component with a path to your STL file -->\n    <stl-viewer\n      model=\"path/to/your/model.stl\"\n      autorotate=\"initial\"\n    ></stl-viewer>\n  </body>\n</html>\n```\n\n## Attributes\n\n- `model`: (Required) Path to the STL file to display.\n- `autorotate`: (Optional) Enable auto-rotation of the model. Options:\n  - `autorotate` or `autorotate=\"1\"`: Always rotate the model\n  - `autorotate=\"2\"` (or any number): Rotate at specified speed\n  - `autorotate=\"initial\"`: Rotate until the user interacts with the model\n\n## Features\n\n- Renders STL files in 3D\n- Orbit controls for rotating and zooming\n- Auto-rotates the model\n- Loading indicator while model downloads\n- Responsive design\n- Uses web components for encapsulation\n- Safe for multiple script loads on the same page\n","readmeFilename":"README.md"}