@smartnet360/svelte-components 0.0.142 → 0.0.143

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 (25) hide show
  1. package/dist/apps/antenna-tools/components/AntennaControls.svelte +14 -6
  2. package/dist/apps/antenna-tools/components/AntennaTools.svelte +6 -5
  3. package/dist/core/Auth/auth.svelte.js +72 -39
  4. package/dist/core/Auth/config.d.ts +1 -0
  5. package/dist/core/Auth/config.js +3 -4
  6. package/dist/map-v3/demo/DemoMap.svelte +3 -1
  7. package/dist/map-v3/features/custom/components/CustomCellSetManager.svelte +105 -10
  8. package/dist/map-v3/features/custom/components/CustomCellSetManager.svelte.d.ts +3 -0
  9. package/dist/map-v3/features/custom/components/ServerSetBrowser.svelte +398 -0
  10. package/dist/map-v3/features/custom/components/ServerSetBrowser.svelte.d.ts +22 -0
  11. package/dist/map-v3/features/custom/components/index.d.ts +1 -0
  12. package/dist/map-v3/features/custom/components/index.js +1 -0
  13. package/dist/map-v3/features/custom/db/custom-sets-api.d.ts +65 -0
  14. package/dist/map-v3/features/custom/db/custom-sets-api.js +220 -0
  15. package/dist/map-v3/features/custom/db/custom-sets-repository.d.ts +77 -0
  16. package/dist/map-v3/features/custom/db/custom-sets-repository.js +195 -0
  17. package/dist/map-v3/features/custom/db/index.d.ts +10 -0
  18. package/dist/map-v3/features/custom/db/index.js +9 -0
  19. package/dist/map-v3/features/custom/db/schema.sql +102 -0
  20. package/dist/map-v3/features/custom/db/types.d.ts +95 -0
  21. package/dist/map-v3/features/custom/db/types.js +95 -0
  22. package/dist/map-v3/features/custom/index.d.ts +2 -0
  23. package/dist/map-v3/features/custom/index.js +2 -0
  24. package/dist/map-v3/features/custom/logic/csv-parser.js +8 -3
  25. package/package.json +1 -1
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Custom Feature - Database Types
3
+ *
4
+ * Types for Oracle database persistence of custom cell sets.
5
+ * Designed for JSON CLOB storage pattern with global sharing.
6
+ */
7
+ import type { CustomCellSet } from '../types';
8
+ /**
9
+ * Database record for a custom cell set
10
+ * Maps to CUSTOM_CELL_SETS Oracle table
11
+ */
12
+ export interface CustomSetDbRecord {
13
+ /** Primary key - UUID or Oracle sequence */
14
+ id: string;
15
+ /** Display name of the set */
16
+ name: string;
17
+ /** JSON string containing serialized CustomCellData */
18
+ data_json: string;
19
+ /** User who created the set (for future ownership filtering) */
20
+ created_by: string;
21
+ /** ISO timestamp of creation */
22
+ created_at: string;
23
+ /** ISO timestamp of last update */
24
+ updated_at: string;
25
+ }
26
+ /**
27
+ * Serializable cell data stored in data_json CLOB
28
+ * Excludes runtime-resolved fields like resolvedCell
29
+ */
30
+ export interface CustomCellSerializable {
31
+ id: string;
32
+ customGroup: string;
33
+ sizeFactor: number;
34
+ extraFields: Record<string, string | number>;
35
+ geometry: 'cell' | 'point';
36
+ lat?: number;
37
+ lon?: number;
38
+ }
39
+ /**
40
+ * Serializable set data stored in data_json CLOB
41
+ * Contains all set metadata and cells
42
+ */
43
+ export interface CustomSetSerializable {
44
+ /** Set metadata */
45
+ name: string;
46
+ groups: string[];
47
+ extraColumns: string[];
48
+ unmatchedTxIds: string[];
49
+ /** Cells (without resolvedCell) */
50
+ cells: CustomCellSerializable[];
51
+ /** Styling settings */
52
+ baseSize: number;
53
+ pointSize: number;
54
+ opacity: number;
55
+ defaultColor: string;
56
+ groupColors: Record<string, string>;
57
+ /** Visible groups as array (Set not serializable) */
58
+ visibleGroups: string[];
59
+ }
60
+ /**
61
+ * Lightweight set info for listing (without full cell data)
62
+ */
63
+ export interface CustomSetListItem {
64
+ id: string;
65
+ name: string;
66
+ created_by: string;
67
+ created_at: string;
68
+ updated_at: string;
69
+ /** Summary info extracted from data_json */
70
+ cellCount?: number;
71
+ pointCount?: number;
72
+ groups?: string[];
73
+ }
74
+ /**
75
+ * API response wrapper
76
+ */
77
+ export interface ApiResponse<T> {
78
+ success: boolean;
79
+ data?: T;
80
+ error?: string;
81
+ }
82
+ /**
83
+ * Serialize a CustomCellSet to database format
84
+ * Strips runtime-only fields (resolvedCell)
85
+ */
86
+ export declare function serializeSet(set: CustomCellSet): CustomSetSerializable;
87
+ /**
88
+ * Deserialize database format to CustomCellSet
89
+ * Creates Set from array, resolvedCell populated later by store
90
+ */
91
+ export declare function deserializeSet(dbRecord: CustomSetDbRecord): CustomCellSet;
92
+ /**
93
+ * Extract summary info from a database record for listing
94
+ */
95
+ export declare function extractListItem(dbRecord: CustomSetDbRecord): CustomSetListItem;
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Custom Feature - Database Types
3
+ *
4
+ * Types for Oracle database persistence of custom cell sets.
5
+ * Designed for JSON CLOB storage pattern with global sharing.
6
+ */
7
+ /**
8
+ * Serialize a CustomCellSet to database format
9
+ * Strips runtime-only fields (resolvedCell)
10
+ */
11
+ export function serializeSet(set) {
12
+ return {
13
+ name: set.name,
14
+ groups: set.groups,
15
+ extraColumns: set.extraColumns,
16
+ unmatchedTxIds: set.unmatchedTxIds,
17
+ cells: set.cells.map(cell => ({
18
+ id: cell.id,
19
+ customGroup: cell.customGroup,
20
+ sizeFactor: cell.sizeFactor,
21
+ extraFields: cell.extraFields,
22
+ geometry: cell.geometry,
23
+ lat: cell.lat,
24
+ lon: cell.lon
25
+ })),
26
+ baseSize: set.baseSize,
27
+ pointSize: set.pointSize,
28
+ opacity: set.opacity,
29
+ defaultColor: set.defaultColor,
30
+ groupColors: set.groupColors,
31
+ visibleGroups: Array.from(set.visibleGroups)
32
+ };
33
+ }
34
+ /**
35
+ * Deserialize database format to CustomCellSet
36
+ * Creates Set from array, resolvedCell populated later by store
37
+ */
38
+ export function deserializeSet(dbRecord) {
39
+ const data = JSON.parse(dbRecord.data_json);
40
+ return {
41
+ id: dbRecord.id,
42
+ name: data.name,
43
+ cells: data.cells.map(cell => ({
44
+ id: cell.id,
45
+ customGroup: cell.customGroup,
46
+ sizeFactor: cell.sizeFactor,
47
+ extraFields: cell.extraFields,
48
+ geometry: cell.geometry,
49
+ lat: cell.lat,
50
+ lon: cell.lon,
51
+ resolvedCell: undefined // Will be resolved by store
52
+ })),
53
+ unmatchedTxIds: data.unmatchedTxIds,
54
+ groups: data.groups,
55
+ extraColumns: data.extraColumns,
56
+ baseSize: data.baseSize,
57
+ pointSize: data.pointSize,
58
+ opacity: data.opacity,
59
+ defaultColor: data.defaultColor,
60
+ groupColors: data.groupColors,
61
+ visible: true, // Default to visible when loading
62
+ visibleGroups: new Set(data.visibleGroups)
63
+ };
64
+ }
65
+ /**
66
+ * Extract summary info from a database record for listing
67
+ */
68
+ export function extractListItem(dbRecord) {
69
+ let cellCount = 0;
70
+ let pointCount = 0;
71
+ let groups = [];
72
+ try {
73
+ const data = JSON.parse(dbRecord.data_json);
74
+ groups = data.groups;
75
+ data.cells.forEach(cell => {
76
+ if (cell.geometry === 'point')
77
+ pointCount++;
78
+ else
79
+ cellCount++;
80
+ });
81
+ }
82
+ catch {
83
+ // Ignore parse errors for list display
84
+ }
85
+ return {
86
+ id: dbRecord.id,
87
+ name: dbRecord.name,
88
+ created_by: dbRecord.created_by,
89
+ created_at: dbRecord.created_at,
90
+ updated_at: dbRecord.updated_at,
91
+ cellCount,
92
+ pointCount,
93
+ groups
94
+ };
95
+ }
@@ -30,3 +30,5 @@ export { CustomCellSetsStore, createCustomCellSetsStore } from './stores';
30
30
  export { CustomCellFilterControl, CustomCellSetManager } from './components';
31
31
  export { CustomCellsLayer } from './layers';
32
32
  export { parseCustomCellsCsv, buildCellLookup, buildCustomCellTree, getGroupCounts } from './logic';
33
+ export { CustomSetsApiClient, createCustomSetsApi, createCustomSetsRepository, serializeSet, deserializeSet, extractListItem, SQL } from './db';
34
+ export type { CustomSetDbRecord, CustomCellSerializable, CustomSetSerializable, CustomSetListItem, ApiResponse, QueryExecutor, CustomSetsRepository } from './db';
@@ -33,3 +33,5 @@ export { CustomCellFilterControl, CustomCellSetManager } from './components';
33
33
  export { CustomCellsLayer } from './layers';
34
34
  // Logic (for advanced usage)
35
35
  export { parseCustomCellsCsv, buildCellLookup, buildCustomCellTree, getGroupCounts } from './logic';
36
+ // Database persistence (optional Oracle integration)
37
+ export { CustomSetsApiClient, createCustomSetsApi, createCustomSetsRepository, serializeSet, deserializeSet, extractListItem, SQL } from './db';
@@ -125,9 +125,14 @@ export function parseCustomCellsCsv(csvContent, cellLookup, delimiter = 'auto')
125
125
  let lon;
126
126
  if (hasLatLon) {
127
127
  // Try to parse lat/lon for point geometry
128
- const parsedLat = parseFloat(values[latIndex]);
129
- const parsedLon = parseFloat(values[lonIndex]);
130
- if (!isNaN(parsedLat) && !isNaN(parsedLon)) {
128
+ // Handle European comma decimals (e.g., "47,4979" → "47.4979")
129
+ const latStr = values[latIndex]?.trim().replace(',', '.') || '';
130
+ const lonStr = values[lonIndex]?.trim().replace(',', '.') || '';
131
+ const parsedLat = parseFloat(latStr);
132
+ const parsedLon = parseFloat(lonStr);
133
+ if (!isNaN(parsedLat) && !isNaN(parsedLon) &&
134
+ parsedLat >= -90 && parsedLat <= 90 &&
135
+ parsedLon >= -180 && parsedLon <= 180) {
131
136
  // Valid coordinates - use point geometry
132
137
  geometry = 'point';
133
138
  lat = parsedLat;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartnet360/svelte-components",
3
- "version": "0.0.142",
3
+ "version": "0.0.143",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",