@nexo-labs/payload-lexical-blocks-builder 1.9.0 → 1.9.1

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.
@@ -2,9 +2,9 @@ import { FeatureProviderServer } from "@payloadcms/richtext-lexical";
2
2
  import { Block, Config } from "payload";
3
3
 
4
4
  //#region src/builder.d.ts
5
- type LexicalBuilder = (blocks: () => Block[]) => Config["editor"];
6
- declare function buildLexicalByFeatures(features: () => FeatureProviderServer<any, any, any>[]): LexicalBuilder;
7
- declare function filterBlocksAtLexicalBuilder<T extends string>(builder: LexicalBuilder, blocks: () => Block[], slugs: T[]): Config["editor"];
5
+ type LexicalBuilder = (blocks: () => Block[]) => Config['editor'];
6
+ declare function buildLexicalByFeatures(features: () => FeatureProviderServer<unknown, unknown, unknown>[]): LexicalBuilder;
7
+ declare function filterBlocksAtLexicalBuilder<T extends string>(builder: LexicalBuilder, blocks: () => Block[], slugs: T[]): Config['editor'];
8
8
  //#endregion
9
9
  export { buildLexicalByFeatures as n, filterBlocksAtLexicalBuilder as r, LexicalBuilder as t };
10
- //# sourceMappingURL=builder-BtCeZMP4.d.mts.map
10
+ //# sourceMappingURL=builder-sbn4JP5M.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder-sbn4JP5M.d.mts","names":[],"sources":["../src/builder.ts"],"sourcesContent":[],"mappings":";;;;KAGY,cAAA,kBAAgC,YAAY;iBAExC,sBAAA,iBACE,qDACf;AAJS,iBAaI,4BAb8C,CAAA,UAAA,MAAA,CAAA,CAAA,OAAA,EAcnD,cAdmD,EAAA,MAAA,EAAA,GAAA,GAe9C,KAf8C,EAAA,EAAA,KAAA,EAgBrD,CAhBqD,EAAA,CAAA,EAiB3D,MAjB2D,CAAA,QAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import { n as buildLexicalByFeatures, r as filterBlocksAtLexicalBuilder, t as LexicalBuilder } from "./builder-BtCeZMP4.mjs";
1
+ import { n as buildLexicalByFeatures, r as filterBlocksAtLexicalBuilder, t as LexicalBuilder } from "./builder-sbn4JP5M.mjs";
2
2
  export { LexicalBuilder, buildLexicalByFeatures, filterBlocksAtLexicalBuilder };
@@ -1 +1 @@
1
- {"version":3,"file":"builder.mjs","names":[],"sources":["../src/builder.ts"],"sourcesContent":["import {\n BlocksFeature,\n FeatureProviderServer,\n lexicalEditor,\n} from \"@payloadcms/richtext-lexical\";\nimport { Block, Config } from \"payload\";\n\nexport type LexicalBuilder = (blocks: () => Block[]) => Config[\"editor\"];\n\nexport function buildLexicalByFeatures(\n features: () => FeatureProviderServer<any, any, any>[]\n): LexicalBuilder {\n return (blocks: () => Block[]) =>\n lexicalEditor({\n features: () => {\n return [...features(), BlocksFeature({ blocks: blocks() })];\n },\n });\n}\n\nexport function filterBlocksAtLexicalBuilder <T extends string>(builder: LexicalBuilder, blocks: () => Block[], slugs: T[]): Config[\"editor\"] {\n return builder(() => blocks().filter((block) => !slugs.includes(block.slug as T)))\n}\n"],"mappings":";;;AASA,SAAgB,uBACd,UACgB;AAChB,SAAQ,WACN,cAAc,EACZ,gBAAgB;AACd,SAAO,CAAC,GAAG,UAAU,EAAE,cAAc,EAAE,QAAQ,QAAQ,EAAE,CAAC,CAAC;IAE9D,CAAC;;AAGN,SAAgB,6BAAgD,SAAyB,QAAuB,OAA8B;AAC1I,QAAO,cAAc,QAAQ,CAAC,QAAQ,UAAU,CAAC,MAAM,SAAS,MAAM,KAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"builder.mjs","names":[],"sources":["../src/builder.ts"],"sourcesContent":["import { BlocksFeature, type FeatureProviderServer, lexicalEditor } from '@payloadcms/richtext-lexical'\nimport type { Block, Config } from 'payload'\n\nexport type LexicalBuilder = (blocks: () => Block[]) => Config['editor']\n\nexport function buildLexicalByFeatures(\n features: () => FeatureProviderServer<unknown, unknown, unknown>[]\n): LexicalBuilder {\n return (blocks: () => Block[]) =>\n lexicalEditor({\n features: () => {\n return [...features(), BlocksFeature({ blocks: blocks() })]\n }\n })\n}\n\nexport function filterBlocksAtLexicalBuilder<T extends string>(\n builder: LexicalBuilder,\n blocks: () => Block[],\n slugs: T[]\n): Config['editor'] {\n return builder(() => blocks().filter(block => !slugs.includes(block.slug as T)))\n}\n"],"mappings":";;;AAKA,SAAgB,uBACd,UACgB;AAChB,SAAQ,WACN,cAAc,EACZ,gBAAgB;AACd,SAAO,CAAC,GAAG,UAAU,EAAE,cAAc,EAAE,QAAQ,QAAQ,EAAE,CAAC,CAAC;IAE9D,CAAC;;AAGN,SAAgB,6BACd,SACA,QACA,OACkB;AAClB,QAAO,cAAc,QAAQ,CAAC,QAAO,UAAS,CAAC,MAAM,SAAS,MAAM,KAAU,CAAC,CAAC"}
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { n as buildLexicalByFeatures, r as filterBlocksAtLexicalBuilder, t as LexicalBuilder } from "./builder-BtCeZMP4.mjs";
2
- import { a as LexicalBlockProps, i as GenericStory, n as BlocksRendererFunctions, o as StoryArgs, r as ExtendedSerializedEditorState, s as generateStoryForLexicalBlock, t as BlockRendererFunction } from "./renderer-Cy_Emxec.mjs";
1
+ import { n as buildLexicalByFeatures, r as filterBlocksAtLexicalBuilder, t as LexicalBuilder } from "./builder-sbn4JP5M.mjs";
2
+ import { a as LexicalBlockProps, i as GenericStory, n as BlocksRendererFunctions, o as StoryArgs, r as ExtendedSerializedEditorState, s as generateStoryForLexicalBlock, t as BlockRendererFunction } from "./renderer-BosW1mYl.mjs";
3
3
  export { BlockRendererFunction, BlocksRendererFunctions, ExtendedSerializedEditorState, GenericStory, LexicalBlockProps, LexicalBuilder, StoryArgs, buildLexicalByFeatures, filterBlocksAtLexicalBuilder, generateStoryForLexicalBlock };
@@ -699,7 +699,7 @@ interface LexicalBlockProps<T$1> {
699
699
  }
700
700
  type BlockRendererFunction = ({
701
701
  node
702
- }: LexicalBlockProps<any>) => Promise<any> | any;
702
+ }: LexicalBlockProps<Record<string, unknown>>) => Promise<unknown> | unknown;
703
703
  type BlocksRendererFunctions<T$1 extends string> = Record<T$1, BlockRendererFunction>;
704
704
  interface GenericStory<P> {
705
705
  argTypes?: Partial<ArgTypes<{
@@ -709,7 +709,7 @@ interface GenericStory<P> {
709
709
  }>>;
710
710
  }
711
711
  type StoryArgs<T$1> = T$1 extends GenericStory<infer P> ? P : never;
712
- declare const generateStoryForLexicalBlock: <T$1 extends GenericStory<any>>(args: StoryArgs<T$1>) => {
712
+ declare const generateStoryForLexicalBlock: <T$1 extends GenericStory<unknown>>(args: StoryArgs<T$1>) => {
713
713
  args: LexicalBlockProps<StoryArgs<T$1>>;
714
714
  };
715
715
  type ExtendedSerializedEditorState = SerializedEditorState & {
@@ -717,4 +717,4 @@ type ExtendedSerializedEditorState = SerializedEditorState & {
717
717
  };
718
718
  //#endregion
719
719
  export { LexicalBlockProps as a, GenericStory as i, BlocksRendererFunctions as n, StoryArgs as o, ExtendedSerializedEditorState as r, generateStoryForLexicalBlock as s, BlockRendererFunction as t };
720
- //# sourceMappingURL=renderer-Cy_Emxec.d.mts.map
720
+ //# sourceMappingURL=renderer-BosW1mYl.d.mts.map