@agent-canvas/cli 0.9.3 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/add-arrow.d.ts +1 -0
- package/dist/commands/add-arrow.js +1 -0
- package/dist/commands/add-line.d.ts +1 -0
- package/dist/commands/add-line.js +1 -0
- package/dist/commands/add-polygon.d.ts +1 -0
- package/dist/commands/add-polygon.js +1 -0
- package/dist/commands/add-shape.d.ts +1 -0
- package/dist/commands/add-shape.js +1 -0
- package/dist/commands/add-text.d.ts +1 -0
- package/dist/commands/add-text.js +1 -0
- package/dist/commands/start.d.ts +3 -1
- package/dist/commands/start.js +69 -4
- package/dist/index.js +14 -3
- package/dist/lib/protocol.d.ts +14 -1
- package/dist/lib/protocol.js +1 -1
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.js +75 -42
- package/dist/static/assets/{ar-SA-G6X2FPQ2-OI07M2im.js → ar-SA-G6X2FPQ2-Ce08lp2o.js} +1 -1
- package/dist/static/assets/{arc-CXEwCJpq.js → arc-BkHVeepa.js} +1 -1
- package/dist/static/assets/{az-AZ-76LH7QW2-Bs11NNqv.js → az-AZ-76LH7QW2-BVPMoIzP.js} +1 -1
- package/dist/static/assets/{bg-BG-XCXSNQG7-D88Ok53c.js → bg-BG-XCXSNQG7-CInScHp1.js} +1 -1
- package/dist/static/assets/{blockDiagram-38ab4fdb-CFP7LyvE.js → blockDiagram-38ab4fdb-Dt3degeL.js} +1 -1
- package/dist/static/assets/{bn-BD-2XOGV67Q-srQEDw1N.js → bn-BD-2XOGV67Q-CD6tY0zX.js} +1 -1
- package/dist/static/assets/{c4Diagram-3d4e48cf-CUMJND-M.js → c4Diagram-3d4e48cf-CsBfo8s7.js} +1 -1
- package/dist/static/assets/{ca-ES-6MX7JW3Y-DBiBw1oL.js → ca-ES-6MX7JW3Y-BiZWDmu1.js} +1 -1
- package/dist/static/assets/channel-LxwPflxn.js +1 -0
- package/dist/static/assets/{classDiagram-70f12bd4-DvOQxFGF.js → classDiagram-70f12bd4-CqreGe0S.js} +1 -1
- package/dist/static/assets/{classDiagram-v2-f2320105-BI8lgLMQ.js → classDiagram-v2-f2320105-B-fnFJnj.js} +1 -1
- package/dist/static/assets/clone-Du22Wc8Z.js +1 -0
- package/dist/static/assets/{createText-2e5e7dd3-C5mUCf4V.js → createText-2e5e7dd3-OugxGj-6.js} +1 -1
- package/dist/static/assets/{cs-CZ-2BRQDIVT-B4iQqVAa.js → cs-CZ-2BRQDIVT-C_2Qpntw.js} +1 -1
- package/dist/static/assets/{da-DK-5WZEPLOC-C2c5eawx.js → da-DK-5WZEPLOC-Dv1WhdR5.js} +1 -1
- package/dist/static/assets/{de-DE-XR44H4JA-hWU-pHeb.js → de-DE-XR44H4JA-DQlTqiWP.js} +1 -1
- package/dist/static/assets/{edges-e0da2a9e-DJwqQCy1.js → edges-e0da2a9e-dDd1EBCU.js} +1 -1
- package/dist/static/assets/{el-GR-BZB4AONW-BOp__7jf.js → el-GR-BZB4AONW-B7Lao56C.js} +1 -1
- package/dist/static/assets/{erDiagram-9861fffd-Dfot_7xQ.js → erDiagram-9861fffd-D4fjZHso.js} +1 -1
- package/dist/static/assets/{es-ES-U4NZUMDT-BOfCdR42.js → es-ES-U4NZUMDT-Cn0xmMVA.js} +1 -1
- package/dist/static/assets/{eu-ES-A7QVB2H4-IHshoU_P.js → eu-ES-A7QVB2H4-DkHBhAsA.js} +1 -1
- package/dist/static/assets/{fa-IR-HGAKTJCU-C9I-xx_r.js → fa-IR-HGAKTJCU-BM18A3xb.js} +1 -1
- package/dist/static/assets/{fi-FI-Z5N7JZ37-wLeRAV1Q.js → fi-FI-Z5N7JZ37-2lVAIeWc.js} +1 -1
- package/dist/static/assets/{flowDb-956e92f1-DMxaUuFm.js → flowDb-956e92f1-BSPjf8yF.js} +1 -1
- package/dist/static/assets/{flowDiagram-66a62f08-BHyXrvRr.js → flowDiagram-66a62f08-BMgRAlPI.js} +1 -1
- package/dist/static/assets/flowDiagram-v2-96b9c2cf-BOfGO5-y.js +1 -0
- package/dist/static/assets/{flowchart-elk-definition-4a651766-BufCtkcL.js → flowchart-elk-definition-4a651766-CdvNef4S.js} +1 -1
- package/dist/static/assets/{fr-FR-RHASNOE6-o0wU2k8o.js → fr-FR-RHASNOE6-C4q6bJB9.js} +1 -1
- package/dist/static/assets/{ganttDiagram-c361ad54-ByvbuAA0.js → ganttDiagram-c361ad54-BEfuNuJ-.js} +1 -1
- package/dist/static/assets/{gitGraphDiagram-72cf32ee-Vb9-lyLw.js → gitGraphDiagram-72cf32ee-CxzHZ4c8.js} +1 -1
- package/dist/static/assets/{gl-ES-HMX3MZ6V-BnvptIWS.js → gl-ES-HMX3MZ6V-DxNHxjYU.js} +1 -1
- package/dist/static/assets/{graph-pu7okUMx.js → graph-CMXJkOFy.js} +1 -1
- package/dist/static/assets/{he-IL-6SHJWFNN-DGEKDUpP.js → he-IL-6SHJWFNN-Dl8s228h.js} +1 -1
- package/dist/static/assets/{hi-IN-IWLTKZ5I-C3xwdGL1.js → hi-IN-IWLTKZ5I-qiaxj6he.js} +1 -1
- package/dist/static/assets/{hu-HU-A5ZG7DT2-By9B8R6Z.js → hu-HU-A5ZG7DT2-Cul9-CZS.js} +1 -1
- package/dist/static/assets/{id-ID-SAP4L64H-pvohEBbk.js → id-ID-SAP4L64H-he93I50g.js} +1 -1
- package/dist/static/assets/{index-3862675e-Csobku0c.js → index-3862675e-CG4MNtwd.js} +1 -1
- package/dist/static/assets/{index-D06NUpbo.js → index-D8VjnP-8.js} +4 -4
- package/dist/static/assets/{index-CRwpS-Cr.js → index-D_54h8Zf.js} +88 -73
- package/dist/static/assets/{infoDiagram-f8f76790-BBFkBSpd.js → infoDiagram-f8f76790-mVkTzQvk.js} +1 -1
- package/dist/static/assets/{it-IT-JPQ66NNP-C_L6-f64.js → it-IT-JPQ66NNP-m_RzGNh7.js} +1 -1
- package/dist/static/assets/{ja-JP-DBVTYXUO-BBZk3fr7.js → ja-JP-DBVTYXUO-jSmANWMZ.js} +1 -1
- package/dist/static/assets/{journeyDiagram-49397b02-B9Bl3gEG.js → journeyDiagram-49397b02-Z_Ho5ZAB.js} +1 -1
- package/dist/static/assets/{kaa-6HZHGXH3-h1BYWxcw.js → kaa-6HZHGXH3-BiV0VYjS.js} +1 -1
- package/dist/static/assets/{kab-KAB-ZGHBKWFO-DJhPKKzp.js → kab-KAB-ZGHBKWFO-BT44LKTf.js} +1 -1
- package/dist/static/assets/{kk-KZ-P5N5QNE5-CmdDVy5G.js → kk-KZ-P5N5QNE5-DXpgSPnS.js} +1 -1
- package/dist/static/assets/{km-KH-HSX4SM5Z-CqylwsJ0.js → km-KH-HSX4SM5Z-GreOo74X.js} +1 -1
- package/dist/static/assets/{ko-KR-MTYHY66A-Cd3OEh4A.js → ko-KR-MTYHY66A-B8oviY81.js} +1 -1
- package/dist/static/assets/{ku-TR-6OUDTVRD-C7vLQ7yg.js → ku-TR-6OUDTVRD-B_KIF7e5.js} +1 -1
- package/dist/static/assets/{layout-D2mkT-7s.js → layout-DXzB1vTB.js} +1 -1
- package/dist/static/assets/{line-rA_iOGWm.js → line-DdAgkzw5.js} +1 -1
- package/dist/static/assets/{linear-C2yfyEZI.js → linear-BCMJbGyJ.js} +1 -1
- package/dist/static/assets/{lt-LT-XHIRWOB4-CN8zb3F9.js → lt-LT-XHIRWOB4-FrsUgb0b.js} +1 -1
- package/dist/static/assets/{lv-LV-5QDEKY6T-CUt--0WM.js → lv-LV-5QDEKY6T-BLZxr6R9.js} +1 -1
- package/dist/static/assets/{mindmap-definition-fc14e90a-BKLTsvp9.js → mindmap-definition-fc14e90a-DKyX3emJ.js} +1 -1
- package/dist/static/assets/{mr-IN-CRQNXWMA-DPUW5bB6.js → mr-IN-CRQNXWMA-Ddfj-qUW.js} +1 -1
- package/dist/static/assets/{my-MM-5M5IBNSE-DmqyScKY.js → my-MM-5M5IBNSE-CQF313Z3.js} +1 -1
- package/dist/static/assets/{nb-NO-T6EIAALU-BDvOHDKI.js → nb-NO-T6EIAALU-Bs9HDcQA.js} +1 -1
- package/dist/static/assets/{nl-NL-IS3SIHDZ-CJNodfoA.js → nl-NL-IS3SIHDZ-5IudGVUP.js} +1 -1
- package/dist/static/assets/{nn-NO-6E72VCQL-Ow7WOnDZ.js → nn-NO-6E72VCQL-DeZGIXBG.js} +1 -1
- package/dist/static/assets/{oc-FR-POXYY2M6--a70xyI2.js → oc-FR-POXYY2M6-DvK0OlJY.js} +1 -1
- package/dist/static/assets/{pa-IN-N4M65BXN-dxbvRq6t.js → pa-IN-N4M65BXN-CTt5TGS7.js} +1 -1
- package/dist/static/assets/{pica-F5gIwYSq.js → pica-Cx-Eb85q.js} +1 -1
- package/dist/static/assets/{pieDiagram-8a3498a8-BhyZpZI7.js → pieDiagram-8a3498a8-C6pU4z_X.js} +1 -1
- package/dist/static/assets/{pl-PL-T2D74RX3-DxQwHZQA.js → pl-PL-T2D74RX3-DOeC5J8p.js} +1 -1
- package/dist/static/assets/{pt-BR-5N22H2LF-CIbxdIx3.js → pt-BR-5N22H2LF-CaV3hUbn.js} +1 -1
- package/dist/static/assets/{pt-PT-UZXXM6DQ-qeGgueeu.js → pt-PT-UZXXM6DQ-C7E4Si6G.js} +1 -1
- package/dist/static/assets/{quadrantDiagram-120e2f19-BBKBZlc1.js → quadrantDiagram-120e2f19-CfcB20VK.js} +1 -1
- package/dist/static/assets/{requirementDiagram-deff3bca-XmNGhapG.js → requirementDiagram-deff3bca-ikZaiaAR.js} +1 -1
- package/dist/static/assets/{ro-RO-JPDTUUEW-CfGukAQu.js → ro-RO-JPDTUUEW-B0w9YPkY.js} +1 -1
- package/dist/static/assets/{ru-RU-B4JR7IUQ-ofiPuFd7.js → ru-RU-B4JR7IUQ-BhLH0Gn4.js} +1 -1
- package/dist/static/assets/{sankeyDiagram-04a897e0-C-xevu0B.js → sankeyDiagram-04a897e0-OB3SO0Dc.js} +1 -1
- package/dist/static/assets/{sequenceDiagram-704730f1-CSTgOlda.js → sequenceDiagram-704730f1-D167QCul.js} +1 -1
- package/dist/static/assets/{si-LK-N5RQ5JYF-B0OfXlJY.js → si-LK-N5RQ5JYF-DmTM35vb.js} +1 -1
- package/dist/static/assets/{sk-SK-C5VTKIMK-CKeQH7R9.js → sk-SK-C5VTKIMK-BqIMGS85.js} +1 -1
- package/dist/static/assets/{sl-SI-NN7IZMDC-Cpjrl0qY.js → sl-SI-NN7IZMDC-BQSdLR8B.js} +1 -1
- package/dist/static/assets/{stateDiagram-587899a1-BP29Ip09.js → stateDiagram-587899a1-CuXXxt5C.js} +1 -1
- package/dist/static/assets/{stateDiagram-v2-d93cdb3a-DsigOnWl.js → stateDiagram-v2-d93cdb3a-PBKC0jL5.js} +1 -1
- package/dist/static/assets/{styles-6aaf32cf-MgD20Blj.js → styles-6aaf32cf-BwTgMSix.js} +1 -1
- package/dist/static/assets/{styles-9a916d00-DEHfjEP7.js → styles-9a916d00-CSnciK5f.js} +1 -1
- package/dist/static/assets/{styles-c10674c1-VAlPhFYg.js → styles-c10674c1-BbjnCqMr.js} +1 -1
- package/dist/static/assets/{subset-shared.chunk-DAsvDCyy.js → subset-shared.chunk-lDC8bbuQ.js} +1 -1
- package/dist/static/assets/{subset-worker.chunk-CpsSnVw7.js → subset-worker.chunk-DPv0zJBp.js} +1 -1
- package/dist/static/assets/{sv-SE-XGPEYMSR-DYospC9W.js → sv-SE-XGPEYMSR-DKHoj3KM.js} +1 -1
- package/dist/static/assets/{svgDrawCommon-08f97a94-ChDeILCO.js → svgDrawCommon-08f97a94-wMt4MZkg.js} +1 -1
- package/dist/static/assets/{ta-IN-2NMHFXQM-KUge_7cv.js → ta-IN-2NMHFXQM-DzRF5wNX.js} +1 -1
- package/dist/static/assets/{th-TH-HPSO5L25-CVkpv1fu.js → th-TH-HPSO5L25-jF9etk7j.js} +1 -1
- package/dist/static/assets/{timeline-definition-85554ec2-CU_3H962.js → timeline-definition-85554ec2-DES-e9Dl.js} +1 -1
- package/dist/static/assets/{tr-TR-DEFEU3FU-1NgM7ujU.js → tr-TR-DEFEU3FU-BHBwBdDN.js} +1 -1
- package/dist/static/assets/{uk-UA-QMV73CPH-CEbyUSYh.js → uk-UA-QMV73CPH-CaKBJcwe.js} +1 -1
- package/dist/static/assets/{vi-VN-M7AON7JQ-BEJyctOP.js → vi-VN-M7AON7JQ-B3-vrsch.js} +1 -1
- package/dist/static/assets/{xychartDiagram-e933f94c-DYLyz3Ik.js → xychartDiagram-e933f94c-D5LbRAMn.js} +1 -1
- package/dist/static/assets/{zh-CN-LNUGB5OW-BP-hYWvz.js → zh-CN-LNUGB5OW-DHFAxh-M.js} +1 -1
- package/dist/static/assets/{zh-HK-E62DVLB3-CKB1nhLy.js → zh-HK-E62DVLB3-cxLNf1YN.js} +1 -1
- package/dist/static/assets/{zh-TW-RAJ6MFWO-Dr_41d5b.js → zh-TW-RAJ6MFWO-DwuDS7A5.js} +1 -1
- package/dist/static/index.html +1 -1
- package/package.json +2 -4
- package/dist/static/assets/channel-D1JfzpyT.js +0 -1
- package/dist/static/assets/clone-vfq7Fn_w.js +0 -1
- package/dist/static/assets/flowDiagram-v2-96b9c2cf-CSEIAIQ0.js +0 -1
|
@@ -35,6 +35,7 @@ export async function addArrow(options, deps = defaultDeps) {
|
|
|
35
35
|
arrowType: options.arrowType,
|
|
36
36
|
midpoints,
|
|
37
37
|
customData: options.note ? { note: options.note } : undefined,
|
|
38
|
+
animated: options.animated,
|
|
38
39
|
};
|
|
39
40
|
const result = await client.send({
|
|
40
41
|
type: 'addArrow',
|
|
@@ -18,6 +18,7 @@ export async function addLine(options, deps = defaultDeps) {
|
|
|
18
18
|
strokeWidth: options.strokeWidth,
|
|
19
19
|
strokeStyle: options.strokeStyle,
|
|
20
20
|
customData: options.note ? { note: options.note } : undefined,
|
|
21
|
+
animated: options.animated,
|
|
21
22
|
};
|
|
22
23
|
const result = await client.send({
|
|
23
24
|
type: 'addLine',
|
|
@@ -27,6 +27,7 @@ export async function addPolygon(options, deps = defaultDeps) {
|
|
|
27
27
|
strokeStyle: options.strokeStyle,
|
|
28
28
|
fillStyle: options.fillStyle,
|
|
29
29
|
customData: options.note ? { note: options.note } : undefined,
|
|
30
|
+
animated: options.animated,
|
|
30
31
|
};
|
|
31
32
|
const result = await client.send({
|
|
32
33
|
type: 'addPolygon',
|
|
@@ -21,6 +21,7 @@ export async function addShape(options, deps = defaultDeps) {
|
|
|
21
21
|
strokeStyle: options.strokeStyle,
|
|
22
22
|
fillStyle: options.fillStyle,
|
|
23
23
|
customData: options.note ? { note: options.note } : undefined,
|
|
24
|
+
animated: options.animated,
|
|
24
25
|
};
|
|
25
26
|
if (options.label) {
|
|
26
27
|
params.label = {
|
|
@@ -18,6 +18,7 @@ export async function addText(options, deps = defaultDeps) {
|
|
|
18
18
|
anchor: options.anchor,
|
|
19
19
|
strokeColor: options.strokeColor,
|
|
20
20
|
customData: options.note ? { note: options.note } : undefined,
|
|
21
|
+
animated: options.animated,
|
|
21
22
|
};
|
|
22
23
|
const result = await client.send({
|
|
23
24
|
type: 'addText',
|
package/dist/commands/start.d.ts
CHANGED
package/dist/commands/start.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { exec } from 'child_process';
|
|
1
|
+
import { exec, spawn } from 'child_process';
|
|
2
2
|
import { promisify } from 'util';
|
|
3
|
+
import { existsSync } from 'fs';
|
|
4
|
+
import { join, dirname } from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
3
6
|
import { startServer, isBrowserServerRunning, isBrowserConnected } from '../server/index.js';
|
|
4
7
|
const execAsync = promisify(exec);
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
9
|
async function openBrowser(url) {
|
|
6
10
|
const platform = process.platform;
|
|
7
11
|
try {
|
|
@@ -19,7 +23,66 @@ async function openBrowser(url) {
|
|
|
19
23
|
console.log(`Please open ${url} in your browser`);
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
|
-
|
|
26
|
+
function findWebAppDir() {
|
|
27
|
+
const possiblePaths = [
|
|
28
|
+
join(__dirname, '../../../web-app'),
|
|
29
|
+
join(__dirname, '../../../../packages/web-app'),
|
|
30
|
+
];
|
|
31
|
+
for (const p of possiblePaths) {
|
|
32
|
+
if (existsSync(join(p, 'package.json'))) {
|
|
33
|
+
return p;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
throw new Error('web-app package not found. --dev mode must be run from the source repository.');
|
|
37
|
+
}
|
|
38
|
+
export async function start(options) {
|
|
39
|
+
if (options?.dev) {
|
|
40
|
+
// Set dev port defaults
|
|
41
|
+
if (!process.env.AGENT_CANVAS_WS_PORT) {
|
|
42
|
+
process.env.AGENT_CANVAS_WS_PORT = '7900';
|
|
43
|
+
}
|
|
44
|
+
// Start WS-only server
|
|
45
|
+
console.log('Starting dev mode...');
|
|
46
|
+
await startServer({ wsOnly: true });
|
|
47
|
+
// Start Vite dev server
|
|
48
|
+
const webAppDir = findWebAppDir();
|
|
49
|
+
const viteProcess = spawn('npx', ['vite', '--host'], {
|
|
50
|
+
cwd: webAppDir,
|
|
51
|
+
env: { ...process.env, VITE_WS_PORT: process.env.AGENT_CANVAS_WS_PORT },
|
|
52
|
+
stdio: 'pipe',
|
|
53
|
+
});
|
|
54
|
+
// Parse Vite output to get URL, then open browser
|
|
55
|
+
let opened = false;
|
|
56
|
+
viteProcess.stdout?.on('data', (data) => {
|
|
57
|
+
const output = data.toString();
|
|
58
|
+
process.stdout.write(output);
|
|
59
|
+
if (!opened) {
|
|
60
|
+
// Vite prints "Local: http://localhost:5173/" — extract the URL
|
|
61
|
+
const match = output.match(/Local:\s+(https?:\/\/\S+)/);
|
|
62
|
+
if (match) {
|
|
63
|
+
opened = true;
|
|
64
|
+
openBrowser(match[1]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
viteProcess.stderr?.on('data', (data) => {
|
|
69
|
+
process.stderr.write(data);
|
|
70
|
+
});
|
|
71
|
+
viteProcess.on('close', (code) => {
|
|
72
|
+
console.log(`Vite dev server exited with code ${code}`);
|
|
73
|
+
process.exit(code ?? 0);
|
|
74
|
+
});
|
|
75
|
+
// Cleanup: kill Vite on Ctrl+C
|
|
76
|
+
const cleanup = () => {
|
|
77
|
+
viteProcess.kill();
|
|
78
|
+
process.exit(0);
|
|
79
|
+
};
|
|
80
|
+
process.on('SIGINT', cleanup);
|
|
81
|
+
process.on('SIGTERM', cleanup);
|
|
82
|
+
console.log('\nDev mode is ready. Press Ctrl+C to stop.');
|
|
83
|
+
await new Promise(() => { }); // Block forever
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
23
86
|
const running = await isBrowserServerRunning();
|
|
24
87
|
if (!running) {
|
|
25
88
|
console.log('Starting canvas server...');
|
|
@@ -29,11 +92,13 @@ export async function start() {
|
|
|
29
92
|
await new Promise((r) => setTimeout(r, 1500));
|
|
30
93
|
const browserConnected = await isBrowserConnected();
|
|
31
94
|
if (browserConnected) {
|
|
32
|
-
|
|
95
|
+
const httpPort = process.env.AGENT_CANVAS_HTTP_PORT || '7891';
|
|
96
|
+
console.log(`Canvas already running at http://localhost:${httpPort}`);
|
|
33
97
|
}
|
|
34
98
|
else {
|
|
99
|
+
const httpPort = process.env.AGENT_CANVAS_HTTP_PORT || '7891';
|
|
35
100
|
console.log('Opening browser...');
|
|
36
|
-
await openBrowser(
|
|
101
|
+
await openBrowser(`http://localhost:${httpPort}`);
|
|
37
102
|
}
|
|
38
103
|
// Keep the server running
|
|
39
104
|
console.log('\nCanvas is ready. Press Ctrl+C to stop.');
|
package/dist/index.js
CHANGED
|
@@ -25,12 +25,13 @@ const program = new Command();
|
|
|
25
25
|
program
|
|
26
26
|
.name('agent-canvas')
|
|
27
27
|
.description('CLI for Agent Canvas - Excalidraw interface for AI agents')
|
|
28
|
-
.version('0.
|
|
28
|
+
.version('0.11.0');
|
|
29
29
|
program
|
|
30
30
|
.command('start')
|
|
31
31
|
.description('Start the canvas server and open in browser')
|
|
32
|
-
.
|
|
33
|
-
|
|
32
|
+
.option('--dev', 'Development mode: use Vite dev server with HMR')
|
|
33
|
+
.action(async (options) => {
|
|
34
|
+
await start({ dev: options.dev });
|
|
34
35
|
});
|
|
35
36
|
program
|
|
36
37
|
.command('load [filepath]')
|
|
@@ -58,6 +59,7 @@ program
|
|
|
58
59
|
.option('--label-font-size <number>', 'Label font size', parseFloat)
|
|
59
60
|
.option('--label-stroke-color <color>', 'Label text color (hex, defaults to --stroke-color)')
|
|
60
61
|
.option('-n, --note <text>', 'Note for this element (stored in customData)')
|
|
62
|
+
.option('--animated', 'Zoom to element after adding')
|
|
61
63
|
.action(async (options) => {
|
|
62
64
|
await addShape({
|
|
63
65
|
type: options.type,
|
|
@@ -74,6 +76,7 @@ program
|
|
|
74
76
|
labelFontSize: options.labelFontSize,
|
|
75
77
|
labelStrokeColor: options.labelStrokeColor,
|
|
76
78
|
note: options.note,
|
|
79
|
+
animated: options.animated,
|
|
77
80
|
}, addShapeDeps);
|
|
78
81
|
});
|
|
79
82
|
// ============================================================================
|
|
@@ -90,6 +93,7 @@ program
|
|
|
90
93
|
.option('-a, --anchor <anchor>', 'Anchor point: topLeft, topCenter, topRight, leftCenter, center, rightCenter, bottomLeft, bottomCenter, bottomRight')
|
|
91
94
|
.option('--stroke-color <color>', 'Text color (hex)')
|
|
92
95
|
.option('-n, --note <text>', 'Note for this element (stored in customData)')
|
|
96
|
+
.option('--animated', 'Zoom to element after adding')
|
|
93
97
|
.action(async (options) => {
|
|
94
98
|
await addText({
|
|
95
99
|
text: options.text,
|
|
@@ -100,6 +104,7 @@ program
|
|
|
100
104
|
anchor: options.anchor,
|
|
101
105
|
strokeColor: options.strokeColor,
|
|
102
106
|
note: options.note,
|
|
107
|
+
animated: options.animated,
|
|
103
108
|
}, addTextDeps);
|
|
104
109
|
});
|
|
105
110
|
// ============================================================================
|
|
@@ -116,6 +121,7 @@ program
|
|
|
116
121
|
.option('--stroke-width <number>', 'Line width in pixels', parseFloat)
|
|
117
122
|
.option('--stroke-style <style>', 'Line style: solid, dashed, or dotted')
|
|
118
123
|
.option('-n, --note <text>', 'Note for this element (stored in customData)')
|
|
124
|
+
.option('--animated', 'Zoom to element after adding')
|
|
119
125
|
.action(async (options) => {
|
|
120
126
|
await addLine({
|
|
121
127
|
x: options.x,
|
|
@@ -126,6 +132,7 @@ program
|
|
|
126
132
|
strokeWidth: options.strokeWidth,
|
|
127
133
|
strokeStyle: options.strokeStyle,
|
|
128
134
|
note: options.note,
|
|
135
|
+
animated: options.animated,
|
|
129
136
|
}, addLineDeps);
|
|
130
137
|
});
|
|
131
138
|
// ============================================================================
|
|
@@ -146,6 +153,7 @@ program
|
|
|
146
153
|
.option('--arrow-type <type>', 'Arrow type: sharp (straight), round (curved), elbow (90° angles)')
|
|
147
154
|
.option('--via <points>', 'Intermediate points as "x1,y1;x2,y2;..." (absolute coordinates). For round: 1 control point. For elbow: multiple turn points.')
|
|
148
155
|
.option('-n, --note <text>', 'Note for this element (stored in customData)')
|
|
156
|
+
.option('--animated', 'Zoom to element after adding')
|
|
149
157
|
.action(async (options) => {
|
|
150
158
|
await addArrow({
|
|
151
159
|
x: options.x,
|
|
@@ -160,6 +168,7 @@ program
|
|
|
160
168
|
arrowType: options.arrowType,
|
|
161
169
|
via: options.via,
|
|
162
170
|
note: options.note,
|
|
171
|
+
animated: options.animated,
|
|
163
172
|
}, addArrowDeps);
|
|
164
173
|
});
|
|
165
174
|
// ============================================================================
|
|
@@ -175,6 +184,7 @@ program
|
|
|
175
184
|
.option('--stroke-style <style>', 'Stroke style: solid, dashed, or dotted')
|
|
176
185
|
.option('--fill-style <style>', 'Fill style: hachure, cross-hatch, solid, or zigzag')
|
|
177
186
|
.option('-n, --note <text>', 'Note for this element (stored in customData)')
|
|
187
|
+
.option('--animated', 'Zoom to element after adding')
|
|
178
188
|
.action(async (options) => {
|
|
179
189
|
await addPolygon({
|
|
180
190
|
points: options.points,
|
|
@@ -184,6 +194,7 @@ program
|
|
|
184
194
|
strokeStyle: options.strokeStyle,
|
|
185
195
|
fillStyle: options.fillStyle,
|
|
186
196
|
note: options.note,
|
|
197
|
+
animated: options.animated,
|
|
187
198
|
}, addPolygonDeps);
|
|
188
199
|
});
|
|
189
200
|
// ============================================================================
|
package/dist/lib/protocol.d.ts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
export declare const WS_PORT
|
|
1
|
+
export declare const WS_PORT: number;
|
|
2
2
|
export interface CanvasMetadata {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
createdAt: number;
|
|
6
6
|
updatedAt: number;
|
|
7
7
|
}
|
|
8
|
+
export interface CanvasCategory {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
isCollapsed: boolean;
|
|
12
|
+
order: number;
|
|
13
|
+
}
|
|
8
14
|
export interface CanvasListState {
|
|
9
15
|
activeCanvasId: string;
|
|
10
16
|
canvases: CanvasMetadata[];
|
|
17
|
+
categories?: CanvasCategory[];
|
|
18
|
+
canvasCategoryMap?: Record<string, string>;
|
|
11
19
|
}
|
|
12
20
|
export interface ListCanvasesResponse {
|
|
13
21
|
type: 'listCanvasesResult';
|
|
@@ -68,6 +76,7 @@ export interface AddShapeParams {
|
|
|
68
76
|
strokeColor?: string;
|
|
69
77
|
};
|
|
70
78
|
customData?: Record<string, unknown>;
|
|
79
|
+
animated?: boolean;
|
|
71
80
|
}
|
|
72
81
|
export interface AddShapeResponse {
|
|
73
82
|
type: 'addShapeResult';
|
|
@@ -90,6 +99,7 @@ export interface AddTextParams {
|
|
|
90
99
|
anchor?: TextAnchor;
|
|
91
100
|
strokeColor?: string;
|
|
92
101
|
customData?: Record<string, unknown>;
|
|
102
|
+
animated?: boolean;
|
|
93
103
|
}
|
|
94
104
|
export interface AddTextResponse {
|
|
95
105
|
type: 'addTextResult';
|
|
@@ -111,6 +121,7 @@ export interface AddLineParams {
|
|
|
111
121
|
strokeWidth?: number;
|
|
112
122
|
strokeStyle?: 'solid' | 'dashed' | 'dotted';
|
|
113
123
|
customData?: Record<string, unknown>;
|
|
124
|
+
animated?: boolean;
|
|
114
125
|
}
|
|
115
126
|
export interface AddLineResponse {
|
|
116
127
|
type: 'addLineResult';
|
|
@@ -135,6 +146,7 @@ export interface AddArrowParams {
|
|
|
135
146
|
y: number;
|
|
136
147
|
}>;
|
|
137
148
|
customData?: Record<string, unknown>;
|
|
149
|
+
animated?: boolean;
|
|
138
150
|
}
|
|
139
151
|
export interface AddArrowResponse {
|
|
140
152
|
type: 'addArrowResult';
|
|
@@ -154,6 +166,7 @@ export interface AddPolygonParams {
|
|
|
154
166
|
strokeStyle?: 'solid' | 'dashed' | 'dotted';
|
|
155
167
|
fillStyle?: 'hachure' | 'cross-hatch' | 'solid' | 'zigzag';
|
|
156
168
|
customData?: Record<string, unknown>;
|
|
169
|
+
animated?: boolean;
|
|
157
170
|
}
|
|
158
171
|
export interface AddPolygonResponse {
|
|
159
172
|
type: 'addPolygonResult';
|
package/dist/lib/protocol.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const WS_PORT = 7890;
|
|
1
|
+
export const WS_PORT = parseInt(process.env.AGENT_CANVAS_WS_PORT || '7890', 10);
|
package/dist/server/index.d.ts
CHANGED
package/dist/server/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'url';
|
|
|
6
6
|
import { dirname } from 'path';
|
|
7
7
|
import { WS_PORT } from '../lib/protocol.js';
|
|
8
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const HTTP_PORT = 7891;
|
|
9
|
+
const HTTP_PORT = parseInt(process.env.AGENT_CANVAS_HTTP_PORT || '7891', 10);
|
|
10
10
|
const MIME_TYPES = {
|
|
11
11
|
'.html': 'text/html',
|
|
12
12
|
'.js': 'application/javascript',
|
|
@@ -23,6 +23,9 @@ const MIME_TYPES = {
|
|
|
23
23
|
// Track connections
|
|
24
24
|
let browserClient = null;
|
|
25
25
|
const pendingRequests = new Map();
|
|
26
|
+
// Auto-shutdown after idle timeout (default: 2 hours)
|
|
27
|
+
const IDLE_TIMEOUT_MS = parseInt(process.env.AGENT_CANVAS_IDLE_TIMEOUT || String(2 * 60 * 60 * 1000), 10);
|
|
28
|
+
let idleTimer = null;
|
|
26
29
|
function getStaticDir() {
|
|
27
30
|
// Try to find static files
|
|
28
31
|
const possiblePaths = [
|
|
@@ -40,47 +43,70 @@ function getStaticDir() {
|
|
|
40
43
|
}
|
|
41
44
|
throw new Error('Static files not found. Please run "bun run build" first.');
|
|
42
45
|
}
|
|
43
|
-
export function startServer() {
|
|
46
|
+
export function startServer(options) {
|
|
44
47
|
return new Promise((resolve) => {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
filePath =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// For SPA, fallback to index.html for non-asset paths
|
|
66
|
-
const indexPath = join(staticDir, 'index.html');
|
|
67
|
-
if (existsSync(indexPath) && !filePath.includes('.')) {
|
|
68
|
-
const content = readFileSync(indexPath);
|
|
69
|
-
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
48
|
+
const wsOnly = options?.wsOnly ?? false;
|
|
49
|
+
let httpServer = null;
|
|
50
|
+
if (!wsOnly) {
|
|
51
|
+
const staticDir = getStaticDir();
|
|
52
|
+
console.log(`Serving static files from: ${staticDir}`);
|
|
53
|
+
// HTTP Server for static files
|
|
54
|
+
httpServer = createServer((req, res) => {
|
|
55
|
+
let filePath = req.url || '/';
|
|
56
|
+
// Remove query string
|
|
57
|
+
filePath = filePath.split('?')[0];
|
|
58
|
+
// Default to index.html
|
|
59
|
+
if (filePath === '/') {
|
|
60
|
+
filePath = '/index.html';
|
|
61
|
+
}
|
|
62
|
+
const fullPath = join(staticDir, filePath);
|
|
63
|
+
if (existsSync(fullPath)) {
|
|
64
|
+
const ext = extname(fullPath);
|
|
65
|
+
const contentType = MIME_TYPES[ext] || 'application/octet-stream';
|
|
66
|
+
const content = readFileSync(fullPath);
|
|
67
|
+
res.writeHead(200, { 'Content-Type': contentType });
|
|
70
68
|
res.end(content);
|
|
71
69
|
}
|
|
72
70
|
else {
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
// For SPA, fallback to index.html for non-asset paths
|
|
72
|
+
const indexPath = join(staticDir, 'index.html');
|
|
73
|
+
if (existsSync(indexPath) && !filePath.includes('.')) {
|
|
74
|
+
const content = readFileSync(indexPath);
|
|
75
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
76
|
+
res.end(content);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
res.writeHead(404);
|
|
80
|
+
res.end('Not Found');
|
|
81
|
+
}
|
|
75
82
|
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
78
85
|
// WebSocket Server
|
|
79
86
|
const wss = new WebSocketServer({ port: WS_PORT });
|
|
87
|
+
const closeServer = () => {
|
|
88
|
+
wss.close();
|
|
89
|
+
httpServer?.close();
|
|
90
|
+
};
|
|
91
|
+
// Idle auto-shutdown
|
|
92
|
+
function resetIdleTimer() {
|
|
93
|
+
if (idleTimer)
|
|
94
|
+
clearTimeout(idleTimer);
|
|
95
|
+
idleTimer = setTimeout(() => {
|
|
96
|
+
console.log(`\nNo activity for ${IDLE_TIMEOUT_MS / 1000 / 60} minutes. Shutting down...`);
|
|
97
|
+
closeServer();
|
|
98
|
+
process.exit(0);
|
|
99
|
+
}, IDLE_TIMEOUT_MS);
|
|
100
|
+
}
|
|
101
|
+
resetIdleTimer();
|
|
80
102
|
wss.on('connection', (ws) => {
|
|
81
103
|
ws.on('message', async (data) => {
|
|
82
104
|
try {
|
|
83
105
|
const message = JSON.parse(data.toString());
|
|
106
|
+
// Reset idle timer on real activity (skip health checks)
|
|
107
|
+
if (message.type !== 'ping' && message.type !== 'isBrowserConnected') {
|
|
108
|
+
resetIdleTimer();
|
|
109
|
+
}
|
|
84
110
|
// Browser identification
|
|
85
111
|
if (message.type === 'browserConnect') {
|
|
86
112
|
console.log('Browser connected');
|
|
@@ -134,20 +160,27 @@ export function startServer() {
|
|
|
134
160
|
}
|
|
135
161
|
});
|
|
136
162
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
console.log(`Canvas server running:`);
|
|
140
|
-
console.log(` - Web UI: ${httpUrl}`);
|
|
141
|
-
console.log(` - WebSocket: ws://localhost:${WS_PORT}`);
|
|
163
|
+
if (wsOnly) {
|
|
164
|
+
console.log(`WebSocket server running on ws://localhost:${WS_PORT}`);
|
|
142
165
|
resolve({
|
|
143
|
-
httpUrl,
|
|
166
|
+
httpUrl: '',
|
|
144
167
|
wsPort: WS_PORT,
|
|
145
|
-
close:
|
|
146
|
-
wss.close();
|
|
147
|
-
httpServer.close();
|
|
148
|
-
},
|
|
168
|
+
close: closeServer,
|
|
149
169
|
});
|
|
150
|
-
}
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
httpServer.listen(HTTP_PORT, () => {
|
|
173
|
+
const httpUrl = `http://localhost:${HTTP_PORT}`;
|
|
174
|
+
console.log(`Canvas server running:`);
|
|
175
|
+
console.log(` - Web UI: ${httpUrl}`);
|
|
176
|
+
console.log(` - WebSocket: ws://localhost:${WS_PORT}`);
|
|
177
|
+
resolve({
|
|
178
|
+
httpUrl,
|
|
179
|
+
wsPort: WS_PORT,
|
|
180
|
+
close: closeServer,
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
151
184
|
});
|
|
152
185
|
}
|
|
153
186
|
export function isBrowserServerRunning() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-D_54h8Zf.js";var u={paste:"لصق",pasteAsPlaintext:"اللصق كنص عادي",pasteCharts:"لصق الرسوم البيانية",selectAll:"تحديد الكل",multiSelect:"إضافة عنصر للتحديد",moveCanvas:"نقل لوح الرسم",cut:"قص",copy:"نسخ",copyAsPng:"نسخ إلى الحافظة بصيغة PNG",copyAsSvg:"نسخ إلى الحافظة بصيغة SVG",copyText:"نسخ إلى الحافظة كنص",copySource:"",convertToCode:"",bringForward:"جلب للأمام",sendToBack:"أرسل للخلف",bringToFront:"أحضر للأمام",sendBackward:"أرسل للخلف",delete:"حذف",copyStyles:"نسخ الأنماط",pasteStyles:"لصق الأنماط",stroke:"الخط",background:"الخلفية",fill:"التعبئة",strokeWidth:"سُمك الخط",strokeStyle:"نمط الخط",strokeStyle_solid:"متصل",strokeStyle_dashed:"متقطع",strokeStyle_dotted:"منقط",sloppiness:"الإمالة",opacity:"الشفافية",textAlign:"محاذاة النص",edges:"الحواف",sharp:"حادة",round:"دائرية",arrowheads:"رؤوس الأسهم",arrowhead_none:"لا شيء",arrowhead_arrow:"سهم",arrowhead_bar:"شريط",arrowhead_circle:"",arrowhead_circle_outline:"",arrowhead_triangle:"مثلث",arrowhead_triangle_outline:"",arrowhead_diamond:"",arrowhead_diamond_outline:"",fontSize:"حجم الخط",fontFamily:"نوع الخط",addWatermark:'إضافة "مصنوعة بواسطة Excalidraw"',handDrawn:"رسم باليد",normal:"عادي",code:"رمز",small:"صغير",medium:"متوسط",large:"كبير",veryLarge:"كبير جدا",solid:"كامل",hachure:"خطوط",zigzag:"متعرج",crossHatch:"خطوط متقطعة",thin:"نحيف",bold:"داكن",left:"الـيسار",center:"وسط",right:"يمين",extraBold:"عريض",architect:"معماري",artist:"رسام",cartoonist:"كرتوني",fileTitle:"إسم الملف",colorPicker:"منتقي اللون",canvasColors:"تستخدم على القماش",canvasBackground:"خلفية اللوحة",drawingCanvas:"لوحة الرسم",layers:"الطبقات",actions:"الإجراءات",language:"اللغة",liveCollaboration:"التعاون المباشر...",duplicateSelection:"تكرار",untitled:"غير معنون",name:"الاسم",yourName:"اسمك",madeWithExcalidraw:"مصنوعة بواسطة Excalidraw",group:"تحديد مجموعة",ungroup:"إلغاء تحديد مجموعة",collaborators:"المتعاونون",showGrid:"إظهار الشبكة",addToLibrary:"أضف إلى المكتبة",removeFromLibrary:"حذف من المكتبة",libraryLoadingMessage:"جارٍ تحميل المكتبة…",libraries:"تصفح المكتبات",loadingScene:"جاري تحميل المشهد…",align:"محاذاة",alignTop:"محاذاة إلى اﻷعلى",alignBottom:"محاذاة إلى اﻷسفل",alignLeft:"محاذاة إلى اليسار",alignRight:"محاذاة إلى اليمين",centerVertically:"توسيط عمودي",centerHorizontally:"توسيط أفقي",distributeHorizontally:"التوزيع الأفقي",distributeVertically:"التوزيع عمودياً",flipHorizontal:"قلب عامودي",flipVertical:"قلب أفقي",viewMode:"نمط العرض",share:"مشاركة",showStroke:"إظهار منتقي لون الخط",showBackground:"إظهار منتقي لون الخلفية",toggleTheme:"غير النمط",personalLib:"المكتبة الشخصية",excalidrawLib:"مكتبتنا",decreaseFontSize:"تصغير حجم الخط",increaseFontSize:"تكبير حجم الخط",unbindText:"فك ربط النص",bindText:"ربط النص بالحاوية",createContainerFromText:"نص مغلف في حاوية",link:{edit:"تعديل الرابط",editEmbed:"تحرير الرابط وإدراجه",create:"إنشاء رابط",createEmbed:"إنشاء رابط و إدراجه",label:"رابط",labelEmbed:"رابط و إدراج",empty:"لم يتم تعيين رابط"},lineEditor:{edit:"تحرير السطر",exit:"الخروج من المُحرر"},elementLock:{lock:"قفل",unlock:"فتح",lockAll:"قفل الكل",unlockAll:"فتح الكل"},statusPublished:"نُشر",sidebarLock:"إبقاء الشريط الجانبي مفتوح",selectAllElementsInFrame:"تحديد جميع العناصر في الإطار",removeAllElementsFromFrame:"إزالة جميع العناصر من الإطار",eyeDropper:"اختيار اللون من القماش",textToDiagram:"",prompt:""},A={noItems:"لا توجد عناصر أضيفت بعد...",hint_emptyLibrary:"حدد عنصر على القماش لإضافته هنا، أو تثبيت مكتبة من المستودع العام أدناه.",hint_emptyPrivateLibrary:"حدد عنصر على القماش لإضافته هنا."},e={clearReset:"إعادة تعيين اللوحة",exportJSON:"صدر الملف",exportImage:"تصدير الصورة...",export:"حفظ إلى...",copyToClipboard:"نسخ إلى الحافظة",save:"احفظ للملف الحالي",saveAs:"حفظ كـ",load:"فتح",getShareableLink:"احصل على رابط المشاركة",close:"غلق",selectLanguage:"اختر اللغة",scrollBackToContent:"الرجوع إلى المحتوى",zoomIn:"تكبير",zoomOut:"تصغير",resetZoom:"إعادة تعيين الشاشة",menu:"القائمة",done:"تم",edit:"تعديل",undo:"تراجع",redo:"إعادة تنفيذ",resetLibrary:"إعادة ضبط المكتبة",createNewRoom:"إنشاء غرفة جديدة",fullScreen:"شاشة كاملة",darkMode:"الوضع المظلم",lightMode:"الوضع المضيء",zenMode:"وضع التأمل",objectsSnapMode:"التقط إلى العناصر",exitZenMode:"إلغاء الوضع الليلى",cancel:"إلغاء",clear:"مسح",remove:"إزالة",embed:"تبديل الإدراج",publishLibrary:"انشر",submit:"أرسل",confirm:"تأكيد",embeddableInteractionButton:"اضغط للتفاعل"},a={clearReset:"هذا سيُزيل كامل اللوحة. هل أنت متأكد؟",couldNotCreateShareableLink:"تعذر إنشاء رابطة المشاركة.",couldNotCreateShareableLinkTooBig:"تعذر إنشاء رابط قابل للمشاركة: المشهد كبير جدًا",couldNotLoadInvalidFile:"تعذر التحميل، الملف غير صالح",importBackendFailed:"فشل الاستيراد من الخادوم.",cannotExportEmptyCanvas:"لا يمكن تصدير لوحة فارغة.",couldNotCopyToClipboard:"تعذر النسخ إلى الحافظة.",decryptFailed:"تعذر فك تشفير البيانات.",uploadedSecurly:"تم تأمين التحميل بتشفير النهاية إلى النهاية، مما يعني أن خادوم Excalidraw والأطراف الثالثة لا يمكنها قراءة المحتوى.",loadSceneOverridePrompt:"تحميل الرسم الخارجي سيحل محل المحتوى الموجود لديك. هل ترغب في المتابعة؟",collabStopOverridePrompt:`إيقاف الجلسة سيؤدي إلى الكتابة فوق رسومك السابقة المخزنة داخليا. هل أنت متأكد؟
|
|
2
2
|
|
|
3
3
|
(إذا كنت ترغب في الاحتفاظ برسمك المخزن داخليا، ببساطة أغلق علامة تبويب المتصفح بدلاً من ذلك.)`,errorAddingToLibrary:"تعذر إضافة العنصر للمكتبة",errorRemovingFromLibrary:"تعذر إزالة العنصر من المكتبة",confirmAddLibrary:"هذا سيضيف {{numShapes}} شكل إلى مكتبتك. هل أنت متأكد؟",imageDoesNotContainScene:"يبدو أن هذه الصورة لا تحتوي على أي بيانات مشهد. هل قمت بتمكين تضمين المشهد أثناء التصدير؟",cannotRestoreFromImage:"تعذر استعادة المشهد من ملف الصورة",invalidSceneUrl:"تعذر استيراد المشهد من عنوان URL المتوفر. إما أنها مشوهة، أو لا تحتوي على بيانات Excalidraw JSON صالحة.",resetLibrary:"هذا سوف يمسح مكتبتك. هل أنت متأكد؟",removeItemsFromsLibrary:"حذف {{count}} عنصر (عناصر) من المكتبة؟",invalidEncryptionKey:"مفتاح التشفير يجب أن يكون من 22 حرفاً. التعاون المباشر معطل.",collabOfflineWarning:`لا يوجد اتصال بالانترنت.
|
|
4
4
|
لن يتم حفظ التغييرات التي قمت بها!`},r={unsupportedFileType:"نوع الملف غير مدعوم.",imageInsertError:"تعذر إدراج الصورة. حاول مرة أخرى لاحقاً...",fileTooBig:"الملف كبير جداً. الحد الأقصى المسموح به للحجم هو {{maxSize}}.",svgImageInsertError:"تعذر إدراج صورة SVG. يبدو أن ترميز SVG غير صحيح.",failedToFetchImage:"",invalidSVGString:"SVG غير صالح.",cannotResolveCollabServer:"تعذر الاتصال بخادم التعاون. الرجاء إعادة تحميل الصفحة والمحاولة مرة أخرى.",importLibraryError:"تعذر تحميل المكتبة",collabSaveFailed:"تعذر الحفظ في قاعدة البيانات. إذا استمرت المشاكل، يفضل أن تحفظ ملفك محليا كي لا تفقد عملك.",collabSaveFailed_sizeExceeded:"تعذر الحفظ في قاعدة البيانات، يبدو أن القماش كبير للغاية، يفضّل حفظ الملف محليا كي لا تفقد عملك.",imageToolNotSupported:"",brave_measure_text_error:{line1:"يبدو أنك تستخدم متصفح Brave مع إعداد <bold>حظر صارم لتتبع البصمة</bold>.",line2:"قد يؤدي هذا إلى كسر <bold>عناصر النص</bold> في الرسومات الخاصة بك.",line3:"من المستحسن إلغاء تفعيل هذا الإعداد. يمكنك اتباع <link>هذه الخطوات</link> لفعل ذلك.",line4:"إذا لم يصلح تعطيل هذا الإعداد طريقة عرض النصوص، الرجاء كتابة <issueLink>بلاغ</issueLink> على حسابنا في GitHub، أو راسلنا على <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"لا يمكن إضافة العناصر القابلة للتضمين في المكتبة.",iframe:"",image:"سوف يتم دعم إضافة صور إلى المكتبة قريباً!"},asyncPasteFailedOnRead:"",asyncPasteFailedOnParse:"",copyToSystemClipboardFailed:""},o={selection:"تحديد",image:"إدراج صورة",rectangle:"مستطيل",diamond:"مضلع",ellipse:"دائرة",arrow:"سهم",line:"خط",freedraw:"رسم",text:"نص",library:"مكتبة",lock:"الحفاظ على أداة التحديد نشطة بعد الرسم",penMode:"وضع القلم - امنع اللمس",link:"إضافة/تحديث الرابط للشكل المحدد",eraser:"ممحاة",frame:"أداة الإطار",magicframe:"",embeddable:"تضمين ويب",laser:"مؤشر ليزر",hand:"يد (أداة الإزاحة)",extraTools:"المزيد من أﻷدوات",mermaidToExcalidraw:"",magicSettings:""},t={canvasActions:"إجراءات اللوحة",selectedShapeActions:"إجراءات الشكل المحدد",shapes:"الأشكال"},i={canvasPanning:"لتحريك القماش، اضغط على عجلة الفأرة أو مفتاح المسافة أثناء السحب، أو استخدم أداة اليد",linearElement:"انقر لبدء نقاط متعددة، اسحب لخط واحد",freeDraw:"انقر واسحب، افرج عند الانتهاء",text:"نصيحة: يمكنك أيضًا إضافة نص بالنقر المزدوج في أي مكان بأداة الاختيار",embeddable:"اضغط مع السحب لإنشاء موقع ويب مضمّن",text_selected:"انقر نقراً مزدوجاً أو اضغط ادخال لتعديل النص",text_editing:"اضغط على Esc أو (Ctrl أو Cmd) + Enter لإنهاء التعديل",linearElementMulti:"انقر فوق النقطة الأخيرة أو اضغط على Esc أو Enter للإنهاء",lockAngle:"يمكنك تقييد الزاوية بالضغط على SHIFT",resize:`يمكنك تقييد النسب بالضغط على SHIFT أثناء تغيير الحجم،
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as ln,c as H}from"./path-CbwjOpE9.js";import{B as rn,D as M,E as D,F as an,G as y,H as on,I as j,J as _,K as un,L as t,M as sn,N as tn,O as fn}from"./index-
|
|
1
|
+
import{w as ln,c as H}from"./path-CbwjOpE9.js";import{B as rn,D as M,E as D,F as an,G as y,H as on,I as j,J as _,K as un,L as t,M as sn,N as tn,O as fn}from"./index-D8VjnP-8.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function dn(l,h,O,E,v,A,J,r){var q=O-l,i=E-h,n=J-v,m=r-A,a=m*q-n*i;if(!(a*a<y))return a=(n*(h-A)-m*(l-v))/a,[l+a*q,h+a*i]}function W(l,h,O,E,v,A,J){var r=l-O,q=h-E,i=(J?A:-A)/j(r*r+q*q),n=i*q,m=-i*r,a=l+n,s=h+m,f=O+n,c=E+m,K=(a+f)/2,o=(s+c)/2,p=f-a,g=c-s,R=p*p+g*g,T=v-A,P=a*c-f*s,B=(g<0?-1:1)*j(tn(0,T*T*R-P*P)),F=(P*g-p*B)/R,G=(-P*p-g*B)/R,w=(P*g+p*B)/R,d=(-P*p+g*B)/R,x=F-K,e=G-o,u=w-K,L=d-o;return x*x+e*e>u*u+L*L&&(F=w,G=d),{cx:F,cy:G,x01:-n,y01:-m,x11:F*(v/T-1),y11:G*(v/T-1)}}function vn(){var l=cn,h=yn,O=H(0),E=null,v=gn,A=mn,J=pn,r=null,q=ln(i);function i(){var n,m,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,K=un(c-f),o=c>f;if(r||(r=n=q()),s<a&&(m=s,s=a,a=m),!(s>y))r.moveTo(0,0);else if(K>on-y)r.moveTo(s*M(f),s*D(f)),r.arc(0,0,s,f,c,!o),a>y&&(r.moveTo(a*M(c),a*D(c)),r.arc(0,0,a,c,f,o));else{var p=f,g=c,R=f,T=c,P=K,B=K,F=J.apply(this,arguments)/2,G=F>y&&(E?+E.apply(this,arguments):j(a*a+s*s)),w=_(un(s-a)/2,+O.apply(this,arguments)),d=w,x=w,e,u;if(G>y){var L=sn(G/a*D(F)),z=sn(G/s*D(F));(P-=L*2)>y?(L*=o?1:-1,R+=L,T-=L):(P=0,R=T=(f+c)/2),(B-=z*2)>y?(z*=o?1:-1,p+=z,g-=z):(B=0,p=g=(f+c)/2)}var N=s*M(p),S=s*D(p),C=a*M(T),Q=a*D(T);if(w>y){var U=s*M(g),V=s*D(g),X=a*M(R),Y=a*D(R),I;if(K<rn)if(I=dn(N,S,X,Y,U,V,C,Q)){var Z=N-I[0],$=S-I[1],k=U-I[0],b=V-I[1],nn=1/D(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(I[0]*I[0]+I[1]*I[1]);d=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else d=x=0}B>y?x>y?(e=W(X,Y,N,S,s,x,o),u=W(U,V,C,Q,s,x,o),r.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?r.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(r.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),r.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),r.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(r.moveTo(N,S),r.arc(0,0,s,p,g,!o)):r.moveTo(N,S),!(a>y)||!(P>y)?r.lineTo(C,Q):d>y?(e=W(C,Q,U,V,a,-d,o),u=W(N,S,X,Y,a,-d,o),r.lineTo(e.cx+e.x01,e.cy+e.y01),d<w?r.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(r.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),r.arc(0,0,a,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),r.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):r.arc(0,0,a,T,R,o)}if(r.closePath(),n)return r=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[M(m)*n,D(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:H(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:H(+n),i):h},i.cornerRadius=function(n){return arguments.length?(O=typeof n=="function"?n:H(+n),i):O},i.padRadius=function(n){return arguments.length?(E=n==null?null:typeof n=="function"?n:H(+n),i):E},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:H(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:H(+n),i):A},i.padAngle=function(n){return arguments.length?(J=typeof n=="function"?n:H(+n),i):J},i.context=function(n){return arguments.length?(r=n??null,i):r},i}export{vn as a};
|