@uipath/apollo-wind 2.67.1 → 2.69.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/components/forms/metadata-form.cjs +40 -44
- package/dist/components/forms/metadata-form.js +40 -44
- package/dist/components/ui/code-block.cjs +375 -0
- package/dist/components/ui/code-block.d.ts +38 -0
- package/dist/components/ui/code-block.js +307 -0
- package/dist/components/ui/index.cjs +268 -191
- package/dist/components/ui/index.d.ts +7 -0
- package/dist/components/ui/index.js +7 -0
- package/dist/components/ui/json-tree-view/JsonTree.cjs +2 -2
- package/dist/components/ui/json-tree-view/JsonTree.js +1 -1
- package/dist/components/ui/json-tree-view/JsonTree.types.d.ts +26 -0
- package/dist/components/ui/json-tree-view/JsonTreeRow.cjs +13 -10
- package/dist/components/ui/json-tree-view/JsonTreeRow.js +14 -11
- package/dist/components/ui/json-tree-view/JsonTreeToolbar.cjs +22 -11
- package/dist/components/ui/json-tree-view/JsonTreeToolbar.d.ts +6 -1
- package/dist/components/ui/json-tree-view/JsonTreeToolbar.js +22 -11
- package/dist/components/ui/json-tree-view/NodeKey.cjs +4 -0
- package/dist/components/ui/json-tree-view/NodeKey.js +4 -0
- package/dist/components/ui/json-tree-view/RowActions.cjs +23 -17
- package/dist/components/ui/json-tree-view/RowActions.d.ts +4 -1
- package/dist/components/ui/json-tree-view/RowActions.js +23 -17
- package/dist/components/ui/json-tree-view/buildJsonTree.cjs +99 -44
- package/dist/components/ui/json-tree-view/buildJsonTree.d.ts +15 -2
- package/dist/components/ui/json-tree-view/buildJsonTree.js +97 -45
- package/dist/components/ui/json-tree-view/index.cjs +26 -23
- package/dist/components/ui/json-tree-view/index.d.ts +2 -2
- package/dist/components/ui/json-tree-view/index.js +2 -2
- package/dist/components/ui/live-region.cjs +106 -0
- package/dist/components/ui/live-region.d.ts +31 -0
- package/dist/components/ui/live-region.js +72 -0
- package/dist/components/ui/loading-dots.cjs +95 -0
- package/dist/components/ui/loading-dots.d.ts +21 -0
- package/dist/components/ui/loading-dots.js +55 -0
- package/dist/components/ui/markdown.cjs +428 -0
- package/dist/components/ui/markdown.d.ts +55 -0
- package/dist/components/ui/markdown.js +378 -0
- package/dist/components/ui/panel-tabs.cjs +99 -0
- package/dist/components/ui/panel-tabs.d.ts +34 -0
- package/dist/components/ui/panel-tabs.js +53 -0
- package/dist/components/ui/thinking-indicator.cjs +146 -0
- package/dist/components/ui/thinking-indicator.d.ts +38 -0
- package/dist/components/ui/thinking-indicator.js +106 -0
- package/dist/components/ui/tool-call.cjs +359 -0
- package/dist/components/ui/tool-call.d.ts +75 -0
- package/dist/components/ui/tool-call.js +301 -0
- package/dist/index.cjs +334 -246
- package/dist/index.d.ts +15 -1
- package/dist/index.js +9 -2
- package/dist/styles.css +239 -0
- package/dist/tailwind.utilities.css +21 -0
- package/package.json +7 -1
- /package/dist/{components/ui/json-tree-view → lib}/clipboard.cjs +0 -0
- /package/dist/{components/ui/json-tree-view → lib}/clipboard.d.ts +0 -0
- /package/dist/{components/ui/json-tree-view → lib}/clipboard.js +0 -0
|
@@ -44,7 +44,7 @@ const external_react_hook_form_namespaceObject = require("react-hook-form");
|
|
|
44
44
|
const v4_namespaceObject = require("zod/v4");
|
|
45
45
|
const accordion_cjs_namespaceObject = require("../ui/accordion.cjs");
|
|
46
46
|
const button_cjs_namespaceObject = require("../ui/button.cjs");
|
|
47
|
-
const
|
|
47
|
+
const panel_tabs_cjs_namespaceObject = require("../ui/panel-tabs.cjs");
|
|
48
48
|
const tooltip_cjs_namespaceObject = require("../ui/tooltip.cjs");
|
|
49
49
|
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
50
50
|
const external_data_fetcher_cjs_namespaceObject = require("./data-fetcher.cjs");
|
|
@@ -470,53 +470,48 @@ function TabbedStepForm({ schema, context, customComponents, disabled, sectionVa
|
|
|
470
470
|
if (0 === visibleSteps.length) return null;
|
|
471
471
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
472
472
|
children: [
|
|
473
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
473
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(panel_tabs_cjs_namespaceObject.PanelTabs, {
|
|
474
474
|
value: currentTab,
|
|
475
475
|
onValueChange: selectTab,
|
|
476
|
-
className: "flex min-h-0 flex-1 flex-col gap-1",
|
|
477
476
|
children: [
|
|
478
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
errorCount
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
className: "grid h-4 min-w-4 place-items-center rounded-full bg-error px-1 text-[10px] font-semibold leading-none text-error-background",
|
|
495
|
-
children: errorCount
|
|
496
|
-
})
|
|
497
|
-
]
|
|
498
|
-
}, step.id);
|
|
499
|
-
})
|
|
477
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(panel_tabs_cjs_namespaceObject.PanelTabsList, {
|
|
478
|
+
children: visibleSteps.map((step)=>{
|
|
479
|
+
const errorCount = errorCountByStepId[step.id] ?? 0;
|
|
480
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(panel_tabs_cjs_namespaceObject.PanelTabsTrigger, {
|
|
481
|
+
value: step.id,
|
|
482
|
+
children: [
|
|
483
|
+
step.title,
|
|
484
|
+
errorCount > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
485
|
+
role: "img",
|
|
486
|
+
"aria-label": `${errorCount} ${1 === errorCount ? 'issue' : 'issues'}`,
|
|
487
|
+
title: `${errorCount} ${1 === errorCount ? 'issue' : 'issues'}`,
|
|
488
|
+
className: "grid h-4 min-w-4 place-items-center rounded-full bg-error px-1 text-[10px] font-semibold leading-none text-error-background",
|
|
489
|
+
children: errorCount
|
|
490
|
+
})
|
|
491
|
+
]
|
|
492
|
+
}, step.id);
|
|
500
493
|
})
|
|
501
494
|
}),
|
|
502
495
|
visibleSteps.map((step)=>{
|
|
503
496
|
const stepSections = step.sections.filter((section)=>!section.conditions || context.evaluateConditions(section.conditions));
|
|
504
|
-
|
|
497
|
+
const showEmptyState = 0 === stepSections.length && void 0 !== step.emptyState;
|
|
498
|
+
const selfPadded = !showEmptyState && 'plain' === sectionVariant;
|
|
499
|
+
const sections = stepSections.map((section, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(metadata_form_FormSection, {
|
|
500
|
+
section: section,
|
|
501
|
+
context: context,
|
|
502
|
+
customComponents: customComponents,
|
|
503
|
+
disabled: disabled,
|
|
504
|
+
sectionVariant: sectionVariant,
|
|
505
|
+
afterTabs: 0 === index
|
|
506
|
+
}, section.id));
|
|
507
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(panel_tabs_cjs_namespaceObject.PanelTabsContent, {
|
|
505
508
|
value: step.id,
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
children: stepSections.map((section)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(metadata_form_FormSection, {
|
|
513
|
-
section: section,
|
|
514
|
-
context: context,
|
|
515
|
-
customComponents: customComponents,
|
|
516
|
-
disabled: disabled,
|
|
517
|
-
sectionVariant: sectionVariant
|
|
518
|
-
}, section.id))
|
|
519
|
-
})
|
|
509
|
+
padded: !selfPadded,
|
|
510
|
+
innerClassName: showEmptyState ? 'text-sm text-muted-foreground' : 'space-y-2',
|
|
511
|
+
children: showEmptyState ? step.emptyState : selfPadded ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
512
|
+
className: "pb-6 [padding-inline:var(--mf-content-inset,0px)]",
|
|
513
|
+
children: sections
|
|
514
|
+
}) : sections
|
|
520
515
|
}, step.id);
|
|
521
516
|
})
|
|
522
517
|
]
|
|
@@ -530,13 +525,14 @@ function TabbedStepForm({ schema, context, customComponents, disabled, sectionVa
|
|
|
530
525
|
]
|
|
531
526
|
});
|
|
532
527
|
}
|
|
533
|
-
const metadata_form_FormSection = /*#__PURE__*/ external_react_default().memo(function({ section, context, customComponents, disabled, sectionVariant = 'card' }) {
|
|
528
|
+
const metadata_form_FormSection = /*#__PURE__*/ external_react_default().memo(function({ section, context, customComponents, disabled, sectionVariant = 'card', afterTabs = false }) {
|
|
534
529
|
const gridColumns = context.schema.layout?.columns || 1;
|
|
535
530
|
const gap = context.schema.layout?.gap || 4;
|
|
536
531
|
const isPlain = 'plain' === sectionVariant;
|
|
537
532
|
const dividerClassName = 'border-t first:border-t-0';
|
|
538
533
|
const wrapperClassName = isPlain ? 'border-b-0' : 'border rounded-lg px-3';
|
|
539
|
-
const
|
|
534
|
+
const plainTopClassName = afterTabs ? 'pt-1.5' : 'pt-4';
|
|
535
|
+
const triggerClassName = isPlain ? `${plainTopClassName} pb-4 text-sm font-semibold hover:no-underline` : 'text-sm font-medium';
|
|
540
536
|
const fieldsGrid = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
541
537
|
className: "grid",
|
|
542
538
|
style: {
|
|
@@ -551,7 +547,7 @@ const metadata_form_FormSection = /*#__PURE__*/ external_react_default().memo(fu
|
|
|
551
547
|
}, field.name))
|
|
552
548
|
});
|
|
553
549
|
if (!section.title) return isPlain ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
554
|
-
className: `${dividerClassName} pb-4
|
|
550
|
+
className: `${dividerClassName} pb-4 ${plainTopClassName}`,
|
|
555
551
|
children: fieldsGrid
|
|
556
552
|
}) : fieldsGrid;
|
|
557
553
|
const innerContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
@@ -593,7 +589,7 @@ const metadata_form_FormSection = /*#__PURE__*/ external_react_default().memo(fu
|
|
|
593
589
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
594
590
|
className: "flex",
|
|
595
591
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
596
|
-
className: isPlain ?
|
|
592
|
+
className: isPlain ? `flex flex-1 items-center justify-start gap-2 pb-4 text-sm font-semibold ${plainTopClassName}` : 'flex flex-1 items-center justify-between py-4 text-sm font-medium',
|
|
597
593
|
children: section.title
|
|
598
594
|
})
|
|
599
595
|
}),
|
|
@@ -5,7 +5,7 @@ import { FormProvider, useForm, useFormState, useWatch } from "react-hook-form";
|
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../ui/accordion.js";
|
|
7
7
|
import { Button } from "../ui/button.js";
|
|
8
|
-
import {
|
|
8
|
+
import { PanelTabs, PanelTabsContent, PanelTabsList, PanelTabsTrigger } from "../ui/panel-tabs.js";
|
|
9
9
|
import { TooltipProvider } from "../ui/tooltip.js";
|
|
10
10
|
import { deepEqual, get } from "../../lib/index.js";
|
|
11
11
|
import { DataFetcher } from "./data-fetcher.js";
|
|
@@ -431,53 +431,48 @@ function TabbedStepForm({ schema, context, customComponents, disabled, sectionVa
|
|
|
431
431
|
if (0 === visibleSteps.length) return null;
|
|
432
432
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
433
433
|
children: [
|
|
434
|
-
/*#__PURE__*/ jsxs(
|
|
434
|
+
/*#__PURE__*/ jsxs(PanelTabs, {
|
|
435
435
|
value: currentTab,
|
|
436
436
|
onValueChange: selectTab,
|
|
437
|
-
className: "flex min-h-0 flex-1 flex-col gap-1",
|
|
438
437
|
children: [
|
|
439
|
-
/*#__PURE__*/ jsx(
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
errorCount
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
className: "grid h-4 min-w-4 place-items-center rounded-full bg-error px-1 text-[10px] font-semibold leading-none text-error-background",
|
|
456
|
-
children: errorCount
|
|
457
|
-
})
|
|
458
|
-
]
|
|
459
|
-
}, step.id);
|
|
460
|
-
})
|
|
438
|
+
/*#__PURE__*/ jsx(PanelTabsList, {
|
|
439
|
+
children: visibleSteps.map((step)=>{
|
|
440
|
+
const errorCount = errorCountByStepId[step.id] ?? 0;
|
|
441
|
+
return /*#__PURE__*/ jsxs(PanelTabsTrigger, {
|
|
442
|
+
value: step.id,
|
|
443
|
+
children: [
|
|
444
|
+
step.title,
|
|
445
|
+
errorCount > 0 && /*#__PURE__*/ jsx("span", {
|
|
446
|
+
role: "img",
|
|
447
|
+
"aria-label": `${errorCount} ${1 === errorCount ? 'issue' : 'issues'}`,
|
|
448
|
+
title: `${errorCount} ${1 === errorCount ? 'issue' : 'issues'}`,
|
|
449
|
+
className: "grid h-4 min-w-4 place-items-center rounded-full bg-error px-1 text-[10px] font-semibold leading-none text-error-background",
|
|
450
|
+
children: errorCount
|
|
451
|
+
})
|
|
452
|
+
]
|
|
453
|
+
}, step.id);
|
|
461
454
|
})
|
|
462
455
|
}),
|
|
463
456
|
visibleSteps.map((step)=>{
|
|
464
457
|
const stepSections = step.sections.filter((section)=>!section.conditions || context.evaluateConditions(section.conditions));
|
|
465
|
-
|
|
458
|
+
const showEmptyState = 0 === stepSections.length && void 0 !== step.emptyState;
|
|
459
|
+
const selfPadded = !showEmptyState && 'plain' === sectionVariant;
|
|
460
|
+
const sections = stepSections.map((section, index)=>/*#__PURE__*/ jsx(metadata_form_FormSection, {
|
|
461
|
+
section: section,
|
|
462
|
+
context: context,
|
|
463
|
+
customComponents: customComponents,
|
|
464
|
+
disabled: disabled,
|
|
465
|
+
sectionVariant: sectionVariant,
|
|
466
|
+
afterTabs: 0 === index
|
|
467
|
+
}, section.id));
|
|
468
|
+
return /*#__PURE__*/ jsx(PanelTabsContent, {
|
|
466
469
|
value: step.id,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
children: stepSections.map((section)=>/*#__PURE__*/ jsx(metadata_form_FormSection, {
|
|
474
|
-
section: section,
|
|
475
|
-
context: context,
|
|
476
|
-
customComponents: customComponents,
|
|
477
|
-
disabled: disabled,
|
|
478
|
-
sectionVariant: sectionVariant
|
|
479
|
-
}, section.id))
|
|
480
|
-
})
|
|
470
|
+
padded: !selfPadded,
|
|
471
|
+
innerClassName: showEmptyState ? 'text-sm text-muted-foreground' : 'space-y-2',
|
|
472
|
+
children: showEmptyState ? step.emptyState : selfPadded ? /*#__PURE__*/ jsx("div", {
|
|
473
|
+
className: "pb-6 [padding-inline:var(--mf-content-inset,0px)]",
|
|
474
|
+
children: sections
|
|
475
|
+
}) : sections
|
|
481
476
|
}, step.id);
|
|
482
477
|
})
|
|
483
478
|
]
|
|
@@ -491,13 +486,14 @@ function TabbedStepForm({ schema, context, customComponents, disabled, sectionVa
|
|
|
491
486
|
]
|
|
492
487
|
});
|
|
493
488
|
}
|
|
494
|
-
const metadata_form_FormSection = /*#__PURE__*/ react.memo(function({ section, context, customComponents, disabled, sectionVariant = 'card' }) {
|
|
489
|
+
const metadata_form_FormSection = /*#__PURE__*/ react.memo(function({ section, context, customComponents, disabled, sectionVariant = 'card', afterTabs = false }) {
|
|
495
490
|
const gridColumns = context.schema.layout?.columns || 1;
|
|
496
491
|
const gap = context.schema.layout?.gap || 4;
|
|
497
492
|
const isPlain = 'plain' === sectionVariant;
|
|
498
493
|
const dividerClassName = 'border-t first:border-t-0';
|
|
499
494
|
const wrapperClassName = isPlain ? 'border-b-0' : 'border rounded-lg px-3';
|
|
500
|
-
const
|
|
495
|
+
const plainTopClassName = afterTabs ? 'pt-1.5' : 'pt-4';
|
|
496
|
+
const triggerClassName = isPlain ? `${plainTopClassName} pb-4 text-sm font-semibold hover:no-underline` : 'text-sm font-medium';
|
|
501
497
|
const fieldsGrid = /*#__PURE__*/ jsx("div", {
|
|
502
498
|
className: "grid",
|
|
503
499
|
style: {
|
|
@@ -512,7 +508,7 @@ const metadata_form_FormSection = /*#__PURE__*/ react.memo(function({ section, c
|
|
|
512
508
|
}, field.name))
|
|
513
509
|
});
|
|
514
510
|
if (!section.title) return isPlain ? /*#__PURE__*/ jsx("div", {
|
|
515
|
-
className: `${dividerClassName} pb-4
|
|
511
|
+
className: `${dividerClassName} pb-4 ${plainTopClassName}`,
|
|
516
512
|
children: fieldsGrid
|
|
517
513
|
}) : fieldsGrid;
|
|
518
514
|
const innerContent = /*#__PURE__*/ jsxs("div", {
|
|
@@ -554,7 +550,7 @@ const metadata_form_FormSection = /*#__PURE__*/ react.memo(function({ section, c
|
|
|
554
550
|
/*#__PURE__*/ jsx("div", {
|
|
555
551
|
className: "flex",
|
|
556
552
|
children: /*#__PURE__*/ jsx("div", {
|
|
557
|
-
className: isPlain ?
|
|
553
|
+
className: isPlain ? `flex flex-1 items-center justify-start gap-2 pb-4 text-sm font-semibold ${plainTopClassName}` : 'flex flex-1 items-center justify-between py-4 text-sm font-medium',
|
|
558
554
|
children: section.title
|
|
559
555
|
})
|
|
560
556
|
}),
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
DEFAULT_CODE_BLOCK_STRINGS: ()=>DEFAULT_CODE_BLOCK_STRINGS,
|
|
37
|
+
CodeBlock: ()=>CodeBlock,
|
|
38
|
+
CodeBlockHeader: ()=>CodeBlockHeader
|
|
39
|
+
});
|
|
40
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
41
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
42
|
+
const external_react_namespaceObject = require("react");
|
|
43
|
+
const bash_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/bash.js");
|
|
44
|
+
var bash_js_default = /*#__PURE__*/ __webpack_require__.n(bash_js_namespaceObject);
|
|
45
|
+
const csharp_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/csharp.js");
|
|
46
|
+
var csharp_js_default = /*#__PURE__*/ __webpack_require__.n(csharp_js_namespaceObject);
|
|
47
|
+
const css_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/css.js");
|
|
48
|
+
var css_js_default = /*#__PURE__*/ __webpack_require__.n(css_js_namespaceObject);
|
|
49
|
+
const diff_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/diff.js");
|
|
50
|
+
var diff_js_default = /*#__PURE__*/ __webpack_require__.n(diff_js_namespaceObject);
|
|
51
|
+
const go_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/go.js");
|
|
52
|
+
var go_js_default = /*#__PURE__*/ __webpack_require__.n(go_js_namespaceObject);
|
|
53
|
+
const java_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/java.js");
|
|
54
|
+
var java_js_default = /*#__PURE__*/ __webpack_require__.n(java_js_namespaceObject);
|
|
55
|
+
const javascript_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/javascript.js");
|
|
56
|
+
var javascript_js_default = /*#__PURE__*/ __webpack_require__.n(javascript_js_namespaceObject);
|
|
57
|
+
const json_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/json.js");
|
|
58
|
+
var json_js_default = /*#__PURE__*/ __webpack_require__.n(json_js_namespaceObject);
|
|
59
|
+
const jsx_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/jsx.js");
|
|
60
|
+
var jsx_js_default = /*#__PURE__*/ __webpack_require__.n(jsx_js_namespaceObject);
|
|
61
|
+
const markdown_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/markdown.js");
|
|
62
|
+
var markdown_js_default = /*#__PURE__*/ __webpack_require__.n(markdown_js_namespaceObject);
|
|
63
|
+
const markup_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/markup.js");
|
|
64
|
+
var markup_js_default = /*#__PURE__*/ __webpack_require__.n(markup_js_namespaceObject);
|
|
65
|
+
const powershell_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/powershell.js");
|
|
66
|
+
var powershell_js_default = /*#__PURE__*/ __webpack_require__.n(powershell_js_namespaceObject);
|
|
67
|
+
const python_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/python.js");
|
|
68
|
+
var python_js_default = /*#__PURE__*/ __webpack_require__.n(python_js_namespaceObject);
|
|
69
|
+
const sql_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/sql.js");
|
|
70
|
+
var sql_js_default = /*#__PURE__*/ __webpack_require__.n(sql_js_namespaceObject);
|
|
71
|
+
const tsx_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/tsx.js");
|
|
72
|
+
var tsx_js_default = /*#__PURE__*/ __webpack_require__.n(tsx_js_namespaceObject);
|
|
73
|
+
const typescript_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/typescript.js");
|
|
74
|
+
var typescript_js_default = /*#__PURE__*/ __webpack_require__.n(typescript_js_namespaceObject);
|
|
75
|
+
const vbnet_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/vbnet.js");
|
|
76
|
+
var vbnet_js_default = /*#__PURE__*/ __webpack_require__.n(vbnet_js_namespaceObject);
|
|
77
|
+
const yaml_js_namespaceObject = require("react-syntax-highlighter/dist/esm/languages/prism/yaml.js");
|
|
78
|
+
var yaml_js_default = /*#__PURE__*/ __webpack_require__.n(yaml_js_namespaceObject);
|
|
79
|
+
const prism_light_js_namespaceObject = require("react-syntax-highlighter/dist/esm/prism-light.js");
|
|
80
|
+
var prism_light_js_default = /*#__PURE__*/ __webpack_require__.n(prism_light_js_namespaceObject);
|
|
81
|
+
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
82
|
+
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
83
|
+
const clipboard_cjs_namespaceObject = require("../../lib/clipboard.cjs");
|
|
84
|
+
const LANGUAGES = {
|
|
85
|
+
bash: bash_js_default(),
|
|
86
|
+
csharp: csharp_js_default(),
|
|
87
|
+
css: css_js_default(),
|
|
88
|
+
diff: diff_js_default(),
|
|
89
|
+
go: go_js_default(),
|
|
90
|
+
java: java_js_default(),
|
|
91
|
+
javascript: javascript_js_default(),
|
|
92
|
+
json: json_js_default(),
|
|
93
|
+
jsx: jsx_js_default(),
|
|
94
|
+
markdown: markdown_js_default(),
|
|
95
|
+
markup: markup_js_default(),
|
|
96
|
+
powershell: powershell_js_default(),
|
|
97
|
+
python: python_js_default(),
|
|
98
|
+
sql: sql_js_default(),
|
|
99
|
+
tsx: tsx_js_default(),
|
|
100
|
+
typescript: typescript_js_default(),
|
|
101
|
+
vbnet: vbnet_js_default(),
|
|
102
|
+
yaml: yaml_js_default()
|
|
103
|
+
};
|
|
104
|
+
for (const [name, grammar] of Object.entries(LANGUAGES))prism_light_js_default().registerLanguage(name, grammar);
|
|
105
|
+
const LANGUAGE_ALIASES = {
|
|
106
|
+
'c#': 'csharp',
|
|
107
|
+
cjs: "javascript",
|
|
108
|
+
cs: 'csharp',
|
|
109
|
+
golang: 'go',
|
|
110
|
+
htm: 'markup',
|
|
111
|
+
html: 'markup',
|
|
112
|
+
js: "javascript",
|
|
113
|
+
md: 'markdown',
|
|
114
|
+
mjs: "javascript",
|
|
115
|
+
patch: 'diff',
|
|
116
|
+
ps: 'powershell',
|
|
117
|
+
ps1: 'powershell',
|
|
118
|
+
pwsh: 'powershell',
|
|
119
|
+
py: 'python',
|
|
120
|
+
sh: 'bash',
|
|
121
|
+
shell: 'bash',
|
|
122
|
+
svg: 'markup',
|
|
123
|
+
ts: "typescript",
|
|
124
|
+
vb: 'vbnet',
|
|
125
|
+
'vb.net': 'vbnet',
|
|
126
|
+
xml: 'markup',
|
|
127
|
+
yml: 'yaml',
|
|
128
|
+
zsh: 'bash'
|
|
129
|
+
};
|
|
130
|
+
function resolveLanguage(language) {
|
|
131
|
+
const key = language?.trim().toLowerCase();
|
|
132
|
+
if (!key) return;
|
|
133
|
+
const name = LANGUAGE_ALIASES[key] ?? key;
|
|
134
|
+
return name in LANGUAGES ? name : void 0;
|
|
135
|
+
}
|
|
136
|
+
const token = (name)=>`var(--code-${name}, var(--foreground))`;
|
|
137
|
+
const codeBlockTheme = {
|
|
138
|
+
'code[class*="language-"]': {
|
|
139
|
+
color: token('rest'),
|
|
140
|
+
background: 'none',
|
|
141
|
+
fontFamily: 'var(--font-mono)',
|
|
142
|
+
textAlign: 'left',
|
|
143
|
+
wordSpacing: 'normal',
|
|
144
|
+
wordBreak: 'normal',
|
|
145
|
+
tabSize: 2,
|
|
146
|
+
hyphens: 'none'
|
|
147
|
+
},
|
|
148
|
+
'pre[class*="language-"]': {
|
|
149
|
+
color: token('rest'),
|
|
150
|
+
background: 'none',
|
|
151
|
+
fontFamily: 'var(--font-mono)',
|
|
152
|
+
fontSize: '0.8125rem',
|
|
153
|
+
lineHeight: 1.6,
|
|
154
|
+
margin: 0,
|
|
155
|
+
padding: '0.75rem 1rem',
|
|
156
|
+
overflow: 'auto',
|
|
157
|
+
tabSize: 2
|
|
158
|
+
},
|
|
159
|
+
comment: {
|
|
160
|
+
color: 'var(--foreground-muted)',
|
|
161
|
+
fontStyle: 'italic'
|
|
162
|
+
},
|
|
163
|
+
prolog: {
|
|
164
|
+
color: 'var(--foreground-muted)',
|
|
165
|
+
fontStyle: 'italic'
|
|
166
|
+
},
|
|
167
|
+
doctype: {
|
|
168
|
+
color: 'var(--foreground-muted)'
|
|
169
|
+
},
|
|
170
|
+
cdata: {
|
|
171
|
+
color: 'var(--foreground-muted)'
|
|
172
|
+
},
|
|
173
|
+
punctuation: {
|
|
174
|
+
color: token('punctuation')
|
|
175
|
+
},
|
|
176
|
+
operator: {
|
|
177
|
+
color: token('key')
|
|
178
|
+
},
|
|
179
|
+
keyword: {
|
|
180
|
+
color: token('key')
|
|
181
|
+
},
|
|
182
|
+
atrule: {
|
|
183
|
+
color: token('key')
|
|
184
|
+
},
|
|
185
|
+
tag: {
|
|
186
|
+
color: token('key')
|
|
187
|
+
},
|
|
188
|
+
property: {
|
|
189
|
+
color: token('key')
|
|
190
|
+
},
|
|
191
|
+
'attr-name': {
|
|
192
|
+
color: token('key')
|
|
193
|
+
},
|
|
194
|
+
selector: {
|
|
195
|
+
color: token('key')
|
|
196
|
+
},
|
|
197
|
+
string: {
|
|
198
|
+
color: token('string')
|
|
199
|
+
},
|
|
200
|
+
char: {
|
|
201
|
+
color: token('string')
|
|
202
|
+
},
|
|
203
|
+
'attr-value': {
|
|
204
|
+
color: token('string')
|
|
205
|
+
},
|
|
206
|
+
'template-string': {
|
|
207
|
+
color: token('string')
|
|
208
|
+
},
|
|
209
|
+
regex: {
|
|
210
|
+
color: token('string')
|
|
211
|
+
},
|
|
212
|
+
url: {
|
|
213
|
+
color: token('string')
|
|
214
|
+
},
|
|
215
|
+
inserted: {
|
|
216
|
+
color: token('string')
|
|
217
|
+
},
|
|
218
|
+
number: {
|
|
219
|
+
color: token('number')
|
|
220
|
+
},
|
|
221
|
+
unit: {
|
|
222
|
+
color: token('number')
|
|
223
|
+
},
|
|
224
|
+
boolean: {
|
|
225
|
+
color: token('literal')
|
|
226
|
+
},
|
|
227
|
+
constant: {
|
|
228
|
+
color: token('literal')
|
|
229
|
+
},
|
|
230
|
+
symbol: {
|
|
231
|
+
color: token('literal')
|
|
232
|
+
},
|
|
233
|
+
builtin: {
|
|
234
|
+
color: token('literal')
|
|
235
|
+
},
|
|
236
|
+
'class-name': {
|
|
237
|
+
color: token('literal')
|
|
238
|
+
},
|
|
239
|
+
function: {
|
|
240
|
+
color: token('literal')
|
|
241
|
+
},
|
|
242
|
+
entity: {
|
|
243
|
+
color: token('literal')
|
|
244
|
+
},
|
|
245
|
+
deleted: {
|
|
246
|
+
color: 'var(--error, var(--destructive))'
|
|
247
|
+
},
|
|
248
|
+
important: {
|
|
249
|
+
fontWeight: 600
|
|
250
|
+
},
|
|
251
|
+
bold: {
|
|
252
|
+
fontWeight: 600
|
|
253
|
+
},
|
|
254
|
+
italic: {
|
|
255
|
+
fontStyle: 'italic'
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const lineNumberStyle = {
|
|
259
|
+
minWidth: '2.25em',
|
|
260
|
+
paddingRight: '1em',
|
|
261
|
+
color: 'var(--foreground-subtle)',
|
|
262
|
+
textAlign: 'right',
|
|
263
|
+
userSelect: 'none'
|
|
264
|
+
};
|
|
265
|
+
const DEFAULT_CODE_BLOCK_STRINGS = {
|
|
266
|
+
copy: 'Copy code',
|
|
267
|
+
copied: 'Copied',
|
|
268
|
+
plainText: 'Text'
|
|
269
|
+
};
|
|
270
|
+
const COPIED_RESET_MS = 2000;
|
|
271
|
+
const CodeBlockHeader = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ code, language, strings, className, children, ...props }, ref)=>{
|
|
272
|
+
const text = {
|
|
273
|
+
...DEFAULT_CODE_BLOCK_STRINGS,
|
|
274
|
+
...strings
|
|
275
|
+
};
|
|
276
|
+
const [copied, setCopied] = external_react_namespaceObject.useState(false);
|
|
277
|
+
const timer = external_react_namespaceObject.useRef(void 0);
|
|
278
|
+
external_react_namespaceObject.useEffect(()=>()=>clearTimeout(timer.current), []);
|
|
279
|
+
const handleCopy = async ()=>{
|
|
280
|
+
if (!await (0, clipboard_cjs_namespaceObject.copyTextToClipboard)(code)) return;
|
|
281
|
+
setCopied(true);
|
|
282
|
+
clearTimeout(timer.current);
|
|
283
|
+
timer.current = setTimeout(()=>setCopied(false), COPIED_RESET_MS);
|
|
284
|
+
};
|
|
285
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
286
|
+
ref: ref,
|
|
287
|
+
"data-slot": "code-block-header",
|
|
288
|
+
className: (0, index_cjs_namespaceObject.cn)('flex items-center justify-between gap-2 border-b border-border-subtle py-1 pr-1 pl-4', className),
|
|
289
|
+
...props,
|
|
290
|
+
children: [
|
|
291
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
292
|
+
"data-slot": "code-block-language",
|
|
293
|
+
className: "min-w-0 truncate text-xs font-medium text-muted-foreground",
|
|
294
|
+
children: language?.trim() || text.plainText
|
|
295
|
+
}),
|
|
296
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
297
|
+
className: "flex shrink-0 items-center gap-1",
|
|
298
|
+
children: [
|
|
299
|
+
children,
|
|
300
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
301
|
+
"data-slot": "code-block-copy",
|
|
302
|
+
"data-copied": copied || void 0,
|
|
303
|
+
variant: "ghost",
|
|
304
|
+
size: "2xs",
|
|
305
|
+
icon: true,
|
|
306
|
+
"aria-label": text.copy,
|
|
307
|
+
title: copied ? text.copied : text.copy,
|
|
308
|
+
onClick: handleCopy,
|
|
309
|
+
children: copied ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Check, {
|
|
310
|
+
"aria-hidden": true
|
|
311
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Copy, {
|
|
312
|
+
"aria-hidden": true
|
|
313
|
+
})
|
|
314
|
+
}),
|
|
315
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("output", {
|
|
316
|
+
className: "sr-only",
|
|
317
|
+
children: copied ? text.copied : ''
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
})
|
|
321
|
+
]
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
CodeBlockHeader.displayName = 'CodeBlockHeader';
|
|
325
|
+
const code_block_CodeBlockBody = /*#__PURE__*/ external_react_namespaceObject.memo(function({ code, language, wrap, showLineNumbers }) {
|
|
326
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(prism_light_js_default(), {
|
|
327
|
+
language: language ?? 'text',
|
|
328
|
+
style: codeBlockTheme,
|
|
329
|
+
wrapLongLines: wrap,
|
|
330
|
+
showLineNumbers: showLineNumbers,
|
|
331
|
+
lineNumberStyle: lineNumberStyle,
|
|
332
|
+
"data-slot": "code-block-body",
|
|
333
|
+
"data-wrap": wrap,
|
|
334
|
+
tabIndex: wrap ? void 0 : 0,
|
|
335
|
+
className: "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
336
|
+
children: code
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
const CodeBlock = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ code, language, wrap = false, showLineNumbers = false, hideHeader = false, actions, strings, className, ...props }, ref)=>{
|
|
340
|
+
const source = code.replace(/\n$/, '');
|
|
341
|
+
const resolved = resolveLanguage(language);
|
|
342
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
343
|
+
ref: ref,
|
|
344
|
+
"data-slot": "code-block",
|
|
345
|
+
"data-language": resolved ?? 'text',
|
|
346
|
+
className: (0, index_cjs_namespaceObject.cn)('min-w-0 overflow-hidden rounded-lg border border-border-subtle bg-surface-overlay text-foreground', className),
|
|
347
|
+
...props,
|
|
348
|
+
children: [
|
|
349
|
+
!hideHeader && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CodeBlockHeader, {
|
|
350
|
+
code: source,
|
|
351
|
+
language: language,
|
|
352
|
+
strings: strings,
|
|
353
|
+
children: actions
|
|
354
|
+
}),
|
|
355
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(code_block_CodeBlockBody, {
|
|
356
|
+
code: source,
|
|
357
|
+
language: resolved,
|
|
358
|
+
wrap: wrap,
|
|
359
|
+
showLineNumbers: showLineNumbers
|
|
360
|
+
})
|
|
361
|
+
]
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
CodeBlock.displayName = 'CodeBlock';
|
|
365
|
+
exports.CodeBlock = __webpack_exports__.CodeBlock;
|
|
366
|
+
exports.CodeBlockHeader = __webpack_exports__.CodeBlockHeader;
|
|
367
|
+
exports.DEFAULT_CODE_BLOCK_STRINGS = __webpack_exports__.DEFAULT_CODE_BLOCK_STRINGS;
|
|
368
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
369
|
+
"CodeBlock",
|
|
370
|
+
"CodeBlockHeader",
|
|
371
|
+
"DEFAULT_CODE_BLOCK_STRINGS"
|
|
372
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
373
|
+
Object.defineProperty(exports, '__esModule', {
|
|
374
|
+
value: true
|
|
375
|
+
});
|