@almadar/std 2.1.1 → 2.4.1
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/behaviors/async.d.ts +12 -7
- package/dist/behaviors/async.js +1085 -312
- package/dist/behaviors/async.js.map +1 -1
- package/dist/behaviors/data-management.d.ts +27 -13
- package/dist/behaviors/data-management.js +600 -244
- package/dist/behaviors/data-management.js.map +1 -1
- package/dist/behaviors/domain/commerce.d.ts +51 -0
- package/dist/behaviors/domain/commerce.js +1093 -0
- package/dist/behaviors/domain/commerce.js.map +1 -0
- package/dist/behaviors/domain/content.d.ts +51 -0
- package/dist/behaviors/domain/content.js +1294 -0
- package/dist/behaviors/domain/content.js.map +1 -0
- package/dist/behaviors/domain/dashboard.d.ts +45 -0
- package/dist/behaviors/domain/dashboard.js +783 -0
- package/dist/behaviors/domain/dashboard.js.map +1 -0
- package/dist/behaviors/domain/education.d.ts +41 -0
- package/dist/behaviors/domain/education.js +738 -0
- package/dist/behaviors/domain/education.js.map +1 -0
- package/dist/behaviors/domain/finance.d.ts +49 -0
- package/dist/behaviors/domain/finance.js +660 -0
- package/dist/behaviors/domain/finance.js.map +1 -0
- package/dist/behaviors/domain/game-2d-platformer.d.ts +50 -0
- package/dist/behaviors/domain/game-2d-platformer.js +810 -0
- package/dist/behaviors/domain/game-2d-platformer.js.map +1 -0
- package/dist/behaviors/domain/game-2d-puzzle.d.ts +42 -0
- package/dist/behaviors/domain/game-2d-puzzle.js +622 -0
- package/dist/behaviors/domain/game-2d-puzzle.js.map +1 -0
- package/dist/behaviors/domain/game-2d-rpg.d.ts +48 -0
- package/dist/behaviors/domain/game-2d-rpg.js +860 -0
- package/dist/behaviors/domain/game-2d-rpg.js.map +1 -0
- package/dist/behaviors/domain/game-2d-strategy.d.ts +48 -0
- package/dist/behaviors/domain/game-2d-strategy.js +692 -0
- package/dist/behaviors/domain/game-2d-strategy.js.map +1 -0
- package/dist/behaviors/domain/geospatial.d.ts +35 -0
- package/dist/behaviors/domain/geospatial.js +634 -0
- package/dist/behaviors/domain/geospatial.js.map +1 -0
- package/dist/behaviors/domain/healthcare.d.ts +36 -0
- package/dist/behaviors/domain/healthcare.js +1068 -0
- package/dist/behaviors/domain/healthcare.js.map +1 -0
- package/dist/behaviors/domain/iot.d.ts +45 -0
- package/dist/behaviors/domain/iot.js +589 -0
- package/dist/behaviors/domain/iot.js.map +1 -0
- package/dist/behaviors/domain/media.d.ts +41 -0
- package/dist/behaviors/domain/media.js +771 -0
- package/dist/behaviors/domain/media.js.map +1 -0
- package/dist/behaviors/domain/scheduling.d.ts +41 -0
- package/dist/behaviors/domain/scheduling.js +930 -0
- package/dist/behaviors/domain/scheduling.js.map +1 -0
- package/dist/behaviors/domain/simulation.d.ts +36 -0
- package/dist/behaviors/domain/simulation.js +706 -0
- package/dist/behaviors/domain/simulation.js.map +1 -0
- package/dist/behaviors/domain/social.d.ts +41 -0
- package/dist/behaviors/domain/social.js +840 -0
- package/dist/behaviors/domain/social.js.map +1 -0
- package/dist/behaviors/domain/workflow.d.ts +41 -0
- package/dist/behaviors/domain/workflow.js +879 -0
- package/dist/behaviors/domain/workflow.js.map +1 -0
- package/dist/behaviors/feedback.d.ts +10 -5
- package/dist/behaviors/feedback.js +279 -194
- package/dist/behaviors/feedback.js.map +1 -1
- package/dist/behaviors/game-core.d.ts +15 -8
- package/dist/behaviors/game-core.js +412 -80
- package/dist/behaviors/game-core.js.map +1 -1
- package/dist/behaviors/game-entity.d.ts +17 -10
- package/dist/behaviors/game-entity.js +544 -237
- package/dist/behaviors/game-entity.js.map +1 -1
- package/dist/behaviors/game-ui.d.ts +16 -8
- package/dist/behaviors/game-ui.js +451 -316
- package/dist/behaviors/game-ui.js.map +1 -1
- package/dist/behaviors/index.d.ts +18 -1
- package/dist/behaviors/index.js +18905 -2140
- package/dist/behaviors/index.js.map +1 -1
- package/dist/behaviors/infrastructure.d.ts +9 -8
- package/dist/behaviors/infrastructure.js +597 -169
- package/dist/behaviors/infrastructure.js.map +1 -1
- package/dist/behaviors/registry.d.ts +11 -11
- package/dist/behaviors/registry.js +18904 -2139
- package/dist/behaviors/registry.js.map +1 -1
- package/dist/behaviors/types.d.ts +19 -2
- package/dist/behaviors/types.js.map +1 -1
- package/dist/behaviors/ui-interaction.d.ts +20 -14
- package/dist/behaviors/ui-interaction.js +928 -518
- package/dist/behaviors/ui-interaction.js.map +1 -1
- package/dist/index.js +18906 -2141
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
// behaviors/domain/geospatial.ts
|
|
2
|
+
var GEOSPATIAL_THEME = {
|
|
3
|
+
name: "geospatial-cyan",
|
|
4
|
+
tokens: {
|
|
5
|
+
colors: {
|
|
6
|
+
primary: "#0891b2",
|
|
7
|
+
"primary-hover": "#0e7490",
|
|
8
|
+
"primary-foreground": "#ffffff",
|
|
9
|
+
accent: "#06b6d4",
|
|
10
|
+
"accent-foreground": "#000000",
|
|
11
|
+
success: "#22c55e",
|
|
12
|
+
warning: "#f59e0b",
|
|
13
|
+
error: "#ef4444"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var mapBrowsingMainEffect = [
|
|
18
|
+
"render-ui",
|
|
19
|
+
"main",
|
|
20
|
+
{ type: "stack", direction: "vertical", gap: "lg", children: [
|
|
21
|
+
// Header: icon + title + create button
|
|
22
|
+
{ type: "stack", direction: "horizontal", justify: "space-between", children: [
|
|
23
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
24
|
+
{ type: "icon", name: "map", size: "lg" },
|
|
25
|
+
{ type: "typography", variant: "h2", content: "Map" }
|
|
26
|
+
] },
|
|
27
|
+
{ type: "button", label: "Create", icon: "map-pin", variant: "primary", action: "CREATE" }
|
|
28
|
+
] },
|
|
29
|
+
{ type: "divider" },
|
|
30
|
+
// Stats row
|
|
31
|
+
{ type: "stack", direction: "horizontal", gap: "md", children: [
|
|
32
|
+
{ type: "stats", label: "Markers", icon: "map-pin", entity: "MapMarker" },
|
|
33
|
+
{ type: "stats", label: "Categories", icon: "layers", entity: "MapMarker" }
|
|
34
|
+
] },
|
|
35
|
+
{ type: "divider" },
|
|
36
|
+
// Map visualization placeholder
|
|
37
|
+
{ type: "stack", direction: "vertical", gap: "md", align: "center", children: [
|
|
38
|
+
{ type: "icon", name: "map", size: "xl" },
|
|
39
|
+
{ type: "typography", variant: "body", content: "Map visualization area" }
|
|
40
|
+
] },
|
|
41
|
+
{ type: "divider" },
|
|
42
|
+
// Selected marker coordinates
|
|
43
|
+
{ type: "stack", direction: "horizontal", gap: "md", children: [
|
|
44
|
+
{ type: "stat-card", label: "Latitude", value: "@entity.latitude", icon: "navigation" },
|
|
45
|
+
{ type: "stat-card", label: "Longitude", value: "@entity.longitude", icon: "compass" }
|
|
46
|
+
] },
|
|
47
|
+
{ type: "divider" },
|
|
48
|
+
// Data zone: marker cards
|
|
49
|
+
{
|
|
50
|
+
type: "data-grid",
|
|
51
|
+
entity: "MapMarker",
|
|
52
|
+
cols: 2,
|
|
53
|
+
gap: "md",
|
|
54
|
+
fields: [
|
|
55
|
+
{ name: "name", label: "Name", icon: "tag", variant: "h4" },
|
|
56
|
+
{ name: "latitude", label: "Lat", icon: "navigation", variant: "body", format: "number" },
|
|
57
|
+
{ name: "longitude", label: "Lng", icon: "compass", variant: "body", format: "number" },
|
|
58
|
+
{ name: "category", label: "Category", icon: "layers", variant: "badge" }
|
|
59
|
+
],
|
|
60
|
+
itemActions: [
|
|
61
|
+
{ label: "View", event: "SELECT_MARKER" }
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
] }
|
|
65
|
+
];
|
|
66
|
+
var MAP_VIEW_BEHAVIOR = {
|
|
67
|
+
name: "std-map-view",
|
|
68
|
+
version: "1.0.0",
|
|
69
|
+
description: "Map display with markers and creation",
|
|
70
|
+
theme: GEOSPATIAL_THEME,
|
|
71
|
+
orbitals: [
|
|
72
|
+
{
|
|
73
|
+
name: "MapViewOrbital",
|
|
74
|
+
entity: {
|
|
75
|
+
name: "MapMarker",
|
|
76
|
+
persistence: "persistent",
|
|
77
|
+
collection: "map_markers",
|
|
78
|
+
fields: [
|
|
79
|
+
{ name: "id", type: "string", required: true },
|
|
80
|
+
{ name: "name", type: "string", default: "" },
|
|
81
|
+
{ name: "latitude", type: "number", default: 0 },
|
|
82
|
+
{ name: "longitude", type: "number", default: 0 },
|
|
83
|
+
{ name: "category", type: "string", default: "default" }
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
traits: [
|
|
87
|
+
{
|
|
88
|
+
name: "MapViewControl",
|
|
89
|
+
linkedEntity: "MapMarker",
|
|
90
|
+
category: "interaction",
|
|
91
|
+
stateMachine: {
|
|
92
|
+
states: [
|
|
93
|
+
{ name: "browsing", isInitial: true },
|
|
94
|
+
{ name: "viewing" },
|
|
95
|
+
{ name: "creating" }
|
|
96
|
+
],
|
|
97
|
+
events: [
|
|
98
|
+
{ key: "INIT", name: "Initialize" },
|
|
99
|
+
{ key: "SELECT_MARKER", name: "Select Marker", payloadSchema: [{ name: "id", type: "string", required: true }] },
|
|
100
|
+
{ key: "CREATE", name: "Create Marker" },
|
|
101
|
+
{ key: "SAVE", name: "Save Marker", payloadSchema: [{ name: "name", type: "string", required: true }, { name: "latitude", type: "number", required: true }, { name: "longitude", type: "number", required: true }] },
|
|
102
|
+
{ key: "CLOSE", name: "Close" },
|
|
103
|
+
{ key: "CANCEL", name: "Cancel" }
|
|
104
|
+
],
|
|
105
|
+
transitions: [
|
|
106
|
+
{
|
|
107
|
+
from: "browsing",
|
|
108
|
+
to: "browsing",
|
|
109
|
+
event: "INIT",
|
|
110
|
+
effects: [
|
|
111
|
+
["fetch", "MapMarker"],
|
|
112
|
+
[...mapBrowsingMainEffect]
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
from: "browsing",
|
|
117
|
+
to: "viewing",
|
|
118
|
+
event: "SELECT_MARKER",
|
|
119
|
+
effects: [
|
|
120
|
+
["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
|
|
121
|
+
// Detail header
|
|
122
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
123
|
+
{ type: "icon", name: "map-pin", size: "lg" },
|
|
124
|
+
{ type: "typography", variant: "h3", content: "@entity.name" }
|
|
125
|
+
] },
|
|
126
|
+
{ type: "divider" },
|
|
127
|
+
// Coordinate details
|
|
128
|
+
{ type: "data-list", fields: [
|
|
129
|
+
{ name: "latitude", label: "Latitude", icon: "navigation", format: "number" },
|
|
130
|
+
{ name: "longitude", label: "Longitude", icon: "compass", format: "number" },
|
|
131
|
+
{ name: "category", label: "Category", icon: "layers" }
|
|
132
|
+
] },
|
|
133
|
+
{ type: "divider" },
|
|
134
|
+
// Actions
|
|
135
|
+
{ type: "stack", direction: "horizontal", justify: "end", gap: "sm", children: [
|
|
136
|
+
{ type: "button", label: "Close", icon: "x", variant: "secondary", action: "CLOSE" }
|
|
137
|
+
] }
|
|
138
|
+
] }]
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
from: "viewing",
|
|
143
|
+
to: "browsing",
|
|
144
|
+
event: "CLOSE",
|
|
145
|
+
effects: [
|
|
146
|
+
["render-ui", "modal", null]
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
from: "viewing",
|
|
151
|
+
to: "browsing",
|
|
152
|
+
event: "CANCEL",
|
|
153
|
+
effects: [
|
|
154
|
+
["render-ui", "modal", null]
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
from: "browsing",
|
|
159
|
+
to: "creating",
|
|
160
|
+
event: "CREATE",
|
|
161
|
+
effects: [
|
|
162
|
+
["fetch", "MapMarker"],
|
|
163
|
+
["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
|
|
164
|
+
// Create header
|
|
165
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
166
|
+
{ type: "icon", name: "map-pin", size: "lg" },
|
|
167
|
+
{ type: "typography", variant: "h3", content: "New Marker" }
|
|
168
|
+
] },
|
|
169
|
+
{ type: "divider" },
|
|
170
|
+
// Creation form
|
|
171
|
+
{ type: "form-section", entity: "MapMarker", submitEvent: "SAVE", cancelEvent: "CANCEL" }
|
|
172
|
+
] }]
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
from: "creating",
|
|
177
|
+
to: "browsing",
|
|
178
|
+
event: "SAVE",
|
|
179
|
+
effects: [
|
|
180
|
+
["set", "@entity.name", "@payload.name"],
|
|
181
|
+
["set", "@entity.latitude", "@payload.latitude"],
|
|
182
|
+
["set", "@entity.longitude", "@payload.longitude"],
|
|
183
|
+
["render-ui", "modal", null],
|
|
184
|
+
["fetch", "MapMarker"],
|
|
185
|
+
[...mapBrowsingMainEffect]
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
from: "creating",
|
|
190
|
+
to: "browsing",
|
|
191
|
+
event: "CLOSE",
|
|
192
|
+
effects: [
|
|
193
|
+
["render-ui", "modal", null]
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
from: "creating",
|
|
198
|
+
to: "browsing",
|
|
199
|
+
event: "CANCEL",
|
|
200
|
+
effects: [
|
|
201
|
+
["render-ui", "modal", null]
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
pages: [
|
|
209
|
+
{
|
|
210
|
+
name: "MapPage",
|
|
211
|
+
path: "/map",
|
|
212
|
+
isInitial: true,
|
|
213
|
+
traits: [{ ref: "MapViewControl" }]
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
};
|
|
219
|
+
var locationIdleMainEffect = [
|
|
220
|
+
"render-ui",
|
|
221
|
+
"main",
|
|
222
|
+
{ type: "stack", direction: "vertical", gap: "lg", children: [
|
|
223
|
+
// Header: icon + title + select button
|
|
224
|
+
{ type: "stack", direction: "horizontal", justify: "space-between", children: [
|
|
225
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
226
|
+
{ type: "icon", name: "target", size: "lg" },
|
|
227
|
+
{ type: "typography", variant: "h2", content: "Location Picker" }
|
|
228
|
+
] },
|
|
229
|
+
{ type: "button", label: "Select Location", icon: "map-pin", variant: "primary", action: "START_SELECTION" }
|
|
230
|
+
] },
|
|
231
|
+
{ type: "divider" },
|
|
232
|
+
// Coordinate display
|
|
233
|
+
{ type: "form-section", entity: "SelectedLocation", title: "Coordinates" }
|
|
234
|
+
] }
|
|
235
|
+
];
|
|
236
|
+
var LOCATION_PICKER_BEHAVIOR = {
|
|
237
|
+
name: "std-location-picker",
|
|
238
|
+
version: "1.0.0",
|
|
239
|
+
description: "Location selection with address and coordinates",
|
|
240
|
+
theme: GEOSPATIAL_THEME,
|
|
241
|
+
orbitals: [
|
|
242
|
+
{
|
|
243
|
+
name: "LocationPickerOrbital",
|
|
244
|
+
entity: {
|
|
245
|
+
name: "SelectedLocation",
|
|
246
|
+
persistence: "runtime",
|
|
247
|
+
fields: [
|
|
248
|
+
{ name: "id", type: "string", required: true },
|
|
249
|
+
{ name: "address", type: "string", default: "" },
|
|
250
|
+
{ name: "latitude", type: "number", default: 0 },
|
|
251
|
+
{ name: "longitude", type: "number", default: 0 },
|
|
252
|
+
{ name: "label", type: "string", default: "" }
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
traits: [
|
|
256
|
+
{
|
|
257
|
+
name: "LocationPickerControl",
|
|
258
|
+
linkedEntity: "SelectedLocation",
|
|
259
|
+
category: "interaction",
|
|
260
|
+
stateMachine: {
|
|
261
|
+
states: [
|
|
262
|
+
{ name: "idle", isInitial: true },
|
|
263
|
+
{ name: "selecting" },
|
|
264
|
+
{ name: "confirmed" }
|
|
265
|
+
],
|
|
266
|
+
events: [
|
|
267
|
+
{ key: "INIT", name: "Initialize" },
|
|
268
|
+
{ key: "START_SELECTION", name: "Start Selection" },
|
|
269
|
+
{ key: "PICK_LOCATION", name: "Pick Location", payloadSchema: [{ name: "address", type: "string", required: true }, { name: "latitude", type: "number", required: true }, { name: "longitude", type: "number", required: true }] },
|
|
270
|
+
{ key: "CONFIRM", name: "Confirm Location" },
|
|
271
|
+
{ key: "CLEAR_SELECTION", name: "Clear Selection" }
|
|
272
|
+
],
|
|
273
|
+
transitions: [
|
|
274
|
+
{
|
|
275
|
+
from: "idle",
|
|
276
|
+
to: "idle",
|
|
277
|
+
event: "INIT",
|
|
278
|
+
effects: [
|
|
279
|
+
["set", "@entity.address", ""],
|
|
280
|
+
["set", "@entity.latitude", 0],
|
|
281
|
+
["set", "@entity.longitude", 0],
|
|
282
|
+
[...locationIdleMainEffect]
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
from: "idle",
|
|
287
|
+
to: "selecting",
|
|
288
|
+
event: "START_SELECTION",
|
|
289
|
+
effects: [
|
|
290
|
+
["fetch", "SelectedLocation"],
|
|
291
|
+
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
292
|
+
// Header
|
|
293
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
294
|
+
{ type: "icon", name: "globe", size: "lg" },
|
|
295
|
+
{ type: "typography", variant: "h2", content: "Select Location" }
|
|
296
|
+
] },
|
|
297
|
+
{ type: "divider" },
|
|
298
|
+
// Search input for address
|
|
299
|
+
{ type: "search-input", placeholder: "Search address...", icon: "search" },
|
|
300
|
+
// Form for coordinate entry
|
|
301
|
+
{ type: "form-section", entity: "SelectedLocation" }
|
|
302
|
+
] }]
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
from: "selecting",
|
|
307
|
+
to: "selecting",
|
|
308
|
+
event: "PICK_LOCATION",
|
|
309
|
+
effects: [
|
|
310
|
+
["set", "@entity.address", "@payload.address"],
|
|
311
|
+
["set", "@entity.latitude", "@payload.latitude"],
|
|
312
|
+
["set", "@entity.longitude", "@payload.longitude"],
|
|
313
|
+
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
314
|
+
// Header with confirm
|
|
315
|
+
{ type: "stack", direction: "horizontal", justify: "space-between", children: [
|
|
316
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
317
|
+
{ type: "icon", name: "map-pin", size: "lg" },
|
|
318
|
+
{ type: "typography", variant: "h2", content: "Selected Location" }
|
|
319
|
+
] },
|
|
320
|
+
{ type: "button", label: "Confirm", icon: "check", variant: "primary", action: "CONFIRM" }
|
|
321
|
+
] },
|
|
322
|
+
{ type: "divider" },
|
|
323
|
+
// Location details
|
|
324
|
+
{ type: "data-list", fields: [
|
|
325
|
+
{ name: "address", label: "Address", icon: "map-pin" },
|
|
326
|
+
{ name: "latitude", label: "Latitude", icon: "navigation", format: "number" },
|
|
327
|
+
{ name: "longitude", label: "Longitude", icon: "compass", format: "number" }
|
|
328
|
+
] },
|
|
329
|
+
// Coordinate meter
|
|
330
|
+
{ type: "meter", value: 0, label: "Accuracy", icon: "target", entity: "SelectedLocation" }
|
|
331
|
+
] }]
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
from: "selecting",
|
|
336
|
+
to: "confirmed",
|
|
337
|
+
event: "CONFIRM",
|
|
338
|
+
effects: [
|
|
339
|
+
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
340
|
+
// Confirmed header
|
|
341
|
+
{ type: "stack", direction: "horizontal", justify: "space-between", children: [
|
|
342
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
343
|
+
{ type: "icon", name: "check", size: "lg" },
|
|
344
|
+
{ type: "typography", variant: "h2", content: "Location Confirmed" }
|
|
345
|
+
] },
|
|
346
|
+
{ type: "button", label: "Clear", icon: "x", variant: "secondary", action: "CLEAR_SELECTION" }
|
|
347
|
+
] },
|
|
348
|
+
{ type: "divider" },
|
|
349
|
+
// Confirmed location details
|
|
350
|
+
{ type: "badge", label: "Confirmed", variant: "success", icon: "check" },
|
|
351
|
+
{ type: "data-list", fields: [
|
|
352
|
+
{ name: "address", label: "Address", icon: "map-pin" },
|
|
353
|
+
{ name: "latitude", label: "Latitude", icon: "navigation", format: "number" },
|
|
354
|
+
{ name: "longitude", label: "Longitude", icon: "compass", format: "number" },
|
|
355
|
+
{ name: "label", label: "Label", icon: "tag" }
|
|
356
|
+
] }
|
|
357
|
+
] }]
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
from: "confirmed",
|
|
362
|
+
to: "idle",
|
|
363
|
+
event: "CLEAR_SELECTION",
|
|
364
|
+
effects: [
|
|
365
|
+
["set", "@entity.address", ""],
|
|
366
|
+
["set", "@entity.latitude", 0],
|
|
367
|
+
["set", "@entity.longitude", 0],
|
|
368
|
+
[...locationIdleMainEffect]
|
|
369
|
+
]
|
|
370
|
+
}
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
pages: [
|
|
376
|
+
{
|
|
377
|
+
name: "LocationPage",
|
|
378
|
+
path: "/location",
|
|
379
|
+
isInitial: true,
|
|
380
|
+
traits: [{ ref: "LocationPickerControl" }]
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
};
|
|
386
|
+
var routeBrowsingMainEffect = [
|
|
387
|
+
"render-ui",
|
|
388
|
+
"main",
|
|
389
|
+
{ type: "stack", direction: "vertical", gap: "lg", children: [
|
|
390
|
+
// Header: icon + title + new route button
|
|
391
|
+
{ type: "stack", direction: "horizontal", justify: "space-between", children: [
|
|
392
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
393
|
+
{ type: "icon", name: "navigation", size: "lg" },
|
|
394
|
+
{ type: "typography", variant: "h2", content: "Routes" }
|
|
395
|
+
] },
|
|
396
|
+
{ type: "button", label: "New Route", icon: "compass", variant: "primary", action: "NEW_ROUTE" }
|
|
397
|
+
] },
|
|
398
|
+
{ type: "divider" },
|
|
399
|
+
// Stats row
|
|
400
|
+
{ type: "stack", direction: "horizontal", gap: "md", children: [
|
|
401
|
+
{ type: "stats", label: "Route Points", icon: "map-pin", entity: "RoutePoint" },
|
|
402
|
+
{ type: "stats", label: "Distance", icon: "navigation", entity: "RoutePoint" }
|
|
403
|
+
] },
|
|
404
|
+
{ type: "divider" },
|
|
405
|
+
// Route point list
|
|
406
|
+
{
|
|
407
|
+
type: "data-list",
|
|
408
|
+
entity: "RoutePoint",
|
|
409
|
+
fields: [
|
|
410
|
+
{ name: "name", label: "Name", icon: "tag" },
|
|
411
|
+
{ name: "latitude", label: "Lat", icon: "navigation", format: "number" },
|
|
412
|
+
{ name: "longitude", label: "Lng", icon: "compass", format: "number" },
|
|
413
|
+
{ name: "order", label: "Order", icon: "hash", format: "number" }
|
|
414
|
+
],
|
|
415
|
+
itemActions: [
|
|
416
|
+
{ label: "View", event: "VIEW" }
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
] }
|
|
420
|
+
];
|
|
421
|
+
var routePointListMainEffect = [
|
|
422
|
+
"render-ui",
|
|
423
|
+
"main",
|
|
424
|
+
{ type: "stack", direction: "vertical", gap: "md", children: [
|
|
425
|
+
{
|
|
426
|
+
type: "data-list",
|
|
427
|
+
entity: "RoutePoint",
|
|
428
|
+
fields: [
|
|
429
|
+
{ name: "name", label: "Name", icon: "tag" },
|
|
430
|
+
{ name: "latitude", label: "Lat", icon: "navigation", format: "number" },
|
|
431
|
+
{ name: "longitude", label: "Lng", icon: "compass", format: "number" },
|
|
432
|
+
{ name: "order", label: "Order", icon: "hash", format: "number" }
|
|
433
|
+
],
|
|
434
|
+
itemActions: [
|
|
435
|
+
{ label: "View", event: "VIEW" }
|
|
436
|
+
]
|
|
437
|
+
}
|
|
438
|
+
] }
|
|
439
|
+
];
|
|
440
|
+
var ROUTE_PLANNER_BEHAVIOR = {
|
|
441
|
+
name: "std-route-planner",
|
|
442
|
+
version: "1.0.0",
|
|
443
|
+
description: "Route planning with ordered waypoints",
|
|
444
|
+
theme: GEOSPATIAL_THEME,
|
|
445
|
+
orbitals: [
|
|
446
|
+
{
|
|
447
|
+
name: "RoutePlannerOrbital",
|
|
448
|
+
entity: {
|
|
449
|
+
name: "RoutePoint",
|
|
450
|
+
persistence: "persistent",
|
|
451
|
+
collection: "route_points",
|
|
452
|
+
fields: [
|
|
453
|
+
{ name: "id", type: "string", required: true },
|
|
454
|
+
{ name: "name", type: "string", default: "" },
|
|
455
|
+
{ name: "latitude", type: "number", default: 0 },
|
|
456
|
+
{ name: "longitude", type: "number", default: 0 },
|
|
457
|
+
{ name: "order", type: "number", default: 0 }
|
|
458
|
+
]
|
|
459
|
+
},
|
|
460
|
+
traits: [
|
|
461
|
+
{
|
|
462
|
+
name: "RoutePlannerControl",
|
|
463
|
+
linkedEntity: "RoutePoint",
|
|
464
|
+
category: "interaction",
|
|
465
|
+
stateMachine: {
|
|
466
|
+
states: [
|
|
467
|
+
{ name: "browsing", isInitial: true },
|
|
468
|
+
{ name: "planning" },
|
|
469
|
+
{ name: "viewing" }
|
|
470
|
+
],
|
|
471
|
+
events: [
|
|
472
|
+
{ key: "INIT", name: "Initialize" },
|
|
473
|
+
{ key: "NEW_ROUTE", name: "New Route" },
|
|
474
|
+
{ key: "ADD_POINT", name: "Add Point", payloadSchema: [{ name: "name", type: "string", required: true }, { name: "latitude", type: "number", required: true }, { name: "longitude", type: "number", required: true }] },
|
|
475
|
+
{ key: "VIEW_ROUTE", name: "View Route" },
|
|
476
|
+
{ key: "BACK", name: "Back to Routes" },
|
|
477
|
+
{ key: "VIEW", name: "View Point", payloadSchema: [{ name: "id", type: "string", required: true }] }
|
|
478
|
+
],
|
|
479
|
+
transitions: [
|
|
480
|
+
{
|
|
481
|
+
from: "browsing",
|
|
482
|
+
to: "browsing",
|
|
483
|
+
event: "INIT",
|
|
484
|
+
effects: [
|
|
485
|
+
["fetch", "RoutePoint"],
|
|
486
|
+
[...routeBrowsingMainEffect]
|
|
487
|
+
]
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
from: "browsing",
|
|
491
|
+
to: "planning",
|
|
492
|
+
event: "NEW_ROUTE",
|
|
493
|
+
effects: [
|
|
494
|
+
["fetch", "RoutePoint"],
|
|
495
|
+
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
496
|
+
// Planning header
|
|
497
|
+
{ type: "stack", direction: "horizontal", justify: "space-between", children: [
|
|
498
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
499
|
+
{ type: "icon", name: "compass", size: "lg" },
|
|
500
|
+
{ type: "typography", variant: "h2", content: "Plan Route" }
|
|
501
|
+
] },
|
|
502
|
+
{ type: "button", label: "Back", icon: "arrow-left", variant: "secondary", action: "BACK" }
|
|
503
|
+
] },
|
|
504
|
+
{ type: "divider" },
|
|
505
|
+
// Add point form
|
|
506
|
+
{ type: "form-section", entity: "RoutePoint" }
|
|
507
|
+
] }]
|
|
508
|
+
]
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
from: "planning",
|
|
512
|
+
to: "planning",
|
|
513
|
+
event: "ADD_POINT",
|
|
514
|
+
effects: [
|
|
515
|
+
["fetch", "RoutePoint"],
|
|
516
|
+
["set", "@entity.name", "@payload.name"],
|
|
517
|
+
["set", "@entity.latitude", "@payload.latitude"],
|
|
518
|
+
["set", "@entity.longitude", "@payload.longitude"],
|
|
519
|
+
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
520
|
+
// Planning header with view route
|
|
521
|
+
{ type: "stack", direction: "horizontal", justify: "space-between", children: [
|
|
522
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
523
|
+
{ type: "icon", name: "compass", size: "lg" },
|
|
524
|
+
{ type: "typography", variant: "h2", content: "Plan Route" }
|
|
525
|
+
] },
|
|
526
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
527
|
+
{ type: "button", label: "View Route", icon: "eye", variant: "primary", action: "VIEW_ROUTE" },
|
|
528
|
+
{ type: "button", label: "Back", icon: "arrow-left", variant: "secondary", action: "BACK" }
|
|
529
|
+
] }
|
|
530
|
+
] },
|
|
531
|
+
{ type: "divider" },
|
|
532
|
+
// Stats
|
|
533
|
+
{ type: "stats", label: "Route Points", icon: "map-pin", entity: "RoutePoint" },
|
|
534
|
+
{ type: "divider" },
|
|
535
|
+
// Current waypoints
|
|
536
|
+
{
|
|
537
|
+
type: "data-list",
|
|
538
|
+
entity: "RoutePoint",
|
|
539
|
+
fields: [
|
|
540
|
+
{ name: "name", label: "Name", icon: "tag" },
|
|
541
|
+
{ name: "latitude", label: "Lat", icon: "navigation", format: "number" },
|
|
542
|
+
{ name: "longitude", label: "Lng", icon: "compass", format: "number" },
|
|
543
|
+
{ name: "order", label: "Order", icon: "hash", format: "number" }
|
|
544
|
+
],
|
|
545
|
+
itemActions: [{ label: "View", event: "VIEW" }]
|
|
546
|
+
},
|
|
547
|
+
{ type: "divider" },
|
|
548
|
+
// Add another point form
|
|
549
|
+
{ type: "form-section", entity: "RoutePoint" }
|
|
550
|
+
] }]
|
|
551
|
+
]
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
from: "planning",
|
|
555
|
+
to: "viewing",
|
|
556
|
+
event: "VIEW_ROUTE",
|
|
557
|
+
effects: [
|
|
558
|
+
["fetch", "RoutePoint"],
|
|
559
|
+
["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
|
|
560
|
+
// Route overview header
|
|
561
|
+
{ type: "stack", direction: "horizontal", justify: "space-between", children: [
|
|
562
|
+
{ type: "stack", direction: "horizontal", gap: "sm", children: [
|
|
563
|
+
{ type: "icon", name: "satellite", size: "lg" },
|
|
564
|
+
{ type: "typography", variant: "h2", content: "Route Overview" }
|
|
565
|
+
] },
|
|
566
|
+
{ type: "button", label: "Back", icon: "arrow-left", variant: "secondary", action: "BACK" }
|
|
567
|
+
] },
|
|
568
|
+
{ type: "divider" },
|
|
569
|
+
// Stats
|
|
570
|
+
{ type: "stats", label: "Route Points", icon: "map-pin", entity: "RoutePoint" },
|
|
571
|
+
{ type: "divider" },
|
|
572
|
+
// Route point list
|
|
573
|
+
{
|
|
574
|
+
type: "data-list",
|
|
575
|
+
entity: "RoutePoint",
|
|
576
|
+
fields: [
|
|
577
|
+
{ name: "name", label: "Name", icon: "tag" },
|
|
578
|
+
{ name: "latitude", label: "Lat", icon: "navigation", format: "number" },
|
|
579
|
+
{ name: "longitude", label: "Lng", icon: "compass", format: "number" },
|
|
580
|
+
{ name: "order", label: "Order", icon: "hash", format: "number" }
|
|
581
|
+
],
|
|
582
|
+
itemActions: [{ label: "View", event: "VIEW" }]
|
|
583
|
+
},
|
|
584
|
+
// Route completeness meter
|
|
585
|
+
{ type: "meter", value: 0, label: "Route Progress", icon: "navigation", entity: "RoutePoint" }
|
|
586
|
+
] }]
|
|
587
|
+
]
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
from: "viewing",
|
|
591
|
+
to: "browsing",
|
|
592
|
+
event: "BACK",
|
|
593
|
+
effects: [
|
|
594
|
+
["fetch", "RoutePoint"],
|
|
595
|
+
[...routeBrowsingMainEffect]
|
|
596
|
+
]
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
from: "planning",
|
|
600
|
+
to: "browsing",
|
|
601
|
+
event: "BACK",
|
|
602
|
+
effects: [
|
|
603
|
+
["fetch", "RoutePoint"],
|
|
604
|
+
[...routeBrowsingMainEffect]
|
|
605
|
+
]
|
|
606
|
+
},
|
|
607
|
+
// VIEW self-transitions
|
|
608
|
+
{ from: "browsing", to: "browsing", event: "VIEW", effects: [["fetch", "RoutePoint"], [...routePointListMainEffect]] },
|
|
609
|
+
{ from: "planning", to: "planning", event: "VIEW", effects: [["fetch", "RoutePoint"], [...routePointListMainEffect]] },
|
|
610
|
+
{ from: "viewing", to: "viewing", event: "VIEW", effects: [["fetch", "RoutePoint"], [...routePointListMainEffect]] }
|
|
611
|
+
]
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
],
|
|
615
|
+
pages: [
|
|
616
|
+
{
|
|
617
|
+
name: "RoutesPage",
|
|
618
|
+
path: "/routes",
|
|
619
|
+
isInitial: true,
|
|
620
|
+
traits: [{ ref: "RoutePlannerControl" }]
|
|
621
|
+
}
|
|
622
|
+
]
|
|
623
|
+
}
|
|
624
|
+
]
|
|
625
|
+
};
|
|
626
|
+
var GEOSPATIAL_BEHAVIORS = [
|
|
627
|
+
MAP_VIEW_BEHAVIOR,
|
|
628
|
+
LOCATION_PICKER_BEHAVIOR,
|
|
629
|
+
ROUTE_PLANNER_BEHAVIOR
|
|
630
|
+
];
|
|
631
|
+
|
|
632
|
+
export { GEOSPATIAL_BEHAVIORS, LOCATION_PICKER_BEHAVIOR, MAP_VIEW_BEHAVIOR, ROUTE_PLANNER_BEHAVIOR };
|
|
633
|
+
//# sourceMappingURL=geospatial.js.map
|
|
634
|
+
//# sourceMappingURL=geospatial.js.map
|