@payloadcms/richtext-lexical 3.0.0-beta.57 → 3.0.0-beta.58

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.
Files changed (52) hide show
  1. package/dist/exports/client/Field-5TCNFYE2.js +2 -0
  2. package/dist/exports/client/Field-5TCNFYE2.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/index.d.ts +1 -0
  5. package/dist/exports/client/index.d.ts.map +1 -1
  6. package/dist/exports/client/index.js +7 -7
  7. package/dist/exports/client/index.js.map +4 -4
  8. package/dist/features/experimental_table/feature.client.d.ts +2 -0
  9. package/dist/features/experimental_table/feature.client.d.ts.map +1 -0
  10. package/dist/features/experimental_table/feature.client.js +66 -0
  11. package/dist/features/experimental_table/feature.client.js.map +1 -0
  12. package/dist/features/experimental_table/feature.server.d.ts +2 -0
  13. package/dist/features/experimental_table/feature.server.d.ts.map +1 -0
  14. package/dist/features/experimental_table/feature.server.js +52 -0
  15. package/dist/features/experimental_table/feature.server.js.map +1 -0
  16. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts +4 -0
  17. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  18. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js +602 -0
  19. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js.map +1 -0
  20. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts +4 -0
  21. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  22. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js +322 -0
  23. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js.map +1 -0
  24. package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts +24 -0
  25. package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts.map +1 -0
  26. package/dist/features/experimental_table/plugins/TablePlugin/index.js +99 -0
  27. package/dist/features/experimental_table/plugins/TablePlugin/index.js.map +1 -0
  28. package/dist/features/typesClient.d.ts +5 -1
  29. package/dist/features/typesClient.d.ts.map +1 -1
  30. package/dist/features/typesClient.js.map +1 -1
  31. package/dist/field/index.js +8 -8
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +1 -0
  35. package/dist/index.js.map +1 -1
  36. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  37. package/dist/lexical/LexicalProvider.js +24 -4
  38. package/dist/lexical/LexicalProvider.js.map +1 -1
  39. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  40. package/dist/lexical/config/client/sanitize.js +4 -0
  41. package/dist/lexical/config/client/sanitize.js.map +1 -1
  42. package/dist/lexical/ui/icons/Meatballs/index.d.ts +3 -0
  43. package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -0
  44. package/dist/lexical/ui/icons/Meatballs/index.js +25 -0
  45. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -0
  46. package/dist/lexical/ui/icons/Table/index.d.ts +3 -0
  47. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -0
  48. package/dist/lexical/ui/icons/Table/index.js +19 -0
  49. package/dist/lexical/ui/icons/Table/index.js.map +1 -0
  50. package/package.json +10 -9
  51. package/dist/exports/client/Field-XBUN6QOM.js +0 -2
  52. package/dist/exports/client/Field-XBUN6QOM.js.map +0 -7
@@ -0,0 +1,2 @@
1
+ export declare const TableFeatureClient: import("react").FC<any>;
2
+ //# sourceMappingURL=feature.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../src/features/experimental_table/feature.client.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,kBAAkB,yBA8C7B,CAAA"}
@@ -0,0 +1,66 @@
1
+ 'use client';
2
+ import { TableCellNode, TableNode, TableRowNode } from '@lexical/table';
3
+ import { TableIcon } from '../../lexical/ui/icons/Table/index.js';
4
+ import { createClientFeature } from '../../utilities/createClientFeature.js';
5
+ import { slashMenuBasicGroupWithItems } from '../shared/slashMenu/basicGroup.js';
6
+ import { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js';
7
+ import { TableActionMenuPlugin } from './plugins/TableActionMenuPlugin/index.js';
8
+ import { TableCellResizerPlugin } from './plugins/TableCellResizerPlugin/index.js';
9
+ import { OPEN_TABLE_DRAWER_COMMAND, TableContext, TablePlugin } from './plugins/TablePlugin/index.js';
10
+ export const TableFeatureClient = createClientFeature({
11
+ nodes: [
12
+ TableNode,
13
+ TableCellNode,
14
+ TableRowNode
15
+ ],
16
+ plugins: [
17
+ {
18
+ Component: TablePlugin,
19
+ position: 'normal'
20
+ },
21
+ {
22
+ Component: TableCellResizerPlugin,
23
+ position: 'normal'
24
+ },
25
+ {
26
+ Component: TableActionMenuPlugin,
27
+ position: 'floatingAnchorElem'
28
+ }
29
+ ],
30
+ providers: [
31
+ TableContext
32
+ ],
33
+ slashMenu: {
34
+ groups: [
35
+ slashMenuBasicGroupWithItems([
36
+ {
37
+ Icon: TableIcon,
38
+ key: 'table',
39
+ keywords: [
40
+ 'table'
41
+ ],
42
+ label: 'Table',
43
+ onSelect: ({ editor })=>{
44
+ editor.dispatchCommand(OPEN_TABLE_DRAWER_COMMAND, {});
45
+ }
46
+ }
47
+ ])
48
+ ]
49
+ },
50
+ toolbarFixed: {
51
+ groups: [
52
+ toolbarAddDropdownGroupWithItems([
53
+ {
54
+ ChildComponent: TableIcon,
55
+ key: 'table',
56
+ label: 'Table',
57
+ onSelect: ({ editor })=>{
58
+ editor.dispatchCommand(OPEN_TABLE_DRAWER_COMMAND, {});
59
+ }
60
+ }
61
+ ])
62
+ ]
63
+ }
64
+ });
65
+
66
+ //# sourceMappingURL=feature.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/features/experimental_table/feature.client.ts"],"sourcesContent":["'use client'\n\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table'\n\nimport { TableIcon } from '../../lexical/ui/icons/Table/index.js'\nimport { createClientFeature } from '../../utilities/createClientFeature.js'\nimport { slashMenuBasicGroupWithItems } from '../shared/slashMenu/basicGroup.js'\nimport { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js'\nimport { TableActionMenuPlugin } from './plugins/TableActionMenuPlugin/index.js'\nimport { TableCellResizerPlugin } from './plugins/TableCellResizerPlugin/index.js'\nimport {\n OPEN_TABLE_DRAWER_COMMAND,\n TableContext,\n TablePlugin,\n} from './plugins/TablePlugin/index.js'\n\nexport const TableFeatureClient = createClientFeature({\n nodes: [TableNode, TableCellNode, TableRowNode],\n plugins: [\n {\n Component: TablePlugin,\n position: 'normal',\n },\n {\n Component: TableCellResizerPlugin,\n position: 'normal',\n },\n {\n Component: TableActionMenuPlugin,\n position: 'floatingAnchorElem',\n },\n ],\n providers: [TableContext],\n slashMenu: {\n groups: [\n slashMenuBasicGroupWithItems([\n {\n Icon: TableIcon,\n key: 'table',\n keywords: ['table'],\n label: 'Table',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OPEN_TABLE_DRAWER_COMMAND, {})\n },\n },\n ]),\n ],\n },\n toolbarFixed: {\n groups: [\n toolbarAddDropdownGroupWithItems([\n {\n ChildComponent: TableIcon,\n key: 'table',\n label: 'Table',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OPEN_TABLE_DRAWER_COMMAND, {})\n },\n },\n ]),\n ],\n },\n})\n"],"names":["TableCellNode","TableNode","TableRowNode","TableIcon","createClientFeature","slashMenuBasicGroupWithItems","toolbarAddDropdownGroupWithItems","TableActionMenuPlugin","TableCellResizerPlugin","OPEN_TABLE_DRAWER_COMMAND","TableContext","TablePlugin","TableFeatureClient","nodes","plugins","Component","position","providers","slashMenu","groups","Icon","key","keywords","label","onSelect","editor","dispatchCommand","toolbarFixed","ChildComponent"],"mappings":"AAAA;AAEA,SAASA,aAAa,EAAEC,SAAS,EAAEC,YAAY,QAAQ,iBAAgB;AAEvE,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,4BAA4B,QAAQ,oCAAmC;AAChF,SAASC,gCAAgC,QAAQ,wCAAuC;AACxF,SAASC,qBAAqB,QAAQ,2CAA0C;AAChF,SAASC,sBAAsB,QAAQ,4CAA2C;AAClF,SACEC,yBAAyB,EACzBC,YAAY,EACZC,WAAW,QACN,iCAAgC;AAEvC,OAAO,MAAMC,qBAAqBR,oBAAoB;IACpDS,OAAO;QAACZ;QAAWD;QAAeE;KAAa;IAC/CY,SAAS;QACP;YACEC,WAAWJ;YACXK,UAAU;QACZ;QACA;YACED,WAAWP;YACXQ,UAAU;QACZ;QACA;YACED,WAAWR;YACXS,UAAU;QACZ;KACD;IACDC,WAAW;QAACP;KAAa;IACzBQ,WAAW;QACTC,QAAQ;YACNd,6BAA6B;gBAC3B;oBACEe,MAAMjB;oBACNkB,KAAK;oBACLC,UAAU;wBAAC;qBAAQ;oBACnBC,OAAO;oBACPC,UAAU,CAAC,EAAEC,MAAM,EAAE;wBACnBA,OAAOC,eAAe,CAACjB,2BAA2B,CAAC;oBACrD;gBACF;aACD;SACF;IACH;IACAkB,cAAc;QACZR,QAAQ;YACNb,iCAAiC;gBAC/B;oBACEsB,gBAAgBzB;oBAChBkB,KAAK;oBACLE,OAAO;oBACPC,UAAU,CAAC,EAAEC,MAAM,EAAE;wBACnBA,OAAOC,eAAe,CAACjB,2BAA2B,CAAC;oBACrD;gBACF;aACD;SACF;IACH;AACF,GAAE"}
@@ -0,0 +1,2 @@
1
+ export declare const EXPERIMENTAL_TableFeature: import("../typesServer.js").FeatureProviderProviderServer<undefined, undefined, any>;
2
+ //# sourceMappingURL=feature.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/experimental_table/feature.server.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,yBAAyB,sFAiCpC,CAAA"}
@@ -0,0 +1,52 @@
1
+ import { TableCellNode, TableNode, TableRowNode } from '@lexical/table';
2
+ import { sanitizeFields } from 'payload';
3
+ // eslint-disable-next-line payload/no-imports-from-exports-dir
4
+ import { TableFeatureClient } from '../../exports/client/index.js';
5
+ import { createServerFeature } from '../../utilities/createServerFeature.js';
6
+ const fields = [
7
+ {
8
+ name: 'rows',
9
+ type: 'number',
10
+ defaultValue: 5,
11
+ required: true
12
+ },
13
+ {
14
+ name: 'columns',
15
+ type: 'number',
16
+ defaultValue: 5,
17
+ required: true
18
+ }
19
+ ];
20
+ export const EXPERIMENTAL_TableFeature = createServerFeature({
21
+ feature: async ({ config, isRoot })=>{
22
+ const validRelationships = config.collections.map((c)=>c.slug) || [];
23
+ const sanitizedFields = await sanitizeFields({
24
+ config: config,
25
+ fields,
26
+ requireFieldLevelRichTextEditor: isRoot,
27
+ validRelationships
28
+ });
29
+ return {
30
+ ClientFeature: TableFeatureClient,
31
+ generateSchemaMap: ()=>{
32
+ const schemaMap = new Map();
33
+ schemaMap.set('fields', sanitizedFields);
34
+ return schemaMap;
35
+ },
36
+ nodes: [
37
+ {
38
+ node: TableNode
39
+ },
40
+ {
41
+ node: TableCellNode
42
+ },
43
+ {
44
+ node: TableRowNode
45
+ }
46
+ ]
47
+ };
48
+ },
49
+ key: 'experimental_table'
50
+ });
51
+
52
+ //# sourceMappingURL=feature.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/features/experimental_table/feature.server.ts"],"sourcesContent":["import type { Config, Field } from 'payload'\n\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table'\nimport { sanitizeFields } from 'payload'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { TableFeatureClient } from '../../exports/client/index.js'\nimport { createServerFeature } from '../../utilities/createServerFeature.js'\n\nconst fields: Field[] = [\n {\n name: 'rows',\n type: 'number',\n defaultValue: 5,\n required: true,\n },\n {\n name: 'columns',\n type: 'number',\n defaultValue: 5,\n required: true,\n },\n]\nexport const EXPERIMENTAL_TableFeature = createServerFeature({\n feature: async ({ config, isRoot }) => {\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n const sanitizedFields = await sanitizeFields({\n config: config as unknown as Config,\n fields,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n return {\n ClientFeature: TableFeatureClient,\n generateSchemaMap: () => {\n const schemaMap = new Map<string, Field[]>()\n\n schemaMap.set('fields', sanitizedFields)\n\n return schemaMap\n },\n nodes: [\n {\n node: TableNode,\n },\n {\n node: TableCellNode,\n },\n {\n node: TableRowNode,\n },\n ],\n }\n },\n key: 'experimental_table',\n})\n"],"names":["TableCellNode","TableNode","TableRowNode","sanitizeFields","TableFeatureClient","createServerFeature","fields","name","type","defaultValue","required","EXPERIMENTAL_TableFeature","feature","config","isRoot","validRelationships","collections","map","c","slug","sanitizedFields","requireFieldLevelRichTextEditor","ClientFeature","generateSchemaMap","schemaMap","Map","set","nodes","node","key"],"mappings":"AAEA,SAASA,aAAa,EAAEC,SAAS,EAAEC,YAAY,QAAQ,iBAAgB;AACvE,SAASC,cAAc,QAAQ,UAAS;AAExC,+DAA+D;AAC/D,SAASC,kBAAkB,QAAQ,gCAA+B;AAClE,SAASC,mBAAmB,QAAQ,yCAAwC;AAE5E,MAAMC,SAAkB;IACtB;QACEC,MAAM;QACNC,MAAM;QACNC,cAAc;QACdC,UAAU;IACZ;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,cAAc;QACdC,UAAU;IACZ;CACD;AACD,OAAO,MAAMC,4BAA4BN,oBAAoB;IAC3DO,SAAS,OAAO,EAAEC,MAAM,EAAEC,MAAM,EAAE;QAChC,MAAMC,qBAAqBF,OAAOG,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAK,EAAE;QAEtE,MAAMC,kBAAkB,MAAMjB,eAAe;YAC3CU,QAAQA;YACRP;YACAe,iCAAiCP;YACjCC;QACF;QACA,OAAO;YACLO,eAAelB;YACfmB,mBAAmB;gBACjB,MAAMC,YAAY,IAAIC;gBAEtBD,UAAUE,GAAG,CAAC,UAAUN;gBAExB,OAAOI;YACT;YACAG,OAAO;gBACL;oBACEC,MAAM3B;gBACR;gBACA;oBACE2B,MAAM5B;gBACR;gBACA;oBACE4B,MAAM1B;gBACR;aACD;QACH;IACF;IACA2B,KAAK;AACP,GAAE"}
@@ -0,0 +1,4 @@
1
+ import type { PluginComponentWithAnchor } from '../../../typesClient.js';
2
+ import './index.scss';
3
+ export declare const TableActionMenuPlugin: PluginComponentWithAnchor;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/experimental_table/plugins/TableActionMenuPlugin/index.tsx"],"names":[],"mappings":"AA4CA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAIxE,OAAO,cAAc,CAAA;AAkoBrB,eAAO,MAAM,qBAAqB,EAAE,yBAQnC,CAAA"}