@esri/solutions-components 5.1.0-next.141 → 5.1.0-next.142

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 (29) hide show
  1. package/dist/cdn/{AYQT4HC4.js → 34JROLRM.js} +1 -1
  2. package/dist/cdn/4WJ2UJWQ.js +2 -0
  3. package/dist/cdn/{PV6MK2E6.js → FV4F6RW3.js} +1 -1
  4. package/dist/cdn/{QTZMCFZB.js → LLPT3R4B.js} +16 -16
  5. package/dist/cdn/{7J2F4TFI.js → PUQBEN7F.js} +1 -1
  6. package/dist/cdn/{TSYIZSCP.js → RYEEEMFO.js} +11 -1
  7. package/dist/cdn/S6U6SXMD.js +2 -0
  8. package/dist/cdn/{RMCQZMLA.js → TIRNZIMX.js} +1 -1
  9. package/dist/cdn/{OYBEDO63.js → UVOAWVML.js} +1 -1
  10. package/dist/cdn/{SAJPXZDW.js → WCOEPRRK.js} +1 -1
  11. package/dist/cdn/{NN52IXXG.js → YM3CRTWP.js} +1 -1
  12. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.en.json +1 -1
  13. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.json +1 -1
  14. package/dist/cdn/index.js +1 -1
  15. package/dist/chunks/converter.js +114 -105
  16. package/dist/chunks/designSolution.js +11 -1
  17. package/dist/chunks/solution-builder-assistant.js +56 -27
  18. package/dist/chunks/updateDesign.js +1 -1
  19. package/dist/components/arcgis-solutions-assistant/customElement.js +182 -174
  20. package/dist/components/solution-builder-assistant/customElement.d.ts +2 -0
  21. package/dist/components/solution-builder-assistant/customElement.js +3 -2
  22. package/dist/components/solution-builder-assistant/index.js +1 -0
  23. package/dist/docs/api.json +1 -1
  24. package/dist/docs/docs.json +1 -1
  25. package/dist/docs/web-types.json +1 -1
  26. package/dist/solutions-components_commit.txt +8 -5
  27. package/package.json +1 -1
  28. package/dist/cdn/LDNPRHOM.js +0 -2
  29. package/dist/cdn/WPGT2HLS.js +0 -2
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function m() {
2
+ function h() {
3
3
  return {
4
4
  renderer: {
5
5
  type: "simple",
@@ -248,7 +248,7 @@ function m() {
248
248
  }
249
249
  };
250
250
  }
251
- function h() {
251
+ function b() {
252
252
  return {
253
253
  renderer: {
254
254
  type: "simple",
@@ -276,6 +276,13 @@ class u {
276
276
  polygon: "esriGeometryPolygon"
277
277
  };
278
278
  }
279
+ static {
280
+ this.simpleTypeLookup = {
281
+ esriGeometryPoint: "Point",
282
+ esriGeometryPolyline: "Polyline",
283
+ esriGeometryPolygon: "Polygon"
284
+ };
285
+ }
279
286
  static {
280
287
  this.drawingToolLookup = {
281
288
  esriGeometryPoint: "esriFeatureEditToolPoint",
@@ -301,59 +308,61 @@ class u {
301
308
  );
302
309
  }
303
310
  dumpToLlmTemplate() {
304
- const e = this.structure?.buildSolution?.solution, i = Object.entries(e?.strings || {}).map(([s, r]) => ({
311
+ const e = this.structure?.buildSolution?.solution, i = Object.entries(e?.strings || {}).map(([s, o]) => ({
305
312
  key: s,
306
- value: r.value,
307
- description: r.description
313
+ value: o.value,
314
+ description: o.description
308
315
  })), t = {
309
316
  title: e?.title,
310
317
  description: e?.description,
311
318
  tags: e?.tags,
312
319
  strings: i
313
- }, o = this.structure?.buildSolution?.items, n = Object.entries(o || {}).map(([s, r]) => ({
320
+ }, r = this.structure?.buildSolution?.items, l = Object.entries(r || {}).map(([s, o]) => ({
314
321
  id: s,
315
- title: r.title,
316
- description: r.description,
317
- type: r.type
322
+ title: o.title,
323
+ description: o.description,
324
+ type: o.type
318
325
  }));
319
- let l = null;
320
- for (const [s, r] of Object.entries(o || {})) {
321
- if (r.type !== "Feature Layer (hosted)")
326
+ let n = null;
327
+ for (const [s, o] of Object.entries(r || {})) {
328
+ if (o.type !== "Feature Layer (hosted)")
322
329
  continue;
323
- const d = [];
324
- for (const p of r.service?.layers || []) {
325
- const c = this.getFields(p);
326
- d.push({
327
- id: p.id,
330
+ const p = [];
331
+ for (const d of o.service?.layers || []) {
332
+ const y = this.getFields(d), c = {
333
+ id: d.id,
328
334
  type: "",
329
- name: p.name,
335
+ typeMutable: !0,
336
+ name: d.name,
330
337
  customFields: [],
331
- requiredFields: c,
338
+ requiredFields: y,
332
339
  systemFields: []
333
- });
340
+ };
341
+ d.geometryType && (c.type = u.simpleTypeLookup[d.geometryType] || "", c.typeMutable = !1), p.push(c);
334
342
  }
335
- for (const p of r.service?.tables || []) {
336
- const c = this.getFields(p);
337
- d.push({
338
- id: p.id,
343
+ for (const d of o.service?.tables || []) {
344
+ const y = this.getFields(d);
345
+ p.push({
346
+ id: d.id,
339
347
  type: "Table",
340
- name: p.name,
348
+ typeMutable: !1,
349
+ name: d.name,
341
350
  customFields: [],
342
- requiredFields: c,
351
+ requiredFields: y,
343
352
  systemFields: []
344
353
  });
345
354
  }
346
- l = {
355
+ n = {
347
356
  itemId: s,
348
- addLayers: r.addLayers,
349
- layers: d
357
+ addLayers: o.addLayers,
358
+ layers: p
350
359
  };
351
360
  break;
352
361
  }
353
362
  return {
354
363
  solution: t,
355
- items: n,
356
- featureLayer: l ?? {
364
+ items: l,
365
+ featureLayer: n ?? {
357
366
  itemId: "",
358
367
  addLayers: !1,
359
368
  layers: []
@@ -392,124 +401,124 @@ class u {
392
401
  for (const s of e.featureLayer.layers)
393
402
  this.llmFsLookup[e.featureLayer.itemId][s.id] = s;
394
403
  }
395
- for (const [s, r] of Object.entries(this.buildSolution.items))
396
- r.type === "Feature Layer (hosted, view)" && (this.llmFsLookup[s] = { ...this.llmFsLookup[r.source] });
404
+ for (const [s, o] of Object.entries(this.buildSolution.items))
405
+ o.type === "Feature Layer (hosted, view)" && (this.llmFsLookup[s] = { ...this.llmFsLookup[o.source] });
397
406
  i.title = e.solution.title, i.description = e.solution.description, i.tags = e.solution.tags;
398
407
  const t = i.strings;
399
408
  for (const s of e.solution.strings)
400
409
  t[s.key] && (t[s.key].value = s.value);
401
- const o = {}, n = /* @__PURE__ */ new Set(), l = this.buildSolution.items;
410
+ const r = {}, l = /* @__PURE__ */ new Set(), n = this.buildSolution.items;
402
411
  for (const s of e.items) {
403
- const r = l[s.id];
404
- if (r)
405
- if (r.title = s.title, r.description = s.description, r.type === "Web Map")
406
- this.applyWebMap(r);
407
- else if (r.type === "Feature Layer (hosted)") {
408
- this.applyFeatureService(r, s.id, !1);
409
- const d = b(r);
410
- r.data = d, o[s.id] = d;
411
- } else r.type === "Feature Layer (hosted, view)" && (this.applyFeatureService(r, s.id, !0), n.add(s.id));
412
+ const o = n[s.id];
413
+ if (o)
414
+ if (o.title = s.title, o.description = s.description, o.type === "Web Map")
415
+ this.applyWebMap(o);
416
+ else if (o.type === "Feature Layer (hosted)") {
417
+ this.applyFeatureService(o, s.id, !1);
418
+ const p = g(o);
419
+ o.data = p, r[s.id] = p;
420
+ } else o.type === "Feature Layer (hosted, view)" && (this.applyFeatureService(o, s.id, !0), l.add(s.id));
412
421
  }
413
- for (const s of n) {
414
- const r = l[s];
415
- r.data = o[r.source];
422
+ for (const s of l) {
423
+ const o = n[s];
424
+ o.data = r[o.source];
416
425
  }
417
426
  return this.structure;
418
427
  }
419
428
  applyWebMap(e) {
420
429
  if (!e.layerSources)
421
430
  return;
422
- for (const o of [...e.layers || [], ...e.tables || []]) {
423
- const [n, l] = this.extractIdAndLayerId(o.url), s = this.llmFsLookup[n]?.[l];
424
- s && (o.title = s.name);
431
+ for (const r of [...e.layers || [], ...e.tables || []]) {
432
+ const [l, n] = this.extractIdAndLayerId(r.url), s = this.llmFsLookup[l]?.[n];
433
+ s && (r.title = s.name);
425
434
  }
426
435
  if (!(e.layers?.length === 0 && e.tables?.length === 0))
427
436
  return;
428
437
  const t = crypto.randomUUID().replace(/-/gu, "").substring(0, 10);
429
- for (const o of e.layerSources) {
430
- const n = this.llmFsLookup[o];
431
- if (n)
432
- for (const [l, s] of Object.entries(n)) {
433
- const r = Number(l), d = s.type.toLowerCase() === "table", p = {
434
- id: `${t}-layer-${r}`,
438
+ for (const r of e.layerSources) {
439
+ const l = this.llmFsLookup[r];
440
+ if (l)
441
+ for (const [n, s] of Object.entries(l)) {
442
+ const o = Number(n), p = s.type.toLowerCase() === "table", d = {
443
+ id: `${t}-layer-${o}`,
435
444
  title: s.name,
436
- url: `{{${o}.layer${r}.url}}`,
437
- itemId: `{{${o}.layer${r}.itemId}}`
445
+ url: `{{${r}.layer${o}.url}}`,
446
+ itemId: `{{${r}.layer${o}.itemId}}`
438
447
  };
439
- d ? e.tables.push(p) : (p.layerType = "ArcGISFeatureLayer", e.layers.push(p));
448
+ p ? e.tables.push(d) : (d.layerType = "ArcGISFeatureLayer", e.layers.push(d));
440
449
  }
441
450
  }
442
451
  }
443
452
  extractIdAndLayerId(e) {
444
- const i = e.replace(/[{}]/gu, "").split("."), t = i[0], o = Number.parseInt(i[1].replace("layer", ""));
445
- return [t, o];
453
+ const i = e.replace(/[{}]/gu, "").split("."), t = i[0], r = Number.parseInt(i[1].replace("layer", ""));
454
+ return [t, r];
446
455
  }
447
456
  applyFeatureService(e, i, t = !1) {
448
- const o = e.source || i, n = this.llmFsLookup[o];
457
+ const r = e.source || i, l = this.llmFsLookup[r];
449
458
  for (const s of [...e.service.layers, ...e.service.tables])
450
- this.applyLayer(s, n, t);
451
- e.addLayers && !t && this.addNewLayers(e, n);
452
- const l = e.service.layers?.length === 0 && e.service.tables?.length === 0;
453
- t && l && this.addNewViewLayers(e, i, n);
459
+ this.applyLayer(s, l, t);
460
+ e.addLayers && !t && this.addNewLayers(e, l);
461
+ const n = e.service.layers?.length === 0 && e.service.tables?.length === 0;
462
+ t && n && this.addNewViewLayers(e, i, l);
454
463
  }
455
464
  addNewLayers(e, i) {
456
- for (const [t, o] of Object.entries(i)) {
457
- const l = { id: Number(t) };
458
- this.applyLayer(l, i), o.type.toLowerCase() === "table" ? e.service.tables.push(l) : e.service.layers.push(l);
465
+ for (const [t, r] of Object.entries(i)) {
466
+ const n = { id: Number(t) };
467
+ this.applyLayer(n, i), r.type.toLowerCase() === "table" ? e.service.tables.push(n) : e.service.layers.push(n);
459
468
  }
460
469
  }
461
470
  addNewViewLayers(e, i, t) {
462
- const o = e.source;
463
- for (const [n, l] of Object.entries(t)) {
464
- const s = Number(n), r = l.type.toLowerCase() === "table", d = {
471
+ const r = e.source;
472
+ for (const [l, n] of Object.entries(t)) {
473
+ const s = Number(l), o = n.type.toLowerCase() === "table", p = {
465
474
  adminLayerInfo: {
466
- geometryField: r ? null : { name: "Shape" },
475
+ geometryField: o ? null : { name: "Shape" },
467
476
  viewLayerDefinition: {
468
- sourceServiceName: `{{${o}.name}}`,
477
+ sourceServiceName: `{{${r}.name}}`,
469
478
  sourceLayerId: s,
470
479
  sourceLayerFields: "*"
471
480
  }
472
481
  },
473
482
  id: s,
474
- name: l.name,
483
+ name: n.name,
475
484
  extent: `{{${i}.solutionExtent}}`,
476
485
  maxRecordCount: 2e3
477
486
  };
478
- r ? e.service.tables.push(d) : e.service.layers.push(d);
487
+ o ? e.service.tables.push(p) : e.service.layers.push(p);
479
488
  }
480
489
  }
481
490
  applyLayer(e, i, t = !1) {
482
- const o = i[e.id];
483
- if (!o || (e.name = o.name, t))
491
+ const r = i[e.id];
492
+ if (!r || (e.name = r.name, t))
484
493
  return;
485
- const n = u.typeLookup[o.type.toLowerCase()] || o.type;
486
- n.toLowerCase() === "table" ? e.type = n : e.geometryType = n, e.editFieldsInfo = this.editFieldsInfo(), e.globalIdField = "globalid", e.objectIdField = "objectid", e.uniqueIdField = { name: "objectid", isSystemMaintained: !0 }, e.hasAttachments = !0, this.updateRelationships(e, i), this.updateFields(e, o), this.updateTemplates(e), this.updateDrawingInfo(e);
494
+ const l = u.typeLookup[r.type.toLowerCase()] || r.type;
495
+ l.toLowerCase() === "table" ? e.type = l : e.geometryType = l, e.editFieldsInfo = this.editFieldsInfo(), e.globalIdField = "globalid", e.objectIdField = "objectid", e.uniqueIdField = { name: "objectid", isSystemMaintained: !0 }, e.hasAttachments = !0, this.updateRelationships(e, i), this.updateFields(e, r), this.updateTemplates(e), this.updateDrawingInfo(e);
487
496
  }
488
497
  updateRelationships(e, i) {
489
498
  const t = e.relationships || [];
490
- for (const o of t) {
491
- const n = i[o.relatedTableId];
492
- n && (o.name = n.name);
499
+ for (const r of t) {
500
+ const l = i[r.relatedTableId];
501
+ l && (r.name = l.name);
493
502
  }
494
503
  }
495
504
  updateFields(e, i) {
496
- const t = [], o = [
505
+ const t = [], r = [
497
506
  [!1, i.customFields],
498
507
  [!0, i.requiredFields],
499
508
  [!0, i.systemFields]
500
509
  ];
501
- for (const [n, l] of o)
502
- if (Array.isArray(l))
503
- for (const s of l) {
504
- const r = {
510
+ for (const [l, n] of r)
511
+ if (Array.isArray(n))
512
+ for (const s of n) {
513
+ const o = {
505
514
  name: s.name,
506
515
  alias: s.alias,
507
516
  type: u.fieldTypeToEsri[s.type] || s.type,
508
517
  description: JSON.stringify({ value: s.description, fieldValueType: "" }, null, 0),
509
518
  domain: this.createDomain(s.choiceList, s.name),
510
- required: n
519
+ required: l
511
520
  };
512
- s.type?.toLowerCase() === "string" && (r.length = s.length ?? 256), (s.type === "oid" || s.type === "globalid") && (r.editable = !1, r.nullable = !1), t.push(r);
521
+ s.type?.toLowerCase() === "string" && (o.length = s.length ?? 256), (s.type === "oid" || s.type === "globalid") && (o.editable = !1, o.nullable = !1), t.push(o);
513
522
  }
514
523
  e.fields = t;
515
524
  }
@@ -525,7 +534,7 @@ class u {
525
534
  }
526
535
  updateDrawingInfo(e) {
527
536
  if (e.drawingTool === "esriGeometryPoint")
528
- e.drawingInfo = h();
537
+ e.drawingInfo = b();
529
538
  else
530
539
  return;
531
540
  }
@@ -545,7 +554,7 @@ class u {
545
554
  };
546
555
  }
547
556
  }
548
- function b(a) {
557
+ function g(a) {
549
558
  const e = a.service, i = {
550
559
  layers: [],
551
560
  tables: []
@@ -553,19 +562,19 @@ function b(a) {
553
562
  for (const t of e.layers || [])
554
563
  i.layers.push({
555
564
  id: t.id,
556
- formInfo: y(t),
565
+ formInfo: m(t),
557
566
  popupInfo: f(t),
558
- layerDefinition: g(t)
567
+ layerDefinition: F(t)
559
568
  });
560
569
  for (const t of e.tables || [])
561
570
  i.tables.push({
562
571
  id: t.id,
563
- formInfo: y(t),
572
+ formInfo: m(t),
564
573
  popupInfo: f(t)
565
574
  });
566
575
  return i;
567
576
  }
568
- function y(a) {
577
+ function m(a) {
569
578
  const e = [];
570
579
  for (const t of a.fields)
571
580
  t.required || e.push({
@@ -573,7 +582,7 @@ function y(a) {
573
582
  type: "field",
574
583
  editableExpression: "expr/system/true",
575
584
  fieldName: t.name,
576
- inputType: F(t.type, t.domain, t.length)
585
+ inputType: L(t.type, t.domain, t.length)
577
586
  });
578
587
  const i = a.relationships || [];
579
588
  for (const t of i)
@@ -598,11 +607,11 @@ function y(a) {
598
607
  }
599
608
  function f(a) {
600
609
  const e = [], i = [];
601
- for (const o of a.fields)
602
- o.required || i.push({
603
- fieldName: o.name,
610
+ for (const r of a.fields)
611
+ r.required || i.push({
612
+ fieldName: r.name,
604
613
  isEditable: !0,
605
- label: o.alias,
614
+ label: r.alias,
606
615
  visible: !0
607
616
  });
608
617
  e.push({
@@ -612,14 +621,14 @@ function f(a) {
612
621
  });
613
622
  const t = a.relationships || [];
614
623
  if (t.length && a.type !== "Table")
615
- for (const o of t)
624
+ for (const r of t)
616
625
  e.push({
617
626
  type: "relationship",
618
627
  description: "",
619
628
  displayCount: 3,
620
629
  displayType: "list",
621
630
  orderByFields: [{ field: "created_date", order: "asc" }],
622
- relationshipId: o.id
631
+ relationshipId: r.id
623
632
  });
624
633
  return e.push({
625
634
  type: "attachments",
@@ -632,10 +641,10 @@ function f(a) {
632
641
  title: a.name
633
642
  };
634
643
  }
635
- function g(a) {
636
- return a.geometryType === "esriGeometryPoint" ? { drawingInfo: m() } : { drawingInfo: {} };
644
+ function F(a) {
645
+ return a.geometryType === "esriGeometryPoint" ? { drawingInfo: h() } : { drawingInfo: {} };
637
646
  }
638
- function F(a, e, i) {
647
+ function L(a, e, i) {
639
648
  return a === "esriFieldTypeString" && !e ? { type: "text-box", maxLength: i || 255, minLength: 0 } : a === "esriFieldTypeString" && e ? { type: "combo-box", noValueOptionLabel: "No value", showNoValueOption: !0 } : ["esriFieldTypeInteger", "esriFieldTypeDouble"].includes(a) ? { type: "text-box", minLength: 0 } : a === "esriFieldTypeDate" ? { type: "datetime-picker", includeTime: !1 } : { type: "text-box", maxLength: i || 255, minLength: 0 };
640
649
  }
641
650
  export {
@@ -48,7 +48,7 @@ Please review the draft design and let me know if you’d like to make any chang
48
48
  \r
49
49
  ## Feature Layers\r
50
50
  - Generate a detailed, normalized database schema for each Feature Layer\r
51
- - Supported layer types: \`Point\`, \`Line\`, \`Polygon\`, \`Table\`\r
51
+ - Supported layer types: \`Point\`, \`Polyine\`, \`Polygon\`, \`Table\`\r
52
52
  \r
53
53
  ### Layer Naming Rules\r
54
54
  - Layer \`name\` values are user-facing and must be written in Title Case\r
@@ -59,9 +59,19 @@ Please review the draft design and let me know if you’d like to make any chang
59
59
  - If \`addLayers: false\`:\r
60
60
  - Layers cannot be added or removed\r
61
61
  - Layer \`id\` values are immutable\r
62
+ - Do not edit the \`typeMutable\` property of layers\r
62
63
  - If \`addLayers: true\`:\r
63
64
  - Layers may be added or removed\r
64
65
  - Each new layer must receive a unique \`id\` starting at 0\r
66
+ - Each new layer must have \`typeMutable\` property set to true\r
67
+ \r
68
+ ### Layer Type Mutability Rule\r
69
+ - If \`typeMutable: true\`:\r
70
+ - The layer type must be chosen: \`Point\`, \`Polyline\`, \`Polygon\`, \`Table\`\r
71
+ - The layer type may be changed without restriction\r
72
+ - If \`typeMutable: false\`:\r
73
+ - The layer type may never be changed\r
74
+ - Requests to change the layer type should be ignored\r
65
75
  \r
66
76
  ### Required Fields\r
67
77
  - Fields in \`requiredFields\` are protected:\r