{"_id":"@adopted-ember-addons/ember-cli-clipboard","name":"@adopted-ember-addons/ember-cli-clipboard","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@adopted-ember-addons/ember-cli-clipboard","version":"1.0.0","description":"An Ember addon that wraps clipboard.js to copy or cut text to the clipboard. A maintained fork of ember-cli-clipboard.","keywords":["ember-addon","clipboard","clipboard.js","copy","cut"],"homepage":"https://github.com/adopted-ember-addons/ember-cli-clipboard#readme","bugs":{"url":"https://github.com/adopted-ember-addons/ember-cli-clipboard/issues"},"repository":{"type":"git","url":"git+https://github.com/adopted-ember-addons/ember-cli-clipboard.git"},"license":"MIT","author":{"name":"adopted-ember-addons","url":"https://github.com/adopted-ember-addons"},"imports":{"#src/*":"./src/*"},"exports":{".":{"types":"./declarations/index.d.ts","default":"./dist/index.js"},"./addon-main.js":"./addon-main.cjs","./*.css":"./dist/*.css","./*":{"types":"./declarations/*.d.ts","default":"./dist/*.js"}},"scripts":{"build":"rollup --config","build:demo":"BUILD_DEMO=true vite build --base=/ember-cli-clipboard/ --out-dir dist-demo","format":"prettier . --cache --write","lint":"concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto","lint:fix":"concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format","lint:format":"prettier . --cache --check","lint:hbs":"ember-template-lint . --no-error-on-unmatched-pattern","lint:hbs:fix":"ember-template-lint . --fix --no-error-on-unmatched-pattern","lint:js":"eslint . --cache","lint:js:fix":"eslint . --fix","lint:publish":"pnpm build && publint run --level error","lint:types":"ember-tsc --noEmit","prepack":"rollup --config","start":"vite dev","test":"vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0"},"dependencies":{"@embroider/addon-shim":"^1.10.2","clipboard":"^2.0.11","decorator-transforms":"^2.3.2"},"devDependencies":{"@babel/core":"^7.29.7","@babel/eslint-parser":"^7.29.7","@babel/plugin-transform-typescript":"^7.29.7","@babel/runtime":"^7.29.7","@ember/app-tsconfig":"^2.0.0","@ember/library-tsconfig":"^2.0.0","@ember/test-helpers":"^5.4.2","@ember/test-waiters":"^4.1.1","@embroider/addon-dev":"^8.3.0","@embroider/compat":"^4.1.19","@embroider/core":"^4.6.0","@embroider/macros":"^1.20.3","@embroider/vite":"^1.7.5","@eslint/js":"^9.39.4","@glimmer/component":"^2.1.1","@glint/ember-tsc":"^1.8.0","@glint/template":"^1.7.7","@glint/tsserver-plugin":"^2.5.6","@rollup/plugin-babel":"^7.1.0","@types/qunit":"^2.19.14","babel-plugin-ember-template-compilation":"^4.0.0","concurrently":"^10.0.0","ember-modifier":"^4.3.0","ember-page-title":"^9.0.3","ember-qunit":"^9.0.4","ember-source":"^7.0.0","ember-strict-application-resolver":"^0.1.1","ember-template-lint":"^7.9.3","eslint":"^9.39.4","eslint-config-prettier":"^10.1.8","eslint-plugin-ember":"^13.3.2","eslint-plugin-import":"^2.32.0","eslint-plugin-n":"^18.0.1","globals":"^17.6.0","prettier":"^3.8.3","prettier-plugin-ember-template-tag":"^2.1.6","publint":"^0.3.21","qunit":"^2.25.0","qunit-dom":"^3.5.1","release-plan":"^0.18.0","rollup":"^4.60.4","shiki":"^4.1.0","testem":"^3.20.1","typescript":"~6.0.3","typescript-eslint":"^8.60.0","vite":"^8.0.14"},"peerDependencies":{"@ember/test-helpers":">= 4.0.0","ember-modifier":">= 4.0.0"},"peerDependenciesMeta":{"@ember/test-helpers":{"optional":true}},"packageManager":"pnpm@10.34.1+sha512.b58fbde6dca66a929538021581f648b4570b6ca19b18e7cbd7f2c07a7b24454155388dacdf08f2af3678e88a6d1fe04f9d609df24bf51735a060ea041b374ab7","engines":{"node":">=22","pnpm":">=10"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"ember":{"edition":"octane"},"ember-addon":{"version":2,"type":"addon","main":"addon-main.cjs","app-js":{"./components/copy-button.js":"./dist/_app_/components/copy-button.js","./helpers/is-clipboard-supported.js":"./dist/_app_/helpers/is-clipboard-supported.js","./modifiers/clipboard.js":"./dist/_app_/modifiers/clipboard.js"}},"_id":"@adopted-ember-addons/ember-cli-clipboard@1.0.0","gitHead":"58d25cfad31e008aea838d1ac76fadb86b47c59f","_nodeVersion":"24.0.2","_npmVersion":"11.3.0","dist":{"integrity":"sha512-iSarQSlyeQncG6QohC4ueznQFNr/Qpu5e58CGEM+7zCex6OlgB/c/IQp0vfI2E4V5vUqYj10piqQu1p6KzBMOg==","shasum":"07af6c43789a84a5f4941cba046786ed246c005f","tarball":"https://registry.npmjs.org/@adopted-ember-addons/ember-cli-clipboard/-/ember-cli-clipboard-1.0.0.tgz","fileCount":37,"unpackedSize":54843,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDLXna14d1RR4ohn75ZWbsk/nDHe9cte+bDjIqkEiqK0QIgHY0ayyBX57i10YXlboZ+KLg0Y6U3wDw3dtykcpDlM7k="}]},"_npmUser":{"name":"rwwagner90","email":"rwwagner90@gmail.com"},"directories":{},"maintainers":[{"name":"alexlafroscia","email":"alex@lafroscia.com"},{"name":"melsumner","email":"melaniersumner@gmail.com"},{"name":"scottkidder","email":"scott.kidder11@gmail.com"},{"name":"toranb","email":"toranb@gmail.com"},{"name":"knownasilya","email":"knownasilya@gmail.com"},{"name":"alonbukai","email":"alonzorz@gmail.com"},{"name":"rwjblue","email":"me@rwjblue.com"},{"name":"st-h","email":"Steve.Hummingbird@yandex.com"},{"name":"the-bionic","email":"inem.patrick@gmail.com"},{"name":"john.derr","email":"john.derr@maximos.io"},{"name":"jelhan","email":"npm@jhanschke.de"},{"name":"patocallaghan","email":"patocallaghan@gmail.com"},{"name":"lindyhopchris","email":"contact@gammie.co.uk"},{"name":"real_ate","email":"chris@manson.ie"},{"name":"sergeastapov","email":"sergeastapov@gmail.com"},{"name":"rwwagner90","email":"rwwagner90@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ember-cli-clipboard_1.0.0_1780370822970_0.5405379376357948"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T03:27:02.761Z","1.0.0":"2026-06-02T03:27:03.120Z","modified":"2026-06-02T03:27:03.871Z"},"maintainers":[{"name":"alexlafroscia","email":"alex@lafroscia.com"},{"name":"melsumner","email":"melaniersumner@gmail.com"},{"name":"scottkidder","email":"scott.kidder11@gmail.com"},{"name":"toranb","email":"toranb@gmail.com"},{"name":"knownasilya","email":"knownasilya@gmail.com"},{"name":"alonbukai","email":"alonzorz@gmail.com"},{"name":"rwjblue","email":"me@rwjblue.com"},{"name":"st-h","email":"Steve.Hummingbird@yandex.com"},{"name":"the-bionic","email":"inem.patrick@gmail.com"},{"name":"john.derr","email":"john.derr@maximos.io"},{"name":"jelhan","email":"npm@jhanschke.de"},{"name":"patocallaghan","email":"patocallaghan@gmail.com"},{"name":"lindyhopchris","email":"contact@gammie.co.uk"},{"name":"real_ate","email":"chris@manson.ie"},{"name":"sergeastapov","email":"sergeastapov@gmail.com"},{"name":"rwwagner90","email":"rwwagner90@gmail.com"}],"description":"An Ember addon that wraps clipboard.js to copy or cut text to the clipboard. A maintained fork of ember-cli-clipboard.","homepage":"https://github.com/adopted-ember-addons/ember-cli-clipboard#readme","keywords":["ember-addon","clipboard","clipboard.js","copy","cut"],"repository":{"type":"git","url":"git+https://github.com/adopted-ember-addons/ember-cli-clipboard.git"},"author":{"name":"adopted-ember-addons","url":"https://github.com/adopted-ember-addons"},"bugs":{"url":"https://github.com/adopted-ember-addons/ember-cli-clipboard/issues"},"license":"MIT","readme":"# @adopted-ember-addons/ember-cli-clipboard\n\nA simple Ember wrapper around [clipboard.js](https://clipboardjs.com) for\ncopying or cutting text to the clipboard.\n\n> **Note:** This is a maintained fork of\n> [ember-cli-clipboard](https://github.com/jkusa/ember-cli-clipboard) by\n> [@jkusa](https://github.com/jkusa), rebuilt as an Embroider v2 addon and\n> published under the `@adopted-ember-addons` scope. The original package is unmaintained.\n\n## Compatibility\n\n- Ember.js v5.8 or above\n- Embroider or ember-auto-import v2\n\n## Installation\n\n```shell\npnpm add @adopted-ember-addons/ember-cli-clipboard\n```\n\n## Usage\n\nThis addon exposes three public APIs plus a set of test helpers:\n\n- [`<CopyButton>`](#copybutton-component) — a ready-made button component\n- [`clipboard`](#clipboard-modifier) — the underlying element modifier\n- [`isClipboardSupported`](#isclipboardsupported-helper) — a helper to detect support\n- [test helpers](#test-helpers) — `triggerCopySuccess` / `triggerCopyError`\n\n### `<CopyButton>` component\n\n```gjs\nimport { CopyButton } from '@adopted-ember-addons/ember-cli-clipboard';\n\n<template>\n  <CopyButton @text=\"text to copy\" @onSuccess={{this.onSuccess}}>\n    Copy\n  </CopyButton>\n</template>\n```∫\n\n`<CopyButton>` renders a `<button class=\"copy-btn\" type=\"button\">` and accepts\nall of the modifier arguments below. Splattributes are supported, so you can add\nyour own `class`, `title`, etc.\n\n| Argument              | Type                                    | Default  | Description                                                                                      |\n| --------------------- | --------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- |\n| `@text`               | `string` or `(trigger) => string`       | none     | Text to copy. A function is evaluated on click. Takes precedence over `@target`.                |\n| `@target`             | `string` or `(trigger) => Element`      | none     | CSS selector or function resolving the element to copy/cut from.                                |\n| `@action`             | `'copy'` or `'cut'`                     | `'copy'` | Whether to copy or cut from the target.                                                         |\n| `@delegateClickEvent` | `boolean`                               | `true`   | When `true`, the listener is delegated to `document.body`; set `false` to scope to the element. |\n| `@container`          | `string` or `HTMLElement`               | none     | Container element (useful inside a `<dialog>` or other focus-trapping element).                 |\n| `@onSuccess`          | `(event) => void`                       | none     | Called after a successful copy/cut.                                                             |\n| `@onError`            | `(event) => void`                       | none     | Called when the copy/cut fails.                                                                 |\n\nYou must provide either `@text` or `@target`.\n\n### `clipboard` modifier\n\nUse the element modifier directly when you don't need the `<CopyButton>` wrapper:\n\n```gjs\nimport { clipboard } from '@adopted-ember-addons/ember-cli-clipboard';\n\n<template>\n  <button\n    type=\"button\"\n    {{clipboard text=\"copied via the modifier\" onSuccess=this.onSuccess}}\n  >\n    Copy\n  </button>\n</template>\n```\n\nThe modifier accepts the same named arguments as the component (`text`,\n`target`, `action`, `delegateClickEvent`, `container`, `onSuccess`, `onError`).\n\n### `isClipboardSupported` helper\n\n```gjs\nimport { isClipboardSupported } from '@adopted-ember-addons/ember-cli-clipboard';\n\n<template>\n  {{#if (isClipboardSupported)}}\n    Clipboard is supported 🎉\n  {{else}}\n    Clipboard is not supported 😔\n  {{/if}}\n</template>\n```\n\nPass an optional action to check support for `copy` or `cut` specifically:\n\n```hbs\n{{#if (isClipboardSupported \"cut\")}}\n  Cut is supported\n{{/if}}\n```\n\nThe helper returns `false` in a FastBoot environment.\n\n### Test helpers\n\nFire a button's `@onSuccess` / `@onError` actions in tests without real\nclipboard access:\n\n```gjs\nimport { triggerCopySuccess, triggerCopyError } from '@adopted-ember-addons/ember-cli-clipboard/test-support';\n\ntest('fires success/error actions', async function (assert) {\n  await render(\n    <template>\n      <CopyButton class=\"my-btn\" @text=\"text\" @onSuccess={{this.onSuccess}} />\n    </template>,\n  );\n\n  // fire the success action for a specific button\n  triggerCopySuccess('.my-btn');\n\n  // omit the selector to default to '.copy-btn'\n  triggerCopyError();\n});\n```\n\n| Helper                          | Description                                                              |\n| ------------------------------- | ------------------------------------------------------------------------ |\n| `triggerCopySuccess(selector?)` | Fires the `@onSuccess` action of the matching copy button.               |\n| `triggerCopyError(selector?)`   | Fires the `@onError` action of the matching copy button.                 |\n\nBoth default to the `.copy-btn` selector rendered by `<CopyButton>` when no\nselector is passed.\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md). Original work\ncopyright the `ember-cli-clipboard` authors; fork modifications copyright aklkv.\n","readmeFilename":"README.md","_rev":"1-56b61e713a04926e56868834e7548d07"}