@bendyline/squisq 0.1.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/Types-sh2VRxfo.d.ts +15 -0
- package/dist/chunk-7UDSRZKG.js +103 -0
- package/dist/chunk-7UDSRZKG.js.map +1 -0
- package/dist/chunk-O5HCIUAD.js +577 -0
- package/dist/chunk-O5HCIUAD.js.map +1 -0
- package/dist/chunk-PJ7AODIM.js +3040 -0
- package/dist/chunk-PJ7AODIM.js.map +1 -0
- package/dist/chunk-QWVRN6I4.js +81 -0
- package/dist/chunk-QWVRN6I4.js.map +1 -0
- package/dist/chunk-S4F2RY37.js +92 -0
- package/dist/chunk-S4F2RY37.js.map +1 -0
- package/dist/chunk-URU6QMLY.js +888 -0
- package/dist/chunk-URU6QMLY.js.map +1 -0
- package/dist/chunk-VJN7UB2Z.js +145 -0
- package/dist/chunk-VJN7UB2Z.js.map +1 -0
- package/dist/doc/index.d.ts +3 -0
- package/dist/doc/index.js +126 -0
- package/dist/doc/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +217 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown/index.d.ts +237 -0
- package/dist/markdown/index.js +33 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/schemas/index.d.ts +70 -0
- package/dist/schemas/index.js +61 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/spatial/index.d.ts +111 -0
- package/dist/spatial/index.js +25 -0
- package/dist/spatial/index.js.map +1 -0
- package/dist/storage/index.d.ts +91 -0
- package/dist/storage/index.js +11 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/story/index.d.ts +691 -0
- package/dist/story/index.js +126 -0
- package/dist/story/index.js.map +1 -0
- package/dist/themeLibrary-DySHPcgj.d.ts +1352 -0
- package/dist/types-DHiv_Pnm.d.ts +496 -0
- package/package.json +91 -0
- package/src/__tests__/animationUtils.test.ts +77 -0
- package/src/__tests__/geohash.test.ts +109 -0
- package/src/__tests__/getLayers.test.ts +200 -0
- package/src/__tests__/haversine.test.ts +63 -0
- package/src/__tests__/localForageAdapter.test.ts +155 -0
- package/src/__tests__/markdown.test.ts +806 -0
- package/src/__tests__/markdownToDoc.test.ts +374 -0
- package/src/__tests__/storage.test.ts +60 -0
- package/src/__tests__/templates.test.ts +247 -0
- package/src/doc/docToMarkdown.ts +98 -0
- package/src/doc/getLayers.ts +152 -0
- package/src/doc/index.ts +8 -0
- package/src/doc/markdownToDoc.ts +277 -0
- package/src/doc/templates/accentImage.ts +338 -0
- package/src/doc/templates/captionUtils.ts +33 -0
- package/src/doc/templates/comparisonBar.ts +140 -0
- package/src/doc/templates/coverBlock.ts +156 -0
- package/src/doc/templates/dateEvent.ts +122 -0
- package/src/doc/templates/definitionCard.ts +129 -0
- package/src/doc/templates/factCard.ts +114 -0
- package/src/doc/templates/fullBleedQuote.ts +59 -0
- package/src/doc/templates/imageWithCaption.ts +167 -0
- package/src/doc/templates/index.ts +571 -0
- package/src/doc/templates/listBlock.ts +101 -0
- package/src/doc/templates/mapBlock.ts +132 -0
- package/src/doc/templates/persistentLayers.ts +522 -0
- package/src/doc/templates/photoGrid.ts +199 -0
- package/src/doc/templates/pullQuote.ts +119 -0
- package/src/doc/templates/quoteBlock.ts +112 -0
- package/src/doc/templates/sectionHeader.ts +105 -0
- package/src/doc/templates/statHighlight.ts +113 -0
- package/src/doc/templates/titleBlock.ts +100 -0
- package/src/doc/templates/twoColumn.ts +239 -0
- package/src/doc/templates/videoPullQuote.ts +128 -0
- package/src/doc/templates/videoWithCaption.ts +126 -0
- package/src/doc/utils/animationUtils.ts +135 -0
- package/src/doc/utils/themeUtils.ts +139 -0
- package/src/index.ts +5 -0
- package/src/markdown/convert.ts +897 -0
- package/src/markdown/htmlParse.ts +212 -0
- package/src/markdown/index.ts +110 -0
- package/src/markdown/parse.ts +103 -0
- package/src/markdown/stringify.ts +122 -0
- package/src/markdown/types.ts +605 -0
- package/src/markdown/utils.ts +165 -0
- package/src/ngeohash.d.ts +11 -0
- package/src/schemas/BlockTemplates.ts +706 -0
- package/src/schemas/Doc.ts +565 -0
- package/src/schemas/LayoutStrategy.ts +178 -0
- package/src/schemas/MediaProvider.ts +70 -0
- package/src/schemas/Theme.ts +235 -0
- package/src/schemas/Types.ts +15 -0
- package/src/schemas/Viewport.ts +91 -0
- package/src/schemas/index.ts +14 -0
- package/src/schemas/themeLibrary.ts +492 -0
- package/src/spatial/Geohash.ts +168 -0
- package/src/spatial/Haversine.ts +59 -0
- package/src/spatial/index.ts +2 -0
- package/src/storage/LocalForageAdapter.ts +103 -0
- package/src/storage/LocalStorageAdapter.ts +57 -0
- package/src/storage/MemoryStorageAdapter.ts +37 -0
- package/src/storage/Storage.ts +28 -0
- package/src/storage/index.ts +5 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { C as Coordinates } from '../Types-sh2VRxfo.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Haversine Distance Calculation
|
|
5
|
+
*
|
|
6
|
+
* Provides accurate distance calculation between two geographic coordinates
|
|
7
|
+
* using the Haversine formula, which accounts for Earth's curvature.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Calculate distance between two coordinates using Haversine formula.
|
|
12
|
+
*
|
|
13
|
+
* @param from Start coordinates
|
|
14
|
+
* @param to End coordinates
|
|
15
|
+
* @returns Distance in kilometers
|
|
16
|
+
*/
|
|
17
|
+
declare function haversineDistance(from: Coordinates, to: Coordinates): number;
|
|
18
|
+
/**
|
|
19
|
+
* Calculate bearing from one coordinate to another.
|
|
20
|
+
*
|
|
21
|
+
* @param from Start coordinates
|
|
22
|
+
* @param to End coordinates
|
|
23
|
+
* @returns Bearing in degrees (0-360, where 0 = north, 90 = east)
|
|
24
|
+
*/
|
|
25
|
+
declare function calculateBearing(from: Coordinates, to: Coordinates): number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Geohash Utilities
|
|
29
|
+
*
|
|
30
|
+
* Provides geohash encoding/decoding and spatial utilities using the standard
|
|
31
|
+
* ngeohash library for core operations, plus custom utilities for overlap checking
|
|
32
|
+
* and distance calculation.
|
|
33
|
+
*
|
|
34
|
+
* Geohashes are a hierarchical spatial indexing system that divides the world
|
|
35
|
+
* into a grid of cells. Each additional character narrows the area by ~1/32.
|
|
36
|
+
*
|
|
37
|
+
* Precision guide:
|
|
38
|
+
* - 4 chars: ~39km x 19km (used for tile indexing)
|
|
39
|
+
* - 5 chars: ~5km x 5km
|
|
40
|
+
* - 6 chars: ~1.2km x 0.6km
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Encode latitude/longitude to a geohash string.
|
|
44
|
+
* Uses the standard ngeohash library.
|
|
45
|
+
*/
|
|
46
|
+
declare function encodeGeohash(lat: number, lng: number, precision?: number): string;
|
|
47
|
+
/**
|
|
48
|
+
* Decode a geohash to latitude/longitude center with error bounds.
|
|
49
|
+
* Uses the standard ngeohash library.
|
|
50
|
+
*/
|
|
51
|
+
declare function decodeGeohash(hash: string): {
|
|
52
|
+
lat: number;
|
|
53
|
+
lng: number;
|
|
54
|
+
latErr: number;
|
|
55
|
+
lngErr: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Get the 8 neighboring geohash cells.
|
|
59
|
+
* Returns up to 8 neighbors (fewer at poles or antimeridian).
|
|
60
|
+
* Uses the standard ngeohash library.
|
|
61
|
+
*/
|
|
62
|
+
declare function getNeighbors(hash: string): string[];
|
|
63
|
+
/**
|
|
64
|
+
* Get a 3x3 grid of geohash4 cells (center + 8 neighbors).
|
|
65
|
+
* Used for landing bonus expansions in Fly mode.
|
|
66
|
+
*
|
|
67
|
+
* @param geohash4 - Center geohash4 cell
|
|
68
|
+
* @returns Array of 9 geohash4 cells (center first, then neighbors)
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* getGeohash4Neighbors('c23n')
|
|
72
|
+
* // => ['c23n', 'c23p', 'c23q', 'c23j', 'c23m', 'c23k', 'c23h', 'c23e', 'c23s']
|
|
73
|
+
*/
|
|
74
|
+
declare function getGeohash4Neighbors(geohash4: string): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Get the prefix of a geohash at a given precision.
|
|
77
|
+
* Simple helper for extracting geohash prefixes for directory organization.
|
|
78
|
+
*/
|
|
79
|
+
declare function getGeohashPrefix(geohash: string, precision: number): string;
|
|
80
|
+
/**
|
|
81
|
+
* Convert a geohash prefix to a hierarchical path.
|
|
82
|
+
*
|
|
83
|
+
* Examples:
|
|
84
|
+
* "9mud" -> "9/m/u/d"
|
|
85
|
+
* "9q8y" -> "9/q/8/y"
|
|
86
|
+
* "c24k" -> "c/2/4/k"
|
|
87
|
+
*
|
|
88
|
+
* This is used for organizing files in hierarchical directories to avoid
|
|
89
|
+
* thousands of folders in a single directory, which causes filesystem
|
|
90
|
+
* performance issues.
|
|
91
|
+
*/
|
|
92
|
+
declare function geohashToHierarchicalPath(geohash4: string): string;
|
|
93
|
+
/**
|
|
94
|
+
* Compute all geohash cells along the path between two geohash cells.
|
|
95
|
+
* Interpolates lat/lng points between the centers of `from` and `to`,
|
|
96
|
+
* encoding each to a geohash at the given precision, and returns the
|
|
97
|
+
* deduplicated list of intermediate cells (excluding `from` and `to`).
|
|
98
|
+
*/
|
|
99
|
+
declare function getGeohashPath(from: string, to: string, precision?: number): string[];
|
|
100
|
+
/**
|
|
101
|
+
* Check if a geohash cell overlaps with a bounding box.
|
|
102
|
+
* Custom implementation (not available in ngeohash).
|
|
103
|
+
*/
|
|
104
|
+
declare function geohashOverlapsBounds(hash: string, bounds: {
|
|
105
|
+
north: number;
|
|
106
|
+
south: number;
|
|
107
|
+
east: number;
|
|
108
|
+
west: number;
|
|
109
|
+
}): boolean;
|
|
110
|
+
|
|
111
|
+
export { calculateBearing, decodeGeohash, encodeGeohash, geohashOverlapsBounds, geohashToHierarchicalPath, getGeohash4Neighbors, getGeohashPath, getGeohashPrefix, getNeighbors, haversineDistance };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
calculateBearing,
|
|
3
|
+
decodeGeohash,
|
|
4
|
+
encodeGeohash,
|
|
5
|
+
geohashOverlapsBounds,
|
|
6
|
+
geohashToHierarchicalPath,
|
|
7
|
+
getGeohash4Neighbors,
|
|
8
|
+
getGeohashPath,
|
|
9
|
+
getGeohashPrefix,
|
|
10
|
+
getNeighbors,
|
|
11
|
+
haversineDistance
|
|
12
|
+
} from "../chunk-7UDSRZKG.js";
|
|
13
|
+
export {
|
|
14
|
+
calculateBearing,
|
|
15
|
+
decodeGeohash,
|
|
16
|
+
encodeGeohash,
|
|
17
|
+
geohashOverlapsBounds,
|
|
18
|
+
geohashToHierarchicalPath,
|
|
19
|
+
getGeohash4Neighbors,
|
|
20
|
+
getGeohashPath,
|
|
21
|
+
getGeohashPrefix,
|
|
22
|
+
getNeighbors,
|
|
23
|
+
haversineDistance
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage - Abstract persistence interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for persistent storage across different environments.
|
|
5
|
+
* All values are JSON-serialized, so any serializable value can be stored.
|
|
6
|
+
* Keys can be automatically namespaced with a configurable prefix.
|
|
7
|
+
*/
|
|
8
|
+
/** Storage adapter interface - implemented by environment-specific adapters */
|
|
9
|
+
interface StorageAdapter {
|
|
10
|
+
/** Get a value by key, returns null if not found */
|
|
11
|
+
get<T>(key: string): Promise<T | null>;
|
|
12
|
+
/** Set a value for a key */
|
|
13
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
14
|
+
/** Remove a value by key */
|
|
15
|
+
remove(key: string): Promise<void>;
|
|
16
|
+
/** Clear all stored values (within our namespace) */
|
|
17
|
+
clear(): Promise<void>;
|
|
18
|
+
/** Get all keys (within our namespace) */
|
|
19
|
+
keys(): Promise<string[]>;
|
|
20
|
+
/** Check if this adapter supports enumeration */
|
|
21
|
+
readonly supportsEnumeration: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* In-memory storage adapter for testing and SSR environments.
|
|
26
|
+
* Data does not persist across page reloads.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
declare class MemoryStorageAdapter implements StorageAdapter {
|
|
30
|
+
readonly supportsEnumeration = true;
|
|
31
|
+
private store;
|
|
32
|
+
get<T>(key: string): Promise<T | null>;
|
|
33
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
34
|
+
remove(key: string): Promise<void>;
|
|
35
|
+
clear(): Promise<void>;
|
|
36
|
+
keys(): Promise<string[]>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* localStorage adapter for web browsers.
|
|
41
|
+
* Supports a configurable key prefix to namespace stored data.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
declare class LocalStorageAdapter implements StorageAdapter {
|
|
45
|
+
readonly supportsEnumeration = true;
|
|
46
|
+
private prefix;
|
|
47
|
+
constructor(prefix?: string);
|
|
48
|
+
get<T>(key: string): Promise<T | null>;
|
|
49
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
50
|
+
remove(key: string): Promise<void>;
|
|
51
|
+
clear(): Promise<void>;
|
|
52
|
+
keys(): Promise<string[]>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* LocalForage adapter - IndexedDB storage with automatic fallbacks.
|
|
57
|
+
*
|
|
58
|
+
* Uses localforage which provides IndexedDB storage with automatic
|
|
59
|
+
* fallbacks to WebSQL and localStorage. This allows storing much more
|
|
60
|
+
* data than raw localStorage (which is limited to ~5MB).
|
|
61
|
+
*
|
|
62
|
+
* Unlike LocalStorageAdapter, this adapter can store binary data
|
|
63
|
+
* (ArrayBuffer, Blob, Uint8Array) natively without JSON serialization.
|
|
64
|
+
*
|
|
65
|
+
* Ported from qualla-internal/shared/services/StorageAdapters.ts with
|
|
66
|
+
* configurable store name and key prefix.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
interface LocalForageAdapterOptions {
|
|
70
|
+
/** IndexedDB database name (default: 'squisq') */
|
|
71
|
+
name?: string;
|
|
72
|
+
/** IndexedDB object store name (default: 'data') */
|
|
73
|
+
storeName?: string;
|
|
74
|
+
/** Key prefix for namespacing (default: '') */
|
|
75
|
+
prefix?: string;
|
|
76
|
+
/** Human-readable description (default: 'Squisq storage') */
|
|
77
|
+
description?: string;
|
|
78
|
+
}
|
|
79
|
+
declare class LocalForageAdapter implements StorageAdapter {
|
|
80
|
+
readonly supportsEnumeration = true;
|
|
81
|
+
private store;
|
|
82
|
+
private prefix;
|
|
83
|
+
constructor(options?: LocalForageAdapterOptions);
|
|
84
|
+
get<T>(key: string): Promise<T | null>;
|
|
85
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
86
|
+
remove(key: string): Promise<void>;
|
|
87
|
+
clear(): Promise<void>;
|
|
88
|
+
keys(): Promise<string[]>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { LocalForageAdapter, type LocalForageAdapterOptions, LocalStorageAdapter, MemoryStorageAdapter, type StorageAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|