@intlayer/design-system 5.3.10 → 5.3.12
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/.vite/manifest.json +19 -19
- package/dist/components/Auth/useAuth/index.cjs +1 -1
- package/dist/components/Auth/useAuth/index.cjs.map +1 -1
- package/dist/components/Auth/useAuth/index.mjs +1 -1
- package/dist/components/Auth/useAuth/index.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ConditionWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/ConditionWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/InsertionWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.cjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.cjs +2 -2
- package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/index.mjs +2 -2
- package/dist/components/Headers/index.cjs +25 -40
- package/dist/components/Headers/index.cjs.map +1 -1
- package/dist/components/Headers/index.d.ts.map +1 -1
- package/dist/components/Headers/index.mjs +25 -40
- package/dist/components/Headers/index.mjs.map +1 -1
- package/dist/components/MarkDownRender/index.cjs +9 -12
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.d.ts.map +1 -1
- package/dist/components/MarkDownRender/index.mjs +9 -12
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/{index-s_Ar0FDw.cjs → index-DW4Wnns5.cjs} +18 -17
- package/dist/index-DW4Wnns5.cjs.map +1 -0
- package/dist/{index-CEoL1j7H.js → index-aPP3MzPT.js} +19 -18
- package/dist/index-aPP3MzPT.js.map +1 -0
- package/dist/tailwind.css +1 -1
- package/package.json +17 -17
- package/dist/index-CEoL1j7H.js.map +0 -1
- package/dist/index-s_Ar0FDw.cjs.map +0 -1
|
@@ -5,61 +5,46 @@ const styledAfter = `after:content-['#'] after:scale-75 after:px-6 after:text-ne
|
|
|
5
5
|
const StyledH1 = ({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
8
|
-
}) => (
|
|
9
|
-
// eslint-disable-next-line jsx-a11y/heading-has-content
|
|
10
|
-
/* @__PURE__ */ jsx("h1", { className: cn("mt-5 text-2xl font-bold", className), ...props })
|
|
11
|
-
);
|
|
8
|
+
}) => /* @__PURE__ */ jsx("h1", { className: cn("mt-5 text-2xl font-bold", className), ...props });
|
|
12
9
|
const StyledH2 = ({
|
|
13
10
|
className,
|
|
14
11
|
...props
|
|
15
|
-
}) => (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
...props
|
|
22
|
-
}
|
|
23
|
-
)
|
|
12
|
+
}) => /* @__PURE__ */ jsx(
|
|
13
|
+
"h2",
|
|
14
|
+
{
|
|
15
|
+
className: cn("mt-16 mb-2 text-2xl font-bold", styledHeading, className),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
24
18
|
);
|
|
25
19
|
const StyledH3 = ({
|
|
26
20
|
className,
|
|
27
21
|
...props
|
|
28
|
-
}) => (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
...props
|
|
35
|
-
}
|
|
36
|
-
)
|
|
22
|
+
}) => /* @__PURE__ */ jsx(
|
|
23
|
+
"h3",
|
|
24
|
+
{
|
|
25
|
+
className: cn("mt-5 mb-2 text-xl font-bold", styledHeading, className),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
37
28
|
);
|
|
38
29
|
const StyledH4 = ({
|
|
39
30
|
className,
|
|
40
31
|
...props
|
|
41
|
-
}) => (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
...props
|
|
48
|
-
}
|
|
49
|
-
)
|
|
32
|
+
}) => /* @__PURE__ */ jsx(
|
|
33
|
+
"h4",
|
|
34
|
+
{
|
|
35
|
+
className: cn("mt-3 text-lg font-bold", styledHeading, className),
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
50
38
|
);
|
|
51
39
|
const StyledH5 = ({
|
|
52
40
|
className,
|
|
53
41
|
...props
|
|
54
|
-
}) => (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
...props
|
|
61
|
-
}
|
|
62
|
-
)
|
|
42
|
+
}) => /* @__PURE__ */ jsx(
|
|
43
|
+
"h5",
|
|
44
|
+
{
|
|
45
|
+
className: cn("mt-3 text-base font-bold", styledHeading, className),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
63
48
|
);
|
|
64
49
|
const getId = (children) => String(children).normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "-").toLowerCase();
|
|
65
50
|
const scrollToHash = (id) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/Headers/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/Headers/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes, JSX, MouseEvent } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst styledHeading = `relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`;\nconst styledAfter = `after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:hover:cursor-pointer after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100`;\n\nconst StyledH1: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => <h1 className={cn('mt-5 text-2xl font-bold', className)} {...props} />;\n\nconst StyledH2: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h2\n className={cn('mt-16 mb-2 text-2xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH3: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h3\n className={cn('mt-5 mb-2 text-xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH4: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h4\n className={cn('mt-3 text-lg font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH5: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h5\n className={cn('mt-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\ntype HeadingProps = HTMLAttributes<HTMLHeadingElement> & {\n isClickable?: boolean;\n};\ntype HeadingGlobalProps = HeadingProps & {\n H: FC<HTMLAttributes<HTMLHeadingElement>>;\n};\ntype HeadingType = (props: HeadingGlobalProps) => JSX.Element;\n\nconst getId = (children: string) =>\n String(children)\n // replace accents\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n // replace spaces\n .replace(/\\s+/g, '-')\n .toLowerCase();\n\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\nconst afterClick = (parentElem: Element, e: MouseEvent<HTMLHeadingElement>) => {\n const parentLeft = parentElem.getBoundingClientRect().left,\n parentTop = parentElem.getBoundingClientRect().top;\n\n const after = window.getComputedStyle(parentElem, ':after');\n\n const afterStart = parentLeft + parseInt(after.getPropertyValue('left'), 10),\n afterEnd = afterStart + parseInt(after.width, 10);\n\n const afterYStart = parentTop + parseInt(after.getPropertyValue('top'), 10),\n afterYEnd = afterYStart + parseInt(after.height, 10);\n\n const mouseX = e.clientX,\n mouseY = e.clientY;\n\n const isAfterClicked: boolean =\n mouseX >= afterStart &&\n mouseX <= afterEnd &&\n mouseY >= afterYStart &&\n mouseY <= afterYEnd;\n\n return isAfterClicked;\n};\n\nconst HeadingWrapper: HeadingType = ({\n H,\n children,\n className,\n isClickable,\n ...props\n}) => {\n const id = typeof children === 'string' ? getId(children) : undefined;\n\n const onClick = (e: MouseEvent<HTMLHeadingElement>) => {\n const { id } = e.currentTarget;\n\n const isAfterClicker = afterClick(e.currentTarget, e);\n\n if (isAfterClicker && typeof id === 'string') {\n const urlWithoutHash = window.location.href.split('#')[0];\n const url = `${urlWithoutHash}#${id}`;\n\n // copy the url to the clipboard\n navigator.clipboard.writeText(url);\n\n scrollToHash(id);\n }\n };\n\n return (\n <H\n id={id}\n onClick={isClickable ? onClick : undefined}\n aria-label={\n isClickable\n ? `Click to scroll to section ${id} and copy the link to the clipboard`\n : undefined\n }\n className={cn(isClickable && styledAfter, className)}\n {...props}\n >\n {children}\n </H>\n );\n};\n\nexport const H1: FC<HeadingProps> = ({ isClickable: _, ...props }) => (\n <StyledH1 {...props} />\n);\n\nexport const H2: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH2} isClickable={isClickable} {...props} />\n);\nexport const H3: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH3} isClickable={isClickable} {...props} />\n);\nexport const H4: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH4} isClickable={isClickable} {...props} />\n);\nexport const H5: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH5} isClickable={isClickable} {...props} />\n);\n"],"names":["id"],"mappings":";;AAGA,MAAM,gBAAgB;AACtB,MAAM,cAAc;AAEpB,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MAAM,oBAAC,QAAG,WAAW,GAAG,2BAA2B,SAAS,GAAI,GAAG,OAAO;AAE1E,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,iCAAiC,eAAe,SAAS;AAAA,IACtE,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,+BAA+B,eAAe,SAAS;AAAA,IACpE,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;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58
58
|
),
|
|
59
59
|
li: ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: utils_cn.cn("list-disc", className), ...props }),
|
|
60
|
-
img: ({ className, ...props }) => (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
src: `${props.src}?raw=true`
|
|
69
|
-
}
|
|
70
|
-
)
|
|
60
|
+
img: ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
"img",
|
|
62
|
+
{
|
|
63
|
+
...props,
|
|
64
|
+
loading: "lazy",
|
|
65
|
+
className: utils_cn.cn("max-w-full rounded-md", className),
|
|
66
|
+
src: `${props.src}?raw=true`
|
|
67
|
+
}
|
|
71
68
|
),
|
|
72
69
|
a: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
73
70
|
components_Link_Link.Link,
|
|
@@ -121,7 +118,7 @@ const MarkdownRenderer = ({
|
|
|
121
118
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
122
119
|
"div",
|
|
123
120
|
{
|
|
124
|
-
className: utils_cn.cn("flex flex-col gap-
|
|
121
|
+
className: utils_cn.cn("flex flex-col gap-8 p-10", className),
|
|
125
122
|
...props
|
|
126
123
|
}
|
|
127
124
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/MarkDownRender/index.tsx"],"sourcesContent":["import type { Locales } from '@intlayer/config';\nimport Markdown, { type MarkdownToJSX } from 'markdown-to-jsx';\nimport type { FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { H1, H2, H3, H4 } from '../Headers';\nimport { SectionScroller } from '../Headers/SectionScroller';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: Locales;\n options?: MarkdownToJSX.Options;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n options,\n}) => {\n const { overrides, ...restOptions } = options ?? {};\n return (\n <CodeProvider>\n <Markdown\n options={{\n overrides: {\n h1: (props) => <H1 isClickable={true} {...props} />,\n h2: (props) => <H2 isClickable={true} {...props} />,\n h3: (props) => <H3 isClickable={true} {...props} />,\n h4: (props) => <H4 isClickable={true} {...props} />,\n\n code: (props) =>\n typeof props.className === 'undefined' ? (\n <strong className=\"bg-card/60 rounded p-1 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur\">\n {props.children}\n </strong>\n ) : (\n <Code\n isDarkMode={isDarkMode}\n language={props.className?.replace('lang-', '')}\n {...props}\n />\n ),\n\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'border-card text-neutral mt-5 flex flex-col gap-3 border-l-4 pl-5',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n li: ({ className, ...props }) => (\n <li className={cn('list-disc', className)} {...props} />\n ),\n img: ({ className, ...props }) => (\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/MarkDownRender/index.tsx"],"sourcesContent":["import type { Locales } from '@intlayer/config';\nimport Markdown, { type MarkdownToJSX } from 'markdown-to-jsx';\nimport type { FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { H1, H2, H3, H4 } from '../Headers';\nimport { SectionScroller } from '../Headers/SectionScroller';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: Locales;\n options?: MarkdownToJSX.Options;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n options,\n}) => {\n const { overrides, ...restOptions } = options ?? {};\n return (\n <CodeProvider>\n <Markdown\n options={{\n overrides: {\n h1: (props) => <H1 isClickable={true} {...props} />,\n h2: (props) => <H2 isClickable={true} {...props} />,\n h3: (props) => <H3 isClickable={true} {...props} />,\n h4: (props) => <H4 isClickable={true} {...props} />,\n\n code: (props) =>\n typeof props.className === 'undefined' ? (\n <strong className=\"bg-card/60 rounded p-1 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur\">\n {props.children}\n </strong>\n ) : (\n <Code\n isDarkMode={isDarkMode}\n language={props.className?.replace('lang-', '')}\n {...props}\n />\n ),\n\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'border-card text-neutral mt-5 flex flex-col gap-3 border-l-4 pl-5',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n li: ({ className, ...props }) => (\n <li className={cn('list-disc', className)} {...props} />\n ),\n img: ({ className, ...props }) => (\n <img\n {...props}\n loading=\"lazy\"\n className={cn('max-w-full rounded-md', className)}\n src={`${props.src}?raw=true`}\n />\n ),\n a: (props) => (\n <Link\n color=\"neutral\"\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n locale={locale}\n {...props}\n />\n ),\n pre: (props) => props.children,\n table: ({ className, ...props }) => (\n <div className=\"grid w-full max-w-full overflow-scroll rounded\">\n <table\n className={cn(\n 'max-w-full table-auto overflow-hidden text-left',\n className\n )}\n {...props}\n />\n </div>\n ),\n th: ({ className, ...props }) => (\n <th\n className={cn(\n 'border-neutral bg-neutral/10 border-b p-4',\n className\n )}\n {...props}\n />\n ),\n tr: ({ className, ...props }) => (\n <tr\n className={cn('hover:bg-neutral/10 hover:/10', className)}\n {...props}\n />\n ),\n td: ({ className, ...props }) => (\n <td\n className={cn('border-b border-neutral-500/50 p-4', className)}\n {...props}\n />\n ),\n ...overrides,\n },\n wrapper: ({ className, ...props }) => (\n <>\n <SectionScroller />\n <div\n className={cn('flex flex-col gap-8 p-10', className)}\n {...props}\n />\n </>\n ),\n ...restOptions,\n }}\n >\n {children ?? ''}\n </Markdown>\n </CodeProvider>\n );\n};\n"],"names":["CodeProvider","jsx","H1","H2","H3","H4","Code","cn","Link","jsxs","Fragment","SectionScroller"],"mappings":";;;;;;;;;;AAiBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,WAAW,GAAG,YAAY,IAAI,WAAW,CAAC;AAClD,wCACGA,2BAAAA,cACC,EAAA,UAAAC,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAS;AAAA,QACP,WAAW;AAAA,UACT,IAAI,CAAC,UAAUA,+BAACC,yBAAAA,MAAG,aAAa,MAAO,GAAG,OAAO;AAAA,UACjD,IAAI,CAAC,UAAUD,+BAACE,yBAAAA,MAAG,aAAa,MAAO,GAAG,OAAO;AAAA,UACjD,IAAI,CAAC,UAAUF,+BAACG,yBAAAA,MAAG,aAAa,MAAO,GAAG,OAAO;AAAA,UACjD,IAAI,CAAC,UAAUH,+BAACI,yBAAAA,MAAG,aAAa,MAAO,GAAG,OAAO;AAAA,UAEjD,MAAM,CAAC,UACL,OAAO,MAAM,cAAc,cACzBJ,2BAAA,IAAC,UAAO,EAAA,WAAU,gFACf,UAAA,MAAM,SACT,CAAA,IAEAA,2BAAA;AAAA,YAACK,oBAAA;AAAA,YAAA;AAAA,cACC;AAAA,cACA,UAAU,MAAM,WAAW,QAAQ,SAAS,EAAE;AAAA,cAC7C,GAAG;AAAA,YAAA;AAAA,UACN;AAAA,UAGJ,YAAY,CAAC,EAAE,WAAW,GAAG,MAC3B,MAAAL,2BAAA;AAAA,YAAC;AAAA,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AAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQhC,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MarkDownRender/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQhC,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0HtD,CAAC"}
|
|
@@ -55,17 +55,14 @@ const MarkdownRenderer = ({
|
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
57
|
li: ({ className, ...props }) => /* @__PURE__ */ jsx("li", { className: cn("list-disc", className), ...props }),
|
|
58
|
-
img: ({ className, ...props }) => (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
src: `${props.src}?raw=true`
|
|
67
|
-
}
|
|
68
|
-
)
|
|
58
|
+
img: ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
59
|
+
"img",
|
|
60
|
+
{
|
|
61
|
+
...props,
|
|
62
|
+
loading: "lazy",
|
|
63
|
+
className: cn("max-w-full rounded-md", className),
|
|
64
|
+
src: `${props.src}?raw=true`
|
|
65
|
+
}
|
|
69
66
|
),
|
|
70
67
|
a: (props) => /* @__PURE__ */ jsx(
|
|
71
68
|
Link,
|
|
@@ -119,7 +116,7 @@ const MarkdownRenderer = ({
|
|
|
119
116
|
/* @__PURE__ */ jsx(
|
|
120
117
|
"div",
|
|
121
118
|
{
|
|
122
|
-
className: cn("flex flex-col gap-
|
|
119
|
+
className: cn("flex flex-col gap-8 p-10", className),
|
|
123
120
|
...props
|
|
124
121
|
}
|
|
125
122
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/MarkDownRender/index.tsx"],"sourcesContent":["import type { Locales } from '@intlayer/config';\nimport Markdown, { type MarkdownToJSX } from 'markdown-to-jsx';\nimport type { FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { H1, H2, H3, H4 } from '../Headers';\nimport { SectionScroller } from '../Headers/SectionScroller';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: Locales;\n options?: MarkdownToJSX.Options;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n options,\n}) => {\n const { overrides, ...restOptions } = options ?? {};\n return (\n <CodeProvider>\n <Markdown\n options={{\n overrides: {\n h1: (props) => <H1 isClickable={true} {...props} />,\n h2: (props) => <H2 isClickable={true} {...props} />,\n h3: (props) => <H3 isClickable={true} {...props} />,\n h4: (props) => <H4 isClickable={true} {...props} />,\n\n code: (props) =>\n typeof props.className === 'undefined' ? (\n <strong className=\"bg-card/60 rounded p-1 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur\">\n {props.children}\n </strong>\n ) : (\n <Code\n isDarkMode={isDarkMode}\n language={props.className?.replace('lang-', '')}\n {...props}\n />\n ),\n\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'border-card text-neutral mt-5 flex flex-col gap-3 border-l-4 pl-5',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n li: ({ className, ...props }) => (\n <li className={cn('list-disc', className)} {...props} />\n ),\n img: ({ className, ...props }) => (\n
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/MarkDownRender/index.tsx"],"sourcesContent":["import type { Locales } from '@intlayer/config';\nimport Markdown, { type MarkdownToJSX } from 'markdown-to-jsx';\nimport type { FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { H1, H2, H3, H4 } from '../Headers';\nimport { SectionScroller } from '../Headers/SectionScroller';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: Locales;\n options?: MarkdownToJSX.Options;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n options,\n}) => {\n const { overrides, ...restOptions } = options ?? {};\n return (\n <CodeProvider>\n <Markdown\n options={{\n overrides: {\n h1: (props) => <H1 isClickable={true} {...props} />,\n h2: (props) => <H2 isClickable={true} {...props} />,\n h3: (props) => <H3 isClickable={true} {...props} />,\n h4: (props) => <H4 isClickable={true} {...props} />,\n\n code: (props) =>\n typeof props.className === 'undefined' ? (\n <strong className=\"bg-card/60 rounded p-1 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur\">\n {props.children}\n </strong>\n ) : (\n <Code\n isDarkMode={isDarkMode}\n language={props.className?.replace('lang-', '')}\n {...props}\n />\n ),\n\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'border-card text-neutral mt-5 flex flex-col gap-3 border-l-4 pl-5',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn('mt-5 flex flex-col gap-3 pl-5', className)}\n {...props}\n />\n ),\n li: ({ className, ...props }) => (\n <li className={cn('list-disc', className)} {...props} />\n ),\n img: ({ className, ...props }) => (\n <img\n {...props}\n loading=\"lazy\"\n className={cn('max-w-full rounded-md', className)}\n src={`${props.src}?raw=true`}\n />\n ),\n a: (props) => (\n <Link\n color=\"neutral\"\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n locale={locale}\n {...props}\n />\n ),\n pre: (props) => props.children,\n table: ({ className, ...props }) => (\n <div className=\"grid w-full max-w-full overflow-scroll rounded\">\n <table\n className={cn(\n 'max-w-full table-auto overflow-hidden text-left',\n className\n )}\n {...props}\n />\n </div>\n ),\n th: ({ className, ...props }) => (\n <th\n className={cn(\n 'border-neutral bg-neutral/10 border-b p-4',\n className\n )}\n {...props}\n />\n ),\n tr: ({ className, ...props }) => (\n <tr\n className={cn('hover:bg-neutral/10 hover:/10', className)}\n {...props}\n />\n ),\n td: ({ className, ...props }) => (\n <td\n className={cn('border-b border-neutral-500/50 p-4', className)}\n {...props}\n />\n ),\n ...overrides,\n },\n wrapper: ({ className, ...props }) => (\n <>\n <SectionScroller />\n <div\n className={cn('flex flex-col gap-8 p-10', className)}\n {...props}\n />\n </>\n ),\n ...restOptions,\n }}\n >\n {children ?? ''}\n </Markdown>\n </CodeProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAiBO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,WAAW,GAAG,YAAY,IAAI,WAAW,CAAC;AAClD,6BACG,cACC,EAAA,UAAA;AAA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AAA;AAAA,cACC,WAAW,GAAG,4BAA4B,SAAS;AAAA,cAClD,GAAG;AAAA,YAAA;AAAA,UAAA;AAAA,QACN,GACF;AAAA,QAEF,GAAG;AAAA,MACL;AAAA,MAEC,UAAY,YAAA;AAAA,IAAA;AAAA,EAAA,GAEjB;AAEJ;"}
|
|
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const core = require("@intlayer/core");
|
|
5
5
|
const components_DictionaryEditor_ItemLayout = require("./components/DictionaryEditor/ItemLayout.cjs");
|
|
6
6
|
const ReactExports = require("react");
|
|
7
|
-
const components_DictionaryEditor_NodeWrapper_StringWrapper = require("./components/DictionaryEditor/NodeWrapper/StringWrapper.cjs");
|
|
8
7
|
const components_DictionaryEditor_NodeWrapper_FileWrapper = require("./components/DictionaryEditor/NodeWrapper/FileWrapper.cjs");
|
|
8
|
+
const components_DictionaryEditor_NodeWrapper_StringWrapper = require("./components/DictionaryEditor/NodeWrapper/StringWrapper.cjs");
|
|
9
9
|
const ArrayWrapper = (props) => {
|
|
10
10
|
const { keyPath, section, onFocusKeyPath, focusedKeyPath = [] } = props;
|
|
11
11
|
return section.map((subSection, key) => {
|
|
@@ -77,6 +77,17 @@ const EnumerationWrapper = (props) => {
|
|
|
77
77
|
] });
|
|
78
78
|
}) });
|
|
79
79
|
};
|
|
80
|
+
const InsertionWrapper = (props) => {
|
|
81
|
+
const { keyPath, section } = props;
|
|
82
|
+
const newKeyPath = [
|
|
83
|
+
...keyPath,
|
|
84
|
+
{
|
|
85
|
+
type: core.NodeType.Insertion
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
const subSection = section[core.NodeType.Insertion];
|
|
89
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection }) });
|
|
90
|
+
};
|
|
80
91
|
const MarkdownWrapper = (props) => {
|
|
81
92
|
const { keyPath, section } = props;
|
|
82
93
|
const newKeyPath = [
|
|
@@ -120,23 +131,13 @@ const TranslationWrapper = (props) => {
|
|
|
120
131
|
const subSection = section.translation[locale];
|
|
121
132
|
return /* @__PURE__ */ jsxRuntime.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection });
|
|
122
133
|
};
|
|
123
|
-
const InsertionWrapper = (props) => {
|
|
124
|
-
const { keyPath, section } = props;
|
|
125
|
-
const newKeyPath = [
|
|
126
|
-
...keyPath,
|
|
127
|
-
{
|
|
128
|
-
type: core.NodeType.Insertion
|
|
129
|
-
}
|
|
130
|
-
];
|
|
131
|
-
const subSection = section[core.NodeType.Insertion];
|
|
132
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: [
|
|
133
|
-
/* @__PURE__ */ jsxRuntime.jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection }),
|
|
134
|
-
";"
|
|
135
|
-
] });
|
|
136
|
-
};
|
|
137
134
|
const traceKeys = ["filePath", "id", "nodeType"];
|
|
138
135
|
const NodeWrapper = (props) => {
|
|
139
|
-
const
|
|
136
|
+
const editedContentValue = core.getContentNodeByKeyPath(
|
|
137
|
+
props.editedContent,
|
|
138
|
+
props.keyPath
|
|
139
|
+
);
|
|
140
|
+
const section = editedContentValue ?? props.section;
|
|
140
141
|
const nodeType = core.getNodeType(section);
|
|
141
142
|
if (typeof section === "object") {
|
|
142
143
|
if (nodeType === core.NodeType.ReactNode) {
|
|
@@ -223,4 +224,4 @@ exports.NestedObjectWrapper = NestedObjectWrapper;
|
|
|
223
224
|
exports.NodeWrapper = NodeWrapper;
|
|
224
225
|
exports.TranslationWrapper = TranslationWrapper;
|
|
225
226
|
exports.traceKeys = traceKeys;
|
|
226
|
-
//# sourceMappingURL=index-
|
|
227
|
+
//# sourceMappingURL=index-DW4Wnns5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DW4Wnns5.cjs","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/ConditionWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/InsertionWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["import {\n isSameKeyPath,\n NodeType,\n type ContentNode,\n type KeyPath,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: ContentNode[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const { keyPath, section, onFocusKeyPath, focusedKeyPath = [] } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","import {\n type KeyPath,\n NodeType,\n type ConditionContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype ConditionWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: ConditionContent<ContentNode>;\n};\n\nexport const ConditionWrapper: FC<ConditionWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Condition,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section[NodeType.Condition][\n key as keyof (typeof section)[NodeType.Condition]\n ]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","import {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<ContentNode>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section[NodeType.Enumeration][\n key as keyof (typeof section)[NodeType.Enumeration]\n ]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","import {\n NodeType,\n type ContentNode,\n type InsertionContent,\n type KeyPath,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype InsertionWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: InsertionContent<ContentNode>;\n};\n\nexport const InsertionWrapper: FC<InsertionWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Insertion,\n },\n ];\n\n const subSection = section[NodeType.Insertion];\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </div>\n );\n};\n","import {\n type KeyPath,\n NodeType,\n type MarkdownContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype MarkdownWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: MarkdownContent<ContentNode>;\n};\n\nexport const MarkdownWrapper: FC<MarkdownWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const subSection = section[NodeType.Markdown] as ContentNode;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </div>\n );\n};\n","import {\n type KeyPath,\n isSameKeyPath,\n type ContentNode,\n NodeType,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, ContentNode>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const { keyPath, section, focusedKeyPath = [], onFocusKeyPath } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","import {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<ContentNode>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n getContentNodeByKeyPath,\n getNodeType,\n NodeType,\n type ConditionContent,\n type ContentNode,\n type Dictionary,\n type EnumerationContent,\n type FileContent,\n type InsertionContent,\n type KeyPath,\n type MarkdownContent,\n type TranslationContent,\n} from '@intlayer/core';\nimport { ReactNode, type FC } from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { ConditionWrapper } from './ConditionWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { FileWrapper } from './FileWrapper';\nimport { InsertionWrapper } from './InsertionWrapper';\nimport { MarkdownWrapper } from './MarkdownWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n section: ContentNode;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: ContentNode;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n renderSection?: (content: string) => ReactNode;\n};\n\nexport const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const editedContentValue = getContentNodeByKeyPath(\n props.editedContent,\n props.keyPath\n );\n const section = editedContentValue ?? props.section;\n const nodeType = getNodeType(section);\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <span className=\"text-neutral text-xs\">React node not editable</span>\n );\n }\n\n if (nodeType === NodeType.Nested) {\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n [Nested] Dictionary\n </div>\n );\n }\n\n if (nodeType === NodeType.Markdown) {\n return (\n <MarkdownWrapper\n {...props}\n section={section as MarkdownContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Condition) {\n return (\n <ConditionWrapper\n {...props}\n section={section as ConditionContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Insertion) {\n return (\n <InsertionWrapper\n {...props}\n section={section as InsertionContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayWrapper\n {...props}\n section={section as unknown as ContentNode[]}\n />\n );\n }\n\n if (nodeType === NodeType.File) {\n return <FileWrapper {...props} section={section as FileContent} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, ContentNode>}\n />\n );\n }\n\n if (typeof section === 'string') {\n return <StringWrapper {...props} section={section} />;\n }\n};\n"],"names":["NodeType","jsx","ItemLayout","isSameKeyPath","jsxs","Fragment","createElement","getContentNodeByKeyPath","getNodeType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aAAaD,cAAS,OAAO;AAE7B,aAAAC,2BAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAIA,QAAA,aAAaD,cAAS,MAAM;AAC9B,aAAQC,2BAAA,IAAAQ,oDAAA,aAAA,EAAa,GAAG,OAAO,QAAiC,CAAA;AAAA,IAAA;AAIhE,WAAAR,2BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAIA,MAAA,OAAO,YAAY,UAAU;AAC/B,WAAQA,2BAAA,IAAAS,sDAAA,eAAA,EAAe,GAAG,OAAO,QAAkB,CAAA;AAAA,EAAA;AAEvD;;;;;;;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { NodeType, isSameKeyPath, getNodeType } from "@intlayer/core";
|
|
3
|
+
import { NodeType, isSameKeyPath, getContentNodeByKeyPath, getNodeType } from "@intlayer/core";
|
|
4
4
|
import { ItemLayout } from "./components/DictionaryEditor/ItemLayout.mjs";
|
|
5
5
|
import { createElement } from "react";
|
|
6
|
-
import { StringWrapper } from "./components/DictionaryEditor/NodeWrapper/StringWrapper.mjs";
|
|
7
6
|
import { FileWrapper } from "./components/DictionaryEditor/NodeWrapper/FileWrapper.mjs";
|
|
7
|
+
import { StringWrapper } from "./components/DictionaryEditor/NodeWrapper/StringWrapper.mjs";
|
|
8
8
|
const ArrayWrapper = (props) => {
|
|
9
9
|
const { keyPath, section, onFocusKeyPath, focusedKeyPath = [] } = props;
|
|
10
10
|
return section.map((subSection, key) => {
|
|
@@ -76,6 +76,17 @@ const EnumerationWrapper = (props) => {
|
|
|
76
76
|
] });
|
|
77
77
|
}) });
|
|
78
78
|
};
|
|
79
|
+
const InsertionWrapper = (props) => {
|
|
80
|
+
const { keyPath, section } = props;
|
|
81
|
+
const newKeyPath = [
|
|
82
|
+
...keyPath,
|
|
83
|
+
{
|
|
84
|
+
type: NodeType.Insertion
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
const subSection = section[NodeType.Insertion];
|
|
88
|
+
return /* @__PURE__ */ jsx("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: /* @__PURE__ */ jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection }) });
|
|
89
|
+
};
|
|
79
90
|
const MarkdownWrapper = (props) => {
|
|
80
91
|
const { keyPath, section } = props;
|
|
81
92
|
const newKeyPath = [
|
|
@@ -119,23 +130,13 @@ const TranslationWrapper = (props) => {
|
|
|
119
130
|
const subSection = section.translation[locale];
|
|
120
131
|
return /* @__PURE__ */ jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection });
|
|
121
132
|
};
|
|
122
|
-
const InsertionWrapper = (props) => {
|
|
123
|
-
const { keyPath, section } = props;
|
|
124
|
-
const newKeyPath = [
|
|
125
|
-
...keyPath,
|
|
126
|
-
{
|
|
127
|
-
type: NodeType.Insertion
|
|
128
|
-
}
|
|
129
|
-
];
|
|
130
|
-
const subSection = section[NodeType.Insertion];
|
|
131
|
-
return /* @__PURE__ */ jsxs("div", { className: "ml-2 grid grid-cols-[auto,1fr] gap-2", children: [
|
|
132
|
-
/* @__PURE__ */ jsx(NodeWrapper, { ...props, keyPath: newKeyPath, section: subSection }),
|
|
133
|
-
";"
|
|
134
|
-
] });
|
|
135
|
-
};
|
|
136
133
|
const traceKeys = ["filePath", "id", "nodeType"];
|
|
137
134
|
const NodeWrapper = (props) => {
|
|
138
|
-
const
|
|
135
|
+
const editedContentValue = getContentNodeByKeyPath(
|
|
136
|
+
props.editedContent,
|
|
137
|
+
props.keyPath
|
|
138
|
+
);
|
|
139
|
+
const section = editedContentValue ?? props.section;
|
|
139
140
|
const nodeType = getNodeType(section);
|
|
140
141
|
if (typeof section === "object") {
|
|
141
142
|
if (nodeType === NodeType.ReactNode) {
|
|
@@ -224,4 +225,4 @@ export {
|
|
|
224
225
|
NestedObjectWrapper as a,
|
|
225
226
|
traceKeys as t
|
|
226
227
|
};
|
|
227
|
-
//# sourceMappingURL=index-
|
|
228
|
+
//# sourceMappingURL=index-aPP3MzPT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-aPP3MzPT.js","sources":["../src/components/DictionaryEditor/NodeWrapper/ArrayWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/ConditionWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/InsertionWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/TranslationWrapper.tsx","../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"sourcesContent":["import {\n isSameKeyPath,\n NodeType,\n type ContentNode,\n type KeyPath,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype ArrayWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: ContentNode[];\n};\n\nexport const ArrayWrapper: FC<ArrayWrapperProps> = (props) => {\n const { keyPath, section, onFocusKeyPath, focusedKeyPath = [] } = props;\n\n return section.map((subSection, key) => {\n const newKeyPathEl: KeyPath = {\n key,\n type: NodeType.Array,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={JSON.stringify(subSection)}\n title={`${key}`}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n onFocusKeyPath(newKeyPath);\n }}\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </ItemLayout>\n );\n });\n};\n","import {\n type KeyPath,\n NodeType,\n type ConditionContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype ConditionWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: ConditionContent<ContentNode>;\n};\n\nexport const ConditionWrapper: FC<ConditionWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Condition,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section[NodeType.Condition][\n key as keyof (typeof section)[NodeType.Condition]\n ]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","import {\n type KeyPath,\n NodeType,\n type EnumerationContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype EnumerationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: EnumerationContent<ContentNode>;\n};\n\nexport const EnumerationWrapper: FC<EnumerationWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n {Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = {\n type: NodeType.Enumeration,\n key,\n };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section[NodeType.Enumeration][\n key as keyof (typeof section)[NodeType.Enumeration]\n ]!;\n\n return (\n <>\n <span className=\"flex items-center font-bold\">{key}</span>\n <NodeWrapper\n {...props}\n key={key}\n keyPath={newKeyPath}\n section={subSection}\n />\n </>\n );\n })}\n </div>\n );\n};\n","import {\n NodeType,\n type ContentNode,\n type InsertionContent,\n type KeyPath,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype InsertionWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: InsertionContent<ContentNode>;\n};\n\nexport const InsertionWrapper: FC<InsertionWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Insertion,\n },\n ];\n\n const subSection = section[NodeType.Insertion];\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </div>\n );\n};\n","import {\n type KeyPath,\n NodeType,\n type MarkdownContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype MarkdownWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: MarkdownContent<ContentNode>;\n};\n\nexport const MarkdownWrapper: FC<MarkdownWrapperProps> = (props) => {\n const { keyPath, section } = props;\n\n const newKeyPath: KeyPath[] = [\n ...keyPath,\n {\n type: NodeType.Markdown,\n },\n ];\n\n const subSection = section[NodeType.Markdown] as ContentNode;\n\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />\n </div>\n );\n};\n","import {\n type KeyPath,\n isSameKeyPath,\n type ContentNode,\n NodeType,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { ItemLayout } from '../ItemLayout';\nimport { NodeWrapper, traceKeys, type NodeWrapperProps } from './index';\n\ntype NestedObjectWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: Record<string, ContentNode>;\n};\n\nexport const NestedObjectWrapper: FC<NestedObjectWrapperProps> = (props) => {\n const { keyPath, section, focusedKeyPath = [], onFocusKeyPath } = props;\n\n return Object.keys(section)\n .filter((key) => !traceKeys.includes(key))\n .map((key) => {\n const newKeyPathEl: KeyPath = { key, type: NodeType.Object };\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n return (\n <ItemLayout\n level={keyPath.length}\n key={key}\n title={key}\n description=\"\"\n isSelected={isSameKeyPath(newKeyPath, focusedKeyPath)}\n onClick={(e) => {\n e.stopPropagation();\n\n onFocusKeyPath(newKeyPath);\n }}\n >\n <NodeWrapper {...props} keyPath={newKeyPath} section={section[key]} />\n </ItemLayout>\n );\n });\n};\n","import {\n type KeyPath,\n NodeType,\n type TranslationContent,\n type ContentNode,\n} from '@intlayer/core';\nimport type { FC } from 'react';\nimport { NodeWrapper, type NodeWrapperProps } from './index';\n\ntype TranslationWrapperProps = Omit<NodeWrapperProps, 'section'> & {\n section: TranslationContent<ContentNode>;\n};\n\nexport const TranslationWrapper: FC<TranslationWrapperProps> = (props) => {\n const { keyPath, section, locale } = props;\n\n const newKeyPathEl: KeyPath = {\n type: NodeType.Translation,\n key: locale,\n };\n\n const newKeyPath: KeyPath[] = [...keyPath, newKeyPathEl];\n\n const subSection =\n section.translation[\n locale as unknown as keyof (typeof section)['translation']\n ]!;\n\n return <NodeWrapper {...props} keyPath={newKeyPath} section={subSection} />;\n};\n","'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport {\n getContentNodeByKeyPath,\n getNodeType,\n NodeType,\n type ConditionContent,\n type ContentNode,\n type Dictionary,\n type EnumerationContent,\n type FileContent,\n type InsertionContent,\n type KeyPath,\n type MarkdownContent,\n type TranslationContent,\n} from '@intlayer/core';\nimport { ReactNode, type FC } from 'react';\nimport { ArrayWrapper } from './ArrayWrapper';\nimport { ConditionWrapper } from './ConditionWrapper';\nimport { EnumerationWrapper } from './EnumerationWrapper';\nimport { FileWrapper } from './FileWrapper';\nimport { InsertionWrapper } from './InsertionWrapper';\nimport { MarkdownWrapper } from './MarkdownWrapper';\nimport { NestedObjectWrapper } from './NestedObjectWrapper';\nimport { StringWrapper } from './StringWrapper';\nimport { TranslationWrapper } from './TranslationWrapper';\n\nexport const traceKeys: string[] = ['filePath', 'id', 'nodeType'];\n\nexport type NodeWrapperProps = {\n keyPath: KeyPath[];\n dictionary: Dictionary;\n section: ContentNode;\n onContentChange: (content: { keyPath: KeyPath[]; newValue: string }) => void;\n locale: Locales;\n editedContent: ContentNode;\n focusedKeyPath: KeyPath[] | undefined;\n onFocusKeyPath: (keyPath: KeyPath[]) => void;\n onClickEdit?: (keyPath: KeyPath[]) => void;\n renderSection?: (content: string) => ReactNode;\n};\n\nexport const NodeWrapper: FC<NodeWrapperProps> = (props) => {\n const editedContentValue = getContentNodeByKeyPath(\n props.editedContent,\n props.keyPath\n );\n const section = editedContentValue ?? props.section;\n const nodeType = getNodeType(section);\n\n if (typeof section === 'object') {\n if (nodeType === NodeType.ReactNode) {\n return (\n <span className=\"text-neutral text-xs\">React node not editable</span>\n );\n }\n\n if (nodeType === NodeType.Nested) {\n return (\n <div className=\"ml-2 grid grid-cols-[auto,1fr] gap-2\">\n [Nested] Dictionary\n </div>\n );\n }\n\n if (nodeType === NodeType.Markdown) {\n return (\n <MarkdownWrapper\n {...props}\n section={section as MarkdownContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Translation) {\n return (\n <TranslationWrapper\n {...props}\n section={section as TranslationContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Enumeration) {\n return (\n <EnumerationWrapper\n {...props}\n section={section as EnumerationContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Condition) {\n return (\n <ConditionWrapper\n {...props}\n section={section as ConditionContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Insertion) {\n return (\n <InsertionWrapper\n {...props}\n section={section as InsertionContent<ContentNode>}\n />\n );\n }\n\n if (nodeType === NodeType.Array) {\n return (\n <ArrayWrapper\n {...props}\n section={section as unknown as ContentNode[]}\n />\n );\n }\n\n if (nodeType === NodeType.File) {\n return <FileWrapper {...props} section={section as FileContent} />;\n }\n\n return (\n <NestedObjectWrapper\n {...props}\n section={section as Record<string, ContentNode>}\n />\n );\n }\n\n if (typeof section === 'string') {\n return <StringWrapper {...props} section={section} />;\n }\n};\n"],"names":[],"mappings":";;;;;;;AAca,MAAA,eAAsC,CAAC,UAAU;AAC5D,QAAM,EAAE,SAAS,SAAS,gBAAgB,iBAAiB,OAAO;AAElE,SAAO,QAAQ,IAAI,CAAC,YAAY,QAAQ;AACtC,UAAM,eAAwB;AAAA,MAC5B;AAAA,MACA,MAAM,SAAS;AAAA,IACjB;AACA,UAAM,aAAwB,CAAC,GAAG,SAAS,YAAY;AAGrD,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO,QAAQ;AAAA,QAEf,OAAO,GAAG,GAAG;AAAA,QACb,aAAY;AAAA,QACZ,YAAY,cAAc,YAAY,cAAc;AAAA,QACpD,SAAS,CAAC,MAAM;AACd,YAAE,gBAAgB;AAClB,yBAAe,UAAU;AAAA,QAC3B;AAAA,QAEA,8BAAC,aAAa,EAAA,GAAG,OAAO,SAAS,YAAY,SAAS,WAAY,CAAA;AAAA,MAAA;AAAA,MAT7D,KAAK,UAAU,UAAU;AAAA,IAUhC;AAAA,EAAA,CAEH;AACH;AC3Ba,MAAA,mBAA8C,CAAC,UAAU;AAC9D,QAAA,EAAE,SAAS,QAAA,IAAY;AAE7B,6BACG,OAAI,EAAA,WAAU,wCACZ,UAAO,OAAA,KAAK,OAAO,EACjB,OAAO,CAAC,QAAQ,CAAC,UAAU,SAAS,GAAG,CAAC,EACxC,IAAI,CAAC,QAAQ;AACZ,UAAM,eAAwB;AAAA,MAC5B,MAAM,SAAS;AAAA,MACf;AAAA,IACF;AACA,UAAM,aAAwB,CAAC,GAAG,SAAS,YAAY;AAEvD,UAAM,aACJ,QAAQ,SAAS,SAAS,EACxB,GACF;AAEF,WAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAC,oBAAA,QAAA,EAAK,WAAU,+BAA+B,U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