@arcgis/core 5.2.0-next.137 → 5.2.0-next.138
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/analysis/LineOfSightAnalysisObserver.d.ts +12 -0
- package/analysis/LineOfSightAnalysisObserver.js +1 -1
- package/analysis/LineOfSightAnalysisTarget.d.ts +12 -0
- package/analysis/LineOfSightAnalysisTarget.js +1 -1
- package/arcade/featureset/sources/FeatureLayerParquet.js +1 -1
- package/arcgisGlobal.d.ts +4 -0
- package/assets/components/assets/icon/blockHeightMedium16.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium24.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium32.json +1 -0
- package/assets/components/assets/icon/blockHeightShort16.json +1 -0
- package/assets/components/assets/icon/blockHeightShort24.json +1 -0
- package/assets/components/assets/icon/blockHeightShort32.json +1 -0
- package/assets/components/assets/icon/blockHeightTall16.json +1 -0
- package/assets/components/assets/icon/blockHeightTall24.json +1 -0
- package/assets/components/assets/icon/blockHeightTall32.json +1 -0
- package/assets/components/assets/icon/cursorCircle16.json +1 -0
- package/assets/components/assets/icon/cursorCircle24.json +1 -0
- package/assets/components/assets/icon/cursorCircle32.json +1 -0
- package/assets/components/assets/icon/dictionary16.json +1 -0
- package/assets/components/assets/icon/dictionary24.json +1 -0
- package/assets/components/assets/icon/dictionary32.json +1 -0
- package/assets/components/assets/icon/jobDependency16.json +1 -0
- package/assets/components/assets/icon/jobDependency24.json +1 -0
- package/assets/components/assets/icon/jobDependency32.json +1 -0
- package/assets/components/assets/icon/referenceChip16.json +1 -0
- package/assets/components/assets/icon/referenceChip24.json +1 -0
- package/assets/components/assets/icon/referenceChip32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4e6f95d8c624d513849a.js → 05963f57cbe5a5249496.js} +1 -1
- package/assets/esri/core/workers/chunks/{0b8681ca4a83e97f1f71.js → 067de1910190da228291.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c0fd1c6cda44e9f40ab.js → 070684943698fa43c2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc1cb4b9a02e6c78deb7.js → 076e8d2e08ff2a013736.js} +1 -1
- package/assets/esri/core/workers/chunks/{c10e040368065411506a.js → 10445313d0d57b34511b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d537c59b46cdaaf66034.js → 1188d0a136fffc009643.js} +1 -1
- package/assets/esri/core/workers/chunks/{20af3f085f60c32c6c53.js → 178083d8ed7707b45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5efe3e800c6e23efcf3.js → 1819c45655c836b9a8d7.js} +1 -1
- package/assets/esri/core/workers/chunks/1b946714ca4a1a7359d4.js +2 -0
- package/assets/esri/core/workers/chunks/{d8d8b38ac8a91d9e45fc.js → 1cc744ab5eee5ee3bed8.js} +1 -1
- package/assets/esri/core/workers/chunks/{05e39b4de7f62c5b22cc.js → 20f75cc777af13fa249b.js} +1 -1
- package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +2 -0
- package/assets/esri/core/workers/chunks/34570e6bbf559f18c1a5.js +1 -0
- package/assets/esri/core/workers/chunks/{60f6d5da9480dd36e877.js → 3dddae78286d05eb10fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9efd30bbd02ec0d1031b.js → 3ec3589f6e74d7cb87cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bec054fca104f3bf141.js → 3f776d9fd2ab68b21fca.js} +1 -1
- package/assets/esri/core/workers/chunks/402a82c77420254831bc.js +1 -0
- package/assets/esri/core/workers/chunks/{e2ebf0ea3af2e6907987.js → 406f24ec13eb30d43405.js} +1 -1
- package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +1 -0
- package/assets/esri/core/workers/chunks/{ddedc414bb478b376221.js → 46b2d4addfc73f9183a4.js} +1 -1
- package/assets/esri/core/workers/chunks/498d6dfd3bb0d3490548.js +1 -0
- package/assets/esri/core/workers/chunks/{36ef86701883a20dd6f6.js → 4a640548032355e57acd.js} +1 -1
- package/assets/esri/core/workers/chunks/5566f14afb63065e438f.js +1 -0
- package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js → 590e6c70206122e4cc3c.js} +2 -2
- package/assets/esri/core/workers/chunks/{54860dd53a46cf4c47f3.js → 59295b99bdff4045a0e7.js} +1 -1
- package/assets/esri/core/workers/chunks/5aeb5e18514644fe2cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{5da86409d70098fc6a10.js → 5b3cfe95314a75a735c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a54678bfa0f1807b61cd.js → 5c855af73ee3c3e764fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8b7e6198c2d0c37c9a0.js → 5e90c1b49f2b7e21d05a.js} +4 -4
- package/assets/esri/core/workers/chunks/{30f808cac8a34f95ea6e.js → 6079d27f4ab319fb8f0c.js} +1 -1
- package/assets/esri/core/workers/chunks/66c2a28a851130b87c04.js +1 -0
- package/assets/esri/core/workers/chunks/{dac90b3631f7f7158f68.js → 67f15538c51838201fc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js → 68d8ae42ab71d01a70a5.js} +2 -2
- package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +1 -0
- package/assets/esri/core/workers/chunks/{864e7030c4ddbfcf0114.js → 6ccf9535013fe672c93b.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba7f0cf7e495d3ec2d55.js → 6e62581d933e7298d1f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{83b5dd4029e00abd80bf.js → 700b1d5bc67b7e1b3ff3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9fea72cc222a30ef2f9.js → 72399062767abdfb0bee.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a7fbfd77002a24bf737.js → 747461bb6a1bc2f0a64d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c333f6ed42985bb2b11f.js → 7851aef196eea5d6c94e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f0b6bd6fab5320c3082f.js → 7a05b18f655c1167ce0a.js} +1 -1
- package/assets/esri/core/workers/chunks/{04296b75d0f81fbd1bb5.js → 864194927d05ebc4cc31.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c4a13a9f0b305394a26.js → 876f7633c15f1e31078d.js} +1 -1
- package/assets/esri/core/workers/chunks/{62298dba3f6cbdc3f4ae.js → 879b2f0ff1977bca9376.js} +1 -1
- package/assets/esri/core/workers/chunks/{b547b3bce729c9dac90d.js → 898359be6996fd9763b8.js} +1 -1
- package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +1 -0
- package/assets/esri/core/workers/chunks/8dc1c3042267618fd710.js +2 -0
- package/assets/esri/core/workers/chunks/{625f02db93d7fbf175ca.js → 9001e9a1e81bce175ddd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ffa6c8d93d3443834c6.js → 912080c90b5cc2e817cf.js} +1 -1
- package/assets/esri/core/workers/chunks/96c50a0dda0f1503ef92.js +2 -0
- package/assets/esri/core/workers/chunks/{13e4379441499599c3b5.js → 9cbde13e536676767900.js} +1 -1
- package/assets/esri/core/workers/chunks/{408db4f32850b77264ae.js → 9cd3fcb5fca6f9dbbcd8.js} +1 -1
- package/assets/esri/core/workers/chunks/a054da6cbd8ee4774a57.js +1 -0
- package/assets/esri/core/workers/chunks/{468fa166608ffc9108d9.js → a05790444115e4cf1bcc.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1f2685782b423ef87a6.js → a556dd4e9e6d35e33a2c.js} +1 -1
- package/assets/esri/core/workers/chunks/{00d576d355599c88931e.js → bc38def1983089514e4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0725e515f3004bdd5c56.js → ca2adcbcf44454484fd5.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3507b9e831ffd7a6bf8.js → cca8bd07bcd1d267a2e8.js} +1 -1
- package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +1 -0
- package/assets/esri/core/workers/chunks/{1d6b2a64f4e40e5cc13d.js → d201fbf3ceff946d2bd6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4439078780d9ba49fd26.js → d51bb11baadc741c46bc.js} +1 -1
- package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +1 -0
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +1 -0
- package/assets/esri/core/workers/chunks/e630f3c56c077cb2bd8e.js +1 -0
- package/assets/esri/core/workers/chunks/e81173724e8de8c1e65b.js +1 -0
- package/assets/esri/core/workers/chunks/{2025288bed125594ceda.js → f6e62d2d279a328cbed7.js} +1 -1
- package/assets/esri/core/workers/chunks/{47c19778fcee7154ca38.js → f8bc474434fd365ab174.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a20dc26cb9c7b2087cf.js → f95a1f878c9c1146180e.js} +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-TW.json +1 -1
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/Component.glsl.js +3 -3
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/FocusArea.glsl.js +8 -10
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-CIE8Wfmb.js +1 -1
- package/chunks/LineMarker.glsl.js +35 -42
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorAffineTransform.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorDistance.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/Path.glsl.js +2 -2
- package/chunks/Point2D.js +1 -1
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +50 -56
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/Terrain.glsl.js +2 -2
- package/chunks/Transformation2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/config.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/editing/fieldUtils.d.ts +12 -0
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/interfaces.d.ts +15 -18
- package/kernel.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/list/LayerItemCollection.d.ts +1 -0
- package/layers/list/types.d.ts +5 -1
- package/layers/support/TimeSeriesCalculation.d.ts +1 -1
- package/layers/support/TimeSeriesCalculation.js +1 -1
- package/layers/support/dataSeriesUtils.d.ts +10 -0
- package/layers/support/timeSeriesUtils.js +17 -6
- package/libs/lyr3d/Lyr3DModule.js +1 -1
- package/networks/UtilityNetwork.d.ts +15 -0
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +4 -4
- package/popup/FeatureContent.d.ts +14 -1
- package/popup/FeatureContent.js +1 -1
- package/popup/FeatureContentCollection.d.ts +4 -10
- package/popup/FeatureContentCollection.js +1 -1
- package/popup/actions.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/renderers/support/RenderingInfo.js +1 -1
- package/renderers/support/renderingInfoUtils.js +1 -1
- package/renderers/visualVariables/SizeVariable.d.ts +16 -20
- package/renderers/visualVariables/support/SizeStop.d.ts +6 -2
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.d.ts +7 -0
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/opacity.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
- package/smartMapping/statistics/histogramForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/histogramForTimeSeries.js +2 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +2 -0
- package/smartMapping/statistics/support/timeSeriesUtils.js +24 -0
- package/smartMapping/statistics/types.d.ts +50 -0
- package/symbols/cim/CIMPlacements.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextParams.js +1 -1
- package/views/2d/layers/SketchLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/ExceedsLimitCache.js +1 -1
- package/views/2d/layers/features/schema/TimeSchema.js +2 -0
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/2d/types.d.ts +2 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +24 -0
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
- package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +12 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/focusArea/FocusArea.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/SelectionManager.d.ts +3 -3
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/options/bindViewToolOptions.js +1 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchLabelOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
- package/views/interactive/sketch/SketchValueOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchValueOptions.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +3 -0
- package/views/interactive/snapping/SnappingOptions.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
- package/views/layers/SketchLayerView.d.ts +34 -0
- package/views/layers/SketchLayerView.js +2 -0
- package/views/layers/types.d.ts +3 -2
- package/views/selection/types.d.ts +15 -4
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.d.ts +4 -0
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +5 -1
- package/widgets/Bookmarks/types.d.ts +2 -0
- package/widgets/Editor/EditorViewModel.d.ts +31 -30
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/types.d.ts +44 -0
- package/widgets/Editor.d.ts +30 -27
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +6 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Histogram/types.d.ts +10 -2
- package/widgets/HistogramRangeSlider/types.d.ts +4 -1
- package/widgets/LayerList/LayerListViewModel.d.ts +2 -1
- package/widgets/Legend/LegendViewModel.d.ts +2 -0
- package/widgets/Legend/styles/card/CardView.d.ts +2 -0
- package/widgets/Legend/styles/classic/ClassicView.d.ts +4 -1
- package/widgets/Legend.d.ts +3 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +7 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/types.d.ts +9 -0
- package/widgets/OrientedImageryViewer.d.ts +7 -0
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/types.d.ts +9 -2
- package/widgets/Sketch/SketchViewModel.d.ts +32 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.d.ts +27 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/types.d.ts +58 -13
- package/widgets/Slider.d.ts +6 -0
- package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.d.ts +3 -0
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/types.d.ts +30 -7
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +21 -11
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
- package/widgets/support/FilterBuilder/types.d.ts +28 -0
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +24 -0
- package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
- package/widgets/support/FilterCondition/types.d.ts +16 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/SnappingControls/snappingLayerListUtils.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0606ab6fdfc1dfea3856.js +0 -1
- package/assets/esri/core/workers/chunks/1289204f8ca96032c17a.js +0 -1
- package/assets/esri/core/workers/chunks/12b5a645c0987a0efe54.js +0 -2
- package/assets/esri/core/workers/chunks/17b938ba49fb1e7ab8c4.js +0 -1
- package/assets/esri/core/workers/chunks/1dbb3e25e005a8220779.js +0 -2
- package/assets/esri/core/workers/chunks/3d6fef25af7e1a51e1bd.js +0 -1
- package/assets/esri/core/workers/chunks/55ae00f33f5240a73a50.js +0 -1
- package/assets/esri/core/workers/chunks/74211d096cc3296e0968.js +0 -1
- package/assets/esri/core/workers/chunks/7926faab76a721a2e1c4.js +0 -1
- package/assets/esri/core/workers/chunks/96c3900685cfb2a8ca12.js +0 -1
- package/assets/esri/core/workers/chunks/ad28486bc6afaa346de5.js +0 -1
- package/assets/esri/core/workers/chunks/ad29c729e90b5866713c.js +0 -1
- package/assets/esri/core/workers/chunks/b72a2514aa4cc4ae7d1b.js +0 -1
- package/assets/esri/core/workers/chunks/be761749f8d77fbd9df5.js +0 -1
- package/assets/esri/core/workers/chunks/d4f55e2b1ace7867a3b8.js +0 -1
- package/assets/esri/core/workers/chunks/dbfd25aa0d19aed5890c.js +0 -1
- package/assets/esri/core/workers/chunks/de28a86775235bd5d3c4.js +0 -2
- package/assets/esri/core/workers/chunks/f6cfc901267a229de7a1.js +0 -2
- package/assets/esri/core/workers/chunks/fb147097149a89e671ff.js +0 -1
- package/support/revision.js +0 -2
- /package/assets/esri/core/workers/chunks/{1dbb3e25e005a8220779.js.LICENSE.txt → 1b946714ca4a1a7359d4.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f6cfc901267a229de7a1.js.LICENSE.txt → 2a1ec30f9ad305763f81.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js.LICENSE.txt → 590e6c70206122e4cc3c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js.LICENSE.txt → 68d8ae42ab71d01a70a5.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{de28a86775235bd5d3c4.js.LICENSE.txt → 8dc1c3042267618fd710.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{12b5a645c0987a0efe54.js.LICENSE.txt → 96c50a0dda0f1503ef92.js.LICENSE.txt} +0 -0
|
@@ -54,7 +54,7 @@ export type SelectableLayerSourceUnion = SelectableLayer | SubtypeSublayer | Sel
|
|
|
54
54
|
*
|
|
55
55
|
* @since 5.1
|
|
56
56
|
*/
|
|
57
|
-
export type SelectionSource = SelectableLayerSourceUnion | SelectableLayerView | FeatureLikeLayerView
|
|
57
|
+
export type SelectionSource = SelectableLayerSourceUnion | SelectableLayerView | FeatureLikeLayerView;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Types of views supported by a selection operation.
|
|
@@ -207,12 +207,23 @@ export interface SelectableLayerWithObjectIds extends SelectableLayerBase {
|
|
|
207
207
|
queryFeatures(query?: Query, requestOptions?: RequestOptions): Promise<FeatureSet>;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Layer type narrowed to those that contain graphics.
|
|
212
|
+
* Includes GraphicsLayer and SketchLayer.
|
|
213
|
+
*
|
|
214
|
+
* @since 5.0
|
|
215
|
+
*/
|
|
216
|
+
export interface SelectableLayerWithGraphics extends SelectableLayerBase {
|
|
217
|
+
/** A collection of graphics in the layer. */
|
|
218
|
+
graphics: Collection<Graphic>;
|
|
219
|
+
}
|
|
220
|
+
|
|
210
221
|
/**
|
|
211
222
|
* A selectable layer which can either be layers containing object IDs or layers with graphics.
|
|
212
223
|
*
|
|
213
224
|
* @since 5.0
|
|
214
225
|
*/
|
|
215
|
-
export type SelectableLayer = SelectableLayerWithObjectIds |
|
|
226
|
+
export type SelectableLayer = SelectableLayerWithObjectIds | SelectableLayerWithGraphics;
|
|
216
227
|
|
|
217
228
|
/**
|
|
218
229
|
* The underlying base type for selectable layer views which contains common properties and methods for both layer views with graphics and layer views with object IDs.
|
|
@@ -259,11 +270,11 @@ export interface SelectableLayerViewWithGraphics extends SelectableLayerViewBase
|
|
|
259
270
|
*/
|
|
260
271
|
layer: GraphicsLayer | SketchLayer;
|
|
261
272
|
/**
|
|
262
|
-
* Queries for [graphics](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) from the layer view
|
|
273
|
+
* Queries for [graphics](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) from the layer view.
|
|
263
274
|
*
|
|
264
275
|
* @since 5.1
|
|
265
276
|
*/
|
|
266
|
-
queryGraphics
|
|
277
|
+
queryGraphics: () => Promise<Collection<Graphic>>;
|
|
267
278
|
}
|
|
268
279
|
|
|
269
280
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{Loadable as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{deprecatedModule as n}from"../../core/deprecate.js";import{Loadable as r,isLoadable as i}from"../../core/Loadable.js";import a from"../../core/Logger.js";import{watch as o,on as s,when as c}from"../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as d,isLoaded as f,load as p}from"../../geometry/projectionUtils.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isLinkChartView as h}from"../../linkChart/guards.js";import{basemapEnsureType as g}from"../../support/basemapEnsureType.js";import{contentEquals as _}from"../../support/basemapUtils.js";import{default3DCompatibility as v,default2DCompatibility as y}from"./support/basemapCompatibilityUtils.js";import b from"./support/BasemapGalleryItem.js";import x from"./support/LocalBasemapsSource.js";import S from"./support/PortalBasemapsSource.js";const C=t.ofType(b);function w(e){return e&&e.declaredClass===`esri.portal.Portal`}function T(e){return e&&!(e instanceof S)&&(!!e.portal||!!e.query)}function E(e){return e&&`basemaps`in e&&`state`in e&&`refresh`in e}let D=class extends r{constructor(e){super(e),this._loadingProjectionEngine=!1,this.items=new C,this.view=null,e?.suppressDeprecationWarning||n(a.getLogger(this),`esri.widgets.BasemapGallery.BasemapGalleryViewModel`,{version:`5.2`,replacement:`Use the @arcgis/core/basemaps/BasemapCollection class instead.`,warnOnce:!0}),this.source=new S}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){let e=()=>this._recreateItems();this.addHandles([o(()=>this.state===`ready`?this.compatibilityFunction:null,()=>this._updateItems()),s(()=>this.source?.basemaps,`change`,e,{onListenerAdd:e}),c(()=>this.view,()=>{this.source instanceof S&&(this.source.viewType=this.view?.type)},{once:!0})])}destroy(){let e=this.source.basemaps.find(e=>e===this.activeBasemap);e&&this.source.basemaps.remove(e),this.source?.destroy()}get activeBasemap(){return this.view?.map?.basemap??null}set activeBasemap(e){let t=this.view;if(!t?.map)return;if(e=g(e),!e||!t.ready){t.map.basemap=e,this._clearOverride(`activeBasemap`);return}let n=e.spatialReference||this.items?.find(t=>this.basemapEquals(e,t.basemap))?.spatialReference;if(n&&`spatialReferenceLocked`in t&&!t.spatialReferenceLocked){let r=t.spatialReference;if(n!=null&&!m(r,n)&&!d(t.spatialReference,n)&&!f()){this._override(`activeBasemap`,e),this._loadingProjectionEngine=!0,p().then(()=>{this._get(`activeBasemap`)===e&&(t.map.basemap=e,t.spatialReference=n,this._clearOverride(`activeBasemap`))},()=>{}).then(()=>{this._loadingProjectionEngine=!1});return}t.map.basemap=e,this._clearOverride(`activeBasemap`),n!=null&&!m(t.spatialReference,n)&&(t.spatialReference=n)}else t.map.basemap=e,this._clearOverride(`activeBasemap`)}get activeBasemapIndex(){let{state:e,activeBasemap:t}=this;return e===`ready`?this._findBasemapIndex(t):-1}get compatibilityFunction(){return this.view?.type===`3d`?v:y}set compatibilityFunction(e){this._overrideIfSome(`compatibilityFunction`,e)}get source(){return this._get(`source`)}set source(e){(Array.isArray(e)||t.isCollection(e))&&(e=new x({basemaps:Array.isArray(e)?new t(e):e})),w(e)&&(e=new S({portal:e})),T(e)&&(e=new S(e)),E(e)||(e=null),this._set(`source`,e)}get state(){return!this.view?.ready||!this.source?`disabled`:h(this.view)&&!this.view.inGeographicLayout?`unsupported`:this._loadingProjectionEngine?`loading`:`ready`}basemapEquals(e,t){return _(e,t)}refresh(){this._recreateItems()}load(){return this.loadSource()}loadSource(e){return this.addResolvingPromise(i(this.source)?this.source.load(e):null),Promise.resolve(this)}_findBasemapIndex(e){let{items:t}=this,n=t.findIndex(t=>t.basemap===e);return n===-1?t.findIndex(t=>this.basemapEquals(t.basemap,e)):n}_recreateItems(){let e=this.source?.basemaps??[],{view:t,compatibilityFunction:n}=this,r=new Map(this.items.map(e=>[e.basemap,e])),i=e.map(e=>{let i=r.get(e);return i?(r.delete(e),i):new b({basemap:e,compatibilityFunction:n,view:t})});this.items.removeAll(),this.items.addMany(i),r.forEach(e=>e.destroy())}_updateItems(){for(let e of this.items)e.compatibilityFunction=this.compatibilityFunction,e.view=this.view}};e([l()],D.prototype,`_loadingProjectionEngine`,void 0),e([l()],D.prototype,`activeBasemap`,null),e([l({readOnly:!0})],D.prototype,`activeBasemapIndex`,null),e([l()],D.prototype,`compatibilityFunction`,null),e([l({readOnly:!0,type:C})],D.prototype,`items`,void 0),e([l()],D.prototype,`source`,null),e([l({readOnly:!0})],D.prototype,`state`,null),e([l()],D.prototype,`view`,void 0),D=e([u(`esri.widgets.BasemapGallery.BasemapGalleryViewModel`)],D);const O=D;export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../assets.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{when as i}from"../core/reactiveUtils.js";import{property as a,subclass as o}from"../core/accessorSupport/decorators.js";import{getBasemapThumbnailUrl as s,isBasemap3D as c,isBasemapInPreview as l,isBasemapInBeta as u}from"../support/basemapUtils.js";import d from"./Widget.js";import f from"./BasemapGallery/BasemapGalleryViewModel.js";import{css as p}from"./BasemapGallery/css.js";import{loadCalciteComponents as m}from"./support/componentsUtils.js";import{globalCss as h}from"./support/globalCss.js";import{Heading as g}from"./support/Heading.js";import{messageBundle as _,accessibleHandler as v,tsx as y}from"./support/widget.js";let b=class extends d{constructor(e,t){super(e,t),this.disabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new f,this._focusBasemapItemEnabled=!1,n(r.getLogger(this),`Basemap Gallery`,`arcgis-basemap-gallery`,{version:`4.32`})}initialize(){this.addHandles(i(()=>this.source,()=>this.viewModel.loadSource(),{sync:!0,initial:!0}))}loadDependencies(){return m({scrim:()=>import(`@esri/calcite-components/dist/components/calcite-scrim`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`)})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get icon(){return`basemap`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){let e=this.source.state===`loading`,t=this.disabled||this.viewModel.state===`disabled`,n={[p.sourceLoading]:e,[h.disabled]:t};return y(`div`,{class:this.classes(p.base,h.widget,h.panel,n),key:`container`},this._getContext())}_getContext(){if(this.viewModel.state===`unsupported`)return y(`div`,{class:h.empty,key:`empty-message`},y(g,{level:this.headingLevel},this.messages.unsupported));if(this.source.state===`loading`)return y(`div`,{class:p.loader,key:`loader`});let e=this.viewModel.items;return e.length>0?y(`ul`,{"aria-disabled":this.disabled,"aria-label":this.label,bind:this,class:p.itemContainer,key:`item-container`,role:`radiogroup`,onkeydown:this._handleKeyDown},e.map((e,t)=>this._renderBasemapGalleryItem(e,t)).toArray()):y(`div`,{class:h.empty,key:`empty-message`},y(g,{level:this.headingLevel},this.messages.noBasemaps))}_getRoundRobinIndex(e,t){return(e+t)%t}_handleKeyDown(e){let{key:t}=e;if(![`ArrowUp`,`ArrowDown`,`ArrowRight`,`ArrowLeft`].includes(t))return;e.preventDefault();let{items:n,activeBasemapIndex:r}=this.viewModel,i=t===`ArrowUp`||t===`ArrowLeft`?this._getRoundRobinIndex(Math.max(r-1,-1),n.length):this._getRoundRobinIndex(r+1,n.length),a=n.at(i);a?.state===`ready`&&(this.viewModel.activeBasemap=a.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&e.tabIndex===0&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){let t=e.currentTarget[`data-item`];t.state===`ready`&&(this.viewModel.activeBasemap=t.basemap)}_renderBasemapGalleryItem(e,n){let r=s(e.basemap)||t(`esri/themes/base/images/basemap-toggle-64.svg`),i=e.basemap.title,a=e.basemap.portalItem?.snippet,o=e.error?.message||a||i,{viewModel:{state:l,activeBasemapIndex:u}}=this,d=this.disabled||l===`disabled`,f=u===n,m=f||u===-1&&n===0?0:-1,g=l===`loading`,_={[p.selectedItem]:f,[p.itemError]:e.state===`error`},v=`basemapgallery-item-${e.uid}`;return y(`li`,{afterUpdate:this._focusBasemapItem,"aria-checked":f.toString(),"aria-disabled":d.toString(),"aria-labelledby":v,bind:this,class:this.classes(p.item,_),"data-item":e,key:e.uid,role:`radio`,tabIndex:m,title:o,onclick:this._handleClick,onkeydown:this._handleClick},y(`img`,{alt:``,class:p.itemThumbnail,src:r}),y(`div`,{class:p.itemContent,key:`content`},y(`div`,{class:p.itemTitle,key:`title`},y(`span`,{id:v},i)),c(e.basemap)?this._renderTags(e.basemap):null),e.state===`loading`||f&&g?y(`calcite-scrim`,null,y(`span`,{"aria-hidden":`true`,class:h.loaderAnimation,key:`loader`,role:`presentation`})):null)}_renderTags(e){return y(`div`,{class:p.itemTagsContainer,key:`tag`},this._render3DTag(),u(e)?this._renderBetaTag():null,l(e)?this._renderPreviewTag():null)}_render3DTag(){let{messages:e}=this;return y(`calcite-chip`,{key:`tag-3d`,label:e.tag3D,scale:`s`},this.messages.tag3D)}_renderBetaTag(){let{messages:e}=this;return y(`calcite-chip`,{appearance:`outline-fill`,key:`tag-beta`,label:e.tagBeta,scale:`s`},this.messages.tagBeta)}_renderPreviewTag(){let{messages:e}=this;return y(`calcite-chip`,{appearance:`outline-fill`,key:`tag-preview`,label:e.tagPreview,scale:`s`},this.messages.tagPreview)}};e([a()],b.prototype,`activeBasemap`,null),e([a()],b.prototype,`disabled`,void 0),e([a()],b.prototype,`headingLevel`,void 0),e([a()],b.prototype,`icon`,null),e([a()],b.prototype,`label`,null),e([a(),_(`esri/widgets/BasemapGallery/t9n/BasemapGallery`)],b.prototype,`messages`,void 0),e([a()],b.prototype,`source`,null),e([a()],b.prototype,`view`,null),e([a({type:f})],b.prototype,`viewModel`,void 0),e([a()],b.prototype,`_focusBasemapItemEnabled`,void 0),e([v()],b.prototype,`_handleClick`,null),b=e([o(`esri.widgets.BasemapGallery`)],b);const x=b;export{x as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../assets.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{when as i}from"../core/reactiveUtils.js";import{property as a,subclass as o}from"../core/accessorSupport/decorators.js";import{getBasemapThumbnailUrl as s,isBasemap3D as c,isBasemapInPreview as l,isBasemapInBeta as u}from"../support/basemapUtils.js";import d from"./Widget.js";import f from"./BasemapGallery/BasemapGalleryViewModel.js";import{css as p}from"./BasemapGallery/css.js";import{loadCalciteComponents as m}from"./support/componentsUtils.js";import{globalCss as h}from"./support/globalCss.js";import{Heading as g}from"./support/Heading.js";import{messageBundle as _,accessibleHandler as v,tsx as y}from"./support/widget.js";let b=class extends d{constructor(e,t){super(e,t),this.disabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new f({suppressDeprecationWarning:!0}),this._focusBasemapItemEnabled=!1,n(r.getLogger(this),`Basemap Gallery`,`arcgis-basemap-gallery`,{version:`4.32`})}initialize(){this.addHandles(i(()=>this.source,()=>this.viewModel.loadSource(),{sync:!0,initial:!0}))}loadDependencies(){return m({scrim:()=>import(`@esri/calcite-components/dist/components/calcite-scrim`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`)})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get icon(){return`basemap`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){let e=this.source.state===`loading`,t=this.disabled||this.viewModel.state===`disabled`,n={[p.sourceLoading]:e,[h.disabled]:t};return y(`div`,{class:this.classes(p.base,h.widget,h.panel,n),key:`container`},this._getContext())}_getContext(){if(this.viewModel.state===`unsupported`)return y(`div`,{class:h.empty,key:`empty-message`},y(g,{level:this.headingLevel},this.messages.unsupported));if(this.source.state===`loading`)return y(`div`,{class:p.loader,key:`loader`});let e=this.viewModel.items;return e.length>0?y(`ul`,{"aria-disabled":this.disabled,"aria-label":this.label,bind:this,class:p.itemContainer,key:`item-container`,role:`radiogroup`,onkeydown:this._handleKeyDown},e.map((e,t)=>this._renderBasemapGalleryItem(e,t)).toArray()):y(`div`,{class:h.empty,key:`empty-message`},y(g,{level:this.headingLevel},this.messages.noBasemaps))}_getRoundRobinIndex(e,t){return(e+t)%t}_handleKeyDown(e){let{key:t}=e;if(![`ArrowUp`,`ArrowDown`,`ArrowRight`,`ArrowLeft`].includes(t))return;e.preventDefault();let{items:n,activeBasemapIndex:r}=this.viewModel,i=t===`ArrowUp`||t===`ArrowLeft`?this._getRoundRobinIndex(Math.max(r-1,-1),n.length):this._getRoundRobinIndex(r+1,n.length),a=n.at(i);a?.state===`ready`&&(this.viewModel.activeBasemap=a.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&e.tabIndex===0&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){let t=e.currentTarget[`data-item`];t.state===`ready`&&(this.viewModel.activeBasemap=t.basemap)}_renderBasemapGalleryItem(e,n){let r=s(e.basemap)||t(`esri/themes/base/images/basemap-toggle-64.svg`),i=e.basemap.title,a=e.basemap.portalItem?.snippet,o=e.error?.message||a||i,{viewModel:{state:l,activeBasemapIndex:u}}=this,d=this.disabled||l===`disabled`,f=u===n,m=f||u===-1&&n===0?0:-1,g=l===`loading`,_={[p.selectedItem]:f,[p.itemError]:e.state===`error`},v=`basemapgallery-item-${e.uid}`;return y(`li`,{afterUpdate:this._focusBasemapItem,"aria-checked":f.toString(),"aria-disabled":d.toString(),"aria-labelledby":v,bind:this,class:this.classes(p.item,_),"data-item":e,key:e.uid,role:`radio`,tabIndex:m,title:o,onclick:this._handleClick,onkeydown:this._handleClick},y(`img`,{alt:``,class:p.itemThumbnail,src:r}),y(`div`,{class:p.itemContent,key:`content`},y(`div`,{class:p.itemTitle,key:`title`},y(`span`,{id:v},i)),c(e.basemap)?this._renderTags(e.basemap):null),e.state===`loading`||f&&g?y(`calcite-scrim`,null,y(`span`,{"aria-hidden":`true`,class:h.loaderAnimation,key:`loader`,role:`presentation`})):null)}_renderTags(e){return y(`div`,{class:p.itemTagsContainer,key:`tag`},this._render3DTag(),u(e)?this._renderBetaTag():null,l(e)?this._renderPreviewTag():null)}_render3DTag(){let{messages:e}=this;return y(`calcite-chip`,{key:`tag-3d`,label:e.tag3D,scale:`s`},this.messages.tag3D)}_renderBetaTag(){let{messages:e}=this;return y(`calcite-chip`,{appearance:`outline-fill`,key:`tag-beta`,label:e.tagBeta,scale:`s`},this.messages.tagBeta)}_renderPreviewTag(){let{messages:e}=this;return y(`calcite-chip`,{appearance:`outline-fill`,key:`tag-preview`,label:e.tagPreview,scale:`s`},this.messages.tagPreview)}};e([a()],b.prototype,`activeBasemap`,null),e([a()],b.prototype,`disabled`,void 0),e([a()],b.prototype,`headingLevel`,void 0),e([a()],b.prototype,`icon`,null),e([a()],b.prototype,`label`,null),e([a(),_(`esri/widgets/BasemapGallery/t9n/BasemapGallery`)],b.prototype,`messages`,void 0),e([a()],b.prototype,`source`,null),e([a()],b.prototype,`view`,null),e([a({type:f})],b.prototype,`viewModel`,void 0),e([a()],b.prototype,`_focusBasemapItemEnabled`,void 0),e([v()],b.prototype,`_handleClick`,null),b=e([o(`esri.widgets.BasemapGallery`)],b);const x=b;export{x as default};
|
|
@@ -7,6 +7,7 @@ import type { BookmarkProperties } from "../../webmap/Bookmark.js";
|
|
|
7
7
|
import type { BookmarkOptions, BookmarksCapabilities } from "./types.js";
|
|
8
8
|
import type { GoTo, GoToProperties } from "../support/GoTo.js";
|
|
9
9
|
|
|
10
|
+
/** @deprecated since version 5.2. Use the [Bookmarks component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/) directly instead. */
|
|
10
11
|
export interface BookmarksViewModelProperties extends GoToProperties, Partial<Pick<BookmarksViewModel, "capabilities" | "view">> {
|
|
11
12
|
/** A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/references/core/webmap/Bookmark/)s. */
|
|
12
13
|
bookmarks?: ReadonlyArrayOrCollection<BookmarkProperties> | null;
|
|
@@ -29,6 +30,7 @@ export interface BookmarksViewModelProperties extends GoToProperties, Partial<Pi
|
|
|
29
30
|
defaultEditOptions?: Partial<BookmarkOptions>;
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
/** @deprecated since version 5.2. Use the [BookmarksState](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/types/#BookmarksState) instead. */
|
|
32
34
|
export type BookmarksViewModelState = "ready" | "loading";
|
|
33
35
|
|
|
34
36
|
/** @deprecated since version 5.0. Use the [Bookmarks component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/) directly instead. */
|
|
@@ -69,11 +71,13 @@ export interface BookmarksViewModelEvents {
|
|
|
69
71
|
"bookmark-select": BookmarksViewModelBookmarkSelectEvent;
|
|
70
72
|
}
|
|
71
73
|
|
|
74
|
+
/** @deprecated since version 5.2. Use [BookmarkEditEvent](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/types/#BookmarkEditEvent) instead. */
|
|
72
75
|
export interface BookmarksViewModelBookmarkEditEvent {
|
|
73
76
|
/** The edited bookmark. */
|
|
74
77
|
bookmark: Bookmark;
|
|
75
78
|
}
|
|
76
79
|
|
|
80
|
+
/** @deprecated since version 5.2. Use [BookmarkSelectEvent](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/types/#BookmarkSelectEvent) instead. */
|
|
77
81
|
export interface BookmarksViewModelBookmarkSelectEvent {
|
|
78
82
|
/** The bookmark selected by the user. */
|
|
79
83
|
bookmark: Bookmark;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type Accessor from "../../core/Accessor.js";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated since version 5.2. Use the [Bookmarks component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/) directly instead.
|
|
5
|
+
* @since 5.0
|
|
6
|
+
*/
|
|
4
7
|
export interface BookmarksVisibleElementsProperties extends Partial<Pick<BookmarksVisibleElements, "addBookmarkButton" | "closeButton" | "collapseButton" | "editBookmarkButton" | "filter" | "flow" | "heading" | "thumbnail" | "time">> {}
|
|
5
8
|
|
|
6
9
|
/**
|
|
@@ -9,6 +12,7 @@ export interface BookmarksVisibleElementsProperties extends Partial<Pick<Bookmar
|
|
|
9
12
|
*
|
|
10
13
|
* 
|
|
11
14
|
*
|
|
15
|
+
* @deprecated since version 5.2. Use the `show` and `hide` properties on the [Bookmarks component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/) directly instead.
|
|
12
16
|
* @since 5.0
|
|
13
17
|
*/
|
|
14
18
|
export default class BookmarksVisibleElements extends Accessor {
|
|
@@ -3,6 +3,7 @@ import type { UserSettings } from "../../views/types.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Specifies how bookmarks will be created or modified.
|
|
5
5
|
*
|
|
6
|
+
* @deprecated since 5.2. Use the [Bookmarks component's BookmarkOptions type](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/types/#BookmarkOptions) instead.
|
|
6
7
|
* @since 5.0
|
|
7
8
|
*/
|
|
8
9
|
export interface BookmarkOptions {
|
|
@@ -50,6 +51,7 @@ export interface BookmarkOptions {
|
|
|
50
51
|
/**
|
|
51
52
|
* Specifies the abilities for the Bookmarks widget.
|
|
52
53
|
*
|
|
54
|
+
* @deprecated since 5.2. Use the [Bookmarks component's timeDisabled property](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/#timeDisabled) instead.
|
|
53
55
|
* @since 5.0
|
|
54
56
|
*/
|
|
55
57
|
export interface BookmarksCapabilities {
|
|
@@ -17,7 +17,7 @@ import type FeatureTemplatesViewModel from "../FeatureTemplates/FeatureTemplates
|
|
|
17
17
|
import type SketchViewModel from "../Sketch/SketchViewModel.js";
|
|
18
18
|
import type { EventedAccessor } from "../../core/Evented.js";
|
|
19
19
|
import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
|
|
20
|
-
import type { CancelWorkflowOptions, CreationInfo, EditorLayerUnion, EditorSketchCreateEvent, EditorSketchUpdateEvent,
|
|
20
|
+
import type { CancelWorkflowOptions, CreationInfo, EditorLayerUnion, EditorSketchCreateEvent, EditorSketchUpdateEvent, EditorStartCreateFeaturesWorkflowAtFeatureEditParameters, EditorStartCreateFeaturesWorkflowAtFeatureTypeSelectionParameters, EditorStartMergeFeaturesWorkflowOptions, EditorStartSplitFeatureWorkflowOptions, FailedOperation, FeatureInfo, LayerInfo, State } from "./types.js";
|
|
21
21
|
import type { AttachmentsViewModelProperties } from "../Attachments/AttachmentsViewModel.js";
|
|
22
22
|
import type { FeatureTemplatesViewModelProperties } from "../FeatureTemplates/FeatureTemplatesViewModel.js";
|
|
23
23
|
import type { SketchLabelOptionsProperties } from "../../views/interactive/sketch/SketchLabelOptions.js";
|
|
@@ -25,7 +25,7 @@ import type { SnappingOptionsProperties } from "../../views/interactive/snapping
|
|
|
25
25
|
import type { SketchTooltipOptionsProperties } from "../../views/interactive/sketch/SketchTooltipOptions.js";
|
|
26
26
|
import type { SketchValueOptionsProperties } from "../../views/interactive/sketch/SketchValueOptions.js";
|
|
27
27
|
|
|
28
|
-
export interface EditorViewModelProperties extends Partial<Pick<EditorViewModel, "formSystem" | "layerInfos" | "selectionManager" | "syncViewSelection" | "useLegacyCreateTools" | "view">> {
|
|
28
|
+
export interface EditorViewModelProperties extends Partial<Pick<EditorViewModel, "formSystem" | "layerInfos" | "selectionManager" | "syncViewSelection" | "useLegacyCreateTools" | "useViewOptions" | "view">> {
|
|
29
29
|
/** The [AttachmentsViewModel][AttachmentsViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attachments/AttachmentsViewModel/) for supporting the editor widget. Attachment editing is enabled by default if the layer has support for it. */
|
|
30
30
|
attachmentsViewModel?: AttachmentsViewModelProperties;
|
|
31
31
|
/**
|
|
@@ -312,6 +312,30 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
312
312
|
* @since 5.0
|
|
313
313
|
*/
|
|
314
314
|
accessor useLegacyCreateTools: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Indicates whether to use the snapping, tooltip, display-unit, and input-unit options configured through
|
|
317
|
+
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
318
|
+
*
|
|
319
|
+
* When `true`, snapping and tooltip options are inherited from the view. Options specified through
|
|
320
|
+
* [snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/#snappingOptions) and [tooltipOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/#tooltipOptions)
|
|
321
|
+
* are preserved but ignored. When `false`, those options are used instead.
|
|
322
|
+
*
|
|
323
|
+
* Explicit units specified through [valueOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/#valueOptions) override the units
|
|
324
|
+
* inherited from the view for the corresponding measurement type, such as length or area, without changing
|
|
325
|
+
* the units configured in the view. Setting an explicit unit to `null` or `undefined` restores inheritance for
|
|
326
|
+
* that measurement type.
|
|
327
|
+
*
|
|
328
|
+
* Label [options](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/#labelOptions) and
|
|
329
|
+
* [direction mode](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ValueOptions/#directionMode) are not inherited from the view.
|
|
330
|
+
*
|
|
331
|
+
* Changes to this property apply when the next create or update operation starts, not to an operation already
|
|
332
|
+
* in progress.
|
|
333
|
+
*
|
|
334
|
+
* @default false
|
|
335
|
+
* @beta
|
|
336
|
+
* @since 5.2
|
|
337
|
+
*/
|
|
338
|
+
accessor useViewOptions: boolean;
|
|
315
339
|
/**
|
|
316
340
|
* Options to configure how values are displayed and input when creating or updating graphics.
|
|
317
341
|
*
|
|
@@ -406,16 +430,16 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
406
430
|
* @since 4.28
|
|
407
431
|
* @see [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/)
|
|
408
432
|
*/
|
|
409
|
-
startCreateFeaturesWorkflowAtFeatureEdit(params:
|
|
433
|
+
startCreateFeaturesWorkflowAtFeatureEdit(params: EditorStartCreateFeaturesWorkflowAtFeatureEditParameters): Promise<void>;
|
|
410
434
|
/**
|
|
411
435
|
* Initiates the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/) by displaying the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTemplates/) panel.
|
|
412
436
|
*
|
|
413
|
-
* @param
|
|
437
|
+
* @param params - An optional object containing additional configuration information for the create features workflow.
|
|
414
438
|
* @returns Resolves when the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/) is initiated
|
|
415
439
|
* and displays the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTemplates/) panel.
|
|
416
440
|
* @since 4.23
|
|
417
441
|
*/
|
|
418
|
-
startCreateFeaturesWorkflowAtFeatureTypeSelection(
|
|
442
|
+
startCreateFeaturesWorkflowAtFeatureTypeSelection(params?: EditorStartCreateFeaturesWorkflowAtFeatureTypeSelectionParameters): Promise<void>;
|
|
419
443
|
/**
|
|
420
444
|
* Starts a [MergeFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/MergeFeaturesWorkflow/) for the
|
|
421
445
|
* specified features. All features must belong to the same layer.
|
|
@@ -427,7 +451,7 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
427
451
|
* @param options - Options for the merge features workflow.
|
|
428
452
|
* @since 4.34
|
|
429
453
|
*/
|
|
430
|
-
startMergeFeaturesWorkflow(features: Graphic[] | FeatureInfo, options?:
|
|
454
|
+
startMergeFeaturesWorkflow(features: Graphic[] | FeatureInfo, options?: EditorStartMergeFeaturesWorkflowOptions): Promise<void>;
|
|
431
455
|
/**
|
|
432
456
|
* Starts a split feature workflow for the given feature.
|
|
433
457
|
*
|
|
@@ -436,7 +460,7 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
436
460
|
* @returns Resolves once the [SplitFeatureWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/SplitFeatureWorkflow/) has been initialized and is active.
|
|
437
461
|
* @since 4.34
|
|
438
462
|
*/
|
|
439
|
-
startSplitFeatureWorkflow(feature: Graphic, options?:
|
|
463
|
+
startSplitFeatureWorkflow(feature: Graphic, options?: EditorStartSplitFeatureWorkflowOptions): Promise<void>;
|
|
440
464
|
/**
|
|
441
465
|
* Starts an [UpdateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateFeaturesWorkflow/) using
|
|
442
466
|
* the provided features.
|
|
@@ -479,27 +503,4 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
479
503
|
startUpdateWorkflowAtMultipleFeatureSelection(candidates: Graphic[]): Promise<void>;
|
|
480
504
|
/** Toggles the `UpdateWorkflow`. */
|
|
481
505
|
toggleUpdateWorkflow(): Promise<void>;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
export interface EditorViewModelStartCreateFeaturesWorkflowAtFeatureEditParameters {
|
|
485
|
-
/** The initial feature used when you begin creating features. */
|
|
486
|
-
initialFeature: Graphic;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
export interface EditorViewModelStartMergeFeaturesWorkflowOptions {
|
|
490
|
-
/**
|
|
491
|
-
* The feature that the other
|
|
492
|
-
* features will be merged into. This feature will have its geometry updated
|
|
493
|
-
* with the merged geometry. The other features will be deleted.
|
|
494
|
-
*/
|
|
495
|
-
keyFeature?: Graphic;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
export interface EditorViewModelStartSplitFeatureWorkflowOptions {
|
|
499
|
-
/** The step to start the workflow at. */
|
|
500
|
-
startAt?: SplitFeatureWorkflowStep;
|
|
501
|
-
/** The preferred Sketch tool to use for drawing the splitter geometry. */
|
|
502
|
-
defaultSplitterGeometryType?: SplitterGeometryType;
|
|
503
|
-
/** The geometry with which to split the input geometry. This is required in order to start the workflow at the "reviewing-features" step. Otherwise, it is ignored. */
|
|
504
|
-
splitterGeometry?: SplitterGeometry;
|
|
505
506
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import{createTask as n}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import{deprecatedFunction as i}from"../../core/deprecate.js";import a from"../../core/Error.js";import{EventedAccessor as o}from"../../core/Evented.js";import{abortHandle as s,makeHandle as c}from"../../core/handleUtils.js";import"../../core/has.js";import l from"../../core/Logger.js";import{destroyMaybe as u,abortMaybe as d,removeMaybe as f}from"../../core/maybe.js";import{throwIfAborted as p}from"../../core/promiseUtils.js";import m from"../../core/ReactiveMap.js";import{watch as h,syncAndInitial as g,initial as _,on as v,when as y,sync as b,whenOnce as x}from"../../core/reactiveUtils.js";import{property as S,subclass as ee}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as te}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as ne}from"../../editing/templateUtils.js";import{getGraphicLayer as C}from"../../graphic/graphicOriginUtils.js";import w from"../../layers/GraphicsLayer.js";import{isEditableLayer as re}from"../../layers/support/editableLayers.js";import{isFeatureLayer as ie,isSubtypeGroupLayer as T,getOwningPortalUrl as E}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as D}from"../../portal/support/urlUtils.js";import ae from"../../views/SelectionManager.js";import{fetchFullFeaturesByObjectId as oe}from"../../views/draw/support/editingSessionUtils.js";import se from"../../views/interactive/sketch/SketchLabelOptions.js";import ce from"../../views/interactive/sketch/SketchOptions.js";import le from"../../views/interactive/sketch/SketchTooltipOptions.js";import ue from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as de}from"../../views/interactive/snapping/SnappingManager.js";import O from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as k}from"../../views/support/selectionUtils.js";import A from"../Attachments/AttachmentsViewModel.js";import{isNextOrLegacyCreateFeaturesWorkflow as j,isNextOrLegacyUpdateRecordWorkflow as M,isNextOrLegacyUpdateFeaturesWorkflow as N,isNextOrLegacyMergeFeaturesWorkflow as P,isNextOrLegacySplitFeatureWorkflow as F,isNextOrLegacyUpdateWorkflow as I,isLegacyFeatureFormViewModel as L}from"./compatibilityAdapters.js";import R from"./CreateFeaturesWorkflow.js";import z from"./UpdateWorkflow.js";import{getLayersFromWorkflow as B,isBatchAttributeFormViewModel as V,findEditorItemForLayerOrThrow as H,toFeatureInfos as U,fetchFullFeatures as fe,findEditorItemForLayer as pe,whenEditorLayerView as W}from"./workflowUtils.js";import me from"./legacy/CreateFeaturesWorkflow.js";import he from"./legacy/UpdateWorkflow.js";import ge from"./support/EditorItem.js";import{assertViewNot3D as G,MultipleSourceLayersError as K,InsufficientFeatureCountError as q,MissingOriginLayerError as J,assertMergeWorkflowCapabilities as _e,FetchFullFeatureError as Y,assertSplitWorkflowCapabilities as ve}from"./support/errors.js";import{makeTemplateGroupInfoForLayer as ye}from"../FeatureTemplates/featureTemplatesUtils.js";import X from"../FeatureTemplates/FeatureTemplatesViewModel.js";import be from"../Sketch/SketchViewModel.js";import xe from"../Spinner/SpinnerViewModel.js";import{goTo as Z}from"../support/goToUtils.js";import{isFeatureItem as Q,isLayerItem as Se}from"../support/SelectionList/selectionListUtils.js";import Ce from"../support/SelectionList/SelectionListViewModel.js";import we from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function Te(e,t){return e?.find(e=>e.layer===t)}let $=class extends o{constructor(e){super(e),this._defaultSelectionManager=new ae,this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new w({listMode:`hide`,internal:!0,title:`Editor sketch layer`}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new te,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new r,this.editorItems=new r,this.editorItemsLayerMap=new m,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new A({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new X({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new be({layer:this._sketchGraphicsLayer,useLegacyCreateTools:this._get(`useLegacyCreateTools`)??!0}),this.selectionListViewModel=new Ce,this.selectionManager=null,this.selectionToolbarViewModel=new we({continuousSelectionEnabled:!0,defaultOperationType:`replace`,persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new ce,this.snappingOptions=new O({attributeRulesEnabled:!0}),this.spinnerViewModel=new xe,this.syncViewSelection=!1,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this.showConfirmationPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.formSystem=`legacy`,this.back=async()=>{if(this.state===`viewing-selection-list`){this.selectionListViewModel.filterText=void 0,this.effectiveSelectionManager.clear();return}this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await this.activeWorkflow?.save(this.showConfirmationPrompt),this.selectFeature=(e,t=!1)=>{let n=this.activeWorkflow;if(this._candidateCommitted||n?.type!==`update`)return;let{rootFeatures:r}=n.data;r.removeAll(),e&&r.add(e),t&&(n.next(),this._candidateCommitted=!0)}}initialize(){this.addHandles([h(()=>{let e=this.view,t=e?.map?.editableLayers.toArray();return[t,(e?.allLayerViews)?.filter(e=>!!t?.includes(e.layer)),this.layerInfos]},()=>this._updateEditorItems(),g),h(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),h(()=>this._selectionSources,()=>this._syncSelectionSources(),_),v(()=>this.activeWorkflow,`cancel`,()=>this.emit(`workflow-cancel`)),v(()=>this.activeWorkflow,`commit`,()=>this.emit(`workflow-commit`)),v(()=>this.activeWorkflow,`complete`,()=>{this.emit(`workflow-commit`),this._set(`activeWorkflow`,null)}),y(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),h(()=>this.activeWorkflow,e=>this._defaultSelectionManager.highlightEnabled=!e),y(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),_),v(()=>this.editorItems,`change`,()=>this._afterEditorItemsChange()),h(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),h(()=>this.page,(e,t)=>{let n=[...this.pageStack];if(n.indexOf(e)===-1)n.push(e);else for(;n.length&&n.at(-1)!==e;)n.pop();this.pageStack=n},g),y(()=>this.state===`awaiting-update-feature-candidate`,()=>this._candidateCommitted=!1),v(()=>this.featureTemplatesViewModel,`select`,async({item:e,oldItem:t})=>{let{activeWorkflow:n}=this;if(n){let e=n.type===`update`&&n.activeWorkflow?.stepId===`awaiting-feature-creation-info`,r=n.type===`create-features`&&n.stepId===`awaiting-feature-creation-info`&&n.data.creationInfo?.layer&&!n.data.creationInfo?.template;if(e||r)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{this.featureTemplatesViewModel.select(t,{emit:!1});return}}if(!e)return;let r={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(r);await this.startCreateFeaturesWorkflowAtFeatureCreation(r)}),h(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},g),v(()=>this.view,`key-down`,e=>{e.key===`Escape`&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),v(()=>this.sketchViewModel,[`create`,`delete`,`update`],e=>{let{activeWorkflow:t}=this,n=B(t),r=`sketch-${e.type}`;this.emit(r,{type:r,detail:e,layer:n[0],layers:n})},b),h(()=>this.view,e=>{if(this._snappingManager=u(this._snappingManager),!e)return;let t=this.snappingOptions;this._snappingManager=new de({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},g),h(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},g),v(()=>this.selectionToolbarViewModel,`complete`,e=>this._onSelectionComplete(e)),h(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:n,selectionToolbarViewModel:r})=>{t.view=e,n.view=e,r.view=e},g),h(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},g)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=d(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=f(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this._defaultSelectionManager.destroy()}get _featureTemplatesLayersAndTables(){let e=new r;for(let t of this.editorItems){let n=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!n&&e.push(t.layer)}return e}get _selectionSources(){let e=new r;if(this.syncViewSelection||this.selectionManager)return e;for(let t of this.editorItems)k(t.layer)&&t.supportsUpdateWorkflow&&e.push(t.layer);return e}get activeFeatureCount(){let e=this.activeLeafWorkflow;return j(e)?e.pendingFeatures.length:M(e)&&e.data.edits.feature?1:N(e)?e.data.fullFeatures.length:P(e)?e.data.features.length:F(e)?2:0}get activeLeafWorkflow(){let e=this.activeWorkflow;return e&&I(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>e.type===`scene`||!e.isTable)}get effectiveSelectionManager(){let e=this.view;return e&&this.syncViewSelection?e.selectionManager:this.selectionManager??this._defaultSelectionManager}get featureFormViewModel(){let e=this.activeWorkflow?.formViewModel;return L(e)?e:null}get formViewModel(){return this.activeWorkflow?.formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){let{activeWorkflow:e}=this;return e?.type===`update`?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get useLegacyCreateTools(){return this.ownSketchViewModel.useLegacyCreateTools}set useLegacyCreateTools(e){this.ownSketchViewModel.useLegacyCreateTools=e}get isUsingLegacyCreateTools(){return this.useLegacyCreateTools||this.view?.type!==`2d`}get sketchViewModel(){let{activeWorkflow:e}=this;return e?.type===`update`?e.activeSketchViewModel:e?.type===`create-features`?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return`disabled`;let e=this.attachmentsViewModel.mode;if(e===`add`)return`adding-attachment`;if(e===`edit`)return`editing-attachment`;let{activeWorkflow:t}=this,n=!t?.stepId;return this.effectiveSelectionManager.count&&n?`viewing-selection-list`:n?`ready`:t.type===`update`&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||this.activeWorkflow?.updating===!0}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set(`view`,e)}get canZoomTo(){return this._getWorkingFeatures().some(e=>e.geometry)}get page(){let{activeWorkflow:e,state:t}=this;if(V(e?.formViewModel)){if(e?.type===`update`&&e.formViewModel?.activeAssociationsInput)return e.formViewModel.activeAssociationsInput.associatedLayer?`viewing-associated-features`:`viewing-associated-layers`}else if(e?.type===`update`&&e.formViewModel){let{associatedLayer:t,associationId:n}=e.formViewModel;if(t||n!=null)return`viewing-associated-features`}if(e?.type===`update`&&e.stepId===`awaiting-feature-to-update`)return`ready`;if(e?.type===`create-features`&&e.numPendingFeatures===0){let t=e.data.upload;if(t)return t.state==="default"?`ready`:`creating-features-upload-details`}return t??`disabled`}get formDisabled(){let{activeLeafWorkflow:e}=this;if(M(e)){let t=e.formViewModel,n=!L(t)&&t.readOnly;return e.data.editorItem?.capabilities.update.attributes===!1||t.disabled===!0||n}if(N(e)){let{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormDisabled(){let{activeLeafWorkflow:e}=this;if(M(e))return e.data.editorItem?.capabilities.update.attributes===!1||e.formViewModel.disabled===!0;if(N(e)){let{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get formHasAssociation(){return!!this.formViewModel?.activeAssociation}get canGoBack(){return this.activeWorkflow!=null&&!this.syncing}get shouldShowDeleteButton(){let{activeLeafWorkflow:e}=this;if(M(e)){let{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return N(e)?e.data.editorItems.every(e=>e.capabilities.delete.enabled):!1}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}activateSelectionTool(e){return this.selectionToolbarViewModel.activateTool(e)}cancelSelectionTool(){this.selectionToolbarViewModel.cancel()}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(e){return this.startCreateFeaturesWorkflow(e)}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,`creating-features`)}async startCreateFeaturesWorkflow(e,t=`awaiting-feature-creation-info`){if(await x(()=>!this.updating),!this.canCreate)throw new a(`editing:unsupported-workflow`,`Creating features is unsupported or disabled.`);let n=this._createUpdatingResolver();try{await this._cancelWorkflow();let n=this._createCreateFeaturesWorkflow(e,t);this._set(`activeWorkflow`,n),await n.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{n.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await x(()=>!this.updating);let t=this._createUpdatingResolver();try{let{initialFeature:t}=e,n=t.sourceLayer=t.layer,r=n?H(this.editorItems,n):void 0;if(!r?.supportsCreateFeaturesWorkflow)throw new a(`editing:unsupported-workflow`,`Creating features is unsupported or disabled for this layer.`);await this._cancelWorkflow();let i=this._createCreateFeaturesWorkflow({initialFeature:t,layer:r.layer,maxFeatures:1},`creating-features`);this._set(`activeWorkflow`,i),await i.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{t.resolve()}}async startMergeFeaturesWorkflow(e,t={}){await x(()=>!this.updating),G(this,`merge-features`);let n=Array.isArray(e)?U(e):[e];if(n.length>1)throw new K;if(n.length===0||n[0].objectIds.length<2)throw new q(2);let i=n[0],a=i.layer;if(!a)throw new J;let o=H(this.editorItems,a);_e(o);let c=this._createUpdatingResolver(),l=new AbortController;this.addHandles(s(l));try{await this._cancelWorkflow(),this.cancelSelectionTool();let e=await oe(i.objectIds,a,this.view?.spatialReference,l.signal);if(e.length!==i.objectIds.length)throw new Y;let n;if(t.keyFeature){let r=t.keyFeature.getObjectId();n=e.find(e=>e.getObjectId()===r)??t.keyFeature}let o=this._createUpdateWorkflow(`editing-existing-feature`,{rootFeatures:new r(e),rootWorkflowOptions:{type:`merge`,props:{...t,keyFeature:n}}});this._set(`activeWorkflow`,o),this.addHandles(this._destroyWorkflowOnCommit(o)),await o.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{c.resolve()}}async startSplitFeatureWorkflow(e,t={}){await x(()=>!this.updating),G(this,`split-feature`);let n=C(e);if(!n)throw new J;let i=H(this.editorItems,n);ve(i);let a=this._createUpdatingResolver(),o=new AbortController;this.addHandles(s(o));try{await this._cancelWorkflow(),this.cancelSelectionTool();let i=await fe([e],n,this.view?.spatialReference,o.signal);if(i.length!==1)throw new Y;let a=this._createUpdateWorkflow(`editing-existing-feature`,{rootFeatures:new r(i),rootWorkflowOptions:{type:`split`,props:t}});this._set(`activeWorkflow`,a),this.addHandles(this._destroyWorkflowOnCommit(a)),await a.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{a.resolve()}}async startUpdateFeaturesWorkflow(e){if(await x(()=>!this.updating),!this.canUpdate){this._logError(`editing:unsupported-workflow`,`Update features workflow is unsupported or disabled.`);return}let t=Array.isArray(e)?U(e):[e];if(t.length>1)throw new K;let n=this._createUpdatingResolver();try{await this._cancelWorkflow(),this.cancelSelectionTool();let e=this._createUpdateWorkflow(`editing-existing-feature`,{rootFeatureInfos:t,rootWorkflowOptions:{type:`update-multiple`}});e.addHandles(this._destroyWorkflowOnCommit(e)),this._set(`activeWorkflow`,e),await e.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{n.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await x(()=>!this.updating),!this.canUpdate){this._logError(`editing:unsupported-workflow`,`Update workflow is unsupported or disabled.`);return}let e=this._createUpdatingResolver();try{await this._cancelWorkflow();let e=this._createUpdateWorkflow();this._set(`activeWorkflow`,e),await e.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await x(()=>!this.updating),!this.canUpdate){this._logError(`editing:unsupported-workflow`,`Update workflow is unsupported or disabled.`);return}let t=this._createUpdatingResolver();try{await this._cancelWorkflow();let t=this._createUpdateWorkflow(`awaiting-update-feature-candidate`);t.data.candidates=e,this._set(`activeWorkflow`,t),await t.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await x(()=>!this.updating),!this.canUpdate){this._logError(`editing:unsupported-workflow`,`Update workflow is unsupported or disabled.`);return}let t=this._createUpdatingResolver();try{await this._cancelWorkflow(),this.cancelSelectionTool();let t=this._createUpdateWorkflow(`editing-existing-feature`,{rootFeatures:new r([e])});t.addHandles(this._destroyWorkflowOnCommit(t)),this._set(`activeWorkflow`,t),await t.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){let{selectionListViewModel:e}=this;if(!e.visibleFeatureCount||!e.visibleLayerCount)throw new a(`editing:missing-selection`,`Unable to determine visible selection.`);if(e.visibleLayerCount>1)throw new a(`editing:features-different-layers`,`Cannot start workflow with features from different layers.`);let t=e.layerItems.find(e=>e.visible);t&&await this._startUpdateWorkflowWithLayerItem(t,`update`)}async deleteFeatureFromWorkflow(){i(l.getLogger(this),`EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.`,{version:`4.33`,replacement:`EditorViewModel.deleteFeatures`,warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){let e=this.activeWorkflow;if(I(e))return e.deleteActiveFeatures();this._logError(`editing:unsupported-workflow`,`Deleting features requires an active update workflow.`)}async deleteAssociationFromWorkflow(){let{activeWorkflow:e}=this;if(!e||e.type!==`update`){this._logError(`editing:unsupported-workflow`,`Deleting an association requires an active update workflow.`);return}await e.deleteActiveAssociation()}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}itemHasInvalidFormTemplate(e){return e!=null&&pe(this.editorItems,e.layer)?.hasInvalidFormTemplate===!0}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){let{view:n,sketchViewModel:r}=this;if(!n)return;let i=e??r?.createGraphic;if(i)i.geometry?.type===`mesh`?Z(n,i.geometry,void 0):Z(n,i,void 0);else{let e=this._getWorkingFeatures();n.type===`3d`&&e?.some(e=>e.geometry?.type===`mesh`)?Z(n,e.map(e=>e.geometry).filter(t),void 0):e&&Z(n,e,void 0)}}async toggleUpdateWorkflow(){this.canUpdate&&(!this.hasPendingEdits||await this.showDiscardEditsPrompt())&&(this.activeWorkflow&&this.state===`awaiting-feature-to-update`?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection())}async onSelectionListItemSelect(e){Q(e)&&await this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e,t){Q(e)?await this.startUpdateWorkflowAtFeatureEdit(e.graphic):Se(e)&&await this._startUpdateWorkflowWithLayerItem(e,t)}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),c(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){let{view:t}=this;if(!t?.map)return[];let{map:n}=t,r=n.editableLayers.toArray(),i=n.allTables.toArray().filter(e=>ie(e)||T(e));return await Promise.allSettled([...r.flatMap(e=>this._getLayerLoadPromise(e)),...i.flatMap(e=>this._getLayerLoadPromise(e))]),p(e),[...r.reverse(),...i.reverse()].filter(e=>re(e)&&(e.geometryType!==`mesh`||t.type===`3d`)).flatMap(e=>e.type===`subtype-group`?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return T(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){d(this._updateItemsTask);let{view:e}=this,t=n(async t=>{if(!e?.map||!e?.allLayerViews)return;let n=await this._getEditorItemCandidates(t);if(!n.length){this._drainEditorItems(),this.editorItemsLayerMap.clear();return}let r=[],i=[],a=[],{editorItemsLayerMap:o,layerInfos:s}=this;for(let t of n){let n=Te(s,t),c=await W(e,t).catch(()=>null),l=n?r:c?i:a,u=new ge({layer:t,layerInfo:n,layerView:c});l.push(u),o.set(t,u)}s?.length&&r.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));let c=[...r,...i,...a];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(c))});this._updatingHandles.consumePromise(t.promise),this._updateItemsTask=t}_updateTemplates(){d(this._updateTemplatesTask);let e=n(async e=>{let t=this._templatesByLayer,n=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(n.length>0){let r=await ne({layers:n.toArray(),view:this.view,signal:e,queryOptions:{returnVisibleTemplatesOnly:!0}});for(let{layer:e,templates:n}of r)t.set(e,n)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.consumePromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){let t=this._templatesByLayer,n=[];for(let r of e){let e=t.get(r);e&&e.length>0&&n.push(ye(r,e))}this.featureTemplatesViewModel.templateInfos=n}_afterEditorItemsChange(){let{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;let{stepId:t}=e;if(e.type===`create-features`){t===`awaiting-feature-creation-info`&&!this.canCreate&&this._cancelWorkflow();return}e.type===`update`&&(t===`awaiting-feature-to-update`&&!this.canUpdateVisible||t===`awaiting-update-feature-candidate`&&!e.hasUpdatableCandidates)&&this._cancelWorkflow()}async _cancelWorkflow(e){let t=this.activeWorkflow;if(!t){e?.warnIfNoWorkflow&&this._logError(`editing:no-active-workflow`,`There is no active workflow to cancel.`);return}if(!e||e.force!==!1){this.emit(`workflow-cancel`),this._set(`activeWorkflow`,null);try{await t.cancel(e)}finally{t.destroy()}return}try{await t.cancel(e),this._set(`activeWorkflow`,null),t.destroy()}catch{}}_createCreateFeaturesWorkflow(e,t){return this.formSystem===`legacy`?me.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,n)=>this._applyEdits(e,t,n),applyEditsFeatureService:(e,t,n)=>this._applyEditsFeatureService(e,t,n),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)}):R.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,n)=>this._applyEdits(e,t,n),applyEditsFeatureService:(e,t,n)=>this._applyEditsFeatureService(e,t,n),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateWorkflow(e,t){return this.formSystem===`legacy`?he.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,...t,applyEdits:(e,t,n)=>this._applyEdits(e,t,n),applyEditsFeatureService:(e,t,n)=>this._applyEditsFeatureService(e,t,n),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)}):z.create({sketchOptions:this.sketchOptions,viewModel:this,snappingManager:this._snappingManager,startAt:e,...t,applyEdits:(e,t,n)=>this._applyEdits(e,t,n),applyEditsFeatureService:(e,t,n)=>this._applyEditsFeatureService(e,t,n),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t),applyAttachmentEdits:(e,t)=>this._editAttachments(e,t)})}async _editAttachments(e,n){let r=[];return n.adds.forEach(t=>r.push(this._addAttachment(e,t))),n.updates.forEach(t=>r.push(this._updateAttachment(e,t))),n.deletes.forEach(t=>r.push(this._deleteAttachments(e,t))),(await Promise.all(r)).filter(t).flat()}_addAttachments(e,t){return Promise.all(t.map(t=>this._addAttachment(e,t)))}async _addAttachment(e,t){let n=null;if(!(`addAttachment`in e)||e.capabilities?.attachment==null)throw new a(`editor:attachments-not-supported`,`Adding attachments is not supported for this layer.`);let{feature:r,attachment:i,keywords:o}=t,s=o?{keywords:o}:void 0;return await this._queueOperation(async()=>(n=await e.addAttachment?.(r,i,s).catch(e=>{throw e?.error||e})??null,n)),n}async _updateAttachment(e,t){if(!(`updateAttachment`in e)||!e.updateAttachment||e.capabilities?.attachment==null)throw new a(`editor:attachments-not-supported`,`Updating attachments is not supported for this layer`);let{feature:n,attachmentId:r,attachment:i}=t,o=null;return await this._queueOperation(async()=>(o=await e.updateAttachment(n,r,i).catch(e=>{throw e?.error||e}),o)),o}async _deleteAttachments(e,t){if(!(`deleteAttachments`in e)||!e.deleteAttachments||e.capabilities?.attachment==null)throw new a(`editor:attachments-not-supported`,`Deleting attachments is not supported for this layer`);let{feature:n,attachmentIds:r}=t,i=null;return await this._queueOperation(async()=>(i=await e.deleteAttachments(n,r).catch(e=>{throw e?.error||e}),i)),i}async _applyEdits(e,t,n){let r=null,i=e.url?await E(e.url):null,a={returnServiceEditsOption:(!i||!D(i))&&!/\/hosted\//i.test(e.url)?`original-and-current-features`:void 0,editsRespectTrueCurves:!0,...n};return await this._queueOperation(async()=>{let{view:n}=this;if(!n)return null;let i=await W(n,e).catch(()=>null);return r=await e.applyEdits(t,a),i&&await x(()=>!i.updating),r}),r}async _applyEditsFeatureService(e,t,n){let r=null;return await this._queueOperation(async()=>r=await e.applyEdits(t,n)),r}_destroyWorkflowOnCommit(e){return v(()=>e,`commit`,()=>{e.destroy(),this.activeWorkflow===e&&this._set(`activeWorkflow`,null)})}_queueOperation(e){this._activityQueue.push(e);let t=(e,t)=>{let n=t.indexOf(e);n>-1&&t.splice(n,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(n=>{this._logError(`editing:operation-error`,`An error occurred.`,{error:n});let r={error:n,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set(`failures`,[...this.failures,r])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(e!=null&&`error`in e&&e.error!=null)throw e.error;if(e!=null&&`addFeatureResults`in e){let{addFeatureResults:t,deleteFeatureResults:n,updateFeatureResults:r}=e,i=t.find(e=>!!e.error)||r.find(e=>!!e.error)||n.find(e=>!!e.error);if(i)throw i.error}}_createUpdatingResolver(){let e=Promise.withResolvers();return this._updatingHandles.consumePromise(e.promise),e}_logErrorAndCancelWorkflow(e){let{name:t,message:n,details:r}=e;this._logError(t??`editing:workflow-start-failed`,n??void 0,r??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){let t=H(this.editorItems,e);return t!=null&&(!t.visible||t.disabled)}_logError(e,t,n){l.getLogger(this).error(new a(e,t,n))}_syncSelectionSources(){this._defaultSelectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;let{operationType:t,selection:n}=e,{effectiveSelectionManager:r}=this;this._queuedSelectionTool=void 0;let i=[],a=[];n.forEach(e=>{let t=C(e),n=this.editorItemsLayerMap.get(t);n?.editable&&a.push(e),n?.visible!==!1&&i.push(e)});let o=i.length===1&&a.includes(i[0]);if(this.state===`ready`&&o&&t===`replace`)return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case`remove`:r.updateSelection({current:[],added:[],removed:i});break;case`replace`:r.clear(),r.updateSelection({current:i,added:[],removed:[]});break;case`add`:r.updateSelection({current:i,added:[],removed:[]})}}async _startUpdateWorkflowWithLayerItem(e,t){if(!e.objectIds?.length)return;let n=e.featureItems.filter(e=>e.visible).map(e=>e.graphic),r=this.selectionListViewModel.filterText;if(n.length===1)return await this.startUpdateWorkflowAtFeatureEdit(n[0]);let i;if(r!=null&&r!==``){let e=U(n);if(e.length>1)throw new K;if(i=e[0],!i)throw new q(t===`merge`?2:1)}else i={layer:e.layer,objectIds:e.objectIds};t===`update`?await this.startUpdateFeaturesWorkflow(i):t===`merge`&&await this.startMergeFeaturesWorkflow(i)}_getWorkingFeatures(){let{sketchViewModel:e}=this;if(e?.createGraphic)return[e.createGraphic];if(e?.updateGraphics?.length)return e.updateGraphics.toArray();let{formViewModel:n}=this;return n?L(n)?[n.feature].filter(t):n.activeFeature?[n.activeFeature]:n.features.toArray():[]}};e([S()],$.prototype,`_defaultSelectionManager`,void 0),e([S()],$.prototype,`_featureTemplatesLayersAndTables`,null),e([S()],$.prototype,`_queuedSelectionTool`,void 0),e([S()],$.prototype,`_snappingManager`,void 0),e([S()],$.prototype,`_selectionSources`,null),e([S()],$.prototype,`activeFeatureCount`,null),e([S({readOnly:!0})],$.prototype,`activeWorkflow`,void 0),e([S()],$.prototype,`activeLeafWorkflow`,null),e([S({readOnly:!0})],$.prototype,`_activityQueue`,void 0),e([S({readOnly:!0})],$.prototype,`canCreate`,null),e([S()],$.prototype,`canCreateVisible`,null),e([S({readOnly:!0})],$.prototype,`canUpdate`,null),e([S()],$.prototype,`canUpdateVisible`,null),e([S()],$.prototype,`featureTemplatesLayers`,null),e([S()],$.prototype,`editorItems`,void 0),e([S()],$.prototype,`editorItemsLayerMap`,void 0),e([S()],$.prototype,`effectiveSelectionManager`,null),e([S({readOnly:!0})],$.prototype,`failures`,void 0),e([S()],$.prototype,`hideTemplatesForInactiveLayers`,void 0),e([S({type:A})],$.prototype,`attachmentsViewModel`,void 0),e([S()],$.prototype,`featureFormViewModel`,null),e([S()],$.prototype,`formViewModel`,null),e([S()],$.prototype,`utilityNetworkAssociationAddAssociationViewModel`,null),e([S({type:X})],$.prototype,`featureTemplatesViewModel`,void 0),e([S({type:se})],$.prototype,`labelOptions`,null),e([S()],$.prototype,`layerInfos`,void 0),e([S()],$.prototype,`useLegacyCreateTools`,null),e([S()],$.prototype,`isUsingLegacyCreateTools`,null),e([S()],$.prototype,`ownSketchViewModel`,void 0),e([S()],$.prototype,`selectionListViewModel`,void 0),e([S()],$.prototype,`selectionManager`,void 0),e([S()],$.prototype,`selectionToolbarViewModel`,void 0),e([S()],$.prototype,`sketchOptions`,void 0),e([S()],$.prototype,`sketchViewModel`,null),e([S({type:O,nonNullable:!0})],$.prototype,`snappingOptions`,void 0),e([S()],$.prototype,`spinnerViewModel`,void 0),e([S()],$.prototype,`state`,null),e([S({readOnly:!0})],$.prototype,`syncing`,null),e([S()],$.prototype,`syncViewSelection`,void 0),e([S()],$.prototype,`updating`,null),e([S({type:le})],$.prototype,`tooltipOptions`,null),e([S({type:ue})],$.prototype,`valueOptions`,null),e([S()],$.prototype,`view`,null),e([S()],$.prototype,`canZoomTo`,null),e([S()],$.prototype,`pageStack`,void 0),e([S()],$.prototype,`showDiscardEditsPrompt`,void 0),e([S()],$.prototype,`showConfirmationPrompt`,void 0),e([S()],$.prototype,`_candidateCommitted`,void 0),e([S()],$.prototype,`page`,null),e([S()],$.prototype,`formDisabled`,null),e([S()],$.prototype,`featureFormDisabled`,null),e([S()],$.prototype,`featureFormHasAssociation`,null),e([S()],$.prototype,`formHasAssociation`,null),e([S()],$.prototype,`formSystem`,void 0),e([S()],$.prototype,`canGoBack`,null),e([S()],$.prototype,`shouldShowDeleteButton`,null),e([S()],$.prototype,`hasPendingEdits`,null),e([S()],$.prototype,`snappingManager`,null),$=e([ee(`esri.widgets.Editor.EditorViewModel`)],$);const Ee=$;export{Ee as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import{createTask as n}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import{deprecatedFunction as i}from"../../core/deprecate.js";import a from"../../core/Error.js";import{EventedAccessor as o}from"../../core/Evented.js";import{abortHandle as s,makeHandle as c}from"../../core/handleUtils.js";import"../../core/has.js";import l from"../../core/Logger.js";import{destroyMaybe as u,abortMaybe as d,removeMaybe as f}from"../../core/maybe.js";import{throwIfAborted as p}from"../../core/promiseUtils.js";import m from"../../core/ReactiveMap.js";import{watch as h,syncAndInitial as g,initial as _,on as v,when as y,sync as b,whenOnce as x}from"../../core/reactiveUtils.js";import{property as S,subclass as ee}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as te}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as ne}from"../../editing/templateUtils.js";import{getGraphicLayer as C}from"../../graphic/graphicOriginUtils.js";import w from"../../layers/GraphicsLayer.js";import{isEditableLayer as re}from"../../layers/support/editableLayers.js";import{isFeatureLayer as ie,isSubtypeGroupLayer as T,getOwningPortalUrl as E}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as D}from"../../portal/support/urlUtils.js";import ae from"../../views/SelectionManager.js";import{fetchFullFeaturesByObjectId as oe}from"../../views/draw/support/editingSessionUtils.js";import se from"../../views/interactive/sketch/SketchLabelOptions.js";import ce from"../../views/interactive/sketch/SketchOptions.js";import le from"../../views/interactive/sketch/SketchTooltipOptions.js";import ue from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as de}from"../../views/interactive/snapping/SnappingManager.js";import O from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as k}from"../../views/support/selectionUtils.js";import A from"../Attachments/AttachmentsViewModel.js";import{isNextOrLegacyCreateFeaturesWorkflow as j,isNextOrLegacyUpdateRecordWorkflow as M,isNextOrLegacyUpdateFeaturesWorkflow as N,isNextOrLegacyMergeFeaturesWorkflow as P,isNextOrLegacySplitFeatureWorkflow as F,isNextOrLegacyUpdateWorkflow as I,isLegacyFeatureFormViewModel as L}from"./compatibilityAdapters.js";import R from"./CreateFeaturesWorkflow.js";import z from"./UpdateWorkflow.js";import{getLayersFromWorkflow as B,isBatchAttributeFormViewModel as V,findEditorItemForLayerOrThrow as H,toFeatureInfos as U,fetchFullFeatures as fe,findEditorItemForLayer as pe,whenEditorLayerView as W}from"./workflowUtils.js";import me from"./legacy/CreateFeaturesWorkflow.js";import he from"./legacy/UpdateWorkflow.js";import ge from"./support/EditorItem.js";import{assertViewNot3D as G,MultipleSourceLayersError as K,InsufficientFeatureCountError as q,MissingOriginLayerError as J,assertMergeWorkflowCapabilities as _e,FetchFullFeatureError as Y,assertSplitWorkflowCapabilities as ve}from"./support/errors.js";import{makeTemplateGroupInfoForLayer as ye}from"../FeatureTemplates/featureTemplatesUtils.js";import X from"../FeatureTemplates/FeatureTemplatesViewModel.js";import be from"../Sketch/SketchViewModel.js";import xe from"../Spinner/SpinnerViewModel.js";import{goTo as Z}from"../support/goToUtils.js";import{isFeatureItem as Q,isLayerItem as Se}from"../support/SelectionList/selectionListUtils.js";import Ce from"../support/SelectionList/SelectionListViewModel.js";import we from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function Te(e,t){return e?.find(e=>e.layer===t)}let $=class extends o{constructor(e){super(e),this._defaultSelectionManager=new ae,this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new w({listMode:`hide`,internal:!0,title:`Editor sketch layer`}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new te,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new r,this.editorItems=new r,this.editorItemsLayerMap=new m,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new A({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new X({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new be({layer:this._sketchGraphicsLayer,useLegacyCreateTools:this._get(`useLegacyCreateTools`)??!0}),this.selectionListViewModel=new Ce,this.selectionManager=null,this.selectionToolbarViewModel=new we({continuousSelectionEnabled:!0,defaultOperationType:`replace`,persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new ce,this.snappingOptions=new O({attributeRulesEnabled:!0}),this.spinnerViewModel=new xe,this.syncViewSelection=!1,this.useViewOptions=!1,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this.showConfirmationPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.formSystem=`legacy`,this.back=async()=>{if(this.state===`viewing-selection-list`){this.selectionListViewModel.filterText=void 0,this.effectiveSelectionManager.clear();return}this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await this.activeWorkflow?.save(this.showConfirmationPrompt),this.selectFeature=(e,t=!1)=>{let n=this.activeWorkflow;if(this._candidateCommitted||n?.type!==`update`)return;let{rootFeatures:r}=n.data;r.removeAll(),e&&r.add(e),t&&(n.next(),this._candidateCommitted=!0)}}initialize(){this.addHandles([h(()=>{let e=this.view,t=e?.map?.editableLayers.toArray();return[t,(e?.allLayerViews)?.filter(e=>!!t?.includes(e.layer)),this.layerInfos]},()=>this._updateEditorItems(),g),h(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),h(()=>this._selectionSources,()=>this._syncSelectionSources(),_),v(()=>this.activeWorkflow,`cancel`,()=>this.emit(`workflow-cancel`)),v(()=>this.activeWorkflow,`commit`,()=>this.emit(`workflow-commit`)),v(()=>this.activeWorkflow,`complete`,()=>{this.emit(`workflow-commit`),this._set(`activeWorkflow`,null)}),y(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),h(()=>this.activeWorkflow,e=>this._defaultSelectionManager.highlightEnabled=!e),y(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),_),v(()=>this.editorItems,`change`,()=>this._afterEditorItemsChange()),h(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),h(()=>this.page,(e,t)=>{let n=[...this.pageStack];if(n.indexOf(e)===-1)n.push(e);else for(;n.length&&n.at(-1)!==e;)n.pop();this.pageStack=n},g),y(()=>this.state===`awaiting-update-feature-candidate`,()=>this._candidateCommitted=!1),v(()=>this.featureTemplatesViewModel,`select`,async({item:e,oldItem:t})=>{let{activeWorkflow:n}=this;if(n){let e=n.type===`update`&&n.activeWorkflow?.stepId===`awaiting-feature-creation-info`,r=n.type===`create-features`&&n.stepId===`awaiting-feature-creation-info`&&n.data.creationInfo?.layer&&!n.data.creationInfo?.template;if(e||r)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{this.featureTemplatesViewModel.select(t,{emit:!1});return}}if(!e)return;let r={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(r);await this.startCreateFeaturesWorkflowAtFeatureCreation(r)}),h(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},g),v(()=>this.view,`key-down`,e=>{e.key===`Escape`&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),v(()=>this.sketchViewModel,[`create`,`delete`,`update`],e=>{let{activeWorkflow:t}=this,n=B(t),r=`sketch-${e.type}`;this.emit(r,{type:r,detail:e,layer:n[0],layers:n})},b),h(()=>[this.sketchViewModel,this.useViewOptions],([e,t])=>{e&&(e.useViewOptions=t)},g),h(()=>this.view,e=>{if(this._snappingManager=u(this._snappingManager),!e)return;let t=this.snappingOptions;this._snappingManager=new de({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},g),h(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},g),v(()=>this.selectionToolbarViewModel,`complete`,e=>this._onSelectionComplete(e)),h(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:n,selectionToolbarViewModel:r})=>{t.view=e,n.view=e,r.view=e},g),h(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},g)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=d(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=f(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this._defaultSelectionManager.destroy()}get _featureTemplatesLayersAndTables(){let e=new r;for(let t of this.editorItems){let n=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!n&&e.push(t.layer)}return e}get _selectionSources(){let e=new r;if(this.syncViewSelection||this.selectionManager)return e;for(let t of this.editorItems)k(t.layer)&&t.supportsUpdateWorkflow&&e.push(t.layer);return e}get activeFeatureCount(){let e=this.activeLeafWorkflow;return j(e)?e.pendingFeatures.length:M(e)&&e.data.edits.feature?1:N(e)?e.data.fullFeatures.length:P(e)?e.data.features.length:F(e)?2:0}get activeLeafWorkflow(){let e=this.activeWorkflow;return e&&I(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>e.type===`scene`||!e.isTable)}get effectiveSelectionManager(){let e=this.view;return e&&this.syncViewSelection?e.selectionManager:this.selectionManager??this._defaultSelectionManager}get featureFormViewModel(){let e=this.activeWorkflow?.formViewModel;return L(e)?e:null}get formViewModel(){return this.activeWorkflow?.formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){let{activeWorkflow:e}=this;return e?.type===`update`?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get useLegacyCreateTools(){return this.ownSketchViewModel.useLegacyCreateTools}set useLegacyCreateTools(e){this.ownSketchViewModel.useLegacyCreateTools=e}get isUsingLegacyCreateTools(){return this.useLegacyCreateTools||this.view?.type!==`2d`}get sketchViewModel(){let{activeWorkflow:e}=this;return e?.type===`update`?e.activeSketchViewModel:e?.type===`create-features`?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return`disabled`;let e=this.attachmentsViewModel.mode;if(e===`add`)return`adding-attachment`;if(e===`edit`)return`editing-attachment`;let{activeWorkflow:t}=this,n=!t?.stepId;return this.effectiveSelectionManager.count&&n?`viewing-selection-list`:n?`ready`:t.type===`update`&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||this.activeWorkflow?.updating===!0}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set(`view`,e)}get canZoomTo(){return this._getWorkingFeatures().some(e=>e.geometry)}get page(){let{activeWorkflow:e,state:t}=this;if(V(e?.formViewModel)){if(e?.type===`update`&&e.formViewModel?.activeAssociationsInput)return e.formViewModel.activeAssociationsInput.associatedLayer?`viewing-associated-features`:`viewing-associated-layers`}else if(e?.type===`update`&&e.formViewModel){let{associatedLayer:t,associationId:n}=e.formViewModel;if(t||n!=null)return`viewing-associated-features`}if(e?.type===`update`&&e.stepId===`awaiting-feature-to-update`)return`ready`;if(e?.type===`create-features`&&e.numPendingFeatures===0){let t=e.data.upload;if(t)return t.state==="default"?`ready`:`creating-features-upload-details`}return t??`disabled`}get formDisabled(){let{activeLeafWorkflow:e}=this;if(M(e)){let t=e.formViewModel,n=!L(t)&&t.readOnly;return e.data.editorItem?.capabilities.update.attributes===!1||t.disabled===!0||n}if(N(e)){let{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormDisabled(){let{activeLeafWorkflow:e}=this;if(M(e))return e.data.editorItem?.capabilities.update.attributes===!1||e.formViewModel.disabled===!0;if(N(e)){let{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get formHasAssociation(){return!!this.formViewModel?.activeAssociation}get canGoBack(){return this.activeWorkflow!=null&&!this.syncing}get shouldShowDeleteButton(){let{activeLeafWorkflow:e}=this;if(M(e)){let{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return N(e)?e.data.editorItems.every(e=>e.capabilities.delete.enabled):!1}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}activateSelectionTool(e){return this.selectionToolbarViewModel.activateTool(e)}cancelSelectionTool(){this.selectionToolbarViewModel.cancel()}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(e){return this.startCreateFeaturesWorkflow(e)}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,`creating-features`)}async startCreateFeaturesWorkflow(e,t=`awaiting-feature-creation-info`){if(await x(()=>!this.updating),!this.canCreate)throw new a(`editing:unsupported-workflow`,`Creating features is unsupported or disabled.`);let n=this._createUpdatingResolver();try{await this._cancelWorkflow();let n=this._createCreateFeaturesWorkflow(e,t);this._set(`activeWorkflow`,n),await n.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{n.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await x(()=>!this.updating);let t=this._createUpdatingResolver();try{let{initialFeature:t}=e,n=t.sourceLayer=t.layer,r=n?H(this.editorItems,n):void 0;if(!r?.supportsCreateFeaturesWorkflow)throw new a(`editing:unsupported-workflow`,`Creating features is unsupported or disabled for this layer.`);await this._cancelWorkflow();let i=this._createCreateFeaturesWorkflow({initialFeature:t,layer:r.layer,maxFeatures:1},`creating-features`);this._set(`activeWorkflow`,i),await i.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{t.resolve()}}async startMergeFeaturesWorkflow(e,t={}){await x(()=>!this.updating),G(this,`merge-features`);let n=Array.isArray(e)?U(e):[e];if(n.length>1)throw new K;if(n.length===0||n[0].objectIds.length<2)throw new q(2);let i=n[0],a=i.layer;if(!a)throw new J;let o=H(this.editorItems,a);_e(o);let c=this._createUpdatingResolver(),l=new AbortController;this.addHandles(s(l));try{await this._cancelWorkflow(),this.cancelSelectionTool();let e=await oe(i.objectIds,a,this.view?.spatialReference,l.signal);if(e.length!==i.objectIds.length)throw new Y;let n;if(t.keyFeature){let r=t.keyFeature.getObjectId();n=e.find(e=>e.getObjectId()===r)??t.keyFeature}let o=this._createUpdateWorkflow(`editing-existing-feature`,{rootFeatures:new r(e),rootWorkflowOptions:{type:`merge`,props:{...t,keyFeature:n}}});this._set(`activeWorkflow`,o),this.addHandles(this._destroyWorkflowOnCommit(o)),await o.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{c.resolve()}}async startSplitFeatureWorkflow(e,t={}){await x(()=>!this.updating),G(this,`split-feature`);let n=C(e);if(!n)throw new J;let i=H(this.editorItems,n);ve(i);let a=this._createUpdatingResolver(),o=new AbortController;this.addHandles(s(o));try{await this._cancelWorkflow(),this.cancelSelectionTool();let i=await fe([e],n,this.view?.spatialReference,o.signal);if(i.length!==1)throw new Y;let a=this._createUpdateWorkflow(`editing-existing-feature`,{rootFeatures:new r(i),rootWorkflowOptions:{type:`split`,props:t}});this._set(`activeWorkflow`,a),this.addHandles(this._destroyWorkflowOnCommit(a)),await a.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{a.resolve()}}async startUpdateFeaturesWorkflow(e){if(await x(()=>!this.updating),!this.canUpdate){this._logError(`editing:unsupported-workflow`,`Update features workflow is unsupported or disabled.`);return}let t=Array.isArray(e)?U(e):[e];if(t.length>1)throw new K;let n=this._createUpdatingResolver();try{await this._cancelWorkflow(),this.cancelSelectionTool();let e=this._createUpdateWorkflow(`editing-existing-feature`,{rootFeatureInfos:t,rootWorkflowOptions:{type:`update-multiple`}});e.addHandles(this._destroyWorkflowOnCommit(e)),this._set(`activeWorkflow`,e),await e.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{n.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await x(()=>!this.updating),!this.canUpdate){this._logError(`editing:unsupported-workflow`,`Update workflow is unsupported or disabled.`);return}let e=this._createUpdatingResolver();try{await this._cancelWorkflow();let e=this._createUpdateWorkflow();this._set(`activeWorkflow`,e),await e.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await x(()=>!this.updating),!this.canUpdate){this._logError(`editing:unsupported-workflow`,`Update workflow is unsupported or disabled.`);return}let t=this._createUpdatingResolver();try{await this._cancelWorkflow();let t=this._createUpdateWorkflow(`awaiting-update-feature-candidate`);t.data.candidates=e,this._set(`activeWorkflow`,t),await t.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await x(()=>!this.updating),!this.canUpdate){this._logError(`editing:unsupported-workflow`,`Update workflow is unsupported or disabled.`);return}let t=this._createUpdatingResolver();try{await this._cancelWorkflow(),this.cancelSelectionTool();let t=this._createUpdateWorkflow(`editing-existing-feature`,{rootFeatures:new r([e])});t.addHandles(this._destroyWorkflowOnCommit(t)),this._set(`activeWorkflow`,t),await t.start()}catch(e){this._logErrorAndCancelWorkflow(e)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){let{selectionListViewModel:e}=this;if(!e.visibleFeatureCount||!e.visibleLayerCount)throw new a(`editing:missing-selection`,`Unable to determine visible selection.`);if(e.visibleLayerCount>1)throw new a(`editing:features-different-layers`,`Cannot start workflow with features from different layers.`);let t=e.layerItems.find(e=>e.visible);t&&await this._startUpdateWorkflowWithLayerItem(t,`update`)}async deleteFeatureFromWorkflow(){i(l.getLogger(this),`EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.`,{version:`4.33`,replacement:`EditorViewModel.deleteFeatures`,warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){let e=this.activeWorkflow;if(I(e))return e.deleteActiveFeatures();this._logError(`editing:unsupported-workflow`,`Deleting features requires an active update workflow.`)}async deleteAssociationFromWorkflow(){let{activeWorkflow:e}=this;if(!e||e.type!==`update`){this._logError(`editing:unsupported-workflow`,`Deleting an association requires an active update workflow.`);return}await e.deleteActiveAssociation()}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}itemHasInvalidFormTemplate(e){return e!=null&&pe(this.editorItems,e.layer)?.hasInvalidFormTemplate===!0}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){let{view:n,sketchViewModel:r}=this;if(!n)return;let i=e??r?.createGraphic;if(i)i.geometry?.type===`mesh`?Z(n,i.geometry,void 0):Z(n,i,void 0);else{let e=this._getWorkingFeatures();n.type===`3d`&&e?.some(e=>e.geometry?.type===`mesh`)?Z(n,e.map(e=>e.geometry).filter(t),void 0):e&&Z(n,e,void 0)}}async toggleUpdateWorkflow(){this.canUpdate&&(!this.hasPendingEdits||await this.showDiscardEditsPrompt())&&(this.activeWorkflow&&this.state===`awaiting-feature-to-update`?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection())}async onSelectionListItemSelect(e){Q(e)&&await this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e,t){Q(e)?await this.startUpdateWorkflowAtFeatureEdit(e.graphic):Se(e)&&await this._startUpdateWorkflowWithLayerItem(e,t)}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),c(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){let{view:t}=this;if(!t?.map)return[];let{map:n}=t,r=n.editableLayers.toArray(),i=n.allTables.toArray().filter(e=>ie(e)||T(e));return await Promise.allSettled([...r.flatMap(e=>this._getLayerLoadPromise(e)),...i.flatMap(e=>this._getLayerLoadPromise(e))]),p(e),[...r.reverse(),...i.reverse()].filter(e=>re(e)&&(e.geometryType!==`mesh`||t.type===`3d`)).flatMap(e=>e.type===`subtype-group`?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return T(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){d(this._updateItemsTask);let{view:e}=this,t=n(async t=>{if(!e?.map||!e?.allLayerViews)return;let n=await this._getEditorItemCandidates(t);if(!n.length){this._drainEditorItems(),this.editorItemsLayerMap.clear();return}let r=[],i=[],a=[],{editorItemsLayerMap:o,layerInfos:s}=this;for(let t of n){let n=Te(s,t),c=await W(e,t).catch(()=>null),l=n?r:c?i:a,u=new ge({layer:t,layerInfo:n,layerView:c});l.push(u),o.set(t,u)}s?.length&&r.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));let c=[...r,...i,...a];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(c))});this._updatingHandles.consumePromise(t.promise),this._updateItemsTask=t}_updateTemplates(){d(this._updateTemplatesTask);let e=n(async e=>{let t=this._templatesByLayer,n=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(n.length>0){let r=await ne({layers:n.toArray(),view:this.view,signal:e,queryOptions:{returnVisibleTemplatesOnly:!0}});for(let{layer:e,templates:n}of r)t.set(e,n)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.consumePromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){let t=this._templatesByLayer,n=[];for(let r of e){let e=t.get(r);e&&e.length>0&&n.push(ye(r,e))}this.featureTemplatesViewModel.templateInfos=n}_afterEditorItemsChange(){let{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;let{stepId:t}=e;if(e.type===`create-features`){t===`awaiting-feature-creation-info`&&!this.canCreate&&this._cancelWorkflow();return}e.type===`update`&&(t===`awaiting-feature-to-update`&&!this.canUpdateVisible||t===`awaiting-update-feature-candidate`&&!e.hasUpdatableCandidates)&&this._cancelWorkflow()}async _cancelWorkflow(e){let t=this.activeWorkflow;if(!t){e?.warnIfNoWorkflow&&this._logError(`editing:no-active-workflow`,`There is no active workflow to cancel.`);return}if(!e||e.force!==!1){this.emit(`workflow-cancel`),this._set(`activeWorkflow`,null);try{await t.cancel(e)}finally{t.destroy()}return}try{await t.cancel(e),this._set(`activeWorkflow`,null),t.destroy()}catch{}}_createCreateFeaturesWorkflow(e,t){return this.formSystem===`legacy`?me.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,n)=>this._applyEdits(e,t,n),applyEditsFeatureService:(e,t,n)=>this._applyEditsFeatureService(e,t,n),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)}):R.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,n)=>this._applyEdits(e,t,n),applyEditsFeatureService:(e,t,n)=>this._applyEditsFeatureService(e,t,n),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateWorkflow(e,t){return this.formSystem===`legacy`?he.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,...t,applyEdits:(e,t,n)=>this._applyEdits(e,t,n),applyEditsFeatureService:(e,t,n)=>this._applyEditsFeatureService(e,t,n),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)}):z.create({sketchOptions:this.sketchOptions,viewModel:this,snappingManager:this._snappingManager,startAt:e,...t,applyEdits:(e,t,n)=>this._applyEdits(e,t,n),applyEditsFeatureService:(e,t,n)=>this._applyEditsFeatureService(e,t,n),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t),applyAttachmentEdits:(e,t)=>this._editAttachments(e,t)})}async _editAttachments(e,n){let r=[];return n.adds.forEach(t=>r.push(this._addAttachment(e,t))),n.updates.forEach(t=>r.push(this._updateAttachment(e,t))),n.deletes.forEach(t=>r.push(this._deleteAttachments(e,t))),(await Promise.all(r)).filter(t).flat()}_addAttachments(e,t){return Promise.all(t.map(t=>this._addAttachment(e,t)))}async _addAttachment(e,t){let n=null;if(!(`addAttachment`in e)||e.capabilities?.attachment==null)throw new a(`editor:attachments-not-supported`,`Adding attachments is not supported for this layer.`);let{feature:r,attachment:i,keywords:o}=t,s=o?{keywords:o}:void 0;return await this._queueOperation(async()=>(n=await e.addAttachment?.(r,i,s).catch(e=>{throw e?.error||e})??null,n)),n}async _updateAttachment(e,t){if(!(`updateAttachment`in e)||!e.updateAttachment||e.capabilities?.attachment==null)throw new a(`editor:attachments-not-supported`,`Updating attachments is not supported for this layer`);let{feature:n,attachmentId:r,attachment:i}=t,o=null;return await this._queueOperation(async()=>(o=await e.updateAttachment(n,r,i).catch(e=>{throw e?.error||e}),o)),o}async _deleteAttachments(e,t){if(!(`deleteAttachments`in e)||!e.deleteAttachments||e.capabilities?.attachment==null)throw new a(`editor:attachments-not-supported`,`Deleting attachments is not supported for this layer`);let{feature:n,attachmentIds:r}=t,i=null;return await this._queueOperation(async()=>(i=await e.deleteAttachments(n,r).catch(e=>{throw e?.error||e}),i)),i}async _applyEdits(e,t,n){let r=null,i=e.url?await E(e.url):null,a={returnServiceEditsOption:(!i||!D(i))&&!/\/hosted\//i.test(e.url)?`original-and-current-features`:void 0,editsRespectTrueCurves:!0,...n};return await this._queueOperation(async()=>{let{view:n}=this;if(!n)return null;let i=await W(n,e).catch(()=>null);return r=await e.applyEdits(t,a),i&&await x(()=>!i.updating),r}),r}async _applyEditsFeatureService(e,t,n){let r=null;return await this._queueOperation(async()=>r=await e.applyEdits(t,n)),r}_destroyWorkflowOnCommit(e){return v(()=>e,`commit`,()=>{e.destroy(),this.activeWorkflow===e&&this._set(`activeWorkflow`,null)})}_queueOperation(e){this._activityQueue.push(e);let t=(e,t)=>{let n=t.indexOf(e);n>-1&&t.splice(n,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(n=>{this._logError(`editing:operation-error`,`An error occurred.`,{error:n});let r={error:n,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set(`failures`,[...this.failures,r])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(e!=null&&`error`in e&&e.error!=null)throw e.error;if(e!=null&&`addFeatureResults`in e){let{addFeatureResults:t,deleteFeatureResults:n,updateFeatureResults:r}=e,i=t.find(e=>!!e.error)||r.find(e=>!!e.error)||n.find(e=>!!e.error);if(i)throw i.error}}_createUpdatingResolver(){let e=Promise.withResolvers();return this._updatingHandles.consumePromise(e.promise),e}_logErrorAndCancelWorkflow(e){let{name:t,message:n,details:r}=e;this._logError(t??`editing:workflow-start-failed`,n??void 0,r??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){let t=H(this.editorItems,e);return t!=null&&(!t.visible||t.disabled)}_logError(e,t,n){l.getLogger(this).error(new a(e,t,n))}_syncSelectionSources(){this._defaultSelectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;let{operationType:t,selection:n}=e,{effectiveSelectionManager:r}=this;this._queuedSelectionTool=void 0;let i=[],a=[];n.forEach(e=>{let t=C(e),n=this.editorItemsLayerMap.get(t);n?.editable&&a.push(e),n?.visible!==!1&&i.push(e)});let o=i.length===1&&a.includes(i[0]);if(this.state===`ready`&&o&&t===`replace`)return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case`remove`:r.updateSelection({current:[],added:[],removed:i});break;case`replace`:r.clear(),r.updateSelection({current:i,added:[],removed:[]});break;case`add`:r.updateSelection({current:i,added:[],removed:[]})}}async _startUpdateWorkflowWithLayerItem(e,t){if(!e.objectIds?.length)return;let n=e.featureItems.filter(e=>e.visible).map(e=>e.graphic),r=this.selectionListViewModel.filterText;if(n.length===1)return await this.startUpdateWorkflowAtFeatureEdit(n[0]);let i;if(r!=null&&r!==``){let e=U(n);if(e.length>1)throw new K;if(i=e[0],!i)throw new q(t===`merge`?2:1)}else i={layer:e.layer,objectIds:e.objectIds};t===`update`?await this.startUpdateFeaturesWorkflow(i):t===`merge`&&await this.startMergeFeaturesWorkflow(i)}_getWorkingFeatures(){let{sketchViewModel:e}=this;if(e?.createGraphic)return[e.createGraphic];if(e?.updateGraphics?.length)return e.updateGraphics.toArray();let{formViewModel:n}=this;return n?L(n)?[n.feature].filter(t):n.activeFeature?[n.activeFeature]:n.features.toArray():[]}};e([S()],$.prototype,`_defaultSelectionManager`,void 0),e([S()],$.prototype,`_featureTemplatesLayersAndTables`,null),e([S()],$.prototype,`_queuedSelectionTool`,void 0),e([S()],$.prototype,`_snappingManager`,void 0),e([S()],$.prototype,`_selectionSources`,null),e([S()],$.prototype,`activeFeatureCount`,null),e([S({readOnly:!0})],$.prototype,`activeWorkflow`,void 0),e([S()],$.prototype,`activeLeafWorkflow`,null),e([S({readOnly:!0})],$.prototype,`_activityQueue`,void 0),e([S({readOnly:!0})],$.prototype,`canCreate`,null),e([S()],$.prototype,`canCreateVisible`,null),e([S({readOnly:!0})],$.prototype,`canUpdate`,null),e([S()],$.prototype,`canUpdateVisible`,null),e([S()],$.prototype,`featureTemplatesLayers`,null),e([S()],$.prototype,`editorItems`,void 0),e([S()],$.prototype,`editorItemsLayerMap`,void 0),e([S()],$.prototype,`effectiveSelectionManager`,null),e([S({readOnly:!0})],$.prototype,`failures`,void 0),e([S()],$.prototype,`hideTemplatesForInactiveLayers`,void 0),e([S({type:A})],$.prototype,`attachmentsViewModel`,void 0),e([S()],$.prototype,`featureFormViewModel`,null),e([S()],$.prototype,`formViewModel`,null),e([S()],$.prototype,`utilityNetworkAssociationAddAssociationViewModel`,null),e([S({type:X})],$.prototype,`featureTemplatesViewModel`,void 0),e([S({type:se})],$.prototype,`labelOptions`,null),e([S()],$.prototype,`layerInfos`,void 0),e([S()],$.prototype,`useLegacyCreateTools`,null),e([S()],$.prototype,`isUsingLegacyCreateTools`,null),e([S()],$.prototype,`ownSketchViewModel`,void 0),e([S()],$.prototype,`selectionListViewModel`,void 0),e([S()],$.prototype,`selectionManager`,void 0),e([S()],$.prototype,`selectionToolbarViewModel`,void 0),e([S()],$.prototype,`sketchOptions`,void 0),e([S()],$.prototype,`sketchViewModel`,null),e([S({type:O,nonNullable:!0})],$.prototype,`snappingOptions`,void 0),e([S()],$.prototype,`spinnerViewModel`,void 0),e([S()],$.prototype,`state`,null),e([S({readOnly:!0})],$.prototype,`syncing`,null),e([S()],$.prototype,`syncViewSelection`,void 0),e([S()],$.prototype,`useViewOptions`,void 0),e([S()],$.prototype,`updating`,null),e([S({type:le})],$.prototype,`tooltipOptions`,null),e([S({type:ue})],$.prototype,`valueOptions`,null),e([S()],$.prototype,`view`,null),e([S()],$.prototype,`canZoomTo`,null),e([S()],$.prototype,`pageStack`,void 0),e([S()],$.prototype,`showDiscardEditsPrompt`,void 0),e([S()],$.prototype,`showConfirmationPrompt`,void 0),e([S()],$.prototype,`_candidateCommitted`,void 0),e([S()],$.prototype,`page`,null),e([S()],$.prototype,`formDisabled`,null),e([S()],$.prototype,`featureFormDisabled`,null),e([S()],$.prototype,`featureFormHasAssociation`,null),e([S()],$.prototype,`formHasAssociation`,null),e([S()],$.prototype,`formSystem`,void 0),e([S()],$.prototype,`canGoBack`,null),e([S()],$.prototype,`shouldShowDeleteButton`,null),e([S()],$.prototype,`hasPendingEdits`,null),e([S()],$.prototype,`snappingManager`,null),$=e([ee(`esri.widgets.Editor.EditorViewModel`)],$);const Ee=$;export{Ee as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{loadCalciteComponents as e}from"../../support/componentsUtils.js";import t from"../../support/SketchTooltipControls.js";import n from"../../support/SnappingControls.js";import{tsx as r}from"../../support/widget.js";import i from"../../support/SketchTooltipControls/VisibleElements.js";import a from"../../support/SnappingControls/VisibleElements.js";const o={settingsContainer:`esri-editor__settings`},s=()=>e({accordion:()=>import(`@esri/calcite-components/dist/components/calcite-accordion`),"accordion-item":()=>import(`@esri/calcite-components/dist/components/calcite-accordion-item`)});function c({editorViewModel:e,messagesCommon:s,visibleElements:c}){let{snappingOptions:l,sketchOptions:u,
|
|
2
|
+
import{loadCalciteComponents as e}from"../../support/componentsUtils.js";import t from"../../support/SketchTooltipControls.js";import n from"../../support/SnappingControls.js";import{tsx as r}from"../../support/widget.js";import i from"../../support/SketchTooltipControls/VisibleElements.js";import a from"../../support/SnappingControls/VisibleElements.js";const o={settingsContainer:`esri-editor__settings`},s=()=>e({accordion:()=>import(`@esri/calcite-components/dist/components/calcite-accordion`),"accordion-item":()=>import(`@esri/calcite-components/dist/components/calcite-accordion-item`)});function c({editorViewModel:e,messagesCommon:s,visibleElements:c}){let{snappingOptions:l,sketchOptions:u,useViewOptions:d,view:f,snappingManager:p}=e,m=[],h={directionModePicker:c.directionModePicker,labelsToggle:c.labelsToggle,tooltipsToggle:!d&&c.tooltipsToggle};return Object.values(h).includes(!0)&&m.push(r(t,{sketchOptions:u,view:f,visibleElements:new i(h)})),!d&&c.snappingControls&&m.push(r(n,{afterCreate:e=>e.layerListOpen=!1,snappingManager:p,snappingOptions:l,view:f,visibleElements:c.snappingControlsElements??new a})),m.length===0?null:r(`calcite-accordion`,{appearance:`transparent`,class:o.settingsContainer,key:`settings`},r(`calcite-accordion-item`,{"data-testid":`settings`,heading:s.settings,iconStart:`gear`},m))}export{c as Settings,o as css,s as loadSettingsComponents};
|
|
@@ -113,6 +113,13 @@ export interface CreationInfo {
|
|
|
113
113
|
* @since 5.0
|
|
114
114
|
*/
|
|
115
115
|
layer: EditorLayerUnion;
|
|
116
|
+
/**
|
|
117
|
+
* The attributes to apply to the newly-created feature. These attributes have priority over any
|
|
118
|
+
* attributes derived from a provided template.
|
|
119
|
+
*
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
attributeOverrides?: Graphic["attributes"];
|
|
116
123
|
/**
|
|
117
124
|
* The associated [Mesh](https://developers.arcgis.com/javascript/latest/references/core/geometry/Mesh/) geometry for the newly-created feature. This property is only applicable when editing [scene layers](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/).
|
|
118
125
|
*
|
|
@@ -139,6 +146,43 @@ export interface CreationInfo {
|
|
|
139
146
|
template?: FeatureTemplate | SharedTemplateMetadata;
|
|
140
147
|
}
|
|
141
148
|
|
|
149
|
+
export interface EditorStartCreateFeaturesWorkflowAtFeatureEditParameters {
|
|
150
|
+
/** The initial feature used when you begin creating features. */
|
|
151
|
+
initialFeature: Graphic;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface EditorStartCreateFeaturesWorkflowAtFeatureTypeSelectionParameters {
|
|
155
|
+
/** The layer containing features. */
|
|
156
|
+
layer: EditorLayerUnion;
|
|
157
|
+
/**
|
|
158
|
+
* The attributes to apply to the newly-created feature. These attributes have priority over any
|
|
159
|
+
* attributes derived from a provided template.
|
|
160
|
+
*
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
163
|
+
attributeOverrides?: Graphic["attributes"];
|
|
164
|
+
/** The maximum amount of feature to create in one batch editing operation. */
|
|
165
|
+
maxFeatures?: number;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface EditorStartMergeFeaturesWorkflowOptions {
|
|
169
|
+
/**
|
|
170
|
+
* The feature that the other
|
|
171
|
+
* features will be merged into. This feature will have its geometry updated
|
|
172
|
+
* with the merged geometry. The other features will be deleted.
|
|
173
|
+
*/
|
|
174
|
+
keyFeature?: Graphic;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface EditorStartSplitFeatureWorkflowOptions {
|
|
178
|
+
/** The step to start the workflow at. */
|
|
179
|
+
startAt?: SplitFeatureWorkflowStep;
|
|
180
|
+
/** The preferred Sketch tool to use for drawing the splitter geometry. */
|
|
181
|
+
defaultSplitterGeometryType?: SplitterGeometryType;
|
|
182
|
+
/** The geometry with which to split the input geometry. This is required in order to start the workflow at the "reviewing-features" step. Otherwise, it is ignored. */
|
|
183
|
+
splitterGeometry?: SplitterGeometry;
|
|
184
|
+
}
|
|
185
|
+
|
|
142
186
|
/** @since 5.0 */
|
|
143
187
|
export type EditorLayerUnion = Exclude<EditableLayerUnion, SubtypeGroupLayer | CatalogFootprintLayer> | SubtypeSublayer | KnowledgeGraphSublayer;
|
|
144
188
|
|