MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getExampleFiles

Function getExampleFiles

packages/dev/s2-docs/src/CodePlatter.tsx:285–299  ·  view source on GitHub ↗
(
  codeRef: RefObject<HTMLDivElement | null>,
  files: DownloadFiles['files'],
  urls: {[name: string]: string},
  entry: string | undefined
)

Source from the content-addressed store, hash-verified

283}
284
285function getExampleFiles(
286 codeRef: RefObject<HTMLDivElement | null>,
287 files: DownloadFiles['files'],
288 urls: {[name: string]: string},
289 entry: string | undefined
290): DownloadFiles['files'] {
291 if (!entry) {
292 return {
293 ...files,
294 'Example.tsx': {contents: getExampleCode(codeRef, urls)}
295 };
296 }
297
298 return files;
299}
300
301function getTextContent(element: Element) {
302 // Manually walk over text nodes inside the element and concatenate them.

Callers 1

CodePlatterFunction · 0.70

Calls 1

getExampleCodeFunction · 0.85

Tested by

no test coverage detected