Add progressive web app companion for cross-platform access

Vite + TypeScript PWA that mirrors the Android app's core features:
- Pre-processed shelter data (build-time UTM33N→WGS84 conversion)
- Leaflet map with shelter markers, user location, and offline tiles
- Canvas compass arrow (ported from DirectionArrowView.kt)
- IndexedDB shelter cache with 7-day staleness check
- Service worker with CacheFirst tiles and precached app shell
- i18n for en, nb, nn (ported from Android strings.xml)
- iOS/Android compass handling with low-pass filter
- Respects user map interaction (no auto-snap on pan/zoom)
- Build revision cache-breaker for reliable SW updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-03-08 17:41:38 +01:00
commit e8428de775
12051 changed files with 1799735 additions and 0 deletions

58
pwa/node_modules/ajv/lib/vocabularies/jtd/values.ts generated vendored Normal file
View file

@ -0,0 +1,58 @@
import type {CodeKeywordDefinition, SchemaObject} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {alwaysValidSchema, Type} from "../../compile/util"
import {not, or, Name} from "../../compile/codegen"
import {checkMetadata} from "./metadata"
import {checkNullableObject} from "./nullable"
import {typeError, _JTDTypeError} from "./error"
export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>
const def: CodeKeywordDefinition = {
keyword: "values",
schemaType: "object",
error: typeError("object"),
code(cxt: KeywordCxt) {
checkMetadata(cxt)
const {gen, data, schema, it} = cxt
const [valid, cond] = checkNullableObject(cxt, data)
if (alwaysValidSchema(it, schema)) {
gen.if(not(or(cond, valid)), () => cxt.error())
} else {
gen.if(cond)
gen.assign(valid, validateMap())
gen.elseIf(not(valid))
cxt.error()
gen.endIf()
}
cxt.ok(valid)
function validateMap(): Name | boolean {
const _valid = gen.name("valid")
if (it.allErrors) {
const validMap = gen.let("valid", true)
validateValues(() => gen.assign(validMap, false))
return validMap
}
gen.var(_valid, true)
validateValues(() => gen.break())
return _valid
function validateValues(notValid: () => void): void {
gen.forIn("key", data, (key) => {
cxt.subschema(
{
keyword: "values",
dataProp: key,
dataPropType: Type.Str,
},
_valid
)
gen.if(not(_valid), notValid)
})
}
}
},
}
export default def