@frogbotai/richtext-lexical 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { type BlocksFeatureProps as UpstreamBlocksFeatureProps, type LexicalBlockClientProps as PayloadLexicalBlockClientProps, type LexicalBlockLabelClientProps as PayloadLexicalBlockLabelClientProps, type LexicalBlockLabelServerProps as PayloadLexicalBlockLabelServerProps, type LexicalBlockServerProps as PayloadLexicalBlockServerProps, type LexicalInlineBlockClientProps as PayloadLexicalInlineBlockClientProps, type LexicalInlineBlockLabelClientProps as PayloadLexicalInlineBlockLabelClientProps, type LexicalInlineBlockLabelServerProps as PayloadLexicalInlineBlockLabelServerProps, type LexicalInlineBlockServerProps as PayloadLexicalInlineBlockServerProps } from '@payloadcms/richtext-lexical';
2
- import type { Field, FrogbotRequest } from 'frogbot';
2
+ import type { Field, FrogBotRequest } from 'frogbot';
3
3
  import type { Block, BlockSlug } from 'payload';
4
4
  type BlockInput = Omit<Block, 'fields'> & {
5
5
  fields: Field[];
@@ -14,16 +14,16 @@ export type LexicalBlockLabelClientProps = PayloadLexicalBlockLabelClientProps;
14
14
  export type LexicalInlineBlockClientProps = PayloadLexicalInlineBlockClientProps;
15
15
  export type LexicalInlineBlockLabelClientProps = PayloadLexicalInlineBlockLabelClientProps;
16
16
  export type LexicalBlockServerProps = Omit<PayloadLexicalBlockServerProps, 'payload' | 'req'> & {
17
- req: FrogbotRequest;
17
+ req: FrogBotRequest;
18
18
  };
19
19
  export type LexicalBlockLabelServerProps = Omit<PayloadLexicalBlockLabelServerProps, 'payload' | 'req'> & {
20
- req: FrogbotRequest;
20
+ req: FrogBotRequest;
21
21
  };
22
22
  export type LexicalInlineBlockServerProps = Omit<PayloadLexicalInlineBlockServerProps, 'payload' | 'req'> & {
23
- req: FrogbotRequest;
23
+ req: FrogBotRequest;
24
24
  };
25
25
  export type LexicalInlineBlockLabelServerProps = Omit<PayloadLexicalInlineBlockLabelServerProps, 'payload' | 'req'> & {
26
- req: FrogbotRequest;
26
+ req: FrogBotRequest;
27
27
  };
28
28
  export {};
29
29
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { convertLexicalToHTMLAsync } from '@payloadcms/richtext-lexical/html-async';
2
2
  import { resolveConfig } from '../../../../../utilities/resolveConfig.js';
3
- import { getFrogbotPopulateFn } from '../../../utilities/frogbotPopulateFn.js';
3
+ import { getFrogBotPopulateFn } from '../../../utilities/frogbotPopulateFn.js';
4
4
  export function lexicalHTMLField(args) {
5
5
  const { converters, hidden = true, htmlFieldName, lexicalFieldName, storeInDB = false } = args;
6
6
  const afterRead = async ({ currentDepth, depth, draft, overrideAccess, req, showHiddenFields, siblingData, }) => {
@@ -8,7 +8,7 @@ export function lexicalHTMLField(args) {
8
8
  if (!data)
9
9
  return '';
10
10
  const resolvedDepth = depth ?? (await resolveConfig(req.frogbot.config)).defaultDepth;
11
- const populate = await getFrogbotPopulateFn({
11
+ const populate = await getFrogBotPopulateFn({
12
12
  currentDepth: currentDepth ?? 0,
13
13
  depth: resolvedDepth,
14
14
  draft: draft ?? false,
@@ -1,14 +1,14 @@
1
1
  import { getPayloadPopulateFn } from '@payloadcms/richtext-lexical';
2
- import type { Frogbot, FrogbotRequest } from 'frogbot';
2
+ import type { FrogBot, FrogBotRequest } from 'frogbot';
3
3
  type PopulateFn = Awaited<ReturnType<typeof getPayloadPopulateFn>>;
4
4
  type CommonArgs = Omit<Parameters<typeof getPayloadPopulateFn>[0], 'payload' | 'req'>;
5
5
  type Args = CommonArgs & ({
6
- frogbot: Frogbot;
6
+ frogbot: FrogBot;
7
7
  req?: never;
8
8
  } | {
9
9
  frogbot?: never;
10
- req: FrogbotRequest;
10
+ req: FrogBotRequest;
11
11
  });
12
- export declare function getFrogbotPopulateFn(args: Args): Promise<PopulateFn>;
12
+ export declare function getFrogBotPopulateFn(args: Args): Promise<PopulateFn>;
13
13
  export {};
14
14
  //# sourceMappingURL=frogbotPopulateFn.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import { getPayloadPopulateFn } from '@payloadcms/richtext-lexical';
2
- export async function getFrogbotPopulateFn(args) {
3
- const hasFrogbot = args.frogbot !== undefined;
2
+ export async function getFrogBotPopulateFn(args) {
3
+ const hasFrogBot = args.frogbot !== undefined;
4
4
  const hasRequest = args.req !== undefined;
5
- if (hasFrogbot === hasRequest) {
5
+ if (hasFrogBot === hasRequest) {
6
6
  throw new Error('FrogBot rich text population requires exactly one of frogbot or req.');
7
7
  }
8
8
  const req = args.req ??
@@ -1,11 +1,11 @@
1
1
  import type { AfterChangeNodeHook as PayloadAfterChangeNodeHook, AfterReadNodeHook as PayloadAfterReadNodeHook, BeforeChangeNodeHook as PayloadBeforeChangeNodeHook, BeforeValidateNodeHook as PayloadBeforeValidateNodeHook, FeatureProviderProviderServer, FeatureProviderServer, HTMLConverter as PayloadHTMLConverter, NodeValidation as PayloadNodeValidation, PopulationPromise as PayloadPopulationPromise, ResolvedServerFeatureMap, ServerFeature as PayloadServerFeature, ServerFeatureProviderMap } from '@payloadcms/richtext-lexical';
2
2
  import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedLexicalNode } from '@payloadcms/richtext-lexical/lexical';
3
- import type { Field, FrogbotRequest } from 'frogbot';
3
+ import type { Field, FrogBotRequest } from 'frogbot';
4
4
  import type { JsonObject } from 'payload';
5
5
  export type ExtractSerializedNode<TNode extends LexicalNode> = ReturnType<TNode['exportJSON']>;
6
6
  type WithNode<TArgs, TNode extends SerializedLexicalNode> = Omit<TArgs, 'node' | 'req'> & {
7
7
  node: TNode;
8
- req: FrogbotRequest;
8
+ req: FrogBotRequest;
9
9
  };
10
10
  type NodeHook<THook, TNode extends SerializedLexicalNode> = (args: WithNode<Parameters<Extract<THook, (args: never) => unknown>>[0], TNode>) => ReturnType<Extract<THook, (args: never) => unknown>>;
11
11
  export type PopulationPromise<TNode extends SerializedLexicalNode = SerializedLexicalNode> = (args: WithNode<Parameters<PayloadPopulationPromise<TNode>>[0], TNode>) => void;
@@ -15,7 +15,7 @@ export type NodeValidation<TNode extends SerializedLexicalNode = SerializedLexic
15
15
  export type HTMLConverter<TNode extends SerializedLexicalNode = SerializedLexicalNode> = Omit<PayloadHTMLConverter<TNode>, 'converter'> & {
16
16
  converter: (args: Omit<Parameters<PayloadHTMLConverter<TNode>['converter']>[0], 'node' | 'req'> & {
17
17
  node: TNode;
18
- req: FrogbotRequest | null | undefined;
18
+ req: FrogBotRequest | null | undefined;
19
19
  }) => ReturnType<PayloadHTMLConverter<TNode>['converter']>;
20
20
  };
21
21
  export type NodeWithHooks<TNode extends LexicalNode = LexicalNode, TSerializedNode extends SerializedLexicalNode = ExtractSerializedNode<TNode>> = {
@@ -24,11 +24,11 @@ export type NodeWithHooks<TNode extends LexicalNode = LexicalNode, TSerializedNo
24
24
  };
25
25
  getSubFields?: (args: {
26
26
  node?: TSerializedNode;
27
- req?: FrogbotRequest;
27
+ req?: FrogBotRequest;
28
28
  }) => Field[] | null;
29
29
  getSubFieldsData?: (args: {
30
30
  node: TSerializedNode;
31
- req: FrogbotRequest;
31
+ req: FrogBotRequest;
32
32
  }) => JsonObject;
33
33
  graphQLPopulationPromises?: PopulationPromise<TSerializedNode>[];
34
34
  hooks?: {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CodeBlock, type CodeBlockArgs } from './features/blocks/premade/CodeBlock/index.js';
2
2
  export { BlocksFeature, type BlocksFeatureProps, type LexicalBlockClientProps, type LexicalBlockLabelClientProps, type LexicalBlockLabelServerProps, type LexicalBlockServerProps, type LexicalInlineBlockClientProps, type LexicalInlineBlockLabelClientProps, type LexicalInlineBlockLabelServerProps, type LexicalInlineBlockServerProps, } from './features/blocks/server/index.js';
3
3
  export { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js';
4
- export { getFrogbotPopulateFn } from './features/converters/utilities/frogbotPopulateFn.js';
4
+ export { getFrogBotPopulateFn } from './features/converters/utilities/frogbotPopulateFn.js';
5
5
  export type { ExtractSerializedNode, HTMLConverter, NodeValidation, NodeWithHooks, PopulationPromise, ServerFeature, } from './features/typesServer.js';
6
6
  export { createNode } from './features/typeUtilities.js';
7
7
  export { createServerFeature, type CreateServerFeatureArgs, } from './utilities/createServerFeature.js';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CodeBlock } from './features/blocks/premade/CodeBlock/index.js';
2
2
  export { BlocksFeature, } from './features/blocks/server/index.js';
3
3
  export { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js';
4
- export { getFrogbotPopulateFn } from './features/converters/utilities/frogbotPopulateFn.js';
4
+ export { getFrogBotPopulateFn } from './features/converters/utilities/frogbotPopulateFn.js';
5
5
  export { createNode } from './features/typeUtilities.js';
6
6
  export { createServerFeature, } from './utilities/createServerFeature.js';
7
7
  export { editorConfigFactory } from './utilities/editorConfigFactory.js';
@@ -1,5 +1,5 @@
1
- import type { FrogbotSanitizedConfig } from 'frogbot';
1
+ import type { FrogBotSanitizedConfig } from 'frogbot';
2
2
  import type { SanitizedConfig } from 'payload';
3
- export type ConfigInput = FrogbotSanitizedConfig | Promise<FrogbotSanitizedConfig>;
3
+ export type ConfigInput = FrogBotSanitizedConfig | Promise<FrogBotSanitizedConfig>;
4
4
  export declare function resolveConfig(config: ConfigInput): Promise<SanitizedConfig>;
5
5
  //# sourceMappingURL=resolveConfig.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frogbotai/richtext-lexical",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "FrogBot Lexical rich text adapter.",
5
5
  "license": "MIT",
6
6
  "author": "Colby Gilbert",
@@ -104,17 +104,17 @@
104
104
  "peerDependencies": {
105
105
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
106
106
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
107
- "frogbot": "0.25.0"
107
+ "frogbot": "0.27.0"
108
108
  },
109
109
  "devDependencies": {
110
110
  "typescript": "5.6.2",
111
- "frogbot": "0.25.0"
111
+ "frogbot": "0.27.0"
112
112
  },
113
113
  "publishConfig": {
114
114
  "access": "public"
115
115
  },
116
116
  "scripts": {
117
- "build": "tsc -p tsconfig.json",
117
+ "build": "rm -rf dist && tsc -p tsconfig.json",
118
118
  "clean": "rm -rf dist",
119
119
  "typecheck": "tsc --noEmit && tsc --noEmit -p ../../test/types/rich-text/tsconfig.json"
120
120
  }