@designbasekorea/ui-wc 0.5.6 → 0.6.0
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/dist/chunks/lottie-0e23d630.js +1 -0
- package/dist/esm/components/animation-background/canvas-controller.js +1 -121
- package/dist/esm/components/animation-background/controls.js +1 -180
- package/dist/esm/components/animation-background/graphite-controller.js +1 -196
- package/dist/esm/components/animation-background/graphite-presets.js +1 -42
- package/dist/esm/components/animation-background/graphite-shader.js +1 -111
- package/dist/esm/components/animation-background/layers.js +1 -369
- package/dist/esm/components/animation-background/lumina-presets.js +1 -53
- package/dist/esm/components/animation-background/lumina-shaders.js +1 -181
- package/dist/esm/components/animation-background/lumina-utils.js +1 -60
- package/dist/esm/components/animation-background/particle-defaults.js +1 -36
- package/dist/esm/components/animation-background/renderers.js +1 -167
- package/dist/esm/components/animation-background/shader-controller.js +1 -154
- package/dist/esm/components/color-picker-utils.js +1 -134
- package/dist/esm/components/date-picker-utils.js +1 -140
- package/dist/esm/components/db-accordion.js +1 -304
- package/dist/esm/components/db-ad-banner.js +1 -455
- package/dist/esm/components/db-ai-chat-list.d.ts +43 -0
- package/dist/esm/components/db-ai-chat-list.js +1 -0
- package/dist/esm/components/db-ai-chat.d.ts +159 -0
- package/dist/esm/components/db-ai-chat.js +1 -0
- package/dist/esm/components/db-alert.js +1 -149
- package/dist/esm/components/db-animation-background.js +1 -486
- package/dist/esm/components/db-animation-text.js +1 -601
- package/dist/esm/components/db-app-badge.js +1 -88
- package/dist/esm/components/db-audio-player.js +1 -752
- package/dist/esm/components/db-avatar.js +1 -188
- package/dist/esm/components/db-backdrop.js +1 -139
- package/dist/esm/components/db-badge.js +1 -91
- package/dist/esm/components/db-banner.js +1 -188
- package/dist/esm/components/db-bottom-navigation.js +1 -146
- package/dist/esm/components/db-bottom-sheet.js +1 -481
- package/dist/esm/components/db-breadcrumbs.js +1 -329
- package/dist/esm/components/db-button.js +1 -316
- package/dist/esm/components/db-calendar.js +1 -675
- package/dist/esm/components/db-card.js +1 -265
- package/dist/esm/components/db-carousel.js +1 -264
- package/dist/esm/components/db-chat-composer.d.ts +134 -0
- package/dist/esm/components/db-chat-composer.js +1 -0
- package/dist/esm/components/db-chat-list.d.ts +47 -0
- package/dist/esm/components/db-chat-list.js +1 -0
- package/dist/esm/components/db-chat-message.d.ts +39 -0
- package/dist/esm/components/db-chat-message.js +1 -0
- package/dist/esm/components/db-chat-orb.d.ts +99 -0
- package/dist/esm/components/db-chat-orb.js +1 -0
- package/dist/esm/components/db-chat-room.d.ts +71 -0
- package/dist/esm/components/db-chat-room.js +1 -0
- package/dist/esm/components/db-chat-suggestions.d.ts +44 -0
- package/dist/esm/components/db-chat-suggestions.js +1 -0
- package/dist/esm/components/db-chat-typing.d.ts +22 -0
- package/dist/esm/components/db-chat-typing.js +1 -0
- package/dist/esm/components/db-chat-welcome.d.ts +32 -0
- package/dist/esm/components/db-chat-welcome.js +1 -0
- package/dist/esm/components/db-chat-widget.d.ts +146 -0
- package/dist/esm/components/db-chat-widget.js +1 -0
- package/dist/esm/components/db-checkbox.js +1 -202
- package/dist/esm/components/db-chip.js +1 -104
- package/dist/esm/components/db-code-block.js +1 -304
- package/dist/esm/components/db-color-picker.js +1 -746
- package/dist/esm/components/db-confirm.js +1 -191
- package/dist/esm/components/db-container.js +1 -39
- package/dist/esm/components/db-context-menu.js +1 -265
- package/dist/esm/components/db-countdown.js +1 -146
- package/dist/esm/components/db-cursor-follower.js +1 -173
- package/dist/esm/components/db-date-picker.js +1 -837
- package/dist/esm/components/db-divider.js +1 -66
- package/dist/esm/components/db-download-progress.d.ts +89 -0
- package/dist/esm/components/db-download-progress.js +1 -0
- package/dist/esm/components/db-drawer.js +1 -245
- package/dist/esm/components/db-dropdown.js +1 -493
- package/dist/esm/components/db-dropzone.js +1 -266
- package/dist/esm/components/db-email-verify.d.ts +62 -0
- package/dist/esm/components/db-email-verify.js +1 -0
- package/dist/esm/components/db-empty-state.js +1 -97
- package/dist/esm/components/db-file-uploader.js +1 -256
- package/dist/esm/components/db-floating-action-button.js +1 -139
- package/dist/esm/components/db-footer.js +1 -385
- package/dist/esm/components/db-form.js +1 -566
- package/dist/esm/components/db-gantt.js +1 -882
- package/dist/esm/components/db-gradient.js +1 -133
- package/dist/esm/components/db-grid-background.js +1 -909
- package/dist/esm/components/db-grid.js +1 -73
- package/dist/esm/components/db-icons.d.ts +3 -0
- package/dist/esm/components/db-icons.js +1 -82
- package/dist/esm/components/db-image-list.js +1 -214
- package/dist/esm/components/db-image-placeholder.js +1 -96
- package/dist/esm/components/db-image.js +1 -289
- package/dist/esm/components/db-indicator.js +1 -517
- package/dist/esm/components/db-input.js +1 -420
- package/dist/esm/components/db-kanban.js +1 -538
- package/dist/esm/components/db-label.js +1 -66
- package/dist/esm/components/db-lightbox.js +1 -372
- package/dist/esm/components/db-list.js +1 -340
- package/dist/esm/components/db-logo-svg.js +1 -72
- package/dist/esm/components/db-logo.js +1 -106
- package/dist/esm/components/db-lottie.js +1 -109
- package/dist/esm/components/db-markdown-editor.js +1 -458
- package/dist/esm/components/db-marquee.js +1 -402
- package/dist/esm/components/db-masonry.js +1 -94
- package/dist/esm/components/db-menu-item.js +1 -211
- package/dist/esm/components/db-modal.js +1 -522
- package/dist/esm/components/db-navbar.js +1 -680
- package/dist/esm/components/db-onboarding-modal.js +1 -322
- package/dist/esm/components/db-otp-input.d.ts +53 -0
- package/dist/esm/components/db-otp-input.js +1 -0
- package/dist/esm/components/db-page-header.js +1 -312
- package/dist/esm/components/db-pagination.js +1 -271
- package/dist/esm/components/db-phone-verify.d.ts +61 -0
- package/dist/esm/components/db-phone-verify.js +1 -0
- package/dist/esm/components/db-popover.js +1 -580
- package/dist/esm/components/db-progress-step.js +1 -166
- package/dist/esm/components/db-progress.js +1 -171
- package/dist/esm/components/db-progressbar.js +1 -72
- package/dist/esm/components/db-radio.js +1 -172
- package/dist/esm/components/db-random-gradient.js +1 -121
- package/dist/esm/components/db-range-slider.js +1 -811
- package/dist/esm/components/db-rating.js +1 -325
- package/dist/esm/components/db-reorder.js +1 -286
- package/dist/esm/components/db-resizable-panels.js +1 -282
- package/dist/esm/components/db-scroll-area.js +1 -126
- package/dist/esm/components/db-search-bar.js +1 -668
- package/dist/esm/components/db-section-app-download.js +1 -101
- package/dist/esm/components/db-section-contact.js +1 -102
- package/dist/esm/components/db-section-cta.js +1 -150
- package/dist/esm/components/db-section-faq.js +1 -120
- package/dist/esm/components/db-section-feature-grid.js +1 -137
- package/dist/esm/components/db-section-feature.js +1 -179
- package/dist/esm/components/db-section-hero.js +1 -243
- package/dist/esm/components/db-section-logo-cloud.js +1 -138
- package/dist/esm/components/db-section-pricing.js +1 -166
- package/dist/esm/components/db-section-stats.js +1 -129
- package/dist/esm/components/db-section-testimonials.js +1 -252
- package/dist/esm/components/db-section.js +1 -385
- package/dist/esm/components/db-segment-control.js +1 -231
- package/dist/esm/components/db-select.js +1 -571
- package/dist/esm/components/db-share-icons.js +1 -40
- package/dist/esm/components/db-share.js +1 -489
- package/dist/esm/components/db-sidebar.js +1 -1068
- package/dist/esm/components/db-skeleton.js +1 -94
- package/dist/esm/components/db-spinner.js +1 -102
- package/dist/esm/components/db-split-view.js +1 -297
- package/dist/esm/components/db-stack.js +1 -46
- package/dist/esm/components/db-stat.js +1 -218
- package/dist/esm/components/db-stepper.js +1 -398
- package/dist/esm/components/db-table.js +1 -412
- package/dist/esm/components/db-tabs.js +1 -335
- package/dist/esm/components/db-testimonial.d.ts +2 -0
- package/dist/esm/components/db-testimonial.js +1 -162
- package/dist/esm/components/db-textarea.js +1 -233
- package/dist/esm/components/db-time-picker.js +1 -523
- package/dist/esm/components/db-timeline.js +1 -174
- package/dist/esm/components/db-toast.js +1 -158
- package/dist/esm/components/db-toggle.js +1 -162
- package/dist/esm/components/db-toolbar.js +1 -94
- package/dist/esm/components/db-tooltip.js +1 -440
- package/dist/esm/components/db-top-banner.js +1 -121
- package/dist/esm/components/db-tutorial.js +1 -324
- package/dist/esm/components/db-two-factor.d.ts +60 -0
- package/dist/esm/components/db-two-factor.js +1 -0
- package/dist/esm/components/db-video-player.js +1 -503
- package/dist/esm/components/db-youtube-player.js +1 -194
- package/dist/esm/components/highlight-code.js +1 -65
- package/dist/esm/components/input-validation.js +1 -50
- package/dist/esm/components/marketing-block-host-utils.js +1 -9
- package/dist/esm/components/number-scrub.js +1 -117
- package/dist/esm/components/random-gradient-palettes.js +1 -67
- package/dist/esm/components/section-block-header-utils.js +1 -48
- package/dist/esm/helpers/confirm.js +1 -52
- package/dist/esm/helpers/toast.js +1 -73
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.js +1 -111
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-bash.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-clike.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-css.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-javascript.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-json.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-jsx.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markup.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-scss.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-tsx.js +1 -0
- package/dist/esm/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-typescript.js +1 -0
- package/dist/index.cjs +1 -55414
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1091 -2
- package/dist/index.esm.js +1 -38284
- package/dist/react/chunks/lottie-14e7addb.js +1 -0
- package/dist/react/index.cjs +1 -56503
- package/dist/react/index.d.ts +1620 -54
- package/dist/react/index.esm.js +1 -39373
- package/package.json +1 -1
- package/dist/chunks/lottie-e273b936.js +0 -17032
- package/dist/esm/node_modules/prismjs/components/prism-bash.js +0 -235
- package/dist/esm/node_modules/prismjs/components/prism-clike.js +0 -31
- package/dist/esm/node_modules/prismjs/components/prism-css.js +0 -64
- package/dist/esm/node_modules/prismjs/components/prism-javascript.js +0 -172
- package/dist/esm/node_modules/prismjs/components/prism-json.js +0 -27
- package/dist/esm/node_modules/prismjs/components/prism-jsx.js +0 -143
- package/dist/esm/node_modules/prismjs/components/prism-markup.js +0 -186
- package/dist/esm/node_modules/prismjs/components/prism-scss.js +0 -81
- package/dist/esm/node_modules/prismjs/components/prism-tsx.js +0 -15
- package/dist/esm/node_modules/prismjs/components/prism-typescript.js +0 -60
- package/dist/react/chunks/lottie-72a4c6d4.js +0 -17032
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
(function (Prism) {
|
|
2
|
-
// $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
|
|
3
|
-
// + LC_ALL, RANDOM, REPLY, SECONDS.
|
|
4
|
-
// + make sure PS1..4 are here as they are not always set,
|
|
5
|
-
// - some useless things.
|
|
6
|
-
var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b';
|
|
7
|
-
|
|
8
|
-
var commandAfterHeredoc = {
|
|
9
|
-
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
10
|
-
lookbehind: true,
|
|
11
|
-
alias: 'punctuation', // this looks reasonably well in all themes
|
|
12
|
-
inside: null // see below
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
var insideString = {
|
|
16
|
-
'bash': commandAfterHeredoc,
|
|
17
|
-
'environment': {
|
|
18
|
-
pattern: RegExp('\\$' + envVars),
|
|
19
|
-
alias: 'constant'
|
|
20
|
-
},
|
|
21
|
-
'variable': [
|
|
22
|
-
// [0]: Arithmetic Environment
|
|
23
|
-
{
|
|
24
|
-
pattern: /\$?\(\([\s\S]+?\)\)/,
|
|
25
|
-
greedy: true,
|
|
26
|
-
inside: {
|
|
27
|
-
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|
28
|
-
'variable': [
|
|
29
|
-
{
|
|
30
|
-
pattern: /(^\$\(\([\s\S]+)\)\)/,
|
|
31
|
-
lookbehind: true
|
|
32
|
-
},
|
|
33
|
-
/^\$\(\(/
|
|
34
|
-
],
|
|
35
|
-
'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
|
|
36
|
-
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
|
|
37
|
-
'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
|
|
38
|
-
// If there is no $ sign at the beginning highlight (( and )) as punctuation
|
|
39
|
-
'punctuation': /\(\(?|\)\)?|,|;/
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
// [1]: Command Substitution
|
|
43
|
-
{
|
|
44
|
-
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
|
|
45
|
-
greedy: true,
|
|
46
|
-
inside: {
|
|
47
|
-
'variable': /^\$\(|^`|\)$|`$/
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
// [2]: Brace expansion
|
|
51
|
-
{
|
|
52
|
-
pattern: /\$\{[^}]+\}/,
|
|
53
|
-
greedy: true,
|
|
54
|
-
inside: {
|
|
55
|
-
'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
56
|
-
'punctuation': /[\[\]]/,
|
|
57
|
-
'environment': {
|
|
58
|
-
pattern: RegExp('(\\{)' + envVars),
|
|
59
|
-
lookbehind: true,
|
|
60
|
-
alias: 'constant'
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
/\$(?:\w+|[#?*!@$])/
|
|
65
|
-
],
|
|
66
|
-
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
67
|
-
'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
Prism.languages.bash = {
|
|
71
|
-
'shebang': {
|
|
72
|
-
pattern: /^#!\s*\/.*/,
|
|
73
|
-
alias: 'important'
|
|
74
|
-
},
|
|
75
|
-
'comment': {
|
|
76
|
-
pattern: /(^|[^"{\\$])#.*/,
|
|
77
|
-
lookbehind: true
|
|
78
|
-
},
|
|
79
|
-
'function-name': [
|
|
80
|
-
// a) function foo {
|
|
81
|
-
// b) foo() {
|
|
82
|
-
// c) function foo() {
|
|
83
|
-
// but not “foo {”
|
|
84
|
-
{
|
|
85
|
-
// a) and c)
|
|
86
|
-
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
|
|
87
|
-
lookbehind: true,
|
|
88
|
-
alias: 'function'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
// b)
|
|
92
|
-
pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
|
|
93
|
-
alias: 'function'
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
// Highlight variable names as variables in for and select beginnings.
|
|
97
|
-
'for-or-select': {
|
|
98
|
-
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
|
|
99
|
-
alias: 'variable',
|
|
100
|
-
lookbehind: true
|
|
101
|
-
},
|
|
102
|
-
// Highlight variable names as variables in the left-hand part
|
|
103
|
-
// of assignments (“=” and “+=”).
|
|
104
|
-
'assign-left': {
|
|
105
|
-
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
106
|
-
inside: {
|
|
107
|
-
'environment': {
|
|
108
|
-
pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
|
|
109
|
-
lookbehind: true,
|
|
110
|
-
alias: 'constant'
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
alias: 'variable',
|
|
114
|
-
lookbehind: true
|
|
115
|
-
},
|
|
116
|
-
// Highlight parameter names as variables
|
|
117
|
-
'parameter': {
|
|
118
|
-
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
|
|
119
|
-
alias: 'variable',
|
|
120
|
-
lookbehind: true
|
|
121
|
-
},
|
|
122
|
-
'string': [
|
|
123
|
-
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|
124
|
-
{
|
|
125
|
-
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
126
|
-
lookbehind: true,
|
|
127
|
-
greedy: true,
|
|
128
|
-
inside: insideString
|
|
129
|
-
},
|
|
130
|
-
// Here-document with quotes around the tag
|
|
131
|
-
// → No expansion (so no “inside”).
|
|
132
|
-
{
|
|
133
|
-
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
|
|
134
|
-
lookbehind: true,
|
|
135
|
-
greedy: true,
|
|
136
|
-
inside: {
|
|
137
|
-
'bash': commandAfterHeredoc
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
// “Normal” string
|
|
141
|
-
{
|
|
142
|
-
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
|
|
143
|
-
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
144
|
-
lookbehind: true,
|
|
145
|
-
greedy: true,
|
|
146
|
-
inside: insideString
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
150
|
-
pattern: /(^|[^$\\])'[^']*'/,
|
|
151
|
-
lookbehind: true,
|
|
152
|
-
greedy: true
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
|
156
|
-
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
157
|
-
greedy: true,
|
|
158
|
-
inside: {
|
|
159
|
-
'entity': insideString.entity
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
'environment': {
|
|
164
|
-
pattern: RegExp('\\$?' + envVars),
|
|
165
|
-
alias: 'constant'
|
|
166
|
-
},
|
|
167
|
-
'variable': insideString.variable,
|
|
168
|
-
'function': {
|
|
169
|
-
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
170
|
-
lookbehind: true
|
|
171
|
-
},
|
|
172
|
-
'keyword': {
|
|
173
|
-
pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
|
|
174
|
-
lookbehind: true
|
|
175
|
-
},
|
|
176
|
-
// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
|
|
177
|
-
'builtin': {
|
|
178
|
-
pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
|
|
179
|
-
lookbehind: true,
|
|
180
|
-
// Alias added to make those easier to distinguish from strings.
|
|
181
|
-
alias: 'class-name'
|
|
182
|
-
},
|
|
183
|
-
'boolean': {
|
|
184
|
-
pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
|
|
185
|
-
lookbehind: true
|
|
186
|
-
},
|
|
187
|
-
'file-descriptor': {
|
|
188
|
-
pattern: /\B&\d\b/,
|
|
189
|
-
alias: 'important'
|
|
190
|
-
},
|
|
191
|
-
'operator': {
|
|
192
|
-
// Lots of redirections here, but not just that.
|
|
193
|
-
pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
|
|
194
|
-
inside: {
|
|
195
|
-
'file-descriptor': {
|
|
196
|
-
pattern: /^\d/,
|
|
197
|
-
alias: 'important'
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
|
|
202
|
-
'number': {
|
|
203
|
-
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
204
|
-
lookbehind: true
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
commandAfterHeredoc.inside = Prism.languages.bash;
|
|
209
|
-
|
|
210
|
-
/* Patterns in command substitution. */
|
|
211
|
-
var toBeCopied = [
|
|
212
|
-
'comment',
|
|
213
|
-
'function-name',
|
|
214
|
-
'for-or-select',
|
|
215
|
-
'assign-left',
|
|
216
|
-
'parameter',
|
|
217
|
-
'string',
|
|
218
|
-
'environment',
|
|
219
|
-
'function',
|
|
220
|
-
'keyword',
|
|
221
|
-
'builtin',
|
|
222
|
-
'boolean',
|
|
223
|
-
'file-descriptor',
|
|
224
|
-
'operator',
|
|
225
|
-
'punctuation',
|
|
226
|
-
'number'
|
|
227
|
-
];
|
|
228
|
-
var inside = insideString.variable[1].inside;
|
|
229
|
-
for (var i = 0; i < toBeCopied.length; i++) {
|
|
230
|
-
inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
Prism.languages.sh = Prism.languages.bash;
|
|
234
|
-
Prism.languages.shell = Prism.languages.bash;
|
|
235
|
-
}(Prism));
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
Prism.languages.clike = {
|
|
2
|
-
'comment': [
|
|
3
|
-
{
|
|
4
|
-
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
5
|
-
lookbehind: true,
|
|
6
|
-
greedy: true
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
pattern: /(^|[^\\:])\/\/.*/,
|
|
10
|
-
lookbehind: true,
|
|
11
|
-
greedy: true
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
'string': {
|
|
15
|
-
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
16
|
-
greedy: true
|
|
17
|
-
},
|
|
18
|
-
'class-name': {
|
|
19
|
-
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
20
|
-
lookbehind: true,
|
|
21
|
-
inside: {
|
|
22
|
-
'punctuation': /[.\\]/
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
26
|
-
'boolean': /\b(?:false|true)\b/,
|
|
27
|
-
'function': /\b\w+(?=\()/,
|
|
28
|
-
'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
29
|
-
'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
30
|
-
'punctuation': /[{}[\];(),.:]/
|
|
31
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
(function (Prism) {
|
|
2
|
-
|
|
3
|
-
var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
4
|
-
|
|
5
|
-
Prism.languages.css = {
|
|
6
|
-
'comment': /\/\*[\s\S]*?\*\//,
|
|
7
|
-
'atrule': {
|
|
8
|
-
pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
|
|
9
|
-
inside: {
|
|
10
|
-
'rule': /^@[\w-]+/,
|
|
11
|
-
'selector-function-argument': {
|
|
12
|
-
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
13
|
-
lookbehind: true,
|
|
14
|
-
alias: 'selector'
|
|
15
|
-
},
|
|
16
|
-
'keyword': {
|
|
17
|
-
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
18
|
-
lookbehind: true
|
|
19
|
-
}
|
|
20
|
-
// See rest below
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
'url': {
|
|
24
|
-
// https://drafts.csswg.org/css-values-3/#urls
|
|
25
|
-
pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
|
|
26
|
-
greedy: true,
|
|
27
|
-
inside: {
|
|
28
|
-
'function': /^url/i,
|
|
29
|
-
'punctuation': /^\(|\)$/,
|
|
30
|
-
'string': {
|
|
31
|
-
pattern: RegExp('^' + string.source + '$'),
|
|
32
|
-
alias: 'url'
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
'selector': {
|
|
37
|
-
pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
|
|
38
|
-
lookbehind: true
|
|
39
|
-
},
|
|
40
|
-
'string': {
|
|
41
|
-
pattern: string,
|
|
42
|
-
greedy: true
|
|
43
|
-
},
|
|
44
|
-
'property': {
|
|
45
|
-
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
46
|
-
lookbehind: true
|
|
47
|
-
},
|
|
48
|
-
'important': /!important\b/i,
|
|
49
|
-
'function': {
|
|
50
|
-
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
51
|
-
lookbehind: true
|
|
52
|
-
},
|
|
53
|
-
'punctuation': /[(){};:,]/
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
|
|
57
|
-
|
|
58
|
-
var markup = Prism.languages.markup;
|
|
59
|
-
if (markup) {
|
|
60
|
-
markup.tag.addInlined('style', 'css');
|
|
61
|
-
markup.tag.addAttribute('style', 'css');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
}(Prism));
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
Prism.languages.javascript = Prism.languages.extend('clike', {
|
|
2
|
-
'class-name': [
|
|
3
|
-
Prism.languages.clike['class-name'],
|
|
4
|
-
{
|
|
5
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
6
|
-
lookbehind: true
|
|
7
|
-
}
|
|
8
|
-
],
|
|
9
|
-
'keyword': [
|
|
10
|
-
{
|
|
11
|
-
pattern: /((?:^|\})\s*)catch\b/,
|
|
12
|
-
lookbehind: true
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
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/,
|
|
16
|
-
lookbehind: true
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
20
|
-
'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
21
|
-
'number': {
|
|
22
|
-
pattern: RegExp(
|
|
23
|
-
/(^|[^\w$])/.source +
|
|
24
|
-
'(?:' +
|
|
25
|
-
(
|
|
26
|
-
// constant
|
|
27
|
-
/NaN|Infinity/.source +
|
|
28
|
-
'|' +
|
|
29
|
-
// binary integer
|
|
30
|
-
/0[bB][01]+(?:_[01]+)*n?/.source +
|
|
31
|
-
'|' +
|
|
32
|
-
// octal integer
|
|
33
|
-
/0[oO][0-7]+(?:_[0-7]+)*n?/.source +
|
|
34
|
-
'|' +
|
|
35
|
-
// hexadecimal integer
|
|
36
|
-
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
|
|
37
|
-
'|' +
|
|
38
|
-
// decimal bigint
|
|
39
|
-
/\d+(?:_\d+)*n/.source +
|
|
40
|
-
'|' +
|
|
41
|
-
// decimal number (integer or float) but no bigint
|
|
42
|
-
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
|
|
43
|
-
) +
|
|
44
|
-
')' +
|
|
45
|
-
/(?![\w$])/.source
|
|
46
|
-
),
|
|
47
|
-
lookbehind: true
|
|
48
|
-
},
|
|
49
|
-
'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
|
|
53
|
-
|
|
54
|
-
Prism.languages.insertBefore('javascript', 'keyword', {
|
|
55
|
-
'regex': {
|
|
56
|
-
pattern: RegExp(
|
|
57
|
-
// lookbehind
|
|
58
|
-
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
59
|
-
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
|
|
60
|
-
// Regex pattern:
|
|
61
|
-
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
|
62
|
-
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
|
63
|
-
// with the only syntax, so we have to define 2 different regex patterns.
|
|
64
|
-
/\//.source +
|
|
65
|
-
'(?:' +
|
|
66
|
-
/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
|
|
67
|
-
'|' +
|
|
68
|
-
// `v` flag syntax. This supports 3 levels of nested character classes.
|
|
69
|
-
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
|
|
70
|
-
')' +
|
|
71
|
-
// lookahead
|
|
72
|
-
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
|
73
|
-
),
|
|
74
|
-
lookbehind: true,
|
|
75
|
-
greedy: true,
|
|
76
|
-
inside: {
|
|
77
|
-
'regex-source': {
|
|
78
|
-
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
79
|
-
lookbehind: true,
|
|
80
|
-
alias: 'language-regex',
|
|
81
|
-
inside: Prism.languages.regex
|
|
82
|
-
},
|
|
83
|
-
'regex-delimiter': /^\/|\/$/,
|
|
84
|
-
'regex-flags': /^[a-z]+$/,
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
// This must be declared before keyword because we use "function" inside the look-forward
|
|
88
|
-
'function-variable': {
|
|
89
|
-
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*=>))/,
|
|
90
|
-
alias: 'function'
|
|
91
|
-
},
|
|
92
|
-
'parameter': [
|
|
93
|
-
{
|
|
94
|
-
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
95
|
-
lookbehind: true,
|
|
96
|
-
inside: Prism.languages.javascript
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
100
|
-
lookbehind: true,
|
|
101
|
-
inside: Prism.languages.javascript
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
105
|
-
lookbehind: true,
|
|
106
|
-
inside: Prism.languages.javascript
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
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*\{)/,
|
|
110
|
-
lookbehind: true,
|
|
111
|
-
inside: Prism.languages.javascript
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
Prism.languages.insertBefore('javascript', 'string', {
|
|
118
|
-
'hashbang': {
|
|
119
|
-
pattern: /^#!.*/,
|
|
120
|
-
greedy: true,
|
|
121
|
-
alias: 'comment'
|
|
122
|
-
},
|
|
123
|
-
'template-string': {
|
|
124
|
-
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
125
|
-
greedy: true,
|
|
126
|
-
inside: {
|
|
127
|
-
'template-punctuation': {
|
|
128
|
-
pattern: /^`|`$/,
|
|
129
|
-
alias: 'string'
|
|
130
|
-
},
|
|
131
|
-
'interpolation': {
|
|
132
|
-
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
133
|
-
lookbehind: true,
|
|
134
|
-
inside: {
|
|
135
|
-
'interpolation-punctuation': {
|
|
136
|
-
pattern: /^\$\{|\}$/,
|
|
137
|
-
alias: 'punctuation'
|
|
138
|
-
},
|
|
139
|
-
rest: Prism.languages.javascript
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
'string': /[\s\S]+/
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
'string-property': {
|
|
146
|
-
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
147
|
-
lookbehind: true,
|
|
148
|
-
greedy: true,
|
|
149
|
-
alias: 'property'
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
Prism.languages.insertBefore('javascript', 'operator', {
|
|
154
|
-
'literal-property': {
|
|
155
|
-
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
156
|
-
lookbehind: true,
|
|
157
|
-
alias: 'property'
|
|
158
|
-
},
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
if (Prism.languages.markup) {
|
|
162
|
-
Prism.languages.markup.tag.addInlined('script', 'javascript');
|
|
163
|
-
|
|
164
|
-
// add attribute support for all DOM events.
|
|
165
|
-
// https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
|
|
166
|
-
Prism.languages.markup.tag.addAttribute(
|
|
167
|
-
/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)/.source,
|
|
168
|
-
'javascript'
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
Prism.languages.js = Prism.languages.javascript;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// https://www.json.org/json-en.html
|
|
2
|
-
Prism.languages.json = {
|
|
3
|
-
'property': {
|
|
4
|
-
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
5
|
-
lookbehind: true,
|
|
6
|
-
greedy: true
|
|
7
|
-
},
|
|
8
|
-
'string': {
|
|
9
|
-
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
10
|
-
lookbehind: true,
|
|
11
|
-
greedy: true
|
|
12
|
-
},
|
|
13
|
-
'comment': {
|
|
14
|
-
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
15
|
-
greedy: true
|
|
16
|
-
},
|
|
17
|
-
'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
18
|
-
'punctuation': /[{}[\],]/,
|
|
19
|
-
'operator': /:/,
|
|
20
|
-
'boolean': /\b(?:false|true)\b/,
|
|
21
|
-
'null': {
|
|
22
|
-
pattern: /\bnull\b/,
|
|
23
|
-
alias: 'keyword'
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
Prism.languages.webmanifest = Prism.languages.json;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
(function (Prism) {
|
|
2
|
-
|
|
3
|
-
var javascript = Prism.util.clone(Prism.languages.javascript);
|
|
4
|
-
|
|
5
|
-
var space = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source;
|
|
6
|
-
var braces = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source;
|
|
7
|
-
var spread = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @param {string} source
|
|
11
|
-
* @param {string} [flags]
|
|
12
|
-
*/
|
|
13
|
-
function re(source, flags) {
|
|
14
|
-
source = source
|
|
15
|
-
.replace(/<S>/g, function () { return space; })
|
|
16
|
-
.replace(/<BRACES>/g, function () { return braces; })
|
|
17
|
-
.replace(/<SPREAD>/g, function () { return spread; });
|
|
18
|
-
return RegExp(source, flags);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
spread = re(spread).source;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Prism.languages.jsx = Prism.languages.extend('markup', javascript);
|
|
25
|
-
Prism.languages.jsx.tag.pattern = re(
|
|
26
|
-
/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/;
|
|
30
|
-
Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/;
|
|
31
|
-
Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
|
|
32
|
-
Prism.languages.jsx.tag.inside['comment'] = javascript['comment'];
|
|
33
|
-
|
|
34
|
-
Prism.languages.insertBefore('inside', 'attr-name', {
|
|
35
|
-
'spread': {
|
|
36
|
-
pattern: re(/<SPREAD>/.source),
|
|
37
|
-
inside: Prism.languages.jsx
|
|
38
|
-
}
|
|
39
|
-
}, Prism.languages.jsx.tag);
|
|
40
|
-
|
|
41
|
-
Prism.languages.insertBefore('inside', 'special-attr', {
|
|
42
|
-
'script': {
|
|
43
|
-
// Allow for two levels of nesting
|
|
44
|
-
pattern: re(/=<BRACES>/.source),
|
|
45
|
-
alias: 'language-javascript',
|
|
46
|
-
inside: {
|
|
47
|
-
'script-punctuation': {
|
|
48
|
-
pattern: /^=(?=\{)/,
|
|
49
|
-
alias: 'punctuation'
|
|
50
|
-
},
|
|
51
|
-
rest: Prism.languages.jsx
|
|
52
|
-
},
|
|
53
|
-
}
|
|
54
|
-
}, Prism.languages.jsx.tag);
|
|
55
|
-
|
|
56
|
-
// The following will handle plain text inside tags
|
|
57
|
-
var stringifyToken = function (token) {
|
|
58
|
-
if (!token) {
|
|
59
|
-
return '';
|
|
60
|
-
}
|
|
61
|
-
if (typeof token === 'string') {
|
|
62
|
-
return token;
|
|
63
|
-
}
|
|
64
|
-
if (typeof token.content === 'string') {
|
|
65
|
-
return token.content;
|
|
66
|
-
}
|
|
67
|
-
return token.content.map(stringifyToken).join('');
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
var walkTokens = function (tokens) {
|
|
71
|
-
var openedTags = [];
|
|
72
|
-
for (var i = 0; i < tokens.length; i++) {
|
|
73
|
-
var token = tokens[i];
|
|
74
|
-
var notTagNorBrace = false;
|
|
75
|
-
|
|
76
|
-
if (typeof token !== 'string') {
|
|
77
|
-
if (token.type === 'tag' && token.content[0] && token.content[0].type === 'tag') {
|
|
78
|
-
// We found a tag, now find its kind
|
|
79
|
-
|
|
80
|
-
if (token.content[0].content[0].content === '</') {
|
|
81
|
-
// Closing tag
|
|
82
|
-
if (openedTags.length > 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) {
|
|
83
|
-
// Pop matching opening tag
|
|
84
|
-
openedTags.pop();
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
if (token.content[token.content.length - 1].content === '/>') ; else {
|
|
88
|
-
// Opening tag
|
|
89
|
-
openedTags.push({
|
|
90
|
-
tagName: stringifyToken(token.content[0].content[1]),
|
|
91
|
-
openedBraces: 0
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
} else if (openedTags.length > 0 && token.type === 'punctuation' && token.content === '{') {
|
|
96
|
-
|
|
97
|
-
// Here we might have entered a JSX context inside a tag
|
|
98
|
-
openedTags[openedTags.length - 1].openedBraces++;
|
|
99
|
-
|
|
100
|
-
} else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === 'punctuation' && token.content === '}') {
|
|
101
|
-
|
|
102
|
-
// Here we might have left a JSX context inside a tag
|
|
103
|
-
openedTags[openedTags.length - 1].openedBraces--;
|
|
104
|
-
|
|
105
|
-
} else {
|
|
106
|
-
notTagNorBrace = true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
if (notTagNorBrace || typeof token === 'string') {
|
|
110
|
-
if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) {
|
|
111
|
-
// Here we are inside a tag, and not inside a JSX context.
|
|
112
|
-
// That's plain text: drop any tokens matched.
|
|
113
|
-
var plainText = stringifyToken(token);
|
|
114
|
-
|
|
115
|
-
// And merge text with adjacent text
|
|
116
|
-
if (i < tokens.length - 1 && (typeof tokens[i + 1] === 'string' || tokens[i + 1].type === 'plain-text')) {
|
|
117
|
-
plainText += stringifyToken(tokens[i + 1]);
|
|
118
|
-
tokens.splice(i + 1, 1);
|
|
119
|
-
}
|
|
120
|
-
if (i > 0 && (typeof tokens[i - 1] === 'string' || tokens[i - 1].type === 'plain-text')) {
|
|
121
|
-
plainText = stringifyToken(tokens[i - 1]) + plainText;
|
|
122
|
-
tokens.splice(i - 1, 1);
|
|
123
|
-
i--;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
tokens[i] = new Prism.Token('plain-text', plainText, null, plainText);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (token.content && typeof token.content !== 'string') {
|
|
131
|
-
walkTokens(token.content);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
Prism.hooks.add('after-tokenize', function (env) {
|
|
137
|
-
if (env.language !== 'jsx' && env.language !== 'tsx') {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
walkTokens(env.tokens);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
}(Prism));
|