eddev 2.0.0-beta.225 → 2.0.0-beta.227
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/app/lib/blocks/editor/usePostEditor.d.ts.map +1 -1
- package/dist/app/lib/blocks/editor/usePostEditor.js +5 -0
- package/dist/node/cli/version.d.ts +1 -1
- package/dist/node/cli/version.js +1 -1
- package/dist/node/compiler/vinxi-app.d.ts.map +1 -1
- package/dist/node/compiler/vinxi-codegen.d.ts.map +1 -1
- package/dist/node/compiler/vinxi-codegen.js +21 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePostEditor.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/blocks/editor/usePostEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"usePostEditor.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/blocks/editor/usePostEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAA;AAExE,wBAAgB,aAAa;;uBAgBN,GAAG;;;EAMzB;AA+BD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAEvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,SAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAEzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,aAAa,EAC7D,GAAG,EAAE,CAAC,EACN,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GACvB,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAmBpC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useBlockContext } from "../inline-editing.js";
|
|
1
2
|
export function usePostEditor() {
|
|
2
3
|
const post = wp.data.useSelect((select) => {
|
|
3
4
|
const editor = select("core/editor");
|
|
@@ -20,6 +21,7 @@ export function usePostEditor() {
|
|
|
20
21
|
}
|
|
21
22
|
function usePostFieldEditor(key, value) {
|
|
22
23
|
if (env.admin) {
|
|
24
|
+
const isReadOnly = useBlockContext()?.readonly;
|
|
23
25
|
const post = wp.data.useSelect((select) => {
|
|
24
26
|
const editor = select("core/editor");
|
|
25
27
|
const post = editor.getCurrentPost();
|
|
@@ -29,6 +31,9 @@ function usePostFieldEditor(key, value) {
|
|
|
29
31
|
...edits,
|
|
30
32
|
};
|
|
31
33
|
}, []);
|
|
34
|
+
if (isReadOnly) {
|
|
35
|
+
return [value, () => { }];
|
|
36
|
+
}
|
|
32
37
|
return [
|
|
33
38
|
post[key] ?? "",
|
|
34
39
|
(title) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.0-beta.
|
|
1
|
+
export declare const VERSION = "2.0.0-beta.226";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/node/cli/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "2.0.0-beta.
|
|
1
|
+
export const VERSION = "2.0.0-beta.226";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vinxi-app.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/vinxi-app.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"vinxi-app.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/vinxi-app.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,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sB,eAAe,CAAC,IAAI,EAAE,OAAO,iBAIlD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"vinxi-codegen.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/vinxi-codegen.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,aAAa,GAAG,YAAY,CAAA;IAClC,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAC,UAExE;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,OAAO,iBAIlD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,aAwsB/C"}
|
|
@@ -124,6 +124,16 @@ export function createVinxiCodegen(opts) {
|
|
|
124
124
|
import { createAssets } from "@vinxi/react"
|
|
125
125
|
import { devToolsStore } from 'eddev/devtools'
|
|
126
126
|
|
|
127
|
+
${process.env.VERCEL_SKEW_PROTECTION_ENABLED &&
|
|
128
|
+
code /* tsx*/ `
|
|
129
|
+
// Skew protection
|
|
130
|
+
const updateSkewCookie = () => {
|
|
131
|
+
document.cookie = "__vdpl=${process.env.VERCEL_DEPLOYMENT_ID}; expires=" + new Date(Date.now() + 24 * 60 * 60 * 1000).toUTCString() + "; path=/"
|
|
132
|
+
}
|
|
133
|
+
window.onfocus = updateSkewCookie
|
|
134
|
+
updateSkewCookie()
|
|
135
|
+
`}
|
|
136
|
+
|
|
127
137
|
// Set up a dynamic entry which will load the configured tailwind manifest
|
|
128
138
|
devToolsStore.loadTailwindConfig = () => import('./manifest/tailwind-config.js')
|
|
129
139
|
|
|
@@ -248,7 +258,8 @@ export function createVinxiCodegen(opts) {
|
|
|
248
258
|
getRequestURL,
|
|
249
259
|
getRouterParam,
|
|
250
260
|
getWebRequest,
|
|
251
|
-
getCookie
|
|
261
|
+
getCookie,
|
|
262
|
+
setCookie
|
|
252
263
|
} from "vinxi/http"
|
|
253
264
|
import { handleRPC } from "./rpc.js"
|
|
254
265
|
import { serverContext } from "./context.js"
|
|
@@ -405,6 +416,15 @@ export function createVinxiCodegen(opts) {
|
|
|
405
416
|
return Response.redirect(url, 301)
|
|
406
417
|
}
|
|
407
418
|
|
|
419
|
+
${process.env.VERCEL_SKEW_PROTECTION_ENABLED &&
|
|
420
|
+
code /* tsx*/ `
|
|
421
|
+
// Skew protection
|
|
422
|
+
setCookie(event, "__vdpl", ${JSON.stringify(process.env.VERCEL_DEPLOYMENT_ID ?? "")}, {
|
|
423
|
+
httpOnly: false,
|
|
424
|
+
path: "/",
|
|
425
|
+
})
|
|
426
|
+
`}
|
|
427
|
+
|
|
408
428
|
// SSR
|
|
409
429
|
return renderPage({ pathname: url.pathname, newOrigin: url.origin, hostname: url.hostname, bypass: serverContext.shouldBypass(event) })
|
|
410
430
|
},
|