@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.
Files changed (102) hide show
  1. package/dist/Types-sh2VRxfo.d.ts +15 -0
  2. package/dist/chunk-7UDSRZKG.js +103 -0
  3. package/dist/chunk-7UDSRZKG.js.map +1 -0
  4. package/dist/chunk-O5HCIUAD.js +577 -0
  5. package/dist/chunk-O5HCIUAD.js.map +1 -0
  6. package/dist/chunk-PJ7AODIM.js +3040 -0
  7. package/dist/chunk-PJ7AODIM.js.map +1 -0
  8. package/dist/chunk-QWVRN6I4.js +81 -0
  9. package/dist/chunk-QWVRN6I4.js.map +1 -0
  10. package/dist/chunk-S4F2RY37.js +92 -0
  11. package/dist/chunk-S4F2RY37.js.map +1 -0
  12. package/dist/chunk-URU6QMLY.js +888 -0
  13. package/dist/chunk-URU6QMLY.js.map +1 -0
  14. package/dist/chunk-VJN7UB2Z.js +145 -0
  15. package/dist/chunk-VJN7UB2Z.js.map +1 -0
  16. package/dist/doc/index.d.ts +3 -0
  17. package/dist/doc/index.js +126 -0
  18. package/dist/doc/index.js.map +1 -0
  19. package/dist/index.d.ts +8 -0
  20. package/dist/index.js +217 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/markdown/index.d.ts +237 -0
  23. package/dist/markdown/index.js +33 -0
  24. package/dist/markdown/index.js.map +1 -0
  25. package/dist/schemas/index.d.ts +70 -0
  26. package/dist/schemas/index.js +61 -0
  27. package/dist/schemas/index.js.map +1 -0
  28. package/dist/spatial/index.d.ts +111 -0
  29. package/dist/spatial/index.js +25 -0
  30. package/dist/spatial/index.js.map +1 -0
  31. package/dist/storage/index.d.ts +91 -0
  32. package/dist/storage/index.js +11 -0
  33. package/dist/storage/index.js.map +1 -0
  34. package/dist/story/index.d.ts +691 -0
  35. package/dist/story/index.js +126 -0
  36. package/dist/story/index.js.map +1 -0
  37. package/dist/themeLibrary-DySHPcgj.d.ts +1352 -0
  38. package/dist/types-DHiv_Pnm.d.ts +496 -0
  39. package/package.json +91 -0
  40. package/src/__tests__/animationUtils.test.ts +77 -0
  41. package/src/__tests__/geohash.test.ts +109 -0
  42. package/src/__tests__/getLayers.test.ts +200 -0
  43. package/src/__tests__/haversine.test.ts +63 -0
  44. package/src/__tests__/localForageAdapter.test.ts +155 -0
  45. package/src/__tests__/markdown.test.ts +806 -0
  46. package/src/__tests__/markdownToDoc.test.ts +374 -0
  47. package/src/__tests__/storage.test.ts +60 -0
  48. package/src/__tests__/templates.test.ts +247 -0
  49. package/src/doc/docToMarkdown.ts +98 -0
  50. package/src/doc/getLayers.ts +152 -0
  51. package/src/doc/index.ts +8 -0
  52. package/src/doc/markdownToDoc.ts +277 -0
  53. package/src/doc/templates/accentImage.ts +338 -0
  54. package/src/doc/templates/captionUtils.ts +33 -0
  55. package/src/doc/templates/comparisonBar.ts +140 -0
  56. package/src/doc/templates/coverBlock.ts +156 -0
  57. package/src/doc/templates/dateEvent.ts +122 -0
  58. package/src/doc/templates/definitionCard.ts +129 -0
  59. package/src/doc/templates/factCard.ts +114 -0
  60. package/src/doc/templates/fullBleedQuote.ts +59 -0
  61. package/src/doc/templates/imageWithCaption.ts +167 -0
  62. package/src/doc/templates/index.ts +571 -0
  63. package/src/doc/templates/listBlock.ts +101 -0
  64. package/src/doc/templates/mapBlock.ts +132 -0
  65. package/src/doc/templates/persistentLayers.ts +522 -0
  66. package/src/doc/templates/photoGrid.ts +199 -0
  67. package/src/doc/templates/pullQuote.ts +119 -0
  68. package/src/doc/templates/quoteBlock.ts +112 -0
  69. package/src/doc/templates/sectionHeader.ts +105 -0
  70. package/src/doc/templates/statHighlight.ts +113 -0
  71. package/src/doc/templates/titleBlock.ts +100 -0
  72. package/src/doc/templates/twoColumn.ts +239 -0
  73. package/src/doc/templates/videoPullQuote.ts +128 -0
  74. package/src/doc/templates/videoWithCaption.ts +126 -0
  75. package/src/doc/utils/animationUtils.ts +135 -0
  76. package/src/doc/utils/themeUtils.ts +139 -0
  77. package/src/index.ts +5 -0
  78. package/src/markdown/convert.ts +897 -0
  79. package/src/markdown/htmlParse.ts +212 -0
  80. package/src/markdown/index.ts +110 -0
  81. package/src/markdown/parse.ts +103 -0
  82. package/src/markdown/stringify.ts +122 -0
  83. package/src/markdown/types.ts +605 -0
  84. package/src/markdown/utils.ts +165 -0
  85. package/src/ngeohash.d.ts +11 -0
  86. package/src/schemas/BlockTemplates.ts +706 -0
  87. package/src/schemas/Doc.ts +565 -0
  88. package/src/schemas/LayoutStrategy.ts +178 -0
  89. package/src/schemas/MediaProvider.ts +70 -0
  90. package/src/schemas/Theme.ts +235 -0
  91. package/src/schemas/Types.ts +15 -0
  92. package/src/schemas/Viewport.ts +91 -0
  93. package/src/schemas/index.ts +14 -0
  94. package/src/schemas/themeLibrary.ts +492 -0
  95. package/src/spatial/Geohash.ts +168 -0
  96. package/src/spatial/Haversine.ts +59 -0
  97. package/src/spatial/index.ts +2 -0
  98. package/src/storage/LocalForageAdapter.ts +103 -0
  99. package/src/storage/LocalStorageAdapter.ts +57 -0
  100. package/src/storage/MemoryStorageAdapter.ts +37 -0
  101. package/src/storage/Storage.ts +28 -0
  102. 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,11 @@
1
+ import {
2
+ LocalForageAdapter,
3
+ LocalStorageAdapter,
4
+ MemoryStorageAdapter
5
+ } from "../chunk-VJN7UB2Z.js";
6
+ export {
7
+ LocalForageAdapter,
8
+ LocalStorageAdapter,
9
+ MemoryStorageAdapter
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}