@innspel/react-native 0.8.0 → 0.9.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.d.cts CHANGED
@@ -621,6 +621,9 @@ declare const tekst: {
621
621
  readonly sendefeilBanner: (arsak: string) => string;
622
622
  readonly provIgjen: "Prøv igjen";
623
623
  readonly mineTittel: "Mine innspill";
624
+ /** Knappen på første steg med innspill fra før (DD-62): tallet er det som gjør den til en inngang. */
625
+ readonly mineMedAntall: (n: number) => string;
626
+ readonly mineEtikett: (n: number) => string;
624
627
  readonly mineUnder: "Status og hva du kan vente deg.";
625
628
  readonly mineTom: "Du har ikke sendt noe ennå.";
626
629
  readonly mineIkkeSendt: "Ikke sendt ennå";
package/dist/index.d.ts CHANGED
@@ -621,6 +621,9 @@ declare const tekst: {
621
621
  readonly sendefeilBanner: (arsak: string) => string;
622
622
  readonly provIgjen: "Prøv igjen";
623
623
  readonly mineTittel: "Mine innspill";
624
+ /** Knappen på første steg med innspill fra før (DD-62): tallet er det som gjør den til en inngang. */
625
+ readonly mineMedAntall: (n: number) => string;
626
+ readonly mineEtikett: (n: number) => string;
624
627
  readonly mineUnder: "Status og hva du kan vente deg.";
625
628
  readonly mineTom: "Du har ikke sendt noe ennå.";
626
629
  readonly mineIkkeSendt: "Ikke sendt ennå";
package/dist/index.js CHANGED
@@ -369,11 +369,14 @@ var arrow_back_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBo
369
369
  // ../../node_modules/ionicons/dist/svg/brush-outline.svg
370
370
  var brush_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="M452.37 59.63a40.49 40.49 0 0 0-57.26 0L184 294.74c23.08 4.7 46.12 27.29 49.26 49.26l219.11-227.11a40.49 40.49 0 0 0 0-57.26M138 336c-29.88 0-54 24.5-54 54.86 0 23.95-20.88 36.57-36 36.57C64.56 449.74 92.82 464 120 464c39.78 0 72-32.73 72-73.14 0-30.36-24.12-54.86-54-54.86" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/></svg>';
371
371
 
372
+ // ../../node_modules/ionicons/dist/svg/bug.svg
373
+ var bug_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="M463.55 272.13H400v-48.2q0-4.32-.27-8.47c29.57-27.88 32.25-64.63 32.27-103 0-8.61-6.64-16-15.25-16.41A16 16 0 0 0 400 112c0 28-1.86 48.15-9.9 63.84-19.22-41.15-65.78-63.91-134.1-63.91-39.8 0-74.19 9.13-99.43 26.39-14.9 10.19-26.2 22.91-33.7 37.72C114 160.65 112 141 112 112.46c0-8.61-6.6-16-15.2-16.44A16 16 0 0 0 80 112c0 37.63 2.61 73.73 32.44 101.63q-.43 5.06-.44 10.3v48.2H48.45c-8.61 0-16 6.62-16.43 15.23a16 16 0 0 0 16 16.77h64V320a143.3 143.3 0 0 0 10.39 53.69C96.74 396.64 80.18 422 80 463.34c0 8.74 6.62 16.3 15.36 16.65A16 16 0 0 0 112 464c0-27.66 9.1-44.71 26.17-61.32A144.37 144.37 0 0 0 220 459.42a16 16 0 0 0 20-15.49V192.45c0-8.61 6.62-16 15.23-16.43A16 16 0 0 1 272 192v251.93a16 16 0 0 0 20 15.49 144.4 144.4 0 0 0 81.82-56.74c17 16.54 26.09 33.52 26.17 60.95a16.27 16.27 0 0 0 15.1 16.37A16 16 0 0 0 432 464c0-41.68-16.6-67.23-42.39-90.31A143.3 143.3 0 0 0 400 320v-15.87h64a16 16 0 0 0 16-16.77c-.42-8.61-7.84-15.23-16.45-15.23"/><path d="m321.39 104 .32.09c13.57 3.8 25.07-10.55 18.2-22.85A95.86 95.86 0 0 0 256.21 32h-.42a95.87 95.87 0 0 0-84.19 50.13c-6.84 12.58 5.14 27 18.84 22.86 19.71-6 41.79-9.06 65.56-9.06 24.09 0 46.09 2.72 65.39 8.07"/></svg>';
374
+
372
375
  // ../../node_modules/ionicons/dist/svg/bug-outline.svg
373
376
  var bug_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="M370 378c28.89 23.52 46 46.07 46 86M142 378c-28.89 23.52-46 46.06-46 86M384 208c28.89-23.52 32-56.07 32-96M128 206c-28.89-23.52-32-54.06-32-94M464 288.13h-80M128 288.13H48M256 192v256" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/><path d="M256 448c-70.4 0-128-57.6-128-128v-96.07c0-65.07 57.6-96 128-96h0c70.4 0 128 25.6 128 96V320c0 70.4-57.6 128-128 128" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/><path d="M179.43 143.52a49.1 49.1 0 0 1-3.43-15.73A80 80 0 0 1 255.79 48h.42A80 80 0 0 1 336 127.79a41.9 41.9 0 0 1-3.12 14.3" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/></svg>';
374
377
 
375
- // ../../node_modules/ionicons/dist/svg/bulb-outline.svg
376
- var bulb_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="M304 384v-24c0-29 31.54-56.43 52-76 28.84-27.57 44-64.61 44-108 0-80-63.73-144-144-144a143.6 143.6 0 0 0-144 144c0 41.84 15.81 81.39 44 108 20.35 19.21 52 46.7 52 76v24M224 480h64M208 432h96M256 384V256" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/><path d="M294 240s-21.51 16-38 16-38-16-38-16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32px"/></svg>';
378
+ // ../../node_modules/ionicons/dist/svg/bulb.svg
379
+ var bulb_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><path d="M288 464h-64a16 16 0 0 0 0 32h64a16 16 0 0 0 0-32M304 416h-96a16 16 0 0 0 0 32h96a16 16 0 0 0 0-32M369.42 62.69C339.35 32.58 299.07 16 256 16A159.62 159.62 0 0 0 96 176c0 46.62 17.87 90.23 49 119.64l4.36 4.09C167.37 316.57 192 339.64 192 360v24a16 16 0 0 0 16 16h24a8 8 0 0 0 8-8V274.82a8 8 0 0 0-5.13-7.47A130.7 130.7 0 0 1 208.71 253a16 16 0 1 1 18.58-26c7.4 5.24 21.65 13 28.71 13s21.31-7.78 28.73-13a16 16 0 0 1 18.56 26 130.7 130.7 0 0 1-26.16 14.32 8 8 0 0 0-5.13 7.47V392a8 8 0 0 0 8 8h24a16 16 0 0 0 16-16v-24c0-19.88 24.36-42.93 42.15-59.77l4.91-4.66C399.08 265 416 223.61 416 176a159.16 159.16 0 0 0-46.58-113.31"/></svg>';
377
380
 
378
381
  // ../../node_modules/ionicons/dist/svg/calendar-outline.svg
379
382
  var calendar_outline_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="ionicon"><rect width="416" height="384" x="48" y="80" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" rx="48"/><circle cx="296" cy="232" r="24"/><circle cx="376" cy="232" r="24"/><circle cx="296" cy="312" r="24"/><circle cx="376" cy="312" r="24"/><circle cx="136" cy="312" r="24"/><circle cx="216" cy="312" r="24"/><circle cx="136" cy="392" r="24"/><circle cx="216" cy="392" r="24"/><circle cx="296" cy="392" r="24"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M128 48v32M384 48v32"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M464 160H48"/></svg>';
@@ -457,8 +460,10 @@ var IKONER = Object.fromEntries(
457
460
  Object.entries({
458
461
  "arrow-back-outline": arrow_back_outline_default,
459
462
  "brush-outline": brush_outline_default,
463
+ // Fylte varianter: bare på sporvalgets to kort (DD-63), der ikonet bærer stemningen.
464
+ bug: bug_default,
465
+ bulb: bulb_default,
460
466
  "bug-outline": bug_outline_default,
461
- "bulb-outline": bulb_outline_default,
462
467
  "calendar-outline": calendar_outline_default,
463
468
  "camera-outline": camera_outline_default,
464
469
  "checkmark-circle-outline": checkmark_circle_outline_default,
@@ -504,6 +509,7 @@ function Ikon({
504
509
  width: maal,
505
510
  height: maal,
506
511
  color: farge ?? tema.color.textPrimary,
512
+ fill: farge ?? tema.color.textPrimary,
507
513
  accessibilityElementsHidden: true,
508
514
  importantForAccessibility: "no"
509
515
  }
@@ -711,7 +717,8 @@ function Banner({
711
717
  // src/widget/tekster.ts
712
718
  function saksnr(id) {
713
719
  const i = id.indexOf("_");
714
- return i >= 0 ? id.slice(i + 1) : id;
720
+ const rest = i >= 0 ? id.slice(i + 1) : id;
721
+ return rest.length > 8 ? rest.slice(-4) : rest;
715
722
  }
716
723
  var stor = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
717
724
  var tekst = {
@@ -814,6 +821,9 @@ var tekst = {
814
821
  provIgjen: "Pr\xF8v igjen",
815
822
  // 2j — mine innspill
816
823
  mineTittel: "Mine innspill",
824
+ /** Knappen på første steg med innspill fra før (DD-62): tallet er det som gjør den til en inngang. */
825
+ mineMedAntall: (n) => `Mine innspill \xB7 ${n}`,
826
+ mineEtikett: (n) => `Mine innspill, ${n} innspill`,
817
827
  mineUnder: "Status og hva du kan vente deg.",
818
828
  mineTom: "Du har ikke sendt noe enn\xE5.",
819
829
  mineIkkeSendt: "Ikke sendt enn\xE5",
@@ -1239,7 +1249,21 @@ function Valg({ onVelg }) {
1239
1249
  padding: tema.space.md
1240
1250
  },
1241
1251
  children: [
1242
- /* @__PURE__ */ jsx4(Ikon, { navn: ikon, storrelse: "stor", farge: tema.color.textPrimary }),
1252
+ /* @__PURE__ */ jsx4(
1253
+ View3,
1254
+ {
1255
+ testID: `spor-${spor}-ikonflate`,
1256
+ style: {
1257
+ width: 2 * tema.icon.inline + 2 * tema.space.md,
1258
+ height: 2 * tema.icon.inline + 2 * tema.space.md,
1259
+ borderRadius: tema.radius.pill,
1260
+ backgroundColor: tema.color.brandBg,
1261
+ alignItems: "center",
1262
+ justifyContent: "center"
1263
+ },
1264
+ children: /* @__PURE__ */ jsx4(Ikon, { navn: ikon, storrelse: "stor", farge: tema.color.brand })
1265
+ }
1266
+ ),
1243
1267
  /* @__PURE__ */ jsx4(
1244
1268
  Text3,
1245
1269
  {
@@ -1259,8 +1283,8 @@ function Valg({ onVelg }) {
1259
1283
  return /* @__PURE__ */ jsxs3(View3, { style: { flex: 1, gap: tema.space.lg }, children: [
1260
1284
  /* @__PURE__ */ jsx4(H, { children: tekst.valgTittel }),
1261
1285
  /* @__PURE__ */ jsx4(View3, { style: { flex: 1, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxs3(View3, { style: { flexDirection: "row", gap: tema.space.md }, children: [
1262
- flate("feil", "bug-outline", tekst.sporFeil, tekst.sporFeilUnder),
1263
- flate("onske", "bulb-outline", tekst.sporOnske, tekst.sporOnskeUnder)
1286
+ flate("feil", "bug", tekst.sporFeil, tekst.sporFeilUnder),
1287
+ flate("onske", "bulb", tekst.sporOnske, tekst.sporOnskeUnder)
1264
1288
  ] }) })
1265
1289
  ] });
1266
1290
  }
@@ -1818,7 +1842,11 @@ function Widget({
1818
1842
  client.track({ name: "widget_opened" });
1819
1843
  void client.queue.flush().catch(() => void 0);
1820
1844
  void client.loadSettings().then((s) => setInnstillinger({ ...s })).catch(() => void 0);
1821
- if (apneOpsjoner?.track) velgSpor(apneOpsjoner.track);
1845
+ if (!client.isAnonymous) {
1846
+ void client.subjects.submissions().then(setMine).catch(() => void 0);
1847
+ }
1848
+ if (apneOpsjoner?.view === "mine" && !client.isAnonymous) void visMine();
1849
+ else if (apneOpsjoner?.track) velgSpor(apneOpsjoner.track);
1822
1850
  }, [synlig]);
1823
1851
  const hentKort = useCallback2(async () => {
1824
1852
  setLasterKort(true);
@@ -2039,7 +2067,17 @@ function Widget({
2039
2067
  !online && steg !== "kvittering" && steg !== "mine" ? /* @__PURE__ */ jsx9(Banner, { ikon: "cloud-offline-outline", tone: "info", testID: "offline-banner", children: tekst.offlineBanner }) : null,
2040
2068
  steg === "valg" ? /* @__PURE__ */ jsxs8(Fragment, { children: [
2041
2069
  /* @__PURE__ */ jsx9(Valg, { onVelg: velgSpor }),
2042
- /* @__PURE__ */ jsx9(Btn, { variant: "ghost", testID: "mine-innspill", ikon: "list-outline", label: tekst.mineTittel, onPress: visMine })
2070
+ !client.isAnonymous ? /* @__PURE__ */ jsx9(
2071
+ Btn,
2072
+ {
2073
+ variant: mine.length > 0 ? "secondary" : "ghost",
2074
+ testID: "mine-innspill",
2075
+ ikon: "list-outline",
2076
+ label: mine.length > 0 ? tekst.mineMedAntall(mine.length) : tekst.mineTittel,
2077
+ accessibilityLabel: mine.length > 0 ? tekst.mineEtikett(mine.length) : tekst.mineTittel,
2078
+ onPress: visMine
2079
+ }
2080
+ ) : null
2043
2081
  ] }) : null,
2044
2082
  steg === "kjenteFeil" ? /* @__PURE__ */ jsx9(
2045
2083
  KjenteFeil,