@arcgis/coding-components 5.0.0-next.161 → 5.0.0-next.163

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.
Files changed (32) hide show
  1. package/dist/cdn/{4MOSGFJC.js → 26MOVMMM.js} +1 -1
  2. package/dist/cdn/{Y4MJ5J2U.js → 5SBFB2DR.js} +1 -1
  3. package/dist/cdn/{CE3ZDQPX.js → BRSZWZFH.js} +1 -1
  4. package/dist/cdn/{EIADXMFF.js → FOOS4KBL.js} +1 -1
  5. package/dist/cdn/{46V2ZGBY.js → KX2GUS7A.js} +1 -1
  6. package/dist/cdn/{L24IFJ5T.js → PWP6N6LB.js} +1 -1
  7. package/dist/cdn/RO427XLV.js +2 -0
  8. package/dist/cdn/WQGZW7TU.js +6 -0
  9. package/dist/cdn/{7TPRUSJF.js → X4I7WY6U.js} +1 -1
  10. package/dist/cdn/{7KWJ63EG.js → X5AMXKB3.js} +1 -1
  11. package/dist/cdn/assets/code-editor/sql-expr.worker.js +1437 -1434
  12. package/dist/cdn/index.js +1 -1
  13. package/dist/chunks/arcade-defaults.js +116 -114
  14. package/dist/chunks/sql-expr-defaults.js +31 -31
  15. package/dist/components/arcgis-arcade-editor/customElement.d.ts +12 -15
  16. package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +1 -1
  17. package/dist/{utils/profile → components}/types.d.ts +65 -205
  18. package/dist/docs/api.json +1 -1
  19. package/dist/docs/docs.json +1 -1
  20. package/dist/docs/web-types.json +1 -1
  21. package/dist/index.d.ts +1 -3
  22. package/dist/utils/arcade-assistant/types.d.ts +5 -1
  23. package/dist/utils/arcade-executor.d.ts +73 -93
  24. package/dist/utils/arcade-monaco/arcade-defaults.d.ts +2 -1
  25. package/dist/utils/custom-panel.d.ts +18 -15
  26. package/dist/utils/sql-expr-monaco/sql-expr-defaults.d.ts +2 -1
  27. package/package.json +5 -5
  28. package/dist/cdn/PJPSSZOF.js +0 -2
  29. package/dist/cdn/QTCMBBCJ.js +0 -6
  30. package/dist/components/arcgis-arcade-coding-assistant/types.d.ts +0 -3
  31. package/dist/utils/editor-suggestions.d.ts +0 -21
  32. package/dist/utils/index.d.ts +0 -4
@@ -1,13 +1,26 @@
1
1
  import type { JsxNode } from "@arcgis/lumina";
2
2
  import type { ArcgisArcadeEditor } from "../components/arcgis-arcade-editor/customElement.js";
3
- import type { IconName } from "../components/arcgis-arcade-coding-assistant/types.js";
3
+ import type { Icon as Icon } from "@esri/calcite-components/components/calcite-icon";
4
4
 
5
- export type ICustomPanel = ICustomSidePanel;
5
+ /** @internal */
6
+ export type IBaseCustomPanel = {
7
+ /** Unique ID */
8
+ id: string;
9
+ name: string;
10
+ location: "sidebar";
11
+ renderer: ({ closePanel, insertText, closed, editorRef, }: {
12
+ closePanel: (e: Event) => void;
13
+ insertText: (text: string) => void;
14
+ closed: boolean;
15
+ editorRef: ArcgisArcadeEditor;
16
+ }) => JsxNode;
17
+ };
6
18
 
19
+ /** @internal */
7
20
  export type ICustomSidePanel = IBaseCustomPanel
8
21
  & {
9
22
  /** Calcite icon */
10
- icon: IconName;
23
+ icon: Icon["icon"];
11
24
  /** Optional description */
12
25
  description?: string;
13
26
  /**
@@ -22,15 +35,5 @@ export type ICustomSidePanel = IBaseCustomPanel
22
35
  location: "sidebar";
23
36
  };
24
37
 
25
- export type IBaseCustomPanel = {
26
- /** Unique ID */
27
- id: string;
28
- name: string;
29
- location: "sidebar";
30
- renderer: ({ closePanel, insertText, closed, editorRef, }: {
31
- closePanel: (e: Event) => void;
32
- insertText: (text: string) => void;
33
- closed: boolean;
34
- editorRef: ArcgisArcadeEditor;
35
- }) => JsxNode;
36
- };
38
+ /** @internal */
39
+ export type ICustomPanel = ICustomSidePanel;
@@ -1,7 +1,8 @@
1
- import type { IEditorProfileDefinition, IPredefinedProfile } from "../profile/types.js";
1
+ import type { IEditorProfileDefinition, IPredefinedProfile } from "../../components/types.js";
2
2
  import type { Uri as Uri2 } from "monaco-editor/esm/vs/editor/editor.api.js";
3
3
  import type { ApiCategory } from "@arcgis/languages-api-utils/dist/types.js";
4
4
 
5
+ /** @internal */
5
6
  export const sqlExpression: {
6
7
  setProfileForModel: (modelId: string | Uri2, definition: IEditorProfileDefinition | IPredefinedProfile | undefined, apiContext?: { locale: string; }) => Promise<void>;
7
8
  getApiLibraryForModel: (modelId: string) => Promise<Array<ApiCategory>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/coding-components",
3
- "version": "5.0.0-next.161",
3
+ "version": "5.0.0-next.163",
4
4
  "description": "Contains components for editing code in different languages. The currently supported languages are html, css, json, TypeScript, JavaScript, and Arcade.",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -47,10 +47,10 @@
47
47
  "monaco-editor": "^0.55.1",
48
48
  "tslib": "^2.8.1",
49
49
  "vscode-languageserver-types": "^3.17.5",
50
- "@arcgis/languages-api-utils": "5.0.0-next.161",
51
- "@arcgis/arcade-languageservice": "5.0.0-next.161",
52
- "@arcgis/lumina": "5.0.0-next.161",
53
- "@arcgis/toolkit": "5.0.0-next.161"
50
+ "@arcgis/arcade-languageservice": "5.0.0-next.163",
51
+ "@arcgis/languages-api-utils": "5.0.0-next.163",
52
+ "@arcgis/lumina": "5.0.0-next.163",
53
+ "@arcgis/toolkit": "5.0.0-next.163"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@arcgis/core": "^5.0.0-next",
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import a from"./JV7SUK33.js";import{b as m,c as y,d as h}from"./3YF4QLXU.js";import{g as f}from"./NMIFSDFV.js";import{K as u}from"./DDFKURLO.js";export default $arcgis.t(([{d:b,f:d,j:g,l:F,m:M}])=>{var w=o=>{let e=o.variables[0],i=e&&e.type==="featureSet"?A(e):void 0,{apiVersion:t,bundles:a,hiddenApiItems:r}=o.toEditorProfileDefinition();return{apiVersion:t,bundles:a,variables:i?[i]:[],hiddenApiItems:r?.map(s=>s.toLowerCase())}};function A(o){let{name:e}=o,i=o.getDescription(),{definition:t}=o.toProfileVariableDefinition(),a={label:e,detail:e,insertText:e,insertTextMode:h.asIs,insertTextFormat:y.PlainText,kind:m.Field},r={name:e,description:i,type:"dictionary",properties:[],completion:a};if(!t||!("fields"in t))return r;let[s,l]=g(t.fields,i);return r.properties=s,a.documentation={kind:"markdown",value:l},r}var P={id:"field-calculation",variables:[{name:"$layer",type:"featureSet",description:"The layer being calculated."}]};function T(){return P}function I(o){if(!d(o))return;let e=T();if(!e)return;let i={variables:[],hiddenApiItems:o.hiddenApiItems?.map(t=>t.toLowerCase())};return e.variables.forEach(t=>{if(o.disabledVariables?.includes(t.name))return;let a=o.definitions[t.name];switch(t.type){case"featureSet":return b(a)?i.variables.push({...t,type:t.type,definition:a}):void 0;default:throw Error(`sdkVariable type not supported (yet) type: ${t.type}`)}}),i}var x="arcgis-sql-expression",p=class extends M{constructor(){super(x,{apiPath:"./assets/sql-language/api",apiPrefix:"sql-api.t9n."}),this._languageId=x,this._layerMap=new Map}updateFeatureLayerForModel(e,i){let t=this._getApiKey(e);this._layerMap.set(t,i)}getFeatureLayerForModel(e){let i=this._getApiKey(e);return this._layerMap.get(i)}async setProfileForModel(e,i,t={locale:"en"}){d(i)&&(i=I(i));let a=await f(t.locale,u("./assets/editor-profile/t9n"),"messages.");if(!a)throw new Error(`Failed to load the language bundle for ${t.locale}`);this.disposeForModel(e);let r=this._getApiKey(e),s=new F(i,a);this._modelToProfileMap.set(r,s);let l=w(s);this.updateApiContextForModel(e,{locale:t.locale,profile:l});let c=i?.variables?.find(v=>v.name==="$layer");c&&this.updateFeatureLayerForModel(e,c.definition)}},n=new p,k={setProfileForModel:n.setProfileForModel.bind(n),getApiLibraryForModel:n.getApiLibraryForModel.bind(n)};async function C(){return await import("./Y4MJ5J2U.js").then(m=>m.default)}return{a:n,b:C}},a)
@@ -1,6 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import a from"./JV7SUK33.js";import{b as f,c,d as p}from"./3YF4QLXU.js";import{f as x,g as v}from"./NMIFSDFV.js";import{K as m}from"./DDFKURLO.js";export default $arcgis.t(([{getDeclaredPixelMembers:S},{a:T,b:M,c:F,d:P,e:k,f:b,i:A,j:I,k:V,l:D,m:L}])=>{async function $(e){let{apiVersion:n,bundles:a,hiddenApiItems:i}=e.toEditorProfileDefinition(),t=await C(e.dictionaryVariables);return{apiVersion:n,bundles:a,variables:t,hiddenApiItems:i?.map(r=>r.toLowerCase())}}async function C(e,n=f.Variable){return await Promise.all(e.map(async a=>{switch(a.type){case"dictionary":return await q(a,n);case"pixel":return await B(a,n);case"voxel":case"feature":return await _(a,n);default:return K(a,n)}}))}function K(e,n){let{name:a,type:i}=e,t=e.getDescription(),r=n===f.Field?A(a,!1):a;return{name:a,description:t,type:i,completion:{label:a,detail:a,insertText:r,insertTextMode:p.asIs,insertTextFormat:c.PlainText,kind:n,documentation:{kind:"markdown",value:t}}}}async function _(e,n){let a=await e.loadSource(),{name:i}=e,t=e.getDescription(),r={label:i,detail:i,insertText:i,insertTextMode:p.asIs,insertTextFormat:c.PlainText,kind:n},s={name:i,description:t,type:"dictionary",properties:[],completion:r};if(!a)return s;let[o,l]=I(a.fields,t,!0);return s.properties=o,r.documentation={kind:"markdown",value:l},s}async function B(e,n){let a=await e.loadSource(),i=e.toProfileVariableDefinition();if(i.type!=="pixel")throw new Error("Incorrect definition passed to pixel variable");let{name:t}=e,r=e.getDescription(),s={label:t,detail:t,insertText:t,insertTextMode:p.asIs,insertTextFormat:c.PlainText,kind:n},o={name:t,description:r,type:"dictionary",properties:[],completion:s};if(!a||!i.definition)return o;let l=await S(a),[d,u]=V(l,r);return o.properties=d,s.documentation={kind:"markdown",value:u},o}async function q(e,n){let{name:a,dictionaryVariables:i}=e,t=e.getDescription(),r=i.reduce((s,o)=>{s!==""&&(s+=`
3
-
4
- `),s+=`**${o.name}**
5
- ${o.type}`;let l=o.getDescription();return l&&(s+=`
6
- ${l}`),s},t);return{name:a,description:t,type:"dictionary",properties:await C(i,f.Field),completion:{label:a,detail:a,insertText:a,insertTextMode:p.asIs,insertTextFormat:c.PlainText,kind:n,documentation:{kind:"markdown",value:r}}}}async function w(e="en"){let n=E.get(e);if(n)return n;if(!x.has(e))return await w("en");try{let a=await fetch(m(`./assets/arcade-language/profiles/arcade-profiles.t9n.${e}.json`));return a.ok?z(e,await a.json()):e==="en"?null:await w("en")}catch{return null}}var E=new Map;function z(e,n){let a=new Map;return n.forEach(i=>{a.set(i.id,i)}),E.set(e,a),a}async function G(e,n="en"){return(await w(n))?.get(e)??null}function H(e){return!!e&&typeof e=="object"&&"additionalVariables"in e&&Array.isArray(e.additionalVariables)}function J(e){return e?.map(h)}function h(e){switch(e.type){case"dictionary":return{...e,type:e.type,properties:J(e.properties)};case"array":return{...e,type:e.type,elementType:{type:"number",name:"number"}};default:return{...e,type:e.type}}}async function N(e,n="en"){if(!b(e))return;let a=await G(e.id,n);if(!a)return;let i={bundles:[...a.bundles],variables:[],hiddenApiItems:e.hiddenApiItems?.map(t=>t.toLowerCase())};return a.variables.forEach(t=>{if(e.disabledVariables?.includes(t.name))return;let r=e.definitions[t.name];switch(t.type){case"dictionary":return i.variables.push(h({...t,type:t.type,properties:Array.isArray(r)?[...r]:t.properties}));case"feature":return T(r)?i.variables.push({...t,type:"feature",definition:r}):void 0;case"pixel":return F(r)?i.variables.push({...t,type:t.type,definition:r}):void 0;case"voxel":return M(r)?i.variables.push({...t,type:t.type,definition:r}):void 0;case"featureSet":return P(r)?i.variables.push({...t,type:t.type,definition:r}):void 0;case"featureSetCollection":return k(r)?i.variables.push({...t,type:t.type,definition:r}):void 0;default:return i.variables.push(h(t))}}),H(e)&&i.variables.push(...e.additionalVariables??[]),i}var O=["catalog-footprint","catalog","csv","feature","geojson","knowledge-graph-sublayer","oriented-imagery","subtype-group","subtype-sublayer","wfs"];function Q(e){return!!e&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&O.includes(e.type)}var R={filterFsCollectionLayersFromMap:e=>Q(e)},g=class extends L{#e=new Map;constructor(){super("arcade",{apiPath:"./assets/arcade-language/api",apiPrefix:"arcade-api.t9n."})}async setProfileForModel(n,a,i={locale:"en"}){let t=this._getApiKey(n),r=(this.#e.get(t)||Promise.resolve()).then(async()=>{let o=a,l=b(o)?await N(o,i.locale):o,d=await v(i.locale,m("./assets/editor-profile/t9n"),"messages.");if(!d)throw new Error(`Failed to load the language bundle for ${i.locale}`);this.disposeForModel(n);let u=new D(l,d,i.locale,R);this._modelToProfileMap.set(t,u);let j=await $(u);this.updateApiContextForModel(n,{locale:i.locale,profile:j,snippets:i.snippets})}),s=r.finally(()=>{this.#e.get(t)===s&&this.#e.delete(t)});return this.#e.set(t,s),await r}},y=new g,ee={setProfileForModel:y.setProfileForModel.bind(y),getApiLibraryForModel:y.getApiLibraryForModel.bind(y)};return y},"applications/Components/arcadeEditorUtils",a)
@@ -1,3 +0,0 @@
1
- import type { Icon as Icon } from "@esri/calcite-components/components/calcite-icon";
2
-
3
- export type IconName = Icon["icon"];
@@ -1,21 +0,0 @@
1
- export interface IEditorCodeSuggestionGroup {
2
- /** Label for the suggestion group */
3
- label: string;
4
- /** List of suggestions for the group */
5
- suggestions: IEditorCodeSuggestion[];
6
- }
7
-
8
- /** Defines a code suggestion */
9
- export interface IEditorCodeSuggestion {
10
- /** A short label for the suggestion. Can be thought as a title */
11
- label: string;
12
- /** A short description that will be showed below the label in the list of suggestions panel */
13
- description?: string;
14
- /** Markdown string that will be rendered along with the code in the detail panel */
15
- documentation?: string;
16
- /** The code for the suggestion. Will be injected in the editor is selected */
17
- code: string;
18
- }
19
-
20
- /** @param item */
21
- export function isSuggestionGroups(item: unknown): item is IEditorCodeSuggestionGroup[];
@@ -1,4 +0,0 @@
1
- export * from "./arcade-executor";
2
- export type * from "./profile/types";
3
- export * from "./editor-suggestions";
4
-