@nano133/nanoterra 0.6.0 → 0.6.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/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/dist/friends/handler.d.ts +2 -2
- package/dist/friends/handler.js +2 -2
- package/dist/friends/panel/mount.js +1 -1
- package/package.json +1 -1
- package/src/friends/handler.ts +2 -2
- package/src/friends/panel/mount.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.1 (2026-10-30)
|
|
4
|
+
|
|
5
|
+
- **Friends: a name may be 80 characters** (it was 64), so a whole Nano address (65 with `nano_`) reaches the game's `PlayerDirectory`: the handler's
|
|
6
|
+
`FRIENDS_LIMITS.nameMax` and the panel's name field.
|
|
7
|
+
|
|
3
8
|
## 0.6.0 (2026-10-30)
|
|
4
9
|
|
|
5
10
|
- **A friends list for the game's players** (`@nano133/nanoterra/friends`, `/friends/d1`, `/friends/firestore`, `/friends/conformance`, `/friends/panel` and
|
package/README.md
CHANGED
|
@@ -682,7 +682,7 @@ import "@nano133/nanoterra/friends/style.css";
|
|
|
682
682
|
const settings = await (await fetch("/api/settings")).json(); // your route: loadGameSettings(store, defaults) from "@nano133/nanoterra/admin"
|
|
683
683
|
const friends = mountFriends(document.getElementById("friends")!, {
|
|
684
684
|
mode: settings.friends, // "nanoterra" | "own" | "off"
|
|
685
|
-
game: "
|
|
685
|
+
game: "my-game", // your game's id on Nanoterra (its listing's id: Echo Island's is "gem-island")
|
|
686
686
|
where: "Lobby", // where the player is, in your words: friends see it
|
|
687
687
|
onJoin: (target) => go(target), // optional: "nanoterra" gives a friend's https address, "own" an invite's place (and the friend's name)
|
|
688
688
|
});
|
|
@@ -22,8 +22,8 @@ export declare const FRIENDS_LIMITS: {
|
|
|
22
22
|
};
|
|
23
23
|
/** The biggest body of a POST. */
|
|
24
24
|
readonly bodyMax: 1024;
|
|
25
|
-
/** The longest name a request may send. */
|
|
26
|
-
readonly nameMax:
|
|
25
|
+
/** The longest name a request may send: room for a whole Nano address (65 characters with "nano_"), which a directory may accept as a name. */
|
|
26
|
+
readonly nameMax: 80;
|
|
27
27
|
};
|
|
28
28
|
export declare function createFriendsHandler(options: FriendsHandlerOptions): {
|
|
29
29
|
base: string;
|
package/dist/friends/handler.js
CHANGED
|
@@ -19,8 +19,8 @@ export const FRIENDS_LIMITS = {
|
|
|
19
19
|
calls: { limit: 30, windowMs: 60_000 },
|
|
20
20
|
/** The biggest body of a POST. */
|
|
21
21
|
bodyMax: 1024,
|
|
22
|
-
/** The longest name a request may send. */
|
|
23
|
-
nameMax:
|
|
22
|
+
/** The longest name a request may send: room for a whole Nano address (65 characters with "nano_"), which a directory may accept as a name. */
|
|
23
|
+
nameMax: 80,
|
|
24
24
|
};
|
|
25
25
|
const sharedLimit = memoryLimiter();
|
|
26
26
|
const OPS = new Set(["request", "accept", "decline", "remove", "block", "unblock", "invite", "pulse", "visibility"]);
|
|
@@ -173,7 +173,7 @@ function ownList(body, options, whereNow, setBadge, ask) {
|
|
|
173
173
|
const api = createApi(options.base ?? "/friends", options.fetch);
|
|
174
174
|
const lease = Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
175
175
|
const status = h("p", { class: "n133f-status", role: "status", "aria-live": "polite" });
|
|
176
|
-
const nameInput = h("input", { class: "n133f-input", type: "text", name: "friend", maxlength:
|
|
176
|
+
const nameInput = h("input", { class: "n133f-input", type: "text", name: "friend", maxlength: 80, autocomplete: "off", placeholder: "A player's name", "aria-label": "A player's name" });
|
|
177
177
|
const addKey = h("button", { class: "n133f-btn n133f-primary", type: "submit" }, "Add");
|
|
178
178
|
const form = h("form", { class: "n133f-add" }, nameInput, addKey);
|
|
179
179
|
const list = h("div", { class: "n133f-list" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nano133/nanoterra",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Nanoterra for a creator's game, in one package: the player's sign-in ticket, the player's character (a toon body on the island's skeleton), the looks ladder, the admin and the friends list.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
package/src/friends/handler.ts
CHANGED
|
@@ -38,8 +38,8 @@ export const FRIENDS_LIMITS = {
|
|
|
38
38
|
calls: { limit: 30, windowMs: 60_000 },
|
|
39
39
|
/** The biggest body of a POST. */
|
|
40
40
|
bodyMax: 1024,
|
|
41
|
-
/** The longest name a request may send. */
|
|
42
|
-
nameMax:
|
|
41
|
+
/** The longest name a request may send: room for a whole Nano address (65 characters with "nano_"), which a directory may accept as a name. */
|
|
42
|
+
nameMax: 80,
|
|
43
43
|
} as const;
|
|
44
44
|
|
|
45
45
|
const sharedLimit = memoryLimiter();
|
|
@@ -202,7 +202,7 @@ function ownList(body: HTMLElement, options: FriendsMountOptions, whereNow: () =
|
|
|
202
202
|
const api: Api = createApi(options.base ?? "/friends", options.fetch);
|
|
203
203
|
const lease = Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
204
204
|
const status = h("p", { class: "n133f-status", role: "status", "aria-live": "polite" });
|
|
205
|
-
const nameInput = h("input", { class: "n133f-input", type: "text", name: "friend", maxlength:
|
|
205
|
+
const nameInput = h("input", { class: "n133f-input", type: "text", name: "friend", maxlength: 80, autocomplete: "off", placeholder: "A player's name", "aria-label": "A player's name" });
|
|
206
206
|
const addKey = h("button", { class: "n133f-btn n133f-primary", type: "submit" }, "Add");
|
|
207
207
|
const form = h("form", { class: "n133f-add" }, nameInput, addKey);
|
|
208
208
|
const list = h("div", { class: "n133f-list" });
|