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

Function getExampleFiles

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

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