chore: functional bin
This commit is contained in:
15
.idea/runConfigurations/Playwright_test.xml
generated
Normal file
15
.idea/runConfigurations/Playwright_test.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Playwright test" type="JavaScriptTestRunnerPlaywright">
|
||||||
|
<node-interpreter value="project" />
|
||||||
|
<playwright-package value="$PROJECT_DIR$/node_modules/playwright" />
|
||||||
|
<working-dir value="$PROJECT_DIR$" />
|
||||||
|
<envs />
|
||||||
|
<scope-kind value="TEST" />
|
||||||
|
<test-file value="$PROJECT_DIR$/test/_community/e2e.spec.ts" />
|
||||||
|
<test-names>
|
||||||
|
<test-name value="Admin Panel" />
|
||||||
|
<test-name value="example test" />
|
||||||
|
</test-names>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
22
.vscode/settings.json
vendored
22
.vscode/settings.json
vendored
@@ -40,25 +40,5 @@
|
|||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.eslint": "explicit"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"workbench.colorCustomizations": {
|
|
||||||
"activityBar.activeBackground": "#8cb5b6",
|
|
||||||
"activityBar.background": "#8cb5b6",
|
|
||||||
"activityBar.foreground": "#15202b",
|
|
||||||
"activityBar.inactiveForeground": "#15202b99",
|
|
||||||
"activityBarBadge.background": "#9c639b",
|
|
||||||
"activityBarBadge.foreground": "#e7e7e7",
|
|
||||||
"commandCenter.border": "#15202b99",
|
|
||||||
"sash.hoverBorder": "#8cb5b6",
|
|
||||||
"statusBar.background": "#6da1a2",
|
|
||||||
"statusBar.foreground": "#15202b",
|
|
||||||
"statusBarItem.hoverBackground": "#568586",
|
|
||||||
"statusBarItem.remoteBackground": "#6da1a2",
|
|
||||||
"statusBarItem.remoteForeground": "#15202b",
|
|
||||||
"titleBar.activeBackground": "#6da1a2",
|
|
||||||
"titleBar.activeForeground": "#15202b",
|
|
||||||
"titleBar.inactiveBackground": "#6da1a299",
|
|
||||||
"titleBar.inactiveForeground": "#15202b99"
|
|
||||||
},
|
|
||||||
"peacock.color": "#6da1a2"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import withPayload from './packages/next/src/withPayload.js'
|
|
||||||
import bundleAnalyzer from '@next/bundle-analyzer'
|
import bundleAnalyzer from '@next/bundle-analyzer'
|
||||||
|
|
||||||
|
import withPayload from './packages/next/src/withPayload.js'
|
||||||
|
|
||||||
const withBundleAnalyzer = bundleAnalyzer({
|
const withBundleAnalyzer = bundleAnalyzer({
|
||||||
enabled: process.env.ANALYZE === 'true',
|
enabled: process.env.ANALYZE === 'true',
|
||||||
})
|
})
|
||||||
@@ -8,14 +9,6 @@ const withBundleAnalyzer = bundleAnalyzer({
|
|||||||
export default withBundleAnalyzer(
|
export default withBundleAnalyzer(
|
||||||
withPayload({
|
withPayload({
|
||||||
reactStrictMode: false,
|
reactStrictMode: false,
|
||||||
webpack: (webpackConfig) => {
|
|
||||||
webpackConfig.resolve.extensionAlias = {
|
|
||||||
'.js': ['.ts', '.tsx', '.js', '.jsx'],
|
|
||||||
'.mjs': ['.mts', '.mjs'],
|
|
||||||
'.cjs': ['.cts', '.cjs'],
|
|
||||||
}
|
|
||||||
return webpackConfig
|
|
||||||
},
|
|
||||||
async redirects() {
|
async redirects() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -25,5 +18,13 @@ export default withBundleAnalyzer(
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
webpack: (webpackConfig) => {
|
||||||
|
webpackConfig.resolve.extensionAlias = {
|
||||||
|
'.cjs': ['.cts', '.cjs'],
|
||||||
|
'.js': ['.ts', '.tsx', '.js', '.jsx'],
|
||||||
|
'.mjs': ['.mts', '.mjs'],
|
||||||
|
}
|
||||||
|
return webpackConfig
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "payload-monorepo",
|
"name": "payload-monorepo",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"workspaces:": [
|
"workspaces:": [
|
||||||
@@ -40,14 +40,14 @@
|
|||||||
"clean:build": "find . \\( -type d \\( -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -not -path '*/node_modules/*' -exec rm -rf {} +",
|
"clean:build": "find . \\( -type d \\( -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -not -path '*/node_modules/*' -exec rm -rf {} +",
|
||||||
"clean:all": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
|
"clean:all": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
|
||||||
"dev": "cross-env node --no-deprecation ./test/dev.js",
|
"dev": "cross-env node --no-deprecation ./test/dev.js",
|
||||||
"dev:generate-graphql-schema": "NODE_OPTIONS=--no-deprecation tsx ./test/generateGraphQLSchema.ts",
|
"dev:generate-graphql-schema": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/generateGraphQLSchema.ts",
|
||||||
"dev:generate-types": "NODE_OPTIONS=--no-deprecation tsx ./test/generateTypes.ts",
|
"dev:generate-types": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/generateTypes.ts",
|
||||||
"dev:postgres": "pnpm --filter payload run dev:postgres",
|
"dev:postgres": "pnpm --filter payload run dev:postgres",
|
||||||
"docker:restart": "pnpm docker:stop --remove-orphans && pnpm docker:start",
|
"docker:restart": "pnpm docker:stop --remove-orphans && pnpm docker:start",
|
||||||
"docker:start": "docker-compose -f packages/plugin-cloud-storage/docker-compose.yml up -d",
|
"docker:start": "docker-compose -f packages/plugin-cloud-storage/docker-compose.yml up -d",
|
||||||
"docker:stop": "docker-compose -f packages/plugin-cloud-storage/docker-compose.yml down",
|
"docker:stop": "docker-compose -f packages/plugin-cloud-storage/docker-compose.yml down",
|
||||||
"fix": "eslint \"packages/**/*.ts\" --fix",
|
"fix": "eslint \"packages/**/*.ts\" --fix",
|
||||||
"generate:types": "PAYLOAD_CONFIG_PATH=./test/_community/config.ts ts-node ./packages/payload/bin.js",
|
"generate:types": "PAYLOAD_CONFIG_PATH=./test/_community/config.ts node --no-deprecation ./packages/payload/bin.js generate:types",
|
||||||
"lint": "eslint \"packages/**/*.ts\"",
|
"lint": "eslint \"packages/**/*.ts\"",
|
||||||
"lint-staged": "lint-staged",
|
"lint-staged": "lint-staged",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
@@ -122,6 +122,8 @@
|
|||||||
"nodemon": "3.0.3",
|
"nodemon": "3.0.3",
|
||||||
"pino": "8.15.0",
|
"pino": "8.15.0",
|
||||||
"pino-pretty": "10.2.0",
|
"pino-pretty": "10.2.0",
|
||||||
|
"playwright": "file:playwright-1.43.0-next.tgz",
|
||||||
|
"playwright-core": "file:playwright-core-1.43.0-next.tgz",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"prompts": "2.4.2",
|
"prompts": "2.4.2",
|
||||||
"qs": "6.11.2",
|
"qs": "6.11.2",
|
||||||
@@ -169,7 +171,9 @@
|
|||||||
"graphql": "^16.8.1",
|
"graphql": "^16.8.1",
|
||||||
"react": "$react",
|
"react": "$react",
|
||||||
"react-dom": "$react-dom",
|
"react-dom": "$react-dom",
|
||||||
"typescript": "$typescript"
|
"typescript": "$typescript",
|
||||||
|
"playwright": "file:playwright-1.43.0-next.tgz",
|
||||||
|
"playwright-core": "file:playwright-core-1.43.0-next.tgz"
|
||||||
},
|
},
|
||||||
"allowedDeprecatedVersions": {
|
"allowedDeprecatedVersions": {
|
||||||
"uuid": "3.4.0",
|
"uuid": "3.4.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/db-mongodb",
|
"name": "@payloadcms/db-mongodb",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"description": "The officially supported MongoDB database adapter for Payload - Update 2",
|
"description": "The officially supported MongoDB database adapter for Payload - Update 2",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/db-postgres",
|
"name": "@payloadcms/db-postgres",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"description": "The officially supported Postgres database adapter for Payload",
|
"description": "The officially supported Postgres database adapter for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { Connect } from 'payload/database'
|
|||||||
import { eq, sql } from 'drizzle-orm'
|
import { eq, sql } from 'drizzle-orm'
|
||||||
import { drizzle } from 'drizzle-orm/node-postgres'
|
import { drizzle } from 'drizzle-orm/node-postgres'
|
||||||
import { numeric, timestamp, varchar } from 'drizzle-orm/pg-core'
|
import { numeric, timestamp, varchar } from 'drizzle-orm/pg-core'
|
||||||
import { Pool } from 'pg'
|
import pg from 'pg'
|
||||||
import prompts from 'prompts'
|
import prompts from 'prompts'
|
||||||
|
|
||||||
import type { PostgresAdapter } from './types.js'
|
import type { PostgresAdapter } from './types.js'
|
||||||
@@ -61,7 +61,7 @@ export const connect: Connect = async function connect(
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.pool = new Pool(this.poolOptions)
|
this.pool = new pg.Pool(this.poolOptions)
|
||||||
await connectWithReconnect({ adapter: this, payload: this.payload })
|
await connectWithReconnect({ adapter: this, payload: this.payload })
|
||||||
|
|
||||||
const logger = this.logger || false
|
const logger = this.logger || false
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { DatabaseError } from 'pg'
|
import pg from 'pg'
|
||||||
|
const { DatabaseError } = pg
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format error message with hint if available
|
* Format error message with hint if available
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/graphql",
|
"name": "@payloadcms/graphql",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"types": "./src/index.d.ts",
|
"types": "./src/index.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { GraphQLEnumType, GraphQLInputObjectType } from 'graphql'
|
import { GraphQLEnumType, GraphQLInputObjectType } from 'graphql'
|
||||||
import GraphQLJSON from 'graphql-type-json'
|
import GraphQLJSONImport from 'graphql-type-json'
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ArrayField,
|
ArrayField,
|
||||||
@@ -28,6 +28,9 @@ import formatName from '../utilities/formatName.js'
|
|||||||
import recursivelyBuildNestedPaths from './recursivelyBuildNestedPaths.js'
|
import recursivelyBuildNestedPaths from './recursivelyBuildNestedPaths.js'
|
||||||
import { withOperators } from './withOperators.js'
|
import { withOperators } from './withOperators.js'
|
||||||
|
|
||||||
|
const GraphQLJSON = (GraphQLJSONImport ||
|
||||||
|
GraphQLJSONImport.default) as unknown as typeof GraphQLJSONImport.default
|
||||||
|
|
||||||
type Args = {
|
type Args = {
|
||||||
nestedFieldName?: string
|
nestedFieldName?: string
|
||||||
parentName: string
|
parentName: string
|
||||||
@@ -96,7 +99,7 @@ const fieldToSchemaMap = ({ nestedFieldName, parentName }: Args): any => ({
|
|||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
value: { type: GraphQLJSON.default },
|
value: { type: GraphQLJSON },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/next",
|
"name": "@payloadcms/next",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"types": "./src/index.d.ts",
|
"types": "./src/index.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const getDataAndFile: GetDataAndFile = async ({ collection, config, reque
|
|||||||
let file: CustomPayloadRequest['file'] = undefined
|
let file: CustomPayloadRequest['file'] = undefined
|
||||||
|
|
||||||
if (['PATCH', 'POST', 'PUT'].includes(request.method.toUpperCase()) && request.body) {
|
if (['PATCH', 'POST', 'PUT'].includes(request.method.toUpperCase()) && request.body) {
|
||||||
const [contentType] = request.headers.get('Content-Type').split(';')
|
const [contentType] = (request.headers.get('Content-Type') || '').split(';')
|
||||||
|
|
||||||
if (contentType === 'application/json') {
|
if (contentType === 'application/json') {
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { Data, DocumentPreferences, ServerSideEditViewProps } from 'payload
|
|||||||
import {
|
import {
|
||||||
DocumentHeader,
|
DocumentHeader,
|
||||||
DocumentInfoProvider,
|
DocumentInfoProvider,
|
||||||
|
FormQueryParamsProvider,
|
||||||
HydrateClientUser,
|
HydrateClientUser,
|
||||||
RenderCustomComponent,
|
RenderCustomComponent,
|
||||||
buildStateFromSchema,
|
buildStateFromSchema,
|
||||||
@@ -22,6 +23,7 @@ export { generateAccountMetadata } from './meta.js'
|
|||||||
export const Account: React.FC<AdminViewProps> = async ({ initPageResult, searchParams }) => {
|
export const Account: React.FC<AdminViewProps> = async ({ initPageResult, searchParams }) => {
|
||||||
const {
|
const {
|
||||||
permissions,
|
permissions,
|
||||||
|
locale,
|
||||||
req: {
|
req: {
|
||||||
i18n,
|
i18n,
|
||||||
payload,
|
payload,
|
||||||
@@ -118,13 +120,22 @@ export const Account: React.FC<AdminViewProps> = async ({ initPageResult, search
|
|||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
/>
|
/>
|
||||||
<HydrateClientUser permissions={permissions} user={user} />
|
<HydrateClientUser permissions={permissions} user={user} />
|
||||||
<RenderCustomComponent
|
<FormQueryParamsProvider
|
||||||
CustomComponent={
|
initialParams={{
|
||||||
typeof CustomAccountComponent === 'function' ? CustomAccountComponent : undefined
|
depth: 0,
|
||||||
}
|
'fallback-locale': 'null',
|
||||||
DefaultComponent={EditView}
|
locale: locale.code,
|
||||||
componentProps={serverSideProps}
|
uploadEdits: undefined,
|
||||||
/>
|
}}
|
||||||
|
>
|
||||||
|
<RenderCustomComponent
|
||||||
|
CustomComponent={
|
||||||
|
typeof CustomAccountComponent === 'function' ? CustomAccountComponent : undefined
|
||||||
|
}
|
||||||
|
DefaultComponent={EditView}
|
||||||
|
componentProps={serverSideProps}
|
||||||
|
/>
|
||||||
|
</FormQueryParamsProvider>
|
||||||
</DocumentInfoProvider>
|
</DocumentInfoProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
#!/usr/bin/env ts-node
|
#!/usr/bin/env node
|
||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
||||||
|
|
||||||
import { register } from 'node:module'
|
import { register } from 'node:module'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url'
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
||||||
// import * as tsNode from 'ts-node'
|
|
||||||
|
|
||||||
import bin from './dist/bin/index.js'
|
import { bin } from './dist/bin/index.js'
|
||||||
import { loadEnv } from './dist/bin/loadEnv.js'
|
|
||||||
import { findConfig } from './dist/config/find.js'
|
|
||||||
|
|
||||||
// Allow disabling SWC for debugging
|
// Allow disabling SWC for debugging
|
||||||
if (process.env.DISABLE_SWC !== 'true') {
|
if (process.env.DISABLE_SWC !== 'true') {
|
||||||
// const oldURL = pathToFileURL('./').toString()
|
|
||||||
const filename = fileURLToPath(import.meta.url)
|
const filename = fileURLToPath(import.meta.url)
|
||||||
const dirname = path.dirname(filename)
|
const dirname = path.dirname(filename)
|
||||||
const url = pathToFileURL(dirname).toString() + '/'
|
const url = pathToFileURL(dirname).toString() + '/'
|
||||||
@@ -20,17 +15,4 @@ if (process.env.DISABLE_SWC !== 'true') {
|
|||||||
register('./dist/bin/register/index.js', url)
|
register('./dist/bin/register/index.js', url)
|
||||||
}
|
}
|
||||||
|
|
||||||
// tsNode.register({})
|
bin()
|
||||||
|
|
||||||
const start = async () => {
|
|
||||||
loadEnv()
|
|
||||||
const configPath = findConfig()
|
|
||||||
|
|
||||||
// const sanitized = configPath.replace('.ts', '')
|
|
||||||
const configPromise = await import(configPath)
|
|
||||||
const config = await configPromise
|
|
||||||
|
|
||||||
bin(config)
|
|
||||||
}
|
|
||||||
|
|
||||||
start()
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "payload",
|
"name": "payload",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"description": "Node, React and MongoDB Headless CMS and Application Framework",
|
"description": "Node, React and MongoDB Headless CMS and Application Framework",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
@@ -44,15 +44,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@payloadcms/translations": "workspace:*",
|
"@payloadcms/translations": "workspace:*",
|
||||||
"@swc-node/core": "^1.13.0",
|
"@swc-node/core": "^1.13.0",
|
||||||
"@swc-node/register": "^1.9.0",
|
|
||||||
"@swc-node/sourcemap-support": "^0.5.0",
|
"@swc-node/sourcemap-support": "^0.5.0",
|
||||||
"@swc/register": "^0.1.10",
|
|
||||||
"bson-objectid": "2.0.4",
|
"bson-objectid": "2.0.4",
|
||||||
"colorette": "^2.0.20",
|
|
||||||
"conf": "10.2.0",
|
"conf": "10.2.0",
|
||||||
"console-table-printer": "2.11.2",
|
"console-table-printer": "2.11.2",
|
||||||
"dataloader": "2.2.2",
|
"dataloader": "2.2.2",
|
||||||
"debug": "^4.3.4",
|
|
||||||
"deepmerge": "4.3.1",
|
"deepmerge": "4.3.1",
|
||||||
"dotenv": "8.6.0",
|
"dotenv": "8.6.0",
|
||||||
"file-type": "16.5.4",
|
"file-type": "16.5.4",
|
||||||
|
|||||||
@@ -1,18 +1,26 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
import minimist from 'minimist'
|
import minimist from 'minimist'
|
||||||
|
|
||||||
import type { BinScript, SanitizedConfig } from '../config/types.js'
|
import type { BinScript } from '../config/types.js'
|
||||||
|
|
||||||
// import loadConfig from '../config/load.js'
|
import { findConfig } from '../config/find.js'
|
||||||
import { generateTypes } from './generateTypes.js'
|
import { generateTypes } from './generateTypes.js'
|
||||||
|
import { loadEnv } from './loadEnv.js'
|
||||||
import { migrate } from './migrate.js'
|
import { migrate } from './migrate.js'
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-exports
|
export const bin = async () => {
|
||||||
export default async (config: SanitizedConfig) => {
|
loadEnv()
|
||||||
|
const configPath = findConfig()
|
||||||
|
const configPromise = await import(configPath)
|
||||||
|
let config = await configPromise
|
||||||
|
if (config.default) config = await config.default
|
||||||
|
|
||||||
const args = minimist(process.argv.slice(2))
|
const args = minimist(process.argv.slice(2))
|
||||||
const scriptIndex = args._.findIndex((x) => x === 'build')
|
const script = (typeof args._[0] === 'string' ? args._[0] : '').toLowerCase()
|
||||||
const script = scriptIndex === -1 ? args._[0] : args._[scriptIndex]
|
|
||||||
const userBinScript = config.bin.find(({ key }) => key === script)
|
const userBinScript = Array.isArray(config.bin)
|
||||||
|
? config.bin.find(({ key }) => key === script)
|
||||||
|
: false
|
||||||
|
|
||||||
if (userBinScript) {
|
if (userBinScript) {
|
||||||
try {
|
try {
|
||||||
@@ -27,17 +35,13 @@ export default async (config: SanitizedConfig) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (script.startsWith('migrate')) {
|
if (script.startsWith('migrate')) {
|
||||||
void migrate({ config, parsedArgs: args }).then(() => process.exit(0))
|
return migrate({ config, parsedArgs: args }).then(() => process.exit(0))
|
||||||
} else {
|
|
||||||
switch (script.toLowerCase()) {
|
|
||||||
case 'generate:types': {
|
|
||||||
generateTypes(config)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
console.log(`Unknown script "${script}".`)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (script === 'generate:types') {
|
||||||
|
return generateTypes(config)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Unknown script: "${script}".`)
|
||||||
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/plugin-cloud-storage",
|
"name": "@payloadcms/plugin-cloud-storage",
|
||||||
"description": "The official cloud storage plugin for Payload CMS",
|
"description": "The official cloud storage plugin for Payload CMS",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/plugin-cloud",
|
"name": "@payloadcms/plugin-cloud",
|
||||||
"description": "The official Payload Cloud plugin",
|
"description": "The official Payload Cloud plugin",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import type { Response } from 'express'
|
|
||||||
import type { Config } from 'payload/config'
|
import type { Config } from 'payload/config'
|
||||||
import type { TypeWithID } from 'payload/types'
|
import type { CollectionConfig, FileData, PayloadRequest, TypeWithID } from 'payload/types'
|
||||||
import type { CollectionConfig, FileData, PayloadRequest } from 'payload/types'
|
|
||||||
|
|
||||||
export interface File {
|
export interface File {
|
||||||
buffer: Buffer
|
buffer: Buffer
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/plugin-seo",
|
"name": "@payloadcms/plugin-seo",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"homepage:": "https://payloadcms.com",
|
"homepage:": "https://payloadcms.com",
|
||||||
"repository": "git@github.com:payloadcms/plugin-seo.git",
|
"repository": "git@github.com:payloadcms/plugin-seo.git",
|
||||||
"description": "SEO plugin for Payload",
|
"description": "SEO plugin for Payload",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/richtext-lexical",
|
"name": "@payloadcms/richtext-lexical",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"description": "The officially supported Lexical richtext adapter for Payload",
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import { createHeadlessEditor } from '@lexical/headless'
|
|||||||
import { useTableCell } from '@payloadcms/ui/elements'
|
import { useTableCell } from '@payloadcms/ui/elements'
|
||||||
import { useFieldPath } from '@payloadcms/ui/forms'
|
import { useFieldPath } from '@payloadcms/ui/forms'
|
||||||
import { useClientFunctions } from '@payloadcms/ui/providers'
|
import { useClientFunctions } from '@payloadcms/ui/providers'
|
||||||
import { $getRoot } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getRoot } = lexicalImport
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { FeatureProviderClient } from '../field/features/types.js'
|
import type { FeatureProviderClient } from '../field/features/types.js'
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { FORMAT_ELEMENT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { FORMAT_ELEMENT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../types.js'
|
import type { FeatureProviderProviderClient } from '../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $createQuoteNode, QuoteNode } from '@lexical/rich-text'
|
import lexicalRichTextImport from '@lexical/rich-text'
|
||||||
import { $setBlocksType } from '@lexical/selection'
|
const { $createQuoteNode, QuoteNode } = lexicalRichTextImport
|
||||||
import { $getSelection } from 'lexical'
|
|
||||||
|
import lexicalSelectionImport from '@lexical/selection'
|
||||||
|
const { $setBlocksType } = lexicalSelectionImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getSelection } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../types.js'
|
import type { FeatureProviderProviderClient } from '../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { QuoteNode, type SerializedQuoteNode } from '@lexical/rich-text'
|
import lexicalRichTextImport, { type SerializedQuoteNode } from '@lexical/rich-text'
|
||||||
|
const { QuoteNode } = lexicalRichTextImport
|
||||||
|
|
||||||
import type { HTMLConverter } from '../converters/html/converter/types.js'
|
import type { HTMLConverter } from '../converters/html/converter/types.js'
|
||||||
import type { FeatureProviderProviderServer } from '../types.js'
|
import type { FeatureProviderProviderServer } from '../types.js'
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import type { ElementTransformer } from '@lexical/markdown'
|
import type { ElementTransformer } from '@lexical/markdown'
|
||||||
|
|
||||||
import { $createQuoteNode, $isQuoteNode, QuoteNode } from '@lexical/rich-text'
|
import lexicalRichTextImport from '@lexical/rich-text'
|
||||||
import { $createLineBreakNode } from 'lexical'
|
const { $createQuoteNode, $isQuoteNode, QuoteNode } = lexicalRichTextImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $createLineBreakNode } = lexicalImport
|
||||||
|
|
||||||
export const MarkdownTransformer: ElementTransformer = {
|
export const MarkdownTransformer: ElementTransformer = {
|
||||||
type: 'element',
|
type: 'element',
|
||||||
dependencies: [QuoteNode],
|
dependencies: [QuoteNode],
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import type { ReducedBlock } from '@payloadcms/ui/types'
|
|||||||
import type { FormState } from 'payload/types'
|
import type { FormState } from 'payload/types'
|
||||||
import type { Data } from 'payload/types'
|
import type { Data } from 'payload/types'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import { RenderFields } from '@payloadcms/ui'
|
import { RenderFields } from '@payloadcms/ui'
|
||||||
import {
|
import {
|
||||||
@@ -17,7 +18,8 @@ import {
|
|||||||
useTranslation,
|
useTranslation,
|
||||||
} from '@payloadcms/ui'
|
} from '@payloadcms/ui'
|
||||||
import isDeepEqual from 'deep-equal'
|
import isDeepEqual from 'deep-equal'
|
||||||
import { $getNodeByKey } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getNodeByKey } = lexicalImport
|
||||||
import React, { useCallback } from 'react'
|
import React, { useCallback } from 'react'
|
||||||
|
|
||||||
import type { SanitizedClientEditorConfig } from '../../../lexical/config/types.js'
|
import type { SanitizedClientEditorConfig } from '../../../lexical/config/types.js'
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useModal } from '@faceless-ui/modal'
|
import * as facelessUIImport from '@faceless-ui/modal'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { BlocksDrawer, formatDrawerSlug, useEditDepth, useTranslation } from '@payloadcms/ui'
|
import { BlocksDrawer, formatDrawerSlug, useEditDepth, useTranslation } from '@payloadcms/ui'
|
||||||
import {
|
import lexicalImport from 'lexical'
|
||||||
$getNodeByKey,
|
const { $getNodeByKey, COMMAND_PRIORITY_EDITOR, createCommand } = lexicalImport
|
||||||
COMMAND_PRIORITY_EDITOR,
|
|
||||||
type LexicalCommand,
|
import type { LexicalCommand, LexicalEditor } from 'lexical'
|
||||||
type LexicalEditor,
|
|
||||||
createCommand,
|
|
||||||
} from 'lexical'
|
|
||||||
import React, { useCallback, useEffect, useState } from 'react'
|
import React, { useCallback, useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { ClientComponentProps } from '../../types.js'
|
import type { ClientComponentProps } from '../../types.js'
|
||||||
@@ -55,6 +54,8 @@ const insertBlock = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const BlocksDrawerComponent: React.FC = () => {
|
export const BlocksDrawerComponent: React.FC = () => {
|
||||||
|
const { useModal } = facelessUIImport
|
||||||
|
|
||||||
const [editor] = useLexicalComposerContext()
|
const [editor] = useLexicalComposerContext()
|
||||||
const { editorConfig, uuid } = useEditorConfigContext()
|
const { editorConfig, uuid } = useEditorConfigContext()
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ import type {
|
|||||||
Spread,
|
Spread,
|
||||||
} from 'lexical'
|
} from 'lexical'
|
||||||
|
|
||||||
import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'
|
import lexicalDecoratorBlockNodeImport from '@lexical/react/LexicalDecoratorBlockNode.js'
|
||||||
|
const { DecoratorBlockNode } = lexicalDecoratorBlockNodeImport
|
||||||
import ObjectID from 'bson-objectid'
|
import ObjectID from 'bson-objectid'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { LexicalCommand } from 'lexical'
|
import type { LexicalCommand } from 'lexical'
|
||||||
|
|
||||||
import { createCommand } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { createCommand } = lexicalImport
|
||||||
|
|
||||||
import type { InsertBlockPayload } from './index.js'
|
import type { InsertBlockPayload } from './index.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { $insertNodeToNearestRoot, mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import {
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
|
const { $insertNodeToNearestRoot, mergeRegister } = lexicalUtilsImport
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const {
|
||||||
$getPreviousSelection,
|
$getPreviousSelection,
|
||||||
$getSelection,
|
$getSelection,
|
||||||
$isParagraphNode,
|
$isParagraphNode,
|
||||||
$isRangeSelection,
|
$isRangeSelection,
|
||||||
COMMAND_PRIORITY_EDITOR,
|
COMMAND_PRIORITY_EDITOR,
|
||||||
} from 'lexical'
|
} = lexicalImport
|
||||||
|
|
||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
|
|
||||||
import type { BlockFields } from '../nodes/BlocksNode.js'
|
import type { BlockFields } from '../nodes/BlocksNode.js'
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { BaseSelection, LexicalEditor } from 'lexical'
|
import type { BaseSelection, LexicalEditor } from 'lexical'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { $createParagraphNode, $createTextNode, $getRoot } from 'lexical'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $createParagraphNode, $createTextNode, $getRoot } = lexicalImport
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { TreeView } from '@lexical/react/LexicalTreeView.js'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
import lexicalTreeViewImport from '@lexical/react/LexicalTreeView.js'
|
||||||
|
const { TreeView } = lexicalTreeViewImport
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,14 @@
|
|||||||
|
|
||||||
import type { HeadingTagType } from '@lexical/rich-text'
|
import type { HeadingTagType } from '@lexical/rich-text'
|
||||||
|
|
||||||
import { HeadingNode } from '@lexical/rich-text'
|
import lexicalRichTextImport from '@lexical/rich-text'
|
||||||
import { $createHeadingNode } from '@lexical/rich-text'
|
const { $createHeadingNode, HeadingNode } = lexicalRichTextImport
|
||||||
import { $setBlocksType } from '@lexical/selection'
|
|
||||||
import { $getSelection } from 'lexical'
|
import lexicalSelectionImport from '@lexical/selection'
|
||||||
|
const { $setBlocksType } = lexicalSelectionImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getSelection } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../types.js'
|
import type { FeatureProviderProviderClient } from '../types.js'
|
||||||
import type { HeadingFeatureProps } from './feature.server.js'
|
import type { HeadingFeatureProps } from './feature.server.js'
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { HeadingTagType } from '@lexical/rich-text'
|
import type { HeadingTagType, SerializedHeadingNode } from '@lexical/rich-text'
|
||||||
|
|
||||||
import { HeadingNode, type SerializedHeadingNode } from '@lexical/rich-text'
|
import lexicalRichTextImport from '@lexical/rich-text'
|
||||||
|
const { HeadingNode } = lexicalRichTextImport
|
||||||
|
|
||||||
import type { HTMLConverter } from '../converters/html/converter/types.js'
|
import type { HTMLConverter } from '../converters/html/converter/types.js'
|
||||||
import type { FeatureProviderProviderServer } from '../types.js'
|
import type { FeatureProviderProviderServer } from '../types.js'
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import type { ElementTransformer } from '@lexical/markdown'
|
import type { ElementTransformer } from '@lexical/markdown'
|
||||||
import type { HeadingTagType } from '@lexical/rich-text'
|
import type { HeadingTagType } from '@lexical/rich-text'
|
||||||
|
|
||||||
import { $createHeadingNode, $isHeadingNode, HeadingNode } from '@lexical/rich-text'
|
import lexicalRichTextImport from '@lexical/rich-text'
|
||||||
|
const { $createHeadingNode, $isHeadingNode, HeadingNode } = lexicalRichTextImport
|
||||||
|
|
||||||
import { createBlockNode } from '../../lexical/utils/markdown/createBlockNode.js'
|
import { createBlockNode } from '../../lexical/utils/markdown/createBlockNode.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../types.js'
|
import type { FeatureProviderProviderClient } from '../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $findMatchingParent } from '@lexical/utils'
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
import { $getSelection, $isRangeSelection } from 'lexical'
|
const { $findMatchingParent } = lexicalUtilsImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getSelection, $isRangeSelection } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../types.js'
|
import type { FeatureProviderProviderClient } from '../types.js'
|
||||||
import type { ExclusiveLinkCollectionsProps } from './feature.server.js'
|
import type { ExclusiveLinkCollectionsProps } from './feature.server.js'
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import {
|
import type { ElementNode, LexicalNode, RangeSelection } from 'lexical'
|
||||||
$applyNodeReplacement,
|
|
||||||
$isElementNode,
|
import lexicalImport from 'lexical'
|
||||||
type ElementNode,
|
const { $applyNodeReplacement, $isElementNode } = lexicalImport
|
||||||
type LexicalNode,
|
|
||||||
type RangeSelection,
|
|
||||||
} from 'lexical'
|
|
||||||
|
|
||||||
import type { LinkFields, SerializedAutoLinkNode } from './types.js'
|
import type { LinkFields, SerializedAutoLinkNode } from './types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
import type { BaseSelection } from 'lexical'
|
import type { BaseSelection } from 'lexical'
|
||||||
|
|
||||||
import { addClassNamesToElement, isHTMLAnchorElement } from '@lexical/utils'
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
import {
|
const { addClassNamesToElement, isHTMLAnchorElement } = lexicalUtilsImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const {
|
||||||
$applyNodeReplacement,
|
$applyNodeReplacement,
|
||||||
$createTextNode,
|
$createTextNode,
|
||||||
$getSelection,
|
$getSelection,
|
||||||
$isElementNode,
|
$isElementNode,
|
||||||
$isRangeSelection,
|
$isRangeSelection,
|
||||||
type DOMConversionMap,
|
|
||||||
type DOMConversionOutput,
|
|
||||||
type EditorConfig,
|
|
||||||
ElementNode,
|
ElementNode,
|
||||||
type LexicalCommand,
|
|
||||||
type LexicalNode,
|
|
||||||
type NodeKey,
|
|
||||||
type RangeSelection,
|
|
||||||
createCommand,
|
createCommand,
|
||||||
|
} = lexicalImport
|
||||||
|
|
||||||
|
import type {
|
||||||
|
DOMConversionMap,
|
||||||
|
DOMConversionOutput,
|
||||||
|
EditorConfig,
|
||||||
|
ElementNode as ElementNodeType,
|
||||||
|
LexicalCommand,
|
||||||
|
LexicalNode,
|
||||||
|
NodeKey,
|
||||||
|
RangeSelection,
|
||||||
} from 'lexical'
|
} from 'lexical'
|
||||||
|
|
||||||
import type { LinkPayload } from '../plugins/floatingLinkEditor/types.js'
|
import type { LinkPayload } from '../plugins/floatingLinkEditor/types.js'
|
||||||
@@ -143,7 +150,7 @@ export class LinkNode extends ElementNode {
|
|||||||
return this.getLatest().__fields
|
return this.getLatest().__fields
|
||||||
}
|
}
|
||||||
|
|
||||||
insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNode | null {
|
insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNodeType | null {
|
||||||
const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection)
|
const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection)
|
||||||
if ($isElementNode(element)) {
|
if ($isElementNode(element)) {
|
||||||
const linkNode = $createLinkNode({ fields: this.__fields })
|
const linkNode = $createLinkNode({ fields: this.__fields })
|
||||||
@@ -284,7 +291,7 @@ export function toggleLink(payload: LinkPayload): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let prevParent: ElementNode | LinkNode | null = null
|
let prevParent: ElementNodeType | LinkNode | null = null
|
||||||
let linkNode: LinkNode | null = null
|
let linkNode: LinkNode | null = null
|
||||||
|
|
||||||
nodes.forEach((node) => {
|
nodes.forEach((node) => {
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { ElementNode, LexicalEditor, LexicalNode } from 'lexical'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
const { mergeRegister } = lexicalUtilsImport
|
||||||
import {
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const {
|
||||||
$createTextNode,
|
$createTextNode,
|
||||||
$getSelection,
|
$getSelection,
|
||||||
$isElementNode,
|
$isElementNode,
|
||||||
@@ -11,8 +14,12 @@ import {
|
|||||||
$isNodeSelection,
|
$isNodeSelection,
|
||||||
$isRangeSelection,
|
$isRangeSelection,
|
||||||
$isTextNode,
|
$isTextNode,
|
||||||
TextNode,
|
TextNode: TextNodeValue,
|
||||||
} from 'lexical'
|
} = lexicalImport
|
||||||
|
|
||||||
|
import type { ElementNode, LexicalEditor, LexicalNode } from 'lexical'
|
||||||
|
|
||||||
|
import { type TextNode } from 'lexical'
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
|
|
||||||
import type { LinkFields } from '../../nodes/types.js'
|
import type { LinkFields } from '../../nodes/types.js'
|
||||||
@@ -391,7 +398,7 @@ function useAutoLink(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return mergeRegister(
|
return mergeRegister(
|
||||||
editor.registerNodeTransform(TextNode, (textNode: TextNode) => {
|
editor.registerNodeTransform(TextNodeValue, (textNode: TextNode) => {
|
||||||
const parent = textNode.getParentOrThrow()
|
const parent = textNode.getParentOrThrow()
|
||||||
const previous = textNode.getPreviousSibling()
|
const previous = textNode.getPreviousSibling()
|
||||||
if ($isAutoLinkNode(parent)) {
|
if ($isAutoLinkNode(parent)) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { LexicalCommand } from 'lexical'
|
import type { LexicalCommand } from 'lexical'
|
||||||
|
|
||||||
import { createCommand } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { createCommand } = lexicalImport
|
||||||
|
|
||||||
import type { LinkPayload } from '../types.js'
|
import type { LinkPayload } from '../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -2,19 +2,24 @@
|
|||||||
import type { FormState } from 'payload/types'
|
import type { FormState } from 'payload/types'
|
||||||
import type { Data } from 'payload/types'
|
import type { Data } from 'payload/types'
|
||||||
|
|
||||||
import { useModal } from '@faceless-ui/modal'
|
import * as facelessUIImport from '@faceless-ui/modal'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { $findMatchingParent, mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
|
||||||
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
|
const { $findMatchingParent, mergeRegister } = lexicalUtilsImport
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import { formatDrawerSlug, useConfig, useEditDepth, useTranslation } from '@payloadcms/ui'
|
import { formatDrawerSlug, useConfig, useEditDepth, useTranslation } from '@payloadcms/ui'
|
||||||
import {
|
import lexicalImport from 'lexical'
|
||||||
|
const {
|
||||||
$getSelection,
|
$getSelection,
|
||||||
$isRangeSelection,
|
$isRangeSelection,
|
||||||
COMMAND_PRIORITY_HIGH,
|
COMMAND_PRIORITY_HIGH,
|
||||||
COMMAND_PRIORITY_LOW,
|
COMMAND_PRIORITY_LOW,
|
||||||
KEY_ESCAPE_COMMAND,
|
KEY_ESCAPE_COMMAND,
|
||||||
SELECTION_CHANGE_COMMAND,
|
SELECTION_CHANGE_COMMAND,
|
||||||
} from 'lexical'
|
} = lexicalImport
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
|
|
||||||
import type { LinkNode } from '../../../nodes/LinkNode.js'
|
import type { LinkNode } from '../../../nodes/LinkNode.js'
|
||||||
@@ -30,6 +35,8 @@ import { $isLinkNode, TOGGLE_LINK_COMMAND } from '../../../nodes/LinkNode.js'
|
|||||||
import { TOGGLE_LINK_WITH_MODAL_COMMAND } from './commands.js'
|
import { TOGGLE_LINK_WITH_MODAL_COMMAND } from './commands.js'
|
||||||
|
|
||||||
export function LinkEditor({ anchorElem }: { anchorElem: HTMLElement }): React.ReactNode {
|
export function LinkEditor({ anchorElem }: { anchorElem: HTMLElement }): React.ReactNode {
|
||||||
|
const { useModal } = facelessUIImport
|
||||||
|
|
||||||
const [editor] = useLexicalComposerContext()
|
const [editor] = useLexicalComposerContext()
|
||||||
|
|
||||||
const editorRef = useRef<HTMLDivElement | null>(null)
|
const editorRef = useRef<HTMLDivElement | null>(null)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import {
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
$getSelection,
|
const { mergeRegister } = lexicalUtilsImport
|
||||||
$isElementNode,
|
|
||||||
$isRangeSelection,
|
import lexicalImport from 'lexical'
|
||||||
COMMAND_PRIORITY_LOW,
|
const { $getSelection, $isElementNode, $isRangeSelection, COMMAND_PRIORITY_LOW, PASTE_COMMAND } =
|
||||||
PASTE_COMMAND,
|
lexicalImport
|
||||||
} from 'lexical'
|
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
|
|
||||||
import type { LinkFields } from '../../nodes/types.js'
|
import type { LinkFields } from '../../nodes/types.js'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { INSERT_CHECK_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { INSERT_CHECK_LIST_COMMAND, ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import type { ClientFeature, FeatureProviderProviderClient } from '../../types.js'
|
import type { ClientFeature, FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderServer } from '../../types.js'
|
import type { FeatureProviderProviderServer } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { ElementTransformer } from '@lexical/markdown'
|
import type { ElementTransformer } from '@lexical/markdown'
|
||||||
|
|
||||||
import { $isListNode, ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { $isListNode, ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import { listExport, listReplace } from '../common/markdown.js'
|
import { listExport, listReplace } from '../common/markdown.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin.js'
|
import lexicalCheckListPluginImport from '@lexical/react/LexicalCheckListPlugin.js'
|
||||||
|
const { CheckListPlugin } = lexicalCheckListPluginImport
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export function LexicalCheckListPlugin() {
|
export function LexicalCheckListPlugin() {
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import type { ListNode, ListType } from '@lexical/list'
|
|||||||
import type { ElementTransformer } from '@lexical/markdown'
|
import type { ElementTransformer } from '@lexical/markdown'
|
||||||
import type { ElementNode } from 'lexical'
|
import type { ElementNode } from 'lexical'
|
||||||
|
|
||||||
import { $createListItemNode, $createListNode, $isListItemNode, $isListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { $createListItemNode, $createListNode, $isListItemNode, $isListNode } = lexicalListImport
|
||||||
|
|
||||||
// Amount of spaces that define indentation level
|
// Amount of spaces that define indentation level
|
||||||
const LIST_INDENT_SIZE = 4
|
const LIST_INDENT_SIZE = 4
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { SerializedListItemNode, SerializedListNode } from '@lexical/list'
|
import type { SerializedListItemNode, SerializedListNode } from '@lexical/list'
|
||||||
|
|
||||||
import { ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import type { HTMLConverter } from '../converters/html/converter/types.js'
|
import type { HTMLConverter } from '../converters/html/converter/types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
import lexicalListImport from '@lexical/list'
|
||||||
import { INSERT_ORDERED_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list'
|
const { INSERT_ORDERED_LIST_COMMAND, ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderServer } from '../../types.js'
|
import type { FeatureProviderProviderServer } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { ElementTransformer } from '@lexical/markdown'
|
import type { ElementTransformer } from '@lexical/markdown'
|
||||||
|
|
||||||
import { $isListNode, ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { $isListNode, ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import { listExport, listReplace } from '../common/markdown.js'
|
import { listExport, listReplace } from '../common/markdown.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { ListPlugin } from '@lexical/react/LexicalListPlugin.js'
|
import lexicalListPluginImport from '@lexical/react/LexicalListPlugin.js'
|
||||||
|
const { ListPlugin } = lexicalListPluginImport
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export function LexicalListPlugin() {
|
export function LexicalListPlugin() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { INSERT_UNORDERED_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { INSERT_UNORDERED_LIST_COMMAND, ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../../types.js'
|
import type { FeatureProviderProviderClient } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderServer } from '../../types.js'
|
import type { FeatureProviderProviderServer } from '../../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { ElementTransformer } from '@lexical/markdown'
|
import type { ElementTransformer } from '@lexical/markdown'
|
||||||
|
|
||||||
import { $isListNode, ListItemNode, ListNode } from '@lexical/list'
|
import lexicalListImport from '@lexical/list'
|
||||||
|
const { $isListNode, ListItemNode, ListNode } = lexicalListImport
|
||||||
|
|
||||||
import { listExport, listReplace } from '../common/markdown.js'
|
import { listExport, listReplace } from '../common/markdown.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
import type { SerializedLexicalNode, Spread } from 'lexical'
|
import type { SerializedLexicalNode, Spread } from 'lexical'
|
||||||
|
|
||||||
import { addClassNamesToElement } from '@lexical/utils'
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
import { DecoratorNode, type EditorConfig, type LexicalNode, type NodeKey } from 'lexical'
|
const { addClassNamesToElement } = lexicalUtilsImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { DecoratorNode } = lexicalImport
|
||||||
|
|
||||||
|
import type { EditorConfig, LexicalNode, NodeKey } from 'lexical'
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
export type UnknownConvertedNodeData = {
|
export type UnknownConvertedNodeData = {
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import type { SerializedLexicalNode, Spread } from 'lexical'
|
import type { SerializedLexicalNode, Spread } from 'lexical'
|
||||||
|
|
||||||
import { addClassNamesToElement } from '@lexical/utils'
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
import { DecoratorNode, type EditorConfig, type LexicalNode, type NodeKey } from 'lexical'
|
const { addClassNamesToElement } = lexicalUtilsImport
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { DecoratorNode } = lexicalImport
|
||||||
|
|
||||||
|
import type { EditorConfig, LexicalNode, NodeKey } from 'lexical'
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
export type UnknownConvertedNodeData = {
|
export type UnknownConvertedNodeData = {
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { $setBlocksType } from '@lexical/selection'
|
import lexicalSelectionImport from '@lexical/selection'
|
||||||
import { $createParagraphNode, $getSelection } from 'lexical'
|
const { $setBlocksType } = lexicalSelectionImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $createParagraphNode, $getSelection } = lexicalImport
|
||||||
|
|
||||||
import type { FeatureProviderProviderClient } from '../types.js'
|
import type { FeatureProviderProviderClient } from '../types.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { LexicalCommand } from 'lexical'
|
import type { LexicalCommand } from 'lexical'
|
||||||
|
|
||||||
import { createCommand } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { createCommand } = lexicalImport
|
||||||
|
|
||||||
export const INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND: LexicalCommand<{
|
export const INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND: LexicalCommand<{
|
||||||
replace: { nodeKey: string } | false
|
replace: { nodeKey: string } | false
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { useListDrawer } from '@payloadcms/ui'
|
import { useListDrawer } from '@payloadcms/ui'
|
||||||
import { $getNodeByKey, COMMAND_PRIORITY_EDITOR, type LexicalEditor } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getNodeByKey, COMMAND_PRIORITY_EDITOR } = lexicalImport
|
||||||
|
|
||||||
|
import type { LexicalEditor } from 'lexical'
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useState } from 'react'
|
import React, { useCallback, useEffect, useState } from 'react'
|
||||||
|
|
||||||
import { $createRelationshipNode } from '../nodes/RelationshipNode.js'
|
import { $createRelationshipNode } from '../nodes/RelationshipNode.js'
|
||||||
|
|||||||
@@ -10,10 +10,11 @@ import type {
|
|||||||
Spread,
|
Spread,
|
||||||
} from 'lexical'
|
} from 'lexical'
|
||||||
|
|
||||||
import {
|
import lexicalDecoratorBlockNodeImport from '@lexical/react/LexicalDecoratorBlockNode.js'
|
||||||
DecoratorBlockNode,
|
const { DecoratorBlockNode } = lexicalDecoratorBlockNodeImport
|
||||||
type SerializedDecoratorBlockNode,
|
|
||||||
} from '@lexical/react/LexicalDecoratorBlockNode.js'
|
import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
const RelationshipComponent = React.lazy(() =>
|
const RelationshipComponent = React.lazy(() =>
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'
|
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import { Button, useConfig, useDocumentDrawer, usePayloadAPI, useTranslation } from '@payloadcms/ui'
|
import { Button, useConfig, useDocumentDrawer, usePayloadAPI, useTranslation } from '@payloadcms/ui'
|
||||||
import { $getNodeByKey, type ElementFormatType } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getNodeByKey } = lexicalImport
|
||||||
|
|
||||||
|
import type { ElementFormatType } from 'lexical'
|
||||||
|
|
||||||
import React, { useCallback, useReducer, useState } from 'react'
|
import React, { useCallback, useReducer, useState } from 'react'
|
||||||
|
|
||||||
import type { RelationshipData } from '../RelationshipNode.js'
|
import type { RelationshipData } from '../RelationshipNode.js'
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { $insertNodeToNearestRoot } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
|
const { $insertNodeToNearestRoot } = lexicalUtilsImport
|
||||||
import { useConfig } from '@payloadcms/ui'
|
import { useConfig } from '@payloadcms/ui'
|
||||||
import {
|
import lexicalImport from 'lexical'
|
||||||
|
const {
|
||||||
$getPreviousSelection,
|
$getPreviousSelection,
|
||||||
$getSelection,
|
$getSelection,
|
||||||
$isParagraphNode,
|
$isParagraphNode,
|
||||||
$isRangeSelection,
|
$isRangeSelection,
|
||||||
COMMAND_PRIORITY_EDITOR,
|
COMMAND_PRIORITY_EDITOR,
|
||||||
type LexicalCommand,
|
|
||||||
createCommand,
|
createCommand,
|
||||||
} from 'lexical'
|
} = lexicalImport
|
||||||
|
|
||||||
|
import type { LexicalCommand } from 'lexical'
|
||||||
|
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { FormState, SanitizedCollectionConfig } from 'payload/types'
|
import type { FormState, SanitizedCollectionConfig } from 'payload/types'
|
||||||
|
|
||||||
import { useModal } from '@faceless-ui/modal'
|
import * as facelessUIImport from '@faceless-ui/modal'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import {
|
import {
|
||||||
Drawer,
|
Drawer,
|
||||||
@@ -17,7 +18,9 @@ import {
|
|||||||
useFieldPath,
|
useFieldPath,
|
||||||
useTranslation,
|
useTranslation,
|
||||||
} from '@payloadcms/ui'
|
} from '@payloadcms/ui'
|
||||||
import { $getNodeByKey } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getNodeByKey } = lexicalImport
|
||||||
|
|
||||||
import { deepCopyObject } from 'payload/utilities'
|
import { deepCopyObject } from 'payload/utilities'
|
||||||
import React, { useCallback, useEffect, useState } from 'react'
|
import React, { useCallback, useEffect, useState } from 'react'
|
||||||
import { v4 as uuid } from 'uuid'
|
import { v4 as uuid } from 'uuid'
|
||||||
@@ -37,6 +40,8 @@ export const ExtraFieldsUploadDrawer: React.FC<
|
|||||||
relatedCollection: SanitizedCollectionConfig
|
relatedCollection: SanitizedCollectionConfig
|
||||||
}
|
}
|
||||||
> = (props) => {
|
> = (props) => {
|
||||||
|
const { useModal } = facelessUIImport
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { fields, relationTo, value },
|
data: { fields, relationTo, value },
|
||||||
drawerSlug,
|
drawerSlug,
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { SanitizedCollectionConfig } from 'payload/types'
|
import type { SanitizedCollectionConfig } from 'payload/types'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'
|
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import {
|
import {
|
||||||
@@ -15,7 +16,9 @@ import {
|
|||||||
useThumbnail,
|
useThumbnail,
|
||||||
useTranslation,
|
useTranslation,
|
||||||
} from '@payloadcms/ui'
|
} from '@payloadcms/ui'
|
||||||
import { $getNodeByKey } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getNodeByKey } = lexicalImport
|
||||||
|
|
||||||
import React, { useCallback, useReducer, useState } from 'react'
|
import React, { useCallback, useReducer, useState } from 'react'
|
||||||
|
|
||||||
import type { ClientComponentProps } from '../../types.js'
|
import type { ClientComponentProps } from '../../types.js'
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { LexicalCommand } from 'lexical'
|
import type { LexicalCommand } from 'lexical'
|
||||||
|
|
||||||
import { createCommand } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { createCommand } = lexicalImport
|
||||||
|
|
||||||
export const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{
|
export const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{
|
||||||
replace: { nodeKey: string } | false
|
replace: { nodeKey: string } | false
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { useListDrawer } from '@payloadcms/ui'
|
import { useListDrawer } from '@payloadcms/ui'
|
||||||
import { $getNodeByKey, COMMAND_PRIORITY_EDITOR, type LexicalEditor } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getNodeByKey, COMMAND_PRIORITY_EDITOR } = lexicalImport
|
||||||
|
|
||||||
|
import type { LexicalEditor } from 'lexical'
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useState } from 'react'
|
import React, { useCallback, useEffect, useState } from 'react'
|
||||||
|
|
||||||
import { EnabledRelationshipsCondition } from '../../relationship/utils/EnabledRelationshipsCondition.js'
|
import { EnabledRelationshipsCondition } from '../../relationship/utils/EnabledRelationshipsCondition.js'
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'
|
import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'
|
||||||
import type { ElementFormatType, NodeKey } from 'lexical'
|
import type { ElementFormatType, NodeKey } from 'lexical'
|
||||||
|
|
||||||
import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'
|
import lexicalDecoratorBlockNodeImport from '@lexical/react/LexicalDecoratorBlockNode.js'
|
||||||
import {
|
const { DecoratorBlockNode } = lexicalDecoratorBlockNodeImport
|
||||||
$applyNodeReplacement,
|
|
||||||
type DOMConversionMap,
|
import lexicalImport from 'lexical'
|
||||||
type DOMConversionOutput,
|
const { $applyNodeReplacement } = lexicalImport
|
||||||
type DOMExportOutput,
|
|
||||||
type LexicalNode,
|
import type {
|
||||||
type Spread,
|
DOMConversionMap,
|
||||||
|
DOMConversionOutput,
|
||||||
|
DOMExportOutput,
|
||||||
|
LexicalNode,
|
||||||
|
Spread,
|
||||||
} from 'lexical'
|
} from 'lexical'
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
const RawUploadComponent = React.lazy(() =>
|
const RawUploadComponent = React.lazy(() =>
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { $insertNodeToNearestRoot, mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
|
const { $insertNodeToNearestRoot, mergeRegister } = lexicalUtilsImport
|
||||||
import { useConfig } from '@payloadcms/ui'
|
import { useConfig } from '@payloadcms/ui'
|
||||||
import {
|
import lexicalImport from 'lexical'
|
||||||
|
const {
|
||||||
$getPreviousSelection,
|
$getPreviousSelection,
|
||||||
$getSelection,
|
$getSelection,
|
||||||
$isParagraphNode,
|
$isParagraphNode,
|
||||||
$isRangeSelection,
|
$isRangeSelection,
|
||||||
COMMAND_PRIORITY_EDITOR,
|
COMMAND_PRIORITY_EDITOR,
|
||||||
type LexicalCommand,
|
|
||||||
createCommand,
|
createCommand,
|
||||||
} from 'lexical'
|
} = lexicalImport
|
||||||
|
|
||||||
|
import type { LexicalCommand } from 'lexical'
|
||||||
|
|
||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
|
|
||||||
import type { RawUploadPayload } from '../nodes/UploadNode.js'
|
import type { RawUploadPayload } from '../nodes/UploadNode.js'
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
|
||||||
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js'
|
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js'
|
||||||
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin.js'
|
import lexicalHistoryPluginImport from '@lexical/react/LexicalHistoryPlugin.js'
|
||||||
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin.js'
|
const { HistoryPlugin } = lexicalHistoryPluginImport
|
||||||
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin.js'
|
|
||||||
import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin.js'
|
import lexicalOnChangePluginImport from '@lexical/react/LexicalOnChangePlugin.js'
|
||||||
|
const { OnChangePlugin } = lexicalOnChangePluginImport
|
||||||
|
|
||||||
|
import lexicalRichTextPluginImport from '@lexical/react/LexicalRichTextPlugin.js'
|
||||||
|
const { RichTextPlugin } = lexicalRichTextPluginImport
|
||||||
|
|
||||||
|
import lexicalTabIndentationPluginImport from '@lexical/react/LexicalTabIndentationPlugin.js'
|
||||||
|
const { TabIndentationPlugin } = lexicalTabIndentationPluginImport
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ import type { FormFieldBase } from '@payloadcms/ui'
|
|||||||
import type { EditorState, SerializedEditorState } from 'lexical'
|
import type { EditorState, SerializedEditorState } from 'lexical'
|
||||||
import type { LexicalEditor } from 'lexical'
|
import type { LexicalEditor } from 'lexical'
|
||||||
|
|
||||||
import { type InitialConfigType, LexicalComposer } from '@lexical/react/LexicalComposer.js'
|
import lexicalComposerImport from '@lexical/react/LexicalComposer.js'
|
||||||
|
const { LexicalComposer } = lexicalComposerImport
|
||||||
|
|
||||||
|
import type { InitialConfigType } from '@lexical/react/LexicalComposer.js'
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import type { SanitizedClientEditorConfig } from './config/types.js'
|
import type { SanitizedClientEditorConfig } from './config/types.js'
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { $getSelection } from 'lexical'
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
|
const { mergeRegister } = lexicalUtilsImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getSelection } = lexicalImport
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useState } from 'react'
|
import React, { useCallback, useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { FloatingToolbarSectionEntry } from '../types.js'
|
import type { FloatingToolbarSectionEntry } from '../types.js'
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import { $getSelection } from 'lexical'
|
|
||||||
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
|
const { mergeRegister } = lexicalUtilsImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getSelection } = lexicalImport
|
||||||
|
|
||||||
import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { createPortal } from 'react-dom'
|
import { createPortal } from 'react-dom'
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { LexicalEditor } from 'lexical'
|
import type { LexicalEditor } from 'lexical'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import {
|
|
||||||
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
|
const { mergeRegister } = lexicalUtilsImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const {
|
||||||
$getSelection,
|
$getSelection,
|
||||||
$isRangeSelection,
|
$isRangeSelection,
|
||||||
$isTextNode,
|
$isTextNode,
|
||||||
COMMAND_PRIORITY_LOW,
|
COMMAND_PRIORITY_LOW,
|
||||||
SELECTION_CHANGE_COMMAND,
|
SELECTION_CHANGE_COMMAND,
|
||||||
} from 'lexical'
|
} = lexicalImport
|
||||||
|
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { createPortal } from 'react-dom'
|
import { createPortal } from 'react-dom'
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { MarkdownShortcutPlugin as LexicalMarkdownShortcutPlugin } from '@lexical/react/LexicalMarkdownShortcutPlugin.js'
|
|
||||||
|
import lexicalMarkdownShortcutPluginImport from '@lexical/react/LexicalMarkdownShortcutPlugin.js'
|
||||||
|
const { MarkdownShortcutPlugin: LexicalMarkdownShortcutPlugin } =
|
||||||
|
lexicalMarkdownShortcutPluginImport
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'
|
import { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'
|
||||||
|
|||||||
@@ -2,9 +2,14 @@
|
|||||||
import type { LexicalCommand, LexicalEditor, TextNode } from 'lexical'
|
import type { LexicalCommand, LexicalEditor, TextNode } from 'lexical'
|
||||||
import type { MutableRefObject, ReactPortal } from 'react'
|
import type { MutableRefObject, ReactPortal } from 'react'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import {
|
|
||||||
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
|
const { mergeRegister } = lexicalUtilsImport
|
||||||
|
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const {
|
||||||
$getSelection,
|
$getSelection,
|
||||||
$isRangeSelection,
|
$isRangeSelection,
|
||||||
COMMAND_PRIORITY_LOW,
|
COMMAND_PRIORITY_LOW,
|
||||||
@@ -14,7 +19,8 @@ import {
|
|||||||
KEY_ESCAPE_COMMAND,
|
KEY_ESCAPE_COMMAND,
|
||||||
KEY_TAB_COMMAND,
|
KEY_TAB_COMMAND,
|
||||||
createCommand,
|
createCommand,
|
||||||
} from 'lexical'
|
} = lexicalImport
|
||||||
|
|
||||||
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
|
||||||
|
|
||||||
import type { MenuTextMatch } from '../useMenuTriggerMatch.js'
|
import type { MenuTextMatch } from '../useMenuTriggerMatch.js'
|
||||||
|
|||||||
@@ -7,15 +7,16 @@ import type {
|
|||||||
TextNode,
|
TextNode,
|
||||||
} from 'lexical'
|
} from 'lexical'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
import {
|
|
||||||
$getSelection,
|
import lexicalUtilsImport from '@lexical/utils'
|
||||||
$isRangeSelection,
|
const { mergeRegister } = lexicalUtilsImport
|
||||||
$isTextNode,
|
|
||||||
COMMAND_PRIORITY_LOW,
|
import lexicalImport from 'lexical'
|
||||||
createCommand,
|
const { $getSelection, $isRangeSelection, $isTextNode, COMMAND_PRIORITY_LOW, createCommand } =
|
||||||
} from 'lexical'
|
lexicalImport
|
||||||
|
|
||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { TextNode } from 'lexical'
|
import type { TextNode } from 'lexical'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
|
||||||
import { useTranslation } from '@payloadcms/ui'
|
import { useTranslation } from '@payloadcms/ui'
|
||||||
import { useCallback, useMemo, useState } from 'react'
|
import { useCallback, useMemo, useState } from 'react'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { ParagraphNode } from 'lexical'
|
import type { LexicalEditor, LexicalNode, ParagraphNode } from 'lexical'
|
||||||
|
|
||||||
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
import lexicalImport from 'lexical'
|
||||||
|
const { $createParagraphNode, $getNodeByKey } = lexicalImport
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
|
||||||
import { $createParagraphNode } from 'lexical'
|
|
||||||
import { $getNodeByKey, type LexicalEditor, type LexicalNode } from 'lexical'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import { createPortal } from 'react-dom'
|
import { createPortal } from 'react-dom'
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { LexicalEditor, LexicalNode } from 'lexical'
|
import type { LexicalEditor, LexicalNode } from 'lexical'
|
||||||
|
|
||||||
import { $getNodeByKey } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getNodeByKey } = lexicalImport
|
||||||
|
|
||||||
import { Point } from '../../../utils/point.js'
|
import { Point } from '../../../utils/point.js'
|
||||||
import { Rect } from '../../../utils/rect.js'
|
import { Rect } from '../../../utils/rect.js'
|
||||||
|
|||||||
@@ -2,9 +2,12 @@
|
|||||||
import type { LexicalEditor } from 'lexical'
|
import type { LexicalEditor } from 'lexical'
|
||||||
import type { DragEvent as ReactDragEvent } from 'react'
|
import type { DragEvent as ReactDragEvent } from 'react'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
const { useLexicalComposerContext } = lexicalComposerContextImport
|
||||||
|
|
||||||
import { eventFiles } from '@lexical/rich-text'
|
import { eventFiles } from '@lexical/rich-text'
|
||||||
import { $getNearestNodeFromDOMNode, $getNodeByKey } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getNearestNodeFromDOMNode, $getNodeByKey } = lexicalImport
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import { createPortal } from 'react-dom'
|
import { createPortal } from 'react-dom'
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { LexicalEditor } from 'lexical'
|
import type { LexicalEditor } from 'lexical'
|
||||||
|
|
||||||
import { $getRoot } from 'lexical'
|
import lexicalImport from 'lexical'
|
||||||
|
const { $getRoot } = lexicalImport
|
||||||
|
|
||||||
export function getTopLevelNodeKeys(editor: LexicalEditor): string[] {
|
export function getTopLevelNodeKeys(editor: LexicalEditor): string[] {
|
||||||
return editor.getEditorState().read(() => $getRoot().getChildrenKeys())
|
return editor.getEditorState().read(() => $getRoot().getChildrenKeys())
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { ContentEditable } from '@lexical/react/LexicalContentEditable.js'
|
import lexicalContentEditableImport from '@lexical/react/LexicalContentEditable.js'
|
||||||
|
const { ContentEditable } = lexicalContentEditableImport
|
||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import './ContentEditable.scss'
|
import './ContentEditable.scss'
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ export function cloneDeep<T>(object: T, cache: WeakMap<any, any> = new WeakMap()
|
|||||||
|
|
||||||
// Handle Array and Object
|
// Handle Array and Object
|
||||||
if (typeof object === 'object' && object !== null) {
|
if (typeof object === 'object' && object !== null) {
|
||||||
|
if ('$$typeof' in object && typeof object.$$typeof === 'symbol') {
|
||||||
|
return object
|
||||||
|
}
|
||||||
|
|
||||||
const clonedObject: any = Array.isArray(object)
|
const clonedObject: any = Array.isArray(object)
|
||||||
? []
|
? []
|
||||||
: Object.create(Object.getPrototypeOf(object))
|
: Object.create(Object.getPrototypeOf(object))
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { $isAtNodeEnd } from '@lexical/selection'
|
import lexicalSelectionImport from '@lexical/selection'
|
||||||
import { type ElementNode, type RangeSelection, type TextNode } from 'lexical'
|
const { $isAtNodeEnd } = lexicalSelectionImport
|
||||||
|
|
||||||
|
import type { ElementNode, RangeSelection, TextNode } from 'lexical'
|
||||||
|
|
||||||
export function getSelectedNode(selection: RangeSelection): ElementNode | TextNode {
|
export function getSelectedNode(selection: RangeSelection): ElementNode | TextNode {
|
||||||
const { anchor } = selection
|
const { anchor } = selection
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/richtext-slate",
|
"name": "@payloadcms/richtext-slate",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"description": "The officially supported Slate richtext adapter for Payload",
|
"description": "The officially supported Slate richtext adapter for Payload",
|
||||||
"repository": "https://github.com/payloadcms/payload",
|
"repository": "https://github.com/payloadcms/payload",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import type { FormState } from 'payload/types'
|
import type { FormState } from 'payload/types'
|
||||||
|
|
||||||
import { useModal } from '@faceless-ui/modal'
|
import * as facelessUIImport from '@faceless-ui/modal'
|
||||||
import {
|
import {
|
||||||
getFormState,
|
getFormState,
|
||||||
reduceFieldsToValues,
|
reduceFieldsToValues,
|
||||||
@@ -63,6 +63,8 @@ const insertLink = (editor, fields) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const LinkButton: React.FC = () => {
|
export const LinkButton: React.FC = () => {
|
||||||
|
const { useModal } = facelessUIImport
|
||||||
|
|
||||||
const { fieldProps } = useElementButton()
|
const { fieldProps } = useElementButton()
|
||||||
const [initialState, setInitialState] = useState<FormState>({})
|
const [initialState, setInitialState] = useState<FormState>({})
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import type { FormState } from 'payload/types'
|
import type { FormState } from 'payload/types'
|
||||||
|
|
||||||
import { useModal } from '@faceless-ui/modal'
|
import * as facelessUIImport from '@faceless-ui/modal'
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -60,6 +60,7 @@ const insertChange = (editor, fields) => {
|
|||||||
export const LinkElement = () => {
|
export const LinkElement = () => {
|
||||||
const { attributes, children, editorRef, element, fieldProps, schemaPath } =
|
const { attributes, children, editorRef, element, fieldProps, schemaPath } =
|
||||||
useElement<LinkElementType>()
|
useElement<LinkElementType>()
|
||||||
|
const { useModal } = facelessUIImport
|
||||||
|
|
||||||
const fieldMapPath = `${schemaPath}.${linkFieldsSchemaPath}`
|
const fieldMapPath = `${schemaPath}.${linkFieldsSchemaPath}`
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import type { FormFieldBase } from '@payloadcms/ui/types'
|
import type { FormFieldBase } from '@payloadcms/ui/types'
|
||||||
import type { SanitizedCollectionConfig } from 'payload/types'
|
import type { SanitizedCollectionConfig } from 'payload/types'
|
||||||
|
|
||||||
import { useModal } from '@faceless-ui/modal'
|
import * as facelessUIImport from '@faceless-ui/modal'
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import {
|
import {
|
||||||
Drawer,
|
Drawer,
|
||||||
@@ -37,6 +37,8 @@ export const UploadDrawer: React.FC<{
|
|||||||
relatedCollection: SanitizedCollectionConfig
|
relatedCollection: SanitizedCollectionConfig
|
||||||
schemaPath: string
|
schemaPath: string
|
||||||
}> = (props) => {
|
}> = (props) => {
|
||||||
|
const { useModal } = facelessUIImport
|
||||||
|
|
||||||
const editor = useSlateStatic()
|
const editor = useSlateStatic()
|
||||||
|
|
||||||
const { drawerSlug, element, fieldProps, relatedCollection, schemaPath } = props
|
const { drawerSlug, element, fieldProps, relatedCollection, schemaPath } = props
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@payloadcms/translations",
|
"name": "@payloadcms/translations",
|
||||||
"version": "3.0.0-alpha.31",
|
"version": "3.0.0-alpha.34",
|
||||||
"main": "./dist/exports/index.ts",
|
"main": "./dist/exports/index.ts",
|
||||||
"types": "./dist/types.d.ts",
|
"types": "./dist/types.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -210,7 +210,7 @@
|
|||||||
"near": "nabij"
|
"near": "nabij"
|
||||||
},
|
},
|
||||||
"upload": {
|
"upload": {
|
||||||
"crop": "Gewas",
|
"crop": "Bijsnijden",
|
||||||
"cropToolDescription": "Sleep de hoeken van het geselecteerde gebied, teken een nieuw gebied of pas de waarden hieronder aan.",
|
"cropToolDescription": "Sleep de hoeken van het geselecteerde gebied, teken een nieuw gebied of pas de waarden hieronder aan.",
|
||||||
"dragAndDrop": "Sleep een bestand",
|
"dragAndDrop": "Sleep een bestand",
|
||||||
"editImage": "Afbeelding bewerken",
|
"editImage": "Afbeelding bewerken",
|
||||||
@@ -220,7 +220,7 @@
|
|||||||
"previewSizes": "Voorbeeldgroottes",
|
"previewSizes": "Voorbeeldgroottes",
|
||||||
"selectCollectionToBrowse": "Selecteer een collectie om door te bladeren",
|
"selectCollectionToBrowse": "Selecteer een collectie om door te bladeren",
|
||||||
"selectFile": "Selecteer een bestand",
|
"selectFile": "Selecteer een bestand",
|
||||||
"setCropArea": "Stel oogstgebied in",
|
"setCropArea": "Stel bijsnijdgebied in",
|
||||||
"setFocalPoint": "Stel het brandpunt in",
|
"setFocalPoint": "Stel het brandpunt in",
|
||||||
"sizesFor": "Maten voor {{label}}",
|
"sizesFor": "Maten voor {{label}}",
|
||||||
"width": "Breedte"
|
"width": "Breedte"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user