elseware-ui 2.37.2 → 2.38.1
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/index.css +669 -4710
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +814 -25
- package/dist/index.d.ts +814 -25
- package/dist/index.js +2442 -350
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2394 -351
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -2
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { twMerge } from 'tailwind-merge';
|
|
2
|
-
import React2, { createContext, forwardRef, useState, useImperativeHandle, useEffect, useMemo, useRef, useCallback, useContext, Children } from 'react';
|
|
2
|
+
import React2, { createContext, forwardRef, useState, useImperativeHandle, useEffect, useMemo, useRef, useCallback, useContext, Children, isValidElement } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { BsStarFill, BsStarHalf, BsStar, BsChevronDown, BsFillDiamondFill } from 'react-icons/bs';
|
|
5
5
|
import { FaSun, FaMoon, FaGripVertical, FaTrash, FaPlus, FaTimes, FaBars, FaCircle, FaEyeSlash, FaEye } from 'react-icons/fa';
|
|
6
6
|
import { ResponsiveContainer, LineChart, CartesianGrid, XAxis, YAxis, Tooltip, Line, AreaChart, Area, BarChart, Bar, PieChart, Pie, Cell, ScatterChart, Scatter } from 'recharts';
|
|
7
|
-
import
|
|
7
|
+
import classNames66 from 'classnames';
|
|
8
8
|
import { FaCircleChevronDown } from 'react-icons/fa6';
|
|
9
9
|
import ReactWorldFlags from 'react-world-flags';
|
|
10
10
|
import emojiFlags from 'emoji-flags';
|
|
@@ -16,9 +16,30 @@ import { motion, AnimatePresence } from 'framer-motion';
|
|
|
16
16
|
import { AiOutlineLoading } from 'react-icons/ai';
|
|
17
17
|
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
18
18
|
import { MdUpload, MdOutlineDone, MdOutlineRemoveCircleOutline } from 'react-icons/md';
|
|
19
|
-
import '@mdxeditor/editor/style.css';
|
|
20
|
-
import { MDXEditor, headingsPlugin, linkPlugin, listsPlugin, imagePlugin, tablePlugin, linkDialogPlugin, thematicBreakPlugin, quotePlugin, toolbarPlugin, UndoRedo, Separator, BlockTypeSelect, BoldItalicUnderlineToggles, StrikeThroughSupSubToggles, ListsToggle, CreateLink, InsertImage, InsertTable, InsertThematicBreak, markdownShortcutPlugin, frontmatterPlugin, codeBlockPlugin, codeMirrorPlugin } from '@mdxeditor/editor';
|
|
21
19
|
import { BiCheckCircle, BiXCircle, BiChevronDown, BiChevronUp, BiSolidLike, BiLike, BiSolidDislike, BiDislike, BiDotsVerticalRounded, BiReply, BiEdit, BiTrash, BiFlag } from 'react-icons/bi';
|
|
20
|
+
import ReactMarkdown from 'react-markdown';
|
|
21
|
+
import remarkGfm from 'remark-gfm';
|
|
22
|
+
import rehypeRaw from 'rehype-raw';
|
|
23
|
+
import rehypeSanitize from 'rehype-sanitize';
|
|
24
|
+
import { PrismLight } from 'react-syntax-highlighter';
|
|
25
|
+
import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
26
|
+
import bash from 'react-syntax-highlighter/dist/esm/languages/prism/bash';
|
|
27
|
+
import c from 'react-syntax-highlighter/dist/esm/languages/prism/c';
|
|
28
|
+
import cpp from 'react-syntax-highlighter/dist/esm/languages/prism/cpp';
|
|
29
|
+
import css from 'react-syntax-highlighter/dist/esm/languages/prism/css';
|
|
30
|
+
import go from 'react-syntax-highlighter/dist/esm/languages/prism/go';
|
|
31
|
+
import java from 'react-syntax-highlighter/dist/esm/languages/prism/java';
|
|
32
|
+
import javascript from 'react-syntax-highlighter/dist/esm/languages/prism/javascript';
|
|
33
|
+
import json from 'react-syntax-highlighter/dist/esm/languages/prism/json';
|
|
34
|
+
import jsx210 from 'react-syntax-highlighter/dist/esm/languages/prism/jsx';
|
|
35
|
+
import markup from 'react-syntax-highlighter/dist/esm/languages/prism/markup';
|
|
36
|
+
import python from 'react-syntax-highlighter/dist/esm/languages/prism/python';
|
|
37
|
+
import rust from 'react-syntax-highlighter/dist/esm/languages/prism/rust';
|
|
38
|
+
import scss from 'react-syntax-highlighter/dist/esm/languages/prism/scss';
|
|
39
|
+
import sql from 'react-syntax-highlighter/dist/esm/languages/prism/sql';
|
|
40
|
+
import tsx from 'react-syntax-highlighter/dist/esm/languages/prism/tsx';
|
|
41
|
+
import typescript from 'react-syntax-highlighter/dist/esm/languages/prism/typescript';
|
|
42
|
+
import yaml from 'react-syntax-highlighter/dist/esm/languages/prism/yaml';
|
|
22
43
|
|
|
23
44
|
// node_modules/clsx/dist/clsx.mjs
|
|
24
45
|
function r(e) {
|
|
@@ -138,7 +159,7 @@ var CURRENCIES = [
|
|
|
138
159
|
|
|
139
160
|
// src/utils/currency.ts
|
|
140
161
|
var getCurrencySymbol = (code) => {
|
|
141
|
-
const currency = CURRENCIES.find((
|
|
162
|
+
const currency = CURRENCIES.find((c2) => c2.code === code);
|
|
142
163
|
return currency ? currency.symbol : null;
|
|
143
164
|
};
|
|
144
165
|
|
|
@@ -3732,7 +3753,7 @@ function renderTransitionChild(children, className) {
|
|
|
3732
3753
|
}
|
|
3733
3754
|
const element = child;
|
|
3734
3755
|
return React2.cloneElement(element, {
|
|
3735
|
-
className:
|
|
3756
|
+
className: classNames66(element.props.className, className)
|
|
3736
3757
|
});
|
|
3737
3758
|
}
|
|
3738
3759
|
function TransitionBase({
|
|
@@ -3752,7 +3773,7 @@ function TransitionBase({
|
|
|
3752
3773
|
if (!mounted && unmountOnExit) {
|
|
3753
3774
|
return null;
|
|
3754
3775
|
}
|
|
3755
|
-
const transitionClassName =
|
|
3776
|
+
const transitionClassName = classNames66(
|
|
3756
3777
|
visibility ? enterClassName : leaveClassName,
|
|
3757
3778
|
active ? visibleClassName : hiddenClassName
|
|
3758
3779
|
);
|
|
@@ -3927,7 +3948,7 @@ function Accordion({
|
|
|
3927
3948
|
/* @__PURE__ */ jsxs(
|
|
3928
3949
|
"div",
|
|
3929
3950
|
{
|
|
3930
|
-
className:
|
|
3951
|
+
className: classNames66(
|
|
3931
3952
|
"inline-flex gap-3 items-center px-3 py-2 w-full eui-gradient-to-r-general-xs",
|
|
3932
3953
|
{
|
|
3933
3954
|
"hover:cursor-pointer": toggleOnSummaryClick
|
|
@@ -3948,7 +3969,7 @@ function Accordion({
|
|
|
3948
3969
|
children: /* @__PURE__ */ jsx(
|
|
3949
3970
|
FaCircleChevronDown,
|
|
3950
3971
|
{
|
|
3951
|
-
className:
|
|
3972
|
+
className: classNames66("text-xl transition-transform duration-300", {
|
|
3952
3973
|
"rotate-180": collapse
|
|
3953
3974
|
})
|
|
3954
3975
|
}
|
|
@@ -3962,7 +3983,7 @@ function Accordion({
|
|
|
3962
3983
|
/* @__PURE__ */ jsx(TransitionAccordion_default, { visibility: collapse, children: /* @__PURE__ */ jsx(
|
|
3963
3984
|
"div",
|
|
3964
3985
|
{
|
|
3965
|
-
className:
|
|
3986
|
+
className: classNames66(
|
|
3966
3987
|
"border-t border-t-eui-dark-400/40 eui-text-sm",
|
|
3967
3988
|
{
|
|
3968
3989
|
"p-5": enableChildrenPadding
|
|
@@ -4046,7 +4067,7 @@ function CardHeader({ icon, title, description, className }) {
|
|
|
4046
4067
|
return /* @__PURE__ */ jsxs(
|
|
4047
4068
|
"div",
|
|
4048
4069
|
{
|
|
4049
|
-
className:
|
|
4070
|
+
className: classNames66(
|
|
4050
4071
|
"flex items-start gap-4 p-6 border-b border-white/10",
|
|
4051
4072
|
className
|
|
4052
4073
|
),
|
|
@@ -4062,14 +4083,14 @@ function CardHeader({ icon, title, description, className }) {
|
|
|
4062
4083
|
}
|
|
4063
4084
|
var CardHeader_default = CardHeader;
|
|
4064
4085
|
function CardContent({ children, className }) {
|
|
4065
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
4086
|
+
return /* @__PURE__ */ jsx("div", { className: classNames66("p-6 text-gray-300 text-sm", className), children });
|
|
4066
4087
|
}
|
|
4067
4088
|
var CardContent_default = CardContent;
|
|
4068
4089
|
function CardFooter({ children, className }) {
|
|
4069
4090
|
return /* @__PURE__ */ jsx(
|
|
4070
4091
|
"div",
|
|
4071
4092
|
{
|
|
4072
|
-
className:
|
|
4093
|
+
className: classNames66(
|
|
4073
4094
|
"flex items-center gap-3 p-5 border-t border-white/10 text-sm text-gray-400",
|
|
4074
4095
|
className
|
|
4075
4096
|
),
|
|
@@ -4111,7 +4132,7 @@ function GradientAnimation({
|
|
|
4111
4132
|
return /* @__PURE__ */ jsx(
|
|
4112
4133
|
"div",
|
|
4113
4134
|
{
|
|
4114
|
-
className:
|
|
4135
|
+
className: classNames66("absolute inset-0"),
|
|
4115
4136
|
style: {
|
|
4116
4137
|
background: `linear-gradient(${cfg.angle}deg, ${cfg.colors?.join(",")})`,
|
|
4117
4138
|
backgroundSize: cfg.backgroundSize,
|
|
@@ -4257,7 +4278,7 @@ function MotionSurface({
|
|
|
4257
4278
|
}) {
|
|
4258
4279
|
const AnimationComponent = animationVariant === "custom" ? CustomAnimation : animationRegistry[animationVariant];
|
|
4259
4280
|
const OverlayComponent = overlay === "custom" ? CustomOverlay : overlayRegistry[overlay];
|
|
4260
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
4281
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames66("relative overflow-hidden", className), children: [
|
|
4261
4282
|
AnimationComponent && /* @__PURE__ */ jsx(AnimationComponent, { config: animationConfig, animated }),
|
|
4262
4283
|
OverlayComponent && /* @__PURE__ */ jsx(OverlayComponent, { config: overlayConfig }),
|
|
4263
4284
|
/* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -5661,7 +5682,7 @@ var Backdrop = ({ children, styles }) => {
|
|
|
5661
5682
|
return /* @__PURE__ */ jsx(
|
|
5662
5683
|
"div",
|
|
5663
5684
|
{
|
|
5664
|
-
className:
|
|
5685
|
+
className: classNames66({
|
|
5665
5686
|
"bg-black/75 top-0 bottom-0 left-0 right-0 z-50 fixed inset-0 flex items-center justify-center overflow-hidden": true,
|
|
5666
5687
|
[`${styles}`]: styles
|
|
5667
5688
|
}),
|
|
@@ -6185,7 +6206,7 @@ var Form = ({
|
|
|
6185
6206
|
/* @__PURE__ */ jsx(UnsavedChangesGuard_default, { formik, enabled: warnOnUnsavedChanges }),
|
|
6186
6207
|
/* @__PURE__ */ jsx(DirtyObserver_default, { formik, onDirtyChange }),
|
|
6187
6208
|
/* @__PURE__ */ jsx(FormObserver_default, { formik, onChange }),
|
|
6188
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
6209
|
+
/* @__PURE__ */ jsx("div", { className: classNames66(styles), children })
|
|
6189
6210
|
] })
|
|
6190
6211
|
}
|
|
6191
6212
|
);
|
|
@@ -6702,7 +6723,7 @@ function FormResponse({
|
|
|
6702
6723
|
return /* @__PURE__ */ jsx(Transition.TransitionDropdown, { visibility: text ? true : false, children: /* @__PURE__ */ jsx(
|
|
6703
6724
|
"div",
|
|
6704
6725
|
{
|
|
6705
|
-
className:
|
|
6726
|
+
className: classNames66({
|
|
6706
6727
|
"font-poppins font-light text-sm": true,
|
|
6707
6728
|
[`${variantsLite[variant]}`]: variant,
|
|
6708
6729
|
[`${shapes[shape]}`]: shape,
|
|
@@ -6819,7 +6840,7 @@ var ThemeSwitch = () => {
|
|
|
6819
6840
|
/* @__PURE__ */ jsx(
|
|
6820
6841
|
"div",
|
|
6821
6842
|
{
|
|
6822
|
-
className:
|
|
6843
|
+
className: classNames66(
|
|
6823
6844
|
"w-6 h-6 bg-white dark:bg-gray-600 rounded-full shadow-md transition-transform duration-300",
|
|
6824
6845
|
theme === "dark" ? "translate-x-8" : "translate-x-0"
|
|
6825
6846
|
)
|
|
@@ -18200,12 +18221,12 @@ function WorldMap({
|
|
|
18200
18221
|
const mode = isDarkMode ? mapStyles.dark : mapStyles.light;
|
|
18201
18222
|
const resolvedData = useMemo(() => {
|
|
18202
18223
|
return data.map((item) => {
|
|
18203
|
-
const
|
|
18204
|
-
if (!
|
|
18224
|
+
const c2 = COUNTRIES.find((x) => x.code === item.code);
|
|
18225
|
+
if (!c2) return null;
|
|
18205
18226
|
return {
|
|
18206
18227
|
...item,
|
|
18207
|
-
name:
|
|
18208
|
-
coordinates:
|
|
18228
|
+
name: c2.name,
|
|
18229
|
+
coordinates: c2.coordinates
|
|
18209
18230
|
};
|
|
18210
18231
|
}).filter(Boolean);
|
|
18211
18232
|
}, [data]);
|
|
@@ -18367,7 +18388,7 @@ function InputResponse({
|
|
|
18367
18388
|
return /* @__PURE__ */ jsx(Transition.TransitionDropdown, { visibility, children: /* @__PURE__ */ jsx(
|
|
18368
18389
|
"div",
|
|
18369
18390
|
{
|
|
18370
|
-
className:
|
|
18391
|
+
className: classNames66({
|
|
18371
18392
|
"font-medium text-sm py-1 px-2": true,
|
|
18372
18393
|
[`${textVariants[variant]}`]: variant,
|
|
18373
18394
|
"transition-all ease-in-out": true,
|
|
@@ -18382,7 +18403,7 @@ function InputLabel({ text, children, styles }) {
|
|
|
18382
18403
|
return /* @__PURE__ */ jsx(
|
|
18383
18404
|
"label",
|
|
18384
18405
|
{
|
|
18385
|
-
className:
|
|
18406
|
+
className: classNames66({
|
|
18386
18407
|
"px-0 eui-text-sm text-[13.5px] pointer-events-none select-none": true,
|
|
18387
18408
|
"transition-all ease-in-out": true,
|
|
18388
18409
|
[`${styles}`]: styles
|
|
@@ -18434,7 +18455,7 @@ var Input = ({
|
|
|
18434
18455
|
...field,
|
|
18435
18456
|
...props,
|
|
18436
18457
|
placeholder,
|
|
18437
|
-
className:
|
|
18458
|
+
className: classNames66({
|
|
18438
18459
|
"border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none h-[50px]": true,
|
|
18439
18460
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
18440
18461
|
"border-eui-danger-500": meta.touched && meta.error,
|
|
@@ -18479,7 +18500,7 @@ var InputFile = ({
|
|
|
18479
18500
|
/* @__PURE__ */ jsx(
|
|
18480
18501
|
"div",
|
|
18481
18502
|
{
|
|
18482
|
-
className:
|
|
18503
|
+
className: classNames66(
|
|
18483
18504
|
"border rounded-sm bg-eui-primary-300/10 px-3 pt-3 text-md text-eui-dark-100 cursor-pointer h-[50px] flex items-center",
|
|
18484
18505
|
{
|
|
18485
18506
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
@@ -18505,7 +18526,7 @@ var InputFile = ({
|
|
|
18505
18526
|
InputLabel_default,
|
|
18506
18527
|
{
|
|
18507
18528
|
text: placeholder,
|
|
18508
|
-
styles:
|
|
18529
|
+
styles: classNames66({
|
|
18509
18530
|
"absolute left-2 eui-text-sm peer-placeholder-shown:text-base peer-placeholder-shown:top-3 pointer-events-none": true,
|
|
18510
18531
|
"top-[0.7px]": showFloatingLabel,
|
|
18511
18532
|
"top-[13px] text-base": !showFloatingLabel
|
|
@@ -18558,7 +18579,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18558
18579
|
/* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsx(FieldArray, { name, children: ({ push, remove, move }) => /* @__PURE__ */ jsxs(
|
|
18559
18580
|
"div",
|
|
18560
18581
|
{
|
|
18561
|
-
className:
|
|
18582
|
+
className: classNames66(
|
|
18562
18583
|
"flex w-full flex-col space-y-2 bg-eui-primary-300/10",
|
|
18563
18584
|
shapes[resolvedShape]
|
|
18564
18585
|
),
|
|
@@ -18587,7 +18608,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18587
18608
|
ref: provided2.innerRef,
|
|
18588
18609
|
...draggableProps,
|
|
18589
18610
|
style: draggableStyle,
|
|
18590
|
-
className:
|
|
18611
|
+
className: classNames66(
|
|
18591
18612
|
"flex items-center space-x-2 bg-eui-primary-300/10 p-2",
|
|
18592
18613
|
shapes[resolvedShape]
|
|
18593
18614
|
),
|
|
@@ -18598,7 +18619,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18598
18619
|
{
|
|
18599
18620
|
name: `${name}[${index}]`,
|
|
18600
18621
|
placeholder: `Item ${index + 1}`,
|
|
18601
|
-
className:
|
|
18622
|
+
className: classNames66(
|
|
18602
18623
|
"peer h-[50px] w-full border bg-eui-primary-300/10 px-3 pb-2 pt-5 text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none eui-text-md",
|
|
18603
18624
|
shapes[resolvedShape],
|
|
18604
18625
|
hasItemError ? "border-eui-danger-500" : "border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18694,7 +18715,7 @@ var InputListGroup = ({
|
|
|
18694
18715
|
return /* @__PURE__ */ jsxs(
|
|
18695
18716
|
"div",
|
|
18696
18717
|
{
|
|
18697
|
-
className:
|
|
18718
|
+
className: classNames66(
|
|
18698
18719
|
"flex flex-col gap-2 bg-eui-primary-300/10 p-3",
|
|
18699
18720
|
shapes[resolvedShape]
|
|
18700
18721
|
),
|
|
@@ -18706,7 +18727,7 @@ var InputListGroup = ({
|
|
|
18706
18727
|
{
|
|
18707
18728
|
name: `${name}[${groupIndex}].name`,
|
|
18708
18729
|
placeholder: `Group ${groupIndex + 1}`,
|
|
18709
|
-
className:
|
|
18730
|
+
className: classNames66(
|
|
18710
18731
|
"h-[40px] w-full border bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none",
|
|
18711
18732
|
shapes[resolvedShape],
|
|
18712
18733
|
"border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18737,7 +18758,7 @@ var InputListGroup = ({
|
|
|
18737
18758
|
{
|
|
18738
18759
|
ref: provided.innerRef,
|
|
18739
18760
|
...provided.droppableProps,
|
|
18740
|
-
className:
|
|
18761
|
+
className: classNames66(
|
|
18741
18762
|
"space-y-2 bg-eui-primary-300/10 p-2",
|
|
18742
18763
|
shapes[resolvedShape]
|
|
18743
18764
|
),
|
|
@@ -18757,7 +18778,7 @@ var InputListGroup = ({
|
|
|
18757
18778
|
ref: provided2.innerRef,
|
|
18758
18779
|
...draggableProps,
|
|
18759
18780
|
style: draggableStyle,
|
|
18760
|
-
className:
|
|
18781
|
+
className: classNames66(
|
|
18761
18782
|
"flex items-center gap-2 bg-eui-primary-300/10 p-2",
|
|
18762
18783
|
shapes[resolvedShape]
|
|
18763
18784
|
),
|
|
@@ -18768,7 +18789,7 @@ var InputListGroup = ({
|
|
|
18768
18789
|
{
|
|
18769
18790
|
name: `${itemsFieldName}[${itemIndex}]`,
|
|
18770
18791
|
placeholder: `Item ${itemIndex + 1}`,
|
|
18771
|
-
className:
|
|
18792
|
+
className: classNames66(
|
|
18772
18793
|
"h-[40px] w-full border bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none",
|
|
18773
18794
|
shapes[resolvedShape],
|
|
18774
18795
|
"border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18982,7 +19003,7 @@ var DateSelector = ({
|
|
|
18982
19003
|
...field,
|
|
18983
19004
|
...props,
|
|
18984
19005
|
placeholder,
|
|
18985
|
-
className:
|
|
19006
|
+
className: classNames66({
|
|
18986
19007
|
"border border-eui-primary-400 peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
|
|
18987
19008
|
"border-eui-danger-500": meta.touched && meta.error,
|
|
18988
19009
|
"transition-all ease-in-out": true,
|
|
@@ -19091,7 +19112,7 @@ var ImageInput = forwardRef(
|
|
|
19091
19112
|
/* @__PURE__ */ jsxs(
|
|
19092
19113
|
"label",
|
|
19093
19114
|
{
|
|
19094
|
-
className:
|
|
19115
|
+
className: classNames66({
|
|
19095
19116
|
"border-2 border-dashed border-gray-700 bg-gray-900 h-[200px] w-[300px] flex flex-col gap-2 items-center justify-center group": true,
|
|
19096
19117
|
"hover:cursor-pointer hover:border-solid hover:border-gray-600 hover:bg-gray-900/80": true,
|
|
19097
19118
|
"transition-all ease-in-out duration-150": true
|
|
@@ -19208,7 +19229,7 @@ function Radio({
|
|
|
19208
19229
|
return /* @__PURE__ */ jsxs(
|
|
19209
19230
|
"div",
|
|
19210
19231
|
{
|
|
19211
|
-
className:
|
|
19232
|
+
className: classNames66({
|
|
19212
19233
|
"flex flex-row gap-2 items-center mx-1 my-2": true
|
|
19213
19234
|
}),
|
|
19214
19235
|
children: [
|
|
@@ -19221,7 +19242,7 @@ function Radio({
|
|
|
19221
19242
|
...props,
|
|
19222
19243
|
value: option.value,
|
|
19223
19244
|
checked: field2.value === option.value,
|
|
19224
|
-
className:
|
|
19245
|
+
className: classNames66({
|
|
19225
19246
|
"appearance-none w-4 h-4 border-2 border-eui-primary-400 rounded-full cursor-pointer transition-all duration-300": true,
|
|
19226
19247
|
// base radio button styles
|
|
19227
19248
|
"checked:bg-eui-secondary-700 checked:border-eui-primary-400": field2.value === option.value
|
|
@@ -19233,7 +19254,7 @@ function Radio({
|
|
|
19233
19254
|
"label",
|
|
19234
19255
|
{
|
|
19235
19256
|
htmlFor: option.value,
|
|
19236
|
-
className:
|
|
19257
|
+
className: classNames66({
|
|
19237
19258
|
"eui-text-md text-sm": true
|
|
19238
19259
|
}),
|
|
19239
19260
|
children: option.label
|
|
@@ -19276,7 +19297,7 @@ function StarRatingInput({
|
|
|
19276
19297
|
return /* @__PURE__ */ jsxs(
|
|
19277
19298
|
"div",
|
|
19278
19299
|
{
|
|
19279
|
-
className:
|
|
19300
|
+
className: classNames66({
|
|
19280
19301
|
"inline-flex gap-[4px] text-[20px]": true,
|
|
19281
19302
|
[`${styles}`]: styles
|
|
19282
19303
|
}),
|
|
@@ -19289,7 +19310,7 @@ function StarRatingInput({
|
|
|
19289
19310
|
onClick: () => handleOnClick(index),
|
|
19290
19311
|
onMouseEnter: () => setHover(index),
|
|
19291
19312
|
onMouseLeave: () => setHover(null),
|
|
19292
|
-
className:
|
|
19313
|
+
className: classNames66({
|
|
19293
19314
|
"text-yellow-600": index <= (hover ?? rating - 1),
|
|
19294
19315
|
"text-gray-400": index > (hover ?? rating - 1)
|
|
19295
19316
|
}),
|
|
@@ -19333,7 +19354,7 @@ function Select({
|
|
|
19333
19354
|
{
|
|
19334
19355
|
as: "select",
|
|
19335
19356
|
...props,
|
|
19336
|
-
className:
|
|
19357
|
+
className: classNames66({
|
|
19337
19358
|
"border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
|
|
19338
19359
|
"border-eui-primary-400": !(meta.touched && meta.error),
|
|
19339
19360
|
"border-red-500": meta.touched && meta.error,
|
|
@@ -19385,7 +19406,7 @@ function Switch({
|
|
|
19385
19406
|
"div",
|
|
19386
19407
|
{
|
|
19387
19408
|
onClick: () => helpers.setValue(!field.value),
|
|
19388
|
-
className:
|
|
19409
|
+
className: classNames66(
|
|
19389
19410
|
"w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-eui-dark-100",
|
|
19390
19411
|
"peer-checked:after:translate-x-full peer-checked:after:border-white",
|
|
19391
19412
|
"after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white",
|
|
@@ -19442,7 +19463,7 @@ function Tags({
|
|
|
19442
19463
|
/* @__PURE__ */ jsxs(
|
|
19443
19464
|
"div",
|
|
19444
19465
|
{
|
|
19445
|
-
className:
|
|
19466
|
+
className: classNames66(
|
|
19446
19467
|
"border rounded-sm flex flex-wrap items-center gap-2 px-2 pt-2 pb-6 min-h-[3rem]",
|
|
19447
19468
|
{
|
|
19448
19469
|
"bg-eui-primary-300/10 eui-text-md": true,
|
|
@@ -19490,7 +19511,7 @@ function Tags({
|
|
|
19490
19511
|
InputLabel_default,
|
|
19491
19512
|
{
|
|
19492
19513
|
text: placeholder,
|
|
19493
|
-
styles:
|
|
19514
|
+
styles: classNames66(
|
|
19494
19515
|
"absolute left-2 transition-all pointer-events-none text-eui-dark-200",
|
|
19495
19516
|
input.length > 0 || field.value.length > 0 ? "top-[2px] text-[13.5px]" : "top-3 text-base"
|
|
19496
19517
|
)
|
|
@@ -19531,7 +19552,7 @@ function TextArea({
|
|
|
19531
19552
|
as: "textarea",
|
|
19532
19553
|
...field,
|
|
19533
19554
|
...props,
|
|
19534
|
-
className:
|
|
19555
|
+
className: classNames66({
|
|
19535
19556
|
"border peer w-full bg-eui-primary-300/10 eui-text-md outline-none px-3 py-5 resize-none focus:resize-none focus:outline-none": true,
|
|
19536
19557
|
"transition-all ease-in-out": true,
|
|
19537
19558
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
@@ -19545,7 +19566,7 @@ function TextArea({
|
|
|
19545
19566
|
InputLabel_default,
|
|
19546
19567
|
{
|
|
19547
19568
|
text: placeholder,
|
|
19548
|
-
styles:
|
|
19569
|
+
styles: classNames66(
|
|
19549
19570
|
"absolute left-2 transition-all pointer-events-none text-eui-dark-200",
|
|
19550
19571
|
field.value ? "top-[2px] text-[13.5px]" : "top-3 text-base"
|
|
19551
19572
|
)
|
|
@@ -19574,7 +19595,7 @@ var ContentArea = forwardRef(
|
|
|
19574
19595
|
"div",
|
|
19575
19596
|
{
|
|
19576
19597
|
ref,
|
|
19577
|
-
className:
|
|
19598
|
+
className: classNames66({
|
|
19578
19599
|
"min-h-screen h-full w-full transition-all duration-[200ms]": true,
|
|
19579
19600
|
"py-3 px-5": !enablePadding,
|
|
19580
19601
|
"py-3 px-5 lg:px-[150px]": enablePadding,
|
|
@@ -19591,7 +19612,7 @@ function FlexCol({ children, gap = 3, styles }) {
|
|
|
19591
19612
|
return /* @__PURE__ */ jsx(
|
|
19592
19613
|
"div",
|
|
19593
19614
|
{
|
|
19594
|
-
className:
|
|
19615
|
+
className: classNames66({
|
|
19595
19616
|
[`flex flex-col gap-${gap}`]: true,
|
|
19596
19617
|
[`${styles}`]: styles
|
|
19597
19618
|
}),
|
|
@@ -19604,7 +19625,7 @@ function FlexRow({ children, gap = 3, styles }) {
|
|
|
19604
19625
|
return /* @__PURE__ */ jsx(
|
|
19605
19626
|
"div",
|
|
19606
19627
|
{
|
|
19607
|
-
className:
|
|
19628
|
+
className: classNames66({
|
|
19608
19629
|
[`flex flex-row gap-${gap}`]: true,
|
|
19609
19630
|
[`${styles}`]: styles
|
|
19610
19631
|
}),
|
|
@@ -19623,7 +19644,7 @@ function Grid({ children, styles }) {
|
|
|
19623
19644
|
return /* @__PURE__ */ jsx(
|
|
19624
19645
|
"div",
|
|
19625
19646
|
{
|
|
19626
|
-
className:
|
|
19647
|
+
className: classNames66({
|
|
19627
19648
|
[`grid`]: true,
|
|
19628
19649
|
[`${styles}`]: styles
|
|
19629
19650
|
}),
|
|
@@ -19640,7 +19661,7 @@ var Layout = ({
|
|
|
19640
19661
|
return /* @__PURE__ */ jsx(
|
|
19641
19662
|
"div",
|
|
19642
19663
|
{
|
|
19643
|
-
className:
|
|
19664
|
+
className: classNames66({
|
|
19644
19665
|
// "flex h-full w-screen bg-gray-100 overflow-auto": true,
|
|
19645
19666
|
"flex bg-eui-light-600": true,
|
|
19646
19667
|
"flex-col": flexDirection === "vertical",
|
|
@@ -19659,7 +19680,7 @@ var Header = ({
|
|
|
19659
19680
|
return /* @__PURE__ */ jsx(
|
|
19660
19681
|
"div",
|
|
19661
19682
|
{
|
|
19662
|
-
className:
|
|
19683
|
+
className: classNames66({
|
|
19663
19684
|
static: position === "static",
|
|
19664
19685
|
fixed: position === "fixed",
|
|
19665
19686
|
sticky: position === "sticky",
|
|
@@ -19699,7 +19720,7 @@ var Content = ({
|
|
|
19699
19720
|
return /* @__PURE__ */ jsx(
|
|
19700
19721
|
"div",
|
|
19701
19722
|
{
|
|
19702
|
-
className:
|
|
19723
|
+
className: classNames66({
|
|
19703
19724
|
"w-full min-h-screen transition-all duration-200 eui-bg-sm": true,
|
|
19704
19725
|
"md:pl-[300px]": !overlayedSidebar && sidebarVisible && !isMobile,
|
|
19705
19726
|
// Shift when sidebar is open (desktop)
|
|
@@ -19715,7 +19736,7 @@ var Footer = ({ children, styles }) => {
|
|
|
19715
19736
|
return /* @__PURE__ */ jsx(
|
|
19716
19737
|
"div",
|
|
19717
19738
|
{
|
|
19718
|
-
className:
|
|
19739
|
+
className: classNames66({
|
|
19719
19740
|
"bottom-0 w-full h-fit": true,
|
|
19720
19741
|
"border-t border-eui-dark-500/40 dark:border-eui-secondary-800 eui-bg-md": !styles,
|
|
19721
19742
|
[`${styles}`]: styles
|
|
@@ -19788,269 +19809,6 @@ function BlockGroup({
|
|
|
19788
19809
|
] });
|
|
19789
19810
|
}
|
|
19790
19811
|
var BlockGroup_default = BlockGroup;
|
|
19791
|
-
var useTheme = () => {
|
|
19792
|
-
const context = useContext(ThemeContext);
|
|
19793
|
-
if (!context) {
|
|
19794
|
-
throw new Error("useTheme must be used within a ThemeProvider");
|
|
19795
|
-
}
|
|
19796
|
-
return context;
|
|
19797
|
-
};
|
|
19798
|
-
var useTheme_default = useTheme;
|
|
19799
|
-
function MarkdownEditor({
|
|
19800
|
-
styles,
|
|
19801
|
-
...props
|
|
19802
|
-
}) {
|
|
19803
|
-
const [field, meta, helpers] = useField(props);
|
|
19804
|
-
const { theme } = useTheme_default();
|
|
19805
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
19806
|
-
/* @__PURE__ */ jsx("div", { className: classNames17(theme === "dark" ? "dark" : "", styles), children: /* @__PURE__ */ jsx(
|
|
19807
|
-
MDXEditor,
|
|
19808
|
-
{
|
|
19809
|
-
markdown: field.value,
|
|
19810
|
-
onChange: (val) => helpers.setValue(val),
|
|
19811
|
-
className: "rounded border border-gray-300 dark:border-gray-700",
|
|
19812
|
-
plugins: [
|
|
19813
|
-
headingsPlugin(),
|
|
19814
|
-
linkPlugin(),
|
|
19815
|
-
listsPlugin(),
|
|
19816
|
-
imagePlugin(),
|
|
19817
|
-
tablePlugin(),
|
|
19818
|
-
linkDialogPlugin({}),
|
|
19819
|
-
thematicBreakPlugin(),
|
|
19820
|
-
quotePlugin(),
|
|
19821
|
-
toolbarPlugin({
|
|
19822
|
-
toolbarContents: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19823
|
-
/* @__PURE__ */ jsx(UndoRedo, {}),
|
|
19824
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
19825
|
-
/* @__PURE__ */ jsx(BlockTypeSelect, {}),
|
|
19826
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
19827
|
-
/* @__PURE__ */ jsx(BoldItalicUnderlineToggles, {}),
|
|
19828
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
19829
|
-
/* @__PURE__ */ jsx(StrikeThroughSupSubToggles, {}),
|
|
19830
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
19831
|
-
/* @__PURE__ */ jsx(ListsToggle, {}),
|
|
19832
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
19833
|
-
/* @__PURE__ */ jsx(CreateLink, {}),
|
|
19834
|
-
/* @__PURE__ */ jsx(InsertImage, {}),
|
|
19835
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
19836
|
-
/* @__PURE__ */ jsx(InsertTable, {}),
|
|
19837
|
-
/* @__PURE__ */ jsx(InsertThematicBreak, {})
|
|
19838
|
-
] })
|
|
19839
|
-
})
|
|
19840
|
-
]
|
|
19841
|
-
}
|
|
19842
|
-
) }),
|
|
19843
|
-
/* @__PURE__ */ jsx(
|
|
19844
|
-
InputResponse_default,
|
|
19845
|
-
{
|
|
19846
|
-
name: field.name,
|
|
19847
|
-
visibility: meta.touched && meta.error ? true : false,
|
|
19848
|
-
variant: "danger"
|
|
19849
|
-
}
|
|
19850
|
-
)
|
|
19851
|
-
] });
|
|
19852
|
-
}
|
|
19853
|
-
var MarkdownEditor_default = MarkdownEditor;
|
|
19854
|
-
var MarkdownContext = createContext(null);
|
|
19855
|
-
|
|
19856
|
-
// src/components/markdown/hooks/useMarkdown.tsx
|
|
19857
|
-
function useMarkdown() {
|
|
19858
|
-
return useContext(MarkdownContext);
|
|
19859
|
-
}
|
|
19860
|
-
|
|
19861
|
-
// src/components/markdown/utils/generateHeadingNumbers.ts
|
|
19862
|
-
function generateHeadingNumbers(headings) {
|
|
19863
|
-
const counters = [0, 0, 0, 0, 0, 0];
|
|
19864
|
-
return headings.map((heading) => {
|
|
19865
|
-
const level = heading.level;
|
|
19866
|
-
counters[level - 1]++;
|
|
19867
|
-
for (let i = level; i < counters.length; i++) {
|
|
19868
|
-
counters[i] = 0;
|
|
19869
|
-
}
|
|
19870
|
-
const numbering = counters.slice(0, level).filter((n) => n > 0).join(".");
|
|
19871
|
-
return {
|
|
19872
|
-
...heading,
|
|
19873
|
-
numbering
|
|
19874
|
-
};
|
|
19875
|
-
});
|
|
19876
|
-
}
|
|
19877
|
-
|
|
19878
|
-
// src/components/markdown/utils/sanitizeHeading.ts
|
|
19879
|
-
function sanitizeHeading(text) {
|
|
19880
|
-
return text.replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu, "").replace(/\s+/g, " ").trim();
|
|
19881
|
-
}
|
|
19882
|
-
function MarkdownTOC({ title = "Table of Contents" }) {
|
|
19883
|
-
const context = useMarkdown();
|
|
19884
|
-
if (!context) {
|
|
19885
|
-
return null;
|
|
19886
|
-
}
|
|
19887
|
-
const { headings, activeHeading } = context;
|
|
19888
|
-
const numberedHeadings = generateHeadingNumbers(headings);
|
|
19889
|
-
const scrollToHeading = (id) => {
|
|
19890
|
-
const element = document.getElementById(id);
|
|
19891
|
-
if (!element) return;
|
|
19892
|
-
element.scrollIntoView({
|
|
19893
|
-
behavior: "smooth",
|
|
19894
|
-
block: "start"
|
|
19895
|
-
});
|
|
19896
|
-
};
|
|
19897
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
19898
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
19899
|
-
"h2",
|
|
19900
|
-
{
|
|
19901
|
-
className: "\n text-sm\n font-semibold\n uppercase\n tracking-wide\n text-gray-900\n dark:text-gray-100\n ",
|
|
19902
|
-
children: title
|
|
19903
|
-
}
|
|
19904
|
-
) }),
|
|
19905
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: numberedHeadings.map((heading) => /* @__PURE__ */ jsxs(
|
|
19906
|
-
"button",
|
|
19907
|
-
{
|
|
19908
|
-
onClick: () => scrollToHeading(heading.id),
|
|
19909
|
-
className: classNames17(
|
|
19910
|
-
"block w-full text-left text-sm transition-all ease-in-out duration-150",
|
|
19911
|
-
"hover:text-primary",
|
|
19912
|
-
activeHeading === heading.id ? "text-primary font-semibold underline" : "text-gray-500 dark:text-gray-400"
|
|
19913
|
-
),
|
|
19914
|
-
style: {
|
|
19915
|
-
paddingLeft: `${(heading.level - 1) * 12}px`
|
|
19916
|
-
},
|
|
19917
|
-
children: [
|
|
19918
|
-
/* @__PURE__ */ jsx("span", { className: "mr-2 opacity-70", children: heading.numbering }),
|
|
19919
|
-
/* @__PURE__ */ jsx("span", { children: sanitizeHeading(heading.text) })
|
|
19920
|
-
]
|
|
19921
|
-
},
|
|
19922
|
-
heading.id
|
|
19923
|
-
)) })
|
|
19924
|
-
] });
|
|
19925
|
-
}
|
|
19926
|
-
var MarkdownTOC_default = MarkdownTOC;
|
|
19927
|
-
function MarkdownViewer({ value }) {
|
|
19928
|
-
const { theme } = useTheme_default();
|
|
19929
|
-
const context = useMarkdown();
|
|
19930
|
-
const markdown = value ?? context?.markdown ?? "";
|
|
19931
|
-
const headings = context?.headings ?? [];
|
|
19932
|
-
const setActiveHeading = context?.setActiveHeading;
|
|
19933
|
-
useEffect(() => {
|
|
19934
|
-
const timeout = setTimeout(() => {
|
|
19935
|
-
headings.forEach((heading) => {
|
|
19936
|
-
const headingEls = document.querySelectorAll("h1,h2,h3,h4,h5,h6");
|
|
19937
|
-
headingEls.forEach((el) => {
|
|
19938
|
-
if (el.textContent?.trim() === heading.text.trim()) {
|
|
19939
|
-
el.id = heading.id;
|
|
19940
|
-
}
|
|
19941
|
-
});
|
|
19942
|
-
});
|
|
19943
|
-
if (!setActiveHeading) return;
|
|
19944
|
-
const observer = new IntersectionObserver(
|
|
19945
|
-
(entries) => {
|
|
19946
|
-
entries.forEach((entry) => {
|
|
19947
|
-
if (entry.isIntersecting) {
|
|
19948
|
-
setActiveHeading(entry.target.id);
|
|
19949
|
-
}
|
|
19950
|
-
});
|
|
19951
|
-
},
|
|
19952
|
-
{
|
|
19953
|
-
rootMargin: "-20% 0px -70% 0px"
|
|
19954
|
-
}
|
|
19955
|
-
);
|
|
19956
|
-
headings.forEach((heading) => {
|
|
19957
|
-
const el = document.getElementById(heading.id);
|
|
19958
|
-
if (el) {
|
|
19959
|
-
observer.observe(el);
|
|
19960
|
-
}
|
|
19961
|
-
});
|
|
19962
|
-
return () => observer.disconnect();
|
|
19963
|
-
}, 0);
|
|
19964
|
-
return () => clearTimeout(timeout);
|
|
19965
|
-
}, [headings, setActiveHeading]);
|
|
19966
|
-
return /* @__PURE__ */ jsx("div", { className: theme === "dark" ? "dark" : "", children: /* @__PURE__ */ jsx(
|
|
19967
|
-
MDXEditor,
|
|
19968
|
-
{
|
|
19969
|
-
markdown,
|
|
19970
|
-
readOnly: true,
|
|
19971
|
-
className: "markdown-body max-w-none",
|
|
19972
|
-
plugins: [
|
|
19973
|
-
headingsPlugin(),
|
|
19974
|
-
linkPlugin(),
|
|
19975
|
-
listsPlugin(),
|
|
19976
|
-
imagePlugin(),
|
|
19977
|
-
tablePlugin(),
|
|
19978
|
-
quotePlugin(),
|
|
19979
|
-
thematicBreakPlugin(),
|
|
19980
|
-
linkDialogPlugin({}),
|
|
19981
|
-
markdownShortcutPlugin(),
|
|
19982
|
-
frontmatterPlugin(),
|
|
19983
|
-
codeBlockPlugin({
|
|
19984
|
-
defaultCodeBlockLanguage: "txt",
|
|
19985
|
-
codeBlockEditorDescriptors: []
|
|
19986
|
-
}),
|
|
19987
|
-
codeMirrorPlugin({
|
|
19988
|
-
codeBlockLanguages: {
|
|
19989
|
-
js: "JavaScript",
|
|
19990
|
-
ts: "TypeScript",
|
|
19991
|
-
jsx: "React JSX",
|
|
19992
|
-
tsx: "React TSX",
|
|
19993
|
-
html: "HTML",
|
|
19994
|
-
css: "CSS",
|
|
19995
|
-
scss: "SCSS",
|
|
19996
|
-
json: "JSON",
|
|
19997
|
-
bash: "Bash",
|
|
19998
|
-
shell: "Shell",
|
|
19999
|
-
zsh: "ZSH",
|
|
20000
|
-
yaml: "YAML",
|
|
20001
|
-
yml: "YAML",
|
|
20002
|
-
md: "Markdown",
|
|
20003
|
-
py: "Python",
|
|
20004
|
-
java: "Java",
|
|
20005
|
-
cpp: "C++",
|
|
20006
|
-
c: "C",
|
|
20007
|
-
go: "Go",
|
|
20008
|
-
rust: "Rust",
|
|
20009
|
-
php: "PHP",
|
|
20010
|
-
sql: "SQL"
|
|
20011
|
-
}
|
|
20012
|
-
})
|
|
20013
|
-
]
|
|
20014
|
-
},
|
|
20015
|
-
markdown
|
|
20016
|
-
) });
|
|
20017
|
-
}
|
|
20018
|
-
var MarkdownViewer_default = MarkdownViewer;
|
|
20019
|
-
|
|
20020
|
-
// src/components/markdown/utils/slugify.ts
|
|
20021
|
-
function slugify(text) {
|
|
20022
|
-
return text.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-");
|
|
20023
|
-
}
|
|
20024
|
-
|
|
20025
|
-
// src/components/markdown/utils/extractHeadings.ts
|
|
20026
|
-
function extractHeadings(markdown) {
|
|
20027
|
-
return markdown.split("\n").filter((line) => /^#{1,6}\s/.test(line)).map((line) => {
|
|
20028
|
-
const level = line.match(/^#+/)?.[0].length || 1;
|
|
20029
|
-
const text = line.replace(/^#{1,6}\s/, "");
|
|
20030
|
-
return {
|
|
20031
|
-
id: slugify(text),
|
|
20032
|
-
text,
|
|
20033
|
-
level
|
|
20034
|
-
};
|
|
20035
|
-
});
|
|
20036
|
-
}
|
|
20037
|
-
function MarkdownProvider({ markdown, children }) {
|
|
20038
|
-
const [activeHeading, setActiveHeading] = useState("");
|
|
20039
|
-
const headings = useMemo(() => extractHeadings(markdown), [markdown]);
|
|
20040
|
-
return /* @__PURE__ */ jsx(
|
|
20041
|
-
MarkdownContext.Provider,
|
|
20042
|
-
{
|
|
20043
|
-
value: {
|
|
20044
|
-
markdown,
|
|
20045
|
-
headings,
|
|
20046
|
-
activeHeading,
|
|
20047
|
-
setActiveHeading
|
|
20048
|
-
},
|
|
20049
|
-
children
|
|
20050
|
-
}
|
|
20051
|
-
);
|
|
20052
|
-
}
|
|
20053
|
-
var MarkdownProvider_default = MarkdownProvider;
|
|
20054
19812
|
function BreadcrumbItem({
|
|
20055
19813
|
title,
|
|
20056
19814
|
href = "#",
|
|
@@ -20062,7 +19820,7 @@ function BreadcrumbItem({
|
|
|
20062
19820
|
{
|
|
20063
19821
|
href,
|
|
20064
19822
|
onClick,
|
|
20065
|
-
className:
|
|
19823
|
+
className: classNames66({
|
|
20066
19824
|
"text-lg font-semibold": true,
|
|
20067
19825
|
"text-gray-400 hover:text-gray-600 cursor-pointer": !active,
|
|
20068
19826
|
"text-eui-light-800": active,
|
|
@@ -20139,7 +19897,7 @@ var Breadcrumb = ({
|
|
|
20139
19897
|
index < resolvedData.length - 1 && /* @__PURE__ */ jsx(
|
|
20140
19898
|
"span",
|
|
20141
19899
|
{
|
|
20142
|
-
className:
|
|
19900
|
+
className: classNames66({
|
|
20143
19901
|
"text-lg font-semibold text-gray-500": true,
|
|
20144
19902
|
[`px-${gap}`]: gap
|
|
20145
19903
|
}),
|
|
@@ -20153,7 +19911,7 @@ var Breadcrumb = ({
|
|
|
20153
19911
|
return /* @__PURE__ */ jsx(
|
|
20154
19912
|
"div",
|
|
20155
19913
|
{
|
|
20156
|
-
className:
|
|
19914
|
+
className: classNames66({
|
|
20157
19915
|
"inline-flex": true,
|
|
20158
19916
|
[`${styles}`]: styles
|
|
20159
19917
|
}),
|
|
@@ -20185,7 +19943,7 @@ var Drawer = ({
|
|
|
20185
19943
|
isMobile && showBackdrop && /* @__PURE__ */ jsx(TransitionFade_default, { visibility, leaveDuration: 200, children: /* @__PURE__ */ jsx(
|
|
20186
19944
|
"div",
|
|
20187
19945
|
{
|
|
20188
|
-
className:
|
|
19946
|
+
className: classNames66(
|
|
20189
19947
|
"fixed inset-0 bg-black/50 z-40",
|
|
20190
19948
|
backdropStyles
|
|
20191
19949
|
),
|
|
@@ -20196,7 +19954,7 @@ var Drawer = ({
|
|
|
20196
19954
|
"div",
|
|
20197
19955
|
{
|
|
20198
19956
|
style: drawerStyle,
|
|
20199
|
-
className:
|
|
19957
|
+
className: classNames66(
|
|
20200
19958
|
"fixed shadow-lg z-50",
|
|
20201
19959
|
{
|
|
20202
19960
|
"h-full w-[300px] top-0": isHorizontal && !hasOffset,
|
|
@@ -20225,7 +19983,7 @@ function DrawerToggler({
|
|
|
20225
19983
|
return /* @__PURE__ */ jsx(
|
|
20226
19984
|
"div",
|
|
20227
19985
|
{
|
|
20228
|
-
className:
|
|
19986
|
+
className: classNames66({
|
|
20229
19987
|
"text-xl p-3 cursor-pointer": true,
|
|
20230
19988
|
"transition-all ease-in-out": true,
|
|
20231
19989
|
"text-eui-dark-500 dark:text-eui-secondary-600": !styles,
|
|
@@ -20273,7 +20031,7 @@ function FooterNav({ data = [], styles }) {
|
|
|
20273
20031
|
childrenContent = /* @__PURE__ */ jsx(
|
|
20274
20032
|
"div",
|
|
20275
20033
|
{
|
|
20276
|
-
className:
|
|
20034
|
+
className: classNames66({
|
|
20277
20035
|
"grid w-full": true,
|
|
20278
20036
|
"grid-cols-1": isMobile,
|
|
20279
20037
|
"grid-cols-3": !isMobile,
|
|
@@ -20286,7 +20044,7 @@ function FooterNav({ data = [], styles }) {
|
|
|
20286
20044
|
return /* @__PURE__ */ jsx(
|
|
20287
20045
|
"div",
|
|
20288
20046
|
{
|
|
20289
|
-
className:
|
|
20047
|
+
className: classNames66({
|
|
20290
20048
|
[`${styles}`]: styles
|
|
20291
20049
|
}),
|
|
20292
20050
|
children: childrenContent
|
|
@@ -20327,7 +20085,7 @@ var FooterNavGroup = ({
|
|
|
20327
20085
|
/* @__PURE__ */ jsx(
|
|
20328
20086
|
"div",
|
|
20329
20087
|
{
|
|
20330
|
-
className:
|
|
20088
|
+
className: classNames66({
|
|
20331
20089
|
"": true,
|
|
20332
20090
|
"py-2 font-semibold eui-text-lg": !styles,
|
|
20333
20091
|
[`${styles}`]: styles
|
|
@@ -20372,7 +20130,7 @@ var FooterNavItem = ({
|
|
|
20372
20130
|
"div",
|
|
20373
20131
|
{
|
|
20374
20132
|
onClick: handleNavigation,
|
|
20375
|
-
className:
|
|
20133
|
+
className: classNames66({
|
|
20376
20134
|
"flex flex-row items-center gap-3 cursor-pointer p-1 w-full": true,
|
|
20377
20135
|
"transition-all duration-200 ease-in-out": true,
|
|
20378
20136
|
"text-sm eui-text-sm": !styles,
|
|
@@ -20401,7 +20159,7 @@ var FooterNavItemTitle = ({
|
|
|
20401
20159
|
return /* @__PURE__ */ jsx(
|
|
20402
20160
|
"div",
|
|
20403
20161
|
{
|
|
20404
|
-
className:
|
|
20162
|
+
className: classNames66({
|
|
20405
20163
|
"": true,
|
|
20406
20164
|
"py-2 font-thin eui-text-md": !styles,
|
|
20407
20165
|
[`${styles}`]: styles
|
|
@@ -20454,7 +20212,7 @@ function HeaderNav({ data = [], styles }) {
|
|
|
20454
20212
|
return /* @__PURE__ */ jsx(
|
|
20455
20213
|
"div",
|
|
20456
20214
|
{
|
|
20457
|
-
className:
|
|
20215
|
+
className: classNames66({
|
|
20458
20216
|
[`${styles}`]: styles
|
|
20459
20217
|
}),
|
|
20460
20218
|
children: childrenContent
|
|
@@ -20516,7 +20274,7 @@ var HeaderNavGroup = ({
|
|
|
20516
20274
|
/* @__PURE__ */ jsxs(
|
|
20517
20275
|
"div",
|
|
20518
20276
|
{
|
|
20519
|
-
className:
|
|
20277
|
+
className: classNames66({
|
|
20520
20278
|
"flex flex-row gap-2 items-center justify-between cursor-pointer p-3 w-full": true,
|
|
20521
20279
|
"transition-all duration-300 ease-in-out": true,
|
|
20522
20280
|
"eui-text-md bg-gradient-to-t from-eui-dark-500/10 dark:from-green-700/10": !styles,
|
|
@@ -20544,7 +20302,7 @@ var HeaderNavGroup = ({
|
|
|
20544
20302
|
children && /* @__PURE__ */ jsx(
|
|
20545
20303
|
BsChevronDown,
|
|
20546
20304
|
{
|
|
20547
|
-
className:
|
|
20305
|
+
className: classNames66({
|
|
20548
20306
|
"text-md": true,
|
|
20549
20307
|
"transition-all ease-in-out duration-300": true,
|
|
20550
20308
|
"rotate-180": !collapsed
|
|
@@ -20557,7 +20315,7 @@ var HeaderNavGroup = ({
|
|
|
20557
20315
|
!collapsed && children && /* @__PURE__ */ jsx(
|
|
20558
20316
|
"div",
|
|
20559
20317
|
{
|
|
20560
|
-
className:
|
|
20318
|
+
className: classNames66({
|
|
20561
20319
|
"absolute min-w-80 left-0 top-full mt-1 border border-eui-dark-300/10 dark:border-eui-dark-300/50 shadow-lg eui-shadow-lg z-50 w-full eui-bg-md": true,
|
|
20562
20320
|
"transition-all duration-300 ease-in-out": true
|
|
20563
20321
|
}),
|
|
@@ -20587,7 +20345,7 @@ var HeaderNavItem = ({
|
|
|
20587
20345
|
"div",
|
|
20588
20346
|
{
|
|
20589
20347
|
onClick: handleNavigation,
|
|
20590
|
-
className:
|
|
20348
|
+
className: classNames66({
|
|
20591
20349
|
"flex flex-row items-center gap-3 cursor-pointer p-3 w-full": true,
|
|
20592
20350
|
"transition-all duration-200 ease-in-out": true,
|
|
20593
20351
|
"eui-text-md border-b border-eui-dark-500/20 dark:border-eui-secondary-900/20 bg-gradient-to-r from-eui-dark-500/10 dark:from-eui-secondary-900/10": !styles,
|
|
@@ -20616,7 +20374,7 @@ var HeaderNavItemTitle = ({
|
|
|
20616
20374
|
return /* @__PURE__ */ jsx(
|
|
20617
20375
|
"div",
|
|
20618
20376
|
{
|
|
20619
|
-
className:
|
|
20377
|
+
className: classNames66({
|
|
20620
20378
|
"p-3 font-thin": true,
|
|
20621
20379
|
"eui-text-md": !styles,
|
|
20622
20380
|
[`${styles}`]: styles
|
|
@@ -20656,7 +20414,7 @@ var Link = ({
|
|
|
20656
20414
|
href: href || "#",
|
|
20657
20415
|
target: targets[target],
|
|
20658
20416
|
onClick: handleClick,
|
|
20659
|
-
className:
|
|
20417
|
+
className: classNames66({
|
|
20660
20418
|
[`${textVariants[variant]}`]: variant,
|
|
20661
20419
|
[`${decorations[decoration]}`]: decoration,
|
|
20662
20420
|
"font-bold": bold,
|
|
@@ -21306,7 +21064,7 @@ function Modal({
|
|
|
21306
21064
|
"div",
|
|
21307
21065
|
{
|
|
21308
21066
|
ref: modalRef,
|
|
21309
|
-
className:
|
|
21067
|
+
className: classNames66(
|
|
21310
21068
|
"eui-bg-md eui-shadow-lg border border-gray-700/80 w-fit h-fit",
|
|
21311
21069
|
shapes[resolvedShape],
|
|
21312
21070
|
styles
|
|
@@ -21318,7 +21076,7 @@ function Modal({
|
|
|
21318
21076
|
"button",
|
|
21319
21077
|
{
|
|
21320
21078
|
type: "button",
|
|
21321
|
-
className:
|
|
21079
|
+
className: classNames66(
|
|
21322
21080
|
"w-[60px] h-[60px] flex items-center justify-center transition-standard-fast",
|
|
21323
21081
|
"hover:cursor-pointer hover:bg-eui-dark-500"
|
|
21324
21082
|
),
|
|
@@ -21452,7 +21210,7 @@ function ShowMore({ text, limit }) {
|
|
|
21452
21210
|
/* @__PURE__ */ jsx(
|
|
21453
21211
|
"div",
|
|
21454
21212
|
{
|
|
21455
|
-
className:
|
|
21213
|
+
className: classNames66({
|
|
21456
21214
|
"text-blue-300 px-1 pb-1 mt-1": true,
|
|
21457
21215
|
"bg-slate-900/70": !showMore,
|
|
21458
21216
|
"bg-gradient-to-t from-slate-900/50 to-transparent": showMore
|
|
@@ -21768,6 +21526,14 @@ var useModal = () => {
|
|
|
21768
21526
|
};
|
|
21769
21527
|
};
|
|
21770
21528
|
var useModal_default = useModal;
|
|
21529
|
+
var useTheme = () => {
|
|
21530
|
+
const context = useContext(ThemeContext);
|
|
21531
|
+
if (!context) {
|
|
21532
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
21533
|
+
}
|
|
21534
|
+
return context;
|
|
21535
|
+
};
|
|
21536
|
+
var useTheme_default = useTheme;
|
|
21771
21537
|
function CommentMenuItem({
|
|
21772
21538
|
icon,
|
|
21773
21539
|
name,
|
|
@@ -22343,11 +22109,78 @@ function DataViewTable({
|
|
|
22343
22109
|
);
|
|
22344
22110
|
}
|
|
22345
22111
|
var DataViewTable_default = DataViewTable;
|
|
22346
|
-
function
|
|
22347
|
-
|
|
22348
|
-
|
|
22349
|
-
|
|
22350
|
-
|
|
22112
|
+
function toCssSize(value) {
|
|
22113
|
+
if (typeof value === "number") return `${value}px`;
|
|
22114
|
+
return value;
|
|
22115
|
+
}
|
|
22116
|
+
function DocumentationPanel({
|
|
22117
|
+
value,
|
|
22118
|
+
toc = true,
|
|
22119
|
+
height = "100vh",
|
|
22120
|
+
viewerClassName,
|
|
22121
|
+
contentClassName,
|
|
22122
|
+
tocClassName,
|
|
22123
|
+
className,
|
|
22124
|
+
contentMaxWidthClassName = "max-w-4xl"
|
|
22125
|
+
}) {
|
|
22126
|
+
return /* @__PURE__ */ jsx(MarkdownProvider_default, { markdown: value, children: /* @__PURE__ */ jsxs(
|
|
22127
|
+
"section",
|
|
22128
|
+
{
|
|
22129
|
+
className: classNames66(
|
|
22130
|
+
"eui-documentation-panel",
|
|
22131
|
+
"min-h-0 overflow-hidden bg-white text-gray-900",
|
|
22132
|
+
"dark:bg-gray-950 dark:text-gray-100",
|
|
22133
|
+
toc ? "grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_280px]" : "grid grid-cols-1",
|
|
22134
|
+
className
|
|
22135
|
+
),
|
|
22136
|
+
style: {
|
|
22137
|
+
height: toCssSize(height)
|
|
22138
|
+
},
|
|
22139
|
+
children: [
|
|
22140
|
+
/* @__PURE__ */ jsx(
|
|
22141
|
+
"main",
|
|
22142
|
+
{
|
|
22143
|
+
className: classNames66(
|
|
22144
|
+
"eui-documentation-panel-viewer",
|
|
22145
|
+
"documentation-panel-scrollbar min-w-0 overflow-y-auto scroll-smooth",
|
|
22146
|
+
viewerClassName
|
|
22147
|
+
),
|
|
22148
|
+
children: /* @__PURE__ */ jsx(
|
|
22149
|
+
"div",
|
|
22150
|
+
{
|
|
22151
|
+
className: classNames66(
|
|
22152
|
+
"mx-auto px-5 py-8 sm:px-6 lg:px-8",
|
|
22153
|
+
contentMaxWidthClassName,
|
|
22154
|
+
contentClassName
|
|
22155
|
+
),
|
|
22156
|
+
children: /* @__PURE__ */ jsx(MarkdownViewer_default, {})
|
|
22157
|
+
}
|
|
22158
|
+
)
|
|
22159
|
+
}
|
|
22160
|
+
),
|
|
22161
|
+
toc ? /* @__PURE__ */ jsx(
|
|
22162
|
+
"aside",
|
|
22163
|
+
{
|
|
22164
|
+
className: classNames66(
|
|
22165
|
+
"eui-documentation-panel-toc",
|
|
22166
|
+
"hidden min-w-0 border-l border-gray-200 bg-white lg:block",
|
|
22167
|
+
"dark:border-gray-800 dark:bg-gray-950",
|
|
22168
|
+
tocClassName
|
|
22169
|
+
),
|
|
22170
|
+
children: /* @__PURE__ */ jsx(
|
|
22171
|
+
"div",
|
|
22172
|
+
{
|
|
22173
|
+
className: classNames66(
|
|
22174
|
+
"documentation-panel-scrollbar h-full overflow-y-auto px-5 py-8"
|
|
22175
|
+
),
|
|
22176
|
+
children: /* @__PURE__ */ jsx("div", { className: "sticky top-0", children: /* @__PURE__ */ jsx(MarkdownTOC_default, {}) })
|
|
22177
|
+
}
|
|
22178
|
+
)
|
|
22179
|
+
}
|
|
22180
|
+
) : null
|
|
22181
|
+
]
|
|
22182
|
+
}
|
|
22183
|
+
) });
|
|
22351
22184
|
}
|
|
22352
22185
|
var DocumentationPanel_default = DocumentationPanel;
|
|
22353
22186
|
function SliderItem({
|
|
@@ -22523,7 +22356,7 @@ function WorldMapCountryTable({
|
|
|
22523
22356
|
}) {
|
|
22524
22357
|
const enrichedData = useMemo(() => {
|
|
22525
22358
|
const mapped = data.map((item) => {
|
|
22526
|
-
const countryMeta = COUNTRIES.find((
|
|
22359
|
+
const countryMeta = COUNTRIES.find((c2) => c2.code === item.code);
|
|
22527
22360
|
return {
|
|
22528
22361
|
code: item.code,
|
|
22529
22362
|
value: item.value,
|
|
@@ -22613,7 +22446,7 @@ function BoxNavItem({ icon, name, to, selected, onClick }) {
|
|
|
22613
22446
|
type: "button",
|
|
22614
22447
|
onClick: handleClick,
|
|
22615
22448
|
"aria-current": selected ? "page" : void 0,
|
|
22616
|
-
className:
|
|
22449
|
+
className: classNames66(
|
|
22617
22450
|
"w-full min-w-[80px] flex flex-col items-center justify-center py-3 text-center",
|
|
22618
22451
|
"hover:text-secondary-700 hover:bg-gray-300/10 hover:cursor-pointer",
|
|
22619
22452
|
selected ? "text-eui-secondary-700 bg-gray-300/10" : "text-gray-400",
|
|
@@ -24522,6 +24355,2216 @@ function ReviewThread({
|
|
|
24522
24355
|
] });
|
|
24523
24356
|
}
|
|
24524
24357
|
var ReviewThread_default = ReviewThread;
|
|
24358
|
+
var MarkdownContext = createContext(null);
|
|
24359
|
+
|
|
24360
|
+
// src/compositions/markdown/utils/sanitizeHeading.ts
|
|
24361
|
+
function sanitizeHeading(text, options = {}) {
|
|
24362
|
+
const {
|
|
24363
|
+
removeMarkdownSyntax = true,
|
|
24364
|
+
removeHtmlTags = true,
|
|
24365
|
+
collapseWhitespace = true
|
|
24366
|
+
} = options;
|
|
24367
|
+
let value = String(text || "");
|
|
24368
|
+
if (removeHtmlTags) {
|
|
24369
|
+
value = value.replace(/<[^>]*>/g, "");
|
|
24370
|
+
}
|
|
24371
|
+
if (removeMarkdownSyntax) {
|
|
24372
|
+
value = value.replace(/!\[([^\]]*)\]\([^)]+\)/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\[([^\]]+)\]\[[^\]]+\]/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/[*_~]+/g, "").replace(/\\([\\`*{}\[\]()#+\-.!_>])/g, "$1");
|
|
24373
|
+
}
|
|
24374
|
+
value = value.replace(/[\u0000-\u001F\u007F]/g, "");
|
|
24375
|
+
if (collapseWhitespace) {
|
|
24376
|
+
value = value.replace(/\s+/g, " ");
|
|
24377
|
+
}
|
|
24378
|
+
return value.trim();
|
|
24379
|
+
}
|
|
24380
|
+
|
|
24381
|
+
// src/compositions/markdown/utils/createHeadingSlug.ts
|
|
24382
|
+
function escapeRegExp(value) {
|
|
24383
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
24384
|
+
}
|
|
24385
|
+
function createHeadingSlug(text, options = {}) {
|
|
24386
|
+
const {
|
|
24387
|
+
separator = "-",
|
|
24388
|
+
fallback = "heading",
|
|
24389
|
+
slugCounts,
|
|
24390
|
+
existingSlugs
|
|
24391
|
+
} = options;
|
|
24392
|
+
const escapedSeparator = escapeRegExp(separator);
|
|
24393
|
+
const sanitized = sanitizeHeading(text);
|
|
24394
|
+
const baseSlug = sanitized.toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}\s-]/gu, "").replace(/\s+/g, separator).replace(new RegExp(`${escapedSeparator}+`, "g"), separator).replace(new RegExp(`^${escapedSeparator}|${escapedSeparator}$`, "g"), "").trim() || fallback;
|
|
24395
|
+
if (slugCounts) {
|
|
24396
|
+
const count = slugCounts.get(baseSlug) ?? 0;
|
|
24397
|
+
slugCounts.set(baseSlug, count + 1);
|
|
24398
|
+
return count === 0 ? baseSlug : `${baseSlug}${separator}${count}`;
|
|
24399
|
+
}
|
|
24400
|
+
if (existingSlugs) {
|
|
24401
|
+
let slug = baseSlug;
|
|
24402
|
+
let count = 1;
|
|
24403
|
+
while (existingSlugs.has(slug)) {
|
|
24404
|
+
slug = `${baseSlug}${separator}${count}`;
|
|
24405
|
+
count++;
|
|
24406
|
+
}
|
|
24407
|
+
existingSlugs.add(slug);
|
|
24408
|
+
return slug;
|
|
24409
|
+
}
|
|
24410
|
+
return baseSlug;
|
|
24411
|
+
}
|
|
24412
|
+
function slugify(text) {
|
|
24413
|
+
return createHeadingSlug(text);
|
|
24414
|
+
}
|
|
24415
|
+
|
|
24416
|
+
// src/compositions/markdown/utils/normalizeMarkdown.ts
|
|
24417
|
+
function normalizeMarkdown(markdown, options = {}) {
|
|
24418
|
+
const {
|
|
24419
|
+
removeBom = true,
|
|
24420
|
+
normalizeLineEndings = true,
|
|
24421
|
+
trimStart = false,
|
|
24422
|
+
trimEnd = false,
|
|
24423
|
+
collapseBlankLines = false,
|
|
24424
|
+
finalNewline = false
|
|
24425
|
+
} = options;
|
|
24426
|
+
let value = String(markdown ?? "");
|
|
24427
|
+
if (removeBom) {
|
|
24428
|
+
value = value.replace(/^\uFEFF/, "");
|
|
24429
|
+
}
|
|
24430
|
+
if (normalizeLineEndings) {
|
|
24431
|
+
value = value.replace(/\r\n?/g, "\n");
|
|
24432
|
+
}
|
|
24433
|
+
if (trimStart) {
|
|
24434
|
+
value = value.trimStart();
|
|
24435
|
+
}
|
|
24436
|
+
if (trimEnd) {
|
|
24437
|
+
value = value.trimEnd();
|
|
24438
|
+
}
|
|
24439
|
+
if (collapseBlankLines) {
|
|
24440
|
+
value = value.replace(/\n{3,}/g, "\n\n");
|
|
24441
|
+
}
|
|
24442
|
+
if (finalNewline && value && !value.endsWith("\n")) {
|
|
24443
|
+
value += "\n";
|
|
24444
|
+
}
|
|
24445
|
+
return value;
|
|
24446
|
+
}
|
|
24447
|
+
|
|
24448
|
+
// src/compositions/markdown/utils/extractHeadings.ts
|
|
24449
|
+
function getFenceState(line) {
|
|
24450
|
+
const match = line.match(/^\s{0,3}(`{3,}|~{3,})/);
|
|
24451
|
+
if (!match) return null;
|
|
24452
|
+
const fence = match[1];
|
|
24453
|
+
return {
|
|
24454
|
+
marker: fence[0],
|
|
24455
|
+
length: fence.length
|
|
24456
|
+
};
|
|
24457
|
+
}
|
|
24458
|
+
function closesFence(line, fence) {
|
|
24459
|
+
const match = line.match(/^\s{0,3}(`{3,}|~{3,})\s*$/);
|
|
24460
|
+
if (!match) return false;
|
|
24461
|
+
const closingFence = match[1];
|
|
24462
|
+
return closingFence[0] === fence.marker && closingFence.length >= fence.length;
|
|
24463
|
+
}
|
|
24464
|
+
function isSetextUnderline(line) {
|
|
24465
|
+
if (/^\s{0,3}=+\s*$/.test(line)) {
|
|
24466
|
+
return 1;
|
|
24467
|
+
}
|
|
24468
|
+
if (/^\s{0,3}-+\s*$/.test(line)) {
|
|
24469
|
+
return 2;
|
|
24470
|
+
}
|
|
24471
|
+
return null;
|
|
24472
|
+
}
|
|
24473
|
+
function extractAtxHeading(line) {
|
|
24474
|
+
const match = line.match(/^\s{0,3}(#{1,6})(?:\s+|$)(.*)$/);
|
|
24475
|
+
if (!match) return null;
|
|
24476
|
+
const level = match[1].length;
|
|
24477
|
+
const rawText = match[2].replace(/\s+#+\s*$/, "").trim();
|
|
24478
|
+
return {
|
|
24479
|
+
level,
|
|
24480
|
+
text: sanitizeHeading(rawText)
|
|
24481
|
+
};
|
|
24482
|
+
}
|
|
24483
|
+
function extractHeadings(markdown, options = {}) {
|
|
24484
|
+
const {
|
|
24485
|
+
minDepth = 1,
|
|
24486
|
+
maxDepth = 6,
|
|
24487
|
+
includeSetextHeadings = true,
|
|
24488
|
+
idPrefix = ""
|
|
24489
|
+
} = options;
|
|
24490
|
+
const normalizedMarkdown = normalizeMarkdown(markdown);
|
|
24491
|
+
const lines = normalizedMarkdown.split("\n");
|
|
24492
|
+
const headings = [];
|
|
24493
|
+
const slugCounts = /* @__PURE__ */ new Map();
|
|
24494
|
+
let activeFence = null;
|
|
24495
|
+
for (let index = 0; index < lines.length; index++) {
|
|
24496
|
+
const line = lines[index];
|
|
24497
|
+
const fence = getFenceState(line);
|
|
24498
|
+
if (activeFence) {
|
|
24499
|
+
if (closesFence(line, activeFence)) {
|
|
24500
|
+
activeFence = null;
|
|
24501
|
+
}
|
|
24502
|
+
continue;
|
|
24503
|
+
}
|
|
24504
|
+
if (fence) {
|
|
24505
|
+
activeFence = fence;
|
|
24506
|
+
continue;
|
|
24507
|
+
}
|
|
24508
|
+
const atxHeading = extractAtxHeading(line);
|
|
24509
|
+
if (atxHeading) {
|
|
24510
|
+
const { level, text: text2 } = atxHeading;
|
|
24511
|
+
if (level >= minDepth && level <= maxDepth && text2) {
|
|
24512
|
+
const id = createHeadingSlug(text2, { slugCounts });
|
|
24513
|
+
headings.push({
|
|
24514
|
+
id: `${idPrefix}${id}`,
|
|
24515
|
+
text: text2,
|
|
24516
|
+
level
|
|
24517
|
+
});
|
|
24518
|
+
}
|
|
24519
|
+
continue;
|
|
24520
|
+
}
|
|
24521
|
+
if (!includeSetextHeadings) {
|
|
24522
|
+
continue;
|
|
24523
|
+
}
|
|
24524
|
+
const nextLine = lines[index + 1];
|
|
24525
|
+
if (!nextLine) {
|
|
24526
|
+
continue;
|
|
24527
|
+
}
|
|
24528
|
+
const setextLevel = isSetextUnderline(nextLine);
|
|
24529
|
+
if (!setextLevel) {
|
|
24530
|
+
continue;
|
|
24531
|
+
}
|
|
24532
|
+
const text = sanitizeHeading(line);
|
|
24533
|
+
if (!text) {
|
|
24534
|
+
continue;
|
|
24535
|
+
}
|
|
24536
|
+
if (setextLevel >= minDepth && setextLevel <= maxDepth) {
|
|
24537
|
+
const id = createHeadingSlug(text, { slugCounts });
|
|
24538
|
+
headings.push({
|
|
24539
|
+
id: `${idPrefix}${id}`,
|
|
24540
|
+
text,
|
|
24541
|
+
level: setextLevel
|
|
24542
|
+
});
|
|
24543
|
+
}
|
|
24544
|
+
index++;
|
|
24545
|
+
}
|
|
24546
|
+
return headings;
|
|
24547
|
+
}
|
|
24548
|
+
|
|
24549
|
+
// src/compositions/markdown/utils/generateHeadingNumbers.ts
|
|
24550
|
+
function generateHeadingNumbers(headings, options = {}) {
|
|
24551
|
+
const { minDepth = 1, maxDepth = 6, separator = "." } = options;
|
|
24552
|
+
const counters = [0, 0, 0, 0, 0, 0];
|
|
24553
|
+
return headings.filter((heading) => {
|
|
24554
|
+
return heading.level >= minDepth && heading.level <= maxDepth;
|
|
24555
|
+
}).map((heading) => {
|
|
24556
|
+
const level = Math.min(Math.max(heading.level, 1), 6);
|
|
24557
|
+
counters[level - 1]++;
|
|
24558
|
+
for (let index = level; index < counters.length; index++) {
|
|
24559
|
+
counters[index] = 0;
|
|
24560
|
+
}
|
|
24561
|
+
const numbering = counters.slice(0, level).filter((count) => count > 0).join(separator);
|
|
24562
|
+
return {
|
|
24563
|
+
...heading,
|
|
24564
|
+
numbering
|
|
24565
|
+
};
|
|
24566
|
+
});
|
|
24567
|
+
}
|
|
24568
|
+
function MarkdownProvider({
|
|
24569
|
+
children,
|
|
24570
|
+
markdown,
|
|
24571
|
+
value,
|
|
24572
|
+
headings: externalHeadings,
|
|
24573
|
+
meta,
|
|
24574
|
+
activeHeading: controlledActiveHeading,
|
|
24575
|
+
defaultActiveHeading = "",
|
|
24576
|
+
onActiveHeadingChange
|
|
24577
|
+
}) {
|
|
24578
|
+
const resolvedMarkdown = value ?? markdown ?? "";
|
|
24579
|
+
const [internalActiveHeading, setInternalActiveHeading] = useState(defaultActiveHeading);
|
|
24580
|
+
const headings = useMemo(() => {
|
|
24581
|
+
if (externalHeadings) {
|
|
24582
|
+
return externalHeadings;
|
|
24583
|
+
}
|
|
24584
|
+
return extractHeadings(resolvedMarkdown);
|
|
24585
|
+
}, [externalHeadings, resolvedMarkdown]);
|
|
24586
|
+
const numberedHeadings = useMemo(() => {
|
|
24587
|
+
return generateHeadingNumbers(headings);
|
|
24588
|
+
}, [headings]);
|
|
24589
|
+
const headingMap = useMemo(() => {
|
|
24590
|
+
return headings.reduce((acc, heading) => {
|
|
24591
|
+
acc[heading.id] = heading;
|
|
24592
|
+
return acc;
|
|
24593
|
+
}, {});
|
|
24594
|
+
}, [headings]);
|
|
24595
|
+
const activeHeading = controlledActiveHeading ?? internalActiveHeading;
|
|
24596
|
+
const getHeadingById = useCallback(
|
|
24597
|
+
(id) => {
|
|
24598
|
+
return headingMap[id];
|
|
24599
|
+
},
|
|
24600
|
+
[headingMap]
|
|
24601
|
+
);
|
|
24602
|
+
const setActiveHeading = useCallback(
|
|
24603
|
+
(id) => {
|
|
24604
|
+
if (controlledActiveHeading === void 0) {
|
|
24605
|
+
setInternalActiveHeading(id);
|
|
24606
|
+
}
|
|
24607
|
+
onActiveHeadingChange?.(id, headingMap[id]);
|
|
24608
|
+
},
|
|
24609
|
+
[controlledActiveHeading, headingMap, onActiveHeadingChange]
|
|
24610
|
+
);
|
|
24611
|
+
const contextValue = useMemo(
|
|
24612
|
+
() => ({
|
|
24613
|
+
markdown: resolvedMarkdown,
|
|
24614
|
+
headings,
|
|
24615
|
+
numberedHeadings,
|
|
24616
|
+
activeHeading,
|
|
24617
|
+
setActiveHeading,
|
|
24618
|
+
meta,
|
|
24619
|
+
getHeadingById
|
|
24620
|
+
}),
|
|
24621
|
+
[
|
|
24622
|
+
resolvedMarkdown,
|
|
24623
|
+
headings,
|
|
24624
|
+
numberedHeadings,
|
|
24625
|
+
activeHeading,
|
|
24626
|
+
setActiveHeading,
|
|
24627
|
+
meta,
|
|
24628
|
+
getHeadingById
|
|
24629
|
+
]
|
|
24630
|
+
);
|
|
24631
|
+
return /* @__PURE__ */ jsx(MarkdownContext.Provider, { value: contextValue, children });
|
|
24632
|
+
}
|
|
24633
|
+
var MarkdownProvider_default = MarkdownProvider;
|
|
24634
|
+
function useMarkdown(options = {}) {
|
|
24635
|
+
const { required = false, errorMessage } = options;
|
|
24636
|
+
const context = useContext(MarkdownContext);
|
|
24637
|
+
if (!context && required) {
|
|
24638
|
+
throw new Error(
|
|
24639
|
+
errorMessage || "useMarkdown must be used inside a MarkdownProvider."
|
|
24640
|
+
);
|
|
24641
|
+
}
|
|
24642
|
+
return context;
|
|
24643
|
+
}
|
|
24644
|
+
function useActiveHeading(options = {}) {
|
|
24645
|
+
const context = useMarkdown();
|
|
24646
|
+
const {
|
|
24647
|
+
headings: externalHeadings,
|
|
24648
|
+
activeHeading: controlledActiveHeading,
|
|
24649
|
+
defaultActiveHeading = "",
|
|
24650
|
+
enabled = true,
|
|
24651
|
+
root = null,
|
|
24652
|
+
rootMargin = "-20% 0px -70% 0px",
|
|
24653
|
+
threshold = 0,
|
|
24654
|
+
scrollBehavior = "smooth",
|
|
24655
|
+
scrollBlock = "start",
|
|
24656
|
+
onActiveHeadingChange
|
|
24657
|
+
} = options;
|
|
24658
|
+
const headings = externalHeadings ?? context?.headings ?? [];
|
|
24659
|
+
const [internalActiveHeading, setInternalActiveHeading] = useState(defaultActiveHeading);
|
|
24660
|
+
const activeHeading = controlledActiveHeading ?? context?.activeHeading ?? internalActiveHeading;
|
|
24661
|
+
const headingMap = useMemo(() => {
|
|
24662
|
+
return headings.reduce((acc, heading) => {
|
|
24663
|
+
acc[heading.id] = heading;
|
|
24664
|
+
return acc;
|
|
24665
|
+
}, {});
|
|
24666
|
+
}, [headings]);
|
|
24667
|
+
const setActiveHeading = useCallback(
|
|
24668
|
+
(id) => {
|
|
24669
|
+
if (controlledActiveHeading === void 0 && !context) {
|
|
24670
|
+
setInternalActiveHeading(id);
|
|
24671
|
+
}
|
|
24672
|
+
context?.setActiveHeading(id);
|
|
24673
|
+
onActiveHeadingChange?.(id, headingMap[id]);
|
|
24674
|
+
},
|
|
24675
|
+
[context, controlledActiveHeading, headingMap, onActiveHeadingChange]
|
|
24676
|
+
);
|
|
24677
|
+
const scrollToHeading = useCallback(
|
|
24678
|
+
(id) => {
|
|
24679
|
+
if (typeof document === "undefined") return;
|
|
24680
|
+
const element = document.getElementById(id);
|
|
24681
|
+
if (!element) return;
|
|
24682
|
+
element.scrollIntoView({
|
|
24683
|
+
behavior: scrollBehavior,
|
|
24684
|
+
block: scrollBlock
|
|
24685
|
+
});
|
|
24686
|
+
setActiveHeading(id);
|
|
24687
|
+
},
|
|
24688
|
+
[scrollBehavior, scrollBlock, setActiveHeading]
|
|
24689
|
+
);
|
|
24690
|
+
const observedHeadingIds = useMemo(() => {
|
|
24691
|
+
return headings.map((heading) => heading.id).join("|");
|
|
24692
|
+
}, [headings]);
|
|
24693
|
+
useEffect(() => {
|
|
24694
|
+
if (!enabled) return;
|
|
24695
|
+
if (typeof window === "undefined") return;
|
|
24696
|
+
if (!("IntersectionObserver" in window)) return;
|
|
24697
|
+
if (headings.length === 0) return;
|
|
24698
|
+
const elements = headings.map((heading) => document.getElementById(heading.id)).filter((element) => Boolean(element));
|
|
24699
|
+
if (elements.length === 0) return;
|
|
24700
|
+
const observer = new IntersectionObserver(
|
|
24701
|
+
(entries) => {
|
|
24702
|
+
const visibleEntries = entries.filter((entry) => entry.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top);
|
|
24703
|
+
const nextActiveId = visibleEntries[0]?.target.id;
|
|
24704
|
+
if (!nextActiveId) return;
|
|
24705
|
+
setActiveHeading(nextActiveId);
|
|
24706
|
+
},
|
|
24707
|
+
{
|
|
24708
|
+
root,
|
|
24709
|
+
rootMargin,
|
|
24710
|
+
threshold
|
|
24711
|
+
}
|
|
24712
|
+
);
|
|
24713
|
+
elements.forEach((element) => {
|
|
24714
|
+
observer.observe(element);
|
|
24715
|
+
});
|
|
24716
|
+
return () => {
|
|
24717
|
+
observer.disconnect();
|
|
24718
|
+
};
|
|
24719
|
+
}, [
|
|
24720
|
+
enabled,
|
|
24721
|
+
root,
|
|
24722
|
+
rootMargin,
|
|
24723
|
+
threshold,
|
|
24724
|
+
observedHeadingIds,
|
|
24725
|
+
headings,
|
|
24726
|
+
setActiveHeading
|
|
24727
|
+
]);
|
|
24728
|
+
return {
|
|
24729
|
+
activeHeading,
|
|
24730
|
+
setActiveHeading,
|
|
24731
|
+
scrollToHeading
|
|
24732
|
+
};
|
|
24733
|
+
}
|
|
24734
|
+
function useMarkdownHeadings(options = {}) {
|
|
24735
|
+
const context = useMarkdown();
|
|
24736
|
+
const {
|
|
24737
|
+
markdown,
|
|
24738
|
+
headings: externalHeadings,
|
|
24739
|
+
minDepth = 1,
|
|
24740
|
+
maxDepth = 6
|
|
24741
|
+
} = options;
|
|
24742
|
+
const baseHeadings = useMemo(() => {
|
|
24743
|
+
if (externalHeadings) {
|
|
24744
|
+
return externalHeadings;
|
|
24745
|
+
}
|
|
24746
|
+
if (markdown !== void 0) {
|
|
24747
|
+
return extractHeadings(markdown);
|
|
24748
|
+
}
|
|
24749
|
+
return context?.headings ?? [];
|
|
24750
|
+
}, [context?.headings, externalHeadings, markdown]);
|
|
24751
|
+
const headings = useMemo(() => {
|
|
24752
|
+
return baseHeadings.filter((heading) => {
|
|
24753
|
+
return heading.level >= minDepth && heading.level <= maxDepth;
|
|
24754
|
+
});
|
|
24755
|
+
}, [baseHeadings, minDepth, maxDepth]);
|
|
24756
|
+
const numberedHeadings = useMemo(() => {
|
|
24757
|
+
return generateHeadingNumbers(headings);
|
|
24758
|
+
}, [headings]);
|
|
24759
|
+
const headingMap = useMemo(() => {
|
|
24760
|
+
return headings.reduce((acc, heading) => {
|
|
24761
|
+
acc[heading.id] = heading;
|
|
24762
|
+
return acc;
|
|
24763
|
+
}, {});
|
|
24764
|
+
}, [headings]);
|
|
24765
|
+
const getHeadingById = (id) => {
|
|
24766
|
+
return headingMap[id];
|
|
24767
|
+
};
|
|
24768
|
+
return {
|
|
24769
|
+
headings,
|
|
24770
|
+
numberedHeadings,
|
|
24771
|
+
hasHeadings: headings.length > 0,
|
|
24772
|
+
getHeadingById
|
|
24773
|
+
};
|
|
24774
|
+
}
|
|
24775
|
+
function MarkdownHeading({
|
|
24776
|
+
id,
|
|
24777
|
+
level,
|
|
24778
|
+
children,
|
|
24779
|
+
className,
|
|
24780
|
+
showAnchor = true,
|
|
24781
|
+
...props
|
|
24782
|
+
}) {
|
|
24783
|
+
const tag = `h${Math.min(Math.max(level, 1), 6)}`;
|
|
24784
|
+
return React2.createElement(
|
|
24785
|
+
tag,
|
|
24786
|
+
{
|
|
24787
|
+
...props,
|
|
24788
|
+
id,
|
|
24789
|
+
className: classNames66("eui-markdown-heading", className)
|
|
24790
|
+
},
|
|
24791
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24792
|
+
children,
|
|
24793
|
+
showAnchor && id ? /* @__PURE__ */ jsx(
|
|
24794
|
+
"a",
|
|
24795
|
+
{
|
|
24796
|
+
href: `#${id}`,
|
|
24797
|
+
className: "eui-markdown-heading-anchor",
|
|
24798
|
+
"aria-label": "Link to heading",
|
|
24799
|
+
children: "#"
|
|
24800
|
+
}
|
|
24801
|
+
) : null
|
|
24802
|
+
] })
|
|
24803
|
+
);
|
|
24804
|
+
}
|
|
24805
|
+
var MarkdownHeading_default = MarkdownHeading;
|
|
24806
|
+
PrismLight.registerLanguage("bash", bash);
|
|
24807
|
+
PrismLight.registerLanguage("shell", bash);
|
|
24808
|
+
PrismLight.registerLanguage("sh", bash);
|
|
24809
|
+
PrismLight.registerLanguage("zsh", bash);
|
|
24810
|
+
PrismLight.registerLanguage("c", c);
|
|
24811
|
+
PrismLight.registerLanguage("cpp", cpp);
|
|
24812
|
+
PrismLight.registerLanguage("c++", cpp);
|
|
24813
|
+
PrismLight.registerLanguage("css", css);
|
|
24814
|
+
PrismLight.registerLanguage("scss", scss);
|
|
24815
|
+
PrismLight.registerLanguage("go", go);
|
|
24816
|
+
PrismLight.registerLanguage("java", java);
|
|
24817
|
+
PrismLight.registerLanguage("js", javascript);
|
|
24818
|
+
PrismLight.registerLanguage("javascript", javascript);
|
|
24819
|
+
PrismLight.registerLanguage("jsx", jsx210);
|
|
24820
|
+
PrismLight.registerLanguage("json", json);
|
|
24821
|
+
PrismLight.registerLanguage("html", markup);
|
|
24822
|
+
PrismLight.registerLanguage("xml", markup);
|
|
24823
|
+
PrismLight.registerLanguage("markup", markup);
|
|
24824
|
+
PrismLight.registerLanguage("py", python);
|
|
24825
|
+
PrismLight.registerLanguage("python", python);
|
|
24826
|
+
PrismLight.registerLanguage("rs", rust);
|
|
24827
|
+
PrismLight.registerLanguage("rust", rust);
|
|
24828
|
+
PrismLight.registerLanguage("sql", sql);
|
|
24829
|
+
PrismLight.registerLanguage("ts", typescript);
|
|
24830
|
+
PrismLight.registerLanguage("typescript", typescript);
|
|
24831
|
+
PrismLight.registerLanguage("tsx", tsx);
|
|
24832
|
+
PrismLight.registerLanguage("yaml", yaml);
|
|
24833
|
+
PrismLight.registerLanguage("yml", yaml);
|
|
24834
|
+
var LANGUAGE_ALIASES = {
|
|
24835
|
+
js: "javascript",
|
|
24836
|
+
ts: "typescript",
|
|
24837
|
+
py: "python",
|
|
24838
|
+
sh: "bash",
|
|
24839
|
+
shell: "bash",
|
|
24840
|
+
zsh: "bash",
|
|
24841
|
+
yml: "yaml",
|
|
24842
|
+
html: "markup",
|
|
24843
|
+
xml: "markup",
|
|
24844
|
+
"c++": "cpp",
|
|
24845
|
+
text: "text",
|
|
24846
|
+
txt: "text",
|
|
24847
|
+
plain: "text",
|
|
24848
|
+
plaintext: "text"
|
|
24849
|
+
};
|
|
24850
|
+
function normalizeLanguage(language) {
|
|
24851
|
+
if (!language) return "text";
|
|
24852
|
+
const normalized = language.toLowerCase().trim();
|
|
24853
|
+
return LANGUAGE_ALIASES[normalized] ?? normalized;
|
|
24854
|
+
}
|
|
24855
|
+
function MarkdownCodeBlock({
|
|
24856
|
+
code,
|
|
24857
|
+
language,
|
|
24858
|
+
meta,
|
|
24859
|
+
className,
|
|
24860
|
+
showCopy = true,
|
|
24861
|
+
wrapLongLines = false,
|
|
24862
|
+
...props
|
|
24863
|
+
}) {
|
|
24864
|
+
const [copied, setCopied] = useState(false);
|
|
24865
|
+
const timeoutRef = useRef(null);
|
|
24866
|
+
const title = meta?.title ?? meta?.filename;
|
|
24867
|
+
const resolvedLanguage = useMemo(() => {
|
|
24868
|
+
return normalizeLanguage(language);
|
|
24869
|
+
}, [language]);
|
|
24870
|
+
const languageLabel = language || resolvedLanguage;
|
|
24871
|
+
const showHeader = Boolean(title || languageLabel || showCopy);
|
|
24872
|
+
const highlightLines = useMemo(() => {
|
|
24873
|
+
return new Set(meta?.highlightLines ?? []);
|
|
24874
|
+
}, [meta?.highlightLines]);
|
|
24875
|
+
const showLineNumbers = Boolean(meta?.showLineNumbers);
|
|
24876
|
+
useEffect(() => {
|
|
24877
|
+
return () => {
|
|
24878
|
+
if (timeoutRef.current) {
|
|
24879
|
+
window.clearTimeout(timeoutRef.current);
|
|
24880
|
+
}
|
|
24881
|
+
};
|
|
24882
|
+
}, []);
|
|
24883
|
+
const copyCode = async () => {
|
|
24884
|
+
if (typeof navigator === "undefined") return;
|
|
24885
|
+
if (!navigator.clipboard) return;
|
|
24886
|
+
await navigator.clipboard.writeText(code);
|
|
24887
|
+
setCopied(true);
|
|
24888
|
+
if (timeoutRef.current) {
|
|
24889
|
+
window.clearTimeout(timeoutRef.current);
|
|
24890
|
+
}
|
|
24891
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
24892
|
+
setCopied(false);
|
|
24893
|
+
}, 1500);
|
|
24894
|
+
};
|
|
24895
|
+
const lineNumberStyle = {
|
|
24896
|
+
minWidth: "3rem",
|
|
24897
|
+
paddingRight: "1rem",
|
|
24898
|
+
color: "rgb(100 116 139)",
|
|
24899
|
+
textAlign: "right",
|
|
24900
|
+
userSelect: "none"
|
|
24901
|
+
};
|
|
24902
|
+
return /* @__PURE__ */ jsxs("div", { ...props, className: classNames66("eui-markdown-code", className), children: [
|
|
24903
|
+
showHeader ? /* @__PURE__ */ jsxs("div", { className: "eui-markdown-code-header", children: [
|
|
24904
|
+
/* @__PURE__ */ jsxs("div", { className: "eui-markdown-code-header-main", children: [
|
|
24905
|
+
title ? /* @__PURE__ */ jsx("div", { className: "eui-markdown-code-title", children: title }) : null,
|
|
24906
|
+
languageLabel ? /* @__PURE__ */ jsx("div", { className: "eui-markdown-code-language", children: languageLabel }) : null
|
|
24907
|
+
] }),
|
|
24908
|
+
showCopy ? /* @__PURE__ */ jsx(
|
|
24909
|
+
"button",
|
|
24910
|
+
{
|
|
24911
|
+
type: "button",
|
|
24912
|
+
className: "eui-markdown-copy-button",
|
|
24913
|
+
onClick: copyCode,
|
|
24914
|
+
children: copied ? "Copied" : "Copy"
|
|
24915
|
+
}
|
|
24916
|
+
) : null
|
|
24917
|
+
] }) : null,
|
|
24918
|
+
/* @__PURE__ */ jsx(
|
|
24919
|
+
PrismLight,
|
|
24920
|
+
{
|
|
24921
|
+
className: "eui-markdown-code-highlighter",
|
|
24922
|
+
language: resolvedLanguage,
|
|
24923
|
+
style: vscDarkPlus,
|
|
24924
|
+
showLineNumbers,
|
|
24925
|
+
wrapLines: highlightLines.size > 0,
|
|
24926
|
+
wrapLongLines,
|
|
24927
|
+
PreTag: "pre",
|
|
24928
|
+
CodeTag: "code",
|
|
24929
|
+
customStyle: {
|
|
24930
|
+
margin: 0,
|
|
24931
|
+
padding: "1rem",
|
|
24932
|
+
background: "transparent",
|
|
24933
|
+
fontSize: "0.875rem",
|
|
24934
|
+
lineHeight: 1.7
|
|
24935
|
+
},
|
|
24936
|
+
codeTagProps: {
|
|
24937
|
+
style: {
|
|
24938
|
+
fontFamily: '"JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace'
|
|
24939
|
+
}
|
|
24940
|
+
},
|
|
24941
|
+
lineNumberStyle,
|
|
24942
|
+
lineProps: (lineNumber) => {
|
|
24943
|
+
const highlighted = highlightLines.has(lineNumber);
|
|
24944
|
+
return {
|
|
24945
|
+
className: highlighted ? "eui-markdown-code-line-highlighted" : void 0,
|
|
24946
|
+
style: {
|
|
24947
|
+
display: "block",
|
|
24948
|
+
background: highlighted ? "rgba(250, 204, 21, 0.12)" : void 0
|
|
24949
|
+
}
|
|
24950
|
+
};
|
|
24951
|
+
},
|
|
24952
|
+
children: code
|
|
24953
|
+
}
|
|
24954
|
+
)
|
|
24955
|
+
] });
|
|
24956
|
+
}
|
|
24957
|
+
var MarkdownCodeBlock_default = MarkdownCodeBlock;
|
|
24958
|
+
function MarkdownInlineCode({
|
|
24959
|
+
children,
|
|
24960
|
+
className,
|
|
24961
|
+
...props
|
|
24962
|
+
}) {
|
|
24963
|
+
return /* @__PURE__ */ jsx(
|
|
24964
|
+
"code",
|
|
24965
|
+
{
|
|
24966
|
+
...props,
|
|
24967
|
+
className: classNames66("eui-markdown-inline-code", className),
|
|
24968
|
+
children
|
|
24969
|
+
}
|
|
24970
|
+
);
|
|
24971
|
+
}
|
|
24972
|
+
var MarkdownInlineCode_default = MarkdownInlineCode;
|
|
24973
|
+
function isExternalHref(href) {
|
|
24974
|
+
if (!href) return false;
|
|
24975
|
+
return /^https?:\/\//i.test(href);
|
|
24976
|
+
}
|
|
24977
|
+
function getSafeHref(href) {
|
|
24978
|
+
if (!href) return void 0;
|
|
24979
|
+
const trimmed = href.trim();
|
|
24980
|
+
const isSafe = trimmed.startsWith("#") || trimmed.startsWith("/") || trimmed.startsWith("./") || trimmed.startsWith("../") || /^https?:\/\//i.test(trimmed) || /^mailto:/i.test(trimmed) || /^tel:/i.test(trimmed);
|
|
24981
|
+
return isSafe ? trimmed : void 0;
|
|
24982
|
+
}
|
|
24983
|
+
function MarkdownLink({
|
|
24984
|
+
href,
|
|
24985
|
+
target,
|
|
24986
|
+
children,
|
|
24987
|
+
className,
|
|
24988
|
+
openLinksInNewTab = true,
|
|
24989
|
+
...props
|
|
24990
|
+
}) {
|
|
24991
|
+
const safeHref = getSafeHref(href);
|
|
24992
|
+
if (!safeHref) {
|
|
24993
|
+
return /* @__PURE__ */ jsx("span", { className, children });
|
|
24994
|
+
}
|
|
24995
|
+
const external = isExternalHref(safeHref);
|
|
24996
|
+
const resolvedTarget = target ?? (openLinksInNewTab && external ? "_blank" : void 0);
|
|
24997
|
+
const rel = resolvedTarget === "_blank" ? "noopener noreferrer" : props.rel;
|
|
24998
|
+
return /* @__PURE__ */ jsx(
|
|
24999
|
+
"a",
|
|
25000
|
+
{
|
|
25001
|
+
...props,
|
|
25002
|
+
href: safeHref,
|
|
25003
|
+
target: resolvedTarget,
|
|
25004
|
+
rel,
|
|
25005
|
+
className: classNames66("eui-markdown-link", className),
|
|
25006
|
+
children
|
|
25007
|
+
}
|
|
25008
|
+
);
|
|
25009
|
+
}
|
|
25010
|
+
var MarkdownLink_default = MarkdownLink;
|
|
25011
|
+
function getSafeImageSrc(src) {
|
|
25012
|
+
if (!src) return void 0;
|
|
25013
|
+
const trimmed = src.trim();
|
|
25014
|
+
const isSafe = trimmed.startsWith("/") || trimmed.startsWith("./") || trimmed.startsWith("../") || /^https?:\/\//i.test(trimmed) || /^data:image\/(png|jpeg|jpg|gif|webp|svg\+xml);base64,/i.test(trimmed);
|
|
25015
|
+
return isSafe ? trimmed : void 0;
|
|
25016
|
+
}
|
|
25017
|
+
function MarkdownImage({
|
|
25018
|
+
src,
|
|
25019
|
+
alt,
|
|
25020
|
+
title,
|
|
25021
|
+
className,
|
|
25022
|
+
...props
|
|
25023
|
+
}) {
|
|
25024
|
+
const safeSrc = getSafeImageSrc(src);
|
|
25025
|
+
if (!safeSrc) {
|
|
25026
|
+
return null;
|
|
25027
|
+
}
|
|
25028
|
+
return /* @__PURE__ */ jsx(
|
|
25029
|
+
"img",
|
|
25030
|
+
{
|
|
25031
|
+
...props,
|
|
25032
|
+
src: safeSrc,
|
|
25033
|
+
alt: alt ?? "",
|
|
25034
|
+
title,
|
|
25035
|
+
loading: "lazy",
|
|
25036
|
+
decoding: "async",
|
|
25037
|
+
className: classNames66("eui-markdown-image", className)
|
|
25038
|
+
}
|
|
25039
|
+
);
|
|
25040
|
+
}
|
|
25041
|
+
var MarkdownImage_default = MarkdownImage;
|
|
25042
|
+
function MarkdownTable({
|
|
25043
|
+
children,
|
|
25044
|
+
className,
|
|
25045
|
+
...props
|
|
25046
|
+
}) {
|
|
25047
|
+
return /* @__PURE__ */ jsx("div", { className: "eui-markdown-table-wrapper", children: /* @__PURE__ */ jsx("table", { ...props, className: classNames66("eui-markdown-table", className), children }) });
|
|
25048
|
+
}
|
|
25049
|
+
function MarkdownTableCell({
|
|
25050
|
+
children,
|
|
25051
|
+
className,
|
|
25052
|
+
...props
|
|
25053
|
+
}) {
|
|
25054
|
+
return /* @__PURE__ */ jsx("td", { ...props, className: classNames66("eui-markdown-table-cell", className), children });
|
|
25055
|
+
}
|
|
25056
|
+
function MarkdownTableHeaderCell({
|
|
25057
|
+
children,
|
|
25058
|
+
className,
|
|
25059
|
+
...props
|
|
25060
|
+
}) {
|
|
25061
|
+
return /* @__PURE__ */ jsx(
|
|
25062
|
+
"th",
|
|
25063
|
+
{
|
|
25064
|
+
...props,
|
|
25065
|
+
className: classNames66("eui-markdown-table-header-cell", className),
|
|
25066
|
+
children
|
|
25067
|
+
}
|
|
25068
|
+
);
|
|
25069
|
+
}
|
|
25070
|
+
var MarkdownTable_default = MarkdownTable;
|
|
25071
|
+
function MarkdownBlockquote({
|
|
25072
|
+
children,
|
|
25073
|
+
className,
|
|
25074
|
+
...props
|
|
25075
|
+
}) {
|
|
25076
|
+
return /* @__PURE__ */ jsx(
|
|
25077
|
+
"blockquote",
|
|
25078
|
+
{
|
|
25079
|
+
...props,
|
|
25080
|
+
className: classNames66("eui-markdown-blockquote", className),
|
|
25081
|
+
children
|
|
25082
|
+
}
|
|
25083
|
+
);
|
|
25084
|
+
}
|
|
25085
|
+
var MarkdownBlockquote_default = MarkdownBlockquote;
|
|
25086
|
+
function getTextContent(node) {
|
|
25087
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
25088
|
+
return String(node);
|
|
25089
|
+
}
|
|
25090
|
+
if (Array.isArray(node)) {
|
|
25091
|
+
return node.map(getTextContent).join("");
|
|
25092
|
+
}
|
|
25093
|
+
if (isValidElement(node)) {
|
|
25094
|
+
return getTextContent(node.props.children);
|
|
25095
|
+
}
|
|
25096
|
+
return "";
|
|
25097
|
+
}
|
|
25098
|
+
function createHeadingKey(level, text) {
|
|
25099
|
+
return `${level}:${sanitizeHeading(text)}`;
|
|
25100
|
+
}
|
|
25101
|
+
function parseNumberRanges(value) {
|
|
25102
|
+
if (!value) return [];
|
|
25103
|
+
const normalized = value.replace(/[{}[\]\s]/g, "");
|
|
25104
|
+
if (!normalized) return [];
|
|
25105
|
+
const values = /* @__PURE__ */ new Set();
|
|
25106
|
+
normalized.split(",").forEach((part) => {
|
|
25107
|
+
if (!part) return;
|
|
25108
|
+
const rangeMatch = part.match(/^(\d+)-(\d+)$/);
|
|
25109
|
+
if (rangeMatch) {
|
|
25110
|
+
const start = Number(rangeMatch[1]);
|
|
25111
|
+
const end = Number(rangeMatch[2]);
|
|
25112
|
+
for (let line2 = start; line2 <= end; line2++) {
|
|
25113
|
+
values.add(line2);
|
|
25114
|
+
}
|
|
25115
|
+
return;
|
|
25116
|
+
}
|
|
25117
|
+
const line = Number(part);
|
|
25118
|
+
if (!Number.isNaN(line)) {
|
|
25119
|
+
values.add(line);
|
|
25120
|
+
}
|
|
25121
|
+
});
|
|
25122
|
+
return Array.from(values).sort((a, b) => a - b);
|
|
25123
|
+
}
|
|
25124
|
+
function parseCodeMeta(metaString) {
|
|
25125
|
+
if (!metaString) return void 0;
|
|
25126
|
+
const filenameMatch = metaString.match(
|
|
25127
|
+
/(?:filename|file)=["']?([^"'\s]+)["']?/
|
|
25128
|
+
);
|
|
25129
|
+
const titleMatch = metaString.match(/(?:title)=["']?([^"']+)["']?/);
|
|
25130
|
+
const highlightMatch = metaString.match(/(?:highlight|lines)=["']?([^"'\s]+)["']?/) || metaString.match(/{([^}]+)}/);
|
|
25131
|
+
return {
|
|
25132
|
+
filename: filenameMatch?.[1],
|
|
25133
|
+
title: titleMatch?.[1],
|
|
25134
|
+
showLineNumbers: /\b(showLineNumbers|lineNumbers|line-numbers)\b/.test(
|
|
25135
|
+
metaString
|
|
25136
|
+
),
|
|
25137
|
+
highlightLines: parseNumberRanges(highlightMatch?.[1])
|
|
25138
|
+
};
|
|
25139
|
+
}
|
|
25140
|
+
function getCodeMetaString(node) {
|
|
25141
|
+
const value = node;
|
|
25142
|
+
return value?.data?.meta || value?.data?.hProperties?.meta || value?.properties?.meta || value?.properties?.dataMeta || value?.meta;
|
|
25143
|
+
}
|
|
25144
|
+
function getLanguageFromClassName(className) {
|
|
25145
|
+
if (!className) return void 0;
|
|
25146
|
+
const match = className.match(/language-([^\s]+)/);
|
|
25147
|
+
return match?.[1];
|
|
25148
|
+
}
|
|
25149
|
+
function getCodeInfoFromPreChildren(children) {
|
|
25150
|
+
const childArray = React2.Children.toArray(children);
|
|
25151
|
+
const codeElement = childArray.find((child) => {
|
|
25152
|
+
if (!isValidElement(child)) return false;
|
|
25153
|
+
return child.type === "code";
|
|
25154
|
+
});
|
|
25155
|
+
const codeProps = codeElement?.props;
|
|
25156
|
+
const code = getTextContent(codeProps?.children ?? children).replace(
|
|
25157
|
+
/\n$/,
|
|
25158
|
+
""
|
|
25159
|
+
);
|
|
25160
|
+
const language = getLanguageFromClassName(codeProps?.className);
|
|
25161
|
+
const meta = parseCodeMeta(codeProps?.["data-meta"]);
|
|
25162
|
+
return {
|
|
25163
|
+
code,
|
|
25164
|
+
language,
|
|
25165
|
+
meta
|
|
25166
|
+
};
|
|
25167
|
+
}
|
|
25168
|
+
function MarkdownRenderer({
|
|
25169
|
+
markdown,
|
|
25170
|
+
headings = [],
|
|
25171
|
+
headingIdPrefix = "",
|
|
25172
|
+
components,
|
|
25173
|
+
className,
|
|
25174
|
+
contentClassName,
|
|
25175
|
+
openLinksInNewTab = true,
|
|
25176
|
+
linkTarget,
|
|
25177
|
+
enableGfm = true,
|
|
25178
|
+
allowHtml = false,
|
|
25179
|
+
sanitizeHtml = true,
|
|
25180
|
+
showCopyCode = true,
|
|
25181
|
+
showHeadingAnchors = true
|
|
25182
|
+
}) {
|
|
25183
|
+
const headingQueues = /* @__PURE__ */ new Map();
|
|
25184
|
+
headings.forEach((heading) => {
|
|
25185
|
+
const key = createHeadingKey(heading.level, heading.text);
|
|
25186
|
+
const queue = headingQueues.get(key) ?? [];
|
|
25187
|
+
queue.push(heading.id);
|
|
25188
|
+
headingQueues.set(key, queue);
|
|
25189
|
+
});
|
|
25190
|
+
const headingUsage = /* @__PURE__ */ new Map();
|
|
25191
|
+
const fallbackSlugCounts = /* @__PURE__ */ new Map();
|
|
25192
|
+
const resolveHeadingId = (level, children) => {
|
|
25193
|
+
const text = getTextContent(children);
|
|
25194
|
+
const key = createHeadingKey(level, text);
|
|
25195
|
+
const queue = headingQueues.get(key);
|
|
25196
|
+
if (queue?.length) {
|
|
25197
|
+
const usedCount = headingUsage.get(key) ?? 0;
|
|
25198
|
+
headingUsage.set(key, usedCount + 1);
|
|
25199
|
+
const existingId = queue[usedCount];
|
|
25200
|
+
if (existingId) {
|
|
25201
|
+
return existingId;
|
|
25202
|
+
}
|
|
25203
|
+
}
|
|
25204
|
+
return `${headingIdPrefix}${createHeadingSlug(text, {
|
|
25205
|
+
slugCounts: fallbackSlugCounts
|
|
25206
|
+
})}`;
|
|
25207
|
+
};
|
|
25208
|
+
const remarkPlugins = [];
|
|
25209
|
+
if (enableGfm) {
|
|
25210
|
+
remarkPlugins.push(remarkGfm);
|
|
25211
|
+
}
|
|
25212
|
+
const rehypePlugins = [];
|
|
25213
|
+
if (allowHtml) {
|
|
25214
|
+
rehypePlugins.push(rehypeRaw);
|
|
25215
|
+
if (sanitizeHtml) {
|
|
25216
|
+
rehypePlugins.push(rehypeSanitize);
|
|
25217
|
+
}
|
|
25218
|
+
}
|
|
25219
|
+
const rendererComponents = {
|
|
25220
|
+
h1: ({ node: _node, children, ...rest }) => {
|
|
25221
|
+
const Component = components?.h1 ?? MarkdownHeading_default;
|
|
25222
|
+
return /* @__PURE__ */ jsx(
|
|
25223
|
+
Component,
|
|
25224
|
+
{
|
|
25225
|
+
...rest,
|
|
25226
|
+
id: resolveHeadingId(1, children),
|
|
25227
|
+
level: 1,
|
|
25228
|
+
showAnchor: showHeadingAnchors,
|
|
25229
|
+
children
|
|
25230
|
+
}
|
|
25231
|
+
);
|
|
25232
|
+
},
|
|
25233
|
+
h2: ({ node: _node, children, ...rest }) => {
|
|
25234
|
+
const Component = components?.h2 ?? MarkdownHeading_default;
|
|
25235
|
+
return /* @__PURE__ */ jsx(
|
|
25236
|
+
Component,
|
|
25237
|
+
{
|
|
25238
|
+
...rest,
|
|
25239
|
+
id: resolveHeadingId(2, children),
|
|
25240
|
+
level: 2,
|
|
25241
|
+
showAnchor: showHeadingAnchors,
|
|
25242
|
+
children
|
|
25243
|
+
}
|
|
25244
|
+
);
|
|
25245
|
+
},
|
|
25246
|
+
h3: ({ node: _node, children, ...rest }) => {
|
|
25247
|
+
const Component = components?.h3 ?? MarkdownHeading_default;
|
|
25248
|
+
return /* @__PURE__ */ jsx(
|
|
25249
|
+
Component,
|
|
25250
|
+
{
|
|
25251
|
+
...rest,
|
|
25252
|
+
id: resolveHeadingId(3, children),
|
|
25253
|
+
level: 3,
|
|
25254
|
+
showAnchor: showHeadingAnchors,
|
|
25255
|
+
children
|
|
25256
|
+
}
|
|
25257
|
+
);
|
|
25258
|
+
},
|
|
25259
|
+
h4: ({ node: _node, children, ...rest }) => {
|
|
25260
|
+
const Component = components?.h4 ?? MarkdownHeading_default;
|
|
25261
|
+
return /* @__PURE__ */ jsx(
|
|
25262
|
+
Component,
|
|
25263
|
+
{
|
|
25264
|
+
...rest,
|
|
25265
|
+
id: resolveHeadingId(4, children),
|
|
25266
|
+
level: 4,
|
|
25267
|
+
showAnchor: showHeadingAnchors,
|
|
25268
|
+
children
|
|
25269
|
+
}
|
|
25270
|
+
);
|
|
25271
|
+
},
|
|
25272
|
+
h5: ({ node: _node, children, ...rest }) => {
|
|
25273
|
+
const Component = components?.h5 ?? MarkdownHeading_default;
|
|
25274
|
+
return /* @__PURE__ */ jsx(
|
|
25275
|
+
Component,
|
|
25276
|
+
{
|
|
25277
|
+
...rest,
|
|
25278
|
+
id: resolveHeadingId(5, children),
|
|
25279
|
+
level: 5,
|
|
25280
|
+
showAnchor: showHeadingAnchors,
|
|
25281
|
+
children
|
|
25282
|
+
}
|
|
25283
|
+
);
|
|
25284
|
+
},
|
|
25285
|
+
h6: ({ node: _node, children, ...rest }) => {
|
|
25286
|
+
const Component = components?.h6 ?? MarkdownHeading_default;
|
|
25287
|
+
return /* @__PURE__ */ jsx(
|
|
25288
|
+
Component,
|
|
25289
|
+
{
|
|
25290
|
+
...rest,
|
|
25291
|
+
id: resolveHeadingId(6, children),
|
|
25292
|
+
level: 6,
|
|
25293
|
+
showAnchor: showHeadingAnchors,
|
|
25294
|
+
children
|
|
25295
|
+
}
|
|
25296
|
+
);
|
|
25297
|
+
},
|
|
25298
|
+
/**
|
|
25299
|
+
* Important:
|
|
25300
|
+
* For block code, return a native <code> with className="language-*".
|
|
25301
|
+
* Then the pre renderer can reliably extract language + meta.
|
|
25302
|
+
*/
|
|
25303
|
+
code: ({ node, className: className2, children, ...rest }) => {
|
|
25304
|
+
const language = getLanguageFromClassName(className2);
|
|
25305
|
+
if (language) {
|
|
25306
|
+
return /* @__PURE__ */ jsx(
|
|
25307
|
+
"code",
|
|
25308
|
+
{
|
|
25309
|
+
...rest,
|
|
25310
|
+
className: className2,
|
|
25311
|
+
"data-meta": getCodeMetaString(node),
|
|
25312
|
+
children
|
|
25313
|
+
}
|
|
25314
|
+
);
|
|
25315
|
+
}
|
|
25316
|
+
const Component = components?.code ?? MarkdownInlineCode_default;
|
|
25317
|
+
return /* @__PURE__ */ jsx(Component, { ...rest, className: className2, children });
|
|
25318
|
+
},
|
|
25319
|
+
/**
|
|
25320
|
+
* Do not spread rest here.
|
|
25321
|
+
* React-markdown's pre props are HTMLPreElement props.
|
|
25322
|
+
* MarkdownCodeBlock root is a div.
|
|
25323
|
+
*/
|
|
25324
|
+
pre: ({ node: _node, children }) => {
|
|
25325
|
+
const Component = components?.pre ?? MarkdownCodeBlock_default;
|
|
25326
|
+
const { code, language, meta } = getCodeInfoFromPreChildren(children);
|
|
25327
|
+
return /* @__PURE__ */ jsx(
|
|
25328
|
+
Component,
|
|
25329
|
+
{
|
|
25330
|
+
code,
|
|
25331
|
+
language,
|
|
25332
|
+
meta,
|
|
25333
|
+
showCopy: showCopyCode
|
|
25334
|
+
}
|
|
25335
|
+
);
|
|
25336
|
+
},
|
|
25337
|
+
a: ({ node: _node, children, href, target, ...rest }) => {
|
|
25338
|
+
const Component = components?.a ?? MarkdownLink_default;
|
|
25339
|
+
return /* @__PURE__ */ jsx(
|
|
25340
|
+
Component,
|
|
25341
|
+
{
|
|
25342
|
+
...rest,
|
|
25343
|
+
href,
|
|
25344
|
+
target: linkTarget ?? target,
|
|
25345
|
+
openLinksInNewTab,
|
|
25346
|
+
children
|
|
25347
|
+
}
|
|
25348
|
+
);
|
|
25349
|
+
},
|
|
25350
|
+
img: ({ node: _node, src, alt, title, ...rest }) => {
|
|
25351
|
+
const Component = components?.img ?? MarkdownImage_default;
|
|
25352
|
+
return /* @__PURE__ */ jsx(Component, { ...rest, src, alt, title });
|
|
25353
|
+
},
|
|
25354
|
+
table: ({ node: _node, children, ...rest }) => {
|
|
25355
|
+
const Component = components?.table ?? MarkdownTable_default;
|
|
25356
|
+
return /* @__PURE__ */ jsx(Component, { ...rest, children });
|
|
25357
|
+
},
|
|
25358
|
+
td: ({ node: _node, children, ...rest }) => {
|
|
25359
|
+
const Component = components?.td ?? MarkdownTableCell;
|
|
25360
|
+
return /* @__PURE__ */ jsx(Component, { ...rest, children });
|
|
25361
|
+
},
|
|
25362
|
+
th: ({ node: _node, children, ...rest }) => {
|
|
25363
|
+
const Component = components?.th ?? MarkdownTableHeaderCell;
|
|
25364
|
+
return /* @__PURE__ */ jsx(Component, { ...rest, children });
|
|
25365
|
+
},
|
|
25366
|
+
blockquote: ({ node: _node, children, ...rest }) => {
|
|
25367
|
+
const Component = components?.blockquote ?? MarkdownBlockquote_default;
|
|
25368
|
+
return /* @__PURE__ */ jsx(Component, { ...rest, children });
|
|
25369
|
+
},
|
|
25370
|
+
...components
|
|
25371
|
+
};
|
|
25372
|
+
return /* @__PURE__ */ jsx("div", { className: classNames66("eui-markdown markdown-body", className), children: /* @__PURE__ */ jsx("div", { className: contentClassName, children: /* @__PURE__ */ jsx(
|
|
25373
|
+
ReactMarkdown,
|
|
25374
|
+
{
|
|
25375
|
+
remarkPlugins,
|
|
25376
|
+
rehypePlugins,
|
|
25377
|
+
skipHtml: !allowHtml,
|
|
25378
|
+
components: rendererComponents,
|
|
25379
|
+
children: markdown
|
|
25380
|
+
}
|
|
25381
|
+
) }) });
|
|
25382
|
+
}
|
|
25383
|
+
var MarkdownRenderer_default = MarkdownRenderer;
|
|
25384
|
+
function MarkdownViewer({
|
|
25385
|
+
value,
|
|
25386
|
+
headings: externalHeadings,
|
|
25387
|
+
headingIdPrefix = "",
|
|
25388
|
+
enableActiveHeading = true,
|
|
25389
|
+
...props
|
|
25390
|
+
}) {
|
|
25391
|
+
const context = useMarkdown();
|
|
25392
|
+
const markdown = value ?? context?.markdown ?? "";
|
|
25393
|
+
const headings = useMemo(() => {
|
|
25394
|
+
if (externalHeadings) {
|
|
25395
|
+
return externalHeadings;
|
|
25396
|
+
}
|
|
25397
|
+
if (context?.headings?.length) {
|
|
25398
|
+
return context.headings;
|
|
25399
|
+
}
|
|
25400
|
+
return extractHeadings(markdown, {
|
|
25401
|
+
idPrefix: headingIdPrefix
|
|
25402
|
+
});
|
|
25403
|
+
}, [context?.headings, externalHeadings, headingIdPrefix, markdown]);
|
|
25404
|
+
useActiveHeading({
|
|
25405
|
+
headings,
|
|
25406
|
+
enabled: enableActiveHeading && headings.length > 0
|
|
25407
|
+
});
|
|
25408
|
+
return /* @__PURE__ */ jsx(
|
|
25409
|
+
MarkdownRenderer_default,
|
|
25410
|
+
{
|
|
25411
|
+
markdown,
|
|
25412
|
+
headings,
|
|
25413
|
+
headingIdPrefix,
|
|
25414
|
+
...props
|
|
25415
|
+
}
|
|
25416
|
+
);
|
|
25417
|
+
}
|
|
25418
|
+
var MarkdownViewer_default = MarkdownViewer;
|
|
25419
|
+
function hasNumbering(heading) {
|
|
25420
|
+
return "numbering" in heading;
|
|
25421
|
+
}
|
|
25422
|
+
function MarkdownTOCItem({
|
|
25423
|
+
heading,
|
|
25424
|
+
active = false,
|
|
25425
|
+
numbered = true,
|
|
25426
|
+
sanitizeLabel = true,
|
|
25427
|
+
indentSize = 12,
|
|
25428
|
+
className,
|
|
25429
|
+
activeClassName,
|
|
25430
|
+
inactiveClassName,
|
|
25431
|
+
onSelect
|
|
25432
|
+
}) {
|
|
25433
|
+
const label = sanitizeLabel ? sanitizeHeading(heading.text) : heading.text;
|
|
25434
|
+
const numbering = hasNumbering(heading) ? heading.numbering : void 0;
|
|
25435
|
+
return /* @__PURE__ */ jsxs(
|
|
25436
|
+
"button",
|
|
25437
|
+
{
|
|
25438
|
+
type: "button",
|
|
25439
|
+
onClick: () => onSelect?.(heading),
|
|
25440
|
+
"aria-current": active ? "location" : void 0,
|
|
25441
|
+
title: label,
|
|
25442
|
+
className: classNames66(
|
|
25443
|
+
"eui-markdown-toc-item",
|
|
25444
|
+
"block w-full text-left text-sm transition-all ease-in-out duration-150",
|
|
25445
|
+
"hover:text-primary",
|
|
25446
|
+
active ? classNames66("text-primary font-semibold underline", activeClassName) : classNames66("text-gray-500 dark:text-gray-400", inactiveClassName),
|
|
25447
|
+
className
|
|
25448
|
+
),
|
|
25449
|
+
style: {
|
|
25450
|
+
paddingLeft: `${Math.max(heading.level - 1, 0) * indentSize}px`
|
|
25451
|
+
},
|
|
25452
|
+
children: [
|
|
25453
|
+
numbered && numbering ? /* @__PURE__ */ jsx("span", { className: "eui-markdown-toc-item-number mr-2 opacity-70", children: numbering }) : null,
|
|
25454
|
+
/* @__PURE__ */ jsx("span", { className: "eui-markdown-toc-item-label", children: label })
|
|
25455
|
+
]
|
|
25456
|
+
}
|
|
25457
|
+
);
|
|
25458
|
+
}
|
|
25459
|
+
var MarkdownTOCItem_default = MarkdownTOCItem;
|
|
25460
|
+
function MarkdownTOC({
|
|
25461
|
+
title = "Table of Contents",
|
|
25462
|
+
markdown,
|
|
25463
|
+
headings: externalHeadings,
|
|
25464
|
+
minDepth = 1,
|
|
25465
|
+
maxDepth = 6,
|
|
25466
|
+
numbered = true,
|
|
25467
|
+
sanitizeLabels = true,
|
|
25468
|
+
collapsible = false,
|
|
25469
|
+
defaultCollapsed = false,
|
|
25470
|
+
emptyState = null,
|
|
25471
|
+
smoothScroll = true,
|
|
25472
|
+
scrollBlock = "start",
|
|
25473
|
+
indentSize = 12,
|
|
25474
|
+
className,
|
|
25475
|
+
titleClassName,
|
|
25476
|
+
listClassName,
|
|
25477
|
+
itemClassName,
|
|
25478
|
+
activeItemClassName,
|
|
25479
|
+
inactiveItemClassName,
|
|
25480
|
+
activeHeading: controlledActiveHeading,
|
|
25481
|
+
onActiveHeadingChange,
|
|
25482
|
+
onHeadingClick
|
|
25483
|
+
}) {
|
|
25484
|
+
const context = useMarkdown();
|
|
25485
|
+
const [collapsed, setCollapsed] = useState(defaultCollapsed);
|
|
25486
|
+
const { headings, numberedHeadings, hasHeadings } = useMarkdownHeadings({
|
|
25487
|
+
markdown,
|
|
25488
|
+
headings: externalHeadings,
|
|
25489
|
+
minDepth,
|
|
25490
|
+
maxDepth
|
|
25491
|
+
});
|
|
25492
|
+
const tocHeadings = useMemo(() => {
|
|
25493
|
+
return numbered ? numberedHeadings : headings;
|
|
25494
|
+
}, [headings, numbered, numberedHeadings]);
|
|
25495
|
+
const { activeHeading, scrollToHeading, setActiveHeading } = useActiveHeading(
|
|
25496
|
+
{
|
|
25497
|
+
headings,
|
|
25498
|
+
enabled: false,
|
|
25499
|
+
activeHeading: controlledActiveHeading,
|
|
25500
|
+
scrollBehavior: smoothScroll ? "smooth" : "auto",
|
|
25501
|
+
scrollBlock,
|
|
25502
|
+
onActiveHeadingChange
|
|
25503
|
+
}
|
|
25504
|
+
);
|
|
25505
|
+
if (!context && !markdown && !externalHeadings) {
|
|
25506
|
+
return null;
|
|
25507
|
+
}
|
|
25508
|
+
if (!hasHeadings) {
|
|
25509
|
+
return emptyState ? /* @__PURE__ */ jsx(
|
|
25510
|
+
"div",
|
|
25511
|
+
{
|
|
25512
|
+
className: classNames66(
|
|
25513
|
+
"eui-markdown-toc",
|
|
25514
|
+
"text-sm text-gray-500 dark:text-gray-400",
|
|
25515
|
+
className
|
|
25516
|
+
),
|
|
25517
|
+
children: emptyState
|
|
25518
|
+
}
|
|
25519
|
+
) : null;
|
|
25520
|
+
}
|
|
25521
|
+
const handleSelect = (heading) => {
|
|
25522
|
+
scrollToHeading(heading.id);
|
|
25523
|
+
setActiveHeading(heading.id);
|
|
25524
|
+
onHeadingClick?.(heading);
|
|
25525
|
+
};
|
|
25526
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25527
|
+
title ? /* @__PURE__ */ jsx("div", { className: "eui-markdown-toc-header", children: collapsible ? /* @__PURE__ */ jsxs(
|
|
25528
|
+
"button",
|
|
25529
|
+
{
|
|
25530
|
+
type: "button",
|
|
25531
|
+
onClick: () => setCollapsed((value) => !value),
|
|
25532
|
+
className: classNames66(
|
|
25533
|
+
"eui-markdown-toc-title",
|
|
25534
|
+
"flex w-full items-center justify-between gap-2 text-left",
|
|
25535
|
+
"text-sm font-semibold uppercase tracking-wide",
|
|
25536
|
+
"text-gray-900 dark:text-gray-100",
|
|
25537
|
+
titleClassName
|
|
25538
|
+
),
|
|
25539
|
+
"aria-expanded": !collapsed,
|
|
25540
|
+
children: [
|
|
25541
|
+
/* @__PURE__ */ jsx("span", { children: title }),
|
|
25542
|
+
/* @__PURE__ */ jsx(
|
|
25543
|
+
"span",
|
|
25544
|
+
{
|
|
25545
|
+
className: classNames66(
|
|
25546
|
+
"text-xs opacity-60 transition-transform duration-150",
|
|
25547
|
+
!collapsed && "rotate-90"
|
|
25548
|
+
),
|
|
25549
|
+
"aria-hidden": "true",
|
|
25550
|
+
children: "\u203A"
|
|
25551
|
+
}
|
|
25552
|
+
)
|
|
25553
|
+
]
|
|
25554
|
+
}
|
|
25555
|
+
) : /* @__PURE__ */ jsx(
|
|
25556
|
+
"h2",
|
|
25557
|
+
{
|
|
25558
|
+
className: classNames66(
|
|
25559
|
+
"eui-markdown-toc-title",
|
|
25560
|
+
"text-sm font-semibold uppercase tracking-wide",
|
|
25561
|
+
"text-gray-900 dark:text-gray-100",
|
|
25562
|
+
titleClassName
|
|
25563
|
+
),
|
|
25564
|
+
children: title
|
|
25565
|
+
}
|
|
25566
|
+
) }) : null,
|
|
25567
|
+
!collapsed ? /* @__PURE__ */ jsx(
|
|
25568
|
+
"nav",
|
|
25569
|
+
{
|
|
25570
|
+
className: classNames66(
|
|
25571
|
+
"eui-markdown-toc-list",
|
|
25572
|
+
"space-y-1",
|
|
25573
|
+
listClassName
|
|
25574
|
+
),
|
|
25575
|
+
"aria-label": title || "Markdown table of contents",
|
|
25576
|
+
children: tocHeadings.map((heading) => /* @__PURE__ */ jsx(
|
|
25577
|
+
MarkdownTOCItem_default,
|
|
25578
|
+
{
|
|
25579
|
+
heading,
|
|
25580
|
+
active: activeHeading === heading.id,
|
|
25581
|
+
numbered,
|
|
25582
|
+
sanitizeLabel: sanitizeLabels,
|
|
25583
|
+
indentSize,
|
|
25584
|
+
className: itemClassName,
|
|
25585
|
+
activeClassName: activeItemClassName,
|
|
25586
|
+
inactiveClassName: inactiveItemClassName,
|
|
25587
|
+
onSelect: handleSelect
|
|
25588
|
+
},
|
|
25589
|
+
heading.id
|
|
25590
|
+
))
|
|
25591
|
+
}
|
|
25592
|
+
) : null
|
|
25593
|
+
] });
|
|
25594
|
+
return /* @__PURE__ */ jsx("aside", { className: classNames66("eui-markdown-toc", "space-y-4", className), children: content });
|
|
25595
|
+
}
|
|
25596
|
+
var MarkdownTOC_default = MarkdownTOC;
|
|
25597
|
+
var DEFAULT_MARKDOWN_TOOLBAR_ACTIONS = [
|
|
25598
|
+
{
|
|
25599
|
+
id: "heading-1",
|
|
25600
|
+
label: "H1",
|
|
25601
|
+
title: "Heading 1"
|
|
25602
|
+
},
|
|
25603
|
+
{
|
|
25604
|
+
id: "heading-2",
|
|
25605
|
+
label: "H2",
|
|
25606
|
+
title: "Heading 2"
|
|
25607
|
+
},
|
|
25608
|
+
{
|
|
25609
|
+
id: "heading-3",
|
|
25610
|
+
label: "H3",
|
|
25611
|
+
title: "Heading 3"
|
|
25612
|
+
},
|
|
25613
|
+
{
|
|
25614
|
+
id: "bold",
|
|
25615
|
+
label: "B",
|
|
25616
|
+
title: "Bold",
|
|
25617
|
+
shortcut: "Ctrl+B"
|
|
25618
|
+
},
|
|
25619
|
+
{
|
|
25620
|
+
id: "italic",
|
|
25621
|
+
label: "I",
|
|
25622
|
+
title: "Italic",
|
|
25623
|
+
shortcut: "Ctrl+I"
|
|
25624
|
+
},
|
|
25625
|
+
{
|
|
25626
|
+
id: "strike",
|
|
25627
|
+
label: "S",
|
|
25628
|
+
title: "Strikethrough"
|
|
25629
|
+
},
|
|
25630
|
+
{
|
|
25631
|
+
id: "inline-code",
|
|
25632
|
+
label: "`",
|
|
25633
|
+
title: "Inline code"
|
|
25634
|
+
},
|
|
25635
|
+
{
|
|
25636
|
+
id: "code-block",
|
|
25637
|
+
label: "{}",
|
|
25638
|
+
title: "Code block"
|
|
25639
|
+
},
|
|
25640
|
+
{
|
|
25641
|
+
id: "link",
|
|
25642
|
+
label: "Link",
|
|
25643
|
+
title: "Link"
|
|
25644
|
+
},
|
|
25645
|
+
{
|
|
25646
|
+
id: "image",
|
|
25647
|
+
label: "Img",
|
|
25648
|
+
title: "Image"
|
|
25649
|
+
},
|
|
25650
|
+
{
|
|
25651
|
+
id: "unordered-list",
|
|
25652
|
+
label: "\u2022 List",
|
|
25653
|
+
title: "Bullet list"
|
|
25654
|
+
},
|
|
25655
|
+
{
|
|
25656
|
+
id: "ordered-list",
|
|
25657
|
+
label: "1. List",
|
|
25658
|
+
title: "Numbered list"
|
|
25659
|
+
},
|
|
25660
|
+
{
|
|
25661
|
+
id: "quote",
|
|
25662
|
+
label: "Quote",
|
|
25663
|
+
title: "Blockquote"
|
|
25664
|
+
},
|
|
25665
|
+
{
|
|
25666
|
+
id: "table",
|
|
25667
|
+
label: "Table",
|
|
25668
|
+
title: "Table"
|
|
25669
|
+
},
|
|
25670
|
+
{
|
|
25671
|
+
id: "hr",
|
|
25672
|
+
label: "\u2014",
|
|
25673
|
+
title: "Horizontal rule"
|
|
25674
|
+
}
|
|
25675
|
+
];
|
|
25676
|
+
function MarkdownToolbar({
|
|
25677
|
+
actions = DEFAULT_MARKDOWN_TOOLBAR_ACTIONS,
|
|
25678
|
+
disabled = false,
|
|
25679
|
+
actionsDisabled = false,
|
|
25680
|
+
compact = false,
|
|
25681
|
+
viewMode = "preview",
|
|
25682
|
+
showViewModeToggle = true,
|
|
25683
|
+
onViewModeToggle,
|
|
25684
|
+
className,
|
|
25685
|
+
buttonClassName,
|
|
25686
|
+
toggleButtonClassName,
|
|
25687
|
+
onAction
|
|
25688
|
+
}) {
|
|
25689
|
+
const isPreviewMode = viewMode === "preview";
|
|
25690
|
+
return /* @__PURE__ */ jsxs(
|
|
25691
|
+
"div",
|
|
25692
|
+
{
|
|
25693
|
+
className: classNames66(
|
|
25694
|
+
"eui-markdown-toolbar",
|
|
25695
|
+
"flex flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 p-2",
|
|
25696
|
+
"dark:border-gray-700 dark:bg-gray-900",
|
|
25697
|
+
className
|
|
25698
|
+
),
|
|
25699
|
+
children: [
|
|
25700
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-1", children: actions.map((action) => /* @__PURE__ */ jsx(
|
|
25701
|
+
"button",
|
|
25702
|
+
{
|
|
25703
|
+
type: "button",
|
|
25704
|
+
disabled: disabled || actionsDisabled,
|
|
25705
|
+
title: action.shortcut ? `${action.title || action.label} (${action.shortcut})` : action.title || action.label,
|
|
25706
|
+
onClick: () => onAction?.(action.id),
|
|
25707
|
+
className: classNames66(
|
|
25708
|
+
"eui-markdown-toolbar-button",
|
|
25709
|
+
"inline-flex items-center justify-center rounded border border-transparent",
|
|
25710
|
+
"text-gray-700 transition-colors hover:border-gray-300 hover:bg-white",
|
|
25711
|
+
"dark:text-gray-200 dark:hover:border-gray-600 dark:hover:bg-gray-800",
|
|
25712
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
25713
|
+
compact ? "h-7 px-2 text-xs" : "h-8 px-2.5 text-sm",
|
|
25714
|
+
buttonClassName
|
|
25715
|
+
),
|
|
25716
|
+
children: action.label
|
|
25717
|
+
},
|
|
25718
|
+
action.id
|
|
25719
|
+
)) }),
|
|
25720
|
+
showViewModeToggle ? /* @__PURE__ */ jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsx(
|
|
25721
|
+
"button",
|
|
25722
|
+
{
|
|
25723
|
+
type: "button",
|
|
25724
|
+
disabled,
|
|
25725
|
+
onClick: onViewModeToggle,
|
|
25726
|
+
title: isPreviewMode ? "Switch to Markdown syntax" : "Switch to preview",
|
|
25727
|
+
className: classNames66(
|
|
25728
|
+
"eui-markdown-view-toggle",
|
|
25729
|
+
"inline-flex items-center justify-center rounded border font-medium transition-colors",
|
|
25730
|
+
"border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
25731
|
+
"dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:hover:bg-gray-700",
|
|
25732
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
25733
|
+
compact ? "h-7 px-2 text-xs" : "h-8 px-3 text-sm",
|
|
25734
|
+
toggleButtonClassName
|
|
25735
|
+
),
|
|
25736
|
+
children: isPreviewMode ? "Syntax" : "Preview"
|
|
25737
|
+
}
|
|
25738
|
+
) }) : null
|
|
25739
|
+
]
|
|
25740
|
+
}
|
|
25741
|
+
);
|
|
25742
|
+
}
|
|
25743
|
+
var MarkdownToolbar_default = MarkdownToolbar;
|
|
25744
|
+
function getLineRange(value, start, end) {
|
|
25745
|
+
const lineStart = value.lastIndexOf("\n", start - 1) + 1;
|
|
25746
|
+
const lineEndIndex = value.indexOf("\n", end);
|
|
25747
|
+
return {
|
|
25748
|
+
lineStart,
|
|
25749
|
+
lineEnd: lineEndIndex === -1 ? value.length : lineEndIndex
|
|
25750
|
+
};
|
|
25751
|
+
}
|
|
25752
|
+
function replaceRange(value, start, end, replacement) {
|
|
25753
|
+
return value.slice(0, start) + replacement + value.slice(end);
|
|
25754
|
+
}
|
|
25755
|
+
function wrapSelection(value, start, end, before, after = before, placeholder = "text") {
|
|
25756
|
+
const selected = value.slice(start, end);
|
|
25757
|
+
const content = selected || placeholder;
|
|
25758
|
+
const replacement = `${before}${content}${after}`;
|
|
25759
|
+
const nextValue = replaceRange(value, start, end, replacement);
|
|
25760
|
+
const selectionStart = start + before.length;
|
|
25761
|
+
const selectionEnd = selectionStart + content.length;
|
|
25762
|
+
return {
|
|
25763
|
+
value: nextValue,
|
|
25764
|
+
selectionStart,
|
|
25765
|
+
selectionEnd
|
|
25766
|
+
};
|
|
25767
|
+
}
|
|
25768
|
+
function prefixSelectedLines(value, start, end, getPrefix) {
|
|
25769
|
+
const { lineStart, lineEnd } = getLineRange(value, start, end);
|
|
25770
|
+
const selectedBlock = value.slice(lineStart, lineEnd);
|
|
25771
|
+
const lines = selectedBlock.split("\n");
|
|
25772
|
+
const replacement = lines.map((line, index) => {
|
|
25773
|
+
const prefix = getPrefix(index);
|
|
25774
|
+
if (line.startsWith(prefix)) {
|
|
25775
|
+
return line;
|
|
25776
|
+
}
|
|
25777
|
+
return `${prefix}${line}`;
|
|
25778
|
+
}).join("\n");
|
|
25779
|
+
const nextValue = replaceRange(value, lineStart, lineEnd, replacement);
|
|
25780
|
+
const delta = replacement.length - selectedBlock.length;
|
|
25781
|
+
return {
|
|
25782
|
+
value: nextValue,
|
|
25783
|
+
selectionStart: start + getPrefix(0).length,
|
|
25784
|
+
selectionEnd: end + delta
|
|
25785
|
+
};
|
|
25786
|
+
}
|
|
25787
|
+
function prefixCurrentLine(value, start, end, prefix) {
|
|
25788
|
+
const { lineStart, lineEnd } = getLineRange(value, start, end);
|
|
25789
|
+
const line = value.slice(lineStart, lineEnd);
|
|
25790
|
+
const cleanedLine = line.replace(/^#{1,6}\s+/, "");
|
|
25791
|
+
const replacement = `${prefix}${cleanedLine}`;
|
|
25792
|
+
const nextValue = replaceRange(value, lineStart, lineEnd, replacement);
|
|
25793
|
+
return {
|
|
25794
|
+
value: nextValue,
|
|
25795
|
+
selectionStart: lineStart + prefix.length,
|
|
25796
|
+
selectionEnd: lineStart + replacement.length
|
|
25797
|
+
};
|
|
25798
|
+
}
|
|
25799
|
+
function insertBlock(value, start, end, block) {
|
|
25800
|
+
const before = value.slice(0, start);
|
|
25801
|
+
const after = value.slice(end);
|
|
25802
|
+
const needsLeadingNewline = before.length > 0 && !before.endsWith("\n");
|
|
25803
|
+
const needsTrailingNewline = after.length > 0 && !after.startsWith("\n");
|
|
25804
|
+
const replacement = `${needsLeadingNewline ? "\n" : ""}${block}${needsTrailingNewline ? "\n" : ""}`;
|
|
25805
|
+
const nextValue = replaceRange(value, start, end, replacement);
|
|
25806
|
+
const selectionStart = start + (needsLeadingNewline ? 1 : 0);
|
|
25807
|
+
const selectionEnd = selectionStart + block.length;
|
|
25808
|
+
return {
|
|
25809
|
+
value: nextValue,
|
|
25810
|
+
selectionStart,
|
|
25811
|
+
selectionEnd
|
|
25812
|
+
};
|
|
25813
|
+
}
|
|
25814
|
+
function applyMarkdownAction(value, start, end, action) {
|
|
25815
|
+
switch (action) {
|
|
25816
|
+
case "heading-1":
|
|
25817
|
+
return prefixCurrentLine(value, start, end, "# ");
|
|
25818
|
+
case "heading-2":
|
|
25819
|
+
return prefixCurrentLine(value, start, end, "## ");
|
|
25820
|
+
case "heading-3":
|
|
25821
|
+
return prefixCurrentLine(value, start, end, "### ");
|
|
25822
|
+
case "bold":
|
|
25823
|
+
return wrapSelection(value, start, end, "**", "**", "bold text");
|
|
25824
|
+
case "italic":
|
|
25825
|
+
return wrapSelection(value, start, end, "_", "_", "italic text");
|
|
25826
|
+
case "strike":
|
|
25827
|
+
return wrapSelection(value, start, end, "~~", "~~", "strikethrough text");
|
|
25828
|
+
case "inline-code":
|
|
25829
|
+
return wrapSelection(value, start, end, "`", "`", "code");
|
|
25830
|
+
case "code-block": {
|
|
25831
|
+
const selected = value.slice(start, end) || "code";
|
|
25832
|
+
return insertBlock(value, start, end, `\`\`\`ts
|
|
25833
|
+
${selected}
|
|
25834
|
+
\`\`\``);
|
|
25835
|
+
}
|
|
25836
|
+
case "link": {
|
|
25837
|
+
const selected = value.slice(start, end) || "link text";
|
|
25838
|
+
const replacement = `[${selected}](https://example.com)`;
|
|
25839
|
+
const nextValue = replaceRange(value, start, end, replacement);
|
|
25840
|
+
return {
|
|
25841
|
+
value: nextValue,
|
|
25842
|
+
selectionStart: start + 1,
|
|
25843
|
+
selectionEnd: start + 1 + selected.length
|
|
25844
|
+
};
|
|
25845
|
+
}
|
|
25846
|
+
case "image": {
|
|
25847
|
+
const selected = value.slice(start, end) || "image alt";
|
|
25848
|
+
const replacement = ``;
|
|
25849
|
+
const nextValue = replaceRange(value, start, end, replacement);
|
|
25850
|
+
return {
|
|
25851
|
+
value: nextValue,
|
|
25852
|
+
selectionStart: start + 2,
|
|
25853
|
+
selectionEnd: start + 2 + selected.length
|
|
25854
|
+
};
|
|
25855
|
+
}
|
|
25856
|
+
case "unordered-list":
|
|
25857
|
+
return prefixSelectedLines(value, start, end, () => "- ");
|
|
25858
|
+
case "ordered-list":
|
|
25859
|
+
return prefixSelectedLines(
|
|
25860
|
+
value,
|
|
25861
|
+
start,
|
|
25862
|
+
end,
|
|
25863
|
+
(index) => `${index + 1}. `
|
|
25864
|
+
);
|
|
25865
|
+
case "quote":
|
|
25866
|
+
return prefixSelectedLines(value, start, end, () => "> ");
|
|
25867
|
+
case "table":
|
|
25868
|
+
return insertBlock(
|
|
25869
|
+
value,
|
|
25870
|
+
start,
|
|
25871
|
+
end,
|
|
25872
|
+
[
|
|
25873
|
+
"| Column 1 | Column 2 | Column 3 |",
|
|
25874
|
+
"| --- | --- | --- |",
|
|
25875
|
+
"| Value 1 | Value 2 | Value 3 |"
|
|
25876
|
+
].join("\n")
|
|
25877
|
+
);
|
|
25878
|
+
case "hr":
|
|
25879
|
+
return insertBlock(value, start, end, "---");
|
|
25880
|
+
default:
|
|
25881
|
+
return {
|
|
25882
|
+
value,
|
|
25883
|
+
selectionStart: start,
|
|
25884
|
+
selectionEnd: end
|
|
25885
|
+
};
|
|
25886
|
+
}
|
|
25887
|
+
}
|
|
25888
|
+
function MarkdownSourceEditor({
|
|
25889
|
+
value,
|
|
25890
|
+
defaultValue = "",
|
|
25891
|
+
onChange,
|
|
25892
|
+
onBlur,
|
|
25893
|
+
viewMode,
|
|
25894
|
+
defaultViewMode = "preview",
|
|
25895
|
+
onViewModeChange,
|
|
25896
|
+
showToolbar = true,
|
|
25897
|
+
showViewModeToggle = true,
|
|
25898
|
+
toolbarProps,
|
|
25899
|
+
previewProps,
|
|
25900
|
+
minHeight = 260,
|
|
25901
|
+
maxHeight,
|
|
25902
|
+
disabled = false,
|
|
25903
|
+
readOnly = false,
|
|
25904
|
+
placeholder = "Write markdown...",
|
|
25905
|
+
containerClassName,
|
|
25906
|
+
toolbarClassName,
|
|
25907
|
+
textareaClassName,
|
|
25908
|
+
previewClassName,
|
|
25909
|
+
className,
|
|
25910
|
+
onKeyDown,
|
|
25911
|
+
...props
|
|
25912
|
+
}) {
|
|
25913
|
+
const textareaRef = useRef(null);
|
|
25914
|
+
const isControlled = value !== void 0;
|
|
25915
|
+
const isViewModeControlled = viewMode !== void 0;
|
|
25916
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
25917
|
+
const [internalViewMode, setInternalViewMode] = useState(defaultViewMode);
|
|
25918
|
+
const currentValue = isControlled ? value : internalValue;
|
|
25919
|
+
const currentViewMode = isViewModeControlled ? viewMode : internalViewMode;
|
|
25920
|
+
const resolvedValue = currentValue ?? "";
|
|
25921
|
+
useEffect(() => {
|
|
25922
|
+
if (!isControlled) {
|
|
25923
|
+
setInternalValue(defaultValue);
|
|
25924
|
+
}
|
|
25925
|
+
}, [defaultValue, isControlled]);
|
|
25926
|
+
useEffect(() => {
|
|
25927
|
+
if (!isViewModeControlled) {
|
|
25928
|
+
setInternalViewMode(defaultViewMode);
|
|
25929
|
+
}
|
|
25930
|
+
}, [defaultViewMode, isViewModeControlled]);
|
|
25931
|
+
const updateValue = (nextValue) => {
|
|
25932
|
+
if (!isControlled) {
|
|
25933
|
+
setInternalValue(nextValue);
|
|
25934
|
+
}
|
|
25935
|
+
onChange?.(nextValue);
|
|
25936
|
+
};
|
|
25937
|
+
const updateViewMode = (nextViewMode) => {
|
|
25938
|
+
if (!isViewModeControlled) {
|
|
25939
|
+
setInternalViewMode(nextViewMode);
|
|
25940
|
+
}
|
|
25941
|
+
onViewModeChange?.(nextViewMode);
|
|
25942
|
+
};
|
|
25943
|
+
const toggleViewMode = () => {
|
|
25944
|
+
updateViewMode(currentViewMode === "preview" ? "source" : "preview");
|
|
25945
|
+
};
|
|
25946
|
+
const runAction = (action) => {
|
|
25947
|
+
const textarea = textareaRef.current;
|
|
25948
|
+
if (!textarea || disabled || readOnly) return;
|
|
25949
|
+
const start = textarea.selectionStart;
|
|
25950
|
+
const end = textarea.selectionEnd;
|
|
25951
|
+
const result = applyMarkdownAction(resolvedValue, start, end, action);
|
|
25952
|
+
updateValue(result.value);
|
|
25953
|
+
window.setTimeout(() => {
|
|
25954
|
+
textarea.focus();
|
|
25955
|
+
textarea.setSelectionRange(result.selectionStart, result.selectionEnd);
|
|
25956
|
+
}, 0);
|
|
25957
|
+
};
|
|
25958
|
+
const handleToolbarAction = (action) => {
|
|
25959
|
+
if (currentViewMode === "preview") {
|
|
25960
|
+
updateViewMode("source");
|
|
25961
|
+
window.setTimeout(() => {
|
|
25962
|
+
runAction(action);
|
|
25963
|
+
}, 0);
|
|
25964
|
+
return;
|
|
25965
|
+
}
|
|
25966
|
+
runAction(action);
|
|
25967
|
+
};
|
|
25968
|
+
const handleKeyDown = (event) => {
|
|
25969
|
+
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === "b") {
|
|
25970
|
+
event.preventDefault();
|
|
25971
|
+
runAction("bold");
|
|
25972
|
+
return;
|
|
25973
|
+
}
|
|
25974
|
+
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === "i") {
|
|
25975
|
+
event.preventDefault();
|
|
25976
|
+
runAction("italic");
|
|
25977
|
+
return;
|
|
25978
|
+
}
|
|
25979
|
+
onKeyDown?.(event);
|
|
25980
|
+
};
|
|
25981
|
+
return /* @__PURE__ */ jsxs(
|
|
25982
|
+
"div",
|
|
25983
|
+
{
|
|
25984
|
+
className: classNames66(
|
|
25985
|
+
"eui-markdown-editor",
|
|
25986
|
+
"overflow-hidden rounded border border-gray-300 bg-white",
|
|
25987
|
+
"dark:border-gray-700 dark:bg-gray-950",
|
|
25988
|
+
containerClassName,
|
|
25989
|
+
className
|
|
25990
|
+
),
|
|
25991
|
+
children: [
|
|
25992
|
+
showToolbar ? /* @__PURE__ */ jsx(
|
|
25993
|
+
MarkdownToolbar_default,
|
|
25994
|
+
{
|
|
25995
|
+
...toolbarProps,
|
|
25996
|
+
disabled,
|
|
25997
|
+
actionsDisabled: readOnly,
|
|
25998
|
+
viewMode: currentViewMode,
|
|
25999
|
+
showViewModeToggle,
|
|
26000
|
+
className: classNames66(toolbarClassName, toolbarProps?.className),
|
|
26001
|
+
onViewModeToggle: toggleViewMode,
|
|
26002
|
+
onAction: handleToolbarAction
|
|
26003
|
+
}
|
|
26004
|
+
) : null,
|
|
26005
|
+
currentViewMode === "preview" ? /* @__PURE__ */ jsx(
|
|
26006
|
+
"div",
|
|
26007
|
+
{
|
|
26008
|
+
className: classNames66(
|
|
26009
|
+
"eui-markdown-editor-preview",
|
|
26010
|
+
"min-h-[260px] p-4",
|
|
26011
|
+
previewClassName
|
|
26012
|
+
),
|
|
26013
|
+
style: {
|
|
26014
|
+
minHeight,
|
|
26015
|
+
maxHeight
|
|
26016
|
+
},
|
|
26017
|
+
children: resolvedValue.trim() ? /* @__PURE__ */ jsx(MarkdownViewer_default, { ...previewProps, value: resolvedValue }) : /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: placeholder })
|
|
26018
|
+
}
|
|
26019
|
+
) : /* @__PURE__ */ jsx(
|
|
26020
|
+
"textarea",
|
|
26021
|
+
{
|
|
26022
|
+
...props,
|
|
26023
|
+
ref: textareaRef,
|
|
26024
|
+
value: resolvedValue,
|
|
26025
|
+
disabled,
|
|
26026
|
+
readOnly,
|
|
26027
|
+
placeholder,
|
|
26028
|
+
onChange: (event) => updateValue(event.target.value),
|
|
26029
|
+
onBlur,
|
|
26030
|
+
onKeyDown: handleKeyDown,
|
|
26031
|
+
className: classNames66(
|
|
26032
|
+
"eui-markdown-source-textarea",
|
|
26033
|
+
"block w-full resize-y border-0 bg-transparent p-4 font-mono text-sm leading-7",
|
|
26034
|
+
"text-gray-900 outline-none placeholder:text-gray-400",
|
|
26035
|
+
"dark:text-gray-100 dark:placeholder:text-gray-500",
|
|
26036
|
+
"disabled:cursor-not-allowed disabled:opacity-60",
|
|
26037
|
+
textareaClassName
|
|
26038
|
+
),
|
|
26039
|
+
style: {
|
|
26040
|
+
minHeight,
|
|
26041
|
+
maxHeight,
|
|
26042
|
+
...props.style
|
|
26043
|
+
}
|
|
26044
|
+
}
|
|
26045
|
+
)
|
|
26046
|
+
]
|
|
26047
|
+
}
|
|
26048
|
+
);
|
|
26049
|
+
}
|
|
26050
|
+
var MarkdownSourceEditor_default = MarkdownSourceEditor;
|
|
26051
|
+
function MarkdownPreviewPane({
|
|
26052
|
+
value = "",
|
|
26053
|
+
emptyState = /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Nothing to preview yet." }),
|
|
26054
|
+
className,
|
|
26055
|
+
contentClassName,
|
|
26056
|
+
...viewerProps
|
|
26057
|
+
}) {
|
|
26058
|
+
return /* @__PURE__ */ jsx(
|
|
26059
|
+
"div",
|
|
26060
|
+
{
|
|
26061
|
+
className: classNames66(
|
|
26062
|
+
"eui-markdown-preview-pane",
|
|
26063
|
+
"rounded border border-gray-300 bg-white p-4",
|
|
26064
|
+
"dark:border-gray-700 dark:bg-gray-950",
|
|
26065
|
+
className
|
|
26066
|
+
),
|
|
26067
|
+
children: value.trim() ? /* @__PURE__ */ jsx(
|
|
26068
|
+
MarkdownViewer_default,
|
|
26069
|
+
{
|
|
26070
|
+
...viewerProps,
|
|
26071
|
+
value,
|
|
26072
|
+
className: contentClassName
|
|
26073
|
+
}
|
|
26074
|
+
) : emptyState
|
|
26075
|
+
}
|
|
26076
|
+
);
|
|
26077
|
+
}
|
|
26078
|
+
var MarkdownPreviewPane_default = MarkdownPreviewPane;
|
|
26079
|
+
function MarkdownSplitEditor({
|
|
26080
|
+
value,
|
|
26081
|
+
defaultValue = "",
|
|
26082
|
+
onChange,
|
|
26083
|
+
onBlur,
|
|
26084
|
+
previewProps,
|
|
26085
|
+
previewPlacement = "right",
|
|
26086
|
+
sourceLabel = "Editor",
|
|
26087
|
+
previewLabel = "Preview",
|
|
26088
|
+
wrapperClassName,
|
|
26089
|
+
sourceWrapperClassName,
|
|
26090
|
+
previewWrapperClassName,
|
|
26091
|
+
...sourceEditorProps
|
|
26092
|
+
}) {
|
|
26093
|
+
const isControlled = value !== void 0;
|
|
26094
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
26095
|
+
const currentValue = isControlled ? value : internalValue;
|
|
26096
|
+
useEffect(() => {
|
|
26097
|
+
if (!isControlled) {
|
|
26098
|
+
setInternalValue(defaultValue);
|
|
26099
|
+
}
|
|
26100
|
+
}, [defaultValue, isControlled]);
|
|
26101
|
+
const updateValue = (nextValue) => {
|
|
26102
|
+
if (!isControlled) {
|
|
26103
|
+
setInternalValue(nextValue);
|
|
26104
|
+
}
|
|
26105
|
+
onChange?.(nextValue);
|
|
26106
|
+
};
|
|
26107
|
+
const isHorizontal = previewPlacement === "right";
|
|
26108
|
+
return /* @__PURE__ */ jsxs(
|
|
26109
|
+
"div",
|
|
26110
|
+
{
|
|
26111
|
+
className: classNames66(
|
|
26112
|
+
"eui-markdown-split-editor",
|
|
26113
|
+
"grid gap-4",
|
|
26114
|
+
isHorizontal ? "grid-cols-1 lg:grid-cols-2" : "grid-cols-1",
|
|
26115
|
+
wrapperClassName
|
|
26116
|
+
),
|
|
26117
|
+
children: [
|
|
26118
|
+
/* @__PURE__ */ jsxs(
|
|
26119
|
+
"div",
|
|
26120
|
+
{
|
|
26121
|
+
className: classNames66(
|
|
26122
|
+
"eui-markdown-split-source",
|
|
26123
|
+
"min-w-0 space-y-2",
|
|
26124
|
+
sourceWrapperClassName
|
|
26125
|
+
),
|
|
26126
|
+
children: [
|
|
26127
|
+
sourceLabel ? /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-gray-700 dark:text-gray-200", children: sourceLabel }) : null,
|
|
26128
|
+
/* @__PURE__ */ jsx(
|
|
26129
|
+
MarkdownSourceEditor_default,
|
|
26130
|
+
{
|
|
26131
|
+
...sourceEditorProps,
|
|
26132
|
+
value: currentValue,
|
|
26133
|
+
onChange: updateValue,
|
|
26134
|
+
onBlur,
|
|
26135
|
+
defaultViewMode: "source",
|
|
26136
|
+
showViewModeToggle: false
|
|
26137
|
+
}
|
|
26138
|
+
)
|
|
26139
|
+
]
|
|
26140
|
+
}
|
|
26141
|
+
),
|
|
26142
|
+
/* @__PURE__ */ jsxs(
|
|
26143
|
+
"div",
|
|
26144
|
+
{
|
|
26145
|
+
className: classNames66(
|
|
26146
|
+
"eui-markdown-split-preview",
|
|
26147
|
+
"min-w-0 space-y-2",
|
|
26148
|
+
previewWrapperClassName
|
|
26149
|
+
),
|
|
26150
|
+
children: [
|
|
26151
|
+
previewLabel ? /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-gray-700 dark:text-gray-200", children: previewLabel }) : null,
|
|
26152
|
+
/* @__PURE__ */ jsx(MarkdownPreviewPane_default, { ...previewProps, value: currentValue })
|
|
26153
|
+
]
|
|
26154
|
+
}
|
|
26155
|
+
)
|
|
26156
|
+
]
|
|
26157
|
+
}
|
|
26158
|
+
);
|
|
26159
|
+
}
|
|
26160
|
+
var MarkdownSplitEditor_default = MarkdownSplitEditor;
|
|
26161
|
+
function MarkdownEditor({
|
|
26162
|
+
value,
|
|
26163
|
+
defaultValue = "",
|
|
26164
|
+
onChange,
|
|
26165
|
+
onBlur,
|
|
26166
|
+
mode = "source",
|
|
26167
|
+
viewMode,
|
|
26168
|
+
defaultViewMode = "preview",
|
|
26169
|
+
onViewModeChange,
|
|
26170
|
+
splitProps,
|
|
26171
|
+
richEditor,
|
|
26172
|
+
...sourceEditorProps
|
|
26173
|
+
}) {
|
|
26174
|
+
const isControlled = value !== void 0;
|
|
26175
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
26176
|
+
const currentValue = isControlled ? value : internalValue;
|
|
26177
|
+
useEffect(() => {
|
|
26178
|
+
if (!isControlled) {
|
|
26179
|
+
setInternalValue(defaultValue);
|
|
26180
|
+
}
|
|
26181
|
+
}, [defaultValue, isControlled]);
|
|
26182
|
+
const updateValue = (nextValue) => {
|
|
26183
|
+
if (!isControlled) {
|
|
26184
|
+
setInternalValue(nextValue);
|
|
26185
|
+
}
|
|
26186
|
+
onChange?.(nextValue);
|
|
26187
|
+
};
|
|
26188
|
+
if (mode === "rich" && richEditor) {
|
|
26189
|
+
return /* @__PURE__ */ jsx(Fragment, { children: richEditor });
|
|
26190
|
+
}
|
|
26191
|
+
if (mode === "split") {
|
|
26192
|
+
return /* @__PURE__ */ jsx(
|
|
26193
|
+
MarkdownSplitEditor_default,
|
|
26194
|
+
{
|
|
26195
|
+
...sourceEditorProps,
|
|
26196
|
+
...splitProps,
|
|
26197
|
+
value: currentValue,
|
|
26198
|
+
onChange: updateValue,
|
|
26199
|
+
onBlur
|
|
26200
|
+
}
|
|
26201
|
+
);
|
|
26202
|
+
}
|
|
26203
|
+
return /* @__PURE__ */ jsx(
|
|
26204
|
+
MarkdownSourceEditor_default,
|
|
26205
|
+
{
|
|
26206
|
+
...sourceEditorProps,
|
|
26207
|
+
value: currentValue,
|
|
26208
|
+
onChange: updateValue,
|
|
26209
|
+
onBlur,
|
|
26210
|
+
viewMode,
|
|
26211
|
+
defaultViewMode,
|
|
26212
|
+
onViewModeChange
|
|
26213
|
+
}
|
|
26214
|
+
);
|
|
26215
|
+
}
|
|
26216
|
+
var MarkdownEditor_default = MarkdownEditor;
|
|
26217
|
+
function MarkdownField({
|
|
26218
|
+
name,
|
|
26219
|
+
validate,
|
|
26220
|
+
label,
|
|
26221
|
+
helperText,
|
|
26222
|
+
wrapperClassName,
|
|
26223
|
+
labelClassName,
|
|
26224
|
+
helperTextClassName,
|
|
26225
|
+
...editorProps
|
|
26226
|
+
}) {
|
|
26227
|
+
const [field, meta, helpers] = useField({
|
|
26228
|
+
name,
|
|
26229
|
+
validate
|
|
26230
|
+
});
|
|
26231
|
+
const hasError = Boolean(meta.touched && meta.error);
|
|
26232
|
+
return /* @__PURE__ */ jsxs(
|
|
26233
|
+
"div",
|
|
26234
|
+
{
|
|
26235
|
+
className: classNames66(
|
|
26236
|
+
"eui-markdown-field",
|
|
26237
|
+
"relative space-y-2",
|
|
26238
|
+
wrapperClassName
|
|
26239
|
+
),
|
|
26240
|
+
children: [
|
|
26241
|
+
label ? /* @__PURE__ */ jsx(
|
|
26242
|
+
"label",
|
|
26243
|
+
{
|
|
26244
|
+
htmlFor: editorProps.id || field.name,
|
|
26245
|
+
className: classNames66(
|
|
26246
|
+
"block text-sm font-medium text-gray-700 dark:text-gray-200",
|
|
26247
|
+
labelClassName
|
|
26248
|
+
),
|
|
26249
|
+
children: label
|
|
26250
|
+
}
|
|
26251
|
+
) : null,
|
|
26252
|
+
/* @__PURE__ */ jsx(
|
|
26253
|
+
MarkdownEditor_default,
|
|
26254
|
+
{
|
|
26255
|
+
...editorProps,
|
|
26256
|
+
id: editorProps.id || field.name,
|
|
26257
|
+
name: field.name,
|
|
26258
|
+
value: field.value || "",
|
|
26259
|
+
onChange: (nextValue) => {
|
|
26260
|
+
helpers.setValue(nextValue);
|
|
26261
|
+
},
|
|
26262
|
+
onBlur: () => {
|
|
26263
|
+
helpers.setTouched(true);
|
|
26264
|
+
}
|
|
26265
|
+
}
|
|
26266
|
+
),
|
|
26267
|
+
helperText && !hasError ? /* @__PURE__ */ jsx(
|
|
26268
|
+
"p",
|
|
26269
|
+
{
|
|
26270
|
+
className: classNames66(
|
|
26271
|
+
"text-sm text-gray-500 dark:text-gray-400",
|
|
26272
|
+
helperTextClassName
|
|
26273
|
+
),
|
|
26274
|
+
children: helperText
|
|
26275
|
+
}
|
|
26276
|
+
) : null,
|
|
26277
|
+
/* @__PURE__ */ jsx(InputResponse_default, { name: field.name, visibility: hasError, variant: "danger" })
|
|
26278
|
+
]
|
|
26279
|
+
}
|
|
26280
|
+
);
|
|
26281
|
+
}
|
|
26282
|
+
var MarkdownField_default = MarkdownField;
|
|
26283
|
+
function resolveSize(value) {
|
|
26284
|
+
if (value === void 0) return void 0;
|
|
26285
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
26286
|
+
}
|
|
26287
|
+
function MarkdownLayout({
|
|
26288
|
+
children,
|
|
26289
|
+
content,
|
|
26290
|
+
toc,
|
|
26291
|
+
sidebar,
|
|
26292
|
+
aside,
|
|
26293
|
+
header,
|
|
26294
|
+
footer,
|
|
26295
|
+
tocPosition = "right",
|
|
26296
|
+
showToc = true,
|
|
26297
|
+
showSidebar = true,
|
|
26298
|
+
showAside = true,
|
|
26299
|
+
stickyToc = true,
|
|
26300
|
+
stickySidebar = true,
|
|
26301
|
+
stickyAside = true,
|
|
26302
|
+
stickyOffset = "6rem",
|
|
26303
|
+
maxWidth = "1440px",
|
|
26304
|
+
className,
|
|
26305
|
+
containerClassName,
|
|
26306
|
+
gridClassName,
|
|
26307
|
+
contentClassName,
|
|
26308
|
+
tocClassName,
|
|
26309
|
+
sidebarClassName,
|
|
26310
|
+
asideClassName,
|
|
26311
|
+
headerClassName,
|
|
26312
|
+
footerClassName
|
|
26313
|
+
}) {
|
|
26314
|
+
const resolvedContent = children ?? content;
|
|
26315
|
+
const hasToc = showToc && Boolean(toc);
|
|
26316
|
+
const hasSidebar = showSidebar && Boolean(sidebar);
|
|
26317
|
+
const hasAside = showAside && Boolean(aside);
|
|
26318
|
+
const stickyStyle = {
|
|
26319
|
+
top: resolveSize(stickyOffset)
|
|
26320
|
+
};
|
|
26321
|
+
const hasLeftToc = hasToc && tocPosition === "left";
|
|
26322
|
+
const hasRightToc = hasToc && tocPosition === "right";
|
|
26323
|
+
return /* @__PURE__ */ jsx("div", { className: classNames66("eui-markdown-layout", "w-full", className), children: /* @__PURE__ */ jsxs(
|
|
26324
|
+
"div",
|
|
26325
|
+
{
|
|
26326
|
+
className: classNames66(
|
|
26327
|
+
"eui-markdown-layout-container",
|
|
26328
|
+
"mx-auto w-full px-4 sm:px-6 lg:px-8",
|
|
26329
|
+
containerClassName
|
|
26330
|
+
),
|
|
26331
|
+
style: {
|
|
26332
|
+
maxWidth: resolveSize(maxWidth)
|
|
26333
|
+
},
|
|
26334
|
+
children: [
|
|
26335
|
+
header ? /* @__PURE__ */ jsx(
|
|
26336
|
+
"header",
|
|
26337
|
+
{
|
|
26338
|
+
className: classNames66(
|
|
26339
|
+
"eui-markdown-layout-header",
|
|
26340
|
+
"mb-8",
|
|
26341
|
+
headerClassName
|
|
26342
|
+
),
|
|
26343
|
+
children: header
|
|
26344
|
+
}
|
|
26345
|
+
) : null,
|
|
26346
|
+
/* @__PURE__ */ jsxs(
|
|
26347
|
+
"div",
|
|
26348
|
+
{
|
|
26349
|
+
className: classNames66(
|
|
26350
|
+
"eui-markdown-layout-grid",
|
|
26351
|
+
"grid grid-cols-1 gap-8",
|
|
26352
|
+
hasSidebar && hasToc && "xl:grid-cols-[16rem_minmax(0,1fr)_18rem]",
|
|
26353
|
+
hasSidebar && !hasToc && "lg:grid-cols-[16rem_minmax(0,1fr)]",
|
|
26354
|
+
!hasSidebar && hasToc && "lg:grid-cols-[minmax(0,1fr)_18rem]",
|
|
26355
|
+
hasAside && "2xl:grid-cols-[16rem_minmax(0,1fr)_18rem_16rem]",
|
|
26356
|
+
gridClassName
|
|
26357
|
+
),
|
|
26358
|
+
children: [
|
|
26359
|
+
hasSidebar ? /* @__PURE__ */ jsx(
|
|
26360
|
+
"aside",
|
|
26361
|
+
{
|
|
26362
|
+
className: classNames66(
|
|
26363
|
+
"eui-markdown-layout-sidebar",
|
|
26364
|
+
"min-w-0",
|
|
26365
|
+
stickySidebar && "lg:sticky lg:self-start",
|
|
26366
|
+
sidebarClassName
|
|
26367
|
+
),
|
|
26368
|
+
style: stickySidebar ? stickyStyle : void 0,
|
|
26369
|
+
children: sidebar
|
|
26370
|
+
}
|
|
26371
|
+
) : null,
|
|
26372
|
+
hasLeftToc ? /* @__PURE__ */ jsx(
|
|
26373
|
+
"aside",
|
|
26374
|
+
{
|
|
26375
|
+
className: classNames66(
|
|
26376
|
+
"eui-markdown-layout-toc",
|
|
26377
|
+
"min-w-0",
|
|
26378
|
+
stickyToc && "lg:sticky lg:self-start",
|
|
26379
|
+
tocClassName
|
|
26380
|
+
),
|
|
26381
|
+
style: stickyToc ? stickyStyle : void 0,
|
|
26382
|
+
children: toc
|
|
26383
|
+
}
|
|
26384
|
+
) : null,
|
|
26385
|
+
/* @__PURE__ */ jsx(
|
|
26386
|
+
"main",
|
|
26387
|
+
{
|
|
26388
|
+
className: classNames66(
|
|
26389
|
+
"eui-markdown-layout-content",
|
|
26390
|
+
"min-w-0",
|
|
26391
|
+
contentClassName
|
|
26392
|
+
),
|
|
26393
|
+
children: resolvedContent
|
|
26394
|
+
}
|
|
26395
|
+
),
|
|
26396
|
+
hasRightToc ? /* @__PURE__ */ jsx(
|
|
26397
|
+
"aside",
|
|
26398
|
+
{
|
|
26399
|
+
className: classNames66(
|
|
26400
|
+
"eui-markdown-layout-toc",
|
|
26401
|
+
"min-w-0",
|
|
26402
|
+
stickyToc && "lg:sticky lg:self-start",
|
|
26403
|
+
tocClassName
|
|
26404
|
+
),
|
|
26405
|
+
style: stickyToc ? stickyStyle : void 0,
|
|
26406
|
+
children: toc
|
|
26407
|
+
}
|
|
26408
|
+
) : null,
|
|
26409
|
+
hasAside ? /* @__PURE__ */ jsx(
|
|
26410
|
+
"aside",
|
|
26411
|
+
{
|
|
26412
|
+
className: classNames66(
|
|
26413
|
+
"eui-markdown-layout-aside",
|
|
26414
|
+
"min-w-0",
|
|
26415
|
+
stickyAside && "2xl:sticky 2xl:self-start",
|
|
26416
|
+
asideClassName
|
|
26417
|
+
),
|
|
26418
|
+
style: stickyAside ? stickyStyle : void 0,
|
|
26419
|
+
children: aside
|
|
26420
|
+
}
|
|
26421
|
+
) : null
|
|
26422
|
+
]
|
|
26423
|
+
}
|
|
26424
|
+
),
|
|
26425
|
+
footer ? /* @__PURE__ */ jsx(
|
|
26426
|
+
"footer",
|
|
26427
|
+
{
|
|
26428
|
+
className: classNames66(
|
|
26429
|
+
"eui-markdown-layout-footer",
|
|
26430
|
+
"mt-10",
|
|
26431
|
+
footerClassName
|
|
26432
|
+
),
|
|
26433
|
+
children: footer
|
|
26434
|
+
}
|
|
26435
|
+
) : null
|
|
26436
|
+
]
|
|
26437
|
+
}
|
|
26438
|
+
) });
|
|
26439
|
+
}
|
|
26440
|
+
var MarkdownLayout_default = MarkdownLayout;
|
|
26441
|
+
function MarkdownDocsLayoutContent({
|
|
26442
|
+
children,
|
|
26443
|
+
markdown,
|
|
26444
|
+
value,
|
|
26445
|
+
headings,
|
|
26446
|
+
title,
|
|
26447
|
+
description,
|
|
26448
|
+
header,
|
|
26449
|
+
headerActions,
|
|
26450
|
+
content,
|
|
26451
|
+
toc,
|
|
26452
|
+
viewerProps,
|
|
26453
|
+
tocProps,
|
|
26454
|
+
enableDefaultViewer = true,
|
|
26455
|
+
enableDefaultToc = true,
|
|
26456
|
+
docsHeaderClassName,
|
|
26457
|
+
docsTitleClassName,
|
|
26458
|
+
docsDescriptionClassName,
|
|
26459
|
+
...layoutProps
|
|
26460
|
+
}) {
|
|
26461
|
+
const resolvedMarkdown = value ?? markdown ?? "";
|
|
26462
|
+
const resolvedHeader = header ?? (title || description || headerActions ? /* @__PURE__ */ jsx(
|
|
26463
|
+
"div",
|
|
26464
|
+
{
|
|
26465
|
+
className: classNames66(
|
|
26466
|
+
"eui-markdown-docs-header",
|
|
26467
|
+
"flex flex-col gap-4 border-b border-gray-200 pb-6",
|
|
26468
|
+
"dark:border-gray-700",
|
|
26469
|
+
docsHeaderClassName
|
|
26470
|
+
),
|
|
26471
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
26472
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-2", children: [
|
|
26473
|
+
title ? /* @__PURE__ */ jsx(
|
|
26474
|
+
"h1",
|
|
26475
|
+
{
|
|
26476
|
+
className: classNames66(
|
|
26477
|
+
"eui-markdown-docs-title",
|
|
26478
|
+
"text-3xl font-bold tracking-tight text-gray-950",
|
|
26479
|
+
"dark:text-gray-50",
|
|
26480
|
+
docsTitleClassName
|
|
26481
|
+
),
|
|
26482
|
+
children: title
|
|
26483
|
+
}
|
|
26484
|
+
) : null,
|
|
26485
|
+
description ? /* @__PURE__ */ jsx(
|
|
26486
|
+
"div",
|
|
26487
|
+
{
|
|
26488
|
+
className: classNames66(
|
|
26489
|
+
"eui-markdown-docs-description",
|
|
26490
|
+
"max-w-3xl text-base leading-7 text-gray-600",
|
|
26491
|
+
"dark:text-gray-400",
|
|
26492
|
+
docsDescriptionClassName
|
|
26493
|
+
),
|
|
26494
|
+
children: description
|
|
26495
|
+
}
|
|
26496
|
+
) : null
|
|
26497
|
+
] }),
|
|
26498
|
+
headerActions ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: headerActions }) : null
|
|
26499
|
+
] })
|
|
26500
|
+
}
|
|
26501
|
+
) : null);
|
|
26502
|
+
const resolvedContent = children ?? content ?? (enableDefaultViewer ? /* @__PURE__ */ jsx(
|
|
26503
|
+
MarkdownViewer_default,
|
|
26504
|
+
{
|
|
26505
|
+
...viewerProps,
|
|
26506
|
+
value: resolvedMarkdown,
|
|
26507
|
+
headings
|
|
26508
|
+
}
|
|
26509
|
+
) : null);
|
|
26510
|
+
const resolvedToc = toc ?? (enableDefaultToc ? /* @__PURE__ */ jsx(
|
|
26511
|
+
MarkdownTOC_default,
|
|
26512
|
+
{
|
|
26513
|
+
...tocProps,
|
|
26514
|
+
markdown: resolvedMarkdown,
|
|
26515
|
+
headings
|
|
26516
|
+
}
|
|
26517
|
+
) : null);
|
|
26518
|
+
return /* @__PURE__ */ jsx(
|
|
26519
|
+
MarkdownLayout_default,
|
|
26520
|
+
{
|
|
26521
|
+
...layoutProps,
|
|
26522
|
+
header: resolvedHeader,
|
|
26523
|
+
toc: resolvedToc,
|
|
26524
|
+
content: resolvedContent
|
|
26525
|
+
}
|
|
26526
|
+
);
|
|
26527
|
+
}
|
|
26528
|
+
function MarkdownDocsLayout({
|
|
26529
|
+
markdown,
|
|
26530
|
+
value,
|
|
26531
|
+
headings,
|
|
26532
|
+
meta,
|
|
26533
|
+
providerProps,
|
|
26534
|
+
enableProvider = true,
|
|
26535
|
+
...props
|
|
26536
|
+
}) {
|
|
26537
|
+
const resolvedMarkdown = value ?? markdown ?? "";
|
|
26538
|
+
if (!enableProvider) {
|
|
26539
|
+
return /* @__PURE__ */ jsx(
|
|
26540
|
+
MarkdownDocsLayoutContent,
|
|
26541
|
+
{
|
|
26542
|
+
...props,
|
|
26543
|
+
markdown,
|
|
26544
|
+
value,
|
|
26545
|
+
headings
|
|
26546
|
+
}
|
|
26547
|
+
);
|
|
26548
|
+
}
|
|
26549
|
+
return /* @__PURE__ */ jsx(
|
|
26550
|
+
MarkdownProvider_default,
|
|
26551
|
+
{
|
|
26552
|
+
...providerProps,
|
|
26553
|
+
markdown: resolvedMarkdown,
|
|
26554
|
+
headings,
|
|
26555
|
+
meta,
|
|
26556
|
+
children: /* @__PURE__ */ jsx(
|
|
26557
|
+
MarkdownDocsLayoutContent,
|
|
26558
|
+
{
|
|
26559
|
+
...props,
|
|
26560
|
+
markdown: resolvedMarkdown,
|
|
26561
|
+
headings
|
|
26562
|
+
}
|
|
26563
|
+
)
|
|
26564
|
+
}
|
|
26565
|
+
);
|
|
26566
|
+
}
|
|
26567
|
+
var MarkdownDocsLayout_default = MarkdownDocsLayout;
|
|
24525
26568
|
function GenericLayout({
|
|
24526
26569
|
children,
|
|
24527
26570
|
styles,
|
|
@@ -24530,7 +26573,7 @@ function GenericLayout({
|
|
|
24530
26573
|
return /* @__PURE__ */ jsx(ThemeProvider, { defaultTheme, children: /* @__PURE__ */ jsx(
|
|
24531
26574
|
"div",
|
|
24532
26575
|
{
|
|
24533
|
-
className:
|
|
26576
|
+
className: classNames66({
|
|
24534
26577
|
[`${styles}`]: styles
|
|
24535
26578
|
}),
|
|
24536
26579
|
children
|
|
@@ -24579,7 +26622,7 @@ function SidemenuLayout({ data, children }) {
|
|
|
24579
26622
|
return /* @__PURE__ */ jsx(DefaultLayout_default, { children: /* @__PURE__ */ jsxs(
|
|
24580
26623
|
"div",
|
|
24581
26624
|
{
|
|
24582
|
-
className:
|
|
26625
|
+
className: classNames66({
|
|
24583
26626
|
grid: true,
|
|
24584
26627
|
"grid-cols-7 gap-10": !isMobile,
|
|
24585
26628
|
"grid-cols-1 gap-": isMobile
|
|
@@ -24638,6 +26681,6 @@ function ScrollToTop({
|
|
|
24638
26681
|
}
|
|
24639
26682
|
var ScrollToTop_default = ScrollToTop;
|
|
24640
26683
|
|
|
24641
|
-
export { Accordion_default as Accordion, AreaPlot, AsyncComponentWrapper_default as AsyncComponentWrapper, Avatar, Backdrop_default as Backdrop, Badge, BarPlot, BaseChartDataSource, Block_default as Block, BlockGroup_default as BlockGroup, BoxNav_default as BoxNav, BoxNavItem_default as BoxNavItem, Brand_default as Brand, Breadcrumb, BreadcrumbItem_default as BreadcrumbItem, Button_default as Button, CHART_COLOR_PALETTE, CHART_DARK_THEME, CHART_DATA_MODES, CHART_DEFAULT_ACTIVE_DOT_RADIUS, CHART_DEFAULT_ANIMATION_DURATION, CHART_DEFAULT_BAR_RADIUS, CHART_DEFAULT_DOT_RADIUS, CHART_DEFAULT_HEIGHT, CHART_DEFAULT_MARGIN, CHART_DEFAULT_MAX_REALTIME_POINTS, CHART_DEFAULT_POLLING_INTERVAL, CHART_DEFAULT_STROKE_WIDTH, CHART_EMPTY_MESSAGE, CHART_ERROR_MESSAGE, CHART_LIGHT_THEME, CHART_LOADING_MESSAGE, CHART_STATUSES, CHART_STATUS_COLORS, CHART_VALUE_FORMATS, Caption, Card_default as Card, CardContent_default as CardContent, CardFooter_default as CardFooter, CardHeader_default as CardHeader, Chapter, Chart, ChartContainer, ChartContext, ChartEmptyState, ChartErrorState, ChartHeader, ChartLegend, ChartLoadingState, ChartPanel, ChartProvider, ChartToolbar, ChartTooltip, Checkbox_default as Checkbox, Chip, CloudinaryImage_default as CloudinaryImage, CloudinaryProvider, CloudinaryVideo_default as CloudinaryVideo, Code, CommentThread_default as CommentThread, ConfigBootstrap_default as ConfigBootstrap, Configurator, ConfiguratorError, Content, ContentArea_default as ContentArea, DEFAULT_CHART_THEME, DEFAULT_REVIEW_THREAD_CONFIG, DataView, DataViewTable_default as DataViewTable, DateSelector_default as DateSelector, DefaultLayout_default as DefaultLayout, Display, DocumentationPanel_default as DocumentationPanel, Drawer, DrawerToggler_default as DrawerToggler, EUIDevLayout_default as EUIDevLayout, EUIProvider, EnvErrorScreen_default as EnvErrorScreen, Flag, Flex, FlexCol_default as FlexCol, FlexRow_default as FlexRow, Footer, FooterNav_default as FooterNav, FooterNavGroup_default as FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse_default as FormResponse, GaugePlot, GenericLayout_default as GenericLayout, GlowWrapper_default as GlowWrapper, Graph, GraphEdge, GraphNode, GraphRenderer, Grid_default as Grid, Header, HeaderNav_default as HeaderNav, HeaderNavGroup_default as HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout_default as HomeLayout, Image2 as Image, ImageInput_default as ImageInput, InfiniteScrollTrigger_default as InfiniteScrollTrigger, Info_default as Info, Input, InputFile, InputLabel_default as InputLabel, InputList, InputListGroup, InputResponse_default as InputResponse, Label, Layout, Lead, LinePlot, Link, List_default as List, ListItem_default as ListItem, MarkdownEditor_default as MarkdownEditor, MarkdownProvider_default as MarkdownProvider, MarkdownTOC_default as MarkdownTOC, MarkdownViewer_default as MarkdownViewer, Menu, MenuGroup, MenuItem, MenuItemTitle, Modal_default as Modal, MotionSurface_default as MotionSurface, MultiImageInput_default as MultiImageInput, NumericRating_default as NumericRating, Overline, Paragraph, PiePlot, PollingChartDataSource, PriceTag, ProgressBar, ProgressBarRating_default as ProgressBarRating, Quote, Radio_default as Radio, RealtimeChartDataSource, ReviewThread_default as ReviewThread, RouteTab_default as RouteTab, RouteTabs_default as RouteTabs, ScatterPlot, ScrollToTop_default as ScrollToTop, Section, Select_default as Select, ShapeSwitch, ShowMore_default as ShowMore, Sidebar_default as Sidebar, SidebarLayout_default as SidebarLayout, SidemenuLayout_default as SidemenuLayout, Skeleton, Slider_default as Slider, Spinner_default as Spinner, StarRating_default as StarRating, StarRatingDistribution_default as StarRatingDistribution, StarRatingInput_default as StarRatingInput, StatPlot, StaticChartDataSource, Switch_default as Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table_default as Table, Tag_default as Tag, Tags_default as Tags, TextArea_default as TextArea, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, Toast, Tooltip6 as Tooltip, TopNav, Transition, TransitionAccordion_default as TransitionAccordion, TransitionBase_default as TransitionBase, TransitionDropdown_default as TransitionDropdown, TransitionFade_default as TransitionFade, TransitionFadeIn_default as TransitionFadeIn, TransitionScale_default as TransitionScale, TransitionSlide_default as TransitionSlide, Typography, UnderConstructionBanner, ValueBadge_default as ValueBadge, WorldMap, WorldMapCountryTable, YoutubeVideo_default as YoutubeVideoPlayer, addReplyToCache, addReviewReply, appendReview, applyReactionState, assertAbsoluteURL, buildURL, canDeleteReview, canDeleteReviewReply, canEditReview, canEditReviewReply, canReplyToReview, canReportReview, canReportReviewReply, chartReducer, cn, createConfigurator, createForceLayout, createGridLayout, createInitialChartState, createTreeLayout, createURLResolver, decrementReplyCount, enumValues, euiToast, findReview, formatChartValue, formatCommentDate, formatConfigError, formatReviewDate, getAllowedOrigins, getBrowserHref, getBrowserOrigin, getBrowserRedirectURL, getCurrencySymbol, getLayout, getOptimisticDislikeState, getOptimisticLikeState, getSafeRedirect, hasReviewReply, incrementReplyCount, isMatch, isRenderFn, limitRealtimePoints, normalize, normalizeChartData, normalizeChartDataPoint, normalizeReview, normalizeReviewAuthor, normalizeReviewReply, parseJson, parseJsonRecord, parseUrlMap, prependReview, registerLayout, removeComment, removeCommentTreeFromCache, removeReview, removeReviewReply, replaceRealtimePoints, replaceReview, replaceReviewReply, resolveAppearanceStyles, resolveChartColor, resolveChartColors, resolveWithGlobal, sendToast, toConfiguratorError, updateComment, updateReplyCacheComment, updateReview, updateReviewReply, upsertReview, useChartContext, useChartData, useChartPolling, useChartRealtime, useChartSeries, useChartTheme, useClickOutside, useCloudinaryConfig, useCurrentTheme_default as useCurrentTheme, useDrawer_default as useDrawer, useEUIConfig, useIsMobile_default as useIsMobile, useModal_default as useModal, useReviewThreadState, useTheme_default as useTheme };
|
|
26684
|
+
export { Accordion_default as Accordion, AreaPlot, AsyncComponentWrapper_default as AsyncComponentWrapper, Avatar, Backdrop_default as Backdrop, Badge, BarPlot, BaseChartDataSource, Block_default as Block, BlockGroup_default as BlockGroup, BoxNav_default as BoxNav, BoxNavItem_default as BoxNavItem, Brand_default as Brand, Breadcrumb, BreadcrumbItem_default as BreadcrumbItem, Button_default as Button, CHART_COLOR_PALETTE, CHART_DARK_THEME, CHART_DATA_MODES, CHART_DEFAULT_ACTIVE_DOT_RADIUS, CHART_DEFAULT_ANIMATION_DURATION, CHART_DEFAULT_BAR_RADIUS, CHART_DEFAULT_DOT_RADIUS, CHART_DEFAULT_HEIGHT, CHART_DEFAULT_MARGIN, CHART_DEFAULT_MAX_REALTIME_POINTS, CHART_DEFAULT_POLLING_INTERVAL, CHART_DEFAULT_STROKE_WIDTH, CHART_EMPTY_MESSAGE, CHART_ERROR_MESSAGE, CHART_LIGHT_THEME, CHART_LOADING_MESSAGE, CHART_STATUSES, CHART_STATUS_COLORS, CHART_VALUE_FORMATS, Caption, Card_default as Card, CardContent_default as CardContent, CardFooter_default as CardFooter, CardHeader_default as CardHeader, Chapter, Chart, ChartContainer, ChartContext, ChartEmptyState, ChartErrorState, ChartHeader, ChartLegend, ChartLoadingState, ChartPanel, ChartProvider, ChartToolbar, ChartTooltip, Checkbox_default as Checkbox, Chip, CloudinaryImage_default as CloudinaryImage, CloudinaryProvider, CloudinaryVideo_default as CloudinaryVideo, Code, CommentThread_default as CommentThread, ConfigBootstrap_default as ConfigBootstrap, Configurator, ConfiguratorError, Content, ContentArea_default as ContentArea, DEFAULT_CHART_THEME, DEFAULT_REVIEW_THREAD_CONFIG, DataView, DataViewTable_default as DataViewTable, DateSelector_default as DateSelector, DefaultLayout_default as DefaultLayout, Display, DocumentationPanel_default as DocumentationPanel, Drawer, DrawerToggler_default as DrawerToggler, EUIDevLayout_default as EUIDevLayout, EUIProvider, EnvErrorScreen_default as EnvErrorScreen, Flag, Flex, FlexCol_default as FlexCol, FlexRow_default as FlexRow, Footer, FooterNav_default as FooterNav, FooterNavGroup_default as FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse_default as FormResponse, GaugePlot, GenericLayout_default as GenericLayout, GlowWrapper_default as GlowWrapper, Graph, GraphEdge, GraphNode, GraphRenderer, Grid_default as Grid, Header, HeaderNav_default as HeaderNav, HeaderNavGroup_default as HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout_default as HomeLayout, Image2 as Image, ImageInput_default as ImageInput, InfiniteScrollTrigger_default as InfiniteScrollTrigger, Info_default as Info, Input, InputFile, InputLabel_default as InputLabel, InputList, InputListGroup, InputResponse_default as InputResponse, Label, Layout, Lead, LinePlot, Link, List_default as List, ListItem_default as ListItem, MarkdownBlockquote_default as MarkdownBlockquote, MarkdownCodeBlock_default as MarkdownCodeBlock, MarkdownContext, MarkdownDocsLayout_default as MarkdownDocsLayout, MarkdownEditor_default as MarkdownEditor, MarkdownField_default as MarkdownField, MarkdownHeading_default as MarkdownHeadingComponent, MarkdownImage_default as MarkdownImage, MarkdownInlineCode_default as MarkdownInlineCode, MarkdownLayout_default as MarkdownLayout, MarkdownLink_default as MarkdownLink, MarkdownPreviewPane_default as MarkdownPreviewPane, MarkdownProvider_default as MarkdownProvider, MarkdownRenderer_default as MarkdownRenderer, MarkdownSourceEditor_default as MarkdownSourceEditor, MarkdownSplitEditor_default as MarkdownSplitEditor, MarkdownTOC_default as MarkdownTOC, MarkdownTOCItem_default as MarkdownTOCItem, MarkdownTable_default as MarkdownTable, MarkdownTableCell, MarkdownTableHeaderCell, MarkdownToolbar_default as MarkdownToolbar, MarkdownViewer_default as MarkdownViewer, Menu, MenuGroup, MenuItem, MenuItemTitle, Modal_default as Modal, MotionSurface_default as MotionSurface, MultiImageInput_default as MultiImageInput, NumericRating_default as NumericRating, Overline, Paragraph, PiePlot, PollingChartDataSource, PriceTag, ProgressBar, ProgressBarRating_default as ProgressBarRating, Quote, Radio_default as Radio, RealtimeChartDataSource, ReviewThread_default as ReviewThread, RouteTab_default as RouteTab, RouteTabs_default as RouteTabs, ScatterPlot, ScrollToTop_default as ScrollToTop, Section, Select_default as Select, ShapeSwitch, ShowMore_default as ShowMore, Sidebar_default as Sidebar, SidebarLayout_default as SidebarLayout, SidemenuLayout_default as SidemenuLayout, Skeleton, Slider_default as Slider, Spinner_default as Spinner, StarRating_default as StarRating, StarRatingDistribution_default as StarRatingDistribution, StarRatingInput_default as StarRatingInput, StatPlot, StaticChartDataSource, Switch_default as Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table_default as Table, Tag_default as Tag, Tags_default as Tags, TextArea_default as TextArea, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, Toast, Tooltip6 as Tooltip, TopNav, Transition, TransitionAccordion_default as TransitionAccordion, TransitionBase_default as TransitionBase, TransitionDropdown_default as TransitionDropdown, TransitionFade_default as TransitionFade, TransitionFadeIn_default as TransitionFadeIn, TransitionScale_default as TransitionScale, TransitionSlide_default as TransitionSlide, Typography, UnderConstructionBanner, ValueBadge_default as ValueBadge, WorldMap, WorldMapCountryTable, YoutubeVideo_default as YoutubeVideoPlayer, addReplyToCache, addReviewReply, appendReview, applyReactionState, assertAbsoluteURL, buildURL, canDeleteReview, canDeleteReviewReply, canEditReview, canEditReviewReply, canReplyToReview, canReportReview, canReportReviewReply, chartReducer, cn, createConfigurator, createForceLayout, createGridLayout, createHeadingSlug, createInitialChartState, createTreeLayout, createURLResolver, decrementReplyCount, enumValues, euiToast, extractHeadings, findReview, formatChartValue, formatCommentDate, formatConfigError, formatReviewDate, generateHeadingNumbers, getAllowedOrigins, getBrowserHref, getBrowserOrigin, getBrowserRedirectURL, getCurrencySymbol, getLayout, getOptimisticDislikeState, getOptimisticLikeState, getSafeRedirect, hasReviewReply, incrementReplyCount, isMatch, isRenderFn, limitRealtimePoints, normalize, normalizeChartData, normalizeChartDataPoint, normalizeMarkdown, normalizeReview, normalizeReviewAuthor, normalizeReviewReply, parseJson, parseJsonRecord, parseUrlMap, prependReview, registerLayout, removeComment, removeCommentTreeFromCache, removeReview, removeReviewReply, replaceRealtimePoints, replaceReview, replaceReviewReply, resolveAppearanceStyles, resolveChartColor, resolveChartColors, resolveWithGlobal, sanitizeHeading, sendToast, slugify, toConfiguratorError, updateComment, updateReplyCacheComment, updateReview, updateReviewReply, upsertReview, useActiveHeading, useChartContext, useChartData, useChartPolling, useChartRealtime, useChartSeries, useChartTheme, useClickOutside, useCloudinaryConfig, useCurrentTheme_default as useCurrentTheme, useDrawer_default as useDrawer, useEUIConfig, useIsMobile_default as useIsMobile, useMarkdown, useMarkdownHeadings, useModal_default as useModal, useReviewThreadState, useTheme_default as useTheme };
|
|
24642
26685
|
//# sourceMappingURL=index.mjs.map
|
|
24643
26686
|
//# sourceMappingURL=index.mjs.map
|