@xyd-js/components 0.0.0-build-1760f84-20251129221538 → 0.0.0-build-aebf977-20251203155725

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/dist/Button-DsQ-CpNa.js +2 -0
  3. package/dist/{Button-D1sRSUU2.js.map → Button-DsQ-CpNa.js.map} +1 -1
  4. package/dist/CodeSample-C3DnZZbq.js +2 -0
  5. package/dist/{CodeSample-BgBX-nnN.js.map → CodeSample-C3DnZZbq.js.map} +1 -1
  6. package/dist/Icon-Bsw2j9bV.js +4 -0
  7. package/dist/Icon-Bsw2j9bV.js.map +1 -0
  8. package/dist/PageFirstSlide-a-LXqB8m.js +2 -0
  9. package/dist/{PageFirstSlide-DaJNENNq.js.map → PageFirstSlide-a-LXqB8m.js.map} +1 -1
  10. package/dist/{TabsAnalytics-CunSa7pG.js → TabsAnalytics-CZdY7fWP.js} +1 -1
  11. package/dist/{TabsAnalytics-CunSa7pG.js.map → TabsAnalytics-CZdY7fWP.js.map} +1 -1
  12. package/dist/Update-BZAgVqnP.js +2 -0
  13. package/dist/{Update-C8Ig1-78.js.map → Update-BZAgVqnP.js.map} +1 -1
  14. package/dist/VideoGuide-BbIalYlR.js +2 -0
  15. package/dist/{VideoGuide-CjFV2soM.js.map → VideoGuide-BbIalYlR.js.map} +1 -1
  16. package/dist/coder.js +1 -1
  17. package/dist/coder.js.map +1 -1
  18. package/dist/content.js +1 -1
  19. package/dist/content.js.map +1 -1
  20. package/dist/index.css +25 -26
  21. package/dist/layouts.js +1 -1
  22. package/dist/layouts.js.map +1 -1
  23. package/dist/pages.js +1 -1
  24. package/dist/pages.js.map +1 -1
  25. package/dist/system.js +1 -1
  26. package/dist/system.js.map +1 -1
  27. package/dist/{useUXClick-w9Bk-N_Y.js → useUXClick-5-G3e-3G.js} +1 -1
  28. package/dist/{useUXClick-w9Bk-N_Y.js.map → useUXClick-5-G3e-3G.js.map} +1 -1
  29. package/dist/useUXEvents-Dii3DU11.js +2 -0
  30. package/dist/{useUXEvents-CVHyMwm7.js.map → useUXEvents-Dii3DU11.js.map} +1 -1
  31. package/dist/useUXScrollDepth-8_Y9CETh.js +2 -0
  32. package/dist/{useUXScrollDepth-DuzQBuHV.js.map → useUXScrollDepth-8_Y9CETh.js.map} +1 -1
  33. package/dist/uxsdk.js +1 -1
  34. package/dist/uxsdk.js.map +1 -1
  35. package/dist/views.js.map +1 -1
  36. package/dist/writer.js +1 -1
  37. package/dist/writer.js.map +1 -1
  38. package/package.json +2 -2
  39. package/rollup.config.js +2 -0
  40. package/dist/Button-D1sRSUU2.js +0 -2
  41. package/dist/CodeSample-BgBX-nnN.js +0 -2
  42. package/dist/Icon-DAUxBCx7.js +0 -4
  43. package/dist/Icon-DAUxBCx7.js.map +0 -1
  44. package/dist/PageFirstSlide-DaJNENNq.js +0 -2
  45. package/dist/Update-C8Ig1-78.js +0 -2
  46. package/dist/VideoGuide-CjFV2soM.js +0 -2
  47. package/dist/useUXEvents-CVHyMwm7.js +0 -2
  48. package/dist/useUXScrollDepth-DuzQBuHV.js +0 -2
package/dist/coder.js CHANGED
@@ -1,2 +1,2 @@
1
- export{C as Code,b as CodeLoader,c as CodeSample,d as CodeTheme,e as CoderProvider,a as annotations,u as useCodeTheme,w as withCodeTabs}from"./CodeSample-BgBX-nnN.js";import{_ as n,a as t}from"./Icon-DAUxBCx7.js";import{LANG_NAMES as o,highlightSync as s,highlight as i}from"@code-hike/lighter";import"react";import"./TabsAnalytics-CunSa7pG.js";import"./coder/themes/cosmo.js";import"openux-js";import"./useUXEvents-CVHyMwm7.js";import"./useUXScrollDepth-DuzQBuHV.js";import"radix-ui";import"lucide-react";function r(n){return"string"==typeof n}function l(n,e,t){o.includes(t)||(console.warn(`Unknown language "${t}"`),t="txt");const{lines:i,lang:r,style:a}=s(n.value,t,e,{annotations:[],scopes:!1}),l=m(g(p(i)));return Object.assign(Object.assign({},n),{code:n.value,tokens:l,lang:r,annotations:[],themeName:"string"==typeof e?e:(null==e?void 0:e.name)||"unknown",style:a})}function h(e,t,s){return n(this,void 0,void 0,function*(){o.includes(s)||(console.warn(`Unknown language "${s}"`),s="txt");const{lines:n,lang:r,style:a}=yield i(e.value,s,t,{annotations:[],scopes:!1}),l=m(g(p(n)));return Object.assign(Object.assign({},e),{code:e.value,tokens:l,lang:r,annotations:[],themeName:"string"==typeof t?t:(null==t?void 0:t.name)||"unknown",style:a})})}function p(n){const e=[];return n.forEach((o,s)=>{if("lines"in o)throw new Error("Shouldnt be groups");{const i=function(n){return n.map(n=>{if("tokens"in n)throw new Error("Shouldnt be groups");{const e=[n.content],o=n.style||{},{color:s}=o,i=t(o,["color"]);return e.push(s),Object.keys(i).length&&e.push(i),e}})}(o.tokens);e.push(...i),s<n.length-1&&e.push("\n")}}),e}function g(n){const e=[];return n.forEach(n=>{if(r(n))e.push(n);else{const[t,o,s]=function(n){const e=n.trim(),t=n.slice(0,n.indexOf(e)),o=n.slice(n.indexOf(e)+e.length);return[t,e,o]}(n[0]);if((null==t?void 0:t.length)&&e.push(t),o.length){const t=[...n];t[0]=o,e.push(t)}(null==s?void 0:s.length)&&e.push(s)}}),e}function m(n){const e=[];return n.forEach(n=>{if(r(n)){let t=e[e.length-1];t&&r(t)?e[e.length-1]+=n:""!==n&&e.push(n)}else n[0].length>0&&e.push(n)}),e}export{l as highlight,h as highlightAsync};
1
+ export{C as Code,b as CodeLoader,c as CodeSample,d as CodeTheme,e as CoderProvider,a as annotations,u as useCodeTheme,w as withCodeTabs}from"./CodeSample-C3DnZZbq.js";import{LANG_NAMES as n,highlight as t,highlightSync as o}from"@code-hike/lighter";import"react";import"./Icon-Bsw2j9bV.js";import"./TabsAnalytics-CZdY7fWP.js";import"./coder/themes/cosmo.js";import"openux-js";import"./useUXEvents-Dii3DU11.js";import"./useUXScrollDepth-8_Y9CETh.js";import"radix-ui";import"lucide-react";function s(n){return"string"==typeof n}function r(e,t,s){n.includes(s)||(console.warn(`Unknown language "${s}"`),s="txt");const{lines:r,lang:a,style:i}=o(e.value,s,t,{annotations:[],scopes:!1}),u=p(h(l(r)));return{...e,code:e.value,tokens:u,lang:a,annotations:[],themeName:"string"==typeof t?t:t?.name||"unknown",style:i}}async function i(e,o,s){n.includes(s)||(console.warn(`Unknown language "${s}"`),s="txt");const{lines:r,lang:a,style:i}=await t(e.value,s,o,{annotations:[],scopes:!1}),u=p(h(l(r)));return{...e,code:e.value,tokens:u,lang:a,annotations:[],themeName:"string"==typeof o?o:o?.name||"unknown",style:i}}function l(n){const e=[];return n.forEach((t,o)=>{if("lines"in t)throw new Error("Shouldnt be groups");{const s=function(n){return n.map(n=>{if("tokens"in n)throw new Error("Shouldnt be groups");{const e=[n.content],{color:t,...o}=n.style||{};return e.push(t),Object.keys(o).length&&e.push(o),e}})}(t.tokens);e.push(...s),o<n.length-1&&e.push("\n")}}),e}function h(n){const e=[];return n.forEach(n=>{if(s(n))e.push(n);else{const[t,o,s]=function(n){const e=n.trim(),t=n.slice(0,n.indexOf(e)),o=n.slice(n.indexOf(e)+e.length);return[t,e,o]}(n[0]);if(t?.length&&e.push(t),o.length){const t=[...n];t[0]=o,e.push(t)}s?.length&&e.push(s)}}),e}function p(n){const e=[];return n.forEach(n=>{if(s(n)){let t=e[e.length-1];t&&s(t)?e[e.length-1]+=n:""!==n&&e.push(n)}else n[0].length>0&&e.push(n)}),e}export{r as highlight,i as highlightAsync};
2
2
  //# sourceMappingURL=coder.js.map
package/dist/coder.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"coder.js","sources":["../src/coder/Code/highlight.ts"],"sourcesContent":["import {\n type CodeAnnotation,\n type RawCode,\n type HighlightedCode,\n type Token\n} from 'codehike/code';\nimport {\n type Lines,\n type Tokens,\n highlight as lighterAsync,\n highlightSync as lighter,\n LANG_NAMES,\n type Theme\n} from '@code-hike/lighter';\n\ntype Whitespace = string\n\ntype AnyToken = Token | Whitespace\n\nfunction isWhitespace(token: Token | Whitespace): token is Whitespace {\n return typeof token === 'string';\n}\n\nexport function highlight(\n data: RawCode,\n theme: Theme,\n lang: string\n): HighlightedCode {\n if (!LANG_NAMES.includes(lang)) {\n console.warn(`Unknown language \"${lang}\"`);\n lang = 'txt';\n }\n\n const {\n lines,\n lang: lighterLang,\n style\n } = lighter(data.value, lang, theme as any, {\n annotations: [],\n scopes: false // true for better token transitions, but breaks css themes\n });\n\n const tokens = joinLines(lines);\n // split surrounding whitespace for each token\n const splitTokens = splitWhitespace(tokens);\n // join consecutive whitespace tokens\n const joinedTokens = joinWhitespace(splitTokens);\n\n return {\n ...data,\n code: data.value,\n tokens: joinedTokens,\n lang: lighterLang,\n annotations: [], // TODO: in the future\n // annotations: compatAnnotations(annotations),\n themeName: typeof theme === 'string' ? theme : theme?.name || 'unknown',\n style\n };\n}\n\nexport async function highlightAsync(\n data: RawCode,\n theme: Theme,\n lang: string\n): Promise<HighlightedCode> {\n if (!LANG_NAMES.includes(lang)) {\n console.warn(`Unknown language \"${lang}\"`);\n lang = 'txt';\n }\n\n const {\n lines,\n lang: lighterLang,\n style\n } = await lighterAsync(data.value, lang, theme as any, {\n annotations: [],\n scopes: false // true for better token transitions, but breaks css themes\n });\n\n const tokens = joinLines(lines);\n // split surrounding whitespace for each token\n const splitTokens = splitWhitespace(tokens);\n // join consecutive whitespace tokens\n const joinedTokens = joinWhitespace(splitTokens);\n\n return {\n ...data,\n code: data.value,\n tokens: joinedTokens,\n lang: lighterLang,\n annotations: [], // TODO: in the future\n // annotations: compatAnnotations(annotations),\n themeName: typeof theme === 'string' ? theme : theme?.name || 'unknown',\n style\n };\n}\n\nfunction compatAnnotations(annotations: any[]): CodeAnnotation[] {\n const newAnnotations: CodeAnnotation[] = [];\n for (const a of annotations) {\n const {name, query, ranges} = a;\n for (const r of ranges) {\n if (r.lineNumber) {\n const {lineNumber, fromColumn, toColumn} = r;\n newAnnotations.push({\n name,\n query,\n lineNumber,\n fromColumn,\n toColumn\n });\n } else {\n const {fromLineNumber, toLineNumber} = r;\n newAnnotations.push({\n name,\n query,\n fromLineNumber,\n toLineNumber\n });\n }\n }\n }\n return newAnnotations;\n}\n\n// group the Lines into one array\nfunction joinLines(lines: Lines): AnyToken[] {\n const joinedTokens: AnyToken[] = [];\n lines.forEach((lineOrGroup, i) => {\n if ('lines' in lineOrGroup) {\n throw new Error('Shouldnt be groups');\n } else {\n const tokens = joinTokens(lineOrGroup.tokens);\n joinedTokens.push(...tokens);\n if (i < lines.length - 1) {\n joinedTokens.push('\\n');\n }\n }\n });\n return joinedTokens;\n}\n\nfunction joinTokens(tokens: Tokens): AnyToken[] {\n return tokens.map((tokenOrGroup) => {\n if ('tokens' in tokenOrGroup) {\n throw new Error('Shouldnt be groups');\n } else {\n const t = [tokenOrGroup.content] as Token;\n const {color, ...rest} = tokenOrGroup.style || {};\n t.push(color);\n if (Object.keys(rest).length) {\n t.push(rest);\n }\n return t;\n }\n });\n}\n\nfunction splitWhitespace(tokens: AnyToken[]) {\n const ejected: AnyToken[] = [];\n tokens.forEach((tokenOrGroup) => {\n if (isWhitespace(tokenOrGroup)) {\n ejected.push(tokenOrGroup);\n } else {\n const [before, content, after] = splitSurroundingWhitespace(\n tokenOrGroup[0]\n );\n if (before?.length) {\n ejected.push(before);\n }\n if (content.length) {\n const copy = [...tokenOrGroup] as Token;\n copy[0] = content;\n ejected.push(copy);\n }\n if (after?.length) {\n ejected.push(after);\n }\n }\n });\n return ejected;\n}\n\nfunction joinWhitespace(tokens: AnyToken[]) {\n const joinedTokens: AnyToken[] = [];\n tokens.forEach((tokenOrGroup) => {\n if (isWhitespace(tokenOrGroup)) {\n let last = joinedTokens[joinedTokens.length - 1];\n if (last && isWhitespace(last)) {\n joinedTokens[joinedTokens.length - 1] += tokenOrGroup;\n } else if (tokenOrGroup !== '') {\n joinedTokens.push(tokenOrGroup);\n }\n } else if (tokenOrGroup[0].length > 0) {\n joinedTokens.push(tokenOrGroup);\n }\n });\n return joinedTokens;\n}\n\n// splits \" \\t foo bar \\n\" into [\" \\t \",\"foo bar\",\" \\n\"]\n// \"foo bar\" -> [\"\",\"foo bar\",\"\"]\nfunction splitSurroundingWhitespace(content: string) {\n const trimmed = content.trim();\n const before = content.slice(0, content.indexOf(trimmed));\n const after = content.slice(content.indexOf(trimmed) + trimmed.length);\n return [before, trimmed, after];\n}"],"names":["isWhitespace","token","highlight","data","theme","lang","LANG_NAMES","includes","console","warn","lines","lighterLang","style","lighter","value","annotations","scopes","joinedTokens","joinWhitespace","splitWhitespace","joinLines","Object","assign","code","tokens","themeName","name","highlightAsync","lighterAsync","forEach","lineOrGroup","i","Error","map","tokenOrGroup","t","content","_a","color","rest","__rest","push","keys","length","joinTokens","ejected","before","after","trimmed","trim","slice","indexOf","splitSurroundingWhitespace","copy","last"],"mappings":"0fAmBA,SAASA,EAAaC,GAClB,MAAwB,iBAAVA,CAClB,UAEgBC,EACZC,EACAC,EACAC,GAEKC,EAAWC,SAASF,KACrBG,QAAQC,KAAK,qBAAqBJ,MAClCA,EAAO,OAGX,MAAMK,MACFA,EACAL,KAAMM,EAAWC,MACjBA,GACAC,EAAQV,EAAKW,MAAOT,EAAMD,EAAc,CACxCW,YAAa,GACbC,QAAQ,IAONC,EAAeC,EAFDC,EAFLC,EAAUV,KAMzB,OAAAW,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACOnB,GAAI,CACPoB,KAAMpB,EAAKW,MACXU,OAAQP,EACRZ,KAAMM,EACNI,YAAa,GAEbU,UAA4B,iBAAVrB,EAAqBA,GAAQA,aAAK,EAALA,EAAOsB,OAAQ,UAC9Dd,SAER,UAEsBe,EAClBxB,EACAC,EACAC,2CAEKC,EAAWC,SAASF,KACrBG,QAAQC,KAAK,qBAAqBJ,MAClCA,EAAO,OAGX,MAAMK,MACFA,EACAL,KAAMM,EAAWC,MACjBA,SACMgB,EAAazB,EAAKW,MAAOT,EAAMD,EAAc,CACnDW,YAAa,GACbC,QAAQ,IAONC,EAAeC,EAFDC,EAFLC,EAA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,EAAO,IAAInB,GACjBmB,EAAK,GAAKjB,EACVS,EAAQJ,KAAKY,EACjB,EACIN,aAAK,EAALA,EAAOJ,SACPE,EAAQJ,KAAKM,EAErB,IAEGF,CACX,CAEA,SAAS3B,EAAeM,GACpB,MAAMP,EAA2B,GAajC,OAZAO,EAAOK,QAASK,IACZ,GAAIlC,EAAakC,GAAe,CAC5B,IAAIoB,EAAOrC,EAAaA,EAAa0B,OAAS,GAC1CW,GAAQtD,EAAasD,GACrBrC,EAAaA,EAAa0B,OAAS,IAAMT,EACjB,KAAjBA,GACPjB,EAAawB,KAAKP,EAE1B,MAAWA,EAAa,GAAGS,OAAS,GAChC1B,EAAawB,KAAKP,KAGnBjB,CACX"}
1
+ {"version":3,"file":"coder.js","sources":["../src/coder/Code/highlight.ts"],"sourcesContent":["import {\n type CodeAnnotation,\n type RawCode,\n type HighlightedCode,\n type Token\n} from 'codehike/code';\nimport {\n type Lines,\n type Tokens,\n highlight as lighterAsync,\n highlightSync as lighter,\n LANG_NAMES,\n type Theme\n} from '@code-hike/lighter';\n\ntype Whitespace = string\n\ntype AnyToken = Token | Whitespace\n\nfunction isWhitespace(token: Token | Whitespace): token is Whitespace {\n return typeof token === 'string';\n}\n\nexport function highlight(\n data: RawCode,\n theme: Theme,\n lang: string\n): HighlightedCode {\n if (!LANG_NAMES.includes(lang)) {\n console.warn(`Unknown language \"${lang}\"`);\n lang = 'txt';\n }\n\n const {\n lines,\n lang: lighterLang,\n style\n } = lighter(data.value, lang, theme as any, {\n annotations: [],\n scopes: false // true for better token transitions, but breaks css themes\n });\n\n const tokens = joinLines(lines);\n // split surrounding whitespace for each token\n const splitTokens = splitWhitespace(tokens);\n // join consecutive whitespace tokens\n const joinedTokens = joinWhitespace(splitTokens);\n\n return {\n ...data,\n code: data.value,\n tokens: joinedTokens,\n lang: lighterLang,\n annotations: [], // TODO: in the future\n // annotations: compatAnnotations(annotations),\n themeName: typeof theme === 'string' ? theme : theme?.name || 'unknown',\n style\n };\n}\n\nexport async function highlightAsync(\n data: RawCode,\n theme: Theme,\n lang: string\n): Promise<HighlightedCode> {\n if (!LANG_NAMES.includes(lang)) {\n console.warn(`Unknown language \"${lang}\"`);\n lang = 'txt';\n }\n\n const {\n lines,\n lang: lighterLang,\n style\n } = await lighterAsync(data.value, lang, theme as any, {\n annotations: [],\n scopes: false // true for better token transitions, but breaks css themes\n });\n\n const tokens = joinLines(lines);\n // split surrounding whitespace for each token\n const splitTokens = splitWhitespace(tokens);\n // join consecutive whitespace tokens\n const joinedTokens = joinWhitespace(splitTokens);\n\n return {\n ...data,\n code: data.value,\n tokens: joinedTokens,\n lang: lighterLang,\n annotations: [], // TODO: in the future\n // annotations: compatAnnotations(annotations),\n themeName: typeof theme === 'string' ? theme : theme?.name || 'unknown',\n style\n };\n}\n\nfunction compatAnnotations(annotations: any[]): CodeAnnotation[] {\n const newAnnotations: CodeAnnotation[] = [];\n for (const a of annotations) {\n const {name, query, ranges} = a;\n for (const r of ranges) {\n if (r.lineNumber) {\n const {lineNumber, fromColumn, toColumn} = r;\n newAnnotations.push({\n name,\n query,\n lineNumber,\n fromColumn,\n toColumn\n });\n } else {\n const {fromLineNumber, toLineNumber} = r;\n newAnnotations.push({\n name,\n query,\n fromLineNumber,\n toLineNumber\n });\n }\n }\n }\n return newAnnotations;\n}\n\n// group the Lines into one array\nfunction joinLines(lines: Lines): AnyToken[] {\n const joinedTokens: AnyToken[] = [];\n lines.forEach((lineOrGroup, i) => {\n if ('lines' in lineOrGroup) {\n throw new Error('Shouldnt be groups');\n } else {\n const tokens = joinTokens(lineOrGroup.tokens);\n joinedTokens.push(...tokens);\n if (i < lines.length - 1) {\n joinedTokens.push('\\n');\n }\n }\n });\n return joinedTokens;\n}\n\nfunction joinTokens(tokens: Tokens): AnyToken[] {\n return tokens.map((tokenOrGroup) => {\n if ('tokens' in tokenOrGroup) {\n throw new Error('Shouldnt be groups');\n } else {\n const t = [tokenOrGroup.content] as Token;\n const {color, ...rest} = tokenOrGroup.style || {};\n t.push(color);\n if (Object.keys(rest).length) {\n t.push(rest);\n }\n return t;\n }\n });\n}\n\nfunction splitWhitespace(tokens: AnyToken[]) {\n const ejected: AnyToken[] = [];\n tokens.forEach((tokenOrGroup) => {\n if (isWhitespace(tokenOrGroup)) {\n ejected.push(tokenOrGroup);\n } else {\n const [before, content, after] = splitSurroundingWhitespace(\n tokenOrGroup[0]\n );\n if (before?.length) {\n ejected.push(before);\n }\n if (content.length) {\n const copy = [...tokenOrGroup] as Token;\n copy[0] = content;\n ejected.push(copy);\n }\n if (after?.length) {\n ejected.push(after);\n }\n }\n });\n return ejected;\n}\n\nfunction joinWhitespace(tokens: AnyToken[]) {\n const joinedTokens: AnyToken[] = [];\n tokens.forEach((tokenOrGroup) => {\n if (isWhitespace(tokenOrGroup)) {\n let last = joinedTokens[joinedTokens.length - 1];\n if (last && isWhitespace(last)) {\n joinedTokens[joinedTokens.length - 1] += tokenOrGroup;\n } else if (tokenOrGroup !== '') {\n joinedTokens.push(tokenOrGroup);\n }\n } else if (tokenOrGroup[0].length > 0) {\n joinedTokens.push(tokenOrGroup);\n }\n });\n return joinedTokens;\n}\n\n// splits \" \\t foo bar \\n\" into [\" \\t \",\"foo bar\",\" \\n\"]\n// \"foo bar\" -> [\"\",\"foo bar\",\"\"]\nfunction splitSurroundingWhitespace(content: string) {\n const trimmed = content.trim();\n const before = content.slice(0, content.indexOf(trimmed));\n const after = content.slice(content.indexOf(trimmed) + trimmed.length);\n return [before, trimmed, after];\n}"],"names":["isWhitespace","token","highlight","data","theme","lang","LANG_NAMES","includes","console","warn","lines","lighterLang","style","lighter","value","annotations","scopes","joinedTokens","joinWhitespace","splitWhitespace","joinLines","code","tokens","themeName","name","async","highlightAsync","lighterAsync","forEach","lineOrGroup","i","Error","map","tokenOrGroup","t","content","color","rest","push","Object","keys","length","joinTokens","ejected","before","after","trimmed","trim","slice","indexOf","splitSurroundingWhitespace","copy","last"],"mappings":"ueAmBA,SAASA,EAAaC,GAClB,MAAwB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CAxB2BQ,CAAWb,EAAYP,QACtCL,EAAaqB,QAAQhB,GACjBQ,EAAIpB,EAAM+B,OAAS,GACnBxB,EAAaqB,KAAK,KAE1B,IAEGrB,CACX,CAkBA,SAASE,EAAgBG,GACrB,MAAMqB,EAAsB,GAqB5B,OApBArB,EAAOM,QAASK,IACZ,GAAIjC,EAAaiC,GACbU,EAAQL,KAAKL,OACV,CACH,MAAOW,EAAQT,EAASU,GAsCpC,SAAoCV,GAChC,MAAMW,EAAUX,EAAQY,OAClBH,EAAST,EAAQa,MAAM,EAAGb,EAAQc,QAAQH,IAC1CD,EAAQV,EAAQa,MAAMb,EAAQc,QAAQH,GAAWA,EAAQL,QAC/D,MAAO,CAACG,EAAQE,EAASD,EAC7B,CA3C6CK,CAC7BjB,EAAa,IAKjB,GAHIW,GAAQH,QACRE,EAAQL,KAAKM,GAEbT,EAAQM,OAAQ,CAChB,MAAMU,EAAO,IAAIlB,GACjBkB,EAAK,GAAKhB,EACVQ,EAAQL,KAAKa,EACjB,CACIN,GAAOJ,QACPE,EAAQL,KAAKO,EAErB,IAEGF,CACX,CAEA,SAASzB,EAAeI,GACpB,MAAML,EAA2B,GAajC,OAZAK,EAAOM,QAASK,IACZ,GAAIjC,EAAaiC,GAAe,CAC5B,IAAImB,EAAOnC,EAAaA,EAAawB,OAAS,GAC1CW,GAAQpD,EAAaoD,GACrBnC,EAAaA,EAAawB,OAAS,IAAMR,EACjB,KAAjBA,GACPhB,EAAaqB,KAAKL,EAE1B,MAAWA,EAAa,GAAGQ,OAAS,GAChCxB,EAAaqB,KAAKL,KAGnBhB,CACX"}
package/dist/content.js CHANGED
@@ -1,2 +1,2 @@
1
- import{I as e,a as t}from"./Icon-DAUxBCx7.js";import n,{useRef as i,useState as l,useEffect as o,createContext as r,useContext as s,useMemo as a}from"react";import{G as c,B as d,T as u,S as h,H as v,L as m,a as g,b as p,A as b}from"./VideoGuide-CjFV2soM.js";import{C as j,U as E,D as f,a as O,I as w,H as k,B as C,b as S,c as y,d as L}from"./Update-C8Ig1-78.js";import{B as T}from"./Button-D1sRSUU2.js";import{T as H}from"./TabsAnalytics-CunSa7pG.js";import{b as I,a as U,G as x,P}from"./PageFirstSlide-DaJNENNq.js";import{c as B}from"./CodeSample-BgBX-nnN.js";import"@code-hike/lighter";import"radix-ui";import"lucide-react";import{u as F}from"./useUXEvents-CVHyMwm7.js";import"openux-js";import"./useUXClick-w9Bk-N_Y.js";import"./coder/themes/cosmo.js";import"./useUXScrollDepth-DuzQBuHV.js";const R="shoi6ow";class A{components(){var e;const t=[D,z,$,Z,_,ee,te].map(e=>e.bind(this)).reduce((e,t)=>Object.assign(Object.assign({},e),t()),{});return Object.assign(Object.assign({},t),(null===(e=this.options)||void 0===e?void 0:e.components)||{})}noop(){var e;const t=this.components(),n=[...Object.keys(t),...Object.keys((null===(e=this.options)||void 0===e?void 0:e.components)||{})].reduce((e,t)=>(e[t]=()=>null,e),{}),i={Steps:N,Tabs:N,GuideCard:N,Table:N};return Object.assign(Object.assign(Object.assign({},n),i),{React:G})}constructor(e,t){this.settings=e,this.options=t}}function N(){return null}function G(){return null}function D(){const e=ne.bind(this),i=V.bind(this),l={h1:e=>n.createElement(i,Object.assign({depth:1},e,{noanchor:!0})),h2:e=>{var t,l,o;const r=null===(l=null===(t=this.settings)||void 0===t?void 0:t.theme)||void 0===l?void 0:l.appearance;return n.createElement(n.Fragment,null,(null===(o=null==r?void 0:r.content)||void 0===o?void 0:o.sectionSeparator)?n.createElement(k,null):null,n.createElement(i,Object.assign({depth:2},e)))},h3:e=>n.createElement(i,Object.assign({depth:3},e)),h4:e=>n.createElement(i,Object.assign({depth:4},e)),h5:e=>n.createElement(i,Object.assign({depth:5},e)),p:e=>n.createElement(H,Object.assign({},e)),ul:e=>n.createElement(m,Object.assign({},e),e.children),ol:e=>n.createElement(g,Object.assign({},e),e.children),li:e=>n.createElement(m.Item,Object.assign({},e),e.children),table:e=>{var t,i,l,o;const r=null===(o=null===(l=null===(i=null===(t=this.settings)||void 0===t?void 0:t.theme)||void 0===i?void 0:i.appearance)||void 0===l?void 0:l.tables)||void 0===o?void 0:o.kind;return n.createElement(u,Object.assign({kind:r},e))},tr:e=>n.createElement(u.Tr,Object.assign({},e)),th:e=>n.createElement(u.Th,Object.assign({},e)),td:e=>n.createElement(u.Td,Object.assign({},e),n.createElement(u.Cell,null,e.children)),code:e=>n.createElement(S,Object.assign({},e)),pre:e,details:e=>n.createElement(f,Object.assign({},e)),blockquote:e=>n.createElement(C,Object.assign({},e)),hr:e=>{var{children:i}=e,l=t(e,["children"]);return n.createElement(k,Object.assign({},l))},a:e=>{var t;return n.createElement(le,Object.assign({},e,{as:null===(t=null==this?void 0:this.options)||void 0===t?void 0:t.Link}))},br:e=>{var{children:i}=e,l=t(e,["children"]);return n.createElement("br",Object.assign({},l))},img:e=>{var{children:i,src:l,alt:o}=e,r=t(e,["children","src","alt"]);return n.createElement(w,Object.assign({src:l,alt:o},r))},picture:e=>{const{children:i}=e,l=t(e,["children"]);return n.createElement("picture",Object.assign({},l),i)},source:e=>{const{children:i}=e,l=t(e,["children"]);return n.createElement("source",Object.assign({},l))},input:e=>{var{children:i}=e,l=t(e,["children"]);return n.createElement("input",Object.assign({},l))},textarea:e=>{var{children:i}=e,l=t(e,["children"]);return n.createElement("textarea",Object.assign({},l))},div:e=>n.createElement("div",Object.assign({},e)),span:e=>n.createElement("span",Object.assign({},e)),iframe:e=>n.createElement("iframe",Object.assign({},e)),svg:e=>n.createElement("svg",Object.assign({},e)),feature:e=>n.createElement("div",{"data-feature-flag":e.flag,"data-feature-match":e.match},e.children),React:G};return Object.assign(Object.assign({},l),{H1:l.h1,H2:l.h2,H3:l.h3,H4:l.h4,H5:l.h5,P:l.p,Ul:l.ul,Ol:l.ol,Li:l.li,Table:l.table,Tr:l.tr,Th:l.th})}function V({id:e,depth:t,children:r,label:s,subtitle:a,noanchor:c,style:d}){var u;const h=null===(u=null==this?void 0:this.options)||void 0===u?void 0:u.useNavigation(),m=F(),g=i(null),[p,b]=l(!1);function j(t){const n=window.location.hash===`#${e}`;b(n)}return o(()=>{window.addEventListener("replaceState",j);const t=window.location.hash===`#${e}`;return b(t),t&&g.current&&"loading"!==(null==h?void 0:h.state)&&g.current.scrollIntoView(),()=>{window.removeEventListener("replaceState",j)}},[]),n.createElement(v,{ref:g,id:e,size:t,active:p,onClick:()=>{var t;e&&m.docs.anchor.click({id:e});const n=new URL(window.location.href);n.hash=e,history.replaceState(null,"",n),null===(t=document.querySelector(`#${e}`))||void 0===t||t.scrollIntoView()},label:s,subtitle:a,noanchor:c,style:d},r)}function z(){const e=X.bind(this);e.List=c.List;const t=q.bind(this),i=M.bind(this);return i.Content=Q.bind(this),i.Item=Y.bind(this),i.Item.displayName="Tabs.Item",{Callout:O,Details:f,GuideCard:e,Breadcrumbs:t,Steps:h,Tabs:i,Table:u,Badge:d,Button:T,Subtitle(e){var t,i;const l=null===(i=null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.props)||void 0===i?void 0:i.children;return n.createElement(v,Object.assign({size:4,kind:"muted"},e),l)},Update:E,Card:J.bind(this),ColorSchemeButton:j,Feature:e=>n.createElement("div",{"data-feature-flag":e.flag,"data-feature-match":e.match},e.children)}}function $(){return{PageHome:U,PageFirstSlide:I,PageBlogHome:W.bind(this)}}function W(e){var t;return n.createElement(P,Object.assign({},e,{as:null===(t=null==this?void 0:this.options)||void 0===t?void 0:t.Link}))}function X(e){var t;return n.createElement(c,Object.assign({},e,{as:null===(t=null==this?void 0:this.options)||void 0===t?void 0:t.Link}))}function q(e){var t;return n.createElement(y,Object.assign({},e,{as:null===(t=null==this?void 0:this.options)||void 0===t?void 0:t.Link}))}function J(e){var t;return n.createElement(L,Object.assign({},e,{link:null===(t=null==this?void 0:this.options)||void 0===t?void 0:t.Link}))}N.Item=()=>null,N.Content=()=>null,N.List=()=>null,N.Head=()=>null,N.Td=()=>null,N.Tr=()=>null,N.Th=()=>null,N.Cell=()=>null,G.Fragment=n.Fragment;const K=r({value:"",onChange:e=>{}});function M(e){const[t,i]=l(e.value);return n.createElement(K,{value:{value:t,onChange:i}},n.createElement(p,Object.assign({},e,{value:t,onChange:e=>{const t=new URL(window.location.href),n=t.searchParams;new URLSearchParams(e).forEach((e,t)=>{n.set(t,e)}),t.search=n.toString(),history.replaceState(null,"",t),i(e)}})))}function Q(e){var t,i;const{onChange:l}=s(K),r=null===(i=null===(t=null==this?void 0:this.options)||void 0===t?void 0:t.useLocation)||void 0===i?void 0:i.call(t),a=null==r?void 0:r.search,c=new URLSearchParams(a),d=new URLSearchParams(e.value);let u=!0,h=!0;return d.forEach((e,t)=>{const n=c.get(t);n!==e&&(u=!1),n||(h=!1)}),o(()=>{u&&l(e.value)},[u]),h||(u=void 0),n.createElement(p.Content,Object.assign({},e,{defaultActive:u}))}function Y(e){var t,i,l;const{onChange:r}=s(K),a=null===(i=null===(t=null==this?void 0:this.options)||void 0===t?void 0:t.useLocation)||void 0===i?void 0:i.call(t),c=null==a?void 0:a.search,d=new URLSearchParams(c),u=new URLSearchParams(e.value);let h=!0;return u.forEach((e,t)=>{d.get(t)!==e&&(h=!1)}),o(()=>{h&&r(e.value)},[h]),n.createElement(p.Item,Object.assign({},e,{as:null===(l=null==this?void 0:this.options)||void 0===l?void 0:l.Link,defaultActive:h}))}function Z(){return{Icon:e}}function _(){return{CodeSample:B}}function ee(){return{DirectiveCodeGroup:e=>{var t,i,l;return n.createElement(B,Object.assign({},e,{theme:(null===(l=null===(i=null===(t=this.settings)||void 0===t?void 0:t.theme)||void 0===i?void 0:i.coder)||void 0===l?void 0:l.syntaxHighlight)||void 0,codeblocks:JSON.parse(e.codeblocks||"[]")}))}}}function te(){return{GridDecorator:x}}function ne(e){var t,i,l,o,r,s,c,d,u;let h;if(e.highlighted)try{const t=JSON.parse(e.highlighted);t&&(h=t)}catch(e){console.error("Error parsing highlighted code",e)}const v=((null===(i=null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.props)||void 0===i?void 0:i.className)||"").replace("language-","");let m;if(null==e?void 0:e.descriptionContent){const t=function(e){const t=oe(e);if(!oe)return{};return{component:null==t?void 0:t.default}}(null==e?void 0:e.descriptionContent);if(null==t?void 0:t.component){const e=(g=null==t?void 0:t.component,a(()=>g||null,[g]));m=n.createElement(e,{components:this.components()})}}var g;return n.createElement(B,{theme:(null===(r=null===(o=null===(l=this.settings)||void 0===l?void 0:l.theme)||void 0===o?void 0:o.coder)||void 0===r?void 0:r.syntaxHighlight)||void 0,name:v,description:"string"==typeof(null==e?void 0:e.title)?null==e?void 0:e.title:null===(c=null===(s=null==e?void 0:e.children)||void 0===s?void 0:s.props)||void 0===c?void 0:c.meta,codeblocks:[{value:null===(u=null===(d=null==e?void 0:e.children)||void 0===d?void 0:d.props)||void 0===u?void 0:u.children,lang:v,meta:v,highlighted:h}],lineNumbers:null==e?void 0:e.lineNumbers,size:null==e?void 0:e.size,descriptionHead:null==e?void 0:e.descriptionHead,descriptionContent:m,descriptionIcon:null==e?void 0:e.descriptionIcon})}const ie=/https?:\/\//;function le(e){var{href:i="",as:l,newWindow:o,children:r}=e,s=t(e,["href","as","newWindow","children"]);const a=l||b;return l||(s.newWindow=o||ie.test(i)),n.createElement(a,Object.assign({href:i},s,{as:l}),r)}function oe(e){const t={Fragment:n.Fragment,jsxs:re,jsx:re,jsxDEV:re};return new Function(...Object.keys(t),e)(t)}const re=(e,t)=>{const i=e=>e.map((e,t)=>n.isValidElement(e)&&!e.key?n.cloneElement(e,{key:`mdx-${t}`}):Array.isArray(e)?i(e):e);let l;return l=t&&t.children?Array.isArray(t.children)?i(t.children):n.isValidElement(t.children)&&!t.children.key?n.cloneElement(t.children,{key:"mdx-child"}):t.children:[],n.createElement(e,Object.assign(Object.assign({},t),{children:l}))};var se="ca1c472";function ae({children:e,metaComponent:t}){return n.createElement("xyd-content-decorator",{className:se,"meta-component":t||void 0},e)}export{ae as ContentDecorator,A as ReactContent,R as SearchButtonFullWidth,_ as coderContent,ee as directiveContent,Z as iconContent,D as stdContent,z as writerContent};
1
+ import e,{useRef as t,useState as n,useEffect as r,createContext as a,useContext as i,useMemo as o}from"react";import{G as c,B as s,T as l,S as h,H as m,L as d,a as u,b as p,A as E}from"./VideoGuide-BbIalYlR.js";import{C as f,U as g,D as b,a as v,I as w,H as k,B as C,b as S,c as y,d as L}from"./Update-BZAgVqnP.js";import{B as j}from"./Button-DsQ-CpNa.js";import{I as T}from"./Icon-Bsw2j9bV.js";import{T as H}from"./TabsAnalytics-CZdY7fWP.js";import{b as I,a as U,G as x,P}from"./PageFirstSlide-a-LXqB8m.js";import{c as B}from"./CodeSample-C3DnZZbq.js";import"@code-hike/lighter";import"radix-ui";import"lucide-react";import{u as F}from"./useUXEvents-Dii3DU11.js";import"openux-js";import"./useUXClick-5-G3e-3G.js";import"./coder/themes/cosmo.js";import"./useUXScrollDepth-8_Y9CETh.js";const R="shoi6ow";class A{components(){return{...[D,V,z,Y,Z,_,ee].map(e=>e.bind(this)).reduce((e,t)=>({...e,...t()}),{}),...this.options?.components||{}}}noop(){const e=this.components();return{...[...Object.keys(e),...Object.keys(this.options?.components||{})].reduce((e,t)=>(e[t]=()=>null,e),{}),...{Steps:N,Tabs:N,GuideCard:N,Table:N},React:G}}constructor(e,t){this.settings=e,this.options=t}}function N(){return null}function G(){return null}function D(){const t=te.bind(this),n=O.bind(this),r={h1:t=>e.createElement(n,{depth:1,...t,noanchor:!0}),h2:t=>{const r=this.settings?.theme?.appearance;return e.createElement(e.Fragment,null,r?.content?.sectionSeparator?e.createElement(k,null):null,e.createElement(n,{depth:2,...t}))},h3:t=>e.createElement(n,{depth:3,...t}),h4:t=>e.createElement(n,{depth:4,...t}),h5:t=>e.createElement(n,{depth:5,...t}),p:t=>e.createElement(H,t),ul:t=>e.createElement(d,t,t.children),ol:t=>e.createElement(u,t,t.children),li:t=>e.createElement(d.Item,t,t.children),table:t=>{const n=this.settings?.theme?.appearance?.tables?.kind;return e.createElement(l,{kind:n,...t})},tr:t=>e.createElement(l.Tr,t),th:t=>e.createElement(l.Th,t),td:t=>e.createElement(l.Td,t,e.createElement(l.Cell,null,t.children)),code:t=>e.createElement(S,t),pre:t,details:t=>e.createElement(b,t),blockquote:t=>e.createElement(C,t),hr:({children:t,...n})=>e.createElement(k,n),a:t=>e.createElement(re,{...t,as:this?.options?.Link}),br:({children:t,...n})=>e.createElement("br",n),img:({children:t,src:n,alt:r,...a})=>e.createElement(w,{src:n,alt:r,...a}),picture:t=>{const{children:n,...r}=t;return e.createElement("picture",r,n)},source:t=>{const{children:n,...r}=t;return e.createElement("source",r)},input:({children:t,...n})=>e.createElement("input",n),textarea:({children:t,...n})=>e.createElement("textarea",n),div:t=>e.createElement("div",t),span:t=>e.createElement("span",t),iframe:t=>e.createElement("iframe",t),svg:t=>e.createElement("svg",t),feature:t=>e.createElement("div",{"data-feature-flag":t.flag,"data-feature-match":t.match},t.children),React:G};return{...r,H1:r.h1,H2:r.h2,H3:r.h3,H4:r.h4,H5:r.h5,P:r.p,Ul:r.ul,Ol:r.ol,Li:r.li,Table:r.table,Tr:r.tr,Th:r.th}}function O({id:a,depth:i,children:o,label:c,subtitle:s,noanchor:l,style:h}){const d=this?.options?.useNavigation(),u=F(),p=t(null),[E,f]=n(!1);function g(e){const t=window.location.hash===`#${a}`;f(t)}return r(()=>{window.addEventListener("replaceState",g);const e=window.location.hash===`#${a}`;return f(e),e&&p.current&&"loading"!==d?.state&&p.current.scrollIntoView(),()=>{window.removeEventListener("replaceState",g)}},[]),e.createElement(m,{ref:p,id:a,size:i,active:E,onClick:()=>{a&&u.docs.anchor.click({id:a});const e=new URL(window.location.href);e.hash=a,history.replaceState(null,"",e),document.querySelector(`#${a}`)?.scrollIntoView()},label:c,subtitle:s,noanchor:l,style:h},o)}function V(){const t=X.bind(this);t.List=c.List;const n=q.bind(this),r=K.bind(this);return r.Content=M.bind(this),r.Item=Q.bind(this),r.Item.displayName="Tabs.Item",{Callout:v,Details:b,GuideCard:t,Breadcrumbs:n,Steps:h,Tabs:r,Table:l,Badge:s,Button:j,Subtitle(t){const n=t?.children?.props?.children;return e.createElement(m,{size:4,kind:"muted",...t},n)},Update:g,Card:J.bind(this),ColorSchemeButton:f,Feature:t=>e.createElement("div",{"data-feature-flag":t.flag,"data-feature-match":t.match},t.children)}}function z(){return{PageHome:U,PageFirstSlide:I,PageBlogHome:$.bind(this)}}function $(t){return e.createElement(P,{...t,as:this?.options?.Link})}function X(t){return e.createElement(c,{...t,as:this?.options?.Link})}function q(t){return e.createElement(y,{...t,as:this?.options?.Link})}function J(t){return e.createElement(L,{...t,link:this?.options?.Link})}N.Item=()=>null,N.Content=()=>null,N.List=()=>null,N.Head=()=>null,N.Td=()=>null,N.Tr=()=>null,N.Th=()=>null,N.Cell=()=>null,G.Fragment=e.Fragment;const W=a({value:"",onChange:e=>{}});function K(t){const[r,a]=n(t.value);return e.createElement(W,{value:{value:r,onChange:a}},e.createElement(p,{...t,value:r,onChange:e=>{const t=new URL(window.location.href),n=t.searchParams;new URLSearchParams(e).forEach((e,t)=>{n.set(t,e)}),t.search=n.toString(),history.replaceState(null,"",t),a(e)}}))}function M(t){const{onChange:n}=i(W),a=this?.options?.useLocation?.(),o=a?.search,c=new URLSearchParams(o),s=new URLSearchParams(t.value);let l=!0,h=!0;return s.forEach((e,t)=>{const n=c.get(t);n!==e&&(l=!1),n||(h=!1)}),r(()=>{l&&n(t.value)},[l]),h||(l=void 0),e.createElement(p.Content,{...t,defaultActive:l})}function Q(t){const{onChange:n}=i(W),a=this?.options?.useLocation?.(),o=a?.search,c=new URLSearchParams(o),s=new URLSearchParams(t.value);let l=!0;return s.forEach((e,t)=>{c.get(t)!==e&&(l=!1)}),r(()=>{l&&n(t.value)},[l]),e.createElement(p.Item,{...t,as:this?.options?.Link,defaultActive:l})}function Y(){return{Icon:T}}function Z(){return{CodeSample:B}}function _(){return{DirectiveCodeGroup:t=>e.createElement(B,{...t,theme:this.settings?.theme?.coder?.syntaxHighlight||void 0,codeblocks:JSON.parse(t.codeblocks||"[]")})}}function ee(){return{GridDecorator:x}}function te(t){let n;if(t.highlighted)try{const e=JSON.parse(t.highlighted);e&&(n=e)}catch(e){console.error("Error parsing highlighted code",e)}const r=(t?.children?.props?.className||"").replace("language-","");let a;if(t?.descriptionContent){const n=function(e){const t=ae(e);if(!ae)return{};return{component:t?.default}}(t?.descriptionContent);if(n?.component){const t=(i=n?.component,o(()=>i||null,[i]));a=e.createElement(t,{components:this.components()})}}var i;return e.createElement(B,{theme:this.settings?.theme?.coder?.syntaxHighlight||void 0,name:r,description:"string"==typeof t?.title?t?.title:t?.children?.props?.meta,codeblocks:[{value:t?.children?.props?.children,lang:r,meta:r,highlighted:n}],lineNumbers:t?.lineNumbers,size:t?.size,descriptionHead:t?.descriptionHead,descriptionContent:a,descriptionIcon:t?.descriptionIcon})}const ne=/https?:\/\//;function re({href:t="",as:n,newWindow:r,children:a,...i}){const o=n||E;return n||(i.newWindow=r||ne.test(t)),e.createElement(o,{href:t,...i,as:n},a)}function ae(t){const n={Fragment:e.Fragment,jsxs:ie,jsx:ie,jsxDEV:ie};return new Function(...Object.keys(n),t)(n)}const ie=(t,n)=>{const r=t=>t.map((t,n)=>e.isValidElement(t)&&!t.key?e.cloneElement(t,{key:`mdx-${n}`}):Array.isArray(t)?r(t):t);let a;return a=n&&n.children?Array.isArray(n.children)?r(n.children):e.isValidElement(n.children)&&!n.children.key?e.cloneElement(n.children,{key:"mdx-child"}):n.children:[],e.createElement(t,{...n,children:a})};var oe="ca1c472";function ce({children:t,metaComponent:n}){return e.createElement("xyd-content-decorator",{className:oe,"meta-component":n||void 0},t)}export{ce as ContentDecorator,A as ReactContent,R as SearchButtonFullWidth,Z as coderContent,_ as directiveContent,Y as iconContent,D as stdContent,V as writerContent};
2
2
  //# sourceMappingURL=content.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","sources":["../src/content/AppearanceDecorator.styles.tsx","../src/content/ReactContent.tsx","../src/content/ContentDecoator.styles.tsx","../src/content/ContentDecorator.tsx"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nexport const SearchButtonFullWidth = css`\n [data-desktop]:has(xyd-nav-item xyd-search-button) {\n width: 100%;\n }\n\n xyd-nav-item:has(xyd-search-button) {\n flex: 1;\n }\n`\n","import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react'\nimport { HighlightedCode } from 'codehike/code';\n\nimport {\n Settings\n} from \"@xyd-js/core\"\n\nimport {\n Anchor,\n Badge,\n Blockquote,\n Callout,\n Code,\n Details,\n GuideCard,\n Heading,\n Hr,\n Table,\n Tabs,\n Steps,\n List,\n ListOl,\n Text,\n Button,\n Icon,\n Image,\n Update,\n Card,\n ColorSchemeButton,\n Breadcrumbs\n} from '../../writer'\nimport { PageHome, PageFirstSlide, PageBlogHome } from '../../pages'\nimport { CodeSample } from \"../../coder\";\nimport { GridDecorator } from './GridDecorator';\nimport { useUXEvents } from '../uxsdk';\n\ninterface ReactContentOptions {\n Link?: React.ElementType\n components?: { [component: string]: (props: any) => React.JSX.Element | null }\n useLocation?: () => {\n search: string\n } // TODO: !!!! BETTER API !!!!!\n useNavigate?: (to: any) => void // TODO: !!!! BETTER API !!!!!\n useNavigation?: () => any, // TODO: !!!! BETTER API !!!!!\n\n}\n\nexport class ReactContent {\n constructor(\n protected settings?: Settings,\n protected options?: ReactContentOptions\n ) {\n }\n\n public components(): { [component: string]: (props: any) => React.JSX.Element | null } {\n const builtInComponents = [\n stdContent,\n writerContent,\n pageComponents,\n iconContent,\n coderContent,\n directiveContent,\n contentDecorators,\n ]\n .map(fn => fn.bind(this))\n .reduce((acc, fn) => ({ ...acc, ...fn() }), {});\n\n return {\n ...builtInComponents,\n ...this.options?.components || {}\n }\n }\n\n public noop() {\n const components = this.components()\n\n const noopBuiltInFlatComponents = [\n ...Object.keys(components),\n ...Object.keys(this.options?.components || {})\n ].reduce((acc, key) => {\n acc[key] = () => null\n return acc\n }, {})\n\n const noopNestedComponents = {\n Steps: NoopComponent,\n Tabs: NoopComponent,\n GuideCard: NoopComponent,\n Table: NoopComponent,\n }\n\n return {\n ...noopBuiltInFlatComponents,\n ...noopNestedComponents,\n React: NoopReactComponent,\n }\n }\n}\n\nfunction NoopComponent() {\n return null\n}\nNoopComponent.Item = () => null\nNoopComponent.Content = () => null\nNoopComponent.List = () => null\nNoopComponent.Head = () => null\nNoopComponent.Td = () => null\nNoopComponent.Tr = () => null\nNoopComponent.Th = () => null\nNoopComponent.Cell = () => null\n\n\nfunction NoopReactComponent() { // TODO: !!!! in the future refactor but `html-to-jsx-transform` creates <React.Fragment> !!!\n return null\n}\nNoopReactComponent.Fragment = React.Fragment\n\nexport function stdContent(\n this: ReactContent,\n) {\n const $$Pre = $Pre.bind(this)\n const $$Heading = $Heading.bind(this)\n\n const stdComponents = {\n h1: (props) => {\n return <$$Heading depth={1} {...props} noanchor />\n },\n h2: props => {\n const appearance = this.settings?.theme?.appearance\n\n return <>\n {appearance?.content?.sectionSeparator ? <Hr /> : null}\n\n <$$Heading depth={2} {...props} />\n </>\n },\n h3: props => {\n return <$$Heading depth={3} {...props} />\n },\n h4: props => {\n return <$$Heading depth={4} {...props} />\n },\n h5: props => {\n return <$$Heading depth={5} {...props} />\n },\n p: props => {\n return <Text {...props} />\n },\n ul: props => {\n return <List {...props}>\n {props.children}\n </List>\n },\n ol: props => {\n return <ListOl {...props}>\n {props.children}\n </ListOl>\n },\n li: props => {\n return <List.Item {...props} >\n {props.children}\n </List.Item>\n },\n\n table: (props) => {\n const kind = this.settings?.theme?.appearance?.tables?.kind\n\n return <Table kind={kind} {...props} />\n },\n tr: (props) => {\n return <Table.Tr {...props} />\n },\n th: (props) => {\n return <Table.Th {...props} />\n },\n td: (props) => {\n return <Table.Td {...props}>\n <Table.Cell>\n {props.children}\n </Table.Cell>\n </Table.Td>\n },\n\n code: (props) => {\n return <Code {...props} />\n },\n pre: $$Pre,\n details: (props) => {\n return <Details {...props} />\n },\n blockquote: (props) => {\n return <Blockquote {...props} />\n },\n hr: ({ children, ...props }) => {\n return <Hr {...props} />\n },\n a: (props) => {\n return <$Link {...props} as={this?.options?.Link} />\n },\n br: ({ children, ...props }) => {\n return <br {...props} />\n },\n img: ({ children, src, alt, ...props }) => {\n return <Image src={src} alt={alt} {...props} />\n },\n picture: (props) => {\n const { children, ...rest } = props\n\n return <picture {...rest}>\n {children}\n </picture>\n },\n source: (props) => {\n const { children, ...rest } = props\n\n return <source {...rest} />\n },\n input: ({ children, ...props }) => {\n return <input {...props} />\n },\n textarea: ({ children, ...props }) => {\n return <textarea {...props} />\n },\n div: (props) => <div {...props} />,\n span: (props) => <span {...props} />,\n iframe: (props) => <iframe {...props} />,\n svg: (props) => <svg {...props} />,\n feature: (props) => <div data-feature-flag={props.flag} data-feature-match={props.match}>{props.children}</div>,\n React: NoopReactComponent,\n }\n\n return {\n ...stdComponents,\n H1: stdComponents.h1,\n H2: stdComponents.h2,\n H3: stdComponents.h3,\n H4: stdComponents.h4,\n H5: stdComponents.h5,\n P: stdComponents.p,\n Ul: stdComponents.ul,\n Ol: stdComponents.ol,\n Li: stdComponents.li,\n Table: stdComponents.table,\n Tr: stdComponents.tr,\n Th: stdComponents.th,\n }\n}\n\ninterface HeadingContentProps {\n id: string\n depth: 1 | 2 | 3 | 4 | 5 | 6\n children: React.ReactNode\n label?: string\n subtitle?: string\n noanchor?: boolean\n style?: any\n}\n\nfunction $Heading({ id, depth, children, label, subtitle, noanchor, style }: HeadingContentProps) {\n // const location = this?.options?.useLocation?.() // TODO: !!!! BETTER API !!!!!\n // const navigate = this?.options?.useNavigate() // TODO: !!!! BETTER API !!!!!\n const navigation = this?.options?.useNavigation() // TODO: !!!! BETTER API !!!!!\n const ux = useUXEvents()\n\n const ref = useRef<HTMLHeadingElement>(null!)\n const [active, setActive] = useState(false)\n\n function onReplaceState(e: any) {\n const active = window.location.hash === `#${id}`\n setActive(active)\n }\n\n useEffect(() => {\n window.addEventListener('replaceState', onReplaceState)\n\n const active = window.location.hash === `#${id}`\n setActive(active)\n\n if (active && ref.current && navigation?.state !== \"loading\") {\n ref.current.scrollIntoView()\n }\n\n return () => {\n window.removeEventListener('replaceState', onReplaceState)\n }\n }, [])\n\n return <Heading\n ref={ref}\n id={id}\n size={depth}\n active={active}\n onClick={() => {\n if (id) {\n ux.docs.anchor.click({\n id: id\n })\n }\n // navigate({\n // hash: id\n // })\n\n // TODO: !!! in the future we should use react-router but some issues with the hash !!!\n const url = new URL(window.location.href)\n url.hash = id\n history.replaceState(null, '', url)\n\n document.querySelector(`#${id}`)?.scrollIntoView()\n }}\n label={label}\n subtitle={subtitle}\n noanchor={noanchor}\n style={style}\n >\n {children}\n </Heading>\n}\n\nexport function writerContent() {\n const GuideCardContent = $GuideCardContentComponent.bind(this)\n GuideCardContent.List = GuideCard.List\n const BreadcrumbsContent = $BreadcrumbsContentComponent.bind(this)\n\n const TabsContent = $TabsContentComponent.bind(this)\n TabsContent.Content = $TabsContentContentComponent.bind(this)\n TabsContent.Item = $TabsItemContentComponent.bind(this)\n TabsContent.Item.displayName = \"Tabs.Item\"\n\n return {\n Callout,\n Details,\n GuideCard: GuideCardContent,\n Breadcrumbs: BreadcrumbsContent,\n Steps,\n Tabs: TabsContent,\n Table,\n Badge,\n Button,\n Subtitle(props) {\n const paragraph = props?.children?.props?.children\n\n return <Heading size={4} kind=\"muted\" {...props}>\n {paragraph}\n </Heading>\n },\n Update,\n Card: $Card.bind(this),\n ColorSchemeButton: ColorSchemeButton,\n Feature: (props) => <div data-feature-flag={props.flag} data-feature-match={props.match}>\n {props.children}\n </div>\n }\n}\n\nfunction pageComponents() {\n return {\n PageHome,\n PageFirstSlide,\n PageBlogHome: $PageBlogHome.bind(this)\n }\n}\n\nfunction $PageBlogHome(props) {\n return <PageBlogHome\n {...props}\n as={this?.options?.Link}\n />\n}\n\nfunction $GuideCardContentComponent(props) {\n return <GuideCard\n {...props}\n as={this?.options?.Link}\n />\n}\n\nfunction $BreadcrumbsContentComponent(props) {\n return <Breadcrumbs\n {...props}\n as={this?.options?.Link}\n />\n}\n\nfunction $Card(props) {\n return <Card\n {...props}\n link={this?.options?.Link}\n />\n}\n\nconst TabsContentContext = createContext({\n value: \"\",\n onChange: (v: string) => {\n }\n})\n\nfunction $TabsContentComponent(props) {\n const [value, setValue] = useState(props.value)\n\n return <TabsContentContext value={{ value, onChange: setValue }}>\n <Tabs\n {...props}\n value={value}\n onChange={val => {\n const url = new URL(window.location.href)\n const currentParams = url.searchParams\n\n // Update parameters from the new params\n new URLSearchParams(val).forEach((value, key) => {\n currentParams.set(key, value)\n })\n\n url.search = currentParams.toString()\n history.replaceState(null, '', url)\n\n setValue(val)\n }}\n />\n </TabsContentContext>\n}\n\nfunction $TabsContentContentComponent(this: ReactContent, props) {\n const { onChange } = useContext(TabsContentContext)\n const location = this?.options?.useLocation?.() // TODO: !!!! BETTER API !!!!!\n\n const search = location?.search\n const params = new URLSearchParams(search)\n const propsParams = new URLSearchParams(props.value)\n\n let tabsMatch: boolean | undefined = true\n let keyMatchExists = true\n propsParams.forEach((value, key) => {\n const paramKey = params.get(key)\n if (paramKey !== value) {\n tabsMatch = false\n }\n if (!paramKey) {\n keyMatchExists = false\n }\n })\n\n useEffect(() => {\n if (tabsMatch) {\n onChange(props.value)\n }\n }, [tabsMatch])\n\n if (!keyMatchExists) {\n tabsMatch = undefined\n }\n\n return <Tabs.Content {...props} defaultActive={tabsMatch} />\n}\n\nfunction $TabsItemContentComponent(props) {\n const { onChange } = useContext(TabsContentContext)\n const location = this?.options?.useLocation?.()\n\n const search = location?.search\n const params = new URLSearchParams(search)\n const propsParams = new URLSearchParams(props.value)\n\n let tabsMatch = true\n propsParams.forEach((value, key) => {\n if (params.get(key) !== value) {\n tabsMatch = false\n }\n })\n\n useEffect(() => {\n if (tabsMatch) {\n onChange(props.value)\n }\n }, [tabsMatch])\n\n return <Tabs.Item\n {...props}\n as={this?.options?.Link}\n defaultActive={tabsMatch}\n />\n}\n\n// TODO: better system for icons + should work with .md like icon=\"session-replay\" etc.\nexport function iconContent() {\n return {\n Icon,\n }\n}\n\nexport function coderContent() {\n return {\n CodeSample, // TODO: server side highlight?\n }\n}\n\nexport function directiveContent(\n this: ReactContent,\n) {\n return {\n // TODO: deprecate? - but currently needed for directive cuz we do JSON.parse here\n DirectiveCodeGroup: (props) => {\n return <CodeSample\n {...props}\n theme={this.settings?.theme?.coder?.syntaxHighlight || undefined}\n codeblocks={JSON.parse(props.codeblocks || \"[]\")}\n />\n }\n }\n}\n\nexport function contentDecorators() {\n return {\n GridDecorator\n }\n}\n\nfunction $Pre(\n this: ReactContent,\n props: any\n) {\n let highlighted: HighlightedCode | undefined = undefined\n\n if (props.highlighted) {\n // if ssr highlighted code\n try {\n const serverHighlight: HighlightedCode = JSON.parse(props.highlighted)\n\n if (serverHighlight) {\n highlighted = serverHighlight\n }\n } catch (e) {\n console.error(\"Error parsing highlighted code\", e)\n }\n }\n const lang = (props?.children?.props?.className || \"\").replace(\"language-\", \"\")\n\n let descriptionContent: React.ReactNode | undefined = undefined\n if (props?.descriptionContent) {\n const code = mdxContent(props?.descriptionContent)\n if (code?.component) {\n const Component = MemoMDXComponent(code?.component)\n\n descriptionContent = <Component components={this.components()} />\n }\n }\n\n return <CodeSample\n theme={this.settings?.theme?.coder?.syntaxHighlight || undefined}\n name={lang}\n description={typeof props?.title === \"string\" ? props?.title : props?.children?.props?.meta}\n codeblocks={[\n {\n value: props?.children?.props?.children,\n lang: lang,\n meta: lang,\n highlighted,\n }\n ]}\n lineNumbers={props?.lineNumbers}\n size={props?.size}\n descriptionHead={props?.descriptionHead}\n descriptionContent={descriptionContent}\n descriptionIcon={props?.descriptionIcon}\n />\n}\n\nconst EXTERNAL_HREF_REGEX = /https?:\\/\\//\n\ninterface LinkProps {\n href?: string\n as?: React.ElementType\n newWindow?: boolean\n children?: React.ReactNode\n}\n\nfunction $Link({\n href = '',\n as,\n newWindow,\n children,\n ...props\n}: LinkProps) {\n const Link = as || Anchor\n\n if (!as) {\n // TODO: fix any\n (props as any).newWindow = newWindow || EXTERNAL_HREF_REGEX.test(href)\n }\n\n return <Link\n href={href}\n {...props}\n as={as}\n >\n {children}\n </Link>\n}\n\n// TODO: move to content?\nfunction mdxExport(code: string) {\n // Create a wrapper around React.createElement that adds keys to elements in lists\n const scope = {\n Fragment: React.Fragment,\n jsxs: createElementWithKeys,\n jsx: createElementWithKeys,\n jsxDEV: createElementWithKeys,\n }\n const fn = new Function(...Object.keys(scope), code)\n\n return fn(scope)\n}\n\nfunction MemoMDXComponent(codeComponent: any) {\n return useMemo(\n () => codeComponent ? codeComponent : null,\n [codeComponent]\n )\n}\n\n\n// // TODO: move to content?\nfunction mdxContent(code: string) {\n const content = mdxExport(code) // TODO: fix any\n if (!mdxExport) {\n return {}\n }\n\n return {\n component: content?.default,\n }\n}\n\nconst createElementWithKeys = (type: any, props: any) => {\n // Process children to add keys to all elements\n const processChildren = (childrenArray: any[]): any[] => {\n return childrenArray.map((child, index) => {\n // If the child is a React element and doesn't have a key, add one\n if (React.isValidElement(child) && !child.key) {\n return React.cloneElement(child, { key: `mdx-${index}` });\n }\n // If the child is an array, process it recursively\n if (Array.isArray(child)) {\n return processChildren(child);\n }\n return child;\n });\n };\n\n // Handle both cases: children as separate args or as props.children\n let processedChildren;\n\n if (props && props.children) {\n if (Array.isArray(props.children)) {\n processedChildren = processChildren(props.children);\n } else if (React.isValidElement(props.children) && !props.children.key) {\n // Single child without key\n processedChildren = React.cloneElement(props.children, { key: 'mdx-child' });\n } else {\n // Single child with key or non-React element\n processedChildren = props.children;\n }\n } else {\n processedChildren = [];\n }\n\n // Create the element with processed children\n return React.createElement(type, {\n ...props,\n children: processedChildren\n });\n};","import { css } from \"@linaria/core\";\n\nexport default {\n ContentDecoratorHost: css`\n @layer components {\n --space-small: 8px;\n --space-medium: 16px;\n --space-large: 20px;\n --space-xlarge: 24px;\n --space-xxlarge: 32px;\n --space-2xlarge: 50px;\n\n font-size: var(--xyd-font-size-medium);\n line-height: var(--xyd-line-height-medium);\n\n p:not(li p):not(ul p):not(xyd-callout p):not(xyd-codetabs p):not(xyd-guidecard p):not([data-button=\"true\"] p) {\n margin-top: var(--space-medium);\n }\n\n button {\n p {\n color: var(--xyd-button-primary-color);\n }\n }\n\n & > img, p > img {\n margin-top: var(--space-medium);\n }\n\n figure {\n margin: 0;\n padding: 12px;\n background: var(--dark16);\n border-radius: 15px;\n border: 1px solid var(--dark32);\n text-align: center;\n padding-bottom: 0;\n\n figcaption {\n padding: 4px;\n }\n }\n\n blockquote {\n margin-top: var(--space-medium);\n }\n \n xyd-steps {\n margin-top: var(--space-medium);\n }\n \n table {\n margin-top: var(--space-xlarge);\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n }\n \n details {\n &:not([data-kind=\"tertiary\"]) {\n --xyd-callout-bgcolor: var(--white);\n }\n margin-top: var(--space-medium);\n\n summary {\n [part=\"summary-deep\"], [part=\"summary-deep-label\"] {\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n }\n [part=\"summary-deep-label\"] {\n font-weight: bold;\n }\n }\n\n &[data-kind=\"secondary\"] {\n code {\n background: var(--xyd-details-bgcolor--secondary);\n }\n }\n }\n\n hr {\n margin: var(--space-xxlarge) 0;\n }\n \n p {\n display: block;\n\n code {\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n margin: 0;\n }\n }\n \n h2,h3,h4,h5,h6 {\n margin-top: var(--space-xxlarge);\n &[data-kind=\"muted\"] {\n display: block;\n }\n }\n h2 {\n margin-top: var(--space-2xlarge);\n }\n h2:first-of-type {\n margin-top: var(--space-xxlarge);\n }\n h4 {\n &[data-kind=\"muted\"] {\n margin: 4px 0 32px;\n }\n }\n \n ul:not(xyd-tabs ul), ol:not(xyd-tabs ol) {\n margin-top: var(--space-medium);\n }\n \n xyd-codetabs, xyd-callout, xyd-guidecard, xyd-tabs {\n margin: var(--space-large) 0;\n }\n \n xyd-guidecard [part=\"body\"] {\n color: var(--xyd-text-color--default, var(--dark48));\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-medium);\n\n p {\n color: var(--xyd-text-color--default, var(--dark48));\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-medium);\n }\n }\n \n xyd-guidecard-list xyd-guidecard {\n margin-bottom: 0;\n }\n\n xyd-tabs [part=\"buttons\"] {\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n }\n\n xyd-callout {\n --xyd-font-size-medium: var(--xyd-font-size-small);\n }\n \n xyd-codetabs {\n xyd-code-pre {\n font-size: var(--xyd-font-size-xsmall);\n line-height: var(--xyd-line-height-xsmall);\n }\n }\n\n xyd-breadcrumbs {\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n margin-bottom: var(--space-small);\n font-weight: var(--xyd-font-weight-semibold);\n }\n\n xyd-grid-decorator {\n @media (min-width: 1025px) and (max-width: 1400px) {\n ul ul {\n grid-template-columns: repeat(2, 1fr);\n }\n \n /* Override data-cols for tablet */\n &[data-cols] {\n --data-cols: 2;\n }\n }\n }\n\n [data-content-element]:not([data-content-element=\"false\"]) {\n margin-top: var(--space-medium);\n }\n }\n `\n}\n","import React from 'react'\n\nimport cn from \"./ContentDecoator.styles\";\n\ninterface ContentDecoratorProps {\n children: React.ReactNode\n metaComponent?: string\n}\n\nexport function ContentDecorator({ children, metaComponent }: ContentDecoratorProps) {\n return <xyd-content-decorator\n className={cn.ContentDecoratorHost}\n meta-component={metaComponent || undefined}\n >\n {children}\n </xyd-content-decorator>\n}\n"],"names":["SearchButtonFullWidth","ReactContent","components","builtInComponents","stdContent","writerContent","pageComponents","iconContent","coderContent","directiveContent","contentDecorators","map","fn","bind","this","reduce","acc","Object","assign","_a","options","noop","noopBuiltInFlatComponents","keys","key","noopNestedComponents","Steps","NoopComponent","Tabs","GuideCard","Table","React","NoopReactComponent","constructor","settings","$$Pre","$Pre","$$Heading","$Heading","stdComponents","h1","props","createElement","depth","noanchor","h2","appearance","_b","theme","Fragment","content","_c","sectionSeparator","Hr","h3","h4","h5","p","Text","ul","List","children","ol","ListOl","li","Item","table","kind","_d","tables","tr","Tr","th","Th","td","Td","Cell","code","Code","pre","details","Details","blockquote","Blockquote","hr","__rest","a","$Link","as","Link","br","img","src","alt","Image","picture","rest","source","input","textarea","div","span","iframe","svg","feature","flag","match","H1","H2","H3","H4","H5","P","Ul","Ol","Li","id","label","subtitle","style","navigation","useNavigation","ux","useUXEvents","ref","useRef","active","setActive","useState","onReplaceState","e","window","location","hash","useEffect","addEventListener","current","state","scrollIntoView","removeEventListener","Heading","size","onClick","docs","anchor","click","url","URL","href","history","replaceState","document","querySelector","GuideCardContent","$GuideCardContentComponent","BreadcrumbsContent","$BreadcrumbsContentComponent","TabsContent","$TabsContentComponent","Content","$TabsContentContentComponent","$TabsItemContentComponent","displayName","Callout","Breadcrumbs","Badge","Button","Subtitle","paragraph","Update","Card","$Card","ColorSchemeButton","Feature","PageHome","PageFirstSlide","PageBlogHome","$PageBlogHome","link","Head","TabsContentContext","createContext","value","onChange","v","setValue","val","currentParams","searchParams","URLSearchParams","forEach","set","search","toString","useContext","useLocation","call","params","propsParams","tabsMatch","keyMatchExists","paramKey","get","undefined","defaultActive","Icon","CodeSample","DirectiveCodeGroup","coder","syntaxHighlight","codeblocks","JSON","parse","GridDecorator","highlighted","serverHighlight","console","error","lang","className","replace","descriptionContent","mdxExport","component","default","mdxContent","Component","codeComponent","useMemo","_e","name","description","title","_g","_f","meta","_j","_h","lineNumbers","descriptionHead","descriptionIcon","EXTERNAL_HREF_REGEX","newWindow","Anchor","test","scope","jsxs","createElementWithKeys","jsx","jsxDEV","Function","type","processChildren","childrenArray","child","index","isValidElement","cloneElement","Array","isArray","processedChildren","cn","ContentDecoratorHost","ContentDecorator","metaComponent"],"mappings":"0xBAEO,MAAMA,EAAAA,gBC6CAC,EAOFC,UAAAA,SACH,MAAMC,EAAoB,CACtBC,EACAC,EACAC,EACAC,EACAC,EACAC,GACAC,IAECC,IAAIC,GAAMA,EAAGC,KAAKC,OAClBC,OAAO,CAACC,EAAKJ,I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B,GAAK,CACRoB,SAAUuM,MC1pBlB,IAAAC,GACIC,mBCMYC,IAAiB1M,SAAEA,EAAQ2M,cAAEA,IACzC,OAAOzO,EAAAW,cAAA,wBAAA,CACHiL,UAAW0C,GAAuB,iBAClBG,QAAiB7D,GAEhC9I,EAET"}
1
+ {"version":3,"file":"content.js","sources":["../src/content/AppearanceDecorator.styles.tsx","../src/content/ReactContent.tsx","../src/content/ContentDecoator.styles.tsx","../src/content/ContentDecorator.tsx"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nexport const SearchButtonFullWidth = css`\n [data-desktop]:has(xyd-nav-item xyd-search-button) {\n width: 100%;\n }\n\n xyd-nav-item:has(xyd-search-button) {\n flex: 1;\n }\n`\n","import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react'\nimport { HighlightedCode } from 'codehike/code';\n\nimport {\n Settings\n} from \"@xyd-js/core\"\n\nimport {\n Anchor,\n Badge,\n Blockquote,\n Callout,\n Code,\n Details,\n GuideCard,\n Heading,\n Hr,\n Table,\n Tabs,\n Steps,\n List,\n ListOl,\n Text,\n Button,\n Icon,\n Image,\n Update,\n Card,\n ColorSchemeButton,\n Breadcrumbs\n} from '../../writer'\nimport { PageHome, PageFirstSlide, PageBlogHome } from '../../pages'\nimport { CodeSample } from \"../../coder\";\nimport { GridDecorator } from './GridDecorator';\nimport { useUXEvents } from '../uxsdk';\n\ninterface ReactContentOptions {\n Link?: React.ElementType\n components?: { [component: string]: (props: any) => React.JSX.Element | null }\n useLocation?: () => {\n search: string\n } // TODO: !!!! BETTER API !!!!!\n useNavigate?: (to: any) => void // TODO: !!!! BETTER API !!!!!\n useNavigation?: () => any, // TODO: !!!! BETTER API !!!!!\n\n}\n\nexport class ReactContent {\n constructor(\n protected settings?: Settings,\n protected options?: ReactContentOptions\n ) {\n }\n\n public components(): { [component: string]: (props: any) => React.JSX.Element | null } {\n const builtInComponents = [\n stdContent,\n writerContent,\n pageComponents,\n iconContent,\n coderContent,\n directiveContent,\n contentDecorators,\n ]\n .map(fn => fn.bind(this))\n .reduce((acc, fn) => ({ ...acc, ...fn() }), {});\n\n return {\n ...builtInComponents,\n ...this.options?.components || {}\n }\n }\n\n public noop() {\n const components = this.components()\n\n const noopBuiltInFlatComponents = [\n ...Object.keys(components),\n ...Object.keys(this.options?.components || {})\n ].reduce((acc, key) => {\n acc[key] = () => null\n return acc\n }, {})\n\n const noopNestedComponents = {\n Steps: NoopComponent,\n Tabs: NoopComponent,\n GuideCard: NoopComponent,\n Table: NoopComponent,\n }\n\n return {\n ...noopBuiltInFlatComponents,\n ...noopNestedComponents,\n React: NoopReactComponent,\n }\n }\n}\n\nfunction NoopComponent() {\n return null\n}\nNoopComponent.Item = () => null\nNoopComponent.Content = () => null\nNoopComponent.List = () => null\nNoopComponent.Head = () => null\nNoopComponent.Td = () => null\nNoopComponent.Tr = () => null\nNoopComponent.Th = () => null\nNoopComponent.Cell = () => null\n\n\nfunction NoopReactComponent() { // TODO: !!!! in the future refactor but `html-to-jsx-transform` creates <React.Fragment> !!!\n return null\n}\nNoopReactComponent.Fragment = React.Fragment\n\nexport function stdContent(\n this: ReactContent,\n) {\n const $$Pre = $Pre.bind(this)\n const $$Heading = $Heading.bind(this)\n\n const stdComponents = {\n h1: (props) => {\n return <$$Heading depth={1} {...props} noanchor />\n },\n h2: props => {\n const appearance = this.settings?.theme?.appearance\n\n return <>\n {appearance?.content?.sectionSeparator ? <Hr /> : null}\n\n <$$Heading depth={2} {...props} />\n </>\n },\n h3: props => {\n return <$$Heading depth={3} {...props} />\n },\n h4: props => {\n return <$$Heading depth={4} {...props} />\n },\n h5: props => {\n return <$$Heading depth={5} {...props} />\n },\n p: props => {\n return <Text {...props} />\n },\n ul: props => {\n return <List {...props}>\n {props.children}\n </List>\n },\n ol: props => {\n return <ListOl {...props}>\n {props.children}\n </ListOl>\n },\n li: props => {\n return <List.Item {...props} >\n {props.children}\n </List.Item>\n },\n\n table: (props) => {\n const kind = this.settings?.theme?.appearance?.tables?.kind\n\n return <Table kind={kind} {...props} />\n },\n tr: (props) => {\n return <Table.Tr {...props} />\n },\n th: (props) => {\n return <Table.Th {...props} />\n },\n td: (props) => {\n return <Table.Td {...props}>\n <Table.Cell>\n {props.children}\n </Table.Cell>\n </Table.Td>\n },\n\n code: (props) => {\n return <Code {...props} />\n },\n pre: $$Pre,\n details: (props) => {\n return <Details {...props} />\n },\n blockquote: (props) => {\n return <Blockquote {...props} />\n },\n hr: ({ children, ...props }) => {\n return <Hr {...props} />\n },\n a: (props) => {\n return <$Link {...props} as={this?.options?.Link} />\n },\n br: ({ children, ...props }) => {\n return <br {...props} />\n },\n img: ({ children, src, alt, ...props }) => {\n return <Image src={src} alt={alt} {...props} />\n },\n picture: (props) => {\n const { children, ...rest } = props\n\n return <picture {...rest}>\n {children}\n </picture>\n },\n source: (props) => {\n const { children, ...rest } = props\n\n return <source {...rest} />\n },\n input: ({ children, ...props }) => {\n return <input {...props} />\n },\n textarea: ({ children, ...props }) => {\n return <textarea {...props} />\n },\n div: (props) => <div {...props} />,\n span: (props) => <span {...props} />,\n iframe: (props) => <iframe {...props} />,\n svg: (props) => <svg {...props} />,\n feature: (props) => <div data-feature-flag={props.flag} data-feature-match={props.match}>{props.children}</div>,\n React: NoopReactComponent,\n }\n\n return {\n ...stdComponents,\n H1: stdComponents.h1,\n H2: stdComponents.h2,\n H3: stdComponents.h3,\n H4: stdComponents.h4,\n H5: stdComponents.h5,\n P: stdComponents.p,\n Ul: stdComponents.ul,\n Ol: stdComponents.ol,\n Li: stdComponents.li,\n Table: stdComponents.table,\n Tr: stdComponents.tr,\n Th: stdComponents.th,\n }\n}\n\ninterface HeadingContentProps {\n id: string\n depth: 1 | 2 | 3 | 4 | 5 | 6\n children: React.ReactNode\n label?: string\n subtitle?: string\n noanchor?: boolean\n style?: any\n}\n\nfunction $Heading({ id, depth, children, label, subtitle, noanchor, style }: HeadingContentProps) {\n // const location = this?.options?.useLocation?.() // TODO: !!!! BETTER API !!!!!\n // const navigate = this?.options?.useNavigate() // TODO: !!!! BETTER API !!!!!\n const navigation = this?.options?.useNavigation() // TODO: !!!! BETTER API !!!!!\n const ux = useUXEvents()\n\n const ref = useRef<HTMLHeadingElement>(null!)\n const [active, setActive] = useState(false)\n\n function onReplaceState(e: any) {\n const active = window.location.hash === `#${id}`\n setActive(active)\n }\n\n useEffect(() => {\n window.addEventListener('replaceState', onReplaceState)\n\n const active = window.location.hash === `#${id}`\n setActive(active)\n\n if (active && ref.current && navigation?.state !== \"loading\") {\n ref.current.scrollIntoView()\n }\n\n return () => {\n window.removeEventListener('replaceState', onReplaceState)\n }\n }, [])\n\n return <Heading\n ref={ref}\n id={id}\n size={depth}\n active={active}\n onClick={() => {\n if (id) {\n ux.docs.anchor.click({\n id: id\n })\n }\n // navigate({\n // hash: id\n // })\n\n // TODO: !!! in the future we should use react-router but some issues with the hash !!!\n const url = new URL(window.location.href)\n url.hash = id\n history.replaceState(null, '', url)\n\n document.querySelector(`#${id}`)?.scrollIntoView()\n }}\n label={label}\n subtitle={subtitle}\n noanchor={noanchor}\n style={style}\n >\n {children}\n </Heading>\n}\n\nexport function writerContent() {\n const GuideCardContent = $GuideCardContentComponent.bind(this)\n GuideCardContent.List = GuideCard.List\n const BreadcrumbsContent = $BreadcrumbsContentComponent.bind(this)\n\n const TabsContent = $TabsContentComponent.bind(this)\n TabsContent.Content = $TabsContentContentComponent.bind(this)\n TabsContent.Item = $TabsItemContentComponent.bind(this)\n TabsContent.Item.displayName = \"Tabs.Item\"\n\n return {\n Callout,\n Details,\n GuideCard: GuideCardContent,\n Breadcrumbs: BreadcrumbsContent,\n Steps,\n Tabs: TabsContent,\n Table,\n Badge,\n Button,\n Subtitle(props) {\n const paragraph = props?.children?.props?.children\n\n return <Heading size={4} kind=\"muted\" {...props}>\n {paragraph}\n </Heading>\n },\n Update,\n Card: $Card.bind(this),\n ColorSchemeButton: ColorSchemeButton,\n Feature: (props) => <div data-feature-flag={props.flag} data-feature-match={props.match}>\n {props.children}\n </div>\n }\n}\n\nfunction pageComponents() {\n return {\n PageHome,\n PageFirstSlide,\n PageBlogHome: $PageBlogHome.bind(this)\n }\n}\n\nfunction $PageBlogHome(props) {\n return <PageBlogHome\n {...props}\n as={this?.options?.Link}\n />\n}\n\nfunction $GuideCardContentComponent(props) {\n return <GuideCard\n {...props}\n as={this?.options?.Link}\n />\n}\n\nfunction $BreadcrumbsContentComponent(props) {\n return <Breadcrumbs\n {...props}\n as={this?.options?.Link}\n />\n}\n\nfunction $Card(props) {\n return <Card\n {...props}\n link={this?.options?.Link}\n />\n}\n\nconst TabsContentContext = createContext({\n value: \"\",\n onChange: (v: string) => {\n }\n})\n\nfunction $TabsContentComponent(props) {\n const [value, setValue] = useState(props.value)\n\n return <TabsContentContext value={{ value, onChange: setValue }}>\n <Tabs\n {...props}\n value={value}\n onChange={val => {\n const url = new URL(window.location.href)\n const currentParams = url.searchParams\n\n // Update parameters from the new params\n new URLSearchParams(val).forEach((value, key) => {\n currentParams.set(key, value)\n })\n\n url.search = currentParams.toString()\n history.replaceState(null, '', url)\n\n setValue(val)\n }}\n />\n </TabsContentContext>\n}\n\nfunction $TabsContentContentComponent(this: ReactContent, props) {\n const { onChange } = useContext(TabsContentContext)\n const location = this?.options?.useLocation?.() // TODO: !!!! BETTER API !!!!!\n\n const search = location?.search\n const params = new URLSearchParams(search)\n const propsParams = new URLSearchParams(props.value)\n\n let tabsMatch: boolean | undefined = true\n let keyMatchExists = true\n propsParams.forEach((value, key) => {\n const paramKey = params.get(key)\n if (paramKey !== value) {\n tabsMatch = false\n }\n if (!paramKey) {\n keyMatchExists = false\n }\n })\n\n useEffect(() => {\n if (tabsMatch) {\n onChange(props.value)\n }\n }, [tabsMatch])\n\n if (!keyMatchExists) {\n tabsMatch = undefined\n }\n\n return <Tabs.Content {...props} defaultActive={tabsMatch} />\n}\n\nfunction $TabsItemContentComponent(props) {\n const { onChange } = useContext(TabsContentContext)\n const location = this?.options?.useLocation?.()\n\n const search = location?.search\n const params = new URLSearchParams(search)\n const propsParams = new URLSearchParams(props.value)\n\n let tabsMatch = true\n propsParams.forEach((value, key) => {\n if (params.get(key) !== value) {\n tabsMatch = false\n }\n })\n\n useEffect(() => {\n if (tabsMatch) {\n onChange(props.value)\n }\n }, [tabsMatch])\n\n return <Tabs.Item\n {...props}\n as={this?.options?.Link}\n defaultActive={tabsMatch}\n />\n}\n\n// TODO: better system for icons + should work with .md like icon=\"session-replay\" etc.\nexport function iconContent() {\n return {\n Icon,\n }\n}\n\nexport function coderContent() {\n return {\n CodeSample, // TODO: server side highlight?\n }\n}\n\nexport function directiveContent(\n this: ReactContent,\n) {\n return {\n // TODO: deprecate? - but currently needed for directive cuz we do JSON.parse here\n DirectiveCodeGroup: (props) => {\n return <CodeSample\n {...props}\n theme={this.settings?.theme?.coder?.syntaxHighlight || undefined}\n codeblocks={JSON.parse(props.codeblocks || \"[]\")}\n />\n }\n }\n}\n\nexport function contentDecorators() {\n return {\n GridDecorator\n }\n}\n\nfunction $Pre(\n this: ReactContent,\n props: any\n) {\n let highlighted: HighlightedCode | undefined = undefined\n\n if (props.highlighted) {\n // if ssr highlighted code\n try {\n const serverHighlight: HighlightedCode = JSON.parse(props.highlighted)\n\n if (serverHighlight) {\n highlighted = serverHighlight\n }\n } catch (e) {\n console.error(\"Error parsing highlighted code\", e)\n }\n }\n const lang = (props?.children?.props?.className || \"\").replace(\"language-\", \"\")\n\n let descriptionContent: React.ReactNode | undefined = undefined\n if (props?.descriptionContent) {\n const code = mdxContent(props?.descriptionContent)\n if (code?.component) {\n const Component = MemoMDXComponent(code?.component)\n\n descriptionContent = <Component components={this.components()} />\n }\n }\n\n return <CodeSample\n theme={this.settings?.theme?.coder?.syntaxHighlight || undefined}\n name={lang}\n description={typeof props?.title === \"string\" ? props?.title : props?.children?.props?.meta}\n codeblocks={[\n {\n value: props?.children?.props?.children,\n lang: lang,\n meta: lang,\n highlighted,\n }\n ]}\n lineNumbers={props?.lineNumbers}\n size={props?.size}\n descriptionHead={props?.descriptionHead}\n descriptionContent={descriptionContent}\n descriptionIcon={props?.descriptionIcon}\n />\n}\n\nconst EXTERNAL_HREF_REGEX = /https?:\\/\\//\n\ninterface LinkProps {\n href?: string\n as?: React.ElementType\n newWindow?: boolean\n children?: React.ReactNode\n}\n\nfunction $Link({\n href = '',\n as,\n newWindow,\n children,\n ...props\n}: LinkProps) {\n const Link = as || Anchor\n\n if (!as) {\n // TODO: fix any\n (props as any).newWindow = newWindow || EXTERNAL_HREF_REGEX.test(href)\n }\n\n return <Link\n href={href}\n {...props}\n as={as}\n >\n {children}\n </Link>\n}\n\n// TODO: move to content?\nfunction mdxExport(code: string) {\n // Create a wrapper around React.createElement that adds keys to elements in lists\n const scope = {\n Fragment: React.Fragment,\n jsxs: createElementWithKeys,\n jsx: createElementWithKeys,\n jsxDEV: createElementWithKeys,\n }\n const fn = new Function(...Object.keys(scope), code)\n\n return fn(scope)\n}\n\nfunction MemoMDXComponent(codeComponent: any) {\n return useMemo(\n () => codeComponent ? codeComponent : null,\n [codeComponent]\n )\n}\n\n\n// // TODO: move to content?\nfunction mdxContent(code: string) {\n const content = mdxExport(code) // TODO: fix any\n if (!mdxExport) {\n return {}\n }\n\n return {\n component: content?.default,\n }\n}\n\nconst createElementWithKeys = (type: any, props: any) => {\n // Process children to add keys to all elements\n const processChildren = (childrenArray: any[]): any[] => {\n return childrenArray.map((child, index) => {\n // If the child is a React element and doesn't have a key, add one\n if (React.isValidElement(child) && !child.key) {\n return React.cloneElement(child, { key: `mdx-${index}` });\n }\n // If the child is an array, process it recursively\n if (Array.isArray(child)) {\n return processChildren(child);\n }\n return child;\n });\n };\n\n // Handle both cases: children as separate args or as props.children\n let processedChildren;\n\n if (props && props.children) {\n if (Array.isArray(props.children)) {\n processedChildren = processChildren(props.children);\n } else if (React.isValidElement(props.children) && !props.children.key) {\n // Single child without key\n processedChildren = React.cloneElement(props.children, { key: 'mdx-child' });\n } else {\n // Single child with key or non-React element\n processedChildren = props.children;\n }\n } else {\n processedChildren = [];\n }\n\n // Create the element with processed children\n return React.createElement(type, {\n ...props,\n children: processedChildren\n });\n};","import { css } from \"@linaria/core\";\n\nexport default {\n ContentDecoratorHost: css`\n @layer components {\n --space-small: 8px;\n --space-medium: 16px;\n --space-large: 20px;\n --space-xlarge: 24px;\n --space-xxlarge: 32px;\n --space-2xlarge: 50px;\n\n font-size: var(--xyd-font-size-medium);\n line-height: var(--xyd-line-height-medium);\n\n p:not(li p):not(ul p):not(xyd-callout p):not(xyd-codetabs p):not(xyd-guidecard p):not([data-button=\"true\"] p) {\n margin-top: var(--space-medium);\n }\n\n button {\n p {\n color: var(--xyd-button-primary-color);\n }\n }\n\n & > img, p > img {\n margin-top: var(--space-medium);\n }\n\n figure {\n margin: 0;\n padding: 12px;\n background: var(--dark16);\n border-radius: 15px;\n border: 1px solid var(--dark32);\n text-align: center;\n padding-bottom: 0;\n\n figcaption {\n padding: 4px;\n }\n }\n\n blockquote {\n margin-top: var(--space-medium);\n }\n \n xyd-steps {\n margin-top: var(--space-medium);\n }\n \n table {\n margin-top: var(--space-xlarge);\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n }\n \n details {\n &:not([data-kind=\"tertiary\"]) {\n --xyd-callout-bgcolor: var(--white);\n }\n margin-top: var(--space-medium);\n\n summary {\n [part=\"summary-deep\"], [part=\"summary-deep-label\"] {\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n }\n [part=\"summary-deep-label\"] {\n font-weight: bold;\n }\n }\n\n &[data-kind=\"secondary\"] {\n code {\n background: var(--xyd-details-bgcolor--secondary);\n }\n }\n }\n\n hr {\n margin: var(--space-xxlarge) 0;\n }\n \n p {\n display: block;\n\n code {\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n margin: 0;\n }\n }\n \n h2,h3,h4,h5,h6 {\n margin-top: var(--space-xxlarge);\n &[data-kind=\"muted\"] {\n display: block;\n }\n }\n h2 {\n margin-top: var(--space-2xlarge);\n }\n h2:first-of-type {\n margin-top: var(--space-xxlarge);\n }\n h4 {\n &[data-kind=\"muted\"] {\n margin: 4px 0 32px;\n }\n }\n \n ul:not(xyd-tabs ul), ol:not(xyd-tabs ol) {\n margin-top: var(--space-medium);\n }\n \n xyd-codetabs, xyd-callout, xyd-guidecard, xyd-tabs {\n margin: var(--space-large) 0;\n }\n \n xyd-guidecard [part=\"body\"] {\n color: var(--xyd-text-color--default, var(--dark48));\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-medium);\n\n p {\n color: var(--xyd-text-color--default, var(--dark48));\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-medium);\n }\n }\n \n xyd-guidecard-list xyd-guidecard {\n margin-bottom: 0;\n }\n\n xyd-tabs [part=\"buttons\"] {\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n }\n\n xyd-callout {\n --xyd-font-size-medium: var(--xyd-font-size-small);\n }\n \n xyd-codetabs {\n xyd-code-pre {\n font-size: var(--xyd-font-size-xsmall);\n line-height: var(--xyd-line-height-xsmall);\n }\n }\n\n xyd-breadcrumbs {\n font-size: var(--xyd-font-size-small);\n line-height: var(--xyd-line-height-small);\n margin-bottom: var(--space-small);\n font-weight: var(--xyd-font-weight-semibold);\n }\n\n xyd-grid-decorator {\n @media (min-width: 1025px) and (max-width: 1400px) {\n ul ul {\n grid-template-columns: repeat(2, 1fr);\n }\n \n /* Override data-cols for tablet */\n &[data-cols] {\n --data-cols: 2;\n }\n }\n }\n\n [data-content-element]:not([data-content-element=\"false\"]) {\n margin-top: var(--space-medium);\n }\n }\n `\n}\n","import React from 'react'\n\nimport cn from \"./ContentDecoator.styles\";\n\ninterface ContentDecoratorProps {\n children: React.ReactNode\n metaComponent?: string\n}\n\nexport function ContentDecorator({ children, metaComponent }: ContentDecoratorProps) {\n return <xyd-content-decorator\n className={cn.ContentDecoratorHost}\n meta-component={metaComponent || undefined}\n >\n {children}\n </xyd-content-decorator>\n}\n"],"names":["SearchButtonFullWidth","ReactContent","components","stdContent","writerContent","pageComponents","iconContent","coderContent","directiveContent","contentDecorators","map","fn","bind","this","reduce","acc","options","noop","Object","keys","key","Steps","NoopComponent","Tabs","GuideCard","Table","React","NoopReactComponent","constructor","settings","$$Pre","$Pre","$$Heading","$Heading","stdComponents","h1","props","createElement","depth","noanchor","h2","appearance","theme","content","sectionSeparator","Hr","h3","h4","h5","p","Text","ul","List","children","ol","ListOl","li","Item","table","kind","tables","tr","Tr","th","Th","td","Td","Cell","code","Code","pre","details","Details","blockquote","Blockquote","hr","a","$Link","as","Link","br","img","src","alt","Image","picture","rest","source","input","textarea","div","span","iframe","svg","feature","data-feature-flag","flag","data-feature-match","match","H1","H2","H3","H4","H5","P","Ul","Ol","Li","id","label","subtitle","style","navigation","useNavigation","ux","useUXEvents","ref","useRef","active","setActive","useState","onReplaceState","e","window","location","hash","useEffect","addEventListener","current","state","scrollIntoView","removeEventListener","Heading","size","onClick","docs","anchor","click","url","URL","href","history","replaceState","document","querySelector","GuideCardContent","$GuideCardContentComponent","BreadcrumbsContent","$BreadcrumbsContentComponent","TabsContent","$TabsContentComponent","Content","$TabsContentContentComponent","$TabsItemContentComponent","displayName","Callout","Breadcrumbs","Badge","Button","Subtitle","paragraph","Update","Card","$Card","ColorSchemeButton","Feature","PageHome","PageFirstSlide","PageBlogHome","$PageBlogHome","link","Head","Fragment","TabsContentContext","createContext","value","onChange","v","setValue","val","currentParams","searchParams","URLSearchParams","forEach","set","search","toString","useContext","useLocation","params","propsParams","tabsMatch","keyMatchExists","paramKey","get","undefined","defaultActive","Icon","CodeSample","DirectiveCodeGroup","coder","syntaxHighlight","codeblocks","JSON","parse","GridDecorator","highlighted","serverHighlight","console","error","lang","className","replace","descriptionContent","mdxExport","component","default","mdxContent","Component","codeComponent","useMemo","name","description","title","meta","lineNumbers","descriptionHead","descriptionIcon","EXTERNAL_HREF_REGEX","newWindow","Anchor","test","scope","jsxs","createElementWithKeys","jsx","jsxDEV","Function","type","processChildren","childrenArray","child","index","isValidElement","cloneElement","Array","isArray","processedChildren","cn","ContentDecoratorHost","ContentDecorator","metaComponent","xyd-content-decorator","meta-component"],"mappings":"mxBAEO,MAAMA,EAAAA,UC6CN,MAAMC,EAOFC,UAAAA,GAaH,MAAO,IAZmB,CACtBC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,IAECC,IAAIC,GAAMA,EAAGC,KAAKC,OAClBC,OAAO,CAACC,EAAKJ,SAAaI,KAAQJ,MAAS,CAAA,MAIzCE,KAAKG,SAASd,YAAc,CAAA,EAEvC,CAEOe,IAAAA,GACH,MAAMf,EAAaW,KAAKX,aAiBxB,MAAO,IAf2B,IAC3BgB,OAAOC,KAAKjB,MACZgB,OAAOC,KAAKN,KAAKG,SAASd,YAAc,CAAA,IAC7CY,OAAO,CAACC,EAAKK,KACXL,EAAIK,GAAO,IAAM,KACVL,GACR,CAAA,MAE0B,CACzBM,MAAOC,EACPC,KAAMD,EACNE,UAAWF,EACXG,MAAOH,GAMPI,MAAOC,EAEf,CAhDA,WAAAC,CACIC,EACUb,QADAa,SAAAA,OACAb,QAAAA,CAEd,EA+CJ,SAASM,IACL,OAAO,IACX,CAWA,SAASK,IACL,OAAO,IACX,CAGO,SAASxB,IAGZ,MAAM2B,EAAQC,GAAKnB,KAAKC,MAClBmB,EAAYC,EAASrB,KAAKC,MAE1BqB,EAAgB,CAClBC,GAAKC,GACMV,EAAAW,cAACL,EAAAA,CAAUM,MAAO,KAAOF,EAAOG,UAAAA,IAE3CC,GAAIJ,IACA,MAAMK,EAAa5B,KAAKgB,UAAUa,OAAOD,WAEzC,OAAOf,gCACFe,GAAYE,SAASC,iBAAmBlB,EAAAW,cAACQ,EAAAA,MAAQ,KAElDnB,EAAAW,cAACL,EAAAA,CAAUM,MAAO,KAAOF,MAGjCU,GAAIV,GACOV,EAAAW,cAACL,EAAAA,CAAUM,MAAO,KAAOF,IAEpCW,GAAIX,GACOV,EAAAW,cAACL,EAAAA,CAAUM,MAAO,KAAOF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