├── CHANGELOG.md ├── docs ├── pnpm-workspace.yaml ├── .npmrc ├── tsconfig.json ├── public │ ├── cover.jpg │ └── favicon.ico ├── layouts │ ├── default.vue │ └── docs.vue ├── renovate.json ├── .gitignore ├── .env.example ├── content │ ├── code.md │ ├── 3.composables │ │ ├── 2.useCldVideoUrl.md │ │ └── 1.useCldImageUrl.md │ ├── index.yml │ ├── 2.components │ │ ├── CldUploadButton.md │ │ ├── CldOgImage.md │ │ ├── CldMediaLibrary.md │ │ ├── CldProductGallery.md │ │ ├── CldImage │ │ │ ├── 1.usage.md │ │ │ ├── 3.examples.md │ │ │ └── 2.configuration.md │ │ ├── CldUploadWidget.md │ │ └── CldVideoPlayer.md │ └── 1.getting-started.md ├── server │ └── api │ │ └── search.json.get.ts ├── components │ └── content │ │ ├── ImageWithReplace.vue │ │ ├── ImageWithRecolor.vue │ │ ├── ImageWithCrop.vue │ │ ├── ImageWithExtract.vue │ │ ├── VideoPlayerWithEvents.vue │ │ ├── MediaLibrary.vue │ │ ├── ColoredVideoPlayer.vue │ │ ├── ImageWithEffects.vue │ │ ├── VideoPlayerWithChapters.vue │ │ ├── ProductGallery.vue │ │ ├── UploadWidget.vue │ │ ├── UploadButton.vue │ │ └── ImageWithOverlays.vue ├── package.json ├── README.md ├── pages │ ├── playground.vue │ ├── index.vue │ └── [...slug].vue ├── nuxt.config.ts ├── app.config.ts ├── tailwind.config.ts └── app.vue ├── .npmrc ├── .nuxtrc ├── playground ├── .env.example ├── package.json ├── nuxt.config.ts └── app.vue ├── tsconfig.json ├── .stackblitz ├── .gitignore ├── tsconfig.json ├── nuxt.config.ts ├── package.json ├── README.md └── app.vue ├── test ├── fixtures │ └── basic │ │ ├── package.json │ │ ├── nuxt.config.ts │ │ └── app.vue └── basic.test.ts ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── question.md │ ├── bug-report.md │ └── feature-request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── ci.yml ├── src ├── runtime │ ├── util │ │ └── triggerOnIdle.ts │ ├── components │ │ ├── CldUploadButton.vue │ │ ├── CldMediaLibrary.vue │ │ ├── CldProductGallery.vue │ │ ├── CldImage.vue │ │ ├── CldOgImage.vue │ │ ├── CldVideoPlayer.vue │ │ └── CldUploadWidget.vue │ └── composables │ │ ├── useCldVideoUrl.ts │ │ └── useCldImageUrl.ts └── module.ts ├── .editorconfig ├── eslint.config.js ├── .gitignore ├── LICENSE.md ├── package.json └── README.md /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: [] 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist=true 2 | strict-peer-dependencies=false 3 | -------------------------------------------------------------------------------- /.nuxtrc: -------------------------------------------------------------------------------- 1 | imports.autoImport=true 2 | typescript.includeWorkspace=true 3 | -------------------------------------------------------------------------------- /docs/.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist=true 2 | strict-peer-dependencies=false 3 | -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.nuxt/tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /playground/.env.example: -------------------------------------------------------------------------------- 1 | CLOUDINARY_CLOUD_NAME= 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./playground/.nuxt/tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /playground/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "my-module-playground" 4 | } 5 | -------------------------------------------------------------------------------- /docs/public/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuxt-modules/cloudinary/HEAD/docs/public/cover.jpg -------------------------------------------------------------------------------- /docs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuxt-modules/cloudinary/HEAD/docs/public/favicon.ico -------------------------------------------------------------------------------- /.stackblitz/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log* 3 | .nuxt 4 | .nitro 5 | .cache 6 | .output 7 | .env 8 | dist 9 | -------------------------------------------------------------------------------- /test/fixtures/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "basic", 4 | "type": "module" 5 | } 6 | -------------------------------------------------------------------------------- /docs/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /.stackblitz/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://v3.nuxtjs.org/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | -------------------------------------------------------------------------------- /docs/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "@nuxtjs" 4 | ], 5 | "lockFileMaintenance": { 6 | "enabled": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.iml 3 | .idea 4 | *.log* 5 | .nuxt 6 | .vscode 7 | .DS_Store 8 | coverage 9 | dist 10 | sw.* 11 | .env 12 | .output 13 | -------------------------------------------------------------------------------- /docs/.env.example: -------------------------------------------------------------------------------- 1 | # To use Nuxt UI Pro in production 2 | NUXT_UI_PRO_LICENSE= 3 | 4 | # Used when pre-rendering the docs for dynamic OG images 5 | NUXT_PUBLIC_SITE_URL= 6 | -------------------------------------------------------------------------------- /docs/content/code.md: -------------------------------------------------------------------------------- 1 | ```html [app.vue] 2 | 8 | ``` 9 | -------------------------------------------------------------------------------- /playground/nuxt.config.ts: -------------------------------------------------------------------------------- 1 | export default defineNuxtConfig({ 2 | modules: ['../src/module'], 3 | cloudinary: { 4 | cloudName: 'nuxt-cloudinary', 5 | url: {}, 6 | cloud: {}, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Nuxt Community Discord 4 | url: https://discord.nuxtjs.org/ 5 | about: Consider asking questions about the module here. 6 | -------------------------------------------------------------------------------- /.stackblitz/nuxt.config.ts: -------------------------------------------------------------------------------- 1 | // https://v3.nuxtjs.org/api/configuration/nuxt.config 2 | export default defineNuxtConfig({ 3 | modules: ['@nuxtjs/cloudinary'], 4 | cloudinary: { 5 | cloudName: 'nuxt-cloudinary', 6 | }, 7 | }) 8 | -------------------------------------------------------------------------------- /src/runtime/util/triggerOnIdle.ts: -------------------------------------------------------------------------------- 1 | export function triggerOnIdle(callback: any) { 2 | if (window && 'requestIdleCallback' in window) { 3 | return requestIdleCallback(callback) 4 | } 5 | return setTimeout(() => callback(), 1) 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/basic/nuxt.config.ts: -------------------------------------------------------------------------------- 1 | import MyModule from '../../../src/module' 2 | 3 | export default defineNuxtConfig({ 4 | modules: [ 5 | MyModule, 6 | ], 7 | cloudinary: { 8 | cloudName: 'nuxt-cloudinary', 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /docs/server/api/search.json.get.ts: -------------------------------------------------------------------------------- 1 | import { serverQueryContent } from '#content/server' 2 | 3 | export default eventHandler(async (event) => { 4 | return serverQueryContent(event).where({ _type: 'markdown', navigation: { $ne: false } }).find() 5 | }) 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_size = 2 5 | indent_style = space 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /docs/components/content/ImageWithReplace.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /docs/components/content/ImageWithRecolor.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /docs/components/content/ImageWithCrop.vue: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /docs/components/content/ImageWithExtract.vue: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /docs/components/content/VideoPlayerWithEvents.vue: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /test/fixtures/basic/app.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 15 | -------------------------------------------------------------------------------- /docs/components/content/MediaLibrary.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 17 | -------------------------------------------------------------------------------- /.stackblitz/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "build": "nuxt build", 5 | "dev": "nuxt dev", 6 | "generate": "nuxt generate", 7 | "preview": "nuxt preview", 8 | "postinstall": "nuxt prepare" 9 | }, 10 | "devDependencies": { 11 | "nuxt": "^3.11.2" 12 | }, 13 | "dependencies": { 14 | "@nuxtjs/cloudinary": "^4.0.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docs/components/content/ColoredVideoPlayer.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 19 | -------------------------------------------------------------------------------- /docs/components/content/ImageWithEffects.vue: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { createConfigForNuxt } from '@nuxt/eslint-config/flat' 3 | 4 | export default createConfigForNuxt({ 5 | features: { 6 | tooling: true, 7 | stylistic: true, 8 | }, 9 | dirs: { 10 | src: [ 11 | './playground', 12 | './docs', 13 | ], 14 | }, 15 | }).append({ 16 | rules: { 17 | '@typescript-eslint/no-explicit-any': 'off', 18 | }, 19 | ignores: ['.docs/'], 20 | }) 21 | -------------------------------------------------------------------------------- /docs/components/content/VideoPlayerWithChapters.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 20 | -------------------------------------------------------------------------------- /docs/components/content/ProductGallery.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question about the module. 4 | title: "" 5 | labels: "question" 6 | assignees: "" 7 | --- 8 | 9 | 17 | -------------------------------------------------------------------------------- /test/basic.test.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'node:url' 2 | import { describe, it, expect } from 'vitest' 3 | import { setup, $fetch } from '@nuxt/test-utils' 4 | 5 | describe('ssr', async () => { 6 | await setup({ 7 | rootDir: fileURLToPath(new URL('./fixtures/basic', import.meta.url)), 8 | }) 9 | 10 | it('renders the index page', async () => { 11 | const html = await $fetch('/') 12 | expect(html).toContain('

https://res.cloudinary.com/nuxt-cloudinary/image/upload/f_auto/q_auto/v1//cld-sample-5.jpg?_a=BBDAACAD0

') 13 | }) 14 | }) 15 | -------------------------------------------------------------------------------- /docs/components/content/UploadWidget.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 27 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@nuxt-modules/cloudinary-docs", 3 | "private": true, 4 | "scripts": { 5 | "dev": "nuxi dev", 6 | "build": "nuxi build", 7 | "generate": "nuxi generate", 8 | "preview": "nuxi preview" 9 | }, 10 | "devDependencies": { 11 | "@iconify-json/ph": "^1.1.10", 12 | "@iconify-json/simple-icons": "^1.1.87", 13 | "@nuxt/content": "^2.13.0", 14 | "@nuxt/devtools": "1.0.5", 15 | "@nuxt/ui-pro": "^1.3.1", 16 | "nuxt": "^3.12.1", 17 | "typescript": "^5.4.5" 18 | }, 19 | "dependencies": { 20 | "@nuxtjs/cloudinary": "^4.0.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs/layouts/docs.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 24 | -------------------------------------------------------------------------------- /src/runtime/components/CldUploadButton.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug report to help us improve the module. 4 | title: "" 5 | labels: "bug" 6 | assignees: "" 7 | --- 8 | 9 | 11 | 12 | ### Version 13 | 14 | @nuxtjs/cloudinary 15 | nuxt: 16 | 17 | ### Reproduction Link 18 | 19 | 23 | 24 | ### Steps to reproduce 25 | 26 | ### What is Expected? 27 | 28 | ### What is actually happening? 29 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Nuxt Cloudinary docs 2 | 3 | Docs template with [Nuxt UI](https://ui.nuxt.com). 4 | 5 | ## Setup 6 | 7 | Install dependencies inside `docs/`: 8 | 9 | ```bash 10 | pnpm i 11 | ``` 12 | 13 | ## Development 14 | 15 | ```bash 16 | pnpm run dev 17 | ``` 18 | 19 | ## Static Generation 20 | 21 | Use the `generate` command to build your application. 22 | 23 | The HTML files will be generated in the .output/public directory and ready to be deployed to any static compatible hosting. 24 | 25 | ```bash 26 | pnpm run generate 27 | ``` 28 | 29 | ## Preview build 30 | 31 | You might want to preview the result of your build locally, to do so, run the following command: 32 | 33 | ```bash 34 | pnpm run preview 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/pages/playground.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 |