@arcgis/coding-components 4.29.0-beta.47 → 4.29.0-beta.49
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/arcgis-coding-components/arcgis-coding-components.esm.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +13 -13
- package/dist/arcgis-coding-components/index.esm.js +1 -1
- package/dist/arcgis-coding-components/{p-10a322ec.js → p-0d616249.js} +9 -9
- package/dist/arcgis-coding-components/p-2c0d6f15.js +2 -0
- package/dist/arcgis-coding-components/{p-71faf9a4.js → p-5802524a.js} +1 -1
- package/dist/arcgis-coding-components/{p-9eabda86.js → p-5ddccf04.js} +1 -1
- package/dist/arcgis-coding-components/p-7475f3a6.js +1 -0
- package/dist/arcgis-coding-components/{p-e6ede32d.js → p-7d8caba9.js} +1 -1
- package/dist/arcgis-coding-components/{p-f7d7d78d.js → p-9f6db08a.js} +1 -1
- package/dist/arcgis-coding-components/{p-e475e6cd.js → p-aefe77ce.js} +1 -1
- package/dist/arcgis-coding-components/p-ce2be55e.entry.js +1 -0
- package/dist/arcgis-coding-components/{p-ce586a8c.js → p-d425a387.js} +1 -1
- package/dist/arcgis-coding-components/{p-c084ada8.js → p-ff21f230.js} +1 -1
- package/dist/cjs/{arcade-defaults-8445d852.js → arcade-defaults-2d513b59.js} +1534 -1534
- package/dist/cjs/arcade-mode-6219f1b8.js +599 -0
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +1404 -1408
- package/dist/cjs/arcgis-coding-components.cjs.js +2 -2
- package/dist/cjs/{cssMode-e63287bb.js → cssMode-1ec48254.js} +2 -2
- package/dist/cjs/{html-c0d4db3b.js → html-0e1741fe.js} +2 -2
- package/dist/cjs/{htmlMode-fdc44d57.js → htmlMode-279d3c29.js} +2 -2
- package/dist/cjs/{index-6a382a34.js → index-ac186201.js} +67 -24
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{javascript-a419d064.js → javascript-04f1bce0.js} +3 -3
- package/dist/cjs/{jsonMode-73aee5d2.js → jsonMode-59322f7a.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{tsMode-37d1b053.js → tsMode-17561f70.js} +2 -2
- package/dist/cjs/{typescript-53f9f36a.js → typescript-b7da8629.js} +2 -2
- package/dist/components/arcade-api.js +160 -160
- package/dist/components/arcade-contribution.js +60 -60
- package/dist/components/arcade-defaults.js +1240 -1240
- package/dist/components/arcade-mode.js +514 -513
- package/dist/components/arcade-results.js +426 -430
- package/dist/components/arcade-suggestions.js +130 -132
- package/dist/components/arcade-variables.js +157 -155
- package/dist/components/arcgis-arcade-api.d.ts +2 -2
- package/dist/components/arcgis-arcade-editor.d.ts +2 -2
- package/dist/components/arcgis-arcade-editor.js +391 -391
- package/dist/components/arcgis-arcade-results.d.ts +2 -2
- package/dist/components/arcgis-arcade-suggestions.d.ts +2 -2
- package/dist/components/arcgis-arcade-variables.d.ts +2 -2
- package/dist/components/arcgis-code-editor.d.ts +2 -2
- package/dist/components/code-editor.js +251 -251
- package/dist/components/fields.js +69 -69
- package/dist/components/functional-components.js +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/markdown.js +28 -28
- package/dist/components/utilities.js +20 -20
- package/dist/esm/{arcade-defaults-d7893362.js → arcade-defaults-0bafa696.js} +1534 -1534
- package/dist/esm/arcade-mode-c17a1fa1.js +595 -0
- package/dist/esm/arcgis-arcade-api_6.entry.js +1404 -1408
- package/dist/esm/arcgis-coding-components.js +3 -3
- package/dist/esm/{cssMode-b1771f92.js → cssMode-3d18bd2b.js} +2 -2
- package/dist/esm/{html-af635d52.js → html-2bce5d77.js} +2 -2
- package/dist/esm/{htmlMode-3021c301.js → htmlMode-69d56956.js} +2 -2
- package/dist/esm/{index-fd6b2fd8.js → index-022fb97b.js} +67 -24
- package/dist/esm/index.js +2 -2
- package/dist/esm/{javascript-70589186.js → javascript-ded5c9d7.js} +3 -3
- package/dist/esm/{jsonMode-cb509b79.js → jsonMode-0bf84cb2.js} +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{tsMode-ed90c9aa.js → tsMode-15d4e936.js} +2 -2
- package/dist/esm/{typescript-db8a0b18.js → typescript-cc4d00f0.js} +2 -2
- package/dist/types/components/arcade-api/arcade-api.d.ts +40 -40
- package/dist/types/components/arcade-api/t9n-types.d.ts +6 -6
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +127 -127
- package/dist/types/components/arcade-editor/t9n-types.d.ts +6 -6
- package/dist/types/components/arcade-results/arcade-results.d.ts +47 -47
- package/dist/types/components/arcade-results/t9n-types.d.ts +11 -11
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +34 -34
- package/dist/types/components/arcade-suggestions/t9n-types.d.ts +4 -4
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +41 -41
- package/dist/types/components/arcade-variables/t9n-types.d.ts +6 -6
- package/dist/types/components/code-editor/code-editor.d.ts +73 -73
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/dist/types/utils/arcade-executor.d.ts +79 -79
- package/dist/types/utils/arcade-monaco/arcade-defaults.d.ts +66 -66
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +23 -23
- package/dist/types/utils/arcade-monaco/arcade-mode.d.ts +9 -9
- package/dist/types/utils/arcade-monaco/arcade-theme.d.ts +7 -7
- package/dist/types/utils/arcade-monaco/arcade-worker-manager.d.ts +9 -9
- package/dist/types/utils/arcade-monaco/arcade.worker.d.ts +12 -12
- package/dist/types/utils/arcade-monaco/types.d.ts +29 -29
- package/dist/types/utils/editor-suggestions.d.ts +24 -24
- package/dist/types/utils/functional-components.d.ts +1 -1
- package/dist/types/utils/markdown.d.ts +1 -1
- package/dist/types/utils/profile/editor-profile.d.ts +185 -185
- package/dist/types/utils/profile/types.d.ts +101 -101
- package/dist/types/utils/utilities.d.ts +1 -1
- package/package.json +7 -7
- package/dist/arcgis-coding-components/p-5d670bd2.js +0 -2
- package/dist/arcgis-coding-components/p-9e242e76.js +0 -1
- package/dist/arcgis-coding-components/p-ccdf0ac1.entry.js +0 -1
- package/dist/cjs/arcade-mode-b77afcc9.js +0 -598
- package/dist/esm/arcade-mode-70e22d22.js +0 -594
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getAssetPath } from './index-
|
|
1
|
+
import { g as getAssetPath } from './index-022fb97b.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns the last element of an array.
|
|
@@ -18824,10 +18824,10 @@ function _$(namespace, description, attrs, ...children) {
|
|
|
18824
18824
|
result.append(...children);
|
|
18825
18825
|
return result;
|
|
18826
18826
|
}
|
|
18827
|
-
function $$
|
|
18827
|
+
function $$e(description, attrs, ...children) {
|
|
18828
18828
|
return _$(Namespace.HTML, description, attrs, ...children);
|
|
18829
18829
|
}
|
|
18830
|
-
$$
|
|
18830
|
+
$$e.SVG = function (description, attrs, ...children) {
|
|
18831
18831
|
return _$(Namespace.SVG, description, attrs, ...children);
|
|
18832
18832
|
};
|
|
18833
18833
|
function setVisibility(visible, ...elements) {
|
|
@@ -81834,7 +81834,7 @@ class ContextView extends Disposable {
|
|
|
81834
81834
|
this.toDisposeOnSetContainer = Disposable.None;
|
|
81835
81835
|
this.shadowRoot = null;
|
|
81836
81836
|
this.shadowRootHostElement = null;
|
|
81837
|
-
this.view = $$
|
|
81837
|
+
this.view = $$e('.context-view');
|
|
81838
81838
|
this.useFixedPosition = false;
|
|
81839
81839
|
this.useShadowDOM = false;
|
|
81840
81840
|
hide(this.view);
|
|
@@ -81861,14 +81861,14 @@ class ContextView extends Disposable {
|
|
|
81861
81861
|
this.useFixedPosition = domPosition !== 1 /* ContextViewDOMPosition.ABSOLUTE */;
|
|
81862
81862
|
this.useShadowDOM = domPosition === 3 /* ContextViewDOMPosition.FIXED_SHADOW */;
|
|
81863
81863
|
if (this.useShadowDOM) {
|
|
81864
|
-
this.shadowRootHostElement = $$
|
|
81864
|
+
this.shadowRootHostElement = $$e('.shadow-root-host');
|
|
81865
81865
|
this.container.appendChild(this.shadowRootHostElement);
|
|
81866
81866
|
this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });
|
|
81867
81867
|
const style = document.createElement('style');
|
|
81868
81868
|
style.textContent = SHADOW_ROOT_CSS;
|
|
81869
81869
|
this.shadowRoot.appendChild(style);
|
|
81870
81870
|
this.shadowRoot.appendChild(this.view);
|
|
81871
|
-
this.shadowRoot.appendChild($$
|
|
81871
|
+
this.shadowRoot.appendChild($$e('slot'));
|
|
81872
81872
|
}
|
|
81873
81873
|
else {
|
|
81874
81874
|
this.container.appendChild(this.view);
|
|
@@ -83962,7 +83962,7 @@ function renderLabelWithIcons(text) {
|
|
|
83962
83962
|
return elements;
|
|
83963
83963
|
}
|
|
83964
83964
|
function renderIcon(icon) {
|
|
83965
|
-
const node = $$
|
|
83965
|
+
const node = $$e(`span`);
|
|
83966
83966
|
node.classList.add(...ThemeIcon.asClassNameArray(icon));
|
|
83967
83967
|
return node;
|
|
83968
83968
|
}
|
|
@@ -87990,7 +87990,7 @@ class RowCache {
|
|
|
87990
87990
|
}
|
|
87991
87991
|
}
|
|
87992
87992
|
else {
|
|
87993
|
-
const domNode = $$
|
|
87993
|
+
const domNode = $$e('.monaco-list-row');
|
|
87994
87994
|
const renderer = this.getRenderer(templateId);
|
|
87995
87995
|
const templateData = renderer.renderTemplate(domNode);
|
|
87996
87996
|
result = { domNode, templateId, templateData };
|
|
@@ -88757,7 +88757,7 @@ class ListView {
|
|
|
88757
88757
|
if (typeof label === 'undefined') {
|
|
88758
88758
|
label = String(elements.length);
|
|
88759
88759
|
}
|
|
88760
|
-
const dragImage = $$
|
|
88760
|
+
const dragImage = $$e('.monaco-drag-image');
|
|
88761
88761
|
dragImage.textContent = label;
|
|
88762
88762
|
const getDragImageContainer = (e) => {
|
|
88763
88763
|
while (e && !e.classList.contains('monaco-workbench')) {
|
|
@@ -90586,16 +90586,16 @@ __decorate$1S([
|
|
|
90586
90586
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
90587
90587
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
90588
90588
|
*--------------------------------------------------------------------------------------------*/
|
|
90589
|
-
const $$
|
|
90589
|
+
const $$d = $$e;
|
|
90590
90590
|
const SELECT_OPTION_ENTRY_TEMPLATE_ID = 'selectOption.entry.template';
|
|
90591
90591
|
class SelectListRenderer {
|
|
90592
90592
|
get templateId() { return SELECT_OPTION_ENTRY_TEMPLATE_ID; }
|
|
90593
90593
|
renderTemplate(container) {
|
|
90594
90594
|
const data = Object.create(null);
|
|
90595
90595
|
data.root = container;
|
|
90596
|
-
data.text = append$1(container, $$
|
|
90597
|
-
data.detail = append$1(container, $$
|
|
90598
|
-
data.decoratorRight = append$1(container, $$
|
|
90596
|
+
data.text = append$1(container, $$d('.option-text'));
|
|
90597
|
+
data.detail = append$1(container, $$d('.option-detail'));
|
|
90598
|
+
data.decoratorRight = append$1(container, $$d('.option-decorator-right'));
|
|
90599
90599
|
return data;
|
|
90600
90600
|
}
|
|
90601
90601
|
renderElement(element, index, templateData) {
|
|
@@ -90666,14 +90666,14 @@ class SelectBoxList extends Disposable {
|
|
|
90666
90666
|
constructSelectDropDown(contextViewProvider) {
|
|
90667
90667
|
// SetUp ContextView container to hold select Dropdown
|
|
90668
90668
|
this.contextViewProvider = contextViewProvider;
|
|
90669
|
-
this.selectDropDownContainer = $$
|
|
90669
|
+
this.selectDropDownContainer = $$e('.monaco-select-box-dropdown-container');
|
|
90670
90670
|
// Use custom CSS vars for padding calculation (shared with parent select)
|
|
90671
90671
|
this.selectDropDownContainer.classList.add('monaco-select-box-dropdown-padding');
|
|
90672
90672
|
// Setup container for select option details
|
|
90673
|
-
this.selectionDetailsPane = append$1(this.selectDropDownContainer, $$
|
|
90673
|
+
this.selectionDetailsPane = append$1(this.selectDropDownContainer, $$d('.select-box-details-pane'));
|
|
90674
90674
|
// Create span flex box item/div we can measure and control
|
|
90675
|
-
const widthControlOuterDiv = append$1(this.selectDropDownContainer, $$
|
|
90676
|
-
const widthControlInnerDiv = append$1(widthControlOuterDiv, $$
|
|
90675
|
+
const widthControlOuterDiv = append$1(this.selectDropDownContainer, $$d('.select-box-dropdown-container-width-control'));
|
|
90676
|
+
const widthControlInnerDiv = append$1(widthControlOuterDiv, $$d('.width-control-div'));
|
|
90677
90677
|
this.widthControlElement = document.createElement('span');
|
|
90678
90678
|
this.widthControlElement.className = 'option-text-width-control';
|
|
90679
90679
|
append$1(widthControlInnerDiv, this.widthControlElement);
|
|
@@ -91115,7 +91115,7 @@ class SelectBoxList extends Disposable {
|
|
|
91115
91115
|
return;
|
|
91116
91116
|
}
|
|
91117
91117
|
// SetUp container for list
|
|
91118
|
-
this.selectDropDownListContainer = append$1(parent, $$
|
|
91118
|
+
this.selectDropDownListContainer = append$1(parent, $$d('.select-box-dropdown-list-container'));
|
|
91119
91119
|
this.listRenderer = new SelectListRenderer();
|
|
91120
91120
|
this.selectList = new List('SelectBoxCustom', this.selectDropDownListContainer, this, [this.listRenderer], {
|
|
91121
91121
|
useShadows: false,
|
|
@@ -91791,13 +91791,13 @@ class ActionViewItem extends BaseActionViewItem {
|
|
|
91791
91791
|
render(container) {
|
|
91792
91792
|
super.render(container);
|
|
91793
91793
|
if (this.element) {
|
|
91794
|
-
this.label = append$1(this.element, $$
|
|
91794
|
+
this.label = append$1(this.element, $$e('a.action-label'));
|
|
91795
91795
|
}
|
|
91796
91796
|
if (this.label) {
|
|
91797
91797
|
this.label.setAttribute('role', this.getDefaultAriaRole());
|
|
91798
91798
|
}
|
|
91799
91799
|
if (this.options.label && this.options.keybinding && this.element) {
|
|
91800
|
-
append$1(this.element, $$
|
|
91800
|
+
append$1(this.element, $$e('span.keybinding')).textContent = this.options.keybinding;
|
|
91801
91801
|
}
|
|
91802
91802
|
this.updateClass();
|
|
91803
91803
|
this.updateLabel();
|
|
@@ -91957,8 +91957,8 @@ class BaseDropdown extends ActionRunner {
|
|
|
91957
91957
|
super();
|
|
91958
91958
|
this._onDidChangeVisibility = this._register(new Emitter$1());
|
|
91959
91959
|
this.onDidChangeVisibility = this._onDidChangeVisibility.event;
|
|
91960
|
-
this._element = append$1(container, $$
|
|
91961
|
-
this._label = append$1(this._element, $$
|
|
91960
|
+
this._element = append$1(container, $$e('.monaco-dropdown'));
|
|
91961
|
+
this._label = append$1(this._element, $$e('.dropdown-label'));
|
|
91962
91962
|
let labelRenderer = options.labelRenderer;
|
|
91963
91963
|
if (!labelRenderer) {
|
|
91964
91964
|
labelRenderer = (container) => {
|
|
@@ -92098,7 +92098,7 @@ class DropdownMenuActionViewItem extends BaseActionViewItem {
|
|
|
92098
92098
|
render(container) {
|
|
92099
92099
|
this.actionItem = container;
|
|
92100
92100
|
const labelRenderer = (el) => {
|
|
92101
|
-
this.element = append$1(el, $$
|
|
92101
|
+
this.element = append$1(el, $$e('a.action-label'));
|
|
92102
92102
|
let classNames = [];
|
|
92103
92103
|
if (typeof this.options.classNames === 'string') {
|
|
92104
92104
|
classNames = this.options.classNames.split(/\s+/g).filter(s => !!s);
|
|
@@ -92943,7 +92943,7 @@ let MenuEntryActionViewItem = class MenuEntryActionViewItem extends ActionViewIt
|
|
|
92943
92943
|
const svgUrl = isDark(this._themeService.getColorTheme().type)
|
|
92944
92944
|
? asCSSUrl(icon.dark)
|
|
92945
92945
|
: asCSSUrl(icon.light);
|
|
92946
|
-
const svgIcon = $$
|
|
92946
|
+
const svgIcon = $$e('span');
|
|
92947
92947
|
svgIcon.style.webkitMask = svgIcon.style.mask = `${svgUrl} no-repeat 50% 50%`;
|
|
92948
92948
|
svgIcon.style.background = 'var(--vscode-icon-foreground)';
|
|
92949
92949
|
svgIcon.style.display = 'inline-block';
|
|
@@ -93052,7 +93052,7 @@ let DropdownWithDefaultActionViewItem = class DropdownWithDefaultActionViewItem
|
|
|
93052
93052
|
}
|
|
93053
93053
|
}();
|
|
93054
93054
|
if (this._container) {
|
|
93055
|
-
this._defaultAction.render(prepend$1(this._container, $$
|
|
93055
|
+
this._defaultAction.render(prepend$1(this._container, $$e('.action-container')));
|
|
93056
93056
|
}
|
|
93057
93057
|
}
|
|
93058
93058
|
_getDefaultActionKeybindingLabel(defaultAction) {
|
|
@@ -93075,7 +93075,7 @@ let DropdownWithDefaultActionViewItem = class DropdownWithDefaultActionViewItem
|
|
|
93075
93075
|
this._container = container;
|
|
93076
93076
|
super.render(this._container);
|
|
93077
93077
|
this._container.classList.add('monaco-dropdown-with-default');
|
|
93078
|
-
const primaryContainer = $$
|
|
93078
|
+
const primaryContainer = $$e('.action-container');
|
|
93079
93079
|
this._defaultAction.render(append$1(this._container, primaryContainer));
|
|
93080
93080
|
this._register(addDisposableListener(primaryContainer, EventType$1.KEY_DOWN, (e) => {
|
|
93081
93081
|
const event = new StandardKeyboardEvent(e);
|
|
@@ -93085,7 +93085,7 @@ let DropdownWithDefaultActionViewItem = class DropdownWithDefaultActionViewItem
|
|
|
93085
93085
|
event.stopPropagation();
|
|
93086
93086
|
}
|
|
93087
93087
|
}));
|
|
93088
|
-
const dropdownContainer = $$
|
|
93088
|
+
const dropdownContainer = $$e('.dropdown-action-container');
|
|
93089
93089
|
this._dropdown.render(append$1(this._container, dropdownContainer));
|
|
93090
93090
|
this._register(addDisposableListener(dropdownContainer, EventType$1.KEY_DOWN, (e) => {
|
|
93091
93091
|
var _a;
|
|
@@ -93938,7 +93938,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
|
|
|
93938
93938
|
return;
|
|
93939
93939
|
}
|
|
93940
93940
|
this.container = container;
|
|
93941
|
-
this.item = append$1(this.element, $$
|
|
93941
|
+
this.item = append$1(this.element, $$e('a.action-menu-item'));
|
|
93942
93942
|
if (this._action.id === Separator.ID) {
|
|
93943
93943
|
// A separator is a presentation item
|
|
93944
93944
|
this.item.setAttribute('role', 'presentation');
|
|
@@ -93949,11 +93949,11 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
|
|
|
93949
93949
|
this.item.setAttribute('aria-keyshortcuts', `${this.mnemonic}`);
|
|
93950
93950
|
}
|
|
93951
93951
|
}
|
|
93952
|
-
this.check = append$1(this.item, $$
|
|
93952
|
+
this.check = append$1(this.item, $$e('span.menu-item-check' + ThemeIcon.asCSSSelector(Codicon.menuSelection)));
|
|
93953
93953
|
this.check.setAttribute('role', 'none');
|
|
93954
|
-
this.label = append$1(this.item, $$
|
|
93954
|
+
this.label = append$1(this.item, $$e('span.action-label'));
|
|
93955
93955
|
if (this.options.label && this.options.keybinding) {
|
|
93956
|
-
append$1(this.item, $$
|
|
93956
|
+
append$1(this.item, $$e('span.keybinding')).textContent = this.options.keybinding;
|
|
93957
93957
|
}
|
|
93958
93958
|
// Adds mouse up listener to actually run the action
|
|
93959
93959
|
this.runOnceToEnableMouseUp.schedule();
|
|
@@ -94006,7 +94006,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
|
|
|
94006
94006
|
}
|
|
94007
94007
|
const replaceDoubleEscapes = (str) => str.replace(/&&/g, '&');
|
|
94008
94008
|
if (escMatch) {
|
|
94009
|
-
this.label.append(ltrim(replaceDoubleEscapes(label.substr(0, escMatch.index)), ' '), $$
|
|
94009
|
+
this.label.append(ltrim(replaceDoubleEscapes(label.substr(0, escMatch.index)), ' '), $$e('u', { 'aria-hidden': 'true' }, escMatch[3]), rtrim(replaceDoubleEscapes(label.substr(escMatch.index + escMatch[0].length)), ' '));
|
|
94010
94010
|
}
|
|
94011
94011
|
else {
|
|
94012
94012
|
this.label.innerText = replaceDoubleEscapes(label).trim();
|
|
@@ -94129,7 +94129,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|
|
94129
94129
|
this.item.tabIndex = 0;
|
|
94130
94130
|
this.item.setAttribute('aria-haspopup', 'true');
|
|
94131
94131
|
this.updateAriaExpanded('false');
|
|
94132
|
-
this.submenuIndicator = append$1(this.item, $$
|
|
94132
|
+
this.submenuIndicator = append$1(this.item, $$e('span.submenu-indicator' + ThemeIcon.asCSSSelector(Codicon.menuSubmenu)));
|
|
94133
94133
|
this.submenuIndicator.setAttribute('aria-hidden', 'true');
|
|
94134
94134
|
}
|
|
94135
94135
|
this._register(addDisposableListener(this.element, EventType$1.KEY_UP, e => {
|
|
@@ -94220,7 +94220,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|
|
94220
94220
|
}
|
|
94221
94221
|
if (!this.parentData.submenu) {
|
|
94222
94222
|
this.updateAriaExpanded('true');
|
|
94223
|
-
this.submenuContainer = append$1(this.element, $$
|
|
94223
|
+
this.submenuContainer = append$1(this.element, $$e('div.monaco-submenu'));
|
|
94224
94224
|
this.submenuContainer.classList.add('menubar-menu-items-holder', 'context-view');
|
|
94225
94225
|
// Set the top value of the menu container before construction
|
|
94226
94226
|
// This allows the menu constructor to calculate the proper max height
|
|
@@ -94757,7 +94757,7 @@ class ContextMenuHandler {
|
|
|
94757
94757
|
}
|
|
94758
94758
|
// Render invisible div to block mouse interaction in the rest of the UI
|
|
94759
94759
|
if (this.options.blockMouse) {
|
|
94760
|
-
this.block = container.appendChild($$
|
|
94760
|
+
this.block = container.appendChild($$e('.context-view-block'));
|
|
94761
94761
|
this.block.style.position = 'fixed';
|
|
94762
94762
|
this.block.style.cursor = 'initial';
|
|
94763
94763
|
this.block.style.left = '0';
|
|
@@ -96181,7 +96181,7 @@ class Sash extends Disposable {
|
|
|
96181
96181
|
const onChange = (state) => {
|
|
96182
96182
|
this.orthogonalStartDragHandleDisposables.clear();
|
|
96183
96183
|
if (state !== 0 /* SashState.Disabled */) {
|
|
96184
|
-
this._orthogonalStartDragHandle = append$1(this.el, $$
|
|
96184
|
+
this._orthogonalStartDragHandle = append$1(this.el, $$e('.orthogonal-drag-handle.start'));
|
|
96185
96185
|
this.orthogonalStartDragHandleDisposables.add(toDisposable(() => this._orthogonalStartDragHandle.remove()));
|
|
96186
96186
|
this.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle, 'mouseenter')).event(() => Sash.onMouseEnter(sash), undefined, this.orthogonalStartDragHandleDisposables);
|
|
96187
96187
|
this.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle, 'mouseleave')).event(() => Sash.onMouseLeave(sash), undefined, this.orthogonalStartDragHandleDisposables);
|
|
@@ -96210,7 +96210,7 @@ class Sash extends Disposable {
|
|
|
96210
96210
|
const onChange = (state) => {
|
|
96211
96211
|
this.orthogonalEndDragHandleDisposables.clear();
|
|
96212
96212
|
if (state !== 0 /* SashState.Disabled */) {
|
|
96213
|
-
this._orthogonalEndDragHandle = append$1(this.el, $$
|
|
96213
|
+
this._orthogonalEndDragHandle = append$1(this.el, $$e('.orthogonal-drag-handle.end'));
|
|
96214
96214
|
this.orthogonalEndDragHandleDisposables.add(toDisposable(() => this._orthogonalEndDragHandle.remove()));
|
|
96215
96215
|
this.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle, 'mouseenter')).event(() => Sash.onMouseEnter(sash), undefined, this.orthogonalEndDragHandleDisposables);
|
|
96216
96216
|
this.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle, 'mouseleave')).event(() => Sash.onMouseLeave(sash), undefined, this.orthogonalEndDragHandleDisposables);
|
|
@@ -96259,7 +96259,7 @@ class Sash extends Disposable {
|
|
|
96259
96259
|
* Useful in 2x2 grids. Not meant for widespread usage.
|
|
96260
96260
|
*/
|
|
96261
96261
|
this.linkedSash = undefined;
|
|
96262
|
-
this.el = append$1(container, $$
|
|
96262
|
+
this.el = append$1(container, $$e('.monaco-sash'));
|
|
96263
96263
|
if (options.orthogonalEdge) {
|
|
96264
96264
|
this.el.classList.add(`orthogonal-edge-${options.orthogonalEdge}`);
|
|
96265
96265
|
}
|
|
@@ -96699,8 +96699,8 @@ class SplitView extends Disposable {
|
|
|
96699
96699
|
this.el.classList.add('monaco-split-view2');
|
|
96700
96700
|
this.el.classList.add(this.orientation === 0 /* Orientation.VERTICAL */ ? 'vertical' : 'horizontal');
|
|
96701
96701
|
container.appendChild(this.el);
|
|
96702
|
-
this.sashContainer = append$1(this.el, $$
|
|
96703
|
-
this.viewContainer = $$
|
|
96702
|
+
this.sashContainer = append$1(this.el, $$e('.sash-container'));
|
|
96703
|
+
this.viewContainer = $$e('.split-view-container');
|
|
96704
96704
|
this.scrollable = this._register(new Scrollable({
|
|
96705
96705
|
forceIntegerValues: true,
|
|
96706
96706
|
smoothScrollDuration: 125,
|
|
@@ -96980,7 +96980,7 @@ class SplitView extends Disposable {
|
|
|
96980
96980
|
}
|
|
96981
96981
|
this.state = State.Busy;
|
|
96982
96982
|
// Add view
|
|
96983
|
-
const container = $$
|
|
96983
|
+
const container = $$e('.split-view-view');
|
|
96984
96984
|
if (index === this.viewItems.length) {
|
|
96985
96985
|
this.viewContainer.appendChild(container);
|
|
96986
96986
|
}
|
|
@@ -97303,12 +97303,12 @@ class TableListRenderer {
|
|
|
97303
97303
|
}
|
|
97304
97304
|
}
|
|
97305
97305
|
renderTemplate(container) {
|
|
97306
|
-
const rowContainer = append$1(container, $$
|
|
97306
|
+
const rowContainer = append$1(container, $$e('.monaco-table-tr'));
|
|
97307
97307
|
const cellContainers = [];
|
|
97308
97308
|
const cellTemplateData = [];
|
|
97309
97309
|
for (let i = 0; i < this.columns.length; i++) {
|
|
97310
97310
|
const renderer = this.renderers[i];
|
|
97311
|
-
const cellContainer = append$1(rowContainer, $$
|
|
97311
|
+
const cellContainer = append$1(rowContainer, $$e('.monaco-table-td', { 'data-col-index': i }));
|
|
97312
97312
|
cellContainer.style.width = `${this.getColumnSize(i)}px`;
|
|
97313
97313
|
cellContainers.push(cellContainer);
|
|
97314
97314
|
cellTemplateData.push(renderer.renderTemplate(cellContainer));
|
|
@@ -97365,7 +97365,7 @@ class ColumnHeader {
|
|
|
97365
97365
|
this.index = index;
|
|
97366
97366
|
this._onDidLayout = new Emitter$1();
|
|
97367
97367
|
this.onDidLayout = this._onDidLayout.event;
|
|
97368
|
-
this.element = $$
|
|
97368
|
+
this.element = $$e('.monaco-table-th', { 'data-col-index': index, title: column.tooltip }, column.label);
|
|
97369
97369
|
}
|
|
97370
97370
|
layout(size) {
|
|
97371
97371
|
this._onDidLayout.fire([this.index, size]);
|
|
@@ -97389,7 +97389,7 @@ class Table {
|
|
|
97389
97389
|
this.disposables = new DisposableStore();
|
|
97390
97390
|
this.cachedWidth = 0;
|
|
97391
97391
|
this.cachedHeight = 0;
|
|
97392
|
-
this.domNode = append$1(container, $$
|
|
97392
|
+
this.domNode = append$1(container, $$e(`.monaco-table.${this.domId}`));
|
|
97393
97393
|
const headers = columns.map((c, i) => new ColumnHeader(c, i));
|
|
97394
97394
|
const descriptor = {
|
|
97395
97395
|
size: headers.reduce((a, b) => a + b.column.weight, 0),
|
|
@@ -97693,7 +97693,7 @@ class HistoryNavigator {
|
|
|
97693
97693
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
97694
97694
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
97695
97695
|
*--------------------------------------------------------------------------------------------*/
|
|
97696
|
-
const $$
|
|
97696
|
+
const $$c = $$e;
|
|
97697
97697
|
class InputBox$1 extends Widget$1 {
|
|
97698
97698
|
constructor(container, contextViewProvider, options) {
|
|
97699
97699
|
var _a;
|
|
@@ -97713,10 +97713,10 @@ class InputBox$1 extends Widget$1 {
|
|
|
97713
97713
|
if (this.options.validationOptions) {
|
|
97714
97714
|
this.validation = this.options.validationOptions.validation;
|
|
97715
97715
|
}
|
|
97716
|
-
this.element = append$1(container, $$
|
|
97716
|
+
this.element = append$1(container, $$c('.monaco-inputbox.idle'));
|
|
97717
97717
|
const tagName = this.options.flexibleHeight ? 'textarea' : 'input';
|
|
97718
|
-
const wrapper = append$1(this.element, $$
|
|
97719
|
-
this.input = append$1(wrapper, $$
|
|
97718
|
+
const wrapper = append$1(this.element, $$c('.ibwrapper'));
|
|
97719
|
+
this.input = append$1(wrapper, $$c(tagName + '.input.empty'));
|
|
97720
97720
|
this.input.setAttribute('autocorrect', 'off');
|
|
97721
97721
|
this.input.setAttribute('autocapitalize', 'off');
|
|
97722
97722
|
this.input.setAttribute('spellcheck', 'false');
|
|
@@ -97724,7 +97724,7 @@ class InputBox$1 extends Widget$1 {
|
|
|
97724
97724
|
this.onblur(this.input, () => this.element.classList.remove('synthetic-focus'));
|
|
97725
97725
|
if (this.options.flexibleHeight) {
|
|
97726
97726
|
this.maxHeight = typeof this.options.flexibleMaxHeight === 'number' ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY;
|
|
97727
|
-
this.mirror = append$1(wrapper, $$
|
|
97727
|
+
this.mirror = append$1(wrapper, $$c('div.mirror'));
|
|
97728
97728
|
this.mirror.innerText = '\u00a0';
|
|
97729
97729
|
this.scrollableElement = new ScrollableElement(this.element, { vertical: 1 /* ScrollbarVisibility.Auto */ });
|
|
97730
97730
|
if (this.options.flexibleWidth) {
|
|
@@ -97921,7 +97921,7 @@ class InputBox$1 extends Widget$1 {
|
|
|
97921
97921
|
if (!this.message) {
|
|
97922
97922
|
return null;
|
|
97923
97923
|
}
|
|
97924
|
-
div = append$1(container, $$
|
|
97924
|
+
div = append$1(container, $$c('.monaco-inputbox-container'));
|
|
97925
97925
|
layout();
|
|
97926
97926
|
const renderOptions = {
|
|
97927
97927
|
inline: true,
|
|
@@ -99229,10 +99229,10 @@ class TreeRenderer {
|
|
|
99229
99229
|
}
|
|
99230
99230
|
}
|
|
99231
99231
|
renderTemplate(container) {
|
|
99232
|
-
const el = append$1(container, $$
|
|
99233
|
-
const indent = append$1(el, $$
|
|
99234
|
-
const twistie = append$1(el, $$
|
|
99235
|
-
const contents = append$1(el, $$
|
|
99232
|
+
const el = append$1(container, $$e('.monaco-tl-row'));
|
|
99233
|
+
const indent = append$1(el, $$e('.monaco-tl-indent'));
|
|
99234
|
+
const twistie = append$1(el, $$e('.monaco-tl-twistie'));
|
|
99235
|
+
const contents = append$1(el, $$e('.monaco-tl-contents'));
|
|
99236
99236
|
const templateData = this.renderer.renderTemplate(contents);
|
|
99237
99237
|
return { container, indent, twistie, indentGuidesDisposable: Disposable.None, templateData };
|
|
99238
99238
|
}
|
|
@@ -99311,7 +99311,7 @@ class TreeRenderer {
|
|
|
99311
99311
|
break;
|
|
99312
99312
|
}
|
|
99313
99313
|
const parent = model.getNode(parentRef);
|
|
99314
|
-
const guide = $$
|
|
99314
|
+
const guide = $$e('.indent-guide', { style: `width: ${this.indent}px` });
|
|
99315
99315
|
if (this.activeIndentNodes.has(parent)) {
|
|
99316
99316
|
guide.classList.add('active');
|
|
99317
99317
|
}
|
|
@@ -102986,7 +102986,7 @@ class CountBadge {
|
|
|
102986
102986
|
this.options = options;
|
|
102987
102987
|
this.styles = styles;
|
|
102988
102988
|
this.count = 0;
|
|
102989
|
-
this.element = append$1(container, $$
|
|
102989
|
+
this.element = append$1(container, $$e('.monaco-count-badge'));
|
|
102990
102990
|
this.countFormat = this.options.countFormat || '{0}';
|
|
102991
102991
|
this.titleFormat = this.options.titleFormat || '';
|
|
102992
102992
|
this.setCount(this.options.count || 0);
|
|
@@ -103112,7 +103112,7 @@ ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD = 10000;
|
|
|
103112
103112
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
103113
103113
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
103114
103114
|
*--------------------------------------------------------------------------------------------*/
|
|
103115
|
-
const $$
|
|
103115
|
+
const $$b = $$e;
|
|
103116
103116
|
class QuickInputBox extends Disposable {
|
|
103117
103117
|
constructor(parent, inputBoxStyles, toggleStyles) {
|
|
103118
103118
|
super();
|
|
@@ -103130,7 +103130,7 @@ class QuickInputBox extends Disposable {
|
|
|
103130
103130
|
this.onDidChange = (handler) => {
|
|
103131
103131
|
return this.findInput.onDidChange(handler);
|
|
103132
103132
|
};
|
|
103133
|
-
this.container = append$1(this.parent, $$
|
|
103133
|
+
this.container = append$1(this.parent, $$b('.quick-input-box'));
|
|
103134
103134
|
this.findInput = this._register(new FindInput(this.container, undefined, { label: '', inputBoxStyles, toggleStyles }));
|
|
103135
103135
|
const input = this.findInput.inputBox.inputElement;
|
|
103136
103136
|
input.role = 'combobox';
|
|
@@ -103219,7 +103219,7 @@ class HighlightedLabel {
|
|
|
103219
103219
|
this.highlights = [];
|
|
103220
103220
|
this.didEverRender = false;
|
|
103221
103221
|
this.supportIcons = (_a = options === null || options === void 0 ? void 0 : options.supportIcons) !== null && _a !== void 0 ? _a : false;
|
|
103222
|
-
this.domNode = append$1(container, $$
|
|
103222
|
+
this.domNode = append$1(container, $$e('span.monaco-highlighted-label'));
|
|
103223
103223
|
}
|
|
103224
103224
|
/**
|
|
103225
103225
|
* The label's DOM node.
|
|
@@ -103270,7 +103270,7 @@ class HighlightedLabel {
|
|
|
103270
103270
|
pos = highlight.start;
|
|
103271
103271
|
}
|
|
103272
103272
|
const substring = this.text.substring(pos, highlight.end);
|
|
103273
|
-
const element = $$
|
|
103273
|
+
const element = $$e('span.highlight', undefined, ...this.supportIcons ? renderLabelWithIcons(substring) : [substring]);
|
|
103274
103274
|
if (highlight.extraClasses) {
|
|
103275
103275
|
element.classList.add(...highlight.extraClasses);
|
|
103276
103276
|
}
|
|
@@ -103359,9 +103359,9 @@ class IconLabel extends Disposable {
|
|
|
103359
103359
|
super();
|
|
103360
103360
|
this.customHovers = new Map();
|
|
103361
103361
|
this.creationOptions = options;
|
|
103362
|
-
this.domNode = this._register(new FastLabelNode(append$1(container, $$
|
|
103363
|
-
this.labelContainer = append$1(this.domNode.element, $$
|
|
103364
|
-
const nameContainer = append$1(this.labelContainer, $$
|
|
103362
|
+
this.domNode = this._register(new FastLabelNode(append$1(container, $$e('.monaco-icon-label'))));
|
|
103363
|
+
this.labelContainer = append$1(this.domNode.element, $$e('.monaco-icon-label-container'));
|
|
103364
|
+
const nameContainer = append$1(this.labelContainer, $$e('span.monaco-icon-name-container'));
|
|
103365
103365
|
if ((options === null || options === void 0 ? void 0 : options.supportHighlights) || (options === null || options === void 0 ? void 0 : options.supportIcons)) {
|
|
103366
103366
|
this.nameNode = new LabelWithHighlights(nameContainer, !!options.supportIcons);
|
|
103367
103367
|
}
|
|
@@ -103442,12 +103442,12 @@ class IconLabel extends Disposable {
|
|
|
103442
103442
|
getOrCreateDescriptionNode() {
|
|
103443
103443
|
var _a;
|
|
103444
103444
|
if (!this.descriptionNode) {
|
|
103445
|
-
const descriptionContainer = this._register(new FastLabelNode(append$1(this.labelContainer, $$
|
|
103445
|
+
const descriptionContainer = this._register(new FastLabelNode(append$1(this.labelContainer, $$e('span.monaco-icon-description-container'))));
|
|
103446
103446
|
if ((_a = this.creationOptions) === null || _a === void 0 ? void 0 : _a.supportDescriptionHighlights) {
|
|
103447
|
-
this.descriptionNode = new HighlightedLabel(append$1(descriptionContainer.element, $$
|
|
103447
|
+
this.descriptionNode = new HighlightedLabel(append$1(descriptionContainer.element, $$e('span.label-description')), { supportIcons: !!this.creationOptions.supportIcons });
|
|
103448
103448
|
}
|
|
103449
103449
|
else {
|
|
103450
|
-
this.descriptionNode = this._register(new FastLabelNode(append$1(descriptionContainer.element, $$
|
|
103450
|
+
this.descriptionNode = this._register(new FastLabelNode(append$1(descriptionContainer.element, $$e('span.label-description'))));
|
|
103451
103451
|
}
|
|
103452
103452
|
}
|
|
103453
103453
|
return this.descriptionNode;
|
|
@@ -103469,7 +103469,7 @@ class Label {
|
|
|
103469
103469
|
if (!this.singleLabel) {
|
|
103470
103470
|
this.container.innerText = '';
|
|
103471
103471
|
this.container.classList.remove('multiple');
|
|
103472
|
-
this.singleLabel = append$1(this.container, $$
|
|
103472
|
+
this.singleLabel = append$1(this.container, $$e('a.label-name', { id: options === null || options === void 0 ? void 0 : options.domId }));
|
|
103473
103473
|
}
|
|
103474
103474
|
this.singleLabel.textContent = label;
|
|
103475
103475
|
}
|
|
@@ -103480,9 +103480,9 @@ class Label {
|
|
|
103480
103480
|
for (let i = 0; i < label.length; i++) {
|
|
103481
103481
|
const l = label[i];
|
|
103482
103482
|
const id = (options === null || options === void 0 ? void 0 : options.domId) && `${options === null || options === void 0 ? void 0 : options.domId}_${i}`;
|
|
103483
|
-
append$1(this.container, $$
|
|
103483
|
+
append$1(this.container, $$e('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));
|
|
103484
103484
|
if (i < label.length - 1) {
|
|
103485
|
-
append$1(this.container, $$
|
|
103485
|
+
append$1(this.container, $$e('span.label-separator', undefined, (options === null || options === void 0 ? void 0 : options.separator) || '/'));
|
|
103486
103486
|
}
|
|
103487
103487
|
}
|
|
103488
103488
|
}
|
|
@@ -103520,7 +103520,7 @@ class LabelWithHighlights {
|
|
|
103520
103520
|
if (!this.singleLabel) {
|
|
103521
103521
|
this.container.innerText = '';
|
|
103522
103522
|
this.container.classList.remove('multiple');
|
|
103523
|
-
this.singleLabel = new HighlightedLabel(append$1(this.container, $$
|
|
103523
|
+
this.singleLabel = new HighlightedLabel(append$1(this.container, $$e('a.label-name', { id: options === null || options === void 0 ? void 0 : options.domId })), { supportIcons: this.supportIcons });
|
|
103524
103524
|
}
|
|
103525
103525
|
this.singleLabel.set(label, options === null || options === void 0 ? void 0 : options.matches, undefined, options === null || options === void 0 ? void 0 : options.labelEscapeNewLines);
|
|
103526
103526
|
}
|
|
@@ -103534,11 +103534,11 @@ class LabelWithHighlights {
|
|
|
103534
103534
|
const l = label[i];
|
|
103535
103535
|
const m = matches ? matches[i] : undefined;
|
|
103536
103536
|
const id = (options === null || options === void 0 ? void 0 : options.domId) && `${options === null || options === void 0 ? void 0 : options.domId}_${i}`;
|
|
103537
|
-
const name = $$
|
|
103537
|
+
const name = $$e('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });
|
|
103538
103538
|
const highlightedLabel = new HighlightedLabel(append$1(this.container, name), { supportIcons: this.supportIcons });
|
|
103539
103539
|
highlightedLabel.set(l, m, undefined, options === null || options === void 0 ? void 0 : options.labelEscapeNewLines);
|
|
103540
103540
|
if (i < label.length - 1) {
|
|
103541
|
-
append$1(name, $$
|
|
103541
|
+
append$1(name, $$e('span.label-separator', undefined, separator));
|
|
103542
103542
|
}
|
|
103543
103543
|
}
|
|
103544
103544
|
}
|
|
@@ -103549,7 +103549,7 @@ class LabelWithHighlights {
|
|
|
103549
103549
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
103550
103550
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
103551
103551
|
*--------------------------------------------------------------------------------------------*/
|
|
103552
|
-
const $$
|
|
103552
|
+
const $$a = $$e;
|
|
103553
103553
|
const unthemedKeybindingLabelOptions = {
|
|
103554
103554
|
keybindingLabelBackground: undefined,
|
|
103555
103555
|
keybindingLabelForeground: undefined,
|
|
@@ -103563,7 +103563,7 @@ class KeybindingLabel {
|
|
|
103563
103563
|
this.keyElements = new Set();
|
|
103564
103564
|
this.options = options || Object.create(null);
|
|
103565
103565
|
const labelForeground = this.options.keybindingLabelForeground;
|
|
103566
|
-
this.domNode = append$1(container, $$
|
|
103566
|
+
this.domNode = append$1(container, $$a('.monaco-keybinding'));
|
|
103567
103567
|
if (labelForeground) {
|
|
103568
103568
|
this.domNode.style.color = labelForeground;
|
|
103569
103569
|
}
|
|
@@ -103590,7 +103590,7 @@ class KeybindingLabel {
|
|
|
103590
103590
|
this.renderChord(this.domNode, chords[0], this.matches ? this.matches.firstPart : null);
|
|
103591
103591
|
}
|
|
103592
103592
|
for (let i = 1; i < chords.length; i++) {
|
|
103593
|
-
append$1(this.domNode, $$
|
|
103593
|
+
append$1(this.domNode, $$a('span.monaco-keybinding-key-chord-separator', undefined, ' '));
|
|
103594
103594
|
this.renderChord(this.domNode, chords[i], this.matches ? this.matches.chordPart : null);
|
|
103595
103595
|
}
|
|
103596
103596
|
const title = ((_a = this.options.disableTitle) !== null && _a !== void 0 ? _a : false) ? undefined : this.keybinding.getAriaLabel() || undefined;
|
|
@@ -103632,14 +103632,14 @@ class KeybindingLabel {
|
|
|
103632
103632
|
renderKey(parent, label, highlight, separator) {
|
|
103633
103633
|
append$1(parent, this.createKeyElement(label, highlight ? '.highlight' : ''));
|
|
103634
103634
|
if (separator) {
|
|
103635
|
-
append$1(parent, $$
|
|
103635
|
+
append$1(parent, $$a('span.monaco-keybinding-key-separator', undefined, separator));
|
|
103636
103636
|
}
|
|
103637
103637
|
}
|
|
103638
103638
|
renderUnbound(parent) {
|
|
103639
103639
|
append$1(parent, this.createKeyElement(localize('unbound', "Unbound")));
|
|
103640
103640
|
}
|
|
103641
103641
|
createKeyElement(label, extraClass = '') {
|
|
103642
|
-
const keyElement = $$
|
|
103642
|
+
const keyElement = $$a('span.monaco-keybinding-key' + extraClass, undefined, label);
|
|
103643
103643
|
this.keyElements.add(keyElement);
|
|
103644
103644
|
if (this.options.keybindingLabelBackground) {
|
|
103645
103645
|
keyElement.style.backgroundColor = this.options.keybindingLabelBackground;
|
|
@@ -103816,7 +103816,7 @@ function renderQuickInputDescription(description, container, actionHandler) {
|
|
|
103816
103816
|
else if (!title) {
|
|
103817
103817
|
title = node.href;
|
|
103818
103818
|
}
|
|
103819
|
-
const anchor = $$
|
|
103819
|
+
const anchor = $$e('a', { href: node.href, title, tabIndex: tabIndex++ }, node.label);
|
|
103820
103820
|
anchor.style.textDecoration = 'underline';
|
|
103821
103821
|
const handleOpen = (e) => {
|
|
103822
103822
|
if (isEventLike(e)) {
|
|
@@ -103857,7 +103857,7 @@ var __awaiter$1i = (undefined && undefined.__awaiter) || function (thisArg, _arg
|
|
|
103857
103857
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
103858
103858
|
});
|
|
103859
103859
|
};
|
|
103860
|
-
const $$
|
|
103860
|
+
const $$9 = $$e;
|
|
103861
103861
|
class ListElement {
|
|
103862
103862
|
constructor(mainItem, previous, index, hasCheckbox, fireButtonTriggered, fireSeparatorButtonTriggered, onCheckedEmitter) {
|
|
103863
103863
|
var _a, _b, _c;
|
|
@@ -103971,36 +103971,36 @@ class ListElementRenderer {
|
|
|
103971
103971
|
const data = Object.create(null);
|
|
103972
103972
|
data.toDisposeElement = [];
|
|
103973
103973
|
data.toDisposeTemplate = [];
|
|
103974
|
-
data.entry = append$1(container, $$
|
|
103974
|
+
data.entry = append$1(container, $$9('.quick-input-list-entry'));
|
|
103975
103975
|
// Checkbox
|
|
103976
|
-
const label = append$1(data.entry, $$
|
|
103976
|
+
const label = append$1(data.entry, $$9('label.quick-input-list-label'));
|
|
103977
103977
|
data.toDisposeTemplate.push(addStandardDisposableListener(label, EventType$1.CLICK, e => {
|
|
103978
103978
|
if (!data.checkbox.offsetParent) { // If checkbox not visible:
|
|
103979
103979
|
e.preventDefault(); // Prevent toggle of checkbox when it is immediately shown afterwards. #91740
|
|
103980
103980
|
}
|
|
103981
103981
|
}));
|
|
103982
|
-
data.checkbox = append$1(label, $$
|
|
103982
|
+
data.checkbox = append$1(label, $$9('input.quick-input-list-checkbox'));
|
|
103983
103983
|
data.checkbox.type = 'checkbox';
|
|
103984
103984
|
data.toDisposeTemplate.push(addStandardDisposableListener(data.checkbox, EventType$1.CHANGE, e => {
|
|
103985
103985
|
data.element.checked = data.checkbox.checked;
|
|
103986
103986
|
}));
|
|
103987
103987
|
// Rows
|
|
103988
|
-
const rows = append$1(label, $$
|
|
103989
|
-
const row1 = append$1(rows, $$
|
|
103990
|
-
const row2 = append$1(rows, $$
|
|
103988
|
+
const rows = append$1(label, $$9('.quick-input-list-rows'));
|
|
103989
|
+
const row1 = append$1(rows, $$9('.quick-input-list-row'));
|
|
103990
|
+
const row2 = append$1(rows, $$9('.quick-input-list-row'));
|
|
103991
103991
|
// Label
|
|
103992
103992
|
data.label = new IconLabel(row1, { supportHighlights: true, supportDescriptionHighlights: true, supportIcons: true });
|
|
103993
103993
|
data.toDisposeTemplate.push(data.label);
|
|
103994
|
-
data.icon = prepend$1(data.label.element, $$
|
|
103994
|
+
data.icon = prepend$1(data.label.element, $$9('.quick-input-list-icon'));
|
|
103995
103995
|
// Keybinding
|
|
103996
|
-
const keybindingContainer = append$1(row1, $$
|
|
103996
|
+
const keybindingContainer = append$1(row1, $$9('.quick-input-list-entry-keybinding'));
|
|
103997
103997
|
data.keybinding = new KeybindingLabel(keybindingContainer, OS);
|
|
103998
103998
|
// Detail
|
|
103999
|
-
const detailContainer = append$1(row2, $$
|
|
103999
|
+
const detailContainer = append$1(row2, $$9('.quick-input-list-label-meta'));
|
|
104000
104000
|
data.detail = new IconLabel(detailContainer, { supportHighlights: true, supportIcons: true });
|
|
104001
104001
|
data.toDisposeTemplate.push(data.detail);
|
|
104002
104002
|
// Separator
|
|
104003
|
-
data.separator = append$1(data.entry, $$
|
|
104003
|
+
data.separator = append$1(data.entry, $$9('.quick-input-list-separator'));
|
|
104004
104004
|
// Actions
|
|
104005
104005
|
data.actionBar = new ActionBar(data.entry);
|
|
104006
104006
|
data.actionBar.domNode.classList.add('quick-input-list-entry-action-bar');
|
|
@@ -104163,7 +104163,7 @@ class QuickInputList {
|
|
|
104163
104163
|
this.elementDisposables = [];
|
|
104164
104164
|
this.disposables = [];
|
|
104165
104165
|
this.id = id;
|
|
104166
|
-
this.container = append$1(this.parent, $$
|
|
104166
|
+
this.container = append$1(this.parent, $$9('.quick-input-list'));
|
|
104167
104167
|
const delegate = new ListElementDelegate();
|
|
104168
104168
|
const accessibilityProvider = new QuickInputAccessibilityProvider();
|
|
104169
104169
|
this.list = options.createList('QuickInput', this.container, delegate, [new ListElementRenderer(themeService)], {
|
|
@@ -105674,7 +105674,7 @@ class InputBox extends QuickInput {
|
|
|
105674
105674
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
105675
105675
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
105676
105676
|
*--------------------------------------------------------------------------------------------*/
|
|
105677
|
-
const $$
|
|
105677
|
+
const $$8 = $$e;
|
|
105678
105678
|
class QuickInputController extends Disposable {
|
|
105679
105679
|
constructor(options, themeService) {
|
|
105680
105680
|
super();
|
|
@@ -105708,19 +105708,19 @@ class QuickInputController extends Disposable {
|
|
|
105708
105708
|
if (this.ui) {
|
|
105709
105709
|
return this.ui;
|
|
105710
105710
|
}
|
|
105711
|
-
const container = append$1(this.parentElement, $$
|
|
105711
|
+
const container = append$1(this.parentElement, $$8('.quick-input-widget.show-file-icons'));
|
|
105712
105712
|
container.tabIndex = -1;
|
|
105713
105713
|
container.style.display = 'none';
|
|
105714
105714
|
const styleSheet = createStyleSheet(container);
|
|
105715
|
-
const titleBar = append$1(container, $$
|
|
105715
|
+
const titleBar = append$1(container, $$8('.quick-input-titlebar'));
|
|
105716
105716
|
const actionBarOption = this.options.hoverDelegate ? { hoverDelegate: this.options.hoverDelegate } : undefined;
|
|
105717
105717
|
const leftActionBar = this._register(new ActionBar(titleBar, actionBarOption));
|
|
105718
105718
|
leftActionBar.domNode.classList.add('quick-input-left-action-bar');
|
|
105719
|
-
const title = append$1(titleBar, $$
|
|
105719
|
+
const title = append$1(titleBar, $$8('.quick-input-title'));
|
|
105720
105720
|
const rightActionBar = this._register(new ActionBar(titleBar, actionBarOption));
|
|
105721
105721
|
rightActionBar.domNode.classList.add('quick-input-right-action-bar');
|
|
105722
|
-
const headerContainer = append$1(container, $$
|
|
105723
|
-
const checkAll = append$1(headerContainer, $$
|
|
105722
|
+
const headerContainer = append$1(container, $$8('.quick-input-header'));
|
|
105723
|
+
const checkAll = append$1(headerContainer, $$8('input.quick-input-check-all'));
|
|
105724
105724
|
checkAll.type = 'checkbox';
|
|
105725
105725
|
checkAll.setAttribute('aria-label', localize('quickInput.checkAll', "Toggle all checkboxes"));
|
|
105726
105726
|
this._register(addStandardDisposableListener(checkAll, EventType$1.CHANGE, e => {
|
|
@@ -105732,36 +105732,36 @@ class QuickInputController extends Disposable {
|
|
|
105732
105732
|
inputBox.setFocus();
|
|
105733
105733
|
}
|
|
105734
105734
|
}));
|
|
105735
|
-
const description2 = append$1(headerContainer, $$
|
|
105736
|
-
const inputContainer = append$1(headerContainer, $$
|
|
105737
|
-
const filterContainer = append$1(inputContainer, $$
|
|
105735
|
+
const description2 = append$1(headerContainer, $$8('.quick-input-description'));
|
|
105736
|
+
const inputContainer = append$1(headerContainer, $$8('.quick-input-and-message'));
|
|
105737
|
+
const filterContainer = append$1(inputContainer, $$8('.quick-input-filter'));
|
|
105738
105738
|
const inputBox = this._register(new QuickInputBox(filterContainer, this.styles.inputBox, this.styles.toggle));
|
|
105739
105739
|
inputBox.setAttribute('aria-describedby', `${this.idPrefix}message`);
|
|
105740
|
-
const visibleCountContainer = append$1(filterContainer, $$
|
|
105740
|
+
const visibleCountContainer = append$1(filterContainer, $$8('.quick-input-visible-count'));
|
|
105741
105741
|
visibleCountContainer.setAttribute('aria-live', 'polite');
|
|
105742
105742
|
visibleCountContainer.setAttribute('aria-atomic', 'true');
|
|
105743
105743
|
const visibleCount = new CountBadge(visibleCountContainer, { countFormat: localize({ key: 'quickInput.visibleCount', comment: ['This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers.'] }, "{0} Results") }, this.styles.countBadge);
|
|
105744
|
-
const countContainer = append$1(filterContainer, $$
|
|
105744
|
+
const countContainer = append$1(filterContainer, $$8('.quick-input-count'));
|
|
105745
105745
|
countContainer.setAttribute('aria-live', 'polite');
|
|
105746
105746
|
const count = new CountBadge(countContainer, { countFormat: localize({ key: 'quickInput.countSelected', comment: ['This tells the user how many items are selected in a list of items to select from. The items can be anything.'] }, "{0} Selected") }, this.styles.countBadge);
|
|
105747
|
-
const okContainer = append$1(headerContainer, $$
|
|
105747
|
+
const okContainer = append$1(headerContainer, $$8('.quick-input-action'));
|
|
105748
105748
|
const ok = this._register(new Button(okContainer, this.styles.button));
|
|
105749
105749
|
ok.label = localize('ok', "OK");
|
|
105750
105750
|
this._register(ok.onDidClick(e => {
|
|
105751
105751
|
this.onDidAcceptEmitter.fire();
|
|
105752
105752
|
}));
|
|
105753
|
-
const customButtonContainer = append$1(headerContainer, $$
|
|
105753
|
+
const customButtonContainer = append$1(headerContainer, $$8('.quick-input-action'));
|
|
105754
105754
|
const customButton = this._register(new Button(customButtonContainer, this.styles.button));
|
|
105755
105755
|
customButton.label = localize('custom', "Custom");
|
|
105756
105756
|
this._register(customButton.onDidClick(e => {
|
|
105757
105757
|
this.onDidCustomEmitter.fire();
|
|
105758
105758
|
}));
|
|
105759
|
-
const message = append$1(inputContainer, $$
|
|
105759
|
+
const message = append$1(inputContainer, $$8(`#${this.idPrefix}message.quick-input-message`));
|
|
105760
105760
|
const progressBar = this._register(new ProgressBar(container, this.styles.progressBar));
|
|
105761
105761
|
progressBar.getContainer().classList.add('quick-input-progress');
|
|
105762
|
-
const widget = append$1(container, $$
|
|
105762
|
+
const widget = append$1(container, $$8('.quick-input-html-widget'));
|
|
105763
105763
|
widget.tabIndex = -1;
|
|
105764
|
-
const description1 = append$1(container, $$
|
|
105764
|
+
const description1 = append$1(container, $$8('.quick-input-description'));
|
|
105765
105765
|
const listId = this.idPrefix + 'list';
|
|
105766
105766
|
const list = this._register(new QuickInputList(container, listId, this.options, this.themeService));
|
|
105767
105767
|
inputBox.setAttribute('aria-controls', listId);
|
|
@@ -108091,7 +108091,7 @@ let BrowserClipboardService = class BrowserClipboardService extends Disposable {
|
|
|
108091
108091
|
}
|
|
108092
108092
|
// Fallback to textarea and execCommand solution
|
|
108093
108093
|
const activeElement = document.activeElement;
|
|
108094
|
-
const textArea = document.body.appendChild($$
|
|
108094
|
+
const textArea = document.body.appendChild($$e('textarea', { 'aria-hidden': true }));
|
|
108095
108095
|
textArea.style.height = '1px';
|
|
108096
108096
|
textArea.style.width = '1px';
|
|
108097
108097
|
textArea.style.position = 'absolute';
|
|
@@ -112815,7 +112815,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
112815
112815
|
this._nodes = h$1('div.diff-hidden-lines', [
|
|
112816
112816
|
h$1('div.top@top', { title: localize('diff.hiddenLines.top', 'Click or drag to show more above') }),
|
|
112817
112817
|
h$1('div.center@content', { style: { display: 'flex' } }, [
|
|
112818
|
-
h$1('div@first', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: '0' } }, [$$
|
|
112818
|
+
h$1('div@first', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: '0' } }, [$$e('a', { title: localize('showAll', 'Show all'), role: 'button', onclick: () => { this._unchangedRegion.showAll(undefined); } }, ...renderLabelWithIcons('$(unfold)'))]),
|
|
112819
112819
|
h$1('div@others', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } }),
|
|
112820
112820
|
]),
|
|
112821
112821
|
h$1('div.bottom@bottom', { title: localize('diff.bottom', 'Click or drag to show more below'), role: 'button' }),
|
|
@@ -112901,7 +112901,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
112901
112901
|
if (!this.hide) {
|
|
112902
112902
|
const lineCount = _unchangedRegion.getHiddenModifiedRange(reader).length;
|
|
112903
112903
|
const linesHiddenText = localize('hiddenLines', '{0} hidden lines', lineCount);
|
|
112904
|
-
const span = $$
|
|
112904
|
+
const span = $$e('span', { title: localize('diff.hiddenLines.expandAll', 'Double click to unfold') }, linesHiddenText);
|
|
112905
112905
|
span.addEventListener('dblclick', e => {
|
|
112906
112906
|
if (e.button !== 0) {
|
|
112907
112907
|
return;
|
|
@@ -112913,7 +112913,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
112913
112913
|
const range = this._unchangedRegion.getHiddenModifiedRange(reader);
|
|
112914
112914
|
const items = this._modifiedOutlineSource.getBreadcrumbItems(range, reader);
|
|
112915
112915
|
if (items.length > 0) {
|
|
112916
|
-
children.push($$
|
|
112916
|
+
children.push($$e('span', undefined, '\u00a0\u00a0|\u00a0\u00a0'));
|
|
112917
112917
|
for (let i = 0; i < items.length; i++) {
|
|
112918
112918
|
const item = items[i];
|
|
112919
112919
|
const icon = SymbolKinds.toIcon(item.kind);
|
|
@@ -114086,7 +114086,7 @@ let ViewZoneManager = class ViewZoneManager extends Disposable {
|
|
|
114086
114086
|
function createViewZoneMarginArrow() {
|
|
114087
114087
|
const arrow = document.createElement('div');
|
|
114088
114088
|
arrow.className = 'arrow-revert-change ' + ThemeIcon.asClassName(Codicon.arrowRight);
|
|
114089
|
-
return $$
|
|
114089
|
+
return $$e('div', {}, arrow);
|
|
114090
114090
|
}
|
|
114091
114091
|
let marginDomNode = undefined;
|
|
114092
114092
|
if (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderRevertArrows.read(reader)) {
|
|
@@ -114898,7 +114898,7 @@ let DiffEditorWidget = class DiffEditorWidget extends DelegatingEditor {
|
|
|
114898
114898
|
this._audioCueService = _audioCueService;
|
|
114899
114899
|
this._editorProgressService = _editorProgressService;
|
|
114900
114900
|
this.elements = h$1('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [
|
|
114901
|
-
h$1('div.noModificationsOverlay@overlay', { style: { position: 'absolute', height: '100%', visibility: 'hidden', } }, [$$
|
|
114901
|
+
h$1('div.noModificationsOverlay@overlay', { style: { position: 'absolute', height: '100%', visibility: 'hidden', } }, [$$e('span', {}, 'No Changes')]),
|
|
114902
114902
|
h$1('div.editor.original@original', { style: { position: 'absolute', height: '100%' } }),
|
|
114903
114903
|
h$1('div.editor.modified@modified', { style: { position: 'absolute', height: '100%' } }),
|
|
114904
114904
|
h$1('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }),
|
|
@@ -118028,7 +118028,7 @@ registerLanguage({
|
|
|
118028
118028
|
mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
|
|
118029
118029
|
loader: () => {
|
|
118030
118030
|
{
|
|
118031
|
-
return import('./html-
|
|
118031
|
+
return import('./html-2bce5d77.js');
|
|
118032
118032
|
}
|
|
118033
118033
|
}
|
|
118034
118034
|
});
|
|
@@ -118048,7 +118048,7 @@ registerLanguage({
|
|
|
118048
118048
|
mimetypes: ["text/javascript"],
|
|
118049
118049
|
loader: () => {
|
|
118050
118050
|
{
|
|
118051
|
-
return import('./javascript-
|
|
118051
|
+
return import('./javascript-ded5c9d7.js');
|
|
118052
118052
|
}
|
|
118053
118053
|
}
|
|
118054
118054
|
});
|
|
@@ -118066,7 +118066,7 @@ registerLanguage({
|
|
|
118066
118066
|
mimetypes: ["text/typescript"],
|
|
118067
118067
|
loader: () => {
|
|
118068
118068
|
{
|
|
118069
|
-
return import('./typescript-
|
|
118069
|
+
return import('./typescript-cc4d00f0.js');
|
|
118070
118070
|
}
|
|
118071
118071
|
}
|
|
118072
118072
|
});
|
|
@@ -118187,7 +118187,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, m
|
|
|
118187
118187
|
monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
|
|
118188
118188
|
function getMode$3() {
|
|
118189
118189
|
{
|
|
118190
|
-
return import('./cssMode-
|
|
118190
|
+
return import('./cssMode-3d18bd2b.js');
|
|
118191
118191
|
}
|
|
118192
118192
|
}
|
|
118193
118193
|
monaco_editor_core_exports$3.languages.onLanguage("less", () => {
|
|
@@ -118312,7 +118312,7 @@ monaco_editor_core_exports$2.languages.html = {
|
|
|
118312
118312
|
};
|
|
118313
118313
|
function getMode$2() {
|
|
118314
118314
|
{
|
|
118315
|
-
return import('./htmlMode-
|
|
118315
|
+
return import('./htmlMode-69d56956.js');
|
|
118316
118316
|
}
|
|
118317
118317
|
}
|
|
118318
118318
|
function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
|
|
@@ -118414,7 +118414,7 @@ var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault,
|
|
|
118414
118414
|
monaco_editor_core_exports$1.languages.json = { jsonDefaults };
|
|
118415
118415
|
function getMode$1() {
|
|
118416
118416
|
{
|
|
118417
|
-
return import('./jsonMode-
|
|
118417
|
+
return import('./jsonMode-0bf84cb2.js');
|
|
118418
118418
|
}
|
|
118419
118419
|
}
|
|
118420
118420
|
monaco_editor_core_exports$1.languages.register({
|
|
@@ -118683,7 +118683,7 @@ monaco_editor_core_exports.languages.typescript = {
|
|
|
118683
118683
|
};
|
|
118684
118684
|
function getMode() {
|
|
118685
118685
|
{
|
|
118686
|
-
return import('./tsMode-
|
|
118686
|
+
return import('./tsMode-15d4e936.js');
|
|
118687
118687
|
}
|
|
118688
118688
|
}
|
|
118689
118689
|
monaco_editor_core_exports.languages.onLanguage("typescript", () => {
|
|
@@ -120666,7 +120666,7 @@ let LightBulbWidget = LightBulbWidget_1 = class LightBulbWidget extends Disposab
|
|
|
120666
120666
|
this._onClick = this._register(new Emitter$1());
|
|
120667
120667
|
this.onClick = this._onClick.event;
|
|
120668
120668
|
this._state = LightBulbState.Hidden;
|
|
120669
|
-
this._domNode = $$
|
|
120669
|
+
this._domNode = $$e('div.lightBulbWidget');
|
|
120670
120670
|
this._register(Gesture.ignoreTarget(this._domNode));
|
|
120671
120671
|
this._editor.addContentWidget(this);
|
|
120672
120672
|
this._register(this._editor.onDidChangeModelContent(_ => {
|
|
@@ -121473,7 +121473,7 @@ let ActionWidgetService = class ActionWidgetService extends Disposable {
|
|
|
121473
121473
|
if (!actions.length) {
|
|
121474
121474
|
return undefined;
|
|
121475
121475
|
}
|
|
121476
|
-
const container = $$
|
|
121476
|
+
const container = $$e(className);
|
|
121477
121477
|
const actionBar = new ActionBar(container);
|
|
121478
121478
|
actionBar.push(actions, { icon: false, label: true });
|
|
121479
121479
|
return actionBar;
|
|
@@ -122667,20 +122667,20 @@ class CodeLensContentWidget {
|
|
|
122667
122667
|
if (lens.command) {
|
|
122668
122668
|
const title = renderLabelWithIcons(lens.command.title.trim());
|
|
122669
122669
|
if (lens.command.id) {
|
|
122670
|
-
children.push($$
|
|
122670
|
+
children.push($$e('a', { id: String(i), title: lens.command.tooltip, role: 'button' }, ...title));
|
|
122671
122671
|
this._commands.set(String(i), lens.command);
|
|
122672
122672
|
}
|
|
122673
122673
|
else {
|
|
122674
|
-
children.push($$
|
|
122674
|
+
children.push($$e('span', { title: lens.command.tooltip }, ...title));
|
|
122675
122675
|
}
|
|
122676
122676
|
if (i + 1 < lenses.length) {
|
|
122677
|
-
children.push($$
|
|
122677
|
+
children.push($$e('span', undefined, '\u00a0|\u00a0'));
|
|
122678
122678
|
}
|
|
122679
122679
|
}
|
|
122680
122680
|
}
|
|
122681
122681
|
if (!hasSymbol) {
|
|
122682
122682
|
// symbols but no commands
|
|
122683
|
-
reset(this._domNode, $$
|
|
122683
|
+
reset(this._domNode, $$e('span', undefined, 'no commands'));
|
|
122684
122684
|
}
|
|
122685
122685
|
else {
|
|
122686
122686
|
// symbols and commands
|
|
@@ -123832,22 +123832,22 @@ class ColorPickerModel {
|
|
|
123832
123832
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
123833
123833
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
123834
123834
|
*--------------------------------------------------------------------------------------------*/
|
|
123835
|
-
const $$
|
|
123835
|
+
const $$7 = $$e;
|
|
123836
123836
|
class ColorPickerHeader extends Disposable {
|
|
123837
123837
|
constructor(container, model, themeService, showingStandaloneColorPicker = false) {
|
|
123838
123838
|
super();
|
|
123839
123839
|
this.model = model;
|
|
123840
123840
|
this.showingStandaloneColorPicker = showingStandaloneColorPicker;
|
|
123841
123841
|
this._closeButton = null;
|
|
123842
|
-
this._domNode = $$
|
|
123842
|
+
this._domNode = $$7('.colorpicker-header');
|
|
123843
123843
|
append$1(container, this._domNode);
|
|
123844
|
-
this._pickedColorNode = append$1(this._domNode, $$
|
|
123845
|
-
append$1(this._pickedColorNode, $$
|
|
123844
|
+
this._pickedColorNode = append$1(this._domNode, $$7('.picked-color'));
|
|
123845
|
+
append$1(this._pickedColorNode, $$7('span.codicon.codicon-color-mode'));
|
|
123846
123846
|
this._pickedColorPresentation = append$1(this._pickedColorNode, document.createElement('span'));
|
|
123847
123847
|
this._pickedColorPresentation.classList.add('picked-color-presentation');
|
|
123848
123848
|
const tooltip = localize('clickToToggleColorOptions', "Click to toggle color options (rgb/hsl/hex)");
|
|
123849
123849
|
this._pickedColorNode.setAttribute('title', tooltip);
|
|
123850
|
-
this._originalColorNode = append$1(this._domNode, $$
|
|
123850
|
+
this._originalColorNode = append$1(this._domNode, $$7('.original-color'));
|
|
123851
123851
|
this._originalColorNode.style.backgroundColor = Color.Format.CSS.format(this.model.originalColor) || '';
|
|
123852
123852
|
this.backgroundColor = themeService.getColorTheme().getColor(editorHoverBackground) || Color.white;
|
|
123853
123853
|
this._register(themeService.onDidColorThemeChange(theme => {
|
|
@@ -123898,7 +123898,7 @@ class CloseButton extends Disposable {
|
|
|
123898
123898
|
const innerDiv = document.createElement('div');
|
|
123899
123899
|
innerDiv.classList.add('close-button-inner-div');
|
|
123900
123900
|
append$1(this._button, innerDiv);
|
|
123901
|
-
const closeButton = append$1(innerDiv, $$
|
|
123901
|
+
const closeButton = append$1(innerDiv, $$7('.button' + ThemeIcon.asCSSSelector(registerIcon('color-picker-close', Codicon.close, localize('closeIcon', 'Icon to close the color picker')))));
|
|
123902
123902
|
closeButton.classList.add('close-icon');
|
|
123903
123903
|
this._button.onclick = () => {
|
|
123904
123904
|
this._onClicked.fire();
|
|
@@ -123911,7 +123911,7 @@ class ColorPickerBody extends Disposable {
|
|
|
123911
123911
|
this.model = model;
|
|
123912
123912
|
this.pixelRatio = pixelRatio;
|
|
123913
123913
|
this._insertButton = null;
|
|
123914
|
-
this._domNode = $$
|
|
123914
|
+
this._domNode = $$7('.colorpicker-body');
|
|
123915
123915
|
append$1(container, this._domNode);
|
|
123916
123916
|
this._saturationBox = new SaturationBox(this._domNode, this.model, this.pixelRatio);
|
|
123917
123917
|
this._register(this._saturationBox);
|
|
@@ -123970,14 +123970,14 @@ class SaturationBox extends Disposable {
|
|
|
123970
123970
|
this.onDidChange = this._onDidChange.event;
|
|
123971
123971
|
this._onColorFlushed = new Emitter$1();
|
|
123972
123972
|
this.onColorFlushed = this._onColorFlushed.event;
|
|
123973
|
-
this._domNode = $$
|
|
123973
|
+
this._domNode = $$7('.saturation-wrap');
|
|
123974
123974
|
append$1(container, this._domNode);
|
|
123975
123975
|
// Create canvas, draw selected color
|
|
123976
123976
|
this._canvas = document.createElement('canvas');
|
|
123977
123977
|
this._canvas.className = 'saturation-box';
|
|
123978
123978
|
append$1(this._domNode, this._canvas);
|
|
123979
123979
|
// Add selection circle
|
|
123980
|
-
this.selection = $$
|
|
123980
|
+
this.selection = $$7('.saturation-selection');
|
|
123981
123981
|
append$1(this._domNode, this.selection);
|
|
123982
123982
|
this.layout();
|
|
123983
123983
|
this._register(addDisposableListener(this._domNode, EventType$1.POINTER_DOWN, e => this.onPointerDown(e)));
|
|
@@ -124062,14 +124062,14 @@ class Strip extends Disposable {
|
|
|
124062
124062
|
this._onColorFlushed = new Emitter$1();
|
|
124063
124063
|
this.onColorFlushed = this._onColorFlushed.event;
|
|
124064
124064
|
if (showingStandaloneColorPicker) {
|
|
124065
|
-
this.domNode = append$1(container, $$
|
|
124066
|
-
this.overlay = append$1(this.domNode, $$
|
|
124065
|
+
this.domNode = append$1(container, $$7('.standalone-strip'));
|
|
124066
|
+
this.overlay = append$1(this.domNode, $$7('.standalone-overlay'));
|
|
124067
124067
|
}
|
|
124068
124068
|
else {
|
|
124069
|
-
this.domNode = append$1(container, $$
|
|
124070
|
-
this.overlay = append$1(this.domNode, $$
|
|
124069
|
+
this.domNode = append$1(container, $$7('.strip'));
|
|
124070
|
+
this.overlay = append$1(this.domNode, $$7('.overlay'));
|
|
124071
124071
|
}
|
|
124072
|
-
this.slider = append$1(this.domNode, $$
|
|
124072
|
+
this.slider = append$1(this.domNode, $$7('.slider'));
|
|
124073
124073
|
this.slider.style.top = `0px`;
|
|
124074
124074
|
this._register(addDisposableListener(this.domNode, EventType$1.POINTER_DOWN, e => this.onPointerDown(e)));
|
|
124075
124075
|
this._register(model.onDidChangeColor(this.onDidChangeColor, this));
|
|
@@ -124159,7 +124159,7 @@ class ColorPickerWidget extends Widget$1 {
|
|
|
124159
124159
|
this.model = model;
|
|
124160
124160
|
this.pixelRatio = pixelRatio;
|
|
124161
124161
|
this._register(PixelRatio.onDidChange(() => this.layout()));
|
|
124162
|
-
const element = $$
|
|
124162
|
+
const element = $$7('.colorpicker-widget');
|
|
124163
124163
|
container.appendChild(element);
|
|
124164
124164
|
this.header = this._register(new ColorPickerHeader(element, this.model, themeService, standaloneColorPicker));
|
|
124165
124165
|
this.body = this._register(new ColorPickerBody(element, this.model, this.pixelRatio, standaloneColorPicker));
|
|
@@ -125103,26 +125103,26 @@ let PeekViewWidget = class PeekViewWidget extends ZoneWidget {
|
|
|
125103
125103
|
}
|
|
125104
125104
|
_fillContainer(container) {
|
|
125105
125105
|
this.setCssClass('peekview-widget');
|
|
125106
|
-
this._headElement = $$
|
|
125107
|
-
this._bodyElement = $$
|
|
125106
|
+
this._headElement = $$e('.head');
|
|
125107
|
+
this._bodyElement = $$e('.body');
|
|
125108
125108
|
this._fillHead(this._headElement);
|
|
125109
125109
|
this._fillBody(this._bodyElement);
|
|
125110
125110
|
container.appendChild(this._headElement);
|
|
125111
125111
|
container.appendChild(this._bodyElement);
|
|
125112
125112
|
}
|
|
125113
125113
|
_fillHead(container, noCloseAction) {
|
|
125114
|
-
this._titleElement = $$
|
|
125114
|
+
this._titleElement = $$e('.peekview-title');
|
|
125115
125115
|
if (this.options.supportOnTitleClick) {
|
|
125116
125116
|
this._titleElement.classList.add('clickable');
|
|
125117
125117
|
addStandardDisposableListener(this._titleElement, 'click', event => this._onTitleClick(event));
|
|
125118
125118
|
}
|
|
125119
125119
|
append$1(this._headElement, this._titleElement);
|
|
125120
125120
|
this._fillTitleIcon(this._titleElement);
|
|
125121
|
-
this._primaryHeading = $$
|
|
125122
|
-
this._secondaryHeading = $$
|
|
125123
|
-
this._metaHeading = $$
|
|
125121
|
+
this._primaryHeading = $$e('span.filename');
|
|
125122
|
+
this._secondaryHeading = $$e('span.dirname');
|
|
125123
|
+
this._metaHeading = $$e('span.meta');
|
|
125124
125124
|
append$1(this._titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading);
|
|
125125
|
-
const actionsContainer = $$
|
|
125125
|
+
const actionsContainer = $$e('.peekview-actions');
|
|
125126
125126
|
append$1(this._headElement, actionsContainer);
|
|
125127
125127
|
const actionBarOptions = this._getActionBarOptions();
|
|
125128
125128
|
this._actionbarWidget = new ActionBar(actionsContainer, actionBarOptions);
|
|
@@ -125546,7 +125546,7 @@ let FileReferencesTemplate = class FileReferencesTemplate extends Disposable {
|
|
|
125546
125546
|
const parent = document.createElement('div');
|
|
125547
125547
|
parent.classList.add('reference-file');
|
|
125548
125548
|
this.file = this._register(new IconLabel(parent, { supportHighlights: true }));
|
|
125549
|
-
this.badge = new CountBadge(append$1(parent, $$
|
|
125549
|
+
this.badge = new CountBadge(append$1(parent, $$e('.count')), {}, defaultCountBadgeStyles);
|
|
125550
125550
|
container.appendChild(parent);
|
|
125551
125551
|
}
|
|
125552
125552
|
set(element, matches) {
|
|
@@ -125858,11 +125858,11 @@ let ReferenceWidget = class ReferenceWidget extends PeekViewWidget {
|
|
|
125858
125858
|
_fillBody(containerElement) {
|
|
125859
125859
|
this.setCssClass('reference-zone-widget');
|
|
125860
125860
|
// message pane
|
|
125861
|
-
this._messageContainer = append$1(containerElement, $$
|
|
125861
|
+
this._messageContainer = append$1(containerElement, $$e('div.messages'));
|
|
125862
125862
|
hide(this._messageContainer);
|
|
125863
125863
|
this._splitView = new SplitView(containerElement, { orientation: 1 /* Orientation.HORIZONTAL */ });
|
|
125864
125864
|
// editor
|
|
125865
|
-
this._previewContainer = append$1(containerElement, $$
|
|
125865
|
+
this._previewContainer = append$1(containerElement, $$e('div.preview.inline'));
|
|
125866
125866
|
const options = {
|
|
125867
125867
|
scrollBeyondLastLine: false,
|
|
125868
125868
|
scrollbar: {
|
|
@@ -125883,7 +125883,7 @@ let ReferenceWidget = class ReferenceWidget extends PeekViewWidget {
|
|
|
125883
125883
|
hide(this._previewContainer);
|
|
125884
125884
|
this._previewNotAvailableMessage = new TextModel(localize('missingPreviewMessage', "no preview available"), PLAINTEXT_LANGUAGE_ID, TextModel.DEFAULT_CREATION_OPTIONS, null, this._undoRedoService, this._languageService, this._languageConfigurationService);
|
|
125885
125885
|
// tree
|
|
125886
|
-
this._treeContainer = append$1(containerElement, $$
|
|
125886
|
+
this._treeContainer = append$1(containerElement, $$e('div.ref-tree.inline'));
|
|
125887
125887
|
const treeOptions = {
|
|
125888
125888
|
keyboardSupport: this._defaultTreeKeyboardSupport,
|
|
125889
125889
|
accessibilityProvider: new AccessibilityProvider(),
|
|
@@ -127729,7 +127729,7 @@ registerEditorContribution(GotoDefinitionAtPositionEditorContribution.ID, GotoDe
|
|
|
127729
127729
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
127730
127730
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
127731
127731
|
*--------------------------------------------------------------------------------------------*/
|
|
127732
|
-
const $$
|
|
127732
|
+
const $$6 = $$e;
|
|
127733
127733
|
class HoverWidget extends Disposable {
|
|
127734
127734
|
constructor() {
|
|
127735
127735
|
super();
|
|
@@ -127754,14 +127754,14 @@ class HoverAction extends Disposable {
|
|
|
127754
127754
|
}
|
|
127755
127755
|
constructor(parent, actionOptions, keybindingLabel) {
|
|
127756
127756
|
super();
|
|
127757
|
-
this.actionContainer = append$1(parent, $$
|
|
127757
|
+
this.actionContainer = append$1(parent, $$6('div.action-container'));
|
|
127758
127758
|
this.actionContainer.setAttribute('tabindex', '0');
|
|
127759
|
-
this.action = append$1(this.actionContainer, $$
|
|
127759
|
+
this.action = append$1(this.actionContainer, $$6('a.action'));
|
|
127760
127760
|
this.action.setAttribute('role', 'button');
|
|
127761
127761
|
if (actionOptions.iconClass) {
|
|
127762
|
-
append$1(this.action, $$
|
|
127762
|
+
append$1(this.action, $$6(`span.icon.${actionOptions.iconClass}`));
|
|
127763
127763
|
}
|
|
127764
|
-
const label = append$1(this.action, $$
|
|
127764
|
+
const label = append$1(this.action, $$6('span'));
|
|
127765
127765
|
label.textContent = keybindingLabel ? `${actionOptions.label} (${keybindingLabel})` : actionOptions.label;
|
|
127766
127766
|
this._register(addDisposableListener(this.actionContainer, EventType$1.CLICK, e => {
|
|
127767
127767
|
e.stopPropagation();
|
|
@@ -128260,7 +128260,7 @@ var __param$15 = (undefined && undefined.__param) || function (paramIndex, decor
|
|
|
128260
128260
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
128261
128261
|
};
|
|
128262
128262
|
var ContentHoverController_1, ContentHoverWidget_1;
|
|
128263
|
-
const $$
|
|
128263
|
+
const $$5 = $$e;
|
|
128264
128264
|
let ContentHoverController = ContentHoverController_1 = class ContentHoverController extends Disposable {
|
|
128265
128265
|
constructor(_editor, _instantiationService, _keybindingService) {
|
|
128266
128266
|
super();
|
|
@@ -129000,8 +129000,8 @@ let EditorHoverStatusBar = class EditorHoverStatusBar extends Disposable {
|
|
|
129000
129000
|
super();
|
|
129001
129001
|
this._keybindingService = _keybindingService;
|
|
129002
129002
|
this._hasContent = false;
|
|
129003
|
-
this.hoverElement = $$
|
|
129004
|
-
this.actionsElement = append$1(this.hoverElement, $$
|
|
129003
|
+
this.hoverElement = $$5('div.hover-row.status-bar');
|
|
129004
|
+
this.actionsElement = append$1(this.hoverElement, $$5('div.actions'));
|
|
129005
129005
|
}
|
|
129006
129006
|
addAction(actionOptions) {
|
|
129007
129007
|
const keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId);
|
|
@@ -129103,7 +129103,7 @@ function computeDistanceFromPointToRectangle(pointX, pointY, left, top, width, h
|
|
|
129103
129103
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
129104
129104
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
129105
129105
|
*--------------------------------------------------------------------------------------------*/
|
|
129106
|
-
const $$
|
|
129106
|
+
const $$4 = $$e;
|
|
129107
129107
|
class MarginHoverWidget extends Disposable {
|
|
129108
129108
|
constructor(editor, languageService, openerService) {
|
|
129109
129109
|
super();
|
|
@@ -129184,8 +129184,8 @@ class MarginHoverWidget extends Disposable {
|
|
|
129184
129184
|
this._renderDisposeables.clear();
|
|
129185
129185
|
const fragment = document.createDocumentFragment();
|
|
129186
129186
|
for (const msg of messages) {
|
|
129187
|
-
const markdownHoverElement = $$
|
|
129188
|
-
const hoverContentsElement = append$1(markdownHoverElement, $$
|
|
129187
|
+
const markdownHoverElement = $$4('div.hover-row.markdown-hover');
|
|
129188
|
+
const hoverContentsElement = append$1(markdownHoverElement, $$4('div.hover-contents'));
|
|
129189
129189
|
const renderedContents = this._renderDisposeables.add(this._markdownRenderer.render(msg.value));
|
|
129190
129190
|
hoverContentsElement.appendChild(renderedContents.element);
|
|
129191
129191
|
fragment.appendChild(markdownHoverElement);
|
|
@@ -129315,7 +129315,7 @@ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
129315
129315
|
var __param$14 = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
129316
129316
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
129317
129317
|
};
|
|
129318
|
-
const $$
|
|
129318
|
+
const $$3 = $$e;
|
|
129319
129319
|
class MarkdownHover {
|
|
129320
129320
|
constructor(owner, range, contents, isBeforeContent, ordinal) {
|
|
129321
129321
|
this.owner = owner;
|
|
@@ -129420,8 +129420,8 @@ function renderMarkdownHovers(context, hoverParts, editor, languageService, open
|
|
|
129420
129420
|
if (isEmptyMarkdownString(contents)) {
|
|
129421
129421
|
continue;
|
|
129422
129422
|
}
|
|
129423
|
-
const markdownHoverElement = $$
|
|
129424
|
-
const hoverContentsElement = append$1(markdownHoverElement, $$
|
|
129423
|
+
const markdownHoverElement = $$3('div.hover-row.markdown-hover');
|
|
129424
|
+
const hoverContentsElement = append$1(markdownHoverElement, $$3('div.hover-contents'));
|
|
129425
129425
|
const renderer = disposables.add(new MarkdownRenderer({ editor }, languageService, openerService));
|
|
129426
129426
|
disposables.add(renderer.onDidRenderAsync(() => {
|
|
129427
129427
|
hoverContentsElement.className = 'hover-contents code-hover-contents';
|
|
@@ -129742,14 +129742,14 @@ class MessageWidget {
|
|
|
129742
129742
|
detailsElement.appendChild(codeElement);
|
|
129743
129743
|
}
|
|
129744
129744
|
else {
|
|
129745
|
-
this._codeLink = $$
|
|
129745
|
+
this._codeLink = $$e('a.code-link');
|
|
129746
129746
|
this._codeLink.setAttribute('href', `${code.target.toString()}`);
|
|
129747
129747
|
this._codeLink.onclick = (e) => {
|
|
129748
129748
|
this._openerService.open(code.target, { allowCommands: true });
|
|
129749
129749
|
e.preventDefault();
|
|
129750
129750
|
e.stopPropagation();
|
|
129751
129751
|
};
|
|
129752
|
-
const codeElement = append$1(this._codeLink, $$
|
|
129752
|
+
const codeElement = append$1(this._codeLink, $$e('span'));
|
|
129753
129753
|
codeElement.innerText = code.value;
|
|
129754
129754
|
detailsElement.appendChild(this._codeLink);
|
|
129755
129755
|
}
|
|
@@ -129873,7 +129873,7 @@ let MarkerNavigationWidget = MarkerNavigationWidget_1 = class MarkerNavigationWi
|
|
|
129873
129873
|
menu.dispose();
|
|
129874
129874
|
}
|
|
129875
129875
|
_fillTitleIcon(container) {
|
|
129876
|
-
this._icon = append$1(container, $$
|
|
129876
|
+
this._icon = append$1(container, $$e(''));
|
|
129877
129877
|
}
|
|
129878
129878
|
_fillBody(container) {
|
|
129879
129879
|
this._parentContainer = container;
|
|
@@ -130242,7 +130242,7 @@ var __decorate$10 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
130242
130242
|
var __param$10 = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
130243
130243
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
130244
130244
|
};
|
|
130245
|
-
const $$
|
|
130245
|
+
const $$2 = $$e;
|
|
130246
130246
|
class MarkerHover {
|
|
130247
130247
|
constructor(owner, range, marker) {
|
|
130248
130248
|
this.owner = owner;
|
|
@@ -130300,36 +130300,36 @@ let MarkerHoverParticipant = class MarkerHoverParticipant {
|
|
|
130300
130300
|
return disposables;
|
|
130301
130301
|
}
|
|
130302
130302
|
renderMarkerHover(markerHover, disposables) {
|
|
130303
|
-
const hoverElement = $$
|
|
130304
|
-
const markerElement = append$1(hoverElement, $$
|
|
130303
|
+
const hoverElement = $$2('div.hover-row');
|
|
130304
|
+
const markerElement = append$1(hoverElement, $$2('div.marker.hover-contents'));
|
|
130305
130305
|
const { source, message, code, relatedInformation } = markerHover.marker;
|
|
130306
130306
|
this._editor.applyFontInfo(markerElement);
|
|
130307
|
-
const messageElement = append$1(markerElement, $$
|
|
130307
|
+
const messageElement = append$1(markerElement, $$2('span'));
|
|
130308
130308
|
messageElement.style.whiteSpace = 'pre-wrap';
|
|
130309
130309
|
messageElement.innerText = message;
|
|
130310
130310
|
if (source || code) {
|
|
130311
130311
|
// Code has link
|
|
130312
130312
|
if (code && typeof code !== 'string') {
|
|
130313
|
-
const sourceAndCodeElement = $$
|
|
130313
|
+
const sourceAndCodeElement = $$2('span');
|
|
130314
130314
|
if (source) {
|
|
130315
|
-
const sourceElement = append$1(sourceAndCodeElement, $$
|
|
130315
|
+
const sourceElement = append$1(sourceAndCodeElement, $$2('span'));
|
|
130316
130316
|
sourceElement.innerText = source;
|
|
130317
130317
|
}
|
|
130318
|
-
const codeLink = append$1(sourceAndCodeElement, $$
|
|
130318
|
+
const codeLink = append$1(sourceAndCodeElement, $$2('a.code-link'));
|
|
130319
130319
|
codeLink.setAttribute('href', code.target.toString());
|
|
130320
130320
|
disposables.add(addDisposableListener(codeLink, 'click', (e) => {
|
|
130321
130321
|
this._openerService.open(code.target, { allowCommands: true });
|
|
130322
130322
|
e.preventDefault();
|
|
130323
130323
|
e.stopPropagation();
|
|
130324
130324
|
}));
|
|
130325
|
-
const codeElement = append$1(codeLink, $$
|
|
130325
|
+
const codeElement = append$1(codeLink, $$2('span'));
|
|
130326
130326
|
codeElement.innerText = code.value;
|
|
130327
130327
|
const detailsElement = append$1(markerElement, sourceAndCodeElement);
|
|
130328
130328
|
detailsElement.style.opacity = '0.6';
|
|
130329
130329
|
detailsElement.style.paddingLeft = '6px';
|
|
130330
130330
|
}
|
|
130331
130331
|
else {
|
|
130332
|
-
const detailsElement = append$1(markerElement, $$
|
|
130332
|
+
const detailsElement = append$1(markerElement, $$2('span'));
|
|
130333
130333
|
detailsElement.style.opacity = '0.6';
|
|
130334
130334
|
detailsElement.style.paddingLeft = '6px';
|
|
130335
130335
|
detailsElement.innerText = source && code ? `${source}(${code})` : source ? source : `(${code})`;
|
|
@@ -130337,9 +130337,9 @@ let MarkerHoverParticipant = class MarkerHoverParticipant {
|
|
|
130337
130337
|
}
|
|
130338
130338
|
if (isNonEmptyArray(relatedInformation)) {
|
|
130339
130339
|
for (const { message, resource, startLineNumber, startColumn } of relatedInformation) {
|
|
130340
|
-
const relatedInfoContainer = append$1(markerElement, $$
|
|
130340
|
+
const relatedInfoContainer = append$1(markerElement, $$2('div'));
|
|
130341
130341
|
relatedInfoContainer.style.marginTop = '8px';
|
|
130342
|
-
const a = append$1(relatedInfoContainer, $$
|
|
130342
|
+
const a = append$1(relatedInfoContainer, $$2('a'));
|
|
130343
130343
|
a.innerText = `${basename(resource)}(${startLineNumber}, ${startColumn}): `;
|
|
130344
130344
|
a.style.cursor = 'pointer';
|
|
130345
130345
|
disposables.add(addDisposableListener(a, 'click', (e) => {
|
|
@@ -130352,7 +130352,7 @@ let MarkerHoverParticipant = class MarkerHoverParticipant {
|
|
|
130352
130352
|
}).catch(onUnexpectedError);
|
|
130353
130353
|
}
|
|
130354
130354
|
}));
|
|
130355
|
-
const messageElement = append$1(relatedInfoContainer, $$
|
|
130355
|
+
const messageElement = append$1(relatedInfoContainer, $$2('span'));
|
|
130356
130356
|
messageElement.innerText = message;
|
|
130357
130357
|
this._editor.applyFontInfo(messageElement);
|
|
130358
130358
|
}
|
|
@@ -130373,7 +130373,7 @@ let MarkerHoverParticipant = class MarkerHoverParticipant {
|
|
|
130373
130373
|
});
|
|
130374
130374
|
}
|
|
130375
130375
|
if (!this._editor.getOption(90 /* EditorOption.readOnly */)) {
|
|
130376
|
-
const quickfixPlaceholderElement = context.statusBar.append($$
|
|
130376
|
+
const quickfixPlaceholderElement = context.statusBar.append($$2('div'));
|
|
130377
130377
|
if (this.recentMarkerCodeActionsInfo) {
|
|
130378
130378
|
if (IMarkerData.makeKey(this.recentMarkerCodeActionsInfo.marker) === IMarkerData.makeKey(markerHover.marker)) {
|
|
130379
130379
|
if (!this.recentMarkerCodeActionsInfo.hasCodeActions) {
|
|
@@ -133788,10 +133788,10 @@ class InlineProgressWidget extends Disposable {
|
|
|
133788
133788
|
this.editor.layoutContentWidget(this);
|
|
133789
133789
|
}
|
|
133790
133790
|
create(title) {
|
|
133791
|
-
this.domNode = $$
|
|
133791
|
+
this.domNode = $$e('.inline-progress-widget');
|
|
133792
133792
|
this.domNode.role = 'button';
|
|
133793
133793
|
this.domNode.title = title;
|
|
133794
|
-
const iconElement = $$
|
|
133794
|
+
const iconElement = $$e('span.icon');
|
|
133795
133795
|
this.domNode.append(iconElement);
|
|
133796
133796
|
iconElement.classList.add(...ThemeIcon.asClassNameArray(Codicon.loading), 'codicon-modifier-spin');
|
|
133797
133797
|
const updateSize = () => {
|
|
@@ -133934,7 +133934,7 @@ let PostEditWidget = PostEditWidget_1 = class PostEditWidget extends Disposable
|
|
|
133934
133934
|
this.button.element.title = this.showCommand.label + (binding ? ` (${binding})` : '');
|
|
133935
133935
|
}
|
|
133936
133936
|
create() {
|
|
133937
|
-
this.domNode = $$
|
|
133937
|
+
this.domNode = $$e('.post-edit-widget');
|
|
133938
133938
|
this.button = this._register(new Button(this.domNode, {
|
|
133939
133939
|
supportIcons: true,
|
|
133940
133940
|
}));
|
|
@@ -147794,7 +147794,7 @@ let SuggestWidgetStatus = class SuggestWidgetStatus {
|
|
|
147794
147794
|
this._menuService = _menuService;
|
|
147795
147795
|
this._contextKeyService = _contextKeyService;
|
|
147796
147796
|
this._menuDisposables = new DisposableStore();
|
|
147797
|
-
this.element = append$1(container, $$
|
|
147797
|
+
this.element = append$1(container, $$e('.suggest-status-bar'));
|
|
147798
147798
|
const actionViewItemProvider = (action => {
|
|
147799
147799
|
return action instanceof MenuItemAction ? instantiationService.createInstance(StatusBarViewItem, action, undefined) : undefined;
|
|
147800
147800
|
});
|
|
@@ -147867,20 +147867,20 @@ let SuggestDetailsWidget = class SuggestDetailsWidget {
|
|
|
147867
147867
|
this._renderDisposeable = new DisposableStore();
|
|
147868
147868
|
this._borderWidth = 1;
|
|
147869
147869
|
this._size = new Dimension(330, 0);
|
|
147870
|
-
this.domNode = $$
|
|
147870
|
+
this.domNode = $$e('.suggest-details');
|
|
147871
147871
|
this.domNode.classList.add('no-docs');
|
|
147872
147872
|
this._markdownRenderer = instaService.createInstance(MarkdownRenderer, { editor: _editor });
|
|
147873
|
-
this._body = $$
|
|
147873
|
+
this._body = $$e('.body');
|
|
147874
147874
|
this._scrollbar = new DomScrollableElement(this._body, {
|
|
147875
147875
|
alwaysConsumeMouseWheel: true,
|
|
147876
147876
|
});
|
|
147877
147877
|
append$1(this.domNode, this._scrollbar.getDomNode());
|
|
147878
147878
|
this._disposables.add(this._scrollbar);
|
|
147879
|
-
this._header = append$1(this._body, $$
|
|
147880
|
-
this._close = append$1(this._header, $$
|
|
147879
|
+
this._header = append$1(this._body, $$e('.header'));
|
|
147880
|
+
this._close = append$1(this._header, $$e('span' + ThemeIcon.asCSSSelector(Codicon.close)));
|
|
147881
147881
|
this._close.title = localize('details.close', "Close");
|
|
147882
|
-
this._type = append$1(this._header, $$
|
|
147883
|
-
this._docs = append$1(this._body, $$
|
|
147882
|
+
this._type = append$1(this._header, $$e('p.type'));
|
|
147883
|
+
this._docs = append$1(this._body, $$e('p.docs'));
|
|
147884
147884
|
this._configureFont();
|
|
147885
147885
|
this._disposables.add(this._editor.onDidChangeConfiguration(e => {
|
|
147886
147886
|
if (e.hasChanged(50 /* EditorOption.fontInfo */)) {
|
|
@@ -148364,19 +148364,19 @@ let ItemRenderer = class ItemRenderer {
|
|
|
148364
148364
|
const disposables = new DisposableStore();
|
|
148365
148365
|
const root = container;
|
|
148366
148366
|
root.classList.add('show-file-icons');
|
|
148367
|
-
const icon = append$1(container, $$
|
|
148368
|
-
const colorspan = append$1(icon, $$
|
|
148369
|
-
const text = append$1(container, $$
|
|
148370
|
-
const main = append$1(text, $$
|
|
148371
|
-
const iconContainer = append$1(main, $$
|
|
148372
|
-
const left = append$1(main, $$
|
|
148373
|
-
const right = append$1(main, $$
|
|
148367
|
+
const icon = append$1(container, $$e('.icon'));
|
|
148368
|
+
const colorspan = append$1(icon, $$e('span.colorspan'));
|
|
148369
|
+
const text = append$1(container, $$e('.contents'));
|
|
148370
|
+
const main = append$1(text, $$e('.main'));
|
|
148371
|
+
const iconContainer = append$1(main, $$e('.icon-label.codicon'));
|
|
148372
|
+
const left = append$1(main, $$e('span.left'));
|
|
148373
|
+
const right = append$1(main, $$e('span.right'));
|
|
148374
148374
|
const iconLabel = new IconLabel(left, { supportHighlights: true, supportIcons: true });
|
|
148375
148375
|
disposables.add(iconLabel);
|
|
148376
|
-
const parametersLabel = append$1(left, $$
|
|
148377
|
-
const qualifierLabel = append$1(left, $$
|
|
148378
|
-
const detailsLabel = append$1(right, $$
|
|
148379
|
-
const readMore = append$1(right, $$
|
|
148376
|
+
const parametersLabel = append$1(left, $$e('span.signature-label'));
|
|
148377
|
+
const qualifierLabel = append$1(left, $$e('span.qualifier-label'));
|
|
148378
|
+
const detailsLabel = append$1(right, $$e('span.details-label'));
|
|
148379
|
+
const readMore = append$1(right, $$e('span.readMore' + ThemeIcon.asCSSSelector(suggestMoreInfoIcon)));
|
|
148380
148380
|
readMore.title = localize('readMore', "Read More");
|
|
148381
148381
|
const configureFont = () => {
|
|
148382
148382
|
const options = this._editor.getOptions();
|
|
@@ -148630,8 +148630,8 @@ let SuggestWidget = SuggestWidget_1 = class SuggestWidget {
|
|
|
148630
148630
|
this._contentWidget.unlockPreference();
|
|
148631
148631
|
state = undefined;
|
|
148632
148632
|
}));
|
|
148633
|
-
this._messageElement = append$1(this.element.domNode, $$
|
|
148634
|
-
this._listElement = append$1(this.element.domNode, $$
|
|
148633
|
+
this._messageElement = append$1(this.element.domNode, $$e('.message'));
|
|
148634
|
+
this._listElement = append$1(this.element.domNode, $$e('.tree'));
|
|
148635
148635
|
const details = this._disposables.add(instantiationService.createInstance(SuggestDetailsWidget, this.editor));
|
|
148636
148636
|
details.onDidClose(this.toggleDetails, this, this._disposables);
|
|
148637
148637
|
this._details = new SuggestDetailsOverlay(details, this.editor);
|
|
@@ -150874,7 +150874,7 @@ let InlineCompletionsHoverParticipant = class InlineCompletionsHoverParticipant
|
|
|
150874
150874
|
return disposableStore;
|
|
150875
150875
|
}
|
|
150876
150876
|
renderScreenReaderText(context, part, disposableStore) {
|
|
150877
|
-
const $ = $$
|
|
150877
|
+
const $ = $$e;
|
|
150878
150878
|
const markdownHoverElement = $('div.hover-row.markdown-hover');
|
|
150879
150879
|
const hoverContentsElement = append$1(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' }));
|
|
150880
150880
|
const renderer = disposableStore.add(new MarkdownRenderer({ editor: this._editor }, this._languageService, this._openerService));
|
|
@@ -156670,7 +156670,7 @@ var __param$n = (undefined && undefined.__param) || function (paramIndex, decora
|
|
|
156670
156670
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
156671
156671
|
};
|
|
156672
156672
|
var ParameterHintsWidget_1;
|
|
156673
|
-
const
|
|
156673
|
+
const $$1 = $$e;
|
|
156674
156674
|
const parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, localize('parameterHintsNextIcon', 'Icon for show next parameter hint.'));
|
|
156675
156675
|
const parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, localize('parameterHintsPreviousIcon', 'Icon for show previous parameter hint.'));
|
|
156676
156676
|
let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget extends Disposable {
|
|
@@ -156688,13 +156688,13 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156688
156688
|
this.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService);
|
|
156689
156689
|
}
|
|
156690
156690
|
createParameterHintDOMNodes() {
|
|
156691
|
-
const element =
|
|
156692
|
-
const wrapper = append$1(element,
|
|
156691
|
+
const element = $$1('.editor-widget.parameter-hints-widget');
|
|
156692
|
+
const wrapper = append$1(element, $$1('.phwrapper'));
|
|
156693
156693
|
wrapper.tabIndex = -1;
|
|
156694
|
-
const controls = append$1(wrapper,
|
|
156695
|
-
const previous = append$1(controls,
|
|
156696
|
-
const overloads = append$1(controls,
|
|
156697
|
-
const next = append$1(controls,
|
|
156694
|
+
const controls = append$1(wrapper, $$1('.controls'));
|
|
156695
|
+
const previous = append$1(controls, $$1('.button' + ThemeIcon.asCSSSelector(parameterHintsPreviousIcon)));
|
|
156696
|
+
const overloads = append$1(controls, $$1('.overloads'));
|
|
156697
|
+
const next = append$1(controls, $$1('.button' + ThemeIcon.asCSSSelector(parameterHintsNextIcon)));
|
|
156698
156698
|
this._register(addDisposableListener(previous, 'click', e => {
|
|
156699
156699
|
EventHelper.stop(e);
|
|
156700
156700
|
this.previous();
|
|
@@ -156703,14 +156703,14 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156703
156703
|
EventHelper.stop(e);
|
|
156704
156704
|
this.next();
|
|
156705
156705
|
}));
|
|
156706
|
-
const body =
|
|
156706
|
+
const body = $$1('.body');
|
|
156707
156707
|
const scrollbar = new DomScrollableElement(body, {
|
|
156708
156708
|
alwaysConsumeMouseWheel: true,
|
|
156709
156709
|
});
|
|
156710
156710
|
this._register(scrollbar);
|
|
156711
156711
|
wrapper.appendChild(scrollbar.getDomNode());
|
|
156712
|
-
const signature = append$1(body,
|
|
156713
|
-
const docs = append$1(body,
|
|
156712
|
+
const signature = append$1(body, $$1('.signature'));
|
|
156713
|
+
const docs = append$1(body, $$1('.docs'));
|
|
156714
156714
|
element.style.userSelect = 'text';
|
|
156715
156715
|
this.domNodes = {
|
|
156716
156716
|
element,
|
|
@@ -156790,14 +156790,14 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156790
156790
|
if (!signature) {
|
|
156791
156791
|
return;
|
|
156792
156792
|
}
|
|
156793
|
-
const code = append$1(this.domNodes.signature,
|
|
156793
|
+
const code = append$1(this.domNodes.signature, $$1('.code'));
|
|
156794
156794
|
const fontInfo = this.editor.getOption(50 /* EditorOption.fontInfo */);
|
|
156795
156795
|
code.style.fontSize = `${fontInfo.fontSize}px`;
|
|
156796
156796
|
code.style.fontFamily = fontInfo.fontFamily;
|
|
156797
156797
|
const hasParameters = signature.parameters.length > 0;
|
|
156798
156798
|
const activeParameterIndex = (_a = signature.activeParameter) !== null && _a !== void 0 ? _a : hints.activeParameter;
|
|
156799
156799
|
if (!hasParameters) {
|
|
156800
|
-
const label = append$1(code,
|
|
156800
|
+
const label = append$1(code, $$1('span'));
|
|
156801
156801
|
label.textContent = signature.label;
|
|
156802
156802
|
}
|
|
156803
156803
|
else {
|
|
@@ -156805,7 +156805,7 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156805
156805
|
}
|
|
156806
156806
|
const activeParameter = signature.parameters[activeParameterIndex];
|
|
156807
156807
|
if (activeParameter === null || activeParameter === void 0 ? void 0 : activeParameter.documentation) {
|
|
156808
|
-
const documentation =
|
|
156808
|
+
const documentation = $$1('span.documentation');
|
|
156809
156809
|
if (typeof activeParameter.documentation === 'string') {
|
|
156810
156810
|
documentation.textContent = activeParameter.documentation;
|
|
156811
156811
|
}
|
|
@@ -156813,11 +156813,11 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156813
156813
|
const renderedContents = this.renderMarkdownDocs(activeParameter.documentation);
|
|
156814
156814
|
documentation.appendChild(renderedContents.element);
|
|
156815
156815
|
}
|
|
156816
|
-
append$1(this.domNodes.docs,
|
|
156816
|
+
append$1(this.domNodes.docs, $$1('p', {}, documentation));
|
|
156817
156817
|
}
|
|
156818
156818
|
if (signature.documentation === undefined) ;
|
|
156819
156819
|
else if (typeof signature.documentation === 'string') {
|
|
156820
|
-
append$1(this.domNodes.docs,
|
|
156820
|
+
append$1(this.domNodes.docs, $$1('p', {}, signature.documentation));
|
|
156821
156821
|
}
|
|
156822
156822
|
else {
|
|
156823
156823
|
const renderedContents = this.renderMarkdownDocs(signature.documentation);
|
|
@@ -160616,7 +160616,7 @@ let Link = class Link extends Disposable {
|
|
|
160616
160616
|
super();
|
|
160617
160617
|
this._link = _link;
|
|
160618
160618
|
this._enabled = true;
|
|
160619
|
-
this.el = append$1(container, $$
|
|
160619
|
+
this.el = append$1(container, $$e('a.monaco-link', {
|
|
160620
160620
|
tabIndex: (_a = _link.tabIndex) !== null && _a !== void 0 ? _a : 0,
|
|
160621
160621
|
href: _link.href,
|
|
160622
160622
|
title: _link.title
|
|
@@ -160687,7 +160687,7 @@ let Banner = class Banner extends Disposable {
|
|
|
160687
160687
|
super();
|
|
160688
160688
|
this.instantiationService = instantiationService;
|
|
160689
160689
|
this.markdownRenderer = this.instantiationService.createInstance(MarkdownRenderer, {});
|
|
160690
|
-
this.element = $$
|
|
160690
|
+
this.element = $$e('div.editor-banner');
|
|
160691
160691
|
this.element.tabIndex = 0;
|
|
160692
160692
|
}
|
|
160693
160693
|
getAriaLabel(item) {
|
|
@@ -160701,7 +160701,7 @@ let Banner = class Banner extends Disposable {
|
|
|
160701
160701
|
}
|
|
160702
160702
|
getBannerMessage(message) {
|
|
160703
160703
|
if (typeof message === 'string') {
|
|
160704
|
-
const element = $$
|
|
160704
|
+
const element = $$e('span');
|
|
160705
160705
|
element.innerText = message;
|
|
160706
160706
|
return element;
|
|
160707
160707
|
}
|
|
@@ -160719,24 +160719,24 @@ let Banner = class Banner extends Disposable {
|
|
|
160719
160719
|
this.element.setAttribute('aria-label', ariaLabel);
|
|
160720
160720
|
}
|
|
160721
160721
|
// Icon
|
|
160722
|
-
const iconContainer = append$1(this.element, $$
|
|
160722
|
+
const iconContainer = append$1(this.element, $$e('div.icon-container'));
|
|
160723
160723
|
iconContainer.setAttribute('aria-hidden', 'true');
|
|
160724
160724
|
if (item.icon) {
|
|
160725
|
-
iconContainer.appendChild($$
|
|
160725
|
+
iconContainer.appendChild($$e(`div${ThemeIcon.asCSSSelector(item.icon)}`));
|
|
160726
160726
|
}
|
|
160727
160727
|
// Message
|
|
160728
|
-
const messageContainer = append$1(this.element, $$
|
|
160728
|
+
const messageContainer = append$1(this.element, $$e('div.message-container'));
|
|
160729
160729
|
messageContainer.setAttribute('aria-hidden', 'true');
|
|
160730
160730
|
messageContainer.appendChild(this.getBannerMessage(item.message));
|
|
160731
160731
|
// Message Actions
|
|
160732
|
-
this.messageActionsContainer = append$1(this.element, $$
|
|
160732
|
+
this.messageActionsContainer = append$1(this.element, $$e('div.message-actions-container'));
|
|
160733
160733
|
if (item.actions) {
|
|
160734
160734
|
for (const action of item.actions) {
|
|
160735
160735
|
this._register(this.instantiationService.createInstance(Link, this.messageActionsContainer, Object.assign(Object.assign({}, action), { tabIndex: -1 }), {}));
|
|
160736
160736
|
}
|
|
160737
160737
|
}
|
|
160738
160738
|
// Action
|
|
160739
|
-
const actionBarContainer = append$1(this.element, $$
|
|
160739
|
+
const actionBarContainer = append$1(this.element, $$e('div.action-container'));
|
|
160740
160740
|
this.actionBar = this._register(new ActionBar(actionBarContainer));
|
|
160741
160741
|
this.actionBar.push(this._register(new Action('banner.close', 'Close Banner', ThemeIcon.asClassName(widgetClose), true, () => {
|
|
160742
160742
|
if (typeof item.onClose === 'function') {
|
|
@@ -162832,13 +162832,13 @@ class InspectTokensWidget extends Disposable {
|
|
|
162832
162832
|
const tokenEndIndex = token1Index + 1 < data.tokens1.length ? data.tokens1[token1Index + 1].offset : lineContent.length;
|
|
162833
162833
|
tokenText = lineContent.substring(tokenStartIndex, tokenEndIndex);
|
|
162834
162834
|
}
|
|
162835
|
-
reset(this._domNode, $$
|
|
162836
|
-
append$1(this._domNode, $$
|
|
162835
|
+
reset(this._domNode, $$e('h2.tm-token', undefined, renderTokenText(tokenText), $$e('span.tm-token-length', undefined, `${tokenText.length} ${tokenText.length === 1 ? 'char' : 'chars'}`)));
|
|
162836
|
+
append$1(this._domNode, $$e('hr.tokens-inspect-separator', { 'style': 'clear:both' }));
|
|
162837
162837
|
const metadata = (token2Index << 1) + 1 < data.tokens2.length ? this._decodeMetadata(data.tokens2[(token2Index << 1) + 1]) : null;
|
|
162838
|
-
append$1(this._domNode, $$
|
|
162839
|
-
append$1(this._domNode, $$
|
|
162838
|
+
append$1(this._domNode, $$e('table.tm-metadata-table', undefined, $$e('tbody', undefined, $$e('tr', undefined, $$e('td.tm-metadata-key', undefined, 'language'), $$e('td.tm-metadata-value', undefined, `${metadata ? metadata.languageId : '-?-'}`)), $$e('tr', undefined, $$e('td.tm-metadata-key', undefined, 'token type'), $$e('td.tm-metadata-value', undefined, `${metadata ? this._tokenTypeToString(metadata.tokenType) : '-?-'}`)), $$e('tr', undefined, $$e('td.tm-metadata-key', undefined, 'font style'), $$e('td.tm-metadata-value', undefined, `${metadata ? this._fontStyleToString(metadata.fontStyle) : '-?-'}`)), $$e('tr', undefined, $$e('td.tm-metadata-key', undefined, 'foreground'), $$e('td.tm-metadata-value', undefined, `${metadata ? Color.Format.CSS.formatHex(metadata.foreground) : '-?-'}`)), $$e('tr', undefined, $$e('td.tm-metadata-key', undefined, 'background'), $$e('td.tm-metadata-value', undefined, `${metadata ? Color.Format.CSS.formatHex(metadata.background) : '-?-'}`)))));
|
|
162839
|
+
append$1(this._domNode, $$e('hr.tokens-inspect-separator'));
|
|
162840
162840
|
if (token1Index < data.tokens1.length) {
|
|
162841
|
-
append$1(this._domNode, $$
|
|
162841
|
+
append$1(this._domNode, $$e('span.tm-token-type', undefined, data.tokens1[token1Index].type));
|
|
162842
162842
|
}
|
|
162843
162843
|
this._editor.layoutContentWidget(this);
|
|
162844
162844
|
}
|
|
@@ -167228,97 +167228,97 @@ async function importRequest() {
|
|
|
167228
167228
|
}
|
|
167229
167229
|
|
|
167230
167230
|
async function newPortalItem(definition) {
|
|
167231
|
-
|
|
167232
|
-
|
|
167231
|
+
const PortalItem = await importPortalPortalItem();
|
|
167232
|
+
return new PortalItem(definition);
|
|
167233
167233
|
}
|
|
167234
167234
|
async function newFeatureLayer(definition) {
|
|
167235
|
-
|
|
167236
|
-
|
|
167237
|
-
|
|
167235
|
+
const FeatureLayer = await importLayersFeatureLayer();
|
|
167236
|
+
// Fix title for the layer. Instead of defaulting to the map viewer style.
|
|
167237
|
+
return new FeatureLayer({ ...definition, sublayerTitleMode: "service-name" });
|
|
167238
167238
|
}
|
|
167239
167239
|
async function newWebMap(definition) {
|
|
167240
|
-
|
|
167241
|
-
|
|
167240
|
+
const WebMap = await importWebMap();
|
|
167241
|
+
return new WebMap(definition);
|
|
167242
167242
|
}
|
|
167243
167243
|
function isSupportedLayerInstance(item) {
|
|
167244
|
-
|
|
167245
|
-
|
|
167246
|
-
|
|
167247
|
-
|
|
167244
|
+
return (!!item &&
|
|
167245
|
+
typeof item === "object" &&
|
|
167246
|
+
typeof item.declaredClass === "string" &&
|
|
167247
|
+
item.declaredClass.startsWith("esri.layers."));
|
|
167248
167248
|
}
|
|
167249
167249
|
function isFeatureSetInstance(item) {
|
|
167250
|
-
|
|
167251
|
-
|
|
167252
|
-
|
|
167253
|
-
|
|
167250
|
+
return (!!item &&
|
|
167251
|
+
typeof item === "object" &&
|
|
167252
|
+
typeof item.declaredClass === "string" &&
|
|
167253
|
+
item.declaredClass === "esri.rest.support.FeatureSet");
|
|
167254
167254
|
}
|
|
167255
167255
|
function isFeatureLayerInstance(item) {
|
|
167256
|
-
|
|
167257
|
-
|
|
167258
|
-
|
|
167259
|
-
|
|
167256
|
+
return (!!item &&
|
|
167257
|
+
typeof item === "object" &&
|
|
167258
|
+
typeof item.declaredClass === "string" &&
|
|
167259
|
+
item.declaredClass === "esri.layers.FeatureLayer");
|
|
167260
167260
|
}
|
|
167261
167261
|
function isGroupLayerInstance(item) {
|
|
167262
|
-
|
|
167263
|
-
|
|
167264
|
-
|
|
167265
|
-
|
|
167262
|
+
return (!!item &&
|
|
167263
|
+
typeof item === "object" &&
|
|
167264
|
+
typeof item.declaredClass === "string" &&
|
|
167265
|
+
item.declaredClass === "esri.layers.GroupLayer");
|
|
167266
167266
|
}
|
|
167267
167267
|
function isWebMapInstance(item) {
|
|
167268
|
-
|
|
167268
|
+
return (!!item && typeof item === "object" && typeof item.declaredClass === "string" && item.declaredClass === "esri.WebMap");
|
|
167269
167269
|
}
|
|
167270
167270
|
function isPortalItemDefinition(item) {
|
|
167271
|
-
|
|
167271
|
+
return !!item && typeof item === "object" && item.portalItem != null;
|
|
167272
167272
|
}
|
|
167273
167273
|
function isFeatureLayerItemDefinition(item) {
|
|
167274
|
-
|
|
167274
|
+
return !!item && typeof item === "object" && item.portalItem != null;
|
|
167275
167275
|
}
|
|
167276
167276
|
function isFieldsDefinition(item) {
|
|
167277
|
-
|
|
167277
|
+
return !!item && typeof item === "object" && Array.isArray(item.fields) && !("declaredClass" in item);
|
|
167278
167278
|
}
|
|
167279
167279
|
function isUrlDefinition(item) {
|
|
167280
|
-
|
|
167280
|
+
return !!item && typeof item === "object" && typeof item.url === "string" && !("declaredClass" in item);
|
|
167281
167281
|
}
|
|
167282
167282
|
function isPredefinedProfile(item) {
|
|
167283
|
-
|
|
167284
|
-
|
|
167285
|
-
|
|
167286
|
-
|
|
167287
|
-
|
|
167283
|
+
return (!!item &&
|
|
167284
|
+
typeof item === "object" &&
|
|
167285
|
+
typeof item.id === "string" &&
|
|
167286
|
+
typeof item.definitions === "object" &&
|
|
167287
|
+
!Array.isArray(item.definitions));
|
|
167288
167288
|
}
|
|
167289
167289
|
|
|
167290
|
-
var p=class{constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n;});}};function S(e,t){let n=e;for(;n;){if(n===t)return !0;if(!n.parentNode)return !1;n.parentNode instanceof ShadowRoot?n=n.parentNode.host:n=n.parentNode;}return !1}function T(e,t,n=()=>{}){if(!t||t.length<=0)return;let r=new MutationObserver(o=>{for(let i of o)S(e,i.target)&&n();});return r.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0}),r}function E(e,t){let n=e;for(;n;){let r=n.closest(t);if(r)return r;let o=n.getRootNode();if(o===document)return null;n=o.host;}return null}function P(e){let t=E(e,":is(.calcite-mode-light, .calcite-mode-dark)");return t&&t.classList.contains("calcite-mode-dark")?"dark":"light"}function f(e,t,n){return E(e,`[${t}]`)?.getAttribute(t)??n}function M(e){return e.nodeType===Node.ELEMENT_NODE}function c(e,t=""){if(!M(e))return !1;if(e.matches(t))return setTimeout(()=>e?.setFocus(),0),!0;for(let r=0;r<e.children.length;r
|
|
167290
|
+
var p=class{constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n;});}};function S(e,t){let n=e;for(;n;){if(n===t)return !0;if(!n.parentNode)return !1;n.parentNode instanceof ShadowRoot?n=n.parentNode.host:n=n.parentNode;}return !1}function T(e,t,n=()=>{}){if(!t||t.length<=0)return;let r=new MutationObserver(o=>{for(let i of o)S(e,i.target)&&n();});return r.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0}),r}function E(e,t){let n=e;for(;n;){let r=n.closest(t);if(r)return r;let o=n.getRootNode();if(o===document)return null;n=o.host;}return null}function P(e){let t=E(e,":is(.calcite-mode-light, .calcite-mode-dark)");return t&&t.classList.contains("calcite-mode-dark")?"dark":"light"}function f(e,t,n){return E(e,`[${t}]`)?.getAttribute(t)??n}function M(e){return e.nodeType===Node.ELEMENT_NODE}function c(e,t=""){if(!M(e))return !1;if(e.matches(t))return setTimeout(()=>e?.setFocus(),0),!0;for(let r=0;r<e.children.length;r+=1)if(c(e.children[r],t))return !0;let n=e.shadowRoot;if(n){for(let r=0;r<n.children.length;r+=1)if(c(n.children[r],t))return !0}return !1}function O(e,t){if(!e||!e.shadowRoot)return;if(e.hasAttribute("hydrated")||e.hasAttribute("calcite-hydrated")){c(e,t);return}let n=new MutationObserver(()=>{n.disconnect(),c(e,t);});n.observe(e,{attributes:!0,attributeFilter:["hydrated","calcite-hydrated"]});}function d(e){let t="";for(let n=0;n<e;n+=1)t+=((1+Math.random())*65536|0).toString(16).substring(1);return t}function $(){return [d(2),d(1),d(1),d(1),d(3)].join("-")}var x=new Set(["ar","bg","bs","ca","cs","da","de","el","en","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nl","nb","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"]),a=new Map;async function N(e,t,n=""){let r=`${t}/${n}${e}.json`;if(a.has(r))return a.get(r);try{let o=await fetch(r);if(o.ok){let s=await o.json();return a.set(r,s),s}if(e==="en"){a.set(r,void 0);return}let i=await N("en",t,n);return a.set(r,i),i}catch{a.set(r,void 0);return}}function R(e){let t=f(e,"lang",navigator?.language||"en");if(x.has(t))return {lang:t,t9nLocale:t};let n=t.slice(0,2);return {lang:t,t9nLocale:x.has(n)?n:"en"}}var m=new WeakMap,h=new WeakMap,_=new WeakMap;async function F(e,t,n){h.set(e,t),m.set(e,T(e._hostElement,["lang"],()=>{b(e,n);})),await b(e,n);}function U(e){m.get(e)?.disconnect(),m.delete(e),h.delete(e);}async function b(e,t){let{lang:n,t9nLocale:r}=R(e._hostElement);if(n===e._lang&&r===e._t9nLocale||(n!==e._lang&&(e._lang=n),r===e._t9nLocale))return;let o=_.get(e);if(!o){let i=h.get(e)??"",s=e._hostElement.tagName.toLowerCase().replace("arcgis-",""),u=`${i}/${s}/t9n`,l=`${s}.t9n.`;o=await N(r,u,l);}e._t9nLocale=r,e._t9nStrings=o,await t?.call(e);}var v='"',w="'";function L(e,t){return new Array(t+1).join(e)}function z(e){let t=v,n=w;e.indexOf(t)>=0&&e.indexOf(n)<0&&(n=v,t=w);let o=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${n})+)`,"gu");e=e.replace(o,(s,u,l,g)=>u+l+L(n,g.length/2));let i=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${t}+)`,"gu");return e=e.replace(i,(s,u,l,g)=>u+l+L(`\\${t}`,g.length)),t+e+t}function B(e){let t=e?e.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu,"\\$&"):"^.*$";return new RegExp(t,"i")}function H(e,t={}){return (e??"").replace(/\{(.*?)\}/gu,(n,r)=>t[r]??n)}function q(e){return `\u200E${e??""}\u200E`}function D(e){return e!==null}function G(e){return e!==void 0}function V(e,t,n=!1){if(!e||!t)return !1;let r=new URL(e),o=new URL(t);return !n&&r.protocol!==o.protocol||r.host==null||o.host==null?!1:r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port}function X(e){try{return new URL(e),!0}catch{return !1}}
|
|
167291
167291
|
|
|
167292
167292
|
/**
|
|
167293
167293
|
* Filters a collection of items by the given keys and filter word.
|
|
167294
167294
|
*/
|
|
167295
167295
|
function filterCollection(collection, keys, filterWord, beforeFilteringFn) {
|
|
167296
|
-
|
|
167297
|
-
|
|
167298
|
-
}
|
|
167299
|
-
const _keys = !Array.isArray(keys) ? [keys] : keys;
|
|
167300
|
-
if (!_keys.length) {
|
|
167301
|
-
return [];
|
|
167302
|
-
}
|
|
167303
|
-
const filterExpression = B(filterWord);
|
|
167304
|
-
return collection.filter((item) => {
|
|
167305
|
-
if (beforeFilteringFn) {
|
|
167306
|
-
const res = beforeFilteringFn(item);
|
|
167307
|
-
if (res !== null || res !== undefined) {
|
|
167308
|
-
return res;
|
|
167309
|
-
}
|
|
167296
|
+
if (!keys) {
|
|
167297
|
+
return [];
|
|
167310
167298
|
}
|
|
167311
|
-
|
|
167312
|
-
|
|
167299
|
+
const _keys = !Array.isArray(keys) ? [keys] : keys;
|
|
167300
|
+
if (!_keys.length) {
|
|
167301
|
+
return [];
|
|
167302
|
+
}
|
|
167303
|
+
const filterExpression = B(filterWord);
|
|
167304
|
+
return collection.filter((item) => {
|
|
167305
|
+
if (beforeFilteringFn) {
|
|
167306
|
+
const res = beforeFilteringFn(item);
|
|
167307
|
+
if (res !== null || res !== undefined) {
|
|
167308
|
+
return res;
|
|
167309
|
+
}
|
|
167310
|
+
}
|
|
167311
|
+
return _keys.some((key) => filterExpression.test(`${item[key] ?? ""}`));
|
|
167312
|
+
});
|
|
167313
167313
|
}
|
|
167314
167314
|
/**
|
|
167315
167315
|
* Returns the url to the portal item.
|
|
167316
167316
|
*/
|
|
167317
167317
|
function portalItemPageUrl(portalItem) {
|
|
167318
|
-
|
|
167319
|
-
|
|
167320
|
-
|
|
167321
|
-
|
|
167318
|
+
if (!portalItem) {
|
|
167319
|
+
return "";
|
|
167320
|
+
}
|
|
167321
|
+
return `${portalItem.portal.url}/home/item.html?id=${portalItem.id}`;
|
|
167322
167322
|
}
|
|
167323
167323
|
//#endregion
|
|
167324
167324
|
|
|
@@ -167326,417 +167326,417 @@ function portalItemPageUrl(portalItem) {
|
|
|
167326
167326
|
* Returns an icon name for the field type
|
|
167327
167327
|
*/
|
|
167328
167328
|
function fieldTypeToIconName(field) {
|
|
167329
|
-
|
|
167330
|
-
|
|
167331
|
-
|
|
167332
|
-
|
|
167333
|
-
|
|
167334
|
-
|
|
167335
|
-
|
|
167336
|
-
|
|
167337
|
-
|
|
167338
|
-
|
|
167339
|
-
|
|
167340
|
-
|
|
167341
|
-
|
|
167342
|
-
|
|
167343
|
-
|
|
167344
|
-
|
|
167345
|
-
|
|
167346
|
-
|
|
167347
|
-
|
|
167348
|
-
|
|
167349
|
-
|
|
167350
|
-
|
|
167351
|
-
|
|
167352
|
-
|
|
167353
|
-
|
|
167354
|
-
|
|
167329
|
+
switch (field?.type) {
|
|
167330
|
+
case "oid":
|
|
167331
|
+
return "key";
|
|
167332
|
+
case "small-integer":
|
|
167333
|
+
case "big-integer":
|
|
167334
|
+
case "integer":
|
|
167335
|
+
case "single":
|
|
167336
|
+
case "double":
|
|
167337
|
+
case "long":
|
|
167338
|
+
return "number";
|
|
167339
|
+
case "global-id":
|
|
167340
|
+
case "guid":
|
|
167341
|
+
return "key";
|
|
167342
|
+
case "string":
|
|
167343
|
+
return "string";
|
|
167344
|
+
case "date":
|
|
167345
|
+
return "date-time";
|
|
167346
|
+
case "date-only":
|
|
167347
|
+
return "calendar";
|
|
167348
|
+
case "time-only":
|
|
167349
|
+
return "clock";
|
|
167350
|
+
case "timestamp-offset":
|
|
167351
|
+
return "time-zone";
|
|
167352
|
+
default:
|
|
167353
|
+
return "cube";
|
|
167354
|
+
}
|
|
167355
167355
|
}
|
|
167356
167356
|
/**
|
|
167357
167357
|
* Returns the Arcade type for the given field.
|
|
167358
167358
|
*/
|
|
167359
167359
|
function fieldTypeToArcadeType(field) {
|
|
167360
|
-
|
|
167361
|
-
|
|
167362
|
-
|
|
167363
|
-
|
|
167364
|
-
|
|
167365
|
-
|
|
167366
|
-
|
|
167367
|
-
|
|
167368
|
-
|
|
167369
|
-
|
|
167370
|
-
|
|
167371
|
-
|
|
167372
|
-
|
|
167373
|
-
|
|
167374
|
-
|
|
167375
|
-
|
|
167376
|
-
|
|
167377
|
-
|
|
167378
|
-
|
|
167379
|
-
|
|
167380
|
-
|
|
167381
|
-
|
|
167360
|
+
switch (field?.type) {
|
|
167361
|
+
case "small-integer":
|
|
167362
|
+
case "integer":
|
|
167363
|
+
case "big-integer":
|
|
167364
|
+
case "single":
|
|
167365
|
+
case "double":
|
|
167366
|
+
case "long":
|
|
167367
|
+
case "oid":
|
|
167368
|
+
return "number";
|
|
167369
|
+
case "global-id":
|
|
167370
|
+
case "guid":
|
|
167371
|
+
case "string":
|
|
167372
|
+
return "text";
|
|
167373
|
+
case "date":
|
|
167374
|
+
return "date";
|
|
167375
|
+
case "date-only":
|
|
167376
|
+
return "dateOnly";
|
|
167377
|
+
case "time-only":
|
|
167378
|
+
return "time";
|
|
167379
|
+
default:
|
|
167380
|
+
return "text";
|
|
167381
|
+
}
|
|
167382
167382
|
}
|
|
167383
167383
|
function supportedFields(fields) {
|
|
167384
|
-
|
|
167385
|
-
|
|
167386
|
-
|
|
167387
|
-
|
|
167388
|
-
|
|
167389
|
-
|
|
167390
|
-
|
|
167391
|
-
|
|
167392
|
-
|
|
167393
|
-
|
|
167394
|
-
|
|
167395
|
-
|
|
167396
|
-
|
|
167397
|
-
|
|
167398
|
-
|
|
167399
|
-
|
|
167400
|
-
|
|
167401
|
-
|
|
167402
|
-
|
|
167403
|
-
|
|
167404
|
-
|
|
167384
|
+
return (fields ?? []).filter((field) => {
|
|
167385
|
+
switch (field.type) {
|
|
167386
|
+
case "string":
|
|
167387
|
+
case "small-integer":
|
|
167388
|
+
case "integer":
|
|
167389
|
+
case "big-integer":
|
|
167390
|
+
case "single":
|
|
167391
|
+
case "double":
|
|
167392
|
+
case "long":
|
|
167393
|
+
case "date":
|
|
167394
|
+
case "date-only":
|
|
167395
|
+
case "time-only":
|
|
167396
|
+
case "timestamp-offset":
|
|
167397
|
+
case "oid":
|
|
167398
|
+
case "guid":
|
|
167399
|
+
case "global-id":
|
|
167400
|
+
return true;
|
|
167401
|
+
default:
|
|
167402
|
+
return false;
|
|
167403
|
+
}
|
|
167404
|
+
});
|
|
167405
167405
|
}
|
|
167406
167406
|
|
|
167407
167407
|
function resolveIntlPath(dictionary, path) {
|
|
167408
|
-
|
|
167409
|
-
|
|
167410
|
-
|
|
167411
|
-
|
|
167412
|
-
|
|
167413
|
-
|
|
167414
|
-
|
|
167415
|
-
|
|
167416
|
-
|
|
167417
|
-
|
|
167418
|
-
|
|
167419
|
-
|
|
167408
|
+
if (!dictionary) {
|
|
167409
|
+
return "";
|
|
167410
|
+
}
|
|
167411
|
+
const pathSegments = path.split(".");
|
|
167412
|
+
let pathSegment = pathSegments.shift();
|
|
167413
|
+
let entry = dictionary;
|
|
167414
|
+
while (entry && pathSegment) {
|
|
167415
|
+
// @ts-expect-error
|
|
167416
|
+
entry = entry[pathSegment];
|
|
167417
|
+
pathSegment = pathSegments.shift();
|
|
167418
|
+
}
|
|
167419
|
+
return typeof entry === "string" ? entry : path;
|
|
167420
167420
|
}
|
|
167421
167421
|
function isTypesCapabaleLayer(item) {
|
|
167422
|
-
|
|
167422
|
+
return !!item?.typeIdField;
|
|
167423
167423
|
}
|
|
167424
167424
|
function isDomainsCapableLayer(item) {
|
|
167425
|
-
|
|
167425
|
+
return typeof item?.getFieldDomain === "function";
|
|
167426
167426
|
}
|
|
167427
167427
|
function isRelationshipsCapableLayer(item) {
|
|
167428
|
-
|
|
167428
|
+
return Array.isArray(item?.relationships) && typeof item?.url === "string";
|
|
167429
167429
|
}
|
|
167430
167430
|
function isTableCapableLayer(item) {
|
|
167431
|
-
|
|
167431
|
+
return typeof item?.isTable === "boolean";
|
|
167432
167432
|
}
|
|
167433
167433
|
function isLoadableSource(item) {
|
|
167434
|
-
|
|
167434
|
+
return typeof item?.load === "function";
|
|
167435
167435
|
}
|
|
167436
167436
|
//#endregion
|
|
167437
167437
|
//#region Support Functions
|
|
167438
167438
|
async function getRelatedFeatureLayer(layer, relationship) {
|
|
167439
|
-
|
|
167440
|
-
|
|
167441
|
-
}
|
|
167442
|
-
const url = `${layer.url}/${relationship.relatedTableId}`;
|
|
167443
|
-
const relatedFeatureLayer = await supportedSourceFromDefinition({ url });
|
|
167444
|
-
if (!isFeatureLayerInstance(relatedFeatureLayer)) {
|
|
167445
|
-
return null;
|
|
167446
|
-
}
|
|
167447
|
-
return relatedFeatureLayer;
|
|
167448
|
-
}
|
|
167449
|
-
function sortFields(layer) {
|
|
167450
|
-
return (firstField, secondField) => {
|
|
167451
|
-
if (firstField.type === "oid") {
|
|
167452
|
-
return -1;
|
|
167453
|
-
}
|
|
167454
|
-
if (secondField.type === "oid") {
|
|
167455
|
-
return 1;
|
|
167439
|
+
if (!relationship) {
|
|
167440
|
+
return null;
|
|
167456
167441
|
}
|
|
167457
|
-
|
|
167458
|
-
|
|
167459
|
-
|
|
167460
|
-
|
|
167461
|
-
if (secondField.name === layer.typeIdField) {
|
|
167462
|
-
return 1;
|
|
167463
|
-
}
|
|
167442
|
+
const url = `${layer.url}/${relationship.relatedTableId}`;
|
|
167443
|
+
const relatedFeatureLayer = await supportedSourceFromDefinition({ url });
|
|
167444
|
+
if (!isFeatureLayerInstance(relatedFeatureLayer)) {
|
|
167445
|
+
return null;
|
|
167464
167446
|
}
|
|
167465
|
-
return
|
|
167466
|
-
|
|
167447
|
+
return relatedFeatureLayer;
|
|
167448
|
+
}
|
|
167449
|
+
function sortFields(layer) {
|
|
167450
|
+
return (firstField, secondField) => {
|
|
167451
|
+
if (firstField.type === "oid") {
|
|
167452
|
+
return -1;
|
|
167453
|
+
}
|
|
167454
|
+
if (secondField.type === "oid") {
|
|
167455
|
+
return 1;
|
|
167456
|
+
}
|
|
167457
|
+
if (isTypesCapabaleLayer(layer)) {
|
|
167458
|
+
if (firstField.name === layer.typeIdField) {
|
|
167459
|
+
return -1;
|
|
167460
|
+
}
|
|
167461
|
+
if (secondField.name === layer.typeIdField) {
|
|
167462
|
+
return 1;
|
|
167463
|
+
}
|
|
167464
|
+
}
|
|
167465
|
+
return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
|
|
167466
|
+
};
|
|
167467
167467
|
}
|
|
167468
167468
|
function getSubtypesProperties(profile, types, field) {
|
|
167469
|
-
|
|
167470
|
-
|
|
167471
|
-
|
|
167472
|
-
|
|
167473
|
-
|
|
167474
|
-
|
|
167475
|
-
|
|
167476
|
-
|
|
167469
|
+
// Try the coded domain first
|
|
167470
|
+
const group = getDomainValuesProperties(profile, field.domain, { code: "subtypes" });
|
|
167471
|
+
if (group) {
|
|
167472
|
+
return group;
|
|
167473
|
+
}
|
|
167474
|
+
// No coded domain for the subtypes, we will manufacture it
|
|
167475
|
+
const values = types.map((t) => new ValueVariable({ profile, label: `${t.id}`, description: t.name, snippet: `"${t.id}"` }));
|
|
167476
|
+
return new GroupOfVariables(profile, { code: "subtypes" }, values);
|
|
167477
167477
|
}
|
|
167478
167478
|
function getDomainValuesProperties(profile, domain, label) {
|
|
167479
|
-
|
|
167480
|
-
|
|
167481
|
-
|
|
167482
|
-
|
|
167483
|
-
|
|
167484
|
-
|
|
167485
|
-
|
|
167486
|
-
|
|
167487
|
-
|
|
167488
|
-
|
|
167489
|
-
|
|
167479
|
+
if (!domain || domain.type !== "coded-value") {
|
|
167480
|
+
return null;
|
|
167481
|
+
}
|
|
167482
|
+
const values = domain.codedValues.map((v) => new ValueVariable({
|
|
167483
|
+
profile,
|
|
167484
|
+
label: `${v.code}`,
|
|
167485
|
+
description: v.name,
|
|
167486
|
+
snippet: `"${v.code}"`,
|
|
167487
|
+
filterDescription: true
|
|
167488
|
+
}));
|
|
167489
|
+
return new GroupOfVariables(profile, label, values);
|
|
167490
167490
|
}
|
|
167491
167491
|
function getDomainValuesBySubtypeGroup(profile, types, field) {
|
|
167492
|
-
|
|
167493
|
-
|
|
167494
|
-
|
|
167495
|
-
|
|
167496
|
-
|
|
167497
|
-
|
|
167498
|
-
|
|
167499
|
-
|
|
167500
|
-
|
|
167501
|
-
|
|
167502
|
-
|
|
167503
|
-
|
|
167504
|
-
|
|
167505
|
-
|
|
167506
|
-
|
|
167507
|
-
|
|
167492
|
+
const variables = [];
|
|
167493
|
+
types.forEach((t) => {
|
|
167494
|
+
let domain = t.domains?.[field.name];
|
|
167495
|
+
if (!domain) {
|
|
167496
|
+
return;
|
|
167497
|
+
}
|
|
167498
|
+
if (domain.type === "inherited") {
|
|
167499
|
+
domain = field.domain;
|
|
167500
|
+
return;
|
|
167501
|
+
}
|
|
167502
|
+
const domainValuesGroup = getDomainValuesProperties(profile, domain, {
|
|
167503
|
+
code: "domainvaluesfortypeformat",
|
|
167504
|
+
formatValues: {
|
|
167505
|
+
fieldName: field.alias ?? field.name,
|
|
167506
|
+
typeName: t.name
|
|
167507
|
+
}
|
|
167508
|
+
});
|
|
167509
|
+
if (!domainValuesGroup) {
|
|
167510
|
+
return;
|
|
167511
|
+
}
|
|
167512
|
+
const label = `${t.id}`;
|
|
167513
|
+
const snippet = `"${t.id}""`;
|
|
167514
|
+
const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
|
|
167515
|
+
subtypeDictionary.variables = [domainValuesGroup];
|
|
167516
|
+
variables.push(subtypeDictionary);
|
|
167508
167517
|
});
|
|
167509
|
-
if (!
|
|
167510
|
-
|
|
167518
|
+
if (!variables.length) {
|
|
167519
|
+
return null;
|
|
167511
167520
|
}
|
|
167512
|
-
|
|
167513
|
-
const snippet = `"${t.id}""`;
|
|
167514
|
-
const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
|
|
167515
|
-
subtypeDictionary.variables = [domainValuesGroup];
|
|
167516
|
-
variables.push(subtypeDictionary);
|
|
167517
|
-
});
|
|
167518
|
-
if (!variables.length) {
|
|
167519
|
-
return null;
|
|
167520
|
-
}
|
|
167521
|
-
return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
|
|
167521
|
+
return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
|
|
167522
167522
|
}
|
|
167523
167523
|
// const validIdentifierExpr = new RegExp(/^[a-z_$][\w$]*$/gi);
|
|
167524
|
-
const validIdentifierExpr =
|
|
167524
|
+
const validIdentifierExpr = /^[a-z_$][a-z0-9_$]*$/giu;
|
|
167525
167525
|
function getMemberExpressionProperty(prop, includeDot = true) {
|
|
167526
|
-
|
|
167527
|
-
|
|
167528
|
-
|
|
167529
|
-
|
|
167526
|
+
if (prop.match(validIdentifierExpr)) {
|
|
167527
|
+
return `${includeDot ? "." : ""}${prop}`;
|
|
167528
|
+
}
|
|
167529
|
+
return `["${prop}"]`;
|
|
167530
167530
|
}
|
|
167531
167531
|
function assembleMemberExpression(obj, prop) {
|
|
167532
|
-
|
|
167533
|
-
|
|
167534
|
-
|
|
167535
|
-
|
|
167532
|
+
if (!obj) {
|
|
167533
|
+
return prop;
|
|
167534
|
+
}
|
|
167535
|
+
return `${obj}${getMemberExpressionProperty(prop)}`;
|
|
167536
167536
|
}
|
|
167537
167537
|
//#endregion
|
|
167538
167538
|
//#region Sources
|
|
167539
167539
|
async function supportedSourceFromDefinition(definition) {
|
|
167540
|
-
|
|
167541
|
-
|
|
167542
|
-
}
|
|
167543
|
-
let source = null;
|
|
167544
|
-
if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
|
|
167545
|
-
source = definition;
|
|
167546
|
-
}
|
|
167547
|
-
else {
|
|
167548
|
-
source = await newFeatureLayer(definition);
|
|
167549
|
-
if (!isFeatureLayerInstance(source)) {
|
|
167550
|
-
console.error("Invalid FeatureSetDefinition", definition);
|
|
167551
|
-
return null;
|
|
167540
|
+
if (!definition) {
|
|
167541
|
+
return null;
|
|
167552
167542
|
}
|
|
167553
|
-
|
|
167554
|
-
|
|
167555
|
-
|
|
167556
|
-
|
|
167557
|
-
|
|
167558
|
-
|
|
167559
|
-
|
|
167560
|
-
|
|
167561
|
-
|
|
167543
|
+
let source = null;
|
|
167544
|
+
if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
|
|
167545
|
+
source = definition;
|
|
167546
|
+
}
|
|
167547
|
+
else {
|
|
167548
|
+
source = await newFeatureLayer(definition);
|
|
167549
|
+
if (!isFeatureLayerInstance(source)) {
|
|
167550
|
+
console.error("Invalid FeatureSetDefinition", definition);
|
|
167551
|
+
return null;
|
|
167552
|
+
}
|
|
167553
|
+
}
|
|
167554
|
+
if (!source) {
|
|
167555
|
+
console.error("Invalid FeatureSetDefinition", definition);
|
|
167556
|
+
return null;
|
|
167557
|
+
}
|
|
167558
|
+
if (isLoadableSource(source)) {
|
|
167559
|
+
await source.load();
|
|
167560
|
+
}
|
|
167561
|
+
return source;
|
|
167562
167562
|
}
|
|
167563
167563
|
async function serviceMetaData(url) {
|
|
167564
|
-
|
|
167565
|
-
|
|
167566
|
-
|
|
167567
|
-
|
|
167568
|
-
|
|
167569
|
-
|
|
167570
|
-
|
|
167571
|
-
|
|
167572
|
-
|
|
167573
|
-
|
|
167574
|
-
|
|
167564
|
+
url += "/layers";
|
|
167565
|
+
const request = await importRequest();
|
|
167566
|
+
const response = await request(url, { responseType: "json", query: { f: "json" } });
|
|
167567
|
+
const data = {
|
|
167568
|
+
layers: response.data?.layers ?? [],
|
|
167569
|
+
tables: response.data?.tables ?? []
|
|
167570
|
+
};
|
|
167571
|
+
const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
|
|
167572
|
+
const layers = filterFeatureLayerInfos(data.layers, queryCapability);
|
|
167573
|
+
const tables = filterFeatureLayerInfos(data.tables, queryCapability);
|
|
167574
|
+
return { layers, tables };
|
|
167575
167575
|
}
|
|
167576
167576
|
function filterFeatureLayerInfos(layers, queryCapability) {
|
|
167577
|
-
|
|
167578
|
-
|
|
167579
|
-
|
|
167580
|
-
|
|
167581
|
-
|
|
167582
|
-
|
|
167583
|
-
|
|
167584
|
-
|
|
167585
|
-
|
|
167586
|
-
|
|
167587
|
-
|
|
167588
|
-
|
|
167577
|
+
return layers.filter((layer) => {
|
|
167578
|
+
if (layer.type !== "Feature Layer" && layer.type !== "Table") {
|
|
167579
|
+
return false;
|
|
167580
|
+
}
|
|
167581
|
+
const capabilities = layer.capabilities
|
|
167582
|
+
? layer.capabilities
|
|
167583
|
+
.toLowerCase()
|
|
167584
|
+
.split(",")
|
|
167585
|
+
.map((value) => value.trim())
|
|
167586
|
+
: [];
|
|
167587
|
+
return capabilities.includes(queryCapability);
|
|
167588
|
+
});
|
|
167589
167589
|
}
|
|
167590
167590
|
//#endregion
|
|
167591
167591
|
//#region Functions to Editor Variables to a language service variables
|
|
167592
167592
|
async function variablesToLSVariable(editorVariables, kind = main.CompletionItemKind.Variable) {
|
|
167593
|
-
|
|
167594
|
-
|
|
167595
|
-
|
|
167596
|
-
|
|
167597
|
-
|
|
167598
|
-
|
|
167599
|
-
|
|
167600
|
-
|
|
167601
|
-
|
|
167602
|
-
|
|
167603
|
-
|
|
167604
|
-
|
|
167605
|
-
|
|
167606
|
-
|
|
167593
|
+
if (!editorVariables) {
|
|
167594
|
+
return [];
|
|
167595
|
+
}
|
|
167596
|
+
const properties = await Promise.all(editorVariables.map(async (editorVariable) => {
|
|
167597
|
+
switch (editorVariable.type) {
|
|
167598
|
+
case "dictionary":
|
|
167599
|
+
return dictionaryToLSDictionary(editorVariable, kind);
|
|
167600
|
+
case "feature":
|
|
167601
|
+
return featureToLSFeature(editorVariable, kind);
|
|
167602
|
+
default:
|
|
167603
|
+
return variableToLSVariable(editorVariable, kind);
|
|
167604
|
+
}
|
|
167605
|
+
}));
|
|
167606
|
+
return properties.filter((p) => p);
|
|
167607
167607
|
}
|
|
167608
167608
|
function variableToLSVariable(editorVariable, kind) {
|
|
167609
|
-
|
|
167610
|
-
|
|
167611
|
-
|
|
167612
|
-
|
|
167613
|
-
|
|
167614
|
-
|
|
167615
|
-
|
|
167616
|
-
|
|
167617
|
-
|
|
167618
|
-
|
|
167619
|
-
|
|
167620
|
-
|
|
167621
|
-
|
|
167622
|
-
|
|
167623
|
-
|
|
167624
|
-
|
|
167609
|
+
const { name, type } = editorVariable;
|
|
167610
|
+
const description = editorVariable.getDescription();
|
|
167611
|
+
return {
|
|
167612
|
+
name,
|
|
167613
|
+
description,
|
|
167614
|
+
type,
|
|
167615
|
+
completion: {
|
|
167616
|
+
label: name,
|
|
167617
|
+
detail: name,
|
|
167618
|
+
insertText: name,
|
|
167619
|
+
insertTextMode: main.InsertTextMode.asIs,
|
|
167620
|
+
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167621
|
+
kind,
|
|
167622
|
+
documentation: { kind: "markdown", value: description }
|
|
167623
|
+
}
|
|
167624
|
+
};
|
|
167625
167625
|
}
|
|
167626
167626
|
async function featureToLSFeature(editorFeature, kind) {
|
|
167627
|
-
|
|
167628
|
-
|
|
167629
|
-
|
|
167630
|
-
|
|
167631
|
-
|
|
167632
|
-
|
|
167633
|
-
|
|
167634
|
-
|
|
167635
|
-
insertTextMode: main.InsertTextMode.asIs,
|
|
167636
|
-
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167637
|
-
kind
|
|
167638
|
-
};
|
|
167639
|
-
const result = {
|
|
167640
|
-
name,
|
|
167641
|
-
description,
|
|
167642
|
-
type: "dictionary",
|
|
167643
|
-
properties: [],
|
|
167644
|
-
completion: resultCompletion
|
|
167645
|
-
};
|
|
167646
|
-
// No source definition, then it will be a feature without any known fields
|
|
167647
|
-
if (!source) {
|
|
167648
|
-
return result;
|
|
167649
|
-
}
|
|
167650
|
-
// Create properties for the fields and the aliases
|
|
167651
|
-
// Also improve the feature completion documentation
|
|
167652
|
-
let featureCompletionDescription = description;
|
|
167653
|
-
const fieldProfileValues = [];
|
|
167654
|
-
const aliasProfileValues = [];
|
|
167655
|
-
supportedFields(source.fields).forEach((field) => {
|
|
167656
|
-
let fieldCompletionDescription = `**${field.name}** \n${field.type}`;
|
|
167657
|
-
if (field.description) {
|
|
167658
|
-
fieldCompletionDescription += ` \n'${field.description}`;
|
|
167659
|
-
}
|
|
167660
|
-
if (featureCompletionDescription) {
|
|
167661
|
-
featureCompletionDescription += " \n \n";
|
|
167662
|
-
}
|
|
167663
|
-
featureCompletionDescription += `**${field.name}** (${field.alias ?? field.name}) \n${field.type}`;
|
|
167664
|
-
if (field.description) {
|
|
167665
|
-
featureCompletionDescription += ` \n'${field.description}`;
|
|
167666
|
-
}
|
|
167667
|
-
// The property for the field
|
|
167668
|
-
const type = fieldTypeToArcadeType(field);
|
|
167669
|
-
const insertText = getMemberExpressionProperty(field.name, false);
|
|
167670
|
-
fieldProfileValues.push({
|
|
167671
|
-
name: field.name,
|
|
167672
|
-
description: field.alias || field.name,
|
|
167673
|
-
type,
|
|
167674
|
-
completion: {
|
|
167675
|
-
label: field.name,
|
|
167676
|
-
detail: field.alias || field.name,
|
|
167677
|
-
insertText,
|
|
167627
|
+
// Get the source for the definition
|
|
167628
|
+
const source = await editorFeature.loadSource();
|
|
167629
|
+
const { name } = editorFeature;
|
|
167630
|
+
const description = editorFeature.getDescription();
|
|
167631
|
+
const resultCompletion = {
|
|
167632
|
+
label: name,
|
|
167633
|
+
detail: name,
|
|
167634
|
+
insertText: name,
|
|
167678
167635
|
insertTextMode: main.InsertTextMode.asIs,
|
|
167679
167636
|
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167680
|
-
kind
|
|
167681
|
-
|
|
167682
|
-
|
|
167683
|
-
|
|
167684
|
-
|
|
167685
|
-
|
|
167637
|
+
kind
|
|
167638
|
+
};
|
|
167639
|
+
const result = {
|
|
167640
|
+
name,
|
|
167641
|
+
description,
|
|
167642
|
+
type: "dictionary",
|
|
167643
|
+
properties: [],
|
|
167644
|
+
completion: resultCompletion
|
|
167645
|
+
};
|
|
167646
|
+
// No source definition, then it will be a feature without any known fields
|
|
167647
|
+
if (!source) {
|
|
167648
|
+
return result;
|
|
167686
167649
|
}
|
|
167687
|
-
//
|
|
167688
|
-
|
|
167689
|
-
|
|
167690
|
-
|
|
167691
|
-
|
|
167692
|
-
|
|
167693
|
-
|
|
167694
|
-
|
|
167695
|
-
|
|
167696
|
-
|
|
167697
|
-
|
|
167698
|
-
|
|
167699
|
-
|
|
167700
|
-
|
|
167701
|
-
|
|
167702
|
-
|
|
167703
|
-
|
|
167704
|
-
|
|
167650
|
+
// Create properties for the fields and the aliases
|
|
167651
|
+
// Also improve the feature completion documentation
|
|
167652
|
+
let featureCompletionDescription = description;
|
|
167653
|
+
const fieldProfileValues = [];
|
|
167654
|
+
const aliasProfileValues = [];
|
|
167655
|
+
supportedFields(source.fields).forEach((field) => {
|
|
167656
|
+
let fieldCompletionDescription = `**${field.name}** \n${field.type}`;
|
|
167657
|
+
if (field.description) {
|
|
167658
|
+
fieldCompletionDescription += ` \n'${field.description}`;
|
|
167659
|
+
}
|
|
167660
|
+
if (featureCompletionDescription) {
|
|
167661
|
+
featureCompletionDescription += " \n \n";
|
|
167662
|
+
}
|
|
167663
|
+
featureCompletionDescription += `**${field.name}** (${field.alias ?? field.name}) \n${field.type}`;
|
|
167664
|
+
if (field.description) {
|
|
167665
|
+
featureCompletionDescription += ` \n'${field.description}`;
|
|
167666
|
+
}
|
|
167667
|
+
// The property for the field
|
|
167668
|
+
const type = fieldTypeToArcadeType(field);
|
|
167669
|
+
const insertText = getMemberExpressionProperty(field.name, false);
|
|
167670
|
+
fieldProfileValues.push({
|
|
167671
|
+
name: field.name,
|
|
167672
|
+
description: field.alias || field.name,
|
|
167673
|
+
type,
|
|
167674
|
+
completion: {
|
|
167675
|
+
label: field.name,
|
|
167676
|
+
detail: field.alias || field.name,
|
|
167677
|
+
insertText,
|
|
167678
|
+
insertTextMode: main.InsertTextMode.asIs,
|
|
167679
|
+
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167680
|
+
kind: main.CompletionItemKind.Field,
|
|
167681
|
+
documentation: { kind: "markdown", value: fieldCompletionDescription }
|
|
167682
|
+
}
|
|
167683
|
+
});
|
|
167684
|
+
if (!field.alias || field.alias.toLowerCase() === field.name.toLowerCase()) {
|
|
167685
|
+
return;
|
|
167686
|
+
}
|
|
167687
|
+
// The property for the alias if different than the field name
|
|
167688
|
+
let aliasCompletionDescription = `**${field.alias}** \n${field.type}`;
|
|
167689
|
+
if (field.description) {
|
|
167690
|
+
aliasCompletionDescription += ` \n'${field.description}`;
|
|
167691
|
+
}
|
|
167692
|
+
aliasProfileValues.push({
|
|
167693
|
+
name: field.alias,
|
|
167694
|
+
description: field.name,
|
|
167695
|
+
type,
|
|
167696
|
+
completion: {
|
|
167697
|
+
label: field.alias,
|
|
167698
|
+
detail: field.name,
|
|
167699
|
+
insertText,
|
|
167700
|
+
insertTextMode: main.InsertTextMode.asIs,
|
|
167701
|
+
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167702
|
+
kind: main.CompletionItemKind.Field,
|
|
167703
|
+
documentation: { kind: "markdown", value: aliasCompletionDescription }
|
|
167704
|
+
}
|
|
167705
|
+
});
|
|
167705
167706
|
});
|
|
167706
|
-
|
|
167707
|
-
|
|
167708
|
-
|
|
167709
|
-
return result;
|
|
167707
|
+
result.properties = [...fieldProfileValues, ...aliasProfileValues];
|
|
167708
|
+
resultCompletion.documentation = { kind: "markdown", value: featureCompletionDescription };
|
|
167709
|
+
return result;
|
|
167710
167710
|
}
|
|
167711
167711
|
async function dictionaryToLSDictionary(editorDictionary, kind) {
|
|
167712
|
-
|
|
167713
|
-
|
|
167714
|
-
|
|
167715
|
-
|
|
167716
|
-
|
|
167717
|
-
|
|
167718
|
-
|
|
167719
|
-
|
|
167720
|
-
|
|
167721
|
-
|
|
167722
|
-
|
|
167723
|
-
|
|
167724
|
-
|
|
167725
|
-
|
|
167726
|
-
|
|
167727
|
-
|
|
167728
|
-
|
|
167729
|
-
|
|
167730
|
-
|
|
167731
|
-
|
|
167732
|
-
|
|
167733
|
-
|
|
167734
|
-
|
|
167735
|
-
|
|
167736
|
-
|
|
167737
|
-
|
|
167738
|
-
|
|
167739
|
-
|
|
167712
|
+
const { name, dictionaryVariables: variables } = editorDictionary;
|
|
167713
|
+
const description = editorDictionary.getDescription();
|
|
167714
|
+
const completionDescription = variables.reduce((previous, p) => {
|
|
167715
|
+
if (previous !== "") {
|
|
167716
|
+
previous += " \n \n";
|
|
167717
|
+
}
|
|
167718
|
+
previous += `**${p.name}** \n${p.type}`;
|
|
167719
|
+
const description = p.getDescription();
|
|
167720
|
+
if (description) {
|
|
167721
|
+
previous += ` \n${description}`;
|
|
167722
|
+
}
|
|
167723
|
+
return previous;
|
|
167724
|
+
}, description ?? "");
|
|
167725
|
+
return {
|
|
167726
|
+
name,
|
|
167727
|
+
description,
|
|
167728
|
+
type: "dictionary",
|
|
167729
|
+
properties: await variablesToLSVariable(variables, main.CompletionItemKind.Field),
|
|
167730
|
+
completion: {
|
|
167731
|
+
label: name,
|
|
167732
|
+
detail: name,
|
|
167733
|
+
insertText: name,
|
|
167734
|
+
insertTextMode: main.InsertTextMode.asIs,
|
|
167735
|
+
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167736
|
+
kind,
|
|
167737
|
+
documentation: { kind: "markdown", value: completionDescription }
|
|
167738
|
+
}
|
|
167739
|
+
};
|
|
167740
167740
|
}
|
|
167741
167741
|
/**
|
|
167742
167742
|
* Represents a item in the EditorProfile. The profile is converted into an optimized way for
|
|
@@ -167744,107 +167744,107 @@ async function dictionaryToLSDictionary(editorDictionary, kind) {
|
|
|
167744
167744
|
* structures are created such as groups.
|
|
167745
167745
|
*/
|
|
167746
167746
|
class ProfileItemBase {
|
|
167747
|
-
|
|
167748
|
-
|
|
167749
|
-
|
|
167750
|
-
|
|
167751
|
-
|
|
167752
|
-
}
|
|
167753
|
-
/**
|
|
167754
|
-
* Returns the label string.
|
|
167755
|
-
*/
|
|
167756
|
-
getLabel() {
|
|
167757
|
-
if (this._label == null) {
|
|
167758
|
-
return "";
|
|
167759
|
-
}
|
|
167760
|
-
if (typeof this._label === "string") {
|
|
167761
|
-
// Some of our variables can start with a $ sign.
|
|
167762
|
-
// If the component is under RTL, the string is messed up.
|
|
167763
|
-
// It is converted from $feature to feature$, This is not acceptable since the label
|
|
167764
|
-
// represents a variable name. We are adding in front of the $ sign a right to left mark.
|
|
167765
|
-
return q(this._label);
|
|
167766
|
-
}
|
|
167767
|
-
return H(this._profile?.intlStrings?.[this._label.code], this._label.formatValues);
|
|
167768
|
-
}
|
|
167769
|
-
/**
|
|
167770
|
-
* Returns the description string.
|
|
167771
|
-
*/
|
|
167772
|
-
getDescription() {
|
|
167773
|
-
if (this.description == null) {
|
|
167774
|
-
return "";
|
|
167747
|
+
constructor(_profile, _label, description) {
|
|
167748
|
+
this._profile = _profile;
|
|
167749
|
+
this._label = _label;
|
|
167750
|
+
this.description = description;
|
|
167751
|
+
this.filterDescription = false;
|
|
167775
167752
|
}
|
|
167776
|
-
|
|
167777
|
-
|
|
167753
|
+
/**
|
|
167754
|
+
* Returns the label string.
|
|
167755
|
+
*/
|
|
167756
|
+
getLabel() {
|
|
167757
|
+
if (this._label == null) {
|
|
167758
|
+
return "";
|
|
167759
|
+
}
|
|
167760
|
+
if (typeof this._label === "string") {
|
|
167761
|
+
// Some of our variables can start with a $ sign.
|
|
167762
|
+
// If the component is under RTL, the string is messed up.
|
|
167763
|
+
// It is converted from $feature to feature$, This is not acceptable since the label
|
|
167764
|
+
// represents a variable name. We are adding in front of the $ sign a right to left mark.
|
|
167765
|
+
return q(this._label);
|
|
167766
|
+
}
|
|
167767
|
+
return H(this._profile?.intlStrings?.[this._label.code], this._label.formatValues);
|
|
167778
167768
|
}
|
|
167779
|
-
|
|
167780
|
-
|
|
167781
|
-
|
|
167782
|
-
|
|
167783
|
-
|
|
167784
|
-
|
|
167785
|
-
|
|
167786
|
-
|
|
167769
|
+
/**
|
|
167770
|
+
* Returns the description string.
|
|
167771
|
+
*/
|
|
167772
|
+
getDescription() {
|
|
167773
|
+
if (this.description == null) {
|
|
167774
|
+
return "";
|
|
167775
|
+
}
|
|
167776
|
+
if (typeof this.description === "string") {
|
|
167777
|
+
return this.description;
|
|
167778
|
+
}
|
|
167779
|
+
return H(this._profile?.intlStrings?.[this.description.code ?? ""], this.description.formatValues);
|
|
167787
167780
|
}
|
|
167788
|
-
|
|
167789
|
-
|
|
167781
|
+
/**
|
|
167782
|
+
* Returns true if the item pass the filter test
|
|
167783
|
+
*/
|
|
167784
|
+
passFilter(filterExpression) {
|
|
167785
|
+
if (!filterExpression) {
|
|
167786
|
+
return true;
|
|
167787
|
+
}
|
|
167788
|
+
if (filterExpression.test(this.getLabel())) {
|
|
167789
|
+
return true;
|
|
167790
|
+
}
|
|
167791
|
+
return this.filterDescription && filterExpression.test(this.getDescription());
|
|
167790
167792
|
}
|
|
167791
|
-
return this.filterDescription && filterExpression.test(this.getDescription());
|
|
167792
|
-
}
|
|
167793
167793
|
}
|
|
167794
167794
|
/**
|
|
167795
167795
|
* The base class for profile variables representation in the EditorProfile.
|
|
167796
167796
|
*/
|
|
167797
167797
|
class VariableBase extends ProfileItemBase {
|
|
167798
|
-
|
|
167799
|
-
|
|
167800
|
-
|
|
167801
|
-
|
|
167802
|
-
|
|
167803
|
-
|
|
167804
|
-
|
|
167805
|
-
|
|
167806
|
-
|
|
167798
|
+
constructor(props) {
|
|
167799
|
+
super(props.profile, props.label, props.description ?? props.declaration?.description);
|
|
167800
|
+
this.declaration = props.declaration ?? {};
|
|
167801
|
+
this.name = props.declaration?.name ?? "";
|
|
167802
|
+
this.snippet = props.snippet || "";
|
|
167803
|
+
this.nonInteractive = props.nonInteractive ?? false;
|
|
167804
|
+
this.filterDescription = props.filterDescription ?? false;
|
|
167805
|
+
this.icon = props.icon;
|
|
167806
|
+
}
|
|
167807
167807
|
}
|
|
167808
167808
|
/**
|
|
167809
167809
|
* Represents the IProfileValue.
|
|
167810
167810
|
*/
|
|
167811
167811
|
class ValueVariable extends VariableBase {
|
|
167812
|
-
|
|
167813
|
-
|
|
167814
|
-
|
|
167815
|
-
|
|
167816
|
-
|
|
167817
|
-
|
|
167818
|
-
|
|
167819
|
-
|
|
167820
|
-
|
|
167812
|
+
constructor(props) {
|
|
167813
|
+
super(props);
|
|
167814
|
+
this.type = "text";
|
|
167815
|
+
this.isCollection = false;
|
|
167816
|
+
this.type = props?.declaration?.type ?? "text";
|
|
167817
|
+
}
|
|
167818
|
+
getDescription() {
|
|
167819
|
+
if (this.description == null) {
|
|
167820
|
+
return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
|
|
167821
|
+
}
|
|
167822
|
+
return super.getDescription();
|
|
167823
|
+
}
|
|
167824
|
+
toProfileVariableDefinition() {
|
|
167825
|
+
return { type: this.type, name: "", ...this.declaration };
|
|
167821
167826
|
}
|
|
167822
|
-
return super.getDescription();
|
|
167823
|
-
}
|
|
167824
|
-
toProfileVariableDefinition() {
|
|
167825
|
-
return { type: this.type, name: "", ...this.declaration };
|
|
167826
|
-
}
|
|
167827
167827
|
}
|
|
167828
167828
|
/**
|
|
167829
167829
|
* Represents the IProfileArray. The main difference is that the IProfileValue type
|
|
167830
167830
|
* is used as valueType.
|
|
167831
167831
|
*/
|
|
167832
167832
|
class ArrayVariable extends VariableBase {
|
|
167833
|
-
|
|
167834
|
-
|
|
167835
|
-
|
|
167836
|
-
|
|
167837
|
-
|
|
167838
|
-
|
|
167839
|
-
|
|
167840
|
-
|
|
167841
|
-
|
|
167833
|
+
constructor(props) {
|
|
167834
|
+
super(props);
|
|
167835
|
+
this.type = "array";
|
|
167836
|
+
this.isCollection = false;
|
|
167837
|
+
this.elementType = props.declaration?.elementType ?? { type: "number", name: "number" };
|
|
167838
|
+
}
|
|
167839
|
+
getDescription() {
|
|
167840
|
+
if (this.description == null) {
|
|
167841
|
+
return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
|
|
167842
|
+
}
|
|
167843
|
+
return super.getDescription();
|
|
167844
|
+
}
|
|
167845
|
+
toProfileVariableDefinition() {
|
|
167846
|
+
return { type: this.type, elementType: this.elementType, name: "", ...this.declaration };
|
|
167842
167847
|
}
|
|
167843
|
-
return super.getDescription();
|
|
167844
|
-
}
|
|
167845
|
-
toProfileVariableDefinition() {
|
|
167846
|
-
return { type: this.type, elementType: this.elementType, name: "", ...this.declaration };
|
|
167847
|
-
}
|
|
167848
167848
|
}
|
|
167849
167849
|
/**
|
|
167850
167850
|
* Represents a collection of items. The collection of items can be synchronous or
|
|
@@ -167853,595 +167853,595 @@ class ArrayVariable extends VariableBase {
|
|
|
167853
167853
|
* collection is ready or not.
|
|
167854
167854
|
*/
|
|
167855
167855
|
class CollectionBasedVariable extends VariableBase {
|
|
167856
|
-
|
|
167857
|
-
|
|
167858
|
-
|
|
167859
|
-
|
|
167856
|
+
constructor(props) {
|
|
167857
|
+
super(props);
|
|
167858
|
+
this.isCollection = true;
|
|
167859
|
+
this._loaded = true;
|
|
167860
|
+
/**
|
|
167861
|
+
* The collection of items used to display the profile.
|
|
167862
|
+
* If the collection is asynchronous, the 'load' function should
|
|
167863
|
+
* be called first before using the items.
|
|
167864
|
+
*/
|
|
167865
|
+
this.variables = [];
|
|
167866
|
+
}
|
|
167860
167867
|
/**
|
|
167861
|
-
*
|
|
167862
|
-
* If the collection is asynchronous, the 'load' function should
|
|
167863
|
-
* be called first before using the items.
|
|
167868
|
+
* Returns true if the collection has been loaded
|
|
167864
167869
|
*/
|
|
167865
|
-
|
|
167866
|
-
|
|
167867
|
-
|
|
167868
|
-
|
|
167869
|
-
|
|
167870
|
-
|
|
167871
|
-
|
|
167872
|
-
|
|
167873
|
-
|
|
167874
|
-
|
|
167875
|
-
|
|
167876
|
-
|
|
167877
|
-
|
|
167878
|
-
|
|
167879
|
-
|
|
167880
|
-
|
|
167881
|
-
|
|
167882
|
-
|
|
167883
|
-
|
|
167884
|
-
return null;
|
|
167885
|
-
}
|
|
167886
|
-
get informationType() {
|
|
167887
|
-
return "";
|
|
167888
|
-
}
|
|
167870
|
+
get loaded() {
|
|
167871
|
+
return this._loaded;
|
|
167872
|
+
}
|
|
167873
|
+
/**
|
|
167874
|
+
* Loads the items if the collection is asynchronous.
|
|
167875
|
+
* If the colleciton is synchronous then the function is a no-op.
|
|
167876
|
+
*/
|
|
167877
|
+
async loadSource() {
|
|
167878
|
+
return;
|
|
167879
|
+
}
|
|
167880
|
+
/**
|
|
167881
|
+
* Returns an url to the associated information
|
|
167882
|
+
*/
|
|
167883
|
+
get informationUrl() {
|
|
167884
|
+
return null;
|
|
167885
|
+
}
|
|
167886
|
+
get informationType() {
|
|
167887
|
+
return "";
|
|
167888
|
+
}
|
|
167889
167889
|
}
|
|
167890
167890
|
class GroupOfVariables extends ProfileItemBase {
|
|
167891
|
-
|
|
167892
|
-
|
|
167893
|
-
|
|
167894
|
-
|
|
167895
|
-
|
|
167896
|
-
|
|
167897
|
-
|
|
167898
|
-
|
|
167899
|
-
|
|
167891
|
+
constructor(profile, label, variables = []) {
|
|
167892
|
+
super(profile, label);
|
|
167893
|
+
this.variables = variables;
|
|
167894
|
+
this.type = "group";
|
|
167895
|
+
this.isCollection = true;
|
|
167896
|
+
}
|
|
167897
|
+
passFilter() {
|
|
167898
|
+
return true;
|
|
167899
|
+
}
|
|
167900
167900
|
}
|
|
167901
167901
|
class DictionaryVariable extends CollectionBasedVariable {
|
|
167902
|
-
|
|
167903
|
-
|
|
167904
|
-
|
|
167905
|
-
|
|
167906
|
-
|
|
167907
|
-
|
|
167908
|
-
|
|
167909
|
-
|
|
167910
|
-
|
|
167911
|
-
|
|
167912
|
-
|
|
167913
|
-
|
|
167914
|
-
|
|
167902
|
+
constructor(props) {
|
|
167903
|
+
super(props);
|
|
167904
|
+
this.type = "dictionary";
|
|
167905
|
+
/**
|
|
167906
|
+
* The variables that the dictionary holds. It is different than the variables.
|
|
167907
|
+
* The variables may contain grouping.
|
|
167908
|
+
*/
|
|
167909
|
+
this.dictionaryVariables = [];
|
|
167910
|
+
this.loadPropertyDeclarations(props?.declaration?.properties);
|
|
167911
|
+
// If we have a snippet then wrap the properties in a group and use the snippet as the heading
|
|
167912
|
+
// This is not applicable for root Dictionary such as Profile
|
|
167913
|
+
if (this.snippet && this.dictionaryVariables.length) {
|
|
167914
|
+
this.variables = [new GroupOfVariables(this._profile, this.snippet, this.dictionaryVariables)];
|
|
167915
|
+
}
|
|
167915
167916
|
}
|
|
167916
|
-
|
|
167917
|
-
|
|
167918
|
-
|
|
167919
|
-
|
|
167920
|
-
|
|
167921
|
-
|
|
167922
|
-
|
|
167923
|
-
|
|
167924
|
-
|
|
167925
|
-
|
|
167926
|
-
|
|
167927
|
-
|
|
167928
|
-
|
|
167929
|
-
|
|
167930
|
-
|
|
167931
|
-
|
|
167932
|
-
|
|
167933
|
-
|
|
167934
|
-
|
|
167935
|
-
|
|
167936
|
-
|
|
167937
|
-
|
|
167938
|
-
|
|
167939
|
-
|
|
167940
|
-
|
|
167941
|
-
|
|
167942
|
-
|
|
167943
|
-
|
|
167944
|
-
|
|
167945
|
-
|
|
167946
|
-
|
|
167947
|
-
|
|
167948
|
-
|
|
167949
|
-
|
|
167950
|
-
|
|
167951
|
-
|
|
167952
|
-
|
|
167953
|
-
|
|
167954
|
-
|
|
167955
|
-
|
|
167956
|
-
|
|
167957
|
-
|
|
167958
|
-
|
|
167959
|
-
|
|
167960
|
-
|
|
167961
|
-
|
|
167962
|
-
|
|
167963
|
-
|
|
167964
|
-
|
|
167965
|
-
|
|
167966
|
-
|
|
167967
|
-
|
|
167968
|
-
|
|
167969
|
-
|
|
167970
|
-
|
|
167971
|
-
|
|
167972
|
-
|
|
167917
|
+
loadPropertyDeclarations(declarations) {
|
|
167918
|
+
this.dictionaryVariables = this.createVariableInstances(declarations);
|
|
167919
|
+
this.variables = this.dictionaryVariables;
|
|
167920
|
+
}
|
|
167921
|
+
createVariableInstances(declarations) {
|
|
167922
|
+
if (!Array.isArray(declarations)) {
|
|
167923
|
+
return [];
|
|
167924
|
+
}
|
|
167925
|
+
const properties = [];
|
|
167926
|
+
declarations.forEach((declaration) => {
|
|
167927
|
+
const variable = this.createVariableInstance(declaration);
|
|
167928
|
+
if (variable) {
|
|
167929
|
+
properties.push(variable);
|
|
167930
|
+
}
|
|
167931
|
+
});
|
|
167932
|
+
return properties;
|
|
167933
|
+
}
|
|
167934
|
+
createVariableInstance(declaration) {
|
|
167935
|
+
const snippet = assembleMemberExpression(this.snippet, declaration.name);
|
|
167936
|
+
switch (declaration.type) {
|
|
167937
|
+
case "number":
|
|
167938
|
+
case "text":
|
|
167939
|
+
case "boolean":
|
|
167940
|
+
case "date":
|
|
167941
|
+
case "geometry":
|
|
167942
|
+
return new ValueVariable({ profile: this._profile, declaration, label: snippet, snippet });
|
|
167943
|
+
case "feature":
|
|
167944
|
+
return new FeatureVariable({ profile: this._profile, declaration, label: snippet, snippet });
|
|
167945
|
+
case "featureSet":
|
|
167946
|
+
return new FeatureSetVariable({ profile: this._profile, declaration, label: snippet, snippet }, [
|
|
167947
|
+
new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })
|
|
167948
|
+
]);
|
|
167949
|
+
case "featureSetCollection":
|
|
167950
|
+
return new FeatureSetCollectionVariable({
|
|
167951
|
+
profile: this._profile,
|
|
167952
|
+
declaration,
|
|
167953
|
+
label: snippet,
|
|
167954
|
+
snippet
|
|
167955
|
+
});
|
|
167956
|
+
case "dictionary":
|
|
167957
|
+
return new DictionaryVariable({
|
|
167958
|
+
profile: this._profile,
|
|
167959
|
+
declaration,
|
|
167960
|
+
label: snippet,
|
|
167961
|
+
snippet
|
|
167962
|
+
});
|
|
167963
|
+
case "array":
|
|
167964
|
+
return new ArrayVariable({
|
|
167965
|
+
profile: this._profile,
|
|
167966
|
+
declaration,
|
|
167967
|
+
label: snippet,
|
|
167968
|
+
snippet
|
|
167969
|
+
});
|
|
167970
|
+
default:
|
|
167971
|
+
console.error("Invalid profile variable", declaration);
|
|
167972
|
+
return null;
|
|
167973
|
+
}
|
|
167974
|
+
}
|
|
167975
|
+
toProfileVariableDefinition() {
|
|
167976
|
+
return {
|
|
167977
|
+
type: this.type,
|
|
167978
|
+
name: "",
|
|
167979
|
+
...this.declaration,
|
|
167980
|
+
properties: this.dictionaryVariables.map((variable) => variable.toProfileVariableDefinition())
|
|
167981
|
+
};
|
|
167973
167982
|
}
|
|
167974
|
-
}
|
|
167975
|
-
toProfileVariableDefinition() {
|
|
167976
|
-
return {
|
|
167977
|
-
type: this.type,
|
|
167978
|
-
name: "",
|
|
167979
|
-
...this.declaration,
|
|
167980
|
-
properties: this.dictionaryVariables.map((variable) => variable.toProfileVariableDefinition())
|
|
167981
|
-
};
|
|
167982
|
-
}
|
|
167983
167983
|
}
|
|
167984
167984
|
class SourceBasedVariable extends CollectionBasedVariable {
|
|
167985
|
-
|
|
167986
|
-
|
|
167987
|
-
|
|
167988
|
-
|
|
167989
|
-
|
|
167990
|
-
|
|
167991
|
-
}
|
|
167992
|
-
get title() {
|
|
167993
|
-
return this._source?.title ?? "";
|
|
167994
|
-
}
|
|
167995
|
-
get url() {
|
|
167996
|
-
return this._definition?.url ?? "";
|
|
167997
|
-
}
|
|
167998
|
-
get informationUrl() {
|
|
167999
|
-
if (!this.loaded) {
|
|
168000
|
-
return null;
|
|
167985
|
+
constructor(props, relationshipsProperties) {
|
|
167986
|
+
super(props);
|
|
167987
|
+
this.relationshipsProperties = relationshipsProperties;
|
|
167988
|
+
this._source = null;
|
|
167989
|
+
this._loaded = false;
|
|
167990
|
+
this._definition = props?.declaration?.definition;
|
|
168001
167991
|
}
|
|
168002
|
-
|
|
168003
|
-
|
|
168004
|
-
return null;
|
|
167992
|
+
get title() {
|
|
167993
|
+
return this._source?.title ?? "";
|
|
168005
167994
|
}
|
|
168006
|
-
|
|
168007
|
-
|
|
168008
|
-
}
|
|
168009
|
-
get informationType() {
|
|
168010
|
-
return this._profile?.intlStrings?.layer ?? "layer";
|
|
168011
|
-
}
|
|
168012
|
-
loadSource() {
|
|
168013
|
-
if (D(this._loadPromise) && G(this._loadPromise)) {
|
|
168014
|
-
return this._loadPromise;
|
|
167995
|
+
get url() {
|
|
167996
|
+
return this._definition?.url ?? "";
|
|
168015
167997
|
}
|
|
168016
|
-
|
|
168017
|
-
|
|
168018
|
-
|
|
168019
|
-
|
|
168020
|
-
|
|
168021
|
-
|
|
168022
|
-
|
|
168023
|
-
|
|
168024
|
-
|
|
168025
|
-
|
|
168026
|
-
}
|
|
168027
|
-
// Create the value property
|
|
168028
|
-
const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
|
|
168029
|
-
return new ValueVariable({
|
|
168030
|
-
profile: this._profile,
|
|
168031
|
-
label: valueSnippet,
|
|
168032
|
-
description: field.alias ?? field.name,
|
|
168033
|
-
snippet: valueSnippet,
|
|
168034
|
-
icon: fieldTypeToIconName(field),
|
|
168035
|
-
filterDescription: true
|
|
168036
|
-
});
|
|
168037
|
-
}
|
|
168038
|
-
_getSubtypesOrDomainValuesDictionary(field) {
|
|
168039
|
-
if (!isDomainsCapableLayer(this._source)) {
|
|
168040
|
-
return null;
|
|
167998
|
+
get informationUrl() {
|
|
167999
|
+
if (!this.loaded) {
|
|
168000
|
+
return null;
|
|
168001
|
+
}
|
|
168002
|
+
const url = this._source?.url;
|
|
168003
|
+
if (!url) {
|
|
168004
|
+
return null;
|
|
168005
|
+
}
|
|
168006
|
+
const layerId = this._source?.layerId ?? "";
|
|
168007
|
+
return `${url}/${layerId}`;
|
|
168041
168008
|
}
|
|
168042
|
-
|
|
168043
|
-
|
|
168044
|
-
const domainDictionary = new DictionaryVariable({
|
|
168045
|
-
profile: this._profile,
|
|
168046
|
-
label: valueSnippet,
|
|
168047
|
-
description: field.alias ?? field.name,
|
|
168048
|
-
snippet: valueSnippet,
|
|
168049
|
-
icon: "form-dropdown"
|
|
168050
|
-
});
|
|
168051
|
-
// Add the header group
|
|
168052
|
-
const headerGroup = new GroupOfVariables(this._profile, field.alias ?? field.name, [
|
|
168053
|
-
new ValueVariable({
|
|
168054
|
-
profile: this._profile,
|
|
168055
|
-
label: valueSnippet,
|
|
168056
|
-
description: "",
|
|
168057
|
-
snippet: valueSnippet
|
|
168058
|
-
})
|
|
168059
|
-
]);
|
|
168060
|
-
domainDictionary.variables = [headerGroup];
|
|
168061
|
-
// If it is the subtype field then get its coded domain values
|
|
168062
|
-
if (isTypesCapabaleLayer(this._source) && field.name === this._source.typeIdField) {
|
|
168063
|
-
const subtypesGroup = getSubtypesProperties(this._profile, this._source.types, field);
|
|
168064
|
-
domainDictionary.variables.push(subtypesGroup);
|
|
168065
|
-
return domainDictionary;
|
|
168066
|
-
}
|
|
168067
|
-
// Since its' not the subtype field then add the snippet for the domain name
|
|
168068
|
-
if (this.type === "feature") {
|
|
168069
|
-
const domainNameSnippet = `DomainName(${this.snippet}, "${field.name}")`;
|
|
168070
|
-
headerGroup.variables.push(new ValueVariable({
|
|
168071
|
-
profile: this._profile,
|
|
168072
|
-
label: domainNameSnippet,
|
|
168073
|
-
description: "",
|
|
168074
|
-
snippet: domainNameSnippet
|
|
168075
|
-
}));
|
|
168076
|
-
}
|
|
168077
|
-
if (isTypesCapabaleLayer(this._source)) {
|
|
168078
|
-
// Check if all the domains for the field in the types are inherited.
|
|
168079
|
-
// If it is we can simplify the structure by avoiding splitting in subtypes
|
|
168080
|
-
const allInherited = this._source.types.every((t) => t.domains?.[field.name]?.type === "inherited");
|
|
168081
|
-
if (!allInherited) {
|
|
168082
|
-
// We have domains per subtype
|
|
168083
|
-
// We need to go thru each types and create a dictionary.
|
|
168084
|
-
const domainValuesBySubtypeGroup = getDomainValuesBySubtypeGroup(this._profile, this._source.types, field);
|
|
168085
|
-
if (!domainValuesBySubtypeGroup) {
|
|
168086
|
-
return null;
|
|
168087
|
-
}
|
|
168088
|
-
domainDictionary.variables.push(domainValuesBySubtypeGroup);
|
|
168089
|
-
return domainDictionary;
|
|
168090
|
-
}
|
|
168009
|
+
get informationType() {
|
|
168010
|
+
return this._profile?.intlStrings?.layer ?? "layer";
|
|
168091
168011
|
}
|
|
168092
|
-
|
|
168093
|
-
|
|
168094
|
-
|
|
168095
|
-
|
|
168096
|
-
|
|
168097
|
-
|
|
168012
|
+
loadSource() {
|
|
168013
|
+
if (D(this._loadPromise) && G(this._loadPromise)) {
|
|
168014
|
+
return this._loadPromise;
|
|
168015
|
+
}
|
|
168016
|
+
this._loadPromise = this._loadSource();
|
|
168017
|
+
return this._loadPromise;
|
|
168098
168018
|
}
|
|
168099
|
-
|
|
168100
|
-
|
|
168101
|
-
|
|
168102
|
-
|
|
168103
|
-
|
|
168104
|
-
|
|
168105
|
-
|
|
168019
|
+
_getFieldProperty(field) {
|
|
168020
|
+
// Check if the field is the type id field or of the field has a coded domain.
|
|
168021
|
+
// If it has then the property will be an exanpdable property (dictionary).
|
|
168022
|
+
// Otherwise just return a simple value property.
|
|
168023
|
+
const subtypesOrDomainValuesDictionary = this._getSubtypesOrDomainValuesDictionary(field);
|
|
168024
|
+
if (subtypesOrDomainValuesDictionary) {
|
|
168025
|
+
return subtypesOrDomainValuesDictionary;
|
|
168026
|
+
}
|
|
168027
|
+
// Create the value property
|
|
168028
|
+
const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
|
|
168029
|
+
return new ValueVariable({
|
|
168030
|
+
profile: this._profile,
|
|
168031
|
+
label: valueSnippet,
|
|
168032
|
+
description: field.alias ?? field.name,
|
|
168033
|
+
snippet: valueSnippet,
|
|
168034
|
+
icon: fieldTypeToIconName(field),
|
|
168035
|
+
filterDescription: true
|
|
168036
|
+
});
|
|
168106
168037
|
}
|
|
168107
|
-
|
|
168108
|
-
|
|
168109
|
-
|
|
168038
|
+
_getSubtypesOrDomainValuesDictionary(field) {
|
|
168039
|
+
if (!isDomainsCapableLayer(this._source)) {
|
|
168040
|
+
return null;
|
|
168041
|
+
}
|
|
168042
|
+
// Create the domain dictionary, we may not use it
|
|
168043
|
+
const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
|
|
168044
|
+
const domainDictionary = new DictionaryVariable({
|
|
168045
|
+
profile: this._profile,
|
|
168046
|
+
label: valueSnippet,
|
|
168047
|
+
description: field.alias ?? field.name,
|
|
168048
|
+
snippet: valueSnippet,
|
|
168049
|
+
icon: "form-dropdown"
|
|
168050
|
+
});
|
|
168051
|
+
// Add the header group
|
|
168052
|
+
const headerGroup = new GroupOfVariables(this._profile, field.alias ?? field.name, [
|
|
168053
|
+
new ValueVariable({
|
|
168054
|
+
profile: this._profile,
|
|
168055
|
+
label: valueSnippet,
|
|
168056
|
+
description: "",
|
|
168057
|
+
snippet: valueSnippet
|
|
168058
|
+
})
|
|
168059
|
+
]);
|
|
168060
|
+
domainDictionary.variables = [headerGroup];
|
|
168061
|
+
// If it is the subtype field then get its coded domain values
|
|
168062
|
+
if (isTypesCapabaleLayer(this._source) && field.name === this._source.typeIdField) {
|
|
168063
|
+
const subtypesGroup = getSubtypesProperties(this._profile, this._source.types, field);
|
|
168064
|
+
domainDictionary.variables.push(subtypesGroup);
|
|
168065
|
+
return domainDictionary;
|
|
168066
|
+
}
|
|
168067
|
+
// Since its' not the subtype field then add the snippet for the domain name
|
|
168068
|
+
if (this.type === "feature") {
|
|
168069
|
+
const domainNameSnippet = `DomainName(${this.snippet}, "${field.name}")`;
|
|
168070
|
+
headerGroup.variables.push(new ValueVariable({
|
|
168071
|
+
profile: this._profile,
|
|
168072
|
+
label: domainNameSnippet,
|
|
168073
|
+
description: "",
|
|
168074
|
+
snippet: domainNameSnippet
|
|
168075
|
+
}));
|
|
168076
|
+
}
|
|
168077
|
+
if (isTypesCapabaleLayer(this._source)) {
|
|
168078
|
+
// Check if all the domains for the field in the types are inherited.
|
|
168079
|
+
// If it is we can simplify the structure by avoiding splitting in subtypes
|
|
168080
|
+
const allInherited = this._source.types.every((t) => t.domains?.[field.name]?.type === "inherited");
|
|
168081
|
+
if (!allInherited) {
|
|
168082
|
+
// We have domains per subtype
|
|
168083
|
+
// We need to go thru each types and create a dictionary.
|
|
168084
|
+
const domainValuesBySubtypeGroup = getDomainValuesBySubtypeGroup(this._profile, this._source.types, field);
|
|
168085
|
+
if (!domainValuesBySubtypeGroup) {
|
|
168086
|
+
return null;
|
|
168087
|
+
}
|
|
168088
|
+
domainDictionary.variables.push(domainValuesBySubtypeGroup);
|
|
168089
|
+
return domainDictionary;
|
|
168090
|
+
}
|
|
168091
|
+
}
|
|
168092
|
+
// Either we have types but all the domains are inherited or we don't have types
|
|
168093
|
+
const domainValuesGroup = getDomainValuesProperties(this._profile, this._source.getFieldDomain?.(field.name), {
|
|
168094
|
+
code: "domainvalues"
|
|
168095
|
+
});
|
|
168096
|
+
if (!domainValuesGroup) {
|
|
168097
|
+
return null;
|
|
168098
|
+
}
|
|
168099
|
+
domainDictionary.variables.push(domainValuesGroup);
|
|
168100
|
+
return domainDictionary;
|
|
168110
168101
|
}
|
|
168111
|
-
|
|
168112
|
-
|
|
168113
|
-
|
|
168114
|
-
|
|
168115
|
-
|
|
168116
|
-
|
|
168117
|
-
|
|
168118
|
-
|
|
168119
|
-
|
|
168120
|
-
|
|
168121
|
-
|
|
168122
|
-
|
|
168123
|
-
|
|
168124
|
-
|
|
168125
|
-
|
|
168126
|
-
|
|
168127
|
-
|
|
168128
|
-
|
|
168129
|
-
|
|
168130
|
-
|
|
168131
|
-
|
|
168132
|
-
|
|
168102
|
+
async _getRelationshipsProperty() {
|
|
168103
|
+
// We need the data store to find the relationship feature layers
|
|
168104
|
+
if (!this.relationshipsProperties?.exposeRelationships || !this._profile?.supportFeatureSetFunctions) {
|
|
168105
|
+
return null;
|
|
168106
|
+
}
|
|
168107
|
+
const source = this._source;
|
|
168108
|
+
if (!isRelationshipsCapableLayer(source)) {
|
|
168109
|
+
return null;
|
|
168110
|
+
}
|
|
168111
|
+
const relationshipsGroup = new GroupOfVariables(this._profile, { code: "relationships" });
|
|
168112
|
+
const relationshipItems = await Promise.all(source.relationships.map(async (relationship) => {
|
|
168113
|
+
const relatedLayer = await getRelatedFeatureLayer(source, relationship);
|
|
168114
|
+
if (!isFeatureLayerInstance(relatedLayer)) {
|
|
168115
|
+
return null;
|
|
168116
|
+
}
|
|
168117
|
+
if (relationship.relatedTableId === this.relationshipsProperties?.sourceTableId) {
|
|
168118
|
+
// We don't want to show the reverse relationship
|
|
168119
|
+
return null;
|
|
168120
|
+
}
|
|
168121
|
+
const snippet = `FeatureSetByRelationshipName(${this.snippet}, "${relationship.name}")`;
|
|
168122
|
+
return new FeatureSetVariable({
|
|
168123
|
+
profile: this._profile,
|
|
168124
|
+
declaration: { definition: relatedLayer },
|
|
168125
|
+
label: relatedLayer.title,
|
|
168126
|
+
description: "",
|
|
168127
|
+
nonInteractive: true
|
|
168128
|
+
}, [new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })], { exposeRelationships: true, sourceTableId: source.layerId });
|
|
168129
|
+
}));
|
|
168130
|
+
relationshipsGroup.variables = relationshipItems.filter(D);
|
|
168131
|
+
if (!relationshipsGroup.variables.length) {
|
|
168132
|
+
return null;
|
|
168133
|
+
}
|
|
168134
|
+
return relationshipsGroup;
|
|
168133
168135
|
}
|
|
168134
|
-
return relationshipsGroup;
|
|
168135
|
-
}
|
|
168136
168136
|
}
|
|
168137
168137
|
class FeatureVariable extends SourceBasedVariable {
|
|
168138
|
-
|
|
168139
|
-
|
|
168140
|
-
|
|
168141
|
-
}
|
|
168142
|
-
get title() {
|
|
168143
|
-
if (isSupportedLayerInstance(this._source)) {
|
|
168144
|
-
return this._source.title;
|
|
168145
|
-
}
|
|
168146
|
-
return { code: "feature" };
|
|
168147
|
-
}
|
|
168148
|
-
async _loadSource() {
|
|
168149
|
-
if (this.loaded) {
|
|
168150
|
-
return this._source;
|
|
168138
|
+
constructor(props) {
|
|
168139
|
+
super(props, { exposeRelationships: true });
|
|
168140
|
+
this.type = "feature";
|
|
168151
168141
|
}
|
|
168152
|
-
|
|
168153
|
-
|
|
168154
|
-
|
|
168155
|
-
|
|
168156
|
-
|
|
168157
|
-
// The title group and snippet
|
|
168158
|
-
const title = isSupportedLayerInstance(this._source) ? this._source.title : "";
|
|
168159
|
-
this.variables.push(new GroupOfVariables(this._profile, title, [
|
|
168160
|
-
new ValueVariable({
|
|
168161
|
-
profile: this._profile,
|
|
168162
|
-
label: this.snippet,
|
|
168163
|
-
description: "",
|
|
168164
|
-
snippet: this.snippet
|
|
168165
|
-
})
|
|
168166
|
-
]));
|
|
168167
|
-
// The collection of feature attribute values
|
|
168168
|
-
const valuesGroup = new GroupOfVariables(this._profile, { code: "values" });
|
|
168169
|
-
this.variables.push(valuesGroup);
|
|
168170
|
-
// Add the geometry if it's a feature layer and not a table
|
|
168171
|
-
if (isTableCapableLayer(this._source) && !this._source.isTable) {
|
|
168172
|
-
const snippet = `Geometry(${this.snippet})`;
|
|
168173
|
-
const geometryProperty = new ValueVariable({
|
|
168174
|
-
profile: this._profile,
|
|
168175
|
-
declaration: { name: snippet },
|
|
168176
|
-
label: snippet,
|
|
168177
|
-
description: "Geometry",
|
|
168178
|
-
snippet,
|
|
168179
|
-
icon: "shapes",
|
|
168180
|
-
filterDescription: true
|
|
168181
|
-
});
|
|
168182
|
-
valuesGroup.variables.push(geometryProperty);
|
|
168183
|
-
}
|
|
168184
|
-
this._source.fields.sort(sortFields(this._source)).forEach((field) => {
|
|
168185
|
-
valuesGroup.variables.push(this._getFieldProperty(field));
|
|
168186
|
-
});
|
|
168187
|
-
// The relatonships
|
|
168188
|
-
const relationshipsGroup = await this._getRelationshipsProperty();
|
|
168189
|
-
if (relationshipsGroup) {
|
|
168190
|
-
this.variables.push(relationshipsGroup);
|
|
168191
|
-
}
|
|
168142
|
+
get title() {
|
|
168143
|
+
if (isSupportedLayerInstance(this._source)) {
|
|
168144
|
+
return this._source.title;
|
|
168145
|
+
}
|
|
168146
|
+
return { code: "feature" };
|
|
168192
168147
|
}
|
|
168193
|
-
|
|
168194
|
-
|
|
168195
|
-
|
|
168148
|
+
async _loadSource() {
|
|
168149
|
+
if (this.loaded) {
|
|
168150
|
+
return this._source;
|
|
168151
|
+
}
|
|
168152
|
+
try {
|
|
168153
|
+
this._source = await supportedSourceFromDefinition(this._definition);
|
|
168154
|
+
if (!this._source) {
|
|
168155
|
+
throw new Error("Invalid definition");
|
|
168156
|
+
}
|
|
168157
|
+
// The title group and snippet
|
|
168158
|
+
const title = isSupportedLayerInstance(this._source) ? this._source.title : "";
|
|
168159
|
+
this.variables.push(new GroupOfVariables(this._profile, title, [
|
|
168160
|
+
new ValueVariable({
|
|
168161
|
+
profile: this._profile,
|
|
168162
|
+
label: this.snippet,
|
|
168163
|
+
description: "",
|
|
168164
|
+
snippet: this.snippet
|
|
168165
|
+
})
|
|
168166
|
+
]));
|
|
168167
|
+
// The collection of feature attribute values
|
|
168168
|
+
const valuesGroup = new GroupOfVariables(this._profile, { code: "values" });
|
|
168169
|
+
this.variables.push(valuesGroup);
|
|
168170
|
+
// Add the geometry if it's a feature layer and not a table
|
|
168171
|
+
if (isTableCapableLayer(this._source) && !this._source.isTable) {
|
|
168172
|
+
const snippet = `Geometry(${this.snippet})`;
|
|
168173
|
+
const geometryProperty = new ValueVariable({
|
|
168174
|
+
profile: this._profile,
|
|
168175
|
+
declaration: { name: snippet },
|
|
168176
|
+
label: snippet,
|
|
168177
|
+
description: "Geometry",
|
|
168178
|
+
snippet,
|
|
168179
|
+
icon: "shapes",
|
|
168180
|
+
filterDescription: true
|
|
168181
|
+
});
|
|
168182
|
+
valuesGroup.variables.push(geometryProperty);
|
|
168183
|
+
}
|
|
168184
|
+
this._source.fields.sort(sortFields(this._source)).forEach((field) => {
|
|
168185
|
+
valuesGroup.variables.push(this._getFieldProperty(field));
|
|
168186
|
+
});
|
|
168187
|
+
// The relatonships
|
|
168188
|
+
const relationshipsGroup = await this._getRelationshipsProperty();
|
|
168189
|
+
if (relationshipsGroup) {
|
|
168190
|
+
this.variables.push(relationshipsGroup);
|
|
168191
|
+
}
|
|
168192
|
+
}
|
|
168193
|
+
catch (e) {
|
|
168194
|
+
console.error("Loading issue", e, this);
|
|
168195
|
+
this._source = null;
|
|
168196
|
+
}
|
|
168197
|
+
finally {
|
|
168198
|
+
this._loaded = true;
|
|
168199
|
+
}
|
|
168200
|
+
return this._source;
|
|
168196
168201
|
}
|
|
168197
|
-
|
|
168198
|
-
|
|
168202
|
+
toProfileVariableDefinition() {
|
|
168203
|
+
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168199
168204
|
}
|
|
168200
|
-
return this._source;
|
|
168201
|
-
}
|
|
168202
|
-
toProfileVariableDefinition() {
|
|
168203
|
-
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168204
|
-
}
|
|
168205
168205
|
}
|
|
168206
168206
|
class FeatureSetVariable extends SourceBasedVariable {
|
|
168207
|
-
|
|
168208
|
-
|
|
168209
|
-
|
|
168210
|
-
|
|
168211
|
-
|
|
168212
|
-
|
|
168213
|
-
|
|
168214
|
-
}
|
|
168215
|
-
get title() {
|
|
168216
|
-
if (isSupportedLayerInstance(this._source)) {
|
|
168217
|
-
return this._source.title;
|
|
168218
|
-
}
|
|
168219
|
-
return { code: "featureset" };
|
|
168220
|
-
}
|
|
168221
|
-
async _loadSource() {
|
|
168222
|
-
if (this.loaded) {
|
|
168223
|
-
return this._source;
|
|
168207
|
+
constructor(props, featureSetSnippets = [],
|
|
168208
|
+
// Relationships for feature set if only supported if the feature set is actually
|
|
168209
|
+
// representing a relationsip feature layer for a feature source.
|
|
168210
|
+
relationshipProps) {
|
|
168211
|
+
super(props, relationshipProps);
|
|
168212
|
+
this.featureSetSnippets = featureSetSnippets;
|
|
168213
|
+
this.type = "featureSet";
|
|
168224
168214
|
}
|
|
168225
|
-
|
|
168226
|
-
|
|
168227
|
-
|
|
168228
|
-
|
|
168229
|
-
|
|
168230
|
-
// The title group and snippet
|
|
168231
|
-
this.variables.push(new GroupOfVariables(this._profile, this.title, this.featureSetSnippets));
|
|
168232
|
-
// Add the fields
|
|
168233
|
-
const fieldsGroup = new GroupOfVariables(this._profile, { code: "fields" });
|
|
168234
|
-
this.variables.push(fieldsGroup);
|
|
168235
|
-
fieldsGroup.variables = this._source.fields
|
|
168236
|
-
.sort(sortFields(this._source))
|
|
168237
|
-
.map((field) => this._getFieldProperty(field));
|
|
168238
|
-
// Add the relationships if enabled
|
|
168239
|
-
const relationshipsGroup = await this._getRelationshipsProperty();
|
|
168240
|
-
if (relationshipsGroup) {
|
|
168241
|
-
this.variables.push(relationshipsGroup);
|
|
168242
|
-
}
|
|
168215
|
+
get title() {
|
|
168216
|
+
if (isSupportedLayerInstance(this._source)) {
|
|
168217
|
+
return this._source.title;
|
|
168218
|
+
}
|
|
168219
|
+
return { code: "featureset" };
|
|
168243
168220
|
}
|
|
168244
|
-
|
|
168245
|
-
|
|
168246
|
-
|
|
168221
|
+
async _loadSource() {
|
|
168222
|
+
if (this.loaded) {
|
|
168223
|
+
return this._source;
|
|
168224
|
+
}
|
|
168225
|
+
try {
|
|
168226
|
+
this._source = await supportedSourceFromDefinition(this._definition);
|
|
168227
|
+
if (!this._source) {
|
|
168228
|
+
throw new Error("Invalid definition");
|
|
168229
|
+
}
|
|
168230
|
+
// The title group and snippet
|
|
168231
|
+
this.variables.push(new GroupOfVariables(this._profile, this.title, this.featureSetSnippets));
|
|
168232
|
+
// Add the fields
|
|
168233
|
+
const fieldsGroup = new GroupOfVariables(this._profile, { code: "fields" });
|
|
168234
|
+
this.variables.push(fieldsGroup);
|
|
168235
|
+
fieldsGroup.variables = this._source.fields
|
|
168236
|
+
.sort(sortFields(this._source))
|
|
168237
|
+
.map((field) => this._getFieldProperty(field));
|
|
168238
|
+
// Add the relationships if enabled
|
|
168239
|
+
const relationshipsGroup = await this._getRelationshipsProperty();
|
|
168240
|
+
if (relationshipsGroup) {
|
|
168241
|
+
this.variables.push(relationshipsGroup);
|
|
168242
|
+
}
|
|
168243
|
+
}
|
|
168244
|
+
catch (e) {
|
|
168245
|
+
console.error("Loading issue", e, this);
|
|
168246
|
+
this._source = null;
|
|
168247
|
+
}
|
|
168248
|
+
finally {
|
|
168249
|
+
this._loaded = true;
|
|
168250
|
+
}
|
|
168251
|
+
return this._source;
|
|
168247
168252
|
}
|
|
168248
|
-
|
|
168249
|
-
|
|
168253
|
+
toProfileVariableDefinition() {
|
|
168254
|
+
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168250
168255
|
}
|
|
168251
|
-
return this._source;
|
|
168252
|
-
}
|
|
168253
|
-
toProfileVariableDefinition() {
|
|
168254
|
-
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168255
|
-
}
|
|
168256
168256
|
}
|
|
168257
168257
|
class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
168258
|
-
|
|
168259
|
-
|
|
168260
|
-
|
|
168261
|
-
|
|
168262
|
-
|
|
168263
|
-
|
|
168264
|
-
|
|
168265
|
-
|
|
168266
|
-
|
|
168267
|
-
|
|
168268
|
-
|
|
168269
|
-
|
|
168270
|
-
|
|
168258
|
+
constructor(props) {
|
|
168259
|
+
super(props);
|
|
168260
|
+
this.type = "featureSetCollection";
|
|
168261
|
+
this._featureSetCollections = null;
|
|
168262
|
+
this._loaded = false;
|
|
168263
|
+
this._definition = props?.declaration?.definition;
|
|
168264
|
+
}
|
|
168265
|
+
get informationUrl() {
|
|
168266
|
+
if (!this.loaded || !this._featureSetCollections) {
|
|
168267
|
+
return null;
|
|
168268
|
+
}
|
|
168269
|
+
if (typeof this._featureSetCollections.source !== "string") {
|
|
168270
|
+
return portalItemPageUrl(this._featureSetCollections.source.portalItem);
|
|
168271
|
+
}
|
|
168272
|
+
// const firstLayer = this._featureSetCollection.layers[0] ?? this._featureSetCollection.tables[0];
|
|
168273
|
+
// if (!firstLayer) {
|
|
168274
|
+
return null;
|
|
168275
|
+
// }
|
|
168276
|
+
// return `${firstLayer.url}`;
|
|
168271
168277
|
}
|
|
168272
|
-
|
|
168273
|
-
|
|
168274
|
-
|
|
168275
|
-
|
|
168276
|
-
|
|
168277
|
-
|
|
168278
|
-
|
|
168279
|
-
|
|
168280
|
-
return "";
|
|
168278
|
+
get informationType() {
|
|
168279
|
+
if (!this.loaded || !this._featureSetCollections) {
|
|
168280
|
+
return "";
|
|
168281
|
+
}
|
|
168282
|
+
if (typeof this._featureSetCollections.source !== "string") {
|
|
168283
|
+
return this._profile?.intlStrings?.webmap ?? "webmap";
|
|
168284
|
+
}
|
|
168285
|
+
return this._profile?.intlStrings?.featureservice ?? "featureservice";
|
|
168281
168286
|
}
|
|
168282
|
-
|
|
168283
|
-
|
|
168287
|
+
async loadSource() {
|
|
168288
|
+
if (D(this._loadPromise) && G(this._loadPromise)) {
|
|
168289
|
+
return this._loadPromise;
|
|
168290
|
+
}
|
|
168291
|
+
this._loadPromise = this._loadSource();
|
|
168292
|
+
return this._loadPromise;
|
|
168284
168293
|
}
|
|
168285
|
-
|
|
168286
|
-
|
|
168287
|
-
|
|
168288
|
-
|
|
168289
|
-
|
|
168294
|
+
async _loadSource() {
|
|
168295
|
+
if (this.loaded) {
|
|
168296
|
+
return this._featureSetCollections;
|
|
168297
|
+
}
|
|
168298
|
+
try {
|
|
168299
|
+
this._featureSetCollections = await this._featureSetCollectionsFromDefinition();
|
|
168300
|
+
if (!this._featureSetCollections) {
|
|
168301
|
+
throw new Error("Invalid definition");
|
|
168302
|
+
}
|
|
168303
|
+
// Create the group for the header
|
|
168304
|
+
const groupLabel = typeof this._featureSetCollections.source === "string"
|
|
168305
|
+
? { code: this._featureSetCollections.source.endsWith("FeatureServer") ? "featureservice" : "mapservice" }
|
|
168306
|
+
: {
|
|
168307
|
+
code: "webmapformat",
|
|
168308
|
+
formatValues: {
|
|
168309
|
+
webMapTitle: this._featureSetCollections.source.portalItem?.title ?? "Untitled map"
|
|
168310
|
+
}
|
|
168311
|
+
};
|
|
168312
|
+
const headerGroup = new GroupOfVariables(this._profile, groupLabel, [
|
|
168313
|
+
new ValueVariable({
|
|
168314
|
+
profile: this._profile,
|
|
168315
|
+
label: this.snippet,
|
|
168316
|
+
description: "",
|
|
168317
|
+
snippet: this.snippet
|
|
168318
|
+
})
|
|
168319
|
+
]);
|
|
168320
|
+
// Creates the groups for the layer and tables
|
|
168321
|
+
const layersGroup = new GroupOfVariables(this._profile, { code: "layers" }, this._featureSetCollections.layers);
|
|
168322
|
+
const tablesGroup = new GroupOfVariables(this._profile, { code: "tables" }, this._featureSetCollections.tables);
|
|
168323
|
+
this.variables.push(headerGroup, layersGroup, tablesGroup);
|
|
168324
|
+
}
|
|
168325
|
+
catch (e) {
|
|
168326
|
+
console.error("Loading issue", e, this);
|
|
168327
|
+
this._featureSetCollections = null;
|
|
168328
|
+
}
|
|
168329
|
+
finally {
|
|
168330
|
+
this._loaded = true;
|
|
168331
|
+
}
|
|
168332
|
+
return this._featureSetCollections;
|
|
168290
168333
|
}
|
|
168291
|
-
|
|
168292
|
-
|
|
168293
|
-
|
|
168294
|
-
|
|
168295
|
-
|
|
168296
|
-
|
|
168334
|
+
async _featureSetCollectionsFromDefinition() {
|
|
168335
|
+
if (!this._definition) {
|
|
168336
|
+
return null;
|
|
168337
|
+
}
|
|
168338
|
+
if (isWebMapInstance(this._definition)) {
|
|
168339
|
+
return this._featureSetCollectionFromWebMap(this._definition);
|
|
168340
|
+
}
|
|
168341
|
+
if (isSupportedLayerInstance(this._definition)) {
|
|
168342
|
+
return this._featureSetCollectionFromUrl(this._definition.url);
|
|
168343
|
+
}
|
|
168344
|
+
if (isPortalItemDefinition(this._definition)) {
|
|
168345
|
+
// Preload the portal item so we can discover if are dealing with a Web Map
|
|
168346
|
+
// or Feature Service
|
|
168347
|
+
return this._featureSetCollectionFromPortalItem(this._definition.portalItem);
|
|
168348
|
+
}
|
|
168349
|
+
if (isUrlDefinition(this._definition)) {
|
|
168350
|
+
// Assume that the url is pointing to a feature server
|
|
168351
|
+
return this._featureSetCollectionFromUrl(this._definition.url);
|
|
168352
|
+
}
|
|
168353
|
+
return null;
|
|
168297
168354
|
}
|
|
168298
|
-
|
|
168299
|
-
|
|
168300
|
-
|
|
168301
|
-
|
|
168302
|
-
|
|
168303
|
-
|
|
168304
|
-
|
|
168305
|
-
|
|
168306
|
-
|
|
168307
|
-
code: "webmapformat",
|
|
168308
|
-
formatValues: {
|
|
168309
|
-
webMapTitle: this._featureSetCollections.source.portalItem?.title ?? "Untitled map"
|
|
168310
|
-
}
|
|
168355
|
+
async _featureSetCollectionFromWebMap(definition) {
|
|
168356
|
+
const webMap = isWebMapInstance(definition) ? definition : await newWebMap({ portalItem: definition });
|
|
168357
|
+
await webMap.loadAll();
|
|
168358
|
+
// Until jsapi fix a bug we have to load the table separately
|
|
168359
|
+
await Promise.all(webMap.tables.map(async (t) => t.load()));
|
|
168360
|
+
return {
|
|
168361
|
+
layers: this._convertWebMapLayersToVariables(webMap.layers),
|
|
168362
|
+
tables: this._convertWebMapLayersToVariables(webMap.tables, true),
|
|
168363
|
+
source: webMap
|
|
168311
168364
|
};
|
|
168312
|
-
const headerGroup = new GroupOfVariables(this._profile, groupLabel, [
|
|
168313
|
-
new ValueVariable({
|
|
168314
|
-
profile: this._profile,
|
|
168315
|
-
label: this.snippet,
|
|
168316
|
-
description: "",
|
|
168317
|
-
snippet: this.snippet
|
|
168318
|
-
})
|
|
168319
|
-
]);
|
|
168320
|
-
// Creates the groups for the layer and tables
|
|
168321
|
-
const layersGroup = new GroupOfVariables(this._profile, { code: "layers" }, this._featureSetCollections.layers);
|
|
168322
|
-
const tablesGroup = new GroupOfVariables(this._profile, { code: "tables" }, this._featureSetCollections.tables);
|
|
168323
|
-
this.variables.push(headerGroup, layersGroup, tablesGroup);
|
|
168324
|
-
}
|
|
168325
|
-
catch (e) {
|
|
168326
|
-
console.error("Loading issue", e, this);
|
|
168327
|
-
this._featureSetCollections = null;
|
|
168328
|
-
}
|
|
168329
|
-
finally {
|
|
168330
|
-
this._loaded = true;
|
|
168331
|
-
}
|
|
168332
|
-
return this._featureSetCollections;
|
|
168333
|
-
}
|
|
168334
|
-
async _featureSetCollectionsFromDefinition() {
|
|
168335
|
-
if (!this._definition) {
|
|
168336
|
-
return null;
|
|
168337
|
-
}
|
|
168338
|
-
if (isWebMapInstance(this._definition)) {
|
|
168339
|
-
return this._featureSetCollectionFromWebMap(this._definition);
|
|
168340
168365
|
}
|
|
168341
|
-
|
|
168342
|
-
|
|
168343
|
-
|
|
168344
|
-
|
|
168345
|
-
|
|
168346
|
-
|
|
168347
|
-
|
|
168366
|
+
async _featureSetCollectionFromPortalItem(definition) {
|
|
168367
|
+
const portalItem = await newPortalItem(definition);
|
|
168368
|
+
await portalItem.load();
|
|
168369
|
+
switch (portalItem.type) {
|
|
168370
|
+
case "Web Map":
|
|
168371
|
+
return this._featureSetCollectionFromWebMap(portalItem);
|
|
168372
|
+
case "Feature Service":
|
|
168373
|
+
return this._featureSetCollectionFromUrl(portalItem.url);
|
|
168374
|
+
default:
|
|
168375
|
+
console.error("Unsupported portal item", definition);
|
|
168376
|
+
return null;
|
|
168377
|
+
}
|
|
168348
168378
|
}
|
|
168349
|
-
|
|
168350
|
-
|
|
168351
|
-
|
|
168379
|
+
async _featureSetCollectionFromUrl(url) {
|
|
168380
|
+
url = url.replace(/\/featureserver\/[0-9]*/iu, "/FeatureServer");
|
|
168381
|
+
url = url.replace(/\/mapserver\/[0-9]*/iu, "/MapServer");
|
|
168382
|
+
url = url.split("?")[0];
|
|
168383
|
+
const metadata = await serviceMetaData(url);
|
|
168384
|
+
const layersPromise = Promise.all(metadata.layers.map(async (layerInfo) => {
|
|
168385
|
+
const fl = await newFeatureLayer({ url: `${url}/${layerInfo.id}` });
|
|
168386
|
+
await fl.load();
|
|
168387
|
+
return this._createFeatureSetVariable(fl);
|
|
168388
|
+
}));
|
|
168389
|
+
const tablesPromise = Promise.all(metadata.tables.map(async (layerInfo) => {
|
|
168390
|
+
const fl = await newFeatureLayer({ url: `${url}/${layerInfo.id}` });
|
|
168391
|
+
await fl.load();
|
|
168392
|
+
return this._createFeatureSetVariable(fl);
|
|
168393
|
+
}));
|
|
168394
|
+
const [layers, tables] = await Promise.all([layersPromise, tablesPromise]);
|
|
168395
|
+
return { layers, tables, source: url };
|
|
168396
|
+
}
|
|
168397
|
+
_convertWebMapLayersToVariables(layers, filteringTables = false) {
|
|
168398
|
+
const layerVariables = [];
|
|
168399
|
+
layers
|
|
168400
|
+
.toArray()
|
|
168401
|
+
.reverse()
|
|
168402
|
+
.forEach((layer) => {
|
|
168403
|
+
if (isFeatureLayerInstance(layer)) {
|
|
168404
|
+
layerVariables.push(this._createFeatureSetVariable(layer, true));
|
|
168405
|
+
return;
|
|
168406
|
+
}
|
|
168407
|
+
if (isGroupLayerInstance(layer)) {
|
|
168408
|
+
const groupLayerVariables = filteringTables
|
|
168409
|
+
? this._convertWebMapLayersToVariables(layer.allTables, true)
|
|
168410
|
+
: this._convertWebMapLayersToVariables(layer.allLayers);
|
|
168411
|
+
layerVariables.push(...groupLayerVariables);
|
|
168412
|
+
}
|
|
168413
|
+
});
|
|
168414
|
+
return layerVariables;
|
|
168352
168415
|
}
|
|
168353
|
-
|
|
168354
|
-
|
|
168355
|
-
|
|
168356
|
-
|
|
168357
|
-
|
|
168358
|
-
|
|
168359
|
-
|
|
168360
|
-
|
|
168361
|
-
layers: this._convertWebMapLayersToVariables(webMap.layers),
|
|
168362
|
-
tables: this._convertWebMapLayersToVariables(webMap.tables, true),
|
|
168363
|
-
source: webMap
|
|
168364
|
-
};
|
|
168365
|
-
}
|
|
168366
|
-
async _featureSetCollectionFromPortalItem(definition) {
|
|
168367
|
-
const portalItem = await newPortalItem(definition);
|
|
168368
|
-
await portalItem.load();
|
|
168369
|
-
switch (portalItem.type) {
|
|
168370
|
-
case "Web Map":
|
|
168371
|
-
return this._featureSetCollectionFromWebMap(portalItem);
|
|
168372
|
-
case "Feature Service":
|
|
168373
|
-
return this._featureSetCollectionFromUrl(portalItem.url);
|
|
168374
|
-
default:
|
|
168375
|
-
console.error("Unsupported portal item", definition);
|
|
168376
|
-
return null;
|
|
168416
|
+
_createFeatureSetVariable(featureLayer, isFromWebMap = false) {
|
|
168417
|
+
return new FeatureSetVariable({
|
|
168418
|
+
profile: this._profile,
|
|
168419
|
+
declaration: { definition: featureLayer },
|
|
168420
|
+
label: featureLayer.title,
|
|
168421
|
+
description: "",
|
|
168422
|
+
nonInteractive: true
|
|
168423
|
+
}, this._makeFeatureSetSnippets(featureLayer, isFromWebMap));
|
|
168377
168424
|
}
|
|
168378
|
-
|
|
168379
|
-
|
|
168380
|
-
|
|
168381
|
-
|
|
168382
|
-
|
|
168383
|
-
|
|
168384
|
-
|
|
168385
|
-
|
|
168386
|
-
|
|
168387
|
-
|
|
168388
|
-
|
|
168389
|
-
|
|
168390
|
-
|
|
168391
|
-
|
|
168392
|
-
|
|
168393
|
-
|
|
168394
|
-
const [layers, tables] = await Promise.all([layersPromise, tablesPromise]);
|
|
168395
|
-
return { layers, tables, source: url };
|
|
168396
|
-
}
|
|
168397
|
-
_convertWebMapLayersToVariables(layers, filteringTables = false) {
|
|
168398
|
-
const layerVariables = [];
|
|
168399
|
-
layers
|
|
168400
|
-
.toArray()
|
|
168401
|
-
.reverse()
|
|
168402
|
-
.forEach((layer) => {
|
|
168403
|
-
if (isFeatureLayerInstance(layer)) {
|
|
168404
|
-
layerVariables.push(this._createFeatureSetVariable(layer, true));
|
|
168405
|
-
return;
|
|
168406
|
-
}
|
|
168407
|
-
if (isGroupLayerInstance(layer)) {
|
|
168408
|
-
const groupLayerVariables = filteringTables
|
|
168409
|
-
? this._convertWebMapLayersToVariables(layer.allTables, true)
|
|
168410
|
-
: this._convertWebMapLayersToVariables(layer.allLayers);
|
|
168411
|
-
layerVariables.push(...groupLayerVariables);
|
|
168412
|
-
}
|
|
168413
|
-
});
|
|
168414
|
-
return layerVariables;
|
|
168415
|
-
}
|
|
168416
|
-
_createFeatureSetVariable(featureLayer, isFromWebMap = false) {
|
|
168417
|
-
return new FeatureSetVariable({
|
|
168418
|
-
profile: this._profile,
|
|
168419
|
-
declaration: { definition: featureLayer },
|
|
168420
|
-
label: featureLayer.title,
|
|
168421
|
-
description: "",
|
|
168422
|
-
nonInteractive: true
|
|
168423
|
-
}, this._makeFeatureSetSnippets(featureLayer, isFromWebMap));
|
|
168424
|
-
}
|
|
168425
|
-
_makeFeatureSetSnippets(featureLayer, isFromWebMap = false) {
|
|
168426
|
-
if (!this._profile?.supportFeatureSetFunctions) {
|
|
168427
|
-
return [];
|
|
168428
|
-
}
|
|
168429
|
-
if (isFromWebMap) {
|
|
168430
|
-
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.id}")`;
|
|
168431
|
-
const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayer.title}")`;
|
|
168432
|
-
return [
|
|
168433
|
-
new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById }),
|
|
168434
|
-
new ValueVariable({ profile: this._profile, label: snippetByName, description: "", snippet: snippetByName })
|
|
168435
|
-
];
|
|
168425
|
+
_makeFeatureSetSnippets(featureLayer, isFromWebMap = false) {
|
|
168426
|
+
if (!this._profile?.supportFeatureSetFunctions) {
|
|
168427
|
+
return [];
|
|
168428
|
+
}
|
|
168429
|
+
if (isFromWebMap) {
|
|
168430
|
+
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.id}")`;
|
|
168431
|
+
const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayer.title}")`;
|
|
168432
|
+
return [
|
|
168433
|
+
new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById }),
|
|
168434
|
+
new ValueVariable({ profile: this._profile, label: snippetByName, description: "", snippet: snippetByName })
|
|
168435
|
+
];
|
|
168436
|
+
}
|
|
168437
|
+
else {
|
|
168438
|
+
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.layerId}")`;
|
|
168439
|
+
return [new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById })];
|
|
168440
|
+
}
|
|
168436
168441
|
}
|
|
168437
|
-
|
|
168438
|
-
|
|
168439
|
-
return [new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById })];
|
|
168442
|
+
toProfileVariableDefinition() {
|
|
168443
|
+
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168440
168444
|
}
|
|
168441
|
-
}
|
|
168442
|
-
toProfileVariableDefinition() {
|
|
168443
|
-
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168444
|
-
}
|
|
168445
168445
|
}
|
|
168446
168446
|
/**
|
|
168447
168447
|
* The EditorProfile is an object that represents an Arcade Profile.
|
|
@@ -168452,64 +168452,64 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
168452
168452
|
* They need to be loaded asynchronously to get the metadata necessary for validation and completion.
|
|
168453
168453
|
*/
|
|
168454
168454
|
class EditorProfile extends DictionaryVariable {
|
|
168455
|
-
|
|
168456
|
-
|
|
168457
|
-
|
|
168458
|
-
|
|
168459
|
-
|
|
168460
|
-
|
|
168461
|
-
|
|
168462
|
-
|
|
168463
|
-
|
|
168464
|
-
|
|
168465
|
-
|
|
168466
|
-
|
|
168467
|
-
|
|
168468
|
-
|
|
168469
|
-
|
|
168470
|
-
|
|
168471
|
-
|
|
168472
|
-
|
|
168473
|
-
|
|
168474
|
-
|
|
168475
|
-
|
|
168476
|
-
|
|
168477
|
-
|
|
168478
|
-
|
|
168479
|
-
|
|
168480
|
-
|
|
168481
|
-
|
|
168482
|
-
|
|
168483
|
-
|
|
168484
|
-
|
|
168485
|
-
|
|
168486
|
-
|
|
168487
|
-
|
|
168488
|
-
|
|
168489
|
-
|
|
168490
|
-
|
|
168491
|
-
|
|
168492
|
-
|
|
168493
|
-
|
|
168455
|
+
constructor(definition, intlStrings, locale = "en") {
|
|
168456
|
+
// Delay the load of the variable declarations so we have a `this`
|
|
168457
|
+
super({
|
|
168458
|
+
profile: null,
|
|
168459
|
+
declaration: { properties: [] }
|
|
168460
|
+
});
|
|
168461
|
+
this.definition = definition;
|
|
168462
|
+
this.intlStrings = intlStrings;
|
|
168463
|
+
this.locale = locale;
|
|
168464
|
+
this.variables = [];
|
|
168465
|
+
// We are the root
|
|
168466
|
+
this._profile = this;
|
|
168467
|
+
// Now that `this` is defined, we can load the variables
|
|
168468
|
+
this.loadPropertyDeclarations(definition?.variables);
|
|
168469
|
+
}
|
|
168470
|
+
/**
|
|
168471
|
+
* Returns true if the profile supports feature set functions for snippets.
|
|
168472
|
+
*/
|
|
168473
|
+
get supportFeatureSetFunctions() {
|
|
168474
|
+
return this.definition?.bundles?.includes("data-access") ?? false;
|
|
168475
|
+
}
|
|
168476
|
+
/**
|
|
168477
|
+
* Returns the language service profile. It is different than the editor profile as it is optimized for Monaco.
|
|
168478
|
+
*/
|
|
168479
|
+
async toLSProfile() {
|
|
168480
|
+
const { apiVersion, bundles, hiddenApiItems } = this.definition ?? {};
|
|
168481
|
+
const variables = await variablesToLSVariable(this.dictionaryVariables);
|
|
168482
|
+
return { apiVersion, bundles, variables, hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()) };
|
|
168483
|
+
}
|
|
168484
|
+
/**
|
|
168485
|
+
* Returns the EditorProfile as a json. The EditorProfile may have been updated. This function allows to
|
|
168486
|
+
* get the new json representing mutations.
|
|
168487
|
+
*/
|
|
168488
|
+
toEditorProfileDefinition() {
|
|
168489
|
+
return {
|
|
168490
|
+
...this.definition,
|
|
168491
|
+
variables: this.dictionaryVariables.map((variable) => variable.toProfileVariableDefinition())
|
|
168492
|
+
};
|
|
168493
|
+
}
|
|
168494
168494
|
}
|
|
168495
168495
|
//#endregion
|
|
168496
168496
|
|
|
168497
168497
|
function isFeatureDefinition(item) {
|
|
168498
|
-
|
|
168499
|
-
|
|
168500
|
-
|
|
168501
|
-
|
|
168502
|
-
|
|
168498
|
+
return (isSupportedLayerInstance(item) ||
|
|
168499
|
+
isFeatureSetInstance(item) ||
|
|
168500
|
+
isUrlDefinition(item) ||
|
|
168501
|
+
isFieldsDefinition(item) ||
|
|
168502
|
+
isFeatureLayerItemDefinition(item));
|
|
168503
168503
|
}
|
|
168504
168504
|
function isFeatureSetDefinition(item) {
|
|
168505
|
-
|
|
168506
|
-
|
|
168507
|
-
|
|
168508
|
-
|
|
168509
|
-
|
|
168505
|
+
return (isFeatureLayerInstance(item) ||
|
|
168506
|
+
isFeatureSetInstance(item) ||
|
|
168507
|
+
isUrlDefinition(item) ||
|
|
168508
|
+
isFieldsDefinition(item) ||
|
|
168509
|
+
isFeatureLayerItemDefinition(item));
|
|
168510
168510
|
}
|
|
168511
168511
|
function isFeatureSetCollectionDefinition(item) {
|
|
168512
|
-
|
|
168512
|
+
return isPortalItemDefinition(item) || isWebMapInstance(item) || isFeatureSetDefinition(item);
|
|
168513
168513
|
}
|
|
168514
168514
|
/**
|
|
168515
168515
|
* Get a PredefinedProfile for a locale. If not already loaded then fetch it.
|
|
@@ -168517,26 +168517,26 @@ function isFeatureSetCollectionDefinition(item) {
|
|
|
168517
168517
|
* the english version of the profile.
|
|
168518
168518
|
*/
|
|
168519
168519
|
async function getSdkPredefinedProfiles(locale = "en") {
|
|
168520
|
-
|
|
168521
|
-
|
|
168522
|
-
|
|
168523
|
-
}
|
|
168524
|
-
if (!x.has(locale)) {
|
|
168525
|
-
return getSdkPredefinedProfiles("en");
|
|
168526
|
-
}
|
|
168527
|
-
try {
|
|
168528
|
-
const response = await fetch(getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
|
|
168529
|
-
if (response.ok) {
|
|
168530
|
-
return cacheSdkPredefinedProfiles(locale, await response.json());
|
|
168520
|
+
const profiles = sdkPredefinedProfilesMap.get(locale);
|
|
168521
|
+
if (profiles) {
|
|
168522
|
+
return profiles;
|
|
168531
168523
|
}
|
|
168532
|
-
if (locale
|
|
168533
|
-
|
|
168524
|
+
if (!x.has(locale)) {
|
|
168525
|
+
return getSdkPredefinedProfiles("en");
|
|
168526
|
+
}
|
|
168527
|
+
try {
|
|
168528
|
+
const response = await fetch(getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
|
|
168529
|
+
if (response.ok) {
|
|
168530
|
+
return cacheSdkPredefinedProfiles(locale, await response.json());
|
|
168531
|
+
}
|
|
168532
|
+
if (locale === "en") {
|
|
168533
|
+
return null;
|
|
168534
|
+
}
|
|
168535
|
+
return getSdkPredefinedProfiles("en");
|
|
168536
|
+
}
|
|
168537
|
+
catch (e) {
|
|
168538
|
+
return null;
|
|
168534
168539
|
}
|
|
168535
|
-
return getSdkPredefinedProfiles("en");
|
|
168536
|
-
}
|
|
168537
|
-
catch (e) {
|
|
168538
|
-
return null;
|
|
168539
|
-
}
|
|
168540
168540
|
}
|
|
168541
168541
|
const sdkPredefinedProfilesMap = new Map();
|
|
168542
168542
|
/**
|
|
@@ -168544,237 +168544,237 @@ const sdkPredefinedProfilesMap = new Map();
|
|
|
168544
168544
|
* Map of profiles per locale.
|
|
168545
168545
|
*/
|
|
168546
168546
|
function cacheSdkPredefinedProfiles(locale, profiles) {
|
|
168547
|
-
|
|
168548
|
-
|
|
168549
|
-
|
|
168550
|
-
|
|
168551
|
-
|
|
168552
|
-
|
|
168547
|
+
const map = new Map();
|
|
168548
|
+
profiles.forEach((profile) => {
|
|
168549
|
+
map.set(profile.id, profile);
|
|
168550
|
+
});
|
|
168551
|
+
sdkPredefinedProfilesMap.set(locale, map);
|
|
168552
|
+
return map;
|
|
168553
168553
|
}
|
|
168554
168554
|
async function getSdkPredefinedProfile(id, locale = "en") {
|
|
168555
|
-
|
|
168556
|
-
|
|
168555
|
+
const profiles = await getSdkPredefinedProfiles(locale);
|
|
168556
|
+
return profiles?.get(id) ?? null;
|
|
168557
168557
|
}
|
|
168558
168558
|
function isExtendedPredefinedProfileDefinition(predefinedProfileDefinition) {
|
|
168559
|
-
|
|
168559
|
+
return Array.isArray(predefinedProfileDefinition?.additionalVariables);
|
|
168560
168560
|
}
|
|
168561
168561
|
function convertApiVariables(variables) {
|
|
168562
|
-
|
|
168563
|
-
|
|
168564
|
-
|
|
168565
|
-
|
|
168562
|
+
if (!variables) {
|
|
168563
|
+
return [];
|
|
168564
|
+
}
|
|
168565
|
+
return variables.map(convertApiVariable);
|
|
168566
168566
|
}
|
|
168567
168567
|
function convertApiVariable(variable) {
|
|
168568
|
-
|
|
168569
|
-
|
|
168570
|
-
|
|
168571
|
-
|
|
168572
|
-
|
|
168573
|
-
|
|
168574
|
-
|
|
168575
|
-
|
|
168576
|
-
|
|
168577
|
-
|
|
168578
|
-
|
|
168579
|
-
|
|
168580
|
-
|
|
168568
|
+
switch (variable.type) {
|
|
168569
|
+
case "dictionary":
|
|
168570
|
+
return {
|
|
168571
|
+
...variable,
|
|
168572
|
+
type: variable.type,
|
|
168573
|
+
properties: convertApiVariables(variable.properties)
|
|
168574
|
+
};
|
|
168575
|
+
case "array": {
|
|
168576
|
+
return {
|
|
168577
|
+
...variable,
|
|
168578
|
+
type: variable.type,
|
|
168579
|
+
elementType: { type: "number", name: "number" }
|
|
168580
|
+
};
|
|
168581
|
+
}
|
|
168582
|
+
default:
|
|
168583
|
+
return { ...variable, type: variable.type };
|
|
168581
168584
|
}
|
|
168582
|
-
default:
|
|
168583
|
-
return { ...variable, type: variable.type };
|
|
168584
|
-
}
|
|
168585
168585
|
}
|
|
168586
168586
|
async function convertToEditorProfileDefinition(predefinedProfile, locale = "en") {
|
|
168587
|
-
|
|
168588
|
-
|
|
168589
|
-
}
|
|
168590
|
-
const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
|
|
168591
|
-
if (!sdkPredefinedProfile) {
|
|
168592
|
-
return undefined;
|
|
168593
|
-
}
|
|
168594
|
-
const editorProfile = {
|
|
168595
|
-
bundles: [...sdkPredefinedProfile.bundles],
|
|
168596
|
-
variables: [],
|
|
168597
|
-
hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase())
|
|
168598
|
-
};
|
|
168599
|
-
// Merge the SDK variables' definitions/properties with the predefined profile definitions.
|
|
168600
|
-
sdkPredefinedProfile.variables.forEach((sdkVariable) => {
|
|
168601
|
-
// Don't include disabled variables
|
|
168602
|
-
if (predefinedProfile.disabledVariables?.includes(sdkVariable.name)) {
|
|
168603
|
-
return;
|
|
168587
|
+
if (!isPredefinedProfile(predefinedProfile)) {
|
|
168588
|
+
return undefined;
|
|
168604
168589
|
}
|
|
168605
|
-
|
|
168606
|
-
|
|
168607
|
-
|
|
168608
|
-
// despite the type checking from the switch statement.
|
|
168609
|
-
switch (sdkVariable.type) {
|
|
168610
|
-
case "dictionary":
|
|
168611
|
-
// For dictionary, we support properties overrride
|
|
168612
|
-
return editorProfile.variables.push(convertApiVariable({
|
|
168613
|
-
...sdkVariable,
|
|
168614
|
-
type: sdkVariable.type,
|
|
168615
|
-
properties: Array.isArray(definition) ? [...definition] : sdkVariable.properties
|
|
168616
|
-
}));
|
|
168617
|
-
case "feature":
|
|
168618
|
-
if (isFeatureDefinition(definition)) {
|
|
168619
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168620
|
-
}
|
|
168621
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168622
|
-
case "featureSet":
|
|
168623
|
-
if (isFeatureSetDefinition(definition)) {
|
|
168624
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168625
|
-
}
|
|
168626
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168627
|
-
case "featureSetCollection":
|
|
168628
|
-
if (isFeatureSetCollectionDefinition(definition)) {
|
|
168629
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168630
|
-
}
|
|
168631
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168632
|
-
default:
|
|
168633
|
-
return editorProfile.variables.push(convertApiVariable(sdkVariable));
|
|
168590
|
+
const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
|
|
168591
|
+
if (!sdkPredefinedProfile) {
|
|
168592
|
+
return undefined;
|
|
168634
168593
|
}
|
|
168635
|
-
|
|
168636
|
-
|
|
168637
|
-
|
|
168638
|
-
|
|
168639
|
-
|
|
168594
|
+
const editorProfile = {
|
|
168595
|
+
bundles: [...sdkPredefinedProfile.bundles],
|
|
168596
|
+
variables: [],
|
|
168597
|
+
hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase())
|
|
168598
|
+
};
|
|
168599
|
+
// Merge the SDK variables' definitions/properties with the predefined profile definitions.
|
|
168600
|
+
sdkPredefinedProfile.variables.forEach((sdkVariable) => {
|
|
168601
|
+
// Don't include disabled variables
|
|
168602
|
+
if (predefinedProfile.disabledVariables?.includes(sdkVariable.name)) {
|
|
168603
|
+
return;
|
|
168604
|
+
}
|
|
168605
|
+
// Try to get a definition from the predefined profile.
|
|
168606
|
+
const definition = predefinedProfile.definitions[sdkVariable.name];
|
|
168607
|
+
// Note: Something is weird with TS. The sdkVariables are being casted to the wrong type
|
|
168608
|
+
// despite the type checking from the switch statement.
|
|
168609
|
+
switch (sdkVariable.type) {
|
|
168610
|
+
case "dictionary":
|
|
168611
|
+
// For dictionary, we support properties overrride
|
|
168612
|
+
return editorProfile.variables.push(convertApiVariable({
|
|
168613
|
+
...sdkVariable,
|
|
168614
|
+
type: sdkVariable.type,
|
|
168615
|
+
properties: Array.isArray(definition) ? [...definition] : sdkVariable.properties
|
|
168616
|
+
}));
|
|
168617
|
+
case "feature":
|
|
168618
|
+
if (isFeatureDefinition(definition)) {
|
|
168619
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168620
|
+
}
|
|
168621
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168622
|
+
case "featureSet":
|
|
168623
|
+
if (isFeatureSetDefinition(definition)) {
|
|
168624
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168625
|
+
}
|
|
168626
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168627
|
+
case "featureSetCollection":
|
|
168628
|
+
if (isFeatureSetCollectionDefinition(definition)) {
|
|
168629
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168630
|
+
}
|
|
168631
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168632
|
+
default:
|
|
168633
|
+
return editorProfile.variables.push(convertApiVariable(sdkVariable));
|
|
168634
|
+
}
|
|
168635
|
+
});
|
|
168636
|
+
if (isExtendedPredefinedProfileDefinition(predefinedProfile)) {
|
|
168637
|
+
editorProfile.variables.push(...(predefinedProfile.additionalVariables ?? []));
|
|
168638
|
+
}
|
|
168639
|
+
return editorProfile;
|
|
168640
168640
|
}
|
|
168641
168641
|
|
|
168642
168642
|
const arcadeLanguageId = "arcade";
|
|
168643
168643
|
const defaultContext = {
|
|
168644
|
-
|
|
168644
|
+
locale: "en"
|
|
168645
168645
|
};
|
|
168646
168646
|
class ArcadeLanguageServiceDefaults {
|
|
168647
|
-
|
|
168648
|
-
|
|
168649
|
-
|
|
168650
|
-
|
|
168651
|
-
|
|
168652
|
-
|
|
168653
|
-
|
|
168654
|
-
|
|
168655
|
-
}
|
|
168656
|
-
get onDidChange() {
|
|
168657
|
-
return this._onDidChange.event;
|
|
168658
|
-
}
|
|
168659
|
-
get onModelContextDidChange() {
|
|
168660
|
-
return this._onModelContextDidChange.event;
|
|
168661
|
-
}
|
|
168662
|
-
get languageId() {
|
|
168663
|
-
return this._languageId;
|
|
168664
|
-
}
|
|
168665
|
-
get languageOptions() {
|
|
168666
|
-
return this._languageOptions;
|
|
168667
|
-
}
|
|
168668
|
-
_fireModelContextDidChange(key) {
|
|
168669
|
-
if (this._onDidModelContextChangeTimeout !== -1) {
|
|
168670
|
-
return;
|
|
168647
|
+
constructor() {
|
|
168648
|
+
this._languageId = arcadeLanguageId;
|
|
168649
|
+
this._languageOptions = {};
|
|
168650
|
+
this._onDidChange = new Emitter();
|
|
168651
|
+
this._profileMap = new Map();
|
|
168652
|
+
this._apiContextMap = new Map();
|
|
168653
|
+
this._onModelContextDidChange = new Emitter();
|
|
168654
|
+
this._onDidModelContextChangeTimeout = -1;
|
|
168671
168655
|
}
|
|
168672
|
-
|
|
168673
|
-
|
|
168674
|
-
this._onModelContextDidChange.fire(key);
|
|
168675
|
-
}, 0);
|
|
168676
|
-
}
|
|
168677
|
-
_getApiKey(modelId) {
|
|
168678
|
-
if (!Uri.isUri(modelId)) {
|
|
168679
|
-
modelId = Uri.parse(modelId);
|
|
168656
|
+
get onDidChange() {
|
|
168657
|
+
return this._onDidChange.event;
|
|
168680
168658
|
}
|
|
168681
|
-
|
|
168682
|
-
|
|
168683
|
-
/**
|
|
168684
|
-
* Create an EditorProfile for the given model id using the given definition and locale.
|
|
168685
|
-
* The EditorProfile is used by the the Arcade Language service as well by the cosing components.
|
|
168686
|
-
* The definition can be a pre-defined profile or an editor profile definition.
|
|
168687
|
-
* If the locale is not provided then the 'en' locale is used.
|
|
168688
|
-
* @param modelId The model id for which to create the context.
|
|
168689
|
-
* @param definition The definition to use for the model context.
|
|
168690
|
-
* @param locale The locale to use for the model context.
|
|
168691
|
-
* @returns The EditorProfile for the model.
|
|
168692
|
-
*/
|
|
168693
|
-
async setProfileForModel(modelId, definition, apiContext = { locale: "en" }) {
|
|
168694
|
-
// Convert pre-defined profile to a runtime profile
|
|
168695
|
-
if (isPredefinedProfile(definition)) {
|
|
168696
|
-
definition = await convertToEditorProfileDefinition(definition, apiContext.locale);
|
|
168697
|
-
}
|
|
168698
|
-
const intlStrings = await N(apiContext.locale, getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
|
|
168699
|
-
if (!intlStrings) {
|
|
168700
|
-
throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
|
|
168701
|
-
}
|
|
168702
|
-
this.disposeEditorProfileForModel(modelId);
|
|
168703
|
-
const key = this._getApiKey(modelId);
|
|
168704
|
-
const editorProfile = new EditorProfile(definition, intlStrings);
|
|
168705
|
-
this._profileMap.set(key, editorProfile);
|
|
168706
|
-
const apiProfile = await editorProfile.toLSProfile();
|
|
168707
|
-
this.updateApiContextForModel(modelId, {
|
|
168708
|
-
locale: apiContext.locale,
|
|
168709
|
-
profile: apiProfile,
|
|
168710
|
-
snippets: apiContext.snippets
|
|
168711
|
-
});
|
|
168712
|
-
}
|
|
168713
|
-
/**
|
|
168714
|
-
* Dispose the editor profile for the given model id.
|
|
168715
|
-
* It is the responsibility of the caller that created the editor profile to dispose it.
|
|
168716
|
-
* @param modelId The model id for which to dispose the editor profile.
|
|
168717
|
-
*/
|
|
168718
|
-
disposeEditorProfileForModel(modelId) {
|
|
168719
|
-
const key = this._getApiKey(modelId);
|
|
168720
|
-
this._profileMap.delete(key);
|
|
168721
|
-
}
|
|
168722
|
-
/**
|
|
168723
|
-
* Dispose the api context for the given model id.
|
|
168724
|
-
* @param modelId The model id for which to dispose the api context.
|
|
168725
|
-
*/
|
|
168726
|
-
disposeApiContextForModel(modelId) {
|
|
168727
|
-
const key = this._getApiKey(modelId);
|
|
168728
|
-
if (this._apiContextMap.delete(key)) {
|
|
168729
|
-
this._fireModelContextDidChange(key);
|
|
168659
|
+
get onModelContextDidChange() {
|
|
168660
|
+
return this._onModelContextDidChange.event;
|
|
168730
168661
|
}
|
|
168731
|
-
|
|
168732
|
-
|
|
168733
|
-
|
|
168734
|
-
|
|
168735
|
-
|
|
168736
|
-
|
|
168737
|
-
|
|
168738
|
-
|
|
168739
|
-
|
|
168740
|
-
|
|
168741
|
-
|
|
168742
|
-
|
|
168743
|
-
|
|
168744
|
-
|
|
168745
|
-
|
|
168746
|
-
|
|
168747
|
-
|
|
168748
|
-
|
|
168749
|
-
|
|
168750
|
-
|
|
168751
|
-
|
|
168752
|
-
|
|
168753
|
-
|
|
168754
|
-
|
|
168755
|
-
|
|
168756
|
-
|
|
168757
|
-
|
|
168758
|
-
|
|
168759
|
-
|
|
168760
|
-
|
|
168761
|
-
|
|
168762
|
-
|
|
168763
|
-
|
|
168764
|
-
|
|
168765
|
-
|
|
168766
|
-
|
|
168767
|
-
|
|
168768
|
-
|
|
168769
|
-
|
|
168662
|
+
get languageId() {
|
|
168663
|
+
return this._languageId;
|
|
168664
|
+
}
|
|
168665
|
+
get languageOptions() {
|
|
168666
|
+
return this._languageOptions;
|
|
168667
|
+
}
|
|
168668
|
+
_fireModelContextDidChange(key) {
|
|
168669
|
+
if (this._onDidModelContextChangeTimeout !== -1) {
|
|
168670
|
+
return;
|
|
168671
|
+
}
|
|
168672
|
+
this._onDidModelContextChangeTimeout = window.setTimeout(() => {
|
|
168673
|
+
this._onDidModelContextChangeTimeout = -1;
|
|
168674
|
+
this._onModelContextDidChange.fire(key);
|
|
168675
|
+
}, 0);
|
|
168676
|
+
}
|
|
168677
|
+
_getApiKey(modelId) {
|
|
168678
|
+
if (!Uri.isUri(modelId)) {
|
|
168679
|
+
modelId = Uri.parse(modelId);
|
|
168680
|
+
}
|
|
168681
|
+
return modelId.toString();
|
|
168682
|
+
}
|
|
168683
|
+
/**
|
|
168684
|
+
* Create an EditorProfile for the given model id using the given definition and locale.
|
|
168685
|
+
* The EditorProfile is used by the the Arcade Language service as well by the cosing components.
|
|
168686
|
+
* The definition can be a pre-defined profile or an editor profile definition.
|
|
168687
|
+
* If the locale is not provided then the 'en' locale is used.
|
|
168688
|
+
* @param modelId The model id for which to create the context.
|
|
168689
|
+
* @param definition The definition to use for the model context.
|
|
168690
|
+
* @param locale The locale to use for the model context.
|
|
168691
|
+
* @returns The EditorProfile for the model.
|
|
168692
|
+
*/
|
|
168693
|
+
async setProfileForModel(modelId, definition, apiContext = { locale: "en" }) {
|
|
168694
|
+
// Convert pre-defined profile to a runtime profile
|
|
168695
|
+
if (isPredefinedProfile(definition)) {
|
|
168696
|
+
definition = await convertToEditorProfileDefinition(definition, apiContext.locale);
|
|
168697
|
+
}
|
|
168698
|
+
const intlStrings = await N(apiContext.locale, getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
|
|
168699
|
+
if (!intlStrings) {
|
|
168700
|
+
throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
|
|
168701
|
+
}
|
|
168702
|
+
this.disposeEditorProfileForModel(modelId);
|
|
168703
|
+
const key = this._getApiKey(modelId);
|
|
168704
|
+
const editorProfile = new EditorProfile(definition, intlStrings);
|
|
168705
|
+
this._profileMap.set(key, editorProfile);
|
|
168706
|
+
const apiProfile = await editorProfile.toLSProfile();
|
|
168707
|
+
this.updateApiContextForModel(modelId, {
|
|
168708
|
+
locale: apiContext.locale,
|
|
168709
|
+
profile: apiProfile,
|
|
168710
|
+
snippets: apiContext.snippets
|
|
168711
|
+
});
|
|
168712
|
+
}
|
|
168713
|
+
/**
|
|
168714
|
+
* Dispose the editor profile for the given model id.
|
|
168715
|
+
* It is the responsibility of the caller that created the editor profile to dispose it.
|
|
168716
|
+
* @param modelId The model id for which to dispose the editor profile.
|
|
168717
|
+
*/
|
|
168718
|
+
disposeEditorProfileForModel(modelId) {
|
|
168719
|
+
const key = this._getApiKey(modelId);
|
|
168720
|
+
this._profileMap.delete(key);
|
|
168721
|
+
}
|
|
168722
|
+
/**
|
|
168723
|
+
* Dispose the api context for the given model id.
|
|
168724
|
+
* @param modelId The model id for which to dispose the api context.
|
|
168725
|
+
*/
|
|
168726
|
+
disposeApiContextForModel(modelId) {
|
|
168727
|
+
const key = this._getApiKey(modelId);
|
|
168728
|
+
if (this._apiContextMap.delete(key)) {
|
|
168729
|
+
this._fireModelContextDidChange(key);
|
|
168730
|
+
}
|
|
168731
|
+
}
|
|
168732
|
+
/**
|
|
168733
|
+
* Returns the editor profile for the given model id.
|
|
168734
|
+
* @param modelId The model id for which to get the editor profile.
|
|
168735
|
+
* @returns The editor profile for the model.
|
|
168736
|
+
*/
|
|
168737
|
+
getEditorProfileForModel(modelId) {
|
|
168738
|
+
return this._profileMap.get(this._getApiKey(modelId));
|
|
168739
|
+
}
|
|
168740
|
+
/**
|
|
168741
|
+
* Returns the API context for the given model id.
|
|
168742
|
+
* Returns the default context if the model has no context.
|
|
168743
|
+
* @param modelId The model id for which to get the API context.
|
|
168744
|
+
* @returns The API context for the model.
|
|
168745
|
+
*/
|
|
168746
|
+
getApiContextForModel(contextId) {
|
|
168747
|
+
return this._apiContextMap.get(this._getApiKey(contextId)) ?? defaultContext;
|
|
168748
|
+
}
|
|
168749
|
+
/**
|
|
168750
|
+
* Set or update api context for the given model id.
|
|
168751
|
+
* @param modelId The model id for which to set the context.
|
|
168752
|
+
* @param apiContext The api context to set.
|
|
168753
|
+
*/
|
|
168754
|
+
updateApiContextForModel(modelId, apiContext) {
|
|
168755
|
+
const key = this._getApiKey(modelId);
|
|
168756
|
+
const currentApiContext = this._apiContextMap.get(key) ?? {};
|
|
168757
|
+
this._apiContextMap.set(key, { ...currentApiContext, ...apiContext });
|
|
168758
|
+
this._fireModelContextDidChange(key);
|
|
168759
|
+
}
|
|
168760
|
+
/**
|
|
168761
|
+
* Set or update the Arcade language service options.
|
|
168762
|
+
* @param languageOptions The language options to set.
|
|
168763
|
+
*/
|
|
168764
|
+
setLanguageOptions(languageOptions = {}) {
|
|
168765
|
+
// Check if options have actually changed.
|
|
168766
|
+
// Avoid restarting the worker when no updates.
|
|
168767
|
+
// Today we only have the 'assetsPath' as a property
|
|
168768
|
+
if (this._languageOptions.assetsPath === languageOptions.assetsPath) {
|
|
168769
|
+
return;
|
|
168770
|
+
}
|
|
168771
|
+
this._languageOptions = { ...this._languageOptions, ...languageOptions };
|
|
168772
|
+
this._onDidChange.fire(this);
|
|
168770
168773
|
}
|
|
168771
|
-
this._languageOptions = { ...this._languageOptions, ...languageOptions };
|
|
168772
|
-
this._onDidChange.fire(this);
|
|
168773
|
-
}
|
|
168774
168774
|
}
|
|
168775
168775
|
const arcadeDefaults = new ArcadeLanguageServiceDefaults();
|
|
168776
168776
|
const arcade = {
|
|
168777
|
-
|
|
168777
|
+
setProfileForModel: arcadeDefaults.setProfileForModel.bind(arcadeDefaults)
|
|
168778
168778
|
};
|
|
168779
168779
|
|
|
168780
|
-
export { B, Emitter as E, F, H, IStandaloneThemeService as I, KeyCode as K, MarkerSeverity as M, O, P, Range as R, StandaloneServices as S, T, Uri as U, V, X, arcade as a, commonjsGlobal as b, createCommonjsModule as c, arcadeDefaults as d, editor as e, U as f, generateTokensCSSForColorMap as g, filterCollection as h, importRequest as i, importArcade as j,
|
|
168780
|
+
export { $, B, Emitter as E, F, H, IStandaloneThemeService as I, KeyCode as K, MarkerSeverity as M, O, P, Range as R, StandaloneServices as S, T, Uri as U, V, X, arcade as a, commonjsGlobal as b, createCommonjsModule as c, arcadeDefaults as d, editor as e, U as f, generateTokensCSSForColorMap as g, filterCollection as h, importRequest as i, importArcade as j, KeyMod as k, languages as l, monaco_editor_core_star as m, main as n, p, q, supportedFields as s, typescriptDefaults as t, z };
|