@nexo-labs/payload-lexical-blocks-builder 1.6.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.
@@ -0,0 +1,3 @@
1
+ import { n as buildLexicalByFeatures, r as filterBlocksAtLexicalBuilder, t as LexicalBuilder } from "./builder-BhjgvNFy.mjs";
2
+ import "./LexicalDecoratorNode-C9hMKfgk.mjs";
3
+ export { LexicalBuilder, buildLexicalByFeatures, filterBlocksAtLexicalBuilder };
@@ -0,0 +1,15 @@
1
+ import { BlocksFeature, lexicalEditor } from "@payloadcms/richtext-lexical";
2
+
3
+ //#region src/builder.ts
4
+ function buildLexicalByFeatures(features) {
5
+ return (blocks) => lexicalEditor({ features: () => {
6
+ return [...features(), BlocksFeature({ blocks: blocks() })];
7
+ } });
8
+ }
9
+ function filterBlocksAtLexicalBuilder(builder, blocks, slugs) {
10
+ return builder(() => blocks().filter((block) => !slugs.includes(block.slug)));
11
+ }
12
+
13
+ //#endregion
14
+ export { buildLexicalByFeatures, filterBlocksAtLexicalBuilder };
15
+ //# sourceMappingURL=builder.mjs.map
@@ -0,0 +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"}
@@ -0,0 +1,4 @@
1
+ import { n as buildLexicalByFeatures, r as filterBlocksAtLexicalBuilder, t as LexicalBuilder } from "./builder-BhjgvNFy.mjs";
2
+ import "./LexicalDecoratorNode-C9hMKfgk.mjs";
3
+ import { a as LexicalBlockProps, i as GenericStory, n as BlocksRendererFunctions, o as StoryArgs, r as ExtendedSerializedEditorState, s as generateStoryForLexicalBlock, t as BlockRendererFunction } from "./renderer-Y62qi9KC.mjs";
4
+ export { BlockRendererFunction, BlocksRendererFunctions, ExtendedSerializedEditorState, GenericStory, LexicalBlockProps, LexicalBuilder, StoryArgs, buildLexicalByFeatures, filterBlocksAtLexicalBuilder, generateStoryForLexicalBlock };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };