{"_id":"@aklkv/ember-cli-clipboard","_rev":"2-ae164383f8cc3543fd3ce43236f2a5be","name":"@aklkv/ember-cli-clipboard","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aklkv/ember-cli-clipboard","version":"1.0.0","keywords":["ember-addon","clipboard","clipboard.js","copy","cut"],"author":{"url":"https://github.com/aklkv","name":"aklkv"},"license":"MIT","_id":"@aklkv/ember-cli-clipboard@1.0.0","maintainers":[{"name":"akulakov","email":"uni_que@me.com"}],"homepage":"https://github.com/aklkv/ember-cli-clipboard#readme","bugs":{"url":"https://github.com/aklkv/ember-cli-clipboard/issues"},"dist":{"shasum":"b85fe51edff34c7424b42d2a9127b97f19ea8a8b","tarball":"https://registry.npmjs.org/@aklkv/ember-cli-clipboard/-/ember-cli-clipboard-1.0.0.tgz","fileCount":37,"integrity":"sha512-r9z5rWyxttabs1xSpgDCHeG3fv+9CU9UlOQ5XDHoSVALFuBO523GaN1ZyZrm+uxDseUmF2cSbe0X3UP76YmTAA==","signatures":[{"sig":"MEUCIAa8eyMP1YRHAsy1Pp7USu6Mkhc4xYe1z7YXbigcJOEgAiEA6bvrJgn+8LTEN1MfvOyher0+G+J6l8m12tTiKn3TZRA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54230},"_from":"file:aklkv-ember-cli-clipboard-1.0.0.tgz","ember":{"edition":"octane"},"engines":{"node":">=22","pnpm":">=10"},"exports":{".":{"types":"./declarations/index.d.ts","default":"./dist/index.js"},"./*":{"types":"./declarations/*.d.ts","default":"./dist/*.js"},"./*.css":"./dist/*.css","./addon-main.js":"./addon-main.cjs"},"imports":{"#src/*":"./src/*"},"scripts":{"lint":"concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto","test":"vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0","build":"rollup --config","start":"vite dev","format":"prettier . --cache --write","lint:js":"eslint . --cache","lint:fix":"concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format","lint:hbs":"ember-template-lint . --no-error-on-unmatched-pattern","build:demo":"BUILD_DEMO=true vite build --base=/ember-cli-clipboard/ --out-dir dist-demo","lint:types":"ember-tsc --noEmit","lint:format":"prettier . --cache --check","lint:js:fix":"eslint . --fix","lint:hbs:fix":"ember-template-lint . --fix --no-error-on-unmatched-pattern","lint:publish":"pnpm build && publint run --level error"},"_npmUser":{"name":"akulakov","email":"uni_que@me.com"},"_resolved":"/private/var/folders/1z/yqs75hjs4pxbf3rr8hk82xpm0000gq/T/2e2255a3f4af6bd09f00cf231b564870/aklkv-ember-cli-clipboard-1.0.0.tgz","_integrity":"sha512-r9z5rWyxttabs1xSpgDCHeG3fv+9CU9UlOQ5XDHoSVALFuBO523GaN1ZyZrm+uxDseUmF2cSbe0X3UP76YmTAA==","repository":{"url":"git+https://github.com/aklkv/ember-cli-clipboard.git","type":"git"},"_npmVersion":"11.15.0","description":"An Ember addon that wraps clipboard.js to copy or cut text to the clipboard. A maintained fork of ember-cli-clipboard.","directories":{},"ember-addon":{"main":"addon-main.cjs","type":"addon","app-js":{"./modifiers/clipboard.js":"./dist/_app_/modifiers/clipboard.js","./components/copy-button.js":"./dist/_app_/components/copy-button.js","./helpers/is-clipboard-supported.js":"./dist/_app_/helpers/is-clipboard-supported.js"},"version":2},"_nodeVersion":"25.6.1","dependencies":{"clipboard":"^2.0.11","decorator-transforms":"^2.3.2","@embroider/addon-shim":"^1.10.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.14","qunit":"^2.25.0","shiki":"^4.1.0","eslint":"^9.39.4","rollup":"^4.60.4","testem":"^3.20.1","globals":"^17.6.0","publint":"^0.3.21","prettier":"^3.8.3","qunit-dom":"^3.5.1","@eslint/js":"^9.39.4","typescript":"~6.0.3","@babel/core":"^7.29.7","ember-qunit":"^9.0.4","@types/qunit":"^2.19.14","concurrently":"^10.0.0","ember-source":"^7.0.0","release-plan":"^0.18.0","@babel/runtime":"^7.29.7","ember-modifier":"^4.3.0","@embroider/core":"^4.6.0","@embroider/vite":"^1.7.5","@glint/template":"^1.7.7","eslint-plugin-n":"^18.0.1","@glint/ember-tsc":"^1.8.0","ember-page-title":"^9.0.3","@embroider/compat":"^4.1.19","@embroider/macros":"^1.20.3","typescript-eslint":"^8.60.0","@glimmer/component":"^2.1.1","@ember/app-tsconfig":"^2.0.0","@ember/test-helpers":"^5.4.2","@ember/test-waiters":"^4.1.1","ember-template-lint":"^7.9.3","eslint-plugin-ember":"^13.3.2","@babel/eslint-parser":"^7.29.7","@embroider/addon-dev":"^8.3.0","@rollup/plugin-babel":"^7.1.0","eslint-plugin-import":"^2.32.0","@glint/tsserver-plugin":"^2.5.6","eslint-config-prettier":"^10.1.8","@ember/library-tsconfig":"^2.0.0","ember-strict-application-resolver":"^0.1.1","@babel/plugin-transform-typescript":"^7.29.7","prettier-plugin-ember-template-tag":"^2.1.6","babel-plugin-ember-template-compilation":"^4.0.0"},"peerDependencies":{"ember-modifier":">= 4.0.0","@ember/test-helpers":">= 4.0.0"},"peerDependenciesMeta":{"@ember/test-helpers":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ember-cli-clipboard_1.0.0_1780102062592_0.5859801109266773","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2026-05-30T00:47:42.407Z","modified":"2026-06-02T05:20:48.920Z","1.0.0":"2026-05-30T00:47:42.782Z"},"bugs":{"url":"https://github.com/aklkv/ember-cli-clipboard/issues"},"author":{"url":"https://github.com/aklkv","name":"aklkv"},"license":"MIT","homepage":"https://github.com/aklkv/ember-cli-clipboard#readme","keywords":["ember-addon","clipboard","clipboard.js","copy","cut"],"repository":{"url":"git+https://github.com/aklkv/ember-cli-clipboard.git","type":"git"},"description":"An Ember addon that wraps clipboard.js to copy or cut text to the clipboard. A maintained fork of ember-cli-clipboard.","maintainers":[{"name":"akulakov","email":"uni_que@me.com"}],"readme":"# @aklkv/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 `@aklkv` 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 @aklkv/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 '@aklkv/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 '@aklkv/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 '@aklkv/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 '@aklkv/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"}