Skip to content

Commit

Permalink
Merge branch 'main' into fix/loadDataListSequenceIssue
Browse files Browse the repository at this point in the history
  • Loading branch information
fwx5618177 committed Jan 30, 2024
2 parents 3f4f35a + cde7011 commit 9b5a28a
Show file tree
Hide file tree
Showing 202 changed files with 12,944 additions and 418 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/sync-pro.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Sync Pro

on:
push:
branches: [main, upstream]

jobs:
# Sync upstream commits to downstream
sync:
if: ${{ github.repository == 'udecode/plate' && contains('refs/heads/main',github.ref)}}
name: Sync Pro
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Perform Sync
run: |
# https://stackoverflow.com/a/69979203
git config --unset-all http.https://github.com/.extraheader
git config user.name 'Sync Pro'
git config user.email '<>'
PUSH_BRANCH=main
PUSH_FORCE=''
git pull --no-rebase --no-edit $DOWNSTREAM main || {
# Got merge conflicts, so fall back to upstream branch
git merge --abort
PUSH_BRANCH=upstream
PUSH_FORCE=--force
}
git push $DOWNSTREAM HEAD:$PUSH_BRANCH $PUSH_FORCE
env:
DOWNSTREAM: https://${{secrets.DOWNSTREAM_REPO_GITHUB_CREDENTIALS}}@github.com/udecode/plate-pro.git

# Open a PR if a branch called 'upstream' recieves commits on downstream
upstream_pr:
if: ${{ github.repository == 'udecode/plate-pro' && contains('refs/heads/upstream',github.ref)}}
name: Upstream PR
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Create PR
run: gh pr create --title 'Sync upstream' --body ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 30.0.0

## @udecode/plate-table@30.0.0

### Major Changes

- [#2867](https://github.com/udecode/plate/pull/2867) by [@12joan](https://github.com/12joan) – Fix: in v28, `TableProvider` was incorrectly shared by all tables in the editor. `TableProvider` must now be rendered as part of `TableElement`.

# 29.0.0

## @udecode/plate-utils@29.0.0
Expand Down
5 changes: 5 additions & 0 deletions apps/www/content/docs/components/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver

## January 2024 #7

### January 11 #7.4

- add support for custom ui dir in `components.json`
- add support for `plate-components.json` to avoid conflict with shadcn's `components.json`

### January 9 #7.3

- `toolbar`
Expand Down
4 changes: 3 additions & 1 deletion apps/www/content/docs/components/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ The `init` command installs dependencies, adds the `cn` util, configures `tailwi
npx @udecode/plate-ui@latest init
```

You will be asked a few questions to configure `components.json`:
You will be asked a few questions to configure `plate-components.json`:

```txt showLineNumbers
Which style would you like to use? › Default
Which color would you like to use as base color? › Slate
Where is your global CSS file? › src/style/globals.css
Do you want to use CSS variables for colors? › no / yes
Are you using a custom tailwind prefix eg. tw-? (Leave blank if not) ...
Where is your tailwind.config.js located? › tailwind.config.js
Configure the import alias for components: › @/components
Configure the import alias for ui: › @/components/plate-ui
Are you using React Server Components? › no / yes
```

Expand Down
47 changes: 26 additions & 21 deletions apps/www/content/docs/components/components-json.mdx
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
---
title: components.json
title: plate-components.json
description: Configuration for your project.
---

The `components.json` file holds configuration for your project.
The `plate-components.json` file holds configuration for your project.

We use it to understand how your project is set up and how to generate components customized for your project.

<Callout className="mt-6">
Note: The `components.json` file is optional and **only required if you're
Note: The `plate-components.json` file is optional and **only required if you're
using the CLI** to add components to your project. If you're using the copy
and paste method, you don't need this file.
</Callout>

You can create a `components.json` file in your project by running the following command:
You can create a `plate-components.json` file in your project by running the following command:

```bash
npx @udecode/plate-ui@latest init
```

Or you could extend [shadcn's `components.json`](https://ui.shadcn.com/docs/components-json) if you don't have any conflict.

See the <Link href="/docs/components/cli">CLI section</Link> for more information.

## $schema

You can see the JSON Schema for `components.json` [here](https://platejs.org/schema.json).
You can see the JSON Schema for `plate-components.json` [here](https://platejs.org/schema.json).

```json title="components.json"
```json title="plate-components.json"
{
"$schema": "https://platejs.org/schema.json"
}
Expand All @@ -35,7 +37,7 @@ You can see the JSON Schema for `components.json` [here](https://platejs.org/sch

The style for your components. **This cannot be changed after initialization.**

```json title="components.json"
```json title="plate-components.json"
{
"style": "default"
}
Expand All @@ -51,7 +53,7 @@ See the <Link href="/docs/installation">installation section</Link> for how to s

Path to where your `tailwind.config.js` file is located.

```json title="components.json"
```json title="plate-components.json"
{
"tailwind": {
"config": "tailwind.config.js" | "tailwind.config.ts"
Expand All @@ -63,7 +65,7 @@ Path to where your `tailwind.config.js` file is located.

Path to the CSS file that imports Tailwind CSS into your project.

```json title="components.json"
```json title="plate-components.json"
{
"tailwind": {
"css": "src/styles/globals.css"
Expand All @@ -75,7 +77,7 @@ Path to the CSS file that imports Tailwind CSS into your project.

This is used to generate the default color palette for your components. **This cannot be changed after initialization.**

```json title="components.json"
```json title="plate-components.json"
{
"tailwind": {
"baseColor": "slate" | "gray" | "neutral" | "stone" | "zinc"
Expand All @@ -89,7 +91,7 @@ You can choose between using CSS variables or Tailwind CSS utility classes for t

To use utility classes for theming set `tailwind.cssVariables` to `false`. For CSS variables, set `tailwind.cssVariables` to `true`.

```json title="components.json"
```json title="plate-components.json"
{
"tailwind": {
"cssVariables": `true` | `false`
Expand All @@ -105,7 +107,7 @@ For more information, see the <Link href="/docs/theming">theming docs</Link>.

The prefix to use for your Tailwind CSS utility classes. Components will be added with this prefix.

```json title="components.json"
```json title="plate-components.json"
{
"tailwind": {
"prefix": "tw-"
Expand All @@ -119,7 +121,7 @@ Whether or not to enable support for React Server Components.

The CLI automatically adds a `use client` directive to client components when set to `true`.

```json title="components.json"
```json title="plate-components.json"
{
"rsc": `true` | `false`
}
Expand All @@ -136,26 +138,29 @@ Path aliases have to be set up in your `tsconfig.json` file.
under `paths` in your `tsconfig.json` file.
</Callout>

### aliases.utils
### aliases.components

Import alias for your utility functions.
Import alias for your components.

```json title="components.json"
```json title="plate-components.json"
{
"aliases": {
"utils": "@udecode/cn"
"components": "@/components"
}
}
```

### aliases.components

Import alias for your components.
### aliases.plate-ui

Import alias for `plate-ui` components. If not defined, uses `aliases.ui`, or `aliases.components`.

```json title="components.json"
The CLI will use this value to determine where to place your UI components. Use this config if you want to customize the installation directory for your UI components.

```json title="plate-components.json"
{
"aliases": {
"components": "@/components"
"plate-ui": "@/components/plate-ui"
}
}
```
6 changes: 4 additions & 2 deletions apps/www/content/docs/components/installation/next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ npx create-next-app@latest my-app --typescript --tailwind --eslint
npx @udecode/plate-ui@latest init
```

### Configure components.json
### Configure plate-components.json

You will be asked a few questions to configure `components.json`:
You will be asked a few questions to configure `plate-components.json`:

```txt showLineNumbers
Which style would you like to use? › Default
Which color would you like to use as base color? › Slate
Where is your global CSS file? › src/style/globals.css
Do you want to use CSS variables for colors? › no / yes
Are you using a custom tailwind prefix eg. tw-? (Leave blank if not) ...
Where is your tailwind.config.js located? › tailwind.config.js
Configure the import alias for components: › @/components
Configure the import alias for ui: › @/components/plate-ui
Are you using React Server Components? › no / yes
```

Expand Down
6 changes: 4 additions & 2 deletions apps/www/content/docs/components/installation/vite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,19 @@ Run the `plate-ui` init command to setup your project:
npx @udecode/plate-ui@latest init
```

### Configure components.json
### Configure plate-components.json

You will be asked a few questions to configure `components.json`:
You will be asked a few questions to configure `plate-components.json`:

```txt showLineNumbers
Which style would you like to use? › Default
Which color would you like to use as base color? › Slate
Where is your global CSS file? › › src/styles/globals.css
Do you want to use CSS variables for colors? › no / yes
Are you using a custom tailwind prefix eg. tw-? (Leave blank if not) ...
Where is your tailwind.config.js located? › tailwind.config.js
Configure the import alias for components: › @/components
Configure the import alias for ui: › @/components/plate-ui
Are you using React Server Components? › no / yes (no)
```

Expand Down
14 changes: 6 additions & 8 deletions apps/www/content/docs/components/theming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ You can choose between using CSS variables or Tailwind CSS utility classes for t
<div className="bg-slate-950 dark:bg-white" />
```

To use utility classes for theming set `tailwind.cssVariables` to `false` in your `components.json` file.
To use utility classes for theming set `tailwind.cssVariables` to `false` in your `plate-components.json` file.

```json {8} title="components.json"
```json {8} title="plate-components.json"
{
"style": "default",
"rsc": true,
Expand All @@ -24,8 +24,7 @@ To use utility classes for theming set `tailwind.cssVariables` to `false` in you
"cssVariables": false
},
"aliases": {
"components": "@/components",
"utils": "@udecode/cn"
"components": "@/components"
}
}
```
Expand All @@ -36,9 +35,9 @@ To use utility classes for theming set `tailwind.cssVariables` to `false` in you
<div className="bg-background text-foreground" />
```

To use CSS variables for theming set `tailwind.cssVariables` to `true` in your `components.json` file.
To use CSS variables for theming set `tailwind.cssVariables` to `true` in your `plate-components.json` file.

```json {8} title="components.json"
```json {8} title="plate-components.json"
{
"style": "default",
"rsc": true,
Expand All @@ -49,8 +48,7 @@ To use CSS variables for theming set `tailwind.cssVariables` to `true` in your `
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@udecode/cn"
"components": "@/components"
}
}
```
Expand Down
Loading

0 comments on commit 9b5a28a

Please sign in to comment.