Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f751c64c07 | ||
|
|
b6bef51b85 | ||
|
|
0a722e48ea | ||
|
|
7ce8058f40 | ||
|
|
9d9e06737e |
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"monorepoCommit": "3ac0870810e7bf32e6f262f4b81f11ce7470e784",
|
|
||||||
"sourcePath": "quixos-instance/packages/web-studio-canvas-runtime"
|
|
||||||
}
|
|
||||||
Generated
+7
-7
@@ -37,17 +37,17 @@
|
|||||||
"quixosNixHelpers": {
|
"quixosNixHelpers": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1788574090,
|
"lastModified": 1788543053,
|
||||||
"narHash": "sha256-bSgc0LS2Ub01fnE14VqazdZzFuVPl4sykmA2d1l4kDs=",
|
"narHash": "sha256-3YReATWEVxZinYVi/l3cwOz+oFoZUrwj24kUBQTmUpQ=",
|
||||||
"ref": "refs/tags/quixos-reachability/7177130c0365f2fa58ea4877366e1c5d17db4c01",
|
"ref": "refs/tags/quixos-reachability/56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a",
|
||||||
"rev": "7177130c0365f2fa58ea4877366e1c5d17db4c01",
|
"rev": "56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a",
|
||||||
"revCount": 4,
|
"revCount": 8,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
|
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"ref": "refs/tags/quixos-reachability/7177130c0365f2fa58ea4877366e1c5d17db4c01",
|
"ref": "refs/tags/quixos-reachability/56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a",
|
||||||
"rev": "7177130c0365f2fa58ea4877366e1c5d17db4c01",
|
"rev": "56bbcd22d17f8c7f120b1e0b5bd1d5a86e91a80a",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
|
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
quixosNixHelpers = {
|
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;
|
flake = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"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": {
|
"devDependencies": {
|
||||||
"@types/node": "^24",
|
"@types/node": "^24",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
quixos-lock version 1 {
|
quixos-lock version 1 {
|
||||||
quixos source {
|
quixos source {
|
||||||
repository "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos.git";
|
repository "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos.git";
|
||||||
commit "3ac0870810e7bf32e6f262f4b81f11ce7470e784";
|
commit "9c3ab572ecfbc83785038c3d9f174516df15d63f";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-7
@@ -1,12 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
objectRef,
|
objectRef,
|
||||||
type QxObjectRef,
|
|
||||||
type RuntimeContext,
|
type RuntimeContext,
|
||||||
} from "@quixos/camino-package-runtime";
|
} from "@quixos/camino-package-runtime";
|
||||||
|
|
||||||
export type PlacementInput = {
|
export type PlacementInput = {
|
||||||
canvas_id: QxObjectRef;
|
canvas_id: string;
|
||||||
subject_id: QxObjectRef;
|
subject_id: string;
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
width: number;
|
width: number;
|
||||||
@@ -18,11 +17,10 @@ const finiteNumber = (value: unknown, fallback: number) =>
|
|||||||
typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
||||||
|
|
||||||
const objectId = (value: unknown, field: string) => {
|
const objectId = (value: unknown, field: string) => {
|
||||||
try {
|
if (typeof value !== "string" || !value.startsWith("obj:")) {
|
||||||
return objectRef(value as QxObjectRef);
|
throw new Error(`${field} must be a Camino object ID`);
|
||||||
} catch {
|
|
||||||
throw new Error(`${field} must be a managed object reference`);
|
|
||||||
}
|
}
|
||||||
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const normalizePlacementInput = (
|
export const normalizePlacementInput = (
|
||||||
|
|||||||
+5
-10
@@ -1,23 +1,19 @@
|
|||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import { normalizePlacementInput } from "../dist/canvas.impl.js";
|
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", () => {
|
test("placement input is bounded and normalized", () => {
|
||||||
assert.deepEqual(normalizePlacementInput({
|
assert.deepEqual(normalizePlacementInput({
|
||||||
canvas_id: canvas,
|
canvas_id: "obj:canvas",
|
||||||
subject_id: subject,
|
subject_id: "obj:subject",
|
||||||
x: 12.5,
|
x: 12.5,
|
||||||
y: -30,
|
y: -30,
|
||||||
width: 12,
|
width: 12,
|
||||||
height: 80,
|
height: 80,
|
||||||
z: 3.8,
|
z: 3.8,
|
||||||
}), {
|
}), {
|
||||||
canvas_id: canvas,
|
canvas_id: "obj:canvas",
|
||||||
subject_id: subject,
|
subject_id: "obj:subject",
|
||||||
x: 12.5,
|
x: 12.5,
|
||||||
y: -30,
|
y: -30,
|
||||||
width: 220,
|
width: 220,
|
||||||
@@ -29,7 +25,6 @@ test("placement input is bounded and normalized", () => {
|
|||||||
test("placement input requires Camino object references", () => {
|
test("placement input requires Camino object references", () => {
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => normalizePlacementInput({ canvas_id: "canvas", subject_id: "obj:subject" }),
|
() => 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
@@ -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=="; };
|
"@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-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=="; };
|
"@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=="; };
|
"@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-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=="; };
|
"@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=="; };
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
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
|
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:
|
dependencies:
|
||||||
"@bufbuild/protobuf": "npm:^2.12.1"
|
"@bufbuild/protobuf": "npm:^2.12.1"
|
||||||
"@connectrpc/connect": "npm:^2.1.2"
|
"@connectrpc/connect": "npm:^2.1.2"
|
||||||
"@connectrpc/connect-node": "npm:^2.1.2"
|
"@connectrpc/connect-node": "npm:^2.1.2"
|
||||||
checksum: 10c0/057866d4f9315d53afa8b08dd00d593d170fc5df95af558fc9d945432828257cbb7d369af4a24e3863125f63ce7a55aee2a9ce1fdb2fbf410f71b2dc7d2e9117
|
checksum: 10c0/c90d5d5c5311da4fb16e491adabae1b0072b40566524064460cd21ab01b3755e5127e7e14048770448283e22f6cb1af1ba5538ce0fe3b23f014c1151a757deca
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@quixos/web-studio-canvas-runtime@workspace:."
|
resolution: "@quixos/web-studio-canvas-runtime@workspace:."
|
||||||
dependencies:
|
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"
|
"@types/node": "npm:^24"
|
||||||
typescript: "npm:^7.0.2"
|
typescript: "npm:^7.0.2"
|
||||||
bin:
|
bin:
|
||||||
|
|||||||
Reference in New Issue
Block a user