@arcgis/coding-components 4.29.0-beta.48 → 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-b5479fc4.js → p-0d616249.js} +8 -8
- package/dist/arcgis-coding-components/{p-af7d25aa.js → p-5802524a.js} +1 -1
- package/dist/arcgis-coding-components/{p-30618728.js → p-5ddccf04.js} +1 -1
- package/dist/arcgis-coding-components/p-7475f3a6.js +1 -0
- package/dist/arcgis-coding-components/{p-2e99b56e.js → p-7d8caba9.js} +1 -1
- package/dist/arcgis-coding-components/{p-a8d30530.js → p-9f6db08a.js} +1 -1
- package/dist/arcgis-coding-components/{p-0823fa31.js → p-aefe77ce.js} +1 -1
- package/dist/arcgis-coding-components/p-ce2be55e.entry.js +1 -0
- package/dist/arcgis-coding-components/{p-d78367ff.js → p-d425a387.js} +1 -1
- package/dist/arcgis-coding-components/{p-ae129dfa.js → p-ff21f230.js} +1 -1
- package/dist/cjs/{arcade-defaults-6fa4acb9.js → arcade-defaults-2d513b59.js} +238 -238
- package/dist/cjs/{arcade-mode-15687545.js → arcade-mode-6219f1b8.js} +74 -73
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +42 -46
- package/dist/cjs/{cssMode-644e4ecf.js → cssMode-1ec48254.js} +1 -1
- package/dist/cjs/{html-567706f3.js → html-0e1741fe.js} +1 -1
- package/dist/cjs/{htmlMode-14c95ab8.js → htmlMode-279d3c29.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{javascript-69c3523c.js → javascript-04f1bce0.js} +2 -2
- package/dist/cjs/{jsonMode-da8803e7.js → jsonMode-59322f7a.js} +1 -1
- package/dist/cjs/{tsMode-eddf280e.js → tsMode-17561f70.js} +1 -1
- package/dist/cjs/{typescript-114292ed.js → typescript-b7da8629.js} +1 -1
- package/dist/components/arcade-api.js +1 -1
- package/dist/components/arcade-contribution.js +4 -4
- package/dist/components/arcade-defaults.js +3 -3
- package/dist/components/arcade-mode.js +73 -72
- package/dist/components/arcade-results.js +26 -30
- package/dist/components/arcade-suggestions.js +2 -4
- package/dist/components/arcade-variables.js +4 -2
- package/dist/components/arcgis-arcade-editor.js +3 -3
- package/dist/components/index2.js +2 -2
- package/dist/components/markdown.js +1 -1
- package/dist/esm/{arcade-defaults-3a952c7e.js → arcade-defaults-0bafa696.js} +238 -238
- package/dist/esm/{arcade-mode-619b0989.js → arcade-mode-c17a1fa1.js} +74 -73
- package/dist/esm/arcgis-arcade-api_6.entry.js +42 -46
- package/dist/esm/{cssMode-4100a9c5.js → cssMode-3d18bd2b.js} +1 -1
- package/dist/esm/{html-fbb4fdec.js → html-2bce5d77.js} +1 -1
- package/dist/esm/{htmlMode-a896869e.js → htmlMode-69d56956.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{javascript-a0bd70ad.js → javascript-ded5c9d7.js} +2 -2
- package/dist/esm/{jsonMode-76fe6af1.js → jsonMode-0bf84cb2.js} +1 -1
- package/dist/esm/{tsMode-277700f6.js → tsMode-15d4e936.js} +1 -1
- package/dist/esm/{typescript-c9f880aa.js → typescript-cc4d00f0.js} +1 -1
- package/package.json +6 -6
- package/dist/arcgis-coding-components/p-3dd452e0.js +0 -1
- package/dist/arcgis-coding-components/p-8f729db2.entry.js +0 -1
|
@@ -182,7 +182,7 @@ function getDomainValuesBySubtypeGroup(profile, types, field) {
|
|
|
182
182
|
return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
|
|
183
183
|
}
|
|
184
184
|
// const validIdentifierExpr = new RegExp(/^[a-z_$][\w$]*$/gi);
|
|
185
|
-
const validIdentifierExpr =
|
|
185
|
+
const validIdentifierExpr = /^[a-z_$][a-z0-9_$]*$/giu;
|
|
186
186
|
function getMemberExpressionProperty(prop, includeDot = true) {
|
|
187
187
|
if (prop.match(validIdentifierExpr)) {
|
|
188
188
|
return `${includeDot ? "." : ""}${prop}`;
|
|
@@ -1038,8 +1038,8 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
1040
|
async _featureSetCollectionFromUrl(url) {
|
|
1041
|
-
url = url.replace(/\/featureserver\/[0-9]*/
|
|
1042
|
-
url = url.replace(/\/mapserver\/[0-9]*/
|
|
1041
|
+
url = url.replace(/\/featureserver\/[0-9]*/iu, "/FeatureServer");
|
|
1042
|
+
url = url.replace(/\/mapserver\/[0-9]*/iu, "/MapServer");
|
|
1043
1043
|
url = url.split("?")[0];
|
|
1044
1044
|
const metadata = await serviceMetaData(url);
|
|
1045
1045
|
const layersPromise = Promise.all(metadata.layers.map(async (layerInfo) => {
|
|
@@ -35,7 +35,7 @@ const operators = [
|
|
|
35
35
|
];
|
|
36
36
|
const arcadeLanguageConfiguration = {
|
|
37
37
|
// the default separators except `@$`
|
|
38
|
-
wordPattern: /(-?\d*\.\d\w*)|([
|
|
38
|
+
wordPattern: /(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,
|
|
39
39
|
comments: {
|
|
40
40
|
lineComment: "//",
|
|
41
41
|
blockComment: ["/*", "*/"]
|
|
@@ -56,15 +56,15 @@ const arcadeLanguageConfiguration = {
|
|
|
56
56
|
autoCloseBefore: ";:.,=}])` \n\t",
|
|
57
57
|
folding: {
|
|
58
58
|
markers: {
|
|
59
|
-
start:
|
|
60
|
-
end:
|
|
59
|
+
start: /^\s*\/\/\s*#?region\b/u,
|
|
60
|
+
end: /^\s*\/\/\s*#?endregion\b/u
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
indentationRules: {
|
|
64
64
|
// ^(.*\*/)?\s*\}.*$
|
|
65
|
-
decreaseIndentPattern: /^((?!.*?\/\*).*\*\/)?\s*[\}\]\)]
|
|
65
|
+
decreaseIndentPattern: /^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,
|
|
66
66
|
// ^.*\{[^}"']*$
|
|
67
|
-
increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/
|
|
67
|
+
increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
const arcadeMonarchLanguage = {
|
|
@@ -80,23 +80,23 @@ const arcadeMonarchLanguage = {
|
|
|
80
80
|
operators,
|
|
81
81
|
constants: ["true", "false", "null"],
|
|
82
82
|
// we include these common regular expressions
|
|
83
|
-
symbols: /[=><!~?:&|+\-*\/\^%]
|
|
84
|
-
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})
|
|
85
|
-
digits: /\d+(_+\d+)
|
|
86
|
-
octaldigits: /[0-7]+(_+[0-7]+)
|
|
87
|
-
binarydigits: /[0-1]+(_+[0-1]+)
|
|
88
|
-
hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)
|
|
89
|
-
regexpctl: /[(){}\[\]\$\^|\-*+?\.]
|
|
90
|
-
regexpesc: /\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})
|
|
83
|
+
symbols: /[=><!~?:&|+\-*\/\^%]+/u,
|
|
84
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/u,
|
|
85
|
+
digits: /\d+(_+\d+)*/u,
|
|
86
|
+
octaldigits: /[0-7]+(_+[0-7]+)*/u,
|
|
87
|
+
binarydigits: /[0-1]+(_+[0-1]+)*/u,
|
|
88
|
+
hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/u,
|
|
89
|
+
regexpctl: /[(){}\[\]\$\^|\-*+?\.]/u,
|
|
90
|
+
regexpesc: /\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/u,
|
|
91
91
|
// The main tokenizer for our languages
|
|
92
92
|
tokenizer: {
|
|
93
|
-
root: [[/[{}]
|
|
93
|
+
root: [[/[{}]/u, "delimiter.bracket"], { include: "common" }],
|
|
94
94
|
common: [
|
|
95
95
|
// import statement. import followed by a white space
|
|
96
|
-
[/import(?=\s)
|
|
96
|
+
[/import(?=\s)/u, { token: "keyword", next: "@import" }],
|
|
97
97
|
// identifiers and keywords
|
|
98
98
|
[
|
|
99
|
-
/[a-z_$][\w$]
|
|
99
|
+
/[a-z_$][\w$]*/u,
|
|
100
100
|
{
|
|
101
101
|
cases: {
|
|
102
102
|
"@constants": "constant",
|
|
@@ -109,14 +109,14 @@ const arcadeMonarchLanguage = {
|
|
|
109
109
|
{ include: "@whitespace" },
|
|
110
110
|
// regular expression: ensure it is terminated before beginning (otherwise it is an opeator)
|
|
111
111
|
[
|
|
112
|
-
/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))
|
|
112
|
+
/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,
|
|
113
113
|
{ token: "regexp", bracket: "@open", next: "@regexp" }
|
|
114
114
|
],
|
|
115
115
|
// delimiters and operators
|
|
116
|
-
[/[()\[\]]
|
|
117
|
-
[/[<>](?!@symbols)
|
|
116
|
+
[/[()\[\]]/u, "@brackets"],
|
|
117
|
+
[/[<>](?!@symbols)/u, "@brackets"],
|
|
118
118
|
[
|
|
119
|
-
/@symbols
|
|
119
|
+
/@symbols/u,
|
|
120
120
|
{
|
|
121
121
|
cases: {
|
|
122
122
|
"@operators": "delimiter",
|
|
@@ -125,87 +125,87 @@ const arcadeMonarchLanguage = {
|
|
|
125
125
|
}
|
|
126
126
|
],
|
|
127
127
|
// numbers
|
|
128
|
-
[/(@digits)[eE]([\-+]?(@digits))
|
|
129
|
-
[/(@digits)\.(@digits)([eE][\-+]?(@digits))
|
|
130
|
-
[/0[xX](@hexdigits)
|
|
131
|
-
[/0[oO]?(@octaldigits)
|
|
132
|
-
[/0[bB](@binarydigits)
|
|
133
|
-
[/(@digits)
|
|
128
|
+
[/(@digits)[eE]([\-+]?(@digits))?/u, "number"],
|
|
129
|
+
[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/u, "number"],
|
|
130
|
+
[/0[xX](@hexdigits)/u, "number"],
|
|
131
|
+
[/0[oO]?(@octaldigits)/u, "number"],
|
|
132
|
+
[/0[bB](@binarydigits)/u, "number"],
|
|
133
|
+
[/(@digits)/u, "number"],
|
|
134
134
|
// delimiter: after number because of .\d floats
|
|
135
|
-
[/[;,.]
|
|
135
|
+
[/[;,.]/u, "delimiter"],
|
|
136
136
|
// strings
|
|
137
|
-
[/"([^"\\]|\\.)
|
|
138
|
-
[/'([^'\\]|\\.)
|
|
139
|
-
[/"
|
|
140
|
-
[/'
|
|
141
|
-
[
|
|
137
|
+
[/"([^"\\]|\\.)*$/u, "string.invalid"],
|
|
138
|
+
[/'([^'\\]|\\.)*$/u, "string.invalid"],
|
|
139
|
+
[/"/u, "string", "@string_double"],
|
|
140
|
+
[/'/u, "string", "@string_single"],
|
|
141
|
+
[/`/u, "string", "@string_backtick"]
|
|
142
142
|
],
|
|
143
143
|
import: [
|
|
144
144
|
// import keyword
|
|
145
|
-
[/import(?=\s)
|
|
145
|
+
[/import(?=\s)/u, { token: "keyword" }],
|
|
146
146
|
// whitespace
|
|
147
147
|
{ include: "@whitespace" },
|
|
148
148
|
// identifier
|
|
149
|
-
[/[a-z_$][\w$]
|
|
149
|
+
[/[a-z_$][\w$]*/u, "identifier"],
|
|
150
150
|
// whitespace
|
|
151
151
|
{ include: "@whitespace" },
|
|
152
152
|
// from keyword
|
|
153
|
-
[/from
|
|
153
|
+
[/from/u, { token: "keyword", next: "@popall" }]
|
|
154
154
|
],
|
|
155
155
|
whitespace: [
|
|
156
|
-
[/[ \t\r\n]
|
|
157
|
-
[
|
|
158
|
-
[
|
|
156
|
+
[/[ \t\r\n]+/u, ""],
|
|
157
|
+
[/\/\*/u, "comment", "@comment"],
|
|
158
|
+
[/\/\/.*$/u, "comment"]
|
|
159
159
|
],
|
|
160
160
|
comment: [
|
|
161
|
-
[/[^\/*]
|
|
162
|
-
[
|
|
163
|
-
[/[\/*]
|
|
161
|
+
[/[^\/*]+/u, "comment"],
|
|
162
|
+
[/\*\//u, "comment", "@pop"],
|
|
163
|
+
[/[\/*]/u, "comment"]
|
|
164
164
|
],
|
|
165
165
|
// We match regular expression quite precisely
|
|
166
166
|
regexp: [
|
|
167
|
-
[/(\{)(\d+(?:,\d*)?)(\})
|
|
167
|
+
[/(\{)(\d+(?:,\d*)?)(\})/u, ["regexp.escape.control", "regexp.escape.control", "regexp.escape.control"]],
|
|
168
168
|
[
|
|
169
|
-
/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)
|
|
169
|
+
/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,
|
|
170
170
|
["regexp.escape.control", { token: "regexp.escape.control", next: "@regexrange" }]
|
|
171
171
|
],
|
|
172
|
-
[/(\()(\?:|\?=|\?!)
|
|
173
|
-
[/[()]
|
|
174
|
-
[/@regexpctl
|
|
175
|
-
[/[^\\\/]
|
|
176
|
-
[/@regexpesc
|
|
177
|
-
[
|
|
178
|
-
[/(\/)([gimsuy]*)
|
|
172
|
+
[/(\()(\?:|\?=|\?!)/u, ["regexp.escape.control", "regexp.escape.control"]],
|
|
173
|
+
[/[()]/u, "regexp.escape.control"],
|
|
174
|
+
[/@regexpctl/u, "regexp.escape.control"],
|
|
175
|
+
[/[^\\\/]/u, "regexp"],
|
|
176
|
+
[/@regexpesc/u, "regexp.escape"],
|
|
177
|
+
[/\\\./u, "regexp.invalid"],
|
|
178
|
+
[/(\/)([gimsuy]*)/u, [{ token: "regexp", bracket: "@close", next: "@pop" }, "keyword.other"]]
|
|
179
179
|
],
|
|
180
180
|
regexrange: [
|
|
181
|
-
[
|
|
182
|
-
[
|
|
183
|
-
[/@regexpesc
|
|
184
|
-
[/[^\]]
|
|
185
|
-
[/\]
|
|
181
|
+
[/-/u, "regexp.escape.control"],
|
|
182
|
+
[/\^/u, "regexp.invalid"],
|
|
183
|
+
[/@regexpesc/u, "regexp.escape"],
|
|
184
|
+
[/[^\]]/u, "regexp"],
|
|
185
|
+
[/\]/u, { token: "regexp.escape.control", next: "@pop", bracket: "@close" }]
|
|
186
186
|
],
|
|
187
187
|
string_double: [
|
|
188
|
-
[/[^\\"]
|
|
189
|
-
[/@escapes
|
|
190
|
-
[
|
|
191
|
-
[/"
|
|
188
|
+
[/[^\\"]+/u, "string"],
|
|
189
|
+
[/@escapes/u, "string.escape"],
|
|
190
|
+
[/\\./u, "string.escape.invalid"],
|
|
191
|
+
[/"/u, "string", "@pop"]
|
|
192
192
|
],
|
|
193
193
|
string_single: [
|
|
194
|
-
[/[^\\']
|
|
195
|
-
[/@escapes
|
|
196
|
-
[
|
|
197
|
-
[/'
|
|
194
|
+
[/[^\\']+/u, "string"],
|
|
195
|
+
[/@escapes/u, "string.escape"],
|
|
196
|
+
[/\\./u, "string.escape.invalid"],
|
|
197
|
+
[/'/u, "string", "@pop"]
|
|
198
198
|
],
|
|
199
199
|
string_backtick: [
|
|
200
|
-
[/\$\{
|
|
201
|
-
[/[^\\`$]
|
|
202
|
-
[/@escapes
|
|
203
|
-
[
|
|
204
|
-
[
|
|
200
|
+
[/\$\{/u, { token: "delimiter.bracket", next: "@bracketCounting" }],
|
|
201
|
+
[/[^\\`$]+/u, "string"],
|
|
202
|
+
[/@escapes/u, "string.escape"],
|
|
203
|
+
[/\\./u, "string.escape.invalid"],
|
|
204
|
+
[/`/u, "string", "@pop"]
|
|
205
205
|
],
|
|
206
206
|
bracketCounting: [
|
|
207
|
-
[/\{
|
|
208
|
-
[/\}
|
|
207
|
+
[/\{/u, "delimiter.bracket", "@bracketCounting"],
|
|
208
|
+
[/\}/u, "delimiter.bracket", "@pop"],
|
|
209
209
|
{ include: "common" }
|
|
210
210
|
]
|
|
211
211
|
}
|
|
@@ -266,7 +266,7 @@ class DiagnosticsAdapter {
|
|
|
266
266
|
}));
|
|
267
267
|
this._disposables.push({
|
|
268
268
|
dispose: () => {
|
|
269
|
-
for (const key
|
|
269
|
+
for (const key of Object.keys(this._listener)) {
|
|
270
270
|
this._listener[key].dispose();
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -536,7 +536,7 @@ let arcadeWorker;
|
|
|
536
536
|
async function getArcadeWorker(...uris) {
|
|
537
537
|
return new Promise((resolve, reject) => {
|
|
538
538
|
if (!arcadeWorker) {
|
|
539
|
-
return reject("TypeScript not registered!");
|
|
539
|
+
return reject(new Error("TypeScript not registered!"));
|
|
540
540
|
}
|
|
541
541
|
resolve(arcadeWorker(...uris));
|
|
542
542
|
});
|
|
@@ -585,6 +585,7 @@ function setupMode(arcadeDefaults) {
|
|
|
585
585
|
// Creates and registers a Formatter
|
|
586
586
|
languages.registerDocumentFormattingEditProvider(arcadeDefaults.languageId, new FormattingProvider(workerAccessor, arcadeDefaults));
|
|
587
587
|
// Creates a Diagnostic Adapter
|
|
588
|
+
// eslint-disable-next-line no-new
|
|
588
589
|
new DiagnosticsAdapter(arcadeDefaults.languageId, workerAccessor, {
|
|
589
590
|
defaults: arcadeDefaults,
|
|
590
591
|
diagnosticsService: arcadeDiagnosticService
|
|
@@ -142,8 +142,8 @@ async function loadArcadeResult(result, timeZone = "system") {
|
|
|
142
142
|
async function executeScript(editorProfile, script, testContext, console) {
|
|
143
143
|
//
|
|
144
144
|
const timeStamp = new Date();
|
|
145
|
-
// Provide a default console function
|
|
146
|
-
console
|
|
145
|
+
// Provide a default console function if missing
|
|
146
|
+
console ?? (console = () => undefined);
|
|
147
147
|
try {
|
|
148
148
|
// We want to measure compilation time
|
|
149
149
|
const t0 = performance.now();
|
|
@@ -182,7 +182,7 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
182
182
|
type: "error",
|
|
183
183
|
value: message,
|
|
184
184
|
error,
|
|
185
|
-
timeStamp
|
|
185
|
+
timeStamp,
|
|
186
186
|
compilationTime: 0,
|
|
187
187
|
executionTime: 0
|
|
188
188
|
};
|
|
@@ -192,7 +192,7 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
192
192
|
const indentSpecs = { char: " ", size: 2 };
|
|
193
193
|
const indentType = new Array(indentSpecs.size + 1).join(indentSpecs.char);
|
|
194
194
|
function createPushFunc(p) {
|
|
195
|
-
return (substring) =>
|
|
195
|
+
return (substring) => `\\${p.push(substring)}\\`;
|
|
196
196
|
}
|
|
197
197
|
function createPopFunc(p) {
|
|
198
198
|
return (_, offset) => p[offset - 1];
|
|
@@ -205,25 +205,27 @@ function jsonFormat(json) {
|
|
|
205
205
|
const p = [];
|
|
206
206
|
const pushFunc = createPushFunc(p);
|
|
207
207
|
const jsonString = JSON.stringify(json)
|
|
208
|
-
.replace(/\\./
|
|
209
|
-
.replace(/(".*?"|'.*?')/
|
|
210
|
-
.replace(/\s
|
|
208
|
+
.replace(/\\./gu, pushFunc)
|
|
209
|
+
.replace(/(".*?"|'.*?')/gu, pushFunc)
|
|
210
|
+
.replace(/\s+/u, "");
|
|
211
211
|
// Indent and insert newlines
|
|
212
212
|
let indentIndex = 0;
|
|
213
213
|
let out = "";
|
|
214
|
-
for (let i = 0; i < jsonString.length; i
|
|
214
|
+
for (let i = 0; i < jsonString.length; i += 1) {
|
|
215
215
|
const c = jsonString.charAt(i);
|
|
216
216
|
switch (c) {
|
|
217
217
|
case "{":
|
|
218
218
|
case "[":
|
|
219
|
-
|
|
219
|
+
indentIndex += 1;
|
|
220
|
+
out += `${c}\n${indent(indentIndex, indentType)}`;
|
|
220
221
|
break;
|
|
221
222
|
case "}":
|
|
222
223
|
case "]":
|
|
223
|
-
|
|
224
|
+
indentIndex -= 1;
|
|
225
|
+
out += `\n${indent(indentIndex, indentType)}${c}`;
|
|
224
226
|
break;
|
|
225
227
|
case ",":
|
|
226
|
-
out +=
|
|
228
|
+
out += `,\n${indent(indentIndex, indentType)}`;
|
|
227
229
|
break;
|
|
228
230
|
case ":":
|
|
229
231
|
out += ": ";
|
|
@@ -237,11 +239,9 @@ function jsonFormat(json) {
|
|
|
237
239
|
// and strings back in
|
|
238
240
|
const popFunc = createPopFunc(p);
|
|
239
241
|
return out
|
|
240
|
-
.replace(/\[[\d,\s]+?\]/
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
.replace(/\\(\d+)\\/g, popFunc) // strings
|
|
244
|
-
.replace(/\\(\d+)\\/g, popFunc); // backslashes in strings
|
|
242
|
+
.replace(/\[[\d,\s]+?\]/gu, (m) => m.replace(/\s/gu, ""))
|
|
243
|
+
.replace(/\\(\d+)\\/gu, popFunc) // strings
|
|
244
|
+
.replace(/\\(\d+)\\/gu, popFunc); // backslashes in strings
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
const arcadeResultsCss = ":host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2)}:host .flex-adjustable{flex:1 1 auto;overflow:hidden}:host .flex-row{display:flex;flex-direction:row;overflow:hidden}:host .flex-column{display:flex;flex-direction:column;overflow:hidden}:host .y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-ui-foreground-1)}:host header{border-bottom:1px solid var(--calcite-ui-border-3);flex:0 0 auto}:host .ltr-container{direction:ltr}:host calcite-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group:last-child{border-inline-end-width:0px}:host calcite-action-bar calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-ui-foreground-1)}:host .color-info{color:var(--calcite-ui-info)}:host .color-error{color:var(--calcite-ui-danger)}:host .color-success{color:var(--calcite-ui-success)}:host [class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-ui-foreground-1);margin:var(--calcite-spacing-three-quarter)}:host .console-logs-container{background-color:var(--calcite-ui-foreground-1);padding:0 var(--calcite-spacing-three-quarter);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}:host .result-value-table table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap}:host .result-value-table table thead{background-color:var(--calcite-ui-foreground-2)}:host .result-value-table table tr{border-top:1px solid var(--calcite-ui-border-3);border-bottom:1px solid var(--calcite-ui-border-3)}:host .result-value-table table th,:host .result-value-table table td{border-inline-start:1px solid var(--calcite-ui-border-3);border-inline-end:1px solid var(--calcite-ui-border-3);text-align:start;padding:var(--calcite-spacing-quarter)}:host .result-value-table table th .string-value,:host .result-value-table table td .string-value{white-space:pre}:host .result-value-table table th{font-weight:var(--calcite-font-weight-medium)}:host .tree-item-label,:host .number-value,:host .string-value,:host .boolean-value{font-family:var(--calcite-code-family)}:host .tree-item-label,:host .value-type{color:var(--calcite-text-2);font-weight:var(--calcite-font-weight-normal)}:host .dictionary-property{color:var(--arcgis-arcade-editor-identifier)}:host .number-value{color:var(--arcgis-arcade-editor-number)}:host .string-value{color:var(--arcgis-arcade-editor-string);white-space:pre-wrap}:host .constant-value{color:var(--arcgis-arcade-editor-constant)}:host .date-value{color:var(--arcgis-arcade-editor-date)}";
|
|
@@ -308,9 +308,7 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
308
308
|
if (this.loading && !this.consoleLogs?.length) {
|
|
309
309
|
return h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
310
310
|
}
|
|
311
|
-
return (h("div", { class: "console-logs-container ltr-container" }, this.consoleLogs?.length ? (this.consoleLogs.map((log) =>
|
|
312
|
-
return h("p", null, log);
|
|
313
|
-
})) : (h("p", null, this._t9nStrings?.consolemessage))));
|
|
311
|
+
return (h("div", { class: "console-logs-container ltr-container" }, this.consoleLogs?.length ? (this.consoleLogs.map((log) => h("p", null, log))) : (h("p", null, this._t9nStrings?.consolemessage))));
|
|
314
312
|
}
|
|
315
313
|
renderLogPanel() {
|
|
316
314
|
if (this.openedResultPanel !== "log") {
|
|
@@ -465,17 +463,15 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
465
463
|
}
|
|
466
464
|
renderFeatureSetTable(arcadeResult) {
|
|
467
465
|
const fields = supportedFields(arcadeResult.value.fields);
|
|
468
|
-
return (h("table", null, h("thead", null, h("tr", null, fields.map((field) => (h("th", null, field.name))))), h("tbody", null, arcadeResult.features.map((feature) => {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
})));
|
|
478
|
-
}))));
|
|
466
|
+
return (h("table", null, h("thead", null, h("tr", null, fields.map((field) => (h("th", null, field.name))))), h("tbody", null, arcadeResult.features.map((feature) => (h("tr", null, fields.map((field) => {
|
|
467
|
+
try {
|
|
468
|
+
const arcadeResult = valueToArcadeResult(feature.field(field.name));
|
|
469
|
+
return h("td", null, this.renderSimpleValue(arcadeResult));
|
|
470
|
+
}
|
|
471
|
+
catch (e) {
|
|
472
|
+
return h("td", null);
|
|
473
|
+
}
|
|
474
|
+
})))))));
|
|
479
475
|
}
|
|
480
476
|
render() {
|
|
481
477
|
return (h(Host, null, h("header", { class: "flex-row" }, h("calcite-action-bar", { class: "flex-adjustable", layout: "horizontal", scale: "s", expanded: true, "expand-disabled": true }, h("calcite-action-group", { scale: "s" }, h("calcite-action", { active: this.openedResultPanel === "output", text: this._t9nStrings?.output ?? "Output", "text-enabled": true, scale: "s", icon: "list-show-all", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "output" }), h("calcite-action", { active: this.openedResultPanel === "console", text: this._t9nStrings?.console ?? "Console", "text-enabled": true, scale: "s", icon: "console", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "console" }), h("calcite-action", { active: this.openedResultPanel === "log", text: this._t9nStrings?.log ?? "Log", "text-enabled": true, scale: "s", icon: "list", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "log" }))), h("calcite-action", { scale: "s", icon: "x", text: this._t9nStrings?.close ?? "", onClick: this._emitClose })), h("article", { class: "flex-adjustable" }, this.loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: "" })) : (h("div", { class: "flex-column y-scrollable-container" }, this.renderOutputPanel(), this.renderConsolePanel(), this.renderLogPanel())))));
|
|
@@ -32,7 +32,7 @@ const ArcgisArcadeSuggestions = /*@__PURE__*/ proxyCustomElement(class ArcgisArc
|
|
|
32
32
|
this.close = createEvent(this, "close", 3);
|
|
33
33
|
this.itemSelected = createEvent(this, "itemSelected", 3);
|
|
34
34
|
// @ts-expect-error
|
|
35
|
-
this._updateFilterValue = (e) => (this._filterValue = e.target?.
|
|
35
|
+
this._updateFilterValue = (e) => (this._filterValue = e.target?.value ?? "");
|
|
36
36
|
this._emitItemSelected = (e) => {
|
|
37
37
|
// @ts-expect-error
|
|
38
38
|
const item = e.target?.["data-item"];
|
|
@@ -106,9 +106,7 @@ const ArcgisArcadeSuggestions = /*@__PURE__*/ proxyCustomElement(class ArcgisArc
|
|
|
106
106
|
return null;
|
|
107
107
|
}
|
|
108
108
|
if (isSuggestionGroups(this.suggestions)) {
|
|
109
|
-
return this.suggestions.map((suggestionGroup) => {
|
|
110
|
-
return (h("calcite-list-item-group", { heading: suggestionGroup.label }, this.renderSuggestionListItems(suggestionGroup.suggestions)));
|
|
111
|
-
});
|
|
109
|
+
return this.suggestions.map((suggestionGroup) => (h("calcite-list-item-group", { heading: suggestionGroup.label }, this.renderSuggestionListItems(suggestionGroup.suggestions))));
|
|
112
110
|
}
|
|
113
111
|
return this.renderSuggestionListItems(this.suggestions);
|
|
114
112
|
}
|
|
@@ -21,7 +21,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
21
21
|
this.close = createEvent(this, "close", 3);
|
|
22
22
|
this.itemSelected = createEvent(this, "itemSelected", 3);
|
|
23
23
|
// @ts-expect-error
|
|
24
|
-
this._updateFilterValue = (e) => (this._filterValue = e.target?.
|
|
24
|
+
this._updateFilterValue = (e) => (this._filterValue = e.target?.value ?? "");
|
|
25
25
|
this._beforeBack = async () => {
|
|
26
26
|
this.removeLastPanelRenderer();
|
|
27
27
|
this._filterValue = "";
|
|
@@ -115,7 +115,9 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
115
115
|
let loading = this.loading;
|
|
116
116
|
if (!loading && !collection.loaded) {
|
|
117
117
|
// Request to load and update mutation counter when done
|
|
118
|
-
collection.loadSource().then(() => setTimeout(() =>
|
|
118
|
+
collection.loadSource().then(() => setTimeout(() => {
|
|
119
|
+
this._mutationCounter += 1;
|
|
120
|
+
}));
|
|
119
121
|
loading = true;
|
|
120
122
|
}
|
|
121
123
|
return (h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this._t9nStrings?.backtotop ?? "Back to top", scale: "m", hidden: topPanel, icon: "chevrons-left", iconFlipRtl: true, onClick: this._backToTop }), h(StickyFilterInput, { filterValue: this._filterValue, onCalciteInputInput: this._updateFilterValue }), loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (h("calcite-list", null, this.renderEditorVariables(collection)))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { editor, KeyCode } from 'monaco-editor';
|
|
3
3
|
import { e as executeScript, D as DevelopersWebSitePath, d as defineCustomElement$5 } from './arcade-results.js';
|
|
4
|
-
import { p,
|
|
4
|
+
import { p, $, P, F, U } from './index2.js';
|
|
5
5
|
import { s as setupMonacoEnvironment, a as getArcadeDiagnosticService } from './arcade-contribution.js';
|
|
6
6
|
import { b as arcadeDefaults } from './arcade-defaults.js';
|
|
7
7
|
import '@esri/calcite-components/dist/components/calcite-action-bar.js';
|
|
@@ -81,7 +81,7 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
81
81
|
this.scriptChange = createEvent(this, "scriptChange", 3);
|
|
82
82
|
this.diagnosticsChange = createEvent(this, "diagnosticsChange", 3);
|
|
83
83
|
this._componentReadyDefer = new p();
|
|
84
|
-
this._modelId =
|
|
84
|
+
this._modelId = $();
|
|
85
85
|
this._editorProfilePromise = Promise.resolve(undefined);
|
|
86
86
|
this._disposables = [];
|
|
87
87
|
this._executeScript = async () => {
|
|
@@ -260,7 +260,7 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
260
260
|
// Start listening to the validation diagnostics.
|
|
261
261
|
// We are doing this as late as possible
|
|
262
262
|
const diagnosticsService = await getArcadeDiagnosticService();
|
|
263
|
-
this._disposables.push(diagnosticsService.onDiagnosticsChange((
|
|
263
|
+
this._disposables.push(diagnosticsService.onDiagnosticsChange((event) => !this._preparingProfile && this.diagnosticsChange.emit(event.diagnostics)));
|
|
264
264
|
// Get editor instance and add action
|
|
265
265
|
this._standaloneCodeEditor = await this.getEditorInstance();
|
|
266
266
|
this._standaloneCodeEditor?.addAction({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
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
|
+
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}}
|
|
2
2
|
|
|
3
|
-
export { B, D, F, G, H, N, O, P, T, U, V, X,
|
|
3
|
+
export { $, B, D, F, G, H, N, O, P, T, U, V, X, p, q, x, z };
|
|
@@ -2931,7 +2931,7 @@ marked_umd.marked.use({
|
|
|
2931
2931
|
}
|
|
2932
2932
|
});
|
|
2933
2933
|
function convertMarkdownString(value) {
|
|
2934
|
-
value
|
|
2934
|
+
value ?? (value = "");
|
|
2935
2935
|
const result = marked_umd.marked(typeof value === "string" ? value : value.value, {
|
|
2936
2936
|
gfm: true,
|
|
2937
2937
|
breaks: true,
|