@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,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-ac186201.js');
|
|
4
4
|
|
|
5
5
|
function _interopNamespace(e) {
|
|
6
6
|
if (e && e.__esModule) return e;
|
|
@@ -18846,10 +18846,10 @@ function _$(namespace, description, attrs, ...children) {
|
|
|
18846
18846
|
result.append(...children);
|
|
18847
18847
|
return result;
|
|
18848
18848
|
}
|
|
18849
|
-
function $$
|
|
18849
|
+
function $$e(description, attrs, ...children) {
|
|
18850
18850
|
return _$(Namespace.HTML, description, attrs, ...children);
|
|
18851
18851
|
}
|
|
18852
|
-
$$
|
|
18852
|
+
$$e.SVG = function (description, attrs, ...children) {
|
|
18853
18853
|
return _$(Namespace.SVG, description, attrs, ...children);
|
|
18854
18854
|
};
|
|
18855
18855
|
function setVisibility(visible, ...elements) {
|
|
@@ -81856,7 +81856,7 @@ class ContextView extends Disposable {
|
|
|
81856
81856
|
this.toDisposeOnSetContainer = Disposable.None;
|
|
81857
81857
|
this.shadowRoot = null;
|
|
81858
81858
|
this.shadowRootHostElement = null;
|
|
81859
|
-
this.view = $$
|
|
81859
|
+
this.view = $$e('.context-view');
|
|
81860
81860
|
this.useFixedPosition = false;
|
|
81861
81861
|
this.useShadowDOM = false;
|
|
81862
81862
|
hide(this.view);
|
|
@@ -81883,14 +81883,14 @@ class ContextView extends Disposable {
|
|
|
81883
81883
|
this.useFixedPosition = domPosition !== 1 /* ContextViewDOMPosition.ABSOLUTE */;
|
|
81884
81884
|
this.useShadowDOM = domPosition === 3 /* ContextViewDOMPosition.FIXED_SHADOW */;
|
|
81885
81885
|
if (this.useShadowDOM) {
|
|
81886
|
-
this.shadowRootHostElement = $$
|
|
81886
|
+
this.shadowRootHostElement = $$e('.shadow-root-host');
|
|
81887
81887
|
this.container.appendChild(this.shadowRootHostElement);
|
|
81888
81888
|
this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });
|
|
81889
81889
|
const style = document.createElement('style');
|
|
81890
81890
|
style.textContent = SHADOW_ROOT_CSS;
|
|
81891
81891
|
this.shadowRoot.appendChild(style);
|
|
81892
81892
|
this.shadowRoot.appendChild(this.view);
|
|
81893
|
-
this.shadowRoot.appendChild($$
|
|
81893
|
+
this.shadowRoot.appendChild($$e('slot'));
|
|
81894
81894
|
}
|
|
81895
81895
|
else {
|
|
81896
81896
|
this.container.appendChild(this.view);
|
|
@@ -83984,7 +83984,7 @@ function renderLabelWithIcons(text) {
|
|
|
83984
83984
|
return elements;
|
|
83985
83985
|
}
|
|
83986
83986
|
function renderIcon(icon) {
|
|
83987
|
-
const node = $$
|
|
83987
|
+
const node = $$e(`span`);
|
|
83988
83988
|
node.classList.add(...ThemeIcon.asClassNameArray(icon));
|
|
83989
83989
|
return node;
|
|
83990
83990
|
}
|
|
@@ -88012,7 +88012,7 @@ class RowCache {
|
|
|
88012
88012
|
}
|
|
88013
88013
|
}
|
|
88014
88014
|
else {
|
|
88015
|
-
const domNode = $$
|
|
88015
|
+
const domNode = $$e('.monaco-list-row');
|
|
88016
88016
|
const renderer = this.getRenderer(templateId);
|
|
88017
88017
|
const templateData = renderer.renderTemplate(domNode);
|
|
88018
88018
|
result = { domNode, templateId, templateData };
|
|
@@ -88779,7 +88779,7 @@ class ListView {
|
|
|
88779
88779
|
if (typeof label === 'undefined') {
|
|
88780
88780
|
label = String(elements.length);
|
|
88781
88781
|
}
|
|
88782
|
-
const dragImage = $$
|
|
88782
|
+
const dragImage = $$e('.monaco-drag-image');
|
|
88783
88783
|
dragImage.textContent = label;
|
|
88784
88784
|
const getDragImageContainer = (e) => {
|
|
88785
88785
|
while (e && !e.classList.contains('monaco-workbench')) {
|
|
@@ -90608,16 +90608,16 @@ __decorate$1S([
|
|
|
90608
90608
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
90609
90609
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
90610
90610
|
*--------------------------------------------------------------------------------------------*/
|
|
90611
|
-
const $$
|
|
90611
|
+
const $$d = $$e;
|
|
90612
90612
|
const SELECT_OPTION_ENTRY_TEMPLATE_ID = 'selectOption.entry.template';
|
|
90613
90613
|
class SelectListRenderer {
|
|
90614
90614
|
get templateId() { return SELECT_OPTION_ENTRY_TEMPLATE_ID; }
|
|
90615
90615
|
renderTemplate(container) {
|
|
90616
90616
|
const data = Object.create(null);
|
|
90617
90617
|
data.root = container;
|
|
90618
|
-
data.text = append$1(container, $$
|
|
90619
|
-
data.detail = append$1(container, $$
|
|
90620
|
-
data.decoratorRight = append$1(container, $$
|
|
90618
|
+
data.text = append$1(container, $$d('.option-text'));
|
|
90619
|
+
data.detail = append$1(container, $$d('.option-detail'));
|
|
90620
|
+
data.decoratorRight = append$1(container, $$d('.option-decorator-right'));
|
|
90621
90621
|
return data;
|
|
90622
90622
|
}
|
|
90623
90623
|
renderElement(element, index, templateData) {
|
|
@@ -90688,14 +90688,14 @@ class SelectBoxList extends Disposable {
|
|
|
90688
90688
|
constructSelectDropDown(contextViewProvider) {
|
|
90689
90689
|
// SetUp ContextView container to hold select Dropdown
|
|
90690
90690
|
this.contextViewProvider = contextViewProvider;
|
|
90691
|
-
this.selectDropDownContainer = $$
|
|
90691
|
+
this.selectDropDownContainer = $$e('.monaco-select-box-dropdown-container');
|
|
90692
90692
|
// Use custom CSS vars for padding calculation (shared with parent select)
|
|
90693
90693
|
this.selectDropDownContainer.classList.add('monaco-select-box-dropdown-padding');
|
|
90694
90694
|
// Setup container for select option details
|
|
90695
|
-
this.selectionDetailsPane = append$1(this.selectDropDownContainer, $$
|
|
90695
|
+
this.selectionDetailsPane = append$1(this.selectDropDownContainer, $$d('.select-box-details-pane'));
|
|
90696
90696
|
// Create span flex box item/div we can measure and control
|
|
90697
|
-
const widthControlOuterDiv = append$1(this.selectDropDownContainer, $$
|
|
90698
|
-
const widthControlInnerDiv = append$1(widthControlOuterDiv, $$
|
|
90697
|
+
const widthControlOuterDiv = append$1(this.selectDropDownContainer, $$d('.select-box-dropdown-container-width-control'));
|
|
90698
|
+
const widthControlInnerDiv = append$1(widthControlOuterDiv, $$d('.width-control-div'));
|
|
90699
90699
|
this.widthControlElement = document.createElement('span');
|
|
90700
90700
|
this.widthControlElement.className = 'option-text-width-control';
|
|
90701
90701
|
append$1(widthControlInnerDiv, this.widthControlElement);
|
|
@@ -91137,7 +91137,7 @@ class SelectBoxList extends Disposable {
|
|
|
91137
91137
|
return;
|
|
91138
91138
|
}
|
|
91139
91139
|
// SetUp container for list
|
|
91140
|
-
this.selectDropDownListContainer = append$1(parent, $$
|
|
91140
|
+
this.selectDropDownListContainer = append$1(parent, $$d('.select-box-dropdown-list-container'));
|
|
91141
91141
|
this.listRenderer = new SelectListRenderer();
|
|
91142
91142
|
this.selectList = new List('SelectBoxCustom', this.selectDropDownListContainer, this, [this.listRenderer], {
|
|
91143
91143
|
useShadows: false,
|
|
@@ -91813,13 +91813,13 @@ class ActionViewItem extends BaseActionViewItem {
|
|
|
91813
91813
|
render(container) {
|
|
91814
91814
|
super.render(container);
|
|
91815
91815
|
if (this.element) {
|
|
91816
|
-
this.label = append$1(this.element, $$
|
|
91816
|
+
this.label = append$1(this.element, $$e('a.action-label'));
|
|
91817
91817
|
}
|
|
91818
91818
|
if (this.label) {
|
|
91819
91819
|
this.label.setAttribute('role', this.getDefaultAriaRole());
|
|
91820
91820
|
}
|
|
91821
91821
|
if (this.options.label && this.options.keybinding && this.element) {
|
|
91822
|
-
append$1(this.element, $$
|
|
91822
|
+
append$1(this.element, $$e('span.keybinding')).textContent = this.options.keybinding;
|
|
91823
91823
|
}
|
|
91824
91824
|
this.updateClass();
|
|
91825
91825
|
this.updateLabel();
|
|
@@ -91979,8 +91979,8 @@ class BaseDropdown extends ActionRunner {
|
|
|
91979
91979
|
super();
|
|
91980
91980
|
this._onDidChangeVisibility = this._register(new Emitter$1());
|
|
91981
91981
|
this.onDidChangeVisibility = this._onDidChangeVisibility.event;
|
|
91982
|
-
this._element = append$1(container, $$
|
|
91983
|
-
this._label = append$1(this._element, $$
|
|
91982
|
+
this._element = append$1(container, $$e('.monaco-dropdown'));
|
|
91983
|
+
this._label = append$1(this._element, $$e('.dropdown-label'));
|
|
91984
91984
|
let labelRenderer = options.labelRenderer;
|
|
91985
91985
|
if (!labelRenderer) {
|
|
91986
91986
|
labelRenderer = (container) => {
|
|
@@ -92120,7 +92120,7 @@ class DropdownMenuActionViewItem extends BaseActionViewItem {
|
|
|
92120
92120
|
render(container) {
|
|
92121
92121
|
this.actionItem = container;
|
|
92122
92122
|
const labelRenderer = (el) => {
|
|
92123
|
-
this.element = append$1(el, $$
|
|
92123
|
+
this.element = append$1(el, $$e('a.action-label'));
|
|
92124
92124
|
let classNames = [];
|
|
92125
92125
|
if (typeof this.options.classNames === 'string') {
|
|
92126
92126
|
classNames = this.options.classNames.split(/\s+/g).filter(s => !!s);
|
|
@@ -92965,7 +92965,7 @@ let MenuEntryActionViewItem = class MenuEntryActionViewItem extends ActionViewIt
|
|
|
92965
92965
|
const svgUrl = isDark(this._themeService.getColorTheme().type)
|
|
92966
92966
|
? asCSSUrl(icon.dark)
|
|
92967
92967
|
: asCSSUrl(icon.light);
|
|
92968
|
-
const svgIcon = $$
|
|
92968
|
+
const svgIcon = $$e('span');
|
|
92969
92969
|
svgIcon.style.webkitMask = svgIcon.style.mask = `${svgUrl} no-repeat 50% 50%`;
|
|
92970
92970
|
svgIcon.style.background = 'var(--vscode-icon-foreground)';
|
|
92971
92971
|
svgIcon.style.display = 'inline-block';
|
|
@@ -93074,7 +93074,7 @@ let DropdownWithDefaultActionViewItem = class DropdownWithDefaultActionViewItem
|
|
|
93074
93074
|
}
|
|
93075
93075
|
}();
|
|
93076
93076
|
if (this._container) {
|
|
93077
|
-
this._defaultAction.render(prepend$1(this._container, $$
|
|
93077
|
+
this._defaultAction.render(prepend$1(this._container, $$e('.action-container')));
|
|
93078
93078
|
}
|
|
93079
93079
|
}
|
|
93080
93080
|
_getDefaultActionKeybindingLabel(defaultAction) {
|
|
@@ -93097,7 +93097,7 @@ let DropdownWithDefaultActionViewItem = class DropdownWithDefaultActionViewItem
|
|
|
93097
93097
|
this._container = container;
|
|
93098
93098
|
super.render(this._container);
|
|
93099
93099
|
this._container.classList.add('monaco-dropdown-with-default');
|
|
93100
|
-
const primaryContainer = $$
|
|
93100
|
+
const primaryContainer = $$e('.action-container');
|
|
93101
93101
|
this._defaultAction.render(append$1(this._container, primaryContainer));
|
|
93102
93102
|
this._register(addDisposableListener(primaryContainer, EventType$1.KEY_DOWN, (e) => {
|
|
93103
93103
|
const event = new StandardKeyboardEvent(e);
|
|
@@ -93107,7 +93107,7 @@ let DropdownWithDefaultActionViewItem = class DropdownWithDefaultActionViewItem
|
|
|
93107
93107
|
event.stopPropagation();
|
|
93108
93108
|
}
|
|
93109
93109
|
}));
|
|
93110
|
-
const dropdownContainer = $$
|
|
93110
|
+
const dropdownContainer = $$e('.dropdown-action-container');
|
|
93111
93111
|
this._dropdown.render(append$1(this._container, dropdownContainer));
|
|
93112
93112
|
this._register(addDisposableListener(dropdownContainer, EventType$1.KEY_DOWN, (e) => {
|
|
93113
93113
|
var _a;
|
|
@@ -93960,7 +93960,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
|
|
|
93960
93960
|
return;
|
|
93961
93961
|
}
|
|
93962
93962
|
this.container = container;
|
|
93963
|
-
this.item = append$1(this.element, $$
|
|
93963
|
+
this.item = append$1(this.element, $$e('a.action-menu-item'));
|
|
93964
93964
|
if (this._action.id === Separator.ID) {
|
|
93965
93965
|
// A separator is a presentation item
|
|
93966
93966
|
this.item.setAttribute('role', 'presentation');
|
|
@@ -93971,11 +93971,11 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
|
|
|
93971
93971
|
this.item.setAttribute('aria-keyshortcuts', `${this.mnemonic}`);
|
|
93972
93972
|
}
|
|
93973
93973
|
}
|
|
93974
|
-
this.check = append$1(this.item, $$
|
|
93974
|
+
this.check = append$1(this.item, $$e('span.menu-item-check' + ThemeIcon.asCSSSelector(Codicon.menuSelection)));
|
|
93975
93975
|
this.check.setAttribute('role', 'none');
|
|
93976
|
-
this.label = append$1(this.item, $$
|
|
93976
|
+
this.label = append$1(this.item, $$e('span.action-label'));
|
|
93977
93977
|
if (this.options.label && this.options.keybinding) {
|
|
93978
|
-
append$1(this.item, $$
|
|
93978
|
+
append$1(this.item, $$e('span.keybinding')).textContent = this.options.keybinding;
|
|
93979
93979
|
}
|
|
93980
93980
|
// Adds mouse up listener to actually run the action
|
|
93981
93981
|
this.runOnceToEnableMouseUp.schedule();
|
|
@@ -94028,7 +94028,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
|
|
|
94028
94028
|
}
|
|
94029
94029
|
const replaceDoubleEscapes = (str) => str.replace(/&&/g, '&');
|
|
94030
94030
|
if (escMatch) {
|
|
94031
|
-
this.label.append(ltrim(replaceDoubleEscapes(label.substr(0, escMatch.index)), ' '), $$
|
|
94031
|
+
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)), ' '));
|
|
94032
94032
|
}
|
|
94033
94033
|
else {
|
|
94034
94034
|
this.label.innerText = replaceDoubleEscapes(label).trim();
|
|
@@ -94151,7 +94151,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|
|
94151
94151
|
this.item.tabIndex = 0;
|
|
94152
94152
|
this.item.setAttribute('aria-haspopup', 'true');
|
|
94153
94153
|
this.updateAriaExpanded('false');
|
|
94154
|
-
this.submenuIndicator = append$1(this.item, $$
|
|
94154
|
+
this.submenuIndicator = append$1(this.item, $$e('span.submenu-indicator' + ThemeIcon.asCSSSelector(Codicon.menuSubmenu)));
|
|
94155
94155
|
this.submenuIndicator.setAttribute('aria-hidden', 'true');
|
|
94156
94156
|
}
|
|
94157
94157
|
this._register(addDisposableListener(this.element, EventType$1.KEY_UP, e => {
|
|
@@ -94242,7 +94242,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|
|
94242
94242
|
}
|
|
94243
94243
|
if (!this.parentData.submenu) {
|
|
94244
94244
|
this.updateAriaExpanded('true');
|
|
94245
|
-
this.submenuContainer = append$1(this.element, $$
|
|
94245
|
+
this.submenuContainer = append$1(this.element, $$e('div.monaco-submenu'));
|
|
94246
94246
|
this.submenuContainer.classList.add('menubar-menu-items-holder', 'context-view');
|
|
94247
94247
|
// Set the top value of the menu container before construction
|
|
94248
94248
|
// This allows the menu constructor to calculate the proper max height
|
|
@@ -94779,7 +94779,7 @@ class ContextMenuHandler {
|
|
|
94779
94779
|
}
|
|
94780
94780
|
// Render invisible div to block mouse interaction in the rest of the UI
|
|
94781
94781
|
if (this.options.blockMouse) {
|
|
94782
|
-
this.block = container.appendChild($$
|
|
94782
|
+
this.block = container.appendChild($$e('.context-view-block'));
|
|
94783
94783
|
this.block.style.position = 'fixed';
|
|
94784
94784
|
this.block.style.cursor = 'initial';
|
|
94785
94785
|
this.block.style.left = '0';
|
|
@@ -96203,7 +96203,7 @@ class Sash extends Disposable {
|
|
|
96203
96203
|
const onChange = (state) => {
|
|
96204
96204
|
this.orthogonalStartDragHandleDisposables.clear();
|
|
96205
96205
|
if (state !== 0 /* SashState.Disabled */) {
|
|
96206
|
-
this._orthogonalStartDragHandle = append$1(this.el, $$
|
|
96206
|
+
this._orthogonalStartDragHandle = append$1(this.el, $$e('.orthogonal-drag-handle.start'));
|
|
96207
96207
|
this.orthogonalStartDragHandleDisposables.add(toDisposable(() => this._orthogonalStartDragHandle.remove()));
|
|
96208
96208
|
this.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle, 'mouseenter')).event(() => Sash.onMouseEnter(sash), undefined, this.orthogonalStartDragHandleDisposables);
|
|
96209
96209
|
this.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle, 'mouseleave')).event(() => Sash.onMouseLeave(sash), undefined, this.orthogonalStartDragHandleDisposables);
|
|
@@ -96232,7 +96232,7 @@ class Sash extends Disposable {
|
|
|
96232
96232
|
const onChange = (state) => {
|
|
96233
96233
|
this.orthogonalEndDragHandleDisposables.clear();
|
|
96234
96234
|
if (state !== 0 /* SashState.Disabled */) {
|
|
96235
|
-
this._orthogonalEndDragHandle = append$1(this.el, $$
|
|
96235
|
+
this._orthogonalEndDragHandle = append$1(this.el, $$e('.orthogonal-drag-handle.end'));
|
|
96236
96236
|
this.orthogonalEndDragHandleDisposables.add(toDisposable(() => this._orthogonalEndDragHandle.remove()));
|
|
96237
96237
|
this.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle, 'mouseenter')).event(() => Sash.onMouseEnter(sash), undefined, this.orthogonalEndDragHandleDisposables);
|
|
96238
96238
|
this.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle, 'mouseleave')).event(() => Sash.onMouseLeave(sash), undefined, this.orthogonalEndDragHandleDisposables);
|
|
@@ -96281,7 +96281,7 @@ class Sash extends Disposable {
|
|
|
96281
96281
|
* Useful in 2x2 grids. Not meant for widespread usage.
|
|
96282
96282
|
*/
|
|
96283
96283
|
this.linkedSash = undefined;
|
|
96284
|
-
this.el = append$1(container, $$
|
|
96284
|
+
this.el = append$1(container, $$e('.monaco-sash'));
|
|
96285
96285
|
if (options.orthogonalEdge) {
|
|
96286
96286
|
this.el.classList.add(`orthogonal-edge-${options.orthogonalEdge}`);
|
|
96287
96287
|
}
|
|
@@ -96721,8 +96721,8 @@ class SplitView extends Disposable {
|
|
|
96721
96721
|
this.el.classList.add('monaco-split-view2');
|
|
96722
96722
|
this.el.classList.add(this.orientation === 0 /* Orientation.VERTICAL */ ? 'vertical' : 'horizontal');
|
|
96723
96723
|
container.appendChild(this.el);
|
|
96724
|
-
this.sashContainer = append$1(this.el, $$
|
|
96725
|
-
this.viewContainer = $$
|
|
96724
|
+
this.sashContainer = append$1(this.el, $$e('.sash-container'));
|
|
96725
|
+
this.viewContainer = $$e('.split-view-container');
|
|
96726
96726
|
this.scrollable = this._register(new Scrollable({
|
|
96727
96727
|
forceIntegerValues: true,
|
|
96728
96728
|
smoothScrollDuration: 125,
|
|
@@ -97002,7 +97002,7 @@ class SplitView extends Disposable {
|
|
|
97002
97002
|
}
|
|
97003
97003
|
this.state = State.Busy;
|
|
97004
97004
|
// Add view
|
|
97005
|
-
const container = $$
|
|
97005
|
+
const container = $$e('.split-view-view');
|
|
97006
97006
|
if (index === this.viewItems.length) {
|
|
97007
97007
|
this.viewContainer.appendChild(container);
|
|
97008
97008
|
}
|
|
@@ -97325,12 +97325,12 @@ class TableListRenderer {
|
|
|
97325
97325
|
}
|
|
97326
97326
|
}
|
|
97327
97327
|
renderTemplate(container) {
|
|
97328
|
-
const rowContainer = append$1(container, $$
|
|
97328
|
+
const rowContainer = append$1(container, $$e('.monaco-table-tr'));
|
|
97329
97329
|
const cellContainers = [];
|
|
97330
97330
|
const cellTemplateData = [];
|
|
97331
97331
|
for (let i = 0; i < this.columns.length; i++) {
|
|
97332
97332
|
const renderer = this.renderers[i];
|
|
97333
|
-
const cellContainer = append$1(rowContainer, $$
|
|
97333
|
+
const cellContainer = append$1(rowContainer, $$e('.monaco-table-td', { 'data-col-index': i }));
|
|
97334
97334
|
cellContainer.style.width = `${this.getColumnSize(i)}px`;
|
|
97335
97335
|
cellContainers.push(cellContainer);
|
|
97336
97336
|
cellTemplateData.push(renderer.renderTemplate(cellContainer));
|
|
@@ -97387,7 +97387,7 @@ class ColumnHeader {
|
|
|
97387
97387
|
this.index = index;
|
|
97388
97388
|
this._onDidLayout = new Emitter$1();
|
|
97389
97389
|
this.onDidLayout = this._onDidLayout.event;
|
|
97390
|
-
this.element = $$
|
|
97390
|
+
this.element = $$e('.monaco-table-th', { 'data-col-index': index, title: column.tooltip }, column.label);
|
|
97391
97391
|
}
|
|
97392
97392
|
layout(size) {
|
|
97393
97393
|
this._onDidLayout.fire([this.index, size]);
|
|
@@ -97411,7 +97411,7 @@ class Table {
|
|
|
97411
97411
|
this.disposables = new DisposableStore();
|
|
97412
97412
|
this.cachedWidth = 0;
|
|
97413
97413
|
this.cachedHeight = 0;
|
|
97414
|
-
this.domNode = append$1(container, $$
|
|
97414
|
+
this.domNode = append$1(container, $$e(`.monaco-table.${this.domId}`));
|
|
97415
97415
|
const headers = columns.map((c, i) => new ColumnHeader(c, i));
|
|
97416
97416
|
const descriptor = {
|
|
97417
97417
|
size: headers.reduce((a, b) => a + b.column.weight, 0),
|
|
@@ -97715,7 +97715,7 @@ class HistoryNavigator {
|
|
|
97715
97715
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
97716
97716
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
97717
97717
|
*--------------------------------------------------------------------------------------------*/
|
|
97718
|
-
const $$
|
|
97718
|
+
const $$c = $$e;
|
|
97719
97719
|
class InputBox$1 extends Widget$1 {
|
|
97720
97720
|
constructor(container, contextViewProvider, options) {
|
|
97721
97721
|
var _a;
|
|
@@ -97735,10 +97735,10 @@ class InputBox$1 extends Widget$1 {
|
|
|
97735
97735
|
if (this.options.validationOptions) {
|
|
97736
97736
|
this.validation = this.options.validationOptions.validation;
|
|
97737
97737
|
}
|
|
97738
|
-
this.element = append$1(container, $$
|
|
97738
|
+
this.element = append$1(container, $$c('.monaco-inputbox.idle'));
|
|
97739
97739
|
const tagName = this.options.flexibleHeight ? 'textarea' : 'input';
|
|
97740
|
-
const wrapper = append$1(this.element, $$
|
|
97741
|
-
this.input = append$1(wrapper, $$
|
|
97740
|
+
const wrapper = append$1(this.element, $$c('.ibwrapper'));
|
|
97741
|
+
this.input = append$1(wrapper, $$c(tagName + '.input.empty'));
|
|
97742
97742
|
this.input.setAttribute('autocorrect', 'off');
|
|
97743
97743
|
this.input.setAttribute('autocapitalize', 'off');
|
|
97744
97744
|
this.input.setAttribute('spellcheck', 'false');
|
|
@@ -97746,7 +97746,7 @@ class InputBox$1 extends Widget$1 {
|
|
|
97746
97746
|
this.onblur(this.input, () => this.element.classList.remove('synthetic-focus'));
|
|
97747
97747
|
if (this.options.flexibleHeight) {
|
|
97748
97748
|
this.maxHeight = typeof this.options.flexibleMaxHeight === 'number' ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY;
|
|
97749
|
-
this.mirror = append$1(wrapper, $$
|
|
97749
|
+
this.mirror = append$1(wrapper, $$c('div.mirror'));
|
|
97750
97750
|
this.mirror.innerText = '\u00a0';
|
|
97751
97751
|
this.scrollableElement = new ScrollableElement(this.element, { vertical: 1 /* ScrollbarVisibility.Auto */ });
|
|
97752
97752
|
if (this.options.flexibleWidth) {
|
|
@@ -97943,7 +97943,7 @@ class InputBox$1 extends Widget$1 {
|
|
|
97943
97943
|
if (!this.message) {
|
|
97944
97944
|
return null;
|
|
97945
97945
|
}
|
|
97946
|
-
div = append$1(container, $$
|
|
97946
|
+
div = append$1(container, $$c('.monaco-inputbox-container'));
|
|
97947
97947
|
layout();
|
|
97948
97948
|
const renderOptions = {
|
|
97949
97949
|
inline: true,
|
|
@@ -99251,10 +99251,10 @@ class TreeRenderer {
|
|
|
99251
99251
|
}
|
|
99252
99252
|
}
|
|
99253
99253
|
renderTemplate(container) {
|
|
99254
|
-
const el = append$1(container, $$
|
|
99255
|
-
const indent = append$1(el, $$
|
|
99256
|
-
const twistie = append$1(el, $$
|
|
99257
|
-
const contents = append$1(el, $$
|
|
99254
|
+
const el = append$1(container, $$e('.monaco-tl-row'));
|
|
99255
|
+
const indent = append$1(el, $$e('.monaco-tl-indent'));
|
|
99256
|
+
const twistie = append$1(el, $$e('.monaco-tl-twistie'));
|
|
99257
|
+
const contents = append$1(el, $$e('.monaco-tl-contents'));
|
|
99258
99258
|
const templateData = this.renderer.renderTemplate(contents);
|
|
99259
99259
|
return { container, indent, twistie, indentGuidesDisposable: Disposable.None, templateData };
|
|
99260
99260
|
}
|
|
@@ -99333,7 +99333,7 @@ class TreeRenderer {
|
|
|
99333
99333
|
break;
|
|
99334
99334
|
}
|
|
99335
99335
|
const parent = model.getNode(parentRef);
|
|
99336
|
-
const guide = $$
|
|
99336
|
+
const guide = $$e('.indent-guide', { style: `width: ${this.indent}px` });
|
|
99337
99337
|
if (this.activeIndentNodes.has(parent)) {
|
|
99338
99338
|
guide.classList.add('active');
|
|
99339
99339
|
}
|
|
@@ -103008,7 +103008,7 @@ class CountBadge {
|
|
|
103008
103008
|
this.options = options;
|
|
103009
103009
|
this.styles = styles;
|
|
103010
103010
|
this.count = 0;
|
|
103011
|
-
this.element = append$1(container, $$
|
|
103011
|
+
this.element = append$1(container, $$e('.monaco-count-badge'));
|
|
103012
103012
|
this.countFormat = this.options.countFormat || '{0}';
|
|
103013
103013
|
this.titleFormat = this.options.titleFormat || '';
|
|
103014
103014
|
this.setCount(this.options.count || 0);
|
|
@@ -103134,7 +103134,7 @@ ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD = 10000;
|
|
|
103134
103134
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
103135
103135
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
103136
103136
|
*--------------------------------------------------------------------------------------------*/
|
|
103137
|
-
const $$
|
|
103137
|
+
const $$b = $$e;
|
|
103138
103138
|
class QuickInputBox extends Disposable {
|
|
103139
103139
|
constructor(parent, inputBoxStyles, toggleStyles) {
|
|
103140
103140
|
super();
|
|
@@ -103152,7 +103152,7 @@ class QuickInputBox extends Disposable {
|
|
|
103152
103152
|
this.onDidChange = (handler) => {
|
|
103153
103153
|
return this.findInput.onDidChange(handler);
|
|
103154
103154
|
};
|
|
103155
|
-
this.container = append$1(this.parent, $$
|
|
103155
|
+
this.container = append$1(this.parent, $$b('.quick-input-box'));
|
|
103156
103156
|
this.findInput = this._register(new FindInput(this.container, undefined, { label: '', inputBoxStyles, toggleStyles }));
|
|
103157
103157
|
const input = this.findInput.inputBox.inputElement;
|
|
103158
103158
|
input.role = 'combobox';
|
|
@@ -103241,7 +103241,7 @@ class HighlightedLabel {
|
|
|
103241
103241
|
this.highlights = [];
|
|
103242
103242
|
this.didEverRender = false;
|
|
103243
103243
|
this.supportIcons = (_a = options === null || options === void 0 ? void 0 : options.supportIcons) !== null && _a !== void 0 ? _a : false;
|
|
103244
|
-
this.domNode = append$1(container, $$
|
|
103244
|
+
this.domNode = append$1(container, $$e('span.monaco-highlighted-label'));
|
|
103245
103245
|
}
|
|
103246
103246
|
/**
|
|
103247
103247
|
* The label's DOM node.
|
|
@@ -103292,7 +103292,7 @@ class HighlightedLabel {
|
|
|
103292
103292
|
pos = highlight.start;
|
|
103293
103293
|
}
|
|
103294
103294
|
const substring = this.text.substring(pos, highlight.end);
|
|
103295
|
-
const element = $$
|
|
103295
|
+
const element = $$e('span.highlight', undefined, ...this.supportIcons ? renderLabelWithIcons(substring) : [substring]);
|
|
103296
103296
|
if (highlight.extraClasses) {
|
|
103297
103297
|
element.classList.add(...highlight.extraClasses);
|
|
103298
103298
|
}
|
|
@@ -103381,9 +103381,9 @@ class IconLabel extends Disposable {
|
|
|
103381
103381
|
super();
|
|
103382
103382
|
this.customHovers = new Map();
|
|
103383
103383
|
this.creationOptions = options;
|
|
103384
|
-
this.domNode = this._register(new FastLabelNode(append$1(container, $$
|
|
103385
|
-
this.labelContainer = append$1(this.domNode.element, $$
|
|
103386
|
-
const nameContainer = append$1(this.labelContainer, $$
|
|
103384
|
+
this.domNode = this._register(new FastLabelNode(append$1(container, $$e('.monaco-icon-label'))));
|
|
103385
|
+
this.labelContainer = append$1(this.domNode.element, $$e('.monaco-icon-label-container'));
|
|
103386
|
+
const nameContainer = append$1(this.labelContainer, $$e('span.monaco-icon-name-container'));
|
|
103387
103387
|
if ((options === null || options === void 0 ? void 0 : options.supportHighlights) || (options === null || options === void 0 ? void 0 : options.supportIcons)) {
|
|
103388
103388
|
this.nameNode = new LabelWithHighlights(nameContainer, !!options.supportIcons);
|
|
103389
103389
|
}
|
|
@@ -103464,12 +103464,12 @@ class IconLabel extends Disposable {
|
|
|
103464
103464
|
getOrCreateDescriptionNode() {
|
|
103465
103465
|
var _a;
|
|
103466
103466
|
if (!this.descriptionNode) {
|
|
103467
|
-
const descriptionContainer = this._register(new FastLabelNode(append$1(this.labelContainer, $$
|
|
103467
|
+
const descriptionContainer = this._register(new FastLabelNode(append$1(this.labelContainer, $$e('span.monaco-icon-description-container'))));
|
|
103468
103468
|
if ((_a = this.creationOptions) === null || _a === void 0 ? void 0 : _a.supportDescriptionHighlights) {
|
|
103469
|
-
this.descriptionNode = new HighlightedLabel(append$1(descriptionContainer.element, $$
|
|
103469
|
+
this.descriptionNode = new HighlightedLabel(append$1(descriptionContainer.element, $$e('span.label-description')), { supportIcons: !!this.creationOptions.supportIcons });
|
|
103470
103470
|
}
|
|
103471
103471
|
else {
|
|
103472
|
-
this.descriptionNode = this._register(new FastLabelNode(append$1(descriptionContainer.element, $$
|
|
103472
|
+
this.descriptionNode = this._register(new FastLabelNode(append$1(descriptionContainer.element, $$e('span.label-description'))));
|
|
103473
103473
|
}
|
|
103474
103474
|
}
|
|
103475
103475
|
return this.descriptionNode;
|
|
@@ -103491,7 +103491,7 @@ class Label {
|
|
|
103491
103491
|
if (!this.singleLabel) {
|
|
103492
103492
|
this.container.innerText = '';
|
|
103493
103493
|
this.container.classList.remove('multiple');
|
|
103494
|
-
this.singleLabel = append$1(this.container, $$
|
|
103494
|
+
this.singleLabel = append$1(this.container, $$e('a.label-name', { id: options === null || options === void 0 ? void 0 : options.domId }));
|
|
103495
103495
|
}
|
|
103496
103496
|
this.singleLabel.textContent = label;
|
|
103497
103497
|
}
|
|
@@ -103502,9 +103502,9 @@ class Label {
|
|
|
103502
103502
|
for (let i = 0; i < label.length; i++) {
|
|
103503
103503
|
const l = label[i];
|
|
103504
103504
|
const id = (options === null || options === void 0 ? void 0 : options.domId) && `${options === null || options === void 0 ? void 0 : options.domId}_${i}`;
|
|
103505
|
-
append$1(this.container, $$
|
|
103505
|
+
append$1(this.container, $$e('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));
|
|
103506
103506
|
if (i < label.length - 1) {
|
|
103507
|
-
append$1(this.container, $$
|
|
103507
|
+
append$1(this.container, $$e('span.label-separator', undefined, (options === null || options === void 0 ? void 0 : options.separator) || '/'));
|
|
103508
103508
|
}
|
|
103509
103509
|
}
|
|
103510
103510
|
}
|
|
@@ -103542,7 +103542,7 @@ class LabelWithHighlights {
|
|
|
103542
103542
|
if (!this.singleLabel) {
|
|
103543
103543
|
this.container.innerText = '';
|
|
103544
103544
|
this.container.classList.remove('multiple');
|
|
103545
|
-
this.singleLabel = new HighlightedLabel(append$1(this.container, $$
|
|
103545
|
+
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 });
|
|
103546
103546
|
}
|
|
103547
103547
|
this.singleLabel.set(label, options === null || options === void 0 ? void 0 : options.matches, undefined, options === null || options === void 0 ? void 0 : options.labelEscapeNewLines);
|
|
103548
103548
|
}
|
|
@@ -103556,11 +103556,11 @@ class LabelWithHighlights {
|
|
|
103556
103556
|
const l = label[i];
|
|
103557
103557
|
const m = matches ? matches[i] : undefined;
|
|
103558
103558
|
const id = (options === null || options === void 0 ? void 0 : options.domId) && `${options === null || options === void 0 ? void 0 : options.domId}_${i}`;
|
|
103559
|
-
const name = $$
|
|
103559
|
+
const name = $$e('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });
|
|
103560
103560
|
const highlightedLabel = new HighlightedLabel(append$1(this.container, name), { supportIcons: this.supportIcons });
|
|
103561
103561
|
highlightedLabel.set(l, m, undefined, options === null || options === void 0 ? void 0 : options.labelEscapeNewLines);
|
|
103562
103562
|
if (i < label.length - 1) {
|
|
103563
|
-
append$1(name, $$
|
|
103563
|
+
append$1(name, $$e('span.label-separator', undefined, separator));
|
|
103564
103564
|
}
|
|
103565
103565
|
}
|
|
103566
103566
|
}
|
|
@@ -103571,7 +103571,7 @@ class LabelWithHighlights {
|
|
|
103571
103571
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
103572
103572
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
103573
103573
|
*--------------------------------------------------------------------------------------------*/
|
|
103574
|
-
const $$
|
|
103574
|
+
const $$a = $$e;
|
|
103575
103575
|
const unthemedKeybindingLabelOptions = {
|
|
103576
103576
|
keybindingLabelBackground: undefined,
|
|
103577
103577
|
keybindingLabelForeground: undefined,
|
|
@@ -103585,7 +103585,7 @@ class KeybindingLabel {
|
|
|
103585
103585
|
this.keyElements = new Set();
|
|
103586
103586
|
this.options = options || Object.create(null);
|
|
103587
103587
|
const labelForeground = this.options.keybindingLabelForeground;
|
|
103588
|
-
this.domNode = append$1(container, $$
|
|
103588
|
+
this.domNode = append$1(container, $$a('.monaco-keybinding'));
|
|
103589
103589
|
if (labelForeground) {
|
|
103590
103590
|
this.domNode.style.color = labelForeground;
|
|
103591
103591
|
}
|
|
@@ -103612,7 +103612,7 @@ class KeybindingLabel {
|
|
|
103612
103612
|
this.renderChord(this.domNode, chords[0], this.matches ? this.matches.firstPart : null);
|
|
103613
103613
|
}
|
|
103614
103614
|
for (let i = 1; i < chords.length; i++) {
|
|
103615
|
-
append$1(this.domNode, $$
|
|
103615
|
+
append$1(this.domNode, $$a('span.monaco-keybinding-key-chord-separator', undefined, ' '));
|
|
103616
103616
|
this.renderChord(this.domNode, chords[i], this.matches ? this.matches.chordPart : null);
|
|
103617
103617
|
}
|
|
103618
103618
|
const title = ((_a = this.options.disableTitle) !== null && _a !== void 0 ? _a : false) ? undefined : this.keybinding.getAriaLabel() || undefined;
|
|
@@ -103654,14 +103654,14 @@ class KeybindingLabel {
|
|
|
103654
103654
|
renderKey(parent, label, highlight, separator) {
|
|
103655
103655
|
append$1(parent, this.createKeyElement(label, highlight ? '.highlight' : ''));
|
|
103656
103656
|
if (separator) {
|
|
103657
|
-
append$1(parent, $$
|
|
103657
|
+
append$1(parent, $$a('span.monaco-keybinding-key-separator', undefined, separator));
|
|
103658
103658
|
}
|
|
103659
103659
|
}
|
|
103660
103660
|
renderUnbound(parent) {
|
|
103661
103661
|
append$1(parent, this.createKeyElement(localize('unbound', "Unbound")));
|
|
103662
103662
|
}
|
|
103663
103663
|
createKeyElement(label, extraClass = '') {
|
|
103664
|
-
const keyElement = $$
|
|
103664
|
+
const keyElement = $$a('span.monaco-keybinding-key' + extraClass, undefined, label);
|
|
103665
103665
|
this.keyElements.add(keyElement);
|
|
103666
103666
|
if (this.options.keybindingLabelBackground) {
|
|
103667
103667
|
keyElement.style.backgroundColor = this.options.keybindingLabelBackground;
|
|
@@ -103838,7 +103838,7 @@ function renderQuickInputDescription(description, container, actionHandler) {
|
|
|
103838
103838
|
else if (!title) {
|
|
103839
103839
|
title = node.href;
|
|
103840
103840
|
}
|
|
103841
|
-
const anchor = $$
|
|
103841
|
+
const anchor = $$e('a', { href: node.href, title, tabIndex: tabIndex++ }, node.label);
|
|
103842
103842
|
anchor.style.textDecoration = 'underline';
|
|
103843
103843
|
const handleOpen = (e) => {
|
|
103844
103844
|
if (isEventLike(e)) {
|
|
@@ -103879,7 +103879,7 @@ var __awaiter$1i = (undefined && undefined.__awaiter) || function (thisArg, _arg
|
|
|
103879
103879
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
103880
103880
|
});
|
|
103881
103881
|
};
|
|
103882
|
-
const $$
|
|
103882
|
+
const $$9 = $$e;
|
|
103883
103883
|
class ListElement {
|
|
103884
103884
|
constructor(mainItem, previous, index, hasCheckbox, fireButtonTriggered, fireSeparatorButtonTriggered, onCheckedEmitter) {
|
|
103885
103885
|
var _a, _b, _c;
|
|
@@ -103993,36 +103993,36 @@ class ListElementRenderer {
|
|
|
103993
103993
|
const data = Object.create(null);
|
|
103994
103994
|
data.toDisposeElement = [];
|
|
103995
103995
|
data.toDisposeTemplate = [];
|
|
103996
|
-
data.entry = append$1(container, $$
|
|
103996
|
+
data.entry = append$1(container, $$9('.quick-input-list-entry'));
|
|
103997
103997
|
// Checkbox
|
|
103998
|
-
const label = append$1(data.entry, $$
|
|
103998
|
+
const label = append$1(data.entry, $$9('label.quick-input-list-label'));
|
|
103999
103999
|
data.toDisposeTemplate.push(addStandardDisposableListener(label, EventType$1.CLICK, e => {
|
|
104000
104000
|
if (!data.checkbox.offsetParent) { // If checkbox not visible:
|
|
104001
104001
|
e.preventDefault(); // Prevent toggle of checkbox when it is immediately shown afterwards. #91740
|
|
104002
104002
|
}
|
|
104003
104003
|
}));
|
|
104004
|
-
data.checkbox = append$1(label, $$
|
|
104004
|
+
data.checkbox = append$1(label, $$9('input.quick-input-list-checkbox'));
|
|
104005
104005
|
data.checkbox.type = 'checkbox';
|
|
104006
104006
|
data.toDisposeTemplate.push(addStandardDisposableListener(data.checkbox, EventType$1.CHANGE, e => {
|
|
104007
104007
|
data.element.checked = data.checkbox.checked;
|
|
104008
104008
|
}));
|
|
104009
104009
|
// Rows
|
|
104010
|
-
const rows = append$1(label, $$
|
|
104011
|
-
const row1 = append$1(rows, $$
|
|
104012
|
-
const row2 = append$1(rows, $$
|
|
104010
|
+
const rows = append$1(label, $$9('.quick-input-list-rows'));
|
|
104011
|
+
const row1 = append$1(rows, $$9('.quick-input-list-row'));
|
|
104012
|
+
const row2 = append$1(rows, $$9('.quick-input-list-row'));
|
|
104013
104013
|
// Label
|
|
104014
104014
|
data.label = new IconLabel(row1, { supportHighlights: true, supportDescriptionHighlights: true, supportIcons: true });
|
|
104015
104015
|
data.toDisposeTemplate.push(data.label);
|
|
104016
|
-
data.icon = prepend$1(data.label.element, $$
|
|
104016
|
+
data.icon = prepend$1(data.label.element, $$9('.quick-input-list-icon'));
|
|
104017
104017
|
// Keybinding
|
|
104018
|
-
const keybindingContainer = append$1(row1, $$
|
|
104018
|
+
const keybindingContainer = append$1(row1, $$9('.quick-input-list-entry-keybinding'));
|
|
104019
104019
|
data.keybinding = new KeybindingLabel(keybindingContainer, OS);
|
|
104020
104020
|
// Detail
|
|
104021
|
-
const detailContainer = append$1(row2, $$
|
|
104021
|
+
const detailContainer = append$1(row2, $$9('.quick-input-list-label-meta'));
|
|
104022
104022
|
data.detail = new IconLabel(detailContainer, { supportHighlights: true, supportIcons: true });
|
|
104023
104023
|
data.toDisposeTemplate.push(data.detail);
|
|
104024
104024
|
// Separator
|
|
104025
|
-
data.separator = append$1(data.entry, $$
|
|
104025
|
+
data.separator = append$1(data.entry, $$9('.quick-input-list-separator'));
|
|
104026
104026
|
// Actions
|
|
104027
104027
|
data.actionBar = new ActionBar(data.entry);
|
|
104028
104028
|
data.actionBar.domNode.classList.add('quick-input-list-entry-action-bar');
|
|
@@ -104185,7 +104185,7 @@ class QuickInputList {
|
|
|
104185
104185
|
this.elementDisposables = [];
|
|
104186
104186
|
this.disposables = [];
|
|
104187
104187
|
this.id = id;
|
|
104188
|
-
this.container = append$1(this.parent, $$
|
|
104188
|
+
this.container = append$1(this.parent, $$9('.quick-input-list'));
|
|
104189
104189
|
const delegate = new ListElementDelegate();
|
|
104190
104190
|
const accessibilityProvider = new QuickInputAccessibilityProvider();
|
|
104191
104191
|
this.list = options.createList('QuickInput', this.container, delegate, [new ListElementRenderer(themeService)], {
|
|
@@ -105696,7 +105696,7 @@ class InputBox extends QuickInput {
|
|
|
105696
105696
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
105697
105697
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
105698
105698
|
*--------------------------------------------------------------------------------------------*/
|
|
105699
|
-
const $$
|
|
105699
|
+
const $$8 = $$e;
|
|
105700
105700
|
class QuickInputController extends Disposable {
|
|
105701
105701
|
constructor(options, themeService) {
|
|
105702
105702
|
super();
|
|
@@ -105730,19 +105730,19 @@ class QuickInputController extends Disposable {
|
|
|
105730
105730
|
if (this.ui) {
|
|
105731
105731
|
return this.ui;
|
|
105732
105732
|
}
|
|
105733
|
-
const container = append$1(this.parentElement, $$
|
|
105733
|
+
const container = append$1(this.parentElement, $$8('.quick-input-widget.show-file-icons'));
|
|
105734
105734
|
container.tabIndex = -1;
|
|
105735
105735
|
container.style.display = 'none';
|
|
105736
105736
|
const styleSheet = createStyleSheet(container);
|
|
105737
|
-
const titleBar = append$1(container, $$
|
|
105737
|
+
const titleBar = append$1(container, $$8('.quick-input-titlebar'));
|
|
105738
105738
|
const actionBarOption = this.options.hoverDelegate ? { hoverDelegate: this.options.hoverDelegate } : undefined;
|
|
105739
105739
|
const leftActionBar = this._register(new ActionBar(titleBar, actionBarOption));
|
|
105740
105740
|
leftActionBar.domNode.classList.add('quick-input-left-action-bar');
|
|
105741
|
-
const title = append$1(titleBar, $$
|
|
105741
|
+
const title = append$1(titleBar, $$8('.quick-input-title'));
|
|
105742
105742
|
const rightActionBar = this._register(new ActionBar(titleBar, actionBarOption));
|
|
105743
105743
|
rightActionBar.domNode.classList.add('quick-input-right-action-bar');
|
|
105744
|
-
const headerContainer = append$1(container, $$
|
|
105745
|
-
const checkAll = append$1(headerContainer, $$
|
|
105744
|
+
const headerContainer = append$1(container, $$8('.quick-input-header'));
|
|
105745
|
+
const checkAll = append$1(headerContainer, $$8('input.quick-input-check-all'));
|
|
105746
105746
|
checkAll.type = 'checkbox';
|
|
105747
105747
|
checkAll.setAttribute('aria-label', localize('quickInput.checkAll', "Toggle all checkboxes"));
|
|
105748
105748
|
this._register(addStandardDisposableListener(checkAll, EventType$1.CHANGE, e => {
|
|
@@ -105754,36 +105754,36 @@ class QuickInputController extends Disposable {
|
|
|
105754
105754
|
inputBox.setFocus();
|
|
105755
105755
|
}
|
|
105756
105756
|
}));
|
|
105757
|
-
const description2 = append$1(headerContainer, $$
|
|
105758
|
-
const inputContainer = append$1(headerContainer, $$
|
|
105759
|
-
const filterContainer = append$1(inputContainer, $$
|
|
105757
|
+
const description2 = append$1(headerContainer, $$8('.quick-input-description'));
|
|
105758
|
+
const inputContainer = append$1(headerContainer, $$8('.quick-input-and-message'));
|
|
105759
|
+
const filterContainer = append$1(inputContainer, $$8('.quick-input-filter'));
|
|
105760
105760
|
const inputBox = this._register(new QuickInputBox(filterContainer, this.styles.inputBox, this.styles.toggle));
|
|
105761
105761
|
inputBox.setAttribute('aria-describedby', `${this.idPrefix}message`);
|
|
105762
|
-
const visibleCountContainer = append$1(filterContainer, $$
|
|
105762
|
+
const visibleCountContainer = append$1(filterContainer, $$8('.quick-input-visible-count'));
|
|
105763
105763
|
visibleCountContainer.setAttribute('aria-live', 'polite');
|
|
105764
105764
|
visibleCountContainer.setAttribute('aria-atomic', 'true');
|
|
105765
105765
|
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);
|
|
105766
|
-
const countContainer = append$1(filterContainer, $$
|
|
105766
|
+
const countContainer = append$1(filterContainer, $$8('.quick-input-count'));
|
|
105767
105767
|
countContainer.setAttribute('aria-live', 'polite');
|
|
105768
105768
|
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);
|
|
105769
|
-
const okContainer = append$1(headerContainer, $$
|
|
105769
|
+
const okContainer = append$1(headerContainer, $$8('.quick-input-action'));
|
|
105770
105770
|
const ok = this._register(new Button(okContainer, this.styles.button));
|
|
105771
105771
|
ok.label = localize('ok', "OK");
|
|
105772
105772
|
this._register(ok.onDidClick(e => {
|
|
105773
105773
|
this.onDidAcceptEmitter.fire();
|
|
105774
105774
|
}));
|
|
105775
|
-
const customButtonContainer = append$1(headerContainer, $$
|
|
105775
|
+
const customButtonContainer = append$1(headerContainer, $$8('.quick-input-action'));
|
|
105776
105776
|
const customButton = this._register(new Button(customButtonContainer, this.styles.button));
|
|
105777
105777
|
customButton.label = localize('custom', "Custom");
|
|
105778
105778
|
this._register(customButton.onDidClick(e => {
|
|
105779
105779
|
this.onDidCustomEmitter.fire();
|
|
105780
105780
|
}));
|
|
105781
|
-
const message = append$1(inputContainer, $$
|
|
105781
|
+
const message = append$1(inputContainer, $$8(`#${this.idPrefix}message.quick-input-message`));
|
|
105782
105782
|
const progressBar = this._register(new ProgressBar(container, this.styles.progressBar));
|
|
105783
105783
|
progressBar.getContainer().classList.add('quick-input-progress');
|
|
105784
|
-
const widget = append$1(container, $$
|
|
105784
|
+
const widget = append$1(container, $$8('.quick-input-html-widget'));
|
|
105785
105785
|
widget.tabIndex = -1;
|
|
105786
|
-
const description1 = append$1(container, $$
|
|
105786
|
+
const description1 = append$1(container, $$8('.quick-input-description'));
|
|
105787
105787
|
const listId = this.idPrefix + 'list';
|
|
105788
105788
|
const list = this._register(new QuickInputList(container, listId, this.options, this.themeService));
|
|
105789
105789
|
inputBox.setAttribute('aria-controls', listId);
|
|
@@ -108113,7 +108113,7 @@ let BrowserClipboardService = class BrowserClipboardService extends Disposable {
|
|
|
108113
108113
|
}
|
|
108114
108114
|
// Fallback to textarea and execCommand solution
|
|
108115
108115
|
const activeElement = document.activeElement;
|
|
108116
|
-
const textArea = document.body.appendChild($$
|
|
108116
|
+
const textArea = document.body.appendChild($$e('textarea', { 'aria-hidden': true }));
|
|
108117
108117
|
textArea.style.height = '1px';
|
|
108118
108118
|
textArea.style.width = '1px';
|
|
108119
108119
|
textArea.style.position = 'absolute';
|
|
@@ -112837,7 +112837,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
112837
112837
|
this._nodes = h$1('div.diff-hidden-lines', [
|
|
112838
112838
|
h$1('div.top@top', { title: localize('diff.hiddenLines.top', 'Click or drag to show more above') }),
|
|
112839
112839
|
h$1('div.center@content', { style: { display: 'flex' } }, [
|
|
112840
|
-
h$1('div@first', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: '0' } }, [$$
|
|
112840
|
+
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)'))]),
|
|
112841
112841
|
h$1('div@others', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } }),
|
|
112842
112842
|
]),
|
|
112843
112843
|
h$1('div.bottom@bottom', { title: localize('diff.bottom', 'Click or drag to show more below'), role: 'button' }),
|
|
@@ -112923,7 +112923,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
112923
112923
|
if (!this.hide) {
|
|
112924
112924
|
const lineCount = _unchangedRegion.getHiddenModifiedRange(reader).length;
|
|
112925
112925
|
const linesHiddenText = localize('hiddenLines', '{0} hidden lines', lineCount);
|
|
112926
|
-
const span = $$
|
|
112926
|
+
const span = $$e('span', { title: localize('diff.hiddenLines.expandAll', 'Double click to unfold') }, linesHiddenText);
|
|
112927
112927
|
span.addEventListener('dblclick', e => {
|
|
112928
112928
|
if (e.button !== 0) {
|
|
112929
112929
|
return;
|
|
@@ -112935,7 +112935,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
|
|
|
112935
112935
|
const range = this._unchangedRegion.getHiddenModifiedRange(reader);
|
|
112936
112936
|
const items = this._modifiedOutlineSource.getBreadcrumbItems(range, reader);
|
|
112937
112937
|
if (items.length > 0) {
|
|
112938
|
-
children.push($$
|
|
112938
|
+
children.push($$e('span', undefined, '\u00a0\u00a0|\u00a0\u00a0'));
|
|
112939
112939
|
for (let i = 0; i < items.length; i++) {
|
|
112940
112940
|
const item = items[i];
|
|
112941
112941
|
const icon = SymbolKinds.toIcon(item.kind);
|
|
@@ -114108,7 +114108,7 @@ let ViewZoneManager = class ViewZoneManager extends Disposable {
|
|
|
114108
114108
|
function createViewZoneMarginArrow() {
|
|
114109
114109
|
const arrow = document.createElement('div');
|
|
114110
114110
|
arrow.className = 'arrow-revert-change ' + ThemeIcon.asClassName(Codicon.arrowRight);
|
|
114111
|
-
return $$
|
|
114111
|
+
return $$e('div', {}, arrow);
|
|
114112
114112
|
}
|
|
114113
114113
|
let marginDomNode = undefined;
|
|
114114
114114
|
if (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderRevertArrows.read(reader)) {
|
|
@@ -114920,7 +114920,7 @@ let DiffEditorWidget = class DiffEditorWidget extends DelegatingEditor {
|
|
|
114920
114920
|
this._audioCueService = _audioCueService;
|
|
114921
114921
|
this._editorProgressService = _editorProgressService;
|
|
114922
114922
|
this.elements = h$1('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [
|
|
114923
|
-
h$1('div.noModificationsOverlay@overlay', { style: { position: 'absolute', height: '100%', visibility: 'hidden', } }, [$$
|
|
114923
|
+
h$1('div.noModificationsOverlay@overlay', { style: { position: 'absolute', height: '100%', visibility: 'hidden', } }, [$$e('span', {}, 'No Changes')]),
|
|
114924
114924
|
h$1('div.editor.original@original', { style: { position: 'absolute', height: '100%' } }),
|
|
114925
114925
|
h$1('div.editor.modified@modified', { style: { position: 'absolute', height: '100%' } }),
|
|
114926
114926
|
h$1('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }),
|
|
@@ -118050,7 +118050,7 @@ registerLanguage({
|
|
|
118050
118050
|
mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
|
|
118051
118051
|
loader: () => {
|
|
118052
118052
|
{
|
|
118053
|
-
return Promise.resolve().then(function () { return require('./html-
|
|
118053
|
+
return Promise.resolve().then(function () { return require('./html-0e1741fe.js'); });
|
|
118054
118054
|
}
|
|
118055
118055
|
}
|
|
118056
118056
|
});
|
|
@@ -118070,7 +118070,7 @@ registerLanguage({
|
|
|
118070
118070
|
mimetypes: ["text/javascript"],
|
|
118071
118071
|
loader: () => {
|
|
118072
118072
|
{
|
|
118073
|
-
return Promise.resolve().then(function () { return require('./javascript-
|
|
118073
|
+
return Promise.resolve().then(function () { return require('./javascript-04f1bce0.js'); });
|
|
118074
118074
|
}
|
|
118075
118075
|
}
|
|
118076
118076
|
});
|
|
@@ -118088,7 +118088,7 @@ registerLanguage({
|
|
|
118088
118088
|
mimetypes: ["text/typescript"],
|
|
118089
118089
|
loader: () => {
|
|
118090
118090
|
{
|
|
118091
|
-
return Promise.resolve().then(function () { return require('./typescript-
|
|
118091
|
+
return Promise.resolve().then(function () { return require('./typescript-b7da8629.js'); });
|
|
118092
118092
|
}
|
|
118093
118093
|
}
|
|
118094
118094
|
});
|
|
@@ -118209,7 +118209,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, m
|
|
|
118209
118209
|
monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
|
|
118210
118210
|
function getMode$3() {
|
|
118211
118211
|
{
|
|
118212
|
-
return Promise.resolve().then(function () { return require('./cssMode-
|
|
118212
|
+
return Promise.resolve().then(function () { return require('./cssMode-1ec48254.js'); });
|
|
118213
118213
|
}
|
|
118214
118214
|
}
|
|
118215
118215
|
monaco_editor_core_exports$3.languages.onLanguage("less", () => {
|
|
@@ -118334,7 +118334,7 @@ monaco_editor_core_exports$2.languages.html = {
|
|
|
118334
118334
|
};
|
|
118335
118335
|
function getMode$2() {
|
|
118336
118336
|
{
|
|
118337
|
-
return Promise.resolve().then(function () { return require('./htmlMode-
|
|
118337
|
+
return Promise.resolve().then(function () { return require('./htmlMode-279d3c29.js'); });
|
|
118338
118338
|
}
|
|
118339
118339
|
}
|
|
118340
118340
|
function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
|
|
@@ -118436,7 +118436,7 @@ var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault,
|
|
|
118436
118436
|
monaco_editor_core_exports$1.languages.json = { jsonDefaults };
|
|
118437
118437
|
function getMode$1() {
|
|
118438
118438
|
{
|
|
118439
|
-
return Promise.resolve().then(function () { return require('./jsonMode-
|
|
118439
|
+
return Promise.resolve().then(function () { return require('./jsonMode-59322f7a.js'); });
|
|
118440
118440
|
}
|
|
118441
118441
|
}
|
|
118442
118442
|
monaco_editor_core_exports$1.languages.register({
|
|
@@ -118705,7 +118705,7 @@ monaco_editor_core_exports.languages.typescript = {
|
|
|
118705
118705
|
};
|
|
118706
118706
|
function getMode() {
|
|
118707
118707
|
{
|
|
118708
|
-
return Promise.resolve().then(function () { return require('./tsMode-
|
|
118708
|
+
return Promise.resolve().then(function () { return require('./tsMode-17561f70.js'); });
|
|
118709
118709
|
}
|
|
118710
118710
|
}
|
|
118711
118711
|
monaco_editor_core_exports.languages.onLanguage("typescript", () => {
|
|
@@ -120688,7 +120688,7 @@ let LightBulbWidget = LightBulbWidget_1 = class LightBulbWidget extends Disposab
|
|
|
120688
120688
|
this._onClick = this._register(new Emitter$1());
|
|
120689
120689
|
this.onClick = this._onClick.event;
|
|
120690
120690
|
this._state = LightBulbState.Hidden;
|
|
120691
|
-
this._domNode = $$
|
|
120691
|
+
this._domNode = $$e('div.lightBulbWidget');
|
|
120692
120692
|
this._register(Gesture.ignoreTarget(this._domNode));
|
|
120693
120693
|
this._editor.addContentWidget(this);
|
|
120694
120694
|
this._register(this._editor.onDidChangeModelContent(_ => {
|
|
@@ -121495,7 +121495,7 @@ let ActionWidgetService = class ActionWidgetService extends Disposable {
|
|
|
121495
121495
|
if (!actions.length) {
|
|
121496
121496
|
return undefined;
|
|
121497
121497
|
}
|
|
121498
|
-
const container = $$
|
|
121498
|
+
const container = $$e(className);
|
|
121499
121499
|
const actionBar = new ActionBar(container);
|
|
121500
121500
|
actionBar.push(actions, { icon: false, label: true });
|
|
121501
121501
|
return actionBar;
|
|
@@ -122689,20 +122689,20 @@ class CodeLensContentWidget {
|
|
|
122689
122689
|
if (lens.command) {
|
|
122690
122690
|
const title = renderLabelWithIcons(lens.command.title.trim());
|
|
122691
122691
|
if (lens.command.id) {
|
|
122692
|
-
children.push($$
|
|
122692
|
+
children.push($$e('a', { id: String(i), title: lens.command.tooltip, role: 'button' }, ...title));
|
|
122693
122693
|
this._commands.set(String(i), lens.command);
|
|
122694
122694
|
}
|
|
122695
122695
|
else {
|
|
122696
|
-
children.push($$
|
|
122696
|
+
children.push($$e('span', { title: lens.command.tooltip }, ...title));
|
|
122697
122697
|
}
|
|
122698
122698
|
if (i + 1 < lenses.length) {
|
|
122699
|
-
children.push($$
|
|
122699
|
+
children.push($$e('span', undefined, '\u00a0|\u00a0'));
|
|
122700
122700
|
}
|
|
122701
122701
|
}
|
|
122702
122702
|
}
|
|
122703
122703
|
if (!hasSymbol) {
|
|
122704
122704
|
// symbols but no commands
|
|
122705
|
-
reset(this._domNode, $$
|
|
122705
|
+
reset(this._domNode, $$e('span', undefined, 'no commands'));
|
|
122706
122706
|
}
|
|
122707
122707
|
else {
|
|
122708
122708
|
// symbols and commands
|
|
@@ -123854,22 +123854,22 @@ class ColorPickerModel {
|
|
|
123854
123854
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
123855
123855
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
123856
123856
|
*--------------------------------------------------------------------------------------------*/
|
|
123857
|
-
const $$
|
|
123857
|
+
const $$7 = $$e;
|
|
123858
123858
|
class ColorPickerHeader extends Disposable {
|
|
123859
123859
|
constructor(container, model, themeService, showingStandaloneColorPicker = false) {
|
|
123860
123860
|
super();
|
|
123861
123861
|
this.model = model;
|
|
123862
123862
|
this.showingStandaloneColorPicker = showingStandaloneColorPicker;
|
|
123863
123863
|
this._closeButton = null;
|
|
123864
|
-
this._domNode = $$
|
|
123864
|
+
this._domNode = $$7('.colorpicker-header');
|
|
123865
123865
|
append$1(container, this._domNode);
|
|
123866
|
-
this._pickedColorNode = append$1(this._domNode, $$
|
|
123867
|
-
append$1(this._pickedColorNode, $$
|
|
123866
|
+
this._pickedColorNode = append$1(this._domNode, $$7('.picked-color'));
|
|
123867
|
+
append$1(this._pickedColorNode, $$7('span.codicon.codicon-color-mode'));
|
|
123868
123868
|
this._pickedColorPresentation = append$1(this._pickedColorNode, document.createElement('span'));
|
|
123869
123869
|
this._pickedColorPresentation.classList.add('picked-color-presentation');
|
|
123870
123870
|
const tooltip = localize('clickToToggleColorOptions', "Click to toggle color options (rgb/hsl/hex)");
|
|
123871
123871
|
this._pickedColorNode.setAttribute('title', tooltip);
|
|
123872
|
-
this._originalColorNode = append$1(this._domNode, $$
|
|
123872
|
+
this._originalColorNode = append$1(this._domNode, $$7('.original-color'));
|
|
123873
123873
|
this._originalColorNode.style.backgroundColor = Color.Format.CSS.format(this.model.originalColor) || '';
|
|
123874
123874
|
this.backgroundColor = themeService.getColorTheme().getColor(editorHoverBackground) || Color.white;
|
|
123875
123875
|
this._register(themeService.onDidColorThemeChange(theme => {
|
|
@@ -123920,7 +123920,7 @@ class CloseButton extends Disposable {
|
|
|
123920
123920
|
const innerDiv = document.createElement('div');
|
|
123921
123921
|
innerDiv.classList.add('close-button-inner-div');
|
|
123922
123922
|
append$1(this._button, innerDiv);
|
|
123923
|
-
const closeButton = append$1(innerDiv, $$
|
|
123923
|
+
const closeButton = append$1(innerDiv, $$7('.button' + ThemeIcon.asCSSSelector(registerIcon('color-picker-close', Codicon.close, localize('closeIcon', 'Icon to close the color picker')))));
|
|
123924
123924
|
closeButton.classList.add('close-icon');
|
|
123925
123925
|
this._button.onclick = () => {
|
|
123926
123926
|
this._onClicked.fire();
|
|
@@ -123933,7 +123933,7 @@ class ColorPickerBody extends Disposable {
|
|
|
123933
123933
|
this.model = model;
|
|
123934
123934
|
this.pixelRatio = pixelRatio;
|
|
123935
123935
|
this._insertButton = null;
|
|
123936
|
-
this._domNode = $$
|
|
123936
|
+
this._domNode = $$7('.colorpicker-body');
|
|
123937
123937
|
append$1(container, this._domNode);
|
|
123938
123938
|
this._saturationBox = new SaturationBox(this._domNode, this.model, this.pixelRatio);
|
|
123939
123939
|
this._register(this._saturationBox);
|
|
@@ -123992,14 +123992,14 @@ class SaturationBox extends Disposable {
|
|
|
123992
123992
|
this.onDidChange = this._onDidChange.event;
|
|
123993
123993
|
this._onColorFlushed = new Emitter$1();
|
|
123994
123994
|
this.onColorFlushed = this._onColorFlushed.event;
|
|
123995
|
-
this._domNode = $$
|
|
123995
|
+
this._domNode = $$7('.saturation-wrap');
|
|
123996
123996
|
append$1(container, this._domNode);
|
|
123997
123997
|
// Create canvas, draw selected color
|
|
123998
123998
|
this._canvas = document.createElement('canvas');
|
|
123999
123999
|
this._canvas.className = 'saturation-box';
|
|
124000
124000
|
append$1(this._domNode, this._canvas);
|
|
124001
124001
|
// Add selection circle
|
|
124002
|
-
this.selection = $$
|
|
124002
|
+
this.selection = $$7('.saturation-selection');
|
|
124003
124003
|
append$1(this._domNode, this.selection);
|
|
124004
124004
|
this.layout();
|
|
124005
124005
|
this._register(addDisposableListener(this._domNode, EventType$1.POINTER_DOWN, e => this.onPointerDown(e)));
|
|
@@ -124084,14 +124084,14 @@ class Strip extends Disposable {
|
|
|
124084
124084
|
this._onColorFlushed = new Emitter$1();
|
|
124085
124085
|
this.onColorFlushed = this._onColorFlushed.event;
|
|
124086
124086
|
if (showingStandaloneColorPicker) {
|
|
124087
|
-
this.domNode = append$1(container, $$
|
|
124088
|
-
this.overlay = append$1(this.domNode, $$
|
|
124087
|
+
this.domNode = append$1(container, $$7('.standalone-strip'));
|
|
124088
|
+
this.overlay = append$1(this.domNode, $$7('.standalone-overlay'));
|
|
124089
124089
|
}
|
|
124090
124090
|
else {
|
|
124091
|
-
this.domNode = append$1(container, $$
|
|
124092
|
-
this.overlay = append$1(this.domNode, $$
|
|
124091
|
+
this.domNode = append$1(container, $$7('.strip'));
|
|
124092
|
+
this.overlay = append$1(this.domNode, $$7('.overlay'));
|
|
124093
124093
|
}
|
|
124094
|
-
this.slider = append$1(this.domNode, $$
|
|
124094
|
+
this.slider = append$1(this.domNode, $$7('.slider'));
|
|
124095
124095
|
this.slider.style.top = `0px`;
|
|
124096
124096
|
this._register(addDisposableListener(this.domNode, EventType$1.POINTER_DOWN, e => this.onPointerDown(e)));
|
|
124097
124097
|
this._register(model.onDidChangeColor(this.onDidChangeColor, this));
|
|
@@ -124181,7 +124181,7 @@ class ColorPickerWidget extends Widget$1 {
|
|
|
124181
124181
|
this.model = model;
|
|
124182
124182
|
this.pixelRatio = pixelRatio;
|
|
124183
124183
|
this._register(PixelRatio.onDidChange(() => this.layout()));
|
|
124184
|
-
const element = $$
|
|
124184
|
+
const element = $$7('.colorpicker-widget');
|
|
124185
124185
|
container.appendChild(element);
|
|
124186
124186
|
this.header = this._register(new ColorPickerHeader(element, this.model, themeService, standaloneColorPicker));
|
|
124187
124187
|
this.body = this._register(new ColorPickerBody(element, this.model, this.pixelRatio, standaloneColorPicker));
|
|
@@ -125125,26 +125125,26 @@ let PeekViewWidget = class PeekViewWidget extends ZoneWidget {
|
|
|
125125
125125
|
}
|
|
125126
125126
|
_fillContainer(container) {
|
|
125127
125127
|
this.setCssClass('peekview-widget');
|
|
125128
|
-
this._headElement = $$
|
|
125129
|
-
this._bodyElement = $$
|
|
125128
|
+
this._headElement = $$e('.head');
|
|
125129
|
+
this._bodyElement = $$e('.body');
|
|
125130
125130
|
this._fillHead(this._headElement);
|
|
125131
125131
|
this._fillBody(this._bodyElement);
|
|
125132
125132
|
container.appendChild(this._headElement);
|
|
125133
125133
|
container.appendChild(this._bodyElement);
|
|
125134
125134
|
}
|
|
125135
125135
|
_fillHead(container, noCloseAction) {
|
|
125136
|
-
this._titleElement = $$
|
|
125136
|
+
this._titleElement = $$e('.peekview-title');
|
|
125137
125137
|
if (this.options.supportOnTitleClick) {
|
|
125138
125138
|
this._titleElement.classList.add('clickable');
|
|
125139
125139
|
addStandardDisposableListener(this._titleElement, 'click', event => this._onTitleClick(event));
|
|
125140
125140
|
}
|
|
125141
125141
|
append$1(this._headElement, this._titleElement);
|
|
125142
125142
|
this._fillTitleIcon(this._titleElement);
|
|
125143
|
-
this._primaryHeading = $$
|
|
125144
|
-
this._secondaryHeading = $$
|
|
125145
|
-
this._metaHeading = $$
|
|
125143
|
+
this._primaryHeading = $$e('span.filename');
|
|
125144
|
+
this._secondaryHeading = $$e('span.dirname');
|
|
125145
|
+
this._metaHeading = $$e('span.meta');
|
|
125146
125146
|
append$1(this._titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading);
|
|
125147
|
-
const actionsContainer = $$
|
|
125147
|
+
const actionsContainer = $$e('.peekview-actions');
|
|
125148
125148
|
append$1(this._headElement, actionsContainer);
|
|
125149
125149
|
const actionBarOptions = this._getActionBarOptions();
|
|
125150
125150
|
this._actionbarWidget = new ActionBar(actionsContainer, actionBarOptions);
|
|
@@ -125568,7 +125568,7 @@ let FileReferencesTemplate = class FileReferencesTemplate extends Disposable {
|
|
|
125568
125568
|
const parent = document.createElement('div');
|
|
125569
125569
|
parent.classList.add('reference-file');
|
|
125570
125570
|
this.file = this._register(new IconLabel(parent, { supportHighlights: true }));
|
|
125571
|
-
this.badge = new CountBadge(append$1(parent, $$
|
|
125571
|
+
this.badge = new CountBadge(append$1(parent, $$e('.count')), {}, defaultCountBadgeStyles);
|
|
125572
125572
|
container.appendChild(parent);
|
|
125573
125573
|
}
|
|
125574
125574
|
set(element, matches) {
|
|
@@ -125880,11 +125880,11 @@ let ReferenceWidget = class ReferenceWidget extends PeekViewWidget {
|
|
|
125880
125880
|
_fillBody(containerElement) {
|
|
125881
125881
|
this.setCssClass('reference-zone-widget');
|
|
125882
125882
|
// message pane
|
|
125883
|
-
this._messageContainer = append$1(containerElement, $$
|
|
125883
|
+
this._messageContainer = append$1(containerElement, $$e('div.messages'));
|
|
125884
125884
|
hide(this._messageContainer);
|
|
125885
125885
|
this._splitView = new SplitView(containerElement, { orientation: 1 /* Orientation.HORIZONTAL */ });
|
|
125886
125886
|
// editor
|
|
125887
|
-
this._previewContainer = append$1(containerElement, $$
|
|
125887
|
+
this._previewContainer = append$1(containerElement, $$e('div.preview.inline'));
|
|
125888
125888
|
const options = {
|
|
125889
125889
|
scrollBeyondLastLine: false,
|
|
125890
125890
|
scrollbar: {
|
|
@@ -125905,7 +125905,7 @@ let ReferenceWidget = class ReferenceWidget extends PeekViewWidget {
|
|
|
125905
125905
|
hide(this._previewContainer);
|
|
125906
125906
|
this._previewNotAvailableMessage = new TextModel(localize('missingPreviewMessage', "no preview available"), PLAINTEXT_LANGUAGE_ID, TextModel.DEFAULT_CREATION_OPTIONS, null, this._undoRedoService, this._languageService, this._languageConfigurationService);
|
|
125907
125907
|
// tree
|
|
125908
|
-
this._treeContainer = append$1(containerElement, $$
|
|
125908
|
+
this._treeContainer = append$1(containerElement, $$e('div.ref-tree.inline'));
|
|
125909
125909
|
const treeOptions = {
|
|
125910
125910
|
keyboardSupport: this._defaultTreeKeyboardSupport,
|
|
125911
125911
|
accessibilityProvider: new AccessibilityProvider(),
|
|
@@ -127751,7 +127751,7 @@ registerEditorContribution(GotoDefinitionAtPositionEditorContribution.ID, GotoDe
|
|
|
127751
127751
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
127752
127752
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
127753
127753
|
*--------------------------------------------------------------------------------------------*/
|
|
127754
|
-
const $$
|
|
127754
|
+
const $$6 = $$e;
|
|
127755
127755
|
class HoverWidget extends Disposable {
|
|
127756
127756
|
constructor() {
|
|
127757
127757
|
super();
|
|
@@ -127776,14 +127776,14 @@ class HoverAction extends Disposable {
|
|
|
127776
127776
|
}
|
|
127777
127777
|
constructor(parent, actionOptions, keybindingLabel) {
|
|
127778
127778
|
super();
|
|
127779
|
-
this.actionContainer = append$1(parent, $$
|
|
127779
|
+
this.actionContainer = append$1(parent, $$6('div.action-container'));
|
|
127780
127780
|
this.actionContainer.setAttribute('tabindex', '0');
|
|
127781
|
-
this.action = append$1(this.actionContainer, $$
|
|
127781
|
+
this.action = append$1(this.actionContainer, $$6('a.action'));
|
|
127782
127782
|
this.action.setAttribute('role', 'button');
|
|
127783
127783
|
if (actionOptions.iconClass) {
|
|
127784
|
-
append$1(this.action, $$
|
|
127784
|
+
append$1(this.action, $$6(`span.icon.${actionOptions.iconClass}`));
|
|
127785
127785
|
}
|
|
127786
|
-
const label = append$1(this.action, $$
|
|
127786
|
+
const label = append$1(this.action, $$6('span'));
|
|
127787
127787
|
label.textContent = keybindingLabel ? `${actionOptions.label} (${keybindingLabel})` : actionOptions.label;
|
|
127788
127788
|
this._register(addDisposableListener(this.actionContainer, EventType$1.CLICK, e => {
|
|
127789
127789
|
e.stopPropagation();
|
|
@@ -128282,7 +128282,7 @@ var __param$15 = (undefined && undefined.__param) || function (paramIndex, decor
|
|
|
128282
128282
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
128283
128283
|
};
|
|
128284
128284
|
var ContentHoverController_1, ContentHoverWidget_1;
|
|
128285
|
-
const $$
|
|
128285
|
+
const $$5 = $$e;
|
|
128286
128286
|
let ContentHoverController = ContentHoverController_1 = class ContentHoverController extends Disposable {
|
|
128287
128287
|
constructor(_editor, _instantiationService, _keybindingService) {
|
|
128288
128288
|
super();
|
|
@@ -129022,8 +129022,8 @@ let EditorHoverStatusBar = class EditorHoverStatusBar extends Disposable {
|
|
|
129022
129022
|
super();
|
|
129023
129023
|
this._keybindingService = _keybindingService;
|
|
129024
129024
|
this._hasContent = false;
|
|
129025
|
-
this.hoverElement = $$
|
|
129026
|
-
this.actionsElement = append$1(this.hoverElement, $$
|
|
129025
|
+
this.hoverElement = $$5('div.hover-row.status-bar');
|
|
129026
|
+
this.actionsElement = append$1(this.hoverElement, $$5('div.actions'));
|
|
129027
129027
|
}
|
|
129028
129028
|
addAction(actionOptions) {
|
|
129029
129029
|
const keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId);
|
|
@@ -129125,7 +129125,7 @@ function computeDistanceFromPointToRectangle(pointX, pointY, left, top, width, h
|
|
|
129125
129125
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
129126
129126
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
129127
129127
|
*--------------------------------------------------------------------------------------------*/
|
|
129128
|
-
const $$
|
|
129128
|
+
const $$4 = $$e;
|
|
129129
129129
|
class MarginHoverWidget extends Disposable {
|
|
129130
129130
|
constructor(editor, languageService, openerService) {
|
|
129131
129131
|
super();
|
|
@@ -129206,8 +129206,8 @@ class MarginHoverWidget extends Disposable {
|
|
|
129206
129206
|
this._renderDisposeables.clear();
|
|
129207
129207
|
const fragment = document.createDocumentFragment();
|
|
129208
129208
|
for (const msg of messages) {
|
|
129209
|
-
const markdownHoverElement = $$
|
|
129210
|
-
const hoverContentsElement = append$1(markdownHoverElement, $$
|
|
129209
|
+
const markdownHoverElement = $$4('div.hover-row.markdown-hover');
|
|
129210
|
+
const hoverContentsElement = append$1(markdownHoverElement, $$4('div.hover-contents'));
|
|
129211
129211
|
const renderedContents = this._renderDisposeables.add(this._markdownRenderer.render(msg.value));
|
|
129212
129212
|
hoverContentsElement.appendChild(renderedContents.element);
|
|
129213
129213
|
fragment.appendChild(markdownHoverElement);
|
|
@@ -129337,7 +129337,7 @@ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
129337
129337
|
var __param$14 = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
129338
129338
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
129339
129339
|
};
|
|
129340
|
-
const $$
|
|
129340
|
+
const $$3 = $$e;
|
|
129341
129341
|
class MarkdownHover {
|
|
129342
129342
|
constructor(owner, range, contents, isBeforeContent, ordinal) {
|
|
129343
129343
|
this.owner = owner;
|
|
@@ -129442,8 +129442,8 @@ function renderMarkdownHovers(context, hoverParts, editor, languageService, open
|
|
|
129442
129442
|
if (isEmptyMarkdownString(contents)) {
|
|
129443
129443
|
continue;
|
|
129444
129444
|
}
|
|
129445
|
-
const markdownHoverElement = $$
|
|
129446
|
-
const hoverContentsElement = append$1(markdownHoverElement, $$
|
|
129445
|
+
const markdownHoverElement = $$3('div.hover-row.markdown-hover');
|
|
129446
|
+
const hoverContentsElement = append$1(markdownHoverElement, $$3('div.hover-contents'));
|
|
129447
129447
|
const renderer = disposables.add(new MarkdownRenderer({ editor }, languageService, openerService));
|
|
129448
129448
|
disposables.add(renderer.onDidRenderAsync(() => {
|
|
129449
129449
|
hoverContentsElement.className = 'hover-contents code-hover-contents';
|
|
@@ -129764,14 +129764,14 @@ class MessageWidget {
|
|
|
129764
129764
|
detailsElement.appendChild(codeElement);
|
|
129765
129765
|
}
|
|
129766
129766
|
else {
|
|
129767
|
-
this._codeLink = $$
|
|
129767
|
+
this._codeLink = $$e('a.code-link');
|
|
129768
129768
|
this._codeLink.setAttribute('href', `${code.target.toString()}`);
|
|
129769
129769
|
this._codeLink.onclick = (e) => {
|
|
129770
129770
|
this._openerService.open(code.target, { allowCommands: true });
|
|
129771
129771
|
e.preventDefault();
|
|
129772
129772
|
e.stopPropagation();
|
|
129773
129773
|
};
|
|
129774
|
-
const codeElement = append$1(this._codeLink, $$
|
|
129774
|
+
const codeElement = append$1(this._codeLink, $$e('span'));
|
|
129775
129775
|
codeElement.innerText = code.value;
|
|
129776
129776
|
detailsElement.appendChild(this._codeLink);
|
|
129777
129777
|
}
|
|
@@ -129895,7 +129895,7 @@ let MarkerNavigationWidget = MarkerNavigationWidget_1 = class MarkerNavigationWi
|
|
|
129895
129895
|
menu.dispose();
|
|
129896
129896
|
}
|
|
129897
129897
|
_fillTitleIcon(container) {
|
|
129898
|
-
this._icon = append$1(container, $$
|
|
129898
|
+
this._icon = append$1(container, $$e(''));
|
|
129899
129899
|
}
|
|
129900
129900
|
_fillBody(container) {
|
|
129901
129901
|
this._parentContainer = container;
|
|
@@ -130264,7 +130264,7 @@ var __decorate$10 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
130264
130264
|
var __param$10 = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
130265
130265
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
130266
130266
|
};
|
|
130267
|
-
const $$
|
|
130267
|
+
const $$2 = $$e;
|
|
130268
130268
|
class MarkerHover {
|
|
130269
130269
|
constructor(owner, range, marker) {
|
|
130270
130270
|
this.owner = owner;
|
|
@@ -130322,36 +130322,36 @@ let MarkerHoverParticipant = class MarkerHoverParticipant {
|
|
|
130322
130322
|
return disposables;
|
|
130323
130323
|
}
|
|
130324
130324
|
renderMarkerHover(markerHover, disposables) {
|
|
130325
|
-
const hoverElement = $$
|
|
130326
|
-
const markerElement = append$1(hoverElement, $$
|
|
130325
|
+
const hoverElement = $$2('div.hover-row');
|
|
130326
|
+
const markerElement = append$1(hoverElement, $$2('div.marker.hover-contents'));
|
|
130327
130327
|
const { source, message, code, relatedInformation } = markerHover.marker;
|
|
130328
130328
|
this._editor.applyFontInfo(markerElement);
|
|
130329
|
-
const messageElement = append$1(markerElement, $$
|
|
130329
|
+
const messageElement = append$1(markerElement, $$2('span'));
|
|
130330
130330
|
messageElement.style.whiteSpace = 'pre-wrap';
|
|
130331
130331
|
messageElement.innerText = message;
|
|
130332
130332
|
if (source || code) {
|
|
130333
130333
|
// Code has link
|
|
130334
130334
|
if (code && typeof code !== 'string') {
|
|
130335
|
-
const sourceAndCodeElement = $$
|
|
130335
|
+
const sourceAndCodeElement = $$2('span');
|
|
130336
130336
|
if (source) {
|
|
130337
|
-
const sourceElement = append$1(sourceAndCodeElement, $$
|
|
130337
|
+
const sourceElement = append$1(sourceAndCodeElement, $$2('span'));
|
|
130338
130338
|
sourceElement.innerText = source;
|
|
130339
130339
|
}
|
|
130340
|
-
const codeLink = append$1(sourceAndCodeElement, $$
|
|
130340
|
+
const codeLink = append$1(sourceAndCodeElement, $$2('a.code-link'));
|
|
130341
130341
|
codeLink.setAttribute('href', code.target.toString());
|
|
130342
130342
|
disposables.add(addDisposableListener(codeLink, 'click', (e) => {
|
|
130343
130343
|
this._openerService.open(code.target, { allowCommands: true });
|
|
130344
130344
|
e.preventDefault();
|
|
130345
130345
|
e.stopPropagation();
|
|
130346
130346
|
}));
|
|
130347
|
-
const codeElement = append$1(codeLink, $$
|
|
130347
|
+
const codeElement = append$1(codeLink, $$2('span'));
|
|
130348
130348
|
codeElement.innerText = code.value;
|
|
130349
130349
|
const detailsElement = append$1(markerElement, sourceAndCodeElement);
|
|
130350
130350
|
detailsElement.style.opacity = '0.6';
|
|
130351
130351
|
detailsElement.style.paddingLeft = '6px';
|
|
130352
130352
|
}
|
|
130353
130353
|
else {
|
|
130354
|
-
const detailsElement = append$1(markerElement, $$
|
|
130354
|
+
const detailsElement = append$1(markerElement, $$2('span'));
|
|
130355
130355
|
detailsElement.style.opacity = '0.6';
|
|
130356
130356
|
detailsElement.style.paddingLeft = '6px';
|
|
130357
130357
|
detailsElement.innerText = source && code ? `${source}(${code})` : source ? source : `(${code})`;
|
|
@@ -130359,9 +130359,9 @@ let MarkerHoverParticipant = class MarkerHoverParticipant {
|
|
|
130359
130359
|
}
|
|
130360
130360
|
if (isNonEmptyArray(relatedInformation)) {
|
|
130361
130361
|
for (const { message, resource, startLineNumber, startColumn } of relatedInformation) {
|
|
130362
|
-
const relatedInfoContainer = append$1(markerElement, $$
|
|
130362
|
+
const relatedInfoContainer = append$1(markerElement, $$2('div'));
|
|
130363
130363
|
relatedInfoContainer.style.marginTop = '8px';
|
|
130364
|
-
const a = append$1(relatedInfoContainer, $$
|
|
130364
|
+
const a = append$1(relatedInfoContainer, $$2('a'));
|
|
130365
130365
|
a.innerText = `${basename(resource)}(${startLineNumber}, ${startColumn}): `;
|
|
130366
130366
|
a.style.cursor = 'pointer';
|
|
130367
130367
|
disposables.add(addDisposableListener(a, 'click', (e) => {
|
|
@@ -130374,7 +130374,7 @@ let MarkerHoverParticipant = class MarkerHoverParticipant {
|
|
|
130374
130374
|
}).catch(onUnexpectedError);
|
|
130375
130375
|
}
|
|
130376
130376
|
}));
|
|
130377
|
-
const messageElement = append$1(relatedInfoContainer, $$
|
|
130377
|
+
const messageElement = append$1(relatedInfoContainer, $$2('span'));
|
|
130378
130378
|
messageElement.innerText = message;
|
|
130379
130379
|
this._editor.applyFontInfo(messageElement);
|
|
130380
130380
|
}
|
|
@@ -130395,7 +130395,7 @@ let MarkerHoverParticipant = class MarkerHoverParticipant {
|
|
|
130395
130395
|
});
|
|
130396
130396
|
}
|
|
130397
130397
|
if (!this._editor.getOption(90 /* EditorOption.readOnly */)) {
|
|
130398
|
-
const quickfixPlaceholderElement = context.statusBar.append($$
|
|
130398
|
+
const quickfixPlaceholderElement = context.statusBar.append($$2('div'));
|
|
130399
130399
|
if (this.recentMarkerCodeActionsInfo) {
|
|
130400
130400
|
if (IMarkerData.makeKey(this.recentMarkerCodeActionsInfo.marker) === IMarkerData.makeKey(markerHover.marker)) {
|
|
130401
130401
|
if (!this.recentMarkerCodeActionsInfo.hasCodeActions) {
|
|
@@ -133810,10 +133810,10 @@ class InlineProgressWidget extends Disposable {
|
|
|
133810
133810
|
this.editor.layoutContentWidget(this);
|
|
133811
133811
|
}
|
|
133812
133812
|
create(title) {
|
|
133813
|
-
this.domNode = $$
|
|
133813
|
+
this.domNode = $$e('.inline-progress-widget');
|
|
133814
133814
|
this.domNode.role = 'button';
|
|
133815
133815
|
this.domNode.title = title;
|
|
133816
|
-
const iconElement = $$
|
|
133816
|
+
const iconElement = $$e('span.icon');
|
|
133817
133817
|
this.domNode.append(iconElement);
|
|
133818
133818
|
iconElement.classList.add(...ThemeIcon.asClassNameArray(Codicon.loading), 'codicon-modifier-spin');
|
|
133819
133819
|
const updateSize = () => {
|
|
@@ -133956,7 +133956,7 @@ let PostEditWidget = PostEditWidget_1 = class PostEditWidget extends Disposable
|
|
|
133956
133956
|
this.button.element.title = this.showCommand.label + (binding ? ` (${binding})` : '');
|
|
133957
133957
|
}
|
|
133958
133958
|
create() {
|
|
133959
|
-
this.domNode = $$
|
|
133959
|
+
this.domNode = $$e('.post-edit-widget');
|
|
133960
133960
|
this.button = this._register(new Button(this.domNode, {
|
|
133961
133961
|
supportIcons: true,
|
|
133962
133962
|
}));
|
|
@@ -147816,7 +147816,7 @@ let SuggestWidgetStatus = class SuggestWidgetStatus {
|
|
|
147816
147816
|
this._menuService = _menuService;
|
|
147817
147817
|
this._contextKeyService = _contextKeyService;
|
|
147818
147818
|
this._menuDisposables = new DisposableStore();
|
|
147819
|
-
this.element = append$1(container, $$
|
|
147819
|
+
this.element = append$1(container, $$e('.suggest-status-bar'));
|
|
147820
147820
|
const actionViewItemProvider = (action => {
|
|
147821
147821
|
return action instanceof MenuItemAction ? instantiationService.createInstance(StatusBarViewItem, action, undefined) : undefined;
|
|
147822
147822
|
});
|
|
@@ -147889,20 +147889,20 @@ let SuggestDetailsWidget = class SuggestDetailsWidget {
|
|
|
147889
147889
|
this._renderDisposeable = new DisposableStore();
|
|
147890
147890
|
this._borderWidth = 1;
|
|
147891
147891
|
this._size = new Dimension(330, 0);
|
|
147892
|
-
this.domNode = $$
|
|
147892
|
+
this.domNode = $$e('.suggest-details');
|
|
147893
147893
|
this.domNode.classList.add('no-docs');
|
|
147894
147894
|
this._markdownRenderer = instaService.createInstance(MarkdownRenderer, { editor: _editor });
|
|
147895
|
-
this._body = $$
|
|
147895
|
+
this._body = $$e('.body');
|
|
147896
147896
|
this._scrollbar = new DomScrollableElement(this._body, {
|
|
147897
147897
|
alwaysConsumeMouseWheel: true,
|
|
147898
147898
|
});
|
|
147899
147899
|
append$1(this.domNode, this._scrollbar.getDomNode());
|
|
147900
147900
|
this._disposables.add(this._scrollbar);
|
|
147901
|
-
this._header = append$1(this._body, $$
|
|
147902
|
-
this._close = append$1(this._header, $$
|
|
147901
|
+
this._header = append$1(this._body, $$e('.header'));
|
|
147902
|
+
this._close = append$1(this._header, $$e('span' + ThemeIcon.asCSSSelector(Codicon.close)));
|
|
147903
147903
|
this._close.title = localize('details.close', "Close");
|
|
147904
|
-
this._type = append$1(this._header, $$
|
|
147905
|
-
this._docs = append$1(this._body, $$
|
|
147904
|
+
this._type = append$1(this._header, $$e('p.type'));
|
|
147905
|
+
this._docs = append$1(this._body, $$e('p.docs'));
|
|
147906
147906
|
this._configureFont();
|
|
147907
147907
|
this._disposables.add(this._editor.onDidChangeConfiguration(e => {
|
|
147908
147908
|
if (e.hasChanged(50 /* EditorOption.fontInfo */)) {
|
|
@@ -148386,19 +148386,19 @@ let ItemRenderer = class ItemRenderer {
|
|
|
148386
148386
|
const disposables = new DisposableStore();
|
|
148387
148387
|
const root = container;
|
|
148388
148388
|
root.classList.add('show-file-icons');
|
|
148389
|
-
const icon = append$1(container, $$
|
|
148390
|
-
const colorspan = append$1(icon, $$
|
|
148391
|
-
const text = append$1(container, $$
|
|
148392
|
-
const main = append$1(text, $$
|
|
148393
|
-
const iconContainer = append$1(main, $$
|
|
148394
|
-
const left = append$1(main, $$
|
|
148395
|
-
const right = append$1(main, $$
|
|
148389
|
+
const icon = append$1(container, $$e('.icon'));
|
|
148390
|
+
const colorspan = append$1(icon, $$e('span.colorspan'));
|
|
148391
|
+
const text = append$1(container, $$e('.contents'));
|
|
148392
|
+
const main = append$1(text, $$e('.main'));
|
|
148393
|
+
const iconContainer = append$1(main, $$e('.icon-label.codicon'));
|
|
148394
|
+
const left = append$1(main, $$e('span.left'));
|
|
148395
|
+
const right = append$1(main, $$e('span.right'));
|
|
148396
148396
|
const iconLabel = new IconLabel(left, { supportHighlights: true, supportIcons: true });
|
|
148397
148397
|
disposables.add(iconLabel);
|
|
148398
|
-
const parametersLabel = append$1(left, $$
|
|
148399
|
-
const qualifierLabel = append$1(left, $$
|
|
148400
|
-
const detailsLabel = append$1(right, $$
|
|
148401
|
-
const readMore = append$1(right, $$
|
|
148398
|
+
const parametersLabel = append$1(left, $$e('span.signature-label'));
|
|
148399
|
+
const qualifierLabel = append$1(left, $$e('span.qualifier-label'));
|
|
148400
|
+
const detailsLabel = append$1(right, $$e('span.details-label'));
|
|
148401
|
+
const readMore = append$1(right, $$e('span.readMore' + ThemeIcon.asCSSSelector(suggestMoreInfoIcon)));
|
|
148402
148402
|
readMore.title = localize('readMore', "Read More");
|
|
148403
148403
|
const configureFont = () => {
|
|
148404
148404
|
const options = this._editor.getOptions();
|
|
@@ -148652,8 +148652,8 @@ let SuggestWidget = SuggestWidget_1 = class SuggestWidget {
|
|
|
148652
148652
|
this._contentWidget.unlockPreference();
|
|
148653
148653
|
state = undefined;
|
|
148654
148654
|
}));
|
|
148655
|
-
this._messageElement = append$1(this.element.domNode, $$
|
|
148656
|
-
this._listElement = append$1(this.element.domNode, $$
|
|
148655
|
+
this._messageElement = append$1(this.element.domNode, $$e('.message'));
|
|
148656
|
+
this._listElement = append$1(this.element.domNode, $$e('.tree'));
|
|
148657
148657
|
const details = this._disposables.add(instantiationService.createInstance(SuggestDetailsWidget, this.editor));
|
|
148658
148658
|
details.onDidClose(this.toggleDetails, this, this._disposables);
|
|
148659
148659
|
this._details = new SuggestDetailsOverlay(details, this.editor);
|
|
@@ -150896,7 +150896,7 @@ let InlineCompletionsHoverParticipant = class InlineCompletionsHoverParticipant
|
|
|
150896
150896
|
return disposableStore;
|
|
150897
150897
|
}
|
|
150898
150898
|
renderScreenReaderText(context, part, disposableStore) {
|
|
150899
|
-
const $ = $$
|
|
150899
|
+
const $ = $$e;
|
|
150900
150900
|
const markdownHoverElement = $('div.hover-row.markdown-hover');
|
|
150901
150901
|
const hoverContentsElement = append$1(markdownHoverElement, $('div.hover-contents', { ['aria-live']: 'assertive' }));
|
|
150902
150902
|
const renderer = disposableStore.add(new MarkdownRenderer({ editor: this._editor }, this._languageService, this._openerService));
|
|
@@ -156692,7 +156692,7 @@ var __param$n = (undefined && undefined.__param) || function (paramIndex, decora
|
|
|
156692
156692
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
156693
156693
|
};
|
|
156694
156694
|
var ParameterHintsWidget_1;
|
|
156695
|
-
const
|
|
156695
|
+
const $$1 = $$e;
|
|
156696
156696
|
const parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, localize('parameterHintsNextIcon', 'Icon for show next parameter hint.'));
|
|
156697
156697
|
const parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, localize('parameterHintsPreviousIcon', 'Icon for show previous parameter hint.'));
|
|
156698
156698
|
let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget extends Disposable {
|
|
@@ -156710,13 +156710,13 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156710
156710
|
this.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService);
|
|
156711
156711
|
}
|
|
156712
156712
|
createParameterHintDOMNodes() {
|
|
156713
|
-
const element =
|
|
156714
|
-
const wrapper = append$1(element,
|
|
156713
|
+
const element = $$1('.editor-widget.parameter-hints-widget');
|
|
156714
|
+
const wrapper = append$1(element, $$1('.phwrapper'));
|
|
156715
156715
|
wrapper.tabIndex = -1;
|
|
156716
|
-
const controls = append$1(wrapper,
|
|
156717
|
-
const previous = append$1(controls,
|
|
156718
|
-
const overloads = append$1(controls,
|
|
156719
|
-
const next = append$1(controls,
|
|
156716
|
+
const controls = append$1(wrapper, $$1('.controls'));
|
|
156717
|
+
const previous = append$1(controls, $$1('.button' + ThemeIcon.asCSSSelector(parameterHintsPreviousIcon)));
|
|
156718
|
+
const overloads = append$1(controls, $$1('.overloads'));
|
|
156719
|
+
const next = append$1(controls, $$1('.button' + ThemeIcon.asCSSSelector(parameterHintsNextIcon)));
|
|
156720
156720
|
this._register(addDisposableListener(previous, 'click', e => {
|
|
156721
156721
|
EventHelper.stop(e);
|
|
156722
156722
|
this.previous();
|
|
@@ -156725,14 +156725,14 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156725
156725
|
EventHelper.stop(e);
|
|
156726
156726
|
this.next();
|
|
156727
156727
|
}));
|
|
156728
|
-
const body =
|
|
156728
|
+
const body = $$1('.body');
|
|
156729
156729
|
const scrollbar = new DomScrollableElement(body, {
|
|
156730
156730
|
alwaysConsumeMouseWheel: true,
|
|
156731
156731
|
});
|
|
156732
156732
|
this._register(scrollbar);
|
|
156733
156733
|
wrapper.appendChild(scrollbar.getDomNode());
|
|
156734
|
-
const signature = append$1(body,
|
|
156735
|
-
const docs = append$1(body,
|
|
156734
|
+
const signature = append$1(body, $$1('.signature'));
|
|
156735
|
+
const docs = append$1(body, $$1('.docs'));
|
|
156736
156736
|
element.style.userSelect = 'text';
|
|
156737
156737
|
this.domNodes = {
|
|
156738
156738
|
element,
|
|
@@ -156812,14 +156812,14 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156812
156812
|
if (!signature) {
|
|
156813
156813
|
return;
|
|
156814
156814
|
}
|
|
156815
|
-
const code = append$1(this.domNodes.signature,
|
|
156815
|
+
const code = append$1(this.domNodes.signature, $$1('.code'));
|
|
156816
156816
|
const fontInfo = this.editor.getOption(50 /* EditorOption.fontInfo */);
|
|
156817
156817
|
code.style.fontSize = `${fontInfo.fontSize}px`;
|
|
156818
156818
|
code.style.fontFamily = fontInfo.fontFamily;
|
|
156819
156819
|
const hasParameters = signature.parameters.length > 0;
|
|
156820
156820
|
const activeParameterIndex = (_a = signature.activeParameter) !== null && _a !== void 0 ? _a : hints.activeParameter;
|
|
156821
156821
|
if (!hasParameters) {
|
|
156822
|
-
const label = append$1(code,
|
|
156822
|
+
const label = append$1(code, $$1('span'));
|
|
156823
156823
|
label.textContent = signature.label;
|
|
156824
156824
|
}
|
|
156825
156825
|
else {
|
|
@@ -156827,7 +156827,7 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156827
156827
|
}
|
|
156828
156828
|
const activeParameter = signature.parameters[activeParameterIndex];
|
|
156829
156829
|
if (activeParameter === null || activeParameter === void 0 ? void 0 : activeParameter.documentation) {
|
|
156830
|
-
const documentation =
|
|
156830
|
+
const documentation = $$1('span.documentation');
|
|
156831
156831
|
if (typeof activeParameter.documentation === 'string') {
|
|
156832
156832
|
documentation.textContent = activeParameter.documentation;
|
|
156833
156833
|
}
|
|
@@ -156835,11 +156835,11 @@ let ParameterHintsWidget = ParameterHintsWidget_1 = class ParameterHintsWidget e
|
|
|
156835
156835
|
const renderedContents = this.renderMarkdownDocs(activeParameter.documentation);
|
|
156836
156836
|
documentation.appendChild(renderedContents.element);
|
|
156837
156837
|
}
|
|
156838
|
-
append$1(this.domNodes.docs,
|
|
156838
|
+
append$1(this.domNodes.docs, $$1('p', {}, documentation));
|
|
156839
156839
|
}
|
|
156840
156840
|
if (signature.documentation === undefined) ;
|
|
156841
156841
|
else if (typeof signature.documentation === 'string') {
|
|
156842
|
-
append$1(this.domNodes.docs,
|
|
156842
|
+
append$1(this.domNodes.docs, $$1('p', {}, signature.documentation));
|
|
156843
156843
|
}
|
|
156844
156844
|
else {
|
|
156845
156845
|
const renderedContents = this.renderMarkdownDocs(signature.documentation);
|
|
@@ -160638,7 +160638,7 @@ let Link = class Link extends Disposable {
|
|
|
160638
160638
|
super();
|
|
160639
160639
|
this._link = _link;
|
|
160640
160640
|
this._enabled = true;
|
|
160641
|
-
this.el = append$1(container, $$
|
|
160641
|
+
this.el = append$1(container, $$e('a.monaco-link', {
|
|
160642
160642
|
tabIndex: (_a = _link.tabIndex) !== null && _a !== void 0 ? _a : 0,
|
|
160643
160643
|
href: _link.href,
|
|
160644
160644
|
title: _link.title
|
|
@@ -160709,7 +160709,7 @@ let Banner = class Banner extends Disposable {
|
|
|
160709
160709
|
super();
|
|
160710
160710
|
this.instantiationService = instantiationService;
|
|
160711
160711
|
this.markdownRenderer = this.instantiationService.createInstance(MarkdownRenderer, {});
|
|
160712
|
-
this.element = $$
|
|
160712
|
+
this.element = $$e('div.editor-banner');
|
|
160713
160713
|
this.element.tabIndex = 0;
|
|
160714
160714
|
}
|
|
160715
160715
|
getAriaLabel(item) {
|
|
@@ -160723,7 +160723,7 @@ let Banner = class Banner extends Disposable {
|
|
|
160723
160723
|
}
|
|
160724
160724
|
getBannerMessage(message) {
|
|
160725
160725
|
if (typeof message === 'string') {
|
|
160726
|
-
const element = $$
|
|
160726
|
+
const element = $$e('span');
|
|
160727
160727
|
element.innerText = message;
|
|
160728
160728
|
return element;
|
|
160729
160729
|
}
|
|
@@ -160741,24 +160741,24 @@ let Banner = class Banner extends Disposable {
|
|
|
160741
160741
|
this.element.setAttribute('aria-label', ariaLabel);
|
|
160742
160742
|
}
|
|
160743
160743
|
// Icon
|
|
160744
|
-
const iconContainer = append$1(this.element, $$
|
|
160744
|
+
const iconContainer = append$1(this.element, $$e('div.icon-container'));
|
|
160745
160745
|
iconContainer.setAttribute('aria-hidden', 'true');
|
|
160746
160746
|
if (item.icon) {
|
|
160747
|
-
iconContainer.appendChild($$
|
|
160747
|
+
iconContainer.appendChild($$e(`div${ThemeIcon.asCSSSelector(item.icon)}`));
|
|
160748
160748
|
}
|
|
160749
160749
|
// Message
|
|
160750
|
-
const messageContainer = append$1(this.element, $$
|
|
160750
|
+
const messageContainer = append$1(this.element, $$e('div.message-container'));
|
|
160751
160751
|
messageContainer.setAttribute('aria-hidden', 'true');
|
|
160752
160752
|
messageContainer.appendChild(this.getBannerMessage(item.message));
|
|
160753
160753
|
// Message Actions
|
|
160754
|
-
this.messageActionsContainer = append$1(this.element, $$
|
|
160754
|
+
this.messageActionsContainer = append$1(this.element, $$e('div.message-actions-container'));
|
|
160755
160755
|
if (item.actions) {
|
|
160756
160756
|
for (const action of item.actions) {
|
|
160757
160757
|
this._register(this.instantiationService.createInstance(Link, this.messageActionsContainer, Object.assign(Object.assign({}, action), { tabIndex: -1 }), {}));
|
|
160758
160758
|
}
|
|
160759
160759
|
}
|
|
160760
160760
|
// Action
|
|
160761
|
-
const actionBarContainer = append$1(this.element, $$
|
|
160761
|
+
const actionBarContainer = append$1(this.element, $$e('div.action-container'));
|
|
160762
160762
|
this.actionBar = this._register(new ActionBar(actionBarContainer));
|
|
160763
160763
|
this.actionBar.push(this._register(new Action('banner.close', 'Close Banner', ThemeIcon.asClassName(widgetClose), true, () => {
|
|
160764
160764
|
if (typeof item.onClose === 'function') {
|
|
@@ -162854,13 +162854,13 @@ class InspectTokensWidget extends Disposable {
|
|
|
162854
162854
|
const tokenEndIndex = token1Index + 1 < data.tokens1.length ? data.tokens1[token1Index + 1].offset : lineContent.length;
|
|
162855
162855
|
tokenText = lineContent.substring(tokenStartIndex, tokenEndIndex);
|
|
162856
162856
|
}
|
|
162857
|
-
reset(this._domNode, $$
|
|
162858
|
-
append$1(this._domNode, $$
|
|
162857
|
+
reset(this._domNode, $$e('h2.tm-token', undefined, renderTokenText(tokenText), $$e('span.tm-token-length', undefined, `${tokenText.length} ${tokenText.length === 1 ? 'char' : 'chars'}`)));
|
|
162858
|
+
append$1(this._domNode, $$e('hr.tokens-inspect-separator', { 'style': 'clear:both' }));
|
|
162859
162859
|
const metadata = (token2Index << 1) + 1 < data.tokens2.length ? this._decodeMetadata(data.tokens2[(token2Index << 1) + 1]) : null;
|
|
162860
|
-
append$1(this._domNode, $$
|
|
162861
|
-
append$1(this._domNode, $$
|
|
162860
|
+
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) : '-?-'}`)))));
|
|
162861
|
+
append$1(this._domNode, $$e('hr.tokens-inspect-separator'));
|
|
162862
162862
|
if (token1Index < data.tokens1.length) {
|
|
162863
|
-
append$1(this._domNode, $$
|
|
162863
|
+
append$1(this._domNode, $$e('span.tm-token-type', undefined, data.tokens1[token1Index].type));
|
|
162864
162864
|
}
|
|
162865
162865
|
this._editor.layoutContentWidget(this);
|
|
162866
162866
|
}
|
|
@@ -167250,97 +167250,97 @@ async function importRequest() {
|
|
|
167250
167250
|
}
|
|
167251
167251
|
|
|
167252
167252
|
async function newPortalItem(definition) {
|
|
167253
|
-
|
|
167254
|
-
|
|
167253
|
+
const PortalItem = await importPortalPortalItem();
|
|
167254
|
+
return new PortalItem(definition);
|
|
167255
167255
|
}
|
|
167256
167256
|
async function newFeatureLayer(definition) {
|
|
167257
|
-
|
|
167258
|
-
|
|
167259
|
-
|
|
167257
|
+
const FeatureLayer = await importLayersFeatureLayer();
|
|
167258
|
+
// Fix title for the layer. Instead of defaulting to the map viewer style.
|
|
167259
|
+
return new FeatureLayer({ ...definition, sublayerTitleMode: "service-name" });
|
|
167260
167260
|
}
|
|
167261
167261
|
async function newWebMap(definition) {
|
|
167262
|
-
|
|
167263
|
-
|
|
167262
|
+
const WebMap = await importWebMap();
|
|
167263
|
+
return new WebMap(definition);
|
|
167264
167264
|
}
|
|
167265
167265
|
function isSupportedLayerInstance(item) {
|
|
167266
|
-
|
|
167267
|
-
|
|
167268
|
-
|
|
167269
|
-
|
|
167266
|
+
return (!!item &&
|
|
167267
|
+
typeof item === "object" &&
|
|
167268
|
+
typeof item.declaredClass === "string" &&
|
|
167269
|
+
item.declaredClass.startsWith("esri.layers."));
|
|
167270
167270
|
}
|
|
167271
167271
|
function isFeatureSetInstance(item) {
|
|
167272
|
-
|
|
167273
|
-
|
|
167274
|
-
|
|
167275
|
-
|
|
167272
|
+
return (!!item &&
|
|
167273
|
+
typeof item === "object" &&
|
|
167274
|
+
typeof item.declaredClass === "string" &&
|
|
167275
|
+
item.declaredClass === "esri.rest.support.FeatureSet");
|
|
167276
167276
|
}
|
|
167277
167277
|
function isFeatureLayerInstance(item) {
|
|
167278
|
-
|
|
167279
|
-
|
|
167280
|
-
|
|
167281
|
-
|
|
167278
|
+
return (!!item &&
|
|
167279
|
+
typeof item === "object" &&
|
|
167280
|
+
typeof item.declaredClass === "string" &&
|
|
167281
|
+
item.declaredClass === "esri.layers.FeatureLayer");
|
|
167282
167282
|
}
|
|
167283
167283
|
function isGroupLayerInstance(item) {
|
|
167284
|
-
|
|
167285
|
-
|
|
167286
|
-
|
|
167287
|
-
|
|
167284
|
+
return (!!item &&
|
|
167285
|
+
typeof item === "object" &&
|
|
167286
|
+
typeof item.declaredClass === "string" &&
|
|
167287
|
+
item.declaredClass === "esri.layers.GroupLayer");
|
|
167288
167288
|
}
|
|
167289
167289
|
function isWebMapInstance(item) {
|
|
167290
|
-
|
|
167290
|
+
return (!!item && typeof item === "object" && typeof item.declaredClass === "string" && item.declaredClass === "esri.WebMap");
|
|
167291
167291
|
}
|
|
167292
167292
|
function isPortalItemDefinition(item) {
|
|
167293
|
-
|
|
167293
|
+
return !!item && typeof item === "object" && item.portalItem != null;
|
|
167294
167294
|
}
|
|
167295
167295
|
function isFeatureLayerItemDefinition(item) {
|
|
167296
|
-
|
|
167296
|
+
return !!item && typeof item === "object" && item.portalItem != null;
|
|
167297
167297
|
}
|
|
167298
167298
|
function isFieldsDefinition(item) {
|
|
167299
|
-
|
|
167299
|
+
return !!item && typeof item === "object" && Array.isArray(item.fields) && !("declaredClass" in item);
|
|
167300
167300
|
}
|
|
167301
167301
|
function isUrlDefinition(item) {
|
|
167302
|
-
|
|
167302
|
+
return !!item && typeof item === "object" && typeof item.url === "string" && !("declaredClass" in item);
|
|
167303
167303
|
}
|
|
167304
167304
|
function isPredefinedProfile(item) {
|
|
167305
|
-
|
|
167306
|
-
|
|
167307
|
-
|
|
167308
|
-
|
|
167309
|
-
|
|
167305
|
+
return (!!item &&
|
|
167306
|
+
typeof item === "object" &&
|
|
167307
|
+
typeof item.id === "string" &&
|
|
167308
|
+
typeof item.definitions === "object" &&
|
|
167309
|
+
!Array.isArray(item.definitions));
|
|
167310
167310
|
}
|
|
167311
167311
|
|
|
167312
|
-
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
|
|
167312
|
+
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}}
|
|
167313
167313
|
|
|
167314
167314
|
/**
|
|
167315
167315
|
* Filters a collection of items by the given keys and filter word.
|
|
167316
167316
|
*/
|
|
167317
167317
|
function filterCollection(collection, keys, filterWord, beforeFilteringFn) {
|
|
167318
|
-
|
|
167319
|
-
|
|
167320
|
-
}
|
|
167321
|
-
const _keys = !Array.isArray(keys) ? [keys] : keys;
|
|
167322
|
-
if (!_keys.length) {
|
|
167323
|
-
return [];
|
|
167324
|
-
}
|
|
167325
|
-
const filterExpression = B(filterWord);
|
|
167326
|
-
return collection.filter((item) => {
|
|
167327
|
-
if (beforeFilteringFn) {
|
|
167328
|
-
const res = beforeFilteringFn(item);
|
|
167329
|
-
if (res !== null || res !== undefined) {
|
|
167330
|
-
return res;
|
|
167331
|
-
}
|
|
167318
|
+
if (!keys) {
|
|
167319
|
+
return [];
|
|
167332
167320
|
}
|
|
167333
|
-
|
|
167334
|
-
|
|
167321
|
+
const _keys = !Array.isArray(keys) ? [keys] : keys;
|
|
167322
|
+
if (!_keys.length) {
|
|
167323
|
+
return [];
|
|
167324
|
+
}
|
|
167325
|
+
const filterExpression = B(filterWord);
|
|
167326
|
+
return collection.filter((item) => {
|
|
167327
|
+
if (beforeFilteringFn) {
|
|
167328
|
+
const res = beforeFilteringFn(item);
|
|
167329
|
+
if (res !== null || res !== undefined) {
|
|
167330
|
+
return res;
|
|
167331
|
+
}
|
|
167332
|
+
}
|
|
167333
|
+
return _keys.some((key) => filterExpression.test(`${item[key] ?? ""}`));
|
|
167334
|
+
});
|
|
167335
167335
|
}
|
|
167336
167336
|
/**
|
|
167337
167337
|
* Returns the url to the portal item.
|
|
167338
167338
|
*/
|
|
167339
167339
|
function portalItemPageUrl(portalItem) {
|
|
167340
|
-
|
|
167341
|
-
|
|
167342
|
-
|
|
167343
|
-
|
|
167340
|
+
if (!portalItem) {
|
|
167341
|
+
return "";
|
|
167342
|
+
}
|
|
167343
|
+
return `${portalItem.portal.url}/home/item.html?id=${portalItem.id}`;
|
|
167344
167344
|
}
|
|
167345
167345
|
//#endregion
|
|
167346
167346
|
|
|
@@ -167348,417 +167348,417 @@ function portalItemPageUrl(portalItem) {
|
|
|
167348
167348
|
* Returns an icon name for the field type
|
|
167349
167349
|
*/
|
|
167350
167350
|
function fieldTypeToIconName(field) {
|
|
167351
|
-
|
|
167352
|
-
|
|
167353
|
-
|
|
167354
|
-
|
|
167355
|
-
|
|
167356
|
-
|
|
167357
|
-
|
|
167358
|
-
|
|
167359
|
-
|
|
167360
|
-
|
|
167361
|
-
|
|
167362
|
-
|
|
167363
|
-
|
|
167364
|
-
|
|
167365
|
-
|
|
167366
|
-
|
|
167367
|
-
|
|
167368
|
-
|
|
167369
|
-
|
|
167370
|
-
|
|
167371
|
-
|
|
167372
|
-
|
|
167373
|
-
|
|
167374
|
-
|
|
167375
|
-
|
|
167376
|
-
|
|
167351
|
+
switch (field?.type) {
|
|
167352
|
+
case "oid":
|
|
167353
|
+
return "key";
|
|
167354
|
+
case "small-integer":
|
|
167355
|
+
case "big-integer":
|
|
167356
|
+
case "integer":
|
|
167357
|
+
case "single":
|
|
167358
|
+
case "double":
|
|
167359
|
+
case "long":
|
|
167360
|
+
return "number";
|
|
167361
|
+
case "global-id":
|
|
167362
|
+
case "guid":
|
|
167363
|
+
return "key";
|
|
167364
|
+
case "string":
|
|
167365
|
+
return "string";
|
|
167366
|
+
case "date":
|
|
167367
|
+
return "date-time";
|
|
167368
|
+
case "date-only":
|
|
167369
|
+
return "calendar";
|
|
167370
|
+
case "time-only":
|
|
167371
|
+
return "clock";
|
|
167372
|
+
case "timestamp-offset":
|
|
167373
|
+
return "time-zone";
|
|
167374
|
+
default:
|
|
167375
|
+
return "cube";
|
|
167376
|
+
}
|
|
167377
167377
|
}
|
|
167378
167378
|
/**
|
|
167379
167379
|
* Returns the Arcade type for the given field.
|
|
167380
167380
|
*/
|
|
167381
167381
|
function fieldTypeToArcadeType(field) {
|
|
167382
|
-
|
|
167383
|
-
|
|
167384
|
-
|
|
167385
|
-
|
|
167386
|
-
|
|
167387
|
-
|
|
167388
|
-
|
|
167389
|
-
|
|
167390
|
-
|
|
167391
|
-
|
|
167392
|
-
|
|
167393
|
-
|
|
167394
|
-
|
|
167395
|
-
|
|
167396
|
-
|
|
167397
|
-
|
|
167398
|
-
|
|
167399
|
-
|
|
167400
|
-
|
|
167401
|
-
|
|
167402
|
-
|
|
167403
|
-
|
|
167382
|
+
switch (field?.type) {
|
|
167383
|
+
case "small-integer":
|
|
167384
|
+
case "integer":
|
|
167385
|
+
case "big-integer":
|
|
167386
|
+
case "single":
|
|
167387
|
+
case "double":
|
|
167388
|
+
case "long":
|
|
167389
|
+
case "oid":
|
|
167390
|
+
return "number";
|
|
167391
|
+
case "global-id":
|
|
167392
|
+
case "guid":
|
|
167393
|
+
case "string":
|
|
167394
|
+
return "text";
|
|
167395
|
+
case "date":
|
|
167396
|
+
return "date";
|
|
167397
|
+
case "date-only":
|
|
167398
|
+
return "dateOnly";
|
|
167399
|
+
case "time-only":
|
|
167400
|
+
return "time";
|
|
167401
|
+
default:
|
|
167402
|
+
return "text";
|
|
167403
|
+
}
|
|
167404
167404
|
}
|
|
167405
167405
|
function supportedFields(fields) {
|
|
167406
|
-
|
|
167407
|
-
|
|
167408
|
-
|
|
167409
|
-
|
|
167410
|
-
|
|
167411
|
-
|
|
167412
|
-
|
|
167413
|
-
|
|
167414
|
-
|
|
167415
|
-
|
|
167416
|
-
|
|
167417
|
-
|
|
167418
|
-
|
|
167419
|
-
|
|
167420
|
-
|
|
167421
|
-
|
|
167422
|
-
|
|
167423
|
-
|
|
167424
|
-
|
|
167425
|
-
|
|
167426
|
-
|
|
167406
|
+
return (fields ?? []).filter((field) => {
|
|
167407
|
+
switch (field.type) {
|
|
167408
|
+
case "string":
|
|
167409
|
+
case "small-integer":
|
|
167410
|
+
case "integer":
|
|
167411
|
+
case "big-integer":
|
|
167412
|
+
case "single":
|
|
167413
|
+
case "double":
|
|
167414
|
+
case "long":
|
|
167415
|
+
case "date":
|
|
167416
|
+
case "date-only":
|
|
167417
|
+
case "time-only":
|
|
167418
|
+
case "timestamp-offset":
|
|
167419
|
+
case "oid":
|
|
167420
|
+
case "guid":
|
|
167421
|
+
case "global-id":
|
|
167422
|
+
return true;
|
|
167423
|
+
default:
|
|
167424
|
+
return false;
|
|
167425
|
+
}
|
|
167426
|
+
});
|
|
167427
167427
|
}
|
|
167428
167428
|
|
|
167429
167429
|
function resolveIntlPath(dictionary, path) {
|
|
167430
|
-
|
|
167431
|
-
|
|
167432
|
-
|
|
167433
|
-
|
|
167434
|
-
|
|
167435
|
-
|
|
167436
|
-
|
|
167437
|
-
|
|
167438
|
-
|
|
167439
|
-
|
|
167440
|
-
|
|
167441
|
-
|
|
167430
|
+
if (!dictionary) {
|
|
167431
|
+
return "";
|
|
167432
|
+
}
|
|
167433
|
+
const pathSegments = path.split(".");
|
|
167434
|
+
let pathSegment = pathSegments.shift();
|
|
167435
|
+
let entry = dictionary;
|
|
167436
|
+
while (entry && pathSegment) {
|
|
167437
|
+
// @ts-expect-error
|
|
167438
|
+
entry = entry[pathSegment];
|
|
167439
|
+
pathSegment = pathSegments.shift();
|
|
167440
|
+
}
|
|
167441
|
+
return typeof entry === "string" ? entry : path;
|
|
167442
167442
|
}
|
|
167443
167443
|
function isTypesCapabaleLayer(item) {
|
|
167444
|
-
|
|
167444
|
+
return !!item?.typeIdField;
|
|
167445
167445
|
}
|
|
167446
167446
|
function isDomainsCapableLayer(item) {
|
|
167447
|
-
|
|
167447
|
+
return typeof item?.getFieldDomain === "function";
|
|
167448
167448
|
}
|
|
167449
167449
|
function isRelationshipsCapableLayer(item) {
|
|
167450
|
-
|
|
167450
|
+
return Array.isArray(item?.relationships) && typeof item?.url === "string";
|
|
167451
167451
|
}
|
|
167452
167452
|
function isTableCapableLayer(item) {
|
|
167453
|
-
|
|
167453
|
+
return typeof item?.isTable === "boolean";
|
|
167454
167454
|
}
|
|
167455
167455
|
function isLoadableSource(item) {
|
|
167456
|
-
|
|
167456
|
+
return typeof item?.load === "function";
|
|
167457
167457
|
}
|
|
167458
167458
|
//#endregion
|
|
167459
167459
|
//#region Support Functions
|
|
167460
167460
|
async function getRelatedFeatureLayer(layer, relationship) {
|
|
167461
|
-
|
|
167462
|
-
|
|
167463
|
-
}
|
|
167464
|
-
const url = `${layer.url}/${relationship.relatedTableId}`;
|
|
167465
|
-
const relatedFeatureLayer = await supportedSourceFromDefinition({ url });
|
|
167466
|
-
if (!isFeatureLayerInstance(relatedFeatureLayer)) {
|
|
167467
|
-
return null;
|
|
167468
|
-
}
|
|
167469
|
-
return relatedFeatureLayer;
|
|
167470
|
-
}
|
|
167471
|
-
function sortFields(layer) {
|
|
167472
|
-
return (firstField, secondField) => {
|
|
167473
|
-
if (firstField.type === "oid") {
|
|
167474
|
-
return -1;
|
|
167475
|
-
}
|
|
167476
|
-
if (secondField.type === "oid") {
|
|
167477
|
-
return 1;
|
|
167461
|
+
if (!relationship) {
|
|
167462
|
+
return null;
|
|
167478
167463
|
}
|
|
167479
|
-
|
|
167480
|
-
|
|
167481
|
-
|
|
167482
|
-
|
|
167483
|
-
if (secondField.name === layer.typeIdField) {
|
|
167484
|
-
return 1;
|
|
167485
|
-
}
|
|
167464
|
+
const url = `${layer.url}/${relationship.relatedTableId}`;
|
|
167465
|
+
const relatedFeatureLayer = await supportedSourceFromDefinition({ url });
|
|
167466
|
+
if (!isFeatureLayerInstance(relatedFeatureLayer)) {
|
|
167467
|
+
return null;
|
|
167486
167468
|
}
|
|
167487
|
-
return
|
|
167488
|
-
|
|
167469
|
+
return relatedFeatureLayer;
|
|
167470
|
+
}
|
|
167471
|
+
function sortFields(layer) {
|
|
167472
|
+
return (firstField, secondField) => {
|
|
167473
|
+
if (firstField.type === "oid") {
|
|
167474
|
+
return -1;
|
|
167475
|
+
}
|
|
167476
|
+
if (secondField.type === "oid") {
|
|
167477
|
+
return 1;
|
|
167478
|
+
}
|
|
167479
|
+
if (isTypesCapabaleLayer(layer)) {
|
|
167480
|
+
if (firstField.name === layer.typeIdField) {
|
|
167481
|
+
return -1;
|
|
167482
|
+
}
|
|
167483
|
+
if (secondField.name === layer.typeIdField) {
|
|
167484
|
+
return 1;
|
|
167485
|
+
}
|
|
167486
|
+
}
|
|
167487
|
+
return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
|
|
167488
|
+
};
|
|
167489
167489
|
}
|
|
167490
167490
|
function getSubtypesProperties(profile, types, field) {
|
|
167491
|
-
|
|
167492
|
-
|
|
167493
|
-
|
|
167494
|
-
|
|
167495
|
-
|
|
167496
|
-
|
|
167497
|
-
|
|
167498
|
-
|
|
167491
|
+
// Try the coded domain first
|
|
167492
|
+
const group = getDomainValuesProperties(profile, field.domain, { code: "subtypes" });
|
|
167493
|
+
if (group) {
|
|
167494
|
+
return group;
|
|
167495
|
+
}
|
|
167496
|
+
// No coded domain for the subtypes, we will manufacture it
|
|
167497
|
+
const values = types.map((t) => new ValueVariable({ profile, label: `${t.id}`, description: t.name, snippet: `"${t.id}"` }));
|
|
167498
|
+
return new GroupOfVariables(profile, { code: "subtypes" }, values);
|
|
167499
167499
|
}
|
|
167500
167500
|
function getDomainValuesProperties(profile, domain, label) {
|
|
167501
|
-
|
|
167502
|
-
|
|
167503
|
-
|
|
167504
|
-
|
|
167505
|
-
|
|
167506
|
-
|
|
167507
|
-
|
|
167508
|
-
|
|
167509
|
-
|
|
167510
|
-
|
|
167511
|
-
|
|
167501
|
+
if (!domain || domain.type !== "coded-value") {
|
|
167502
|
+
return null;
|
|
167503
|
+
}
|
|
167504
|
+
const values = domain.codedValues.map((v) => new ValueVariable({
|
|
167505
|
+
profile,
|
|
167506
|
+
label: `${v.code}`,
|
|
167507
|
+
description: v.name,
|
|
167508
|
+
snippet: `"${v.code}"`,
|
|
167509
|
+
filterDescription: true
|
|
167510
|
+
}));
|
|
167511
|
+
return new GroupOfVariables(profile, label, values);
|
|
167512
167512
|
}
|
|
167513
167513
|
function getDomainValuesBySubtypeGroup(profile, types, field) {
|
|
167514
|
-
|
|
167515
|
-
|
|
167516
|
-
|
|
167517
|
-
|
|
167518
|
-
|
|
167519
|
-
|
|
167520
|
-
|
|
167521
|
-
|
|
167522
|
-
|
|
167523
|
-
|
|
167524
|
-
|
|
167525
|
-
|
|
167526
|
-
|
|
167527
|
-
|
|
167528
|
-
|
|
167529
|
-
|
|
167514
|
+
const variables = [];
|
|
167515
|
+
types.forEach((t) => {
|
|
167516
|
+
let domain = t.domains?.[field.name];
|
|
167517
|
+
if (!domain) {
|
|
167518
|
+
return;
|
|
167519
|
+
}
|
|
167520
|
+
if (domain.type === "inherited") {
|
|
167521
|
+
domain = field.domain;
|
|
167522
|
+
return;
|
|
167523
|
+
}
|
|
167524
|
+
const domainValuesGroup = getDomainValuesProperties(profile, domain, {
|
|
167525
|
+
code: "domainvaluesfortypeformat",
|
|
167526
|
+
formatValues: {
|
|
167527
|
+
fieldName: field.alias ?? field.name,
|
|
167528
|
+
typeName: t.name
|
|
167529
|
+
}
|
|
167530
|
+
});
|
|
167531
|
+
if (!domainValuesGroup) {
|
|
167532
|
+
return;
|
|
167533
|
+
}
|
|
167534
|
+
const label = `${t.id}`;
|
|
167535
|
+
const snippet = `"${t.id}""`;
|
|
167536
|
+
const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
|
|
167537
|
+
subtypeDictionary.variables = [domainValuesGroup];
|
|
167538
|
+
variables.push(subtypeDictionary);
|
|
167530
167539
|
});
|
|
167531
|
-
if (!
|
|
167532
|
-
|
|
167540
|
+
if (!variables.length) {
|
|
167541
|
+
return null;
|
|
167533
167542
|
}
|
|
167534
|
-
|
|
167535
|
-
const snippet = `"${t.id}""`;
|
|
167536
|
-
const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
|
|
167537
|
-
subtypeDictionary.variables = [domainValuesGroup];
|
|
167538
|
-
variables.push(subtypeDictionary);
|
|
167539
|
-
});
|
|
167540
|
-
if (!variables.length) {
|
|
167541
|
-
return null;
|
|
167542
|
-
}
|
|
167543
|
-
return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
|
|
167543
|
+
return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
|
|
167544
167544
|
}
|
|
167545
167545
|
// const validIdentifierExpr = new RegExp(/^[a-z_$][\w$]*$/gi);
|
|
167546
|
-
const validIdentifierExpr =
|
|
167546
|
+
const validIdentifierExpr = /^[a-z_$][a-z0-9_$]*$/giu;
|
|
167547
167547
|
function getMemberExpressionProperty(prop, includeDot = true) {
|
|
167548
|
-
|
|
167549
|
-
|
|
167550
|
-
|
|
167551
|
-
|
|
167548
|
+
if (prop.match(validIdentifierExpr)) {
|
|
167549
|
+
return `${includeDot ? "." : ""}${prop}`;
|
|
167550
|
+
}
|
|
167551
|
+
return `["${prop}"]`;
|
|
167552
167552
|
}
|
|
167553
167553
|
function assembleMemberExpression(obj, prop) {
|
|
167554
|
-
|
|
167555
|
-
|
|
167556
|
-
|
|
167557
|
-
|
|
167554
|
+
if (!obj) {
|
|
167555
|
+
return prop;
|
|
167556
|
+
}
|
|
167557
|
+
return `${obj}${getMemberExpressionProperty(prop)}`;
|
|
167558
167558
|
}
|
|
167559
167559
|
//#endregion
|
|
167560
167560
|
//#region Sources
|
|
167561
167561
|
async function supportedSourceFromDefinition(definition) {
|
|
167562
|
-
|
|
167563
|
-
|
|
167564
|
-
}
|
|
167565
|
-
let source = null;
|
|
167566
|
-
if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
|
|
167567
|
-
source = definition;
|
|
167568
|
-
}
|
|
167569
|
-
else {
|
|
167570
|
-
source = await newFeatureLayer(definition);
|
|
167571
|
-
if (!isFeatureLayerInstance(source)) {
|
|
167572
|
-
console.error("Invalid FeatureSetDefinition", definition);
|
|
167573
|
-
return null;
|
|
167562
|
+
if (!definition) {
|
|
167563
|
+
return null;
|
|
167574
167564
|
}
|
|
167575
|
-
|
|
167576
|
-
|
|
167577
|
-
|
|
167578
|
-
|
|
167579
|
-
|
|
167580
|
-
|
|
167581
|
-
|
|
167582
|
-
|
|
167583
|
-
|
|
167565
|
+
let source = null;
|
|
167566
|
+
if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
|
|
167567
|
+
source = definition;
|
|
167568
|
+
}
|
|
167569
|
+
else {
|
|
167570
|
+
source = await newFeatureLayer(definition);
|
|
167571
|
+
if (!isFeatureLayerInstance(source)) {
|
|
167572
|
+
console.error("Invalid FeatureSetDefinition", definition);
|
|
167573
|
+
return null;
|
|
167574
|
+
}
|
|
167575
|
+
}
|
|
167576
|
+
if (!source) {
|
|
167577
|
+
console.error("Invalid FeatureSetDefinition", definition);
|
|
167578
|
+
return null;
|
|
167579
|
+
}
|
|
167580
|
+
if (isLoadableSource(source)) {
|
|
167581
|
+
await source.load();
|
|
167582
|
+
}
|
|
167583
|
+
return source;
|
|
167584
167584
|
}
|
|
167585
167585
|
async function serviceMetaData(url) {
|
|
167586
|
-
|
|
167587
|
-
|
|
167588
|
-
|
|
167589
|
-
|
|
167590
|
-
|
|
167591
|
-
|
|
167592
|
-
|
|
167593
|
-
|
|
167594
|
-
|
|
167595
|
-
|
|
167596
|
-
|
|
167586
|
+
url += "/layers";
|
|
167587
|
+
const request = await importRequest();
|
|
167588
|
+
const response = await request(url, { responseType: "json", query: { f: "json" } });
|
|
167589
|
+
const data = {
|
|
167590
|
+
layers: response.data?.layers ?? [],
|
|
167591
|
+
tables: response.data?.tables ?? []
|
|
167592
|
+
};
|
|
167593
|
+
const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
|
|
167594
|
+
const layers = filterFeatureLayerInfos(data.layers, queryCapability);
|
|
167595
|
+
const tables = filterFeatureLayerInfos(data.tables, queryCapability);
|
|
167596
|
+
return { layers, tables };
|
|
167597
167597
|
}
|
|
167598
167598
|
function filterFeatureLayerInfos(layers, queryCapability) {
|
|
167599
|
-
|
|
167600
|
-
|
|
167601
|
-
|
|
167602
|
-
|
|
167603
|
-
|
|
167604
|
-
|
|
167605
|
-
|
|
167606
|
-
|
|
167607
|
-
|
|
167608
|
-
|
|
167609
|
-
|
|
167610
|
-
|
|
167599
|
+
return layers.filter((layer) => {
|
|
167600
|
+
if (layer.type !== "Feature Layer" && layer.type !== "Table") {
|
|
167601
|
+
return false;
|
|
167602
|
+
}
|
|
167603
|
+
const capabilities = layer.capabilities
|
|
167604
|
+
? layer.capabilities
|
|
167605
|
+
.toLowerCase()
|
|
167606
|
+
.split(",")
|
|
167607
|
+
.map((value) => value.trim())
|
|
167608
|
+
: [];
|
|
167609
|
+
return capabilities.includes(queryCapability);
|
|
167610
|
+
});
|
|
167611
167611
|
}
|
|
167612
167612
|
//#endregion
|
|
167613
167613
|
//#region Functions to Editor Variables to a language service variables
|
|
167614
167614
|
async function variablesToLSVariable(editorVariables, kind = main.CompletionItemKind.Variable) {
|
|
167615
|
-
|
|
167616
|
-
|
|
167617
|
-
|
|
167618
|
-
|
|
167619
|
-
|
|
167620
|
-
|
|
167621
|
-
|
|
167622
|
-
|
|
167623
|
-
|
|
167624
|
-
|
|
167625
|
-
|
|
167626
|
-
|
|
167627
|
-
|
|
167628
|
-
|
|
167615
|
+
if (!editorVariables) {
|
|
167616
|
+
return [];
|
|
167617
|
+
}
|
|
167618
|
+
const properties = await Promise.all(editorVariables.map(async (editorVariable) => {
|
|
167619
|
+
switch (editorVariable.type) {
|
|
167620
|
+
case "dictionary":
|
|
167621
|
+
return dictionaryToLSDictionary(editorVariable, kind);
|
|
167622
|
+
case "feature":
|
|
167623
|
+
return featureToLSFeature(editorVariable, kind);
|
|
167624
|
+
default:
|
|
167625
|
+
return variableToLSVariable(editorVariable, kind);
|
|
167626
|
+
}
|
|
167627
|
+
}));
|
|
167628
|
+
return properties.filter((p) => p);
|
|
167629
167629
|
}
|
|
167630
167630
|
function variableToLSVariable(editorVariable, kind) {
|
|
167631
|
-
|
|
167632
|
-
|
|
167633
|
-
|
|
167634
|
-
|
|
167635
|
-
|
|
167636
|
-
|
|
167637
|
-
|
|
167638
|
-
|
|
167639
|
-
|
|
167640
|
-
|
|
167641
|
-
|
|
167642
|
-
|
|
167643
|
-
|
|
167644
|
-
|
|
167645
|
-
|
|
167646
|
-
|
|
167631
|
+
const { name, type } = editorVariable;
|
|
167632
|
+
const description = editorVariable.getDescription();
|
|
167633
|
+
return {
|
|
167634
|
+
name,
|
|
167635
|
+
description,
|
|
167636
|
+
type,
|
|
167637
|
+
completion: {
|
|
167638
|
+
label: name,
|
|
167639
|
+
detail: name,
|
|
167640
|
+
insertText: name,
|
|
167641
|
+
insertTextMode: main.InsertTextMode.asIs,
|
|
167642
|
+
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167643
|
+
kind,
|
|
167644
|
+
documentation: { kind: "markdown", value: description }
|
|
167645
|
+
}
|
|
167646
|
+
};
|
|
167647
167647
|
}
|
|
167648
167648
|
async function featureToLSFeature(editorFeature, kind) {
|
|
167649
|
-
|
|
167650
|
-
|
|
167651
|
-
|
|
167652
|
-
|
|
167653
|
-
|
|
167654
|
-
|
|
167655
|
-
|
|
167656
|
-
|
|
167657
|
-
insertTextMode: main.InsertTextMode.asIs,
|
|
167658
|
-
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167659
|
-
kind
|
|
167660
|
-
};
|
|
167661
|
-
const result = {
|
|
167662
|
-
name,
|
|
167663
|
-
description,
|
|
167664
|
-
type: "dictionary",
|
|
167665
|
-
properties: [],
|
|
167666
|
-
completion: resultCompletion
|
|
167667
|
-
};
|
|
167668
|
-
// No source definition, then it will be a feature without any known fields
|
|
167669
|
-
if (!source) {
|
|
167670
|
-
return result;
|
|
167671
|
-
}
|
|
167672
|
-
// Create properties for the fields and the aliases
|
|
167673
|
-
// Also improve the feature completion documentation
|
|
167674
|
-
let featureCompletionDescription = description;
|
|
167675
|
-
const fieldProfileValues = [];
|
|
167676
|
-
const aliasProfileValues = [];
|
|
167677
|
-
supportedFields(source.fields).forEach((field) => {
|
|
167678
|
-
let fieldCompletionDescription = `**${field.name}** \n${field.type}`;
|
|
167679
|
-
if (field.description) {
|
|
167680
|
-
fieldCompletionDescription += ` \n'${field.description}`;
|
|
167681
|
-
}
|
|
167682
|
-
if (featureCompletionDescription) {
|
|
167683
|
-
featureCompletionDescription += " \n \n";
|
|
167684
|
-
}
|
|
167685
|
-
featureCompletionDescription += `**${field.name}** (${field.alias ?? field.name}) \n${field.type}`;
|
|
167686
|
-
if (field.description) {
|
|
167687
|
-
featureCompletionDescription += ` \n'${field.description}`;
|
|
167688
|
-
}
|
|
167689
|
-
// The property for the field
|
|
167690
|
-
const type = fieldTypeToArcadeType(field);
|
|
167691
|
-
const insertText = getMemberExpressionProperty(field.name, false);
|
|
167692
|
-
fieldProfileValues.push({
|
|
167693
|
-
name: field.name,
|
|
167694
|
-
description: field.alias || field.name,
|
|
167695
|
-
type,
|
|
167696
|
-
completion: {
|
|
167697
|
-
label: field.name,
|
|
167698
|
-
detail: field.alias || field.name,
|
|
167699
|
-
insertText,
|
|
167649
|
+
// Get the source for the definition
|
|
167650
|
+
const source = await editorFeature.loadSource();
|
|
167651
|
+
const { name } = editorFeature;
|
|
167652
|
+
const description = editorFeature.getDescription();
|
|
167653
|
+
const resultCompletion = {
|
|
167654
|
+
label: name,
|
|
167655
|
+
detail: name,
|
|
167656
|
+
insertText: name,
|
|
167700
167657
|
insertTextMode: main.InsertTextMode.asIs,
|
|
167701
167658
|
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167702
|
-
kind
|
|
167703
|
-
|
|
167704
|
-
|
|
167705
|
-
|
|
167706
|
-
|
|
167707
|
-
|
|
167659
|
+
kind
|
|
167660
|
+
};
|
|
167661
|
+
const result = {
|
|
167662
|
+
name,
|
|
167663
|
+
description,
|
|
167664
|
+
type: "dictionary",
|
|
167665
|
+
properties: [],
|
|
167666
|
+
completion: resultCompletion
|
|
167667
|
+
};
|
|
167668
|
+
// No source definition, then it will be a feature without any known fields
|
|
167669
|
+
if (!source) {
|
|
167670
|
+
return result;
|
|
167708
167671
|
}
|
|
167709
|
-
//
|
|
167710
|
-
|
|
167711
|
-
|
|
167712
|
-
|
|
167713
|
-
|
|
167714
|
-
|
|
167715
|
-
|
|
167716
|
-
|
|
167717
|
-
|
|
167718
|
-
|
|
167719
|
-
|
|
167720
|
-
|
|
167721
|
-
|
|
167722
|
-
|
|
167723
|
-
|
|
167724
|
-
|
|
167725
|
-
|
|
167726
|
-
|
|
167672
|
+
// Create properties for the fields and the aliases
|
|
167673
|
+
// Also improve the feature completion documentation
|
|
167674
|
+
let featureCompletionDescription = description;
|
|
167675
|
+
const fieldProfileValues = [];
|
|
167676
|
+
const aliasProfileValues = [];
|
|
167677
|
+
supportedFields(source.fields).forEach((field) => {
|
|
167678
|
+
let fieldCompletionDescription = `**${field.name}** \n${field.type}`;
|
|
167679
|
+
if (field.description) {
|
|
167680
|
+
fieldCompletionDescription += ` \n'${field.description}`;
|
|
167681
|
+
}
|
|
167682
|
+
if (featureCompletionDescription) {
|
|
167683
|
+
featureCompletionDescription += " \n \n";
|
|
167684
|
+
}
|
|
167685
|
+
featureCompletionDescription += `**${field.name}** (${field.alias ?? field.name}) \n${field.type}`;
|
|
167686
|
+
if (field.description) {
|
|
167687
|
+
featureCompletionDescription += ` \n'${field.description}`;
|
|
167688
|
+
}
|
|
167689
|
+
// The property for the field
|
|
167690
|
+
const type = fieldTypeToArcadeType(field);
|
|
167691
|
+
const insertText = getMemberExpressionProperty(field.name, false);
|
|
167692
|
+
fieldProfileValues.push({
|
|
167693
|
+
name: field.name,
|
|
167694
|
+
description: field.alias || field.name,
|
|
167695
|
+
type,
|
|
167696
|
+
completion: {
|
|
167697
|
+
label: field.name,
|
|
167698
|
+
detail: field.alias || field.name,
|
|
167699
|
+
insertText,
|
|
167700
|
+
insertTextMode: main.InsertTextMode.asIs,
|
|
167701
|
+
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167702
|
+
kind: main.CompletionItemKind.Field,
|
|
167703
|
+
documentation: { kind: "markdown", value: fieldCompletionDescription }
|
|
167704
|
+
}
|
|
167705
|
+
});
|
|
167706
|
+
if (!field.alias || field.alias.toLowerCase() === field.name.toLowerCase()) {
|
|
167707
|
+
return;
|
|
167708
|
+
}
|
|
167709
|
+
// The property for the alias if different than the field name
|
|
167710
|
+
let aliasCompletionDescription = `**${field.alias}** \n${field.type}`;
|
|
167711
|
+
if (field.description) {
|
|
167712
|
+
aliasCompletionDescription += ` \n'${field.description}`;
|
|
167713
|
+
}
|
|
167714
|
+
aliasProfileValues.push({
|
|
167715
|
+
name: field.alias,
|
|
167716
|
+
description: field.name,
|
|
167717
|
+
type,
|
|
167718
|
+
completion: {
|
|
167719
|
+
label: field.alias,
|
|
167720
|
+
detail: field.name,
|
|
167721
|
+
insertText,
|
|
167722
|
+
insertTextMode: main.InsertTextMode.asIs,
|
|
167723
|
+
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167724
|
+
kind: main.CompletionItemKind.Field,
|
|
167725
|
+
documentation: { kind: "markdown", value: aliasCompletionDescription }
|
|
167726
|
+
}
|
|
167727
|
+
});
|
|
167727
167728
|
});
|
|
167728
|
-
|
|
167729
|
-
|
|
167730
|
-
|
|
167731
|
-
return result;
|
|
167729
|
+
result.properties = [...fieldProfileValues, ...aliasProfileValues];
|
|
167730
|
+
resultCompletion.documentation = { kind: "markdown", value: featureCompletionDescription };
|
|
167731
|
+
return result;
|
|
167732
167732
|
}
|
|
167733
167733
|
async function dictionaryToLSDictionary(editorDictionary, kind) {
|
|
167734
|
-
|
|
167735
|
-
|
|
167736
|
-
|
|
167737
|
-
|
|
167738
|
-
|
|
167739
|
-
|
|
167740
|
-
|
|
167741
|
-
|
|
167742
|
-
|
|
167743
|
-
|
|
167744
|
-
|
|
167745
|
-
|
|
167746
|
-
|
|
167747
|
-
|
|
167748
|
-
|
|
167749
|
-
|
|
167750
|
-
|
|
167751
|
-
|
|
167752
|
-
|
|
167753
|
-
|
|
167754
|
-
|
|
167755
|
-
|
|
167756
|
-
|
|
167757
|
-
|
|
167758
|
-
|
|
167759
|
-
|
|
167760
|
-
|
|
167761
|
-
|
|
167734
|
+
const { name, dictionaryVariables: variables } = editorDictionary;
|
|
167735
|
+
const description = editorDictionary.getDescription();
|
|
167736
|
+
const completionDescription = variables.reduce((previous, p) => {
|
|
167737
|
+
if (previous !== "") {
|
|
167738
|
+
previous += " \n \n";
|
|
167739
|
+
}
|
|
167740
|
+
previous += `**${p.name}** \n${p.type}`;
|
|
167741
|
+
const description = p.getDescription();
|
|
167742
|
+
if (description) {
|
|
167743
|
+
previous += ` \n${description}`;
|
|
167744
|
+
}
|
|
167745
|
+
return previous;
|
|
167746
|
+
}, description ?? "");
|
|
167747
|
+
return {
|
|
167748
|
+
name,
|
|
167749
|
+
description,
|
|
167750
|
+
type: "dictionary",
|
|
167751
|
+
properties: await variablesToLSVariable(variables, main.CompletionItemKind.Field),
|
|
167752
|
+
completion: {
|
|
167753
|
+
label: name,
|
|
167754
|
+
detail: name,
|
|
167755
|
+
insertText: name,
|
|
167756
|
+
insertTextMode: main.InsertTextMode.asIs,
|
|
167757
|
+
insertTextFormat: main.InsertTextFormat.PlainText,
|
|
167758
|
+
kind,
|
|
167759
|
+
documentation: { kind: "markdown", value: completionDescription }
|
|
167760
|
+
}
|
|
167761
|
+
};
|
|
167762
167762
|
}
|
|
167763
167763
|
/**
|
|
167764
167764
|
* Represents a item in the EditorProfile. The profile is converted into an optimized way for
|
|
@@ -167766,107 +167766,107 @@ async function dictionaryToLSDictionary(editorDictionary, kind) {
|
|
|
167766
167766
|
* structures are created such as groups.
|
|
167767
167767
|
*/
|
|
167768
167768
|
class ProfileItemBase {
|
|
167769
|
-
|
|
167770
|
-
|
|
167771
|
-
|
|
167772
|
-
|
|
167773
|
-
|
|
167774
|
-
}
|
|
167775
|
-
/**
|
|
167776
|
-
* Returns the label string.
|
|
167777
|
-
*/
|
|
167778
|
-
getLabel() {
|
|
167779
|
-
if (this._label == null) {
|
|
167780
|
-
return "";
|
|
167781
|
-
}
|
|
167782
|
-
if (typeof this._label === "string") {
|
|
167783
|
-
// Some of our variables can start with a $ sign.
|
|
167784
|
-
// If the component is under RTL, the string is messed up.
|
|
167785
|
-
// It is converted from $feature to feature$, This is not acceptable since the label
|
|
167786
|
-
// represents a variable name. We are adding in front of the $ sign a right to left mark.
|
|
167787
|
-
return q(this._label);
|
|
167788
|
-
}
|
|
167789
|
-
return H(this._profile?.intlStrings?.[this._label.code], this._label.formatValues);
|
|
167790
|
-
}
|
|
167791
|
-
/**
|
|
167792
|
-
* Returns the description string.
|
|
167793
|
-
*/
|
|
167794
|
-
getDescription() {
|
|
167795
|
-
if (this.description == null) {
|
|
167796
|
-
return "";
|
|
167769
|
+
constructor(_profile, _label, description) {
|
|
167770
|
+
this._profile = _profile;
|
|
167771
|
+
this._label = _label;
|
|
167772
|
+
this.description = description;
|
|
167773
|
+
this.filterDescription = false;
|
|
167797
167774
|
}
|
|
167798
|
-
|
|
167799
|
-
|
|
167775
|
+
/**
|
|
167776
|
+
* Returns the label string.
|
|
167777
|
+
*/
|
|
167778
|
+
getLabel() {
|
|
167779
|
+
if (this._label == null) {
|
|
167780
|
+
return "";
|
|
167781
|
+
}
|
|
167782
|
+
if (typeof this._label === "string") {
|
|
167783
|
+
// Some of our variables can start with a $ sign.
|
|
167784
|
+
// If the component is under RTL, the string is messed up.
|
|
167785
|
+
// It is converted from $feature to feature$, This is not acceptable since the label
|
|
167786
|
+
// represents a variable name. We are adding in front of the $ sign a right to left mark.
|
|
167787
|
+
return q(this._label);
|
|
167788
|
+
}
|
|
167789
|
+
return H(this._profile?.intlStrings?.[this._label.code], this._label.formatValues);
|
|
167800
167790
|
}
|
|
167801
|
-
|
|
167802
|
-
|
|
167803
|
-
|
|
167804
|
-
|
|
167805
|
-
|
|
167806
|
-
|
|
167807
|
-
|
|
167808
|
-
|
|
167791
|
+
/**
|
|
167792
|
+
* Returns the description string.
|
|
167793
|
+
*/
|
|
167794
|
+
getDescription() {
|
|
167795
|
+
if (this.description == null) {
|
|
167796
|
+
return "";
|
|
167797
|
+
}
|
|
167798
|
+
if (typeof this.description === "string") {
|
|
167799
|
+
return this.description;
|
|
167800
|
+
}
|
|
167801
|
+
return H(this._profile?.intlStrings?.[this.description.code ?? ""], this.description.formatValues);
|
|
167809
167802
|
}
|
|
167810
|
-
|
|
167811
|
-
|
|
167803
|
+
/**
|
|
167804
|
+
* Returns true if the item pass the filter test
|
|
167805
|
+
*/
|
|
167806
|
+
passFilter(filterExpression) {
|
|
167807
|
+
if (!filterExpression) {
|
|
167808
|
+
return true;
|
|
167809
|
+
}
|
|
167810
|
+
if (filterExpression.test(this.getLabel())) {
|
|
167811
|
+
return true;
|
|
167812
|
+
}
|
|
167813
|
+
return this.filterDescription && filterExpression.test(this.getDescription());
|
|
167812
167814
|
}
|
|
167813
|
-
return this.filterDescription && filterExpression.test(this.getDescription());
|
|
167814
|
-
}
|
|
167815
167815
|
}
|
|
167816
167816
|
/**
|
|
167817
167817
|
* The base class for profile variables representation in the EditorProfile.
|
|
167818
167818
|
*/
|
|
167819
167819
|
class VariableBase extends ProfileItemBase {
|
|
167820
|
-
|
|
167821
|
-
|
|
167822
|
-
|
|
167823
|
-
|
|
167824
|
-
|
|
167825
|
-
|
|
167826
|
-
|
|
167827
|
-
|
|
167828
|
-
|
|
167820
|
+
constructor(props) {
|
|
167821
|
+
super(props.profile, props.label, props.description ?? props.declaration?.description);
|
|
167822
|
+
this.declaration = props.declaration ?? {};
|
|
167823
|
+
this.name = props.declaration?.name ?? "";
|
|
167824
|
+
this.snippet = props.snippet || "";
|
|
167825
|
+
this.nonInteractive = props.nonInteractive ?? false;
|
|
167826
|
+
this.filterDescription = props.filterDescription ?? false;
|
|
167827
|
+
this.icon = props.icon;
|
|
167828
|
+
}
|
|
167829
167829
|
}
|
|
167830
167830
|
/**
|
|
167831
167831
|
* Represents the IProfileValue.
|
|
167832
167832
|
*/
|
|
167833
167833
|
class ValueVariable extends VariableBase {
|
|
167834
|
-
|
|
167835
|
-
|
|
167836
|
-
|
|
167837
|
-
|
|
167838
|
-
|
|
167839
|
-
|
|
167840
|
-
|
|
167841
|
-
|
|
167842
|
-
|
|
167834
|
+
constructor(props) {
|
|
167835
|
+
super(props);
|
|
167836
|
+
this.type = "text";
|
|
167837
|
+
this.isCollection = false;
|
|
167838
|
+
this.type = props?.declaration?.type ?? "text";
|
|
167839
|
+
}
|
|
167840
|
+
getDescription() {
|
|
167841
|
+
if (this.description == null) {
|
|
167842
|
+
return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
|
|
167843
|
+
}
|
|
167844
|
+
return super.getDescription();
|
|
167845
|
+
}
|
|
167846
|
+
toProfileVariableDefinition() {
|
|
167847
|
+
return { type: this.type, name: "", ...this.declaration };
|
|
167843
167848
|
}
|
|
167844
|
-
return super.getDescription();
|
|
167845
|
-
}
|
|
167846
|
-
toProfileVariableDefinition() {
|
|
167847
|
-
return { type: this.type, name: "", ...this.declaration };
|
|
167848
|
-
}
|
|
167849
167849
|
}
|
|
167850
167850
|
/**
|
|
167851
167851
|
* Represents the IProfileArray. The main difference is that the IProfileValue type
|
|
167852
167852
|
* is used as valueType.
|
|
167853
167853
|
*/
|
|
167854
167854
|
class ArrayVariable extends VariableBase {
|
|
167855
|
-
|
|
167856
|
-
|
|
167857
|
-
|
|
167858
|
-
|
|
167859
|
-
|
|
167860
|
-
|
|
167861
|
-
|
|
167862
|
-
|
|
167863
|
-
|
|
167855
|
+
constructor(props) {
|
|
167856
|
+
super(props);
|
|
167857
|
+
this.type = "array";
|
|
167858
|
+
this.isCollection = false;
|
|
167859
|
+
this.elementType = props.declaration?.elementType ?? { type: "number", name: "number" };
|
|
167860
|
+
}
|
|
167861
|
+
getDescription() {
|
|
167862
|
+
if (this.description == null) {
|
|
167863
|
+
return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
|
|
167864
|
+
}
|
|
167865
|
+
return super.getDescription();
|
|
167866
|
+
}
|
|
167867
|
+
toProfileVariableDefinition() {
|
|
167868
|
+
return { type: this.type, elementType: this.elementType, name: "", ...this.declaration };
|
|
167864
167869
|
}
|
|
167865
|
-
return super.getDescription();
|
|
167866
|
-
}
|
|
167867
|
-
toProfileVariableDefinition() {
|
|
167868
|
-
return { type: this.type, elementType: this.elementType, name: "", ...this.declaration };
|
|
167869
|
-
}
|
|
167870
167870
|
}
|
|
167871
167871
|
/**
|
|
167872
167872
|
* Represents a collection of items. The collection of items can be synchronous or
|
|
@@ -167875,595 +167875,595 @@ class ArrayVariable extends VariableBase {
|
|
|
167875
167875
|
* collection is ready or not.
|
|
167876
167876
|
*/
|
|
167877
167877
|
class CollectionBasedVariable extends VariableBase {
|
|
167878
|
-
|
|
167879
|
-
|
|
167880
|
-
|
|
167881
|
-
|
|
167878
|
+
constructor(props) {
|
|
167879
|
+
super(props);
|
|
167880
|
+
this.isCollection = true;
|
|
167881
|
+
this._loaded = true;
|
|
167882
|
+
/**
|
|
167883
|
+
* The collection of items used to display the profile.
|
|
167884
|
+
* If the collection is asynchronous, the 'load' function should
|
|
167885
|
+
* be called first before using the items.
|
|
167886
|
+
*/
|
|
167887
|
+
this.variables = [];
|
|
167888
|
+
}
|
|
167882
167889
|
/**
|
|
167883
|
-
*
|
|
167884
|
-
* If the collection is asynchronous, the 'load' function should
|
|
167885
|
-
* be called first before using the items.
|
|
167890
|
+
* Returns true if the collection has been loaded
|
|
167886
167891
|
*/
|
|
167887
|
-
|
|
167888
|
-
|
|
167889
|
-
|
|
167890
|
-
|
|
167891
|
-
|
|
167892
|
-
|
|
167893
|
-
|
|
167894
|
-
|
|
167895
|
-
|
|
167896
|
-
|
|
167897
|
-
|
|
167898
|
-
|
|
167899
|
-
|
|
167900
|
-
|
|
167901
|
-
|
|
167902
|
-
|
|
167903
|
-
|
|
167904
|
-
|
|
167905
|
-
|
|
167906
|
-
return null;
|
|
167907
|
-
}
|
|
167908
|
-
get informationType() {
|
|
167909
|
-
return "";
|
|
167910
|
-
}
|
|
167892
|
+
get loaded() {
|
|
167893
|
+
return this._loaded;
|
|
167894
|
+
}
|
|
167895
|
+
/**
|
|
167896
|
+
* Loads the items if the collection is asynchronous.
|
|
167897
|
+
* If the colleciton is synchronous then the function is a no-op.
|
|
167898
|
+
*/
|
|
167899
|
+
async loadSource() {
|
|
167900
|
+
return;
|
|
167901
|
+
}
|
|
167902
|
+
/**
|
|
167903
|
+
* Returns an url to the associated information
|
|
167904
|
+
*/
|
|
167905
|
+
get informationUrl() {
|
|
167906
|
+
return null;
|
|
167907
|
+
}
|
|
167908
|
+
get informationType() {
|
|
167909
|
+
return "";
|
|
167910
|
+
}
|
|
167911
167911
|
}
|
|
167912
167912
|
class GroupOfVariables extends ProfileItemBase {
|
|
167913
|
-
|
|
167914
|
-
|
|
167915
|
-
|
|
167916
|
-
|
|
167917
|
-
|
|
167918
|
-
|
|
167919
|
-
|
|
167920
|
-
|
|
167921
|
-
|
|
167913
|
+
constructor(profile, label, variables = []) {
|
|
167914
|
+
super(profile, label);
|
|
167915
|
+
this.variables = variables;
|
|
167916
|
+
this.type = "group";
|
|
167917
|
+
this.isCollection = true;
|
|
167918
|
+
}
|
|
167919
|
+
passFilter() {
|
|
167920
|
+
return true;
|
|
167921
|
+
}
|
|
167922
167922
|
}
|
|
167923
167923
|
class DictionaryVariable extends CollectionBasedVariable {
|
|
167924
|
-
|
|
167925
|
-
|
|
167926
|
-
|
|
167927
|
-
|
|
167928
|
-
|
|
167929
|
-
|
|
167930
|
-
|
|
167931
|
-
|
|
167932
|
-
|
|
167933
|
-
|
|
167934
|
-
|
|
167935
|
-
|
|
167936
|
-
|
|
167924
|
+
constructor(props) {
|
|
167925
|
+
super(props);
|
|
167926
|
+
this.type = "dictionary";
|
|
167927
|
+
/**
|
|
167928
|
+
* The variables that the dictionary holds. It is different than the variables.
|
|
167929
|
+
* The variables may contain grouping.
|
|
167930
|
+
*/
|
|
167931
|
+
this.dictionaryVariables = [];
|
|
167932
|
+
this.loadPropertyDeclarations(props?.declaration?.properties);
|
|
167933
|
+
// If we have a snippet then wrap the properties in a group and use the snippet as the heading
|
|
167934
|
+
// This is not applicable for root Dictionary such as Profile
|
|
167935
|
+
if (this.snippet && this.dictionaryVariables.length) {
|
|
167936
|
+
this.variables = [new GroupOfVariables(this._profile, this.snippet, this.dictionaryVariables)];
|
|
167937
|
+
}
|
|
167937
167938
|
}
|
|
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
|
-
|
|
167973
|
-
|
|
167974
|
-
|
|
167975
|
-
|
|
167976
|
-
|
|
167977
|
-
|
|
167978
|
-
|
|
167979
|
-
|
|
167980
|
-
|
|
167981
|
-
|
|
167982
|
-
|
|
167983
|
-
|
|
167984
|
-
|
|
167985
|
-
|
|
167986
|
-
|
|
167987
|
-
|
|
167988
|
-
|
|
167989
|
-
|
|
167990
|
-
|
|
167991
|
-
|
|
167992
|
-
|
|
167993
|
-
|
|
167994
|
-
|
|
167939
|
+
loadPropertyDeclarations(declarations) {
|
|
167940
|
+
this.dictionaryVariables = this.createVariableInstances(declarations);
|
|
167941
|
+
this.variables = this.dictionaryVariables;
|
|
167942
|
+
}
|
|
167943
|
+
createVariableInstances(declarations) {
|
|
167944
|
+
if (!Array.isArray(declarations)) {
|
|
167945
|
+
return [];
|
|
167946
|
+
}
|
|
167947
|
+
const properties = [];
|
|
167948
|
+
declarations.forEach((declaration) => {
|
|
167949
|
+
const variable = this.createVariableInstance(declaration);
|
|
167950
|
+
if (variable) {
|
|
167951
|
+
properties.push(variable);
|
|
167952
|
+
}
|
|
167953
|
+
});
|
|
167954
|
+
return properties;
|
|
167955
|
+
}
|
|
167956
|
+
createVariableInstance(declaration) {
|
|
167957
|
+
const snippet = assembleMemberExpression(this.snippet, declaration.name);
|
|
167958
|
+
switch (declaration.type) {
|
|
167959
|
+
case "number":
|
|
167960
|
+
case "text":
|
|
167961
|
+
case "boolean":
|
|
167962
|
+
case "date":
|
|
167963
|
+
case "geometry":
|
|
167964
|
+
return new ValueVariable({ profile: this._profile, declaration, label: snippet, snippet });
|
|
167965
|
+
case "feature":
|
|
167966
|
+
return new FeatureVariable({ profile: this._profile, declaration, label: snippet, snippet });
|
|
167967
|
+
case "featureSet":
|
|
167968
|
+
return new FeatureSetVariable({ profile: this._profile, declaration, label: snippet, snippet }, [
|
|
167969
|
+
new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })
|
|
167970
|
+
]);
|
|
167971
|
+
case "featureSetCollection":
|
|
167972
|
+
return new FeatureSetCollectionVariable({
|
|
167973
|
+
profile: this._profile,
|
|
167974
|
+
declaration,
|
|
167975
|
+
label: snippet,
|
|
167976
|
+
snippet
|
|
167977
|
+
});
|
|
167978
|
+
case "dictionary":
|
|
167979
|
+
return new DictionaryVariable({
|
|
167980
|
+
profile: this._profile,
|
|
167981
|
+
declaration,
|
|
167982
|
+
label: snippet,
|
|
167983
|
+
snippet
|
|
167984
|
+
});
|
|
167985
|
+
case "array":
|
|
167986
|
+
return new ArrayVariable({
|
|
167987
|
+
profile: this._profile,
|
|
167988
|
+
declaration,
|
|
167989
|
+
label: snippet,
|
|
167990
|
+
snippet
|
|
167991
|
+
});
|
|
167992
|
+
default:
|
|
167993
|
+
console.error("Invalid profile variable", declaration);
|
|
167994
|
+
return null;
|
|
167995
|
+
}
|
|
167996
|
+
}
|
|
167997
|
+
toProfileVariableDefinition() {
|
|
167998
|
+
return {
|
|
167999
|
+
type: this.type,
|
|
168000
|
+
name: "",
|
|
168001
|
+
...this.declaration,
|
|
168002
|
+
properties: this.dictionaryVariables.map((variable) => variable.toProfileVariableDefinition())
|
|
168003
|
+
};
|
|
167995
168004
|
}
|
|
167996
|
-
}
|
|
167997
|
-
toProfileVariableDefinition() {
|
|
167998
|
-
return {
|
|
167999
|
-
type: this.type,
|
|
168000
|
-
name: "",
|
|
168001
|
-
...this.declaration,
|
|
168002
|
-
properties: this.dictionaryVariables.map((variable) => variable.toProfileVariableDefinition())
|
|
168003
|
-
};
|
|
168004
|
-
}
|
|
168005
168005
|
}
|
|
168006
168006
|
class SourceBasedVariable extends CollectionBasedVariable {
|
|
168007
|
-
|
|
168008
|
-
|
|
168009
|
-
|
|
168010
|
-
|
|
168011
|
-
|
|
168012
|
-
|
|
168013
|
-
}
|
|
168014
|
-
get title() {
|
|
168015
|
-
return this._source?.title ?? "";
|
|
168016
|
-
}
|
|
168017
|
-
get url() {
|
|
168018
|
-
return this._definition?.url ?? "";
|
|
168019
|
-
}
|
|
168020
|
-
get informationUrl() {
|
|
168021
|
-
if (!this.loaded) {
|
|
168022
|
-
return null;
|
|
168007
|
+
constructor(props, relationshipsProperties) {
|
|
168008
|
+
super(props);
|
|
168009
|
+
this.relationshipsProperties = relationshipsProperties;
|
|
168010
|
+
this._source = null;
|
|
168011
|
+
this._loaded = false;
|
|
168012
|
+
this._definition = props?.declaration?.definition;
|
|
168023
168013
|
}
|
|
168024
|
-
|
|
168025
|
-
|
|
168026
|
-
return null;
|
|
168014
|
+
get title() {
|
|
168015
|
+
return this._source?.title ?? "";
|
|
168027
168016
|
}
|
|
168028
|
-
|
|
168029
|
-
|
|
168030
|
-
}
|
|
168031
|
-
get informationType() {
|
|
168032
|
-
return this._profile?.intlStrings?.layer ?? "layer";
|
|
168033
|
-
}
|
|
168034
|
-
loadSource() {
|
|
168035
|
-
if (D(this._loadPromise) && G(this._loadPromise)) {
|
|
168036
|
-
return this._loadPromise;
|
|
168017
|
+
get url() {
|
|
168018
|
+
return this._definition?.url ?? "";
|
|
168037
168019
|
}
|
|
168038
|
-
|
|
168039
|
-
|
|
168040
|
-
|
|
168041
|
-
|
|
168042
|
-
|
|
168043
|
-
|
|
168044
|
-
|
|
168045
|
-
|
|
168046
|
-
|
|
168047
|
-
|
|
168048
|
-
}
|
|
168049
|
-
// Create the value property
|
|
168050
|
-
const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
|
|
168051
|
-
return new ValueVariable({
|
|
168052
|
-
profile: this._profile,
|
|
168053
|
-
label: valueSnippet,
|
|
168054
|
-
description: field.alias ?? field.name,
|
|
168055
|
-
snippet: valueSnippet,
|
|
168056
|
-
icon: fieldTypeToIconName(field),
|
|
168057
|
-
filterDescription: true
|
|
168058
|
-
});
|
|
168059
|
-
}
|
|
168060
|
-
_getSubtypesOrDomainValuesDictionary(field) {
|
|
168061
|
-
if (!isDomainsCapableLayer(this._source)) {
|
|
168062
|
-
return null;
|
|
168020
|
+
get informationUrl() {
|
|
168021
|
+
if (!this.loaded) {
|
|
168022
|
+
return null;
|
|
168023
|
+
}
|
|
168024
|
+
const url = this._source?.url;
|
|
168025
|
+
if (!url) {
|
|
168026
|
+
return null;
|
|
168027
|
+
}
|
|
168028
|
+
const layerId = this._source?.layerId ?? "";
|
|
168029
|
+
return `${url}/${layerId}`;
|
|
168063
168030
|
}
|
|
168064
|
-
|
|
168065
|
-
|
|
168066
|
-
const domainDictionary = new DictionaryVariable({
|
|
168067
|
-
profile: this._profile,
|
|
168068
|
-
label: valueSnippet,
|
|
168069
|
-
description: field.alias ?? field.name,
|
|
168070
|
-
snippet: valueSnippet,
|
|
168071
|
-
icon: "form-dropdown"
|
|
168072
|
-
});
|
|
168073
|
-
// Add the header group
|
|
168074
|
-
const headerGroup = new GroupOfVariables(this._profile, field.alias ?? field.name, [
|
|
168075
|
-
new ValueVariable({
|
|
168076
|
-
profile: this._profile,
|
|
168077
|
-
label: valueSnippet,
|
|
168078
|
-
description: "",
|
|
168079
|
-
snippet: valueSnippet
|
|
168080
|
-
})
|
|
168081
|
-
]);
|
|
168082
|
-
domainDictionary.variables = [headerGroup];
|
|
168083
|
-
// If it is the subtype field then get its coded domain values
|
|
168084
|
-
if (isTypesCapabaleLayer(this._source) && field.name === this._source.typeIdField) {
|
|
168085
|
-
const subtypesGroup = getSubtypesProperties(this._profile, this._source.types, field);
|
|
168086
|
-
domainDictionary.variables.push(subtypesGroup);
|
|
168087
|
-
return domainDictionary;
|
|
168088
|
-
}
|
|
168089
|
-
// Since its' not the subtype field then add the snippet for the domain name
|
|
168090
|
-
if (this.type === "feature") {
|
|
168091
|
-
const domainNameSnippet = `DomainName(${this.snippet}, "${field.name}")`;
|
|
168092
|
-
headerGroup.variables.push(new ValueVariable({
|
|
168093
|
-
profile: this._profile,
|
|
168094
|
-
label: domainNameSnippet,
|
|
168095
|
-
description: "",
|
|
168096
|
-
snippet: domainNameSnippet
|
|
168097
|
-
}));
|
|
168098
|
-
}
|
|
168099
|
-
if (isTypesCapabaleLayer(this._source)) {
|
|
168100
|
-
// Check if all the domains for the field in the types are inherited.
|
|
168101
|
-
// If it is we can simplify the structure by avoiding splitting in subtypes
|
|
168102
|
-
const allInherited = this._source.types.every((t) => t.domains?.[field.name]?.type === "inherited");
|
|
168103
|
-
if (!allInherited) {
|
|
168104
|
-
// We have domains per subtype
|
|
168105
|
-
// We need to go thru each types and create a dictionary.
|
|
168106
|
-
const domainValuesBySubtypeGroup = getDomainValuesBySubtypeGroup(this._profile, this._source.types, field);
|
|
168107
|
-
if (!domainValuesBySubtypeGroup) {
|
|
168108
|
-
return null;
|
|
168109
|
-
}
|
|
168110
|
-
domainDictionary.variables.push(domainValuesBySubtypeGroup);
|
|
168111
|
-
return domainDictionary;
|
|
168112
|
-
}
|
|
168031
|
+
get informationType() {
|
|
168032
|
+
return this._profile?.intlStrings?.layer ?? "layer";
|
|
168113
168033
|
}
|
|
168114
|
-
|
|
168115
|
-
|
|
168116
|
-
|
|
168117
|
-
|
|
168118
|
-
|
|
168119
|
-
|
|
168034
|
+
loadSource() {
|
|
168035
|
+
if (D(this._loadPromise) && G(this._loadPromise)) {
|
|
168036
|
+
return this._loadPromise;
|
|
168037
|
+
}
|
|
168038
|
+
this._loadPromise = this._loadSource();
|
|
168039
|
+
return this._loadPromise;
|
|
168120
168040
|
}
|
|
168121
|
-
|
|
168122
|
-
|
|
168123
|
-
|
|
168124
|
-
|
|
168125
|
-
|
|
168126
|
-
|
|
168127
|
-
|
|
168041
|
+
_getFieldProperty(field) {
|
|
168042
|
+
// Check if the field is the type id field or of the field has a coded domain.
|
|
168043
|
+
// If it has then the property will be an exanpdable property (dictionary).
|
|
168044
|
+
// Otherwise just return a simple value property.
|
|
168045
|
+
const subtypesOrDomainValuesDictionary = this._getSubtypesOrDomainValuesDictionary(field);
|
|
168046
|
+
if (subtypesOrDomainValuesDictionary) {
|
|
168047
|
+
return subtypesOrDomainValuesDictionary;
|
|
168048
|
+
}
|
|
168049
|
+
// Create the value property
|
|
168050
|
+
const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
|
|
168051
|
+
return new ValueVariable({
|
|
168052
|
+
profile: this._profile,
|
|
168053
|
+
label: valueSnippet,
|
|
168054
|
+
description: field.alias ?? field.name,
|
|
168055
|
+
snippet: valueSnippet,
|
|
168056
|
+
icon: fieldTypeToIconName(field),
|
|
168057
|
+
filterDescription: true
|
|
168058
|
+
});
|
|
168128
168059
|
}
|
|
168129
|
-
|
|
168130
|
-
|
|
168131
|
-
|
|
168060
|
+
_getSubtypesOrDomainValuesDictionary(field) {
|
|
168061
|
+
if (!isDomainsCapableLayer(this._source)) {
|
|
168062
|
+
return null;
|
|
168063
|
+
}
|
|
168064
|
+
// Create the domain dictionary, we may not use it
|
|
168065
|
+
const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
|
|
168066
|
+
const domainDictionary = new DictionaryVariable({
|
|
168067
|
+
profile: this._profile,
|
|
168068
|
+
label: valueSnippet,
|
|
168069
|
+
description: field.alias ?? field.name,
|
|
168070
|
+
snippet: valueSnippet,
|
|
168071
|
+
icon: "form-dropdown"
|
|
168072
|
+
});
|
|
168073
|
+
// Add the header group
|
|
168074
|
+
const headerGroup = new GroupOfVariables(this._profile, field.alias ?? field.name, [
|
|
168075
|
+
new ValueVariable({
|
|
168076
|
+
profile: this._profile,
|
|
168077
|
+
label: valueSnippet,
|
|
168078
|
+
description: "",
|
|
168079
|
+
snippet: valueSnippet
|
|
168080
|
+
})
|
|
168081
|
+
]);
|
|
168082
|
+
domainDictionary.variables = [headerGroup];
|
|
168083
|
+
// If it is the subtype field then get its coded domain values
|
|
168084
|
+
if (isTypesCapabaleLayer(this._source) && field.name === this._source.typeIdField) {
|
|
168085
|
+
const subtypesGroup = getSubtypesProperties(this._profile, this._source.types, field);
|
|
168086
|
+
domainDictionary.variables.push(subtypesGroup);
|
|
168087
|
+
return domainDictionary;
|
|
168088
|
+
}
|
|
168089
|
+
// Since its' not the subtype field then add the snippet for the domain name
|
|
168090
|
+
if (this.type === "feature") {
|
|
168091
|
+
const domainNameSnippet = `DomainName(${this.snippet}, "${field.name}")`;
|
|
168092
|
+
headerGroup.variables.push(new ValueVariable({
|
|
168093
|
+
profile: this._profile,
|
|
168094
|
+
label: domainNameSnippet,
|
|
168095
|
+
description: "",
|
|
168096
|
+
snippet: domainNameSnippet
|
|
168097
|
+
}));
|
|
168098
|
+
}
|
|
168099
|
+
if (isTypesCapabaleLayer(this._source)) {
|
|
168100
|
+
// Check if all the domains for the field in the types are inherited.
|
|
168101
|
+
// If it is we can simplify the structure by avoiding splitting in subtypes
|
|
168102
|
+
const allInherited = this._source.types.every((t) => t.domains?.[field.name]?.type === "inherited");
|
|
168103
|
+
if (!allInherited) {
|
|
168104
|
+
// We have domains per subtype
|
|
168105
|
+
// We need to go thru each types and create a dictionary.
|
|
168106
|
+
const domainValuesBySubtypeGroup = getDomainValuesBySubtypeGroup(this._profile, this._source.types, field);
|
|
168107
|
+
if (!domainValuesBySubtypeGroup) {
|
|
168108
|
+
return null;
|
|
168109
|
+
}
|
|
168110
|
+
domainDictionary.variables.push(domainValuesBySubtypeGroup);
|
|
168111
|
+
return domainDictionary;
|
|
168112
|
+
}
|
|
168113
|
+
}
|
|
168114
|
+
// Either we have types but all the domains are inherited or we don't have types
|
|
168115
|
+
const domainValuesGroup = getDomainValuesProperties(this._profile, this._source.getFieldDomain?.(field.name), {
|
|
168116
|
+
code: "domainvalues"
|
|
168117
|
+
});
|
|
168118
|
+
if (!domainValuesGroup) {
|
|
168119
|
+
return null;
|
|
168120
|
+
}
|
|
168121
|
+
domainDictionary.variables.push(domainValuesGroup);
|
|
168122
|
+
return domainDictionary;
|
|
168132
168123
|
}
|
|
168133
|
-
|
|
168134
|
-
|
|
168135
|
-
|
|
168136
|
-
|
|
168137
|
-
|
|
168138
|
-
|
|
168139
|
-
|
|
168140
|
-
|
|
168141
|
-
|
|
168142
|
-
|
|
168143
|
-
|
|
168144
|
-
|
|
168145
|
-
|
|
168146
|
-
|
|
168147
|
-
|
|
168148
|
-
|
|
168149
|
-
|
|
168150
|
-
|
|
168151
|
-
|
|
168152
|
-
|
|
168153
|
-
|
|
168154
|
-
|
|
168124
|
+
async _getRelationshipsProperty() {
|
|
168125
|
+
// We need the data store to find the relationship feature layers
|
|
168126
|
+
if (!this.relationshipsProperties?.exposeRelationships || !this._profile?.supportFeatureSetFunctions) {
|
|
168127
|
+
return null;
|
|
168128
|
+
}
|
|
168129
|
+
const source = this._source;
|
|
168130
|
+
if (!isRelationshipsCapableLayer(source)) {
|
|
168131
|
+
return null;
|
|
168132
|
+
}
|
|
168133
|
+
const relationshipsGroup = new GroupOfVariables(this._profile, { code: "relationships" });
|
|
168134
|
+
const relationshipItems = await Promise.all(source.relationships.map(async (relationship) => {
|
|
168135
|
+
const relatedLayer = await getRelatedFeatureLayer(source, relationship);
|
|
168136
|
+
if (!isFeatureLayerInstance(relatedLayer)) {
|
|
168137
|
+
return null;
|
|
168138
|
+
}
|
|
168139
|
+
if (relationship.relatedTableId === this.relationshipsProperties?.sourceTableId) {
|
|
168140
|
+
// We don't want to show the reverse relationship
|
|
168141
|
+
return null;
|
|
168142
|
+
}
|
|
168143
|
+
const snippet = `FeatureSetByRelationshipName(${this.snippet}, "${relationship.name}")`;
|
|
168144
|
+
return new FeatureSetVariable({
|
|
168145
|
+
profile: this._profile,
|
|
168146
|
+
declaration: { definition: relatedLayer },
|
|
168147
|
+
label: relatedLayer.title,
|
|
168148
|
+
description: "",
|
|
168149
|
+
nonInteractive: true
|
|
168150
|
+
}, [new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })], { exposeRelationships: true, sourceTableId: source.layerId });
|
|
168151
|
+
}));
|
|
168152
|
+
relationshipsGroup.variables = relationshipItems.filter(D);
|
|
168153
|
+
if (!relationshipsGroup.variables.length) {
|
|
168154
|
+
return null;
|
|
168155
|
+
}
|
|
168156
|
+
return relationshipsGroup;
|
|
168155
168157
|
}
|
|
168156
|
-
return relationshipsGroup;
|
|
168157
|
-
}
|
|
168158
168158
|
}
|
|
168159
168159
|
class FeatureVariable extends SourceBasedVariable {
|
|
168160
|
-
|
|
168161
|
-
|
|
168162
|
-
|
|
168163
|
-
}
|
|
168164
|
-
get title() {
|
|
168165
|
-
if (isSupportedLayerInstance(this._source)) {
|
|
168166
|
-
return this._source.title;
|
|
168167
|
-
}
|
|
168168
|
-
return { code: "feature" };
|
|
168169
|
-
}
|
|
168170
|
-
async _loadSource() {
|
|
168171
|
-
if (this.loaded) {
|
|
168172
|
-
return this._source;
|
|
168160
|
+
constructor(props) {
|
|
168161
|
+
super(props, { exposeRelationships: true });
|
|
168162
|
+
this.type = "feature";
|
|
168173
168163
|
}
|
|
168174
|
-
|
|
168175
|
-
|
|
168176
|
-
|
|
168177
|
-
|
|
168178
|
-
|
|
168179
|
-
// The title group and snippet
|
|
168180
|
-
const title = isSupportedLayerInstance(this._source) ? this._source.title : "";
|
|
168181
|
-
this.variables.push(new GroupOfVariables(this._profile, title, [
|
|
168182
|
-
new ValueVariable({
|
|
168183
|
-
profile: this._profile,
|
|
168184
|
-
label: this.snippet,
|
|
168185
|
-
description: "",
|
|
168186
|
-
snippet: this.snippet
|
|
168187
|
-
})
|
|
168188
|
-
]));
|
|
168189
|
-
// The collection of feature attribute values
|
|
168190
|
-
const valuesGroup = new GroupOfVariables(this._profile, { code: "values" });
|
|
168191
|
-
this.variables.push(valuesGroup);
|
|
168192
|
-
// Add the geometry if it's a feature layer and not a table
|
|
168193
|
-
if (isTableCapableLayer(this._source) && !this._source.isTable) {
|
|
168194
|
-
const snippet = `Geometry(${this.snippet})`;
|
|
168195
|
-
const geometryProperty = new ValueVariable({
|
|
168196
|
-
profile: this._profile,
|
|
168197
|
-
declaration: { name: snippet },
|
|
168198
|
-
label: snippet,
|
|
168199
|
-
description: "Geometry",
|
|
168200
|
-
snippet,
|
|
168201
|
-
icon: "shapes",
|
|
168202
|
-
filterDescription: true
|
|
168203
|
-
});
|
|
168204
|
-
valuesGroup.variables.push(geometryProperty);
|
|
168205
|
-
}
|
|
168206
|
-
this._source.fields.sort(sortFields(this._source)).forEach((field) => {
|
|
168207
|
-
valuesGroup.variables.push(this._getFieldProperty(field));
|
|
168208
|
-
});
|
|
168209
|
-
// The relatonships
|
|
168210
|
-
const relationshipsGroup = await this._getRelationshipsProperty();
|
|
168211
|
-
if (relationshipsGroup) {
|
|
168212
|
-
this.variables.push(relationshipsGroup);
|
|
168213
|
-
}
|
|
168164
|
+
get title() {
|
|
168165
|
+
if (isSupportedLayerInstance(this._source)) {
|
|
168166
|
+
return this._source.title;
|
|
168167
|
+
}
|
|
168168
|
+
return { code: "feature" };
|
|
168214
168169
|
}
|
|
168215
|
-
|
|
168216
|
-
|
|
168217
|
-
|
|
168170
|
+
async _loadSource() {
|
|
168171
|
+
if (this.loaded) {
|
|
168172
|
+
return this._source;
|
|
168173
|
+
}
|
|
168174
|
+
try {
|
|
168175
|
+
this._source = await supportedSourceFromDefinition(this._definition);
|
|
168176
|
+
if (!this._source) {
|
|
168177
|
+
throw new Error("Invalid definition");
|
|
168178
|
+
}
|
|
168179
|
+
// The title group and snippet
|
|
168180
|
+
const title = isSupportedLayerInstance(this._source) ? this._source.title : "";
|
|
168181
|
+
this.variables.push(new GroupOfVariables(this._profile, title, [
|
|
168182
|
+
new ValueVariable({
|
|
168183
|
+
profile: this._profile,
|
|
168184
|
+
label: this.snippet,
|
|
168185
|
+
description: "",
|
|
168186
|
+
snippet: this.snippet
|
|
168187
|
+
})
|
|
168188
|
+
]));
|
|
168189
|
+
// The collection of feature attribute values
|
|
168190
|
+
const valuesGroup = new GroupOfVariables(this._profile, { code: "values" });
|
|
168191
|
+
this.variables.push(valuesGroup);
|
|
168192
|
+
// Add the geometry if it's a feature layer and not a table
|
|
168193
|
+
if (isTableCapableLayer(this._source) && !this._source.isTable) {
|
|
168194
|
+
const snippet = `Geometry(${this.snippet})`;
|
|
168195
|
+
const geometryProperty = new ValueVariable({
|
|
168196
|
+
profile: this._profile,
|
|
168197
|
+
declaration: { name: snippet },
|
|
168198
|
+
label: snippet,
|
|
168199
|
+
description: "Geometry",
|
|
168200
|
+
snippet,
|
|
168201
|
+
icon: "shapes",
|
|
168202
|
+
filterDescription: true
|
|
168203
|
+
});
|
|
168204
|
+
valuesGroup.variables.push(geometryProperty);
|
|
168205
|
+
}
|
|
168206
|
+
this._source.fields.sort(sortFields(this._source)).forEach((field) => {
|
|
168207
|
+
valuesGroup.variables.push(this._getFieldProperty(field));
|
|
168208
|
+
});
|
|
168209
|
+
// The relatonships
|
|
168210
|
+
const relationshipsGroup = await this._getRelationshipsProperty();
|
|
168211
|
+
if (relationshipsGroup) {
|
|
168212
|
+
this.variables.push(relationshipsGroup);
|
|
168213
|
+
}
|
|
168214
|
+
}
|
|
168215
|
+
catch (e) {
|
|
168216
|
+
console.error("Loading issue", e, this);
|
|
168217
|
+
this._source = null;
|
|
168218
|
+
}
|
|
168219
|
+
finally {
|
|
168220
|
+
this._loaded = true;
|
|
168221
|
+
}
|
|
168222
|
+
return this._source;
|
|
168218
168223
|
}
|
|
168219
|
-
|
|
168220
|
-
|
|
168224
|
+
toProfileVariableDefinition() {
|
|
168225
|
+
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168221
168226
|
}
|
|
168222
|
-
return this._source;
|
|
168223
|
-
}
|
|
168224
|
-
toProfileVariableDefinition() {
|
|
168225
|
-
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168226
|
-
}
|
|
168227
168227
|
}
|
|
168228
168228
|
class FeatureSetVariable extends SourceBasedVariable {
|
|
168229
|
-
|
|
168230
|
-
|
|
168231
|
-
|
|
168232
|
-
|
|
168233
|
-
|
|
168234
|
-
|
|
168235
|
-
|
|
168236
|
-
}
|
|
168237
|
-
get title() {
|
|
168238
|
-
if (isSupportedLayerInstance(this._source)) {
|
|
168239
|
-
return this._source.title;
|
|
168240
|
-
}
|
|
168241
|
-
return { code: "featureset" };
|
|
168242
|
-
}
|
|
168243
|
-
async _loadSource() {
|
|
168244
|
-
if (this.loaded) {
|
|
168245
|
-
return this._source;
|
|
168229
|
+
constructor(props, featureSetSnippets = [],
|
|
168230
|
+
// Relationships for feature set if only supported if the feature set is actually
|
|
168231
|
+
// representing a relationsip feature layer for a feature source.
|
|
168232
|
+
relationshipProps) {
|
|
168233
|
+
super(props, relationshipProps);
|
|
168234
|
+
this.featureSetSnippets = featureSetSnippets;
|
|
168235
|
+
this.type = "featureSet";
|
|
168246
168236
|
}
|
|
168247
|
-
|
|
168248
|
-
|
|
168249
|
-
|
|
168250
|
-
|
|
168251
|
-
|
|
168252
|
-
// The title group and snippet
|
|
168253
|
-
this.variables.push(new GroupOfVariables(this._profile, this.title, this.featureSetSnippets));
|
|
168254
|
-
// Add the fields
|
|
168255
|
-
const fieldsGroup = new GroupOfVariables(this._profile, { code: "fields" });
|
|
168256
|
-
this.variables.push(fieldsGroup);
|
|
168257
|
-
fieldsGroup.variables = this._source.fields
|
|
168258
|
-
.sort(sortFields(this._source))
|
|
168259
|
-
.map((field) => this._getFieldProperty(field));
|
|
168260
|
-
// Add the relationships if enabled
|
|
168261
|
-
const relationshipsGroup = await this._getRelationshipsProperty();
|
|
168262
|
-
if (relationshipsGroup) {
|
|
168263
|
-
this.variables.push(relationshipsGroup);
|
|
168264
|
-
}
|
|
168237
|
+
get title() {
|
|
168238
|
+
if (isSupportedLayerInstance(this._source)) {
|
|
168239
|
+
return this._source.title;
|
|
168240
|
+
}
|
|
168241
|
+
return { code: "featureset" };
|
|
168265
168242
|
}
|
|
168266
|
-
|
|
168267
|
-
|
|
168268
|
-
|
|
168243
|
+
async _loadSource() {
|
|
168244
|
+
if (this.loaded) {
|
|
168245
|
+
return this._source;
|
|
168246
|
+
}
|
|
168247
|
+
try {
|
|
168248
|
+
this._source = await supportedSourceFromDefinition(this._definition);
|
|
168249
|
+
if (!this._source) {
|
|
168250
|
+
throw new Error("Invalid definition");
|
|
168251
|
+
}
|
|
168252
|
+
// The title group and snippet
|
|
168253
|
+
this.variables.push(new GroupOfVariables(this._profile, this.title, this.featureSetSnippets));
|
|
168254
|
+
// Add the fields
|
|
168255
|
+
const fieldsGroup = new GroupOfVariables(this._profile, { code: "fields" });
|
|
168256
|
+
this.variables.push(fieldsGroup);
|
|
168257
|
+
fieldsGroup.variables = this._source.fields
|
|
168258
|
+
.sort(sortFields(this._source))
|
|
168259
|
+
.map((field) => this._getFieldProperty(field));
|
|
168260
|
+
// Add the relationships if enabled
|
|
168261
|
+
const relationshipsGroup = await this._getRelationshipsProperty();
|
|
168262
|
+
if (relationshipsGroup) {
|
|
168263
|
+
this.variables.push(relationshipsGroup);
|
|
168264
|
+
}
|
|
168265
|
+
}
|
|
168266
|
+
catch (e) {
|
|
168267
|
+
console.error("Loading issue", e, this);
|
|
168268
|
+
this._source = null;
|
|
168269
|
+
}
|
|
168270
|
+
finally {
|
|
168271
|
+
this._loaded = true;
|
|
168272
|
+
}
|
|
168273
|
+
return this._source;
|
|
168269
168274
|
}
|
|
168270
|
-
|
|
168271
|
-
|
|
168275
|
+
toProfileVariableDefinition() {
|
|
168276
|
+
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168272
168277
|
}
|
|
168273
|
-
return this._source;
|
|
168274
|
-
}
|
|
168275
|
-
toProfileVariableDefinition() {
|
|
168276
|
-
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168277
|
-
}
|
|
168278
168278
|
}
|
|
168279
168279
|
class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
168280
|
-
|
|
168281
|
-
|
|
168282
|
-
|
|
168283
|
-
|
|
168284
|
-
|
|
168285
|
-
|
|
168286
|
-
|
|
168287
|
-
|
|
168288
|
-
|
|
168289
|
-
|
|
168290
|
-
|
|
168291
|
-
|
|
168292
|
-
|
|
168280
|
+
constructor(props) {
|
|
168281
|
+
super(props);
|
|
168282
|
+
this.type = "featureSetCollection";
|
|
168283
|
+
this._featureSetCollections = null;
|
|
168284
|
+
this._loaded = false;
|
|
168285
|
+
this._definition = props?.declaration?.definition;
|
|
168286
|
+
}
|
|
168287
|
+
get informationUrl() {
|
|
168288
|
+
if (!this.loaded || !this._featureSetCollections) {
|
|
168289
|
+
return null;
|
|
168290
|
+
}
|
|
168291
|
+
if (typeof this._featureSetCollections.source !== "string") {
|
|
168292
|
+
return portalItemPageUrl(this._featureSetCollections.source.portalItem);
|
|
168293
|
+
}
|
|
168294
|
+
// const firstLayer = this._featureSetCollection.layers[0] ?? this._featureSetCollection.tables[0];
|
|
168295
|
+
// if (!firstLayer) {
|
|
168296
|
+
return null;
|
|
168297
|
+
// }
|
|
168298
|
+
// return `${firstLayer.url}`;
|
|
168293
168299
|
}
|
|
168294
|
-
|
|
168295
|
-
|
|
168296
|
-
|
|
168297
|
-
|
|
168298
|
-
|
|
168299
|
-
|
|
168300
|
-
|
|
168301
|
-
|
|
168302
|
-
return "";
|
|
168300
|
+
get informationType() {
|
|
168301
|
+
if (!this.loaded || !this._featureSetCollections) {
|
|
168302
|
+
return "";
|
|
168303
|
+
}
|
|
168304
|
+
if (typeof this._featureSetCollections.source !== "string") {
|
|
168305
|
+
return this._profile?.intlStrings?.webmap ?? "webmap";
|
|
168306
|
+
}
|
|
168307
|
+
return this._profile?.intlStrings?.featureservice ?? "featureservice";
|
|
168303
168308
|
}
|
|
168304
|
-
|
|
168305
|
-
|
|
168309
|
+
async loadSource() {
|
|
168310
|
+
if (D(this._loadPromise) && G(this._loadPromise)) {
|
|
168311
|
+
return this._loadPromise;
|
|
168312
|
+
}
|
|
168313
|
+
this._loadPromise = this._loadSource();
|
|
168314
|
+
return this._loadPromise;
|
|
168306
168315
|
}
|
|
168307
|
-
|
|
168308
|
-
|
|
168309
|
-
|
|
168310
|
-
|
|
168311
|
-
|
|
168316
|
+
async _loadSource() {
|
|
168317
|
+
if (this.loaded) {
|
|
168318
|
+
return this._featureSetCollections;
|
|
168319
|
+
}
|
|
168320
|
+
try {
|
|
168321
|
+
this._featureSetCollections = await this._featureSetCollectionsFromDefinition();
|
|
168322
|
+
if (!this._featureSetCollections) {
|
|
168323
|
+
throw new Error("Invalid definition");
|
|
168324
|
+
}
|
|
168325
|
+
// Create the group for the header
|
|
168326
|
+
const groupLabel = typeof this._featureSetCollections.source === "string"
|
|
168327
|
+
? { code: this._featureSetCollections.source.endsWith("FeatureServer") ? "featureservice" : "mapservice" }
|
|
168328
|
+
: {
|
|
168329
|
+
code: "webmapformat",
|
|
168330
|
+
formatValues: {
|
|
168331
|
+
webMapTitle: this._featureSetCollections.source.portalItem?.title ?? "Untitled map"
|
|
168332
|
+
}
|
|
168333
|
+
};
|
|
168334
|
+
const headerGroup = new GroupOfVariables(this._profile, groupLabel, [
|
|
168335
|
+
new ValueVariable({
|
|
168336
|
+
profile: this._profile,
|
|
168337
|
+
label: this.snippet,
|
|
168338
|
+
description: "",
|
|
168339
|
+
snippet: this.snippet
|
|
168340
|
+
})
|
|
168341
|
+
]);
|
|
168342
|
+
// Creates the groups for the layer and tables
|
|
168343
|
+
const layersGroup = new GroupOfVariables(this._profile, { code: "layers" }, this._featureSetCollections.layers);
|
|
168344
|
+
const tablesGroup = new GroupOfVariables(this._profile, { code: "tables" }, this._featureSetCollections.tables);
|
|
168345
|
+
this.variables.push(headerGroup, layersGroup, tablesGroup);
|
|
168346
|
+
}
|
|
168347
|
+
catch (e) {
|
|
168348
|
+
console.error("Loading issue", e, this);
|
|
168349
|
+
this._featureSetCollections = null;
|
|
168350
|
+
}
|
|
168351
|
+
finally {
|
|
168352
|
+
this._loaded = true;
|
|
168353
|
+
}
|
|
168354
|
+
return this._featureSetCollections;
|
|
168312
168355
|
}
|
|
168313
|
-
|
|
168314
|
-
|
|
168315
|
-
|
|
168316
|
-
|
|
168317
|
-
|
|
168318
|
-
|
|
168356
|
+
async _featureSetCollectionsFromDefinition() {
|
|
168357
|
+
if (!this._definition) {
|
|
168358
|
+
return null;
|
|
168359
|
+
}
|
|
168360
|
+
if (isWebMapInstance(this._definition)) {
|
|
168361
|
+
return this._featureSetCollectionFromWebMap(this._definition);
|
|
168362
|
+
}
|
|
168363
|
+
if (isSupportedLayerInstance(this._definition)) {
|
|
168364
|
+
return this._featureSetCollectionFromUrl(this._definition.url);
|
|
168365
|
+
}
|
|
168366
|
+
if (isPortalItemDefinition(this._definition)) {
|
|
168367
|
+
// Preload the portal item so we can discover if are dealing with a Web Map
|
|
168368
|
+
// or Feature Service
|
|
168369
|
+
return this._featureSetCollectionFromPortalItem(this._definition.portalItem);
|
|
168370
|
+
}
|
|
168371
|
+
if (isUrlDefinition(this._definition)) {
|
|
168372
|
+
// Assume that the url is pointing to a feature server
|
|
168373
|
+
return this._featureSetCollectionFromUrl(this._definition.url);
|
|
168374
|
+
}
|
|
168375
|
+
return null;
|
|
168319
168376
|
}
|
|
168320
|
-
|
|
168321
|
-
|
|
168322
|
-
|
|
168323
|
-
|
|
168324
|
-
|
|
168325
|
-
|
|
168326
|
-
|
|
168327
|
-
|
|
168328
|
-
|
|
168329
|
-
code: "webmapformat",
|
|
168330
|
-
formatValues: {
|
|
168331
|
-
webMapTitle: this._featureSetCollections.source.portalItem?.title ?? "Untitled map"
|
|
168332
|
-
}
|
|
168377
|
+
async _featureSetCollectionFromWebMap(definition) {
|
|
168378
|
+
const webMap = isWebMapInstance(definition) ? definition : await newWebMap({ portalItem: definition });
|
|
168379
|
+
await webMap.loadAll();
|
|
168380
|
+
// Until jsapi fix a bug we have to load the table separately
|
|
168381
|
+
await Promise.all(webMap.tables.map(async (t) => t.load()));
|
|
168382
|
+
return {
|
|
168383
|
+
layers: this._convertWebMapLayersToVariables(webMap.layers),
|
|
168384
|
+
tables: this._convertWebMapLayersToVariables(webMap.tables, true),
|
|
168385
|
+
source: webMap
|
|
168333
168386
|
};
|
|
168334
|
-
const headerGroup = new GroupOfVariables(this._profile, groupLabel, [
|
|
168335
|
-
new ValueVariable({
|
|
168336
|
-
profile: this._profile,
|
|
168337
|
-
label: this.snippet,
|
|
168338
|
-
description: "",
|
|
168339
|
-
snippet: this.snippet
|
|
168340
|
-
})
|
|
168341
|
-
]);
|
|
168342
|
-
// Creates the groups for the layer and tables
|
|
168343
|
-
const layersGroup = new GroupOfVariables(this._profile, { code: "layers" }, this._featureSetCollections.layers);
|
|
168344
|
-
const tablesGroup = new GroupOfVariables(this._profile, { code: "tables" }, this._featureSetCollections.tables);
|
|
168345
|
-
this.variables.push(headerGroup, layersGroup, tablesGroup);
|
|
168346
|
-
}
|
|
168347
|
-
catch (e) {
|
|
168348
|
-
console.error("Loading issue", e, this);
|
|
168349
|
-
this._featureSetCollections = null;
|
|
168350
|
-
}
|
|
168351
|
-
finally {
|
|
168352
|
-
this._loaded = true;
|
|
168353
|
-
}
|
|
168354
|
-
return this._featureSetCollections;
|
|
168355
|
-
}
|
|
168356
|
-
async _featureSetCollectionsFromDefinition() {
|
|
168357
|
-
if (!this._definition) {
|
|
168358
|
-
return null;
|
|
168359
|
-
}
|
|
168360
|
-
if (isWebMapInstance(this._definition)) {
|
|
168361
|
-
return this._featureSetCollectionFromWebMap(this._definition);
|
|
168362
168387
|
}
|
|
168363
|
-
|
|
168364
|
-
|
|
168365
|
-
|
|
168366
|
-
|
|
168367
|
-
|
|
168368
|
-
|
|
168369
|
-
|
|
168388
|
+
async _featureSetCollectionFromPortalItem(definition) {
|
|
168389
|
+
const portalItem = await newPortalItem(definition);
|
|
168390
|
+
await portalItem.load();
|
|
168391
|
+
switch (portalItem.type) {
|
|
168392
|
+
case "Web Map":
|
|
168393
|
+
return this._featureSetCollectionFromWebMap(portalItem);
|
|
168394
|
+
case "Feature Service":
|
|
168395
|
+
return this._featureSetCollectionFromUrl(portalItem.url);
|
|
168396
|
+
default:
|
|
168397
|
+
console.error("Unsupported portal item", definition);
|
|
168398
|
+
return null;
|
|
168399
|
+
}
|
|
168370
168400
|
}
|
|
168371
|
-
|
|
168372
|
-
|
|
168373
|
-
|
|
168401
|
+
async _featureSetCollectionFromUrl(url) {
|
|
168402
|
+
url = url.replace(/\/featureserver\/[0-9]*/iu, "/FeatureServer");
|
|
168403
|
+
url = url.replace(/\/mapserver\/[0-9]*/iu, "/MapServer");
|
|
168404
|
+
url = url.split("?")[0];
|
|
168405
|
+
const metadata = await serviceMetaData(url);
|
|
168406
|
+
const layersPromise = Promise.all(metadata.layers.map(async (layerInfo) => {
|
|
168407
|
+
const fl = await newFeatureLayer({ url: `${url}/${layerInfo.id}` });
|
|
168408
|
+
await fl.load();
|
|
168409
|
+
return this._createFeatureSetVariable(fl);
|
|
168410
|
+
}));
|
|
168411
|
+
const tablesPromise = Promise.all(metadata.tables.map(async (layerInfo) => {
|
|
168412
|
+
const fl = await newFeatureLayer({ url: `${url}/${layerInfo.id}` });
|
|
168413
|
+
await fl.load();
|
|
168414
|
+
return this._createFeatureSetVariable(fl);
|
|
168415
|
+
}));
|
|
168416
|
+
const [layers, tables] = await Promise.all([layersPromise, tablesPromise]);
|
|
168417
|
+
return { layers, tables, source: url };
|
|
168418
|
+
}
|
|
168419
|
+
_convertWebMapLayersToVariables(layers, filteringTables = false) {
|
|
168420
|
+
const layerVariables = [];
|
|
168421
|
+
layers
|
|
168422
|
+
.toArray()
|
|
168423
|
+
.reverse()
|
|
168424
|
+
.forEach((layer) => {
|
|
168425
|
+
if (isFeatureLayerInstance(layer)) {
|
|
168426
|
+
layerVariables.push(this._createFeatureSetVariable(layer, true));
|
|
168427
|
+
return;
|
|
168428
|
+
}
|
|
168429
|
+
if (isGroupLayerInstance(layer)) {
|
|
168430
|
+
const groupLayerVariables = filteringTables
|
|
168431
|
+
? this._convertWebMapLayersToVariables(layer.allTables, true)
|
|
168432
|
+
: this._convertWebMapLayersToVariables(layer.allLayers);
|
|
168433
|
+
layerVariables.push(...groupLayerVariables);
|
|
168434
|
+
}
|
|
168435
|
+
});
|
|
168436
|
+
return layerVariables;
|
|
168374
168437
|
}
|
|
168375
|
-
|
|
168376
|
-
|
|
168377
|
-
|
|
168378
|
-
|
|
168379
|
-
|
|
168380
|
-
|
|
168381
|
-
|
|
168382
|
-
|
|
168383
|
-
layers: this._convertWebMapLayersToVariables(webMap.layers),
|
|
168384
|
-
tables: this._convertWebMapLayersToVariables(webMap.tables, true),
|
|
168385
|
-
source: webMap
|
|
168386
|
-
};
|
|
168387
|
-
}
|
|
168388
|
-
async _featureSetCollectionFromPortalItem(definition) {
|
|
168389
|
-
const portalItem = await newPortalItem(definition);
|
|
168390
|
-
await portalItem.load();
|
|
168391
|
-
switch (portalItem.type) {
|
|
168392
|
-
case "Web Map":
|
|
168393
|
-
return this._featureSetCollectionFromWebMap(portalItem);
|
|
168394
|
-
case "Feature Service":
|
|
168395
|
-
return this._featureSetCollectionFromUrl(portalItem.url);
|
|
168396
|
-
default:
|
|
168397
|
-
console.error("Unsupported portal item", definition);
|
|
168398
|
-
return null;
|
|
168438
|
+
_createFeatureSetVariable(featureLayer, isFromWebMap = false) {
|
|
168439
|
+
return new FeatureSetVariable({
|
|
168440
|
+
profile: this._profile,
|
|
168441
|
+
declaration: { definition: featureLayer },
|
|
168442
|
+
label: featureLayer.title,
|
|
168443
|
+
description: "",
|
|
168444
|
+
nonInteractive: true
|
|
168445
|
+
}, this._makeFeatureSetSnippets(featureLayer, isFromWebMap));
|
|
168399
168446
|
}
|
|
168400
|
-
|
|
168401
|
-
|
|
168402
|
-
|
|
168403
|
-
|
|
168404
|
-
|
|
168405
|
-
|
|
168406
|
-
|
|
168407
|
-
|
|
168408
|
-
|
|
168409
|
-
|
|
168410
|
-
|
|
168411
|
-
|
|
168412
|
-
|
|
168413
|
-
|
|
168414
|
-
|
|
168415
|
-
|
|
168416
|
-
const [layers, tables] = await Promise.all([layersPromise, tablesPromise]);
|
|
168417
|
-
return { layers, tables, source: url };
|
|
168418
|
-
}
|
|
168419
|
-
_convertWebMapLayersToVariables(layers, filteringTables = false) {
|
|
168420
|
-
const layerVariables = [];
|
|
168421
|
-
layers
|
|
168422
|
-
.toArray()
|
|
168423
|
-
.reverse()
|
|
168424
|
-
.forEach((layer) => {
|
|
168425
|
-
if (isFeatureLayerInstance(layer)) {
|
|
168426
|
-
layerVariables.push(this._createFeatureSetVariable(layer, true));
|
|
168427
|
-
return;
|
|
168428
|
-
}
|
|
168429
|
-
if (isGroupLayerInstance(layer)) {
|
|
168430
|
-
const groupLayerVariables = filteringTables
|
|
168431
|
-
? this._convertWebMapLayersToVariables(layer.allTables, true)
|
|
168432
|
-
: this._convertWebMapLayersToVariables(layer.allLayers);
|
|
168433
|
-
layerVariables.push(...groupLayerVariables);
|
|
168434
|
-
}
|
|
168435
|
-
});
|
|
168436
|
-
return layerVariables;
|
|
168437
|
-
}
|
|
168438
|
-
_createFeatureSetVariable(featureLayer, isFromWebMap = false) {
|
|
168439
|
-
return new FeatureSetVariable({
|
|
168440
|
-
profile: this._profile,
|
|
168441
|
-
declaration: { definition: featureLayer },
|
|
168442
|
-
label: featureLayer.title,
|
|
168443
|
-
description: "",
|
|
168444
|
-
nonInteractive: true
|
|
168445
|
-
}, this._makeFeatureSetSnippets(featureLayer, isFromWebMap));
|
|
168446
|
-
}
|
|
168447
|
-
_makeFeatureSetSnippets(featureLayer, isFromWebMap = false) {
|
|
168448
|
-
if (!this._profile?.supportFeatureSetFunctions) {
|
|
168449
|
-
return [];
|
|
168450
|
-
}
|
|
168451
|
-
if (isFromWebMap) {
|
|
168452
|
-
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.id}")`;
|
|
168453
|
-
const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayer.title}")`;
|
|
168454
|
-
return [
|
|
168455
|
-
new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById }),
|
|
168456
|
-
new ValueVariable({ profile: this._profile, label: snippetByName, description: "", snippet: snippetByName })
|
|
168457
|
-
];
|
|
168447
|
+
_makeFeatureSetSnippets(featureLayer, isFromWebMap = false) {
|
|
168448
|
+
if (!this._profile?.supportFeatureSetFunctions) {
|
|
168449
|
+
return [];
|
|
168450
|
+
}
|
|
168451
|
+
if (isFromWebMap) {
|
|
168452
|
+
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.id}")`;
|
|
168453
|
+
const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayer.title}")`;
|
|
168454
|
+
return [
|
|
168455
|
+
new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById }),
|
|
168456
|
+
new ValueVariable({ profile: this._profile, label: snippetByName, description: "", snippet: snippetByName })
|
|
168457
|
+
];
|
|
168458
|
+
}
|
|
168459
|
+
else {
|
|
168460
|
+
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.layerId}")`;
|
|
168461
|
+
return [new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById })];
|
|
168462
|
+
}
|
|
168458
168463
|
}
|
|
168459
|
-
|
|
168460
|
-
|
|
168461
|
-
return [new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById })];
|
|
168464
|
+
toProfileVariableDefinition() {
|
|
168465
|
+
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168462
168466
|
}
|
|
168463
|
-
}
|
|
168464
|
-
toProfileVariableDefinition() {
|
|
168465
|
-
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
168466
|
-
}
|
|
168467
168467
|
}
|
|
168468
168468
|
/**
|
|
168469
168469
|
* The EditorProfile is an object that represents an Arcade Profile.
|
|
@@ -168474,64 +168474,64 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
168474
168474
|
* They need to be loaded asynchronously to get the metadata necessary for validation and completion.
|
|
168475
168475
|
*/
|
|
168476
168476
|
class EditorProfile extends DictionaryVariable {
|
|
168477
|
-
|
|
168478
|
-
|
|
168479
|
-
|
|
168480
|
-
|
|
168481
|
-
|
|
168482
|
-
|
|
168483
|
-
|
|
168484
|
-
|
|
168485
|
-
|
|
168486
|
-
|
|
168487
|
-
|
|
168488
|
-
|
|
168489
|
-
|
|
168490
|
-
|
|
168491
|
-
|
|
168492
|
-
|
|
168493
|
-
|
|
168494
|
-
|
|
168495
|
-
|
|
168496
|
-
|
|
168497
|
-
|
|
168498
|
-
|
|
168499
|
-
|
|
168500
|
-
|
|
168501
|
-
|
|
168502
|
-
|
|
168503
|
-
|
|
168504
|
-
|
|
168505
|
-
|
|
168506
|
-
|
|
168507
|
-
|
|
168508
|
-
|
|
168509
|
-
|
|
168510
|
-
|
|
168511
|
-
|
|
168512
|
-
|
|
168513
|
-
|
|
168514
|
-
|
|
168515
|
-
|
|
168477
|
+
constructor(definition, intlStrings, locale = "en") {
|
|
168478
|
+
// Delay the load of the variable declarations so we have a `this`
|
|
168479
|
+
super({
|
|
168480
|
+
profile: null,
|
|
168481
|
+
declaration: { properties: [] }
|
|
168482
|
+
});
|
|
168483
|
+
this.definition = definition;
|
|
168484
|
+
this.intlStrings = intlStrings;
|
|
168485
|
+
this.locale = locale;
|
|
168486
|
+
this.variables = [];
|
|
168487
|
+
// We are the root
|
|
168488
|
+
this._profile = this;
|
|
168489
|
+
// Now that `this` is defined, we can load the variables
|
|
168490
|
+
this.loadPropertyDeclarations(definition?.variables);
|
|
168491
|
+
}
|
|
168492
|
+
/**
|
|
168493
|
+
* Returns true if the profile supports feature set functions for snippets.
|
|
168494
|
+
*/
|
|
168495
|
+
get supportFeatureSetFunctions() {
|
|
168496
|
+
return this.definition?.bundles?.includes("data-access") ?? false;
|
|
168497
|
+
}
|
|
168498
|
+
/**
|
|
168499
|
+
* Returns the language service profile. It is different than the editor profile as it is optimized for Monaco.
|
|
168500
|
+
*/
|
|
168501
|
+
async toLSProfile() {
|
|
168502
|
+
const { apiVersion, bundles, hiddenApiItems } = this.definition ?? {};
|
|
168503
|
+
const variables = await variablesToLSVariable(this.dictionaryVariables);
|
|
168504
|
+
return { apiVersion, bundles, variables, hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()) };
|
|
168505
|
+
}
|
|
168506
|
+
/**
|
|
168507
|
+
* Returns the EditorProfile as a json. The EditorProfile may have been updated. This function allows to
|
|
168508
|
+
* get the new json representing mutations.
|
|
168509
|
+
*/
|
|
168510
|
+
toEditorProfileDefinition() {
|
|
168511
|
+
return {
|
|
168512
|
+
...this.definition,
|
|
168513
|
+
variables: this.dictionaryVariables.map((variable) => variable.toProfileVariableDefinition())
|
|
168514
|
+
};
|
|
168515
|
+
}
|
|
168516
168516
|
}
|
|
168517
168517
|
//#endregion
|
|
168518
168518
|
|
|
168519
168519
|
function isFeatureDefinition(item) {
|
|
168520
|
-
|
|
168521
|
-
|
|
168522
|
-
|
|
168523
|
-
|
|
168524
|
-
|
|
168520
|
+
return (isSupportedLayerInstance(item) ||
|
|
168521
|
+
isFeatureSetInstance(item) ||
|
|
168522
|
+
isUrlDefinition(item) ||
|
|
168523
|
+
isFieldsDefinition(item) ||
|
|
168524
|
+
isFeatureLayerItemDefinition(item));
|
|
168525
168525
|
}
|
|
168526
168526
|
function isFeatureSetDefinition(item) {
|
|
168527
|
-
|
|
168528
|
-
|
|
168529
|
-
|
|
168530
|
-
|
|
168531
|
-
|
|
168527
|
+
return (isFeatureLayerInstance(item) ||
|
|
168528
|
+
isFeatureSetInstance(item) ||
|
|
168529
|
+
isUrlDefinition(item) ||
|
|
168530
|
+
isFieldsDefinition(item) ||
|
|
168531
|
+
isFeatureLayerItemDefinition(item));
|
|
168532
168532
|
}
|
|
168533
168533
|
function isFeatureSetCollectionDefinition(item) {
|
|
168534
|
-
|
|
168534
|
+
return isPortalItemDefinition(item) || isWebMapInstance(item) || isFeatureSetDefinition(item);
|
|
168535
168535
|
}
|
|
168536
168536
|
/**
|
|
168537
168537
|
* Get a PredefinedProfile for a locale. If not already loaded then fetch it.
|
|
@@ -168539,26 +168539,26 @@ function isFeatureSetCollectionDefinition(item) {
|
|
|
168539
168539
|
* the english version of the profile.
|
|
168540
168540
|
*/
|
|
168541
168541
|
async function getSdkPredefinedProfiles(locale = "en") {
|
|
168542
|
-
|
|
168543
|
-
|
|
168544
|
-
|
|
168545
|
-
}
|
|
168546
|
-
if (!x.has(locale)) {
|
|
168547
|
-
return getSdkPredefinedProfiles("en");
|
|
168548
|
-
}
|
|
168549
|
-
try {
|
|
168550
|
-
const response = await fetch(index.getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
|
|
168551
|
-
if (response.ok) {
|
|
168552
|
-
return cacheSdkPredefinedProfiles(locale, await response.json());
|
|
168542
|
+
const profiles = sdkPredefinedProfilesMap.get(locale);
|
|
168543
|
+
if (profiles) {
|
|
168544
|
+
return profiles;
|
|
168553
168545
|
}
|
|
168554
|
-
if (locale
|
|
168555
|
-
|
|
168546
|
+
if (!x.has(locale)) {
|
|
168547
|
+
return getSdkPredefinedProfiles("en");
|
|
168548
|
+
}
|
|
168549
|
+
try {
|
|
168550
|
+
const response = await fetch(index.getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
|
|
168551
|
+
if (response.ok) {
|
|
168552
|
+
return cacheSdkPredefinedProfiles(locale, await response.json());
|
|
168553
|
+
}
|
|
168554
|
+
if (locale === "en") {
|
|
168555
|
+
return null;
|
|
168556
|
+
}
|
|
168557
|
+
return getSdkPredefinedProfiles("en");
|
|
168558
|
+
}
|
|
168559
|
+
catch (e) {
|
|
168560
|
+
return null;
|
|
168556
168561
|
}
|
|
168557
|
-
return getSdkPredefinedProfiles("en");
|
|
168558
|
-
}
|
|
168559
|
-
catch (e) {
|
|
168560
|
-
return null;
|
|
168561
|
-
}
|
|
168562
168562
|
}
|
|
168563
168563
|
const sdkPredefinedProfilesMap = new Map();
|
|
168564
168564
|
/**
|
|
@@ -168566,239 +168566,240 @@ const sdkPredefinedProfilesMap = new Map();
|
|
|
168566
168566
|
* Map of profiles per locale.
|
|
168567
168567
|
*/
|
|
168568
168568
|
function cacheSdkPredefinedProfiles(locale, profiles) {
|
|
168569
|
-
|
|
168570
|
-
|
|
168571
|
-
|
|
168572
|
-
|
|
168573
|
-
|
|
168574
|
-
|
|
168569
|
+
const map = new Map();
|
|
168570
|
+
profiles.forEach((profile) => {
|
|
168571
|
+
map.set(profile.id, profile);
|
|
168572
|
+
});
|
|
168573
|
+
sdkPredefinedProfilesMap.set(locale, map);
|
|
168574
|
+
return map;
|
|
168575
168575
|
}
|
|
168576
168576
|
async function getSdkPredefinedProfile(id, locale = "en") {
|
|
168577
|
-
|
|
168578
|
-
|
|
168577
|
+
const profiles = await getSdkPredefinedProfiles(locale);
|
|
168578
|
+
return profiles?.get(id) ?? null;
|
|
168579
168579
|
}
|
|
168580
168580
|
function isExtendedPredefinedProfileDefinition(predefinedProfileDefinition) {
|
|
168581
|
-
|
|
168581
|
+
return Array.isArray(predefinedProfileDefinition?.additionalVariables);
|
|
168582
168582
|
}
|
|
168583
168583
|
function convertApiVariables(variables) {
|
|
168584
|
-
|
|
168585
|
-
|
|
168586
|
-
|
|
168587
|
-
|
|
168584
|
+
if (!variables) {
|
|
168585
|
+
return [];
|
|
168586
|
+
}
|
|
168587
|
+
return variables.map(convertApiVariable);
|
|
168588
168588
|
}
|
|
168589
168589
|
function convertApiVariable(variable) {
|
|
168590
|
-
|
|
168591
|
-
|
|
168592
|
-
|
|
168593
|
-
|
|
168594
|
-
|
|
168595
|
-
|
|
168596
|
-
|
|
168597
|
-
|
|
168598
|
-
|
|
168599
|
-
|
|
168600
|
-
|
|
168601
|
-
|
|
168602
|
-
|
|
168590
|
+
switch (variable.type) {
|
|
168591
|
+
case "dictionary":
|
|
168592
|
+
return {
|
|
168593
|
+
...variable,
|
|
168594
|
+
type: variable.type,
|
|
168595
|
+
properties: convertApiVariables(variable.properties)
|
|
168596
|
+
};
|
|
168597
|
+
case "array": {
|
|
168598
|
+
return {
|
|
168599
|
+
...variable,
|
|
168600
|
+
type: variable.type,
|
|
168601
|
+
elementType: { type: "number", name: "number" }
|
|
168602
|
+
};
|
|
168603
|
+
}
|
|
168604
|
+
default:
|
|
168605
|
+
return { ...variable, type: variable.type };
|
|
168603
168606
|
}
|
|
168604
|
-
default:
|
|
168605
|
-
return { ...variable, type: variable.type };
|
|
168606
|
-
}
|
|
168607
168607
|
}
|
|
168608
168608
|
async function convertToEditorProfileDefinition(predefinedProfile, locale = "en") {
|
|
168609
|
-
|
|
168610
|
-
|
|
168611
|
-
}
|
|
168612
|
-
const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
|
|
168613
|
-
if (!sdkPredefinedProfile) {
|
|
168614
|
-
return undefined;
|
|
168615
|
-
}
|
|
168616
|
-
const editorProfile = {
|
|
168617
|
-
bundles: [...sdkPredefinedProfile.bundles],
|
|
168618
|
-
variables: [],
|
|
168619
|
-
hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase())
|
|
168620
|
-
};
|
|
168621
|
-
// Merge the SDK variables' definitions/properties with the predefined profile definitions.
|
|
168622
|
-
sdkPredefinedProfile.variables.forEach((sdkVariable) => {
|
|
168623
|
-
// Don't include disabled variables
|
|
168624
|
-
if (predefinedProfile.disabledVariables?.includes(sdkVariable.name)) {
|
|
168625
|
-
return;
|
|
168609
|
+
if (!isPredefinedProfile(predefinedProfile)) {
|
|
168610
|
+
return undefined;
|
|
168626
168611
|
}
|
|
168627
|
-
|
|
168628
|
-
|
|
168629
|
-
|
|
168630
|
-
// despite the type checking from the switch statement.
|
|
168631
|
-
switch (sdkVariable.type) {
|
|
168632
|
-
case "dictionary":
|
|
168633
|
-
// For dictionary, we support properties overrride
|
|
168634
|
-
return editorProfile.variables.push(convertApiVariable({
|
|
168635
|
-
...sdkVariable,
|
|
168636
|
-
type: sdkVariable.type,
|
|
168637
|
-
properties: Array.isArray(definition) ? [...definition] : sdkVariable.properties
|
|
168638
|
-
}));
|
|
168639
|
-
case "feature":
|
|
168640
|
-
if (isFeatureDefinition(definition)) {
|
|
168641
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168642
|
-
}
|
|
168643
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168644
|
-
case "featureSet":
|
|
168645
|
-
if (isFeatureSetDefinition(definition)) {
|
|
168646
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168647
|
-
}
|
|
168648
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168649
|
-
case "featureSetCollection":
|
|
168650
|
-
if (isFeatureSetCollectionDefinition(definition)) {
|
|
168651
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168652
|
-
}
|
|
168653
|
-
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168654
|
-
default:
|
|
168655
|
-
return editorProfile.variables.push(convertApiVariable(sdkVariable));
|
|
168612
|
+
const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
|
|
168613
|
+
if (!sdkPredefinedProfile) {
|
|
168614
|
+
return undefined;
|
|
168656
168615
|
}
|
|
168657
|
-
|
|
168658
|
-
|
|
168659
|
-
|
|
168660
|
-
|
|
168661
|
-
|
|
168616
|
+
const editorProfile = {
|
|
168617
|
+
bundles: [...sdkPredefinedProfile.bundles],
|
|
168618
|
+
variables: [],
|
|
168619
|
+
hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase())
|
|
168620
|
+
};
|
|
168621
|
+
// Merge the SDK variables' definitions/properties with the predefined profile definitions.
|
|
168622
|
+
sdkPredefinedProfile.variables.forEach((sdkVariable) => {
|
|
168623
|
+
// Don't include disabled variables
|
|
168624
|
+
if (predefinedProfile.disabledVariables?.includes(sdkVariable.name)) {
|
|
168625
|
+
return;
|
|
168626
|
+
}
|
|
168627
|
+
// Try to get a definition from the predefined profile.
|
|
168628
|
+
const definition = predefinedProfile.definitions[sdkVariable.name];
|
|
168629
|
+
// Note: Something is weird with TS. The sdkVariables are being casted to the wrong type
|
|
168630
|
+
// despite the type checking from the switch statement.
|
|
168631
|
+
switch (sdkVariable.type) {
|
|
168632
|
+
case "dictionary":
|
|
168633
|
+
// For dictionary, we support properties overrride
|
|
168634
|
+
return editorProfile.variables.push(convertApiVariable({
|
|
168635
|
+
...sdkVariable,
|
|
168636
|
+
type: sdkVariable.type,
|
|
168637
|
+
properties: Array.isArray(definition) ? [...definition] : sdkVariable.properties
|
|
168638
|
+
}));
|
|
168639
|
+
case "feature":
|
|
168640
|
+
if (isFeatureDefinition(definition)) {
|
|
168641
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168642
|
+
}
|
|
168643
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168644
|
+
case "featureSet":
|
|
168645
|
+
if (isFeatureSetDefinition(definition)) {
|
|
168646
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168647
|
+
}
|
|
168648
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168649
|
+
case "featureSetCollection":
|
|
168650
|
+
if (isFeatureSetCollectionDefinition(definition)) {
|
|
168651
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type, definition });
|
|
168652
|
+
}
|
|
168653
|
+
return editorProfile.variables.push({ ...sdkVariable, type: sdkVariable.type });
|
|
168654
|
+
default:
|
|
168655
|
+
return editorProfile.variables.push(convertApiVariable(sdkVariable));
|
|
168656
|
+
}
|
|
168657
|
+
});
|
|
168658
|
+
if (isExtendedPredefinedProfileDefinition(predefinedProfile)) {
|
|
168659
|
+
editorProfile.variables.push(...(predefinedProfile.additionalVariables ?? []));
|
|
168660
|
+
}
|
|
168661
|
+
return editorProfile;
|
|
168662
168662
|
}
|
|
168663
168663
|
|
|
168664
168664
|
const arcadeLanguageId = "arcade";
|
|
168665
168665
|
const defaultContext = {
|
|
168666
|
-
|
|
168666
|
+
locale: "en"
|
|
168667
168667
|
};
|
|
168668
168668
|
class ArcadeLanguageServiceDefaults {
|
|
168669
|
-
|
|
168670
|
-
|
|
168671
|
-
|
|
168672
|
-
|
|
168673
|
-
|
|
168674
|
-
|
|
168675
|
-
|
|
168676
|
-
|
|
168677
|
-
}
|
|
168678
|
-
get onDidChange() {
|
|
168679
|
-
return this._onDidChange.event;
|
|
168680
|
-
}
|
|
168681
|
-
get onModelContextDidChange() {
|
|
168682
|
-
return this._onModelContextDidChange.event;
|
|
168683
|
-
}
|
|
168684
|
-
get languageId() {
|
|
168685
|
-
return this._languageId;
|
|
168686
|
-
}
|
|
168687
|
-
get languageOptions() {
|
|
168688
|
-
return this._languageOptions;
|
|
168689
|
-
}
|
|
168690
|
-
_fireModelContextDidChange(key) {
|
|
168691
|
-
if (this._onDidModelContextChangeTimeout !== -1) {
|
|
168692
|
-
return;
|
|
168669
|
+
constructor() {
|
|
168670
|
+
this._languageId = arcadeLanguageId;
|
|
168671
|
+
this._languageOptions = {};
|
|
168672
|
+
this._onDidChange = new Emitter();
|
|
168673
|
+
this._profileMap = new Map();
|
|
168674
|
+
this._apiContextMap = new Map();
|
|
168675
|
+
this._onModelContextDidChange = new Emitter();
|
|
168676
|
+
this._onDidModelContextChangeTimeout = -1;
|
|
168693
168677
|
}
|
|
168694
|
-
|
|
168695
|
-
|
|
168696
|
-
this._onModelContextDidChange.fire(key);
|
|
168697
|
-
}, 0);
|
|
168698
|
-
}
|
|
168699
|
-
_getApiKey(modelId) {
|
|
168700
|
-
if (!Uri.isUri(modelId)) {
|
|
168701
|
-
modelId = Uri.parse(modelId);
|
|
168678
|
+
get onDidChange() {
|
|
168679
|
+
return this._onDidChange.event;
|
|
168702
168680
|
}
|
|
168703
|
-
|
|
168704
|
-
|
|
168705
|
-
/**
|
|
168706
|
-
* Create an EditorProfile for the given model id using the given definition and locale.
|
|
168707
|
-
* The EditorProfile is used by the the Arcade Language service as well by the cosing components.
|
|
168708
|
-
* The definition can be a pre-defined profile or an editor profile definition.
|
|
168709
|
-
* If the locale is not provided then the 'en' locale is used.
|
|
168710
|
-
* @param modelId The model id for which to create the context.
|
|
168711
|
-
* @param definition The definition to use for the model context.
|
|
168712
|
-
* @param locale The locale to use for the model context.
|
|
168713
|
-
* @returns The EditorProfile for the model.
|
|
168714
|
-
*/
|
|
168715
|
-
async setProfileForModel(modelId, definition, apiContext = { locale: "en" }) {
|
|
168716
|
-
// Convert pre-defined profile to a runtime profile
|
|
168717
|
-
if (isPredefinedProfile(definition)) {
|
|
168718
|
-
definition = await convertToEditorProfileDefinition(definition, apiContext.locale);
|
|
168719
|
-
}
|
|
168720
|
-
const intlStrings = await N(apiContext.locale, index.getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
|
|
168721
|
-
if (!intlStrings) {
|
|
168722
|
-
throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
|
|
168723
|
-
}
|
|
168724
|
-
this.disposeEditorProfileForModel(modelId);
|
|
168725
|
-
const key = this._getApiKey(modelId);
|
|
168726
|
-
const editorProfile = new EditorProfile(definition, intlStrings);
|
|
168727
|
-
this._profileMap.set(key, editorProfile);
|
|
168728
|
-
const apiProfile = await editorProfile.toLSProfile();
|
|
168729
|
-
this.updateApiContextForModel(modelId, {
|
|
168730
|
-
locale: apiContext.locale,
|
|
168731
|
-
profile: apiProfile,
|
|
168732
|
-
snippets: apiContext.snippets
|
|
168733
|
-
});
|
|
168734
|
-
}
|
|
168735
|
-
/**
|
|
168736
|
-
* Dispose the editor profile for the given model id.
|
|
168737
|
-
* It is the responsibility of the caller that created the editor profile to dispose it.
|
|
168738
|
-
* @param modelId The model id for which to dispose the editor profile.
|
|
168739
|
-
*/
|
|
168740
|
-
disposeEditorProfileForModel(modelId) {
|
|
168741
|
-
const key = this._getApiKey(modelId);
|
|
168742
|
-
this._profileMap.delete(key);
|
|
168743
|
-
}
|
|
168744
|
-
/**
|
|
168745
|
-
* Dispose the api context for the given model id.
|
|
168746
|
-
* @param modelId The model id for which to dispose the api context.
|
|
168747
|
-
*/
|
|
168748
|
-
disposeApiContextForModel(modelId) {
|
|
168749
|
-
const key = this._getApiKey(modelId);
|
|
168750
|
-
if (this._apiContextMap.delete(key)) {
|
|
168751
|
-
this._fireModelContextDidChange(key);
|
|
168681
|
+
get onModelContextDidChange() {
|
|
168682
|
+
return this._onModelContextDidChange.event;
|
|
168752
168683
|
}
|
|
168753
|
-
|
|
168754
|
-
|
|
168755
|
-
|
|
168756
|
-
|
|
168757
|
-
|
|
168758
|
-
|
|
168759
|
-
|
|
168760
|
-
|
|
168761
|
-
|
|
168762
|
-
|
|
168763
|
-
|
|
168764
|
-
|
|
168765
|
-
|
|
168766
|
-
|
|
168767
|
-
|
|
168768
|
-
|
|
168769
|
-
|
|
168770
|
-
|
|
168771
|
-
|
|
168772
|
-
|
|
168773
|
-
|
|
168774
|
-
|
|
168775
|
-
|
|
168776
|
-
|
|
168777
|
-
|
|
168778
|
-
|
|
168779
|
-
|
|
168780
|
-
|
|
168781
|
-
|
|
168782
|
-
|
|
168783
|
-
|
|
168784
|
-
|
|
168785
|
-
|
|
168786
|
-
|
|
168787
|
-
|
|
168788
|
-
|
|
168789
|
-
|
|
168790
|
-
|
|
168791
|
-
|
|
168684
|
+
get languageId() {
|
|
168685
|
+
return this._languageId;
|
|
168686
|
+
}
|
|
168687
|
+
get languageOptions() {
|
|
168688
|
+
return this._languageOptions;
|
|
168689
|
+
}
|
|
168690
|
+
_fireModelContextDidChange(key) {
|
|
168691
|
+
if (this._onDidModelContextChangeTimeout !== -1) {
|
|
168692
|
+
return;
|
|
168693
|
+
}
|
|
168694
|
+
this._onDidModelContextChangeTimeout = window.setTimeout(() => {
|
|
168695
|
+
this._onDidModelContextChangeTimeout = -1;
|
|
168696
|
+
this._onModelContextDidChange.fire(key);
|
|
168697
|
+
}, 0);
|
|
168698
|
+
}
|
|
168699
|
+
_getApiKey(modelId) {
|
|
168700
|
+
if (!Uri.isUri(modelId)) {
|
|
168701
|
+
modelId = Uri.parse(modelId);
|
|
168702
|
+
}
|
|
168703
|
+
return modelId.toString();
|
|
168704
|
+
}
|
|
168705
|
+
/**
|
|
168706
|
+
* Create an EditorProfile for the given model id using the given definition and locale.
|
|
168707
|
+
* The EditorProfile is used by the the Arcade Language service as well by the cosing components.
|
|
168708
|
+
* The definition can be a pre-defined profile or an editor profile definition.
|
|
168709
|
+
* If the locale is not provided then the 'en' locale is used.
|
|
168710
|
+
* @param modelId The model id for which to create the context.
|
|
168711
|
+
* @param definition The definition to use for the model context.
|
|
168712
|
+
* @param locale The locale to use for the model context.
|
|
168713
|
+
* @returns The EditorProfile for the model.
|
|
168714
|
+
*/
|
|
168715
|
+
async setProfileForModel(modelId, definition, apiContext = { locale: "en" }) {
|
|
168716
|
+
// Convert pre-defined profile to a runtime profile
|
|
168717
|
+
if (isPredefinedProfile(definition)) {
|
|
168718
|
+
definition = await convertToEditorProfileDefinition(definition, apiContext.locale);
|
|
168719
|
+
}
|
|
168720
|
+
const intlStrings = await N(apiContext.locale, index.getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
|
|
168721
|
+
if (!intlStrings) {
|
|
168722
|
+
throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
|
|
168723
|
+
}
|
|
168724
|
+
this.disposeEditorProfileForModel(modelId);
|
|
168725
|
+
const key = this._getApiKey(modelId);
|
|
168726
|
+
const editorProfile = new EditorProfile(definition, intlStrings);
|
|
168727
|
+
this._profileMap.set(key, editorProfile);
|
|
168728
|
+
const apiProfile = await editorProfile.toLSProfile();
|
|
168729
|
+
this.updateApiContextForModel(modelId, {
|
|
168730
|
+
locale: apiContext.locale,
|
|
168731
|
+
profile: apiProfile,
|
|
168732
|
+
snippets: apiContext.snippets
|
|
168733
|
+
});
|
|
168734
|
+
}
|
|
168735
|
+
/**
|
|
168736
|
+
* Dispose the editor profile for the given model id.
|
|
168737
|
+
* It is the responsibility of the caller that created the editor profile to dispose it.
|
|
168738
|
+
* @param modelId The model id for which to dispose the editor profile.
|
|
168739
|
+
*/
|
|
168740
|
+
disposeEditorProfileForModel(modelId) {
|
|
168741
|
+
const key = this._getApiKey(modelId);
|
|
168742
|
+
this._profileMap.delete(key);
|
|
168743
|
+
}
|
|
168744
|
+
/**
|
|
168745
|
+
* Dispose the api context for the given model id.
|
|
168746
|
+
* @param modelId The model id for which to dispose the api context.
|
|
168747
|
+
*/
|
|
168748
|
+
disposeApiContextForModel(modelId) {
|
|
168749
|
+
const key = this._getApiKey(modelId);
|
|
168750
|
+
if (this._apiContextMap.delete(key)) {
|
|
168751
|
+
this._fireModelContextDidChange(key);
|
|
168752
|
+
}
|
|
168753
|
+
}
|
|
168754
|
+
/**
|
|
168755
|
+
* Returns the editor profile for the given model id.
|
|
168756
|
+
* @param modelId The model id for which to get the editor profile.
|
|
168757
|
+
* @returns The editor profile for the model.
|
|
168758
|
+
*/
|
|
168759
|
+
getEditorProfileForModel(modelId) {
|
|
168760
|
+
return this._profileMap.get(this._getApiKey(modelId));
|
|
168761
|
+
}
|
|
168762
|
+
/**
|
|
168763
|
+
* Returns the API context for the given model id.
|
|
168764
|
+
* Returns the default context if the model has no context.
|
|
168765
|
+
* @param modelId The model id for which to get the API context.
|
|
168766
|
+
* @returns The API context for the model.
|
|
168767
|
+
*/
|
|
168768
|
+
getApiContextForModel(contextId) {
|
|
168769
|
+
return this._apiContextMap.get(this._getApiKey(contextId)) ?? defaultContext;
|
|
168770
|
+
}
|
|
168771
|
+
/**
|
|
168772
|
+
* Set or update api context for the given model id.
|
|
168773
|
+
* @param modelId The model id for which to set the context.
|
|
168774
|
+
* @param apiContext The api context to set.
|
|
168775
|
+
*/
|
|
168776
|
+
updateApiContextForModel(modelId, apiContext) {
|
|
168777
|
+
const key = this._getApiKey(modelId);
|
|
168778
|
+
const currentApiContext = this._apiContextMap.get(key) ?? {};
|
|
168779
|
+
this._apiContextMap.set(key, { ...currentApiContext, ...apiContext });
|
|
168780
|
+
this._fireModelContextDidChange(key);
|
|
168781
|
+
}
|
|
168782
|
+
/**
|
|
168783
|
+
* Set or update the Arcade language service options.
|
|
168784
|
+
* @param languageOptions The language options to set.
|
|
168785
|
+
*/
|
|
168786
|
+
setLanguageOptions(languageOptions = {}) {
|
|
168787
|
+
// Check if options have actually changed.
|
|
168788
|
+
// Avoid restarting the worker when no updates.
|
|
168789
|
+
// Today we only have the 'assetsPath' as a property
|
|
168790
|
+
if (this._languageOptions.assetsPath === languageOptions.assetsPath) {
|
|
168791
|
+
return;
|
|
168792
|
+
}
|
|
168793
|
+
this._languageOptions = { ...this._languageOptions, ...languageOptions };
|
|
168794
|
+
this._onDidChange.fire(this);
|
|
168792
168795
|
}
|
|
168793
|
-
this._languageOptions = { ...this._languageOptions, ...languageOptions };
|
|
168794
|
-
this._onDidChange.fire(this);
|
|
168795
|
-
}
|
|
168796
168796
|
}
|
|
168797
168797
|
const arcadeDefaults = new ArcadeLanguageServiceDefaults();
|
|
168798
168798
|
const arcade = {
|
|
168799
|
-
|
|
168799
|
+
setProfileForModel: arcadeDefaults.setProfileForModel.bind(arcadeDefaults)
|
|
168800
168800
|
};
|
|
168801
168801
|
|
|
168802
|
+
exports.$ = $;
|
|
168802
168803
|
exports.B = B;
|
|
168803
168804
|
exports.Emitter = Emitter;
|
|
168804
168805
|
exports.F = F;
|
|
@@ -168824,7 +168825,6 @@ exports.filterCollection = filterCollection;
|
|
|
168824
168825
|
exports.generateTokensCSSForColorMap = generateTokensCSSForColorMap;
|
|
168825
168826
|
exports.importArcade = importArcade;
|
|
168826
168827
|
exports.importRequest = importRequest;
|
|
168827
|
-
exports.j = j;
|
|
168828
168828
|
exports.languages = languages;
|
|
168829
168829
|
exports.main = main;
|
|
168830
168830
|
exports.monaco_editor_core_star = monaco_editor_core_star;
|