@coframe/sdk 1.1.1 → 1.1.2
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/pkg/server.cjs.js
CHANGED
|
@@ -45,12 +45,15 @@ async function fetchProjectFromEdge(projectId, currentUrl, signal, userContext,
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
async function fetchAntiflickerFromEdge(projectId, currentUrl, userContext, headers) {
|
|
48
|
+
async function fetchAntiflickerFromEdge(projectId, currentUrl, userContext, enableElementAntiFlicker, headers) {
|
|
49
49
|
try {
|
|
50
50
|
const payload = { projectId, currentUrl };
|
|
51
51
|
if (userContext) {
|
|
52
52
|
payload.userContext = userContext;
|
|
53
53
|
}
|
|
54
|
+
if (enableElementAntiFlicker) {
|
|
55
|
+
payload.enableElementAntiFlicker = enableElementAntiFlicker;
|
|
56
|
+
}
|
|
54
57
|
const config = encodeURIComponent(JSON.stringify(payload));
|
|
55
58
|
const edgeUrl = new URL(`${"https://edge.cofra.me"}/cf.css`);
|
|
56
59
|
edgeUrl.searchParams.set('config', config);
|
|
@@ -73,7 +76,7 @@ async function getProjectData(options) {
|
|
|
73
76
|
? fetchProjectFromEdge(options.projectId, options.currentUrl, undefined, options.userContext, options.headers)
|
|
74
77
|
: Promise.resolve(null),
|
|
75
78
|
includeCSS
|
|
76
|
-
? fetchAntiflickerFromEdge(options.projectId, options.currentUrl, options.userContext, options.headers)
|
|
79
|
+
? fetchAntiflickerFromEdge(options.projectId, options.currentUrl, options.userContext, options.enableElementAntiFlicker, options.headers)
|
|
77
80
|
: Promise.resolve(null),
|
|
78
81
|
]);
|
|
79
82
|
const config = {};
|
package/dist/pkg/server.esm.mjs
CHANGED
|
@@ -43,12 +43,15 @@ async function fetchProjectFromEdge(projectId, currentUrl, signal, userContext,
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
async function fetchAntiflickerFromEdge(projectId, currentUrl, userContext, headers) {
|
|
46
|
+
async function fetchAntiflickerFromEdge(projectId, currentUrl, userContext, enableElementAntiFlicker, headers) {
|
|
47
47
|
try {
|
|
48
48
|
const payload = { projectId, currentUrl };
|
|
49
49
|
if (userContext) {
|
|
50
50
|
payload.userContext = userContext;
|
|
51
51
|
}
|
|
52
|
+
if (enableElementAntiFlicker) {
|
|
53
|
+
payload.enableElementAntiFlicker = enableElementAntiFlicker;
|
|
54
|
+
}
|
|
52
55
|
const config = encodeURIComponent(JSON.stringify(payload));
|
|
53
56
|
const edgeUrl = new URL(`${"https://edge.cofra.me"}/cf.css`);
|
|
54
57
|
edgeUrl.searchParams.set('config', config);
|
|
@@ -71,7 +74,7 @@ async function getProjectData(options) {
|
|
|
71
74
|
? fetchProjectFromEdge(options.projectId, options.currentUrl, undefined, options.userContext, options.headers)
|
|
72
75
|
: Promise.resolve(null),
|
|
73
76
|
includeCSS
|
|
74
|
-
? fetchAntiflickerFromEdge(options.projectId, options.currentUrl, options.userContext, options.headers)
|
|
77
|
+
? fetchAntiflickerFromEdge(options.projectId, options.currentUrl, options.userContext, options.enableElementAntiFlicker, options.headers)
|
|
75
78
|
: Promise.resolve(null),
|
|
76
79
|
]);
|
|
77
80
|
const config = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coframe/sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Coframe optimizes your website using generative AI to deliver maximum impact to your audience and allow your site to improve itself as you sleep. Learn more at coframe.com.",
|
|
5
5
|
"main": "dist/pkg/cf.cjs.js",
|
|
6
6
|
"module": "dist/pkg/cf.esm.mjs",
|