@shipeasy/sdk 2.1.8 → 2.1.10
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/dist/server/index.js +12 -2
- package/dist/server/index.mjs +12 -2
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -386,7 +386,10 @@ Object.defineProperty(globalThis, _EDIT_MODE_SSR_SYM, {
|
|
|
386
386
|
get: () => _editModeALS.getStore() ?? globalThis[_EDIT_MODE_FALLBACK_SYM] ?? false,
|
|
387
387
|
set: (v) => {
|
|
388
388
|
const b = Boolean(v);
|
|
389
|
-
|
|
389
|
+
try {
|
|
390
|
+
_editModeALS.enterWith(b);
|
|
391
|
+
} catch {
|
|
392
|
+
}
|
|
390
393
|
globalThis[_EDIT_MODE_FALLBACK_SYM] = b;
|
|
391
394
|
},
|
|
392
395
|
configurable: true
|
|
@@ -507,7 +510,11 @@ async function shipeasy(opts) {
|
|
|
507
510
|
configs: bootstrap.configs,
|
|
508
511
|
experiments: bootstrap.experiments,
|
|
509
512
|
getBootstrapHtml() {
|
|
510
|
-
return getBootstrapHtml(bootstrap, i18nData, {
|
|
513
|
+
return getBootstrapHtml(bootstrap, i18nData, {
|
|
514
|
+
apiKey: clientKey,
|
|
515
|
+
editLabels,
|
|
516
|
+
i18nProfile: profile
|
|
517
|
+
});
|
|
511
518
|
}
|
|
512
519
|
};
|
|
513
520
|
}
|
|
@@ -524,6 +531,9 @@ function getBootstrapHtml(bootstrap, i18nData, opts) {
|
|
|
524
531
|
};
|
|
525
532
|
if (i18nData) payload.i18n = i18nData;
|
|
526
533
|
if (opts.editLabels) payload.editLabels = true;
|
|
534
|
+
parts.push(
|
|
535
|
+
`(function(){if(!new URLSearchParams(location.search).has('se_edit_labels'))return;var R;function P(v){if(!v||typeof v.t!=='function'||v.__sePatched)return;var O=v.t.bind(v);v.__sePatched=true;window._sei18n_t=O;v.t=function(k,vars){var r=O(k,vars);return r===k?k:'\\uFFF9'+k+'\\uFFFA'+r+'\\uFFFB';};}Object.defineProperty(window,'i18n',{configurable:true,get:function(){return R;},set:function(v){P(v);R=v;}});})();`
|
|
536
|
+
);
|
|
527
537
|
parts.push(`window.__SE_BOOTSTRAP=${JSON.stringify(payload)};`);
|
|
528
538
|
if (i18nData?.strings && Object.keys(i18nData.strings).length > 0) {
|
|
529
539
|
parts.push(
|
package/dist/server/index.mjs
CHANGED
|
@@ -343,7 +343,10 @@ Object.defineProperty(globalThis, _EDIT_MODE_SSR_SYM, {
|
|
|
343
343
|
get: () => _editModeALS.getStore() ?? globalThis[_EDIT_MODE_FALLBACK_SYM] ?? false,
|
|
344
344
|
set: (v) => {
|
|
345
345
|
const b = Boolean(v);
|
|
346
|
-
|
|
346
|
+
try {
|
|
347
|
+
_editModeALS.enterWith(b);
|
|
348
|
+
} catch {
|
|
349
|
+
}
|
|
347
350
|
globalThis[_EDIT_MODE_FALLBACK_SYM] = b;
|
|
348
351
|
},
|
|
349
352
|
configurable: true
|
|
@@ -464,7 +467,11 @@ async function shipeasy(opts) {
|
|
|
464
467
|
configs: bootstrap.configs,
|
|
465
468
|
experiments: bootstrap.experiments,
|
|
466
469
|
getBootstrapHtml() {
|
|
467
|
-
return getBootstrapHtml(bootstrap, i18nData, {
|
|
470
|
+
return getBootstrapHtml(bootstrap, i18nData, {
|
|
471
|
+
apiKey: clientKey,
|
|
472
|
+
editLabels,
|
|
473
|
+
i18nProfile: profile
|
|
474
|
+
});
|
|
468
475
|
}
|
|
469
476
|
};
|
|
470
477
|
}
|
|
@@ -481,6 +488,9 @@ function getBootstrapHtml(bootstrap, i18nData, opts) {
|
|
|
481
488
|
};
|
|
482
489
|
if (i18nData) payload.i18n = i18nData;
|
|
483
490
|
if (opts.editLabels) payload.editLabels = true;
|
|
491
|
+
parts.push(
|
|
492
|
+
`(function(){if(!new URLSearchParams(location.search).has('se_edit_labels'))return;var R;function P(v){if(!v||typeof v.t!=='function'||v.__sePatched)return;var O=v.t.bind(v);v.__sePatched=true;window._sei18n_t=O;v.t=function(k,vars){var r=O(k,vars);return r===k?k:'\\uFFF9'+k+'\\uFFFA'+r+'\\uFFFB';};}Object.defineProperty(window,'i18n',{configurable:true,get:function(){return R;},set:function(v){P(v);R=v;}});})();`
|
|
493
|
+
);
|
|
484
494
|
parts.push(`window.__SE_BOOTSTRAP=${JSON.stringify(payload)};`);
|
|
485
495
|
if (i18nData?.strings && Object.keys(i18nData.strings).length > 0) {
|
|
486
496
|
parts.push(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipeasy/sdk",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.10",
|
|
4
4
|
"description": "Shipeasy SDK — feature gates, runtime configs, experiments, and metrics for the Shipeasy hosted service.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"homepage": "https://shipeasy.ai",
|