@esri/hub-web-components 0.37.1 → 0.37.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/24LWDIWH.js +2 -0
- package/dist/cdn/{OCLH76JV.js → 4VZL3FH3.js} +1 -1
- package/dist/cdn/{ENIUDJ7K.js → 5SFG6XNQ.js} +1 -1
- package/dist/cdn/{DIAOUTLA.js → 5VH76XSQ.js} +1 -1
- package/dist/cdn/{UAGYDOBI.js → 77NTOQZO.js} +1 -1
- package/dist/cdn/CKOFCDE3.js +2 -0
- package/dist/cdn/{J2T727KW.js → EAB7DUGA.js} +1 -1
- package/dist/cdn/GLKCCCVQ.js +2 -0
- package/dist/cdn/{J6YVMYK4.js → HE3DHDMO.js} +1 -1
- package/dist/cdn/{MK2IL6EU.js → HKS652OZ.js} +1 -1
- package/dist/cdn/{UNAHMPVZ.js → I2CC4Z7B.js} +1 -1
- package/dist/cdn/{BFDKTUKB.js → I3GKS5LC.js} +1 -1
- package/dist/cdn/IE3N5HKQ.js +2 -0
- package/dist/cdn/{I4GSA6FV.js → JXTLVDZ3.js} +1 -1
- package/dist/cdn/{NCDVI3CS.js → K4JVFZDS.js} +1 -1
- package/dist/cdn/{LGCNVPYM.js → MLV6BSL7.js} +1 -1
- package/dist/cdn/{6X3MZZZU.js → MT4BUGHF.js} +1 -1
- package/dist/cdn/MUJK2PAB.js +10 -0
- package/dist/cdn/{WO6HRRH3.js → N6VT6AJI.js} +1 -1
- package/dist/cdn/{P25YNGGG.js → PTAQKJEW.js} +1 -1
- package/dist/cdn/{M4WTQTD4.js → SOGZ7ZLI.js} +1 -1
- package/dist/cdn/{V3OFOLDD.js → VQ6FS65F.js} +1 -1
- package/dist/cdn/{H4XKOYUB.js → WTFAANTX.js} +1 -1
- package/dist/cdn/{E5HKFFMD.js → XRBZRHR3.js} +1 -1
- package/dist/cdn/{LX5L3QU6.js → YDFCEZES.js} +1 -1
- package/dist/cdn/YEWX4IVK.js +6 -0
- package/dist/cdn/{PHGORKJG.js → YTAOXT7K.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/components/arcgis-hub-entity-view-layout/customElement.js +42 -36
- package/dist/components/arcgis-layout-container/customElement.js +221 -221
- package/dist/components/arcgis-layout-editor-toolbar/customElement.js +13 -13
- package/dist/components/arcgis-layout-node-controls/customElement.js +27 -27
- package/dist/components/arcgis-layout-node-wrapper/customElement.js +31 -31
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +55 -54
- package/dist/cdn/5PZXLCBE.js +0 -2
- package/dist/cdn/EG7UYDYW.js +0 -2
- package/dist/cdn/PQAWOUBJ.js +0 -6
- package/dist/cdn/QA3FAKMR.js +0 -2
- package/dist/cdn/TZLGC5F6.js +0 -2
- package/dist/cdn/W5FA4IWP.js +0 -10
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/0.37/LICENSE.txt */
|
|
2
2
|
import { c as k } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as L, createEvent as y, noShadowRoot as A } from "@arcgis/lumina";
|
|
4
|
-
import { getProp as
|
|
4
|
+
import { getProp as i, getWithDefault as H, MetricVisibility as p, getTypeFromEntity as E, Logger as c, cloneObject as m, updateHubEntity as P, capitalize as S } from "@esri/hub-common";
|
|
5
5
|
import { u as R } from "../../chunks/useT9n.js";
|
|
6
6
|
import { isTargetEntityScopeConfigured as n, showNotice as b } from "@esri/hub-components";
|
|
7
7
|
import { g as $ } from "../../chunks/state.js";
|
|
8
8
|
import { constants as w, dictionary as v } from "@esri/telemetry-dictionary-hub";
|
|
9
9
|
import { html as f } from "lit";
|
|
10
10
|
const I = async (t, e) => {
|
|
11
|
-
const
|
|
11
|
+
const a = !!t.summary, r = !!t.description, s = !!i(t, "view.embeds[0]"), C = !!i(t, "view.featuredImageUrl"), O = a || r || s || C;
|
|
12
12
|
let d = "";
|
|
13
13
|
e?.isAuthenticated && (d = `?token=${e.session.token}`);
|
|
14
|
-
const T = `${
|
|
14
|
+
const T = `${i(t, "view.featuredImageUrl")}${d}`, u = H(t, "view.metricDisplays", []), g = u.filter((o) => o.visibility === p.featured), x = u.filter((o) => o.visibility !== p.hidden);
|
|
15
15
|
let h = [];
|
|
16
|
-
h =
|
|
16
|
+
h = i(t, "typeKeywords");
|
|
17
17
|
const l = h.filter(
|
|
18
18
|
(o) => o.startsWith("ref|initiative")
|
|
19
19
|
);
|
|
@@ -103,35 +103,41 @@ const I = async (t, e) => {
|
|
|
103
103
|
html: "<h2>{{about:translate}}</h2>"
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
-
|
|
106
|
+
// NOTE: we use getProp here and elsewhere to conditionally include nodes in the layout based on the presence of data in the project entity.
|
|
107
|
+
// we could instead use syntax like {{entity.summary:optional}} or {{entity.view.timeline.stages:optional:2}} in the properties of a node
|
|
108
|
+
// so that interpolation removes them later. however, we should not do that because that means that our layout and our processed layout
|
|
109
|
+
// in the layout container have different shapes which could lead to bugs and makes it more difficult to reason about the code.
|
|
110
|
+
// by using getProp to conditionally include nodes in the layout, we ensure that the layout and processed layout have the same shape
|
|
111
|
+
// and we can be confident that if a node is in the layout then it will be rendered in the processed layout (assuming it's not filtered out for some reason).
|
|
112
|
+
i(t, "summary") && {
|
|
107
113
|
id: "about-summary",
|
|
108
114
|
tag: "arcgis-text-card",
|
|
109
115
|
readOnly: !0,
|
|
110
116
|
properties: {
|
|
111
|
-
html: "<p>{{entity.summary
|
|
117
|
+
html: "<p>{{entity.summary}}</p>"
|
|
112
118
|
}
|
|
113
119
|
},
|
|
114
|
-
|
|
120
|
+
i(t, "view.embeds[0]") && {
|
|
115
121
|
id: "about-embed",
|
|
116
122
|
tag: "arcgis-hub-embed-card",
|
|
117
123
|
properties: {
|
|
118
|
-
embed:
|
|
124
|
+
embed: i(t, "view.embeds[0]")
|
|
119
125
|
}
|
|
120
126
|
},
|
|
121
|
-
{
|
|
127
|
+
i(t, "description") && {
|
|
122
128
|
id: "about-description",
|
|
123
129
|
tag: "arcgis-text-card",
|
|
124
130
|
readOnly: !0,
|
|
125
131
|
properties: {
|
|
126
|
-
html: "<p>{{entity.description
|
|
132
|
+
html: "<p>{{entity.description}}</p>"
|
|
127
133
|
}
|
|
128
134
|
},
|
|
129
|
-
|
|
135
|
+
i(t, "view.featuredImageUrl") && {
|
|
130
136
|
id: "about-featured-image",
|
|
131
137
|
tag: "arcgis-hub-image",
|
|
132
138
|
properties: {
|
|
133
139
|
src: T,
|
|
134
|
-
alt:
|
|
140
|
+
alt: i(t, "view.featuredImageAltText") || ""
|
|
135
141
|
}
|
|
136
142
|
},
|
|
137
143
|
g.length > 0 && {
|
|
@@ -149,14 +155,14 @@ const I = async (t, e) => {
|
|
|
149
155
|
entity: "{{entity}}"
|
|
150
156
|
}
|
|
151
157
|
},
|
|
152
|
-
|
|
158
|
+
i(t, "view.featuredContentIds.length") > 0 && {
|
|
153
159
|
id: "featured-content-header",
|
|
154
160
|
tag: "arcgis-text-card",
|
|
155
161
|
properties: {
|
|
156
162
|
html: "<h2>{{featuredContent:translate}}</h2>"
|
|
157
163
|
}
|
|
158
164
|
},
|
|
159
|
-
|
|
165
|
+
i(t, "view.featuredContentIds.length") > 0 && {
|
|
160
166
|
id: "featured-content-gallery",
|
|
161
167
|
tag: "arcgis-hub-gallery-card",
|
|
162
168
|
properties: {
|
|
@@ -178,7 +184,7 @@ const I = async (t, e) => {
|
|
|
178
184
|
{
|
|
179
185
|
predicates: [
|
|
180
186
|
{
|
|
181
|
-
id:
|
|
187
|
+
id: i(t, "view.featuredContentIds")
|
|
182
188
|
}
|
|
183
189
|
]
|
|
184
190
|
}
|
|
@@ -210,13 +216,13 @@ const I = async (t, e) => {
|
|
|
210
216
|
entity: "{{entity}}"
|
|
211
217
|
}
|
|
212
218
|
},
|
|
213
|
-
{
|
|
219
|
+
i(t, "view.timeline.stages")?.length && {
|
|
214
220
|
id: "status-timeline",
|
|
215
221
|
tag: "arcgis-hub-timeline",
|
|
216
222
|
readOnly: !0,
|
|
217
223
|
properties: {
|
|
218
224
|
canCollapse: "{{entity.view.timeline.canCollapse:optional}}",
|
|
219
|
-
stages: "{{entity.view.timeline.stages
|
|
225
|
+
stages: "{{entity.view.timeline.stages}}"
|
|
220
226
|
}
|
|
221
227
|
},
|
|
222
228
|
{
|
|
@@ -425,7 +431,7 @@ const I = async (t, e) => {
|
|
|
425
431
|
]
|
|
426
432
|
};
|
|
427
433
|
}, V = async (t, e) => {
|
|
428
|
-
const
|
|
434
|
+
const a = !!t.summary, r = !!t.description;
|
|
429
435
|
return {
|
|
430
436
|
schemaVersion: 2,
|
|
431
437
|
history: [],
|
|
@@ -505,27 +511,27 @@ const I = async (t, e) => {
|
|
|
505
511
|
columnProps: { width: { xs: 12, md: 8 } },
|
|
506
512
|
properties: {},
|
|
507
513
|
children: [
|
|
508
|
-
(
|
|
514
|
+
(a || r) && {
|
|
509
515
|
id: "about-header",
|
|
510
516
|
tag: "arcgis-text-card",
|
|
511
517
|
properties: {
|
|
512
518
|
html: "<h2>{{about:translate}}</h2>"
|
|
513
519
|
}
|
|
514
520
|
},
|
|
515
|
-
{
|
|
521
|
+
i(t, "summary") && {
|
|
516
522
|
id: "about-summary",
|
|
517
523
|
tag: "arcgis-text-card",
|
|
518
524
|
readOnly: !0,
|
|
519
525
|
properties: {
|
|
520
|
-
html: "<p>{{entity.summary
|
|
526
|
+
html: "<p>{{entity.summary}}</p>"
|
|
521
527
|
}
|
|
522
528
|
},
|
|
523
|
-
{
|
|
529
|
+
i(t, "description") && {
|
|
524
530
|
id: "about-description",
|
|
525
531
|
tag: "arcgis-text-card",
|
|
526
532
|
readOnly: !0,
|
|
527
533
|
properties: {
|
|
528
|
-
html: "<p>{{entity.description
|
|
534
|
+
html: "<p>{{entity.description}}</p>"
|
|
529
535
|
}
|
|
530
536
|
}
|
|
531
537
|
].filter(Boolean)
|
|
@@ -660,8 +666,8 @@ const I = async (t, e) => {
|
|
|
660
666
|
]
|
|
661
667
|
};
|
|
662
668
|
}, _ = async (t, e) => {
|
|
663
|
-
let
|
|
664
|
-
return E(t) === "project" ?
|
|
669
|
+
let a;
|
|
670
|
+
return E(t) === "project" ? a = await I(t, e) : a = await V(t), a;
|
|
665
671
|
};
|
|
666
672
|
class D extends L {
|
|
667
673
|
constructor() {
|
|
@@ -680,20 +686,20 @@ class D extends L {
|
|
|
680
686
|
return this.entity && E(this.entity);
|
|
681
687
|
}
|
|
682
688
|
willUpdate(e) {
|
|
683
|
-
e.has("entity") && this._init().catch((
|
|
684
|
-
c.error("Error initializing ArcgisHubEntityViewLayout >>>",
|
|
689
|
+
e.has("entity") && this._init().catch((a) => {
|
|
690
|
+
c.error("Error initializing ArcgisHubEntityViewLayout >>>", a);
|
|
685
691
|
});
|
|
686
692
|
}
|
|
687
693
|
async _init() {
|
|
688
694
|
let e;
|
|
689
|
-
this.entity && (e =
|
|
695
|
+
this.entity && (e = i(this.entity, "layout"), e || (e = await _(this.entity, this._context)), this._layout = e);
|
|
690
696
|
}
|
|
691
697
|
async _handleLayoutPublished(e) {
|
|
692
|
-
const { layout:
|
|
698
|
+
const { layout: a, successCallback: r } = e.detail;
|
|
693
699
|
try {
|
|
694
|
-
this._isPublishing = !0, this._layout =
|
|
695
|
-
const
|
|
696
|
-
|
|
700
|
+
this._isPublishing = !0, this._layout = a;
|
|
701
|
+
const s = m(this.entity);
|
|
702
|
+
s.layout = a, await P(this._entityType, s, this._context), r && await r(), c.info(`Successfully published layout for ${this._entityType} ${this.entity.id} >>>`, this._layout), b({
|
|
697
703
|
title: this._messages.publishSuccess,
|
|
698
704
|
message: "",
|
|
699
705
|
configuration: {
|
|
@@ -708,8 +714,8 @@ class D extends L {
|
|
|
708
714
|
...v.category.content.action.update.label.layout.details.publish,
|
|
709
715
|
response: w.response.SUCCESS
|
|
710
716
|
}), this.arcgisHubEntityViewPublished.emit();
|
|
711
|
-
} catch (
|
|
712
|
-
c.error(`Error publishing layout for ${this._entityType} ${this.entity.id} >>>`,
|
|
717
|
+
} catch (s) {
|
|
718
|
+
c.error(`Error publishing layout for ${this._entityType} ${this.entity.id} >>>`, s), b({
|
|
713
719
|
title: this._messages.publishError,
|
|
714
720
|
message: "",
|
|
715
721
|
configuration: {
|
|
@@ -729,8 +735,8 @@ class D extends L {
|
|
|
729
735
|
}
|
|
730
736
|
}
|
|
731
737
|
async _handleLayoutReset(e) {
|
|
732
|
-
const
|
|
733
|
-
|
|
738
|
+
const a = m(this.entity);
|
|
739
|
+
a.layout && delete a.layout, this._layout = await _(a, this._context), e.detail.successCallback && await e.detail.successCallback();
|
|
734
740
|
}
|
|
735
741
|
render() {
|
|
736
742
|
return this._layout ? f`<calcite-alert auto-close auto-close-duration=slow icon=information label="internal layout alert" kind=info open><div slot=title>${S(this._entityType || "")} view rendered as layout</div><div slot=message>We are rendering ${this._entityType} views on dev/QA alpha orgs using the new layout system. This system is
|