1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

Reintroduce manual Android tests (#5884)

* Re-add manual Android tests

* Remove trailing slash

* Disable autofocus
This commit is contained in:
Joe Anderson
2025-05-27 22:44:02 +01:00
committed by GitHub
parent de260565c7
commit 8f8b957ba6
6 changed files with 519 additions and 19 deletions

View File

@@ -7,6 +7,7 @@ import { ErrorBoundary } from 'react-error-boundary'
import { Icon } from '../../examples/ts/components/index'
import AndroidTests from '../../examples/ts/android-tests'
import CheckLists from '../../examples/ts/check-lists'
import CodeHighlighting from '../../examples/ts/code-highlighting'
import EditableVoids from '../../examples/ts/editable-voids'
@@ -33,13 +34,15 @@ import CustomPlaceholder from '../../examples/ts/custom-placeholder'
// node
import { getAllExamples } from '../api'
type ExampleTuple = [string, React.ComponentType, string]
type ExampleTuple = [name: string, component: React.ComponentType, path: string]
const EXAMPLES: ExampleTuple[] = [
['Android Tests', AndroidTests, 'android-tests'],
['Checklists', CheckLists, 'check-lists'],
['Code Highlighting', CodeHighlighting, 'code-highlighting'],
['Custom Placeholder', CustomPlaceholder, 'custom-placeholder'],
['Editable Voids', EditableVoids, 'editable-voids'],
['Embeds', Embeds, 'embeds'],
['Code Highlighting', CodeHighlighting, 'code-highlighting'],
['Forced Layout', ForcedLayout, 'forced-layout'],
['Hovering Toolbar', HoveringToolbar, 'hovering-toolbar'],
['Huge Document', HugeDocument, 'huge-document'],
@@ -51,15 +54,20 @@ const EXAMPLES: ExampleTuple[] = [
['Paste HTML', PasteHtml, 'paste-html'],
['Plain Text', PlainText, 'plaintext'],
['Read-only', ReadOnly, 'read-only'],
['Rendering in iframes', IFrames, 'iframe'],
['Rich Text', RichText, 'richtext'],
['Search Highlighting', SearchHighlighting, 'search-highlighting'],
['Shadow DOM', ShadowDOM, 'shadow-dom'],
['Styling', Styling, 'styling'],
['Tables', Tables, 'tables'],
['Rendering in iframes', IFrames, 'iframe'],
['Custom placeholder', CustomPlaceholder, 'custom-placeholder'],
]
const HIDDEN_EXAMPLES = ['android-tests']
const NON_HIDDEN_EXAMPLES = EXAMPLES.filter(
([, , path]) => !HIDDEN_EXAMPLES.includes(path)
)
const Header = (props: React.HTMLAttributes<HTMLDivElement>) => (
<div
{...props}
@@ -351,7 +359,7 @@ const ExamplePage = ({ example }: { example: string }) => {
</ExampleTitle>
</ExampleHeader>
<TabList isVisible={showTabs}>
{EXAMPLES.map(([n, , p]) => (
{NON_HIDDEN_EXAMPLES.map(([n, , p]) => (
<Link
key={p as string}
href="/examples/[example]"