@smartnet360/svelte-components 0.0.72 → 0.0.74
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/map-v2/demo/index.d.ts +1 -0
- package/dist/map-v2/demo/index.js +1 -0
- package/dist/map-v2/features/cells/stores/cellStoreContext.svelte.js +16 -4
- package/dist/map-v2/features/repeaters/index.d.ts +5 -2
- package/dist/map-v2/features/repeaters/index.js +5 -2
- package/dist/map-v2/features/repeaters/stores/repeaterStoreContext.svelte.js +17 -4
- package/dist/map-v2/index.d.ts +2 -1
- package/dist/map-v2/index.js +5 -1
- package/package.json +1 -1
|
@@ -74,10 +74,22 @@ export function createCellStoreContext(cells) {
|
|
|
74
74
|
});
|
|
75
75
|
// Derived: Filter cells by status based on includePlannedCells flag
|
|
76
76
|
// IMPORTANT: This is a pure $derived - it only READS from state, never writes
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
// Memoized to avoid re-filtering when cells array reference hasn't changed
|
|
78
|
+
let lastCellsRef = null;
|
|
79
|
+
let lastIncludePlanned = null;
|
|
80
|
+
let cachedFilteredCells = [];
|
|
81
|
+
let cellsFilteredByStatus = $derived.by(() => {
|
|
82
|
+
// Only recompute if cells reference or flag changed
|
|
83
|
+
if (state.cells === lastCellsRef && state.includePlannedCells === lastIncludePlanned) {
|
|
84
|
+
return cachedFilteredCells;
|
|
85
|
+
}
|
|
86
|
+
lastCellsRef = state.cells;
|
|
87
|
+
lastIncludePlanned = state.includePlannedCells;
|
|
88
|
+
cachedFilteredCells = state.includePlannedCells
|
|
89
|
+
? state.cells // Include all cells
|
|
90
|
+
: state.cells.filter(cell => cell.status.startsWith('On_Air')); // Only On Air cells
|
|
91
|
+
return cachedFilteredCells;
|
|
92
|
+
});
|
|
81
93
|
// Auto-save settings when they change
|
|
82
94
|
$effect(() => {
|
|
83
95
|
// Convert Map to plain object for serialization
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* Barrel export for all public-facing repeater functionality
|
|
5
5
|
*/
|
|
6
6
|
export type { Repeater, RepeaterTreeNode } from './types';
|
|
7
|
+
export type { RepeaterStoreValue, RepeaterStoreContext } from './stores/repeaterStoreContext.svelte';
|
|
7
8
|
export { createRepeaterStoreContext } from './stores/repeaterStoreContext.svelte';
|
|
8
|
-
export type { RepeaterStoreContext, RepeaterStoreValue } from './stores/repeaterStoreContext.svelte';
|
|
9
9
|
export { default as RepeatersLayer } from './layers/RepeatersLayer.svelte';
|
|
10
10
|
export { default as RepeaterLabelsLayer } from './layers/RepeaterLabelsLayer.svelte';
|
|
11
11
|
export { default as RepeaterFilterControl } from './controls/RepeaterFilterControl.svelte';
|
|
12
|
-
export { REPEATER_FILL_Z_INDEX, REPEATER_LINE_Z_INDEX, REPEATER_LABEL_Z_INDEX } from './constants/zIndex';
|
|
13
12
|
export { repeatersToGeoJSON } from './utils/repeaterGeoJSON';
|
|
13
|
+
export { buildRepeaterTree, getFilteredRepeaters } from './utils/repeaterTree';
|
|
14
|
+
export { REPEATER_FILL_Z_INDEX, REPEATER_LINE_Z_INDEX, REPEATER_LABEL_Z_INDEX } from './constants/zIndex';
|
|
15
|
+
export { REPEATER_RADIUS_MULTIPLIER, getRepeaterRadiusMultiplier } from './constants/radiusMultipliers';
|
|
16
|
+
export { REPEATER_TECH_BAND_Z_ORDER, getRepeaterZOrder } from './constants/techBandZOrder';
|
|
@@ -10,7 +10,10 @@ export { default as RepeatersLayer } from './layers/RepeatersLayer.svelte';
|
|
|
10
10
|
export { default as RepeaterLabelsLayer } from './layers/RepeaterLabelsLayer.svelte';
|
|
11
11
|
// Controls
|
|
12
12
|
export { default as RepeaterFilterControl } from './controls/RepeaterFilterControl.svelte';
|
|
13
|
-
// Constants
|
|
14
|
-
export { REPEATER_FILL_Z_INDEX, REPEATER_LINE_Z_INDEX, REPEATER_LABEL_Z_INDEX } from './constants/zIndex';
|
|
15
13
|
// Utilities
|
|
16
14
|
export { repeatersToGeoJSON } from './utils/repeaterGeoJSON';
|
|
15
|
+
export { buildRepeaterTree, getFilteredRepeaters } from './utils/repeaterTree';
|
|
16
|
+
// Constants
|
|
17
|
+
export { REPEATER_FILL_Z_INDEX, REPEATER_LINE_Z_INDEX, REPEATER_LABEL_Z_INDEX } from './constants/zIndex';
|
|
18
|
+
export { REPEATER_RADIUS_MULTIPLIER, getRepeaterRadiusMultiplier } from './constants/radiusMultipliers';
|
|
19
|
+
export { REPEATER_TECH_BAND_Z_ORDER, getRepeaterZOrder } from './constants/techBandZOrder';
|
|
@@ -90,10 +90,23 @@ export function createRepeaterStoreContext(repeaters) {
|
|
|
90
90
|
minLabelZoom: persistedSettings.minLabelZoom ?? 10 // Lower default to show labels at more zoom levels
|
|
91
91
|
});
|
|
92
92
|
// Derived: Filter repeaters by visible tech:fband combinations
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
// Memoized to avoid re-filtering when repeaters array or visibleTechBands haven't changed
|
|
94
|
+
let lastRepeatersRef = null;
|
|
95
|
+
let lastVisibleTechBands = null;
|
|
96
|
+
let cachedFilteredRepeaters = [];
|
|
97
|
+
let filteredRepeaters = $derived.by(() => {
|
|
98
|
+
// Only recompute if repeaters reference or visible tech bands changed
|
|
99
|
+
if (state.repeaters === lastRepeatersRef && state.visibleTechBands === lastVisibleTechBands) {
|
|
100
|
+
return cachedFilteredRepeaters;
|
|
101
|
+
}
|
|
102
|
+
lastRepeatersRef = state.repeaters;
|
|
103
|
+
lastVisibleTechBands = state.visibleTechBands;
|
|
104
|
+
cachedFilteredRepeaters = state.repeaters.filter(r => {
|
|
105
|
+
const key = `${r.tech}:${r.fband}`;
|
|
106
|
+
return state.visibleTechBands.has(key);
|
|
107
|
+
});
|
|
108
|
+
return cachedFilteredRepeaters;
|
|
109
|
+
});
|
|
97
110
|
// Auto-save settings when they change
|
|
98
111
|
$effect(() => {
|
|
99
112
|
// Convert Set to Array and Map to Object for serialization
|
package/dist/map-v2/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export { type MapStore, MAP_CONTEXT_KEY, MapboxProvider, ViewportSync, MapStoreB
|
|
|
8
8
|
export { MapControl, FeatureSettingsControl, addSourceIfMissing, removeSourceIfExists, addLayerIfMissing, removeLayerIfExists, updateGeoJSONSource, removeLayerAndSource, isStyleLoaded, waitForStyleLoad, setFeatureState, removeFeatureState, generateLayerId, generateSourceId } from './shared';
|
|
9
9
|
export { type Site, type SiteStoreValue, type SiteStoreContext, createSiteStore, createSiteStoreContext, SitesLayer, SiteFilterControl, SiteSelectionControl, SiteSizeSlider, sitesToGeoJSON, siteToFeature, buildSiteTree, getFilteredSites } from './features/sites';
|
|
10
10
|
export { type Cell, type CellStatus, type CellStatusStyle, type CellGroupingField, type CellGroupingLabels, type CellTreeConfig, type TechnologyBandKey, type CellStoreValue, type CellStoreContext, createCellStoreContext, CellsLayer, CellLabelsLayer, CellFilterControl, CellStyleControl, cellsToGeoJSON, buildCellTree, getFilteredCells, calculateRadius, getZoomFactor, createArcPolygon, DEFAULT_CELL_TREE_CONFIG, TECHNOLOGY_BAND_COLORS, DEFAULT_STATUS_STYLES, RADIUS_MULTIPLIER } from './features/cells';
|
|
11
|
-
export {
|
|
11
|
+
export { type Repeater, type RepeaterTreeNode, type RepeaterStoreValue, type RepeaterStoreContext, createRepeaterStoreContext, RepeatersLayer, RepeaterLabelsLayer, RepeaterFilterControl, repeatersToGeoJSON, buildRepeaterTree, getFilteredRepeaters, getRepeaterRadiusMultiplier, getRepeaterZOrder, REPEATER_FILL_Z_INDEX, REPEATER_LINE_Z_INDEX, REPEATER_LABEL_Z_INDEX, REPEATER_RADIUS_MULTIPLIER, REPEATER_TECH_BAND_Z_ORDER } from './features/repeaters';
|
|
12
|
+
export { DemoMap, demoSites, demoCells, demoRepeaters } from './demo';
|
package/dist/map-v2/index.js
CHANGED
|
@@ -21,6 +21,10 @@ export { createSiteStore, createSiteStoreContext, SitesLayer, SiteFilterControl,
|
|
|
21
21
|
// ============================================================================
|
|
22
22
|
export { createCellStoreContext, CellsLayer, CellLabelsLayer, CellFilterControl, CellStyleControl, cellsToGeoJSON, buildCellTree, getFilteredCells, calculateRadius, getZoomFactor, createArcPolygon, DEFAULT_CELL_TREE_CONFIG, TECHNOLOGY_BAND_COLORS, DEFAULT_STATUS_STYLES, RADIUS_MULTIPLIER } from './features/cells';
|
|
23
23
|
// ============================================================================
|
|
24
|
+
// REPEATER FEATURE
|
|
25
|
+
// ============================================================================
|
|
26
|
+
export { createRepeaterStoreContext, RepeatersLayer, RepeaterLabelsLayer, RepeaterFilterControl, repeatersToGeoJSON, buildRepeaterTree, getFilteredRepeaters, getRepeaterRadiusMultiplier, getRepeaterZOrder, REPEATER_FILL_Z_INDEX, REPEATER_LINE_Z_INDEX, REPEATER_LABEL_Z_INDEX, REPEATER_RADIUS_MULTIPLIER, REPEATER_TECH_BAND_Z_ORDER } from './features/repeaters';
|
|
27
|
+
// ============================================================================
|
|
24
28
|
// DEMO
|
|
25
29
|
// ============================================================================
|
|
26
|
-
export { DemoMap, demoSites, demoCells } from './demo';
|
|
30
|
+
export { DemoMap, demoSites, demoCells, demoRepeaters } from './demo';
|