mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
Remove clipboard-copy dependency from CodeSnippet, CopyButton (#726)
* chore(deps): remove clipboard-copy * feat: add copy prop, use navigator.clipboard API * docs: add clipboard-copy back to docsite for more browser support * docs(component-api): use outbound link * docs: add override/prevent copy examples
This commit is contained in:
parent
6ed4aaa86e
commit
921c3e121a
19 changed files with 163 additions and 68 deletions
|
@ -4,6 +4,7 @@
|
|||
export let src = "";
|
||||
export let framed = false;
|
||||
|
||||
import copy from "clipboard-copy";
|
||||
import { CodeSnippet, Button } from "carbon-components-svelte";
|
||||
import Launch16 from "carbon-icons-svelte/lib/Launch16";
|
||||
import { url } from "@sveltech/routify";
|
||||
|
@ -40,7 +41,7 @@
|
|||
{/if}
|
||||
</div>
|
||||
<div class="code-override">
|
||||
<CodeSnippet type="multi" code="{codeRaw}">
|
||||
<CodeSnippet type="multi" code="{codeRaw}" copy="{(text) => copy(text)}">
|
||||
{@html code}
|
||||
</CodeSnippet>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue