@wildwinter/app-shell 0.19.0 → 0.21.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/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -334,6 +334,11 @@ interface GameIdEditorOptions {
|
|
|
334
334
|
validate?: (gameId: string) => boolean;
|
|
335
335
|
/** Where the panel goes, for hosts that anchor it somewhere tight. */
|
|
336
336
|
prefer?: "left" | "below" | "centre";
|
|
337
|
+
/** Chrome the panel must not cover, passed through to the anchored panel: an
|
|
338
|
+
* app with a problems bar along the bottom wants it usable while an address
|
|
339
|
+
* is being edited. Without this the editor is the one panel in a host that
|
|
340
|
+
* can land on top of its own bars. */
|
|
341
|
+
keepClear?: string[];
|
|
337
342
|
}
|
|
338
343
|
/**
|
|
339
344
|
* Open it. Returns false when that click TOGGLED the panel shut, which is the
|
|
@@ -462,6 +467,12 @@ interface CommentsOptions {
|
|
|
462
467
|
deleteMessage?: (threadId: string, index: number) => void;
|
|
463
468
|
/** Where the panel sits: "centre" for a point on a canvas (see anchored.ts). */
|
|
464
469
|
prefer?: "left" | "below" | "centre";
|
|
470
|
+
/**
|
|
471
|
+
* Chrome the panel must not cover. Defaults to `[".problembar"]`, which was
|
|
472
|
+
* hardcoded here and should not have been: one app's class name in shared
|
|
473
|
+
* code, and it misses any OTHER bar a host has. A second app arrived with two.
|
|
474
|
+
*/
|
|
475
|
+
keepClear?: string[];
|
|
465
476
|
/**
|
|
466
477
|
* The text a thread is pinned to, shown above it as a quotation.
|
|
467
478
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -334,6 +334,11 @@ interface GameIdEditorOptions {
|
|
|
334
334
|
validate?: (gameId: string) => boolean;
|
|
335
335
|
/** Where the panel goes, for hosts that anchor it somewhere tight. */
|
|
336
336
|
prefer?: "left" | "below" | "centre";
|
|
337
|
+
/** Chrome the panel must not cover, passed through to the anchored panel: an
|
|
338
|
+
* app with a problems bar along the bottom wants it usable while an address
|
|
339
|
+
* is being edited. Without this the editor is the one panel in a host that
|
|
340
|
+
* can land on top of its own bars. */
|
|
341
|
+
keepClear?: string[];
|
|
337
342
|
}
|
|
338
343
|
/**
|
|
339
344
|
* Open it. Returns false when that click TOGGLED the panel shut, which is the
|
|
@@ -462,6 +467,12 @@ interface CommentsOptions {
|
|
|
462
467
|
deleteMessage?: (threadId: string, index: number) => void;
|
|
463
468
|
/** Where the panel sits: "centre" for a point on a canvas (see anchored.ts). */
|
|
464
469
|
prefer?: "left" | "below" | "centre";
|
|
470
|
+
/**
|
|
471
|
+
* Chrome the panel must not cover. Defaults to `[".problembar"]`, which was
|
|
472
|
+
* hardcoded here and should not have been: one app's class name in shared
|
|
473
|
+
* code, and it misses any OTHER bar a host has. A second app arrived with two.
|
|
474
|
+
*/
|
|
475
|
+
keepClear?: string[];
|
|
465
476
|
/**
|
|
466
477
|
* The text a thread is pinned to, shown above it as a quotation.
|
|
467
478
|
*
|
package/dist/index.js
CHANGED
|
@@ -50,7 +50,7 @@ function tagChips(holder, onChange) {
|
|
|
50
50
|
const chip = el("span", "shell-tag", v);
|
|
51
51
|
const x = el("button", "shell-tag-x", "\u2715");
|
|
52
52
|
x.type = "button";
|
|
53
|
-
x.
|
|
53
|
+
x.dataset["tip"] = `remove ${v}`;
|
|
54
54
|
x.setAttribute("aria-label", `remove ${v}`);
|
|
55
55
|
x.addEventListener("click", () => {
|
|
56
56
|
holder.values = (holder.values ?? []).filter((o) => o !== v);
|
|
@@ -307,7 +307,7 @@ function expandableRow(opts) {
|
|
|
307
307
|
for (const d of opts.details) details.append(d);
|
|
308
308
|
const toggle = el("button", "set-expand");
|
|
309
309
|
toggle.type = "button";
|
|
310
|
-
toggle.
|
|
310
|
+
toggle.dataset.tip = "More";
|
|
311
311
|
toggle.setAttribute("aria-label", "More");
|
|
312
312
|
toggle.setAttribute("aria-expanded", "false");
|
|
313
313
|
toggle.addEventListener("click", () => {
|
|
@@ -705,7 +705,8 @@ function openGameIdEditor(opts) {
|
|
|
705
705
|
className: "shell-id-editor",
|
|
706
706
|
title: opts.title ?? "Game ID",
|
|
707
707
|
width: 260,
|
|
708
|
-
...opts.prefer !== void 0 ? { prefer: opts.prefer } : {}
|
|
708
|
+
...opts.prefer !== void 0 ? { prefer: opts.prefer } : {},
|
|
709
|
+
...opts.keepClear !== void 0 ? { keepClear: opts.keepClear } : {}
|
|
709
710
|
});
|
|
710
711
|
if (!panel) return false;
|
|
711
712
|
const input = el("input", "shell-id-input");
|
|
@@ -1004,7 +1005,7 @@ function openComments(opts) {
|
|
|
1004
1005
|
// want it to the left; and never over the problems bar, which an author may
|
|
1005
1006
|
// be stepping through while reading the thread.
|
|
1006
1007
|
prefer: opts.prefer ?? "below",
|
|
1007
|
-
keepClear: [".problembar"]
|
|
1008
|
+
keepClear: opts.keepClear ?? [".problembar"]
|
|
1008
1009
|
});
|
|
1009
1010
|
if (!panel) return;
|
|
1010
1011
|
const { body, close } = panel;
|
|
@@ -1052,7 +1053,8 @@ function openComments(opts) {
|
|
|
1052
1053
|
);
|
|
1053
1054
|
if (opts.deleteMessage && message.deleted !== true) {
|
|
1054
1055
|
const bin = el("button", { className: "shell-cmt-del", text: "\u2715" });
|
|
1055
|
-
bin.
|
|
1056
|
+
bin.dataset.tip = "Delete this comment";
|
|
1057
|
+
bin.setAttribute("aria-label", "Delete this comment");
|
|
1056
1058
|
bin.addEventListener("click", () => opts.deleteMessage?.(thread.id, index));
|
|
1057
1059
|
head.append(bin);
|
|
1058
1060
|
}
|