@uniformdev/canvas-next 18.35.1-alpha.17 → 18.35.1-alpha.22
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/index.esm.js +5 -1
- package/dist/index.js +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +6 -6
package/dist/index.esm.js
CHANGED
|
@@ -12,6 +12,9 @@ var getQueryParam = (req, paramName) => {
|
|
|
12
12
|
return Array.isArray(value) ? value[0] : value;
|
|
13
13
|
};
|
|
14
14
|
var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefault } = {}) => async (req, res) => {
|
|
15
|
+
if (req.headers["sec-fetch-mode"] === "no-cors") {
|
|
16
|
+
return res.status(204).end();
|
|
17
|
+
}
|
|
15
18
|
const queryParamsToPreserve = [IN_CONTEXT_EDITOR_QUERY_STRING_PARAM];
|
|
16
19
|
const id = getQueryParam(req, "id");
|
|
17
20
|
const slug = getQueryParam(req, "slug");
|
|
@@ -45,7 +48,8 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
45
48
|
// By default the preview cookies stays as long as the tab is open. And in contextual editing mode, people tend to open Canvas editor (one tab) and another tab to see published changes.
|
|
46
49
|
// This causes the second tab to still have the preview cookie, which causes unexpected behavior.
|
|
47
50
|
// This is more obvious in contextual editing mode because we skip the composition fetching and the user sees a blank page where they expected the published composition.
|
|
48
|
-
|
|
51
|
+
// We set this value to `1` just to handle the case of middlewares and redirections, ideally `0` should do the trick.
|
|
52
|
+
maxAge: isUniformContextualEditing ? 1 : void 0
|
|
49
53
|
}
|
|
50
54
|
);
|
|
51
55
|
const cookies = res.getHeader("Set-Cookie");
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,9 @@ var getQueryParam = (req, paramName) => {
|
|
|
47
47
|
return Array.isArray(value) ? value[0] : value;
|
|
48
48
|
};
|
|
49
49
|
var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefault } = {}) => async (req, res) => {
|
|
50
|
+
if (req.headers["sec-fetch-mode"] === "no-cors") {
|
|
51
|
+
return res.status(204).end();
|
|
52
|
+
}
|
|
50
53
|
const queryParamsToPreserve = [import_canvas.IN_CONTEXT_EDITOR_QUERY_STRING_PARAM];
|
|
51
54
|
const id = getQueryParam(req, "id");
|
|
52
55
|
const slug = getQueryParam(req, "slug");
|
|
@@ -80,7 +83,8 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
80
83
|
// By default the preview cookies stays as long as the tab is open. And in contextual editing mode, people tend to open Canvas editor (one tab) and another tab to see published changes.
|
|
81
84
|
// This causes the second tab to still have the preview cookie, which causes unexpected behavior.
|
|
82
85
|
// This is more obvious in contextual editing mode because we skip the composition fetching and the user sees a blank page where they expected the published composition.
|
|
83
|
-
|
|
86
|
+
// We set this value to `1` just to handle the case of middlewares and redirections, ideally `0` should do the trick.
|
|
87
|
+
maxAge: isUniformContextualEditing ? 1 : void 0
|
|
84
88
|
}
|
|
85
89
|
);
|
|
86
90
|
const cookies = res.getHeader("Set-Cookie");
|
package/dist/index.mjs
CHANGED
|
@@ -12,6 +12,9 @@ var getQueryParam = (req, paramName) => {
|
|
|
12
12
|
return Array.isArray(value) ? value[0] : value;
|
|
13
13
|
};
|
|
14
14
|
var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefault } = {}) => async (req, res) => {
|
|
15
|
+
if (req.headers["sec-fetch-mode"] === "no-cors") {
|
|
16
|
+
return res.status(204).end();
|
|
17
|
+
}
|
|
15
18
|
const queryParamsToPreserve = [IN_CONTEXT_EDITOR_QUERY_STRING_PARAM];
|
|
16
19
|
const id = getQueryParam(req, "id");
|
|
17
20
|
const slug = getQueryParam(req, "slug");
|
|
@@ -45,7 +48,8 @@ var createPreviewHandlerGet = ({ secret, resolveFullPath = resolveFullPathDefaul
|
|
|
45
48
|
// By default the preview cookies stays as long as the tab is open. And in contextual editing mode, people tend to open Canvas editor (one tab) and another tab to see published changes.
|
|
46
49
|
// This causes the second tab to still have the preview cookie, which causes unexpected behavior.
|
|
47
50
|
// This is more obvious in contextual editing mode because we skip the composition fetching and the user sees a blank page where they expected the published composition.
|
|
48
|
-
|
|
51
|
+
// We set this value to `1` just to handle the case of middlewares and redirections, ideally `0` should do the trick.
|
|
52
|
+
maxAge: isUniformContextualEditing ? 1 : void 0
|
|
49
53
|
}
|
|
50
54
|
);
|
|
51
55
|
const cookies = res.getHeader("Set-Cookie");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next",
|
|
3
|
-
"version": "18.35.1-alpha.
|
|
3
|
+
"version": "18.35.1-alpha.22+55597238b",
|
|
4
4
|
"description": "Next.js SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"document": "api-extractor run --local"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@uniformdev/canvas": "18.35.1-alpha.
|
|
57
|
-
"@uniformdev/canvas-react": "18.35.1-alpha.
|
|
58
|
-
"@uniformdev/project-map": "18.35.1-alpha.
|
|
56
|
+
"@uniformdev/canvas": "18.35.1-alpha.22+55597238b",
|
|
57
|
+
"@uniformdev/canvas-react": "18.35.1-alpha.22+55597238b",
|
|
58
|
+
"@uniformdev/project-map": "18.35.1-alpha.22+55597238b"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"next": ">= 12.0.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-dom": ">=16"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@types/react": "18.0.
|
|
66
|
+
"@types/react": "18.0.35",
|
|
67
67
|
"next": "13.3.0",
|
|
68
68
|
"react": "18.2.0",
|
|
69
69
|
"react-dom": "18.2.0"
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "55597238baeb37d7e7a5e2dca5e3b0953fd8e5c4"
|
|
78
78
|
}
|