pleasenobugs 0.2.0 → 0.4.0
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/README.md +137 -38
- package/dist/chunks/client-CkFi6gmV.js +358 -0
- package/dist/chunks/demo-DLTn5oUs.js +232 -0
- package/dist/chunks/index-B1dIQO6N.js +2795 -0
- package/dist/client.js +7 -294
- package/dist/index.js +9 -10
- package/dist/pleasenobugs.iife.js +2 -2
- package/dist/types/client.d.ts +72 -4
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/demo.d.ts +39 -3
- package/dist/types/demo.d.ts.map +1 -1
- package/dist/types/element.d.ts +19 -13
- package/dist/types/element.d.ts.map +1 -1
- package/dist/types/filter.d.ts +66 -0
- package/dist/types/filter.d.ts.map +1 -0
- package/dist/types/i18n.d.ts +222 -531
- package/dist/types/i18n.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/readonly.d.ts +4 -3
- package/dist/types/readonly.d.ts.map +1 -1
- package/dist/types/signer.d.ts +7 -0
- package/dist/types/signer.d.ts.map +1 -1
- package/dist/types/ui/App.d.ts +4 -3
- package/dist/types/ui/App.d.ts.map +1 -1
- package/dist/types/ui/Compose.d.ts +12 -7
- package/dist/types/ui/Compose.d.ts.map +1 -1
- package/dist/types/ui/Face.d.ts +17 -0
- package/dist/types/ui/Face.d.ts.map +1 -0
- package/dist/types/ui/Manage.d.ts +60 -0
- package/dist/types/ui/Manage.d.ts.map +1 -0
- package/dist/types/ui/PostCard.d.ts +53 -6
- package/dist/types/ui/PostCard.d.ts.map +1 -1
- package/dist/types/ui/Sheets.d.ts +32 -28
- package/dist/types/ui/Sheets.d.ts.map +1 -1
- package/dist/types/ui/Talk.d.ts +57 -0
- package/dist/types/ui/Talk.d.ts.map +1 -0
- package/dist/types/ui/Updates.d.ts +37 -0
- package/dist/types/ui/Updates.d.ts.map +1 -0
- package/dist/types/ui/icons.d.ts +16 -0
- package/dist/types/ui/icons.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/demo-nnvUgJyJ.js +0 -107
- package/dist/chunks/index-13DToKWI.js +0 -1751
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pleasenobugs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A feedback board for Nimiq mini apps: bugs and ideas, straight from your users. One tag, or a headless client.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"screenshots": "node demo/screenshots.mjs"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@pleasenobugs/core": "0.
|
|
52
|
+
"@pleasenobugs/core": "0.4.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@nimiq/core": "^2.7.1",
|
|
56
|
-
"@pleasenobugs/server": "0.
|
|
56
|
+
"@pleasenobugs/server": "0.4.0",
|
|
57
57
|
"express": "^4.21.2",
|
|
58
58
|
"preact": "^10.24.3",
|
|
59
59
|
"puppeteer-core": "^23.11.1",
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { D as h } from "./index-13DToKWI.js";
|
|
2
|
-
function p(g = "en") {
|
|
3
|
-
const u = Date.now();
|
|
4
|
-
let i = (c[g] ?? c.en).map((e, t) => ({
|
|
5
|
-
id: `demo-${t}`,
|
|
6
|
-
kind: e.kind,
|
|
7
|
-
text: e.text,
|
|
8
|
-
at: u - e.ago,
|
|
9
|
-
status: e.status ?? "open",
|
|
10
|
-
votes: e.votes,
|
|
11
|
-
voted: !1,
|
|
12
|
-
mine: !1,
|
|
13
|
-
...e.who ? { who: e.who } : {},
|
|
14
|
-
...e.rating ? { rating: e.rating } : {},
|
|
15
|
-
...e.reply ? { reply: { text: e.reply, at: u - e.ago / 2 } } : {}
|
|
16
|
-
})), o, l = h.perDay;
|
|
17
|
-
const v = /* @__PURE__ */ new Map(), a = (e) => k({ ok: !0, data: e }), d = (e, t) => k({ ok: !1, status: e, error: t }), m = (e) => i.find((t) => t.id === e);
|
|
18
|
-
return {
|
|
19
|
-
project: "demo",
|
|
20
|
-
canSign: !0,
|
|
21
|
-
address: () => w,
|
|
22
|
-
signIn: () => a(w),
|
|
23
|
-
signOut() {
|
|
24
|
-
},
|
|
25
|
-
board: () => a({
|
|
26
|
-
project: { id: "demo", name: "Demo app", rules: { ...h, kinds: [...h.kinds] } },
|
|
27
|
-
posts: i.map((e) => ({ ...e })),
|
|
28
|
-
me: { owner: !1, left: l, ...o ? { name: o } : {} }
|
|
29
|
-
}),
|
|
30
|
-
me: () => a({ owner: !1, left: l, ...o ? { name: o } : {} }),
|
|
31
|
-
answers: () => a({ answers: [] }),
|
|
32
|
-
post(e) {
|
|
33
|
-
return l <= 0 ? d(429, "too_many") : e.kind === "review" && i.some((t) => t.mine && t.kind === "review") ? d(409, "reviewed") : (l -= 1, i = [
|
|
34
|
-
{
|
|
35
|
-
id: e.id,
|
|
36
|
-
kind: e.kind,
|
|
37
|
-
text: e.text,
|
|
38
|
-
at: Date.now(),
|
|
39
|
-
status: "open",
|
|
40
|
-
votes: 1,
|
|
41
|
-
voted: !0,
|
|
42
|
-
mine: !0,
|
|
43
|
-
...!e.anon && o ? { who: o } : {},
|
|
44
|
-
...e.kind === "review" ? { rating: e.rating } : {},
|
|
45
|
-
...e.shot?.board ? { shot: !0 } : {}
|
|
46
|
-
},
|
|
47
|
-
...i
|
|
48
|
-
], e.shot?.board && v.set(e.id, `data:${e.shot.type};base64,${e.shot.data}`), a({ ok: !0, left: l }));
|
|
49
|
-
},
|
|
50
|
-
// The visitor's own screenshots on the board; nothing else exists here.
|
|
51
|
-
shot: async (e) => {
|
|
52
|
-
const t = v.get(e);
|
|
53
|
-
return t ? a(await (await fetch(t)).blob()) : d(404, "not_found");
|
|
54
|
-
},
|
|
55
|
-
shotUrl: (e) => v.get(e) ?? "",
|
|
56
|
-
vote(e, t) {
|
|
57
|
-
const r = m(e);
|
|
58
|
-
return r ? (r.voted !== t && (r.votes += t ? 1 : -1), r.voted = t, a({ ok: !0, votes: r.votes, voted: r.voted })) : d(404, "not_found");
|
|
59
|
-
},
|
|
60
|
-
remove(e) {
|
|
61
|
-
const t = m(e);
|
|
62
|
-
return t ? (i = i.filter((r) => r !== t), v.delete(e), a({ ok: !0 })) : d(404, "not_found");
|
|
63
|
-
},
|
|
64
|
-
setName(e) {
|
|
65
|
-
o = e.trim() || void 0;
|
|
66
|
-
for (const t of i) t.mine && t.who !== void 0 && (t.who = o);
|
|
67
|
-
return a({ ok: !0, ...o ? { name: o } : {} });
|
|
68
|
-
},
|
|
69
|
-
manage: () => d(403, "not_owner")
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
const w = "NQ00 DEMO DEMO DEMO DEMO DEMO DEMO DEMO DEMO";
|
|
73
|
-
function k(g) {
|
|
74
|
-
return new Promise((u) => setTimeout(() => u(g), 250));
|
|
75
|
-
}
|
|
76
|
-
const s = 36e5, n = 24 * s, c = {
|
|
77
|
-
en: [
|
|
78
|
-
{ kind: "idea", text: "A dark mode that follows my phone", votes: 24, ago: 6 * n, status: "planned", who: "Mira", reply: "On its way in the next release." },
|
|
79
|
-
{ kind: "bug", text: "The send button does nothing after I switch accounts", votes: 17, ago: 2 * n, status: "done", reply: "Fixed in 1.4.2, thanks for the steps!" },
|
|
80
|
-
{ kind: "review", text: "Fast, simple and it never asks me twice. Love it.", votes: 9, ago: 3 * n, rating: 5, who: "Joost" },
|
|
81
|
-
{ kind: "idea", text: "Let me pin my favourite contacts to the top", votes: 12, ago: 4 * s },
|
|
82
|
-
{ kind: "review", text: "Does what it says. The history screen could be clearer.", votes: 4, ago: 9 * n, rating: 4 },
|
|
83
|
-
{ kind: "bug", text: "Amounts over 1,000 overlap the currency on small phones", votes: 6, ago: 20 * s, who: "Sam" },
|
|
84
|
-
{ kind: "idea", text: "Export my history as a CSV file", votes: 3, ago: 12 * n, status: "declined", reply: "Not for now: it would mean storing more than we want to." }
|
|
85
|
-
],
|
|
86
|
-
nl: [
|
|
87
|
-
{ kind: "idea", text: "Een donkere modus die mijn telefoon volgt", votes: 24, ago: 6 * n, status: "planned", who: "Mira", reply: "Komt in de volgende versie." },
|
|
88
|
-
{ kind: "bug", text: "De verstuurknop doet niets nadat ik van account wissel", votes: 17, ago: 2 * n, status: "done", reply: "Opgelost in 1.4.2, bedankt voor de stappen!" },
|
|
89
|
-
{ kind: "review", text: "Snel, simpel en hij vraagt nooit twee keer. Top.", votes: 9, ago: 3 * n, rating: 5, who: "Joost" },
|
|
90
|
-
{ kind: "idea", text: "Laat me mijn favoriete contacten bovenaan zetten", votes: 12, ago: 4 * s },
|
|
91
|
-
{ kind: "review", text: "Doet wat hij belooft. Het geschiedenisscherm kan duidelijker.", votes: 4, ago: 9 * n, rating: 4 },
|
|
92
|
-
{ kind: "bug", text: "Bedragen boven 1.000 vallen over de munt op kleine telefoons", votes: 6, ago: 20 * s, who: "Sam" },
|
|
93
|
-
{ kind: "idea", text: "Mijn geschiedenis exporteren als CSV-bestand", votes: 3, ago: 12 * n, status: "declined", reply: "Voorlopig niet: dan zouden we meer moeten bewaren dan we willen." }
|
|
94
|
-
],
|
|
95
|
-
de: [
|
|
96
|
-
{ kind: "idea", text: "Ein dunkler Modus, der meinem Handy folgt", votes: 24, ago: 6 * n, status: "planned", who: "Mira", reply: "Kommt mit der nächsten Version." },
|
|
97
|
-
{ kind: "bug", text: "Der Senden-Knopf tut nichts, nachdem ich das Konto wechsle", votes: 17, ago: 2 * n, status: "done", reply: "Behoben in 1.4.2, danke für die Schritte!" },
|
|
98
|
-
{ kind: "review", text: "Schnell, einfach und fragt nie zweimal. Super.", votes: 9, ago: 3 * n, rating: 5, who: "Joost" },
|
|
99
|
-
{ kind: "idea", text: "Lass mich meine Lieblingskontakte oben anheften", votes: 12, ago: 4 * s },
|
|
100
|
-
{ kind: "review", text: "Tut, was es verspricht. Der Verlauf könnte klarer sein.", votes: 4, ago: 9 * n, rating: 4 },
|
|
101
|
-
{ kind: "bug", text: "Beträge über 1.000 überlappen die Währung auf kleinen Handys", votes: 6, ago: 20 * s, who: "Sam" },
|
|
102
|
-
{ kind: "idea", text: "Meinen Verlauf als CSV-Datei exportieren", votes: 3, ago: 12 * n, status: "declined", reply: "Vorerst nicht: Dafür müssten wir mehr speichern, als wir wollen." }
|
|
103
|
-
]
|
|
104
|
-
};
|
|
105
|
-
export {
|
|
106
|
-
p as createDemoClient
|
|
107
|
-
};
|