@payloadcms/richtext-lexical 3.71.0-internal.cbf546e → 3.71.0-internal.ef75fa0

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 (87) hide show
  1. package/dist/exports/client/Field-2A2VQXKP.js +2 -0
  2. package/dist/exports/client/Field-2A2VQXKP.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-AFXLIYGL.js +12 -0
  5. package/dist/exports/client/chunk-AFXLIYGL.js.map +7 -0
  6. package/dist/exports/client/index.d.ts +0 -1
  7. package/dist/exports/client/index.d.ts.map +1 -1
  8. package/dist/exports/client/index.js +20 -20
  9. package/dist/exports/client/index.js.map +3 -3
  10. package/dist/exports/react/index.d.ts +1 -1
  11. package/dist/exports/react/index.d.ts.map +1 -1
  12. package/dist/exports/react/index.js.map +1 -1
  13. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +14 -2
  14. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  15. package/dist/features/converters/lexicalToJSX/Component/index.js +2 -4
  16. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  17. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +1 -16
  18. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  19. package/dist/features/converters/lexicalToJSX/converter/index.js +4 -76
  20. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  21. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +10 -14
  22. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  23. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  24. package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -1
  25. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  26. package/dist/field/Field.d.ts.map +1 -1
  27. package/dist/field/Field.js +6 -11
  28. package/dist/field/Field.js.map +1 -1
  29. package/dist/field/bundled.css +1 -1
  30. package/dist/field/index.d.ts +0 -1
  31. package/dist/field/index.d.ts.map +1 -1
  32. package/dist/field/index.js +29 -47
  33. package/dist/field/index.js.map +1 -1
  34. package/dist/field/rscEntry.d.ts +1 -1
  35. package/dist/field/rscEntry.d.ts.map +1 -1
  36. package/dist/field/rscEntry.js +0 -12
  37. package/dist/field/rscEntry.js.map +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +1 -3
  41. package/dist/index.js.map +1 -1
  42. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  43. package/dist/lexical/LexicalEditor.js +1 -2
  44. package/dist/lexical/LexicalEditor.js.map +1 -1
  45. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  46. package/dist/lexical/LexicalProvider.js +3 -12
  47. package/dist/lexical/LexicalProvider.js.map +1 -1
  48. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  49. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  50. package/dist/lexical/config/client/sanitize.js +2 -3
  51. package/dist/lexical/config/client/sanitize.js.map +1 -1
  52. package/dist/lexical/config/types.d.ts +0 -4
  53. package/dist/lexical/config/types.d.ts.map +1 -1
  54. package/dist/lexical/config/types.js.map +1 -1
  55. package/dist/lexical/nodes/index.d.ts +2 -12
  56. package/dist/lexical/nodes/index.d.ts.map +1 -1
  57. package/dist/lexical/nodes/index.js +2 -195
  58. package/dist/lexical/nodes/index.js.map +1 -1
  59. package/dist/types.d.ts +2 -152
  60. package/dist/types.d.ts.map +1 -1
  61. package/dist/types.js.map +1 -1
  62. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  63. package/dist/utilities/generateImportMap.js +0 -1
  64. package/dist/utilities/generateImportMap.js.map +1 -1
  65. package/dist/validate/hasText.d.ts +1 -6
  66. package/dist/validate/hasText.d.ts.map +1 -1
  67. package/dist/validate/hasText.js +4 -10
  68. package/dist/validate/hasText.js.map +1 -1
  69. package/package.json +6 -11
  70. package/dist/exports/client/Field-YM44WOON.js +0 -2
  71. package/dist/exports/client/Field-YM44WOON.js.map +0 -7
  72. package/dist/exports/client/chunk-6NIGQP6A.js +0 -12
  73. package/dist/exports/client/chunk-6NIGQP6A.js.map +0 -7
  74. package/dist/exports/client/internal-client.d.ts +0 -3
  75. package/dist/exports/client/internal-client.d.ts.map +0 -1
  76. package/dist/field/RichTextViewProvider.d.ts +0 -83
  77. package/dist/field/RichTextViewProvider.d.ts.map +0 -1
  78. package/dist/field/RichTextViewProvider.js +0 -87
  79. package/dist/field/RichTextViewProvider.js.map +0 -1
  80. package/dist/field/ViewSelector.d.ts +0 -4
  81. package/dist/field/ViewSelector.d.ts.map +0 -1
  82. package/dist/field/ViewSelector.js +0 -89
  83. package/dist/field/ViewSelector.js.map +0 -1
  84. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts +0 -2
  85. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +0 -1
  86. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +0 -48
  87. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +0 -1
@@ -1,87 +0,0 @@
1
- 'use client';
2
-
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { useControllableState } from '@payloadcms/ui';
5
- import React, { createContext, use, useMemo } from 'react';
6
- const RichTextViewContext = /*#__PURE__*/createContext({
7
- currentView: 'default',
8
- inheritable: false,
9
- setCurrentView: () => {}
10
- });
11
- /**
12
- * Provider component for rich text view context.
13
- *
14
- * This provider manages the current view state internally and makes it accessible to child components
15
- * via the useRichTextView hook. It automatically resolves the current view's node map
16
- * based on the active view name.
17
- *
18
- * @example
19
- * ```tsx
20
- * <RichTextViewProvider
21
- * currentView="frontend"
22
- * views={myViews}
23
- * >
24
- * <MyEditor />
25
- * </RichTextViewProvider>
26
- * ```
27
- */
28
- export const RichTextViewProvider = args => {
29
- const parentContext = useRichTextView();
30
- const {
31
- children,
32
- currentView: currentViewFromProps,
33
- inheritable,
34
- views
35
- } = parentContext.inheritable ? {
36
- ...parentContext,
37
- ...args
38
- } : args;
39
- const [currentView, setCurrentView] = useControllableState(currentViewFromProps, 'default');
40
- const value = useMemo(() => {
41
- const currentViewMap = views ? views[currentView] || views.default : undefined;
42
- return {
43
- currentView,
44
- currentViewMap,
45
- inheritable,
46
- setCurrentView,
47
- views
48
- };
49
- }, [currentView, inheritable, setCurrentView, views]);
50
- return /*#__PURE__*/_jsx(RichTextViewContext, {
51
- value: value,
52
- children: children
53
- });
54
- };
55
- /**
56
- * Hook to access the current rich text view context.
57
- *
58
- * Use this hook to access the currently active view and its node map,
59
- * or to programmatically switch between views.
60
- *
61
- * @returns An object containing:
62
- * - `currentView`: The name of the active view
63
- * - `currentViewMap`: The node overrides for the current view
64
- * - `setCurrentView`: Function to change views
65
- * - `views`: All available views
66
- *
67
- * @example
68
- * ```tsx
69
- * function MyComponent() {
70
- * const { currentView, currentViewMap, setCurrentView } = useRichTextView()
71
- *
72
- * return (
73
- * <div>
74
- * <p>Current view: {currentView}</p>
75
- * {currentViewMap?.heading && <p>Heading overrides are active</p>}
76
- * <button onClick={() => setCurrentView('frontend')}>
77
- * Switch to frontend view
78
- * </button>
79
- * </div>
80
- * )
81
- * }
82
- * ```
83
- */
84
- export function useRichTextView() {
85
- return use(RichTextViewContext);
86
- }
87
- //# sourceMappingURL=RichTextViewProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RichTextViewProvider.js","names":["useControllableState","React","createContext","use","useMemo","RichTextViewContext","currentView","inheritable","setCurrentView","RichTextViewProvider","args","parentContext","useRichTextView","children","currentViewFromProps","views","value","currentViewMap","default","undefined","_jsx"],"sources":["../../src/field/RichTextViewProvider.tsx"],"sourcesContent":["'use client'\nimport { useControllableState } from '@payloadcms/ui'\nimport React, { createContext, use, useMemo } from 'react'\n\nimport type { LexicalEditorNodeMap, LexicalEditorViewMap } from '../types.js'\n\n/**\n * Context type for rich text view management.\n */\ntype RichTextViewContextType = {\n /**\n * The name of the currently active view (e.g., 'default', 'frontend', 'debug')\n */\n currentView: string\n /**\n * The node map for the currently active view, containing rendering overrides for each node type.\n * This is the resolved view from the views map based on currentView.\n */\n currentViewMap?: LexicalEditorNodeMap\n /**\n * If true, the current view will be inherited by nested richtext editors.\n */\n inheritable?: boolean\n /**\n * Function to change the current view.\n */\n setCurrentView: (view: string) => void\n /**\n * The complete map of all available views for this field.\n */\n views?: LexicalEditorViewMap\n}\n\nconst RichTextViewContext = createContext<RichTextViewContextType>({\n currentView: 'default',\n inheritable: false,\n setCurrentView: () => {},\n})\n\n/**\n * Provider component for rich text view context.\n *\n * This provider manages the current view state internally and makes it accessible to child components\n * via the useRichTextView hook. It automatically resolves the current view's node map\n * based on the active view name.\n *\n * @example\n * ```tsx\n * <RichTextViewProvider\n * currentView=\"frontend\"\n * views={myViews}\n * >\n * <MyEditor />\n * </RichTextViewProvider>\n * ```\n */\nexport const RichTextViewProvider: React.FC<{\n children: React.ReactNode\n currentView?: string\n inheritable?: boolean\n views?: LexicalEditorViewMap\n}> = (args) => {\n const parentContext = useRichTextView()\n\n const {\n children,\n currentView: currentViewFromProps,\n inheritable,\n views,\n } = parentContext.inheritable\n ? {\n ...parentContext,\n ...args,\n }\n : args\n\n const [currentView, setCurrentView] = useControllableState(currentViewFromProps, 'default')\n\n const value = useMemo(() => {\n const currentViewMap = views ? views[currentView] || views.default : undefined\n return {\n currentView,\n currentViewMap,\n inheritable,\n setCurrentView,\n views,\n }\n }, [currentView, inheritable, setCurrentView, views])\n\n return <RichTextViewContext value={value}>{children}</RichTextViewContext>\n}\n\n/**\n * Hook to access the current rich text view context.\n *\n * Use this hook to access the currently active view and its node map,\n * or to programmatically switch between views.\n *\n * @returns An object containing:\n * - `currentView`: The name of the active view\n * - `currentViewMap`: The node overrides for the current view\n * - `setCurrentView`: Function to change views\n * - `views`: All available views\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { currentView, currentViewMap, setCurrentView } = useRichTextView()\n *\n * return (\n * <div>\n * <p>Current view: {currentView}</p>\n * {currentViewMap?.heading && <p>Heading overrides are active</p>}\n * <button onClick={() => setCurrentView('frontend')}>\n * Switch to frontend view\n * </button>\n * </div>\n * )\n * }\n * ```\n */\nexport function useRichTextView(): RichTextViewContextType {\n return use(RichTextViewContext)\n}\n"],"mappings":"AAAA;;;AACA,SAASA,oBAAoB,QAAQ;AACrC,OAAOC,KAAA,IAASC,aAAa,EAAEC,GAAG,EAAEC,OAAO,QAAQ;AA+BnD,MAAMC,mBAAA,gBAAsBH,aAAA,CAAuC;EACjEI,WAAA,EAAa;EACbC,WAAA,EAAa;EACbC,cAAA,EAAgBA,CAAA,MAAO;AACzB;AAEA;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMC,oBAAA,GAKPC,IAAA;EACJ,MAAMC,aAAA,GAAgBC,eAAA;EAEtB,MAAM;IACJC,QAAQ;IACRP,WAAA,EAAaQ,oBAAoB;IACjCP,WAAW;IACXQ;EAAK,CACN,GAAGJ,aAAA,CAAcJ,WAAW,GACzB;IACE,GAAGI,aAAa;IAChB,GAAGD;EACL,IACAA,IAAA;EAEJ,MAAM,CAACJ,WAAA,EAAaE,cAAA,CAAe,GAAGR,oBAAA,CAAqBc,oBAAA,EAAsB;EAEjF,MAAME,KAAA,GAAQZ,OAAA,CAAQ;IACpB,MAAMa,cAAA,GAAiBF,KAAA,GAAQA,KAAK,CAACT,WAAA,CAAY,IAAIS,KAAA,CAAMG,OAAO,GAAGC,SAAA;IACrE,OAAO;MACLb,WAAA;MACAW,cAAA;MACAV,WAAA;MACAC,cAAA;MACAO;IACF;EACF,GAAG,CAACT,WAAA,EAAaC,WAAA,EAAaC,cAAA,EAAgBO,KAAA,CAAM;EAEpD,oBAAOK,IAAA,CAACf,mBAAA;IAAoBW,KAAA,EAAOA,KAAA;cAAQH;;AAC7C;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,OAAO,SAASD,gBAAA;EACd,OAAOT,GAAA,CAAIE,mBAAA;AACb","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './ViewSelector.scss';
3
- export declare function ViewSelector(): null | React.ReactElement;
4
- //# sourceMappingURL=ViewSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewSelector.d.ts","sourceRoot":"","sources":["../../src/field/ViewSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,qBAAqB,CAAA;AAE5B,wBAAgB,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY,CAyDxD"}
@@ -1,89 +0,0 @@
1
- 'use client';
2
-
3
- import { c as _c } from "react/compiler-runtime";
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- import { ChevronIcon, Popup, PopupList } from '@payloadcms/ui';
6
- import React from 'react';
7
- import { useRichTextView } from './RichTextViewProvider.js';
8
- export function ViewSelector() {
9
- const $ = _c(5);
10
- const {
11
- currentView,
12
- setCurrentView,
13
- views
14
- } = useRichTextView();
15
- if (!views || Object.keys(views).length === 0) {
16
- return null;
17
- }
18
- let t0;
19
- let t1;
20
- if ($[0] !== currentView || $[1] !== setCurrentView || $[2] !== views) {
21
- t1 = Symbol.for("react.early_return_sentinel");
22
- bb0: {
23
- const viewKeys = Object.keys(views);
24
- const hasNonDefaultViews = viewKeys.some(_temp);
25
- if (!hasNonDefaultViews) {
26
- t1 = null;
27
- break bb0;
28
- }
29
- const allViews = ["default", ...viewKeys.filter(_temp2)];
30
- const currentViewLabel = currentView.charAt(0).toUpperCase() + currentView.slice(1);
31
- t0 = _jsx("div", {
32
- className: "lexical-view-selector",
33
- children: _jsx(Popup, {
34
- button: _jsxs("button", {
35
- className: "lexical-view-selector__button",
36
- type: "button",
37
- children: [_jsx("span", {
38
- className: "lexical-view-selector__label",
39
- children: currentViewLabel
40
- }), _jsx(ChevronIcon, {
41
- className: "lexical-view-selector__icon"
42
- })]
43
- }),
44
- buttonType: "custom",
45
- horizontalAlign: "left",
46
- render: t2 => {
47
- const {
48
- close
49
- } = t2;
50
- return _jsx(PopupList.ButtonGroup, {
51
- children: allViews.map(viewName => {
52
- const viewLabel = viewName.charAt(0).toUpperCase() + viewName.slice(1);
53
- return _jsx(PopupList.Button, {
54
- active: viewName === currentView,
55
- disabled: viewName === currentView,
56
- onClick: () => {
57
- setCurrentView?.(viewName);
58
- close();
59
- },
60
- children: viewLabel
61
- }, viewName);
62
- })
63
- });
64
- },
65
- size: "large"
66
- })
67
- });
68
- }
69
- $[0] = currentView;
70
- $[1] = setCurrentView;
71
- $[2] = views;
72
- $[3] = t0;
73
- $[4] = t1;
74
- } else {
75
- t0 = $[3];
76
- t1 = $[4];
77
- }
78
- if (t1 !== Symbol.for("react.early_return_sentinel")) {
79
- return t1;
80
- }
81
- return t0;
82
- }
83
- function _temp2(key_0) {
84
- return key_0 !== "default";
85
- }
86
- function _temp(key) {
87
- return key !== "default";
88
- }
89
- //# sourceMappingURL=ViewSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewSelector.js","names":["c","_c","ChevronIcon","Popup","PopupList","React","useRichTextView","ViewSelector","$","currentView","setCurrentView","views","Object","keys","length","t0","t1","Symbol","for","bb0","viewKeys","hasNonDefaultViews","some","_temp","allViews","filter","_temp2","currentViewLabel","charAt","toUpperCase","slice","_jsx","className","children","button","_jsxs","type","horizontalAlign","render","t2","close","ButtonGroup","map","viewName","viewLabel","Button","active","disabled","onClick","key_0","key"],"sources":["../../src/field/ViewSelector.tsx"],"sourcesContent":["'use client'\nimport { ChevronIcon, Popup, PopupList } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { useRichTextView } from './RichTextViewProvider.js'\nimport './ViewSelector.scss'\n\nexport function ViewSelector(): null | React.ReactElement {\n const { currentView, setCurrentView, views } = useRichTextView()\n\n // Don't show if no views or only default exists\n if (!views || Object.keys(views).length === 0) {\n return null\n }\n\n const viewKeys = Object.keys(views)\n const hasNonDefaultViews = viewKeys.some((key) => key !== 'default')\n\n // If only 'default' exists, no need to show selector\n if (!hasNonDefaultViews) {\n return null\n }\n\n // Build list of available views\n const allViews = ['default', ...viewKeys.filter((key) => key !== 'default')]\n\n const currentViewLabel = currentView.charAt(0).toUpperCase() + currentView.slice(1)\n\n return (\n <div className=\"lexical-view-selector\">\n <Popup\n button={\n <button className=\"lexical-view-selector__button\" type=\"button\">\n <span className=\"lexical-view-selector__label\">{currentViewLabel}</span>\n <ChevronIcon className=\"lexical-view-selector__icon\" />\n </button>\n }\n buttonType=\"custom\"\n horizontalAlign=\"left\"\n render={({ close }) => (\n <PopupList.ButtonGroup>\n {allViews.map((viewName) => {\n const viewLabel = viewName.charAt(0).toUpperCase() + viewName.slice(1)\n\n return (\n <PopupList.Button\n active={viewName === currentView}\n disabled={viewName === currentView}\n key={viewName}\n onClick={() => {\n setCurrentView?.(viewName)\n close()\n }}\n >\n {viewLabel}\n </PopupList.Button>\n )\n })}\n </PopupList.ButtonGroup>\n )}\n size=\"large\"\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,WAAW,EAAEC,KAAK,EAAEC,SAAS,QAAQ;AAC9C,OAAOC,KAAA,MAAW;AAElB,SAASC,eAAe,QAAQ;AAGhC,OAAO,SAAAC,aAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACL;IAAAQ,WAAA;IAAAC,cAAA;IAAAC;EAAA,IAA+CL,eAAA;EAAA,IAG3C,CAACK,KAAA,IAASC,MAAA,CAAAC,IAAA,CAAYF,KAAA,EAAAG,MAAA,MAAkB;IAAA;EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAC,WAAA,IAAAD,CAAA,QAAAE,cAAA,IAAAF,CAAA,QAAAG,KAAA;IASnCK,EAAA,GAAAC,MAAA,CAAAC,GAAA;IAAAC,GAAA;MALT,MAAAC,QAAA,GAAiBR,MAAA,CAAAC,IAAA,CAAYF,KAAA;MAC7B,MAAAU,kBAAA,GAA2BD,QAAA,CAAAE,IAAA,CAAAC,KAA+B;MAAA,KAGrDF,kBAAA;QACIL,EAAA;QAAA,MAAAG,GAAA;MAAA;MAIT,MAAAK,QAAA,IAAkB,cAAcJ,QAAA,CAAAK,MAAA,CAAAC,MAAiC;MAEjE,MAAAC,gBAAA,GAAyBlB,WAAA,CAAAmB,MAAA,EAAmB,EAAAC,WAAA,CAAc,IAAKpB,WAAA,CAAAqB,KAAA,EAAkB;MAG/Ef,EAAA,GAAAgB,IAAA,CAAC;QAAAC,SAAA,EAAc;QAAAC,QAAA,EACbF,IAAA,CAAA5B,KAAA;UAAA+B,MAAA,EAEIC,KAAA,CAAC;YAAAH,SAAA,EAAiB;YAAAI,IAAA,EAAqC;YAAAH,QAAA,GACrDF,IAAA,CAAC;cAAAC,SAAA,EAAe;cAAAC,QAAA,EAAgCN;YAAA,C,GAChDI,IAAA,CAAA7B,WAAA;cAAA8B,SAAA,EAAuB;YAAA,C;;sBAGhB;UAAAK,eAAA,EACK;UAAAC,MAAA,EAAAC,EAAA;YACP;cAAAC;YAAA,IAAAD,EAAS;YAAA,OAChBR,IAAA,CAAA3B,SAAA,CAAAqC,WAAA;cAAAR,QAAA,EACGT,QAAA,CAAAkB,GAAA,CAAAC,QAAA;gBACC,MAAAC,SAAA,GAAkBD,QAAA,CAAAf,MAAA,EAAgB,EAAAC,WAAA,CAAc,IAAKc,QAAA,CAAAb,KAAA,EAAe;gBAAA,OAGlEC,IAAA,CAAA3B,SAAA,CAAAyC,MAAA;kBAAAC,MAAA,EACUH,QAAA,KAAalC,WAAA;kBAAAsC,QAAA,EACXJ,QAAA,KAAalC,WAAA;kBAAAuC,OAAA,EAAAA,CAAA;oBAGrBtC,cAAA,GAAiBiC,QAAA;oBACjBH,KAAA;kBAAA;kBAAAP,QAAA,EAGDW;gBAAA,GANID,QAAA;cAAA,CASX;YAAA,C;;gBAGC;QAAA,C;;;;;;;;;;;;;;;SA/BT5B,E;;AAtBG,SAAAW,OAAAuB,KAAA;EAAA,OAiBoDC,KAAA,KAAQ;AAAA;AAjB5D,SAAA3B,MAAA2B,GAAA;EAAA,OAS6CA,GAAA,KAAQ;AAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export declare function NodeViewOverridePlugin(): null;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lexical/plugins/NodeViewOverridePlugin/index.tsx"],"names":[],"mappings":"AAOA,wBAAgB,sBAAsB,IAAI,IAAI,CAsB7C"}
@@ -1,48 +0,0 @@
1
- 'use client';
2
-
3
- import { c as _c } from "react/compiler-runtime";
4
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
5
- import { useEffect } from 'react';
6
- import { useRichTextView } from '../../../field/RichTextViewProvider.js';
7
- import { clearEditorNodeViews, registerEditorNodeViews } from '../../nodes/index.js';
8
- export function NodeViewOverridePlugin() {
9
- const $ = _c(5);
10
- const [editor] = useLexicalComposerContext();
11
- const {
12
- currentView,
13
- views
14
- } = useRichTextView();
15
- let t0;
16
- let t1;
17
- if ($[0] !== currentView || $[1] !== editor || $[2] !== views) {
18
- t0 = () => {
19
- if (!views) {
20
- return;
21
- }
22
- if (currentView === "default") {
23
- if (views.default) {
24
- registerEditorNodeViews(editor, views.default?.nodes);
25
- } else {
26
- clearEditorNodeViews(editor);
27
- }
28
- } else {
29
- if (views[currentView]) {
30
- clearEditorNodeViews(editor);
31
- registerEditorNodeViews(editor, views[currentView]?.nodes);
32
- }
33
- }
34
- };
35
- t1 = [editor, views, currentView];
36
- $[0] = currentView;
37
- $[1] = editor;
38
- $[2] = views;
39
- $[3] = t0;
40
- $[4] = t1;
41
- } else {
42
- t0 = $[3];
43
- t1 = $[4];
44
- }
45
- useEffect(t0, t1);
46
- return null;
47
- }
48
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useEffect","useRichTextView","clearEditorNodeViews","registerEditorNodeViews","NodeViewOverridePlugin","$","editor","currentView","views","t0","t1","default","nodes"],"sources":["../../../../src/lexical/plugins/NodeViewOverridePlugin/index.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useEffect } from 'react'\n\nimport { useRichTextView } from '../../../field/RichTextViewProvider.js'\nimport { clearEditorNodeViews, registerEditorNodeViews } from '../../nodes/index.js'\n\nexport function NodeViewOverridePlugin(): null {\n const [editor] = useLexicalComposerContext()\n const { currentView, views } = useRichTextView()\n\n useEffect(() => {\n if (!views) {\n return\n }\n\n if (currentView === 'default') {\n if (views.default) {\n registerEditorNodeViews(editor, views.default?.nodes)\n } else {\n clearEditorNodeViews(editor)\n }\n } else if (views[currentView]) {\n clearEditorNodeViews(editor)\n registerEditorNodeViews(editor, views[currentView]?.nodes)\n }\n }, [editor, views, currentView])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,SAAS,QAAQ;AAE1B,SAASC,eAAe,QAAQ;AAChC,SAASC,oBAAoB,EAAEC,uBAAuB,QAAQ;AAE9D,OAAO,SAAAC,uBAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACL,OAAAQ,MAAA,IAAiBP,yBAAA;EACjB;IAAAQ,WAAA;IAAAC;EAAA,IAA+BP,eAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAL,CAAA,QAAAE,WAAA,IAAAF,CAAA,QAAAC,MAAA,IAAAD,CAAA,QAAAG,KAAA;IAErBC,EAAA,GAAAA,CAAA;MAAA,KACHD,KAAA;QAAA;MAAA;MAAA,IAIDD,WAAA,KAAgB;QAAA,IACdC,KAAA,CAAAG,OAAA;UACFR,uBAAA,CAAwBG,MAAA,EAAQE,KAAA,CAAAG,OAAA,EAAAC,KAAe;QAAA;UAE/CV,oBAAA,CAAqBI,MAAA;QAAA;MAAA;QAAA,IAEdE,KAAK,CAACD,WAAA;UACfL,oBAAA,CAAqBI,MAAA;UACrBH,uBAAA,CAAwBG,MAAA,EAAQE,KAAK,CAACD,WAAA,GAAAK,KAAc;QAAA;MAAA;IAAA;IAErDF,EAAA,IAACJ,MAAA,EAAQE,KAAA,EAAOD,WAAA;IAAYF,CAAA,MAAAE,WAAA;IAAAF,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAG,KAAA;IAAAH,CAAA,MAAAI,EAAA;IAAAJ,CAAA,MAAAK,EAAA;EAAA;IAAAD,EAAA,GAAAJ,CAAA;IAAAK,EAAA,GAAAL,CAAA;EAAA;EAf/BL,SAAA,CAAUS,EAeV,EAAGC,EAA4B;EAAA;AAAA","ignoreList":[]}