@rathnasgala/theme 0.0.15 → 0.0.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rathnasgala/theme",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "Managed Gala static-site theme payload",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "themePackage": {
4
4
  "name": "@rathnasgala/theme",
5
- "version": "0.0.15",
5
+ "version": "0.0.16",
6
6
  "availableDesignThemes": [
7
7
  "editorial"
8
8
  ],
@@ -37,7 +37,7 @@
37
37
  "src/assets/embed-gist.svg": "fcd9bc2bf29a5c118492b853c0a01390b7539c38ddb985da3c2a6e2f246a39f7",
38
38
  "src/assets/embed-x.svg": "0ae74edc6790ec7e933067fe5392bce756e93fa7ad71caacf1c1ca99fa4ec9b6",
39
39
  "src/assets/embed-youtube.svg": "10d192f2b14b67664fea88c8cf246321d20190def51d59fad5762e552219b067",
40
- "src/assets/interactions.js": "fafa38854663f840fb4eb206d3ca06a836abf36bedb035a4e8ac211805709f09",
40
+ "src/assets/interactions.js": "caaf22c9e64bc1be8b92d9facbaa52f2c1c9de2685c25fe470557fd7fe2a52e2",
41
41
  "src/assets/preferences.js": "789127bee013ed6a1bbf8cefd7b9109291c16220e7a6e09314e3c93c54731d1d",
42
42
  "src/assets/search.js": "df425f0239277792ad39f2138bc89cb66cc4ecda5ed59042d46abc2f05372088",
43
43
  "src/assets/theme-mode.js": "3797c84dbaa090b5b21427a31928b5dd97f13d04d99833f5e1e74c6b50e01dcc",
@@ -476,6 +476,23 @@ window.addEventListener('focus', () => {
476
476
  if (sessionUser && pendingIntent) resumeIntent();
477
477
  });
478
478
 
479
+ /*
480
+ * The sign-in window reports success to this page rather than to the account frame.
481
+ *
482
+ * It cannot reach the frame directly: a frame embedded in a publication has its storage — and its
483
+ * BroadcastChannel — partitioned away from a window running at the top level on the API's origin,
484
+ * so the session it wrote is invisible there. The signal carries no token; it only says a sign-in
485
+ * happened, and this asks the frame to look again. Without it the frame never learns the reader
486
+ * signed in, and every click asks them to sign in once more.
487
+ */
488
+ window.addEventListener('message', (event) => {
489
+ const frame = document.querySelector('[data-gala-session-frame]');
490
+ if (!frame || event.data?.type !== 'gala-session-established') return;
491
+ const apiOrigin = new URL(frame.src).origin;
492
+ if (event.origin !== apiOrigin) return;
493
+ frame.contentWindow?.postMessage({ type: 'gala-session-recheck' }, apiOrigin);
494
+ });
495
+
479
496
  document.querySelectorAll('[data-engagement-url]').forEach((region) => {
480
497
  refreshEngagement(region);
481
498
  recordView(region);