mnfst 0.5.299 → 0.5.300

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.299';
5
+ const MANIFEST_BUILD_VERSION = '0.5.300';
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.299';
5
+ const MANIFEST_BUILD_VERSION = '0.5.300';
6
6
 
7
7
  /* Manifest Data Sources - Configuration */
8
8
 
@@ -1284,7 +1284,7 @@ function setupTeamChangeListener() {
1284
1284
  }
1285
1285
 
1286
1286
  // Find team-scoped data sources (both "team" and "teams" scopes, including dual scope)
1287
- const teamScopedDataSources = Object.entries(manifest.data)
1287
+ const teamScopedDataSources = Object.getOwnPropertyNames(manifest.data).map(name => [name, manifest.data[name]])
1288
1288
  .filter(([name, config]) => {
1289
1289
  if (typeof config === 'object' && config.scope) {
1290
1290
  const scope = config.scope;
@@ -6654,6 +6654,16 @@ function createComputedFilesArray(tableName, entryId, bucketName, columnName = '
6654
6654
  });
6655
6655
  }
6656
6656
 
6657
+ // Inline mapping: read a hidden bucket source, loaded once per bucket on first read
6658
+ const inlineSource = inlineBucketSource(tableName, bucketName);
6659
+ if (inlineSource) bucketName = inlineSource;
6660
+ let inlineRequested = !inlineSource;
6661
+ const requestInline = () => {
6662
+ if (inlineRequested) return;
6663
+ inlineRequested = true;
6664
+ loadInlineBucket(inlineSource);
6665
+ };
6666
+
6657
6667
  // Create a reactive array that will be computed from bucket and fileIds
6658
6668
  const computedFiles = typeof Alpine !== 'undefined' && Alpine.reactive
6659
6669
  ? Alpine.reactive([])
@@ -6806,6 +6816,7 @@ function createComputedFilesArray(tableName, entryId, bucketName, columnName = '
6806
6816
  // Create proxy that adds loading/error properties
6807
6817
  const computedProxy = new Proxy(computedFiles, {
6808
6818
  get(target, key) {
6819
+ if (key !== 'toJSON') requestInline();
6809
6820
  if (key === '$loading') return loadingState.value;
6810
6821
  if (key === '$error') return errorState.value;
6811
6822
  if (key === Symbol.iterator) return target[Symbol.iterator].bind(target);
@@ -6816,12 +6827,43 @@ function createComputedFilesArray(tableName, entryId, bucketName, columnName = '
6816
6827
  return undefined;
6817
6828
  },
6818
6829
  has(target, key) {
6830
+ requestInline();
6819
6831
  return key in target || key === '$loading' || key === '$error';
6820
6832
  }
6821
6833
  });
6822
6834
  return computedProxy;
6823
6835
  }
6824
6836
 
6837
+ // Hidden bucket source for an inline mapping ({ appwriteBucketId }): non-enumerable on manifest.data,
6838
+ // so loadDataSource, resetSource and identity resets treat it as a named bucket
6839
+ function inlineBucketSource(tableName, bucketName) {
6840
+ const manifest = window.ManifestDataConfig?.getManifest?.();
6841
+ const table = manifest?.data?.[tableName];
6842
+ const mapping = table?.storage?.[bucketName];
6843
+ if (!mapping || typeof mapping !== 'object' || !mapping.appwriteBucketId) return null;
6844
+ const scope = mapping.scope ? [].concat(mapping.scope).join('+') : '';
6845
+ const name = `_inline_${mapping.appwriteBucketId}${scope ? `_${scope}` : ''}`;
6846
+ if (!Object.prototype.hasOwnProperty.call(manifest.data, name)) {
6847
+ const config = { appwriteBucketId: mapping.appwriteBucketId };
6848
+ if (mapping.scope) config.scope = mapping.scope;
6849
+ for (const key of ['appwriteProjectId', 'appwriteEndpoint', 'appwriteDevKey']) {
6850
+ if (table[key]) config[key] = table[key];
6851
+ }
6852
+ Object.defineProperty(manifest.data, name, { value: config, enumerable: false, configurable: true, writable: true });
6853
+ }
6854
+ return name;
6855
+ }
6856
+
6857
+ // Load a hidden bucket source unless loaded or loading (resets reload it themselves)
6858
+ function loadInlineBucket(name) {
6859
+ const store = typeof Alpine !== 'undefined' ? Alpine.store('data') : null;
6860
+ const raw = window.ManifestDataStore?.rawOf ? window.ManifestDataStore.rawOf(store) : store;
6861
+ const state = raw?.[`_${name}_state`];
6862
+ if (state && (state.loading || state.ready || state.error)) return;
6863
+ const locale = document.documentElement.lang || Alpine.store('locale')?.current || 'en';
6864
+ Promise.resolve(window.ManifestDataMain?.loadDataSource?.(name, locale)).catch(() => { /* $error carries it */ });
6865
+ }
6866
+
6825
6867
  // Create reactive file array that watches a function/expression for entryId changes
6826
6868
  function createReactiveFileArrayFromGetter(tableName, entryIdGetter, bucketName, columnName) {
6827
6869
  if (typeof Alpine === 'undefined') {
@@ -11036,7 +11078,8 @@ function setupAuthResetListener() {
11036
11078
  const store = typeof Alpine !== 'undefined' ? Alpine.store('data') : null;
11037
11079
  if (!manifest || !ds?.resetSource || !store) return;
11038
11080
  const raw = ds.rawOf ? ds.rawOf(store) : store;
11039
- const configs = { ...(manifest.appwrite || {}), ...(manifest.data || {}) };
11081
+ const configs = { ...(manifest.appwrite || {}) };
11082
+ for (const name of Object.getOwnPropertyNames(manifest.data || {})) configs[name] = manifest.data[name]; // incl. hidden inline buckets
11040
11083
  const locale = liveLocale();
11041
11084
  for (const [name, config] of Object.entries(configs)) {
11042
11085
  if (!isIdentityBound(config) || raw[`_${name}_state`] === undefined) continue;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest.appwrite.auth.js": "sha384-gWLSeVPqCLMiUZB8MU7GqMg3x2yULFUsp8nTTZrPp/9Dlkix42rBn9yIimvwrHqZ",
3
- "manifest.appwrite.data.js": "sha384-YkcDf74N4r8iTjP8EmY2pBH59MlDVhOj4kE5eOyEYLCidkcbjQbSPFhLrPbVCXvf",
3
+ "manifest.appwrite.data.js": "sha384-c3rIozRRbzc4IDJFYiGh1IjGhG3OrQsSfPHgyDv/wLpENWhI/H+R2VI0eYKZhviY",
4
4
  "manifest.appwrite.presences.js": "sha384-LINPhIPTCK+rA8zd+HPUzMSEgH6Sl2vQMEyItT97bnEE2FYGYKqjXX+CWdt6nl9z",
5
5
  "manifest.bindings.js": "sha384-lPtMf8Ykaic9gNVZKq8Scia1881ZeMAyxer3WCIkUNwwrgzGBWto1OXADUwjvORF",
6
6
  "manifest.charts.js": "sha384-cf1N+ssSR5IL2qufv8noB5QOJrSvL7J0sLKgbJmyTDl1HodQ/Bkyf/QntO6Iynvi",
@@ -11,7 +11,7 @@
11
11
  "manifest.combobox.js": "sha384-/lJo6vaxKjgnBSRs/dzkhK1dzGk3GBw8FISoNJZB70mwAVwu1k5veZyBXjOb4keS",
12
12
  "manifest.components.js": "sha384-7lu4Nw2GqpAUn63c3gYEvgfM58PYsdoPv3wzqPQfZ5bravqOY/lfE8HFKHsKflQj",
13
13
  "manifest.computed.js": "sha384-GYML/e81gQfN+iDbqhPUgny8bINCyL+SrbTofoGk4hlCnLLjv51mCv42JMqq+ku5",
14
- "manifest.data.js": "sha384-r3G5FmhJs9XFqa+zcClpHm/DsruwOV0t8WEjg6znAQ2THBXWlJBq5k42CgeEICLE",
14
+ "manifest.data.js": "sha384-gB8Y3Dox2Yc1DfyuiynEjsCYdmh2ZQns6uBd/urznLKoRr2DxDuHYJXxL7vV6ojf",
15
15
  "manifest.datepicker.js": "sha384-EzlMwvIxlla/0BuyhAEqxN0M8TGcWIWgEIg840V0akKQQK1uY648wPWMkobvtq/o",
16
16
  "manifest.defer.js": "sha384-PRp7+dCZHnnl55rX2xrHutLrQnszHo7o5o9Tq28M/yjLZPuXDzcwQNxCdvbtCYSz",
17
17
  "manifest.device.js": "sha384-YeQaS56L8IILqrQNBSeAOLwIh5DuAOrE60cYLK1+46qJtUrXlAvqGe2j5mbV4Vq7",
@@ -29,7 +29,7 @@
29
29
  "manifest.status.js": "sha384-ofu7nBnVIGZ1U1o2R9d2H3V8aEMPUCVbl5FO3gIToXqi0oa36fTviEdh5UU7Kitw",
30
30
  "manifest.submissions.js": "sha384-v9eS47ytAfTGIKAyVnbd0QWegucVS7yduvigqfsxxoqXmbaEoy0M2y+BiI4xeZBd",
31
31
  "manifest.svg.js": "sha384-qr/8H9+2cIhSXNbRWRtIdrDlTOxKlNJqwEefHvCYoiBNW/kKhPTFa109Orv/EBnb",
32
- "manifest.sw.js": "sha384-ArP1ycg+8Tbhimn+TqZDALqHdo9351td9SvTkshPD8tICwa34d2jDXNeud4NrxyC",
32
+ "manifest.sw.js": "sha384-GeqajA7Wqj4902PrA1Wda/C2hrZJb/C7Mu3HFr+9cobcv7NShBXDvwyq9Y7jVNSm",
33
33
  "manifest.tabs.js": "sha384-otU09H7jnawVKQdLAYpMCd3jx00tgyPVr42D2hLIBzN5dG4se505YesavdnMqEi1",
34
34
  "manifest.tailwind.js": "sha384-yuP3LEvWU+QVjxjkZ0YhErtC9RrGmhOmHjjFjhS9obqZbp5/KTIEnSR0CXDvHE0B",
35
35
  "manifest.toasts.js": "sha384-UpOz9fAdGeGUhL0NamBg5iPepEfIy73p9HYdcxfOQC5b7CVsl7Our0skdZzaLNcC",
@@ -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.299';
19
+ const BUILD_VERSION = '0.5.300';
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.299",
3
+ "version": "0.5.300",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",