mnfst 0.5.234 → 0.5.235

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.234';
5
+ const MANIFEST_BUILD_VERSION = '0.5.235';
6
6
 
7
7
  /* Manifest Data Sources - Appwrite Integration */
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.234';
5
+ const MANIFEST_BUILD_VERSION = '0.5.235';
6
6
 
7
7
  /* Manifest Data Sources - Configuration */
8
8
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest.appwrite.auth.js": "sha384-dsIWnH0qCAGSzAXMGrd8fvOrVl4tOIE6j5tC35JPTrQXZ56qLD36ARyvhR7vi3Id",
3
- "manifest.appwrite.data.js": "sha384-pj/2ZCUMXz3zTWPZyICJHfCPnz5srho9URrw0Sl0nfWuvh5KqvoT/g3Kg4uyv7yl",
3
+ "manifest.appwrite.data.js": "sha384-U1jsUuWiDJM4Gis+q87cyGQMA+iyShm2cxBTZNhdQLXDLjZoxO5KomiRzUTdBZDF",
4
4
  "manifest.appwrite.presences.js": "sha384-JyVDWFT69b7Svq8J8p9tNWe2v9PZNQBY5UyhtOl1vnuHFAX0CRQ3MA9SiKq5wzNh",
5
5
  "manifest.bindings.js": "sha384-lPtMf8Ykaic9gNVZKq8Scia1881ZeMAyxer3WCIkUNwwrgzGBWto1OXADUwjvORF",
6
6
  "manifest.charts.js": "sha384-gEAv/98+29RbhvNkiNWTNyBPbLTFr2Ld15wLu29FLCL57j1cwGChRrL9Pfk7dBtT",
@@ -11,7 +11,7 @@
11
11
  "manifest.combobox.js": "sha384-MILTkrgsTzsYUjGo4ZuADqV85Xs4GmfB4xexfe9vbJMIoQTZ42W4zs+DTaVSPEsx",
12
12
  "manifest.components.js": "sha384-JalISaBBWNFl3ggx92Hb3B52EpwwG3gzgra6Q+js0OgZ8vrFKMD48CuBox2N9A5T",
13
13
  "manifest.computed.js": "sha384-GYML/e81gQfN+iDbqhPUgny8bINCyL+SrbTofoGk4hlCnLLjv51mCv42JMqq+ku5",
14
- "manifest.data.js": "sha384-+wRqEd8FFPqaSX5gZhb66OgkAHTiSQDFK6W1agFMceKtd5nVL7OLh6p5gC96AJ3Z",
14
+ "manifest.data.js": "sha384-HwDBkbNBxPVfBam7Y2jBi6DmDokw+Lw1OnHQZRM1LB6RKMxMKsUWAMzuEx86LaAJ",
15
15
  "manifest.datepicker.js": "sha384-XnbeURni2X91ozVzatQcSjYYIS4MoW12dBRJnYAGBr0nCQ624heH5s+xtQSpLZX6",
16
16
  "manifest.defer.js": "sha384-pMRGqQKiEoJhpUcD40QeM4jEHau7sz9Xn/YCpiUamT1T4xJBZDSiYX+xnVrSWoq+",
17
17
  "manifest.device.js": "sha384-g+txmrEszYtuOvRelTp/c1wSNR2AtllVI9rx5NPPD7DzhVUnMNughonZykv2xlBW",
@@ -23,12 +23,12 @@
23
23
  "manifest.markdown.js": "sha384-heyDR40LXHaAmAuA+fa381uFwShk1oAqpFFY6E2Qq4T3VN0TQfRqyc++MF40K5Hj",
24
24
  "manifest.native.js": "sha384-g+txmrEszYtuOvRelTp/c1wSNR2AtllVI9rx5NPPD7DzhVUnMNughonZykv2xlBW",
25
25
  "manifest.payments.js": "sha384-8pofk2zhxtapPMpwnFyTelPMrYhShNhDCE722uQh/EYFvZFuPLmSdgunqsarVQjv",
26
- "manifest.rich.text.js": "sha384-yJNb+EIumFIJx2KiKmLojwyHLCKwIn+48noxh3gUuZ10YZOvJJoanzAU7NLIBF1s",
26
+ "manifest.rich.text.js": "sha384-SeqwIXW01/FD39kMHLjCMaFKheVK/JxHOR/eDkePhvgaFH8Rl2y3mzZoqHuu8UH8",
27
27
  "manifest.router.js": "sha384-QkKhRaCbdXEOxhj+ojT4jeLUCtQepBnqP+QWTIWdb6kUWD+mVzPN8hf6jhgschpW",
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-alPjmWaugQV/aCb6l7hVITwZ6Z5k47SJ9jHXmNUN093iUu8ikbVggwLSGNb84Ib1",
31
+ "manifest.sw.js": "sha384-V+o5XeR3JaL7nGLhtZ14cymUmbx61S2nigZDlkLMr9rD6Ni2A0cVMDrmP+wNr26o",
32
32
  "manifest.tabs.js": "sha384-OIIcyaQnGS0eNYk4zgAFEDboNYect7THvUd9D0V6nqCeDOxQcoiqLrBEmmWVTTet",
33
33
  "manifest.tailwind.js": "sha384-r/Jvqb+Piz21jUts10BbVAJoKkShOdJRVFpywyi4HPIi/OfOJq5CtPyWAPbdkMgt",
34
34
  "manifest.toasts.js": "sha384-3zkWxzw693pxg3QDFsoYCA3CqYaLKmBaMArULXODD66Utolpewl0OAeTB92aWUVv",
@@ -987,6 +987,8 @@
987
987
  const have = (grid[r] || []).filter(Boolean).length;
988
988
  for (let i = have; i < width; i++) row.appendChild(emptyCell(rowCellTag(row)));
989
989
  });
990
+ const group = table.querySelector(':scope > colgroup');
991
+ if (group && group.children.length !== width) rebalanceCols(table);
990
992
  if (!table.querySelector('tbody, thead')) {
991
993
  const body = document.createElement('tbody');
992
994
  while (table.firstChild) body.appendChild(table.firstChild);
@@ -995,6 +997,43 @@
995
997
  });
996
998
  }
997
999
 
1000
+ // A table whose column widths were set by resizing keeps them adding up to 100% as its columns
1001
+ // change: an added column takes an equal share (the others scale down), a removed one's share
1002
+ // goes to all the others in proportion, and no column falls under the minimum. Tables without widths are left alone.
1003
+ function rebalanceCols(table, change) {
1004
+ const group = table.querySelector(':scope > colgroup'); if (!group) return;
1005
+ let w = [...group.children].map(c => /%$/.test(c.style.width) ? parseFloat(c.style.width) : NaN);
1006
+ if (!w.length || w.some(isNaN)) return;
1007
+ const n = columnCount(table);
1008
+ if (change && change.add != null) {
1009
+ const share = 100 / (w.length + 1);
1010
+ w = w.map(v => v * (100 - share) / 100);
1011
+ w.splice(Math.min(change.add, w.length), 0, share);
1012
+ } else if (change && change.remove != null && change.remove < w.length) {
1013
+ // its share goes to every remaining column, in proportion to its width
1014
+ const [gone] = w.splice(change.remove, 1), base = w.reduce((a, v) => a + v, 0);
1015
+ w = w.map(v => v + gone * (base ? v / base : 1 / w.length));
1016
+ }
1017
+ // Any other mismatch (merges, splits, padding): columns added at the end take equal shares, extras go
1018
+ while (w.length < n) { const share = 100 / (w.length + 1); w = w.map(v => v * (100 - share) / 100); w.push(share); }
1019
+ if (w.length > n) { const extra = w.splice(n).reduce((a, b) => a + b, 0); if (w.length) w[w.length - 1] += extra; }
1020
+ if (!w.length) return;
1021
+ // The minimum, taken from the widest columns
1022
+ const px = table.getBoundingClientRect().width, min = px ? MIN_COL / px * 100 : 0;
1023
+ if (min && min * w.length > 100) w = w.map(() => 100 / w.length); // too narrow for the minimum: equal shares
1024
+ else if (min) {
1025
+ for (let guard = 0; guard < 20 && w.some(v => v < min - 1e-6); guard++) {
1026
+ const need = w.reduce((a, v) => a + Math.max(0, min - v), 0), room = w.reduce((a, v) => a + Math.max(0, v - min), 0);
1027
+ w = w.map(v => v < min ? min : v - (v - min) / room * need);
1028
+ }
1029
+ }
1030
+ const total = w.reduce((a, b) => a + b, 0), pct = (v) => Math.round(v * 100) / 100;
1031
+ while (group.children.length < w.length) group.appendChild(document.createElement('col'));
1032
+ while (group.children.length > w.length) group.lastElementChild.remove();
1033
+ let used = 0;
1034
+ [...group.children].forEach((col, i) => { const v = i === w.length - 1 ? pct(100 - used) : pct(w[i] / total * 100); used += v; col.style.width = v + '%'; });
1035
+ }
1036
+
998
1037
  function addRow(where) {
999
1038
  const cell = cellAt(); if (!cell) return;
1000
1039
  const row = cell.parentElement, table = row.closest('table');
@@ -1016,6 +1055,7 @@
1016
1055
  fresh.appendChild(document.createElement('br'));
1017
1056
  if (where < 0) at.before(fresh); else at.after(fresh);
1018
1057
  });
1058
+ rebalanceCols(table, { add: where < 0 ? col : col + 1 });
1019
1059
  normalizeTables(table.parentElement || table);
1020
1060
  caretIn(cellCovering(rowsOf(table)[gridPosition(cell).row], where < 0 ? col : col + 1), 0);
1021
1061
  }
@@ -1035,6 +1075,7 @@
1035
1075
  if (columnCount(table) <= 1) return removeTable();
1036
1076
  const seen = new Set();
1037
1077
  grid.forEach(row => { const at = row[col]; if (!at || seen.has(at)) return; seen.add(at); at.remove(); });
1078
+ rebalanceCols(table, { remove: col });
1038
1079
  normalizeTables(table.parentElement || table);
1039
1080
  caretIn(cellCovering(rowsOf(table)[0], Math.max(0, col - 1)), 0);
1040
1081
  }
@@ -1172,21 +1213,34 @@
1172
1213
  Widths on a <colgroup>, heights on the row. */
1173
1214
  const EDGE = 5;
1174
1215
 
1175
- function ensureCols(table) {
1216
+ const MIN_COL = 28;
1217
+ // Each column's rendered width: a cell spanning it alone, else a spanning cell's share
1218
+ function columnWidths(table) {
1219
+ const grid = tableGrid(table), n = columnCount(table), out = [];
1220
+ for (let i = 0; i < n; i++) {
1221
+ let w = null;
1222
+ for (const row of grid) { const c = row[i]; if (c && (c.colSpan || 1) === 1) { w = c.getBoundingClientRect().width; break; } }
1223
+ if (w == null) { const c = grid.map(r => r[i]).find(Boolean); w = c ? c.getBoundingClientRect().width / (c.colSpan || 1) : 0; }
1224
+ out.push(w);
1225
+ }
1226
+ return out;
1227
+ }
1228
+ // Widths as percentages: of the table for its columns (they add up to 100%), and of the field
1229
+ // for the table, so what is stored is what renders, whatever width the field has
1230
+ function writeWidths(table, widths, tableWidth, fieldWidth) {
1176
1231
  let group = table.querySelector(':scope > colgroup');
1177
1232
  if (!group) { group = document.createElement('colgroup'); table.prepend(group); }
1178
- const want = columnCount(table);
1179
- while (group.children.length < want) group.appendChild(document.createElement('col'));
1180
- while (group.children.length > want) group.lastElementChild.remove();
1181
- // Freeze current widths so one drag doesn't reflow the rest
1233
+ while (group.children.length < widths.length) group.appendChild(document.createElement('col'));
1234
+ while (group.children.length > widths.length) group.lastElementChild.remove();
1235
+ const total = widths.reduce((a, b) => a + b, 0) || 1, pct = (v) => Math.round(v * 100) / 100;
1236
+ let used = 0;
1182
1237
  [...group.children].forEach((col, i) => {
1183
- if (col.style.width) return;
1184
- const at = (tableGrid(table)[0] || [])[i];
1185
- if (at) col.style.width = Math.round(at.getBoundingClientRect().width / (at.colSpan || 1)) + 'px';
1238
+ const v = i === widths.length - 1 ? pct(100 - used) : pct(widths[i] / total * 100);
1239
+ used += v; col.style.width = v + '%';
1186
1240
  });
1187
- return group;
1241
+ table.style.width = pct(Math.min(100, tableWidth / fieldWidth * 100)) + '%';
1242
+ table.style.tableLayout = 'fixed'; // stored widths are the rendered ones, with or without the plugin's stylesheet
1188
1243
  }
1189
-
1190
1244
  function borderAt(x, y) {
1191
1245
  const el = document.elementFromPoint(x, y);
1192
1246
  let cell = el && el.closest && el.closest('td, th');
@@ -1223,19 +1277,27 @@
1223
1277
  const begin = () => {
1224
1278
  area.setAttribute('data-rich-text-resizing', hit.axis);
1225
1279
  if (hit.axis === 'x') {
1226
- const group = ensureCols(table);
1280
+ // As a spreadsheet does: a border between columns moves width from one to the other (the
1281
+ // table keeps its width); the outer border sizes the last column and the table, within the field
1227
1282
  const { col } = gridPosition(cell);
1228
- const index = Math.min(col + (cell.colSpan || 1) - 1, group.children.length - 1);
1229
- const target = group.children[index];
1230
- const start = parseFloat(target.style.width) || cell.getBoundingClientRect().width;
1231
- // The outer border sizes the table too
1232
- const outer = index === group.children.length - 1;
1283
+ const widths = columnWidths(table), last = widths.length - 1;
1284
+ const index = Math.min(col + (cell.colSpan || 1) - 1, last);
1233
1285
  const tableStart = table.getBoundingClientRect().width;
1234
- if (outer) table.style.width = Math.round(tableStart) + 'px';
1286
+ const cs = getComputedStyle(area), field = Math.max(1, area.clientWidth - (parseFloat(cs.paddingLeft) || 0) - (parseFloat(cs.paddingRight) || 0));
1287
+ const room = Math.max(field, tableStart) - (tableStart - widths.reduce((a, b) => a + b, 0)); // columns' room, borders aside
1235
1288
  return (ev) => {
1236
- const delta = ev.clientX - fromX;
1237
- target.style.width = Math.max(28, Math.round(start + delta)) + 'px';
1238
- if (outer) table.style.width = Math.max(60, Math.round(tableStart + delta)) + 'px';
1289
+ const delta = ev.clientX - fromX, w = widths.slice();
1290
+ if (index < last) {
1291
+ const pair = widths[index] + widths[index + 1];
1292
+ if (pair < 2 * MIN_COL) return;
1293
+ w[index] = Math.min(pair - MIN_COL, Math.max(MIN_COL, widths[index] + delta));
1294
+ w[index + 1] = pair - w[index];
1295
+ writeWidths(table, w, tableStart, field);
1296
+ } else {
1297
+ const others = widths.reduce((a, b) => a + b, 0) - widths[last];
1298
+ w[last] = Math.max(MIN_COL, Math.min(widths[last] + delta, room - others));
1299
+ writeWidths(table, w, tableStart - widths[last] + w[last], field);
1300
+ }
1239
1301
  };
1240
1302
  }
1241
1303
  const row = cell.parentElement, start = row.getBoundingClientRect().height;
@@ -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.234';
19
+ const BUILD_VERSION = '0.5.235';
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.234",
3
+ "version": "0.5.235",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",