index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/examples/react-dropzone.mdx | ---
title: React Dropzone
---
[React Dropzone](https://react-dropzone.js.org/) is a simple React hook to create a HTML5-compliant drag'n'drop zone for files.
> ⚠️ All examples below are using **TypeScript**. If you're not using it, you can remove all type definitions from the component definition.
[Click here](https... | 8,300 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/examples/react-input-mask.mdx | ---
title: React Input Mask
description: Learn how to use React Input Mask with Unform
---
[React Input Mask](https://github.com/sanniassin/react-input-mask) offers an easy way to add masks to inputs.
> ⚠️ All examples below are using **TypeScript**. If you're not using it, you can remove all type definitions from th... | 8,301 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/examples/react-native-input-mask.mdx | ---
title: React Native Input Mask
description: Learn how to use React Native Input Mask with Unform
---
[React Native Masked Text](https://github.com/benhurott/react-native-masked-text) offers an easy way to add masks to inputs.
## Input component
Create a base Input component, as described in the [React Native](/g... | 8,302 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/examples/react-native-picker-select.mdx | ---
title: React Native Picker Select
---
[React Native Picker Select](https://github.com/lawnstarter/react-native-picker-select) component for React Native which emulates the native `<select>` interfaces for iOS and Android.
> ⚠️ All examples below are using **TypeScript**. If you're not using it, you can remove all... | 8,303 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/examples/react-number-format.mdx | ---
title: React Number Format
---
[React Number Format](https://www.npmjs.com/package/react-number-format) is a popular package that makes it easy to format inputted numbers, allowing to add prefixes, suffixes, decimal formatting and so on.
> ⚠️ All examples below are using **TypeScript**. If you're not using it, yo... | 8,304 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/examples/react-select.mdx | ---
title: React Select
description: Learn how to use React Select with Unform
---
[React Select](https://react-select.com/) is the coolest ReactJS custom `<select>` library.
If you're not using it, we recommend using it instead of using simple `<select>` elements as it's highly customizable and provides an incredibl... | 8,305 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/examples/react-simple-code-editor.mdx | ---
title: React Simple Code Editor
description: Learn how to use React Simple Code Editor with Unform
---
[React Simple Code Editor](http://satya164.xyz/react-simple-code-editor/) is a cool library focused on providing a simple way to add a code input source to user.
> ⚠️ All examples below are using **TypeScript**.... | 8,306 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/basic-form.mdx | ---
title: Basic form
description: Creating a basic form using Unform
---
Let's suppose you're creating a sign-in form with two fields, `email` and
`password`.
The first step after installing Unform is creating your custom Input component
that you will use for every input in your application.
```jsx title=components... | 8,307 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/complex-structures.mdx | ---
title: Complex structures
description: Learn to create complex form structures using Unform
---
Most of the time, the form structure is based on how data is received or
restored from the back-end, including relationships and complex data structures.
While using Unform, you can use the dot notation inside the inp... | 8,308 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/get-set-field-error.mdx | ---
title: Get/set field error
description: Using the get/set field error on Unform
---
Unform provides an easy way to set or access input errors by using the form ref.
```jsx lineNumbers=true
export default function MyForm() {
const formRef = useRef(null);
function functionThatGetsErrors() {
// Get all erro... | 8,309 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/get-set-field-value.mdx | ---
title: Get/set field value
description: Using the get/set field value on Unform
---
Unform provides an easy way to set or access input data using the form ref.
```jsx lineNumbers=true
export default function MyForm() {
const formRef = useRef(null);
function functionThatGetsData() {
// Get all data
co... | 8,310 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/initial-data.mdx | ---
title: Initial data
description: Providing initial data on Unform
---
To provide initial custom data to inputs, you can provide an `initialData` prop
to the `Form` component:
```jsx lineNumbers=true
export default function MyForm() {
return (
<Form initialData={{ email: 'test@example.com' }}>
<Input ... | 8,311 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/manual-form-submit.mdx | ---
title: Manual form submit
description: Manually submitting a form using the submitForm method
---
With Unform, you can submit your form without a submit button using the
`submitForm` function exposed by form reference.
```jsx lineNumbers=true
export default function SignIn() {
const formRef = useRef(null);
... | 8,312 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/react-native.mdx | ---
title: React Native
description: Get started with Unform in React Native apps
---
The Unform API is almost identical between web and mobile; below, you can see an
Input and a Form using Unform on React Native.
## Input component
In React Native, we need to use `TextInput` provided by the `react-native` package.... | 8,313 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/reset-form.mdx | ---
title: Reset form
description: Manually reseting a form using the resetForm method
---
> Don't use the `<input type="reset" />` to reset the form data. It won't work correctly with Unform and may cause bugs.
There are two ways to reset all form data:
## 1. Reset after submit
Besides the `data`, the `onSubmit` f... | 8,314 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/guides/validation.mdx | ---
title: Validation
description: Learn to validate forms using Yup on Unform
---
Unform **does not include validation in its core**, so you can choose the best
library that fits your application needs.
In the example below, we showcase form validation with [Yup](https://github.com/jquense/yup).
## Validation with... | 8,315 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/recipes/accessing-field-ref.mdx | ---
title: Accessing field ref
description: Accessing a field ref by using the getFieldRef method
---
To access a single field reference, you can use the `getFieldRef` function
exposed inside the form ref.
```jsx lineNumbers=true
export default function MyForm() {
const formRef = useRef(null)
function focusNameI... | 8,316 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/recipes/accessing-form-event.mdx | ---
title: Accessing form event
description: Accessing form events on Unform
---
On the web, you can access the form event in the 3rd parameter of the submit
function.
```jsx lineNumbers=true
export default function MyForm() {
function handleSubmit(data, { reset }, event) {
console.log(event)
}
return <For... | 8,317 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/recipes/accessing-form-ref.mdx | ---
title: Accessing form reference
description: Learn to access a form reference using Unform
---
Unform exposes various helper functions through the form ref.
```jsx lineNumbers=true
export default function MyForm() {
const formRef = useRef(null)
// Use formRef.current to access all methods
return <Form ref... | 8,318 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/recipes/clear-input-error-on-focus.mdx | ---
title: Clear input error on focus
description: Learn to clean input errors on focus by using the clearError method
---
Unform exposes a function called `clearError` within `useField` hook, so use it
inside `onFocus`.
```jsx title=components/Input.js lineNumbers=true
import React, { useRef, useEffect } from 'react... | 8,319 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/recipes/simple-input.mdx | ---
title: Simple input
description: Creating a simple input with Unform
---
This page explains how you can create a simple input with Unform.
Here we have an example of an elementary input with support for label and error
message.
```jsx title=components/Input.js lineNumbers=true
import React, { useRef, useEffect }... | 8,320 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/recipes/styled-components.mdx | ---
title: Usage with Styled Components
description: Integrating Unform with Styled Components
---
With Unform you create your components for input sources. You can customize the
inputs with any styling library you want or even with pure CSS.
When using Unform in the Web, `<Form />` component automatically renders an... | 8,321 |
0 | petrpan-code/unform/unform/docs/src/docs | petrpan-code/unform/unform/docs/src/docs/recipes/typescript.mdx | ---
title: Usage with TypeScript
description: Learn how can you use Unform with TypeScript
---
Unform exposes all type definitions from within its packages, so it's unnecessary
to install `@types` dependencies.
## Form with TypeScript
When creating a form component using Unform and TypeScript, there are two main poi... | 8,322 |
0 | petrpan-code/unform/unform/docs/src | petrpan-code/unform/unform/docs/src/pages/404.js | import React from 'react'
import { Link } from 'gatsby'
import Layout from '@rocketseat/gatsby-theme-docs/src/components/Layout'
import SEO from '@rocketseat/gatsby-theme-docs/src/components/SEO'
export default function NotFound() {
return (
<Layout>
<SEO title="404: Not found" />
<h1>Page not foun... | 8,323 |
0 | petrpan-code/unform/unform | petrpan-code/unform/unform/examples/README.md | # Examples
This folder contains Unform examples for different types of components. All of
them were tested and may work properly. You can also customize them for your
needs, hiding labels, styling error messages, etc.
| Name | Link |
| -------- | --... | 8,324 |
0 | petrpan-code/unform/unform | petrpan-code/unform/unform/examples/checkbox.js | import { useEffect, useRef } from 'react'
import { useField } from '@unform/core'
import { Form } from '@unform/web'
/**
* This example renders one checkbox. If you want to render multiple options,
* check the other checkbox example, or adapt this one.
*
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element... | 8,325 |
0 | petrpan-code/unform/unform | petrpan-code/unform/unform/examples/input.js | import { useRef, useEffect } from 'react'
import { useField } from '@unform/core'
import { Form } from '@unform/web'
/**
* This input component supports many <input> types, including:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
* - text
* - number
* - color
* - date
* - datetime-loca... | 8,326 |
0 | petrpan-code/unform/unform | petrpan-code/unform/unform/examples/radio.js | import { useEffect, useRef } from 'react'
import { useField } from '@unform/core'
import { Form } from '@unform/web'
/**
* This is a Radio component that supports rendering multiple options.
*
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio
*/
function Radio({ name, label, options, ...rest... | 8,327 |
0 | petrpan-code/unform/unform | petrpan-code/unform/unform/examples/select.js | import { useRef, useEffect } from 'react'
import { useField } from '@unform/core'
import { Form } from '@unform/web'
/**
* Select component for Unform (without React Select)
*
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
*/
function Select({ name, label, children, ...rest }) {
const select... | 8,328 |
0 | petrpan-code/unform/unform | petrpan-code/unform/unform/examples/textarea.js | import { useRef, useEffect } from 'react'
import { useField } from '@unform/core'
import { Form } from '@unform/web'
/**
* Textarea component for Unform.
*
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
*/
function Textarea({ name, label, rows = 5, cols, ...rest }) {
const textareaRef = us... | 8,329 |
0 | petrpan-code/unform/unform/examples | petrpan-code/unform/unform/examples/typescript/checkbox.tsx | import { useEffect, useRef, InputHTMLAttributes } from 'react'
import { useField, SubmitHandler, FormHandles } from '@unform/core'
import { Form } from '@unform/web'
/**
* This example renders one checkbox. If you want to render multiple options,
* check the other checkbox example, or adapt this one.
*
* https://... | 8,330 |
0 | petrpan-code/unform/unform/examples | petrpan-code/unform/unform/examples/typescript/input.tsx | import { useRef, useEffect, InputHTMLAttributes } from 'react'
import { useField, SubmitHandler, FormHandles } from '@unform/core'
import { Form } from '@unform/web'
/**
* This input component supports many <input> types, including:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
*
* Don't use i... | 8,331 |
0 | petrpan-code/unform/unform/examples | petrpan-code/unform/unform/examples/typescript/radio.tsx | import { useEffect, useRef, InputHTMLAttributes, RefObject } from 'react'
import { useField, SubmitHandler, FormHandles } from '@unform/core'
import { Form } from '@unform/web'
/**
* This is a Radio component that supports rendering multiple options.
*
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/in... | 8,332 |
0 | petrpan-code/unform/unform/examples | petrpan-code/unform/unform/examples/typescript/select.tsx | import { useRef, useEffect, ReactNode, SelectHTMLAttributes } from 'react'
import { useField, SubmitHandler, FormHandles } from '@unform/core'
import { Form } from '@unform/web'
interface SelectProps {
name: string
label: string
children: ReactNode
}
type Props = SelectHTMLAttributes<HTMLSelectElement> & Selec... | 8,333 |
0 | petrpan-code/unform/unform/examples | petrpan-code/unform/unform/examples/typescript/textarea.tsx | import { useRef, useEffect, TextareaHTMLAttributes } from 'react'
import { useField, SubmitHandler, FormHandles } from '@unform/core'
import { Form } from '@unform/web'
/**
* Textarea component for Unform.
*
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
*/
interface Props {
name: string
... | 8,334 |
0 | petrpan-code/unform/unform/packages | petrpan-code/unform/unform/packages/core/README.md | <p align="center">
<a href="https://unform.dev">
<img src="https://storage.googleapis.com/golden-wind/unform/unform.svg" height="150" width="175" alt="Unform" />
</a>
</p>
<p align="center">Easy peasy highly scalable ReactJS & React Native forms! 🚀</p>
<div align="center">
[
const baseConfig = require('../../jest.config')
const pkg = require('./package.json')
delete baseConfig.projects
module.exports = {
...baseConfig,
displayName: pkg.name,
testMatch: [join(__dirname, '__tests__/**/*.spec.{ts,tsx}')],
}
| 8,336 |
0 | petrpan-code/unform/unform/packages | petrpan-code/unform/unform/packages/core/package.json | {
"name": "@unform/core",
"version": "2.1.6",
"description": "Unform core package",
"author": "Diego Fernandes <diego.schell.f@gmail.com>",
"homepage": "https://github.com/unform/unform#readme",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.es.js",
"types": "typings/index.d.ts",
"... | 8,337 |
0 | petrpan-code/unform/unform/packages/core | petrpan-code/unform/unform/packages/core/__tests__/Form.spec.tsx | import { RefObject } from 'react'
import { act, fireEvent, waitFor } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect.js'
import { Form } from '../../web/lib'
import { Scope, FormHandles } from '../lib'
import { Input } from './components/Input'
import { ObjectInput } from './components/... | 8,338 |
0 | petrpan-code/unform/unform/packages/core | petrpan-code/unform/unform/packages/core/__tests__/Scope.spec.tsx | import { Scope } from '../lib'
import { Input } from './components/Input'
import { render } from './utils/RenderTest'
describe('RenderTest', () => {
it('should name form elements based on scope', () => {
const { container } = render(
<Scope path="profile">
<Input name="name" />
</Scope>
)... | 8,339 |
0 | petrpan-code/unform/unform/packages/core/__tests__ | petrpan-code/unform/unform/packages/core/__tests__/components/Input.tsx | import { useEffect, useRef, InputHTMLAttributes } from 'react'
import { useField } from '../../lib'
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
name: string
label?: string
}
export function Input({ name, label, ...rest }: InputProps) {
const ref = useRef<HTMLInputElement>(null)
const... | 8,340 |
0 | petrpan-code/unform/unform/packages/core/__tests__ | petrpan-code/unform/unform/packages/core/__tests__/components/ObjectInput.tsx | import { useEffect, useRef } from 'react'
import { useField } from '../../lib'
interface InputProps {
name: string
label?: string
}
interface InputValue {
id: string
label: string
}
export function ObjectInput({ name, label, ...rest }: InputProps) {
const inputRef = useRef<HTMLInputElement>(null)
const ... | 8,341 |
0 | petrpan-code/unform/unform/packages/core/__tests__ | petrpan-code/unform/unform/packages/core/__tests__/utils/CustomInputClear.tsx | import { InputHTMLAttributes, useEffect, useRef } from 'react'
import { useField } from '../../lib'
interface Props extends InputHTMLAttributes<HTMLInputElement> {
name: string
label?: string
}
export function CustomInputClear({ name, label, ...rest }: Props) {
const ref = useRef<HTMLInputElement>(null)
cons... | 8,342 |
0 | petrpan-code/unform/unform/packages/core/__tests__ | petrpan-code/unform/unform/packages/core/__tests__/utils/CustomInputParse.tsx | import { InputHTMLAttributes, useEffect, useRef } from 'react'
import { useField } from '../../lib'
interface Props extends InputHTMLAttributes<HTMLInputElement> {
name: string
label?: string
}
export function CustomInputParse({ name, label, ...rest }: Props) {
const ref = useRef<HTMLInputElement>(null)
cons... | 8,343 |
0 | petrpan-code/unform/unform/packages/core/__tests__ | petrpan-code/unform/unform/packages/core/__tests__/utils/RenderTest.tsx | import { ReactNode } from 'react'
import { render as rtlRender } from '@testing-library/react'
import { Form } from '../../../web/lib'
export function render(children: ReactNode, props: Record<string, any> = {}) {
const mockFunction = jest.fn()
return rtlRender(
<Form data-testid="form" onSubmit={mockFunctio... | 8,344 |
0 | petrpan-code/unform/unform/packages/core | petrpan-code/unform/unform/packages/core/lib/Context.tsx | /* istanbul ignore file */
import { createContext } from 'react'
import { UnformContext } from './types'
export const FormContext = createContext<UnformContext>({} as UnformContext)
| 8,345 |
0 | petrpan-code/unform/unform/packages/core | petrpan-code/unform/unform/packages/core/lib/FormProvider.tsx | import {
forwardRef,
FormEvent,
useState,
useRef,
useCallback,
useImperativeHandle,
ForwardRefRenderFunction,
} from 'react'
import dot from 'dot-object'
import { FormContext } from './Context'
import { UnformErrors, UnformField, FormHandles, FormProps } from './types'
const Form: ForwardRefRenderFunct... | 8,346 |
0 | petrpan-code/unform/unform/packages/core | petrpan-code/unform/unform/packages/core/lib/Scope.tsx | import { useContext, ReactNode } from 'react'
import { FormContext } from './Context'
export interface ScopeProps {
path: string
children: ReactNode
}
export function Scope({ path, children }: ScopeProps) {
const { scopePath, ...form } = useContext(FormContext)
return (
<FormContext.Provider
value... | 8,347 |
0 | petrpan-code/unform/unform/packages/core | petrpan-code/unform/unform/packages/core/lib/index.ts | /**
* Hooks
*/
export * from './useField'
/**
* Main components
*/
export * from './FormProvider'
export * from './Scope'
/**
* Types
*/
export * from './types'
/**
* Context
*/
export * from './Context'
| 8,348 |
0 | petrpan-code/unform/unform/packages/core | petrpan-code/unform/unform/packages/core/lib/types.ts | import {
DetailedHTMLProps,
FormHTMLAttributes,
FormEvent,
ReactNode,
} from 'react'
interface BaseUnformField<T> {
name: string
ref?: any
setValue?: (ref: any, value: T) => void
clearValue?: (ref: any, newValue: T) => void
}
export interface PathUnformField<T> extends BaseUnformField<T> {
path: str... | 8,349 |
0 | petrpan-code/unform/unform/packages/core | petrpan-code/unform/unform/packages/core/lib/useField.ts | import { useContext, useEffect, useMemo, useCallback } from 'react'
import dot from 'dot-object'
import { FormContext } from './Context'
import { UnformContext } from './types'
export function useField(name: string) {
const {
initialData,
errors,
scopePath,
unregisterField,
registerField,
c... | 8,350 |
0 | petrpan-code/unform/unform/packages | petrpan-code/unform/unform/packages/mobile/README.md | <p align="center">
<a href="https://unform.dev">
<img src="https://storage.googleapis.com/golden-wind/unform/unform.svg" height="150" width="175" alt="Unform" />
</a>
</p>
<p align="center">Unform for React Native</p>
<div align="center">
[
const baseConfig = require('../../jest.config')
const pkg = require('./package.json')
delete baseConfig.projects
module.exports = {
...baseConfig,
preset: 'react-native',
displayName: pkg.name,
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
transformIgnorePatterns: ['n... | 8,352 |
0 | petrpan-code/unform/unform/packages | petrpan-code/unform/unform/packages/mobile/package.json | {
"name": "@unform/mobile",
"version": "2.1.6",
"description": "Unform React Native implementation",
"author": "Diego Fernandes <diego.schell.f@gmail.com>",
"homepage": "https://github.com/unform/unform#readme",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.es.js",
"types": "typings... | 8,353 |
0 | petrpan-code/unform/unform/packages/mobile | petrpan-code/unform/unform/packages/mobile/__tests__/Form.spec.tsx | import {
RefObject,
ReactNode,
forwardRef,
ForwardRefRenderFunction,
} from 'react'
import { render } from '@testing-library/react-native'
import { FormHandles } from '@unform/core'
import { Form } from '../lib'
import Input from './components/Input'
interface UnformProps {
onSubmit(): void
children?: Re... | 8,354 |
0 | petrpan-code/unform/unform/packages/mobile/__tests__ | petrpan-code/unform/unform/packages/mobile/__tests__/components/Input.tsx | import { useEffect, useRef, memo } from 'react'
import { TextInput, TextInputProps, Text } from 'react-native'
import { useField } from '../../../core/lib'
interface Props {
name: string
label?: string
}
type InputProps = TextInputProps & Props
interface InputValueReference {
value: string
}
function Input({... | 8,355 |
0 | petrpan-code/unform/unform/packages/mobile | petrpan-code/unform/unform/packages/mobile/lib/Form.tsx | import { forwardRef, ForwardRefRenderFunction, ReactNode } from 'react'
import { View, ViewProps } from 'react-native'
import { FormProvider, FormHandles, SubmitHandler } from '@unform/core'
export interface FormProps extends ViewProps {
initialData?: Record<string, any>
children: ReactNode
onSubmit: SubmitHand... | 8,356 |
0 | petrpan-code/unform/unform/packages/mobile | petrpan-code/unform/unform/packages/mobile/lib/index.ts | export * from './Form'
| 8,357 |
0 | petrpan-code/unform/unform/packages | petrpan-code/unform/unform/packages/web/README.md | <p align="center">
<a href="https://unform.dev">
<img src="https://storage.googleapis.com/golden-wind/unform/unform.svg" height="150" width="175" alt="Unform" />
</a>
</p>
<p align="center">Unform for React</p>
<div align="center">
[
const baseConfig = require('../../jest.config')
const pkg = require('./package.json')
delete baseConfig.projects
module.exports = {
...baseConfig,
displayName: pkg.name,
testMatch: [join(__dirname, '__tests__/**/*.spec.{ts,tsx}')],
}
| 8,359 |
0 | petrpan-code/unform/unform/packages | petrpan-code/unform/unform/packages/web/package.json | {
"name": "@unform/web",
"version": "2.1.6",
"description": "Unform Web support",
"author": "Diego Fernandes <diego.schell.f@gmail.com>",
"homepage": "https://github.com/unform/unform#readme",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.es.js",
"types": "typings/web/lib/index.d.ts... | 8,360 |
0 | petrpan-code/unform/unform/packages/web | petrpan-code/unform/unform/packages/web/lib/Form.tsx | import { ForwardRefRenderFunction, forwardRef } from 'react'
import { FormProvider, FormContext, FormHandles, FormProps } from '@unform/core'
const Form: ForwardRefRenderFunction<FormHandles, FormProps> = (
{ initialData = {}, children, onSubmit, ...rest },
formRef
) => {
return (
<FormProvider ref={formRef... | 8,361 |
0 | petrpan-code/unform/unform/packages/web | petrpan-code/unform/unform/packages/web/lib/index.ts | export { default as Form } from './Form'
| 8,362 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/.eslintrc.cjs | const {
getDefaultIgnorePatterns,
} = require('./config/eslint/helpers/getDefaultIgnorePatterns.cjs');
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: [
'turbo',
'./config/eslint/bases/javascript.cjs',
'./config/eslint/bases/typescript.cjs',
'./config/eslint... | 8,363 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/.npmrc | # used in tandem with package.json engines section to only use yarn
engine-strict=true
| 8,364 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/.nvmrc | v16.19.1 | 8,365 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/.yarnrc.yml | changesetBaseRefs:
- main
- origin/main
- upstream/main
changesetIgnorePatterns:
- "**/*.test.{js,jsx,ts,tsx}"
- "**/*.spec.{js,jsx,ts,tsx}"
defaultSemverRangePrefix: ""
nodeLinker: node-modules
npmRegistryServer: "https://registry.npmjs.org/"
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-... | 8,366 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/BREAKING_CHANGES.md | # 25.0.1
## @udecode/plate-core@25.0.1
### Major Changes
- [#2729](https://github.com/udecode/plate/pull/2729) by [@12joan](https://github.com/12joan) – **This is a breaking change meant to be part of v25, hence the patch.**
On `deserializeHtml`, replace `stripWhitespace` with `collapseWhiteSpace`, defaulting to t... | 8,367 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/CONTRIBUTING.md | # Contributing
Thank you for your interest in helping to improve **`plate`**! As a community-led project, we wholeheartedly welcome all kinds of contributions. This includes everything from participating in discussions and improving documentation, to fixing bugs and enhancing features.
This document will provide guid... | 8,368 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/LICENSE | The MIT License (MIT)
Copyright (c) Ziad Beyens, Dylan Schiemann, Joe Anderson
Unless otherwise specified in a LICENSE file within an individual package directory,
this license applies to all files in this repository outside of those package directories.
Permission is hereby granted, free of charge, to any person ob... | 8,369 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/README.md | <h1 align="center">
Plate
</h1>
<p>
<div align="center">
<a href="https://www.npmjs.com/package/@udecode/plate-core"><img src="https://img.shields.io/npm/dm/@udecode/plate-core.svg" alt="Total Downloads"></a>
<a target="_blank" href="https://github.com/udecode/plate/releases/latest"><img src="https://img.shields.i... | 8,370 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/jest.config.cjs | const { pathsToModuleNameMapper } = require('ts-jest');
const appRoot = require('app-root-path');
const packageJson = require(`${process.cwd()}/package.json`);
const packageName = packageJson.name ?? 'plate';
const {
compilerOptions: baseTsConfig,
} = require(`${appRoot}/config/tsconfig.test.json`);
// Take the pat... | 8,371 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/package.json | {
"packageManager": "yarn@4.0.0-rc.43",
"private": true,
"license": "MIT",
"scripts": {
"build": "yarn g:build",
"build:watch": "ROARR_LOG=true turbowatch ./config/turbowatch.config.ts | roarr",
"build:apps": "turbo --filter \"./apps/www\" build",
"build:registry": "yarn workspace www build:regi... | 8,372 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/playwright.config.ts | /* eslint-disable turbo/no-undeclared-env-vars */
import { defineConfig, devices } from '@playwright/test';
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({... | 8,373 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/postcss.config.cjs | module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
| 8,374 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/prettier.config.cjs | const {
getPrettierConfig,
} = require('./config/eslint/helpers/getPrettierConfig.cjs');
const config = getPrettierConfig();
/** @type {import("prettier").Config} */
module.exports = {
...config,
};
| 8,375 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/renovate.json | {
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"dependencyDashboardApproval": true,
"packageRules": [
{
"matchPaths": ["templates/"],
"matchPackagePatterns": ["^@udecode/"],
"matchUpdateTypes": ["major"],
"dependencyDashboardAppro... | 8,376 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/reviewpad.yml | # This file is used to configure Reviewpad.
# The configuration is a proposal to help you get started.
# You can use it as a starting point and customize it to your needs.
# For more details see https://docs.reviewpad.com/guides/syntax.
# Define the list of labels to be used by Reviewpad.
# For more details see https:... | 8,377 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/tailwind.config.cjs | const plugin = require('tailwindcss/plugin');
const { fontFamily } = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ['class'],
content: ['**/src/**/*.{ts,tsx}'],
theme: {
container: {
padding: '2rem',
center: true,
screens: {
... | 8,378 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/tsconfig.json | {
"awesomeTypescriptLoaderOptions": {
"ignoreDiagnostics": [7005]
},
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react",
... | 8,379 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/turbo.json | {
"$schema": "https://turbo.build/schema.json",
"globalEnv": ["CI", "GITHUB_OAUTH_TOKEN"],
"pipeline": {
"dev": {
"cache": false,
"persistent": true
},
"build": {
"dependsOn": ["^build"],
"env": [
"COMPONENTS_BASE_URL",
"NEXT_PUBLIC_APP_URL",
"NODE_ENV",... | 8,380 |
0 | petrpan-code/udecode | petrpan-code/udecode/plate/yarn.lock | # This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 7
cacheKey: 9
"@aashutoshrathi/word-wrap@npm:^1.2.3":
version: 1.2.6
resolution: "@aashutoshrathi/word-wrap@npm:1.2.6"
checksum: 0c82b90350766c937f011275be5e67a... | 8,381 |
0 | petrpan-code/udecode/plate | petrpan-code/udecode/plate/.changeset/README.md | # Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets... | 8,382 |
0 | petrpan-code/udecode/plate | petrpan-code/udecode/plate/.changeset/changelog-config.js | const { config } = require("dotenv");
const { getInfo, getInfoFromPullRequest } = require("@changesets/get-github-info");
config();
module.exports = {
getDependencyReleaseLine: async (
) => {
return ""
},
getReleaseLine: async (changeset, type, options) => {
if (!options || !options.repo) {
thro... | 8,383 |
0 | petrpan-code/udecode/plate | petrpan-code/udecode/plate/.changeset/config.json | {
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
"changelog": ["./changelog-config", { "repo": "udecode/plate" }],
"commit": false,
"linked": [["@udecode/*"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["www", "e2e-examples"]
}
| 8,384 |
0 | petrpan-code/udecode/plate | petrpan-code/udecode/plate/.changeset/grumpy-planes-attack.md | ---
'@udecode/plate-comments': major
---
- Renamed the `comments` prop on CommentsProvider to `initialComments` to reflect the fact that updating its value after the initial render has no effect
- Removed the following props from CommentsProvider, since they represent the internal state of the comments plugin and shou... | 8,385 |
0 | petrpan-code/udecode/plate | petrpan-code/udecode/plate/.changeset/sixty-bats-explode.md | ---
'@udecode/plate-serializer-html': major
---
- [Breaking] `serializeHtml`: replaced option `slateProps` by `plateProps`.
- Fix errors when the components were using Plate hooks.
| 8,386 |
0 | petrpan-code/udecode/plate | petrpan-code/udecode/plate/.changeset/table.md | ---
'@udecode/plate-table': minor
---
- Table plugin has now merging support. To enable it, use option `enableMerging: true`
| 8,387 |
0 | petrpan-code/udecode/plate/.yarn | petrpan-code/udecode/plate/.yarn/patches/react-dnd-npm-15.1.2-0351d81431.patch | diff --git a/package.json b/package.json
index e66cead9ee6c09d50989bdecb149ecc0b4e2de48..6fb2e1f4067b0158e73f4a876fe82e58bc7f39a4 100644
--- a/package.json
+++ b/package.json
@@ -4,11 +4,6 @@
"description": "Drag and Drop for React",
"main": "dist/cjs/index.js",
"types": "dist/types/index.d.ts",
- "exports": ... | 8,388 |
0 | petrpan-code/udecode/plate/.yarn/plugins | petrpan-code/udecode/plate/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs | /* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-interactive-tools",
factory: function (require) {
var plugin=(()=>{var $P=Object.create,Py=Object.defineProperty,eI=Object.defineProperties,tI=Object.getOwnPropertyDescriptor,nI=Object.getOwnPropertyDescriptors,rI=Object.getOwnPropertyName... | 8,389 |
0 | petrpan-code/udecode/plate/.yarn/plugins | petrpan-code/udecode/plate/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | /* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-workspace-tools",
factory: function (require) {
var plugin=(()=>{var wr=Object.create,me=Object.defineProperty,Sr=Object.defineProperties,vr=Object.getOwnPropertyDescriptor,Hr=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertyNames,... | 8,390 |
0 | petrpan-code/udecode/plate/.yarn | petrpan-code/udecode/plate/.yarn/releases/yarn-4.0.0-rc.43.cjs | #!/usr/bin/env node
/* eslint-disable */
//prettier-ignore
(()=>{var E_e=Object.create;var QR=Object.defineProperty;var C_e=Object.getOwnPropertyDescriptor;var I_e=Object.getOwnPropertyNames;var w_e=Object.getPrototypeOf,B_e=Object.prototype.hasOwnProperty;var Ie=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Prox... | 8,391 |
0 | petrpan-code/udecode/plate/apps | petrpan-code/udecode/plate/apps/e2e-examples/index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
| 8,392 |
0 | petrpan-code/udecode/plate/apps | petrpan-code/udecode/plate/apps/e2e-examples/package.json | {
"private": true,
"name": "e2e-examples",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"start": "yarn build && yarn preview",
"lint": "yarn p:lint",
"lint:fix": "yarn p:lint:fix"
},
"dependencies": {
"@udecode/plate": "wo... | 8,393 |
0 | petrpan-code/udecode/plate/apps | petrpan-code/udecode/plate/apps/e2e-examples/tsconfig.json | {
"extends": "../www/tsconfig.json",
"compilerOptions": {
"paths": {
"@/*": ["../../www/src/*"],
"@/plate/*": ["../../www/src/lib/plate/*"]
}
},
"include": ["src", "../www/src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
| 8,394 |
0 | petrpan-code/udecode/plate/apps | petrpan-code/udecode/plate/apps/e2e-examples/tsconfig.node.json | {
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
| 8,395 |
0 | petrpan-code/udecode/plate/apps | petrpan-code/udecode/plate/apps/e2e-examples/tsconfig.node.tsbuildinfo | {"version":"4.6.4"} | 8,396 |
0 | petrpan-code/udecode/plate/apps | petrpan-code/udecode/plate/apps/e2e-examples/tsconfig.tsbuildinfo | {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib... | 8,397 |
0 | petrpan-code/udecode/plate/apps | petrpan-code/udecode/plate/apps/e2e-examples/vite.config.ts | import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
build: {
// Disable warning about chunk size
chunkSizeWarningLimit: Infinity,
},
server: {
port: 3030,
},
preview: {
port: 3030,
},
... | 8,398 |
0 | petrpan-code/udecode/plate/apps/e2e-examples | petrpan-code/udecode/plate/apps/e2e-examples/src/TableApp.tsx | import { createPlateUI } from '@/plate/create-plate-ui';
import {
createPlugins,
createTablePlugin,
Plate,
PlateContent,
} from '@udecode/plate';
import { useVariant } from './useVariant';
export function TableApp() {
const {
initialTableWidth,
colSizes,
readOnly = false,
disableMarginLeft =... | 8,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.