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

Function getExampleFiles

packages/dev/s2-docs/src/CodePlatter.tsx:289–303  ·  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

287}
288
289function getExampleFiles(
290 codeRef: RefObject<HTMLDivElement | null>,
291 files: DownloadFiles['files'],
292 urls: {[name: string]: string},
293 entry: string | undefined
294): DownloadFiles['files'] {
295 if (!entry) {
296 return {
297 ...files,
298 'Example.tsx': {contents: getExampleCode(codeRef, urls)}
299 };
300 }
301
302 return files;
303}
304
305function getTextContent(element: Element) {
306 // 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