{"_id":"@brizy/cloud-media-upload","_rev":"10-306295100156fec51a1defaac1a6d626","name":"@brizy/cloud-media-upload","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.3":{"name":"@brizy/cloud-media-upload","version":"1.0.3","keywords":["brizy","cloud","media","upload","files","image","font"],"author":{"name":"brizy"},"license":"MIT","_id":"@brizy/cloud-media-upload@1.0.3","maintainers":[{"name":"oleg-brizy","email":"oleg@brizy.io"},{"name":"sergiu.bagrin","email":"sergey.roxigo@gmail.com"},{"name":"maxval","email":"maxvalwork1991@gmail.com"},{"name":"gheorghep","email":"pisarenco.gh@gmail.com"},{"name":"lift46252","email":"sasa.lefter@gmail.com"},{"name":"redd97","email":"kingstoonesis@gmail.com"},{"name":"victor-pg","email":"victor.poalelungi1@gmail.com"}],"homepage":"https://github.com/EasyBrizy/Brizy-Local-Editor#readme","bugs":{"url":"https://github.com/EasyBrizy/Brizy-Local-Editor/issues"},"dist":{"shasum":"6c7f27ed7ae4accde32e4812ed1c4a33d1057f9d","tarball":"https://registry.npmjs.org/@brizy/cloud-media-upload/-/cloud-media-upload-1.0.3.tgz","fileCount":47,"integrity":"sha512-wTmeCWP/b5qdxqdGy5w0CmY7tB46OqBE3YGkCFtyad9NVwj6mVDE5Kos6wlbXSqzw3ioEoPpW0YQDYW4R850Dw==","signatures":[{"sig":"MEUCIQC6wnS1dbcMuDmav5oIqzYnqEYpIf5hYTke8Tz4vSu+MwIgMowi5SgjN+3td22h/n+ExLhnF6P4Dt4mbEOPOgnPf48=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":132100},"types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./dist/*.css":"./dist/*.css"},"gitHead":"4973130c71438fffd45c0468725f363b6f6faaf0","scripts":{"dev":"npm run clean && npm run copy:styles && npm run dev:all","tsc":"tsc --noEmit","build":"npm run clean && npm run copy:styles && npm run build:all","clean":"rimraf dist","dev:all":"concurrently \"npm run dev:esm\" \"npm run dev:cjs\" \"npm run dev:types\"","dev:cjs":"tsc -p tsconfig.cjs.json --watch","dev:esm":"tsc -p tsconfig.esm.json --watch","build:all":"concurrently \"npm run build:esm\" \"npm run build:cjs\" \"npm run build:types\"","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","dev:types":"tsc -p tsconfig.types.json --watch","build:types":"tsc -p tsconfig.types.json","copy:styles":"cpy src/style.css dist --flat","prepublishOnly":"npm run tsc && npm run build"},"_npmUser":{"name":"redd97","email":"kingstoonesis@gmail.com"},"repository":{"url":"git+https://github.com/EasyBrizy/Brizy-Local-Editor.git","type":"git"},"_npmVersion":"10.5.2","description":"Upload media in Brizy Cloud","directories":{},"_nodeVersion":"20.13.1","dependencies":{"zod":"^3.24.4","@brizy/media-gallery":"^1.1.5"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","cpy-cli":"^5.0.0","prettier":"3.5.3","typescript":"^5.8.3","concurrently":"^9.1.2"},"peerDependencies":{"react":"^18.0.0","@brizy/ui":"^0.9.92","react-dom":"^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cloud-media-upload_1.0.3_1748866913649_0.011900649104559902","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@brizy/cloud-media-upload","version":"1.0.4","keywords":["brizy","cloud","media","upload","files","image","font"],"author":{"name":"brizy"},"license":"MIT","_id":"@brizy/cloud-media-upload@1.0.4","maintainers":[{"name":"oleg-brizy","email":"oleg@brizy.io"},{"name":"sergiu.bagrin","email":"sergey.roxigo@gmail.com"},{"name":"maxval","email":"maxvalwork1991@gmail.com"},{"name":"gheorghep","email":"pisarenco.gh@gmail.com"},{"name":"lift46252","email":"sasa.lefter@gmail.com"},{"name":"redd97","email":"kingstoonesis@gmail.com"},{"name":"victor-pg","email":"victor.poalelungi1@gmail.com"}],"homepage":"https://github.com/EasyBrizy/Brizy-Local-Editor#readme","bugs":{"url":"https://github.com/EasyBrizy/Brizy-Local-Editor/issues"},"dist":{"shasum":"fe285ecc228744ed2f364af1cb44b9b4c456b3e5","tarball":"https://registry.npmjs.org/@brizy/cloud-media-upload/-/cloud-media-upload-1.0.4.tgz","fileCount":47,"integrity":"sha512-DFVqgQouLICvGo2T2qsGdNCU/ikRK3hyPMRkO7CPAhk7ez7P7r1eDhvRCAijwjpw68sSNT/otHQ6OfOprVN+UQ==","signatures":[{"sig":"MEUCIB89N3EoTFHkTuDqJ5w6YBijWexd+FbjgPf7QCa6Hvb/AiEA6xgeRV0KI2iL9k+wT8RXnFfRXFV8//qChUv6NZOfKgM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":131262},"types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./dist/*.css":"./dist/*.css"},"gitHead":"cab5845c7a69abe6c2512d6b823eb9d3c56fe9b4","scripts":{"dev":"npm run clean && npm run copy:styles && npm run dev:all","tsc":"tsc --noEmit","build":"npm run clean && npm run copy:styles && npm run build:all","clean":"rimraf dist","dev:all":"concurrently \"npm run dev:esm\" \"npm run dev:cjs\" \"npm run dev:types\"","dev:cjs":"tsc -p tsconfig.cjs.json --watch","dev:esm":"tsc -p tsconfig.esm.json --watch","build:all":"concurrently \"npm run build:esm\" \"npm run build:cjs\" \"npm run build:types\"","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","dev:types":"tsc -p tsconfig.types.json --watch","build:types":"tsc -p tsconfig.types.json","copy:styles":"cpy src/style.css dist --flat","prepublishOnly":"npm run tsc && npm run build"},"_npmUser":{"name":"redd97","email":"kingstoonesis@gmail.com"},"repository":{"url":"git+https://github.com/EasyBrizy/Brizy-Local-Editor.git","type":"git"},"_npmVersion":"10.5.2","description":"Upload media in Brizy Cloud","directories":{},"_nodeVersion":"20.13.1","dependencies":{"zod":"^3.24.4","@brizy/media-gallery":"^1.1.5"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","cpy-cli":"^5.0.0","prettier":"3.5.3","typescript":"^5.8.3","concurrently":"^9.1.2"},"peerDependencies":{"react":"^18.0.0","@brizy/ui":"^0.9.92","react-dom":"^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cloud-media-upload_1.0.4_1748872699310_0.500597521755137","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-06-02T12:21:53.554Z","modified":"2026-06-04T14:06:00.942Z","1.0.0":"2025-06-02T06:48:18.027Z","1.0.1":"2025-06-02T12:07:10.862Z","1.0.2":"2025-06-02T12:15:30.524Z","1.0.3":"2025-06-02T12:21:53.825Z","1.0.4":"2025-06-02T13:58:19.498Z"},"bugs":{"url":"https://github.com/EasyBrizy/Brizy-Local-Editor/issues"},"author":{"name":"brizy"},"license":"MIT","homepage":"https://github.com/EasyBrizy/Brizy-Local-Editor#readme","keywords":["brizy","cloud","media","upload","files","image","font"],"repository":{"url":"git+https://github.com/EasyBrizy/Brizy-Local-Editor.git","type":"git"},"description":"Upload media in Brizy Cloud","maintainers":[{"email":"sergey.roxigo@gmail.com","name":"sergiu.bagrin"},{"email":"maxvalwork1991@gmail.com","name":"maxval"},{"email":"pisarenco.gh@gmail.com","name":"gheorghep"},{"email":"sasa.lefter@gmail.com","name":"lift46252"},{"email":"kingstoonesis@gmail.com","name":"redd97"},{"email":"elementaryartgun@gmail.com","name":"artgun1"},{"email":"victor.poalelungi1@gmail.com","name":"victor-pg"}],"readme":"# 📦 Brizy Cloud Image Uploader\n\nThis npm package is designed to enable seamless image uploads from within the editor's image toolbar. It integrates cloud storage support, allowing users to upload images directly through the editor interface. This functionality is particularly useful for developers building custom (third-party) elements, such as image-based components, by simplifying the process of handling and referencing uploaded media.\n\nUse this package to streamline image handling and enhance the development of dynamic, user-driven components in your editor environment.\n\n🌟 Features\n\n- Zero Configuration Setup: Initialize in seconds with only a clientID.\n- Flexible Mounting: Optionally attach the modal to any HTMLElement or default to document.body.\n- Batch Operations: Upload multiple images at once, select or multi-select for deletion, and rename.\n- Intuitive UX: Clean, modal-driven interface matches Brizy’s look and feel.\n- Seamless Integration: Returns a handler for api.media in the Brizy editor configuration.\n- Dual Module Support: Ships in both ESM and CommonJS formats.\n- Development: Enables development mode, which provides additional logs for debugging purposes.\n\n## 🚀 Installation\n\n```bash\nnpm install @brizy/cloud-media-upload\n# or\nyarn add @brizy/cloud-media-upload\n```\n\n## ⚙️ Quick Start\n\n```ts\n// ESM import\nimport MediaUpload from \"@brizy/cloud-media-upload\";\nimport \"@brizy/cloud-media-upload/dist/style.css\";\n\n// CommonJS require\n// const BrizyCloudUploader = require('@brizy/cloud-media-upload').default;\n\n// Initialize uploader\nconst node = document.querySelector<HTMLElement>(\".myContainer\");\n\nconst uploader = new MediaUpload({\n  clientId: \"YOUR_CLIENT_ID\", // required\n  node, // optional\n  isDev: false, // optional\n});\n\n// Inject into Brizy editor config\nconfig = {\n  // ...otherKeys\n  api: {\n    // ...otherKeys\n    media: uploader.mediaConfig,\n  },\n};\n```\n\n🧩 API Reference\n\n| Option     | Type               | Required | Default                                                                    | Description                                                                                                                                                                                                       |\n| ---------- | ------------------ | -------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `node`     | `HTMLDivElement`   | No       | Automatically created in document.body as <div class=\"cloud-media-upload\"> | DOM node where the media uploader interface will be mounted. If not provided, the uploader will automatically create a <div class=\"cloud-media-upload\"> inside document.body and use it as the default container. |\n| `clientId` | `string \\| number` | Yes      | –                                                                          | Unique client identifier used to authenticate.                                                                                                                                                                    |\n| `isDev`    | `boolean`          | No       | `false`                                                                    | Enables development mode with additional logs .                                                                                                                                                                   |\n\n```ts\nnew MediaUpload({\n  clientId: 40302010,\n});\n```\n\n## Properties\n\n`resizeUrl: string`\nReturns the image resize service URL. Chooses between production and development URLs based on isDev.\n\n`resizePatterns: Array`\nReturns the set of image resize patterns depending on the environment.\n\n`addMedia: { handler: Function }`\nReturns an object containing the media insertion handler function.\n\n`mediaConfig: { addMedia, mediaResizeUrl, imagePatterns }`\nReturns the complete media configuration object for Brizy editor.\n\n## 🖼️ Modal UI Workflow\n\n1. Open Modal: Triggered by the editor’s image toolbar button.\n2. Add Files: Click “Add Files” to select one or more images.\n3. Manage Images:\n   - Select: Single-click to choose images.\n   - Bulk Delete: Multi-select and click “Delete”.\n   - Rename: Click on an image name to edit.\n4. Insert: Select image and click “Insert File” to inject into the editor.\n\n## 🔧 Development Mode\n\nToggle sandbox environment for testing:\n\n```ts\nconst uploader = new MediaUpload({\n  clientID: \"DEV_ID\",\n  isDev: true,\n});\n```\n\n## 🛠️ Build & Distribution\n\nDistributed as both ESM and CJS:\nESM: dist/esm/index.js\nCJS: dist/cjs/index.js\n\nNo additional bundler configuration needed.\n\n## 🙋‍♂️ Support\n\nIf you find a bug or want to suggest a feature, feel free\nto [open an issue](https://github.com/EasyBrizy/Brizy-Local-Editor) (or other repo?).\n","readmeFilename":"README.md"}