@oneflowui/ui 0.4.2 → 0.4.4
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/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/assets/tableWorker-CTsbCPPP.js +1 -0
- package/dist/components/ContextMenu/index.vue.d.ts +2 -1
- package/dist/components/ContextMenu/index.vue.js +7 -0
- package/dist/components/ContextMenu/index.vue2.js +92 -0
- package/dist/components/Dashboard/charts/BarChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/BarChart.vue2.js +43 -0
- package/dist/components/Dashboard/charts/DoughnutChart.vue.js +23 -0
- package/dist/components/Dashboard/charts/DoughnutChart.vue2.js +4 -0
- package/dist/components/Dashboard/charts/NumberCard.vue.js +7 -0
- package/dist/components/Dashboard/charts/NumberCard.vue2.js +41 -0
- package/dist/components/Dashboard/charts/PieChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/PieChart.vue2.js +53 -0
- package/dist/components/Dashboard/charts/TableChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/TableChart.vue2.js +50 -0
- package/dist/components/Dashboard/index.vue.js +7 -0
- package/dist/components/Dashboard/index.vue2.js +104 -0
- package/dist/components/ai/AiMessageBubble.vue.js +7 -0
- package/dist/components/ai/AiMessageBubble.vue2.js +47 -0
- package/dist/components/ai/AiMessageList.vue.js +7 -0
- package/dist/components/ai/AiMessageList.vue2.js +78 -0
- package/dist/components/ai/AiSender.vue.js +7 -0
- package/dist/components/ai/AiSender.vue2.js +86 -0
- package/dist/components/ai/AiStreamingCursor.vue.js +7 -0
- package/dist/components/ai/AiStreamingCursor.vue2.js +16 -0
- package/dist/components/ai/AiThinking.vue.js +7 -0
- package/dist/components/ai/AiThinking.vue2.js +19 -0
- package/dist/components/ai/UserMessageBubble.vue.js +7 -0
- package/dist/components/ai/UserMessageBubble.vue2.js +34 -0
- package/dist/components/auxiliary/ColorPanel.vue.js +7 -0
- package/dist/components/auxiliary/ColorPanel.vue2.js +65 -0
- package/dist/components/auxiliary/FileUpload.vue.js +7 -0
- package/dist/components/auxiliary/FileUpload.vue2.js +90 -0
- package/dist/components/auxiliary/PersonPanel.vue.js +7 -0
- package/dist/components/auxiliary/PersonPanel.vue2.js +66 -0
- package/dist/components/base/Accordion.vue.js +7 -0
- package/dist/components/base/Accordion.vue2.js +78 -0
- package/dist/components/base/AddViewBtn.vue.js +7 -0
- package/dist/components/base/AddViewBtn.vue2.js +25 -0
- package/dist/components/base/Avatar.vue.js +7 -0
- package/dist/components/base/Avatar.vue2.js +72 -0
- package/dist/components/base/Badge.vue.js +7 -0
- package/dist/components/base/Badge.vue2.js +70 -0
- package/dist/components/base/ButtonGroup.vue.js +7 -0
- package/dist/components/base/ButtonGroup.vue2.js +40 -0
- package/dist/components/base/ChainItem.vue.js +7 -0
- package/dist/components/base/ChainItem.vue2.js +68 -0
- package/dist/components/base/DescBlock.vue.js +7 -0
- package/dist/components/base/DescBlock.vue2.js +13 -0
- package/dist/components/base/DropdownMenu.vue.js +7 -0
- package/dist/components/base/DropdownMenu.vue2.js +91 -0
- package/dist/components/base/EmptyState.vue.js +7 -0
- package/dist/components/base/EmptyState.vue2.js +38 -0
- package/dist/components/base/InfoCard.vue.js +7 -0
- package/dist/components/base/InfoCard.vue2.js +167 -0
- package/dist/components/base/MonitorItem.vue.d.ts +1 -1
- package/dist/components/base/MonitorItem.vue.js +7 -0
- package/dist/components/base/MonitorItem.vue2.js +56 -0
- package/dist/components/base/PersonaCard.vue.d.ts +2 -1
- package/dist/components/base/PersonaCard.vue.js +7 -0
- package/dist/components/base/PersonaCard.vue2.js +185 -0
- package/dist/components/base/ProgressBar.vue.js +7 -0
- package/dist/components/base/ProgressBar.vue2.js +49 -0
- package/dist/components/base/RangeSlider.vue.js +7 -0
- package/dist/components/base/RangeSlider.vue2.js +35 -0
- package/dist/components/base/RefTag.vue.d.ts +2 -2
- package/dist/components/base/RefTag.vue.js +7 -0
- package/dist/components/base/RefTag.vue2.js +52 -0
- package/dist/components/base/SearchHighlight.vue.d.ts +6 -0
- package/dist/components/base/SearchHighlight.vue.js +7 -0
- package/dist/components/base/SearchHighlight.vue2.js +21 -0
- package/dist/components/base/SectionBlock.vue.js +7 -0
- package/dist/components/base/SectionBlock.vue2.js +115 -0
- package/dist/components/base/SelectBadge.vue.js +7 -0
- package/dist/components/base/SelectBadge.vue2.js +81 -0
- package/dist/components/base/StatisticCard.vue.js +7 -0
- package/dist/components/base/StatisticCard.vue2.js +57 -0
- package/dist/components/base/StatusIndicator.vue.js +7 -0
- package/dist/components/base/StatusIndicator.vue2.js +54 -0
- package/dist/components/base/StatusSummary.vue.js +7 -0
- package/dist/components/base/StatusSummary.vue2.js +64 -0
- package/dist/components/base/Stepper.vue.js +7 -0
- package/dist/components/base/Stepper.vue2.js +70 -0
- package/dist/components/base/Switch.vue.js +7 -0
- package/dist/components/base/Switch.vue2.js +43 -0
- package/dist/components/base/ToolbarBtn.vue.d.ts +2 -1
- package/dist/components/base/ToolbarBtn.vue.js +7 -0
- package/dist/components/base/ToolbarBtn.vue2.js +30 -0
- package/dist/components/base/ViewModeGroup.vue.d.ts +2 -1
- package/dist/components/base/ViewModeGroup.vue.js +7 -0
- package/dist/components/base/ViewModeGroup.vue2.js +32 -0
- package/dist/components/base/ViewSwitcher.vue.d.ts +2 -1
- package/dist/components/base/ViewSwitcher.vue.js +7 -0
- package/dist/components/base/ViewSwitcher.vue2.js +73 -0
- package/dist/components/base/ViewTab.vue.js +7 -0
- package/dist/components/base/ViewTab.vue2.js +42 -0
- package/dist/components/base/index.d.ts +1 -0
- package/dist/components/breadcrumb/Breadcrumb.vue.js +7 -0
- package/dist/components/breadcrumb/Breadcrumb.vue2.js +52 -0
- package/dist/components/breadcrumb/BreadcrumbItem.vue.js +7 -0
- package/dist/components/breadcrumb/BreadcrumbItem.vue2.js +35 -0
- package/dist/components/detail/CommentItem.vue.js +7 -0
- package/dist/components/detail/CommentItem.vue2.js +29 -0
- package/dist/components/detail/DetailLayout.vue.js +7 -0
- package/dist/components/detail/DetailLayout.vue2.js +118 -0
- package/dist/components/detail/PropPanel.vue.js +7 -0
- package/dist/components/detail/PropPanel.vue2.js +51 -0
- package/dist/components/detail/PropRow.vue.js +7 -0
- package/dist/components/detail/PropRow.vue2.js +51 -0
- package/dist/components/editor/BlockQuote.vue.js +7 -0
- package/dist/components/editor/BlockQuote.vue2.js +45 -0
- package/dist/components/editor/CodeBlock.vue.js +7 -0
- package/dist/components/editor/CodeBlock.vue2.js +48 -0
- package/dist/components/editor/ContentBlock.vue.js +7 -0
- package/dist/components/editor/ContentBlock.vue2.js +49 -0
- package/dist/components/editor/RefLink.vue.js +7 -0
- package/dist/components/editor/RefLink.vue2.js +37 -0
- package/dist/components/editor/RichTextEditor.vue.js +7 -0
- package/dist/components/editor/RichTextEditor.vue2.js +132 -0
- package/dist/components/field/FieldAttachment.vue.d.ts +17 -0
- package/dist/components/field/FieldAttachment.vue.js +7 -0
- package/dist/components/field/FieldAttachment.vue2.js +69 -0
- package/dist/components/field/FieldAutoNumber.vue.d.ts +7 -0
- package/dist/components/field/FieldAutoNumber.vue.js +7 -0
- package/dist/components/field/FieldAutoNumber.vue2.js +15 -0
- package/dist/components/field/FieldCheckbox.vue.js +7 -0
- package/dist/{FieldCheckbox-CV3QtQ4Y.js → components/field/FieldCheckbox.vue2.js} +8 -9
- package/dist/components/field/FieldCreator.vue.d.ts +7 -0
- package/dist/components/field/FieldCreator.vue.js +7 -0
- package/dist/components/field/FieldCreator.vue2.js +24 -0
- package/dist/components/field/FieldCurrency.vue.d.ts +17 -0
- package/dist/components/field/FieldCurrency.vue.js +7 -0
- package/dist/components/field/FieldCurrency.vue2.js +42 -0
- package/dist/components/field/FieldDate.vue.js +7 -0
- package/dist/components/field/FieldDate.vue2.js +36 -0
- package/dist/components/field/FieldDatetime.vue.js +7 -0
- package/dist/{FieldDatetime-B52GfWrK.js → components/field/FieldDatetime.vue2.js} +11 -12
- package/dist/components/field/FieldEmail.vue.js +7 -0
- package/dist/{FieldEmail-UREMoue-.js → components/field/FieldEmail.vue2.js} +12 -13
- package/dist/components/field/FieldMarkdownPreview.vue.d.ts +13 -0
- package/dist/components/field/FieldMarkdownPreview.vue.js +7 -0
- package/dist/components/field/FieldMarkdownPreview.vue2.js +37 -0
- package/dist/components/field/FieldMultiSelect.vue.js +7 -0
- package/dist/{FieldMultiSelect-Dlay1Fop.js → components/field/FieldMultiSelect.vue2.js} +32 -33
- package/dist/components/field/FieldNumber.vue.js +7 -0
- package/dist/{FieldNumber-BjhfFhs6.js → components/field/FieldNumber.vue2.js} +8 -9
- package/dist/components/field/FieldPhone.vue.d.ts +17 -0
- package/dist/components/field/FieldPhone.vue.js +7 -0
- package/dist/components/field/FieldPhone.vue2.js +34 -0
- package/dist/components/field/FieldProgress.vue.d.ts +15 -0
- package/dist/components/field/FieldProgress.vue.js +7 -0
- package/dist/components/field/FieldProgress.vue2.js +40 -0
- package/dist/components/field/FieldRating.vue.js +7 -0
- package/dist/components/field/FieldRating.vue2.js +31 -0
- package/dist/components/field/FieldRelation.vue.d.ts +17 -0
- package/dist/components/field/FieldRelation.vue.js +7 -0
- package/dist/components/field/FieldRelation.vue2.js +67 -0
- package/dist/components/field/FieldRichText.vue.d.ts +17 -0
- package/dist/components/field/FieldRichText.vue.js +7 -0
- package/dist/components/field/FieldRichText.vue2.js +65 -0
- package/dist/components/field/FieldSelect.vue.js +7 -0
- package/dist/{FieldSelect-B39Ad8VH.js → components/field/FieldSelect.vue2.js} +44 -44
- package/dist/components/field/FieldText.vue.js +7 -0
- package/dist/{FieldText-Ry7f72Ug.js → components/field/FieldText.vue2.js} +13 -14
- package/dist/components/field/FieldUrl.vue.js +7 -0
- package/dist/components/field/FieldUrl.vue2.js +33 -0
- package/dist/components/form/FormDesigner.vue.js +7 -0
- package/dist/components/form/FormDesigner.vue2.js +255 -0
- package/dist/components/gallery/GalleryCard.vue.js +7 -0
- package/dist/components/gallery/GalleryCard.vue2.js +87 -0
- package/dist/components/gallery/GalleryView.vue.d.ts +6 -2
- package/dist/components/gallery/GalleryView.vue.js +7 -0
- package/dist/components/gallery/GalleryView.vue2.js +58 -0
- package/dist/components/kanban/KanbanBoard.vue.d.ts +5 -1
- package/dist/components/kanban/KanbanBoard.vue.js +7 -0
- package/dist/components/kanban/KanbanBoard.vue2.js +119 -0
- package/dist/components/kanban/KanbanCard.vue.js +7 -0
- package/dist/components/kanban/KanbanCard.vue2.js +56 -0
- package/dist/components/kanban/KanbanColumn.vue.js +7 -0
- package/dist/components/kanban/KanbanColumn.vue2.js +103 -0
- package/dist/components/kanban/QuickAddRow.vue.js +7 -0
- package/dist/components/kanban/QuickAddRow.vue2.js +58 -0
- package/dist/components/layout/AppLayout.vue.js +7 -0
- package/dist/components/layout/AppLayout.vue2.js +82 -0
- package/dist/components/layout/Navbar.vue.js +7 -0
- package/dist/components/layout/Navbar.vue2.js +70 -0
- package/dist/components/layout/Sidebar.vue.js +7 -0
- package/dist/components/layout/Sidebar.vue2.js +88 -0
- package/dist/components/layout/StatusBar.vue.js +7 -0
- package/dist/components/layout/StatusBar.vue2.js +37 -0
- package/dist/components/mermaid/MermaidChart.vue.js +7 -0
- package/dist/components/mermaid/MermaidChart.vue2.js +75 -0
- package/dist/components/overlay/Dialog.vue.js +7 -0
- package/dist/components/overlay/Dialog.vue2.js +89 -0
- package/dist/components/overlay/Drawer.vue.js +7 -0
- package/dist/components/overlay/Drawer.vue2.js +96 -0
- package/dist/components/overlay/Modal.vue.js +7 -0
- package/dist/components/overlay/Modal.vue2.js +99 -0
- package/dist/components/overlay/SidePanel.vue.js +7 -0
- package/dist/components/overlay/SidePanel.vue2.js +121 -0
- package/dist/components/split/SplitPane.vue.js +8 -0
- package/dist/components/split/SplitPane.vue2.js +68 -0
- package/dist/components/table/ColumnHeaderMenu.vue.d.ts +33 -0
- package/dist/components/table/ColumnHeaderMenu.vue.js +7 -0
- package/dist/components/table/ColumnHeaderMenu.vue2.js +153 -0
- package/dist/components/table/DataTable.vue.d.ts +116 -25
- package/dist/components/table/DataTable.vue.js +7 -0
- package/dist/components/table/DataTable.vue2.js +821 -0
- package/dist/components/table/DetailSheet.vue.d.ts +43 -0
- package/dist/components/table/DetailSheet.vue.js +7 -0
- package/dist/components/table/DetailSheet.vue2.js +140 -0
- package/dist/components/table/FieldCell.vue.d.ts +1 -1
- package/dist/components/table/FieldCell.vue.js +7 -0
- package/dist/components/table/FieldCell.vue2.js +86 -0
- package/dist/components/table/FieldTypePicker.vue.d.ts +15 -0
- package/dist/components/table/FieldTypePicker.vue.js +7 -0
- package/dist/components/table/FieldTypePicker.vue2.js +92 -0
- package/dist/components/table/MobileListView.vue.d.ts +24 -0
- package/dist/components/table/MobileListView.vue.js +7 -0
- package/dist/components/table/MobileListView.vue2.js +90 -0
- package/dist/components/table/NewRowBtn.vue.js +7 -0
- package/dist/components/table/NewRowBtn.vue2.js +22 -0
- package/dist/components/table/TableColumnManager.vue.js +7 -0
- package/dist/components/table/TableColumnManager.vue2.js +100 -0
- package/dist/components/table/TableDataRow.vue.js +7 -0
- package/dist/components/table/TableDataRow.vue2.js +115 -0
- package/dist/components/table/TableFilterPanel.vue.js +7 -0
- package/dist/components/table/TableFilterPanel.vue2.js +142 -0
- package/dist/components/table/TableGroupRow.vue.d.ts +5 -0
- package/dist/components/table/TableGroupRow.vue.js +7 -0
- package/dist/components/table/TableGroupRow.vue2.js +58 -0
- package/dist/components/table/TableHeaderRow.vue.d.ts +16 -0
- package/dist/components/table/TableHeaderRow.vue.js +7 -0
- package/dist/components/table/TableHeaderRow.vue2.js +90 -0
- package/dist/components/table/TableToolbar.vue.d.ts +118 -0
- package/dist/components/table/TableToolbar.vue.js +7 -0
- package/dist/components/table/TableToolbar.vue2.js +273 -0
- package/dist/components/table/index.d.ts +5 -0
- package/dist/components/tabs/TabPanel.vue.js +7 -0
- package/dist/components/tabs/TabPanel.vue2.js +26 -0
- package/dist/components/tabs/Tabs.vue.js +7 -0
- package/dist/components/tabs/Tabs.vue2.js +87 -0
- package/dist/components/timeline/ActivityTimeline.vue.js +7 -0
- package/dist/components/timeline/ActivityTimeline.vue2.js +104 -0
- package/dist/components/timeline/GanttRow.vue.js +7 -0
- package/dist/components/timeline/GanttRow.vue2.js +110 -0
- package/dist/components/timeline/GanttTimeline.vue.js +7 -0
- package/dist/components/timeline/GanttTimeline.vue2.js +186 -0
- package/dist/components/toast/ToastContainer.vue.js +34 -0
- package/dist/components/toast/ToastContainer.vue3.js +5 -0
- package/dist/components/toast/ToastItem.vue.js +7 -0
- package/dist/components/toast/ToastItem.vue2.js +78 -0
- package/dist/composables/index.d.ts +19 -0
- package/dist/composables/useAiChat.js +103 -0
- package/dist/composables/useBadge.js +76 -0
- package/dist/composables/useBreakpoint.d.ts +2 -1
- package/dist/composables/useBreakpoint.js +18 -0
- package/dist/composables/useColumnResize.d.ts +19 -0
- package/dist/composables/useColumnResize.js +58 -0
- package/dist/composables/useDraftRows.d.ts +33 -0
- package/dist/composables/useDraftRows.js +103 -0
- package/dist/composables/useFixedColumns.d.ts +25 -0
- package/dist/composables/useFixedColumns.js +61 -0
- package/dist/composables/useFocusTrap.d.ts +10 -0
- package/dist/composables/useFocusTrap.js +37 -0
- package/dist/composables/useInlineEdit.js +28 -0
- package/dist/composables/useKeyboardNavigation.d.ts +45 -0
- package/dist/composables/useKeyboardNavigation.js +140 -0
- package/dist/composables/useMarkdown.js +69 -0
- package/dist/composables/useRowDrag.d.ts +32 -0
- package/dist/composables/useRowDrag.js +85 -0
- package/dist/composables/useSchemaEngine.d.ts +31 -0
- package/dist/composables/useSchemaEngine.js +129 -0
- package/dist/composables/useSearch.d.ts +30 -0
- package/dist/composables/useSearch.js +59 -0
- package/dist/composables/useStream.js +80 -0
- package/dist/composables/useSupabaseProvider.d.ts +70 -0
- package/dist/composables/useSupabaseProvider.js +126 -0
- package/dist/composables/useTable.d.ts +3 -0
- package/dist/composables/useTable.js +135 -0
- package/dist/composables/useTableColumns.js +24 -0
- package/dist/composables/useTableData.js +16 -0
- package/dist/composables/useTableFilter.js +97 -0
- package/dist/composables/useTableGroup.d.ts +14 -1
- package/dist/composables/useTableGroup.js +70 -0
- package/dist/composables/useToast.js +38 -0
- package/dist/composables/useTypewriter.js +56 -0
- package/dist/composables/useViewPersistence.d.ts +98 -0
- package/dist/composables/useViewPersistence.js +141 -0
- package/dist/composables/useVirtualList.d.ts +4 -1
- package/dist/composables/useVirtualList.js +140 -0
- package/dist/composables/useWorkerSort.d.ts +14 -0
- package/dist/composables/useWorkerSort.js +61 -0
- package/dist/constants/table.js +11 -0
- package/dist/index.d.ts +28 -4
- package/dist/index.js +349 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/core.js +5 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js +377 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js +923 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js +151 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js +240 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js +658 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js +38 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js +216 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js +13 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js +399 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js +305 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js +615 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js +753 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js +219 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js +183 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +1063 -0
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +63 -2
- package/dist/types/index.js +94 -0
- package/dist/types/table-internal.d.ts +64 -0
- package/dist/utils/aggregation.d.ts +5 -0
- package/dist/utils/aggregation.js +38 -0
- package/dist/utils/icon.js +15 -0
- package/dist/utils/supabaseAdapter.d.ts +48 -0
- package/dist/utils/supabaseAdapter.js +76 -0
- package/dist/utils/supabaseSchema.d.ts +81 -0
- package/dist/utils/supabaseSchema.js +202 -0
- package/dist/workers/tableWorker.d.ts +31 -0
- package/package.json +13 -6
- package/dist/FieldDate-Bljx4jb7.js +0 -34
- package/dist/FieldRating-BKHUu-A1.js +0 -32
- package/dist/FieldUrl-bv0EB9sh.js +0 -34
- package/dist/index-DQph5iTq.js +0 -12936
- package/dist/oneflow-ui.js +0 -111
- package/dist/oneflow-ui.umd.cjs +0 -13
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
const y = "[A-Za-z$_][0-9A-Za-z$_]*", x = [
|
|
2
|
+
"as",
|
|
3
|
+
// for exports
|
|
4
|
+
"in",
|
|
5
|
+
"of",
|
|
6
|
+
"if",
|
|
7
|
+
"for",
|
|
8
|
+
"while",
|
|
9
|
+
"finally",
|
|
10
|
+
"var",
|
|
11
|
+
"new",
|
|
12
|
+
"function",
|
|
13
|
+
"do",
|
|
14
|
+
"return",
|
|
15
|
+
"void",
|
|
16
|
+
"else",
|
|
17
|
+
"break",
|
|
18
|
+
"catch",
|
|
19
|
+
"instanceof",
|
|
20
|
+
"with",
|
|
21
|
+
"throw",
|
|
22
|
+
"case",
|
|
23
|
+
"default",
|
|
24
|
+
"try",
|
|
25
|
+
"switch",
|
|
26
|
+
"continue",
|
|
27
|
+
"typeof",
|
|
28
|
+
"delete",
|
|
29
|
+
"let",
|
|
30
|
+
"yield",
|
|
31
|
+
"const",
|
|
32
|
+
"class",
|
|
33
|
+
// JS handles these with a special rule
|
|
34
|
+
// "get",
|
|
35
|
+
// "set",
|
|
36
|
+
"debugger",
|
|
37
|
+
"async",
|
|
38
|
+
"await",
|
|
39
|
+
"static",
|
|
40
|
+
"import",
|
|
41
|
+
"from",
|
|
42
|
+
"export",
|
|
43
|
+
"extends",
|
|
44
|
+
// It's reached stage 3, which is "recommended for implementation":
|
|
45
|
+
"using"
|
|
46
|
+
], k = [
|
|
47
|
+
"true",
|
|
48
|
+
"false",
|
|
49
|
+
"null",
|
|
50
|
+
"undefined",
|
|
51
|
+
"NaN",
|
|
52
|
+
"Infinity"
|
|
53
|
+
], D = [
|
|
54
|
+
// Fundamental objects
|
|
55
|
+
"Object",
|
|
56
|
+
"Function",
|
|
57
|
+
"Boolean",
|
|
58
|
+
"Symbol",
|
|
59
|
+
// numbers and dates
|
|
60
|
+
"Math",
|
|
61
|
+
"Date",
|
|
62
|
+
"Number",
|
|
63
|
+
"BigInt",
|
|
64
|
+
// text
|
|
65
|
+
"String",
|
|
66
|
+
"RegExp",
|
|
67
|
+
// Indexed collections
|
|
68
|
+
"Array",
|
|
69
|
+
"Float32Array",
|
|
70
|
+
"Float64Array",
|
|
71
|
+
"Int8Array",
|
|
72
|
+
"Uint8Array",
|
|
73
|
+
"Uint8ClampedArray",
|
|
74
|
+
"Int16Array",
|
|
75
|
+
"Int32Array",
|
|
76
|
+
"Uint16Array",
|
|
77
|
+
"Uint32Array",
|
|
78
|
+
"BigInt64Array",
|
|
79
|
+
"BigUint64Array",
|
|
80
|
+
// Keyed collections
|
|
81
|
+
"Set",
|
|
82
|
+
"Map",
|
|
83
|
+
"WeakSet",
|
|
84
|
+
"WeakMap",
|
|
85
|
+
// Structured data
|
|
86
|
+
"ArrayBuffer",
|
|
87
|
+
"SharedArrayBuffer",
|
|
88
|
+
"Atomics",
|
|
89
|
+
"DataView",
|
|
90
|
+
"JSON",
|
|
91
|
+
// Control abstraction objects
|
|
92
|
+
"Promise",
|
|
93
|
+
"Generator",
|
|
94
|
+
"GeneratorFunction",
|
|
95
|
+
"AsyncFunction",
|
|
96
|
+
// Reflection
|
|
97
|
+
"Reflect",
|
|
98
|
+
"Proxy",
|
|
99
|
+
// Internationalization
|
|
100
|
+
"Intl",
|
|
101
|
+
// WebAssembly
|
|
102
|
+
"WebAssembly"
|
|
103
|
+
], h = [
|
|
104
|
+
"Error",
|
|
105
|
+
"EvalError",
|
|
106
|
+
"InternalError",
|
|
107
|
+
"RangeError",
|
|
108
|
+
"ReferenceError",
|
|
109
|
+
"SyntaxError",
|
|
110
|
+
"TypeError",
|
|
111
|
+
"URIError"
|
|
112
|
+
], B = [
|
|
113
|
+
"setInterval",
|
|
114
|
+
"setTimeout",
|
|
115
|
+
"clearInterval",
|
|
116
|
+
"clearTimeout",
|
|
117
|
+
"require",
|
|
118
|
+
"exports",
|
|
119
|
+
"eval",
|
|
120
|
+
"isFinite",
|
|
121
|
+
"isNaN",
|
|
122
|
+
"parseFloat",
|
|
123
|
+
"parseInt",
|
|
124
|
+
"decodeURI",
|
|
125
|
+
"decodeURIComponent",
|
|
126
|
+
"encodeURI",
|
|
127
|
+
"encodeURIComponent",
|
|
128
|
+
"escape",
|
|
129
|
+
"unescape"
|
|
130
|
+
], U = [
|
|
131
|
+
"arguments",
|
|
132
|
+
"this",
|
|
133
|
+
"super",
|
|
134
|
+
"console",
|
|
135
|
+
"window",
|
|
136
|
+
"document",
|
|
137
|
+
"localStorage",
|
|
138
|
+
"sessionStorage",
|
|
139
|
+
"module",
|
|
140
|
+
"global"
|
|
141
|
+
// Node.js
|
|
142
|
+
], P = [].concat(
|
|
143
|
+
B,
|
|
144
|
+
D,
|
|
145
|
+
h
|
|
146
|
+
);
|
|
147
|
+
function J(e) {
|
|
148
|
+
const a = e.regex, t = (s, { after: d }) => {
|
|
149
|
+
const S = "</" + s[0].slice(1);
|
|
150
|
+
return s.input.indexOf(S, d) !== -1;
|
|
151
|
+
}, n = y, b = {
|
|
152
|
+
begin: "<>",
|
|
153
|
+
end: "</>"
|
|
154
|
+
}, p = /<[A-Za-z0-9\\._:-]+\s*\/>/, i = {
|
|
155
|
+
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
156
|
+
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
|
157
|
+
/**
|
|
158
|
+
* @param {RegExpMatchArray} match
|
|
159
|
+
* @param {CallbackResponse} response
|
|
160
|
+
*/
|
|
161
|
+
isTrulyOpeningTag: (s, d) => {
|
|
162
|
+
const S = s[0].length + s.index, f = s.input[S];
|
|
163
|
+
if (
|
|
164
|
+
// HTML should not include another raw `<` inside a tag
|
|
165
|
+
// nested type?
|
|
166
|
+
// `<Array<Array<number>>`, etc.
|
|
167
|
+
f === "<" || // the , gives away that this is not HTML
|
|
168
|
+
// `<T, A extends keyof T, V>`
|
|
169
|
+
f === ","
|
|
170
|
+
) {
|
|
171
|
+
d.ignoreMatch();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
f === ">" && (t(s, { after: S }) || d.ignoreMatch());
|
|
175
|
+
let O;
|
|
176
|
+
const L = s.input.substring(S);
|
|
177
|
+
if (O = L.match(/^\s*=/)) {
|
|
178
|
+
d.ignoreMatch();
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if ((O = L.match(/^\s+extends\s+/)) && O.index === 0) {
|
|
182
|
+
d.ignoreMatch();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}, o = {
|
|
187
|
+
$pattern: y,
|
|
188
|
+
keyword: x,
|
|
189
|
+
literal: k,
|
|
190
|
+
built_in: P,
|
|
191
|
+
"variable.language": U
|
|
192
|
+
}, N = "[0-9](_?[0-9])*", l = `\\.(${N})`, g = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", u = {
|
|
193
|
+
className: "number",
|
|
194
|
+
variants: [
|
|
195
|
+
// DecimalLiteral
|
|
196
|
+
{ begin: `(\\b(${g})((${l})|\\.)?|(${l}))[eE][+-]?(${N})\\b` },
|
|
197
|
+
{ begin: `\\b(${g})\\b((${l})\\b|\\.)?|(${l})\\b` },
|
|
198
|
+
// DecimalBigIntegerLiteral
|
|
199
|
+
{ begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
|
|
200
|
+
// NonDecimalIntegerLiteral
|
|
201
|
+
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
|
202
|
+
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
|
203
|
+
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
|
204
|
+
// LegacyOctalIntegerLiteral (does not include underscore separators)
|
|
205
|
+
// https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
|
|
206
|
+
{ begin: "\\b0[0-7]+n?\\b" }
|
|
207
|
+
],
|
|
208
|
+
relevance: 0
|
|
209
|
+
}, c = {
|
|
210
|
+
className: "subst",
|
|
211
|
+
begin: "\\$\\{",
|
|
212
|
+
end: "\\}",
|
|
213
|
+
keywords: o,
|
|
214
|
+
contains: []
|
|
215
|
+
// defined later
|
|
216
|
+
}, A = {
|
|
217
|
+
begin: ".?html`",
|
|
218
|
+
end: "",
|
|
219
|
+
starts: {
|
|
220
|
+
end: "`",
|
|
221
|
+
returnEnd: !1,
|
|
222
|
+
contains: [
|
|
223
|
+
e.BACKSLASH_ESCAPE,
|
|
224
|
+
c
|
|
225
|
+
],
|
|
226
|
+
subLanguage: "xml"
|
|
227
|
+
}
|
|
228
|
+
}, T = {
|
|
229
|
+
begin: ".?css`",
|
|
230
|
+
end: "",
|
|
231
|
+
starts: {
|
|
232
|
+
end: "`",
|
|
233
|
+
returnEnd: !1,
|
|
234
|
+
contains: [
|
|
235
|
+
e.BACKSLASH_ESCAPE,
|
|
236
|
+
c
|
|
237
|
+
],
|
|
238
|
+
subLanguage: "css"
|
|
239
|
+
}
|
|
240
|
+
}, r = {
|
|
241
|
+
begin: ".?gql`",
|
|
242
|
+
end: "",
|
|
243
|
+
starts: {
|
|
244
|
+
end: "`",
|
|
245
|
+
returnEnd: !1,
|
|
246
|
+
contains: [
|
|
247
|
+
e.BACKSLASH_ESCAPE,
|
|
248
|
+
c
|
|
249
|
+
],
|
|
250
|
+
subLanguage: "graphql"
|
|
251
|
+
}
|
|
252
|
+
}, m = {
|
|
253
|
+
className: "string",
|
|
254
|
+
begin: "`",
|
|
255
|
+
end: "`",
|
|
256
|
+
contains: [
|
|
257
|
+
e.BACKSLASH_ESCAPE,
|
|
258
|
+
c
|
|
259
|
+
]
|
|
260
|
+
}, E = {
|
|
261
|
+
className: "comment",
|
|
262
|
+
variants: [
|
|
263
|
+
e.COMMENT(
|
|
264
|
+
/\/\*\*(?!\/)/,
|
|
265
|
+
"\\*/",
|
|
266
|
+
{
|
|
267
|
+
relevance: 0,
|
|
268
|
+
contains: [
|
|
269
|
+
{
|
|
270
|
+
begin: "(?=@[A-Za-z]+)",
|
|
271
|
+
relevance: 0,
|
|
272
|
+
contains: [
|
|
273
|
+
{
|
|
274
|
+
className: "doctag",
|
|
275
|
+
begin: "@[A-Za-z]+"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
className: "type",
|
|
279
|
+
begin: "\\{",
|
|
280
|
+
end: "\\}",
|
|
281
|
+
excludeEnd: !0,
|
|
282
|
+
excludeBegin: !0,
|
|
283
|
+
relevance: 0
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
className: "variable",
|
|
287
|
+
begin: n + "(?=\\s*(-)|$)",
|
|
288
|
+
endsParent: !0,
|
|
289
|
+
relevance: 0
|
|
290
|
+
},
|
|
291
|
+
// eat spaces (not newlines) so we can find
|
|
292
|
+
// types or variables
|
|
293
|
+
{
|
|
294
|
+
begin: /(?=[^\n])\s/,
|
|
295
|
+
relevance: 0
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
),
|
|
302
|
+
e.C_BLOCK_COMMENT_MODE,
|
|
303
|
+
e.C_LINE_COMMENT_MODE
|
|
304
|
+
]
|
|
305
|
+
}, R = [
|
|
306
|
+
e.APOS_STRING_MODE,
|
|
307
|
+
e.QUOTE_STRING_MODE,
|
|
308
|
+
A,
|
|
309
|
+
T,
|
|
310
|
+
r,
|
|
311
|
+
m,
|
|
312
|
+
// Skip numbers when they are part of a variable name
|
|
313
|
+
{ match: /\$\d+/ },
|
|
314
|
+
u
|
|
315
|
+
// This is intentional:
|
|
316
|
+
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
317
|
+
// hljs.REGEXP_MODE
|
|
318
|
+
];
|
|
319
|
+
c.contains = R.concat({
|
|
320
|
+
// we need to pair up {} inside our subst to prevent
|
|
321
|
+
// it from ending too early by matching another }
|
|
322
|
+
begin: /\{/,
|
|
323
|
+
end: /\}/,
|
|
324
|
+
keywords: o,
|
|
325
|
+
contains: [
|
|
326
|
+
"self"
|
|
327
|
+
].concat(R)
|
|
328
|
+
});
|
|
329
|
+
const M = [].concat(E, c.contains), I = M.concat([
|
|
330
|
+
// eat recursive parens in sub expressions
|
|
331
|
+
{
|
|
332
|
+
begin: /(\s*)\(/,
|
|
333
|
+
end: /\)/,
|
|
334
|
+
keywords: o,
|
|
335
|
+
contains: ["self"].concat(M)
|
|
336
|
+
}
|
|
337
|
+
]), _ = {
|
|
338
|
+
className: "params",
|
|
339
|
+
// convert this to negative lookbehind in v12
|
|
340
|
+
begin: /(\s*)\(/,
|
|
341
|
+
// to match the parms with
|
|
342
|
+
end: /\)/,
|
|
343
|
+
excludeBegin: !0,
|
|
344
|
+
excludeEnd: !0,
|
|
345
|
+
keywords: o,
|
|
346
|
+
contains: I
|
|
347
|
+
}, $ = {
|
|
348
|
+
variants: [
|
|
349
|
+
// class Car extends vehicle
|
|
350
|
+
{
|
|
351
|
+
match: [
|
|
352
|
+
/class/,
|
|
353
|
+
/\s+/,
|
|
354
|
+
n,
|
|
355
|
+
/\s+/,
|
|
356
|
+
/extends/,
|
|
357
|
+
/\s+/,
|
|
358
|
+
a.concat(n, "(", a.concat(/\./, n), ")*")
|
|
359
|
+
],
|
|
360
|
+
scope: {
|
|
361
|
+
1: "keyword",
|
|
362
|
+
3: "title.class",
|
|
363
|
+
5: "keyword",
|
|
364
|
+
7: "title.class.inherited"
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
// class Car
|
|
368
|
+
{
|
|
369
|
+
match: [
|
|
370
|
+
/class/,
|
|
371
|
+
/\s+/,
|
|
372
|
+
n
|
|
373
|
+
],
|
|
374
|
+
scope: {
|
|
375
|
+
1: "keyword",
|
|
376
|
+
3: "title.class"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
]
|
|
380
|
+
}, v = {
|
|
381
|
+
relevance: 0,
|
|
382
|
+
match: a.either(
|
|
383
|
+
// Hard coded exceptions
|
|
384
|
+
/\bJSON/,
|
|
385
|
+
// Float32Array, OutT
|
|
386
|
+
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
|
|
387
|
+
// CSSFactory, CSSFactoryT
|
|
388
|
+
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
|
|
389
|
+
// FPs, FPsT
|
|
390
|
+
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
|
|
391
|
+
// P
|
|
392
|
+
// single letters are not highlighted
|
|
393
|
+
// BLAH
|
|
394
|
+
// this will be flagged as a UPPER_CASE_CONSTANT instead
|
|
395
|
+
),
|
|
396
|
+
className: "title.class",
|
|
397
|
+
keywords: {
|
|
398
|
+
_: [
|
|
399
|
+
// se we still get relevance credit for JS library classes
|
|
400
|
+
...D,
|
|
401
|
+
...h
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
}, F = {
|
|
405
|
+
label: "use_strict",
|
|
406
|
+
className: "meta",
|
|
407
|
+
relevance: 10,
|
|
408
|
+
begin: /^\s*['"]use (strict|asm)['"]/
|
|
409
|
+
}, G = {
|
|
410
|
+
variants: [
|
|
411
|
+
{
|
|
412
|
+
match: [
|
|
413
|
+
/function/,
|
|
414
|
+
/\s+/,
|
|
415
|
+
n,
|
|
416
|
+
/(?=\s*\()/
|
|
417
|
+
]
|
|
418
|
+
},
|
|
419
|
+
// anonymous function
|
|
420
|
+
{
|
|
421
|
+
match: [
|
|
422
|
+
/function/,
|
|
423
|
+
/\s*(?=\()/
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
],
|
|
427
|
+
className: {
|
|
428
|
+
1: "keyword",
|
|
429
|
+
3: "title.function"
|
|
430
|
+
},
|
|
431
|
+
label: "func.def",
|
|
432
|
+
contains: [_],
|
|
433
|
+
illegal: /%/
|
|
434
|
+
}, Z = {
|
|
435
|
+
relevance: 0,
|
|
436
|
+
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
437
|
+
className: "variable.constant"
|
|
438
|
+
};
|
|
439
|
+
function z(s) {
|
|
440
|
+
return a.concat("(?!", s.join("|"), ")");
|
|
441
|
+
}
|
|
442
|
+
const K = {
|
|
443
|
+
match: a.concat(
|
|
444
|
+
/\b/,
|
|
445
|
+
z([
|
|
446
|
+
...B,
|
|
447
|
+
"super",
|
|
448
|
+
"import"
|
|
449
|
+
].map((s) => `${s}\\s*\\(`)),
|
|
450
|
+
n,
|
|
451
|
+
a.lookahead(/\s*\(/)
|
|
452
|
+
),
|
|
453
|
+
className: "title.function",
|
|
454
|
+
relevance: 0
|
|
455
|
+
}, H = {
|
|
456
|
+
begin: a.concat(/\./, a.lookahead(
|
|
457
|
+
a.concat(n, /(?![0-9A-Za-z$_(])/)
|
|
458
|
+
)),
|
|
459
|
+
end: n,
|
|
460
|
+
excludeBegin: !0,
|
|
461
|
+
keywords: "prototype",
|
|
462
|
+
className: "property",
|
|
463
|
+
relevance: 0
|
|
464
|
+
}, Y = {
|
|
465
|
+
match: [
|
|
466
|
+
/get|set/,
|
|
467
|
+
/\s+/,
|
|
468
|
+
n,
|
|
469
|
+
/(?=\()/
|
|
470
|
+
],
|
|
471
|
+
className: {
|
|
472
|
+
1: "keyword",
|
|
473
|
+
3: "title.function"
|
|
474
|
+
},
|
|
475
|
+
contains: [
|
|
476
|
+
{
|
|
477
|
+
// eat to avoid empty params
|
|
478
|
+
begin: /\(\)/
|
|
479
|
+
},
|
|
480
|
+
_
|
|
481
|
+
]
|
|
482
|
+
}, w = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", W = {
|
|
483
|
+
match: [
|
|
484
|
+
/const|var|let/,
|
|
485
|
+
/\s+/,
|
|
486
|
+
n,
|
|
487
|
+
/\s*/,
|
|
488
|
+
/=\s*/,
|
|
489
|
+
/(async\s*)?/,
|
|
490
|
+
// async is optional
|
|
491
|
+
a.lookahead(w)
|
|
492
|
+
],
|
|
493
|
+
keywords: "async",
|
|
494
|
+
className: {
|
|
495
|
+
1: "keyword",
|
|
496
|
+
3: "title.function"
|
|
497
|
+
},
|
|
498
|
+
contains: [
|
|
499
|
+
_
|
|
500
|
+
]
|
|
501
|
+
};
|
|
502
|
+
return {
|
|
503
|
+
name: "JavaScript",
|
|
504
|
+
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
505
|
+
keywords: o,
|
|
506
|
+
// this will be extended by TypeScript
|
|
507
|
+
exports: { PARAMS_CONTAINS: I, CLASS_REFERENCE: v },
|
|
508
|
+
illegal: /#(?![$_A-z])/,
|
|
509
|
+
contains: [
|
|
510
|
+
e.SHEBANG({
|
|
511
|
+
label: "shebang",
|
|
512
|
+
binary: "node",
|
|
513
|
+
relevance: 5
|
|
514
|
+
}),
|
|
515
|
+
F,
|
|
516
|
+
e.APOS_STRING_MODE,
|
|
517
|
+
e.QUOTE_STRING_MODE,
|
|
518
|
+
A,
|
|
519
|
+
T,
|
|
520
|
+
r,
|
|
521
|
+
m,
|
|
522
|
+
E,
|
|
523
|
+
// Skip numbers when they are part of a variable name
|
|
524
|
+
{ match: /\$\d+/ },
|
|
525
|
+
u,
|
|
526
|
+
v,
|
|
527
|
+
{
|
|
528
|
+
scope: "attr",
|
|
529
|
+
match: n + a.lookahead(":"),
|
|
530
|
+
relevance: 0
|
|
531
|
+
},
|
|
532
|
+
W,
|
|
533
|
+
{
|
|
534
|
+
// "value" container
|
|
535
|
+
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
536
|
+
keywords: "return throw case",
|
|
537
|
+
relevance: 0,
|
|
538
|
+
contains: [
|
|
539
|
+
E,
|
|
540
|
+
e.REGEXP_MODE,
|
|
541
|
+
{
|
|
542
|
+
className: "function",
|
|
543
|
+
// we have to count the parens to make sure we actually have the
|
|
544
|
+
// correct bounding ( ) before the =>. There could be any number of
|
|
545
|
+
// sub-expressions inside also surrounded by parens.
|
|
546
|
+
begin: w,
|
|
547
|
+
returnBegin: !0,
|
|
548
|
+
end: "\\s*=>",
|
|
549
|
+
contains: [
|
|
550
|
+
{
|
|
551
|
+
className: "params",
|
|
552
|
+
variants: [
|
|
553
|
+
{
|
|
554
|
+
begin: e.UNDERSCORE_IDENT_RE,
|
|
555
|
+
relevance: 0
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
className: null,
|
|
559
|
+
begin: /\(\s*\)/,
|
|
560
|
+
skip: !0
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
begin: /(\s*)\(/,
|
|
564
|
+
end: /\)/,
|
|
565
|
+
excludeBegin: !0,
|
|
566
|
+
excludeEnd: !0,
|
|
567
|
+
keywords: o,
|
|
568
|
+
contains: I
|
|
569
|
+
}
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
// could be a comma delimited list of params to a function call
|
|
576
|
+
begin: /,/,
|
|
577
|
+
relevance: 0
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
match: /\s+/,
|
|
581
|
+
relevance: 0
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
// JSX
|
|
585
|
+
variants: [
|
|
586
|
+
{ begin: b.begin, end: b.end },
|
|
587
|
+
{ match: p },
|
|
588
|
+
{
|
|
589
|
+
begin: i.begin,
|
|
590
|
+
// we carefully check the opening tag to see if it truly
|
|
591
|
+
// is a tag and not a false positive
|
|
592
|
+
"on:begin": i.isTrulyOpeningTag,
|
|
593
|
+
end: i.end
|
|
594
|
+
}
|
|
595
|
+
],
|
|
596
|
+
subLanguage: "xml",
|
|
597
|
+
contains: [
|
|
598
|
+
{
|
|
599
|
+
begin: i.begin,
|
|
600
|
+
end: i.end,
|
|
601
|
+
skip: !0,
|
|
602
|
+
contains: ["self"]
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
}
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
G,
|
|
609
|
+
{
|
|
610
|
+
// prevent this from getting swallowed up by function
|
|
611
|
+
// since they appear "function like"
|
|
612
|
+
beginKeywords: "while if switch catch for"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
// we have to count the parens to make sure we actually have the correct
|
|
616
|
+
// bounding ( ). There could be any number of sub-expressions inside
|
|
617
|
+
// also surrounded by parens.
|
|
618
|
+
begin: "\\b(?!function)" + e.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
|
619
|
+
// end parens
|
|
620
|
+
returnBegin: !0,
|
|
621
|
+
label: "func.def",
|
|
622
|
+
contains: [
|
|
623
|
+
_,
|
|
624
|
+
e.inherit(e.TITLE_MODE, { begin: n, className: "title.function" })
|
|
625
|
+
]
|
|
626
|
+
},
|
|
627
|
+
// catch ... so it won't trigger the property rule below
|
|
628
|
+
{
|
|
629
|
+
match: /\.\.\./,
|
|
630
|
+
relevance: 0
|
|
631
|
+
},
|
|
632
|
+
H,
|
|
633
|
+
// hack: prevents detection of keywords in some circumstances
|
|
634
|
+
// .keyword()
|
|
635
|
+
// $keyword = x
|
|
636
|
+
{
|
|
637
|
+
match: "\\$" + n,
|
|
638
|
+
relevance: 0
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
match: [/\bconstructor(?=\s*\()/],
|
|
642
|
+
className: { 1: "title.function" },
|
|
643
|
+
contains: [_]
|
|
644
|
+
},
|
|
645
|
+
K,
|
|
646
|
+
Z,
|
|
647
|
+
$,
|
|
648
|
+
Y,
|
|
649
|
+
{
|
|
650
|
+
match: /\$[(.]/
|
|
651
|
+
// relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
|
652
|
+
}
|
|
653
|
+
]
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
function X(e) {
|
|
657
|
+
const a = e.regex, t = J(e), n = y, b = [
|
|
658
|
+
"any",
|
|
659
|
+
"void",
|
|
660
|
+
"number",
|
|
661
|
+
"boolean",
|
|
662
|
+
"string",
|
|
663
|
+
"object",
|
|
664
|
+
"never",
|
|
665
|
+
"symbol",
|
|
666
|
+
"bigint",
|
|
667
|
+
"unknown"
|
|
668
|
+
], p = {
|
|
669
|
+
begin: [
|
|
670
|
+
/namespace/,
|
|
671
|
+
/\s+/,
|
|
672
|
+
e.IDENT_RE
|
|
673
|
+
],
|
|
674
|
+
beginScope: {
|
|
675
|
+
1: "keyword",
|
|
676
|
+
3: "title.class"
|
|
677
|
+
}
|
|
678
|
+
}, i = {
|
|
679
|
+
beginKeywords: "interface",
|
|
680
|
+
end: /\{/,
|
|
681
|
+
excludeEnd: !0,
|
|
682
|
+
keywords: {
|
|
683
|
+
keyword: "interface extends",
|
|
684
|
+
built_in: b
|
|
685
|
+
},
|
|
686
|
+
contains: [t.exports.CLASS_REFERENCE]
|
|
687
|
+
}, o = {
|
|
688
|
+
className: "meta",
|
|
689
|
+
relevance: 10,
|
|
690
|
+
begin: /^\s*['"]use strict['"]/
|
|
691
|
+
}, N = [
|
|
692
|
+
"type",
|
|
693
|
+
// "namespace",
|
|
694
|
+
"interface",
|
|
695
|
+
"public",
|
|
696
|
+
"private",
|
|
697
|
+
"protected",
|
|
698
|
+
"implements",
|
|
699
|
+
"declare",
|
|
700
|
+
"abstract",
|
|
701
|
+
"readonly",
|
|
702
|
+
"enum",
|
|
703
|
+
"override",
|
|
704
|
+
"satisfies"
|
|
705
|
+
], l = {
|
|
706
|
+
$pattern: y,
|
|
707
|
+
keyword: x.concat(N),
|
|
708
|
+
literal: k,
|
|
709
|
+
built_in: P.concat(b),
|
|
710
|
+
"variable.language": U
|
|
711
|
+
}, g = {
|
|
712
|
+
className: "meta",
|
|
713
|
+
begin: "@" + n
|
|
714
|
+
}, u = (r, m, C) => {
|
|
715
|
+
const E = r.contains.findIndex((R) => R.label === m);
|
|
716
|
+
if (E === -1)
|
|
717
|
+
throw new Error("can not find mode to replace");
|
|
718
|
+
r.contains.splice(E, 1, C);
|
|
719
|
+
};
|
|
720
|
+
Object.assign(t.keywords, l), t.exports.PARAMS_CONTAINS.push(g);
|
|
721
|
+
const c = t.contains.find((r) => r.scope === "attr"), A = Object.assign(
|
|
722
|
+
{},
|
|
723
|
+
c,
|
|
724
|
+
{ match: a.concat(n, a.lookahead(/\s*\?:/)) }
|
|
725
|
+
);
|
|
726
|
+
t.exports.PARAMS_CONTAINS.push([
|
|
727
|
+
t.exports.CLASS_REFERENCE,
|
|
728
|
+
// class reference for highlighting the params types
|
|
729
|
+
c,
|
|
730
|
+
// highlight the params key
|
|
731
|
+
A
|
|
732
|
+
// Added for optional property assignment highlighting
|
|
733
|
+
]), t.contains = t.contains.concat([
|
|
734
|
+
g,
|
|
735
|
+
p,
|
|
736
|
+
i,
|
|
737
|
+
A
|
|
738
|
+
// Added for optional property assignment highlighting
|
|
739
|
+
]), u(t, "shebang", e.SHEBANG()), u(t, "use_strict", o);
|
|
740
|
+
const T = t.contains.find((r) => r.label === "func.def");
|
|
741
|
+
return T.relevance = 0, Object.assign(t, {
|
|
742
|
+
name: "TypeScript",
|
|
743
|
+
aliases: [
|
|
744
|
+
"ts",
|
|
745
|
+
"tsx",
|
|
746
|
+
"mts",
|
|
747
|
+
"cts"
|
|
748
|
+
]
|
|
749
|
+
}), t;
|
|
750
|
+
}
|
|
751
|
+
export {
|
|
752
|
+
X as default
|
|
753
|
+
};
|