feat: add SVG Tools to Toolbox 0.10.0
This commit is contained in:
+7
-1
@@ -42,6 +42,9 @@ describe('portal UI', () => {
|
||||
expect(
|
||||
screen.getByTestId('app-card-de.add-ideas.onenote-tools')
|
||||
).toHaveTextContent('OneNote');
|
||||
expect(
|
||||
screen.getByTestId('app-card-de.add-ideas.svg-tools')
|
||||
).toHaveTextContent('SVG');
|
||||
expect(
|
||||
screen.queryByText(
|
||||
'Page-level PDF operations performed locally in the browser.'
|
||||
@@ -407,6 +410,7 @@ describe('portal UI', () => {
|
||||
'de.add-ideas.pdf-tools',
|
||||
'de.add-ideas.xslt-tools',
|
||||
'de.add-ideas.onenote-tools',
|
||||
'de.add-ideas.svg-tools',
|
||||
],
|
||||
hidden: [],
|
||||
theme: 'light',
|
||||
@@ -424,6 +428,7 @@ describe('portal UI', () => {
|
||||
screen.getByTestId('app-card-de.add-ideas.pdf-tools'),
|
||||
screen.getByTestId('app-card-de.add-ideas.xslt-tools'),
|
||||
screen.getByTestId('app-card-de.add-ideas.onenote-tools'),
|
||||
screen.getByTestId('app-card-de.add-ideas.svg-tools'),
|
||||
];
|
||||
cards.forEach((card, index) => {
|
||||
const rect = {
|
||||
@@ -454,7 +459,7 @@ describe('portal UI', () => {
|
||||
within(tools)
|
||||
.getAllByRole('heading', { level: 3 })
|
||||
.map((heading) => heading.textContent)
|
||||
).toEqual(['XSLT', 'PDF', 'OneNote']);
|
||||
).toEqual(['XSLT', 'PDF', 'OneNote', 'SVG']);
|
||||
});
|
||||
expect(
|
||||
JSON.parse(localStorage.getItem(PREFERENCES_KEY) ?? '{}').order
|
||||
@@ -462,6 +467,7 @@ describe('portal UI', () => {
|
||||
'de.add-ideas.xslt-tools',
|
||||
'de.add-ideas.pdf-tools',
|
||||
'de.add-ideas.onenote-tools',
|
||||
'de.add-ideas.svg-tools',
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
+2
-2
@@ -489,9 +489,9 @@ export default function App() {
|
||||
</span>
|
||||
</p>
|
||||
<span>
|
||||
Portal v0.2.11 ·{' '}
|
||||
Portal v0.2.12 ·{' '}
|
||||
<a
|
||||
href="https://git.add-ideas.de/lotobo/toolbox-portal/src/tag/v0.9.3"
|
||||
href="https://git.add-ideas.de/lotobo/toolbox-portal/src/tag/v0.10.0"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('catalogue loading', () => {
|
||||
const loaded = await loadCatalogue('/toolbox.catalog.json');
|
||||
expect(loaded.catalogue.name).toBe('add·ideas Toolbox');
|
||||
expect(loaded.homeUrl).toBe('http://localhost:3000/');
|
||||
expect(loaded.apps).toHaveLength(3);
|
||||
expect(loaded.apps).toHaveLength(4);
|
||||
expect(loaded.apps[0]).toMatchObject({
|
||||
id: 'de.add-ideas.pdf-tools',
|
||||
name: 'PDF Workbench',
|
||||
@@ -40,6 +40,7 @@ describe('catalogue loading', () => {
|
||||
'de.add-ideas.pdf-tools',
|
||||
'de.add-ideas.xslt-tools',
|
||||
'de.add-ideas.onenote-tools',
|
||||
'de.add-ideas.svg-tools',
|
||||
]);
|
||||
expect(loaded.unavailable).toHaveLength(1);
|
||||
expect(loaded.unavailable[0]?.reason).toMatch(/HTTP 404/);
|
||||
|
||||
@@ -87,6 +87,38 @@ export const regexManifest: ToolboxAppManifest = {
|
||||
},
|
||||
};
|
||||
|
||||
export const svgManifest: ToolboxAppManifest = {
|
||||
...pdfManifest,
|
||||
id: 'de.add-ideas.svg-tools',
|
||||
name: 'SVG Tools',
|
||||
version: '0.1.0',
|
||||
description:
|
||||
'Inspect, edit, optimize and transform SVG documents locally in the browser.',
|
||||
icon: './favicon.svg',
|
||||
categories: ['graphics', 'design', 'developer'],
|
||||
tags: [
|
||||
'svg',
|
||||
'vector',
|
||||
'path',
|
||||
'xml',
|
||||
'transform',
|
||||
'optimize',
|
||||
'accessibility',
|
||||
],
|
||||
requirements: {
|
||||
secureContext: false,
|
||||
workers: true,
|
||||
indexedDb: false,
|
||||
crossOriginIsolated: false,
|
||||
topLevelContext: false,
|
||||
},
|
||||
source: {
|
||||
repository: 'https://git.add-ideas.de/lotobo/svg-tools',
|
||||
license: 'GPL-3.0-or-later',
|
||||
},
|
||||
assets: ['./canvas-frame-controller.js'],
|
||||
};
|
||||
|
||||
export const catalogue: ToolboxCatalog = {
|
||||
schemaVersion: 1,
|
||||
id: 'de.add-ideas.toolbox',
|
||||
@@ -97,6 +129,7 @@ export const catalogue: ToolboxCatalog = {
|
||||
{ manifest: './apps/pdf/toolbox-app.json', enabled: true },
|
||||
{ manifest: './apps/xslt/toolbox-app.json', enabled: true },
|
||||
{ manifest: './apps/onenote/toolbox-app.json', enabled: true },
|
||||
{ manifest: './apps/svg/toolbox-app.json', enabled: true },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -118,6 +151,8 @@ export function catalogueFetch(overrides: Record<string, Response> = {}) {
|
||||
return Response.json(onenoteManifest);
|
||||
if (url.pathname.endsWith('/apps/regex/toolbox-app.json'))
|
||||
return Response.json(regexManifest);
|
||||
if (url.pathname.endsWith('/apps/svg/toolbox-app.json'))
|
||||
return Response.json(svgManifest);
|
||||
return new Response('Not found', { status: 404 });
|
||||
};
|
||||
}
|
||||
|
||||
@@ -28,4 +28,15 @@ describe('compact tool presentation', () => {
|
||||
expect(shortToolTitle(regex)).toBe('Regex');
|
||||
expect(shortToolDescription(regex)).toBe('Explain and test locally.');
|
||||
});
|
||||
|
||||
it('uses the compact SVG tile copy', () => {
|
||||
const svg = app(
|
||||
'de.add-ideas.svg-tools',
|
||||
'SVG Tools',
|
||||
'Inspect, edit, optimize and transform SVG documents locally in the browser.'
|
||||
);
|
||||
|
||||
expect(shortToolTitle(svg)).toBe('SVG');
|
||||
expect(shortToolDescription(svg)).toBe('Inspect and edit vectors locally.');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,6 +21,10 @@ const PRESENTATION: Record<string, { title: string; description: string }> = {
|
||||
title: 'Regex',
|
||||
description: 'Explain and test locally.',
|
||||
},
|
||||
'de.add-ideas.svg-tools': {
|
||||
title: 'SVG',
|
||||
description: 'Inspect and edit vectors locally.',
|
||||
},
|
||||
};
|
||||
|
||||
export function shortToolTitle(app: ResolvedApp): string {
|
||||
|
||||
Reference in New Issue
Block a user