easy-email-pro-theme 0.2.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/lib/VariablesEditorContent-08997e30.mjs +147384 -0
- package/lib/abap-e7729493.mjs +1315 -0
- package/lib/apex-ea0b1b44.mjs +320 -0
- package/lib/assets/json.worker-2db083a8.js +16634 -0
- package/lib/azcli-92ca1f6b.mjs +75 -0
- package/lib/bat-a8aff72a.mjs +96 -0
- package/lib/bicep-a4d73496.mjs +116 -0
- package/lib/cameligo-93a61573.mjs +169 -0
- package/lib/clojure-a4292303.mjs +755 -0
- package/lib/coffee-c79fd580.mjs +229 -0
- package/lib/cpp-4bbc4355.mjs +391 -0
- package/lib/csharp-8ee8b919.mjs +321 -0
- package/lib/csp-7ff23ab5.mjs +58 -0
- package/lib/css-675efd06.mjs +185 -0
- package/lib/cssMode-e5b02650.mjs +2031 -0
- package/lib/cypher-ff6c93d1.mjs +263 -0
- package/lib/dart-b81ee8da.mjs +271 -0
- package/lib/dockerfile-4d34b657.mjs +133 -0
- package/lib/ecl-829c6c9f.mjs +455 -0
- package/lib/elixir-d20ab92c.mjs +490 -0
- package/lib/flow9-d363677c.mjs +142 -0
- package/lib/freemarker2-07352200.mjs +675 -0
- package/lib/fsharp-e5e10937.mjs +211 -0
- package/lib/go-49d8dd1b.mjs +209 -0
- package/lib/graphql-397d36cc.mjs +142 -0
- package/lib/handlebars-eb587af4.mjs +403 -0
- package/lib/hcl-2bc5a11b.mjs +178 -0
- package/lib/html-805b20b1.mjs +293 -0
- package/lib/html2canvas.esm-858519c4.mjs +7837 -0
- package/lib/htmlMode-a339a06a.mjs +2047 -0
- package/lib/index.js +40838 -0
- package/lib/ini-777fd0a6.mjs +69 -0
- package/lib/java-88c2ae93.mjs +222 -0
- package/lib/javascript-b5849f55.mjs +78 -0
- package/lib/jsonMode-1b509c19.mjs +2607 -0
- package/lib/julia-7e1d65a2.mjs +497 -0
- package/lib/kotlin-da15198d.mjs +246 -0
- package/lib/less-0057666d.mjs +168 -0
- package/lib/lexon-4f74b04c.mjs +152 -0
- package/lib/liquid-d5c8a287.mjs +250 -0
- package/lib/lua-da0a0c60.mjs +158 -0
- package/lib/m3-14d67e1c.mjs +211 -0
- package/lib/markdown-37ba20b1.mjs +203 -0
- package/lib/mips-d0b2c227.mjs +195 -0
- package/lib/monacoeditorwork/css.worker.bundle.js +46736 -0
- package/lib/monacoeditorwork/editor.worker.bundle.js +9954 -0
- package/lib/monacoeditorwork/html.worker.bundle.js +25985 -0
- package/lib/monacoeditorwork/json.worker.bundle.js +17214 -0
- package/lib/monacoeditorwork/ts.worker.bundle.js +172133 -0
- package/lib/msdax-29068c66.mjs +378 -0
- package/lib/mysql-7833c854.mjs +877 -0
- package/lib/objective-c-91c200d7.mjs +189 -0
- package/lib/pascal-eb8fa4fd.mjs +246 -0
- package/lib/pascaligo-855a8af1.mjs +159 -0
- package/lib/perl-6aab1ca2.mjs +600 -0
- package/lib/pgsql-f2266c91.mjs +848 -0
- package/lib/php-9806c791.mjs +472 -0
- package/lib/pla-c1d8ec04.mjs +132 -0
- package/lib/postiats-04d6db22.mjs +545 -0
- package/lib/powerquery-ec4dd65a.mjs +891 -0
- package/lib/powershell-cc02a40e.mjs +234 -0
- package/lib/protobuf-83b8e701.mjs +423 -0
- package/lib/pug-06fecd70.mjs +394 -0
- package/lib/python-7da9e073.mjs +270 -0
- package/lib/qsharp-232171da.mjs +283 -0
- package/lib/r-c048a1d4.mjs +246 -0
- package/lib/razor-c88b46b3.mjs +524 -0
- package/lib/redis-4399e06c.mjs +299 -0
- package/lib/redshift-ba36da77.mjs +807 -0
- package/lib/restructuredtext-cac6fcb7.mjs +163 -0
- package/lib/ruby-dca5ee98.mjs +445 -0
- package/lib/rust-c0b8769e.mjs +338 -0
- package/lib/sb-2b0bce6c.mjs +111 -0
- package/lib/scala-58e9dfc7.mjs +354 -0
- package/lib/scheme-fdc48747.mjs +115 -0
- package/lib/scss-defea6f2.mjs +243 -0
- package/lib/shell-8e11dc85.mjs +225 -0
- package/lib/solidity-8d74b890.mjs +1352 -0
- package/lib/sophia-b97eb718.mjs +191 -0
- package/lib/sparql-68163824.mjs +194 -0
- package/lib/sql-59977475.mjs +819 -0
- package/lib/st-febe75da.mjs +415 -0
- package/lib/style.css +6503 -0
- package/lib/swift-b95bae51.mjs +316 -0
- package/lib/systemverilog-4461e8b3.mjs +557 -0
- package/lib/tcl-8f97c15f.mjs +233 -0
- package/lib/tsMode-934544e6.mjs +1216 -0
- package/lib/twig-a68d494c.mjs +324 -0
- package/lib/typescript-049ec7b9.mjs +339 -0
- package/lib/typings/assets/font/iconfont.d.ts +0 -0
- package/lib/typings/components/BlockSideBar/BlockItem/index.d.ts +9 -0
- package/lib/typings/components/BlockSideBar/BlockList/index.d.ts +5 -0
- package/lib/typings/components/BlockSideBar/BlocksPanel/index.d.ts +2 -0
- package/lib/typings/components/BlockSideBar/LayoutItem/index.d.ts +6 -0
- package/lib/typings/components/BlockSideBar/index.d.ts +5 -0
- package/lib/typings/components/ColumnLayout/LayoutItemList.d.ts +6 -0
- package/lib/typings/components/ColumnLayout/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationDrawer/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Button/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Column/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Divider/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Hero/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Image/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Navbar/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Page/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Section/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Social/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Spacer/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Text/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/Wrapper/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/Elements/index.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundColor.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundImage.d.ts +8 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundPosition.d.ts +8 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Border.d.ts +11 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/BorderRadius.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/ButtonCategory.d.ts +10 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Buttons.d.ts +18 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Columns.d.ts +8 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Direction.d.ts +9 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/Condition.d.ts +9 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/Iteration.d.ts +9 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/index.d.ts +3 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/DividerLine.d.ts +10 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontFamily.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontSize.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontWeight.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/GlobalLink.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Heading.d.ts +7 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Height.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/ImageUrl.d.ts +6 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/ImageWidth.d.ts +7 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/LetterSpacing.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/LineHeight.d.ts +7 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Link.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Padding.d.ts +10 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/PixelAndPercentField.d.ts +11 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/PixelField.d.ts +3 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/StackOnMobile.d.ts +7 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAlign.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAndHeadingList.d.ts +6 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAndHeadingStyle.d.ts +8 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Typography.d.ts +17 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/VerticalAlign.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/WebFonts.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/Width.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributeField/index.d.ts +103 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributePanel.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/components/AttributesPanelWrapper/index.d.ts +8 -0
- package/lib/typings/components/ConfigurationPanel/components/CollapseWrapper/index.d.ts +7 -0
- package/lib/typings/components/ConfigurationPanel/components/ResponsiveTabs/ResponsiveField.d.ts +5 -0
- package/lib/typings/components/ConfigurationPanel/components/ResponsiveTabs/index.d.ts +11 -0
- package/lib/typings/components/ConfigurationPanel/components/SourceCodePanel/index.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/components/UniversalElementPanel/index.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/index.d.ts +8 -0
- package/lib/typings/components/Controller/index.d.ts +3 -0
- package/lib/typings/components/EditorTabs/components/PreviewEmail/components/DesktopEmailPreview/index.d.ts +5 -0
- package/lib/typings/components/EditorTabs/components/PreviewEmail/components/MobilePreview/index.d.ts +5 -0
- package/lib/typings/components/EditorTabs/components/PreviewEmail/index.d.ts +8 -0
- package/lib/typings/components/EditorTabs/components/PreviewEmailDrawer/index.d.ts +4 -0
- package/lib/typings/components/EditorTabs/components/TabHeader/index.d.ts +5 -0
- package/lib/typings/components/EditorTabs/index.d.ts +4 -0
- package/lib/typings/components/Form/ButtonField.d.ts +13 -0
- package/lib/typings/components/Form/ButtonGroupField.d.ts +15 -0
- package/lib/typings/components/Form/ColorPicker/ColorPickerContent.d.ts +7 -0
- package/lib/typings/components/Form/ColorPicker/index.d.ts +14 -0
- package/lib/typings/components/Form/EditPanelListField.d.ts +17 -0
- package/lib/typings/components/Form/EditPanelTabsField.d.ts +13 -0
- package/lib/typings/components/Form/ImageUploaderField/index.d.ts +20 -0
- package/lib/typings/components/Form/RichTextField/index.d.ts +10 -0
- package/lib/typings/components/Form/Select.d.ts +11 -0
- package/lib/typings/components/Form/SwitchField/index.d.ts +5 -0
- package/lib/typings/components/Form/SyncChildrenField.d.ts +11 -0
- package/lib/typings/components/Form/VariablesEditor/VariablesEditorContent.d.ts +7 -0
- package/lib/typings/components/Form/VariablesEditor/index.d.ts +2 -0
- package/lib/typings/components/Form/WatchField.d.ts +11 -0
- package/lib/typings/components/Form/adapter/JsonAdapter.d.ts +4 -0
- package/lib/typings/components/Form/adapter/color.adapter.d.ts +4 -0
- package/lib/typings/components/Form/adapter/fontStyle.adapter.d.ts +4 -0
- package/lib/typings/components/Form/adapter/fontWeight.adapter.d.ts +4 -0
- package/lib/typings/components/Form/adapter/index.d.ts +8 -0
- package/lib/typings/components/Form/adapter/italic.adapter.d.ts +4 -0
- package/lib/typings/components/Form/adapter/pixel.adapter.d.ts +4 -0
- package/lib/typings/components/Form/adapter/pixelNumber.adapter.d.ts +4 -0
- package/lib/typings/components/Form/adapter/slider.adapter.d.ts +4 -0
- package/lib/typings/components/Form/enhancer.d.ts +12 -0
- package/lib/typings/components/Form/index.d.ts +26 -0
- package/lib/typings/components/FullHeightOverlayScrollbars/index.d.ts +9 -0
- package/lib/typings/components/FullScreenLoading/index.d.ts +7 -0
- package/lib/typings/components/Hotkeys/index.d.ts +2 -0
- package/lib/typings/components/HoveringToolbar/RichTextBar.d.ts +6 -0
- package/lib/typings/components/HoveringToolbar/componens/BgColor.d.ts +2 -0
- package/lib/typings/components/HoveringToolbar/componens/FontColor.d.ts +2 -0
- package/lib/typings/components/HoveringToolbar/componens/FontFamily.d.ts +2 -0
- package/lib/typings/components/HoveringToolbar/componens/FontSize.d.ts +2 -0
- package/lib/typings/components/HoveringToolbar/componens/FormatButton.d.ts +9 -0
- package/lib/typings/components/HoveringToolbar/componens/MergeTag.d.ts +8 -0
- package/lib/typings/components/HoveringToolbar/componens/TextAlign.d.ts +2 -0
- package/lib/typings/components/HoveringToolbar/componens/TextLink.d.ts +2 -0
- package/lib/typings/components/HoveringToolbar/componens/TurnInto.d.ts +2 -0
- package/lib/typings/components/HoveringToolbar/constants.d.ts +0 -0
- package/lib/typings/components/HoveringToolbar/index.d.ts +3 -0
- package/lib/typings/components/HoveringToolbar/utils/getLinkNode.d.ts +3 -0
- package/lib/typings/components/IconFont/index.d.ts +10 -0
- package/lib/typings/components/MergeTagComponent/index.d.ts +7 -0
- package/lib/typings/components/MergetagPopover/index.d.ts +2 -0
- package/lib/typings/components/Providers/ControllerProvider.d.ts +4 -0
- package/lib/typings/components/Providers/DraggingProvider.d.ts +20 -0
- package/lib/typings/components/Providers/FormProvider.d.ts +4 -0
- package/lib/typings/components/Providers/UniversalElementProvider.d.ts +10 -0
- package/lib/typings/components/Providers/index.d.ts +6 -0
- package/lib/typings/components/UniversalElementEditorDrawer/index.d.ts +5 -0
- package/lib/typings/components/UnsplashImages/index.d.ts +206 -0
- package/lib/typings/components/index.d.ts +69 -0
- package/lib/typings/hooks/index.d.ts +6 -0
- package/lib/typings/hooks/useDragging.d.ts +15 -0
- package/lib/typings/hooks/useEditorForm.d.ts +12 -0
- package/lib/typings/hooks/useElementDefault.d.ts +9 -0
- package/lib/typings/hooks/useElementInteract.d.ts +6 -0
- package/lib/typings/hooks/useFontFamily.d.ts +7 -0
- package/lib/typings/hooks/useUniversalContent.d.ts +1 -0
- package/lib/typings/index.d.ts +5 -0
- package/lib/typings/store/ColorState.d.ts +9 -0
- package/lib/typings/store/EditorState.d.ts +12 -0
- package/lib/typings/store/Minimalist.d.ts +35 -0
- package/lib/typings/store/index.d.ts +49 -0
- package/lib/typings/themes/Minimalist/components/AutoSelectElement.d.ts +2 -0
- package/lib/typings/themes/Minimalist/components/BlockMenusOverlay/index.d.ts +2 -0
- package/lib/typings/themes/Minimalist/components/BlockResizer/index.d.ts +12 -0
- package/lib/typings/themes/Minimalist/components/ColumnLayoutOverlay/index.d.ts +2 -0
- package/lib/typings/themes/Minimalist/components/ElementHover/index.d.ts +2 -0
- package/lib/typings/themes/Minimalist/components/ElementPlaceholder/index.d.ts +2 -0
- package/lib/typings/themes/Minimalist/components/ElementSelected/index.d.ts +2 -0
- package/lib/typings/themes/Minimalist/components/ElementTools/index.d.ts +8 -0
- package/lib/typings/themes/Minimalist/components/ImageAction/MoreActionsMenusOverlay/index.d.ts +10 -0
- package/lib/typings/themes/Minimalist/components/ImageAction/MoreIcon/index.d.ts +5 -0
- package/lib/typings/themes/Minimalist/components/ImageAction/index.d.ts +7 -0
- package/lib/typings/themes/Minimalist/index.d.ts +10 -0
- package/lib/typings/themes/Minimalist/withTheme.d.ts +4 -0
- package/lib/typings/themes/Retro/components/AutoDeselectElement.d.ts +2 -0
- package/lib/typings/themes/Retro/components/ElementInteract/AddIcon/index.d.ts +2 -0
- package/lib/typings/themes/Retro/components/ElementInteract/DragIcon/index.d.ts +4 -0
- package/lib/typings/themes/Retro/components/ElementInteract/ElementHover/index.d.ts +2 -0
- package/lib/typings/themes/Retro/components/ElementInteract/ElementPlaceholder/index.d.ts +2 -0
- package/lib/typings/themes/Retro/components/ElementInteract/ElementSelected/index.d.ts +2 -0
- package/lib/typings/themes/Retro/components/ElementInteract/ElementTools/index.d.ts +8 -0
- package/lib/typings/themes/Retro/components/ElementInteract/index.d.ts +3 -0
- package/lib/typings/themes/Retro/index.d.ts +10 -0
- package/lib/typings/themes/Retro/withTheme.d.ts +2 -0
- package/lib/typings/themes/index.d.ts +2 -0
- package/lib/typings/typings/custom-types.d.ts +96 -0
- package/lib/typings/typings/index.d.ts +1 -0
- package/lib/typings/utils/Uploader.d.ts +35 -0
- package/lib/typings/utils/environment.d.ts +1 -0
- package/lib/typings/utils/generateLogic.d.ts +3 -0
- package/lib/typings/utils/getElementPageLayout.d.ts +16 -0
- package/lib/typings/utils/getFallbackValue.d.ts +7 -0
- package/lib/typings/utils/hideCursor.d.ts +2 -0
- package/lib/typings/utils/hotkeys.d.ts +18 -0
- package/lib/typings/utils/index.d.ts +2 -0
- package/lib/typings/utils/isValidHttpUrl.d.ts +1 -0
- package/lib/typings/utils/mjmlToJson/HtmlNodeAdapter.d.ts +2 -0
- package/lib/typings/utils/mjmlToJson/basicElementToStandardElement.d.ts +2 -0
- package/lib/typings/utils/mjmlToJson/formatPadding.d.ts +1 -0
- package/lib/typings/utils/mjmlToJson/index.d.ts +2 -0
- package/lib/typings/utils/onDrag.d.ts +10 -0
- package/lib/typings/utils/previewLoadImage.d.ts +1 -0
- package/lib/vb-dfbee74a.mjs +365 -0
- package/lib/xml-c6d1e274.mjs +106 -0
- package/lib/yaml-3c88ef61.mjs +195 -0
- package/package.json +44 -0
|
@@ -0,0 +1,1216 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
var __async = (__this, __arguments, generator) => {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
var fulfilled = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.next(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var rejected = (value) => {
|
|
34
|
+
try {
|
|
35
|
+
step(generator.throw(value));
|
|
36
|
+
} catch (e) {
|
|
37
|
+
reject(e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
import { t as typescriptDefaults, m as monaco_editor_core_star } from "./VariablesEditorContent-08997e30.mjs";
|
|
45
|
+
import "react";
|
|
46
|
+
import "easy-email-pro-core";
|
|
47
|
+
/*!-----------------------------------------------------------------------------
|
|
48
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
49
|
+
* Version: 0.36.1(6c56744c3419458f0dd48864520b759d1a3a1ca8)
|
|
50
|
+
* Released under the MIT license
|
|
51
|
+
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
52
|
+
*-----------------------------------------------------------------------------*/
|
|
53
|
+
var __defProp2 = Object.defineProperty;
|
|
54
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
55
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
56
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
57
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
58
|
+
var __copyProps = (to, from, except, desc) => {
|
|
59
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
60
|
+
for (let key of __getOwnPropNames(from))
|
|
61
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
62
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
63
|
+
}
|
|
64
|
+
return to;
|
|
65
|
+
};
|
|
66
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
67
|
+
var __publicField2 = (obj, key, value) => {
|
|
68
|
+
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
69
|
+
return value;
|
|
70
|
+
};
|
|
71
|
+
var monaco_editor_core_exports = {};
|
|
72
|
+
__reExport(monaco_editor_core_exports, monaco_editor_core_star);
|
|
73
|
+
var WorkerManager = class {
|
|
74
|
+
constructor(_modeId, _defaults) {
|
|
75
|
+
__publicField(this, "_configChangeListener");
|
|
76
|
+
__publicField(this, "_updateExtraLibsToken");
|
|
77
|
+
__publicField(this, "_extraLibsChangeListener");
|
|
78
|
+
__publicField(this, "_worker");
|
|
79
|
+
__publicField(this, "_client");
|
|
80
|
+
this._modeId = _modeId;
|
|
81
|
+
this._defaults = _defaults;
|
|
82
|
+
this._worker = null;
|
|
83
|
+
this._client = null;
|
|
84
|
+
this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
|
|
85
|
+
this._updateExtraLibsToken = 0;
|
|
86
|
+
this._extraLibsChangeListener = this._defaults.onDidExtraLibsChange(() => this._updateExtraLibs());
|
|
87
|
+
}
|
|
88
|
+
dispose() {
|
|
89
|
+
this._configChangeListener.dispose();
|
|
90
|
+
this._extraLibsChangeListener.dispose();
|
|
91
|
+
this._stopWorker();
|
|
92
|
+
}
|
|
93
|
+
_stopWorker() {
|
|
94
|
+
if (this._worker) {
|
|
95
|
+
this._worker.dispose();
|
|
96
|
+
this._worker = null;
|
|
97
|
+
}
|
|
98
|
+
this._client = null;
|
|
99
|
+
}
|
|
100
|
+
_updateExtraLibs() {
|
|
101
|
+
return __async(this, null, function* () {
|
|
102
|
+
if (!this._worker) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const myToken = ++this._updateExtraLibsToken;
|
|
106
|
+
const proxy = yield this._worker.getProxy();
|
|
107
|
+
if (this._updateExtraLibsToken !== myToken) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
proxy.updateExtraLibs(this._defaults.getExtraLibs());
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
_getClient() {
|
|
114
|
+
if (!this._client) {
|
|
115
|
+
this._client = (() => __async(this, null, function* () {
|
|
116
|
+
this._worker = monaco_editor_core_exports.editor.createWebWorker({
|
|
117
|
+
moduleId: "vs/language/typescript/tsWorker",
|
|
118
|
+
label: this._modeId,
|
|
119
|
+
keepIdleModels: true,
|
|
120
|
+
createData: {
|
|
121
|
+
compilerOptions: this._defaults.getCompilerOptions(),
|
|
122
|
+
extraLibs: this._defaults.getExtraLibs(),
|
|
123
|
+
customWorkerPath: this._defaults.workerOptions.customWorkerPath,
|
|
124
|
+
inlayHintsOptions: this._defaults.inlayHintsOptions
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
if (this._defaults.getEagerModelSync()) {
|
|
128
|
+
return yield this._worker.withSyncedResources(monaco_editor_core_exports.editor.getModels().filter((model) => model.getLanguageId() === this._modeId).map((model) => model.uri));
|
|
129
|
+
}
|
|
130
|
+
return yield this._worker.getProxy();
|
|
131
|
+
}))();
|
|
132
|
+
}
|
|
133
|
+
return this._client;
|
|
134
|
+
}
|
|
135
|
+
getLanguageServiceWorker(...resources) {
|
|
136
|
+
return __async(this, null, function* () {
|
|
137
|
+
const client = yield this._getClient();
|
|
138
|
+
if (this._worker) {
|
|
139
|
+
yield this._worker.withSyncedResources(resources);
|
|
140
|
+
}
|
|
141
|
+
return client;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
var libFileSet = {};
|
|
146
|
+
libFileSet["lib.d.ts"] = true;
|
|
147
|
+
libFileSet["lib.dom.d.ts"] = true;
|
|
148
|
+
libFileSet["lib.dom.iterable.d.ts"] = true;
|
|
149
|
+
libFileSet["lib.es2015.collection.d.ts"] = true;
|
|
150
|
+
libFileSet["lib.es2015.core.d.ts"] = true;
|
|
151
|
+
libFileSet["lib.es2015.d.ts"] = true;
|
|
152
|
+
libFileSet["lib.es2015.generator.d.ts"] = true;
|
|
153
|
+
libFileSet["lib.es2015.iterable.d.ts"] = true;
|
|
154
|
+
libFileSet["lib.es2015.promise.d.ts"] = true;
|
|
155
|
+
libFileSet["lib.es2015.proxy.d.ts"] = true;
|
|
156
|
+
libFileSet["lib.es2015.reflect.d.ts"] = true;
|
|
157
|
+
libFileSet["lib.es2015.symbol.d.ts"] = true;
|
|
158
|
+
libFileSet["lib.es2015.symbol.wellknown.d.ts"] = true;
|
|
159
|
+
libFileSet["lib.es2016.array.include.d.ts"] = true;
|
|
160
|
+
libFileSet["lib.es2016.d.ts"] = true;
|
|
161
|
+
libFileSet["lib.es2016.full.d.ts"] = true;
|
|
162
|
+
libFileSet["lib.es2017.d.ts"] = true;
|
|
163
|
+
libFileSet["lib.es2017.full.d.ts"] = true;
|
|
164
|
+
libFileSet["lib.es2017.intl.d.ts"] = true;
|
|
165
|
+
libFileSet["lib.es2017.object.d.ts"] = true;
|
|
166
|
+
libFileSet["lib.es2017.sharedmemory.d.ts"] = true;
|
|
167
|
+
libFileSet["lib.es2017.string.d.ts"] = true;
|
|
168
|
+
libFileSet["lib.es2017.typedarrays.d.ts"] = true;
|
|
169
|
+
libFileSet["lib.es2018.asyncgenerator.d.ts"] = true;
|
|
170
|
+
libFileSet["lib.es2018.asynciterable.d.ts"] = true;
|
|
171
|
+
libFileSet["lib.es2018.d.ts"] = true;
|
|
172
|
+
libFileSet["lib.es2018.full.d.ts"] = true;
|
|
173
|
+
libFileSet["lib.es2018.intl.d.ts"] = true;
|
|
174
|
+
libFileSet["lib.es2018.promise.d.ts"] = true;
|
|
175
|
+
libFileSet["lib.es2018.regexp.d.ts"] = true;
|
|
176
|
+
libFileSet["lib.es2019.array.d.ts"] = true;
|
|
177
|
+
libFileSet["lib.es2019.d.ts"] = true;
|
|
178
|
+
libFileSet["lib.es2019.full.d.ts"] = true;
|
|
179
|
+
libFileSet["lib.es2019.object.d.ts"] = true;
|
|
180
|
+
libFileSet["lib.es2019.string.d.ts"] = true;
|
|
181
|
+
libFileSet["lib.es2019.symbol.d.ts"] = true;
|
|
182
|
+
libFileSet["lib.es2020.bigint.d.ts"] = true;
|
|
183
|
+
libFileSet["lib.es2020.d.ts"] = true;
|
|
184
|
+
libFileSet["lib.es2020.full.d.ts"] = true;
|
|
185
|
+
libFileSet["lib.es2020.intl.d.ts"] = true;
|
|
186
|
+
libFileSet["lib.es2020.promise.d.ts"] = true;
|
|
187
|
+
libFileSet["lib.es2020.sharedmemory.d.ts"] = true;
|
|
188
|
+
libFileSet["lib.es2020.string.d.ts"] = true;
|
|
189
|
+
libFileSet["lib.es2020.symbol.wellknown.d.ts"] = true;
|
|
190
|
+
libFileSet["lib.es2021.d.ts"] = true;
|
|
191
|
+
libFileSet["lib.es2021.full.d.ts"] = true;
|
|
192
|
+
libFileSet["lib.es2021.intl.d.ts"] = true;
|
|
193
|
+
libFileSet["lib.es2021.promise.d.ts"] = true;
|
|
194
|
+
libFileSet["lib.es2021.string.d.ts"] = true;
|
|
195
|
+
libFileSet["lib.es2021.weakref.d.ts"] = true;
|
|
196
|
+
libFileSet["lib.es5.d.ts"] = true;
|
|
197
|
+
libFileSet["lib.es6.d.ts"] = true;
|
|
198
|
+
libFileSet["lib.esnext.d.ts"] = true;
|
|
199
|
+
libFileSet["lib.esnext.full.d.ts"] = true;
|
|
200
|
+
libFileSet["lib.esnext.intl.d.ts"] = true;
|
|
201
|
+
libFileSet["lib.esnext.promise.d.ts"] = true;
|
|
202
|
+
libFileSet["lib.esnext.string.d.ts"] = true;
|
|
203
|
+
libFileSet["lib.esnext.weakref.d.ts"] = true;
|
|
204
|
+
libFileSet["lib.scripthost.d.ts"] = true;
|
|
205
|
+
libFileSet["lib.webworker.d.ts"] = true;
|
|
206
|
+
libFileSet["lib.webworker.importscripts.d.ts"] = true;
|
|
207
|
+
libFileSet["lib.webworker.iterable.d.ts"] = true;
|
|
208
|
+
function flattenDiagnosticMessageText(diag, newLine, indent = 0) {
|
|
209
|
+
if (typeof diag === "string") {
|
|
210
|
+
return diag;
|
|
211
|
+
} else if (diag === void 0) {
|
|
212
|
+
return "";
|
|
213
|
+
}
|
|
214
|
+
let result = "";
|
|
215
|
+
if (indent) {
|
|
216
|
+
result += newLine;
|
|
217
|
+
for (let i = 0; i < indent; i++) {
|
|
218
|
+
result += " ";
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
result += diag.messageText;
|
|
222
|
+
indent++;
|
|
223
|
+
if (diag.next) {
|
|
224
|
+
for (const kid of diag.next) {
|
|
225
|
+
result += flattenDiagnosticMessageText(kid, newLine, indent);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return result;
|
|
229
|
+
}
|
|
230
|
+
function displayPartsToString(displayParts) {
|
|
231
|
+
if (displayParts) {
|
|
232
|
+
return displayParts.map((displayPart) => displayPart.text).join("");
|
|
233
|
+
}
|
|
234
|
+
return "";
|
|
235
|
+
}
|
|
236
|
+
var Adapter = class {
|
|
237
|
+
constructor(_worker) {
|
|
238
|
+
this._worker = _worker;
|
|
239
|
+
}
|
|
240
|
+
_textSpanToRange(model, span) {
|
|
241
|
+
let p1 = model.getPositionAt(span.start);
|
|
242
|
+
let p2 = model.getPositionAt(span.start + span.length);
|
|
243
|
+
let { lineNumber: startLineNumber, column: startColumn } = p1;
|
|
244
|
+
let { lineNumber: endLineNumber, column: endColumn } = p2;
|
|
245
|
+
return { startLineNumber, startColumn, endLineNumber, endColumn };
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
var LibFiles = class {
|
|
249
|
+
constructor(_worker) {
|
|
250
|
+
__publicField(this, "_libFiles");
|
|
251
|
+
__publicField(this, "_hasFetchedLibFiles");
|
|
252
|
+
__publicField(this, "_fetchLibFilesPromise");
|
|
253
|
+
this._worker = _worker;
|
|
254
|
+
this._libFiles = {};
|
|
255
|
+
this._hasFetchedLibFiles = false;
|
|
256
|
+
this._fetchLibFilesPromise = null;
|
|
257
|
+
}
|
|
258
|
+
isLibFile(uri) {
|
|
259
|
+
if (!uri) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
if (uri.path.indexOf("/lib.") === 0) {
|
|
263
|
+
return !!libFileSet[uri.path.slice(1)];
|
|
264
|
+
}
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
getOrCreateModel(fileName) {
|
|
268
|
+
const uri = monaco_editor_core_exports.Uri.parse(fileName);
|
|
269
|
+
const model = monaco_editor_core_exports.editor.getModel(uri);
|
|
270
|
+
if (model) {
|
|
271
|
+
return model;
|
|
272
|
+
}
|
|
273
|
+
if (this.isLibFile(uri) && this._hasFetchedLibFiles) {
|
|
274
|
+
return monaco_editor_core_exports.editor.createModel(this._libFiles[uri.path.slice(1)], "typescript", uri);
|
|
275
|
+
}
|
|
276
|
+
const matchedLibFile = typescriptDefaults.getExtraLibs()[fileName];
|
|
277
|
+
if (matchedLibFile) {
|
|
278
|
+
return monaco_editor_core_exports.editor.createModel(matchedLibFile.content, "typescript", uri);
|
|
279
|
+
}
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
_containsLibFile(uris) {
|
|
283
|
+
for (let uri of uris) {
|
|
284
|
+
if (this.isLibFile(uri)) {
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
fetchLibFilesIfNecessary(uris) {
|
|
291
|
+
return __async(this, null, function* () {
|
|
292
|
+
if (!this._containsLibFile(uris)) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
yield this._fetchLibFiles();
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
_fetchLibFiles() {
|
|
299
|
+
if (!this._fetchLibFilesPromise) {
|
|
300
|
+
this._fetchLibFilesPromise = this._worker().then((w) => w.getLibFiles()).then((libFiles) => {
|
|
301
|
+
this._hasFetchedLibFiles = true;
|
|
302
|
+
this._libFiles = libFiles;
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
return this._fetchLibFilesPromise;
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
var DiagnosticsAdapter = class extends Adapter {
|
|
309
|
+
constructor(_libFiles, _defaults, _selector, worker) {
|
|
310
|
+
super(worker);
|
|
311
|
+
__publicField(this, "_disposables", []);
|
|
312
|
+
__publicField(this, "_listener", /* @__PURE__ */ Object.create(null));
|
|
313
|
+
this._libFiles = _libFiles;
|
|
314
|
+
this._defaults = _defaults;
|
|
315
|
+
this._selector = _selector;
|
|
316
|
+
const onModelAdd = (model) => {
|
|
317
|
+
if (model.getLanguageId() !== _selector) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
const maybeValidate = () => {
|
|
321
|
+
const { onlyVisible } = this._defaults.getDiagnosticsOptions();
|
|
322
|
+
if (onlyVisible) {
|
|
323
|
+
if (model.isAttachedToEditor()) {
|
|
324
|
+
this._doValidate(model);
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
this._doValidate(model);
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
let handle;
|
|
331
|
+
const changeSubscription = model.onDidChangeContent(() => {
|
|
332
|
+
clearTimeout(handle);
|
|
333
|
+
handle = window.setTimeout(maybeValidate, 500);
|
|
334
|
+
});
|
|
335
|
+
const visibleSubscription = model.onDidChangeAttached(() => {
|
|
336
|
+
const { onlyVisible } = this._defaults.getDiagnosticsOptions();
|
|
337
|
+
if (onlyVisible) {
|
|
338
|
+
if (model.isAttachedToEditor()) {
|
|
339
|
+
maybeValidate();
|
|
340
|
+
} else {
|
|
341
|
+
monaco_editor_core_exports.editor.setModelMarkers(model, this._selector, []);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
this._listener[model.uri.toString()] = {
|
|
346
|
+
dispose() {
|
|
347
|
+
changeSubscription.dispose();
|
|
348
|
+
visibleSubscription.dispose();
|
|
349
|
+
clearTimeout(handle);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
maybeValidate();
|
|
353
|
+
};
|
|
354
|
+
const onModelRemoved = (model) => {
|
|
355
|
+
monaco_editor_core_exports.editor.setModelMarkers(model, this._selector, []);
|
|
356
|
+
const key = model.uri.toString();
|
|
357
|
+
if (this._listener[key]) {
|
|
358
|
+
this._listener[key].dispose();
|
|
359
|
+
delete this._listener[key];
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
this._disposables.push(monaco_editor_core_exports.editor.onDidCreateModel((model) => onModelAdd(model)));
|
|
363
|
+
this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel(onModelRemoved));
|
|
364
|
+
this._disposables.push(monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
|
|
365
|
+
onModelRemoved(event.model);
|
|
366
|
+
onModelAdd(event.model);
|
|
367
|
+
}));
|
|
368
|
+
this._disposables.push({
|
|
369
|
+
dispose() {
|
|
370
|
+
for (const model of monaco_editor_core_exports.editor.getModels()) {
|
|
371
|
+
onModelRemoved(model);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
const recomputeDiagostics = () => {
|
|
376
|
+
for (const model of monaco_editor_core_exports.editor.getModels()) {
|
|
377
|
+
onModelRemoved(model);
|
|
378
|
+
onModelAdd(model);
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
this._disposables.push(this._defaults.onDidChange(recomputeDiagostics));
|
|
382
|
+
this._disposables.push(this._defaults.onDidExtraLibsChange(recomputeDiagostics));
|
|
383
|
+
monaco_editor_core_exports.editor.getModels().forEach((model) => onModelAdd(model));
|
|
384
|
+
}
|
|
385
|
+
dispose() {
|
|
386
|
+
this._disposables.forEach((d) => d && d.dispose());
|
|
387
|
+
this._disposables = [];
|
|
388
|
+
}
|
|
389
|
+
_doValidate(model) {
|
|
390
|
+
return __async(this, null, function* () {
|
|
391
|
+
const worker = yield this._worker(model.uri);
|
|
392
|
+
if (model.isDisposed()) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const promises = [];
|
|
396
|
+
const { noSyntaxValidation, noSemanticValidation, noSuggestionDiagnostics } = this._defaults.getDiagnosticsOptions();
|
|
397
|
+
if (!noSyntaxValidation) {
|
|
398
|
+
promises.push(worker.getSyntacticDiagnostics(model.uri.toString()));
|
|
399
|
+
}
|
|
400
|
+
if (!noSemanticValidation) {
|
|
401
|
+
promises.push(worker.getSemanticDiagnostics(model.uri.toString()));
|
|
402
|
+
}
|
|
403
|
+
if (!noSuggestionDiagnostics) {
|
|
404
|
+
promises.push(worker.getSuggestionDiagnostics(model.uri.toString()));
|
|
405
|
+
}
|
|
406
|
+
const allDiagnostics = yield Promise.all(promises);
|
|
407
|
+
if (!allDiagnostics || model.isDisposed()) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
const diagnostics = allDiagnostics.reduce((p, c) => c.concat(p), []).filter((d) => (this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(d.code) === -1);
|
|
411
|
+
const relatedUris = diagnostics.map((d) => d.relatedInformation || []).reduce((p, c) => c.concat(p), []).map((relatedInformation) => relatedInformation.file ? monaco_editor_core_exports.Uri.parse(relatedInformation.file.fileName) : null);
|
|
412
|
+
yield this._libFiles.fetchLibFilesIfNecessary(relatedUris);
|
|
413
|
+
if (model.isDisposed()) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
monaco_editor_core_exports.editor.setModelMarkers(model, this._selector, diagnostics.map((d) => this._convertDiagnostics(model, d)));
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
_convertDiagnostics(model, diag) {
|
|
420
|
+
const diagStart = diag.start || 0;
|
|
421
|
+
const diagLength = diag.length || 1;
|
|
422
|
+
const { lineNumber: startLineNumber, column: startColumn } = model.getPositionAt(diagStart);
|
|
423
|
+
const { lineNumber: endLineNumber, column: endColumn } = model.getPositionAt(diagStart + diagLength);
|
|
424
|
+
const tags = [];
|
|
425
|
+
if (diag.reportsUnnecessary) {
|
|
426
|
+
tags.push(monaco_editor_core_exports.MarkerTag.Unnecessary);
|
|
427
|
+
}
|
|
428
|
+
if (diag.reportsDeprecated) {
|
|
429
|
+
tags.push(monaco_editor_core_exports.MarkerTag.Deprecated);
|
|
430
|
+
}
|
|
431
|
+
return {
|
|
432
|
+
severity: this._tsDiagnosticCategoryToMarkerSeverity(diag.category),
|
|
433
|
+
startLineNumber,
|
|
434
|
+
startColumn,
|
|
435
|
+
endLineNumber,
|
|
436
|
+
endColumn,
|
|
437
|
+
message: flattenDiagnosticMessageText(diag.messageText, "\n"),
|
|
438
|
+
code: diag.code.toString(),
|
|
439
|
+
tags,
|
|
440
|
+
relatedInformation: this._convertRelatedInformation(model, diag.relatedInformation)
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
_convertRelatedInformation(model, relatedInformation) {
|
|
444
|
+
if (!relatedInformation) {
|
|
445
|
+
return [];
|
|
446
|
+
}
|
|
447
|
+
const result = [];
|
|
448
|
+
relatedInformation.forEach((info) => {
|
|
449
|
+
let relatedResource = model;
|
|
450
|
+
if (info.file) {
|
|
451
|
+
relatedResource = this._libFiles.getOrCreateModel(info.file.fileName);
|
|
452
|
+
}
|
|
453
|
+
if (!relatedResource) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
const infoStart = info.start || 0;
|
|
457
|
+
const infoLength = info.length || 1;
|
|
458
|
+
const { lineNumber: startLineNumber, column: startColumn } = relatedResource.getPositionAt(infoStart);
|
|
459
|
+
const { lineNumber: endLineNumber, column: endColumn } = relatedResource.getPositionAt(infoStart + infoLength);
|
|
460
|
+
result.push({
|
|
461
|
+
resource: relatedResource.uri,
|
|
462
|
+
startLineNumber,
|
|
463
|
+
startColumn,
|
|
464
|
+
endLineNumber,
|
|
465
|
+
endColumn,
|
|
466
|
+
message: flattenDiagnosticMessageText(info.messageText, "\n")
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
return result;
|
|
470
|
+
}
|
|
471
|
+
_tsDiagnosticCategoryToMarkerSeverity(category) {
|
|
472
|
+
switch (category) {
|
|
473
|
+
case 1:
|
|
474
|
+
return monaco_editor_core_exports.MarkerSeverity.Error;
|
|
475
|
+
case 3:
|
|
476
|
+
return monaco_editor_core_exports.MarkerSeverity.Info;
|
|
477
|
+
case 0:
|
|
478
|
+
return monaco_editor_core_exports.MarkerSeverity.Warning;
|
|
479
|
+
case 2:
|
|
480
|
+
return monaco_editor_core_exports.MarkerSeverity.Hint;
|
|
481
|
+
}
|
|
482
|
+
return monaco_editor_core_exports.MarkerSeverity.Info;
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
var SuggestAdapter = class extends Adapter {
|
|
486
|
+
get triggerCharacters() {
|
|
487
|
+
return ["."];
|
|
488
|
+
}
|
|
489
|
+
provideCompletionItems(model, position, _context, token) {
|
|
490
|
+
return __async(this, null, function* () {
|
|
491
|
+
const wordInfo = model.getWordUntilPosition(position);
|
|
492
|
+
const wordRange = new monaco_editor_core_exports.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
493
|
+
const resource = model.uri;
|
|
494
|
+
const offset = model.getOffsetAt(position);
|
|
495
|
+
const worker = yield this._worker(resource);
|
|
496
|
+
if (model.isDisposed()) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
const info = yield worker.getCompletionsAtPosition(resource.toString(), offset);
|
|
500
|
+
if (!info || model.isDisposed()) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const suggestions = info.entries.map((entry) => {
|
|
504
|
+
let range = wordRange;
|
|
505
|
+
if (entry.replacementSpan) {
|
|
506
|
+
const p1 = model.getPositionAt(entry.replacementSpan.start);
|
|
507
|
+
const p2 = model.getPositionAt(entry.replacementSpan.start + entry.replacementSpan.length);
|
|
508
|
+
range = new monaco_editor_core_exports.Range(p1.lineNumber, p1.column, p2.lineNumber, p2.column);
|
|
509
|
+
}
|
|
510
|
+
const tags = [];
|
|
511
|
+
if (entry.kindModifiers !== void 0 && entry.kindModifiers.indexOf("deprecated") !== -1) {
|
|
512
|
+
tags.push(monaco_editor_core_exports.languages.CompletionItemTag.Deprecated);
|
|
513
|
+
}
|
|
514
|
+
return {
|
|
515
|
+
uri: resource,
|
|
516
|
+
position,
|
|
517
|
+
offset,
|
|
518
|
+
range,
|
|
519
|
+
label: entry.name,
|
|
520
|
+
insertText: entry.name,
|
|
521
|
+
sortText: entry.sortText,
|
|
522
|
+
kind: SuggestAdapter.convertKind(entry.kind),
|
|
523
|
+
tags
|
|
524
|
+
};
|
|
525
|
+
});
|
|
526
|
+
return {
|
|
527
|
+
suggestions
|
|
528
|
+
};
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
resolveCompletionItem(item, token) {
|
|
532
|
+
return __async(this, null, function* () {
|
|
533
|
+
const myItem = item;
|
|
534
|
+
const resource = myItem.uri;
|
|
535
|
+
const position = myItem.position;
|
|
536
|
+
const offset = myItem.offset;
|
|
537
|
+
const worker = yield this._worker(resource);
|
|
538
|
+
const details = yield worker.getCompletionEntryDetails(resource.toString(), offset, myItem.label);
|
|
539
|
+
if (!details) {
|
|
540
|
+
return myItem;
|
|
541
|
+
}
|
|
542
|
+
return {
|
|
543
|
+
uri: resource,
|
|
544
|
+
position,
|
|
545
|
+
label: details.name,
|
|
546
|
+
kind: SuggestAdapter.convertKind(details.kind),
|
|
547
|
+
detail: displayPartsToString(details.displayParts),
|
|
548
|
+
documentation: {
|
|
549
|
+
value: SuggestAdapter.createDocumentationString(details)
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
static convertKind(kind) {
|
|
555
|
+
switch (kind) {
|
|
556
|
+
case Kind.primitiveType:
|
|
557
|
+
case Kind.keyword:
|
|
558
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Keyword;
|
|
559
|
+
case Kind.variable:
|
|
560
|
+
case Kind.localVariable:
|
|
561
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Variable;
|
|
562
|
+
case Kind.memberVariable:
|
|
563
|
+
case Kind.memberGetAccessor:
|
|
564
|
+
case Kind.memberSetAccessor:
|
|
565
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Field;
|
|
566
|
+
case Kind.function:
|
|
567
|
+
case Kind.memberFunction:
|
|
568
|
+
case Kind.constructSignature:
|
|
569
|
+
case Kind.callSignature:
|
|
570
|
+
case Kind.indexSignature:
|
|
571
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Function;
|
|
572
|
+
case Kind.enum:
|
|
573
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Enum;
|
|
574
|
+
case Kind.module:
|
|
575
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Module;
|
|
576
|
+
case Kind.class:
|
|
577
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Class;
|
|
578
|
+
case Kind.interface:
|
|
579
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Interface;
|
|
580
|
+
case Kind.warning:
|
|
581
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.File;
|
|
582
|
+
}
|
|
583
|
+
return monaco_editor_core_exports.languages.CompletionItemKind.Property;
|
|
584
|
+
}
|
|
585
|
+
static createDocumentationString(details) {
|
|
586
|
+
let documentationString = displayPartsToString(details.documentation);
|
|
587
|
+
if (details.tags) {
|
|
588
|
+
for (const tag of details.tags) {
|
|
589
|
+
documentationString += `
|
|
590
|
+
|
|
591
|
+
${tagToString(tag)}`;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
return documentationString;
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
function tagToString(tag) {
|
|
598
|
+
let tagLabel = `*@${tag.name}*`;
|
|
599
|
+
if (tag.name === "param" && tag.text) {
|
|
600
|
+
const [paramName, ...rest] = tag.text;
|
|
601
|
+
tagLabel += `\`${paramName.text}\``;
|
|
602
|
+
if (rest.length > 0)
|
|
603
|
+
tagLabel += ` — ${rest.map((r) => r.text).join(" ")}`;
|
|
604
|
+
} else if (Array.isArray(tag.text)) {
|
|
605
|
+
tagLabel += ` — ${tag.text.map((r) => r.text).join(" ")}`;
|
|
606
|
+
} else if (tag.text) {
|
|
607
|
+
tagLabel += ` — ${tag.text}`;
|
|
608
|
+
}
|
|
609
|
+
return tagLabel;
|
|
610
|
+
}
|
|
611
|
+
var SignatureHelpAdapter = class extends Adapter {
|
|
612
|
+
constructor() {
|
|
613
|
+
super(...arguments);
|
|
614
|
+
__publicField(this, "signatureHelpTriggerCharacters", ["(", ","]);
|
|
615
|
+
}
|
|
616
|
+
static _toSignatureHelpTriggerReason(context) {
|
|
617
|
+
switch (context.triggerKind) {
|
|
618
|
+
case monaco_editor_core_exports.languages.SignatureHelpTriggerKind.TriggerCharacter:
|
|
619
|
+
if (context.triggerCharacter) {
|
|
620
|
+
if (context.isRetrigger) {
|
|
621
|
+
return { kind: "retrigger", triggerCharacter: context.triggerCharacter };
|
|
622
|
+
} else {
|
|
623
|
+
return { kind: "characterTyped", triggerCharacter: context.triggerCharacter };
|
|
624
|
+
}
|
|
625
|
+
} else {
|
|
626
|
+
return { kind: "invoked" };
|
|
627
|
+
}
|
|
628
|
+
case monaco_editor_core_exports.languages.SignatureHelpTriggerKind.ContentChange:
|
|
629
|
+
return context.isRetrigger ? { kind: "retrigger" } : { kind: "invoked" };
|
|
630
|
+
case monaco_editor_core_exports.languages.SignatureHelpTriggerKind.Invoke:
|
|
631
|
+
default:
|
|
632
|
+
return { kind: "invoked" };
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
provideSignatureHelp(model, position, token, context) {
|
|
636
|
+
return __async(this, null, function* () {
|
|
637
|
+
const resource = model.uri;
|
|
638
|
+
const offset = model.getOffsetAt(position);
|
|
639
|
+
const worker = yield this._worker(resource);
|
|
640
|
+
if (model.isDisposed()) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
const info = yield worker.getSignatureHelpItems(resource.toString(), offset, {
|
|
644
|
+
triggerReason: SignatureHelpAdapter._toSignatureHelpTriggerReason(context)
|
|
645
|
+
});
|
|
646
|
+
if (!info || model.isDisposed()) {
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
const ret = {
|
|
650
|
+
activeSignature: info.selectedItemIndex,
|
|
651
|
+
activeParameter: info.argumentIndex,
|
|
652
|
+
signatures: []
|
|
653
|
+
};
|
|
654
|
+
info.items.forEach((item) => {
|
|
655
|
+
const signature = {
|
|
656
|
+
label: "",
|
|
657
|
+
parameters: []
|
|
658
|
+
};
|
|
659
|
+
signature.documentation = {
|
|
660
|
+
value: displayPartsToString(item.documentation)
|
|
661
|
+
};
|
|
662
|
+
signature.label += displayPartsToString(item.prefixDisplayParts);
|
|
663
|
+
item.parameters.forEach((p, i, a) => {
|
|
664
|
+
const label = displayPartsToString(p.displayParts);
|
|
665
|
+
const parameter = {
|
|
666
|
+
label,
|
|
667
|
+
documentation: {
|
|
668
|
+
value: displayPartsToString(p.documentation)
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
signature.label += label;
|
|
672
|
+
signature.parameters.push(parameter);
|
|
673
|
+
if (i < a.length - 1) {
|
|
674
|
+
signature.label += displayPartsToString(item.separatorDisplayParts);
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
signature.label += displayPartsToString(item.suffixDisplayParts);
|
|
678
|
+
ret.signatures.push(signature);
|
|
679
|
+
});
|
|
680
|
+
return {
|
|
681
|
+
value: ret,
|
|
682
|
+
dispose() {
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
var QuickInfoAdapter = class extends Adapter {
|
|
689
|
+
provideHover(model, position, token) {
|
|
690
|
+
return __async(this, null, function* () {
|
|
691
|
+
const resource = model.uri;
|
|
692
|
+
const offset = model.getOffsetAt(position);
|
|
693
|
+
const worker = yield this._worker(resource);
|
|
694
|
+
if (model.isDisposed()) {
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
const info = yield worker.getQuickInfoAtPosition(resource.toString(), offset);
|
|
698
|
+
if (!info || model.isDisposed()) {
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
const documentation = displayPartsToString(info.documentation);
|
|
702
|
+
const tags = info.tags ? info.tags.map((tag) => tagToString(tag)).join(" \n\n") : "";
|
|
703
|
+
const contents = displayPartsToString(info.displayParts);
|
|
704
|
+
return {
|
|
705
|
+
range: this._textSpanToRange(model, info.textSpan),
|
|
706
|
+
contents: [
|
|
707
|
+
{
|
|
708
|
+
value: "```typescript\n" + contents + "\n```\n"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
value: documentation + (tags ? "\n\n" + tags : "")
|
|
712
|
+
}
|
|
713
|
+
]
|
|
714
|
+
};
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
var OccurrencesAdapter = class extends Adapter {
|
|
719
|
+
provideDocumentHighlights(model, position, token) {
|
|
720
|
+
return __async(this, null, function* () {
|
|
721
|
+
const resource = model.uri;
|
|
722
|
+
const offset = model.getOffsetAt(position);
|
|
723
|
+
const worker = yield this._worker(resource);
|
|
724
|
+
if (model.isDisposed()) {
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
const entries = yield worker.getOccurrencesAtPosition(resource.toString(), offset);
|
|
728
|
+
if (!entries || model.isDisposed()) {
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
return entries.map((entry) => {
|
|
732
|
+
return {
|
|
733
|
+
range: this._textSpanToRange(model, entry.textSpan),
|
|
734
|
+
kind: entry.isWriteAccess ? monaco_editor_core_exports.languages.DocumentHighlightKind.Write : monaco_editor_core_exports.languages.DocumentHighlightKind.Text
|
|
735
|
+
};
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
var DefinitionAdapter = class extends Adapter {
|
|
741
|
+
constructor(_libFiles, worker) {
|
|
742
|
+
super(worker);
|
|
743
|
+
this._libFiles = _libFiles;
|
|
744
|
+
}
|
|
745
|
+
provideDefinition(model, position, token) {
|
|
746
|
+
return __async(this, null, function* () {
|
|
747
|
+
const resource = model.uri;
|
|
748
|
+
const offset = model.getOffsetAt(position);
|
|
749
|
+
const worker = yield this._worker(resource);
|
|
750
|
+
if (model.isDisposed()) {
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
const entries = yield worker.getDefinitionAtPosition(resource.toString(), offset);
|
|
754
|
+
if (!entries || model.isDisposed()) {
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
yield this._libFiles.fetchLibFilesIfNecessary(entries.map((entry) => monaco_editor_core_exports.Uri.parse(entry.fileName)));
|
|
758
|
+
if (model.isDisposed()) {
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
const result = [];
|
|
762
|
+
for (let entry of entries) {
|
|
763
|
+
const refModel = this._libFiles.getOrCreateModel(entry.fileName);
|
|
764
|
+
if (refModel) {
|
|
765
|
+
result.push({
|
|
766
|
+
uri: refModel.uri,
|
|
767
|
+
range: this._textSpanToRange(refModel, entry.textSpan)
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
return result;
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
var ReferenceAdapter = class extends Adapter {
|
|
776
|
+
constructor(_libFiles, worker) {
|
|
777
|
+
super(worker);
|
|
778
|
+
this._libFiles = _libFiles;
|
|
779
|
+
}
|
|
780
|
+
provideReferences(model, position, context, token) {
|
|
781
|
+
return __async(this, null, function* () {
|
|
782
|
+
const resource = model.uri;
|
|
783
|
+
const offset = model.getOffsetAt(position);
|
|
784
|
+
const worker = yield this._worker(resource);
|
|
785
|
+
if (model.isDisposed()) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
const entries = yield worker.getReferencesAtPosition(resource.toString(), offset);
|
|
789
|
+
if (!entries || model.isDisposed()) {
|
|
790
|
+
return;
|
|
791
|
+
}
|
|
792
|
+
yield this._libFiles.fetchLibFilesIfNecessary(entries.map((entry) => monaco_editor_core_exports.Uri.parse(entry.fileName)));
|
|
793
|
+
if (model.isDisposed()) {
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
const result = [];
|
|
797
|
+
for (let entry of entries) {
|
|
798
|
+
const refModel = this._libFiles.getOrCreateModel(entry.fileName);
|
|
799
|
+
if (refModel) {
|
|
800
|
+
result.push({
|
|
801
|
+
uri: refModel.uri,
|
|
802
|
+
range: this._textSpanToRange(refModel, entry.textSpan)
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return result;
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
var OutlineAdapter = class extends Adapter {
|
|
811
|
+
provideDocumentSymbols(model, token) {
|
|
812
|
+
return __async(this, null, function* () {
|
|
813
|
+
const resource = model.uri;
|
|
814
|
+
const worker = yield this._worker(resource);
|
|
815
|
+
if (model.isDisposed()) {
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
const items = yield worker.getNavigationBarItems(resource.toString());
|
|
819
|
+
if (!items || model.isDisposed()) {
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
const convert = (bucket, item, containerLabel) => {
|
|
823
|
+
let result2 = {
|
|
824
|
+
name: item.text,
|
|
825
|
+
detail: "",
|
|
826
|
+
kind: outlineTypeTable[item.kind] || monaco_editor_core_exports.languages.SymbolKind.Variable,
|
|
827
|
+
range: this._textSpanToRange(model, item.spans[0]),
|
|
828
|
+
selectionRange: this._textSpanToRange(model, item.spans[0]),
|
|
829
|
+
tags: []
|
|
830
|
+
};
|
|
831
|
+
if (containerLabel)
|
|
832
|
+
result2.containerName = containerLabel;
|
|
833
|
+
if (item.childItems && item.childItems.length > 0) {
|
|
834
|
+
for (let child of item.childItems) {
|
|
835
|
+
convert(bucket, child, result2.name);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
bucket.push(result2);
|
|
839
|
+
};
|
|
840
|
+
let result = [];
|
|
841
|
+
items.forEach((item) => convert(result, item));
|
|
842
|
+
return result;
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
var Kind = class {
|
|
847
|
+
};
|
|
848
|
+
__publicField2(Kind, "unknown", "");
|
|
849
|
+
__publicField2(Kind, "keyword", "keyword");
|
|
850
|
+
__publicField2(Kind, "script", "script");
|
|
851
|
+
__publicField2(Kind, "module", "module");
|
|
852
|
+
__publicField2(Kind, "class", "class");
|
|
853
|
+
__publicField2(Kind, "interface", "interface");
|
|
854
|
+
__publicField2(Kind, "type", "type");
|
|
855
|
+
__publicField2(Kind, "enum", "enum");
|
|
856
|
+
__publicField2(Kind, "variable", "var");
|
|
857
|
+
__publicField2(Kind, "localVariable", "local var");
|
|
858
|
+
__publicField2(Kind, "function", "function");
|
|
859
|
+
__publicField2(Kind, "localFunction", "local function");
|
|
860
|
+
__publicField2(Kind, "memberFunction", "method");
|
|
861
|
+
__publicField2(Kind, "memberGetAccessor", "getter");
|
|
862
|
+
__publicField2(Kind, "memberSetAccessor", "setter");
|
|
863
|
+
__publicField2(Kind, "memberVariable", "property");
|
|
864
|
+
__publicField2(Kind, "constructorImplementation", "constructor");
|
|
865
|
+
__publicField2(Kind, "callSignature", "call");
|
|
866
|
+
__publicField2(Kind, "indexSignature", "index");
|
|
867
|
+
__publicField2(Kind, "constructSignature", "construct");
|
|
868
|
+
__publicField2(Kind, "parameter", "parameter");
|
|
869
|
+
__publicField2(Kind, "typeParameter", "type parameter");
|
|
870
|
+
__publicField2(Kind, "primitiveType", "primitive type");
|
|
871
|
+
__publicField2(Kind, "label", "label");
|
|
872
|
+
__publicField2(Kind, "alias", "alias");
|
|
873
|
+
__publicField2(Kind, "const", "const");
|
|
874
|
+
__publicField2(Kind, "let", "let");
|
|
875
|
+
__publicField2(Kind, "warning", "warning");
|
|
876
|
+
var outlineTypeTable = /* @__PURE__ */ Object.create(null);
|
|
877
|
+
outlineTypeTable[Kind.module] = monaco_editor_core_exports.languages.SymbolKind.Module;
|
|
878
|
+
outlineTypeTable[Kind.class] = monaco_editor_core_exports.languages.SymbolKind.Class;
|
|
879
|
+
outlineTypeTable[Kind.enum] = monaco_editor_core_exports.languages.SymbolKind.Enum;
|
|
880
|
+
outlineTypeTable[Kind.interface] = monaco_editor_core_exports.languages.SymbolKind.Interface;
|
|
881
|
+
outlineTypeTable[Kind.memberFunction] = monaco_editor_core_exports.languages.SymbolKind.Method;
|
|
882
|
+
outlineTypeTable[Kind.memberVariable] = monaco_editor_core_exports.languages.SymbolKind.Property;
|
|
883
|
+
outlineTypeTable[Kind.memberGetAccessor] = monaco_editor_core_exports.languages.SymbolKind.Property;
|
|
884
|
+
outlineTypeTable[Kind.memberSetAccessor] = monaco_editor_core_exports.languages.SymbolKind.Property;
|
|
885
|
+
outlineTypeTable[Kind.variable] = monaco_editor_core_exports.languages.SymbolKind.Variable;
|
|
886
|
+
outlineTypeTable[Kind.const] = monaco_editor_core_exports.languages.SymbolKind.Variable;
|
|
887
|
+
outlineTypeTable[Kind.localVariable] = monaco_editor_core_exports.languages.SymbolKind.Variable;
|
|
888
|
+
outlineTypeTable[Kind.variable] = monaco_editor_core_exports.languages.SymbolKind.Variable;
|
|
889
|
+
outlineTypeTable[Kind.function] = monaco_editor_core_exports.languages.SymbolKind.Function;
|
|
890
|
+
outlineTypeTable[Kind.localFunction] = monaco_editor_core_exports.languages.SymbolKind.Function;
|
|
891
|
+
var FormatHelper = class extends Adapter {
|
|
892
|
+
static _convertOptions(options) {
|
|
893
|
+
return {
|
|
894
|
+
ConvertTabsToSpaces: options.insertSpaces,
|
|
895
|
+
TabSize: options.tabSize,
|
|
896
|
+
IndentSize: options.tabSize,
|
|
897
|
+
IndentStyle: 2,
|
|
898
|
+
NewLineCharacter: "\n",
|
|
899
|
+
InsertSpaceAfterCommaDelimiter: true,
|
|
900
|
+
InsertSpaceAfterSemicolonInForStatements: true,
|
|
901
|
+
InsertSpaceBeforeAndAfterBinaryOperators: true,
|
|
902
|
+
InsertSpaceAfterKeywordsInControlFlowStatements: true,
|
|
903
|
+
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: true,
|
|
904
|
+
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,
|
|
905
|
+
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,
|
|
906
|
+
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
|
|
907
|
+
PlaceOpenBraceOnNewLineForControlBlocks: false,
|
|
908
|
+
PlaceOpenBraceOnNewLineForFunctions: false
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
_convertTextChanges(model, change) {
|
|
912
|
+
return {
|
|
913
|
+
text: change.newText,
|
|
914
|
+
range: this._textSpanToRange(model, change.span)
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
var FormatAdapter = class extends FormatHelper {
|
|
919
|
+
provideDocumentRangeFormattingEdits(model, range, options, token) {
|
|
920
|
+
return __async(this, null, function* () {
|
|
921
|
+
const resource = model.uri;
|
|
922
|
+
const startOffset = model.getOffsetAt({
|
|
923
|
+
lineNumber: range.startLineNumber,
|
|
924
|
+
column: range.startColumn
|
|
925
|
+
});
|
|
926
|
+
const endOffset = model.getOffsetAt({
|
|
927
|
+
lineNumber: range.endLineNumber,
|
|
928
|
+
column: range.endColumn
|
|
929
|
+
});
|
|
930
|
+
const worker = yield this._worker(resource);
|
|
931
|
+
if (model.isDisposed()) {
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
const edits = yield worker.getFormattingEditsForRange(resource.toString(), startOffset, endOffset, FormatHelper._convertOptions(options));
|
|
935
|
+
if (!edits || model.isDisposed()) {
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
return edits.map((edit) => this._convertTextChanges(model, edit));
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
var FormatOnTypeAdapter = class extends FormatHelper {
|
|
943
|
+
get autoFormatTriggerCharacters() {
|
|
944
|
+
return [";", "}", "\n"];
|
|
945
|
+
}
|
|
946
|
+
provideOnTypeFormattingEdits(model, position, ch, options, token) {
|
|
947
|
+
return __async(this, null, function* () {
|
|
948
|
+
const resource = model.uri;
|
|
949
|
+
const offset = model.getOffsetAt(position);
|
|
950
|
+
const worker = yield this._worker(resource);
|
|
951
|
+
if (model.isDisposed()) {
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
const edits = yield worker.getFormattingEditsAfterKeystroke(resource.toString(), offset, ch, FormatHelper._convertOptions(options));
|
|
955
|
+
if (!edits || model.isDisposed()) {
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
return edits.map((edit) => this._convertTextChanges(model, edit));
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
var CodeActionAdaptor = class extends FormatHelper {
|
|
963
|
+
provideCodeActions(model, range, context, token) {
|
|
964
|
+
return __async(this, null, function* () {
|
|
965
|
+
const resource = model.uri;
|
|
966
|
+
const start = model.getOffsetAt({
|
|
967
|
+
lineNumber: range.startLineNumber,
|
|
968
|
+
column: range.startColumn
|
|
969
|
+
});
|
|
970
|
+
const end = model.getOffsetAt({
|
|
971
|
+
lineNumber: range.endLineNumber,
|
|
972
|
+
column: range.endColumn
|
|
973
|
+
});
|
|
974
|
+
const formatOptions = FormatHelper._convertOptions(model.getOptions());
|
|
975
|
+
const errorCodes = context.markers.filter((m) => m.code).map((m) => m.code).map(Number);
|
|
976
|
+
const worker = yield this._worker(resource);
|
|
977
|
+
if (model.isDisposed()) {
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
const codeFixes = yield worker.getCodeFixesAtPosition(resource.toString(), start, end, errorCodes, formatOptions);
|
|
981
|
+
if (!codeFixes || model.isDisposed()) {
|
|
982
|
+
return { actions: [], dispose: () => {
|
|
983
|
+
} };
|
|
984
|
+
}
|
|
985
|
+
const actions = codeFixes.filter((fix) => {
|
|
986
|
+
return fix.changes.filter((change) => change.isNewFile).length === 0;
|
|
987
|
+
}).map((fix) => {
|
|
988
|
+
return this._tsCodeFixActionToMonacoCodeAction(model, context, fix);
|
|
989
|
+
});
|
|
990
|
+
return {
|
|
991
|
+
actions,
|
|
992
|
+
dispose: () => {
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
_tsCodeFixActionToMonacoCodeAction(model, context, codeFix) {
|
|
998
|
+
const edits = [];
|
|
999
|
+
for (const change of codeFix.changes) {
|
|
1000
|
+
for (const textChange of change.textChanges) {
|
|
1001
|
+
edits.push({
|
|
1002
|
+
resource: model.uri,
|
|
1003
|
+
versionId: void 0,
|
|
1004
|
+
textEdit: {
|
|
1005
|
+
range: this._textSpanToRange(model, textChange.span),
|
|
1006
|
+
text: textChange.newText
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
const action = {
|
|
1012
|
+
title: codeFix.description,
|
|
1013
|
+
edit: { edits },
|
|
1014
|
+
diagnostics: context.markers,
|
|
1015
|
+
kind: "quickfix"
|
|
1016
|
+
};
|
|
1017
|
+
return action;
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
var RenameAdapter = class extends Adapter {
|
|
1021
|
+
constructor(_libFiles, worker) {
|
|
1022
|
+
super(worker);
|
|
1023
|
+
this._libFiles = _libFiles;
|
|
1024
|
+
}
|
|
1025
|
+
provideRenameEdits(model, position, newName, token) {
|
|
1026
|
+
return __async(this, null, function* () {
|
|
1027
|
+
const resource = model.uri;
|
|
1028
|
+
const fileName = resource.toString();
|
|
1029
|
+
const offset = model.getOffsetAt(position);
|
|
1030
|
+
const worker = yield this._worker(resource);
|
|
1031
|
+
if (model.isDisposed()) {
|
|
1032
|
+
return;
|
|
1033
|
+
}
|
|
1034
|
+
const renameInfo = yield worker.getRenameInfo(fileName, offset, {
|
|
1035
|
+
allowRenameOfImportPath: false
|
|
1036
|
+
});
|
|
1037
|
+
if (renameInfo.canRename === false) {
|
|
1038
|
+
return {
|
|
1039
|
+
edits: [],
|
|
1040
|
+
rejectReason: renameInfo.localizedErrorMessage
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
if (renameInfo.fileToRename !== void 0) {
|
|
1044
|
+
throw new Error("Renaming files is not supported.");
|
|
1045
|
+
}
|
|
1046
|
+
const renameLocations = yield worker.findRenameLocations(fileName, offset, false, false, false);
|
|
1047
|
+
if (!renameLocations || model.isDisposed()) {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
const edits = [];
|
|
1051
|
+
for (const renameLocation of renameLocations) {
|
|
1052
|
+
const model2 = this._libFiles.getOrCreateModel(renameLocation.fileName);
|
|
1053
|
+
if (model2) {
|
|
1054
|
+
edits.push({
|
|
1055
|
+
resource: model2.uri,
|
|
1056
|
+
versionId: void 0,
|
|
1057
|
+
textEdit: {
|
|
1058
|
+
range: this._textSpanToRange(model2, renameLocation.textSpan),
|
|
1059
|
+
text: newName
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
} else {
|
|
1063
|
+
throw new Error(`Unknown file ${renameLocation.fileName}.`);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
return { edits };
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
var InlayHintsAdapter = class extends Adapter {
|
|
1071
|
+
provideInlayHints(model, range, token) {
|
|
1072
|
+
return __async(this, null, function* () {
|
|
1073
|
+
const resource = model.uri;
|
|
1074
|
+
const fileName = resource.toString();
|
|
1075
|
+
const start = model.getOffsetAt({
|
|
1076
|
+
lineNumber: range.startLineNumber,
|
|
1077
|
+
column: range.startColumn
|
|
1078
|
+
});
|
|
1079
|
+
const end = model.getOffsetAt({
|
|
1080
|
+
lineNumber: range.endLineNumber,
|
|
1081
|
+
column: range.endColumn
|
|
1082
|
+
});
|
|
1083
|
+
const worker = yield this._worker(resource);
|
|
1084
|
+
if (model.isDisposed()) {
|
|
1085
|
+
return null;
|
|
1086
|
+
}
|
|
1087
|
+
const tsHints = yield worker.provideInlayHints(fileName, start, end);
|
|
1088
|
+
const hints = tsHints.map((hint) => {
|
|
1089
|
+
return __spreadProps(__spreadValues({}, hint), {
|
|
1090
|
+
label: hint.text,
|
|
1091
|
+
position: model.getPositionAt(hint.position),
|
|
1092
|
+
kind: this._convertHintKind(hint.kind)
|
|
1093
|
+
});
|
|
1094
|
+
});
|
|
1095
|
+
return { hints, dispose: () => {
|
|
1096
|
+
} };
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
_convertHintKind(kind) {
|
|
1100
|
+
switch (kind) {
|
|
1101
|
+
case "Parameter":
|
|
1102
|
+
return monaco_editor_core_exports.languages.InlayHintKind.Parameter;
|
|
1103
|
+
case "Type":
|
|
1104
|
+
return monaco_editor_core_exports.languages.InlayHintKind.Type;
|
|
1105
|
+
default:
|
|
1106
|
+
return monaco_editor_core_exports.languages.InlayHintKind.Type;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
var javaScriptWorker;
|
|
1111
|
+
var typeScriptWorker;
|
|
1112
|
+
function setupTypeScript(defaults) {
|
|
1113
|
+
typeScriptWorker = setupMode(defaults, "typescript");
|
|
1114
|
+
}
|
|
1115
|
+
function setupJavaScript(defaults) {
|
|
1116
|
+
javaScriptWorker = setupMode(defaults, "javascript");
|
|
1117
|
+
}
|
|
1118
|
+
function getJavaScriptWorker() {
|
|
1119
|
+
return new Promise((resolve, reject) => {
|
|
1120
|
+
if (!javaScriptWorker) {
|
|
1121
|
+
return reject("JavaScript not registered!");
|
|
1122
|
+
}
|
|
1123
|
+
resolve(javaScriptWorker);
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
function getTypeScriptWorker() {
|
|
1127
|
+
return new Promise((resolve, reject) => {
|
|
1128
|
+
if (!typeScriptWorker) {
|
|
1129
|
+
return reject("TypeScript not registered!");
|
|
1130
|
+
}
|
|
1131
|
+
resolve(typeScriptWorker);
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
function setupMode(defaults, modeId) {
|
|
1135
|
+
const providers = [];
|
|
1136
|
+
const client = new WorkerManager(modeId, defaults);
|
|
1137
|
+
const worker = (...uris) => {
|
|
1138
|
+
return client.getLanguageServiceWorker(...uris);
|
|
1139
|
+
};
|
|
1140
|
+
const libFiles = new LibFiles(worker);
|
|
1141
|
+
function registerProviders() {
|
|
1142
|
+
const { modeConfiguration } = defaults;
|
|
1143
|
+
disposeAll(providers);
|
|
1144
|
+
if (modeConfiguration.completionItems) {
|
|
1145
|
+
providers.push(monaco_editor_core_exports.languages.registerCompletionItemProvider(modeId, new SuggestAdapter(worker)));
|
|
1146
|
+
}
|
|
1147
|
+
if (modeConfiguration.signatureHelp) {
|
|
1148
|
+
providers.push(monaco_editor_core_exports.languages.registerSignatureHelpProvider(modeId, new SignatureHelpAdapter(worker)));
|
|
1149
|
+
}
|
|
1150
|
+
if (modeConfiguration.hovers) {
|
|
1151
|
+
providers.push(monaco_editor_core_exports.languages.registerHoverProvider(modeId, new QuickInfoAdapter(worker)));
|
|
1152
|
+
}
|
|
1153
|
+
if (modeConfiguration.documentHighlights) {
|
|
1154
|
+
providers.push(monaco_editor_core_exports.languages.registerDocumentHighlightProvider(modeId, new OccurrencesAdapter(worker)));
|
|
1155
|
+
}
|
|
1156
|
+
if (modeConfiguration.definitions) {
|
|
1157
|
+
providers.push(monaco_editor_core_exports.languages.registerDefinitionProvider(modeId, new DefinitionAdapter(libFiles, worker)));
|
|
1158
|
+
}
|
|
1159
|
+
if (modeConfiguration.references) {
|
|
1160
|
+
providers.push(monaco_editor_core_exports.languages.registerReferenceProvider(modeId, new ReferenceAdapter(libFiles, worker)));
|
|
1161
|
+
}
|
|
1162
|
+
if (modeConfiguration.documentSymbols) {
|
|
1163
|
+
providers.push(monaco_editor_core_exports.languages.registerDocumentSymbolProvider(modeId, new OutlineAdapter(worker)));
|
|
1164
|
+
}
|
|
1165
|
+
if (modeConfiguration.rename) {
|
|
1166
|
+
providers.push(monaco_editor_core_exports.languages.registerRenameProvider(modeId, new RenameAdapter(libFiles, worker)));
|
|
1167
|
+
}
|
|
1168
|
+
if (modeConfiguration.documentRangeFormattingEdits) {
|
|
1169
|
+
providers.push(monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(modeId, new FormatAdapter(worker)));
|
|
1170
|
+
}
|
|
1171
|
+
if (modeConfiguration.onTypeFormattingEdits) {
|
|
1172
|
+
providers.push(monaco_editor_core_exports.languages.registerOnTypeFormattingEditProvider(modeId, new FormatOnTypeAdapter(worker)));
|
|
1173
|
+
}
|
|
1174
|
+
if (modeConfiguration.codeActions) {
|
|
1175
|
+
providers.push(monaco_editor_core_exports.languages.registerCodeActionProvider(modeId, new CodeActionAdaptor(worker)));
|
|
1176
|
+
}
|
|
1177
|
+
if (modeConfiguration.inlayHints) {
|
|
1178
|
+
providers.push(monaco_editor_core_exports.languages.registerInlayHintsProvider(modeId, new InlayHintsAdapter(worker)));
|
|
1179
|
+
}
|
|
1180
|
+
if (modeConfiguration.diagnostics) {
|
|
1181
|
+
providers.push(new DiagnosticsAdapter(libFiles, defaults, modeId, worker));
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
registerProviders();
|
|
1185
|
+
return worker;
|
|
1186
|
+
}
|
|
1187
|
+
function disposeAll(disposables) {
|
|
1188
|
+
while (disposables.length) {
|
|
1189
|
+
disposables.pop().dispose();
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
export {
|
|
1193
|
+
Adapter,
|
|
1194
|
+
CodeActionAdaptor,
|
|
1195
|
+
DefinitionAdapter,
|
|
1196
|
+
DiagnosticsAdapter,
|
|
1197
|
+
FormatAdapter,
|
|
1198
|
+
FormatHelper,
|
|
1199
|
+
FormatOnTypeAdapter,
|
|
1200
|
+
InlayHintsAdapter,
|
|
1201
|
+
Kind,
|
|
1202
|
+
LibFiles,
|
|
1203
|
+
OccurrencesAdapter,
|
|
1204
|
+
OutlineAdapter,
|
|
1205
|
+
QuickInfoAdapter,
|
|
1206
|
+
ReferenceAdapter,
|
|
1207
|
+
RenameAdapter,
|
|
1208
|
+
SignatureHelpAdapter,
|
|
1209
|
+
SuggestAdapter,
|
|
1210
|
+
WorkerManager,
|
|
1211
|
+
flattenDiagnosticMessageText,
|
|
1212
|
+
getJavaScriptWorker,
|
|
1213
|
+
getTypeScriptWorker,
|
|
1214
|
+
setupJavaScript,
|
|
1215
|
+
setupTypeScript
|
|
1216
|
+
};
|