feat: add toolbox contract shell and testkit

This commit is contained in:
2026-07-20 17:53:56 +02:00
commit ce9bddb218
53 changed files with 8950 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { AppShell } from "@add-ideas/toolbox-shell-react";
import "@add-ideas/toolbox-shell-react/styles.css";
import { toolboxApp } from "./toolbox-app.js";
export function App() {
return (
<AppShell app={toolboxApp} appActions={<a href="./help/">Help</a>}>
<section>
<h2>Ready</h2>
<p>
Open this app directly for standalone mode, or add
<code>?toolbox=/toolbox.catalog.json</code> to connect it to a
same-origin catalog.
</p>
</section>
</AppShell>
);
}

View File

@@ -0,0 +1,13 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { App } from "./App.js";
const root = document.querySelector("#root");
if (!root) throw new Error("Missing #root element");
createRoot(root).render(
<StrictMode>
<App />
</StrictMode>,
);

View File

@@ -0,0 +1,33 @@
import { defineToolboxApp } from "@add-ideas/toolbox-contract";
export const toolboxApp = defineToolboxApp({
schemaVersion: 1,
id: "de.add-ideas.example-tool",
name: "Example Tool",
version: "0.1.0",
description: "A minimal toolbox-compatible React application.",
entry: "./",
icon: "./icon.svg",
categories: ["examples"],
tags: ["react", "toolbox"],
integration: {
contextVersion: 1,
launchModes: ["navigate", "new-tab"],
embedding: "unsupported",
},
requirements: {
secureContext: false,
workers: false,
indexedDb: false,
crossOriginIsolated: false,
},
privacy: {
processing: "local",
fileUploads: false,
telemetry: false,
},
source: {
repository: "https://git.add-ideas.de/zemion/toolbox-sdk",
license: "Apache-2.0",
},
});