@texonom/nreact 1.6.2 → 1.6.5
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/build/asset-wrapper-BjCXzGmC.js +1056 -0
- package/build/asset-wrapper-BjCXzGmC.js.map +1 -0
- package/build/block.d.ts +1 -0
- package/build/block.d.ts.map +1 -1
- package/build/collection-column-title-Bw3sXBSk.js +113 -0
- package/build/collection-column-title-Bw3sXBSk.js.map +1 -0
- package/build/components/editable-text.d.ts +18 -0
- package/build/components/editable-text.d.ts.map +1 -0
- package/build/components/editable-text.test.d.ts +2 -0
- package/build/components/editable-text.test.d.ts.map +1 -0
- package/build/context.d.ts +4 -0
- package/build/context.d.ts.map +1 -1
- package/build/index.js +596 -689
- package/build/index.js.map +1 -1
- package/build/renderer.d.ts +3 -0
- package/build/renderer.d.ts.map +1 -1
- package/build/rolldown-runtime-CEFd7nDs.js +30 -0
- package/build/third-party/code.js +559 -196
- package/build/third-party/code.js.map +1 -1
- package/build/third-party/collection.js +2690 -3432
- package/build/third-party/collection.js.map +1 -1
- package/build/third-party/equation.js +27 -43
- package/build/third-party/equation.js.map +1 -1
- package/build/third-party/modal.js +1355 -1615
- package/build/third-party/modal.js.map +1 -1
- package/license +21 -0
- package/package.json +16 -13
- package/src/styles.css +16 -0
- package/build/_commonjsHelpers-ByYUsBRP.js +0 -34
- package/build/_commonjsHelpers-ByYUsBRP.js.map +0 -1
- package/build/asset-wrapper-CVJvW06J.js +0 -984
- package/build/asset-wrapper-CVJvW06J.js.map +0 -1
- package/build/collection-column-title-l4hmVo49.js +0 -99
- package/build/collection-column-title-l4hmVo49.js.map +0 -1
|
@@ -1,199 +1,562 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
]
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
1
|
+
import { o as e, t } from "../rolldown-runtime-CEFd7nDs.js";
|
|
2
|
+
import { f as n, g as r, j as i, p as a, s as o } from "../asset-wrapper-BjCXzGmC.js";
|
|
3
|
+
import s from "react";
|
|
4
|
+
import { getBlockTitle as c } from "@texonom/nutils";
|
|
5
|
+
import { highlightElement as l } from "prismjs";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-clike.min.js
|
|
8
|
+
var u = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
9
|
+
a(), t.exports = l;
|
|
10
|
+
function r() {
|
|
11
|
+
return new DOMException("The request is not allowed", "NotAllowedError");
|
|
12
|
+
}
|
|
13
|
+
function i(e) {
|
|
14
|
+
return o.apply(this, arguments);
|
|
15
|
+
}
|
|
16
|
+
function o() {
|
|
17
|
+
return o = n(function* (e) {
|
|
18
|
+
if (!navigator.clipboard) throw r();
|
|
19
|
+
return navigator.clipboard.writeText(e);
|
|
20
|
+
}), o.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
function s(e) {
|
|
23
|
+
return c.apply(this, arguments);
|
|
24
|
+
}
|
|
25
|
+
function c() {
|
|
26
|
+
return c = n(function* (e) {
|
|
27
|
+
let t = document.createElement("span");
|
|
28
|
+
t.textContent = e, t.style.whiteSpace = "pre", t.style.webkitUserSelect = "auto", t.style.userSelect = "all", document.body.appendChild(t);
|
|
29
|
+
let n = window.getSelection(), i = window.document.createRange();
|
|
30
|
+
n.removeAllRanges(), i.selectNode(t), n.addRange(i);
|
|
31
|
+
let a = !1;
|
|
32
|
+
try {
|
|
33
|
+
a = window.document.execCommand("copy");
|
|
34
|
+
} finally {
|
|
35
|
+
n.removeAllRanges(), window.document.body.removeChild(t);
|
|
36
|
+
}
|
|
37
|
+
if (!a) throw r();
|
|
38
|
+
}), c.apply(this, arguments);
|
|
39
|
+
}
|
|
40
|
+
function l(e) {
|
|
41
|
+
return u.apply(this, arguments);
|
|
42
|
+
}
|
|
43
|
+
function u() {
|
|
44
|
+
return u = n(function* (e) {
|
|
45
|
+
try {
|
|
46
|
+
yield i(e);
|
|
47
|
+
} catch (t) {
|
|
48
|
+
try {
|
|
49
|
+
yield s(e);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
throw e || t || r();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}), u.apply(this, arguments);
|
|
55
|
+
}
|
|
56
|
+
})))(), 1);
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region ../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-typescript.min.js
|
|
59
|
+
Prism.languages.clike = {
|
|
60
|
+
comment: [{
|
|
61
|
+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
62
|
+
lookbehind: !0,
|
|
63
|
+
greedy: !0
|
|
64
|
+
}, {
|
|
65
|
+
pattern: /(^|[^\\:])\/\/.*/,
|
|
66
|
+
lookbehind: !0,
|
|
67
|
+
greedy: !0
|
|
68
|
+
}],
|
|
69
|
+
string: {
|
|
70
|
+
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
71
|
+
greedy: !0
|
|
72
|
+
},
|
|
73
|
+
"class-name": {
|
|
74
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
75
|
+
lookbehind: !0,
|
|
76
|
+
inside: { punctuation: /[.\\]/ }
|
|
77
|
+
},
|
|
78
|
+
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
79
|
+
boolean: /\b(?:false|true)\b/,
|
|
80
|
+
function: /\b\w+(?=\()/,
|
|
81
|
+
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
82
|
+
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
83
|
+
punctuation: /[{}[\];(),.:]/
|
|
84
|
+
}, (function(e) {
|
|
85
|
+
var t, n = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
|
|
86
|
+
e.languages.css.selector = {
|
|
87
|
+
pattern: e.languages.css.selector.pattern,
|
|
88
|
+
lookbehind: !0,
|
|
89
|
+
inside: t = {
|
|
90
|
+
"pseudo-element": /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
|
|
91
|
+
"pseudo-class": /:[-\w]+/,
|
|
92
|
+
class: /\.[-\w]+/,
|
|
93
|
+
id: /#[-\w]+/,
|
|
94
|
+
attribute: {
|
|
95
|
+
pattern: RegExp("\\[(?:[^[\\]\"']|" + n.source + ")*\\]"),
|
|
96
|
+
greedy: !0,
|
|
97
|
+
inside: {
|
|
98
|
+
punctuation: /^\[|\]$/,
|
|
99
|
+
"case-sensitivity": {
|
|
100
|
+
pattern: /(\s)[si]$/i,
|
|
101
|
+
lookbehind: !0,
|
|
102
|
+
alias: "keyword"
|
|
103
|
+
},
|
|
104
|
+
namespace: {
|
|
105
|
+
pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,
|
|
106
|
+
lookbehind: !0,
|
|
107
|
+
inside: { punctuation: /\|$/ }
|
|
108
|
+
},
|
|
109
|
+
"attr-name": {
|
|
110
|
+
pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,
|
|
111
|
+
lookbehind: !0
|
|
112
|
+
},
|
|
113
|
+
"attr-value": [n, {
|
|
114
|
+
pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,
|
|
115
|
+
lookbehind: !0
|
|
116
|
+
}],
|
|
117
|
+
operator: /[|~*^$]?=/
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"n-th": [{
|
|
121
|
+
pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
|
|
122
|
+
lookbehind: !0,
|
|
123
|
+
inside: {
|
|
124
|
+
number: /[\dn]+/,
|
|
125
|
+
operator: /[+-]/
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
|
|
129
|
+
lookbehind: !0
|
|
130
|
+
}],
|
|
131
|
+
combinator: />|\+|~|\|\|/,
|
|
132
|
+
punctuation: /[(),]/
|
|
133
|
+
}
|
|
134
|
+
}, e.languages.css.atrule.inside["selector-function-argument"].inside = t, e.languages.insertBefore("css", "property", { variable: {
|
|
135
|
+
pattern: /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,
|
|
136
|
+
lookbehind: !0
|
|
137
|
+
} });
|
|
138
|
+
var r = {
|
|
139
|
+
pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/,
|
|
140
|
+
lookbehind: !0
|
|
141
|
+
}, i = {
|
|
142
|
+
pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
|
|
143
|
+
lookbehind: !0
|
|
144
|
+
};
|
|
145
|
+
e.languages.insertBefore("css", "function", {
|
|
146
|
+
operator: {
|
|
147
|
+
pattern: /(\s)[+\-*\/](?=\s)/,
|
|
148
|
+
lookbehind: !0
|
|
149
|
+
},
|
|
150
|
+
hexcode: {
|
|
151
|
+
pattern: /\B#[\da-f]{3,8}\b/i,
|
|
152
|
+
alias: "color"
|
|
153
|
+
},
|
|
154
|
+
color: [{
|
|
155
|
+
pattern: /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
|
|
156
|
+
lookbehind: !0
|
|
157
|
+
}, {
|
|
158
|
+
pattern: /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
|
|
159
|
+
inside: {
|
|
160
|
+
unit: r,
|
|
161
|
+
number: i,
|
|
162
|
+
function: /[\w-]+(?=\()/,
|
|
163
|
+
punctuation: /[(),]/
|
|
164
|
+
}
|
|
165
|
+
}],
|
|
166
|
+
entity: /\\[\da-f]{1,8}/i,
|
|
167
|
+
unit: r,
|
|
168
|
+
number: i
|
|
169
|
+
});
|
|
170
|
+
})(Prism), (function(e) {
|
|
171
|
+
var t = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
172
|
+
e.languages.css = {
|
|
173
|
+
comment: /\/\*[\s\S]*?\*\//,
|
|
174
|
+
atrule: {
|
|
175
|
+
pattern: RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|" + t.source + ")*?(?:;|(?=\\s*\\{))"),
|
|
176
|
+
inside: {
|
|
177
|
+
rule: /^@[\w-]+/,
|
|
178
|
+
"selector-function-argument": {
|
|
179
|
+
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
180
|
+
lookbehind: !0,
|
|
181
|
+
alias: "selector"
|
|
182
|
+
},
|
|
183
|
+
keyword: {
|
|
184
|
+
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
185
|
+
lookbehind: !0
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
url: {
|
|
190
|
+
pattern: RegExp("\\burl\\((?:" + t.source + "|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)", "i"),
|
|
191
|
+
greedy: !0,
|
|
192
|
+
inside: {
|
|
193
|
+
function: /^url/i,
|
|
194
|
+
punctuation: /^\(|\)$/,
|
|
195
|
+
string: {
|
|
196
|
+
pattern: RegExp("^" + t.source + "$"),
|
|
197
|
+
alias: "url"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
selector: {
|
|
202
|
+
pattern: RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|" + t.source + ")*(?=\\s*\\{)"),
|
|
203
|
+
lookbehind: !0
|
|
204
|
+
},
|
|
205
|
+
string: {
|
|
206
|
+
pattern: t,
|
|
207
|
+
greedy: !0
|
|
208
|
+
},
|
|
209
|
+
property: {
|
|
210
|
+
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
211
|
+
lookbehind: !0
|
|
212
|
+
},
|
|
213
|
+
important: /!important\b/i,
|
|
214
|
+
function: {
|
|
215
|
+
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
216
|
+
lookbehind: !0
|
|
217
|
+
},
|
|
218
|
+
punctuation: /[(){};:,]/
|
|
219
|
+
}, e.languages.css.atrule.inside.rest = e.languages.css;
|
|
220
|
+
var n = e.languages.markup;
|
|
221
|
+
n && (n.tag.addInlined("style", "css"), n.tag.addAttribute("style", "css"));
|
|
222
|
+
})(Prism), Prism.languages.javascript = Prism.languages.extend("clike", {
|
|
223
|
+
"class-name": [Prism.languages.clike["class-name"], {
|
|
224
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
225
|
+
lookbehind: !0
|
|
226
|
+
}],
|
|
227
|
+
keyword: [{
|
|
228
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
|
229
|
+
lookbehind: !0
|
|
230
|
+
}, {
|
|
231
|
+
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
|
232
|
+
lookbehind: !0
|
|
233
|
+
}],
|
|
234
|
+
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
235
|
+
number: {
|
|
236
|
+
pattern: RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),
|
|
237
|
+
lookbehind: !0
|
|
238
|
+
},
|
|
239
|
+
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
240
|
+
}), Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, Prism.languages.insertBefore("javascript", "keyword", {
|
|
241
|
+
regex: {
|
|
242
|
+
pattern: RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))"),
|
|
243
|
+
lookbehind: !0,
|
|
244
|
+
greedy: !0,
|
|
245
|
+
inside: {
|
|
246
|
+
"regex-source": {
|
|
247
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
248
|
+
lookbehind: !0,
|
|
249
|
+
alias: "language-regex",
|
|
250
|
+
inside: Prism.languages.regex
|
|
251
|
+
},
|
|
252
|
+
"regex-delimiter": /^\/|\/$/,
|
|
253
|
+
"regex-flags": /^[a-z]+$/
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"function-variable": {
|
|
257
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
|
258
|
+
alias: "function"
|
|
259
|
+
},
|
|
260
|
+
parameter: [
|
|
261
|
+
{
|
|
262
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
263
|
+
lookbehind: !0,
|
|
264
|
+
inside: Prism.languages.javascript
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
268
|
+
lookbehind: !0,
|
|
269
|
+
inside: Prism.languages.javascript
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
273
|
+
lookbehind: !0,
|
|
274
|
+
inside: Prism.languages.javascript
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
278
|
+
lookbehind: !0,
|
|
279
|
+
inside: Prism.languages.javascript
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
283
|
+
}), Prism.languages.insertBefore("javascript", "string", {
|
|
284
|
+
hashbang: {
|
|
285
|
+
pattern: /^#!.*/,
|
|
286
|
+
greedy: !0,
|
|
287
|
+
alias: "comment"
|
|
288
|
+
},
|
|
289
|
+
"template-string": {
|
|
290
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
291
|
+
greedy: !0,
|
|
292
|
+
inside: {
|
|
293
|
+
"template-punctuation": {
|
|
294
|
+
pattern: /^`|`$/,
|
|
295
|
+
alias: "string"
|
|
296
|
+
},
|
|
297
|
+
interpolation: {
|
|
298
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
299
|
+
lookbehind: !0,
|
|
300
|
+
inside: {
|
|
301
|
+
"interpolation-punctuation": {
|
|
302
|
+
pattern: /^\$\{|\}$/,
|
|
303
|
+
alias: "punctuation"
|
|
304
|
+
},
|
|
305
|
+
rest: Prism.languages.javascript
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
string: /[\s\S]+/
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"string-property": {
|
|
312
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
313
|
+
lookbehind: !0,
|
|
314
|
+
greedy: !0,
|
|
315
|
+
alias: "property"
|
|
316
|
+
}
|
|
317
|
+
}), Prism.languages.insertBefore("javascript", "operator", { "literal-property": {
|
|
318
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
319
|
+
lookbehind: !0,
|
|
320
|
+
alias: "property"
|
|
321
|
+
} }), Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)", "javascript")), Prism.languages.js = Prism.languages.javascript, (function(e) {
|
|
322
|
+
function t(e, t) {
|
|
323
|
+
return RegExp(e.replace(/<ID>/g, (function() {
|
|
324
|
+
return "(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*";
|
|
325
|
+
})), t);
|
|
326
|
+
}
|
|
327
|
+
e.languages.insertBefore("javascript", "function-variable", { "method-variable": {
|
|
328
|
+
pattern: RegExp("(\\.\\s*)" + e.languages.javascript["function-variable"].pattern.source),
|
|
329
|
+
lookbehind: !0,
|
|
330
|
+
alias: [
|
|
331
|
+
"function-variable",
|
|
332
|
+
"method",
|
|
333
|
+
"function",
|
|
334
|
+
"property-access"
|
|
335
|
+
]
|
|
336
|
+
} }), e.languages.insertBefore("javascript", "function", { method: {
|
|
337
|
+
pattern: RegExp("(\\.\\s*)" + e.languages.javascript.function.source),
|
|
338
|
+
lookbehind: !0,
|
|
339
|
+
alias: ["function", "property-access"]
|
|
340
|
+
} }), e.languages.insertBefore("javascript", "constant", { "known-class-name": [{
|
|
341
|
+
pattern: /\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,
|
|
342
|
+
alias: "class-name"
|
|
343
|
+
}, {
|
|
344
|
+
pattern: /\b(?:[A-Z]\w*)Error\b/,
|
|
345
|
+
alias: "class-name"
|
|
346
|
+
}] }), e.languages.insertBefore("javascript", "keyword", {
|
|
347
|
+
imports: {
|
|
348
|
+
pattern: t("(\\bimport\\b\\s*)(?:<ID>(?:\\s*,\\s*(?:\\*\\s*as\\s+<ID>|\\{[^{}]*\\}))?|\\*\\s*as\\s+<ID>|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)"),
|
|
349
|
+
lookbehind: !0,
|
|
350
|
+
inside: e.languages.javascript
|
|
351
|
+
},
|
|
352
|
+
exports: {
|
|
353
|
+
pattern: t("(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+<ID>)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})"),
|
|
354
|
+
lookbehind: !0,
|
|
355
|
+
inside: e.languages.javascript
|
|
356
|
+
}
|
|
357
|
+
}), e.languages.javascript.keyword.unshift({
|
|
358
|
+
pattern: /\b(?:as|default|export|from|import)\b/,
|
|
359
|
+
alias: "module"
|
|
360
|
+
}, {
|
|
361
|
+
pattern: /\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,
|
|
362
|
+
alias: "control-flow"
|
|
363
|
+
}, {
|
|
364
|
+
pattern: /\bnull\b/,
|
|
365
|
+
alias: ["null", "nil"]
|
|
366
|
+
}, {
|
|
367
|
+
pattern: /\bundefined\b/,
|
|
368
|
+
alias: "nil"
|
|
369
|
+
}), e.languages.insertBefore("javascript", "operator", {
|
|
370
|
+
spread: {
|
|
371
|
+
pattern: /\.{3}/,
|
|
372
|
+
alias: "operator"
|
|
373
|
+
},
|
|
374
|
+
arrow: {
|
|
375
|
+
pattern: /=>/,
|
|
376
|
+
alias: "operator"
|
|
377
|
+
}
|
|
378
|
+
}), e.languages.insertBefore("javascript", "punctuation", {
|
|
379
|
+
"property-access": {
|
|
380
|
+
pattern: t("(\\.\\s*)#?<ID>"),
|
|
381
|
+
lookbehind: !0
|
|
382
|
+
},
|
|
383
|
+
"maybe-class-name": {
|
|
384
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,
|
|
385
|
+
lookbehind: !0
|
|
386
|
+
},
|
|
387
|
+
dom: {
|
|
388
|
+
pattern: /\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,
|
|
389
|
+
alias: "variable"
|
|
390
|
+
},
|
|
391
|
+
console: {
|
|
392
|
+
pattern: /\bconsole(?=\s*\.)/,
|
|
393
|
+
alias: "class-name"
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
for (var n = [
|
|
397
|
+
"function",
|
|
398
|
+
"function-variable",
|
|
399
|
+
"method",
|
|
400
|
+
"method-variable",
|
|
401
|
+
"property-access"
|
|
402
|
+
], r = 0; r < n.length; r++) {
|
|
403
|
+
var i = n[r], a = e.languages.javascript[i];
|
|
404
|
+
e.util.type(a) === "RegExp" && (a = e.languages.javascript[i] = { pattern: a });
|
|
405
|
+
var o = a.inside || {};
|
|
406
|
+
a.inside = o, o["maybe-class-name"] = /^[A-Z][\s\S]*/;
|
|
407
|
+
}
|
|
408
|
+
})(Prism), Prism.languages.json = {
|
|
409
|
+
property: {
|
|
410
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
411
|
+
lookbehind: !0,
|
|
412
|
+
greedy: !0
|
|
413
|
+
},
|
|
414
|
+
string: {
|
|
415
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
416
|
+
lookbehind: !0,
|
|
417
|
+
greedy: !0
|
|
418
|
+
},
|
|
419
|
+
comment: {
|
|
420
|
+
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
421
|
+
greedy: !0
|
|
422
|
+
},
|
|
423
|
+
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
424
|
+
punctuation: /[{}[\],]/,
|
|
425
|
+
operator: /:/,
|
|
426
|
+
boolean: /\b(?:false|true)\b/,
|
|
427
|
+
null: {
|
|
428
|
+
pattern: /\bnull\b/,
|
|
429
|
+
alias: "keyword"
|
|
430
|
+
}
|
|
431
|
+
}, Prism.languages.webmanifest = Prism.languages.json, (function(e) {
|
|
432
|
+
var t = e.util.clone(e.languages.javascript), n = "(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})";
|
|
433
|
+
function r(e, t) {
|
|
434
|
+
return e = e.replace(/<S>/g, (function() {
|
|
435
|
+
return "(?:\\s|//.*(?!.)|/\\*(?:[^*]|\\*(?!/))\\*/)";
|
|
436
|
+
})).replace(/<BRACES>/g, (function() {
|
|
437
|
+
return "(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})";
|
|
438
|
+
})).replace(/<SPREAD>/g, (function() {
|
|
439
|
+
return n;
|
|
440
|
+
})), RegExp(e, t);
|
|
441
|
+
}
|
|
442
|
+
n = r(n).source, e.languages.jsx = e.languages.extend("markup", t), e.languages.jsx.tag.pattern = r("</?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:\"(?:\\\\[^]|[^\\\\\"])*\"|'(?:\\\\[^]|[^\\\\'])*'|[^\\s{'\"/>=]+|<BRACES>))?|<SPREAD>))*<S>*/?)?>"), e.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/, e.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/, e.languages.jsx.tag.inside.tag.inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/, e.languages.jsx.tag.inside.comment = t.comment, e.languages.insertBefore("inside", "attr-name", { spread: {
|
|
443
|
+
pattern: r("<SPREAD>"),
|
|
444
|
+
inside: e.languages.jsx
|
|
445
|
+
} }, e.languages.jsx.tag), e.languages.insertBefore("inside", "special-attr", { script: {
|
|
446
|
+
pattern: r("=<BRACES>"),
|
|
447
|
+
alias: "language-javascript",
|
|
448
|
+
inside: {
|
|
449
|
+
"script-punctuation": {
|
|
450
|
+
pattern: /^=(?=\{)/,
|
|
451
|
+
alias: "punctuation"
|
|
452
|
+
},
|
|
453
|
+
rest: e.languages.jsx
|
|
454
|
+
}
|
|
455
|
+
} }, e.languages.jsx.tag);
|
|
456
|
+
var i = function(e) {
|
|
457
|
+
return e ? typeof e == "string" ? e : typeof e.content == "string" ? e.content : e.content.map(i).join("") : "";
|
|
458
|
+
}, a = function(t) {
|
|
459
|
+
for (var n = [], r = 0; r < t.length; r++) {
|
|
460
|
+
var o = t[r], s = !1;
|
|
461
|
+
if (typeof o != "string" && (o.type === "tag" && o.content[0] && o.content[0].type === "tag" ? o.content[0].content[0].content === "</" ? n.length > 0 && n[n.length - 1].tagName === i(o.content[0].content[1]) && n.pop() : o.content[o.content.length - 1].content === "/>" || n.push({
|
|
462
|
+
tagName: i(o.content[0].content[1]),
|
|
463
|
+
openedBraces: 0
|
|
464
|
+
}) : n.length > 0 && o.type === "punctuation" && o.content === "{" ? n[n.length - 1].openedBraces++ : n.length > 0 && n[n.length - 1].openedBraces > 0 && o.type === "punctuation" && o.content === "}" ? n[n.length - 1].openedBraces-- : s = !0), (s || typeof o == "string") && n.length > 0 && n[n.length - 1].openedBraces === 0) {
|
|
465
|
+
var c = i(o);
|
|
466
|
+
r < t.length - 1 && (typeof t[r + 1] == "string" || t[r + 1].type === "plain-text") && (c += i(t[r + 1]), t.splice(r + 1, 1)), r > 0 && (typeof t[r - 1] == "string" || t[r - 1].type === "plain-text") && (c = i(t[r - 1]) + c, t.splice(r - 1, 1), r--), t[r] = new e.Token("plain-text", c, null, c);
|
|
467
|
+
}
|
|
468
|
+
o.content && typeof o.content != "string" && a(o.content);
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
e.hooks.add("after-tokenize", (function(e) {
|
|
472
|
+
e.language !== "jsx" && e.language !== "tsx" || a(e.tokens);
|
|
473
|
+
}));
|
|
474
|
+
})(Prism), (function(e) {
|
|
475
|
+
var t = e.util.clone(e.languages.typescript);
|
|
476
|
+
e.languages.tsx = e.languages.extend("jsx", t), delete e.languages.tsx.parameter, delete e.languages.tsx["literal-property"];
|
|
477
|
+
var n = e.languages.tsx.tag;
|
|
478
|
+
n.pattern = RegExp("(^|[^\\w$]|(?=</))(?:" + n.pattern.source + ")", n.pattern.flags), n.lookbehind = !0;
|
|
479
|
+
})(Prism), (function(e) {
|
|
480
|
+
e.languages.typescript = e.languages.extend("javascript", {
|
|
481
|
+
"class-name": {
|
|
482
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
|
|
483
|
+
lookbehind: !0,
|
|
484
|
+
greedy: !0,
|
|
485
|
+
inside: null
|
|
486
|
+
},
|
|
487
|
+
builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
|
|
488
|
+
}), e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/, /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/, /\btype\b(?=\s*(?:[\{*]|$))/), delete e.languages.typescript.parameter, delete e.languages.typescript["literal-property"];
|
|
489
|
+
var t = e.languages.extend("typescript", {});
|
|
490
|
+
delete t["class-name"], e.languages.typescript["class-name"].inside = t, e.languages.insertBefore("typescript", "function", {
|
|
491
|
+
decorator: {
|
|
492
|
+
pattern: /@[$\w\xA0-\uFFFF]+/,
|
|
493
|
+
inside: {
|
|
494
|
+
at: {
|
|
495
|
+
pattern: /^@/,
|
|
496
|
+
alias: "operator"
|
|
497
|
+
},
|
|
498
|
+
function: /^[\s\S]+/
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
"generic-function": {
|
|
502
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
|
|
503
|
+
greedy: !0,
|
|
504
|
+
inside: {
|
|
505
|
+
function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
|
|
506
|
+
generic: {
|
|
507
|
+
pattern: /<[\s\S]+/,
|
|
508
|
+
alias: "class-name",
|
|
509
|
+
inside: t
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}), e.languages.ts = e.languages.typescript;
|
|
153
514
|
})(Prism);
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region src/icons/copy.tsx
|
|
517
|
+
function d(e) {
|
|
518
|
+
return /* @__PURE__ */ s.createElement("svg", i({
|
|
519
|
+
fill: "currentColor",
|
|
520
|
+
viewBox: "0 0 16 16",
|
|
521
|
+
width: "1em",
|
|
522
|
+
version: "1.1"
|
|
523
|
+
}, e), /* @__PURE__ */ s.createElement("path", {
|
|
524
|
+
fillRule: "evenodd",
|
|
525
|
+
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"
|
|
526
|
+
}), /* @__PURE__ */ s.createElement("path", {
|
|
527
|
+
fillRule: "evenodd",
|
|
528
|
+
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"
|
|
529
|
+
}));
|
|
161
530
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const d = u.useCallback(() => {
|
|
190
|
-
T(r), o(!0), i.current && (clearTimeout(i.current), i.current = null), i.current = setTimeout(() => {
|
|
191
|
-
o(!1);
|
|
192
|
-
}, 1200);
|
|
193
|
-
}, [r, i]), $ = /* @__PURE__ */ u.createElement("div", { className: "notion-code-copy-button", onClick: d }, /* @__PURE__ */ u.createElement(q, null));
|
|
194
|
-
return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("pre", { className: `notion-code ${a || ""}` }, /* @__PURE__ */ u.createElement("div", { className: "notion-code-copy" }, $, c && /* @__PURE__ */ u.createElement("div", { className: "notion-code-copy-tooltip" }, /* @__PURE__ */ u.createElement("div", null, c ? "Copied" : "Copy"))), /* @__PURE__ */ u.createElement("code", { className: `language-${s}`, ref: p }, r)), l && /* @__PURE__ */ u.createElement("figcaption", { className: "notion-asset-caption" }, /* @__PURE__ */ u.createElement(G, { value: l, block: e })));
|
|
195
|
-
};
|
|
196
|
-
export {
|
|
197
|
-
J as Code
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region src/third-party/code.tsx
|
|
533
|
+
var f = ({ block: e, defaultLanguage: t = "typescript", className: n }) => {
|
|
534
|
+
var i;
|
|
535
|
+
let [a, f] = s.useState(!1), p = s.useRef(null), { recordMap: m } = o(), h = c(e, m), g = (((i = e.properties) == null || (i = i.language) == null || (i = i[0]) == null ? void 0 : i[0]) || t).toLowerCase(), _ = e.properties.caption, v = s.useRef(null);
|
|
536
|
+
s.useEffect(() => {
|
|
537
|
+
if (v.current) try {
|
|
538
|
+
l(v.current);
|
|
539
|
+
} catch (e) {
|
|
540
|
+
console.warn("prismjs highlight error", e);
|
|
541
|
+
}
|
|
542
|
+
}, [v]);
|
|
543
|
+
let y = s.useCallback(() => {
|
|
544
|
+
(0, u.default)(h), f(!0), p.current && (clearTimeout(p.current), p.current = null), p.current = setTimeout(() => {
|
|
545
|
+
f(!1);
|
|
546
|
+
}, 1200);
|
|
547
|
+
}, [h, p]), b = /* @__PURE__ */ s.createElement("div", {
|
|
548
|
+
className: "notion-code-copy-button",
|
|
549
|
+
onClick: y
|
|
550
|
+
}, /* @__PURE__ */ s.createElement(d, null));
|
|
551
|
+
return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("pre", { className: `notion-code ${n || ""}` }, /* @__PURE__ */ s.createElement("div", { className: "notion-code-copy" }, b, a && /* @__PURE__ */ s.createElement("div", { className: "notion-code-copy-tooltip" }, /* @__PURE__ */ s.createElement("div", null, a ? "Copied" : "Copy"))), /* @__PURE__ */ s.createElement("code", {
|
|
552
|
+
className: `language-${g}`,
|
|
553
|
+
ref: v
|
|
554
|
+
}, h)), _ && /* @__PURE__ */ s.createElement("figcaption", { className: "notion-asset-caption" }, /* @__PURE__ */ s.createElement(r, {
|
|
555
|
+
value: _,
|
|
556
|
+
block: e
|
|
557
|
+
})));
|
|
198
558
|
};
|
|
199
|
-
//#
|
|
559
|
+
//#endregion
|
|
560
|
+
export { f as Code };
|
|
561
|
+
|
|
562
|
+
//# sourceMappingURL=code.js.map
|