castle-web-cli 0.4.145 → 0.4.147
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/api.d.ts +1 -0
- package/dist/api.js +1 -1
- package/dist/serve.js +3 -1
- package/dist/serveSecurity.js +9 -0
- package/dist/shell/assets/{index-CbRAepsq.js → index-CL9TuLXb.js} +86 -86
- package/dist/shell/assets/{index-BaiRLZ8p.css → index-DN8HQBnW.css} +1 -1
- package/dist/shell/index.html +2 -2
- package/kits/physics-2d/castle.json +1 -1
- package/kits/physics-2d/editors/SingleEditor.jsx +6 -1
- package/kits/physics-2d/package-lock.json +1 -1
- package/kits/physics-3d/castle.json +1 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
package/dist/api.js
CHANGED
|
@@ -58,7 +58,7 @@ export async function pollForCLILogin(pollToken) {
|
|
|
58
58
|
}
|
|
59
59
|
export async function me() {
|
|
60
60
|
try {
|
|
61
|
-
const data = await graphql(`query { me { userId username isAnonymous photo { url } photoFrame { frameUrl } } }`);
|
|
61
|
+
const data = await graphql(`query { me { userId username isAnonymous isAdmin photo { url } photoFrame { frameUrl } } }`);
|
|
62
62
|
return pickData(data, 'me');
|
|
63
63
|
}
|
|
64
64
|
catch {
|
package/dist/serve.js
CHANGED
|
@@ -234,7 +234,9 @@ function castlePlugin(security, ideServer, agentServer, configuredHost) {
|
|
|
234
234
|
return html.replace(/<head(\s[^>]*)?>/i, (match) => `${match}${favicon}\n <script>
|
|
235
235
|
window.CastleEmbed={edit:true,host:'dev'};
|
|
236
236
|
window.__castleShellOrigin=(function(){
|
|
237
|
-
var h=location.hostname.toLowerCase()
|
|
237
|
+
var h=location.hostname.toLowerCase();
|
|
238
|
+
if(h.endsWith('.sandboxes.castle.xyz')||h.endsWith('.sandboxes-staging.castle.xyz'))return location.origin;
|
|
239
|
+
var m=/^1[ep]([0-9a-z]{1,4})-([a-z0-9]{14})-/.exec(h);
|
|
238
240
|
if(!m)return null;
|
|
239
241
|
var p=parseInt(m[1],36),sid=m[2];
|
|
240
242
|
if(h.endsWith('.sandboxes-staging.castlexyz.com'))return 'https://'+p+'-'+sid+'.sandboxes-staging.castle.xyz';
|
package/dist/serveSecurity.js
CHANGED
|
@@ -135,6 +135,15 @@ window.fetch=function(input,init){
|
|
|
135
135
|
contentOrigins(req) {
|
|
136
136
|
const host = hostWithoutPort(req.headers.host || 'localhost');
|
|
137
137
|
const cloud = host.match(/^\d+-([a-z0-9]{14})\.(sandboxes(?:-staging)?\.castle\.xyz)$/);
|
|
138
|
+
// Compatibility rollback: the released iOS WebView only permits castle.xyz
|
|
139
|
+
// origins, so a sandboxes.castlexyz.com iframe is rejected before the deck
|
|
140
|
+
// can load. Keep the isolated-origin implementation available for explicit
|
|
141
|
+
// staging/device testing, but make ordinary cloud images use the existing
|
|
142
|
+
// shell origin until a compatible native release is in production.
|
|
143
|
+
if (cloud && process.env.CASTLE_ISOLATED_CONTENT_ORIGINS !== '1') {
|
|
144
|
+
const origin = requestOrigin(req);
|
|
145
|
+
return { editOrigin: origin, playOrigin: origin };
|
|
146
|
+
}
|
|
138
147
|
const sandboxId = cloud?.[1] || 'localdev000000';
|
|
139
148
|
const contentHeader = req.headers['x-castle-content-domain'];
|
|
140
149
|
const contentDomain = typeof contentHeader === 'string' &&
|