@vertigis/viewer-spec 50.5.0 → 50.6.0
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/README.md +1 -1
- package/analytics/AnalyticsContext.d.ts +2 -1
- package/analytics/CommonAction.d.ts +2 -1
- package/analytics/MobileAction.d.ts +6 -3
- package/app-config/AppConfig.d.ts +11 -8
- package/app-config/common/BrandingThemeProperties.d.ts +4 -2
- package/app-config/common/HighlightModelProperties.d.ts +4 -2
- package/app-config/common/LayerPresetsModelProperties.d.ts +2 -1
- package/app-config/common/LicensingModelProperties.d.ts +1 -1
- package/app-config/common/ResultsModelProperties.d.ts +2 -1
- package/app-config/common/TranslatableText.d.ts +2 -1
- package/app-config/common/WorkflowModelProperties.d.ts +4 -2
- package/app-config/mobile/FeatureDetailsModelProperties.d.ts +4 -2
- package/app-config/mobile/VertigisMobileModelProperties.d.ts +4 -3
- package/app-config/schema/common-app-config.schema.json +1 -1
- package/app-config/schema/mobile-app-config.schema.json +1 -1
- package/app-config/schema/web-app-config.schema.json +1 -1
- package/app-config/web/CoordinateModelProperties.d.ts +2 -1
- package/app-config/web/DrawModelProperties.d.ts +2 -1
- package/app-config/web/HasVisibilityFilters.d.ts +2 -1
- package/app-config/web/KpiCardModelProperties.d.ts +2 -1
- package/app-config/web/MapCoordinatesModelProperties.d.ts +2 -1
- package/app-config/web/MapModelProperties.d.ts +4 -2
- package/app-config/web/MeasurementModelProperties.d.ts +2 -1
- package/app-config/web/PortalModelProperties.d.ts +2 -1
- package/app-config/web/ResultsModelProperties.d.ts +4 -2
- package/app-config/web/SearchModelProperties.d.ts +2 -1
- package/app-config/web/VertigisWebModelProperties.d.ts +6 -3
- package/docs/Geocortex Apps.md +8 -8
- package/docs/layout-spec.md +105 -94
- package/layout/schema/layout-common.xsd +1 -1
- package/layout/schema/layout-web.xsd +1 -1
- package/messaging/Command.d.ts +4 -2
- package/messaging/Event.d.ts +4 -2
- package/messaging/Message.d.ts +2 -1
- package/messaging/Operation.d.ts +4 -2
- package/messaging/common.d.ts +12 -6
- package/messaging/registry/app.d.ts +12 -6
- package/messaging/registry/arcade.d.ts +6 -3
- package/messaging/registry/auth.d.ts +12 -7
- package/messaging/registry/basemap.d.ts +2 -1
- package/messaging/registry/drawing.d.ts +8 -4
- package/messaging/registry/edit.d.ts +6 -3
- package/messaging/registry/file.d.ts +2 -1
- package/messaging/registry/geocode.d.ts +8 -5
- package/messaging/registry/geolocation.d.ts +26 -11
- package/messaging/registry/geolocation.js +1 -1
- package/messaging/registry/geometry.d.ts +10 -5
- package/messaging/registry/kpi.d.ts +4 -2
- package/messaging/registry/layout.d.ts +2 -1
- package/messaging/registry/location-marker.d.ts +10 -5
- package/messaging/registry/map.d.ts +15 -8
- package/messaging/registry/measurement.d.ts +4 -2
- package/messaging/registry/messaging.d.ts +1 -1
- package/messaging/registry/offline.d.ts +16 -9
- package/messaging/registry/panel.d.ts +2 -1
- package/messaging/registry/portal.d.ts +8 -4
- package/messaging/registry/printing.d.ts +4 -2
- package/messaging/registry/results.d.ts +19 -10
- package/messaging/registry/settings.d.ts +4 -2
- package/messaging/registry/sketching.d.ts +38 -26
- package/messaging/registry/tasks.d.ts +7 -4
- package/messaging/registry/ui.d.ts +14 -7
- package/messaging/registry/viewer.d.ts +2 -1
- package/messaging/registry/workflow.d.ts +6 -3
- package/messaging/schema/common-action.schema.json +269 -236
- package/messaging/schema/common-event.schema.json +118 -122
- package/messaging/schema/mobile-action.schema.json +294 -217
- package/messaging/schema/mobile-event.schema.json +146 -153
- package/messaging/schema/web-action.schema.json +305 -269
- package/messaging/schema/web-event.schema.json +144 -151
- package/package.json +17 -17
- package/version.d.ts +2 -2
- package/version.js +2 -2
package/docs/layout-spec.md
CHANGED
|
@@ -5,28 +5,27 @@
|
|
|
5
5
|
A Microsoft Word version of this document is maintained in the Products Team SharePoint site.
|
|
6
6
|
This document should be treated as the source of the Word document.
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
## Amendments
|
|
10
9
|
|
|
11
10
|
As per the March 17, 2017 meeting, the following modifications were decided upon:
|
|
12
11
|
|
|
13
|
-
-
|
|
12
|
+
- Config items referenced from layout should support an additional short hand notation where the item type is not specified. Instead, since the item type for the particular component is already known, we can use that in conjunction with a supplied item id, to find the item on the app.json. Example: <map id="secondary" config="ortho-photos-2017" />
|
|
14
13
|
|
|
15
14
|
The URI based syntax is also supported. Example:
|
|
16
15
|
|
|
17
16
|
<map id="secondary" config="item://MapExtension/ortho-photos-2017" />
|
|
18
17
|
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
- The term "group" is preferable and more clear than "region".
|
|
18
|
+
- We won’t be building shell components until we need them, if we need them. Additionally, the term "shell" may or may not be used.
|
|
22
19
|
|
|
23
|
-
-
|
|
20
|
+
- The term "group" is preferable and more clear than "region".
|
|
24
21
|
|
|
25
|
-
-
|
|
22
|
+
- Regions/groups will not be implemented until we need them, if we need them.
|
|
26
23
|
|
|
24
|
+
- CSS style selectors for targeting components were using a dot (.) in front of component types. The dot should be dropped to be in alignment with CSS.
|
|
27
25
|
|
|
28
26
|
## Intro
|
|
29
|
-
|
|
27
|
+
|
|
28
|
+
The _ArcGIS Extensions API_ introduces a powerful schema for defining and managing spatial applications.
|
|
30
29
|
|
|
31
30
|
This schema is used by our next-generation _viewers_, and represents the ability to express fully cross-platform _apps_ via singular, shareable items. For example, an _inspections.json_ app in your organization's Portal that defines all of the configuration involved in realizing a running instance of that particular application.
|
|
32
31
|
|
|
@@ -36,8 +35,8 @@ In order to achieve the objective of truly cross-platform apps, and to account f
|
|
|
36
35
|
|
|
37
36
|
This new entity is known as an _Application Layout_, and is a resource that can be referenced by apps or inferred from a simple Web Map. This new entry into our lexicon represents a design language capable of rapidly expressing simple and complex apps alike, and in terms of reusable, contextually bound components.
|
|
38
37
|
|
|
39
|
-
|
|
40
38
|
## Overview
|
|
39
|
+
|
|
41
40
|
Application Layouts are simple, human readable XML documents. They express the _structural composition_ and _visual arrangement_ of apps in terms of their constituent components, and how those components interact with each other.
|
|
42
41
|
|
|
43
42
|
**Layouts are strictly technology neutral**. As a hard rule, implementation details from _specific technologies_ should never leak into layouts, just like they should never leak into the API.
|
|
@@ -49,56 +48,60 @@ Apps reference one more _layouts_ as _items_. When a viewer loads an app, it "se
|
|
|
49
48
|
The details of how a viewer selects the appropriate layout to load on app startup is left out of this document and can safely be considered a viewer-level implementation detail. However, it's worth noting that layouts can be hardcoded or synthesized as well. For example, a viewer may derive a layout directly from a Web Map when loading an app that references no layouts, or simply fall back to a map centric, in-built default.
|
|
50
49
|
|
|
51
50
|
### Notes
|
|
52
|
-
- Layouts are concise, technology-agnostic XML documents
|
|
53
|
-
- Layouts define user interfaces in simple, cross-platform ways
|
|
54
|
-
- Layouts bind user interface elements to configured items
|
|
55
|
-
- Layouts are no different than any other item an app can reference
|
|
56
|
-
- Apps can reference multiple layouts, in which case a viewer will select the one to load
|
|
57
|
-
- Layouts can be derived from Web Maps or Web Scenes when none is available
|
|
58
51
|
|
|
52
|
+
- Layouts are concise, technology-agnostic XML documents
|
|
53
|
+
- Layouts define user interfaces in simple, cross-platform ways
|
|
54
|
+
- Layouts bind user interface elements to configured items
|
|
55
|
+
- Layouts are no different than any other item an app can reference
|
|
56
|
+
- Apps can reference multiple layouts, in which case a viewer will select the one to load
|
|
57
|
+
- Layouts can be derived from Web Maps or Web Scenes when none is available
|
|
59
58
|
|
|
60
59
|
## Proposed Schema Versions
|
|
60
|
+
|
|
61
61
|
In contrasting GMV and GWV requirements and objectives as well as potential enhancements, we have decided to consider multiple layout spec versions:
|
|
62
62
|
|
|
63
63
|
1.0: A scope-constrained 1.0 suitable for initial versions of GMV to use.
|
|
64
64
|
1.1: Introduces support for multiple components, and mechanisms for working with "arity"
|
|
65
65
|
1.2: A set of progressive enhancements that possibly includes accessibility mechanisms (e.g. skip lists), control over fault-tolerance, support for printing, and support for drag and drop
|
|
66
66
|
|
|
67
|
-
This document covers the core aspects of 1.0 and 1.1. GMV will initially use spec 1.0, and GWV will use 1.1 to allow more flexible layouts.
|
|
67
|
+
This document covers the core aspects of 1.0 and 1.1. GMV will initially use spec 1.0, and GWV will use 1.1 to allow more flexible layouts.
|
|
68
68
|
Each version of the spec will have an XSD.
|
|
69
69
|
|
|
70
|
-
|
|
71
70
|
### Schema 1.0
|
|
71
|
+
|
|
72
72
|
Version 1.0 addresses ground-level compatibility topics between viewers, primarily by defining and normalizing patterns and practices that may have implications that affect compatibility across viewers.
|
|
73
73
|
|
|
74
74
|
#### 1.0 Topics:
|
|
75
|
-
- App compatibility across GWV and GMV
|
|
76
|
-
- Syntax and semantics
|
|
77
|
-
- Binding of configuration to components
|
|
78
|
-
- Lazy loading and baseline fault tolerance for components
|
|
79
|
-
- Core set of initial components (i.e. `map`, `scene`, "primitives")
|
|
80
|
-
- Technology-neutral, resolution-independent sizing and positioning attributes (a.k.a. "liquid layouts")
|
|
81
75
|
|
|
76
|
+
- App compatibility across GWV and GMV
|
|
77
|
+
- Syntax and semantics
|
|
78
|
+
- Binding of configuration to components
|
|
79
|
+
- Lazy loading and baseline fault tolerance for components
|
|
80
|
+
- Core set of initial components (i.e. `map`, `scene`, "primitives")
|
|
81
|
+
- Technology-neutral, resolution-independent sizing and positioning attributes (a.k.a. "liquid layouts")
|
|
82
82
|
|
|
83
83
|
### Schema 1.1
|
|
84
|
+
|
|
84
85
|
Version 1.1 addresses secondary concerns and value additions that GMV 1.0 can safely defer.
|
|
85
86
|
GWV has already implemented "arity", and accessibility (WCAG 2.0 AA) is required for GVH parity.
|
|
86
87
|
Because of this, GWV should ship with schema 1.1.
|
|
87
88
|
|
|
88
89
|
#### Topics:
|
|
89
|
-
- Declarative control over "arity" (i.e. handling 0-to-many maps, scenes, etc)
|
|
90
|
-
- Accessibility enhancements, i.e. skip lists, declarative screen reader content and controls
|
|
91
90
|
|
|
91
|
+
- Declarative control over "arity" (i.e. handling 0-to-many maps, scenes, etc)
|
|
92
|
+
- Accessibility enhancements, i.e. skip lists, declarative screen reader content and controls
|
|
92
93
|
|
|
93
94
|
### Schema 1.2
|
|
95
|
+
|
|
94
96
|
Schema 1.2 extends previous versions
|
|
95
97
|
|
|
96
98
|
#### Topics:
|
|
97
|
-
- Declarative control over fault tolerance (e.g. "failure mode" attributes)
|
|
98
|
-
- Non-interactive use cases (i.e. relationships to _Print Templates_, _Reports_)
|
|
99
99
|
|
|
100
|
+
- Declarative control over fault tolerance (e.g. "failure mode" attributes)
|
|
101
|
+
- Non-interactive use cases (i.e. relationships to _Print Templates_, _Reports_)
|
|
100
102
|
|
|
101
103
|
## Syntax and semantics
|
|
104
|
+
|
|
102
105
|
Layouts use simple XML to represent user interfaces with as little cognitive load as possible.
|
|
103
106
|
Here is a layout expressing a simple spatial application comprised of a map:
|
|
104
107
|
|
|
@@ -130,7 +133,7 @@ In this example, the custom namespace for Cityworks is added to a layout documen
|
|
|
130
133
|
|
|
131
134
|
We recognize that admins and implementors frequently hand-edit configuration, and thus consider it a part of UX. With this in mind, our syntax and semantics are intended to be concise and human-friendly. Like apps, layouts are always _human readable_, and suitable for _hand-editing_.
|
|
132
135
|
|
|
133
|
-
In layouts, element and attribute names are "kebab-cased". Words are always lowercase and
|
|
136
|
+
In layouts, element and attribute names are "kebab-cased". Words are always lowercase and separated by hyphens:
|
|
134
137
|
|
|
135
138
|
```XML
|
|
136
139
|
<map>
|
|
@@ -141,16 +144,17 @@ In layouts, element and attribute names are "kebab-cased". Words are always lowe
|
|
|
141
144
|
Double-quotes are used for attributes, and we suggest that attribute values use the same kebab-cased convention.
|
|
142
145
|
|
|
143
146
|
# Notes
|
|
144
|
-
- Layouts are human-friendly, expressed in simple, concise XML
|
|
145
|
-
- Layouts can include custom components via XML namespaces
|
|
146
|
-
- Layout elements and attribute names are "kebab-cased":
|
|
147
|
-
- All lowercase
|
|
148
|
-
- Words separated by hyphens, i.e. `<my-custom-component spin-map="true" />`
|
|
149
|
-
- Double-quotes are used for attributes
|
|
150
|
-
- Kebab-casing suggested for attribute values as well
|
|
151
147
|
|
|
148
|
+
- Layouts are human-friendly, expressed in simple, concise XML
|
|
149
|
+
- Layouts can include custom components via XML namespaces
|
|
150
|
+
- Layout elements and attribute names are "kebab-cased":
|
|
151
|
+
- All lowercase
|
|
152
|
+
- Words separated by hyphens, i.e. `<my-custom-component spin-map="true" />`
|
|
153
|
+
- Double-quotes are used for attributes
|
|
154
|
+
- Kebab-casing suggested for attribute values as well
|
|
152
155
|
|
|
153
156
|
## Layouts bind components to config
|
|
157
|
+
|
|
154
158
|
As a viewer loads a layout, it maps components to configuration items in an _app container_, resolving them asynchronously and passing them to the components for consumption during initialization.
|
|
155
159
|
|
|
156
160
|
These bindings to config are known as "item references", and they can be explicit or implicit. Example:
|
|
@@ -174,20 +178,20 @@ When the viewer finds a map component with no item reference specified, it can u
|
|
|
174
178
|
|
|
175
179
|
item://Map/default
|
|
176
180
|
|
|
177
|
-
|
|
178
181
|
## Missing configuration
|
|
182
|
+
|
|
179
183
|
When a component implicitly or explicitly references config that does not exist in the app, the component is said to have _missing config_.
|
|
180
184
|
This type of fault is not treated as _exceptional_. Depending on use case, it may be A-OK to simply hide components who have missing config.
|
|
181
185
|
|
|
182
186
|
For any component encountered that is found to have _missing config_, a viewer may choose to do one of the following:
|
|
183
|
-
|
|
184
|
-
|
|
187
|
+
A. Halt the loading process, indicating to the user that a component is missing configuration and the app failed to load
|
|
188
|
+
B. Issue a warning to the user, continuing the loading process, ignoring any sub-components configured under the failed one
|
|
185
189
|
|
|
186
190
|
Which option a viewer takes for a given component is referred to as the component's _failure mode_, and declarative control over this is deferred as a possible 1.2 topic.
|
|
187
191
|
|
|
188
|
-
|
|
189
192
|
## Unresolved configuration
|
|
190
|
-
|
|
193
|
+
|
|
194
|
+
When a component has an explicit or implicit item reference, but that item reference fails to load, it is considered as having _unresolved configuration_.
|
|
191
195
|
Unlike _missing config_, this class of fault is exceptional - it indicates an erroneous situation.
|
|
192
196
|
Something has caught on fire, or the user does not have access.
|
|
193
197
|
|
|
@@ -200,15 +204,16 @@ C) Malformed configuration
|
|
|
200
204
|
As a viewer loads a layout, instances of unresolved config (and for why they are unresolved) are collected for the purposes of presenting a user a singular prompt for which to acknowledge the errors, and/or retry an authentication flow.
|
|
201
205
|
|
|
202
206
|
As is the case with _missing config_, a viewer that loads components with _unresolved config_ can continue loading if and when components fail to load unresolved config.
|
|
203
|
-
However, since unresolved configuration represents exceptional (erroneous)
|
|
204
|
-
|
|
207
|
+
However, since unresolved configuration represents exceptional (erroneous) behavior, the user should receive notification of the fault(s).
|
|
205
208
|
|
|
206
209
|
## Loading sequence
|
|
210
|
+
|
|
207
211
|
This layout consists of a single web map and for which a _binding to the default `MapExtension` in the app is implied:_
|
|
208
212
|
|
|
209
213
|
```XML
|
|
210
214
|
<map />
|
|
211
215
|
```
|
|
216
|
+
|
|
212
217
|
Upon encountering a component bearing no item reference, a viewer will:
|
|
213
218
|
|
|
214
219
|
1. Check the component's metadata for a "default item type"
|
|
@@ -217,9 +222,9 @@ Upon encountering a component bearing no item reference, a viewer will:
|
|
|
217
222
|
1. If the item does not exist in the container, the viewer will consider the component as having _missing config_
|
|
218
223
|
1. If the item exists in the container, but cannot be resolved to due auth or service failure, it is considered to have _unresolved config_
|
|
219
224
|
1. When a component has _missing_ or _unresolved_ config, the viewer may choose to do one of the following:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
225
|
+
A. Halt the loading process, indicating to the user that a component is missing configuration and the app failed to load
|
|
226
|
+
B. Fallback to "baked in" configuration for the component, colocated with the module, entering a mode of "outright failure", or option C
|
|
227
|
+
C. Logging a warning, and continuing the loading process, ignoring any sub-components configured under the failed one
|
|
223
228
|
|
|
224
229
|
Which option is chosen is considered a component's _failure mode_.
|
|
225
230
|
|
|
@@ -228,7 +233,7 @@ Future schema versions may wish to treat these faults differently.
|
|
|
228
233
|
|
|
229
234
|
Missing config simply means that the contents of the layout and the app don't necessarily line up, and that is OK in certain use cases.
|
|
230
235
|
Debug warnings can be logged, but the viewer may not wish to expose any "failure" to the average user.
|
|
231
|
-
This means that we can use any layout with any app, and simply gracefully degrade. In other words, a viewer's default layout is capable of loading
|
|
236
|
+
This means that we can use any layout with any app, and simply gracefully degrade. In other words, a viewer's default layout is capable of loading _any_
|
|
232
237
|
app without outright failure. The user simply won't see components that are missing config.
|
|
233
238
|
|
|
234
239
|
Contrast this to _unresolved_ config, where we are either not authorized, or a Portal is broken or has moved, or we have encountered outright broken configuration.
|
|
@@ -237,14 +242,14 @@ For this class of failure, we will most likely want to at least notify the user
|
|
|
237
242
|
**Note:** For GMV 1.0 and GWV 1.0, we suggest a default "failure mode" of "continue loading whatever else you can, logging warnings to the console".
|
|
238
243
|
Declarative control of this is proposed as a future topic for Schema 1.2.
|
|
239
244
|
|
|
240
|
-
|
|
241
245
|
### Summary
|
|
242
|
-
- When an item reference and a _defaults.json_ are not available, the viewer will simply warn the user and continue loading
|
|
243
|
-
- This "baseline" of fault tolerance may be controlled by admins and devs in the future, i.e. to explicitly fail on missing config
|
|
244
|
-
- For 1.0, the viewer will just continue loading and emit useful log information saying that component X or Y could not be loaded to to missing config
|
|
245
246
|
|
|
247
|
+
- When an item reference and a _defaults.json_ are not available, the viewer will simply warn the user and continue loading
|
|
248
|
+
- This "baseline" of fault tolerance may be controlled by admins and developers in the future, i.e. to explicitly fail on missing config
|
|
249
|
+
- For 1.0, the viewer will just continue loading and emit useful log information saying that component X or Y could not be loaded to to missing config
|
|
246
250
|
|
|
247
251
|
## Composition: Slotting
|
|
252
|
+
|
|
248
253
|
Consider the following example layout:
|
|
249
254
|
|
|
250
255
|
```XML
|
|
@@ -258,7 +263,7 @@ How might a user anchor the scale bar component to a particular corner or edge o
|
|
|
258
263
|
|
|
259
264
|
To phrase in more technical terms: how are components _composed_ together? The answer to this question is "slotting".
|
|
260
265
|
|
|
261
|
-
> Note: The
|
|
266
|
+
> Note: The behavior and terminology for "slotting" is borrowed from the _Web Components_ spec, where the major browser vendors have collectively solved and defined the problems and solutions to composing elements hierarchically.
|
|
262
267
|
|
|
263
268
|
_Slotting_ is the act of hosting components inside of other components, and involves a declarative mechanism for layout authors to target "slots" when composing components together.
|
|
264
269
|
|
|
@@ -271,9 +276,9 @@ To anchor to the top right corner, a layout author may express the following:
|
|
|
271
276
|
</map>
|
|
272
277
|
```
|
|
273
278
|
|
|
274
|
-
> Note: The
|
|
275
|
-
When the layout loader encounters the scale bar, it will recognize the "slot" attribute, defined in our Geocortex namespace.
|
|
276
|
-
When it goes to "slot" the scale bar into the map, it will make a "slotting request" to the map component, passing it some information about the child component as well as the intended slot target.
|
|
279
|
+
> Note: The behavior described below is currently specific to GWV.
|
|
280
|
+
> When the layout loader encounters the scale bar, it will recognize the "slot" attribute, defined in our Geocortex namespace.
|
|
281
|
+
> When it goes to "slot" the scale bar into the map, it will make a "slotting request" to the map component, passing it some information about the child component as well as the intended slot target.
|
|
277
282
|
|
|
278
283
|
The map component may "accept" or "reject" the slotting request. If it accepts, it will place the child component in the correct position in its own DOM in order to satisfy the slotting request.
|
|
279
284
|
|
|
@@ -283,8 +288,8 @@ The notion of a slotting "request" is realized as nothing more than a simple met
|
|
|
283
288
|
|
|
284
289
|
> Note: While this mechanism is dirt-simple, formalizing it helps conceptually enable potential support for drag-and-drop app creation down the road.
|
|
285
290
|
|
|
286
|
-
|
|
287
291
|
### Implicit slots
|
|
292
|
+
|
|
288
293
|
When a slot attribute is present, this is known as _named slotting_ or _explicit slotting_.
|
|
289
294
|
When no slot attribute is present, this is known as _implicit slotting_.
|
|
290
295
|
|
|
@@ -303,14 +308,15 @@ As with named slotting, components can reject implicit slotting.
|
|
|
303
308
|
|
|
304
309
|
Here, the map may choose to reject the slotting request, since it only has named slots: the four corners of the map where content can be anchored.
|
|
305
310
|
|
|
306
|
-
However, a component with no implicit slot
|
|
311
|
+
However, a component with no implicit slot behavior is free to satisfy a request for implicit slotting by simply slotting it into a default slot of its choosing, i.e. "bottom-left".
|
|
307
312
|
This is a component-specific implementation detail.
|
|
308
313
|
|
|
309
|
-
By supporting the simple compositional
|
|
310
|
-
|
|
314
|
+
By supporting the simple compositional strategy of "slotting", we provide layout authors simple yet powerful tools for declaratively building simple and sophisticated apps alike, and entirely out of loosely-coupled, reusable components.
|
|
311
315
|
|
|
312
316
|
### Slotting examples
|
|
317
|
+
|
|
313
318
|
Scale Bar and Overview Map explicitly slotted:
|
|
319
|
+
|
|
314
320
|
```XML
|
|
315
321
|
<map>
|
|
316
322
|
<scale-bar slot="bottom-left" />
|
|
@@ -319,6 +325,7 @@ Scale Bar and Overview Map explicitly slotted:
|
|
|
319
325
|
```
|
|
320
326
|
|
|
321
327
|
A stack of implicitly slotted maps:
|
|
328
|
+
|
|
322
329
|
```XML
|
|
323
330
|
<stack>
|
|
324
331
|
<map />
|
|
@@ -328,14 +335,16 @@ A stack of implicitly slotted maps:
|
|
|
328
335
|
```
|
|
329
336
|
|
|
330
337
|
2.x style "hoisting" into a panel's slot:
|
|
338
|
+
|
|
331
339
|
```XML
|
|
332
340
|
<smart-panel id="data-frame">
|
|
333
341
|
<menu slot="hoist" config="item://Menu/results-list" />
|
|
334
342
|
<results-list />
|
|
335
|
-
</smart-panel>
|
|
343
|
+
</smart-panel>
|
|
336
344
|
```
|
|
337
345
|
|
|
338
346
|
Slotting into a "master detail page" component
|
|
347
|
+
|
|
339
348
|
```XML
|
|
340
349
|
<mdp>
|
|
341
350
|
<menu config="item://Menu/master" slot="master" />
|
|
@@ -344,6 +353,7 @@ Slotting into a "master detail page" component
|
|
|
344
353
|
```
|
|
345
354
|
|
|
346
355
|
Slotting into a traditional "shell" component:
|
|
356
|
+
|
|
347
357
|
```XML
|
|
348
358
|
<mobile-shell>
|
|
349
359
|
<menu config="item://Menu/nav-mobile-main" slot="primary-menu" />
|
|
@@ -355,25 +365,26 @@ Slotting into a traditional "shell" component:
|
|
|
355
365
|
```
|
|
356
366
|
|
|
357
367
|
### Summary
|
|
358
|
-
- When components are nested in other components in layouts, they are "slotted" into them
|
|
359
|
-
- When a component attempts to slot into another, the layout loader asks the host component to satisfy the slotting
|
|
360
|
-
- Host components can accept or reject slotting attempts (*Note:* currently GWV specific)
|
|
361
|
-
- When a slotting request fails during load, the slotee enters a failure state
|
|
362
|
-
- When a child component bears a "slot" attribute, it targets a "named slot" in its parent
|
|
363
|
-
- When a child component bears no "slot" attribute, it targets the "implicit slot" in its parent
|
|
364
368
|
|
|
369
|
+
- When components are nested in other components in layouts, they are "slotted" into them
|
|
370
|
+
- When a component attempts to slot into another, the layout loader asks the host component to satisfy the slotting
|
|
371
|
+
- Host components can accept or reject slotting attempts (_Note:_ currently GWV specific)
|
|
372
|
+
- When a slotting request fails during load, the slotee enters a failure state
|
|
373
|
+
- When a child component bears a "slot" attribute, it targets a "named slot" in its parent
|
|
374
|
+
- When a child component bears no "slot" attribute, it targets the "implicit slot" in its parent
|
|
365
375
|
|
|
366
376
|
## A note about "shells"
|
|
377
|
+
|
|
367
378
|
Shells have been a winning pattern for us, particularly in the realm of GVH, where we can target wildly different form factors with specific arrangements of components and navigational structures.
|
|
368
379
|
|
|
369
|
-
In the new "layout era", the role of shells is a bit diminished. It is layouts themselves that define the visual arrangement of components, as well as the compositional
|
|
380
|
+
In the new "layout era", the role of shells is a bit diminished. It is layouts themselves that define the visual arrangement of components, as well as the compositional behavior between them.
|
|
370
381
|
|
|
371
382
|
However, this is not to say that shells are obsolete. Sometimes, we need to address high-level UI concerns that aren't suitable for individual components to address themselves. For example, a complex interplay between config, a "home panel", and a "data frame" is best expressed specifically in a higher level component rather than polluting the constituents with specific application-level concerns.
|
|
372
383
|
|
|
373
384
|
Shells are not obsolete. Shells are just high-level components comprised of other components!
|
|
374
385
|
|
|
375
|
-
|
|
376
386
|
## A note about "views"
|
|
387
|
+
|
|
377
388
|
If components can implicitly host other components by default, and components can be parked inside other components via nominal "slots", it raises the following question:
|
|
378
389
|
|
|
379
390
|
What happens to regions and views?
|
|
@@ -382,11 +393,11 @@ In a nutshell: The term "view" now references the specific user interface of a c
|
|
|
382
393
|
|
|
383
394
|
A view is a specific component's interface, realized using platform-specific UI controls and components.
|
|
384
395
|
|
|
385
|
-
|
|
386
396
|
## Regions
|
|
397
|
+
|
|
387
398
|
Regions evolve a bit with the introduction of layouts, but are perhaps even more useful than before.
|
|
388
399
|
|
|
389
|
-
In GVH, regions are nominal targets for views. In 2.x configs, user interfaces are expressed as flattened graphs, with views
|
|
400
|
+
In GVH, regions are nominal targets for views. In 2.x configs, user interfaces are expressed as flattened graphs, with views targeting regions by globally unique names and forming "edges" in the flattened graph.
|
|
390
401
|
|
|
391
402
|
In the new hierarchical paradigm, regions serve as simple grouping constructs, as well as continuing to serve as nominal targets for commands and workflows. However, unlike GVH 2.x, regions are not defined in view templates: they are only defined in layouts.
|
|
392
403
|
|
|
@@ -432,15 +443,16 @@ A less contrived example would be grouping components so that they may be treate
|
|
|
432
443
|
While there are similarities between regions and slots, they are distinct because they serve different purposes for different audiences: Regions are defined by layout authors for naming groups of components, while slots are defined by developers as composition targets in views.
|
|
433
444
|
|
|
434
445
|
### Summary
|
|
435
|
-
- Regions are defined in layouts
|
|
436
|
-
- Slots are defined in views
|
|
437
|
-
- Regions are useful grouping constructs
|
|
438
446
|
|
|
447
|
+
- Regions are defined in layouts
|
|
448
|
+
- Slots are defined in views
|
|
449
|
+
- Regions are useful grouping constructs
|
|
439
450
|
|
|
440
451
|
## Dispatch: Commands
|
|
452
|
+
|
|
441
453
|
> Note: Dispatch is spec 1.1
|
|
442
454
|
|
|
443
|
-
Because our configuration and composition models support 0-to-many of any component, application authors need a way of specifying the targets of
|
|
455
|
+
Because our configuration and composition models support 0-to-many of any component, application authors need a way of specifying the targets of particular commands and event invocations. How messages such as commands and events are delivered to the correct recipients is known as "dispatch".
|
|
444
456
|
|
|
445
457
|
Consider this example:
|
|
446
458
|
|
|
@@ -464,11 +476,12 @@ Unlike a structural mechanism like XPath (which was considered) our syntax speci
|
|
|
464
476
|
|
|
465
477
|
Since items in apps such as menus and toolbars may bear dispatch config, the nominal approach ensures that they aren't bound to the structure of any particular layout. For example, a configured menu item that zooms a particular map by name will function as intended no matter where in the app that map (should it exist) is hosted. This prevents app configs from becoming "brittle" and coupled to particular layouts.
|
|
466
478
|
|
|
467
|
-
|
|
468
479
|
### Binding syntax
|
|
480
|
+
|
|
469
481
|
Binding syntax allows authors to target components by referencing components by ID or type.
|
|
470
482
|
|
|
471
483
|
### Nominal binding
|
|
484
|
+
|
|
472
485
|
Components can be referenced by ID using the "#" character:
|
|
473
486
|
|
|
474
487
|
```XML
|
|
@@ -476,11 +489,13 @@ Components can be referenced by ID using the "#" character:
|
|
|
476
489
|
```
|
|
477
490
|
|
|
478
491
|
Multiple binding expressions (of any type) are allowed. Commas are used to separate bindings:
|
|
492
|
+
|
|
479
493
|
```XML
|
|
480
494
|
<button cmd="zoom-in" targets"#map1, #map2">I zoom maps</button>
|
|
481
495
|
```
|
|
482
496
|
|
|
483
497
|
### Type binding
|
|
498
|
+
|
|
484
499
|
Components of a particular type can be target using the "." character:
|
|
485
500
|
|
|
486
501
|
```XML
|
|
@@ -490,8 +505,7 @@ Components of a particular type can be target using the "." character:
|
|
|
490
505
|
|
|
491
506
|
### Attribute matching
|
|
492
507
|
|
|
493
|
-
> Note: Spec version 1.2
|
|
494
|
-
|
|
508
|
+
> Note: Spec version 1.2
|
|
495
509
|
|
|
496
510
|
Bindings can specify simple key-value patterns to match arbitrary attributes on component:
|
|
497
511
|
|
|
@@ -509,10 +523,9 @@ Attribute matching can apply to all components of any type as well, simply by om
|
|
|
509
523
|
<button cmd="zoom-in" targets="[role=navigation]">I target any component marked with role=navigation</button>
|
|
510
524
|
```
|
|
511
525
|
|
|
512
|
-
|
|
513
526
|
## Model bindings
|
|
514
|
-
> Note: Spec version 1.1
|
|
515
527
|
|
|
528
|
+
> Note: Spec version 1.1
|
|
516
529
|
|
|
517
530
|
Components often observe and modify the state of other components.
|
|
518
531
|
Consider the following example:
|
|
@@ -622,7 +635,7 @@ This allows the layout author to specify the "#map" hint on a parent component,
|
|
|
622
635
|
<map id="map" />
|
|
623
636
|
</region>
|
|
624
637
|
</split>
|
|
625
|
-
```
|
|
638
|
+
```
|
|
626
639
|
|
|
627
640
|
This is known as "model pinning". We've "pinned" any exported models from the map to the panel for its children to consume.
|
|
628
641
|
Note that the panel component itself remains wholly uncoupled from any map concerns - it is simply decorated in this particular layout in order to keep the layout clean and concise.
|
|
@@ -639,10 +652,9 @@ In this case, the layout author can specify their binding as a binding to multip
|
|
|
639
652
|
It's worth noting that this strategy of contextually resolving model dependencies between components lends itself extremely well to a potential drag and drop implementation.
|
|
640
653
|
When components are "dropped" into new locations, we can simply re-slot them and re-resolve their model dependencies.
|
|
641
654
|
|
|
642
|
-
|
|
643
655
|
## Presentation
|
|
644
|
-
> Note: Originally out of scope for 1.0, but required by GMV to express basic UI structure.
|
|
645
656
|
|
|
657
|
+
> Note: Originally out of scope for 1.0, but required by GMV to express basic UI structure.
|
|
646
658
|
|
|
647
659
|
Layouts can bear attributes related to visual presentation such as widths, heights, margins, and paddings.
|
|
648
660
|
These attributes are applied on components to control their presentation in the layout.
|
|
@@ -665,8 +677,8 @@ Consider this example:
|
|
|
665
677
|
In this case, there are 10 units of space available. The first map has 10% of them, while the second has 90%.
|
|
666
678
|
This particular layout can be understand to have a map that's 10% the height of the available space, and a second map that takes up the other 90%.
|
|
667
679
|
|
|
668
|
-
|
|
669
680
|
## Internationalization
|
|
681
|
+
|
|
670
682
|
In order to support localized apps, layouts must be able to reference localized strings. A simple method is proposed:
|
|
671
683
|
|
|
672
684
|
```XML
|
|
@@ -682,30 +694,29 @@ By avoiding absolute coordinates, we create easy solutions for RTL, which is typ
|
|
|
682
694
|
|
|
683
695
|
> Note: RTL is a 1.2 topic
|
|
684
696
|
|
|
685
|
-
|
|
686
697
|
## Common components
|
|
698
|
+
|
|
687
699
|
As part of the layout specification, a common set of components for both viewer should be defined.
|
|
688
700
|
Viewer specific components can live in viewer-specific namespaces, and components that we decide to make common can be elevated into the common namespace.
|
|
689
701
|
|
|
690
702
|
The common set of components we have defined so far are:
|
|
691
703
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
704
|
+
- stack
|
|
705
|
+
- split
|
|
706
|
+
- text
|
|
707
|
+
- dialog
|
|
708
|
+
- panel
|
|
709
|
+
- button
|
|
710
|
+
- map
|
|
711
|
+
- scene
|
|
700
712
|
|
|
701
713
|
Aside from map and scene, these components are considered "primitives": simple building blocks for layouts that are easy to implement and suitable for us to begin exploring and experimenting with application interfaces.
|
|
702
714
|
|
|
703
715
|
Along with simple presentation attributes such as width and height, stack and split components give us trivially simply blocks that can form the basis for almost any user interface. Stack simply vertically stacks components, while split horizontally partitions screen real estate, flipping the order of components for RTL. Both stacks and splits can allow their child components to be resized.
|
|
704
716
|
|
|
705
|
-
Dialogs handle popup
|
|
706
|
-
|
|
707
|
-
The text component is similar in nature to our Markdown form item, and can show arbitrary blocks of rich content including images, and possibly command hyperlinks and substituted tokens, similiar to our _Home Panel_ and _Feature Description_ functionality.
|
|
717
|
+
Dialogs handle popup behavior, and panels can provide functionality similar to "smart panels" today: accessible containers for content, and with panel-specific menu actions.
|
|
708
718
|
|
|
719
|
+
The text component is similar in nature to our Markdown form item, and can show arbitrary blocks of rich content including images, and possibly command hyperlinks and substituted tokens, similar to our _Home Panel_ and _Feature Description_ functionality.
|
|
709
720
|
|
|
710
721
|
## Summary
|
|
711
722
|
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<attribute name="config" type="string">
|
|
91
91
|
<annotation>
|
|
92
92
|
<documentation xml:lang="en">
|
|
93
|
-
The ID of a corresponding item in a
|
|
93
|
+
The ID of a corresponding item in a VertiGIS Studio App that
|
|
94
94
|
contains this component's configuration and state.
|
|
95
95
|
</documentation>
|
|
96
96
|
</annotation>
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
<element name="inline" substitutionGroup="base:component">
|
|
106
106
|
<annotation>
|
|
107
107
|
<documentation xml:lang="en">
|
|
108
|
-
A component that allows the integration of
|
|
108
|
+
A component that allows the integration of VertiGIS Studio Inline (Deprecated).
|
|
109
109
|
</documentation>
|
|
110
110
|
</annotation>
|
|
111
111
|
<complexType>
|
package/messaging/Command.d.ts
CHANGED
|
@@ -23,7 +23,8 @@ export interface Command<T = void> extends Message {
|
|
|
23
23
|
* Executes the command.
|
|
24
24
|
*
|
|
25
25
|
* @param argument The command arguments.
|
|
26
|
-
* @param options CancelToken or options to apply to the commands execute
|
|
26
|
+
* @param options CancelToken or options to apply to the commands execute
|
|
27
|
+
* behavior.
|
|
27
28
|
*/
|
|
28
29
|
execute(argument: T, options?: CancelToken | MessageExecuteOptions): Promise<void>;
|
|
29
30
|
/**
|
|
@@ -61,7 +62,8 @@ export interface CommandContext<T> extends AnalyticsContext {
|
|
|
61
62
|
* Invokes the next behavior in the chain. If it isn't invoked explicitly,
|
|
62
63
|
* then the next behavior will run after the current one is finished. Note
|
|
63
64
|
* that this is not supported for behaviors that are added at runtime via
|
|
64
|
-
* registerParallel(), which have no explicit sequence as they are run
|
|
65
|
+
* registerParallel(), which have no explicit sequence as they are run
|
|
66
|
+
* concurrently.
|
|
65
67
|
*/
|
|
66
68
|
next: (argument?: T) => Promise<void>;
|
|
67
69
|
/**
|
package/messaging/Event.d.ts
CHANGED
|
@@ -10,13 +10,15 @@ export interface Event<T = void> extends Message {
|
|
|
10
10
|
/**
|
|
11
11
|
* Publishes the event to all subscribers.
|
|
12
12
|
*
|
|
13
|
-
* @returns A promise that is fulfilled once all subscribers have been
|
|
13
|
+
* @returns A promise that is fulfilled once all subscribers have been
|
|
14
|
+
* notified.
|
|
14
15
|
*/
|
|
15
16
|
publish: (arg: T) => Promise<void>;
|
|
16
17
|
/**
|
|
17
18
|
* Subscribes to this event.
|
|
18
19
|
*
|
|
19
|
-
* @param callback A callback that will be invoked whenever the event is
|
|
20
|
+
* @param callback A callback that will be invoked whenever the event is
|
|
21
|
+
* published.
|
|
20
22
|
* @returns A handle that can be used to unsubscribe.
|
|
21
23
|
*/
|
|
22
24
|
subscribe: (callback: EventCallback<T>) => IHandle;
|
package/messaging/Message.d.ts
CHANGED
|
@@ -23,7 +23,8 @@ export interface MessageExecuteOptions {
|
|
|
23
23
|
/**
|
|
24
24
|
* The XML name of the layout component that initiated the action, if
|
|
25
25
|
* applicable. This will be available in the command context and can be used
|
|
26
|
-
* by message handlers for capturing analytics. Examples: "layer-list",
|
|
26
|
+
* by message handlers for capturing analytics. Examples: "layer-list",
|
|
27
|
+
* "map", etc.
|
|
27
28
|
*/
|
|
28
29
|
analyticsComponentType?: string;
|
|
29
30
|
/**
|
package/messaging/Operation.d.ts
CHANGED
|
@@ -24,7 +24,8 @@ export interface Operation<T = void, TResult = undefined> extends Message {
|
|
|
24
24
|
* Executes the operation and returns its result.
|
|
25
25
|
*
|
|
26
26
|
* @param argument The argument to the operation.
|
|
27
|
-
* @param options CancelToken or options to apply to the Operation execute
|
|
27
|
+
* @param options CancelToken or options to apply to the Operation execute
|
|
28
|
+
* behavior.
|
|
28
29
|
*/
|
|
29
30
|
execute: (argument: T, options?: CancelToken | MessageExecuteOptions) => Promise<TResult>;
|
|
30
31
|
/**
|
|
@@ -36,7 +37,8 @@ export interface Operation<T = void, TResult = undefined> extends Message {
|
|
|
36
37
|
/**
|
|
37
38
|
* Initializes the operation if it is not already initialized. Attempting to
|
|
38
39
|
* execute an operation will automatically initialize it, however calling
|
|
39
|
-
* canExecute() will always return false until the operation is
|
|
40
|
+
* canExecute() will always return false until the operation is
|
|
41
|
+
* initialized.
|
|
40
42
|
*/
|
|
41
43
|
initialize(): Promise<void>;
|
|
42
44
|
}
|