@firecms/editor 3.0.0-canary.183 → 3.0.0-canary.186

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.
package/dist/editor.d.ts CHANGED
@@ -15,11 +15,10 @@ export type FireCMSEditorProps = {
15
15
  to: number;
16
16
  };
17
17
  aiController?: EditorAIController;
18
- onDisabledAutocompleteClick?: () => void;
19
18
  customComponents?: CustomEditorComponent[];
20
19
  };
21
20
  export type CustomEditorComponent = {
22
21
  name: string;
23
22
  component: React.FC;
24
23
  };
25
- export declare const FireCMSEditor: ({ content, onJsonContentChange, onHtmlContentChange, onMarkdownContentChange, version, textSize, highlight, handleImageUpload, aiController, onDisabledAutocompleteClick }: FireCMSEditorProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const FireCMSEditor: ({ content, onJsonContentChange, onHtmlContentChange, onMarkdownContentChange, version, textSize, highlight, handleImageUpload, aiController, }: FireCMSEditorProps) => import("react/jsx-runtime").JSX.Element;
@@ -85,8 +85,7 @@ export interface SuggestionItem {
85
85
  aiController?: EditorAIController;
86
86
  }) => void;
87
87
  }
88
- export declare const suggestion: (ref: React.MutableRefObject<any>, { upload, onDisabledAutocompleteClick, aiController }: {
88
+ export declare const suggestion: (ref: React.MutableRefObject<any>, { upload, aiController }: {
89
89
  upload: UploadFn;
90
- onDisabledAutocompleteClick?: () => void;
91
90
  aiController?: EditorAIController;
92
91
  }) => Omit<SuggestionOptions<SuggestionItem, any>, "editor">;
package/dist/index.es.js CHANGED
@@ -1386,25 +1386,15 @@ const SlashCommand = Node.create({
1386
1386
  });
1387
1387
  const suggestion = (ref, {
1388
1388
  upload,
1389
- onDisabledAutocompleteClick,
1390
1389
  aiController
1391
1390
  }) => ({
1392
1391
  items: ({
1393
1392
  query
1394
1393
  }) => {
1395
1394
  const availableSuggestionItems = [...suggestionItems];
1396
- if (!onDisabledAutocompleteClick && aiController) {
1395
+ if (aiController) {
1397
1396
  availableSuggestionItems.push(autocompleteSuggestionItem);
1398
1397
  }
1399
- if (onDisabledAutocompleteClick) {
1400
- availableSuggestionItems.push({
1401
- title: "Autocomplete",
1402
- description: "Add text based on the context.",
1403
- searchTerms: ["ai"],
1404
- icon: /* @__PURE__ */ jsx(AutoFixHighIcon, { size: 18 }),
1405
- command: onDisabledAutocompleteClick
1406
- });
1407
- }
1408
1398
  return availableSuggestionItems.filter((item) => {
1409
1399
  const inTitle = item.title.toLowerCase().startsWith(query.toLowerCase());
1410
1400
  if (inTitle) return inTitle;
@@ -1639,6 +1629,7 @@ const CommandList = forwardRef((props, ref) => {
1639
1629
  }
1640
1630
  return t12;
1641
1631
  });
1632
+ CommandList.displayName = "CommandList";
1642
1633
  const autocompleteSuggestionItem = {
1643
1634
  title: "Autocomplete",
1644
1635
  description: "Add text based on the context.",
@@ -1834,8 +1825,7 @@ const FireCMSEditor = ({
1834
1825
  textSize = "base",
1835
1826
  highlight,
1836
1827
  handleImageUpload,
1837
- aiController,
1838
- onDisabledAutocompleteClick
1828
+ aiController
1839
1829
  }) => {
1840
1830
  const ref = React.useRef(null);
1841
1831
  const editorRef = React.useRef(null);
@@ -1919,8 +1909,7 @@ const FireCMSEditor = ({
1919
1909
  },
1920
1910
  suggestion: suggestion(ref, {
1921
1911
  upload: handleImageUpload,
1922
- aiController,
1923
- onDisabledAutocompleteClick
1912
+ aiController
1924
1913
  })
1925
1914
  })
1926
1915
  ], []);