@epam/ai-dial-skill-editor 1.1.0-dev.249 → 1.1.0-dev.250
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/components/SkillEditor/SkillEditor.d.ts.map +1 -1
- package/index.js +45 -43
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillEditor.d.ts","sourceRoot":"","sources":["../../../src/components/SkillEditor/SkillEditor.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,EAAE,EASH,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,iCAAiC,CAAC;AAqBzC,qFAAqF;AACrF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"SkillEditor.d.ts","sourceRoot":"","sources":["../../../src/components/SkillEditor/SkillEditor.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,EAAE,EASH,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,iCAAiC,CAAC;AAqBzC,qFAAqF;AACrF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAwc5C,CAAC"}
|
package/index.js
CHANGED
|
@@ -278,70 +278,72 @@ var A = (e) => !!e.dataTransfer?.types.includes("Files"), ae = (e) => {
|
|
|
278
278
|
name: t?.name ?? "",
|
|
279
279
|
description: t?.description ?? "",
|
|
280
280
|
instructions: t?.instructions ?? ""
|
|
281
|
-
}), ge = T(r);
|
|
281
|
+
}), ge = T(t), _e = ge.current !== t, ve = T(r);
|
|
282
282
|
S(() => {
|
|
283
|
-
W({
|
|
283
|
+
ge.current = t, W({
|
|
284
284
|
name: t?.name ?? "",
|
|
285
285
|
description: t?.description ?? "",
|
|
286
286
|
instructions: t?.instructions ?? ""
|
|
287
|
-
}),
|
|
287
|
+
}), ve.current = r;
|
|
288
288
|
}, [t]);
|
|
289
|
-
let
|
|
289
|
+
let ye = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), be = T(!1);
|
|
290
290
|
S(() => {
|
|
291
|
+
if (_e) return;
|
|
291
292
|
let e = {
|
|
292
293
|
name: t?.name ?? "",
|
|
293
294
|
description: t?.description ?? "",
|
|
294
295
|
instructions: t?.instructions ?? ""
|
|
295
|
-
}, n = JSON.stringify(U) !== JSON.stringify(e) ||
|
|
296
|
-
n !==
|
|
296
|
+
}, n = JSON.stringify(U) !== JSON.stringify(e) || ye(r) !== ye(ve.current);
|
|
297
|
+
n !== be.current && (be.current = n, L?.(n));
|
|
297
298
|
}, [
|
|
298
299
|
U,
|
|
299
300
|
r,
|
|
300
301
|
t,
|
|
302
|
+
_e,
|
|
301
303
|
L
|
|
302
304
|
]);
|
|
303
|
-
let [
|
|
304
|
-
|
|
305
|
-
}, [d]), [
|
|
305
|
+
let [xe, Se] = E(j), G = te ?? xe, K = x((e) => {
|
|
306
|
+
Se(e), d?.(e);
|
|
307
|
+
}, [d]), [Ce, we] = E([]), Te = ne ?? Ce, Ee = w(() => new Set(Te), [Te]), De = x((e) => {
|
|
306
308
|
let t = [...e];
|
|
307
|
-
|
|
308
|
-
}, [p]), [q, J] = E(!1), [
|
|
309
|
+
we(t), p?.(t);
|
|
310
|
+
}, [p]), [q, J] = E(!1), [Oe, Y] = E(), [ke, Ae] = E(!0), { isDragActive: je, dropZoneHandlers: Me } = ae(x((e) => {
|
|
309
311
|
q || (Y(e), J(!0));
|
|
310
|
-
}, [q])), X = H ?? {}, Z = pe?.colors, Q = pe?.typography ?? {},
|
|
312
|
+
}, [q])), X = H ?? {}, Z = pe?.colors, Q = pe?.typography ?? {}, Ne = Q.titleClassName ?? "dial-body-semi-text", Pe = Q.helperTextClassName ?? "dial-tiny-semi-text", Fe = Q.removeIconClassName ?? "text-secondary", Ie = e({
|
|
311
313
|
"--se-title-color": Z?.title,
|
|
312
314
|
"--se-helper-text-color": Z?.helperText,
|
|
313
315
|
"--se-border-color": Z?.border
|
|
314
|
-
}),
|
|
316
|
+
}), Le = w(() => oe([{
|
|
315
317
|
path: j,
|
|
316
318
|
name: j,
|
|
317
319
|
kind: M.File
|
|
318
|
-
}, ...r]), [r]), $ = w(() => r.find((e) => e.path === G), [r, G]),
|
|
320
|
+
}, ...r]), [r]), $ = w(() => r.find((e) => e.path === G), [r, G]), Re = x((e) => {
|
|
319
321
|
K(e.path);
|
|
320
|
-
}, [K]),
|
|
322
|
+
}, [K]), ze = x((e) => {
|
|
321
323
|
R.onRemoveNode(e), G === e && K(j);
|
|
322
324
|
}, [
|
|
323
325
|
R,
|
|
324
326
|
G,
|
|
325
327
|
K
|
|
326
|
-
]),
|
|
328
|
+
]), Be = x((e) => e.path === "SKILL.md" ? [] : [{
|
|
327
329
|
key: "remove",
|
|
328
330
|
label: X.removeLabel ?? "Remove",
|
|
329
331
|
icon: /* @__PURE__ */ O(ie, {
|
|
330
332
|
size: o.SM,
|
|
331
|
-
className:
|
|
333
|
+
className: Fe,
|
|
332
334
|
"aria-hidden": !0
|
|
333
335
|
}),
|
|
334
|
-
onClick: () =>
|
|
336
|
+
onClick: () => ze(e.path)
|
|
335
337
|
}], [
|
|
336
338
|
X.removeLabel,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
]),
|
|
339
|
+
Fe,
|
|
340
|
+
ze
|
|
341
|
+
]), Ve = C(), He = C(), Ue = /* @__PURE__ */ k("div", {
|
|
340
342
|
className: "flex flex-col gap-2 desktop:gap-5",
|
|
341
343
|
children: [/* @__PURE__ */ k("div", {
|
|
342
344
|
className: "flex items-center justify-between",
|
|
343
345
|
children: [/* @__PURE__ */ O("span", {
|
|
344
|
-
className: n(B.title,
|
|
346
|
+
className: n(B.title, Ne),
|
|
345
347
|
children: X.filesHeading ?? "Files"
|
|
346
348
|
}), /* @__PURE__ */ O(f, {
|
|
347
349
|
label: X.addUploadLabel ?? "Upload from device",
|
|
@@ -354,21 +356,21 @@ var A = (e) => !!e.dataTransfer?.types.includes("Files"), ae = (e) => {
|
|
|
354
356
|
}
|
|
355
357
|
})]
|
|
356
358
|
}), /* @__PURE__ */ O("div", {
|
|
357
|
-
id:
|
|
359
|
+
id: Ve,
|
|
358
360
|
role: "tree",
|
|
359
361
|
"aria-label": X.filesTreeAriaLabel ?? "Skill files",
|
|
360
362
|
children: /* @__PURE__ */ O(i, {
|
|
361
|
-
items:
|
|
363
|
+
items: Le,
|
|
362
364
|
showFiles: !0,
|
|
363
365
|
selectedPath: G,
|
|
364
|
-
expandedPaths:
|
|
365
|
-
onExpandedPathsChange:
|
|
366
|
-
onItemClick:
|
|
367
|
-
getContextMenuItems:
|
|
366
|
+
expandedPaths: Ee,
|
|
367
|
+
onExpandedPathsChange: De,
|
|
368
|
+
onItemClick: Re,
|
|
369
|
+
getContextMenuItems: Be,
|
|
368
370
|
rootItemPath: ""
|
|
369
371
|
})
|
|
370
372
|
})]
|
|
371
|
-
}),
|
|
373
|
+
}), We = b ? X.savingStatusLabel ?? "Saving" : "", Ge = /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(l, {
|
|
372
374
|
label: X.cancelLabel ?? "Cancel",
|
|
373
375
|
onClick: de,
|
|
374
376
|
disabled: b
|
|
@@ -394,19 +396,19 @@ var A = (e) => !!e.dataTransfer?.types.includes("Files"), ae = (e) => {
|
|
|
394
396
|
}) : /* @__PURE__ */ k("div", {
|
|
395
397
|
dir: me,
|
|
396
398
|
className: "relative flex h-full flex-col",
|
|
397
|
-
style:
|
|
398
|
-
...
|
|
399
|
+
style: Ie,
|
|
400
|
+
...Me,
|
|
399
401
|
children: [
|
|
400
402
|
/* @__PURE__ */ O(se, {
|
|
401
|
-
isVisible:
|
|
403
|
+
isVisible: je && !q,
|
|
402
404
|
labels: H
|
|
403
405
|
}),
|
|
404
406
|
/* @__PURE__ */ O("span", {
|
|
405
407
|
role: "status",
|
|
406
408
|
"aria-live": "polite",
|
|
407
409
|
className: "sr-only",
|
|
408
|
-
id:
|
|
409
|
-
children:
|
|
410
|
+
id: He,
|
|
411
|
+
children: We
|
|
410
412
|
}),
|
|
411
413
|
N && /* @__PURE__ */ O("div", {
|
|
412
414
|
role: "alert",
|
|
@@ -428,7 +430,7 @@ var A = (e) => !!e.dataTransfer?.types.includes("Files"), ae = (e) => {
|
|
|
428
430
|
children: z
|
|
429
431
|
}), /* @__PURE__ */ O("div", {
|
|
430
432
|
className: "flex shrink-0 items-center gap-2",
|
|
431
|
-
children:
|
|
433
|
+
children: Ge
|
|
432
434
|
})]
|
|
433
435
|
}),
|
|
434
436
|
/* @__PURE__ */ k("div", {
|
|
@@ -439,20 +441,20 @@ var A = (e) => !!e.dataTransfer?.types.includes("Files"), ae = (e) => {
|
|
|
439
441
|
children: /* @__PURE__ */ O(a, {
|
|
440
442
|
title: X.editingFileLabel ?? "Editing file",
|
|
441
443
|
description: $?.name ?? "SKILL.md",
|
|
442
|
-
expanded:
|
|
443
|
-
onToggle:
|
|
444
|
+
expanded: ke,
|
|
445
|
+
onToggle: Ae,
|
|
444
446
|
ariaLabel: X.editingFileLabel ?? "Editing file",
|
|
445
|
-
children:
|
|
447
|
+
children: Ue
|
|
446
448
|
})
|
|
447
449
|
}),
|
|
448
450
|
/* @__PURE__ */ O("div", {
|
|
449
451
|
className: n("hidden border-e desktop:block desktop:w-[360px] desktop:shrink-0 desktop:px-8 desktop:py-6", B.sidebarBorder),
|
|
450
|
-
children:
|
|
452
|
+
children: Ue
|
|
451
453
|
}),
|
|
452
454
|
/* @__PURE__ */ k("div", {
|
|
453
455
|
className: "flex min-w-0 flex-1 flex-col gap-4 desktop:gap-5 desktop:px-8 desktop:py-6",
|
|
454
456
|
children: [/* @__PURE__ */ O("h2", {
|
|
455
|
-
className: n(B.title,
|
|
457
|
+
className: n(B.title, Ne),
|
|
456
458
|
children: G === "SKILL.md" ? j : X.selectedFileHeading?.($?.name ?? G) ?? $?.name ?? G
|
|
457
459
|
}), G === "SKILL.md" ? /* @__PURE__ */ k(D, { children: [
|
|
458
460
|
/* @__PURE__ */ O(u, {
|
|
@@ -491,7 +493,7 @@ var A = (e) => !!e.dataTransfer?.types.includes("Files"), ae = (e) => {
|
|
|
491
493
|
/* @__PURE__ */ k("span", {
|
|
492
494
|
className: "flex items-center gap-0.5",
|
|
493
495
|
children: [/* @__PURE__ */ O("span", {
|
|
494
|
-
className: n(B.helperText,
|
|
496
|
+
className: n(B.helperText, Pe),
|
|
495
497
|
children: X.instructionsLabel ?? "Instructions"
|
|
496
498
|
}), /* @__PURE__ */ O("span", {
|
|
497
499
|
className: "dial-tiny-text text-error",
|
|
@@ -519,7 +521,7 @@ var A = (e) => !!e.dataTransfer?.types.includes("Files"), ae = (e) => {
|
|
|
519
521
|
}),
|
|
520
522
|
/* @__PURE__ */ O("div", {
|
|
521
523
|
className: n("fixed inset-x-0 bottom-0 flex items-center gap-2 border-t p-3 desktop:hidden", B.actionBarBorder),
|
|
522
|
-
children:
|
|
524
|
+
children: Ge
|
|
523
525
|
}),
|
|
524
526
|
/* @__PURE__ */ O(ce, {
|
|
525
527
|
isOpen: q,
|
|
@@ -527,7 +529,7 @@ var A = (e) => !!e.dataTransfer?.types.includes("Files"), ae = (e) => {
|
|
|
527
529
|
J(!1), Y(void 0);
|
|
528
530
|
},
|
|
529
531
|
fileActions: R,
|
|
530
|
-
initialFiles:
|
|
532
|
+
initialFiles: Oe,
|
|
531
533
|
labels: H
|
|
532
534
|
})
|
|
533
535
|
]
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-skill-editor",
|
|
3
3
|
"description": "Host-agnostic form for authoring a DIAL Skill, with an inline supporting-file tree",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.250",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
19
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.250",
|
|
20
20
|
"@epam/ai-dial-ui-kit": "*",
|
|
21
21
|
"@epam/ai-dial-react-file-manager": "^0.1.0-dev.22",
|
|
22
22
|
"@tabler/icons-react": "^3.0.0",
|