@esri/hub-web-components 0.37.2 → 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/{GTMYGR72.js → 4VZL3FH3.js} +1 -1
- package/dist/cdn/{77R2C3NY.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/{MKMW2OIY.js → EAB7DUGA.js} +1 -1
- package/dist/cdn/GLKCCCVQ.js +2 -0
- package/dist/cdn/{SNHGQLES.js → HE3DHDMO.js} +1 -1
- package/dist/cdn/{YXKNVWVS.js → HKS652OZ.js} +1 -1
- package/dist/cdn/{SMQJD2L6.js → I2CC4Z7B.js} +1 -1
- package/dist/cdn/{UTLMCJD2.js → I3GKS5LC.js} +1 -1
- package/dist/cdn/IE3N5HKQ.js +2 -0
- package/dist/cdn/{DEVEFEZB.js → JXTLVDZ3.js} +1 -1
- package/dist/cdn/{IV7AWQ4I.js → K4JVFZDS.js} +1 -1
- package/dist/cdn/{NQJLGBVK.js → MLV6BSL7.js} +1 -1
- package/dist/cdn/{VJWEGXQY.js → MT4BUGHF.js} +1 -1
- package/dist/cdn/MUJK2PAB.js +10 -0
- package/dist/cdn/{V76BJGGX.js → N6VT6AJI.js} +1 -1
- package/dist/cdn/{JEQW7KPC.js → PTAQKJEW.js} +1 -1
- package/dist/cdn/{OAR2EXND.js → SOGZ7ZLI.js} +1 -1
- package/dist/cdn/{3SHBZF4M.js → VQ6FS65F.js} +1 -1
- package/dist/cdn/{WTEVUXDK.js → WTFAANTX.js} +1 -1
- package/dist/cdn/{HSKNYFFN.js → XRBZRHR3.js} +1 -1
- package/dist/cdn/{TWLLLMPH.js → YDFCEZES.js} +1 -1
- package/dist/cdn/{M3ZUOUC3.js → YEWX4IVK.js} +1 -1
- package/dist/cdn/{RIMWN7PN.js → YTAOXT7K.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- 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 +54 -53
- package/dist/cdn/425VBETO.js +0 -2
- package/dist/cdn/CP5CMZPK.js +0 -2
- package/dist/cdn/G3DW5HI6.js +0 -2
- package/dist/cdn/MTV6GBRX.js +0 -2
- package/dist/cdn/W5FA4IWP.js +0 -10
|
@@ -2,155 +2,155 @@
|
|
|
2
2
|
import { g as D, c as I } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as M, html as p } from "lit";
|
|
4
4
|
import { keyed as $ } from "lit/directives/keyed.js";
|
|
5
|
-
import { LitElement as T, createEvent as
|
|
5
|
+
import { LitElement as T, createEvent as b, noShadowRoot as O } from "@arcgis/lumina";
|
|
6
6
|
import { useContextProvider as V } from "@arcgis/lumina/context";
|
|
7
7
|
import { createRef as x, ref as R } from "lit/directives/ref.js";
|
|
8
8
|
import { l as H } from "../../chunks/layoutContext.js";
|
|
9
|
-
import { layoutNodeTags as
|
|
9
|
+
import { layoutNodeTags as A, cloneObject as y, findNodeById as v, setProp as j, getProp as U, deepMerge as B, Logger as _, createId as z, getWithDefault as F } from "@esri/hub-common";
|
|
10
10
|
import { g as q } from "../../chunks/state.js";
|
|
11
11
|
import { p as G } from "../../chunks/processLayout.js";
|
|
12
|
-
import { c as W, b as
|
|
12
|
+
import { c as W, b as w, i as m, a as C } from "../../chunks/typeGuards.js";
|
|
13
13
|
import { a as J, i as K } from "../../chunks/interpolate-translations.js";
|
|
14
14
|
import { u as Q } from "../../chunks/useT9n.js";
|
|
15
15
|
import { migrateSchema as X } from "@esri/hub-components";
|
|
16
|
-
import { f as
|
|
17
|
-
import { dictionary as
|
|
18
|
-
const Y = M`@layer{arcgis-layout-container{display:block;--offset-top: 0px;calcite-shell{position:static;font-size:inherit}#arcgis-layout-container-edit-mode-live-region{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}}arcgis-layout-container[is-edit-mode]{height:calc(100vh - var(--offset-top));arcgis-layout{margin-block-start:15px}calcite-panel>*{margin:1rem}calcite-panel>calcite-action.panel-close{margin:0}}}`;
|
|
19
|
-
function Z(
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
typeof
|
|
16
|
+
import { f as S } from "../../chunks/findColumnAndNodeIndex.js";
|
|
17
|
+
import { dictionary as L } from "@esri/telemetry-dictionary-hub";
|
|
18
|
+
const Y = M`@layer{arcgis-layout-container{display:block;--offset-top: 0px;calcite-shell{position:static;font-size:inherit}#arcgis-layout-container-edit-mode-live-region{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}}arcgis-layout-container[is-edit-mode]{height:calc(100vh - var(--offset-top));arcgis-layout{margin-block-start:15px}calcite-shell-panel{font-family:Avenir Next;--calcite-color-background: #f7f7f7;--calcite-color-background-none: rgba(255, 255, 255, 0);--calcite-color-border-1: #d4d4d4;--calcite-color-border-2: #dedede;--calcite-color-border-3: #ebebeb;--calcite-color-border-ghost: rgba(0, 0, 0, .3);--calcite-color-border-input: #949494;--calcite-color-border-white: #ffffff;--calcite-color-brand: #007ac2;--calcite-color-brand-hover: #00619b;--calcite-color-brand-press: #004874;--calcite-color-brand-underline: rgba(0, 97, 155, .4);--calcite-color-focus: #007ac2;--calcite-color-foreground-1: #ffffff;--calcite-color-foreground-2: #f2f2f2;--calcite-color-foreground-3: #ebebeb;--calcite-color-foreground-current: #d6efff;--calcite-color-inverse: #363636;--calcite-color-inverse-hover: #2b2b2b;--calcite-color-inverse-press: #212121;--calcite-color-status-danger: #d83020;--calcite-color-status-danger-hover: #a82b1e;--calcite-color-status-danger-press: #7c1d13;--calcite-color-status-info: #00619b;--calcite-color-status-info-hover: #004874;--calcite-color-status-info-press: #00304d;--calcite-color-status-success: #288835;--calcite-color-status-success-hover: #1a6324;--calcite-color-status-success-press: #0d3f14;--calcite-color-status-warning: #da7c0b;--calcite-color-status-warning-hover: #c26b00;--calcite-color-status-warning-press: #9a5b10;--calcite-color-surface-1: #f7f7f7;--calcite-color-surface-2: #ffffff;--calcite-color-surface-3: #f2f2f2;--calcite-color-surface-4: #ebebeb;--calcite-color-surface-highlight: #d6efff;--calcite-color-text-1: #141414;--calcite-color-text-2: #4a4a4a;--calcite-color-text-3: #6b6b6b;--calcite-color-text-highlight: #004874;--calcite-color-text-inverse: #ffffff;--calcite-color-text-link: #00619b;--calcite-color-transparent: rgba(0, 0, 0, 0);--calcite-color-transparent-hover: rgba(0, 0, 0, .04);--calcite-color-transparent-inverse-hover: rgba(255, 255, 255, .12);--calcite-color-transparent-inverse-press: rgba(255, 255, 255, .16);--calcite-color-transparent-press: rgba(0, 0, 0, .08);--calcite-color-transparent-scrim: rgba(255, 255, 255, .85);--calcite-color-transparent-tint: rgba(255, 255, 255, .8)}calcite-panel>*{margin:1rem}calcite-panel>calcite-action.panel-close{margin:0}}}`;
|
|
19
|
+
function Z(e, t) {
|
|
20
|
+
const o = ["order", "offset", "width"], i = [];
|
|
21
|
+
return o.forEach((a) => {
|
|
22
|
+
let s;
|
|
23
|
+
w(e) && (s = e.sectionProps?.[a]), m(e) && (s = e.rowProps?.[a]), C(e) && (s = e.columnProps?.[a]), typeof s == "number" ? (s < 0 || s > 12) && i.push(`Node "${e.id}": ${t} > ${a} out of range (0-12): ${s}`) : typeof s == "object" && Object.entries(s).forEach(([r, n]) => {
|
|
24
|
+
typeof n == "number" && (n < 0 || n > 12) && i.push(`Node "${e.id}": ${t} > ${a}.${r} out of range (0-12): ${n}`);
|
|
25
25
|
});
|
|
26
|
-
}),
|
|
26
|
+
}), i;
|
|
27
27
|
}
|
|
28
|
-
function tt(
|
|
28
|
+
function tt(e, t, o, i) {
|
|
29
29
|
const a = [];
|
|
30
|
-
return
|
|
30
|
+
return e.id || a.push(`${t} > missing required id.`), e.tag || a.push(`${t} > missing required tag.`), e.id && (o.has(e.id) && a.push(`Node "${e.id}": ${t} > duplicate id: "${e.id}"`), o.add(e.id)), i.includes(e.tag) || a.push(`Node "${e.id}": ${t} > has invalid tag: ${e.tag}`), a.push(...Z(e, t)), (w(e) || m(e) || C(e)) && (!e.children || !Array.isArray(e.children) || e.children.length === 0) && a.push(`Node "${e.id}": ${t} > missing or empty children array.`), a;
|
|
31
31
|
}
|
|
32
|
-
function N({ node:
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
|
|
32
|
+
function N({ node: e, nodePath: t, idSet: o, validTags: i, errors: a }) {
|
|
33
|
+
if (e.tag === "arcgis-nav-card") {
|
|
34
|
+
const s = e.properties;
|
|
35
|
+
s && typeof s == "object" && Array.isArray(s.sections) && s.sections.forEach((n, c) => {
|
|
36
36
|
const u = `${t}.sections[${c}]`;
|
|
37
37
|
N({
|
|
38
|
-
node:
|
|
38
|
+
node: n,
|
|
39
39
|
nodePath: u,
|
|
40
|
-
idSet:
|
|
40
|
+
idSet: o,
|
|
41
41
|
validTags: ["arcgis-layout-section"],
|
|
42
42
|
errors: a
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
a.push(...tt(
|
|
47
|
-
let
|
|
48
|
-
|
|
46
|
+
a.push(...tt(e, t, o, i)), Array.isArray(e.children) && e.children.forEach((s, r) => {
|
|
47
|
+
let n = `${t}.Child[${r}]`, c = Array.from(A);
|
|
48
|
+
w(e) ? (c = ["arcgis-layout-row"], n = `${t}.Row[${r}]`) : m(e) ? (c = ["arcgis-layout-column"], n = `${t}.Column[${r}]`) : C(e) && (c = Array.from(A).filter(
|
|
49
49
|
(u) => u !== "arcgis-layout-column" && u !== "arcgis-layout-section"
|
|
50
50
|
)), N({
|
|
51
|
-
node:
|
|
52
|
-
nodePath:
|
|
53
|
-
idSet:
|
|
51
|
+
node: s,
|
|
52
|
+
nodePath: n,
|
|
53
|
+
idSet: o,
|
|
54
54
|
validTags: c,
|
|
55
55
|
errors: a
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
const t = [],
|
|
61
|
-
return
|
|
62
|
-
if (W(
|
|
59
|
+
function et(e) {
|
|
60
|
+
const t = [], o = /* @__PURE__ */ new Set();
|
|
61
|
+
return e ? typeof e != "object" ? (t.push("Layout must be an object."), t) : !e.sections.length || !Array.isArray(e.sections) ? (t.push("Layout must have a sections array."), t) : (e.sections.forEach((i, a) => {
|
|
62
|
+
if (W(i))
|
|
63
63
|
return;
|
|
64
|
-
const
|
|
64
|
+
const s = i, r = `Section[${a}]`;
|
|
65
65
|
N({
|
|
66
|
-
node:
|
|
67
|
-
nodePath:
|
|
68
|
-
idSet:
|
|
66
|
+
node: s,
|
|
67
|
+
nodePath: r,
|
|
68
|
+
idSet: o,
|
|
69
69
|
validTags: ["arcgis-layout-section"],
|
|
70
70
|
errors: t
|
|
71
71
|
});
|
|
72
72
|
}), t) : (t.push("Layout must be defined."), t);
|
|
73
73
|
}
|
|
74
|
-
async function
|
|
75
|
-
return
|
|
74
|
+
async function it(e) {
|
|
75
|
+
return e === "arcgis-text-card" ? (await import("../../chunks/migrateTextCard.js")).migrateTextCard : ((t) => t);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const t =
|
|
77
|
+
function ot(e) {
|
|
78
|
+
const t = y(e);
|
|
79
79
|
return t.schemaVersion = 2, t;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
2:
|
|
81
|
+
const st = {
|
|
82
|
+
2: ot
|
|
83
83
|
};
|
|
84
|
-
async function at(
|
|
85
|
-
const t = X(
|
|
86
|
-
t.sections.map(async (
|
|
84
|
+
async function at(e) {
|
|
85
|
+
const t = X(e, st), o = await Promise.all(
|
|
86
|
+
t.sections.map(async (i) => await k(i))
|
|
87
87
|
);
|
|
88
|
-
return t.sections =
|
|
88
|
+
return t.sections = o, t;
|
|
89
89
|
}
|
|
90
|
-
async function
|
|
91
|
-
const
|
|
92
|
-
return Array.isArray(
|
|
93
|
-
|
|
94
|
-
)),
|
|
90
|
+
async function k(e) {
|
|
91
|
+
const o = (await it(e.tag))(e);
|
|
92
|
+
return Array.isArray(o.children) && (o.children = await Promise.all(
|
|
93
|
+
o.children.map(async (i) => await k(i))
|
|
94
|
+
)), o;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
if (
|
|
98
|
-
return
|
|
96
|
+
function rt(e, t) {
|
|
97
|
+
if (e.children && t < e.children.length - 1)
|
|
98
|
+
return e.children[t + 1];
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
if (
|
|
102
|
-
return
|
|
100
|
+
function nt(e, t) {
|
|
101
|
+
if (e.children && t > 0)
|
|
102
|
+
return e.children[t - 1];
|
|
103
103
|
}
|
|
104
|
-
function ct(
|
|
105
|
-
if (t <
|
|
106
|
-
return
|
|
104
|
+
function ct(e, t) {
|
|
105
|
+
if (t < e.sections.length - 1)
|
|
106
|
+
return e.sections[t + 1];
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function lt(e, t) {
|
|
109
109
|
if (t > 0)
|
|
110
|
-
return
|
|
110
|
+
return e.sections[t - 1];
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const
|
|
114
|
-
function
|
|
115
|
-
for (let
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
for (let
|
|
119
|
-
const c =
|
|
112
|
+
function dt(e, t) {
|
|
113
|
+
const o = y(t);
|
|
114
|
+
function i(a) {
|
|
115
|
+
for (let s = 0; s < a.sections.length; s++) {
|
|
116
|
+
const r = a.sections[s];
|
|
117
|
+
if (r.children)
|
|
118
|
+
for (let n = 0; n < r.children.length; n++) {
|
|
119
|
+
const c = r.children[n];
|
|
120
120
|
if (c.children)
|
|
121
121
|
for (let u = 0; u < c.children.length; u++) {
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
for (let
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
if (
|
|
128
|
-
const h =
|
|
129
|
-
return
|
|
122
|
+
const l = c.children[u];
|
|
123
|
+
if (l.children)
|
|
124
|
+
for (let d = 0; d < l.children.length; d++) {
|
|
125
|
+
const f = l.children[d];
|
|
126
|
+
if (f.id === e.id)
|
|
127
|
+
if (d > 0) {
|
|
128
|
+
const h = l.children[d - 1];
|
|
129
|
+
return l.children[d - 1] = l.children[d], l.children[d] = h, !0;
|
|
130
130
|
} else {
|
|
131
131
|
if (u > 0)
|
|
132
|
-
return
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
const h =
|
|
132
|
+
return l.children.splice(d, 1), c.children[u - 1].children?.push(e), !0;
|
|
133
|
+
if (n > 0) {
|
|
134
|
+
l.children.splice(d, 1);
|
|
135
|
+
const h = nt(r, n);
|
|
136
136
|
if (h?.children && h.children.length > 0)
|
|
137
|
-
return h.children[h.children.length - 1].children?.push(
|
|
138
|
-
} else if (
|
|
139
|
-
|
|
140
|
-
const h =
|
|
137
|
+
return h.children[h.children.length - 1].children?.push(e), !0;
|
|
138
|
+
} else if (s > 0) {
|
|
139
|
+
l.children.splice(d, 1);
|
|
140
|
+
const h = lt(a, s);
|
|
141
141
|
if (h?.children && h.children.length > 0) {
|
|
142
142
|
const g = h.children[h.children.length - 1];
|
|
143
143
|
if (g.children && g.children.length > 0)
|
|
144
|
-
return g.children[g.children.length - 1].children?.push(
|
|
144
|
+
return g.children[g.children.length - 1].children?.push(e), !0;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
if (
|
|
149
|
-
const h =
|
|
150
|
-
if (h &&
|
|
148
|
+
if (f.tag === "arcgis-nav-card") {
|
|
149
|
+
const h = f.properties?.sections;
|
|
150
|
+
if (h && i({ sections: h }))
|
|
151
151
|
return !0;
|
|
152
152
|
}
|
|
153
|
-
if (
|
|
153
|
+
if (f.children && m(f) && i({ sections: [{ children: [f] }] }))
|
|
154
154
|
return !0;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -158,50 +158,50 @@ function lt(i, t) {
|
|
|
158
158
|
}
|
|
159
159
|
return !1;
|
|
160
160
|
}
|
|
161
|
-
return
|
|
161
|
+
return i(o), o;
|
|
162
162
|
}
|
|
163
|
-
function ht(
|
|
164
|
-
const
|
|
165
|
-
function
|
|
166
|
-
for (let
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
for (let
|
|
170
|
-
const c =
|
|
163
|
+
function ht(e, t) {
|
|
164
|
+
const o = y(t);
|
|
165
|
+
function i(a) {
|
|
166
|
+
for (let s = 0; s < a.sections.length; s++) {
|
|
167
|
+
const r = a.sections[s];
|
|
168
|
+
if (r.children)
|
|
169
|
+
for (let n = 0; n < r.children.length; n++) {
|
|
170
|
+
const c = r.children[n];
|
|
171
171
|
if (c.children)
|
|
172
172
|
for (let u = 0; u < c.children.length; u++) {
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
for (let
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
178
|
-
if (
|
|
179
|
-
const h =
|
|
180
|
-
return
|
|
173
|
+
const l = c.children[u];
|
|
174
|
+
if (l.children)
|
|
175
|
+
for (let d = 0; d < l.children.length; d++) {
|
|
176
|
+
const f = l.children[d];
|
|
177
|
+
if (f.id === e.id)
|
|
178
|
+
if (d < l.children.length - 1) {
|
|
179
|
+
const h = l.children[d + 1];
|
|
180
|
+
return l.children[d + 1] = l.children[d], l.children[d] = h, !0;
|
|
181
181
|
} else {
|
|
182
182
|
if (u < c.children.length - 1)
|
|
183
|
-
return
|
|
184
|
-
if (
|
|
185
|
-
|
|
186
|
-
const h =
|
|
183
|
+
return l.children.splice(d, 1), c.children[u + 1].children?.unshift(e), !0;
|
|
184
|
+
if (n < r.children.length - 1) {
|
|
185
|
+
l.children.splice(d, 1);
|
|
186
|
+
const h = rt(r, n);
|
|
187
187
|
if (h?.children && h.children.length > 0)
|
|
188
|
-
return h.children[0].children?.unshift(
|
|
189
|
-
} else if (
|
|
190
|
-
|
|
191
|
-
const h = ct(a,
|
|
188
|
+
return h.children[0].children?.unshift(e), !0;
|
|
189
|
+
} else if (s < a.sections.length - 1) {
|
|
190
|
+
l.children.splice(d, 1);
|
|
191
|
+
const h = ct(a, s);
|
|
192
192
|
if (h?.children && h.children.length > 0) {
|
|
193
193
|
const g = h.children[0];
|
|
194
194
|
if (g.children && g.children.length > 0)
|
|
195
|
-
return g.children[0].children?.unshift(
|
|
195
|
+
return g.children[0].children?.unshift(e), !0;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
200
|
-
const h =
|
|
201
|
-
if (h &&
|
|
199
|
+
if (f.tag === "arcgis-nav-card") {
|
|
200
|
+
const h = f.properties?.sections;
|
|
201
|
+
if (h && i({ sections: h }))
|
|
202
202
|
return !0;
|
|
203
203
|
}
|
|
204
|
-
if (
|
|
204
|
+
if (f.children && m(f) && i({ sections: [{ children: [f] }] }))
|
|
205
205
|
return !0;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -209,93 +209,93 @@ function ht(i, t) {
|
|
|
209
209
|
}
|
|
210
210
|
return !1;
|
|
211
211
|
}
|
|
212
|
-
return
|
|
212
|
+
return i(o), o;
|
|
213
213
|
}
|
|
214
|
-
function ut(
|
|
215
|
-
const
|
|
216
|
-
function
|
|
214
|
+
function ut(e, t) {
|
|
215
|
+
const o = [];
|
|
216
|
+
function i(a) {
|
|
217
217
|
if (a.nodeType === Node.ELEMENT_NODE) {
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
for (const
|
|
223
|
-
|
|
218
|
+
const s = a;
|
|
219
|
+
s.matches(t) && o.push(s);
|
|
220
|
+
const r = s.shadowRoot;
|
|
221
|
+
r && i(r);
|
|
222
|
+
for (const n of Array.from(s.children))
|
|
223
|
+
i(n);
|
|
224
224
|
} else if (a instanceof ShadowRoot)
|
|
225
|
-
for (const
|
|
226
|
-
|
|
225
|
+
for (const s of Array.from(a.children))
|
|
226
|
+
i(s);
|
|
227
227
|
}
|
|
228
|
-
return e
|
|
228
|
+
return i(e), o;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
231
|
-
function
|
|
232
|
-
const t = /* @__PURE__ */ new Set(),
|
|
233
|
-
if (typeof
|
|
234
|
-
for (const a of
|
|
235
|
-
const
|
|
236
|
-
|
|
230
|
+
const ft = /\{\{\s*variables\.([^.\s}]+)\.value\s*\}\}/gu;
|
|
231
|
+
function yt(e) {
|
|
232
|
+
const t = /* @__PURE__ */ new Set(), o = (i) => {
|
|
233
|
+
if (typeof i == "string") {
|
|
234
|
+
for (const a of i.matchAll(ft)) {
|
|
235
|
+
const s = a[1];
|
|
236
|
+
s && t.add(s);
|
|
237
237
|
}
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
if (Array.isArray(
|
|
241
|
-
|
|
240
|
+
if (Array.isArray(i)) {
|
|
241
|
+
i.forEach((a) => o(a));
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
i && typeof i == "object" && Object.values(i).forEach((a) => o(a));
|
|
245
245
|
};
|
|
246
|
-
return
|
|
246
|
+
return o(e), Array.from(t);
|
|
247
247
|
}
|
|
248
|
-
function E(
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
251
|
-
return
|
|
252
|
-
const a = (
|
|
253
|
-
const
|
|
254
|
-
delete
|
|
248
|
+
function E(e, t) {
|
|
249
|
+
const o = [], i = /* @__PURE__ */ new Set();
|
|
250
|
+
if (!e.sections?.length)
|
|
251
|
+
return o;
|
|
252
|
+
const a = (s) => {
|
|
253
|
+
const r = { ...s };
|
|
254
|
+
delete r.children, r.tag === "arcgis-nav-card" && r.properties && (r.properties = { ...r.properties }, delete r.properties.sections), !i.has(s.id) && yt(r).includes(t) && (o.push(s), i.add(s.id));
|
|
255
255
|
};
|
|
256
|
-
for (const
|
|
257
|
-
if (a(
|
|
258
|
-
for (const
|
|
259
|
-
if (a(
|
|
260
|
-
for (const
|
|
261
|
-
if (a(
|
|
262
|
-
for (const c of
|
|
256
|
+
for (const s of e.sections)
|
|
257
|
+
if (a(s), !!s.children) {
|
|
258
|
+
for (const r of s.children)
|
|
259
|
+
if (a(r), !!r.children) {
|
|
260
|
+
for (const n of r.children)
|
|
261
|
+
if (a(n), !!n.children)
|
|
262
|
+
for (const c of n.children) {
|
|
263
263
|
if (a(c), c.tag === "arcgis-nav-card") {
|
|
264
264
|
const u = c.properties?.sections;
|
|
265
265
|
E(
|
|
266
266
|
{ sections: u || [] },
|
|
267
267
|
t
|
|
268
|
-
).forEach((
|
|
268
|
+
).forEach((d) => a(d));
|
|
269
269
|
}
|
|
270
270
|
m(c) && c.children && E(
|
|
271
271
|
{
|
|
272
272
|
sections: [{ children: [c] }]
|
|
273
273
|
},
|
|
274
274
|
t
|
|
275
|
-
).forEach((
|
|
275
|
+
).forEach((l) => a(l));
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
return
|
|
279
|
+
return o;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
const t =
|
|
283
|
-
return Object.keys(t.variables || {}).forEach((
|
|
284
|
-
E(t,
|
|
281
|
+
function P(e) {
|
|
282
|
+
const t = y(e);
|
|
283
|
+
return Object.keys(t.variables || {}).forEach((i) => {
|
|
284
|
+
E(t, i).length === 0 && delete t.variables?.[i];
|
|
285
285
|
}), t;
|
|
286
286
|
}
|
|
287
|
-
function gt(
|
|
288
|
-
let
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
const a =
|
|
287
|
+
function gt(e, t) {
|
|
288
|
+
let o = y(t);
|
|
289
|
+
const i = v(o, e);
|
|
290
|
+
if (i) {
|
|
291
|
+
const a = S(i, o);
|
|
292
292
|
if (a) {
|
|
293
|
-
const { column:
|
|
294
|
-
|
|
293
|
+
const { column: s, index: r } = a;
|
|
294
|
+
s.children?.splice(r, 1);
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
o = P(o);
|
|
297
297
|
}
|
|
298
|
-
return
|
|
298
|
+
return o;
|
|
299
299
|
}
|
|
300
300
|
class pt extends T {
|
|
301
301
|
constructor() {
|
|
@@ -309,11 +309,11 @@ class pt extends T {
|
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
311
|
}, this._resetLayout = async (t) => {
|
|
312
|
-
t.stopPropagation(), this._isConfirmResetDialogOpen = !0, this.hubTelemetry.emit(
|
|
312
|
+
t.stopPropagation(), this._isConfirmResetDialogOpen = !0, this.hubTelemetry.emit(L.category.interaction.action.open.label.modal.details.resetToDefault);
|
|
313
313
|
}, this._confirmResetLayout = () => {
|
|
314
314
|
this._hideConfirmResetDialog(), this.arcgisHubLayoutReset.emit({
|
|
315
315
|
successCallback: () => {
|
|
316
|
-
this._isLayoutDirty = !0, this.hubTelemetry.emit(
|
|
316
|
+
this._isLayoutDirty = !0, this.hubTelemetry.emit(L.category.interaction.action.select.label.layout.details.default);
|
|
317
317
|
}
|
|
318
318
|
});
|
|
319
319
|
}, this._handleCloseEditPanel = async () => {
|
|
@@ -323,15 +323,15 @@ class pt extends T {
|
|
|
323
323
|
await this._updateLayoutNode(this._nodeBeforeEdit.id, "properties", this._nodeBeforeEdit.properties, void 0, !0);
|
|
324
324
|
}
|
|
325
325
|
this._isEditPanelOpen = !1, this._nodeBeforeEdit = void 0, this.hubTelemetry.emit({
|
|
326
|
-
...
|
|
326
|
+
...L.category.interaction.action.close.label.sidePanel,
|
|
327
327
|
details: this._layoutNodeEditorConfig?.layoutNodeConfig?.name || "unknown"
|
|
328
328
|
});
|
|
329
329
|
}, this._setlayoutNodeEditorRef = async (t) => {
|
|
330
|
-
await this.updateComplete, await new Promise((
|
|
330
|
+
await this.updateComplete, await new Promise((o) => setTimeout(o, 100)), this.#t.setValue({
|
|
331
331
|
...this._layoutContext,
|
|
332
332
|
layoutNodeEditorRef: t
|
|
333
333
|
});
|
|
334
|
-
}, this._isConfirmResetDialogOpen = !1, this._liveAnnouncement = void 0, this._layoutErrors = [], this._historyStack = [], this._historyIdx = -1, this._isLayoutDirty = !1, this._isLayoutValid = !0, this._isEditPanelOpen = !1, this.debug = !1, this.isEditMode = !1, this.isPublishing = !1, this.options = {}, this.arcgisHubLayoutChanged =
|
|
334
|
+
}, this._isConfirmResetDialogOpen = !1, this._liveAnnouncement = void 0, this._layoutErrors = [], this._historyStack = [], this._historyIdx = -1, this._isLayoutDirty = !1, this._isLayoutValid = !0, this._isEditPanelOpen = !1, this.debug = !1, this.isEditMode = !1, this.isPublishing = !1, this.options = {}, this.arcgisHubLayoutChanged = b(), this.arcgisHubLayoutEditorExit = b(), this.arcgisHubLayoutPublished = b(), this.arcgisHubLayoutReset = b(), this.hubTelemetry = b(), this.listen("arcgisLayoutActivateNode", (t) => {
|
|
335
335
|
this._handleNodeActivate(t);
|
|
336
336
|
}), this.listen("arcgisLayoutDeactivateNode", (t) => {
|
|
337
337
|
this._handleNodeDeactivate(t);
|
|
@@ -375,8 +375,8 @@ class pt extends T {
|
|
|
375
375
|
this._initShell();
|
|
376
376
|
}
|
|
377
377
|
willUpdate(t) {
|
|
378
|
-
(t.has("layout") || t.has("options")) && this._init(), this.hasUpdated && t.has("isEditMode") && (this._activatedNode = void 0, this._layoutNodeEditorConfig = void 0, this.updateEditModeAnnouncement(), this.isEditMode && ut(this._layoutRef.value, "arcgis-hub-gallery, arcgis-hub-image").forEach((
|
|
379
|
-
|
|
378
|
+
(t.has("layout") || t.has("options")) && this._init(), this.hasUpdated && t.has("isEditMode") && (this._activatedNode = void 0, this._layoutNodeEditorConfig = void 0, this.updateEditModeAnnouncement(), this.isEditMode && ut(this._layoutRef.value, "arcgis-hub-gallery, arcgis-hub-image").forEach((i) => {
|
|
379
|
+
i.lazy = !1;
|
|
380
380
|
})), (!this.hasUpdated || t.has("_processedLayout") || t.has("_isLayoutValid")) && this.#t.setValue(this._layoutContext);
|
|
381
381
|
}
|
|
382
382
|
_hideConfirmResetDialog() {
|
|
@@ -388,88 +388,88 @@ class pt extends T {
|
|
|
388
388
|
}
|
|
389
389
|
async _init() {
|
|
390
390
|
const t = await at(this.layout);
|
|
391
|
-
this._layout =
|
|
391
|
+
this._layout = y(t), this._processedLayout = await this._validateAndProcess(this._layout, this.options), this._historyStack = [this._processedLayout], this._historyIdx = 0;
|
|
392
392
|
}
|
|
393
393
|
async getUpdateComplete() {
|
|
394
394
|
const t = await super.getUpdateComplete();
|
|
395
|
-
return await this._layoutRef.value?.updateComplete, await new Promise((
|
|
395
|
+
return await this._layoutRef.value?.updateComplete, await new Promise((o) => setTimeout(o, 150)), t;
|
|
396
396
|
}
|
|
397
397
|
async updateEditModeAnnouncement() {
|
|
398
398
|
this._liveAnnouncement = "";
|
|
399
399
|
const t = this.isEditMode ? this._messages.editModeActivatedLiveRegion : this._messages.editModeDeactivatedLiveRegion;
|
|
400
400
|
await this.updateComplete, this._liveAnnouncement = t;
|
|
401
401
|
}
|
|
402
|
-
async _updateLayoutNode(t,
|
|
403
|
-
let
|
|
404
|
-
const c =
|
|
405
|
-
c && (j(
|
|
406
|
-
...
|
|
402
|
+
async _updateLayoutNode(t, o, i, a, s, r) {
|
|
403
|
+
let n = y(this._layout);
|
|
404
|
+
const c = v(n, t);
|
|
405
|
+
c && (j(o, i, c), a && (n.variables = {
|
|
406
|
+
...n.variables,
|
|
407
407
|
...a
|
|
408
|
-
}),
|
|
408
|
+
}), n = P(n), this._layout = n, this._processedLayout = await this._validateAndProcess(n, this.options), this._activatedNode = v(this._processedLayout, t), this._historyIdx < this._historyStack.length - 1 && (this._historyStack = this._historyStack.slice(0, this._historyIdx + 1)), this._historyStack.push(this._processedLayout), this._historyIdx = this._historyStack.length - 1, this._isLayoutValid = s, this._isNodeDirty = !0, this._isLayoutDirty = !0, r && r());
|
|
409
409
|
}
|
|
410
410
|
_handleNodeActivate(t) {
|
|
411
|
-
const { node:
|
|
412
|
-
this._activatedNode =
|
|
411
|
+
const { node: o } = t.detail;
|
|
412
|
+
this._activatedNode = o;
|
|
413
413
|
}
|
|
414
414
|
_handleNodeDeactivate(t) {
|
|
415
415
|
t.detail.node.id === this._activatedNode?.id && (this._activatedNode = void 0);
|
|
416
416
|
}
|
|
417
417
|
async _handleLayoutNodeEditorChange(t) {
|
|
418
|
-
const { layoutNodeConfig:
|
|
419
|
-
if (
|
|
420
|
-
const c = (U(
|
|
418
|
+
const { layoutNodeConfig: o, id: i, values: a, valid: s } = t.detail, r = v(this._layout, i);
|
|
419
|
+
if (r) {
|
|
420
|
+
const c = (U(o, "editor.valuesOutCallback") || ((d) => d))(a, { nodeId: i, valid: s }), u = c.variables;
|
|
421
421
|
delete c.variables;
|
|
422
|
-
const
|
|
423
|
-
|
|
422
|
+
const l = r.properties || {};
|
|
423
|
+
r.properties = B(l, c), await this._updateLayoutNode(i, "properties", r.properties, u, s, () => {
|
|
424
424
|
this.arcgisHubLayoutChanged.emit();
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
async _handleLayoutNodeVisibilityChange(t) {
|
|
429
|
-
const { id:
|
|
430
|
-
|
|
429
|
+
const { id: o } = t.detail, i = v(this._layout, o);
|
|
430
|
+
i && (i.visibility || (i.visibility = { kind: "static", isHidden: !1 }), i.visibility.kind === "static" && await this._updateLayoutNode(o, "visibility", { ...i.visibility, isHidden: !i.visibility.isHidden }, void 0, !0, () => {
|
|
431
431
|
this.arcgisHubLayoutChanged.emit();
|
|
432
432
|
}));
|
|
433
433
|
}
|
|
434
|
-
async _validateAndProcess(t,
|
|
435
|
-
const
|
|
436
|
-
return this._layoutErrors =
|
|
434
|
+
async _validateAndProcess(t, o) {
|
|
435
|
+
const i = et(t);
|
|
436
|
+
return this._layoutErrors = i, i.length > 0 && !this.debug && _.error("Layout validation errors:", i), await G(t, { ...o }, this._context);
|
|
437
437
|
}
|
|
438
438
|
_handleLayoutNodeEditorOpen(t) {
|
|
439
|
-
const { node:
|
|
440
|
-
this.openLayoutNodeEditor(
|
|
439
|
+
const { node: o, element: i } = t.detail;
|
|
440
|
+
this.openLayoutNodeEditor(i, o);
|
|
441
441
|
}
|
|
442
|
-
openLayoutNodeEditor(t,
|
|
442
|
+
openLayoutNodeEditor(t, o) {
|
|
443
443
|
this._isEditPanelOpen = !0;
|
|
444
|
-
let
|
|
445
|
-
|
|
446
|
-
layoutNodeConfig:
|
|
447
|
-
layoutNode:
|
|
448
|
-
}, this._nodeBeforeEdit =
|
|
444
|
+
let i = J(t.tagName.toLowerCase(), this._layoutContext, this._context);
|
|
445
|
+
i && (i = K(this._messages, i)), this._layoutNodeEditorConfig = {
|
|
446
|
+
layoutNodeConfig: y(i),
|
|
447
|
+
layoutNode: y(o)
|
|
448
|
+
}, this._nodeBeforeEdit = y(this._activatedNode);
|
|
449
449
|
}
|
|
450
450
|
async _handleLayoutAddNode(t) {
|
|
451
451
|
_.debug("Add node event:", t.detail.config.tag);
|
|
452
|
-
const
|
|
453
|
-
_.debug("Found column and index:",
|
|
454
|
-
const
|
|
452
|
+
const o = y(this._layout), { column: i, index: a } = S(t.detail.adjacentNode, o);
|
|
453
|
+
_.debug("Found column and index:", i, a);
|
|
454
|
+
const s = {
|
|
455
455
|
id: z(),
|
|
456
456
|
tag: t.detail.config.tag,
|
|
457
457
|
properties: t.detail.config.defaults
|
|
458
458
|
};
|
|
459
|
-
|
|
460
|
-
const
|
|
461
|
-
this.openLayoutNodeEditor(
|
|
462
|
-
...
|
|
459
|
+
i.children?.splice(a + 1, 0, s), this._layout = o, this._processedLayout = await this._validateAndProcess(o, this.options), await this.updateComplete, this._activatedNode = s;
|
|
460
|
+
const r = await this._layoutRef.value?.getCardEl(s.id);
|
|
461
|
+
this.openLayoutNodeEditor(r, this._activatedNode), this._historyIdx < this._historyStack.length - 1 && (this._historyStack = this._historyStack.slice(0, this._historyIdx + 1)), this._historyStack.push(this._processedLayout), this._historyIdx = this._historyStack.length - 1, this._isLayoutDirty = !0, this.arcgisHubLayoutChanged.emit(), this.hubTelemetry.emit({
|
|
462
|
+
...L.category.interaction.action.select.label.layoutNode,
|
|
463
463
|
details: t.detail.config.name
|
|
464
464
|
});
|
|
465
465
|
}
|
|
466
466
|
async _handleLayoutRepositionNode(t) {
|
|
467
|
-
_.debug("Reposition node event:", t.detail.node.id, t.detail.direction), this._activatedNode = void 0, t.detail.direction === "up" ? (_.debug("Moving node up..."), this._layout =
|
|
467
|
+
_.debug("Reposition node event:", t.detail.node.id, t.detail.direction), this._activatedNode = void 0, t.detail.direction === "up" ? (_.debug("Moving node up..."), this._layout = dt(t.detail.node, this._layout)) : (_.debug("Moving node down..."), this._layout = ht(t.detail.node, this._layout)), this._processedLayout = await this._validateAndProcess(this._layout, this.options), await this.updateComplete, this._activatedNode = t.detail.node, (await this._layoutRef.value?.getCardEl(t.detail.node.id))?.scrollIntoView({ behavior: "smooth", block: "nearest" }), this._historyIdx < this._historyStack.length - 1 && (this._historyStack = this._historyStack.slice(0, this._historyIdx + 1)), this._historyStack.push(this._processedLayout), this._historyIdx = this._historyStack.length - 1, this._isLayoutDirty = !0, this.arcgisHubLayoutChanged.emit();
|
|
468
468
|
}
|
|
469
469
|
async _handleLayoutDeleteNode(t) {
|
|
470
470
|
_.debug("Delete node event:", t.detail.id);
|
|
471
|
-
const { id:
|
|
472
|
-
this._layout =
|
|
471
|
+
const { id: o } = t.detail, i = gt(o, this._layout);
|
|
472
|
+
this._layout = i, this._processedLayout = await this._validateAndProcess(i, this.options), this._activatedNode = void 0, this._handleCloseEditPanel(), this._historyIdx < this._historyStack.length - 1 && (this._historyStack = this._historyStack.slice(0, this._historyIdx + 1)), this._historyStack.push(this._processedLayout), this._historyIdx = this._historyStack.length - 1, this._isLayoutDirty = !0, this.arcgisHubLayoutChanged.emit();
|
|
473
473
|
}
|
|
474
474
|
renderEditToolbar() {
|
|
475
475
|
let t;
|
|
@@ -478,8 +478,8 @@ class pt extends T {
|
|
|
478
478
|
renderEditor() {
|
|
479
479
|
let t;
|
|
480
480
|
if (this.isEditMode) {
|
|
481
|
-
const
|
|
482
|
-
t = p`<calcite-shell-panel .collapsed=${!this._isEditPanelOpen} position=end slot=panel-end><calcite-panel .heading=${F(
|
|
481
|
+
const o = this._layoutNodeEditorConfig;
|
|
482
|
+
t = p`<calcite-shell-panel .collapsed=${!this._isEditPanelOpen} position=end slot=panel-end><calcite-panel .heading=${F(o || {}, "layoutNodeConfig.i18n.label", this._messages.configurableNodes.default.label)} id=editor-panel ${R(this._setlayoutNodeEditorRef)}>${o?.layoutNodeConfig?.editor && p`<calcite-action class="panel-close" icon=x @click=${this._handleCloseEditPanel} slot=header-actions-end .text=${this._messages.close}></calcite-action>${$(o.layoutNode.id, p`<arcgis-layout-node-editor .layoutNodeConfig=${o.layoutNodeConfig} .node=${o.layoutNode}></arcgis-layout-node-editor>`)}` || ""}</calcite-panel></calcite-shell-panel>`;
|
|
483
483
|
}
|
|
484
484
|
return t;
|
|
485
485
|
}
|