@syntrologie/runtime-sdk 2.8.0-canary.116 → 2.8.0-canary.117

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.
@@ -3640,7 +3640,7 @@ function getAntiFlickerSnippet(config = {}) {
3640
3640
  }
3641
3641
 
3642
3642
  // src/version.ts
3643
- var SDK_VERSION = "2.8.0-canary.116";
3643
+ var SDK_VERSION = "2.8.0-canary.117";
3644
3644
 
3645
3645
  // src/types.ts
3646
3646
  var SDK_SCHEMA_VERSION = "2.0";
@@ -6535,6 +6535,23 @@ function decodeParam(paramName) {
6535
6535
  return null;
6536
6536
  }
6537
6537
  }
6538
+ var STORAGE_KEY_SOURCE = "__syntro_rt_editor_source";
6539
+ var STORAGE_KEY_CONF = "__syntro_rt_editor_conf";
6540
+ function persistToStorage(key, value) {
6541
+ try {
6542
+ sessionStorage.setItem(key, JSON.stringify(value));
6543
+ } catch {
6544
+ }
6545
+ }
6546
+ function readFromStorage(key) {
6547
+ try {
6548
+ const raw = sessionStorage.getItem(key);
6549
+ if (!raw) return null;
6550
+ return JSON.parse(raw);
6551
+ } catch {
6552
+ return null;
6553
+ }
6554
+ }
6538
6555
  var _cachedSource;
6539
6556
  var _cachedConf;
6540
6557
  function getEditorSource() {
@@ -6543,6 +6560,7 @@ function getEditorSource() {
6543
6560
  const globalParams = typeof window !== "undefined" ? window.__SYNTRO_EDITOR_PARAMS__ : null;
6544
6561
  if (globalParams == null ? void 0 : globalParams.token) {
6545
6562
  _cachedSource = { token: globalParams.token, api_base: globalParams.apiBase || "" };
6563
+ persistToStorage(STORAGE_KEY_SOURCE, _cachedSource);
6546
6564
  console.log(
6547
6565
  `[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${_cachedSource.token.slice(0, 15)}...)`
6548
6566
  );
@@ -6550,6 +6568,15 @@ function getEditorSource() {
6550
6568
  const decoded = decodeParam("editor_source");
6551
6569
  if (decoded) {
6552
6570
  _cachedSource = decoded;
6571
+ persistToStorage(STORAGE_KEY_SOURCE, decoded);
6572
+ } else {
6573
+ const fromStorage = readFromStorage(STORAGE_KEY_SOURCE);
6574
+ if (fromStorage == null ? void 0 : fromStorage.token) {
6575
+ _cachedSource = fromStorage;
6576
+ console.log(
6577
+ `[DIAG] getEditorSource: restored from sessionStorage (token=${fromStorage.token.slice(0, 15)}...)`
6578
+ );
6579
+ }
6553
6580
  }
6554
6581
  console.log(
6555
6582
  `[DIAG] getEditorSource: from URL param \u2192 ${decoded ? `token=${(_a2 = decoded.token) == null ? void 0 : _a2.slice(0, 15)}...` : "NULL"}`
@@ -6571,11 +6598,21 @@ function getEditorConf() {
6571
6598
  syntro_token: globalParams.syntroToken,
6572
6599
  workspace_id: globalParams.workspaceId
6573
6600
  };
6601
+ persistToStorage(STORAGE_KEY_CONF, _cachedConf);
6574
6602
  console.log(`[DIAG] getEditorConf: from __SYNTRO_EDITOR_PARAMS__ (mode=${_cachedConf.mode})`);
6575
6603
  } else {
6576
6604
  const decoded = decodeParam("editor_conf");
6577
6605
  if (decoded) {
6578
6606
  _cachedConf = decoded;
6607
+ persistToStorage(STORAGE_KEY_CONF, decoded);
6608
+ } else {
6609
+ const fromStorage = readFromStorage(STORAGE_KEY_CONF);
6610
+ if (fromStorage == null ? void 0 : fromStorage.mode) {
6611
+ _cachedConf = fromStorage;
6612
+ console.log(
6613
+ `[DIAG] getEditorConf: restored from sessionStorage (mode=${fromStorage.mode})`
6614
+ );
6615
+ }
6579
6616
  }
6580
6617
  console.log(
6581
6618
  `[DIAG] getEditorConf: from URL param \u2192 ${decoded ? `mode=${decoded.mode}` : "NULL"}`
@@ -12341,4 +12378,4 @@ export {
12341
12378
  encodeToken,
12342
12379
  Syntro
12343
12380
  };
12344
- //# sourceMappingURL=chunk-ANMHZ7Y4.js.map
12381
+ //# sourceMappingURL=chunk-YOIHS53J.js.map