@uiw/copy-to-clipboard 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,41 +0,0 @@
1
- .sidebar-border {
2
- border-right: 1px solid var(--color-border-muted);
3
- }
4
- aside.sidebar {
5
- min-width: 160px;
6
- margin-left: -5px;
7
- padding-bottom: 20px;
8
- padding-right: 6px;
9
- position: -webkit-sticky;
10
- position: sticky;
11
- top: 56px;
12
- grid-area: sidebar;
13
- overflow: auto;
14
- max-height: calc(100vh - 56px);
15
- padding-bottom: 36px;
16
- }
17
- aside.sidebar label:first-child {
18
- padding-top: 0 !important;
19
- }
20
- aside.sidebar a:first-child {
21
- margin-top: 0 !important;
22
- }
23
- aside.sidebar label {
24
- font-size: 12px;
25
- padding: 5px 0 3px 0;
26
- display: block;
27
- padding-left: 5px !important;
28
- }
29
- aside.sidebar a.active {
30
- color: var(--color-prettylights-syntax-markup-inserted-text);
31
- background-color: var(--color-hover);
32
- }
33
- aside.sidebar a {
34
- display: block;
35
- padding: 3px 5px 3px 5px;
36
- border-radius: 3px;
37
- margin: 3px 0;
38
- text-overflow: ellipsis;
39
- white-space: nowrap;
40
- overflow: hidden;
41
- }
@@ -1,52 +0,0 @@
1
- .tocs {
2
- line-height: 26px;
3
- }
4
- nav.tocs > .inner {
5
- position: sticky;
6
- top: 56px;
7
- overflow: auto;
8
- max-height: calc(100vh - 56px);
9
- }
10
- nav.tocs .inner > .tocs-list {
11
- overflow: hidden;
12
- position: relative;
13
- }
14
- .tocs .tocs-list li {
15
- list-style: none;
16
- }
17
- .tocs-list {
18
- margin: 0;
19
- padding-left: 10px;
20
- }
21
- .tocs-list.is-collapsed {
22
- max-height: 0;
23
- overflow: hidden;
24
- transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
25
- }
26
- .tocs-list.is-collapsed.is-open {
27
- max-height: 9999px;
28
- transition: max-height 0.3s cubic-bezier(1, 0, 1, 0);
29
- }
30
-
31
- .tocs-link {
32
- height: 100%;
33
- text-overflow: ellipsis;
34
- white-space: nowrap;
35
- overflow: hidden;
36
- }
37
- .tocs-link::before {
38
- background-color: var(--color-border-default);
39
- content: ' ';
40
- display: inline-block;
41
- height: inherit;
42
- left: 0;
43
- margin-top: -1px;
44
- position: absolute;
45
- width: 2px;
46
- }
47
- .tocs-link.is-active-link {
48
- font-weight: 700;
49
- }
50
- .tocs-link.is-active-link::before {
51
- background-color: #54bc4b;
52
- }
package/dist/index.html DELETED
@@ -1,114 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Copy Text to Clipboard Copy Text to Clipboard 1.0.18</title>
8
- <meta name="description" content="Why is it here? To ensure:">
9
- <meta name="keywords" content="copy,text,clipboard,browser,clipboard-copy,clipboard.js">
10
- <meta name="author" content="Kenny Wong">
11
- <meta property="og:site_name" content="Copy Text to Clipboard <sup>1.0.18</sup>">
12
- <meta property="og:url" content="https://wangchujiang.com/copy-to-clipboard/index.html">
13
- <meta property="og:type" content="application">
14
- <meta property="og:title" content="Copy Text to Clipboard <sup>1.0.18</sup>">
15
- <meta property="og:description" content="Why is it here? To ensure:">
16
- <meta property="twitter:site" content="@jaywcjlove">
17
- <meta property="twitter:creator" content="jaywcjlove">
18
- <meta property="twitter:title" content="Copy Text to Clipboard <sup>1.0.18</sup>">
19
- <meta property="twitter:description" content="Why is it here? To ensure:">
20
- <link rel="stylesheet" type="text/css" href="css/main.css?v=1.34.4">
21
- <link rel="stylesheet" type="text/css" href="css/tocbot.css?v=1.34.4">
22
- <link rel="stylesheet" type="text/css" href="css/media.css?v=1.34.4">
23
- <link rel="stylesheet" type="text/css" href="css/sidebar.css?v=1.34.4">
24
- <link rel="stylesheet" type="text/css" href="css/copy.css?v=1.34.4">
25
- <link rel="stylesheet" type="text/css" href="css/demo-preview.css?v=1.34.4">
26
- <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAEIlJREFUeF7tnXtwVNUdx3/n7kIe8sgTNEjLTMeAUrVUKB0U0f6D1ZkKCqhBJKDSdjplHEnW6B8l0hZIQKBaq+KMQDvTOhYfnY5jpU7rg9pp0Y5aSysKA4SEAJJNIJjdkN3TOWuigcnuub97727u2fu9MzuJ7ve8vt/72XPP2XCvIBxwAA6kdUDAGzgAB9I7AEBwdsCBDA4AEJwecACA4ByAA84cwAzizDeUCogDACQgQWOYzhwAIM58Q6mAOABAAhI0hunMAQDizDeUCogDACQgQWOYzhwAIM58Q6mAOABAAhI0hunMAQDizDeUCogDACQgQWOYzhwAIM58Q6mAOABAAhI0hunMAQDizDeUCogDACQgQWOYzhwAIM58Q6mAOABAAhI0hunMgawC0tTU9DgRLRRCVDrrHqtUBxFFiSj1U0rZYVlWRzKZVP+v3bKsViJqi8fjbX19fa2NjY1JVu0BFG/atKlMSlmRSCQqhRAVRFQhpVRZqt9TP6WUJUR0wcBLCDHweyhHlm1PJBI7Hnzwwdez0V7WAGlubpbZ6LCHdbYLIVqllB8JIfZIKfcUFha+s3LlyriHbfi6qrVr16oTf6plWZcR0VQhxGUKAAWDekkpc3WSu/bJsqypdXV1e11XdF4FWQFkw4YNm6WU93nd2RzV94GCxbIsBc0/IpHIezlqN6vNrFu3blIoFLpOSjmjHwQFRC5m9qyOa1DleyKRyLe8biwrgDQ3N6vLmSqvOztM9Z0moreklLuFEO/29fW9+9BDD50cpr7YbnYACCKaLYS4RkpZbbuwoUIhxJX19fUfeNn9bAHi98srxx4KIRJSyn9KKV+TUu5qaGjY7bgyjwtu3LhxbjKZnNsPxAyPqzehuusikcgbXnYUgLh3U31i7VKwPPDAA392Xx2vhqampuuFEDcS0U1EdCmvdN6pAYifI5VSfqJgIaJXe3p6djU2Nsay0d/169fPCoVCN0opFRTfyEYbJtZpWdac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lv89qI3lcOQBxGW7hM53fIYv+SETFLqvyvDjgcG8pAHHvIRX9OnpLUorFQtK1RFThQZXOq5B0jAT9VUh6ATOHcxsHSgIQ9x6eU0PqsitJw7JjlLRGdPQuHfWBx0MKdHUAJNDxY/A6BwCIziG8H2gHAEig48fgdQ4AEJ1DeD/QDgCQQMePwescACA6h/B+oB0AIIGOH4PXOQBAdA7h/UA7AEACHT8Gr3MAgOgcwvuBdgCABDp+DF7nAADROYT3A+0AAAl0/Bi8zgEAonMI7wfaAQAS6PgxeJ0DAETnEN4PtAMAJNDxY/A6BwCIziG8H2gH/g8LPRyq8vuk8QAAAABJRU5ErkJggg==" type="image/x-icon">
27
- <script src="js/copy.js?v=1.34.4"></script>
28
- <script src="js/dark-mode.js?v=1.34.4"></script>
29
- <script src="js/markdown-style.js?v=1.34.4"></script>
30
- </head>
31
- <body id="idoctotop"><a href="#idoctotop" class="gototop">top</a>
32
- <header class="header">
33
- <article class="inner warpper" style="max-width:720px;"><a class="logo" href="index.html"><img alt="Copy Text to Clipboard <sup>1.0.18</sup> logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAEIlJREFUeF7tnXtwVNUdx3/n7kIe8sgTNEjLTMeAUrVUKB0U0f6D1ZkKCqhBJKDSdjplHEnW6B8l0hZIQKBaq+KMQDvTOhYfnY5jpU7rg9pp0Y5aSysKA4SEAJJNIJjdkN3TOWuigcnuub97727u2fu9MzuJ7ve8vt/72XPP2XCvIBxwAA6kdUDAGzgAB9I7AEBwdsCBDA4AEJwecACA4ByAA84cwAzizDeUCogDACQgQWOYzhwAIM58Q6mAOABAAhI0hunMAQDizDeUCogDACQgQWOYzhwAIM58Q6mAOABAAhI0hunMAQDizDeUCogDACQgQWOYzhwAIM58Q6mAOABAAhI0hunMAQDizDeUCogDACQgQWOYzhwAIM58Q6mAOABAAhI0hunMgawC0tTU9DgRLRRCVDrrHqtUBxFFiSj1U0rZYV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UvjZlD/yqczCoD8XkOABBzTolZn/2bbuj+u60O/2H0tfRu0RRbWogyOJALQAq2Re8TQmxGEO4dUBsZakMj06EWnuoaG4d7B6SkH8aXlTzJqYn9RWHRts6FUtBznEagTe/Aks5X6JLeof++yPbiEwbbckAkrat7lo9525a4X8QGpHh751VJonc4jUCb3gG1kbGi4yUqT3SdI1LrDbXuwOGZA/tiZ3qvoh+N6+bUyAZEVV60LfqoFOLHnIagTe9AVd+ntKLjRbL6/5LofwVfpd+OnQvLvHRAyutjy0pf51bpCBDViJ2/yeJ2Jsj6ge+NWkaMp+0lN2V+UlKQjXIwdinEyvjSsY85KJrpn1/pqyt65tQsaSWXE4lvE8mp+hJQZHJg9mfv0fuFl9Ap6wIY5d6B16VaCoTEU/ElYz9xWp3jGcRpg/lSrnBH559IkinXQaditSVj88X7XI4DgDh0u/A3p2ZTIvmmw+K5LeZg/z+3HfRvawDERTYF26MvChLzXFSRg6LiP7HasV/PQUN52QQAcRFr8Y7otKQULxHRV1xUk9WiQtKinmUlv89qI3lcOQBxGW7hM53fIYv+SETFLqvyvDjgcG8pAHHvIRX9OnpLUorFQtK1RFThQZXOq5B0jAT9VUh6ATOHcxsHSgIQ9x6eU0PqsitJw7JjlLRGdPQuHfWBx0MKdHUAJNDxY/A6BwCIziG8H2gHAEig48fgdQ4AEJ1DeD/QDgCQQMePwescACA6h/B+oB0AIIGOH4PXOQBAdA7h/UA7AEACHT8Gr3MAgOgcwvuBdgCABDp+DF7nAADROYT3A+0AAAl0/Bi8zgEAonMI7wfaAQAS6PgxeJ0DAETnEN4PtAMAJNDxY/A6BwCIziG8H2gH/g8LPRyq8vuk8QAAAABJRU5ErkJggg==">
34
- <span class="title">Copy Text to Clipboard <sup>1.0.18</sup></span></a>
35
- <div class="content">
36
- <ul class="menu">
37
- <li><a href="index.html" target="" class="active">Home</a></li>
38
- <li><a href="https://wangchujiang.com/#/app" target="__blank" class="">Apps</a></li>
39
- <li><a href="https://jaywcjlove.github.io/#/sponsor" target="__blank" class="">Sponsor</a></li>
40
- </ul><a href="https://github.com/jaywcjlove/copy-to-clipboard" target="_blank" rel="noopener noreferrer" title="Github" name="Github" class="github"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
41
- <path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>
42
- </svg></a>
43
- <dark-mode permanent=""></dark-mode>
44
- </div>
45
- </article>
46
- </header>
47
- <div style="max-width:720px;" class="warpper-content warpper notocs">
48
- <markdown-style theme-auto-switch-disabled="">
49
- <h1 id="copy-text-to-clipboard"><a aria-hidden="true" tabindex="-1" href="#copy-text-to-clipboard" class="anchor"><span class="icon icon-link"></span></a>Copy Text to Clipboard</h1>
50
- <p>
51
- <a href="https://jaywcjlove.github.io/#/sponsor"><img src="https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee" alt="Buy me a coffee"></a>
52
- <img src="http://jaywcjlove.github.io/sb/status/no-dependencies.svg" alt="No Dependencies">
53
- <a href="https://www.npmjs.com/package/@uiw/copy-to-clipboard"><img src="https://img.shields.io/npm/dm/@uiw/copy-to-clipboard.svg?style=flat" alt="NPM Downloads"></a>
54
- <a href="https://github.com/uiwjs/react-codemirror/actions"><img src="https://github.com/uiwjs/copy-to-clipboard/workflows/Build/badge.svg" alt="Build &#x26; Deploy"></a>
55
- <a href="https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/copy-to-clipboard/file/README.md"><img src="https://img.shields.io/badge/Open%20in-unpkg-blue" alt="Open in unpkg"></a>
56
- <a href="https://www.npmjs.com/package/@uiw/copy-to-clipboard"><img src="https://img.shields.io/npm/v/@uiw/copy-to-clipboard.svg" alt="npm version"></a>
57
- <a href="https://github.com/uiwjs/copy-to-clipboard/network/dependents"><img src="https://badgen.net/github/dependents-repo/uiwjs/copy-to-clipboard" alt="Repo Dependents"></a>
58
- <a href="https://uiwjs.github.io/copy-to-clipboard/lcov-report/"><img src="https://uiwjs.github.io/copy-to-clipboard/badges.svg" alt="Coverage Status"></a>
59
- </p>
60
- <p><strong>This styling is an extra step which is likely not required.</strong></p>
61
- <p>Why is it here? To ensure:</p>
62
- <ol>
63
- <li>the element is able to have focus and selection.</li>
64
- <li>if element was to <code>flash</code> render it has minimal visual impact.</li>
65
- <li>less flakyness with selection and copying which <strong>might</strong> occur if the textarea element is not visible.</li>
66
- </ol>
67
- <p>The likelihood is the element won't even render, not even a flash, so some of these are just precautions. However in IE the element is visible whilst the popup box asking the user for permission for the web page to copy to the clipboard. Place in top-left corner of screen regardless of scroll position.</p>
68
- <h2 id="usage"><a aria-hidden="true" tabindex="-1" href="#usage" class="anchor"><span class="icon icon-link"></span></a>Usage</h2>
69
- <p>You will need Node.js installed on your system.</p>
70
- <pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line line-number" line="1">$ <span class="token function">npm</span> i @uiw/copy-to-clipboard
71
- </span></code><input type="hidden" value="$ npm i @uiw/copy-to-clipboard
72
- "><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
73
- <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token keyword module">import</span> <span class="token imports">copyTextToClipboard</span> <span class="token keyword module">from</span> <span class="token string">'@uiw/copy-to-clipboard'</span><span class="token punctuation">;</span>
74
- </span><span class="code-line line-number" line="2">
75
- </span><span class="code-line line-number" line="3"><span class="token function">copyTextToClipboard</span><span class="token punctuation">(</span><span class="token string">'test'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">isCopy</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>
76
- </span><span class="code-line line-number" line="4"> <span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">log</span><span class="token punctuation">(</span><span class="token string">'isCopy:'</span><span class="token punctuation">,</span> isCopy<span class="token punctuation">)</span><span class="token punctuation">;</span>
77
- </span><span class="code-line line-number" line="5"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
78
- </span></code><input type="hidden" value="import copyTextToClipboard from &#x27;@uiw/copy-to-clipboard&#x27;;
79
-
80
- copyTextToClipboard(&#x27;test&#x27;, (isCopy) => {
81
- console.log(&#x27;isCopy:&#x27;, isCopy);
82
- });
83
- "><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
84
- <p>Or manually download and link <a href="https://unpkg.com/@uiw/copy-to-clipboard/dist/">copy-to-clipboard</a> in your HTML, It can also be downloaded via <a href="https://unpkg.com/@uiw/copy-to-clipboard/dist/">UNPKG</a>:</p>
85
- <pre class="language-html"><code class="language-html code-highlight"><span class="code-line line-number" line="1"><span class="token tag"><span class="token tag"><span class="token punctuation">&#x3C;</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/@uiw/copy-to-clipboard/dist/copy-to-clipboard.umd.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation">&#x3C;/</span>script</span><span class="token punctuation">></span></span>
86
- </span><span class="code-line line-number" line="2"><span class="token tag"><span class="token tag"><span class="token punctuation">&#x3C;</span>script</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>text/javascript<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"><span class="token language-javascript">
87
- </span></span></span><span class="code-line line-number" line="3"><span class="token script"><span class="token language-javascript"><span class="token function">copyTextToClipboard</span><span class="token punctuation">(</span><span class="token string">'test'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">isCopy</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>
88
- </span></span></span><span class="code-line line-number" line="4"><span class="token script"><span class="token language-javascript"> <span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">log</span><span class="token punctuation">(</span><span class="token string">'isCopy:'</span><span class="token punctuation">,</span> isCopy<span class="token punctuation">)</span><span class="token punctuation">;</span>
89
- </span></span></span><span class="code-line line-number" line="5"><span class="token script"><span class="token language-javascript"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
90
- </span></span></span><span class="code-line line-number" line="6"><span class="token script"><span class="token language-javascript"></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&#x3C;/</span>script</span><span class="token punctuation">></span></span>
91
- </span></code><input type="hidden" value="<script src=&#x22;https://unpkg.com/@uiw/copy-to-clipboard/dist/copy-to-clipboard.umd.js&#x22;></script>
92
- <script type=&#x22;text/javascript&#x22;>
93
- copyTextToClipboard(&#x27;test&#x27;, (isCopy) => {
94
- console.log(&#x27;isCopy:&#x27;, isCopy);
95
- });
96
- </script>
97
- "><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
98
- <h2 id="contributors"><a aria-hidden="true" tabindex="-1" href="#contributors" class="anchor"><span class="icon icon-link"></span></a>Contributors</h2>
99
- <p>As always, thanks to our amazing contributors!</p><a href="https://github.com/uiwjs/copy-to-clipboard/graphs/contributors"><img src="https://uiwjs.github.io/copy-to-clipboard/CONTRIBUTORS.svg"></a>
100
- <p>Made with <a href="https://github.com/jaywcjlove/github-action-contributors">contributors</a>.</p>
101
- <h3 id="license"><a aria-hidden="true" tabindex="-1" href="#license" class="anchor"><span class="icon icon-link"></span></a>License</h3>
102
- <p>Licensed under the MIT License.</p>
103
- </markdown-style>
104
- </div>
105
- <script src="js/demo-preview.js?v=1.34.4"></script>
106
- <div class="footer warpper" style="max-width:720px;">
107
- <a href="https://wangchujiang.com/#/app" target="_blank">App</a> •
108
- <a href="https://wangchujiang.com/#/projects" target="_blank">Projects</a> •
109
- <a href="https://wangchujiang.com/#/sponsor" target="_blank">Sponsor</a> •
110
- <a href="https://wangchujiang.com/#/app" target="_blank">More Apps</a><br><br>Generated by <a href="https://github.com/jaywcjlove/idoc" target="_blank">idoc</a> v1.34.4
111
- </div>
112
- <script src="js/tocbot.js?v=1.34.4"></script>
113
- </body>
114
- </html>
package/dist/js/copy.js DELETED
@@ -1,40 +0,0 @@
1
- /**
2
- * https://github.com/uiwjs/copy-to-clipboard/blob/master/src/main.js
3
- */
4
- function copyTextToClipboard(text, cb) {
5
- const el = document.createElement('textarea');
6
- el.value = text;
7
- el.setAttribute('readonly', '');
8
- el.style = {
9
- position: 'absolute',
10
- left: '-9999px',
11
- };
12
- document.body.appendChild(el);
13
- const selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;
14
- el.select();
15
- let isCopy = false;
16
- try {
17
- const successful = document.execCommand('copy');
18
- isCopy = !!successful;
19
- } catch (err) {
20
- isCopy = false;
21
- }
22
- document.body.removeChild(el);
23
- if (selected && document.getSelection) {
24
- document.getSelection().removeAllRanges();
25
- document.getSelection().addRange(selected);
26
- }
27
- cb && cb(isCopy);
28
- }
29
-
30
- function copied(target, str) {
31
- target.classList.add('active');
32
- const input = target.parentElement.querySelector('input');
33
- if (input) {
34
- copyTextToClipboard(input.value || '', function () {
35
- setTimeout(() => {
36
- target.classList.remove('active');
37
- }, 2000);
38
- });
39
- }
40
- }
@@ -1,162 +0,0 @@
1
- /**
2
- * @package @wcj/dark-mode@1.0.14
3
- * Web Component that toggles dark mode 🌒
4
- * Github: https://github.com/jaywcjlove/dark-mode.git
5
- * Website: https://jaywcjlove.github.io/dark-mode
6
- *
7
- * Licensed under the MIT license.
8
- * @license Copyright © 2022. Licensed under the MIT License
9
- * @author kenny wong <wowohoo@qq.com>
10
- */
11
- const t = document;
12
- const e = '_dark_mode_theme_';
13
- const s = 'permanent';
14
- const o = 'colorschemechange';
15
- const i = 'permanentcolorscheme';
16
- const h = 'light';
17
- const r = 'dark';
18
- const n = (t, e, s = e) => {
19
- Object.defineProperty(t, s, {
20
- enumerable: true,
21
- get() {
22
- const t = this.getAttribute(e);
23
- return t === null ? '' : t;
24
- },
25
- set(t) {
26
- this.setAttribute(e, t);
27
- },
28
- });
29
- };
30
- const c = (t, e, s = e) => {
31
- Object.defineProperty(t, s, {
32
- enumerable: true,
33
- get() {
34
- return this.hasAttribute(e);
35
- },
36
- set(t) {
37
- if (t) {
38
- this.setAttribute(e, '');
39
- } else {
40
- this.removeAttribute(e);
41
- }
42
- },
43
- });
44
- };
45
- class a extends HTMLElement {
46
- static get observedAttributes() {
47
- return ['mode', h, r, s];
48
- }
49
- LOCAL_NANE = e;
50
- constructor() {
51
- super();
52
- this.t();
53
- }
54
- connectedCallback() {
55
- n(this, 'mode');
56
- n(this, r);
57
- n(this, h);
58
- c(this, s);
59
- const a = localStorage.getItem(e);
60
- if (a && [h, r].includes(a)) {
61
- this.mode = a;
62
- this.permanent = true;
63
- }
64
- if (this.permanent && !a) {
65
- localStorage.setItem(e, this.mode);
66
- }
67
- const l = [h, r].includes(a);
68
- if (this.permanent && a) {
69
- this.o();
70
- } else {
71
- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
72
- this.mode = r;
73
- this.o();
74
- }
75
- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
76
- this.mode = h;
77
- this.o();
78
- }
79
- }
80
- if (!this.permanent && !l) {
81
- window.matchMedia('(prefers-color-scheme: light)').onchange = (t) => {
82
- this.mode = t.matches ? h : r;
83
- this.o();
84
- };
85
- window.matchMedia('(prefers-color-scheme: dark)').onchange = (t) => {
86
- this.mode = t.matches ? r : h;
87
- this.o();
88
- };
89
- }
90
- const d = new MutationObserver((s, h) => {
91
- this.mode = t.documentElement.dataset.colorMode;
92
- if (this.permanent && l) {
93
- localStorage.setItem(e, this.mode);
94
- this.i(i, { permanent: this.permanent });
95
- }
96
- this.h();
97
- this.i(o, { colorScheme: this.mode });
98
- });
99
- d.observe(t.documentElement, { attributes: true });
100
- this.i(o, { colorScheme: this.mode });
101
- this.h();
102
- }
103
- attributeChangedCallback(t, s, o) {
104
- if (t === 'mode' && s !== o && [h, r].includes(o)) {
105
- const t = localStorage.getItem(e);
106
- if (this.mode === t) {
107
- this.mode = o;
108
- this.h();
109
- this.o();
110
- } else if (this.mode && this.mode !== t) {
111
- this.h();
112
- this.o();
113
- }
114
- } else if ((t === h || t === r) && s !== o) {
115
- this.h();
116
- }
117
- if (t === 'permanent' && typeof this.permanent === 'boolean') {
118
- this.permanent ? localStorage.setItem(e, this.mode) : localStorage.removeItem(e);
119
- }
120
- }
121
- o() {
122
- t.documentElement.setAttribute('data-color-mode', this.mode);
123
- }
124
- h() {
125
- this.icon.textContent = this.mode === h ? '🌒' : '🌞';
126
- this.text.textContent = this.mode === h ? this.getAttribute(r) : this.getAttribute(h);
127
- }
128
- t() {
129
- var s = this.attachShadow({ mode: 'open' });
130
- this.label = t.createElement('span');
131
- this.label.setAttribute('class', 'wrapper');
132
- this.label.onclick = () => {
133
- this.mode = this.mode === h ? r : h;
134
- if (this.permanent) {
135
- localStorage.setItem(e, this.mode);
136
- }
137
- this.o();
138
- this.h();
139
- };
140
- s.appendChild(this.label);
141
- this.icon = t.createElement('span');
142
- this.label.appendChild(this.icon);
143
- this.text = t.createElement('span');
144
- this.label.appendChild(this.text);
145
- const o = `\n[data-color-mode*='dark'], [data-color-mode*='dark'] body {\n color-scheme: dark;\n --color-theme-bg: #0d1117;\n --color-theme-text: #c9d1d9;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}\n\n[data-color-mode*='light'], [data-color-mode*='light'] body {\n color-scheme: light;\n --color-theme-bg: #fff;\n --color-theme-text: #24292f;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}`;
146
- const i = '_dark_mode_style_';
147
- const n = t.getElementById(i);
148
- if (!n) {
149
- var c = t.createElement('style');
150
- c.id = i;
151
- c.textContent = o;
152
- t.head.appendChild(c);
153
- }
154
- var a = t.createElement('style');
155
- a.textContent = `\n .wrapper { cursor: pointer; user-select: none; position: relative; }\n .wrapper > span + span { margin-left: .4rem; }\n `;
156
- s.appendChild(a);
157
- }
158
- i(t, e) {
159
- this.dispatchEvent(new CustomEvent(t, { bubbles: true, composed: true, detail: e }));
160
- }
161
- }
162
- customElements.define('dark-mode', a);
@@ -1,31 +0,0 @@
1
- const demo = document.querySelectorAll('.idoc-demo-warpper .idoc-demo-previw');
2
-
3
- function getButton(elm, type = 'BUTTON') {
4
- let btn;
5
- do {
6
- elm = elm.nextElementSibling;
7
- if (elm.tagName === type) {
8
- btn = elm;
9
- elm = undefined;
10
- break;
11
- }
12
- } while (elm);
13
- return btn;
14
- }
15
- if (demo && demo.length > 0) {
16
- demo.forEach((item) => {
17
- if (item.previousElementSibling && item.previousElementSibling.tagName === 'INPUT') {
18
- const button = getButton(item);
19
- if (button) {
20
- button.innerHTML = item.classList.contains('ishiden') ? 'Preview' : 'Show Code';
21
- if (item.tagName === 'DIV') {
22
- item.innerHTML = item.previousElementSibling.defaultValue;
23
- }
24
- button.onclick = () => {
25
- item.classList.toggle('ishiden');
26
- button.innerHTML = item.classList.contains('ishiden') ? 'Preview' : 'Show Code';
27
- };
28
- }
29
- }
30
- });
31
- }
package/dist/js/giscus.js DELETED
@@ -1,34 +0,0 @@
1
- (() => {
2
- const targetElement = document.documentElement;
3
- const defaultTheme = targetElement.getAttribute('data-color-mode');
4
- changeGiscusTheme(defaultTheme);
5
- const observer = new MutationObserver((mutationsList, observer) => {
6
- for (const mutation of mutationsList) {
7
- if (mutation.type === 'attributes') {
8
- const value = targetElement.getAttribute('data-color-mode');
9
- changeGiscusTheme(value);
10
- }
11
- }
12
- });
13
-
14
- observer.observe(targetElement, {
15
- attributes: true,
16
- attributeOldValue: true,
17
- });
18
-
19
- function changeGiscusTheme(theme = 'light') {
20
- const iframe = document.querySelector('.giscus-frame');
21
- if (iframe) {
22
- const config = {
23
- giscus: {
24
- setConfig: {
25
- theme: theme.toLocaleLowerCase(),
26
- },
27
- },
28
- };
29
- iframe.contentWindow.postMessage(config, 'https://giscus.app');
30
- const script = document.querySelector('script[data-script-id="giscus"]');
31
- script.setAttribute('data-theme', theme);
32
- }
33
- }
34
- })();