-
-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
104 changed files
with
3,334 additions
and
1,974 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- [ ] I signed and returned the [Plone Contributor Agreement](https://plone.org/foundation/contributors-agreement), and received and accepted an invitation to join a team in the Plone GitHub organization. | ||
- [ ] I verified there aren't other open [pull requests](https://github.com/plone/volto/pulls) for the same change. | ||
- [ ] I followed the guidelines in [Contributing to Volto](https://6.docs.plone.org/volto/contributing/index.html). | ||
- [ ] I succesfully ran [code linting checks](https://6.docs.plone.org/volto/contributing/linting.html) on my changes locally. | ||
- [ ] I succesfully ran [unit tests](https://6.docs.plone.org/volto/contributing/testing.html) on my changes locally. | ||
- [ ] I succesfully ran [acceptance tests](https://6.docs.plone.org/volto/contributing/acceptance-tests.html) on my changes locally. | ||
- [ ] If needed, I added new tests for my changes. | ||
- [ ] If needed, I added [documentation](https://6.docs.plone.org/volto/contributing/documentation.html#narrative-documentation) for my changes, either in the Storybook or narrative documentation. | ||
- [ ] I included a [change log entry](https://6.docs.plone.org/contributing/index.html#contributing-change-log-label) in my commits. | ||
|
||
----- | ||
|
||
If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically. | ||
|
||
Closes # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Plone on Vite with SSR mode | ||
|
||
This is a proof of concept of a [Vite](https://vitejs.dev) build, using `@plone/client` and `@plone/components` libraries. | ||
This is a proof of concept of a [Vite](https://vite.dev/) build, using `@plone/client` and `@plone/components` libraries. | ||
This is intended to serve as both a playground for the development of both packages and as a demo of Plone using Vite built with server side rendering (SSR). | ||
|
||
It also uses [TanStack Router](https://tanstack.com/router/latest/docs/framework/react/overview) for its routing library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Plone on Vite | ||
|
||
This is a proof of concept of a [Vite](https://vitejs.dev) build, using `@plone/client` and `@plone/components` libraries. | ||
This is a proof of concept of a [Vite](https://vite.dev/) build, using `@plone/client` and `@plone/components` libraries. | ||
This is intended to serve as both a playground for the development of both packages and as a demo of Plone using Vite. | ||
|
||
It also uses [TanStack Router](https://tanstack.com/router/latest/docs/framework/react/overview) for its routing library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
} | ||
], | ||
"license": "MIT", | ||
"version": "1.0.0-alpha.17", | ||
"version": "1.0.0-alpha.18", | ||
"repository": { | ||
"type": "git", | ||
"url": "[email protected]:plone/volto.git" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,35 @@ | ||
import { z } from 'zod'; | ||
import { ApiRequestParams, apiRequest } from '../../API'; | ||
import { | ||
PloneClientConfig, | ||
PloneClientConfigSchema, | ||
} from '../../validation/config'; | ||
import { PloneClientConfig } from '../../validation/config'; | ||
import { copyMoveDataSchema as copyDataSchema } from '../../validation/copymove'; | ||
import { CopyMoveResponse as CopyResponse } from '@plone/types'; | ||
|
||
export const copyArgsSchema = z.object({ | ||
data: copyDataSchema, | ||
config: PloneClientConfigSchema, | ||
}); | ||
|
||
export type CopyArgs = z.infer<typeof copyArgsSchema>; | ||
export type CopyArgs = z.infer<typeof copyDataSchema> & { | ||
config: PloneClientConfig; | ||
}; | ||
|
||
export const copy = async ({ | ||
path, | ||
data, | ||
config, | ||
}: CopyArgs): Promise<CopyResponse> => { | ||
const validatedArgs = copyArgsSchema.parse({ | ||
const validatedArgs = copyDataSchema.parse({ | ||
path, | ||
data, | ||
config, | ||
}); | ||
|
||
const options: ApiRequestParams = { | ||
config, | ||
data: validatedArgs.data, | ||
config: validatedArgs.config, | ||
}; | ||
|
||
return apiRequest('post', '/@copy', options); | ||
const copyPath = `${validatedArgs.path}/@copy`; | ||
|
||
return apiRequest('post', copyPath, options); | ||
}; | ||
|
||
export const copyMutation = ({ config }: { config: PloneClientConfig }) => ({ | ||
mutationKey: ['post', 'copy'], | ||
mutationFn: ({ data }: Omit<CopyArgs, 'config'>) => copy({ data, config }), | ||
mutationFn: ({ path, data }: Omit<CopyArgs, 'config'>) => | ||
copy({ path, data, config }), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { z } from 'zod'; | ||
|
||
export const copyMoveDataSchema = z.object({ | ||
source: z.union([z.string(), z.array(z.string())]), | ||
path: z.string(), | ||
data: z.object({ | ||
source: z.union([z.string(), z.array(z.string())]), | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/components/src/components/ColorArea/ColorArea.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import { ColorArea } from './ColorArea'; | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import '../../styles/basic/ColorArea.css'; | ||
|
||
const meta = { | ||
title: 'Widgets/ColorArea', | ||
component: ColorArea, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
} satisfies Meta<typeof ColorArea>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
render: (args: any) => <ColorArea {...args} />, | ||
}; | ||
|
||
Default.args = { | ||
defaultValue: 'hsl(30, 100%, 50%)', | ||
}; |
14 changes: 14 additions & 0 deletions
14
packages/components/src/components/ColorArea/ColorArea.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as React from 'react'; | ||
import { | ||
ColorArea as RACColorArea, | ||
ColorAreaProps, | ||
ColorThumb, | ||
} from 'react-aria-components'; | ||
|
||
export function ColorArea(props: ColorAreaProps) { | ||
return ( | ||
<RACColorArea {...props}> | ||
<ColorThumb /> | ||
</RACColorArea> | ||
); | ||
} |
Oops, something went wrong.