Export template source from be30143a326d5d7d7b0cbabea5bc5ac0301ef5b9:quixos-instance/packages/web-studio-canvas-editor
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
src/gen/
|
||||||
|
.quixos/
|
||||||
|
result
|
||||||
|
.yarn/cache/
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.yarn/unplugged/
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"monorepoCommit": "be30143a326d5d7d7b0cbabea5bc5ac0301ef5b9",
|
||||||
|
"sourcePath": "quixos-instance/packages/web-studio-canvas-editor"
|
||||||
|
}
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
+24
@@ -0,0 +1,24 @@
|
|||||||
|
enableScripts: true
|
||||||
|
|
||||||
|
generateDefaultNix: false
|
||||||
|
|
||||||
|
individualNixPackaging: true
|
||||||
|
|
||||||
|
nodeLinker: node-modules
|
||||||
|
|
||||||
|
supportedArchitectures:
|
||||||
|
os:
|
||||||
|
- current
|
||||||
|
- linux
|
||||||
|
cpu:
|
||||||
|
- current
|
||||||
|
- x64
|
||||||
|
- arm64
|
||||||
|
libc:
|
||||||
|
- current
|
||||||
|
- glibc
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- checksum: 271de9a785321a37c564b8e2a6b5cd689850b20572d5fee8ec0a6b8e7a5d4cfb59e533524af2b4a537e00da12828abd062eaec6978556e3dd9149a020db2591b
|
||||||
|
path: .yarn/plugins/yarn-plugin-nixify.cjs
|
||||||
|
spec: "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/yarn-plugin-nixify-patched/raw/commit/4528fdd20b30d869262443b3f044549810e75fb8/dist/yarn-plugin-nixify.js"
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Canvas editor component
|
||||||
|
|
||||||
|
This component-only package imports the public Canvas, Placement and Placeable
|
||||||
|
interfaces. Its query spans all three; its only write is the named Canvas name
|
||||||
|
setter. It has no process, Worker, database, private action protocol or copy of
|
||||||
|
canonical state. The input draft is ordinary temporary UI state.
|
||||||
|
|
||||||
|
The checked artifact builder generates `src/gen/client.ts`. `Editor` uses the
|
||||||
|
selected Camino React SDK and declares its styles as a build dependency. Studio
|
||||||
|
supplies the shared session and a subject reference. The package can be replaced
|
||||||
|
independently of the canvas capability implementation or the title-only card.
|
||||||
|
|
||||||
|
Normal independent source checkout/scaffold recipes are qualified in WI-12;
|
||||||
|
these resource pins are the source snapshot used by the Studio integration test.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"component:studio:canvas-editor" = {
|
||||||
|
entry = "src/editor.tsx";
|
||||||
|
export = "Editor";
|
||||||
|
};
|
||||||
|
}
|
||||||
Generated
+108
@@ -0,0 +1,108 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"helpers": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1790852599,
|
||||||
|
"narHash": "sha256-MdNtZpcsoguLPSCpAy9Naz6fkVPrftbZQbz1Aj7Zm9A=",
|
||||||
|
"ref": "refs/tags/quixos-reachability/91679e8cc82133093cb0b4f9e519cbb39a5bba4f",
|
||||||
|
"rev": "91679e8cc82133093cb0b4f9e519cbb39a5bba4f",
|
||||||
|
"revCount": 54,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"ref": "refs/tags/quixos-reachability/91679e8cc82133093cb0b4f9e519cbb39a5bba4f",
|
||||||
|
"rev": "91679e8cc82133093cb0b4f9e519cbb39a5bba4f",
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1783776592,
|
||||||
|
"narHash": "sha256-UgCQzxeWI75XM8G+hPrPh+MKzEPjG3SpAj7dtqSbksA=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "e7a3ca8092b61ff85b6a45bf863ea2b2d6a661b3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"protocol": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1791261504,
|
||||||
|
"narHash": "sha256-QSk9DWR7n5KL6cMHzmSKKXNIyaFA0s8Nu+wXjhhlENI=",
|
||||||
|
"ref": "refs/tags/quixos-reachability/5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87",
|
||||||
|
"rev": "5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87",
|
||||||
|
"revCount": 184,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-protocol.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"ref": "refs/tags/quixos-reachability/5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87",
|
||||||
|
"rev": "5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87",
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-protocol.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"protocol",
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"helpers": "helpers",
|
||||||
|
"nixpkgs": [
|
||||||
|
"protocol",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"protocol": "protocol"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
inputs.protocol.url = "git+https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-protocol.git?ref=refs/tags/quixos-reachability/5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87&rev=5b44c8154dc038efd87cf1cbdd2c00b66bfd4f87";
|
||||||
|
inputs.nixpkgs.follows = "protocol/nixpkgs";
|
||||||
|
inputs.flake-utils.follows = "protocol/flake-utils";
|
||||||
|
inputs.helpers = {
|
||||||
|
url = "git+https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git?ref=refs/tags/quixos-reachability/91679e8cc82133093cb0b4f9e519cbb39a5bba4f&rev=91679e8cc82133093cb0b4f9e519cbb39a5bba4f";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
outputs =
|
||||||
|
{
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
helpers,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
camino = import (helpers + "/quixos-package-helpers.nix");
|
||||||
|
in
|
||||||
|
{
|
||||||
|
quixosPackages.checkedArtifacts =
|
||||||
|
context:
|
||||||
|
let
|
||||||
|
pkgs = camino.packageSet { inherit nixpkgs system context; };
|
||||||
|
dependencies =
|
||||||
|
if builtins.pathExists ./yarn-project.nix then
|
||||||
|
camino.mkCaminoYarnDependencies {
|
||||||
|
inherit pkgs;
|
||||||
|
src = ./.;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
null;
|
||||||
|
in
|
||||||
|
(camino.mkCaminoReactPackage {
|
||||||
|
inherit pkgs context dependencies;
|
||||||
|
src = ./.;
|
||||||
|
modules = import ./components.nix;
|
||||||
|
});
|
||||||
|
devShells.default = camino.mkCaminoYarnShell { inherit pkgs; };
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "@quixos/web-studio-canvas-editor",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import interface StandaloneView;
|
||||||
|
import interface WebStudioCanvas;
|
||||||
|
import interface WebStudioCanvasPlacement;
|
||||||
|
import interface WebStudioPlaceable;
|
||||||
|
package WebStudioCanvasEditor id "package:org.quixos.web-studio:canvas-editor" revision "package:org.quixos.web-studio:canvas-editor@1" {
|
||||||
|
module Editor id "component:studio:canvas-editor" implements StandaloneView<interface WebStudioCanvas>.render;
|
||||||
|
query Inputs id "studio:editor-inputs" root WebStudioCanvas document "queries/inputs.graphql" operation "Inputs" {replica;max rows 200;}
|
||||||
|
query View id "studio:editor-view" root WebStudioCanvas document "queries/view.graphql" operation "View" {local from Inputs;watch;max rows 200;}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
query Inputs { root { name placements(all: 200) { entries { node { presentation subject { _camino { ref } } } } } } }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
query View { root { name placements(all: 200) { entries { node { presentation subject { _camino { ref } } } } } } }
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"backend": "execution",
|
||||||
|
"queryFrontends": ["react"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
quixos-lock version 1 {
|
||||||
|
quixos source { repository "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos.git"; commit "be30143a326d5d7d7b0cbabea5bc5ac0301ef5b9"; }
|
||||||
|
interface StandaloneView source { repository "https://repos.quixos.org/quixos-studio/interface-react-standalone-view.git"; commit "67b00f7ff8df87a477e12c5668c42684d8fa1708"; }
|
||||||
|
interface WebStudioCanvas source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-canvas.git"; commit "fb076e2d0d48080f76b88b2ffa4edeb4c37a7342"; }
|
||||||
|
interface WebStudioCanvasPlacement source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-canvas-placement.git"; commit "8bee874e37700fc860f066f11946efc82a1f521d"; }
|
||||||
|
interface WebStudioPlaceable source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-placeable.git"; commit "a998ebd982f7b61946156a0fa7038bc1295c3afc"; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"modules": {
|
||||||
|
"Editor": {
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"query": "View",
|
||||||
|
"root": {
|
||||||
|
"from": "input",
|
||||||
|
"path": ["subject"]
|
||||||
|
},
|
||||||
|
"arguments": {
|
||||||
|
"record": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
section {
|
||||||
|
padding: 12px;
|
||||||
|
color: #214f65;
|
||||||
|
background: #eef8fc;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font: 600 18px system-ui;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import { useState } from "react";
|
||||||
|
import { useInterface, useMutationFeedback } from "@quixos/camino-react";
|
||||||
|
import { LocalInput } from "@quixos/camino-react/ui";
|
||||||
|
import { interfaces, type Modules } from "./gen/client.js";
|
||||||
|
import "./editor.css";
|
||||||
|
const names = { name: interfaces.WebStudioCanvas.name };
|
||||||
|
export const Editor: Modules["Editor"] = ({ subject, input }) => {
|
||||||
|
const operations = useInterface(names, subject);
|
||||||
|
const [draft, setDraft] = useState("");
|
||||||
|
const feedback = useMutationFeedback();
|
||||||
|
return (
|
||||||
|
<section>
|
||||||
|
<h2>{input.body.root.name}</h2>
|
||||||
|
<label>
|
||||||
|
Name
|
||||||
|
<LocalInput value={draft} onChange={(e) => setDraft(e.target.value)} />
|
||||||
|
</label>
|
||||||
|
<button
|
||||||
|
disabled={operations.status !== "ready"}
|
||||||
|
onClick={() => {
|
||||||
|
if (operations.status === "ready") feedback.track(operations.value.name.set(draft));
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Save name
|
||||||
|
</button>
|
||||||
|
<p>{input.body.root.placements.entries.length} placements in this view</p>
|
||||||
|
<ul>
|
||||||
|
{input.body.root.placements.entries.map(({ node }, i) => (
|
||||||
|
<li key={i}>
|
||||||
|
{node.presentation} · {node.subject._camino.ref.object}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
{feedback.message && <p role="alert">{feedback.message}</p>}
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user