@uiw/copy-to-clipboard 1.0.13 → 1.0.15

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- copy text to clipboard
1
+ Copy Text to Clipboard
2
2
  ===
3
3
 
4
4
  ![No Dependencies](http://jaywcjlove.github.io/sb/status/no-dependencies.svg)
@@ -6,7 +6,7 @@ copy text to clipboard
6
6
  [![Build & Deploy](https://github.com/uiwjs/copy-to-clipboard/workflows/Build/badge.svg)](https://github.com/uiwjs/react-codemirror/actions)
7
7
  [![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/copy-to-clipboard/file/README.md)
8
8
  [![npm version](https://img.shields.io/npm/v/@uiw/copy-to-clipboard.svg)](https://www.npmjs.com/package/@uiw/copy-to-clipboard)
9
- [![Repo Dependents](https://badgen.net/github/dependents-repo/uiwjs/copy-to-clipboard)](https://github.com/jaywcjlove/rehype-rewrite/network/dependents)
9
+ [![Repo Dependents](https://badgen.net/github/dependents-repo/uiwjs/copy-to-clipboard)](https://github.com/uiwjs/copy-to-clipboard/network/dependents)
10
10
 
11
11
  **This styling is an extra step which is likely not required.**
12
12
 
@@ -1,11 +1,11 @@
1
1
  /**!
2
- * @uiw/copy-to-clipboard v1.0.13
2
+ * @uiw/copy-to-clipboard v1.0.15
3
3
  * Copy to clipboard.
4
4
  *
5
5
  * Copyright (c) 2023 Kenny Wang
6
6
  * https://github.com/uiwjs/copy-to-clipboard.git
7
7
  *
8
- * @website: https://github.com/uiwjs/copy-to-clipboard.git
8
+ * @website: https://uiwjs.github.io/copy-to-clipboard
9
9
 
10
10
  * Licensed under the MIT license
11
11
  */
@@ -38,6 +38,7 @@
38
38
  * @param {CopyTextToClipboard} cb
39
39
  */
40
40
  function copyTextToClipboard(text, cb) {
41
+ if (typeof document === "undefined") return;
41
42
  const el = document.createElement('textarea');
42
43
  el.value = text;
43
44
  el.setAttribute('readonly', '');
@@ -1,11 +1,11 @@
1
1
  /**!
2
- * @uiw/copy-to-clipboard v1.0.13
2
+ * @uiw/copy-to-clipboard v1.0.15
3
3
  * Copy to clipboard.
4
4
  *
5
5
  * Copyright (c) 2023 Kenny Wang
6
6
  * https://github.com/uiwjs/copy-to-clipboard.git
7
7
  *
8
- * @website: https://github.com/uiwjs/copy-to-clipboard.git
8
+ * @website: https://uiwjs.github.io/copy-to-clipboard
9
9
 
10
10
  * Licensed under the MIT license
11
11
  */
@@ -36,6 +36,7 @@
36
36
  * @param {CopyTextToClipboard} cb
37
37
  */
38
38
  function copyTextToClipboard(text, cb) {
39
+ if (typeof document === "undefined") return;
39
40
  const el = document.createElement('textarea');
40
41
  el.value = text;
41
42
  el.setAttribute('readonly', '');
@@ -1,11 +1,11 @@
1
1
  /**!
2
- * @uiw/copy-to-clipboard v1.0.13
2
+ * @uiw/copy-to-clipboard v1.0.15
3
3
  * Copy to clipboard.
4
4
  *
5
5
  * Copyright (c) 2023 Kenny Wang
6
6
  * https://github.com/uiwjs/copy-to-clipboard.git
7
7
  *
8
- * @website: https://github.com/uiwjs/copy-to-clipboard.git
8
+ * @website: https://uiwjs.github.io/copy-to-clipboard
9
9
 
10
10
  * Licensed under the MIT license
11
11
  */
@@ -42,6 +42,7 @@
42
42
  * @param {CopyTextToClipboard} cb
43
43
  */
44
44
  function copyTextToClipboard(text, cb) {
45
+ if (typeof document === "undefined") return;
45
46
  const el = document.createElement('textarea');
46
47
  el.value = text;
47
48
  el.setAttribute('readonly', '');
@@ -1 +1 @@
1
- {"version":3,"file":"copy-to-clipboard.umd.js","sources":["../src/main.js"],"sourcesContent":["/**\n * *** This styling is an extra step which is likely not required. ***\n * https://github.com/w3c/clipboard-apis/blob/master/explainer.adoc#writing-to-the-clipboard\n * \n * Why is it here? To ensure:\n * \n * 1. the element is able to have focus and selection.\n * 2. if element was to flash render it has minimal visual impact.\n * 3. less flakyness with selection and copying which **might** occur if\n * the textarea element is not visible.\n *\n * The likelihood is the element won't even render, not even a flash,\n * so some of these are just precautions. However in IE the element\n * is visible whilst the popup box asking the user for permission for\n * the web page to copy to the clipboard.\n * \n * Place in top-left corner of screen regardless of scroll position.\n *\n * @typedef CopyTextToClipboard\n * @property {(text: string, method?: (isCopy: boolean) => void) => void} void\n * @returns {void}\n * \n * @param {string} text \n * @param {CopyTextToClipboard} cb \n */\nexport default function copyTextToClipboard(text, cb) {\n const el = document.createElement('textarea');\n el.value = text;\n el.setAttribute('readonly', '');\n el.style = {\n position: 'absolute',\n left: '-9999px',\n }\n document.body.appendChild(el);\n const selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;\n el.select();\n let isCopy = false;\n try {\n const successful = document.execCommand('copy');\n isCopy = !!successful;\n } catch (err) {\n isCopy = false;\n }\n document.body.removeChild(el);\n if (selected && document.getSelection) {\n document.getSelection().removeAllRanges();\n document.getSelection().addRange(selected);\n }\n cb && cb(isCopy);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAAS,mBAAmB,CAAC,IAAI,EAAE,EAAE,EAAE;EACtD,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;EAChD,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC;EAClB,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;EAClC,EAAE,EAAE,CAAC,KAAK,GAAG;EACb,IAAI,QAAQ,EAAE,UAAU;EACxB,IAAI,IAAI,EAAE,SAAS;EACnB,IAAG;EACH,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;EAChC,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC,UAAU,GAAG,CAAC,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;EAC1G,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC;EACd,EAAE,IAAI,MAAM,GAAG,KAAK,CAAC;EACrB,EAAE,IAAI;EACN,IAAI,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;EACpD,IAAI,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC;EAC1B,GAAG,CAAC,OAAO,GAAG,EAAE;EAChB,IAAI,MAAM,GAAG,KAAK,CAAC;EACnB,GAAG;EACH,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;EAChC,EAAE,IAAI,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE;EACzC,IAAI,QAAQ,CAAC,YAAY,EAAE,CAAC,eAAe,EAAE,CAAC;EAC9C,IAAI,QAAQ,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;EAC/C,GAAG;EACH,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;EACnB;;;;;;;;"}
1
+ {"version":3,"file":"copy-to-clipboard.umd.js","sources":["../src/main.js"],"sourcesContent":["/**\n * *** This styling is an extra step which is likely not required. ***\n * https://github.com/w3c/clipboard-apis/blob/master/explainer.adoc#writing-to-the-clipboard\n * \n * Why is it here? To ensure:\n * \n * 1. the element is able to have focus and selection.\n * 2. if element was to flash render it has minimal visual impact.\n * 3. less flakyness with selection and copying which **might** occur if\n * the textarea element is not visible.\n *\n * The likelihood is the element won't even render, not even a flash,\n * so some of these are just precautions. However in IE the element\n * is visible whilst the popup box asking the user for permission for\n * the web page to copy to the clipboard.\n * \n * Place in top-left corner of screen regardless of scroll position.\n *\n * @typedef CopyTextToClipboard\n * @property {(text: string, method?: (isCopy: boolean) => void) => void} void\n * @returns {void}\n * \n * @param {string} text \n * @param {CopyTextToClipboard} cb \n */\nexport default function copyTextToClipboard(text, cb) {\n if (typeof document === \"undefined\") return;\n const el = document.createElement('textarea');\n el.value = text;\n el.setAttribute('readonly', '');\n el.style = {\n position: 'absolute',\n left: '-9999px',\n }\n document.body.appendChild(el);\n const selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;\n el.select();\n let isCopy = false;\n try {\n const successful = document.execCommand('copy');\n isCopy = !!successful;\n } catch (err) {\n isCopy = false;\n }\n document.body.removeChild(el);\n if (selected && document.getSelection) {\n document.getSelection().removeAllRanges();\n document.getSelection().addRange(selected);\n }\n cb && cb(isCopy);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,SAAS,mBAAmB,CAAC,IAAI,EAAE,EAAE,EAAE;EACtD,EAAE,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,OAAO;EAC9C,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;EAChD,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC;EAClB,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;EAClC,EAAE,EAAE,CAAC,KAAK,GAAG;EACb,IAAI,QAAQ,EAAE,UAAU;EACxB,IAAI,IAAI,EAAE,SAAS;EACnB,IAAG;EACH,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;EAChC,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC,UAAU,GAAG,CAAC,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;EAC1G,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC;EACd,EAAE,IAAI,MAAM,GAAG,KAAK,CAAC;EACrB,EAAE,IAAI;EACN,IAAI,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;EACpD,IAAI,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC;EAC1B,GAAG,CAAC,OAAO,GAAG,EAAE;EAChB,IAAI,MAAM,GAAG,KAAK,CAAC;EACnB,GAAG;EACH,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;EAChC,EAAE,IAAI,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE;EACzC,IAAI,QAAQ,CAAC,YAAY,EAAE,CAAC,eAAe,EAAE,CAAC;EAC9C,IAAI,QAAQ,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;EAC/C,GAAG;EACH,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;EACnB;;;;;;;;"}
@@ -1,3 +1,3 @@
1
- /*! @uiw/copy-to-clipboard v1.0.13 | MIT © 2023 Kenny Wang https://github.com/uiwjs/copy-to-clipboard.git */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).copyTextToClipboard=t()}(this,(function(){"use strict";return function(e,t){const o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style={position:"absolute",left:"-9999px"},document.body.appendChild(o);const n=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);o.select();let c=!1;try{c=!!document.execCommand("copy")}catch(e){c=!1}document.body.removeChild(o),n&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(n)),t&&t(c)}}));
1
+ /*! @uiw/copy-to-clipboard v1.0.15 | MIT © 2023 Kenny Wang https://uiwjs.github.io/copy-to-clipboard */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).copyTextToClipboard=t()}(this,(function(){"use strict";return function(e,t){if("undefined"==typeof document)return;const o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style={position:"absolute",left:"-9999px"},document.body.appendChild(o);const n=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);o.select();let d=!1;try{d=!!document.execCommand("copy")}catch(e){d=!1}document.body.removeChild(o),n&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(n)),t&&t(d)}}));
3
3
  //# sourceMappingURL=copy-to-clipboard.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"copy-to-clipboard.umd.min.js","sources":["../src/main.js"],"sourcesContent":["/**\n * *** This styling is an extra step which is likely not required. ***\n * https://github.com/w3c/clipboard-apis/blob/master/explainer.adoc#writing-to-the-clipboard\n * \n * Why is it here? To ensure:\n * \n * 1. the element is able to have focus and selection.\n * 2. if element was to flash render it has minimal visual impact.\n * 3. less flakyness with selection and copying which **might** occur if\n * the textarea element is not visible.\n *\n * The likelihood is the element won't even render, not even a flash,\n * so some of these are just precautions. However in IE the element\n * is visible whilst the popup box asking the user for permission for\n * the web page to copy to the clipboard.\n * \n * Place in top-left corner of screen regardless of scroll position.\n *\n * @typedef CopyTextToClipboard\n * @property {(text: string, method?: (isCopy: boolean) => void) => void} void\n * @returns {void}\n * \n * @param {string} text \n * @param {CopyTextToClipboard} cb \n */\nexport default function copyTextToClipboard(text, cb) {\n const el = document.createElement('textarea');\n el.value = text;\n el.setAttribute('readonly', '');\n el.style = {\n position: 'absolute',\n left: '-9999px',\n }\n document.body.appendChild(el);\n const selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;\n el.select();\n let isCopy = false;\n try {\n const successful = document.execCommand('copy');\n isCopy = !!successful;\n } catch (err) {\n isCopy = false;\n }\n document.body.removeChild(el);\n if (selected && document.getSelection) {\n document.getSelection().removeAllRanges();\n document.getSelection().addRange(selected);\n }\n cb && cb(isCopy);\n};\n"],"names":["text","cb","el","document","createElement","value","setAttribute","style","position","left","body","appendChild","selected","getSelection","rangeCount","getRangeAt","select","isCopy","execCommand","err","removeChild","removeAllRanges","addRange"],"mappings":";2PAyBe,SAA6BA,EAAMC,GAChD,MAAMC,EAAKC,SAASC,cAAc,YAClCF,EAAGG,MAAQL,EACXE,EAAGI,aAAa,WAAY,IAC5BJ,EAAGK,MAAQ,CACTC,SAAU,WACVC,KAAM,WAERN,SAASO,KAAKC,YAAYT,GAC1B,MAAMU,EAAWT,SAASU,eAAeC,WAAa,GAAIX,SAASU,eAAeE,WAAW,GAC7Fb,EAAGc,SACH,IAAIC,GAAS,EACb,IAEEA,IADmBd,SAASe,YAAY,OAEzC,CAAC,MAAOC,GACPF,GAAS,CACV,CACDd,SAASO,KAAKU,YAAYlB,GACtBU,GAAYT,SAASU,eACvBV,SAASU,eAAeQ,kBACxBlB,SAASU,eAAeS,SAASV,IAEnCX,GAAMA,EAAGgB,EACX"}
1
+ {"version":3,"file":"copy-to-clipboard.umd.min.js","sources":["../src/main.js"],"sourcesContent":["/**\n * *** This styling is an extra step which is likely not required. ***\n * https://github.com/w3c/clipboard-apis/blob/master/explainer.adoc#writing-to-the-clipboard\n * \n * Why is it here? To ensure:\n * \n * 1. the element is able to have focus and selection.\n * 2. if element was to flash render it has minimal visual impact.\n * 3. less flakyness with selection and copying which **might** occur if\n * the textarea element is not visible.\n *\n * The likelihood is the element won't even render, not even a flash,\n * so some of these are just precautions. However in IE the element\n * is visible whilst the popup box asking the user for permission for\n * the web page to copy to the clipboard.\n * \n * Place in top-left corner of screen regardless of scroll position.\n *\n * @typedef CopyTextToClipboard\n * @property {(text: string, method?: (isCopy: boolean) => void) => void} void\n * @returns {void}\n * \n * @param {string} text \n * @param {CopyTextToClipboard} cb \n */\nexport default function copyTextToClipboard(text, cb) {\n if (typeof document === \"undefined\") return;\n const el = document.createElement('textarea');\n el.value = text;\n el.setAttribute('readonly', '');\n el.style = {\n position: 'absolute',\n left: '-9999px',\n }\n document.body.appendChild(el);\n const selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;\n el.select();\n let isCopy = false;\n try {\n const successful = document.execCommand('copy');\n isCopy = !!successful;\n } catch (err) {\n isCopy = false;\n }\n document.body.removeChild(el);\n if (selected && document.getSelection) {\n document.getSelection().removeAllRanges();\n document.getSelection().addRange(selected);\n }\n cb && cb(isCopy);\n};\n"],"names":["text","cb","document","el","createElement","value","setAttribute","style","position","left","body","appendChild","selected","getSelection","rangeCount","getRangeAt","select","isCopy","execCommand","err","removeChild","removeAllRanges","addRange"],"mappings":";2PAyBe,SAA6BA,EAAMC,GAChD,GAAwB,oBAAbC,SAA0B,OACrC,MAAMC,EAAKD,SAASE,cAAc,YAClCD,EAAGE,MAAQL,EACXG,EAAGG,aAAa,WAAY,IAC5BH,EAAGI,MAAQ,CACTC,SAAU,WACVC,KAAM,WAERP,SAASQ,KAAKC,YAAYR,GAC1B,MAAMS,EAAWV,SAASW,eAAeC,WAAa,GAAIZ,SAASW,eAAeE,WAAW,GAC7FZ,EAAGa,SACH,IAAIC,GAAS,EACb,IAEEA,IADmBf,SAASgB,YAAY,OAEzC,CAAC,MAAOC,GACPF,GAAS,CACV,CACDf,SAASQ,KAAKU,YAAYjB,GACtBS,GAAYV,SAASW,eACvBX,SAASW,eAAeQ,kBACxBnB,SAASW,eAAeS,SAASV,IAEnCX,GAAMA,EAAGgB,EACX"}
@@ -0,0 +1,49 @@
1
+ markdown-style pre > .copied,
2
+ markdown-style [class*='language-'] .copied {
3
+ display: flex;
4
+ position: absolute;
5
+ cursor: pointer;
6
+ color: #a5afbb;
7
+ top: 6px;
8
+ right: 6px;
9
+ border-radius: 5px;
10
+ background: #82828226;
11
+ padding: 6px;
12
+ font-size: 12px;
13
+ transition: all 0.3s;
14
+ z-index: 10;
15
+ }
16
+ markdown-style pre > .copied:not(.active),
17
+ markdown-style [class*='language-'] .copied:not(.active) {
18
+ visibility: hidden;
19
+ }
20
+ markdown-style pre:hover > .copied,
21
+ markdown-style [class*='language-']:hover .copied {
22
+ visibility: visible;
23
+ }
24
+ markdown-style pre:hover > .copied:hover,
25
+ markdown-style [class*='language-']:hover .copied:hover {
26
+ background: #4caf50;
27
+ color: #fff;
28
+ }
29
+ markdown-style [class*='language-']:hover .copied:active,
30
+ markdown-style pre > .copied.active {
31
+ background: #2e9b33;
32
+ color: #fff;
33
+ }
34
+ markdown-style pre > .copied .octicon-copy,
35
+ markdown-style [class*='language-'] .copied .octicon-copy {
36
+ display: block;
37
+ }
38
+ markdown-style pre > .copied .octicon-check,
39
+ markdown-style [class*='language-'] .copied .octicon-check {
40
+ display: none;
41
+ }
42
+ markdown-style pre > .active .octicon-copy,
43
+ markdown-style [class*='language-'] .active .octicon-copy {
44
+ display: none;
45
+ }
46
+ markdown-style pre > .active .octicon-check,
47
+ markdown-style [class*='language-'] .active .octicon-check {
48
+ display: block;
49
+ }
@@ -0,0 +1,62 @@
1
+ .idoc-demo-warpper {
2
+ overflow: hidden;
3
+ min-height: 60px;
4
+ margin-bottom: 16px;
5
+ }
6
+
7
+ div.idoc-demo-warpper {
8
+ position: relative;
9
+ background-color: var(--color-canvas-subtle);
10
+ border-radius: 6px;
11
+ }
12
+
13
+ div.idoc-demo-warpper > pre {
14
+ padding: 16px;
15
+ overflow: auto;
16
+ display: block;
17
+ margin-bottom: 0 !important;
18
+ height: 100%;
19
+ }
20
+
21
+ div.idoc-demo-previw {
22
+ padding: 10px;
23
+ font-size: initial;
24
+ line-height: initial;
25
+ line-height: initial;
26
+ font-family: initial;
27
+ overflow: auto;
28
+ }
29
+ .idoc-demo-previw {
30
+ border: 0;
31
+ position: absolute;
32
+ top: 0;
33
+ left: 0;
34
+ right: 0;
35
+ bottom: 0;
36
+ width: 100%;
37
+ background-color: var(--color-canvas-subtle);
38
+ border: 1px solid var(--color-border-default);
39
+ border-radius: 6px;
40
+ z-index: 9;
41
+ transition: left 0.3s cubic-bezier(1, 0, 1, 0);
42
+ }
43
+
44
+ .idoc-demo-previw.ishiden {
45
+ left: -100%;
46
+ }
47
+ button.idoc-toggle-previw {
48
+ user-select: none;
49
+ position: absolute;
50
+ z-index: 10;
51
+ border: transparent;
52
+ background-color: var(--color-border-default);
53
+ cursor: pointer;
54
+ font-size: 12px;
55
+ padding: 2px 5px;
56
+ border-radius: 3px;
57
+ bottom: 5px;
58
+ right: 5px;
59
+ }
60
+ button.idoc-toggle-previw:hover {
61
+ color: var(--color-theme-text);
62
+ }
@@ -0,0 +1,258 @@
1
+ [data-color-mode*='dark'],
2
+ [data-color-mode*='dark'] body {
3
+ --color-header-bg: #3a3a3a8f;
4
+ --color-header-border: #21262d;
5
+ --color-hover: #ffffff1c;
6
+ --color-hoc-bg: #fffefe08;
7
+ }
8
+
9
+ [data-color-mode*='light'],
10
+ [data-color-mode*='light'] body {
11
+ --color-header-bg: #ffffff52;
12
+ --color-header-border: #d3d3d3;
13
+ --color-hover: #0000001a;
14
+ --color-hoc-bg: #00000008;
15
+ }
16
+
17
+ *,
18
+ :after,
19
+ :before {
20
+ box-sizing: border-box;
21
+ }
22
+
23
+ html {
24
+ scroll-behavior: smooth;
25
+ }
26
+
27
+ body {
28
+ margin: 0;
29
+ font-size: 14px;
30
+ font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
31
+ }
32
+
33
+ a {
34
+ text-decoration: none;
35
+ color: var(--color-accent-fg);
36
+ }
37
+ a:hover {
38
+ text-decoration: underline;
39
+ }
40
+
41
+ .warpper {
42
+ max-width: 960px;
43
+ margin: 0 auto;
44
+ }
45
+
46
+ .warpper dark-mode {
47
+ font-size: 18px;
48
+ }
49
+
50
+ markdown-style {
51
+ min-height: 60vh;
52
+ grid-area: main;
53
+ margin-bottom: 18px !important;
54
+ }
55
+ markdown-style img {
56
+ background-color: transparent !important;
57
+ }
58
+
59
+ .warpper-content {
60
+ padding: 0 20px;
61
+ padding-top: 32px;
62
+ margin-top: 48px;
63
+ display: grid;
64
+ grid-template-columns: minmax(0, 3.5fr) minmax(0, 15rem);
65
+ grid-template-areas: 'main toc';
66
+ grid-gap: 18px;
67
+ gap: 18px;
68
+ }
69
+ .warpper-content.sidebar {
70
+ grid-template-columns: 180px minmax(0, 3.5fr) minmax(0, 15rem);
71
+ grid-template-areas: 'sidebar main toc';
72
+ }
73
+ .warpper-content.notocs {
74
+ grid-template-columns: minmax(0, 3.5fr);
75
+ grid-template-areas: 'main';
76
+ }
77
+ .warpper-content.sidebar.notocs {
78
+ grid-template-columns: 180px minmax(0, 3.5fr);
79
+ grid-template-areas: 'sidebar main';
80
+ }
81
+
82
+ nav.tocs .is-position-fixed {
83
+ top: 58px !important;
84
+ max-height: calc(100% - 68px);
85
+ }
86
+ nav.tocs {
87
+ position: relative;
88
+ grid-area: toc;
89
+ }
90
+ nav.tocs p {
91
+ color: var(--color-fg-muted);
92
+ margin-bottom: 0;
93
+ }
94
+ nav.tocs a {
95
+ color: var(--color-fg-muted);
96
+ display: block;
97
+ padding: 0 5px;
98
+ }
99
+ nav.tocs .inner {
100
+ padding: 10px 10px 10px 10px;
101
+ background-color: var(--color-hoc-bg);
102
+ max-width: 240px;
103
+ width: 240px;
104
+ }
105
+
106
+ a.gototop {
107
+ position: fixed;
108
+ bottom: 10px;
109
+ right: 10px;
110
+ display: inline-block;
111
+ background: var(--color-theme-text);
112
+ padding: 5px;
113
+ border-radius: 5px;
114
+ z-index: 9999;
115
+ color: var(--color-theme-bg);
116
+ font-size: 10px;
117
+ opacity: 0;
118
+ transition: all 0.3s;
119
+ }
120
+ a.gototop:hover {
121
+ opacity: 1;
122
+ }
123
+
124
+ .header {
125
+ position: fixed;
126
+ width: 100%;
127
+ background: var(--color-header-bg);
128
+ backdrop-filter: saturate(180%) blur(0.4rem);
129
+ background-color: var(--color-header-bg);
130
+ border-bottom: 1px solid var(--color-header-border);
131
+ z-index: 99;
132
+ top: 0;
133
+ }
134
+
135
+ .header .inner {
136
+ display: flex;
137
+ justify-content: space-between;
138
+ min-height: 45px;
139
+ padding-left: 10px;
140
+ padding-right: 10px;
141
+ }
142
+ .header .logo {
143
+ font-weight: bold;
144
+ display: flex;
145
+ color: var(--color-theme-text);
146
+ align-items: center;
147
+ }
148
+ .header .logo:hover {
149
+ text-decoration: none;
150
+ }
151
+ .header .logo .title {
152
+ padding-left: 8px;
153
+ display: flex;
154
+ }
155
+ .header .logo .title sup {
156
+ margin-top: -5px;
157
+ padding-left: 2px;
158
+ font-weight: normal;
159
+ color: var(--color-fg-subtle);
160
+ }
161
+ .header .logo img,
162
+ .header .logo svg {
163
+ height: 26px;
164
+ display: block;
165
+ }
166
+
167
+ .header .content {
168
+ display: flex;
169
+ align-items: center;
170
+ }
171
+
172
+ .header .menu {
173
+ padding: 0;
174
+ margin: 0;
175
+ display: flex;
176
+ list-style: none;
177
+ padding-right: 10px;
178
+ }
179
+ .header .menu li {
180
+ display: flex;
181
+ align-items: center;
182
+ }
183
+ .header a {
184
+ color: var(--color-theme-text);
185
+ font-weight: bold;
186
+ }
187
+ .header .menu a {
188
+ padding: 3px 7px;
189
+ font-size: 14px;
190
+ border-radius: 2px;
191
+ }
192
+ .header .menu a.active {
193
+ background-color: var(--color-hover);
194
+ }
195
+
196
+ .header .github {
197
+ width: 18px;
198
+ height: 18px;
199
+ margin-right: 8px;
200
+ }
201
+
202
+ section.article-footer {
203
+ display: flex;
204
+ align-items: center;
205
+ font-size: 14px;
206
+ justify-content: space-between;
207
+ margin-top: 12px;
208
+ }
209
+
210
+ section.article-footer a {
211
+ display: flex;
212
+ align-items: center;
213
+ }
214
+
215
+ section.article-footer .edit-button {
216
+ padding-right: 8px;
217
+ }
218
+ section.article-footer .edit-button svg {
219
+ height: 15px;
220
+ margin-right: 6px;
221
+ }
222
+
223
+ section.article-footer .atime {
224
+ font-size: 12px;
225
+ color: var(--color-fg-muted);
226
+ margin-top: 2px;
227
+ }
228
+
229
+ .previous {
230
+ display: flex;
231
+ align-items: center;
232
+ justify-content: space-between;
233
+ grid-gap: 12px;
234
+ gap: 12px;
235
+ background-color: var(--color-canvas-subtle);
236
+ padding: 10px;
237
+ font-size: 14px;
238
+ border-radius: 5px;
239
+ margin-top: 26px;
240
+ }
241
+ .previous a {
242
+ display: flex;
243
+ align-items: center;
244
+ }
245
+ .previous a.prev svg {
246
+ margin-right: 3px;
247
+ }
248
+ .previous a.next svg {
249
+ margin-left: 3px;
250
+ }
251
+
252
+ .footer {
253
+ text-align: center;
254
+ border-top: 1px solid var(--color-header-border);
255
+ padding: 32px 0 110px 0;
256
+ color: var(--color-fg-muted);
257
+ font-size: 14px;
258
+ }
@@ -0,0 +1,52 @@
1
+ @media only screen and (min-width: 1024px) {
2
+ footer.article-footer,
3
+ .warpper {
4
+ max-width: 1200px;
5
+ }
6
+ }
7
+
8
+ @media screen and (max-width: 900px) {
9
+ .warpper-content {
10
+ grid-template-columns: minmax(0, 3.5fr);
11
+ grid-template-areas: 'main';
12
+ }
13
+ .warpper-content.sidebar {
14
+ grid-template-areas: 'sidebar main';
15
+ grid-template-columns: 180px minmax(0, 41rem);
16
+ }
17
+ nav.tocs {
18
+ display: none;
19
+ }
20
+ }
21
+
22
+ @media screen and (max-width: 600px) {
23
+ .warpper-content {
24
+ grid-template-columns: minmax(0, 3.5fr);
25
+ grid-template-areas: 'main';
26
+ }
27
+ .warpper-content.sidebar {
28
+ grid-template-areas: 'main';
29
+ grid-template-columns: minmax(0, 41rem);
30
+ }
31
+ nav.tocs,
32
+ .sidebar-border {
33
+ display: none;
34
+ }
35
+ }
36
+
37
+ @media print {
38
+ .header,
39
+ nav.tocs,
40
+ section.article-footer,
41
+ .sidebar-border,
42
+ .previous,
43
+ .footer,
44
+ a.gototop {
45
+ display: none;
46
+ }
47
+ .warpper-content {
48
+ margin: 0;
49
+ padding: 0;
50
+ display: initial;
51
+ }
52
+ }
@@ -0,0 +1,41 @@
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
+ }
@@ -0,0 +1,52 @@
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
+ }