@eodash/eodash 5.0.0-alpha.2.9 → 5.0.0-rc

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.
Files changed (113) hide show
  1. package/README.md +1 -1
  2. package/core/client/App.vue +13 -1
  3. package/core/client/asWebComponent.js +13 -4
  4. package/core/client/components/DashboardLayout.vue +36 -14
  5. package/core/client/components/Loading.vue +6 -9
  6. package/core/client/components/MobileLayout.vue +16 -14
  7. package/core/client/composables/DefineEodash.js +14 -4
  8. package/core/client/composables/DefineTemplate.js +67 -0
  9. package/core/client/composables/DefineWidgets.js +3 -2
  10. package/core/client/composables/EodashMap.js +360 -0
  11. package/core/client/composables/EodashProcess.js +574 -0
  12. package/core/client/composables/index.js +136 -28
  13. package/core/client/eodash.js +395 -80
  14. package/core/client/eodashSTAC/EodashCollection.js +432 -0
  15. package/core/client/eodashSTAC/createLayers.js +315 -0
  16. package/core/client/eodashSTAC/helpers.js +375 -0
  17. package/core/client/eodashSTAC/triggers.js +43 -0
  18. package/core/client/plugins/axios.js +8 -0
  19. package/core/client/plugins/index.js +2 -1
  20. package/core/client/plugins/vuetify.js +2 -1
  21. package/core/client/store/actions.js +79 -0
  22. package/core/client/store/index.js +4 -18
  23. package/core/client/store/stac.js +99 -9
  24. package/core/client/store/states.js +37 -0
  25. package/core/client/{types.d.ts → types.ts} +66 -20
  26. package/core/client/utils/keys.js +2 -0
  27. package/core/client/utils/states.js +22 -0
  28. package/core/client/views/Dashboard.vue +22 -49
  29. package/core/client/vite-env.d.ts +2 -10
  30. package/dist/client/DashboardLayout-232tRmjz.js +84 -0
  31. package/dist/client/DynamicWebComponent-Cl4LqHU6.js +88 -0
  32. package/dist/client/EodashDatePicker-Pok6bZwU.js +306 -0
  33. package/dist/client/EodashItemFilter-16eMMjTV.js +151 -0
  34. package/dist/client/EodashLayerControl-De7IlCm_.js +120 -0
  35. package/dist/client/EodashLayoutSwitcher-C-3-jjn5.js +52 -0
  36. package/dist/client/EodashMap-CMvbfI6-.js +549 -0
  37. package/dist/client/EodashMapBtns-BeknGDtc.js +107 -0
  38. package/dist/client/EodashProcess-BwKAa9Ee.js +1476 -0
  39. package/dist/client/EodashStacInfo-_BfonNUG.js +85 -0
  40. package/dist/client/EodashTools-PD3XPYuR.js +103 -0
  41. package/dist/client/ExportState-DOrT7M15.js +644 -0
  42. package/dist/client/Footer-CCigxYBo.js +141 -0
  43. package/dist/client/Header-C2cdx4gb.js +437 -0
  44. package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
  45. package/dist/client/MobileLayout-BdiFjHg7.js +1207 -0
  46. package/dist/client/PopUp--_xn1Cms.js +410 -0
  47. package/dist/client/VImg-9xu2l99m.js +384 -0
  48. package/dist/client/VMain-BUs3kDTd.js +43 -0
  49. package/dist/client/VOverlay-D89omJis.js +1453 -0
  50. package/dist/client/VTooltip-CDu3bErh.js +86 -0
  51. package/dist/client/WidgetsContainer-aFG9yFT6.js +83 -0
  52. package/dist/client/asWebComponent-BRGyP_j5.js +11943 -0
  53. package/dist/client/{style.css → eo-dash.css} +2 -2
  54. package/dist/client/eo-dash.js +2 -6
  55. package/dist/client/forwardRefs-CYrR6bMw.js +245 -0
  56. package/dist/client/index-BZwk0V42.js +199 -0
  57. package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
  58. package/dist/client/transition-DG9nRSW4.js +37 -0
  59. package/dist/node/cli.js +4 -4
  60. package/dist/node/types.d.ts +2 -0
  61. package/package.json +73 -38
  62. package/widgets/EodashDatePicker.vue +176 -134
  63. package/widgets/EodashItemFilter.vue +79 -38
  64. package/widgets/EodashLayerControl.vue +111 -0
  65. package/widgets/EodashLayoutSwitcher.vue +36 -0
  66. package/widgets/EodashMap.vue +108 -133
  67. package/widgets/EodashMapBtns.vue +62 -8
  68. package/widgets/EodashProcess.vue +143 -0
  69. package/widgets/EodashStacInfo.vue +82 -0
  70. package/widgets/EodashTools.vue +83 -0
  71. package/widgets/ExportState.vue +17 -13
  72. package/widgets/PopUp.vue +24 -2
  73. package/core/client/SuspensedDashboard.ce.vue +0 -105
  74. package/core/client/asWebComponent.d.ts +0 -23
  75. package/core/client/store/Actions.js +0 -14
  76. package/core/client/store/States.js +0 -16
  77. package/core/client/utils/eodashSTAC.js +0 -249
  78. package/core/client/utils/helpers.js +0 -38
  79. package/dist/client/DashboardLayout-D0ZF6V2S.js +0 -156
  80. package/dist/client/DynamicWebComponent-CPsMSBHi.js +0 -57
  81. package/dist/client/EodashDatePicker-CBQP7u2X.js +0 -252
  82. package/dist/client/EodashItemFilter-DL2ScI-5.js +0 -7671
  83. package/dist/client/EodashMap-CkKoQlmR.js +0 -86917
  84. package/dist/client/EodashMapBtns-yuO2QmiR.js +0 -36
  85. package/dist/client/ExportState-CCzOhppU.js +0 -558
  86. package/dist/client/Footer-BPAND0yG.js +0 -115
  87. package/dist/client/Header-DLhebNvG.js +0 -350
  88. package/dist/client/IframeWrapper-1GEMHlsW.js +0 -19
  89. package/dist/client/MobileLayout-mGkOYRhu.js +0 -945
  90. package/dist/client/PopUp-1d2bBFjw.js +0 -300
  91. package/dist/client/VImg-DxHcztfM.js +0 -291
  92. package/dist/client/VMain-BLX5vRRn.js +0 -39
  93. package/dist/client/VOverlay-CvrYEmLu.js +0 -967
  94. package/dist/client/WidgetsContainer-CmYjvGm7.js +0 -129
  95. package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
  96. package/dist/client/asWebComponent-B91uK0U7.js +0 -20361
  97. package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
  98. package/dist/client/decoder-CP4lv0Kb-B6yqkcfC.js +0 -10
  99. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
  100. package/dist/client/eodashSTAC-DBjqe_Ho.js +0 -2788
  101. package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
  102. package/dist/client/forwardRefs-BJJiadQP.js +0 -185
  103. package/dist/client/index-Q-bHLjxx.js +0 -153
  104. package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
  105. package/dist/client/lerc-DzVumYtB-P-KXC0TO.js +0 -1027
  106. package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
  107. package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
  108. package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
  109. package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
  110. package/dist/client/ssrBoot-yo11mybw.js +0 -17
  111. package/dist/client/transition-CSJhuYGK.js +0 -34
  112. package/dist/client/webfontloader-qotgY98I.js +0 -435
  113. package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
@@ -1,6 +1,2 @@
1
- import { bz as a, bA as e, bB as o } from "./asWebComponent-B91uK0U7.js";
2
- export {
3
- a as Eodash,
4
- e as register,
5
- o as store
6
- };
1
+ export { aW as EodashConstructor, aX as register, aY as store } from './asWebComponent-BRGyP_j5.js';
2
+ import 'vue';
@@ -0,0 +1,245 @@
1
+ import { shallowRef, computed, watch } from 'vue';
2
+ import { p as propsFactory, aH as getCurrentInstance } from './asWebComponent-BRGyP_j5.js';
3
+
4
+ class Box {
5
+ constructor(_ref) {
6
+ let {
7
+ x,
8
+ y,
9
+ width,
10
+ height
11
+ } = _ref;
12
+ this.x = x;
13
+ this.y = y;
14
+ this.width = width;
15
+ this.height = height;
16
+ }
17
+ get top() {
18
+ return this.y;
19
+ }
20
+ get bottom() {
21
+ return this.y + this.height;
22
+ }
23
+ get left() {
24
+ return this.x;
25
+ }
26
+ get right() {
27
+ return this.x + this.width;
28
+ }
29
+ }
30
+ function getOverflow(a, b) {
31
+ return {
32
+ x: {
33
+ before: Math.max(0, b.left - a.left),
34
+ after: Math.max(0, a.right - b.right)
35
+ },
36
+ y: {
37
+ before: Math.max(0, b.top - a.top),
38
+ after: Math.max(0, a.bottom - b.bottom)
39
+ }
40
+ };
41
+ }
42
+ function getTargetBox(target) {
43
+ if (Array.isArray(target)) {
44
+ return new Box({
45
+ x: target[0],
46
+ y: target[1],
47
+ width: 0,
48
+ height: 0
49
+ });
50
+ } else {
51
+ return target.getBoundingClientRect();
52
+ }
53
+ }
54
+
55
+ // Utilities
56
+ /** @see https://stackoverflow.com/a/57876601/2074736 */
57
+ function nullifyTransforms(el) {
58
+ const rect = el.getBoundingClientRect();
59
+ const style = getComputedStyle(el);
60
+ const tx = style.transform;
61
+ if (tx) {
62
+ let ta, sx, sy, dx, dy;
63
+ if (tx.startsWith('matrix3d(')) {
64
+ ta = tx.slice(9, -1).split(/, /);
65
+ sx = +ta[0];
66
+ sy = +ta[5];
67
+ dx = +ta[12];
68
+ dy = +ta[13];
69
+ } else if (tx.startsWith('matrix(')) {
70
+ ta = tx.slice(7, -1).split(/, /);
71
+ sx = +ta[0];
72
+ sy = +ta[3];
73
+ dx = +ta[4];
74
+ dy = +ta[5];
75
+ } else {
76
+ return new Box(rect);
77
+ }
78
+ const to = style.transformOrigin;
79
+ const x = rect.x - dx - (1 - sx) * parseFloat(to);
80
+ const y = rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(' ') + 1));
81
+ const w = sx ? rect.width / sx : el.offsetWidth + 1;
82
+ const h = sy ? rect.height / sy : el.offsetHeight + 1;
83
+ return new Box({
84
+ x,
85
+ y,
86
+ width: w,
87
+ height: h
88
+ });
89
+ } else {
90
+ return new Box(rect);
91
+ }
92
+ }
93
+ function animate(el, keyframes, options) {
94
+ if (typeof el.animate === 'undefined') return {
95
+ finished: Promise.resolve()
96
+ };
97
+ let animation;
98
+ try {
99
+ animation = el.animate(keyframes, options);
100
+ } catch (err) {
101
+ return {
102
+ finished: Promise.resolve()
103
+ };
104
+ }
105
+ if (typeof animation.finished === 'undefined') {
106
+ animation.finished = new Promise(resolve => {
107
+ animation.onfinish = () => {
108
+ resolve(animation);
109
+ };
110
+ });
111
+ }
112
+ return animation;
113
+ }
114
+
115
+ const standardEasing = 'cubic-bezier(0.4, 0, 0.2, 1)';
116
+ const deceleratedEasing = 'cubic-bezier(0.0, 0, 0.2, 1)'; // Entering
117
+ const acceleratedEasing = 'cubic-bezier(0.4, 0, 1, 1)'; // Leaving
118
+
119
+ // Utilities
120
+ const makeLazyProps = propsFactory({
121
+ eager: Boolean
122
+ }, 'lazy');
123
+ function useLazy(props, active) {
124
+ const isBooted = shallowRef(false);
125
+ const hasContent = computed(() => isBooted.value || props.eager || active.value);
126
+ watch(active, () => isBooted.value = true);
127
+ function onAfterLeave() {
128
+ if (!props.eager) isBooted.value = false;
129
+ }
130
+ return {
131
+ isBooted,
132
+ hasContent,
133
+ onAfterLeave
134
+ };
135
+ }
136
+
137
+ // Utilities
138
+ function useScopeId() {
139
+ const vm = getCurrentInstance('useScopeId');
140
+ const scopeId = vm.vnode.scopeId;
141
+ return {
142
+ scopeId: scopeId ? {
143
+ [scopeId]: ''
144
+ } : undefined
145
+ };
146
+ }
147
+
148
+ // Types
149
+
150
+ const Refs = Symbol('Forwarded refs');
151
+
152
+ /** Omit properties starting with P */
153
+
154
+ /** Omit keyof $props from T */
155
+
156
+ function getDescriptor(obj, key) {
157
+ let currentObj = obj;
158
+ while (currentObj) {
159
+ const descriptor = Reflect.getOwnPropertyDescriptor(currentObj, key);
160
+ if (descriptor) return descriptor;
161
+ currentObj = Object.getPrototypeOf(currentObj);
162
+ }
163
+ return undefined;
164
+ }
165
+ function forwardRefs(target) {
166
+ for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
167
+ refs[_key - 1] = arguments[_key];
168
+ }
169
+ target[Refs] = refs;
170
+ return new Proxy(target, {
171
+ get(target, key) {
172
+ if (Reflect.has(target, key)) {
173
+ return Reflect.get(target, key);
174
+ }
175
+
176
+ // Skip internal properties
177
+ if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return;
178
+ for (const ref of refs) {
179
+ if (ref.value && Reflect.has(ref.value, key)) {
180
+ const val = Reflect.get(ref.value, key);
181
+ return typeof val === 'function' ? val.bind(ref.value) : val;
182
+ }
183
+ }
184
+ },
185
+ has(target, key) {
186
+ if (Reflect.has(target, key)) {
187
+ return true;
188
+ }
189
+
190
+ // Skip internal properties
191
+ if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return false;
192
+ for (const ref of refs) {
193
+ if (ref.value && Reflect.has(ref.value, key)) {
194
+ return true;
195
+ }
196
+ }
197
+ return false;
198
+ },
199
+ set(target, key, value) {
200
+ if (Reflect.has(target, key)) {
201
+ return Reflect.set(target, key, value);
202
+ }
203
+
204
+ // Skip internal properties
205
+ if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return false;
206
+ for (const ref of refs) {
207
+ if (ref.value && Reflect.has(ref.value, key)) {
208
+ return Reflect.set(ref.value, key, value);
209
+ }
210
+ }
211
+ return false;
212
+ },
213
+ getOwnPropertyDescriptor(target, key) {
214
+ const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
215
+ if (descriptor) return descriptor;
216
+
217
+ // Skip internal properties
218
+ if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return;
219
+
220
+ // Check each ref's own properties
221
+ for (const ref of refs) {
222
+ if (!ref.value) continue;
223
+ const descriptor = getDescriptor(ref.value, key) ?? ('_' in ref.value ? getDescriptor(ref.value._?.setupState, key) : undefined);
224
+ if (descriptor) return descriptor;
225
+ }
226
+
227
+ // Recursive search up each ref's prototype
228
+ for (const ref of refs) {
229
+ const childRefs = ref.value && ref.value[Refs];
230
+ if (!childRefs) continue;
231
+ const queue = childRefs.slice();
232
+ while (queue.length) {
233
+ const ref = queue.shift();
234
+ const descriptor = getDescriptor(ref.value, key);
235
+ if (descriptor) return descriptor;
236
+ const childRefs = ref.value && ref.value[Refs];
237
+ if (childRefs) queue.push(...childRefs);
238
+ }
239
+ }
240
+ return undefined;
241
+ }
242
+ });
243
+ }
244
+
245
+ export { Box as B, animate as a, useScopeId as b, acceleratedEasing as c, deceleratedEasing as d, getOverflow as e, forwardRefs as f, getTargetBox as g, makeLazyProps as m, nullifyTransforms as n, standardEasing as s, useLazy as u };
@@ -0,0 +1,199 @@
1
+ import { TransitionGroup, Transition, h, camelize } from 'vue';
2
+ import { g as genericComponent, p as propsFactory } from './asWebComponent-BRGyP_j5.js';
3
+
4
+ // Utilities
5
+ const makeTransitionProps = propsFactory({
6
+ disabled: Boolean,
7
+ group: Boolean,
8
+ hideOnLeave: Boolean,
9
+ leaveAbsolute: Boolean,
10
+ mode: String,
11
+ origin: String
12
+ }, 'transition');
13
+ function createCssTransition(name, origin, mode) {
14
+ return genericComponent()({
15
+ name,
16
+ props: makeTransitionProps({
17
+ mode,
18
+ origin
19
+ }),
20
+ setup(props, _ref) {
21
+ let {
22
+ slots
23
+ } = _ref;
24
+ const functions = {
25
+ onBeforeEnter(el) {
26
+ if (props.origin) {
27
+ el.style.transformOrigin = props.origin;
28
+ }
29
+ },
30
+ onLeave(el) {
31
+ if (props.leaveAbsolute) {
32
+ const {
33
+ offsetTop,
34
+ offsetLeft,
35
+ offsetWidth,
36
+ offsetHeight
37
+ } = el;
38
+ el._transitionInitialStyles = {
39
+ position: el.style.position,
40
+ top: el.style.top,
41
+ left: el.style.left,
42
+ width: el.style.width,
43
+ height: el.style.height
44
+ };
45
+ el.style.position = 'absolute';
46
+ el.style.top = `${offsetTop}px`;
47
+ el.style.left = `${offsetLeft}px`;
48
+ el.style.width = `${offsetWidth}px`;
49
+ el.style.height = `${offsetHeight}px`;
50
+ }
51
+ if (props.hideOnLeave) {
52
+ el.style.setProperty('display', 'none', 'important');
53
+ }
54
+ },
55
+ onAfterLeave(el) {
56
+ if (props.leaveAbsolute && el?._transitionInitialStyles) {
57
+ const {
58
+ position,
59
+ top,
60
+ left,
61
+ width,
62
+ height
63
+ } = el._transitionInitialStyles;
64
+ delete el._transitionInitialStyles;
65
+ el.style.position = position || '';
66
+ el.style.top = top || '';
67
+ el.style.left = left || '';
68
+ el.style.width = width || '';
69
+ el.style.height = height || '';
70
+ }
71
+ }
72
+ };
73
+ return () => {
74
+ const tag = props.group ? TransitionGroup : Transition;
75
+ return h(tag, {
76
+ name: props.disabled ? '' : name,
77
+ css: !props.disabled,
78
+ ...(props.group ? undefined : {
79
+ mode: props.mode
80
+ }),
81
+ ...(props.disabled ? {} : functions)
82
+ }, slots.default);
83
+ };
84
+ }
85
+ });
86
+ }
87
+ function createJavascriptTransition(name, functions) {
88
+ let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'in-out';
89
+ return genericComponent()({
90
+ name,
91
+ props: {
92
+ mode: {
93
+ type: String,
94
+ default: mode
95
+ },
96
+ disabled: Boolean,
97
+ group: Boolean
98
+ },
99
+ setup(props, _ref2) {
100
+ let {
101
+ slots
102
+ } = _ref2;
103
+ const tag = props.group ? TransitionGroup : Transition;
104
+ return () => {
105
+ return h(tag, {
106
+ name: props.disabled ? '' : name,
107
+ css: !props.disabled,
108
+ // mode: props.mode, // TODO: vuejs/vue-next#3104
109
+ ...(props.disabled ? {} : functions)
110
+ }, slots.default);
111
+ };
112
+ }
113
+ });
114
+ }
115
+
116
+ // Utilities
117
+ function ExpandTransitionGenerator () {
118
+ let expandedParentClass = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
119
+ let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
120
+ const sizeProperty = x ? 'width' : 'height';
121
+ const offsetProperty = camelize(`offset-${sizeProperty}`);
122
+ return {
123
+ onBeforeEnter(el) {
124
+ el._parent = el.parentNode;
125
+ el._initialStyle = {
126
+ transition: el.style.transition,
127
+ overflow: el.style.overflow,
128
+ [sizeProperty]: el.style[sizeProperty]
129
+ };
130
+ },
131
+ onEnter(el) {
132
+ const initialStyle = el._initialStyle;
133
+ el.style.setProperty('transition', 'none', 'important');
134
+ // Hide overflow to account for collapsed margins in the calculated height
135
+ el.style.overflow = 'hidden';
136
+ const offset = `${el[offsetProperty]}px`;
137
+ el.style[sizeProperty] = '0';
138
+ void el.offsetHeight; // force reflow
139
+
140
+ el.style.transition = initialStyle.transition;
141
+ if (expandedParentClass && el._parent) {
142
+ el._parent.classList.add(expandedParentClass);
143
+ }
144
+ requestAnimationFrame(() => {
145
+ el.style[sizeProperty] = offset;
146
+ });
147
+ },
148
+ onAfterEnter: resetStyles,
149
+ onEnterCancelled: resetStyles,
150
+ onLeave(el) {
151
+ el._initialStyle = {
152
+ transition: '',
153
+ overflow: el.style.overflow,
154
+ [sizeProperty]: el.style[sizeProperty]
155
+ };
156
+ el.style.overflow = 'hidden';
157
+ el.style[sizeProperty] = `${el[offsetProperty]}px`;
158
+ void el.offsetHeight; // force reflow
159
+
160
+ requestAnimationFrame(() => el.style[sizeProperty] = '0');
161
+ },
162
+ onAfterLeave,
163
+ onLeaveCancelled: onAfterLeave
164
+ };
165
+ function onAfterLeave(el) {
166
+ if (expandedParentClass && el._parent) {
167
+ el._parent.classList.remove(expandedParentClass);
168
+ }
169
+ resetStyles(el);
170
+ }
171
+ function resetStyles(el) {
172
+ const size = el._initialStyle[sizeProperty];
173
+ el.style.overflow = el._initialStyle.overflow;
174
+ if (size != null) el.style[sizeProperty] = size;
175
+ delete el._initialStyle;
176
+ }
177
+ }
178
+
179
+ createCssTransition('fab-transition', 'center center', 'out-in');
180
+
181
+ // Generic transitions
182
+ createCssTransition('dialog-bottom-transition');
183
+ createCssTransition('dialog-top-transition');
184
+ const VFadeTransition = createCssTransition('fade-transition');
185
+ createCssTransition('scale-transition');
186
+ createCssTransition('scroll-x-transition');
187
+ createCssTransition('scroll-x-reverse-transition');
188
+ createCssTransition('scroll-y-transition');
189
+ createCssTransition('scroll-y-reverse-transition');
190
+ createCssTransition('slide-x-transition');
191
+ createCssTransition('slide-x-reverse-transition');
192
+ createCssTransition('slide-y-transition');
193
+ createCssTransition('slide-y-reverse-transition');
194
+
195
+ // Javascript transitions
196
+ const VExpandTransition = createJavascriptTransition('expand-transition', ExpandTransitionGenerator());
197
+ createJavascriptTransition('expand-x-transition', ExpandTransitionGenerator('', true));
198
+
199
+ export { VFadeTransition as V, VExpandTransition as a };
@@ -0,0 +1,22 @@
1
+ import { shallowRef, onMounted, computed, readonly } from 'vue';
2
+
3
+ // Utilities
4
+
5
+ // Composables
6
+ function useSsrBoot() {
7
+ const isBooted = shallowRef(false);
8
+ onMounted(() => {
9
+ window.requestAnimationFrame(() => {
10
+ isBooted.value = true;
11
+ });
12
+ });
13
+ const ssrBootStyles = computed(() => !isBooted.value ? {
14
+ transition: 'none !important'
15
+ } : undefined);
16
+ return {
17
+ ssrBootStyles,
18
+ isBooted: readonly(isBooted)
19
+ };
20
+ }
21
+
22
+ export { useSsrBoot as u };
@@ -0,0 +1,37 @@
1
+ import { h, mergeProps, TransitionGroup, Transition } from 'vue';
2
+ import { p as propsFactory } from './asWebComponent-BRGyP_j5.js';
3
+
4
+ // Utilities
5
+ const makeTransitionProps = propsFactory({
6
+ transition: {
7
+ type: [Boolean, String, Object],
8
+ default: 'fade-transition',
9
+ validator: val => val !== true
10
+ }
11
+ }, 'transition');
12
+ const MaybeTransition = (props, _ref) => {
13
+ let {
14
+ slots
15
+ } = _ref;
16
+ const {
17
+ transition,
18
+ disabled,
19
+ group,
20
+ ...rest
21
+ } = props;
22
+ const {
23
+ component = group ? TransitionGroup : Transition,
24
+ ...customProps
25
+ } = typeof transition === 'object' ? transition : {};
26
+ return h(component, mergeProps(typeof transition === 'string' ? {
27
+ name: disabled ? '' : transition
28
+ } : customProps, typeof transition === 'string' ? {} : Object.fromEntries(Object.entries({
29
+ disabled,
30
+ group
31
+ }).filter(_ref2 => {
32
+ let [_, v] = _ref2;
33
+ return v !== undefined;
34
+ })), rest), slots);
35
+ };
36
+
37
+ export { MaybeTransition as M, makeTransitionProps as m };
package/dist/node/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import{createLogger as P,defineConfig as C,searchForWorkspaceRoot as x,createServer as k,preview as S,build as F}from"vite";import{readFileSync as U,existsSync as u}from"fs";import t from"path";import{Command as E}from"commander";import{readFile as W,writeFile as I,rm as $,cp as N}from"fs/promises";import O from"@vitejs/plugin-vue";import T,{transformAssetUrls as A}from"vite-plugin-vuetify";const s=b(process.cwd()),h=new E("eodash"),H=JSON.parse(U(t.join(s,"package.json"),"utf-8"));h.version(H.version,"-v, --version","output the current version"),h.option("--publicDir <path>","path to statically served assets folder").option("--no-publicDir","stop serving static assets").option("--outDir <path>","minified output folder").option("-e, --entryPoint <path>","file exporting `createEodash`").option("-w, --widgets <path>","folder that contains vue components as internal widgets").option("--cacheDir <path>","cache folder").option("-r, --runtime <path>","file exporting eodash client runtime config").option("-b, --base <path>","base public path").option("-p, --port <port>","serving port").option("-o, --open","open default browser when the server starts").option("-c, --config <path>","path to eodash server and build configuration file").option("--host [IP address]","specify which IP addresses the server should listen on").option("-l, --lib","builds eodash as a web component library").option("--no-lib","builds eodash as an SPA").option("--no-host","do not expose server to the network").parse(process.argv);const i=await z(h.opts(),process.argv?.[2]),c=b(),L=i.publicDir?t.resolve(s,i.publicDir):t.join(s,"./public"),f=t.join(s,"/src"),l=i.runtime?t.resolve(s,i.runtime):t.join(f,"./runtime.js"),g=i.entryPoint?t.resolve(s,i.entryPoint):t.join(f,"/main.js"),w=i.widgets?t.resolve(s,i.widgets):t.join(f,"widgets"),j=t.join(s,"/.eodash"),m=i.outDir?t.resolve(s,i.outDir):t.join(j,"/dist"),R=i.cacheDir?t.resolve(s,i.cacheDir):t.join(j,"cache"),v=P(void 0,{prefix:"[eodash]"});async function z(e,n){let a=e.config?t.resolve(s,e.config):t.join(s,"eodash.config.js"),o={};return u(a)?o=await import(a).then(r=>r.default instanceof Function?r.default():r.default).catch(r=>{console.error(r)}):a=null,{base:e.base??o?.base,port:Number(e.port??o?.[n]?.port),host:e.host??o?.[n]?.host,open:e.open??o?.[n]?.open,cacheDir:e.cacheDir??o?.cacheDir,entryPoint:e.entryPoint??o?.entryPoint,outDir:e.outDir??o?.outDir,publicDir:e.publicDir??o?.publicDir,runtime:e.runtime??o?.runtime,widgets:e.widgets??o?.widgets,lib:e.lib??o?.lib}}function b(e=import.meta.dirname){if(e.split("/").length>0)return u(t.resolve(e,"package.json"))?e:b(t.resolve(e,".."));throw new Error("no package root found from "+e)}const y=`
2
+ import{createLogger as S,defineConfig as w,searchForWorkspaceRoot as W,mergeConfig as F,createServer as O,preview as U,build as N}from"vite";import{readFileSync as y,existsSync as u}from"fs";import t from"path";import{Command as E}from"commander";import{fileURLToPath as I}from"url";import{readFile as L,writeFile as T,rm as $,cp as A}from"fs/promises";import H from"@vitejs/plugin-vue";import M,{transformAssetUrls as J}from"vite-plugin-vuetify";const h=new E("eodash"),c=b(),s=b(process.cwd());JSON.parse(y(t.join(s,"package.json"),"utf-8"));const j=JSON.parse(y(t.join(c,"package.json"),"utf-8"))??{},R=["commander","vite","@vitejs/plugin-vue","vite-plugin-vuetify","axios"],V=Object.keys(j?.dependencies).filter(e=>!R.includes(e));h.version(j.version,"-v, --version","output the current version"),h.option("--publicDir <path>","path to statically served assets folder").option("--no-publicDir","stop serving static assets").option("--outDir <path>","minified output folder").option("-e, --entryPoint <path>","file exporting `createEodash`").option("-w, --widgets <path>","folder that contains vue components as internal widgets").option("--cacheDir <path>","cache folder").option("-r, --runtime <path>","file exporting eodash client runtime config").option("-b, --base <path>","base public path").option("-p, --port <port>","serving port").option("-o, --open","open default browser when the server starts").option("-c, --config <path>","path to eodash server and build configuration file").option("--host [IP address]","specify which IP addresses the server should listen on").option("-l, --lib","builds eodash as a web component library").option("--no-lib","builds eodash as an SPA").option("--no-host","do not expose server to the network").parse(process.argv);const i=await B(h.opts(),process.argv?.[2]),z=i.publicDir?t.resolve(s,i.publicDir):t.join(s,"./public"),m=t.join(s,"/src"),p=i.runtime?t.resolve(s,i.runtime):t.join(m,"./runtime.js"),f=i.entryPoint?t.resolve(s,i.entryPoint):t.join(m,"/main.js"),D=i.widgets?t.resolve(s,i.widgets):t.join(m,"widgets"),x=t.join(s,"/.eodash"),v=i.outDir?t.resolve(s,i.outDir):t.join(x,"/dist"),Y=i.cacheDir?t.resolve(s,i.cacheDir):t.join(x,"cache"),g=S(void 0,{prefix:"[eodash]"});async function B(e,a){let r=e.config?t.resolve(s,e.config):t.join(s,"eodash.config.js"),o={};return u(r)?o=await import(r).then(n=>n.default instanceof Function?n.default():n.default).catch(n=>{console.error(n)}):r=null,{base:e.base??o?.base,port:Number(e.port??o?.[a]?.port),host:e.host??o?.[a]?.host,open:e.open??o?.[a]?.open,cacheDir:e.cacheDir??o?.cacheDir,entryPoint:e.entryPoint??o?.entryPoint,outDir:e.outDir??o?.outDir,publicDir:e.publicDir??o?.publicDir,runtime:e.runtime??o?.runtime,widgets:e.widgets??o?.widgets,lib:e.lib??o?.lib,vite:o.vite}}function b(e=import.meta.dirname??t.dirname(I(import.meta.url))){if(e?.split("/").length)return u(t.resolve(e,"package.json"))?e:b(t.resolve(e,".."));throw new Error("no package root found from "+e)}const P=`
3
3
  <!DOCTYPE html>
4
- <html lang="en">
4
+ <html lang="en" style="overflow: hidden">
5
5
 
6
6
  <head>
7
7
  <meta charset="UTF-8" />
@@ -13,8 +13,8 @@ import{createLogger as P,defineConfig as C,searchForWorkspaceRoot as x,createSer
13
13
  <body>
14
14
  ${i.lib?`<eo-dash style="height:100dvh;"/>
15
15
  <script type="module" src="${t.resolve(`/@fs/${c}`,"core/client/asWebComponent.js")}"><\/script>
16
- `:` <div id="app"/>
16
+ `:` <div id="app" />
17
17
  <script type="module" src="${t.resolve(`/@fs/${c}`,"core/client/render.js")}"><\/script>
18
18
  `}
19
19
  </body>
20
- </html>`,D=C(({mode:e,command:n})=>({base:i.base??"",cacheDir:R,plugins:[O({customElement:!1,template:{transformAssetUrls:A,compilerOptions:{isCustomElement:a=>!a.includes("v-")&&a.includes("-")}}}),T({autoImport:!0}),e==="development"&&{name:"inject-html",configureServer:J}],customLogger:v,define:{"process.env":{}},resolve:{alias:{"@":t.join(c,"core/client"),"^":t.join(c,"widgets"),"user:config":g,"user:widgets":w},extensions:[".js",".json",".jsx",".mjs",".ts",".tsx",".vue"]},server:{warmup:{clientFiles:[t.join(c,"core/client/**")]},port:i.port??3e3,open:i.open,fs:{allow:[x(process.cwd())]},host:i.host},root:c,optimizeDeps:e==="development"?{include:["webfontloader","vuetify","vue","pinia","stac-js","urijs"],noDiscovery:!0}:{},publicDir:i.publicDir===!1?!1:L,build:{lib:i.lib&&n==="build"&&{entry:t.join(c,"core/client/asWebComponent.js"),fileName:"eo-dash",formats:["es"],name:"@eodash/eodash"},outDir:m,emptyOutDir:!0,rollupOptions:i.lib&&n==="build"?{input:t.join(c,"core/client/asWebComponent.js")}:void 0,target:"esnext"}}));async function J(e){e.watcher.add([g,l,t.join(w,"**/*.vue")]);let n="";const a=v.info;return v.info=(o,r)=>{if(o.includes("core")){const d=o.split("/")[0].split(" ");d.pop();const p=d.join(" ")+" "+n.replace(s,"");return a(p,r)}return a(o,r)},e.watcher.on("change",async o=>{n=o,o===l&&e.hot.send({type:"full-reload",path:o})}),()=>{e.middlewares.use(async(o,r,d)=>{if(o.originalUrl==="/@fs/config.js"||o.originalUrl==="/config.js"){r.statusCode=200,r.setHeader("Content-Type","text/javascript"),u(l)&&await W(l).then(p=>{r.write(p)}),r.end();return}if(o.url?.endsWith(".html")){r.statusCode=200,r.setHeader("Content-Type","text/html");const p=await e.transformIndexHtml(o.url,y,o.originalUrl);r.end(p);return}d()})}}const M=async()=>{const e=await k(await D({mode:"development",command:"serve"}));await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})},Y=async()=>{const e=async()=>{const n=await D({mode:"production",command:"build"});await F(n),u(l)&&await N(l,t.join(m,"config.js"),{recursive:!0}).catch(a=>{console.error(a)})};if(i.lib)await e();else{const n=t.join(c,"/index.html");await I(n,y).then(async()=>{await e(),await $(n).catch(()=>{console.error("failed to remove index.html")})})}};async function B(){(await S({root:s,base:i.base??"",preview:{port:isNaN(i.port)?8080:i.port,open:i.open,host:i.host},build:{outDir:m}})).printUrls()}const G=process.argv?.[2];(async()=>{switch(G){case"dev":await M();break;case"build":await Y();break;case"preview":await B();break;default:console.error("command not found");break}})();
20
+ </html>`,C=w(async({mode:e,command:a})=>({base:i.base??"",cacheDir:Y,plugins:[H({template:{transformAssetUrls:J,compilerOptions:{isCustomElement:r=>!r.includes("v-")&&r.includes("-")}}}),M({autoImport:!0}),e==="development"&&{name:"inject-html",configureServer:G}],customLogger:g,define:{"process.env":{}},resolve:{alias:{"@":t.join(c,"core/client"),"^":t.join(c,"widgets"),"user:config":f,"user:widgets":D},extensions:[".js",".json",".jsx",".mjs",".ts",".tsx",".vue"]},server:{warmup:{clientFiles:[t.join(c,"core/client/**"),f]},port:i.port??3e3,open:i.open,fs:{allow:[W(process.cwd())]},host:i.host},root:c,...e==="development"&&{optimizeDeps:{include:["webfontloader","vuetify","vue","pinia","stac-js","urijs","loglevel","vega","vega-lite","vega-embed","@eox/map","@eox/map/src/plugins/advancedLayersAndSources","@eox/layercontrol","@eox/drawtools","@eox/chart","@eox/jsonform","@eox/layout","@eox/itemfilter","@eox/timecontrol","@eox/stacinfo","color-legend-element"],noDiscovery:!0}},publicDir:i.publicDir===!1?!1:z,build:{outDir:v,emptyOutDir:!0,target:"esnext",cssMinify:!0,...i.lib&&a==="build"&&{minify:!1,lib:{entry:t.join(c,"core/client/asWebComponent.js"),fileName:"eo-dash",formats:["es"],name:"@eodash/eodash"},rollupOptions:{input:t.join(c,"core/client/asWebComponent.js"),external:r=>{const o=r.includes("vuetify")||r.endsWith(".css")||r.endsWith("styles"),n=V.some(l=>r.startsWith(l));return!o&&n}}}}})),k=w(async e=>i.vite?F(await C(e),i.vite):C(e));async function G(e){e.watcher.add([f,p,t.join(D,"**/*.vue")]);let a="";const r=g.info;return g.info=(o,n)=>{if(o.includes("core")){const l=o.split("/")[0].split(" ");l.pop();const d=l.join(" ")+" "+a.replace(s,"");return r(d,n)}return r(o,n)},e.watcher.on("change",async o=>{a=o,o===p&&e.ws.send({type:"full-reload",path:o})}),()=>{e.middlewares.use(async(o,n,l)=>{if(o.originalUrl==="/@fs/config.js"||o.originalUrl==="/config.js"){n.statusCode=200,n.setHeader("Content-Type","text/javascript"),u(p)&&await L(p).then(d=>{n.write(d)}),n.end();return}if(o.url?.endsWith(".html")){n.statusCode=200,n.setHeader("Content-Type","text/html");const d=await e.transformIndexHtml(o.url,P,o.originalUrl);n.end(d);return}l()})}}const K=async()=>{const e=await O(await k({mode:"development",command:"serve"}));await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})},Q=async()=>{const e=async()=>{const a=await k({mode:"production",command:"build"});await N(a),u(p)&&await A(p,t.join(v,"config.js"),{recursive:!0}).catch(r=>{console.error(r)})};if(i.lib)await e();else{const a=t.join(c,"/index.html");await T(a,P).then(async()=>{await e(),await $(a).catch(()=>{console.error("failed to remove index.html")})})}};async function X(){(await U({root:s,base:i.base??"",preview:{port:isNaN(i.port)?8080:i.port,open:i.open,host:i.host},build:{outDir:v}})).printUrls()}const Z=process.argv?.[2];(async()=>{switch(Z){case"dev":await K();break;case"build":await Q();break;case"preview":await X();break;default:console.error("command not found");break}})();
@@ -37,6 +37,8 @@ export interface EodashConfig {
37
37
  widgets?: string;
38
38
  /** Builds eodash as a web component library */
39
39
  lib?: boolean;
40
+ /** User Config that is merged to eodash Vite Config*/
41
+ vite?: Omit<import("vite").UserConfig, "root">;
40
42
  }
41
43
  /**
42
44
  * Helper function that provides intellisense without the need for JSDOC for