tosijs-ui 1.16.4 → 1.16.6
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 +80 -0
- package/dist/data-table.d.ts +4 -4
- package/dist/data-table.js +23 -4
- package/dist/doc-browser.js +16 -1
- package/dist/float.d.ts +6 -0
- package/dist/float.js +7 -0
- package/dist/iife.js +109 -108
- package/dist/iife.js.map +12 -12
- package/dist/live-example/component.d.ts +32 -1
- package/dist/live-example/component.js +326 -6
- package/dist/live-example/execution.d.ts +2 -2
- package/dist/live-example/execution.js +2 -1
- package/dist/live-example/styles.d.ts +1 -1
- package/dist/live-example/styles.js +8 -2
- package/dist/pop-float.d.ts +5 -0
- package/dist/pop-float.js +50 -4
- package/dist/router.js +6 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/llms.txt +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.16.6
|
|
4
|
+
|
|
5
|
+
A one-fix patch: a link to the page you are already on no longer adds a history entry that Back
|
|
6
|
+
has to step through (#174). No API change.
|
|
7
|
+
|
|
8
|
+
### Clicking a link to the page you are on no longer costs an extra Back (#174)
|
|
9
|
+
|
|
10
|
+
A doc link pointing at the document already showing pushed a duplicate history entry, so the
|
|
11
|
+
next Back press left the page where it was. It now replaces the entry, as a native same-URL
|
|
12
|
+
navigation does. "The same page" means the same document: `/x`, `/x/` and `/x/index.html`, or
|
|
13
|
+
`?x` with extra query parameters, all count. A URL with a hash still pushes, so Back from
|
|
14
|
+
`/x/` returns to `/x/#example`. The `router`'s `navigate()` had the same defect and gets the
|
|
15
|
+
same rule: navigating to the current path (with no hash) replaces.
|
|
16
|
+
|
|
17
|
+
The double push #174 measured on every link (ensemble on 1.14.1) does not reproduce on 1.16.4
|
|
18
|
+
with the same direct import: one click, one entry, and Back and Forward both work, in Chromium
|
|
19
|
+
and WebKit. The documented consumer entry point is `import 'tosijs-ui/doc-browser'`, which
|
|
20
|
+
registers `<tosi-doc-system>` since 1.14.2. The deep `tosijs-ui/doc-system/doc-system.js`
|
|
21
|
+
import loads the same module.
|
|
22
|
+
|
|
23
|
+
## 1.16.5
|
|
24
|
+
|
|
25
|
+
A patch, mostly found by using the doc site on an iPhone: menus that stay on screen as Safari's
|
|
26
|
+
toolbars come and go, a code panel that fits the visible screen, and a REPL that completes as
|
|
27
|
+
you type (touchably, case-insensitively, with `$` and `$$`). Also quiet under tosijs 1.10.7's
|
|
28
|
+
long-list advice, and `pinnedTopRows` now works from the element creator. `dist/iife.js` grows
|
|
29
|
+
by 3.6 kB gzip (478.7 → 482.2 kB), including the move to tosijs 1.10.7, which it bundles.
|
|
30
|
+
|
|
31
|
+
**One read-side change to check for:** `<tosi-table>`'s `pinnedTopRows` and `pinnedBottomRows`
|
|
32
|
+
now read as `null` rather than `undefined` when unset (typed `any[] | null`). That is what makes
|
|
33
|
+
them work when passed to the element creator. Code that tested `table.pinnedTopRows ===
|
|
34
|
+
undefined` should test `== null` instead; truthiness checks are unaffected.
|
|
35
|
+
|
|
36
|
+
### `$` and `$$` in the REPL
|
|
37
|
+
|
|
38
|
+
As in a browser console: `$('.thing')` returns the first match and `$$('.thing')` an array of all
|
|
39
|
+
of them, within the example's own preview. An example's own `$`, or a page's jQuery, takes
|
|
40
|
+
precedence.
|
|
41
|
+
|
|
42
|
+
### The Console tab's REPL completes as you type
|
|
43
|
+
|
|
44
|
+
Typing a name, or a dot after a value, opens a list of suggestions above the prompt: the
|
|
45
|
+
value's properties (prototype chain included) or the names in scope (the example's own,
|
|
46
|
+
`preview`, `console`, the page's modules, globals). Tap one, or use ↓/↑ and Enter; Tab takes the
|
|
47
|
+
highlighted or first suggestion, and Escape closes the list. Rows are touch-sized, so it works
|
|
48
|
+
on a phone, where there is no Tab key and no browser console at all. Matching ignores case, and
|
|
49
|
+
the field turns off iOS's auto-capitalisation and autocorrect; the example's own names rank
|
|
50
|
+
above globals.
|
|
51
|
+
|
|
52
|
+
### Quiet under tosijs 1.10.7's long-list advice; `pinnedTopRows` works from the creator
|
|
53
|
+
|
|
54
|
+
tosijs 1.10.7 warns once about any list binding of more than 10 items that has neither
|
|
55
|
+
`virtual` nor a `nonVirtualReason`. tosijs-ui builds some lists its users can't reach, so it now
|
|
56
|
+
gives the reason itself:
|
|
57
|
+
|
|
58
|
+
- `<tosi-table>`'s pinned rows, which are always on screen;
|
|
59
|
+
- its body under `rowHeight: 0`, which is the author choosing to render every row (the table's
|
|
60
|
+
own warning still fires past 1,000 rows);
|
|
61
|
+
- the doc browser's flat nav in `routing: 'query'`.
|
|
62
|
+
|
|
63
|
+
While testing this, `tosiTable({ pinnedTopRows: [...] })` (and `pinnedBottomRows`) turned out to
|
|
64
|
+
be silently ignored when passed to the element creator: the getter returned `undefined` when
|
|
65
|
+
unset, so tosijs set an attribute instead. It now returns `null` when unset, and the creator
|
|
66
|
+
works (see the note at the top of these notes). The dev dependency moves to tosijs 1.10.7; the peer range is unchanged (`^1.10.3`).
|
|
67
|
+
|
|
68
|
+
### Menus stay inside the screen on iPhone as Safari's toolbars come and go
|
|
69
|
+
|
|
70
|
+
A menu's room was measured once, when it opened. Mobile Safari then shows and hides its toolbars
|
|
71
|
+
(and the keyboard comes and goes) as you touch the page, which changes the visible area without
|
|
72
|
+
a window resize, so a menu measured a moment earlier ran under the toolbar. Open floats (menus,
|
|
73
|
+
tooltips, hint lists) are now re-fitted to their anchor whenever the visible viewport changes.
|
|
74
|
+
Draggable floats are left where they are. Reported by the maintainer on an iPhone (the other
|
|
75
|
+
half of #2460).
|
|
76
|
+
|
|
77
|
+
### The Console tab's REPL is reachable on iPhone
|
|
78
|
+
|
|
79
|
+
A full-screen example (the code panel, or maximized) was sized `100vh`, which on iPhone Safari is
|
|
80
|
+
the height without the browser toolbar, so the bottom of the panel sat under it, and that is
|
|
81
|
+
where the Console tab's REPL input lives. It is now sized to the visible viewport (`100dvh`).
|
|
82
|
+
|
|
3
83
|
## 1.16.4
|
|
4
84
|
|
|
5
85
|
A patch: the example console becomes a tab with a REPL, test-only examples render on deployed
|
package/dist/data-table.d.ts
CHANGED
|
@@ -243,10 +243,10 @@ export declare class TosiTable extends TosiTable_base {
|
|
|
243
243
|
private _nonRepeatingGroupedRowCells;
|
|
244
244
|
private _pinnedTopRows?;
|
|
245
245
|
private _pinnedBottomRows?;
|
|
246
|
-
get pinnedTopRows(): any[] |
|
|
247
|
-
set pinnedTopRows(rows: any[] | undefined);
|
|
248
|
-
get pinnedBottomRows(): any[] |
|
|
249
|
-
set pinnedBottomRows(rows: any[] | undefined);
|
|
246
|
+
get pinnedTopRows(): any[] | null;
|
|
247
|
+
set pinnedTopRows(rows: any[] | null | undefined);
|
|
248
|
+
get pinnedBottomRows(): any[] | null;
|
|
249
|
+
set pinnedBottomRows(rows: any[] | null | undefined);
|
|
250
250
|
get effectivePinnedTopData(): any[];
|
|
251
251
|
get effectivePinnedBottomData(): any[];
|
|
252
252
|
private get effectiveBaseData();
|
package/dist/data-table.js
CHANGED
|
@@ -1578,15 +1578,20 @@ export class TosiTable extends withAttributes({
|
|
|
1578
1578
|
// count-based slicing.
|
|
1579
1579
|
_pinnedTopRows;
|
|
1580
1580
|
_pinnedBottomRows;
|
|
1581
|
+
/*
|
|
1582
|
+
`null`, not `undefined`, when unset: tosijs's element creator assigns a prop as a PROPERTY only
|
|
1583
|
+
when the instance's current value isn't `undefined`, and otherwise as an attribute — so
|
|
1584
|
+
`tosiTable({ pinnedTopRows: [...] })` was silently ignored (tosijs board #2464).
|
|
1585
|
+
*/
|
|
1581
1586
|
get pinnedTopRows() {
|
|
1582
|
-
return this._pinnedTopRows;
|
|
1587
|
+
return this._pinnedTopRows ?? null;
|
|
1583
1588
|
}
|
|
1584
1589
|
set pinnedTopRows(rows) {
|
|
1585
1590
|
this._pinnedTopRows = rows ? tosiValue(rows) : undefined;
|
|
1586
1591
|
this.queueRender();
|
|
1587
1592
|
}
|
|
1588
1593
|
get pinnedBottomRows() {
|
|
1589
|
-
return this._pinnedBottomRows;
|
|
1594
|
+
return this._pinnedBottomRows ?? null;
|
|
1590
1595
|
}
|
|
1591
1596
|
set pinnedBottomRows(rows) {
|
|
1592
1597
|
this._pinnedBottomRows = rows ? tosiValue(rows) : undefined;
|
|
@@ -2364,7 +2369,11 @@ export class TosiTable extends withAttributes({
|
|
|
2364
2369
|
the visible data, so they have no parity, and blanking their non-repeating cells
|
|
2365
2370
|
would empty a pinned header/summary row purely because it is not in `firstRows`.
|
|
2366
2371
|
*/
|
|
2367
|
-
(_elements, item) => this.buildRow(item, cols, stickyInfo, rowClass, false),
|
|
2372
|
+
(_elements, item) => this.buildRow(item, cols, stickyInfo, rowClass, false),
|
|
2373
|
+
// tosijs warns about long unvirtualised lists (1.10.7); the author can't reach this one
|
|
2374
|
+
{
|
|
2375
|
+
nonVirtualReason: 'pinned rows are always on screen, so every one is rendered (a handful by design)',
|
|
2376
|
+
});
|
|
2368
2377
|
return div({
|
|
2369
2378
|
class: `tbody tbody-${region}`,
|
|
2370
2379
|
role: 'rowgroup',
|
|
@@ -3338,7 +3347,17 @@ export class TosiTable extends withAttributes({
|
|
|
3338
3347
|
// The visible-rows listBinding is bound directly to .scroll-area so
|
|
3339
3348
|
// virtualisation observes the same scroll container that sticky cells
|
|
3340
3349
|
// stick against.
|
|
3341
|
-
const visibleBinding = this.rowData.visible.listBinding((_elements, item) => this.buildRow(item, cols, stickyInfo), this.rowHeight > 0
|
|
3350
|
+
const visibleBinding = this.rowData.visible.listBinding((_elements, item) => this.buildRow(item, cols, stickyInfo), this.rowHeight > 0
|
|
3351
|
+
? { virtual: { height: this.rowHeight } }
|
|
3352
|
+
: /*
|
|
3353
|
+
`rowHeight: 0` IS the author saying "render every row" (documented for small tables
|
|
3354
|
+
and variable row heights), so say so to tosijs rather than have it warn about a choice
|
|
3355
|
+
already made. A table big enough for that to hurt still gets <tosi-table>'s own
|
|
3356
|
+
warning past NON_VIRTUAL_ROW_ADVICE rows (#84).
|
|
3357
|
+
*/
|
|
3358
|
+
{
|
|
3359
|
+
nonVirtualReason: 'rowHeight: 0 — the author chose to render every row (<tosi-table> warns past 1,000)',
|
|
3360
|
+
});
|
|
3342
3361
|
this._scrollArea = div({ class: 'scroll-area', part: 'visibleRows' }, ...[
|
|
3343
3362
|
this._head,
|
|
3344
3363
|
this._tbodyTop,
|
package/dist/doc-browser.js
CHANGED
|
@@ -1027,7 +1027,19 @@ export function createDocBrowser(options) {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
else {
|
|
1029
1029
|
const href = hrefFor(filename);
|
|
1030
|
-
|
|
1030
|
+
/*
|
|
1031
|
+
A link to the document already showing REPLACES the entry rather than pushing one, as a
|
|
1032
|
+
native same-URL navigation does. Pushing left a duplicate the reader had to Back
|
|
1033
|
+
through, and Back then visibly did nothing — the symptom #174 reported.
|
|
1034
|
+
|
|
1035
|
+
"Same" is the DOCUMENT, the identity the popstate guard uses, not the raw path: `/x`,
|
|
1036
|
+
`/x/` and `/x/index.html`, or `?x` and `?x&_testMode=1`, are one page. A URL carrying a
|
|
1037
|
+
hash still pushes, because leaving `/x/#example` for `/x/` is a navigation the reader
|
|
1038
|
+
may want to come Back from.
|
|
1039
|
+
*/
|
|
1040
|
+
const same = filename === String(app.currentDoc.filename) &&
|
|
1041
|
+
document.location.hash === '';
|
|
1042
|
+
window.history[same ? 'replaceState' : 'pushState']({ href }, '', href);
|
|
1031
1043
|
}
|
|
1032
1044
|
navigateTo(filename);
|
|
1033
1045
|
};
|
|
@@ -1490,6 +1502,9 @@ export function createDocBrowser(options) {
|
|
|
1490
1502
|
idPath: 'filename',
|
|
1491
1503
|
hiddenProp: 'hidden',
|
|
1492
1504
|
value: app.docs,
|
|
1505
|
+
// the flat nav (query routing) lists every doc so the search can filter it and a
|
|
1506
|
+
// reader can scan it; the site's author can't reach this binding to say so
|
|
1507
|
+
nonVirtualReason: 'doc navigation: every doc is listed so search can filter it',
|
|
1493
1508
|
},
|
|
1494
1509
|
}, template(a({
|
|
1495
1510
|
class: 'doc-link',
|
package/dist/float.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ElementCreator } from 'tosijs';
|
|
2
|
+
import type { FloatPosition } from './pop-float.js';
|
|
2
3
|
declare const TosiFloat_base: import("tosijs").WithAttributes<{
|
|
3
4
|
drag: boolean;
|
|
4
5
|
remainOnResize: "hide" | "remove" | "remain";
|
|
@@ -12,6 +13,11 @@ export declare class TosiFloat extends TosiFloat_base {
|
|
|
12
13
|
* (the page, or a scroller containing it) triggers `remainOnScroll`. `null`: any scroll does.
|
|
13
14
|
*/
|
|
14
15
|
anchor: Element | null;
|
|
16
|
+
/**
|
|
17
|
+
* The position it was asked for against its anchor (set by `positionFloat`), so it can be
|
|
18
|
+
* re-fitted when the visible viewport changes. `null`: never positioned against an anchor.
|
|
19
|
+
*/
|
|
20
|
+
anchorPosition: FloatPosition | null;
|
|
15
21
|
content: HTMLSlotElement;
|
|
16
22
|
static shadowStyleSpec: {
|
|
17
23
|
':host': {
|
package/dist/float.js
CHANGED
|
@@ -106,6 +106,13 @@ export class TosiFloat extends withAttributes({
|
|
|
106
106
|
* (the page, or a scroller containing it) triggers `remainOnScroll`. `null`: any scroll does.
|
|
107
107
|
*/
|
|
108
108
|
anchor = null;
|
|
109
|
+
/**
|
|
110
|
+
* The position it was asked for against its anchor (set by `positionFloat`), so it can be
|
|
111
|
+
* re-fitted when the visible viewport changes. `null`: never positioned against an anchor.
|
|
112
|
+
*/
|
|
113
|
+
// typed FloatPosition, not string: as `string` it accepted the CSS position '' / 'fixed'
|
|
114
|
+
// that a shadowed variable stored there (1.16.5 review B1), and the compiler said nothing
|
|
115
|
+
anchorPosition = null;
|
|
109
116
|
content = slot();
|
|
110
117
|
static shadowStyleSpec = {
|
|
111
118
|
':host': {
|