{"version":3,"sources":["../src/components/Editor/index.tsx","../src/components/Live/LiveProvider.tsx","../src/components/Live/LiveContext.ts","../src/utils/transpile/index.ts","../src/utils/transpile/transform.ts","../src/utils/transpile/errorBoundary.tsx","../src/utils/transpile/evalCode.ts","../src/utils/transpile/compose.ts","../src/components/Live/LiveEditor.tsx","../src/components/Live/LiveError.tsx","../src/components/Live/LivePreview.tsx","../src/components/Live/ErrorBoundary.tsx","../src/hoc/withLive.tsx"],"sourcesContent":["import { Highlight, Prism, themes } from \"prism-react-renderer\";\nimport { CSSProperties, useEffect, useRef, useState } from \"react\";\nimport { useEditable } from \"use-editable\";\n\nexport type Props = {\n  className?: string;\n  code: string;\n  disabled?: boolean;\n  language: string;\n  prism?: typeof Prism;\n  style?: CSSProperties;\n  tabMode?: \"focus\" | \"indentation\";\n  theme?: typeof themes.nightOwl;\n  onChange?(value: string): void;\n};\n\nconst CodeEditor = (props: Props) => {\n  const { tabMode = \"indentation\" } = props;\n  const editorRef = useRef(null);\n  const [code, setCode] = useState(props.code || \"\");\n  const { theme } = props;\n\n  useEffect(() => {\n    setCode(props.code);\n  }, [props.code]);\n\n  useEditable(\n    editorRef,\n    (text) => {\n      const t = text.slice(0, -1);\n      setCode(t);\n\n      if (props.onChange) {\n        props.onChange(t);\n      }\n    },\n    {\n      disabled: props.disabled,\n      indentation: tabMode === \"indentation\" ? 2 : undefined,\n    }\n  );\n\n  return (\n    <div className={props.className} style={props.style}>\n      <Highlight\n        code={code}\n        theme={props.theme || themes.nightOwl}\n        language={props.language}\n      >\n        {({\n          className: _className,\n          tokens,\n          getLineProps,\n          getTokenProps,\n          style: _style,\n        }) => (\n          <pre\n            className={_className}\n            style={{\n              margin: 0,\n              outline: \"none\",\n              padding: 10,\n              fontFamily: \"inherit\",\n              ...(theme && typeof theme.plain === \"object\" ? theme.plain : {}),\n              ..._style,\n            }}\n            ref={editorRef}\n            spellCheck=\"false\"\n          >\n            {tokens.map((line, lineIndex) => (\n              <span key={`line-${lineIndex}`} {...getLineProps({ line })}>\n                {line\n                  .filter((token) => !token.empty)\n                  .map((token, tokenIndex) => (\n                    <span\n                      key={`token-${tokenIndex}`}\n                      {...getTokenProps({ token })}\n                    />\n                  ))}\n                {\"\\n\"}\n              </span>\n            ))}\n          </pre>\n        )}\n      </Highlight>\n    </div>\n  );\n};\n\nexport default CodeEditor;\n","import { useEffect, useState, ComponentType, PropsWithChildren } from \"react\";\nimport LiveContext from \"./LiveContext\";\nimport { generateElement, renderElementAsync } from \"../../utils/transpile\";\nimport { themes } from \"prism-react-renderer\";\n\ntype ProviderState = {\n  element?: ComponentType | null;\n  error?: string;\n  newCode?: string;\n};\n\ntype Props = {\n  code?: string;\n  disabled?: boolean;\n  enableTypeScript?: boolean;\n  language?: string;\n  noInline?: boolean;\n  scope?: Record<string, unknown>;\n  theme?: typeof themes.nightOwl;\n  transformCode?(code: string): void;\n};\n\nfunction LiveProvider({\n  children,\n  code = \"\",\n  language = \"tsx\",\n  theme,\n  enableTypeScript = true,\n  disabled = false,\n  scope,\n  transformCode,\n  noInline = false,\n}: PropsWithChildren<Props>) {\n  const [state, setState] = useState<ProviderState>({\n    error: undefined,\n    element: undefined,\n  });\n\n  async function transpileAsync(newCode: string) {\n    const errorCallback = (error: Error) => {\n      setState((previousState) => ({\n        ...previousState,\n        error: error.toString(),\n        element: undefined,\n      }));\n    };\n\n    // - transformCode may be synchronous or asynchronous.\n    // - transformCode may throw an exception or return a rejected promise, e.g.\n    //   if newCode is invalid and cannot be transformed.\n    // - Not using async-await to since it requires targeting ES 2017 or\n    //   importing regenerator-runtime... in the next major version of\n    //   react-live, should target ES 2017+\n    try {\n      const transformResult = transformCode ? transformCode(newCode) : newCode;\n      try {\n        const transformedCode = await Promise.resolve(transformResult);\n        const renderElement = (element: ComponentType) =>\n          setState({ error: undefined, element, newCode });\n\n        if (typeof transformedCode !== \"string\") {\n          throw new Error(\"Code failed to transform\");\n        }\n\n        // Transpilation arguments\n        const input = {\n          code: transformedCode,\n          scope,\n          enableTypeScript,\n        };\n\n        if (noInline) {\n          setState((previousState) => ({\n            ...previousState,\n            error: undefined,\n            element: null,\n          })); // Reset output for async (no inline) evaluation\n          renderElementAsync(input, renderElement, errorCallback);\n        } else {\n          renderElement(generateElement(input, errorCallback));\n        }\n      } catch (error) {\n        return errorCallback(error as Error);\n      }\n    } catch (e) {\n      errorCallback(e as Error);\n      return Promise.resolve();\n    }\n  }\n\n  const onError = (error: Error) => setState({ error: error.toString() });\n\n  useEffect(() => {\n    transpileAsync(code).catch(onError);\n  }, [code, scope, noInline, transformCode]);\n\n  const onChange = (newCode: string) => {\n    transpileAsync(newCode).catch(onError);\n  };\n\n  return (\n    <LiveContext.Provider\n      value={{\n        ...state,\n        code,\n        language,\n        theme,\n        disabled,\n        onError,\n        onChange,\n      }}\n    >\n      {children}\n    </LiveContext.Provider>\n  );\n}\n\nexport default LiveProvider;\n","import { themes } from \"prism-react-renderer\";\nimport { ComponentType, createContext } from \"react\";\n\ntype ContextValue = {\n  error?: string;\n  element?: ComponentType | null;\n  code: string;\n  newCode?: string;\n  disabled: boolean;\n  language: string;\n  theme?: typeof themes.nightOwl;\n  onError(error: Error): void;\n  onChange(value: string): void;\n};\n\nconst LiveContext = createContext<ContextValue>({} as ContextValue);\n\nexport default LiveContext;\n","import React, { ComponentType } from \"react\";\nimport transform from \"./transform\";\nimport errorBoundary from \"./errorBoundary\";\nimport evalCode from \"./evalCode\";\nimport compose from \"./compose\";\nimport { Transform } from \"sucrase\";\n\nconst jsxConst = 'const _jsxFileName = \"\";';\nconst trimCode = (code: string) => code.trim().replace(/;$/, \"\");\nconst spliceJsxConst = (code: string) => code.replace(jsxConst, \"\").trim();\nconst addJsxConst = (code: string) => jsxConst + code;\nconst wrapReturn = (code: string) => `return (${code})`;\n\ntype GenerateOptions = {\n  code: string;\n  scope?: Record<string, unknown>;\n  enableTypeScript: boolean;\n};\n\nexport const generateElement = (\n  { code = \"\", scope = {}, enableTypeScript = true }: GenerateOptions,\n  errorCallback: (error: Error) => void\n) => {\n  /**\n   * To enable TypeScript we need to transform the TS to JS code first,\n   * splice off the JSX const, wrap the eval in a return statement, then\n   * transform any imports. The two-phase approach is required to do\n   * the implicit evaluation and not wrap leading Interface or Type\n   * statements in the return.\n   */\n\n  const firstPassTransforms: Transform[] = [\"jsx\"];\n  enableTypeScript && firstPassTransforms.push(\"typescript\");\n\n  const transformed = compose<string>(\n    addJsxConst,\n    transform({ transforms: [\"imports\"] }),\n    spliceJsxConst,\n    trimCode,\n    transform({ transforms: firstPassTransforms }),\n    wrapReturn,\n    trimCode\n  )(code);\n\n  return errorBoundary(\n    evalCode(transformed, { React, ...scope }),\n    errorCallback\n  );\n};\n\nexport const renderElementAsync = (\n  { code = \"\", scope = {}, enableTypeScript = true }: GenerateOptions,\n  resultCallback: (sender: ComponentType) => void,\n  errorCallback: (error: Error) => void\n  // eslint-disable-next-line consistent-return\n) => {\n  const render = (element: ComponentType) => {\n    if (typeof element === \"undefined\") {\n      errorCallback(new SyntaxError(\"`render` must be called with valid JSX.\"));\n    } else {\n      resultCallback(errorBoundary(element, errorCallback));\n    }\n  };\n\n  if (!/render\\s*\\(/.test(code)) {\n    return errorCallback(\n      new SyntaxError(\"No-Inline evaluations must call `render`.\")\n    );\n  }\n\n  const transforms: Transform[] = [\"jsx\", \"imports\"];\n  enableTypeScript && transforms.splice(1, 0, \"typescript\");\n\n  evalCode(transform({ transforms })(code), { React, ...scope, render });\n};\n","import { transform as _transform, Transform } from \"sucrase\";\n\nconst defaultTransforms: Transform[] = [\"jsx\", \"imports\"];\n\ntype Options = {\n  transforms?: Transform[];\n};\n\nexport default function transform(opts: Options = {}) {\n  const transforms = Array.isArray(opts.transforms)\n    ? opts.transforms.filter(Boolean)\n    : defaultTransforms;\n\n  return (code: string) => _transform(code, { transforms }).code;\n}\n","import React, { ComponentType, Component } from \"react\";\n\nconst errorBoundary = (\n  Element: ComponentType,\n  errorCallback: (error: Error) => void\n) => {\n  return class ErrorBoundary extends Component {\n    componentDidCatch(error: Error) {\n      errorCallback(error);\n    }\n\n    render() {\n      return typeof Element === \"function\" ? (\n        <Element />\n      ) : React.isValidElement(Element) ? (\n        Element\n      ) : null;\n    }\n  };\n};\n\nexport default errorBoundary;\n","import type { ComponentType } from \"react\";\n\nconst evalCode = (\n  code: string,\n  scope: Record<string, unknown>\n): ComponentType => {\n  const scopeKeys = Object.keys(scope);\n  const scopeValues = scopeKeys.map((key) => scope[key]);\n  return new Function(...scopeKeys, code)(...scopeValues);\n};\n\nexport default evalCode;\n","/**\n * Creates a new composite function that invokes the functions from right to left\n */\n\nexport default function compose<T>(...functions: ((...args: T[]) => T)[]) {\n  return functions.reduce(\n    (acc, currentFn) =>\n      (...args: T[]) =>\n        acc(currentFn(...args))\n  );\n}\n","import React, { useContext } from \"react\";\nimport LiveContext from \"./LiveContext\";\nimport Editor, { Props as EditorProps } from \"../Editor\";\n\nexport default function LiveEditor(props: Partial<EditorProps>) {\n  const { code, language, theme, disabled, onChange } = useContext(LiveContext);\n\n  return (\n    <Editor\n      theme={theme}\n      code={code}\n      language={language}\n      disabled={disabled}\n      onChange={onChange}\n      {...props}\n    />\n  );\n}\n","import React, { useContext } from \"react\";\nimport LiveContext from \"./LiveContext\";\n\nexport default function LiveError<T extends Record<string, unknown>>(props: T) {\n  const { error } = useContext(LiveContext);\n  return error ? <pre {...props}>{error}</pre> : null;\n}\n","import React, { useContext } from \"react\";\n\nimport { ErrorBoundary } from \"./ErrorBoundary\";\nimport LiveContext from \"./LiveContext\";\n\ntype Props<T extends React.ElementType = React.ElementType> = {\n  Component?: T;\n} & React.ComponentPropsWithoutRef<T>;\n\nfunction LivePreview<T extends keyof JSX.IntrinsicElements>(\n  props: Props<T>\n): JSX.Element;\nfunction LivePreview<T extends React.ElementType>(props: Props<T>): JSX.Element;\n\nfunction LivePreview({ Component = \"div\", ...rest }: Props): JSX.Element {\n  const { element: Element, onError, newCode } = useContext(LiveContext);\n\n  return (\n    <ErrorBoundary key={newCode} onError={onError}>\n      <Component {...rest}>{Element ? <Element /> : null}</Component>\n    </ErrorBoundary>\n  );\n}\nexport default LivePreview;\n","import { Component, ReactNode } from \"react\";\n\ntype Props = {\n  children: ReactNode;\n  onError?: (error: Error) => void;\n};\n\ntype State = {\n  hasError: boolean;\n};\n\nexport class ErrorBoundary extends Component<Props, State> {\n  static getDerivedStateFromError() {\n    return { hasError: true };\n  }\n\n  constructor(props: Props) {\n    super(props);\n    this.state = { hasError: false };\n  }\n\n  componentDidCatch(err: Error): void {\n    this.props.onError?.(err);\n  }\n\n  render() {\n    if (this.state.hasError) {\n      return null;\n    }\n\n    return this.props.children;\n  }\n}\n","import React, { ComponentType } from \"react\";\nimport LiveContext from \"../components/Live/LiveContext\";\n\ntype Props = {\n  live: Record<string, unknown>;\n};\n\nexport default function withLive<T>(\n  WrappedComponent: ComponentType<T & Props>\n) {\n  const WithLive = (props: T) => (\n    <LiveContext.Consumer>\n      {(live) => <WrappedComponent live={live} {...props} />}\n    </LiveContext.Consumer>\n  );\n\n  WithLive.displayName = \"WithLive\";\n  return WithLive;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAkB,cAAc;AACzC,SAAwB,WAAW,QAAQ,gBAAgB;AAC3D,SAAS,mBAAmB;AAoEd,SAIM,KAJN;AAtDd,IAAM,aAAa,CAAC,UAAiB;AACnC,QAAM,EAAE,UAAU,cAAc,IAAI;AACpC,QAAM,YAAY,OAAO,IAAI;AAC7B,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,MAAM,QAAQ,EAAE;AACjD,QAAM,EAAE,MAAM,IAAI;AAElB,YAAU,MAAM;AACd,YAAQ,MAAM,IAAI;AAAA,EACpB,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf;AAAA,IACE;AAAA,IACA,CAAC,SAAS;AACR,YAAM,IAAI,KAAK,MAAM,GAAG,EAAE;AAC1B,cAAQ,CAAC;AAET,UAAI,MAAM,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AC3B,0BAAAA,KAACC,YAAA,iCAAc,OAAd,EAAqB,oBAAU,gBAAAD,KAAC,WAAQ,IAAK,OAAK,KADjC,OAEpB;AAEJ;AACA,IAAO,sBAAQ;;;AEXE,gBAAAG,YAAA;AALF,SAAR,SACL,kBACA;AACA,QAAM,WAAW,CAAC,UAChB,gBAAAA,KAAC,oBAAY,UAAZ,EACE,WAAC,SAAS,gBAAAA,KAAC,mCAAiB,QAAgB,MAAO,GACtD;AAGF,WAAS,cAAc;AACvB,SAAO;AACT;","names":["useEffect","useState","React","jsx","React","jsx","useState","useEffect","jsx","useContext","jsx","useContext","useContext","Component","jsx","Component","useContext","jsx"]}