minecodex 0.1.6 → 0.1.7
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/features/images/codex-feature.json +1 -1
- package/features/images/web/app.js +3 -3
- package/features/images/web/styles.css +1 -0
- package/features/model-slider/codex-feature.json +1 -1
- package/features/notes/codex-feature.json +1 -1
- package/features/notes/web/app.js +1 -1
- package/package.json +1 -1
- package/packages/runtime-host/src/codex-runtime.mjs +15 -2
|
@@ -303,9 +303,9 @@ function layoutMasonry() {
|
|
|
303
303
|
const cards = [...grid.children];
|
|
304
304
|
if (!cards.length) return;
|
|
305
305
|
|
|
306
|
-
//
|
|
307
|
-
//
|
|
308
|
-
|
|
306
|
+
// Existing spans do not affect the intrinsic card boxes because the grid
|
|
307
|
+
// aligns items to the start. Clearing them here would collapse the 1px row
|
|
308
|
+
// grid and clamp the user's scroll position before the new spans are applied.
|
|
309
309
|
const blockGap = Number.parseFloat(getComputedStyle(cards[0]).marginBottom);
|
|
310
310
|
const spans = cards.map((card) => (
|
|
311
311
|
Math.ceil((card.getBoundingClientRect().height + blockGap) / rowHeight)
|
package/package.json
CHANGED
|
@@ -51,12 +51,25 @@ function declaredSurfaceUrls(feature) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function requireDeclaredLoopbackSurface(feature, value) {
|
|
54
|
-
if (typeof value !== "string"
|
|
54
|
+
if (typeof value !== "string") {
|
|
55
55
|
throw Object.assign(new Error("Surface URL is not declared by this feature"), {
|
|
56
56
|
code: "SURFACE_URL_NOT_ALLOWED",
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
const url = new URL(value);
|
|
60
|
+
const matchesDeclaredDocument = Array.from(declaredSurfaceUrls(feature), (declared) => new URL(declared))
|
|
61
|
+
.some((declared) => (
|
|
62
|
+
declared.origin === url.origin
|
|
63
|
+
&& declared.username === url.username
|
|
64
|
+
&& declared.password === url.password
|
|
65
|
+
&& declared.pathname === url.pathname
|
|
66
|
+
&& declared.hash === url.hash
|
|
67
|
+
));
|
|
68
|
+
if (!matchesDeclaredDocument) {
|
|
69
|
+
throw Object.assign(new Error("Surface URL is not declared by this feature"), {
|
|
70
|
+
code: "SURFACE_URL_NOT_ALLOWED",
|
|
71
|
+
});
|
|
72
|
+
}
|
|
60
73
|
if (url.protocol !== "http:" || !LOOPBACK_SURFACE_HOSTS.has(url.hostname)) {
|
|
61
74
|
throw Object.assign(new Error("Surface URL must use an exact loopback HTTP origin"), {
|
|
62
75
|
code: "SURFACE_URL_NOT_ALLOWED",
|
|
@@ -2541,7 +2554,7 @@ export function createInjectionSource(features, {
|
|
|
2541
2554
|
|
|
2542
2555
|
closePromptPreview({ immediate: true });
|
|
2543
2556
|
closeModalSurface();
|
|
2544
|
-
const editorUrl = new URL(sourceRecord.
|
|
2557
|
+
const editorUrl = new URL(sourceRecord.surfaceUrl);
|
|
2545
2558
|
editorUrl.searchParams.set("surface", "editor");
|
|
2546
2559
|
editorUrl.searchParams.set("kind", kind);
|
|
2547
2560
|
if (typeof payload.id === "string" && payload.id) editorUrl.searchParams.set("id", payload.id);
|