mnfst 0.5.201 → 0.5.202

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.201';
5
+ const MANIFEST_BUILD_VERSION = '0.5.202';
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.201';
5
+ const MANIFEST_BUILD_VERSION = '0.5.202';
6
6
 
7
7
  /* Manifest Data Sources - Configuration */
8
8
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest.appwrite.auth.js": "sha384-HMJmRXnvdDBWyuteXL+DTxWM2llSCdjl4EDamEI7iHNAVlqeOCE4GDTm8ZHipPRj",
3
- "manifest.appwrite.data.js": "sha384-/pUVR3PGGMBz680dmGqubCjjs3nx3RiRi9DqJEpO6/cKEu25YxnO4Rwf38aBdcWN",
3
+ "manifest.appwrite.data.js": "sha384-RVDH7r+lH+uw6OnE5kvgszmjJdlZjtbpYXc5+CZMtzo1gWViE0AG9AlpE+N3NvtH",
4
4
  "manifest.appwrite.presences.js": "sha384-JyVDWFT69b7Svq8J8p9tNWe2v9PZNQBY5UyhtOl1vnuHFAX0CRQ3MA9SiKq5wzNh",
5
5
  "manifest.bindings.js": "sha384-lPtMf8Ykaic9gNVZKq8Scia1881ZeMAyxer3WCIkUNwwrgzGBWto1OXADUwjvORF",
6
6
  "manifest.charts.js": "sha384-qQrjhWkIDi4oU5uQrpy8DdlMjY+gfiivBuX6mssNiFdkawgkVBvKneGgp+nd3PYJ",
@@ -11,7 +11,7 @@
11
11
  "manifest.combobox.js": "sha384-SN3XHumoebxcduFQqx5zt65/Cd10y8nuf9Gkco6UnsZ42sadRd+gvVLfWPdkkuPH",
12
12
  "manifest.components.js": "sha384-DLGSqCbnGkS87AWJ8GpKoAFP4nCosgC5SFSg6C10hH/nWu/MxI+0ntHlnFEfs++u",
13
13
  "manifest.computed.js": "sha384-GYML/e81gQfN+iDbqhPUgny8bINCyL+SrbTofoGk4hlCnLLjv51mCv42JMqq+ku5",
14
- "manifest.data.js": "sha384-mNrtyjtCTK+mcv3Nfau+ccleGFEd3qUFbYCOuMMvvJp5nGA+so9GB4XZ9MYlTjmZ",
14
+ "manifest.data.js": "sha384-WNojlmE9Z0vDcw+MgVQdUhQKdSjbz6ghJlHoQaJcGdaK1XCNmvx8G7kvEfozpaVl",
15
15
  "manifest.datepicker.js": "sha384-8vTJYkLqqvgXgm1w1becuaRR/jUEpiLBjBJ6RsRbUr+ZkypvspD6EsssuDrX4SQq",
16
16
  "manifest.defer.js": "sha384-wXa60M2OHigi5rBurXQ7Oa8eyr5WTKs7EUn2GOru62KMdfs/LDyNegxCc9MNJFSe",
17
17
  "manifest.device.js": "sha384-g+txmrEszYtuOvRelTp/c1wSNR2AtllVI9rx5NPPD7DzhVUnMNughonZykv2xlBW",
@@ -28,14 +28,14 @@
28
28
  "manifest.slides.js": "sha384-3uRTkyK9XPLmnxI2+igZlpi4EyPlU/7IHj5j3BZJJ2KN455vXyk99fiXV3feO/XY",
29
29
  "manifest.status.js": "sha384-nwvUSbT+gpRMqhYx6MeBYswUMH72rY92mjgxv0vrSG7Ht7l83XYpEB6fCTbXjjfK",
30
30
  "manifest.svg.js": "sha384-qr/8H9+2cIhSXNbRWRtIdrDlTOxKlNJqwEefHvCYoiBNW/kKhPTFa109Orv/EBnb",
31
- "manifest.sw.js": "sha384-zwGxW9eipPdhlEs6dEjZkVttY/G78J2u47w0N0lVbcrekTdwkfBA/Y8U2KuSAfF8",
31
+ "manifest.sw.js": "sha384-zUBmvVs8MVFHnt/sNWQJ16vWTaLZUJc6egsmhU4EVpvYLvOqWo28KmusamAO/rfi",
32
32
  "manifest.tabs.js": "sha384-OIIcyaQnGS0eNYk4zgAFEDboNYect7THvUd9D0V6nqCeDOxQcoiqLrBEmmWVTTet",
33
33
  "manifest.tailwind.js": "sha384-r/Jvqb+Piz21jUts10BbVAJoKkShOdJRVFpywyi4HPIi/OfOJq5CtPyWAPbdkMgt",
34
34
  "manifest.text.edit.js": "sha384-pfhc4IPKNJokj6ldlgD+KwGLN4UoM21CNeVf2sVq/34X1Un2PUhEuyTg5itmtsXS",
35
35
  "manifest.toasts.js": "sha384-/OV32LLMJl0Iw8NoNQJ+5lgntLxjIJq/YNj5JAKS/+nUhVx4MMB9h1FOqP7zuj2M",
36
36
  "manifest.tooltips.js": "sha384-uXVVQADl6pY2Pj9i/UaSclZN7dzbKhLkmevv7Ad0+wXR8LgqodALNFrc5jZJjlwm",
37
37
  "manifest.url.parameters.js": "sha384-J2aSVBOPsoqsbafHndrWLHEDpKb4AKJAoQnVmKA4gZh5P/8HHjFWHO/lkusmG84l",
38
- "manifest.utilities.js": "sha384-mncpPiNnQWpKojYWm7oO3cepjSQlnJQtxdxxPTyyaAsi77QnXrJQgqNPGT7j4dez",
38
+ "manifest.utilities.js": "sha384-u8wB+Jf6SMVFSZs/Bbf15h4HpkKqWyqeri/xCCMgHbMqRu595Gu9wUBY5wafiJ87",
39
39
  "manifest.virtual.js": "sha384-YwwmAsZNddajnAkLhBWtrK8edHMJOhD7cJkQi3qmm5o1Thg0wbtDU0dsfrCHKTIQ",
40
- "manifest.js": "sha384-+rWocB3jT+iBErwbS1ZBwt24C/jhUavBduc5EzMSu8ZZooyO52LeGpW7UscLdLYx"
40
+ "manifest.js": "sha384-AmLBpm1v/K9B93ZBGNTje0ceJHA4qnlciTrPms0zjcGGRJV8f8wQ7Pcr+sOLO38w"
41
41
  }
package/lib/manifest.js CHANGED
@@ -187,6 +187,11 @@
187
187
  // Configuration
188
188
  const DEFAULT_VERSION = 'latest';
189
189
 
190
+ // The version the page booted with (data-version). Every later load —
191
+ // Manifest.loadPlugin(), usage sniffing — resolves against it, so a runtime
192
+ // load can't pull a second copy of the framework at another version.
193
+ let RESOLVED_VERSION = DEFAULT_VERSION;
194
+
190
195
  // CDN fallback chain (first-party first). Each origin serves the npm scheme
191
196
  // `<origin>/<pkg>@<version>/<path>`. Override order with `data-cdn`
192
197
  // (comma-separated origins).
@@ -298,7 +303,7 @@
298
303
  // candidate per CDN host, tried in order.
299
304
  let _pluginBase = null;
300
305
  function setPluginBase(b) { _pluginBase = b || null; }
301
- function getPluginUrlCandidates(pluginName, version = DEFAULT_VERSION) {
306
+ function getPluginUrlCandidates(pluginName, version = RESOLVED_VERSION) {
302
307
  // Hyphenated API name → dotted file name (`appwrite-auth` → appwrite.auth).
303
308
  const fileName = pluginName.replace(/-/g, '.');
304
309
  if (_pluginBase) {
@@ -307,7 +312,7 @@
307
312
  }
308
313
  return CDN_HOSTS.map(h => `${getBaseUrl(version, h)}/${hostFile(h, `manifest.${fileName}.min.js`)}`);
309
314
  }
310
- function getPluginUrl(pluginName, version = DEFAULT_VERSION) {
315
+ function getPluginUrl(pluginName, version = RESOLVED_VERSION) {
311
316
  return getPluginUrlCandidates(pluginName, version)[0];
312
317
  }
313
318
 
@@ -417,7 +422,7 @@
417
422
  // Load a plugin, falling through the CDN chain on error. A fallback insert
418
423
  // lands after already-inserted scripts, so strict cross-plugin execution
419
424
  // order is traded for availability in the (already degraded) fallback case.
420
- async function addScript(pluginName, version = DEFAULT_VERSION) {
425
+ async function fetchPluginScript(pluginName, version) {
421
426
  const urls = getPluginUrlCandidates(pluginName, version);
422
427
  let lastErr = null;
423
428
  for (const url of urls) {
@@ -431,6 +436,26 @@
431
436
  throw lastErr || new Error(`Failed to load ${pluginName}`);
432
437
  }
433
438
 
439
+ // One execution per plugin per page. injectScript dedupes by URL, which two
440
+ // versions of the same plugin slip past — and a second copy of a plugin that
441
+ // owns page-level state (utilities' style element and its order observer)
442
+ // fights the first. A failed load is forgotten so a retry can still run.
443
+ const pluginLoads = new Map();
444
+
445
+ async function addScript(pluginName, version = RESOLVED_VERSION) {
446
+ const prior = pluginLoads.get(pluginName);
447
+ if (prior) {
448
+ if (prior.version !== version) {
449
+ console.warn(`[Manifest Loader] ${pluginName} already loaded at ${prior.version} — ignoring request for ${version}`);
450
+ }
451
+ return prior.promise;
452
+ }
453
+ const promise = fetchPluginScript(pluginName, version);
454
+ pluginLoads.set(pluginName, { version, promise });
455
+ promise.catch(() => pluginLoads.delete(pluginName));
456
+ return promise;
457
+ }
458
+
434
459
  // Resolve plugin dependencies (auto-inject required dependencies)
435
460
  function resolveDependencies(pluginList) {
436
461
  const resolved = [];
@@ -626,7 +651,7 @@
626
651
  }
627
652
 
628
653
  // Load custom Tailwind CDN script, falling through the CDN chain on error
629
- async function loadTailwind(version = DEFAULT_VERSION) {
654
+ async function loadTailwind(version = RESOLVED_VERSION) {
630
655
  const urls = CDN_HOSTS.map(h => `${getBaseUrl(version, h)}/${hostFile(h, 'manifest.tailwind.min.js')}`);
631
656
  let lastErr = null;
632
657
  for (const url of urls) {
@@ -642,7 +667,7 @@
642
667
 
643
668
  // Expose API
644
669
  window.Manifest = {
645
- loadPlugin: function (pluginName, version = DEFAULT_VERSION) {
670
+ loadPlugin: function (pluginName, version = RESOLVED_VERSION) {
646
671
  const allPlugins = [...AVAILABLE_PLUGINS, ...APPWRITE_PLUGINS, ...AUTHORING_PLUGINS, 'payments', 'chat', 'device'];
647
672
  if (!allPlugins.includes(pluginName)) {
648
673
  console.warn(`[Manifest Loader] Unknown plugin: ${pluginName}`);
@@ -770,6 +795,7 @@
770
795
 
771
796
  // Parse config and load plugins
772
797
  const config = parseDataAttributes();
798
+ if (config && config.version) RESOLVED_VERSION = config.version;
773
799
  if (config && config.pluginBase) setPluginBase(config.pluginBase);
774
800
  if (config && config.cdn) setCdnHosts(config.cdn);
775
801
  armServiceWorker(config);
@@ -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.201';
19
+ const BUILD_VERSION = '0.5.202';
20
20
  const CACHE_PREFIX = 'mnfst-sw:';
21
21
  const META_CACHE = CACHE_PREFIX + 'meta';
22
22
  const SWR_CAP = 200;
@@ -3833,8 +3833,13 @@ function injectTailwindVariants() {
3833
3833
  }
3834
3834
  injectTailwindVariants();
3835
3835
 
3836
- // Initialize immediately without waiting for DOMContentLoaded
3837
- const compiler = new TailwindCompiler();
3836
+ // One compiler per page: a second copy would own a rival #manifest-styles and
3837
+ // the two order observers would re-append their own style to <head> forever.
3838
+ // A compiler whose style element left the document is stale, so it is rebuilt.
3839
+ const existingCompiler = window.ManifestUtilities;
3840
+ const compiler = (existingCompiler && existingCompiler.styleElement && existingCompiler.styleElement.isConnected)
3841
+ ? existingCompiler
3842
+ : new TailwindCompiler();
3838
3843
 
3839
3844
  // Expose utilities compiler for optional integration
3840
3845
  window.ManifestUtilities = compiler;
@@ -3858,11 +3863,14 @@ if ('PerformanceObserver' in window) {
3858
3863
  }
3859
3864
 
3860
3865
  // Recompile on DOMContentLoaded for late-added elements
3861
- document.addEventListener('DOMContentLoaded', () => {
3862
- if (!compiler.usesStaticPrerenderUtilities && !compiler.isCompiling) {
3863
- compiler.compile();
3864
- }
3865
- });
3866
+ if (!compiler.__mnfstDomReadyBound) {
3867
+ compiler.__mnfstDomReadyBound = true;
3868
+ document.addEventListener('DOMContentLoaded', () => {
3869
+ if (!compiler.usesStaticPrerenderUtilities && !compiler.isCompiling) {
3870
+ compiler.compile();
3871
+ }
3872
+ });
3873
+ }
3866
3874
 
3867
3875
 
3868
3876
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst",
3
- "version": "0.5.201",
3
+ "version": "0.5.202",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",