Extension SDK
הרחבות drawtonomy הן אפליקציות web מארחות-iframe שמדברות
עם העורך דרך postMessage. ה-SDK נותן לכם לקוח מוקלד;
ה-dev-server נותן לכם עורך מקומי לפתח מולו.
עמוד זה הוא התמצאות מהירה. המדריך המלא — סכמת manifest, רשימת capabilities, פרוטוקול הודעות — נמצא במאגר הציבורי:
התחלה מהירה
Section titled “התחלה מהירה”# Editor on :3000pnpm add -g @drawtonomy/dev-serverdrawtonomy-dev-server
# Your extension on :3001cd my-extension && pnpm dev --port 3001
open "http://localhost:3000/?ext=http://localhost:3001/manifest.json"הרחבה מינימלית
Section titled “הרחבה מינימלית”my-extension/ manifest.json index.html src/{ "id": "my-extension", "name": "My Extension", "version": "1.0.0", "entry": "./index.html", "capabilities": ["shapes:read", "shapes:write", "ui:panel"]}import { ExtensionClient, createVehicle } from '@drawtonomy/sdk'
const client = new ExtensionClient()await client.ready()
document.getElementById('add')!.addEventListener('click', async () => { await client.addShapes([createVehicle(0, 0, { templateId: 'sedan' })])})הרחבות הפניה
Section titled “הרחבות הפניה”ההרחבות in-tree הן דוגמאות בנאמנות מלאה:
ai-scene-generator— יצירת סצנה משפה טבעית ומ-OpenSCENARIO.template-preview— תצוגה מקדימה של תבנית צורה.exporter-playground— הפעלת המייצא מול קנבס חי.path-footprint-lab— ניסויים ב-Path Footprint.
ראו גם
Section titled “ראו גם”- ארכיטקטורת ההרחבות — למה iframes, למה postMessage.
- סקירת
@drawtonomy/sdk— החבילה והמודולים שלה.