@emuanalytics/flow-rdf-core 4.0.4 → 4.0.5

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 (89) hide show
  1. package/README.md +1 -64
  2. package/dist/index.d.mts +36 -31
  3. package/dist/index.d.ts +36 -31
  4. package/dist/index.mjs +20 -3249
  5. package/dist/lib/context/context-registry.mjs +63 -0
  6. package/dist/lib/context/debugger.mjs +240 -0
  7. package/dist/lib/context/flow-context.mjs +61 -0
  8. package/dist/lib/context/global-state.mjs +70 -0
  9. package/dist/lib/context/map-registry.mjs +59 -0
  10. package/dist/lib/context/query-registry.mjs +53 -0
  11. package/dist/lib/errors/flow-error.mjs +10 -0
  12. package/dist/lib/errors/flow-expression-error.mjs +14 -0
  13. package/dist/lib/errors/flow-map-error.mjs +9 -0
  14. package/dist/lib/expressions/expression-parser.mjs +198 -0
  15. package/dist/lib/expressions/functions/from-palette.mjs +75 -0
  16. package/dist/lib/expressions/functions/regex.mjs +25 -0
  17. package/dist/lib/expressions/functions/state.mjs +25 -0
  18. package/dist/lib/expressions/parser-helpers.mjs +37 -0
  19. package/dist/lib/expressions/reactive-expression.mjs +253 -0
  20. package/dist/lib/map/flow-core-map.mjs +749 -0
  21. package/dist/lib/map/plugins/annotations/annotation-layers.mjs +163 -0
  22. package/dist/lib/map/plugins/annotations/annotation.events.mjs +27 -0
  23. package/dist/lib/map/plugins/annotations/annotation.plugin.mjs +498 -0
  24. package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/modes/DirectModeOverride.mjs +67 -0
  25. package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/modes/DragCircleMode.mjs +65 -0
  26. package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/utils/create_supplementary_points_circle.mjs +15 -0
  27. package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/utils/drag_pan.mjs +20 -0
  28. package/dist/lib/map/plugins/data-join.plugin.mjs +173 -0
  29. package/dist/lib/map/plugins/export/export.plugin.mjs +21 -0
  30. package/dist/lib/map/plugins/export/map-exporter.mjs +177 -0
  31. package/dist/lib/map/plugins/hover-effect.plugin.mjs +58 -0
  32. package/dist/lib/map/plugins/index.d.mts +37 -72
  33. package/dist/lib/map/plugins/index.d.ts +37 -72
  34. package/dist/lib/map/plugins/index.mjs +11 -1810
  35. package/dist/lib/map/plugins/keyboard-shortcut-manager.mjs +120 -0
  36. package/dist/lib/map/plugins/map-plugin-base.mjs +25 -0
  37. package/dist/lib/map/plugins/plugin-manager.mjs +135 -0
  38. package/dist/lib/map/plugins/popup.plugin.mjs +55 -0
  39. package/dist/lib/map/plugins/selection/selection.events.mjs +21 -0
  40. package/dist/lib/map/plugins/selection/selection.plugin.mjs +136 -0
  41. package/dist/lib/map/plugins/selection/source-selection.mjs +156 -0
  42. package/dist/lib/map/plugins/url-sync.plugin.mjs +55 -0
  43. package/dist/lib/map/support/image-registry.mjs +82 -0
  44. package/dist/lib/map/support/map-events.mjs +71 -0
  45. package/dist/lib/map/support/map-feature-stream.mjs +158 -0
  46. package/dist/lib/map/support/map-popup.mjs +159 -0
  47. package/dist/lib/map/types.mjs +7 -0
  48. package/dist/lib/map-style/map-data-source.mjs +192 -0
  49. package/dist/lib/map-style/map-layer-style-builder-generated.mjs +1307 -0
  50. package/dist/lib/map-style/map-layer-style-builder.mjs +86 -0
  51. package/dist/lib/map-style/map-layer.mjs +223 -0
  52. package/dist/lib/map-style/map-style.mjs +178 -0
  53. package/dist/lib/queries/async-committer.mjs +30 -0
  54. package/dist/lib/queries/query.mjs +172 -0
  55. package/dist/lib/state-store/decorators.mjs +83 -0
  56. package/dist/lib/state-store/state-store.mjs +534 -0
  57. package/dist/lib/state-store/utils.mjs +7 -0
  58. package/dist/lib/utils/announce.mjs +12 -0
  59. package/dist/lib/utils/assert.mjs +12 -0
  60. package/dist/{shared/flow-rdf-core.187cb345.mjs → lib/utils/debounce.mjs} +3 -39
  61. package/dist/lib/utils/decorators.mjs +59 -0
  62. package/dist/lib/utils/deferred.mjs +11 -0
  63. package/dist/lib/utils/ensure-array.mjs +16 -0
  64. package/dist/{shared/flow-rdf-core.1f0901c5.mjs → lib/utils/feature-type-checks.mjs} +2 -2
  65. package/dist/lib/utils/functional.mjs +22 -0
  66. package/dist/lib/utils/global.mjs +18 -0
  67. package/dist/lib/utils/index.mjs +8 -5
  68. package/dist/lib/utils/random-id.mjs +9 -0
  69. package/dist/lib/utils/string-utils.mjs +3 -0
  70. package/dist/lib/utils/throttle.mjs +20 -0
  71. package/dist/{shared/flow-rdf-core.25e5f6d7.mjs → lib/utils/type-checks.mjs} +1 -26
  72. package/dist/lib/utils/watchable-promise.mjs +55 -0
  73. package/dist/package.json.mjs +3 -0
  74. package/dist/shared/{flow-rdf-core.4dde996e.d.cts → flow-rdf-core.8b5acf14.d.mts} +1315 -172
  75. package/dist/shared/{flow-rdf-core.4dde996e.d.ts → flow-rdf-core.8b5acf14.d.ts} +1315 -172
  76. package/package.json +4 -8
  77. package/dist/index.cjs +0 -3316
  78. package/dist/index.d.cts +0 -90
  79. package/dist/lib/map/plugins/index.cjs +0 -1850
  80. package/dist/lib/map/plugins/index.d.cts +0 -345
  81. package/dist/lib/utils/index.cjs +0 -48
  82. package/dist/lib/utils/index.d.cts +0 -160
  83. package/dist/shared/flow-rdf-core.06e85a6c.cjs +0 -1394
  84. package/dist/shared/flow-rdf-core.4dde996e.d.mts +0 -1916
  85. package/dist/shared/flow-rdf-core.55c169ca.cjs +0 -150
  86. package/dist/shared/flow-rdf-core.63162669.d.cts +0 -10
  87. package/dist/shared/flow-rdf-core.65045caf.mjs +0 -1360
  88. package/dist/shared/flow-rdf-core.a82b9be4.cjs +0 -34
  89. package/dist/shared/flow-rdf-core.f50908f0.cjs +0 -102
@@ -1,150 +0,0 @@
1
- 'use strict';
2
-
3
- const randomId = require('./flow-rdf-core.f50908f0.cjs');
4
-
5
- const doNotMemoize = Symbol("Do not memoize");
6
- function memoize(originalFunction, options) {
7
- const cache = /* @__PURE__ */ new Map();
8
- const hash = options.hash ? options.hash : (...args) => args[0];
9
- const context = options.context;
10
- return function memoizedFunction(...args) {
11
- const key = hash.apply(context, args);
12
- if (key === doNotMemoize) {
13
- return originalFunction.apply(context, args);
14
- }
15
- let value;
16
- if (!cache.has(key)) {
17
- value = originalFunction.apply(context, args);
18
- cache.set(key, value);
19
- } else {
20
- value = cache.get(key);
21
- }
22
- return value;
23
- };
24
- }
25
-
26
- function debounce(func, wait, options) {
27
- options = {
28
- leading: false,
29
- trailing: true,
30
- ...options
31
- };
32
- const leading = options.leading;
33
- const trailing = options.trailing;
34
- const maxWait = options.maxWait;
35
- const maxing = randomId.isNumber(maxWait);
36
- let lastArgs;
37
- let lastThis;
38
- let result;
39
- let timerId;
40
- let lastCallTime;
41
- let lastInvokeTime = 0;
42
- if (typeof func != "function") {
43
- throw new TypeError("Expected a function");
44
- }
45
- function invokeFunc(time) {
46
- const args = lastArgs;
47
- const thisArg = lastThis;
48
- lastArgs = lastThis = void 0;
49
- lastInvokeTime = time;
50
- result = func.apply(options?.context ?? thisArg, args);
51
- return result;
52
- }
53
- function leadingEdge(time) {
54
- lastInvokeTime = time;
55
- timerId = setTimeout(timerExpired, wait);
56
- return leading ? invokeFunc(time) : result;
57
- }
58
- function remainingWait(time) {
59
- const timeSinceLastCall = time - lastCallTime;
60
- const timeSinceLastInvoke = time - lastInvokeTime;
61
- const timeWaiting = wait - timeSinceLastCall;
62
- return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
63
- }
64
- function shouldInvoke(time) {
65
- const timeSinceLastCall = time - lastCallTime;
66
- const timeSinceLastInvoke = time - lastInvokeTime;
67
- return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
68
- }
69
- function timerExpired() {
70
- const time = Date.now();
71
- if (shouldInvoke(time)) {
72
- return trailingEdge(time);
73
- }
74
- timerId = setTimeout(timerExpired, remainingWait(time));
75
- }
76
- function trailingEdge(time) {
77
- timerId = void 0;
78
- if (trailing && lastArgs) {
79
- return invokeFunc(time);
80
- }
81
- lastArgs = lastThis = void 0;
82
- return result;
83
- }
84
- function cancel() {
85
- if (timerId !== void 0) {
86
- clearTimeout(timerId);
87
- }
88
- lastInvokeTime = 0;
89
- lastCallTime = 0;
90
- lastArgs = lastThis = timerId = void 0;
91
- }
92
- function flush() {
93
- return timerId === void 0 ? result : trailingEdge(Date.now());
94
- }
95
- function debounced(...args) {
96
- const time = Date.now();
97
- const isInvoking = shouldInvoke(time);
98
- lastArgs = args;
99
- lastThis = this;
100
- lastCallTime = time;
101
- if (isInvoking) {
102
- if (timerId === void 0) {
103
- return leadingEdge(lastCallTime);
104
- }
105
- if (maxing) {
106
- clearTimeout(timerId);
107
- timerId = setTimeout(timerExpired, wait);
108
- return invokeFunc(lastCallTime);
109
- }
110
- }
111
- if (timerId === void 0) {
112
- timerId = setTimeout(timerExpired, wait);
113
- }
114
- return result;
115
- }
116
- debounced.cancel = cancel;
117
- debounced.flush = flush;
118
- return debounced;
119
- }
120
- function debounceWithArgs(fn, wait, options) {
121
- const memoizedDebouncedFn = memoize(
122
- () => debounce(fn, wait, options),
123
- options
124
- );
125
- return (...args) => {
126
- memoizedDebouncedFn(...args)(...args);
127
- };
128
- }
129
-
130
- function throttle(func, wait, options) {
131
- if (typeof func != "function") {
132
- throw new TypeError("Expected a function");
133
- }
134
- return debounce(func, wait, { ...options, maxWait: wait });
135
- }
136
- function throttleWithArgs(fn, wait, options) {
137
- const memoizedThrottleFn = memoize(
138
- () => debounce(fn, wait, options),
139
- options
140
- );
141
- return (...args) => {
142
- memoizedThrottleFn(...args)(...args);
143
- };
144
- }
145
-
146
- exports.debounce = debounce;
147
- exports.debounceWithArgs = debounceWithArgs;
148
- exports.memoize = memoize;
149
- exports.throttle = throttle;
150
- exports.throttleWithArgs = throttleWithArgs;
@@ -1,10 +0,0 @@
1
- type Func<TArgs extends any[] = any[], TResult = any | void> = (...args: TArgs) => TResult;
2
- type NoReturn<T extends Func> = Func<Parameters<T>, void>;
3
- declare const doNotMemoize: unique symbol;
4
- interface MemoizeOptions<TArgs extends any[], TKey> {
5
- hash?: Func<TArgs, TKey | typeof doNotMemoize>;
6
- context?: any;
7
- }
8
- declare function memoize<TArgs extends any[], TResult, TKey>(originalFunction: Func<TArgs, TResult>, options: MemoizeOptions<TArgs, TKey>): (...args: TArgs) => TResult;
9
-
10
- export { type Func as F, type MemoizeOptions as M, type NoReturn as N, memoize as m };