@khanacademy/perseus-editor 28.6.5 → 28.8.0

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.
@@ -3,6 +3,7 @@
3
3
  * multiple (Renderer) sections concatenated together.
4
4
  */
5
5
  import * as React from "react";
6
+ import type { Issue } from "./components/issues-panel";
6
7
  import type { APIOptions, Changeable, ImageUploader, PerseusDependenciesV2 } from "@khanacademy/perseus";
7
8
  type RendererProps = {
8
9
  content?: string;
@@ -23,15 +24,22 @@ type Props = DefaultProps & {
23
24
  dependencies: PerseusDependenciesV2;
24
25
  imageUploader?: ImageUploader;
25
26
  previewURL: string;
27
+ issues?: Issue[];
26
28
  } & Changeable.ChangeableProps;
27
29
  type State = {
28
30
  highlightLint: boolean;
31
+ issues: Issue[];
29
32
  };
30
33
  export default class ArticleEditor extends React.Component<Props, State> {
31
34
  static defaultProps: DefaultProps;
32
35
  state: State;
33
36
  componentDidMount(): void;
34
- componentDidUpdate(): void;
37
+ componentDidUpdate(prevProps: Props): void;
38
+ /**
39
+ * Updates the issues state with the linter issues for the current sections.
40
+ * Helper function to be used with componentDidMount and componentDidUpdate.
41
+ */
42
+ _updateIssues(): void;
35
43
  _updatePreviewFrames(): void;
36
44
  _apiOptionsForSection(section: RendererProps, sectionIndex: number): any;
37
45
  _sections(): ReadonlyArray<RendererProps>;
package/dist/editor.d.ts CHANGED
@@ -42,7 +42,6 @@ type State = {
42
42
  };
43
43
  declare class Editor extends React.Component<Props, State> {
44
44
  lastUserValue: string | null | undefined;
45
- deferredChange: any | null | undefined;
46
45
  widgetIds: any | null | undefined;
47
46
  underlay: React.RefObject<HTMLDivElement>;
48
47
  textarea: React.RefObject<HTMLTextAreaElement>;
@@ -51,7 +50,6 @@ declare class Editor extends React.Component<Props, State> {
51
50
  componentDidMount(): void;
52
51
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;
53
52
  componentDidUpdate(prevProps: Props): void;
54
- componentWillUnmount(): void;
55
53
  getWidgetEditor(id: string, type: PerseusWidget["type"]): undefined | React.ReactNode;
56
54
  _handleWidgetEditorChange: (id: string, newWidgetInfo: PerseusWidget, cb?: () => unknown, silent?: boolean) => void;
57
55
  _handleWidgetEditorRemove: (id: string) => void;