REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.19 KB
Close
/home/byroehnu/.trash/node_modules11/@adminjs/design-system/node_modules/@tiptap/react/src/ReactRenderer.tsx
Text
Base64
import { Editor } from '@tiptap/core' import React from 'react' import { Editor as ExtendedEditor } from './Editor.js' function isClassComponent(Component: any) { return !!( typeof Component === 'function' && Component.prototype && Component.prototype.isReactComponent ) } function isForwardRefComponent(Component: any) { return !!( typeof Component === 'object' && Component.$$typeof?.toString() === 'Symbol(react.forward_ref)' ) } export interface ReactRendererOptions { editor: Editor, props?: Record<string, any>, as?: string, className?: string, attrs?: Record<string, string>, } type ComponentType<R, P> = React.ComponentClass<P> | React.FunctionComponent<P> | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<R>>; export class ReactRenderer<R = unknown, P = unknown> { id: string editor: ExtendedEditor component: any element: Element props: Record<string, any> reactElement: React.ReactNode ref: R | null = null constructor(component: ComponentType<R, P>, { editor, props = {}, as = 'div', className = '', attrs, }: ReactRendererOptions) { this.id = Math.floor(Math.random() * 0xFFFFFFFF).toString() this.component = component this.editor = editor as ExtendedEditor this.props = props this.element = document.createElement(as) this.element.classList.add('react-renderer') if (className) { this.element.classList.add(...className.split(' ')) } if (attrs) { Object.keys(attrs).forEach(key => { this.element.setAttribute(key, attrs[key]) }) } this.render() } render(): void { const Component = this.component const props = this.props if (isClassComponent(Component) || isForwardRefComponent(Component)) { props.ref = (ref: R) => { this.ref = ref } } this.reactElement = <Component {...props } /> this.editor?.contentComponent?.setRenderer(this.id, this) } updateProps(props: Record<string, any> = {}): void { this.props = { ...this.props, ...props, } this.render() } destroy(): void { this.editor?.contentComponent?.removeRenderer(this.id) } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 12
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
BubbleMenu.tsx
1.51 KB
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Context.tsx
1.12 KB
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Editor.ts
489 B
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
EditorContent.tsx
3.52 KB
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FloatingMenu.tsx
1.51 KB
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
379 B
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NodeViewContent.tsx
528 B
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NodeViewWrapper.tsx
561 B
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ReactNodeViewRenderer.tsx
5.92 KB
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ReactRenderer.tsx
2.19 KB
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
useEditor.ts
2.96 KB
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
useReactNodeView.ts
392 B
lrw-r--r--
2026-02-28 11:47:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).