@innspel/react-native 0.4.1 → 0.5.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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/InnspelProvider.tsx
2
- import { createContext as createContext3, useCallback as useCallback3, useContext as useContext3, useMemo as useMemo3, useRef as useRef3, useState as useState4 } from "react";
2
+ import { createContext as createContext3, useCallback as useCallback3, useContext as useContext4, useMemo as useMemo3, useRef as useRef3, useState as useState4 } from "react";
3
3
  import { View as View9 } from "react-native";
4
4
 
5
5
  // src/skjermbilde.ts
@@ -102,6 +102,7 @@ var t = {
102
102
  pill: 999
103
103
  },
104
104
  font: {
105
+ display: 40,
105
106
  h1: 24,
106
107
  h2: 21,
107
108
  h3: 18,
@@ -110,6 +111,7 @@ var t = {
110
111
  tiny: 11
111
112
  },
112
113
  lineHeight: {
114
+ display: 48,
113
115
  h1: 30,
114
116
  h2: 27,
115
117
  h3: 24,
@@ -128,6 +130,7 @@ var t = {
128
130
  base: 200,
129
131
  slow: 320
130
132
  },
133
+ icon: { inline: 20, minste: 16 },
131
134
  touch: 48,
132
135
  screenPadding: 24,
133
136
  hairline: 1
@@ -186,6 +189,7 @@ var light = {
186
189
  pill: 999
187
190
  },
188
191
  font: {
192
+ display: 40,
189
193
  h1: 24,
190
194
  h2: 21,
191
195
  h3: 18,
@@ -194,6 +198,7 @@ var light = {
194
198
  tiny: 11
195
199
  },
196
200
  lineHeight: {
201
+ display: 48,
197
202
  h1: 30,
198
203
  h2: 27,
199
204
  h3: 24,
@@ -212,6 +217,7 @@ var light = {
212
217
  base: 200,
213
218
  slow: 320
214
219
  },
220
+ icon: { inline: 20, minste: 16 },
215
221
  touch: 48,
216
222
  screenPadding: 24,
217
223
  hairline: 1
@@ -246,12 +252,13 @@ import {
246
252
  InnspelApiError,
247
253
  InnspelQueueFullError
248
254
  } from "@innspel/core";
249
- import { useCallback as useCallback2, useEffect, useRef as useRef2, useState as useState3 } from "react";
250
- import { Modal, Pressable as Pressable5, Text as Text8, View as View8 } from "react-native";
255
+ import { useCallback as useCallback2, useContext as useContext3, useEffect, useRef as useRef2, useState as useState3 } from "react";
256
+ import { KeyboardAvoidingView, Modal, Pressable as Pressable5, Text as Text8, View as View8 } from "react-native";
257
+ import { initialWindowMetrics, SafeAreaInsetsContext } from "react-native-safe-area-context";
251
258
 
252
259
  // src/widget/Felt.tsx
253
260
  import { useMemo, useState } from "react";
254
- import { Pressable as Pressable2, Text as Text2, TextInput, View as View2 } from "react-native";
261
+ import { Pressable as Pressable2, ScrollView, Text as Text2, TextInput, View as View2 } from "react-native";
255
262
 
256
263
  // src/widget/primitiver.tsx
257
264
  import "react";
@@ -468,7 +475,13 @@ var tekst = {
468
475
  rettesI: (versjon) => `Rettes i ${versjon}`,
469
476
  rettetI: (versjon) => `Rettet i ${versjon}`,
470
477
  // 2d + 2e — feltet og kontekstlinja
471
- feltLabelFeil: "Din feil",
478
+ /**
479
+ * «Ditt innspill», ikke «Din feil» (DD-54). «Din» festet saken til personen, og
480
+ * «feil» karakteriserte den før noen hadde lest den — innsenderen leste det som
481
+ * skyld. Ønskesporet beholder «Ditt ønske»: et ønske er ingen feil, og der finnes
482
+ * ikke problemet. De to står aldri ved siden av hverandre; sporet velges før dette.
483
+ */
484
+ feltLabelFeil: "Ditt innspill",
472
485
  feltLabelOnske: "Ditt \xF8nske",
473
486
  /** DD-45: to spørsmål i feilsporet. Kilde: Sentry «What's the bug? What did you expect?» */
474
487
  placeholderFeil: "Hva skjedde? Hva forventet du?",
@@ -667,229 +680,240 @@ function Felt({
667
680
  return verdi2 && !fjernedeFelter.includes(felt) ? { felt, etikett, verdi: verdi2 } : null;
668
681
  }).filter((x) => x !== null);
669
682
  }, [kontekst, fjernedeFelter]);
670
- return /* @__PURE__ */ jsxs2(View2, { style: { flex: 1, gap: tema.space.md }, children: [
671
- lenketTil ? /* @__PURE__ */ jsxs2(
672
- View2,
683
+ return /* @__PURE__ */ jsxs2(View2, { testID: "skjema", style: { flexGrow: 1, flexShrink: 1, gap: tema.space.md }, children: [
684
+ /* @__PURE__ */ jsxs2(
685
+ ScrollView,
673
686
  {
674
- style: {
675
- flexDirection: "row",
676
- alignItems: "center",
677
- gap: tema.space.sm,
678
- minHeight: tema.touch,
679
- borderWidth: tema.hairline,
680
- borderColor: tema.color.borderInteractive,
681
- borderRadius: tema.radius.pill,
682
- paddingLeft: tema.space.md,
683
- paddingRight: tema.space.xs
684
- },
687
+ testID: "skjema-kropp",
688
+ style: { flexGrow: 0, flexShrink: 1 },
689
+ contentContainerStyle: { gap: tema.space.md },
690
+ keyboardShouldPersistTaps: "handled",
685
691
  children: [
686
- /* @__PURE__ */ jsx2(Text2, { style: { flex: 1, color: tema.color.textPrimary, fontSize: tema.font.small }, children: tekst.lenketTil(lenketTil.title) }),
687
- /* @__PURE__ */ jsx2(
688
- Pressable2,
692
+ lenketTil ? /* @__PURE__ */ jsxs2(
693
+ View2,
689
694
  {
690
- testID: "fjern-lenke",
691
- accessibilityRole: "button",
692
- accessibilityLabel: tekst.fjernLenke,
693
- onPress: onFjernLenke,
694
- style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
695
- children: /* @__PURE__ */ jsx2(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: "\u2715" })
695
+ style: {
696
+ flexDirection: "row",
697
+ alignItems: "center",
698
+ gap: tema.space.sm,
699
+ minHeight: tema.touch,
700
+ borderWidth: tema.hairline,
701
+ borderColor: tema.color.borderInteractive,
702
+ borderRadius: tema.radius.pill,
703
+ paddingLeft: tema.space.md,
704
+ paddingRight: tema.space.xs
705
+ },
706
+ children: [
707
+ /* @__PURE__ */ jsx2(Text2, { style: { flex: 1, color: tema.color.textPrimary, fontSize: tema.font.small }, children: tekst.lenketTil(lenketTil.title) }),
708
+ /* @__PURE__ */ jsx2(
709
+ Pressable2,
710
+ {
711
+ testID: "fjern-lenke",
712
+ accessibilityRole: "button",
713
+ accessibilityLabel: tekst.fjernLenke,
714
+ onPress: onFjernLenke,
715
+ style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
716
+ children: /* @__PURE__ */ jsx2(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: "\u2715" })
717
+ }
718
+ )
719
+ ]
696
720
  }
697
- )
698
- ]
699
- }
700
- ) : null,
701
- uavklart ? /* @__PURE__ */ jsxs2(
702
- View2,
703
- {
704
- style: {
705
- gap: tema.space.sm,
706
- backgroundColor: tema.color.warningBg,
707
- borderRadius: tema.radius.md,
708
- padding: tema.space.md
709
- },
710
- children: [
721
+ ) : null,
722
+ uavklart ? /* @__PURE__ */ jsxs2(
723
+ View2,
724
+ {
725
+ style: {
726
+ gap: tema.space.sm,
727
+ backgroundColor: tema.color.warningBg,
728
+ borderRadius: tema.radius.md,
729
+ padding: tema.space.md
730
+ },
731
+ children: [
732
+ /* @__PURE__ */ jsx2(
733
+ Text2,
734
+ {
735
+ accessibilityRole: "alert",
736
+ accessibilityLiveRegion: "polite",
737
+ style: {
738
+ color: tema.color.warning,
739
+ fontSize: tema.font.small,
740
+ lineHeight: tema.lineHeight.small,
741
+ fontWeight: tema.weight.medium
742
+ },
743
+ children: tekst.monsterSpm[uavklart.kind]
744
+ }
745
+ ),
746
+ /* @__PURE__ */ jsxs2(View2, { style: { flexDirection: "row", gap: tema.space.sm }, children: [
747
+ /* @__PURE__ */ jsx2(
748
+ Btn,
749
+ {
750
+ grow: true,
751
+ variant: "secondary",
752
+ testID: "monster-fjern",
753
+ label: tekst.monsterFjern,
754
+ onPress: () => onEndre(verdi.slice(0, uavklart.start) + verdi.slice(uavklart.end))
755
+ }
756
+ ),
757
+ /* @__PURE__ */ jsx2(
758
+ Btn,
759
+ {
760
+ grow: true,
761
+ variant: "ghost",
762
+ testID: "monster-behold",
763
+ label: tekst.monsterBehold,
764
+ onPress: () => setBeholdt((b) => [...b, uavklart.match])
765
+ }
766
+ )
767
+ ] }),
768
+ /* @__PURE__ */ jsx2(Hint, { children: tekst.monsterForklaring })
769
+ ]
770
+ }
771
+ ) : null,
772
+ /* @__PURE__ */ jsx2(H, { children: spor === "onske" ? tekst.feltLabelOnske : tekst.feltLabelFeil }),
711
773
  /* @__PURE__ */ jsx2(
774
+ TextInput,
775
+ {
776
+ testID: "innspill-tekst",
777
+ accessibilityLabel: spor === "onske" ? tekst.feltLabelOnske : tekst.feltLabelFeil,
778
+ value: verdi,
779
+ onChangeText: onEndre,
780
+ maxLength: textMaxLength,
781
+ multiline: true,
782
+ numberOfLines: 4,
783
+ placeholder: spor === "onske" ? tekst.placeholderOnske : tekst.placeholderFeil,
784
+ placeholderTextColor: tema.color.textMuted,
785
+ style: {
786
+ backgroundColor: tema.color.surfaceRaised,
787
+ borderWidth: tema.hairline,
788
+ borderColor: full ? tema.color.warning : tema.color.borderStrong,
789
+ borderRadius: tema.radius.md,
790
+ padding: tema.space.md,
791
+ color: tema.color.textPrimary,
792
+ fontSize: tema.font.body,
793
+ lineHeight: tema.lineHeight.body,
794
+ minHeight: tema.touch * 2,
795
+ textAlignVertical: "top"
796
+ }
797
+ }
798
+ ),
799
+ visTeller ? /* @__PURE__ */ jsxs2(
712
800
  Text2,
713
801
  {
714
- accessibilityRole: "alert",
715
- accessibilityLiveRegion: "polite",
802
+ testID: "teller",
803
+ accessibilityLiveRegion: full ? "assertive" : "polite",
716
804
  style: {
717
- color: tema.color.warning,
718
- fontSize: tema.font.small,
719
- lineHeight: tema.lineHeight.small,
720
- fontWeight: tema.weight.medium
805
+ alignSelf: "flex-end",
806
+ color: full ? tema.color.warning : tema.color.textMuted,
807
+ fontSize: tema.font.small
721
808
  },
722
- children: tekst.monsterSpm[uavklart.kind]
809
+ children: [
810
+ brukt,
811
+ " / ",
812
+ textMaxLength,
813
+ full ? tekst.tellerFull : ""
814
+ ]
723
815
  }
724
- ),
725
- /* @__PURE__ */ jsxs2(View2, { style: { flexDirection: "row", gap: tema.space.sm }, children: [
816
+ ) : null,
817
+ harVedlegg ? /* @__PURE__ */ jsxs2(
818
+ View2,
819
+ {
820
+ testID: "vedlegg-chip",
821
+ style: {
822
+ flexDirection: "row",
823
+ alignItems: "center",
824
+ gap: tema.space.sm,
825
+ minHeight: tema.touch,
826
+ borderWidth: tema.hairline,
827
+ borderColor: tema.color.borderInteractive,
828
+ borderRadius: tema.radius.pill,
829
+ paddingLeft: tema.space.md,
830
+ paddingRight: tema.space.xs
831
+ },
832
+ children: [
833
+ /* @__PURE__ */ jsx2(Text2, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: { fontSize: tema.font.small }, children: "\u{1F4F7}" }),
834
+ /* @__PURE__ */ jsx2(Text2, { style: { flex: 1, color: tema.color.textPrimary, fontSize: tema.font.small }, children: tekst.skjermbildeLagtVed }),
835
+ /* @__PURE__ */ jsx2(
836
+ Pressable2,
837
+ {
838
+ testID: "fjern-vedlegg",
839
+ accessibilityRole: "button",
840
+ accessibilityLabel: tekst.fjernSkjermbilde,
841
+ onPress: onFjernVedlegg,
842
+ style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
843
+ children: /* @__PURE__ */ jsx2(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: "\u2715" })
844
+ }
845
+ )
846
+ ]
847
+ }
848
+ ) : onSkjermbilde ? /* @__PURE__ */ jsx2(
849
+ Btn,
850
+ {
851
+ variant: "secondary",
852
+ testID: "legg-ved-skjermbilde",
853
+ ikon: "\u{1F4F7}",
854
+ label: tekst.leggVedSkjermbilde,
855
+ hint: tekst.leggVedHint,
856
+ onPress: onSkjermbilde
857
+ }
858
+ ) : null,
859
+ /* @__PURE__ */ jsxs2(View2, { style: { borderTopWidth: tema.hairline, borderTopColor: tema.color.border, paddingTop: tema.space.sm }, children: [
726
860
  /* @__PURE__ */ jsx2(
727
- Btn,
861
+ Pressable2,
728
862
  {
729
- grow: true,
730
- variant: "secondary",
731
- testID: "monster-fjern",
732
- label: tekst.monsterFjern,
733
- onPress: () => onEndre(verdi.slice(0, uavklart.start) + verdi.slice(uavklart.end))
863
+ testID: "kontekst-bryter",
864
+ accessibilityRole: "button",
865
+ accessibilityState: { expanded: apen },
866
+ accessibilityLabel: `${tekst.kontekstLinje}${apen ? "" : tekst.kontekstVis}`,
867
+ onPress: () => setApen((a) => !a),
868
+ style: { minHeight: tema.touch, justifyContent: "center" },
869
+ children: /* @__PURE__ */ jsxs2(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: [
870
+ apen ? "\u25B4" : "\u25BE",
871
+ " ",
872
+ tekst.kontekstLinje,
873
+ apen ? "" : tekst.kontekstVis
874
+ ] })
734
875
  }
735
876
  ),
736
- /* @__PURE__ */ jsx2(
737
- Btn,
738
- {
739
- grow: true,
740
- variant: "ghost",
741
- testID: "monster-behold",
742
- label: tekst.monsterBehold,
743
- onPress: () => setBeholdt((b) => [...b, uavklart.match])
744
- }
745
- )
746
- ] }),
747
- /* @__PURE__ */ jsx2(Hint, { children: tekst.monsterForklaring })
877
+ apen ? /* @__PURE__ */ jsxs2(View2, { children: [
878
+ linjer.map((l) => /* @__PURE__ */ jsxs2(
879
+ View2,
880
+ {
881
+ style: {
882
+ flexDirection: "row",
883
+ alignItems: "center",
884
+ gap: tema.space.sm,
885
+ minHeight: tema.touch,
886
+ borderBottomWidth: tema.hairline,
887
+ borderBottomColor: tema.color.border
888
+ },
889
+ children: [
890
+ /* @__PURE__ */ jsx2(Text2, { style: { color: tema.color.textMuted, fontSize: tema.font.small, minWidth: tema.touch * 2 }, children: l.etikett }),
891
+ /* @__PURE__ */ jsx2(Text2, { style: { flex: 1, color: tema.color.textPrimary, fontSize: tema.font.small }, children: l.verdi }),
892
+ /* @__PURE__ */ jsx2(
893
+ Pressable2,
894
+ {
895
+ testID: `fjern-${l.felt}`,
896
+ accessibilityRole: "button",
897
+ accessibilityLabel: `${tekst.kontekstFjern} ${l.etikett.toLowerCase()} fra innsendingen`,
898
+ onPress: () => onFjernKontekst(l.felt),
899
+ style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
900
+ children: /* @__PURE__ */ jsxs2(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: [
901
+ "\u2715 ",
902
+ tekst.kontekstFjern
903
+ ] })
904
+ }
905
+ )
906
+ ]
907
+ },
908
+ l.felt
909
+ )),
910
+ /* @__PURE__ */ jsx2(View2, { style: { paddingTop: tema.space.sm }, children: /* @__PURE__ */ jsx2(Hint, { children: tekst.kontekstAldri }) })
911
+ ] }) : null
912
+ ] })
748
913
  ]
749
914
  }
750
- ) : null,
751
- /* @__PURE__ */ jsx2(H, { children: spor === "onske" ? tekst.feltLabelOnske : tekst.feltLabelFeil }),
752
- /* @__PURE__ */ jsx2(
753
- TextInput,
754
- {
755
- testID: "innspill-tekst",
756
- accessibilityLabel: spor === "onske" ? tekst.feltLabelOnske : tekst.feltLabelFeil,
757
- value: verdi,
758
- onChangeText: onEndre,
759
- maxLength: textMaxLength,
760
- multiline: true,
761
- numberOfLines: 4,
762
- placeholder: spor === "onske" ? tekst.placeholderOnske : tekst.placeholderFeil,
763
- placeholderTextColor: tema.color.textMuted,
764
- style: {
765
- backgroundColor: tema.color.surfaceRaised,
766
- borderWidth: tema.hairline,
767
- borderColor: full ? tema.color.warning : tema.color.borderStrong,
768
- borderRadius: tema.radius.md,
769
- padding: tema.space.md,
770
- color: tema.color.textPrimary,
771
- fontSize: tema.font.body,
772
- lineHeight: tema.lineHeight.body,
773
- minHeight: tema.touch * 2,
774
- textAlignVertical: "top"
775
- }
776
- }
777
915
  ),
778
- visTeller ? /* @__PURE__ */ jsxs2(
779
- Text2,
780
- {
781
- testID: "teller",
782
- accessibilityLiveRegion: full ? "assertive" : "polite",
783
- style: {
784
- alignSelf: "flex-end",
785
- color: full ? tema.color.warning : tema.color.textMuted,
786
- fontSize: tema.font.small
787
- },
788
- children: [
789
- brukt,
790
- " / ",
791
- textMaxLength,
792
- full ? tekst.tellerFull : ""
793
- ]
794
- }
795
- ) : null,
796
- harVedlegg ? /* @__PURE__ */ jsxs2(
797
- View2,
798
- {
799
- testID: "vedlegg-chip",
800
- style: {
801
- flexDirection: "row",
802
- alignItems: "center",
803
- gap: tema.space.sm,
804
- minHeight: tema.touch,
805
- borderWidth: tema.hairline,
806
- borderColor: tema.color.borderInteractive,
807
- borderRadius: tema.radius.pill,
808
- paddingLeft: tema.space.md,
809
- paddingRight: tema.space.xs
810
- },
811
- children: [
812
- /* @__PURE__ */ jsx2(Text2, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: { fontSize: tema.font.small }, children: "\u{1F4F7}" }),
813
- /* @__PURE__ */ jsx2(Text2, { style: { flex: 1, color: tema.color.textPrimary, fontSize: tema.font.small }, children: tekst.skjermbildeLagtVed }),
814
- /* @__PURE__ */ jsx2(
815
- Pressable2,
816
- {
817
- testID: "fjern-vedlegg",
818
- accessibilityRole: "button",
819
- accessibilityLabel: tekst.fjernSkjermbilde,
820
- onPress: onFjernVedlegg,
821
- style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
822
- children: /* @__PURE__ */ jsx2(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: "\u2715" })
823
- }
824
- )
825
- ]
826
- }
827
- ) : onSkjermbilde ? /* @__PURE__ */ jsx2(
828
- Btn,
829
- {
830
- variant: "secondary",
831
- testID: "legg-ved-skjermbilde",
832
- ikon: "\u{1F4F7}",
833
- label: tekst.leggVedSkjermbilde,
834
- hint: tekst.leggVedHint,
835
- onPress: onSkjermbilde
836
- }
837
- ) : null,
838
- /* @__PURE__ */ jsxs2(View2, { style: { borderTopWidth: tema.hairline, borderTopColor: tema.color.border, paddingTop: tema.space.sm }, children: [
839
- /* @__PURE__ */ jsx2(
840
- Pressable2,
841
- {
842
- testID: "kontekst-bryter",
843
- accessibilityRole: "button",
844
- accessibilityState: { expanded: apen },
845
- accessibilityLabel: `${tekst.kontekstLinje}${apen ? "" : tekst.kontekstVis}`,
846
- onPress: () => setApen((a) => !a),
847
- style: { minHeight: tema.touch, justifyContent: "center" },
848
- children: /* @__PURE__ */ jsxs2(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: [
849
- apen ? "\u25B4" : "\u25BE",
850
- " ",
851
- tekst.kontekstLinje,
852
- apen ? "" : tekst.kontekstVis
853
- ] })
854
- }
855
- ),
856
- apen ? /* @__PURE__ */ jsxs2(View2, { children: [
857
- linjer.map((l) => /* @__PURE__ */ jsxs2(
858
- View2,
859
- {
860
- style: {
861
- flexDirection: "row",
862
- alignItems: "center",
863
- gap: tema.space.sm,
864
- minHeight: tema.touch,
865
- borderBottomWidth: tema.hairline,
866
- borderBottomColor: tema.color.border
867
- },
868
- children: [
869
- /* @__PURE__ */ jsx2(Text2, { style: { color: tema.color.textMuted, fontSize: tema.font.small, minWidth: tema.touch * 2 }, children: l.etikett }),
870
- /* @__PURE__ */ jsx2(Text2, { style: { flex: 1, color: tema.color.textPrimary, fontSize: tema.font.small }, children: l.verdi }),
871
- /* @__PURE__ */ jsx2(
872
- Pressable2,
873
- {
874
- testID: `fjern-${l.felt}`,
875
- accessibilityRole: "button",
876
- accessibilityLabel: `${tekst.kontekstFjern} ${l.etikett.toLowerCase()} fra innsendingen`,
877
- onPress: () => onFjernKontekst(l.felt),
878
- style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
879
- children: /* @__PURE__ */ jsxs2(Text2, { style: { color: tema.color.textSecondary, fontSize: tema.font.small }, children: [
880
- "\u2715 ",
881
- tekst.kontekstFjern
882
- ] })
883
- }
884
- )
885
- ]
886
- },
887
- l.felt
888
- )),
889
- /* @__PURE__ */ jsx2(View2, { style: { paddingTop: tema.space.sm }, children: /* @__PURE__ */ jsx2(Hint, { children: tekst.kontekstAldri }) })
890
- ] }) : null
891
- ] }),
892
- /* @__PURE__ */ jsx2(View2, { style: { flex: 1, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx2(
916
+ /* @__PURE__ */ jsx2(View2, { testID: "skjema-fot", style: { flexGrow: 1, flexShrink: 0, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx2(
893
917
  Btn,
894
918
  {
895
919
  testID: "send",
@@ -956,7 +980,7 @@ function Valg({ onVelg }) {
956
980
 
957
981
  // src/widget/KjenteFeil.tsx
958
982
  import "react";
959
- import { ActivityIndicator, Text as Text4, View as View4 } from "react-native";
983
+ import { ActivityIndicator, ScrollView as ScrollView2, Text as Text4, View as View4 } from "react-native";
960
984
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
961
985
  function KjenteFeil({
962
986
  kort,
@@ -973,73 +997,82 @@ function KjenteFeil({
973
997
  /* @__PURE__ */ jsx4(ActivityIndicator, { accessibilityLabel: "Sjekker kjente feil", color: tema.color.textSecondary })
974
998
  ] });
975
999
  }
976
- return /* @__PURE__ */ jsxs4(View4, { style: { flex: 1, gap: tema.space.md }, children: [
1000
+ return /* @__PURE__ */ jsxs4(View4, { testID: "kjente-feil", style: { flexGrow: 1, flexShrink: 1, gap: tema.space.md }, children: [
977
1001
  /* @__PURE__ */ jsx4(H, { sub: spor === "onske" ? tekst.kjenteFeilUnderOnske : tekst.kjenteFeilUnderFeil, children: spor === "onske" ? tekst.kjenteFeilTittelOnske : tekst.kjenteFeilTittelFeil }),
978
- kort.map((k) => {
979
- const versjon = k.fixedIn ? k.status === "fikset" ? tekst.rettetI(k.fixedIn) : tekst.rettesI(k.fixedIn) : void 0;
980
- const kontekst = versjon ? `${k.title}. ${versjon}` : k.title;
981
- return /* @__PURE__ */ jsxs4(Card, { children: [
982
- /* @__PURE__ */ jsx4(
983
- Text4,
984
- {
985
- style: {
986
- color: tema.color.textPrimary,
987
- fontSize: tema.font.body,
988
- lineHeight: tema.lineHeight.body,
989
- fontWeight: tema.weight.medium
990
- },
991
- children: k.title
992
- }
993
- ),
994
- k.workaround ? /* @__PURE__ */ jsxs4(
995
- Text4,
996
- {
997
- style: {
998
- color: tema.color.textSecondary,
999
- fontSize: tema.font.small,
1000
- lineHeight: tema.lineHeight.small
1001
- },
1002
- children: [
1003
- tekst.omvei,
1004
- " ",
1005
- k.workaround
1006
- ]
1007
- }
1008
- ) : null,
1009
- versjon ? /* @__PURE__ */ jsx4(
1010
- StatusPill,
1011
- {
1012
- ikon: k.status === "fikset" ? "\u2713" : "\u{1F527}",
1013
- etikett: versjon,
1014
- farge: k.status === "fikset" ? "success" : "info"
1015
- }
1016
- ) : null,
1017
- /* @__PURE__ */ jsxs4(View4, { style: { flexDirection: "row", gap: tema.space.sm }, children: [
1018
- /* @__PURE__ */ jsx4(
1019
- Btn,
1020
- {
1021
- grow: true,
1022
- testID: `ja-ogsa-${k.id}`,
1023
- label: tekst.svarJa,
1024
- accessibilityLabel: `${tekst.svarJa}. ${kontekst}`,
1025
- onPress: () => onJaOgsa(k)
1026
- }
1027
- ),
1028
- /* @__PURE__ */ jsx4(
1029
- Btn,
1030
- {
1031
- grow: true,
1032
- variant: "secondary",
1033
- testID: `ligner-${k.id}`,
1034
- label: tekst.svarLigner,
1035
- accessibilityLabel: `${tekst.svarLigner}. ${kontekst}`,
1036
- onPress: () => onLigner(k)
1037
- }
1038
- )
1039
- ] })
1040
- ] }, k.id);
1041
- }),
1042
- /* @__PURE__ */ jsx4(Btn, { variant: "secondary", testID: "nei-noe-annet", label: tekst.svarNei, onPress: onNei })
1002
+ /* @__PURE__ */ jsx4(
1003
+ ScrollView2,
1004
+ {
1005
+ testID: "kjente-feil-liste",
1006
+ style: { flexGrow: 0, flexShrink: 1 },
1007
+ contentContainerStyle: { gap: tema.space.md },
1008
+ keyboardShouldPersistTaps: "handled",
1009
+ children: kort.map((k) => {
1010
+ const versjon = k.fixedIn ? k.status === "fikset" ? tekst.rettetI(k.fixedIn) : tekst.rettesI(k.fixedIn) : void 0;
1011
+ const kontekst = versjon ? `${k.title}. ${versjon}` : k.title;
1012
+ return /* @__PURE__ */ jsxs4(Card, { children: [
1013
+ /* @__PURE__ */ jsx4(
1014
+ Text4,
1015
+ {
1016
+ style: {
1017
+ color: tema.color.textPrimary,
1018
+ fontSize: tema.font.body,
1019
+ lineHeight: tema.lineHeight.body,
1020
+ fontWeight: tema.weight.medium
1021
+ },
1022
+ children: k.title
1023
+ }
1024
+ ),
1025
+ k.workaround ? /* @__PURE__ */ jsxs4(
1026
+ Text4,
1027
+ {
1028
+ style: {
1029
+ color: tema.color.textSecondary,
1030
+ fontSize: tema.font.small,
1031
+ lineHeight: tema.lineHeight.small
1032
+ },
1033
+ children: [
1034
+ tekst.omvei,
1035
+ " ",
1036
+ k.workaround
1037
+ ]
1038
+ }
1039
+ ) : null,
1040
+ versjon ? /* @__PURE__ */ jsx4(
1041
+ StatusPill,
1042
+ {
1043
+ ikon: k.status === "fikset" ? "\u2713" : "\u{1F527}",
1044
+ etikett: versjon,
1045
+ farge: k.status === "fikset" ? "success" : "info"
1046
+ }
1047
+ ) : null,
1048
+ /* @__PURE__ */ jsxs4(View4, { style: { flexDirection: "row", gap: tema.space.sm }, children: [
1049
+ /* @__PURE__ */ jsx4(
1050
+ Btn,
1051
+ {
1052
+ grow: true,
1053
+ testID: `ja-ogsa-${k.id}`,
1054
+ label: tekst.svarJa,
1055
+ accessibilityLabel: `${tekst.svarJa}. ${kontekst}`,
1056
+ onPress: () => onJaOgsa(k)
1057
+ }
1058
+ ),
1059
+ /* @__PURE__ */ jsx4(
1060
+ Btn,
1061
+ {
1062
+ grow: true,
1063
+ variant: "secondary",
1064
+ testID: `ligner-${k.id}`,
1065
+ label: tekst.svarLigner,
1066
+ accessibilityLabel: `${tekst.svarLigner}. ${kontekst}`,
1067
+ onPress: () => onLigner(k)
1068
+ }
1069
+ )
1070
+ ] })
1071
+ ] }, k.id);
1072
+ })
1073
+ }
1074
+ ),
1075
+ /* @__PURE__ */ jsx4(View4, { testID: "kjente-feil-fot", style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx4(Btn, { variant: "secondary", testID: "nei-noe-annet", label: tekst.svarNei, onPress: onNei }) })
1043
1076
  ] });
1044
1077
  }
1045
1078
 
@@ -1101,7 +1134,7 @@ function Kvittering({
1101
1134
 
1102
1135
  // src/widget/MineInnspill.tsx
1103
1136
  import "react";
1104
- import { ActivityIndicator as ActivityIndicator2, ScrollView, Text as Text6, View as View6 } from "react-native";
1137
+ import { ActivityIndicator as ActivityIndicator2, ScrollView as ScrollView3, Text as Text6, View as View6 } from "react-native";
1105
1138
 
1106
1139
  // src/widget/status.ts
1107
1140
  var IKON = {
@@ -1168,7 +1201,7 @@ function MineInnspill({
1168
1201
  const tema = useTema();
1169
1202
  return /* @__PURE__ */ jsxs6(View6, { style: { flex: 1, gap: tema.space.md }, children: [
1170
1203
  /* @__PURE__ */ jsx6(H, { sub: tekst.mineUnder, children: tekst.mineTittel }),
1171
- laster ? /* @__PURE__ */ jsx6(ActivityIndicator2, { accessibilityLabel: "Henter innspillene dine", color: tema.color.textSecondary }) : rader.length === 0 ? /* @__PURE__ */ jsx6(Hint, { children: tekst.mineTom }) : /* @__PURE__ */ jsx6(ScrollView, { style: { flex: 1 }, contentContainerStyle: { gap: tema.space.sm }, children: rader.map((rad) => {
1204
+ laster ? /* @__PURE__ */ jsx6(ActivityIndicator2, { accessibilityLabel: "Henter innspillene dine", color: tema.color.textSecondary }) : rader.length === 0 ? /* @__PURE__ */ jsx6(Hint, { children: tekst.mineTom }) : /* @__PURE__ */ jsx6(ScrollView3, { style: { flex: 1 }, contentContainerStyle: { gap: tema.space.sm }, children: rader.map((rad) => {
1172
1205
  const venter = rad.pending === true;
1173
1206
  const v = venter ? venterVisning : statusVisning(rad.status, rad.type, rad.deadlineAt);
1174
1207
  const nokkel = venter ? rad.clientRef : rad.id;
@@ -1437,6 +1470,7 @@ function Widget({
1437
1470
  tenantName
1438
1471
  }) {
1439
1472
  const tema = useTema();
1473
+ const insets = useContext3(SafeAreaInsetsContext) ?? initialWindowMetrics?.insets ?? { top: 0, bottom: 0, left: 0, right: 0 };
1440
1474
  const skjermbilde = useSkjermbilde();
1441
1475
  const previewRef = useRef2(null);
1442
1476
  const [steg, setSteg] = useState3("valg");
@@ -1630,108 +1664,119 @@ function Widget({
1630
1664
  animationType: "slide",
1631
1665
  onRequestClose: lukk,
1632
1666
  accessibilityViewIsModal: true,
1633
- children: /* @__PURE__ */ jsx8(View8, { style: { flex: 1, backgroundColor: tema.color.scrim, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxs8(
1634
- View8,
1667
+ children: /* @__PURE__ */ jsx8(
1668
+ KeyboardAvoidingView,
1635
1669
  {
1636
- testID: "innspel-widget",
1637
- accessibilityViewIsModal: true,
1638
- accessibilityRole: "none",
1639
- style: {
1640
- backgroundColor: tema.color.bg,
1641
- borderTopLeftRadius: tema.radius.lg * 2,
1642
- borderTopRightRadius: tema.radius.lg * 2,
1643
- padding: tema.screenPadding,
1644
- gap: tema.space.md,
1645
- maxHeight: "92%",
1646
- minHeight: "60%"
1647
- },
1648
- children: [
1649
- /* @__PURE__ */ jsxs8(View8, { style: { flexDirection: "row", justifyContent: "space-between", alignItems: "center" }, children: [
1650
- steg === "skjermbilde" ? /* @__PURE__ */ jsx8(Btn, { variant: "ghost", testID: "tilbake", ikon: "\u2190", label: tekst.tilbake, onPress: fjernBilde }) : steg !== "valg" && steg !== "kvittering" ? /* @__PURE__ */ jsx8(Btn, { variant: "ghost", testID: "tilbake", ikon: "\u2190", label: tekst.tilbake, onPress: nullstill }) : /* @__PURE__ */ jsx8(View8, {}),
1651
- /* @__PURE__ */ jsx8(
1652
- Pressable5,
1653
- {
1654
- testID: "lukk",
1655
- accessibilityRole: "button",
1656
- accessibilityLabel: tekst.lukk,
1657
- onPress: lukk,
1658
- style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
1659
- children: /* @__PURE__ */ jsx8(Text8, { style: { color: tema.color.textSecondary, fontSize: tema.font.body }, children: "\u2715" })
1660
- }
1661
- )
1662
- ] }),
1663
- feil ? /* @__PURE__ */ jsx8(Banner, { live: true, ikon: "\u26A0", tone: "danger", children: tekst.sendefeilBanner(feil) }) : null,
1664
- steg === "valg" ? /* @__PURE__ */ jsxs8(Fragment, { children: [
1665
- /* @__PURE__ */ jsx8(Valg, { onVelg: velgSpor }),
1666
- /* @__PURE__ */ jsx8(Btn, { variant: "ghost", testID: "mine-innspill", ikon: "\u{1F4CB}", label: tekst.mineTittel, onPress: visMine })
1667
- ] }) : null,
1668
- steg === "kjenteFeil" ? /* @__PURE__ */ jsx8(
1669
- KjenteFeil,
1670
- {
1671
- kort,
1672
- spor,
1673
- laster: lasterKort,
1674
- onJaOgsa: jaOgsa,
1675
- onLigner: (k) => {
1676
- setLenketTil(k);
1677
- setSteg("felt");
1678
- },
1679
- onNei: () => spor === "onske" ? void send() : setSteg("felt")
1680
- }
1681
- ) : null,
1682
- steg === "felt" ? /* @__PURE__ */ jsx8(
1683
- Felt,
1684
- {
1685
- spor,
1686
- verdi,
1687
- onEndre: endreTekst,
1688
- minTextLength: innstillinger.minTextLength,
1689
- textMaxLength: innstillinger.textMaxLength,
1690
- kontekst: client.context,
1691
- fjernedeFelter: fjernede,
1692
- onFjernKontekst: (f) => setFjernede((x) => [...x, f]),
1693
- ...lenketTil ? { lenketTil, onFjernLenke: () => setLenketTil(void 0) } : {},
1694
- funn,
1695
- onSend: send,
1696
- sender,
1697
- ...skjermbildeMulig ? { onSkjermbilde: taSkjermbilde } : {},
1698
- harVedlegg: vedlegg !== void 0,
1699
- onFjernVedlegg: fjernBilde
1700
- }
1701
- ) : null,
1702
- steg === "skjermbilde" && bilde ? /* @__PURE__ */ jsx8(
1703
- Skjermbilde,
1704
- {
1705
- bilde,
1706
- automaskerRot: automasker,
1707
- rotStorrelse,
1708
- previewRef,
1709
- komponerer,
1710
- onFjern: fjernBilde,
1711
- onLeggVed: leggVedBilde
1712
- }
1713
- ) : null,
1714
- steg === "kvittering" && kvittering ? /* @__PURE__ */ jsx8(
1715
- Kvittering,
1716
- {
1717
- art: kvittering.art,
1718
- ...kvittering.nr ? { saksnummer: kvittering.nr } : {},
1719
- ...kvittering.vedlegg ? { vedlegg: kvittering.vedlegg } : {},
1720
- onLukk: lukk
1721
- }
1722
- ) : null,
1723
- steg === "mine" ? /* @__PURE__ */ jsx8(
1724
- MineInnspill,
1725
- {
1726
- rader: mine,
1727
- laster: lasterMine,
1728
- ...tenantName ? { tenantName } : {},
1729
- onNytt: nullstill
1730
- }
1731
- ) : null
1732
- ]
1670
+ behavior: "padding",
1671
+ keyboardVerticalOffset: -insets.bottom,
1672
+ style: { flex: 1, backgroundColor: tema.color.scrim, justifyContent: "flex-end", paddingTop: insets.top },
1673
+ children: /* @__PURE__ */ jsxs8(
1674
+ View8,
1675
+ {
1676
+ testID: "innspel-widget",
1677
+ accessibilityViewIsModal: true,
1678
+ accessibilityRole: "none",
1679
+ style: {
1680
+ backgroundColor: tema.color.bg,
1681
+ borderTopLeftRadius: tema.radius.lg * 2,
1682
+ borderTopRightRadius: tema.radius.lg * 2,
1683
+ padding: tema.screenPadding,
1684
+ paddingBottom: tema.screenPadding + insets.bottom,
1685
+ paddingLeft: tema.screenPadding + insets.left,
1686
+ paddingRight: tema.screenPadding + insets.right,
1687
+ gap: tema.space.md,
1688
+ maxHeight: "92%",
1689
+ minHeight: "60%"
1690
+ },
1691
+ children: [
1692
+ /* @__PURE__ */ jsxs8(View8, { style: { flexDirection: "row", justifyContent: "space-between", alignItems: "center" }, children: [
1693
+ steg === "skjermbilde" ? /* @__PURE__ */ jsx8(Btn, { variant: "ghost", testID: "tilbake", ikon: "\u2190", label: tekst.tilbake, onPress: fjernBilde }) : steg !== "valg" && steg !== "kvittering" ? /* @__PURE__ */ jsx8(Btn, { variant: "ghost", testID: "tilbake", ikon: "\u2190", label: tekst.tilbake, onPress: nullstill }) : /* @__PURE__ */ jsx8(View8, {}),
1694
+ /* @__PURE__ */ jsx8(
1695
+ Pressable5,
1696
+ {
1697
+ testID: "lukk",
1698
+ accessibilityRole: "button",
1699
+ accessibilityLabel: tekst.lukk,
1700
+ onPress: lukk,
1701
+ style: { minWidth: tema.touch, minHeight: tema.touch, alignItems: "center", justifyContent: "center" },
1702
+ children: /* @__PURE__ */ jsx8(Text8, { style: { color: tema.color.textSecondary, fontSize: tema.font.body }, children: "\u2715" })
1703
+ }
1704
+ )
1705
+ ] }),
1706
+ feil ? /* @__PURE__ */ jsx8(Banner, { live: true, ikon: "\u26A0", tone: "danger", children: tekst.sendefeilBanner(feil) }) : null,
1707
+ steg === "valg" ? /* @__PURE__ */ jsxs8(Fragment, { children: [
1708
+ /* @__PURE__ */ jsx8(Valg, { onVelg: velgSpor }),
1709
+ /* @__PURE__ */ jsx8(Btn, { variant: "ghost", testID: "mine-innspill", ikon: "\u{1F4CB}", label: tekst.mineTittel, onPress: visMine })
1710
+ ] }) : null,
1711
+ steg === "kjenteFeil" ? /* @__PURE__ */ jsx8(
1712
+ KjenteFeil,
1713
+ {
1714
+ kort,
1715
+ spor,
1716
+ laster: lasterKort,
1717
+ onJaOgsa: jaOgsa,
1718
+ onLigner: (k) => {
1719
+ setLenketTil(k);
1720
+ setSteg("felt");
1721
+ },
1722
+ onNei: () => spor === "onske" ? void send() : setSteg("felt")
1723
+ }
1724
+ ) : null,
1725
+ steg === "felt" ? /* @__PURE__ */ jsx8(
1726
+ Felt,
1727
+ {
1728
+ spor,
1729
+ verdi,
1730
+ onEndre: endreTekst,
1731
+ minTextLength: innstillinger.minTextLength,
1732
+ textMaxLength: innstillinger.textMaxLength,
1733
+ kontekst: client.context,
1734
+ fjernedeFelter: fjernede,
1735
+ onFjernKontekst: (f) => setFjernede((x) => [...x, f]),
1736
+ ...lenketTil ? { lenketTil, onFjernLenke: () => setLenketTil(void 0) } : {},
1737
+ funn,
1738
+ onSend: send,
1739
+ sender,
1740
+ ...skjermbildeMulig ? { onSkjermbilde: taSkjermbilde } : {},
1741
+ harVedlegg: vedlegg !== void 0,
1742
+ onFjernVedlegg: fjernBilde
1743
+ }
1744
+ ) : null,
1745
+ steg === "skjermbilde" && bilde ? /* @__PURE__ */ jsx8(
1746
+ Skjermbilde,
1747
+ {
1748
+ bilde,
1749
+ automaskerRot: automasker,
1750
+ rotStorrelse,
1751
+ previewRef,
1752
+ komponerer,
1753
+ onFjern: fjernBilde,
1754
+ onLeggVed: leggVedBilde
1755
+ }
1756
+ ) : null,
1757
+ steg === "kvittering" && kvittering ? /* @__PURE__ */ jsx8(
1758
+ Kvittering,
1759
+ {
1760
+ art: kvittering.art,
1761
+ ...kvittering.nr ? { saksnummer: kvittering.nr } : {},
1762
+ ...kvittering.vedlegg ? { vedlegg: kvittering.vedlegg } : {},
1763
+ onLukk: lukk
1764
+ }
1765
+ ) : null,
1766
+ steg === "mine" ? /* @__PURE__ */ jsx8(
1767
+ MineInnspill,
1768
+ {
1769
+ rader: mine,
1770
+ laster: lasterMine,
1771
+ ...tenantName ? { tenantName } : {},
1772
+ onNytt: nullstill
1773
+ }
1774
+ ) : null
1775
+ ]
1776
+ }
1777
+ )
1733
1778
  }
1734
- ) })
1779
+ )
1735
1780
  }
1736
1781
  );
1737
1782
  }
@@ -1792,7 +1837,7 @@ function InnspelProvider({
1792
1837
  ] }) }) });
1793
1838
  }
1794
1839
  function useInnspel() {
1795
- const k = useContext3(Kontekst);
1840
+ const k = useContext4(Kontekst);
1796
1841
  if (!k) {
1797
1842
  throw new Error(
1798
1843
  "[innspel] useInnspel() ble kalt utenfor <InnspelProvider>. Pakk appen din i den \u2014 se README.md."
@@ -1825,7 +1870,7 @@ import { Modal as Modal4, Pressable as Pressable8, Text as Text13, View as View1
1825
1870
 
1826
1871
  // src/program/Aksept.tsx
1827
1872
  import "react";
1828
- import { Linking, Modal as Modal2, Pressable as Pressable6, ScrollView as ScrollView2, Text as Text9, View as View11 } from "react-native";
1873
+ import { Linking, Modal as Modal2, Pressable as Pressable6, ScrollView as ScrollView4, Text as Text9, View as View11 } from "react-native";
1829
1874
 
1830
1875
  // src/program/periode.ts
1831
1876
  var MANEDER = [
@@ -1891,7 +1936,7 @@ function Aksept({
1891
1936
  /* @__PURE__ */ jsx11(View11, {})
1892
1937
  ] }),
1893
1938
  feil ? /* @__PURE__ */ jsx11(Banner, { live: true, ikon: "\u26A0", tone: "danger", children: tekst.akseptFeil(feil) }) : null,
1894
- /* @__PURE__ */ jsxs10(ScrollView2, { contentContainerStyle: { gap: tema.space.md }, children: [
1939
+ /* @__PURE__ */ jsxs10(ScrollView4, { contentContainerStyle: { gap: tema.space.md }, children: [
1895
1940
  /* @__PURE__ */ jsx11(H, { sub: tekst.akseptHva, children: program.name }),
1896
1941
  /* @__PURE__ */ jsx11(
1897
1942
  Text9,