feat: add toolbox contract shell and testkit
This commit is contained in:
19
examples/react-app/src/App.tsx
Normal file
19
examples/react-app/src/App.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
13
examples/react-app/src/main.tsx
Normal file
13
examples/react-app/src/main.tsx
Normal 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>,
|
||||
);
|
||||
33
examples/react-app/src/toolbox-app.ts
Normal file
33
examples/react-app/src/toolbox-app.ts
Normal 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",
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user