@designbasekorea/ui-wc 0.5.3 → 0.5.6
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-e273b936.js +17032 -0
- package/dist/esm/components/animation-background/canvas-controller.js +121 -1
- package/dist/esm/components/animation-background/controls.js +180 -1
- package/dist/esm/components/animation-background/graphite-controller.js +196 -1
- package/dist/esm/components/animation-background/graphite-presets.js +42 -1
- package/dist/esm/components/animation-background/graphite-shader.js +111 -1
- package/dist/esm/components/animation-background/layers.js +369 -1
- package/dist/esm/components/animation-background/lumina-presets.js +53 -1
- package/dist/esm/components/animation-background/lumina-shaders.js +181 -1
- package/dist/esm/components/animation-background/lumina-utils.js +60 -1
- package/dist/esm/components/animation-background/particle-defaults.js +36 -1
- package/dist/esm/components/animation-background/renderers.js +167 -1
- package/dist/esm/components/animation-background/shader-controller.js +154 -1
- package/dist/esm/components/color-picker-utils.js +134 -1
- package/dist/esm/components/date-picker-utils.js +140 -1
- package/dist/esm/components/db-accordion.js +304 -1
- package/dist/esm/components/db-ad-banner.js +455 -1
- package/dist/esm/components/db-alert.js +149 -1
- package/dist/esm/components/db-animation-background.js +486 -1
- package/dist/esm/components/db-animation-text.js +601 -1
- package/dist/esm/components/db-app-badge.js +88 -1
- package/dist/esm/components/db-audio-player.js +752 -1
- package/dist/esm/components/db-avatar.js +188 -1
- package/dist/esm/components/db-backdrop.js +139 -1
- package/dist/esm/components/db-badge.js +91 -1
- package/dist/esm/components/db-banner.js +188 -1
- package/dist/esm/components/db-bottom-navigation.js +146 -1
- package/dist/esm/components/db-bottom-sheet.js +481 -1
- package/dist/esm/components/db-breadcrumbs.js +329 -1
- package/dist/esm/components/db-button.js +316 -1
- package/dist/esm/components/db-calendar.js +675 -1
- package/dist/esm/components/db-card.js +265 -1
- package/dist/esm/components/db-carousel.js +264 -1
- package/dist/esm/components/db-checkbox.js +202 -1
- package/dist/esm/components/db-chip.js +104 -1
- package/dist/esm/components/db-code-block.js +304 -1
- package/dist/esm/components/db-color-picker.js +746 -1
- package/dist/esm/components/db-confirm.js +191 -1
- package/dist/esm/components/db-container.js +39 -1
- package/dist/esm/components/db-context-menu.js +265 -1
- package/dist/esm/components/db-countdown.js +146 -1
- package/dist/esm/components/db-cursor-follower.js +173 -1
- package/dist/esm/components/db-date-picker.js +837 -1
- package/dist/esm/components/db-divider.js +66 -1
- package/dist/esm/components/db-drawer.js +245 -1
- package/dist/esm/components/db-dropdown.js +493 -1
- package/dist/esm/components/db-dropzone.js +266 -1
- package/dist/esm/components/db-empty-state.js +97 -1
- package/dist/esm/components/db-file-uploader.js +256 -1
- package/dist/esm/components/db-floating-action-button.js +139 -1
- package/dist/esm/components/db-footer.js +385 -1
- package/dist/esm/components/db-form.js +566 -1
- package/dist/esm/components/db-gantt.js +882 -1
- package/dist/esm/components/db-gradient.js +133 -1
- package/dist/esm/components/db-grid-background.js +909 -1
- package/dist/esm/components/db-grid.js +73 -1
- package/dist/esm/components/db-icons.js +82 -1
- package/dist/esm/components/db-image-list.js +214 -1
- package/dist/esm/components/db-image-placeholder.js +96 -1
- package/dist/esm/components/db-image.js +289 -1
- package/dist/esm/components/db-indicator.js +517 -1
- package/dist/esm/components/db-input.js +420 -1
- package/dist/esm/components/db-kanban.js +538 -1
- package/dist/esm/components/db-label.js +66 -1
- package/dist/esm/components/db-lightbox.js +372 -1
- package/dist/esm/components/db-list.js +340 -1
- package/dist/esm/components/db-logo-svg.js +72 -1
- package/dist/esm/components/db-logo.js +106 -1
- package/dist/esm/components/db-lottie.js +109 -1
- package/dist/esm/components/db-markdown-editor.js +458 -1
- package/dist/esm/components/db-marquee.js +402 -1
- package/dist/esm/components/db-masonry.js +94 -1
- package/dist/esm/components/db-menu-item.js +211 -1
- package/dist/esm/components/db-modal.js +522 -1
- package/dist/esm/components/db-navbar.js +680 -1
- package/dist/esm/components/db-onboarding-modal.js +322 -1
- package/dist/esm/components/db-page-header.js +312 -1
- package/dist/esm/components/db-pagination.js +271 -1
- package/dist/esm/components/db-popover.js +580 -1
- package/dist/esm/components/db-progress-step.js +166 -1
- package/dist/esm/components/db-progress.js +171 -1
- package/dist/esm/components/db-progressbar.js +72 -1
- package/dist/esm/components/db-radio.js +172 -1
- package/dist/esm/components/db-random-gradient.js +121 -1
- package/dist/esm/components/db-range-slider.js +811 -1
- package/dist/esm/components/db-rating.js +325 -1
- package/dist/esm/components/db-reorder.js +286 -1
- package/dist/esm/components/db-resizable-panels.js +282 -1
- package/dist/esm/components/db-scroll-area.js +126 -1
- package/dist/esm/components/db-search-bar.js +668 -1
- package/dist/esm/components/db-section-app-download.js +101 -1
- package/dist/esm/components/db-section-contact.js +102 -1
- package/dist/esm/components/db-section-cta.js +150 -1
- package/dist/esm/components/db-section-faq.js +120 -1
- package/dist/esm/components/db-section-feature-grid.js +137 -1
- package/dist/esm/components/db-section-feature.js +179 -1
- package/dist/esm/components/db-section-hero.js +243 -1
- package/dist/esm/components/db-section-logo-cloud.js +138 -1
- package/dist/esm/components/db-section-pricing.js +166 -1
- package/dist/esm/components/db-section-stats.js +129 -1
- package/dist/esm/components/db-section-testimonials.js +252 -1
- package/dist/esm/components/db-section.js +385 -1
- package/dist/esm/components/db-segment-control.js +231 -1
- package/dist/esm/components/db-select.js +571 -1
- package/dist/esm/components/db-share-icons.js +40 -1
- package/dist/esm/components/db-share.js +489 -1
- package/dist/esm/components/db-sidebar.js +1068 -1
- package/dist/esm/components/db-skeleton.js +94 -1
- package/dist/esm/components/db-spinner.js +102 -1
- package/dist/esm/components/db-split-view.js +297 -1
- package/dist/esm/components/db-stack.js +46 -1
- package/dist/esm/components/db-stat.js +218 -1
- package/dist/esm/components/db-stepper.js +398 -1
- package/dist/esm/components/db-table.js +412 -1
- package/dist/esm/components/db-tabs.js +335 -1
- package/dist/esm/components/db-testimonial.js +162 -1
- package/dist/esm/components/db-textarea.js +233 -1
- package/dist/esm/components/db-time-picker.js +523 -1
- package/dist/esm/components/db-timeline.js +174 -1
- package/dist/esm/components/db-toast.js +158 -1
- package/dist/esm/components/db-toggle.js +162 -1
- package/dist/esm/components/db-toolbar.js +94 -1
- package/dist/esm/components/db-tooltip.js +440 -1
- package/dist/esm/components/db-top-banner.js +121 -1
- package/dist/esm/components/db-tutorial.js +324 -1
- package/dist/esm/components/db-video-player.js +503 -1
- package/dist/esm/components/db-youtube-player.js +194 -1
- package/dist/esm/components/highlight-code.js +65 -1
- package/dist/esm/components/input-validation.js +50 -1
- package/dist/esm/components/marketing-block-host-utils.js +9 -1
- package/dist/esm/components/number-scrub.js +117 -1
- package/dist/esm/components/random-gradient-palettes.js +67 -1
- package/dist/esm/components/section-block-header-utils.js +48 -1
- package/dist/esm/helpers/confirm.js +52 -1
- package/dist/esm/helpers/toast.js +73 -1
- package/dist/esm/index.js +111 -1
- package/dist/esm/node_modules/prismjs/components/prism-bash.js +235 -1
- package/dist/esm/node_modules/prismjs/components/prism-clike.js +31 -1
- package/dist/esm/node_modules/prismjs/components/prism-css.js +64 -1
- package/dist/esm/node_modules/prismjs/components/prism-javascript.js +172 -1
- package/dist/esm/node_modules/prismjs/components/prism-json.js +27 -1
- package/dist/esm/node_modules/prismjs/components/prism-jsx.js +143 -1
- package/dist/esm/node_modules/prismjs/components/prism-markup.js +186 -1
- package/dist/esm/node_modules/prismjs/components/prism-scss.js +81 -1
- package/dist/esm/node_modules/prismjs/components/prism-tsx.js +15 -1
- package/dist/esm/node_modules/prismjs/components/prism-typescript.js +60 -1
- package/dist/index.cjs +55414 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +38284 -1
- package/dist/react/chunks/lottie-72a4c6d4.js +17032 -0
- package/dist/react/index.cjs +56503 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.esm.js +39373 -1
- package/package.json +1 -1
- package/dist/chunks/lottie-2d1f6278.js +0 -1
- package/dist/react/chunks/lottie-14e7addb.js +0 -1
|
@@ -1 +1,73 @@
|
|
|
1
|
-
const
|
|
1
|
+
const CONTAINER_CLASS = 'designbase-wc-toast-container';
|
|
2
|
+
const DEFAULT_POSITION = 'top-right';
|
|
3
|
+
let counter = 0;
|
|
4
|
+
function isBrowser() {
|
|
5
|
+
return typeof document !== 'undefined';
|
|
6
|
+
}
|
|
7
|
+
function getContainer(position) {
|
|
8
|
+
const existing = document.querySelector(`.${CONTAINER_CLASS}[data-position="${position}"]`);
|
|
9
|
+
if (existing)
|
|
10
|
+
return existing;
|
|
11
|
+
const container = document.createElement('div');
|
|
12
|
+
container.className = `${CONTAINER_CLASS} ${CONTAINER_CLASS}--${position}`;
|
|
13
|
+
container.dataset.position = position;
|
|
14
|
+
container.setAttribute('role', 'region');
|
|
15
|
+
container.setAttribute('aria-live', 'polite');
|
|
16
|
+
container.setAttribute('aria-label', '알림');
|
|
17
|
+
document.body.appendChild(container);
|
|
18
|
+
return container;
|
|
19
|
+
}
|
|
20
|
+
function cleanupContainer(container) {
|
|
21
|
+
if (container.childElementCount === 0)
|
|
22
|
+
container.remove();
|
|
23
|
+
}
|
|
24
|
+
/** 토스트를 띄웁니다. `toast(options)` 와 동일합니다. */
|
|
25
|
+
function showToast(options) {
|
|
26
|
+
const id = `db-toast-${(counter += 1)}`;
|
|
27
|
+
if (!isBrowser()) {
|
|
28
|
+
return { id, element: null, close: () => { } };
|
|
29
|
+
}
|
|
30
|
+
const { title, description, status = 'info', duration = 5000, position = DEFAULT_POSITION, showClose = true, showProgress = false, } = options;
|
|
31
|
+
const container = getContainer(position);
|
|
32
|
+
const toastEl = document.createElement('db-toast');
|
|
33
|
+
toastEl.setAttribute('toast-id', id);
|
|
34
|
+
toastEl.setAttribute('status', status);
|
|
35
|
+
toastEl.setAttribute('title', title);
|
|
36
|
+
if (description)
|
|
37
|
+
toastEl.setAttribute('description', description);
|
|
38
|
+
toastEl.setAttribute('duration', String(duration));
|
|
39
|
+
toastEl.setAttribute('show-close', String(showClose));
|
|
40
|
+
if (showProgress)
|
|
41
|
+
toastEl.setAttribute('show-progress', '');
|
|
42
|
+
toastEl.setAttribute('auto-remove', 'true');
|
|
43
|
+
// bottom 계열은 새 토스트가 가장 아래(=가장 가까운 곳)에 오도록 위에 쌓는다.
|
|
44
|
+
if (position.startsWith('bottom'))
|
|
45
|
+
container.insertBefore(toastEl, container.firstChild);
|
|
46
|
+
else
|
|
47
|
+
container.appendChild(toastEl);
|
|
48
|
+
toastEl.addEventListener('db-close', () => window.requestAnimationFrame(() => cleanupContainer(container)), { once: true });
|
|
49
|
+
return {
|
|
50
|
+
id,
|
|
51
|
+
element: toastEl,
|
|
52
|
+
close: () => toastEl.close(),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function shortcut(status) {
|
|
56
|
+
return (title, options) => showToast({ ...options, title, status });
|
|
57
|
+
}
|
|
58
|
+
const toast = ((options) => showToast(options));
|
|
59
|
+
toast.show = showToast;
|
|
60
|
+
toast.success = shortcut('success');
|
|
61
|
+
toast.error = shortcut('error');
|
|
62
|
+
toast.warning = shortcut('warning');
|
|
63
|
+
toast.info = shortcut('info');
|
|
64
|
+
toast.dismissAll = (position) => {
|
|
65
|
+
if (!isBrowser())
|
|
66
|
+
return;
|
|
67
|
+
const selector = position
|
|
68
|
+
? `.${CONTAINER_CLASS}[data-position="${position}"] db-toast`
|
|
69
|
+
: `.${CONTAINER_CLASS} db-toast`;
|
|
70
|
+
document.querySelectorAll(selector).forEach((el) => el.close());
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { showToast, toast };
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1,111 @@
|
|
|
1
|
-
export{DbButton}from
|
|
1
|
+
export { DbButton } from './components/db-button.js';
|
|
2
|
+
export { DbInput } from './components/db-input.js';
|
|
3
|
+
export { DbCheckbox } from './components/db-checkbox.js';
|
|
4
|
+
export { DbToggle } from './components/db-toggle.js';
|
|
5
|
+
export { DbBadge } from './components/db-badge.js';
|
|
6
|
+
export { DbBanner } from './components/db-banner.js';
|
|
7
|
+
export { DbSpinner } from './components/db-spinner.js';
|
|
8
|
+
export { DbCard } from './components/db-card.js';
|
|
9
|
+
export { DbTabs } from './components/db-tabs.js';
|
|
10
|
+
export { DbModal } from './components/db-modal.js';
|
|
11
|
+
export { DbDropdown } from './components/db-dropdown.js';
|
|
12
|
+
export { DbTooltip } from './components/db-tooltip.js';
|
|
13
|
+
export { DbAccordion } from './components/db-accordion.js';
|
|
14
|
+
export { DbAvatar } from './components/db-avatar.js';
|
|
15
|
+
export { DbDivider } from './components/db-divider.js';
|
|
16
|
+
export { DbProgress } from './components/db-progress.js';
|
|
17
|
+
export { DbSelect } from './components/db-select.js';
|
|
18
|
+
export { DbTextarea } from './components/db-textarea.js';
|
|
19
|
+
export { DbRadio } from './components/db-radio.js';
|
|
20
|
+
export { DbPagination } from './components/db-pagination.js';
|
|
21
|
+
export { DbBreadcrumbs } from './components/db-breadcrumbs.js';
|
|
22
|
+
export { DbTable } from './components/db-table.js';
|
|
23
|
+
export { DbAlert } from './components/db-alert.js';
|
|
24
|
+
export { DbChip } from './components/db-chip.js';
|
|
25
|
+
export { DbSkeleton } from './components/db-skeleton.js';
|
|
26
|
+
export { DbLabel } from './components/db-label.js';
|
|
27
|
+
export { DbLogo } from './components/db-logo.js';
|
|
28
|
+
export { DbEmptyState } from './components/db-empty-state.js';
|
|
29
|
+
export { DbBackdrop } from './components/db-backdrop.js';
|
|
30
|
+
export { DbPopover } from './components/db-popover.js';
|
|
31
|
+
export { DbDrawer } from './components/db-drawer.js';
|
|
32
|
+
export { DbToast } from './components/db-toast.js';
|
|
33
|
+
export { DbConfirm } from './components/db-confirm.js';
|
|
34
|
+
export { DbIndicator } from './components/db-indicator.js';
|
|
35
|
+
export { DbList } from './components/db-list.js';
|
|
36
|
+
export { DbMenuItem } from './components/db-menu-item.js';
|
|
37
|
+
export { DbSearchBar } from './components/db-search-bar.js';
|
|
38
|
+
export { DbShare } from './components/db-share.js';
|
|
39
|
+
export { DbTopBanner } from './components/db-top-banner.js';
|
|
40
|
+
export { DbStat } from './components/db-stat.js';
|
|
41
|
+
export { DbImage } from './components/db-image.js';
|
|
42
|
+
export { DbImagePlaceholder } from './components/db-image-placeholder.js';
|
|
43
|
+
export { DbImageList } from './components/db-image-list.js';
|
|
44
|
+
export { DbLightbox } from './components/db-lightbox.js';
|
|
45
|
+
export { DbBottomNavigation } from './components/db-bottom-navigation.js';
|
|
46
|
+
export { DbNavbar } from './components/db-navbar.js';
|
|
47
|
+
export { DbFooter } from './components/db-footer.js';
|
|
48
|
+
export { DbSidebar } from './components/db-sidebar.js';
|
|
49
|
+
export { DbContextMenu } from './components/db-context-menu.js';
|
|
50
|
+
export { DbProgressbar } from './components/db-progressbar.js';
|
|
51
|
+
export { DbProgressStep } from './components/db-progress-step.js';
|
|
52
|
+
export { DbRangeSlider } from './components/db-range-slider.js';
|
|
53
|
+
export { DbSegmentControl } from './components/db-segment-control.js';
|
|
54
|
+
export { DbStepper } from './components/db-stepper.js';
|
|
55
|
+
export { DbContainer } from './components/db-container.js';
|
|
56
|
+
export { DbStack } from './components/db-stack.js';
|
|
57
|
+
export { DbGrid, DbGridItem } from './components/db-grid.js';
|
|
58
|
+
export { DbToolbar } from './components/db-toolbar.js';
|
|
59
|
+
export { DbForm } from './components/db-form.js';
|
|
60
|
+
export { DbPageHeader } from './components/db-page-header.js';
|
|
61
|
+
export { DbSection } from './components/db-section.js';
|
|
62
|
+
export { DbFloatingActionButton } from './components/db-floating-action-button.js';
|
|
63
|
+
export { DbBottomSheet } from './components/db-bottom-sheet.js';
|
|
64
|
+
export { DbScrollArea } from './components/db-scroll-area.js';
|
|
65
|
+
export { DbDropzone } from './components/db-dropzone.js';
|
|
66
|
+
export { DbOnboardingModal } from './components/db-onboarding-modal.js';
|
|
67
|
+
export { DbSplitView } from './components/db-split-view.js';
|
|
68
|
+
export { DbFileUploader } from './components/db-file-uploader.js';
|
|
69
|
+
export { DbDatePicker } from './components/db-date-picker.js';
|
|
70
|
+
export { DbTimePicker } from './components/db-time-picker.js';
|
|
71
|
+
export { DbCalendar } from './components/db-calendar.js';
|
|
72
|
+
export { DbRating } from './components/db-rating.js';
|
|
73
|
+
export { DbCountdown } from './components/db-countdown.js';
|
|
74
|
+
export { DbMasonry } from './components/db-masonry.js';
|
|
75
|
+
export { DbCarousel } from './components/db-carousel.js';
|
|
76
|
+
export { DbColorPicker } from './components/db-color-picker.js';
|
|
77
|
+
export { DbReorder } from './components/db-reorder.js';
|
|
78
|
+
export { DbKanban } from './components/db-kanban.js';
|
|
79
|
+
export { DbGantt } from './components/db-gantt.js';
|
|
80
|
+
export { DbResizablePanels } from './components/db-resizable-panels.js';
|
|
81
|
+
export { DbVideoPlayer } from './components/db-video-player.js';
|
|
82
|
+
export { DbYouTubePlayer } from './components/db-youtube-player.js';
|
|
83
|
+
export { DbAudioPlayer } from './components/db-audio-player.js';
|
|
84
|
+
export { DbCodeBlock } from './components/db-code-block.js';
|
|
85
|
+
export { DbMarkdownEditor } from './components/db-markdown-editor.js';
|
|
86
|
+
export { DbTestimonial } from './components/db-testimonial.js';
|
|
87
|
+
export { DbSectionHero } from './components/db-section-hero.js';
|
|
88
|
+
export { DbSectionFeature } from './components/db-section-feature.js';
|
|
89
|
+
export { DbAppBadge } from './components/db-app-badge.js';
|
|
90
|
+
export { DbSectionContact } from './components/db-section-contact.js';
|
|
91
|
+
export { DbSectionAppDownload } from './components/db-section-app-download.js';
|
|
92
|
+
export { DbSectionCta } from './components/db-section-cta.js';
|
|
93
|
+
export { DbSectionTestimonials } from './components/db-section-testimonials.js';
|
|
94
|
+
export { DbSectionFeatureGrid } from './components/db-section-feature-grid.js';
|
|
95
|
+
export { DbSectionLogoCloud } from './components/db-section-logo-cloud.js';
|
|
96
|
+
export { DbSectionStats } from './components/db-section-stats.js';
|
|
97
|
+
export { DbSectionFaq } from './components/db-section-faq.js';
|
|
98
|
+
export { DbSectionPricing } from './components/db-section-pricing.js';
|
|
99
|
+
export { DbMarquee } from './components/db-marquee.js';
|
|
100
|
+
export { DbGradient } from './components/db-gradient.js';
|
|
101
|
+
export { DbRandomGradient } from './components/db-random-gradient.js';
|
|
102
|
+
export { DbAdBanner } from './components/db-ad-banner.js';
|
|
103
|
+
export { DbTimeline } from './components/db-timeline.js';
|
|
104
|
+
export { DbAnimationText } from './components/db-animation-text.js';
|
|
105
|
+
export { DbTutorial } from './components/db-tutorial.js';
|
|
106
|
+
export { DbAnimationBackground } from './components/db-animation-background.js';
|
|
107
|
+
export { DbGridBackground } from './components/db-grid-background.js';
|
|
108
|
+
export { DbCursorFollower } from './components/db-cursor-follower.js';
|
|
109
|
+
export { DbLottie } from './components/db-lottie.js';
|
|
110
|
+
export { toast as dbToast, showToast, toast } from './helpers/toast.js';
|
|
111
|
+
export { confirm, confirm as dbConfirm } from './helpers/confirm.js';
|
|
@@ -1 +1,235 @@
|
|
|
1
|
-
|
|
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 +1,31 @@
|
|
|
1
|
-
Prism.languages.clike={
|
|
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 +1,64 @@
|
|
|
1
|
-
|
|
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));
|