Compare commits

..
9 changed files with 25 additions and 36 deletions
-4
View File
@@ -1,4 +0,0 @@
{
"monorepoCommit": "3ac0870810e7bf32e6f262f4b81f11ce7470e784",
"sourcePath": "quixos-instance/packages/web-studio-canvas-runtime"
}
Generated
+7 -7
View File
@@ -37,17 +37,17 @@
"quixosNixHelpers": {
"flake": false,
"locked": {
"lastModified": 1788574090,
"narHash": "sha256-bSgc0LS2Ub01fnE14VqazdZzFuVPl4sykmA2d1l4kDs=",
"ref": "refs/tags/quixos-reachability/7177130c0365f2fa58ea4877366e1c5d17db4c01",
"rev": "7177130c0365f2fa58ea4877366e1c5d17db4c01",
"revCount": 4,
"lastModified": 1788543053,
"narHash": "sha256-3YReATWEVxZinYVi/l3cwOz+oFoZUrwj24kUBQTmUpQ=",
"ref": "refs/tags/quixos-reachability/56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a",
"rev": "56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a",
"revCount": 8,
"type": "git",
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
},
"original": {
"ref": "refs/tags/quixos-reachability/7177130c0365f2fa58ea4877366e1c5d17db4c01",
"rev": "7177130c0365f2fa58ea4877366e1c5d17db4c01",
"ref": "refs/tags/quixos-reachability/56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a",
"rev": "56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a",
"type": "git",
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
}
+1 -1
View File
@@ -6,7 +6,7 @@
flake-utils.url = "github:numtide/flake-utils";
quixosNixHelpers = {
url = "git+https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git?ref=refs/tags/quixos-reachability/7177130c0365f2fa58ea4877366e1c5d17db4c01&rev=7177130c0365f2fa58ea4877366e1c5d17db4c01";
url = "git+https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git?ref=refs/tags/quixos-reachability/56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a&rev=56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a";
flake = false;
};
};
+1 -1
View File
@@ -13,7 +13,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@quixos/camino-package-runtime": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=652ac8e53e1e770a7c48d684cac47be6bc62b7e9"
"@quixos/camino-package-runtime": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=a998690446ecf647e3af78e369492c1a3663b66d"
},
"devDependencies": {
"@types/node": "^24",
+1 -1
View File
@@ -1,6 +1,6 @@
quixos-lock version 1 {
quixos source {
repository "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos.git";
commit "3ac0870810e7bf32e6f262f4b81f11ce7470e784";
commit "9c3ab572ecfbc83785038c3d9f174516df15d63f";
}
}
+5 -7
View File
@@ -1,12 +1,11 @@
import {
objectRef,
type QxObjectRef,
type RuntimeContext,
} from "@quixos/camino-package-runtime";
export type PlacementInput = {
canvas_id: QxObjectRef;
subject_id: QxObjectRef;
canvas_id: string;
subject_id: string;
x: number;
y: number;
width: number;
@@ -18,11 +17,10 @@ const finiteNumber = (value: unknown, fallback: number) =>
typeof value === "number" && Number.isFinite(value) ? value : fallback;
const objectId = (value: unknown, field: string) => {
try {
return objectRef(value as QxObjectRef);
} catch {
throw new Error(`${field} must be a managed object reference`);
if (typeof value !== "string" || !value.startsWith("obj:")) {
throw new Error(`${field} must be a Camino object ID`);
}
return value;
};
export const normalizePlacementInput = (
+5 -10
View File
@@ -1,23 +1,19 @@
import assert from "node:assert/strict";
import test from "node:test";
import { normalizePlacementInput } from "../dist/canvas.impl.js";
import { protoValueToJs } from "@quixos/camino-package-runtime";
const reference = (objectId) => protoValueToJs({kind: {case: "refValue", value: {objectId}}});
const canvas = reference("obj:canvas"), subject = reference("obj:subject");
test("placement input is bounded and normalized", () => {
assert.deepEqual(normalizePlacementInput({
canvas_id: canvas,
subject_id: subject,
canvas_id: "obj:canvas",
subject_id: "obj:subject",
x: 12.5,
y: -30,
width: 12,
height: 80,
z: 3.8,
}), {
canvas_id: canvas,
subject_id: subject,
canvas_id: "obj:canvas",
subject_id: "obj:subject",
x: 12.5,
y: -30,
width: 220,
@@ -29,7 +25,6 @@ test("placement input is bounded and normalized", () => {
test("placement input requires Camino object references", () => {
assert.throws(
() => normalizePlacementInput({ canvas_id: "canvas", subject_id: "obj:subject" }),
/canvas_id must be a managed object reference/,
/canvas_id must be a Camino object ID/,
);
assert.throws(() => normalizePlacementInput({canvas_id: "obj:canvas", subject_id: subject}), /managed object reference/);
});
+1 -1
View File
@@ -159,7 +159,7 @@ cacheEntries = {
"@bufbuild/protobuf@npm:2.14.1" = { filename = "@bufbuild-protobuf-npm-2.14.1-78e9ea56a2-3f913aca03.zip"; hash = "sha512-P5E6ygPfhBnEsh2ADqVNf2yDalND5l1vaGJ57DVmxJB3KZOO8vlKXifZLo0/StzW4CcRi6Kbp2TSHhxjfN3HAg=="; };
"@connectrpc/connect-node@npm:2.1.2" = { filename = "@connectrpc-connect-node-npm-2.1.2-021434d5d5-ba8b0c9384.zip"; hash = "sha512-uosMk4TDgps3eqeoJtwM1Qpgk1J9LscBRgSRKDYzbqlgSitazqQrEEd/i+RWnknd7WbKD8d/X1sCcDXgKeE+qQ=="; };
"@connectrpc/connect@npm:2.1.2" = { filename = "@connectrpc-connect-npm-2.1.2-ab34825de3-4e15000890.zip"; hash = "sha512-ThUACJAjt1Lv1E+pQKWuHh+gDhvrxLoM7ScruTWSDYw7hbd0UOZErUQruMqaJ1sMFxNviWuo7/A2F4Ex2wHWFQ=="; };
"@quixos/camino-package-runtime@https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=652ac8e53e1e770a7c48d684cac47be6bc62b7e9" = { filename = "@quixos-camino-package-runtime-https-7a34959630-057866d4f9.zip"; hash = "sha512-BXhm1PkxXVOvqLCN0A1ZPRcPxd+Vr1WPydlFQygoJXy7fTaa9KJOOGMSX2POelWu4qnOH9svv0EPcbLcfS6RFw=="; };
"@quixos/camino-package-runtime@https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=a998690446ecf647e3af78e369492c1a3663b66d" = { filename = "@quixos-camino-package-runtime-https-683bcbf33c-c90d5d5c53.zip"; hash = "sha512-yQ1dXFMR2k+xbkka2rrhsAcrQFZlJAZEYM0hqwGzdV5RJ+fhQEh3BEgoPiL2yxrxulU4zg/jsj8BTBFRp1feyg=="; };
"@types/node@npm:24.13.3" = { filename = "@types-node-npm-24.13.3-b512a0bbeb-a5bc08f49b.zip"; hash = "sha512-pbwI9JuVgdzcqQ4CzXcZejx5mECAdmSULlzVFhpVPU0q6AZPfjKUQQ10jX0Ji1wYSL5/pQwG8pxBk6sWvk5Z6w=="; };
"@typescript/typescript-linux-arm64@npm:7.0.2" = { filename = "@typescript-typescript-linux-arm64-npm-7.0.2-9cacfc53a0-10c0.zip"; hash = "sha512-s4c7nGT/lQIw6x0IfrL0b3ECy/D0g7UoDLdiIWJoM6EGXk5N/dmXdxUdA8Cr3hV/3nO2BYKTQ6Ai8/zGhiSQ3A=="; };
"@typescript/typescript-linux-x64@npm:7.0.2" = { filename = "@typescript-typescript-linux-x64-npm-7.0.2-8dd7ff8d24-10c0.zip"; hash = "sha512-k9EUK5CZ3OOPnyslp8SAAonHJpnpPmlaulppI/NmFyCzNs3UN/TLPUkyQia3KIxgbyTzKoXI5L5fl8Uj9bJ7Cg=="; };
+4 -4
View File
@@ -31,14 +31,14 @@ __metadata:
languageName: node
linkType: hard
"@quixos/camino-package-runtime@https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=652ac8e53e1e770a7c48d684cac47be6bc62b7e9":
"@quixos/camino-package-runtime@https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=a998690446ecf647e3af78e369492c1a3663b66d":
version: 0.1.0
resolution: "@quixos/camino-package-runtime@https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=652ac8e53e1e770a7c48d684cac47be6bc62b7e9"
resolution: "@quixos/camino-package-runtime@https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=a998690446ecf647e3af78e369492c1a3663b66d"
dependencies:
"@bufbuild/protobuf": "npm:^2.12.1"
"@connectrpc/connect": "npm:^2.1.2"
"@connectrpc/connect-node": "npm:^2.1.2"
checksum: 10c0/057866d4f9315d53afa8b08dd00d593d170fc5df95af558fc9d945432828257cbb7d369af4a24e3863125f63ce7a55aee2a9ce1fdb2fbf410f71b2dc7d2e9117
checksum: 10c0/c90d5d5c5311da4fb16e491adabae1b0072b40566524064460cd21ab01b3755e5127e7e14048770448283e22f6cb1af1ba5538ce0fe3b23f014c1151a757deca
languageName: node
linkType: hard
@@ -46,7 +46,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@quixos/web-studio-canvas-runtime@workspace:."
dependencies:
"@quixos/camino-package-runtime": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=652ac8e53e1e770a7c48d684cac47be6bc62b7e9"
"@quixos/camino-package-runtime": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/camino-package-runtime.git#commit=a998690446ecf647e3af78e369492c1a3663b66d"
"@types/node": "npm:^24"
typescript: "npm:^7.0.2"
bin: