mnfst 0.5.245 → 0.5.247

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.245';
5
+ const MANIFEST_BUILD_VERSION = '0.5.247';
6
6
 
7
7
  /* Manifest Data Sources - Appwrite Integration */
8
8
 
@@ -199,6 +199,7 @@
199
199
  cfg.dataLabels = !!cfg.dataLabels; // static value labels off by default
200
200
  cfg.gap = num(cfg.gap, 1); // heatmap tile gutter in px
201
201
  cfg.labels = Array.isArray(cfg.labels) ? cfg.labels : [];
202
+ cfg.tickAnchor = cfg.tickAnchor === 'end' ? 'end' : 'start';
202
203
 
203
204
  // Series may be omitted in favor of a single `data` array. (A map's
204
205
  // `data` is a region→value object, left untouched for drawMap.)
@@ -565,9 +566,9 @@
565
566
  else if (cfg.type === 'scatter') drawScatter(state, plot, labels, iw, ih, y);
566
567
  else drawLines(state, plot, labels, iw, ih, y); // line + area
567
568
 
568
- // x axis labels (banded), evenly thinned so they never overlap
569
+ // x axis labels, thinned by a whole step so they never overlap
569
570
  if (cfg.axis) {
570
- xAxisTicks(root, marks, xScheme(cfg, d3, labels.length, iw).x, iw, m).forEach(([t, cx]) => {
571
+ xAxisTicks(root, marks, xScheme(cfg, d3, labels.length, iw).x, iw, m, cfg.tickAnchor).forEach(([t, cx]) => {
571
572
  text(plot, t.label, { x: cx, y: ih + 16, 'text-anchor': 'middle' });
572
573
  });
573
574
  }
@@ -606,9 +607,9 @@
606
607
  return ok ? Math.round(+v) : -1;
607
608
  }
608
609
 
609
- // Marks + x to draw: the most evenly spaced subset (first and last kept)
610
- // whose measured labels don't overlap; ends clamped inside the svg.
611
- function xAxisTicks(root, marks, xc, iw, m) {
610
+ // Marks + x to draw: every s-th mark for the smallest whole step s whose
611
+ // measured labels don't overlap, counted from `tickAnchor` ('start' | 'end'); ends clamped inside the svg.
612
+ function xAxisTicks(root, marks, xc, iw, m, anchor) {
612
613
  const N = marks.length;
613
614
  if (!N) return [];
614
615
  const GAP = 6;
@@ -623,15 +624,15 @@
623
624
  }
624
625
  const center = k => xc(marks[k].at);
625
626
  const xAt = k => Math.min(Math.max(center(k), -m.left + half(k)), iw + m.right - half(k));
626
- const pick = c => Array.from({ length: c }, (_, j) => Math.round(j * (N - 1) / (c - 1)));
627
+ const end = anchor === 'end';
628
+ const pick = s => { const ks = []; for (let k = end ? N - 1 : 0; k >= 0 && k < N; k += end ? -s : s) ks.push(k); return end ? ks.reverse() : ks; };
627
629
  const fits = ks => ks.every((k, j) => !j || xAt(k) - xAt(ks[j - 1]) >= half(k) + half(ks[j - 1]) + GAP);
628
- const span = center(N - 1) - center(0);
629
- const minW = N <= 60 ? Math.min(...marks.map((_, k) => half(k) * 2)) : half(0) * 2;
630
- for (let c = Math.min(N, Math.floor(span / (minW + GAP)) + 1); c > 1; c--) {
631
- const ks = pick(c);
630
+ for (let s = 1; s < N; s++) {
631
+ const ks = pick(s);
632
632
  if (fits(ks)) return ks.map(k => [marks[k], xAt(k)]);
633
633
  }
634
- return [[marks[0], xAt(0)]];
634
+ const k = end ? N - 1 : 0;
635
+ return [[marks[k], xAt(k)]];
635
636
  }
636
637
 
637
638
  // `list` lets combo pass a subset of series with their original indices
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.245';
5
+ const MANIFEST_BUILD_VERSION = '0.5.247';
6
6
 
7
7
  /* Manifest Data Sources - Configuration */
8
8
 
@@ -11502,6 +11502,11 @@ function dropSubscription(dataSourceName, unsubscribe) {
11502
11502
  if (subs?.get?.(dataSourceName) === unsubscribe) subs.delete(dataSourceName);
11503
11503
  }
11504
11504
 
11505
+ // Init couldn't reach Appwrite: signed out locally until the recheck confirms or clears the session
11506
+ function sessionUnverified(auth) {
11507
+ return auth?._sessionUnverified === true && auth.isAuthenticated !== true;
11508
+ }
11509
+
11505
11510
  // Auth settled with no identity (or no auth plugin): a scoped read can't resolve until sign-in
11506
11511
  function authSettledSignedOut() {
11507
11512
  const auth = currentAuth();
@@ -12117,6 +12122,11 @@ async function loadDataSource(dataSourceName, locale = 'en', options = {}) {
12117
12122
  return false;
12118
12123
  }
12119
12124
  if (!authSettledUnresolvable(manifest)) return false;
12125
+ // Offline/unverified: restored rows of the last-known identity stay (logout and identity changes still reset)
12126
+ if (sessionUnverified(currentAuth()) && hasLiveRows(dataSourceName)) {
12127
+ setSourceState(dataSourceName, { loading: false, error: null, ready: true });
12128
+ return true;
12129
+ }
12120
12130
  updateStore(dataSourceName, [], { loading: false, error: null, ready: true });
12121
12131
  return true;
12122
12132
  };
@@ -444,6 +444,21 @@
444
444
  const d = iso ? D.fromISO(iso) : null;
445
445
  if (d) { this.selected = d; this.view = { y: d.getFullYear(), m: d.getMonth() + 1 }; }
446
446
  }
447
+ this.fitView();
448
+ },
449
+
450
+ // Initial view: shift so no panel lies past max's month (max last) or before min's.
451
+ fitView() {
452
+ const c = Math.max(1, Math.min(4, this.monthCount || 1));
453
+ const mi = d => d.getFullYear() * 12 + d.getMonth();
454
+ const sel = this.selectionMode === 'range' ? [this.rangeStart, this.rangeEnd || this.rangeStart]
455
+ : this.selectionMode === 'multiple' ? [this.selectedDates[0], this.selectedDates[this.selectedDates.length - 1]]
456
+ : [this.selected, this.selected];
457
+ const lo = sel[0] ? mi(sel[0]) : null, hi = sel[1] ? mi(sel[1]) : null;
458
+ let first = this.view.y * 12 + this.view.m - 1;
459
+ if (this.max) { const mx = mi(this.max); if (first + c - 1 > mx && (hi == null || hi <= mx)) first = mx - c + 1; }
460
+ if (this.min) { const mn = mi(this.min); if (first < mn && (lo == null || lo >= mn)) first = mn; }
461
+ this.view = { y: Math.floor(first / 12), m: first % 12 + 1 };
447
462
  },
448
463
 
449
464
  // Only the plugin-generated dropdown opens here; native showPopover() rides
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "manifest.appwrite.auth.js": "sha384-dsIWnH0qCAGSzAXMGrd8fvOrVl4tOIE6j5tC35JPTrQXZ56qLD36ARyvhR7vi3Id",
3
- "manifest.appwrite.data.js": "sha384-bg/IZDy3pRsvCsopmIJQ1g5uc3KjpL6O1X/waOZLwDw0KjXuHsG8dRMkKdTdviP4",
3
+ "manifest.appwrite.data.js": "sha384-sNtP9DeNzeKENXQRFUh1HC5t3SZNFJPbzc9bTuosCf181JbY4v8i3hjKenuP2ICr",
4
4
  "manifest.appwrite.presences.js": "sha384-JyVDWFT69b7Svq8J8p9tNWe2v9PZNQBY5UyhtOl1vnuHFAX0CRQ3MA9SiKq5wzNh",
5
5
  "manifest.bindings.js": "sha384-lPtMf8Ykaic9gNVZKq8Scia1881ZeMAyxer3WCIkUNwwrgzGBWto1OXADUwjvORF",
6
- "manifest.charts.js": "sha384-FTLltd+0atALQQD5Wi9eASFnNYYzhxouH3HJlMkFrDfjTV9/8TZhEif7bMDqElq3",
6
+ "manifest.charts.js": "sha384-G+huD7UvjF9zDovdVVlh4I5X1Mq4oNnJfoFg4NnGdP3R/4Skq9hy5cGuHNYLxDYm",
7
7
  "manifest.chat.js": "sha384-88DfMfJLoi2oxclVD2iIMDkIGAExMXq5k47mekUredlicLaP3oZY5bwtwqs+TqDF",
8
8
  "manifest.code.js": "sha384-WGPlZE5Sp9GygUzJSmCdpLyYQTgvmEKc9BQS9Hmq1VTQwkqYJzPSWibHvPekcres",
9
9
  "manifest.color.js": "sha384-6Rv3LxyTcZNjrhtayQfqRdCx0uSZ4BiEbgEI98I62eTvp8Aw7LBIoNJ0Je1oktwL",
@@ -11,8 +11,8 @@
11
11
  "manifest.combobox.js": "sha384-MILTkrgsTzsYUjGo4ZuADqV85Xs4GmfB4xexfe9vbJMIoQTZ42W4zs+DTaVSPEsx",
12
12
  "manifest.components.js": "sha384-BUFA8h+G5Plr82sV7bKzO42pPoiRZwRQcKj1lt2ROFiKjjlkayU/vmkAFqEsdBA+",
13
13
  "manifest.computed.js": "sha384-GYML/e81gQfN+iDbqhPUgny8bINCyL+SrbTofoGk4hlCnLLjv51mCv42JMqq+ku5",
14
- "manifest.data.js": "sha384-Ie+YDjD9X8mUgLqbRdgt6KLXNSB6ysP++yBs3W7JdhLr19xIkY9d54RLVGvwY6v7",
15
- "manifest.datepicker.js": "sha384-XnbeURni2X91ozVzatQcSjYYIS4MoW12dBRJnYAGBr0nCQ624heH5s+xtQSpLZX6",
14
+ "manifest.data.js": "sha384-iaM1hIuvlArTLhJ2+79JpXpiRPusnKhldmHU00hFijo8kR8Ai1iKR3g5vuujCOBJ",
15
+ "manifest.datepicker.js": "sha384-2XwFFnS4Bg5FDvG/v8x6KUvrjcBQEOYyTxynX2K/D/Qb3PI6+Y04lEwCnVDJLzwL",
16
16
  "manifest.defer.js": "sha384-pMRGqQKiEoJhpUcD40QeM4jEHau7sz9Xn/YCpiUamT1T4xJBZDSiYX+xnVrSWoq+",
17
17
  "manifest.device.js": "sha384-g+txmrEszYtuOvRelTp/c1wSNR2AtllVI9rx5NPPD7DzhVUnMNughonZykv2xlBW",
18
18
  "manifest.dropdowns.js": "sha384-acufUps7R9WjqB4XXW5JLACqniuHJGM4CNTb2rF4B2Q/jv7ZRmsAwfr2McanOz3s",
@@ -28,7 +28,7 @@
28
28
  "manifest.slides.js": "sha384-3uRTkyK9XPLmnxI2+igZlpi4EyPlU/7IHj5j3BZJJ2KN455vXyk99fiXV3feO/XY",
29
29
  "manifest.status.js": "sha384-MBO345ab7H6Uq1X2dZLt4Ge1Gcra+Z2qYApvlAeIV8CJhDDJrz2FPXpp+Kcp8zcM",
30
30
  "manifest.svg.js": "sha384-qr/8H9+2cIhSXNbRWRtIdrDlTOxKlNJqwEefHvCYoiBNW/kKhPTFa109Orv/EBnb",
31
- "manifest.sw.js": "sha384-rK22P7FyWRLX/DuW34gS9OIShs4Jo/s5+10o9Y23dbrbktHY3XYfzRygMlIgK4IB",
31
+ "manifest.sw.js": "sha384-61zm8U61fdgOmq50j9aAplOPmDAhK7OhIydJW4OdxEKjnSkMT5WNzWTqcrk3+UGc",
32
32
  "manifest.tabs.js": "sha384-OIIcyaQnGS0eNYk4zgAFEDboNYect7THvUd9D0V6nqCeDOxQcoiqLrBEmmWVTTet",
33
33
  "manifest.tailwind.js": "sha384-r/Jvqb+Piz21jUts10BbVAJoKkShOdJRVFpywyi4HPIi/OfOJq5CtPyWAPbdkMgt",
34
34
  "manifest.toasts.js": "sha384-3zkWxzw693pxg3QDFsoYCA3CqYaLKmBaMArULXODD66Utolpewl0OAeTB92aWUVv",
@@ -16,7 +16,7 @@
16
16
 
17
17
  // Build stamps the published version here; unstamped (dev) falls back to the
18
18
  // registration URL's `v`, then 'dev'.
19
- const BUILD_VERSION = '0.5.245';
19
+ const BUILD_VERSION = '0.5.247';
20
20
  const CACHE_PREFIX = 'mnfst-sw:';
21
21
  const META_CACHE = CACHE_PREFIX + 'meta';
22
22
  // Sized to hold a full precache.json warm-up (PRECACHE_MAX_ENTRIES server-side)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst",
3
- "version": "0.5.245",
3
+ "version": "0.5.247",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",