Skip to content

Commit

Permalink
Previous build errors resolved
Browse files Browse the repository at this point in the history
Parts of the code that resulted build errors and commented out previously is enabled back by also solving the errors...
  • Loading branch information
ozanyurtsever committed Jun 23, 2022
1 parent df1e6bf commit f09580e
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
26 changes: 13 additions & 13 deletions src/nodes/EmojiNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,24 @@ export class EmojiNode extends TextNode {
serializedNode.text
);
node.setFormat(serializedNode.format);
// node.setDetail(serializedNode.detail); //FIXME: açılacak
node.setDetail(serializedNode.detail);
node.setMode(serializedNode.mode);
node.setStyle(serializedNode.style);
return node;
}

// exportJSON(): SerializedEmojiNode {
// return {
// // ...super.exportJSON(), //FIXME: açılacak
// className: this.getClassName(),
// type: "emoji",
// };
// }
exportJSON(): SerializedEmojiNode {
return {
...super.exportJSON(),
className: this.getClassName(),
type: 'emoji',
};
}

// getClassName(): string {
// const self = this.getLatest<EmojiNode>();
// return self.__className;
// } //FIXME: açılacak
getClassName(): string {
const self = this.getLatest();
return self.__className;
}
}

export function $isEmojiNode(
Expand All @@ -97,4 +97,4 @@ export function $createEmojiNode(
emojiText: string
): EmojiNode {
return new EmojiNode(className, emojiText).setMode('token');
} //FIXME: açılacak
}
3 changes: 2 additions & 1 deletion src/nodes/ExcalidrawNode/ExcalidrawModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { createPortal } from 'react-dom';

import Button from '../../ui/Button';
import Modal from '../../ui/Modal';
import { ExcalidrawElement } from '@excalidraw/excalidraw/types/element/types';

export type ExcalidrawElementFragment = {
isDeleted?: boolean;
Expand Down Expand Up @@ -177,7 +178,7 @@ export default function ExcalidrawModal({
onChange={onChange}
initialData={{
appState: { isLoading: false },
// elements: initialElements, //FIXME: açılacak
elements: initialElements as ExcalidrawElement[],
}}
/>
<div className="ExcalidrawModal__actions">
Expand Down
4 changes: 2 additions & 2 deletions src/nodes/KeywordNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export class KeywordNode extends TextNode {
static importJSON(serializedNode: SerializedKeywordNode): KeywordNode {
const node = $createKeywordNode(serializedNode.text);
node.setFormat(serializedNode.format);
// node.setDetail(serializedNode.detail); //FIXME: açılacak
node.setDetail(serializedNode.detail);
node.setMode(serializedNode.mode);
node.setStyle(serializedNode.style);
return node;
}

exportJSON(): SerializedKeywordNode {
return {
// ...super.exportJSON(), //FIXME: açılacak
...super.exportJSON(),
type: 'keyword',
version: 1,
};
Expand Down
4 changes: 2 additions & 2 deletions src/nodes/MentionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class MentionNode extends TextNode {
const node = $createMentionNode(serializedNode.mentionName);
node.setTextContent(serializedNode.text);
node.setFormat(serializedNode.format);
// node.setDetail(serializedNode.detail); //FIXME: burası normalde açık
node.setDetail(serializedNode.detail);
node.setMode(serializedNode.mode);
node.setStyle(serializedNode.style);
return node;
Expand All @@ -50,7 +50,7 @@ export class MentionNode extends TextNode {

exportJSON(): SerializedMentionNode {
return {
// ...super.exportJSON(), //FIXME: burası açılacak
...super.exportJSON(),
mentionName: this.__mention,
type: 'mention',
version: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/TweetNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class TweetNode extends DecoratorBlockNode<JSX.Element> {

exportJSON(): SerializedTweetNode {
return {
// ...super.exportJSON(), //FIXME: açılacak
...super.exportJSON(),
id: this.getId(),
type: 'tweet',
version: 1,
Expand Down
16 changes: 8 additions & 8 deletions src/nodes/TypeaheadNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ export class TypeaheadNode extends TextNode {
static importJSON(serializedNode: SerializedTypeaheadNode): TypeaheadNode {
const node = $createTypeaheadNode(serializedNode.text);
node.setFormat(serializedNode.format);
// node.setDetail(serializedNode.detail);
node.setDetail(serializedNode.detail);
node.setMode(serializedNode.mode);
node.setStyle(serializedNode.style);
return node;
}

// exportJSON(): SerializedTypeaheadNode {
// return {
// // ...super.exportJSON(), //FIXME: açılacak
// type: 'typeahead',
// version: 1,
// };
// } //FIXME: açılacak
exportJSON(): SerializedTypeaheadNode {
return {
...super.exportJSON(),
type: 'typeahead',
version: 1,
};
}

createDOM(config: EditorConfig): HTMLElement {
const dom = super.createDOM(config);
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/YouTubeNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class YouTubeNode extends DecoratorBlockNode<JSX.Element> {

exportJSON(): SerializedYouTubeNode {
return {
// ...super.exportJSON(), //FIXME: açılacak
...super.exportJSON(),
type: 'youtube',
version: 1,
videoID: this.__id,
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/ActionsPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ export default function ActionsPlugin({
return editor.registerUpdateListener(() => {
editor.getEditorState().read(() => {
const root = $getRoot();
const children = null; //root.getChildren(); //FIXME: closed for a build error
const children = root.getChildren();

if (children.length > 1) {
setIsEditorEmpty(false);
} else {
if ($isParagraphNode(children[0])) {
const paragraphChildren = null; //children[0].getChildren();
const paragraphChildren = children[0].getChildren();
setIsEditorEmpty(paragraphChildren.length === 0);
} else {
setIsEditorEmpty(false);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/CommentPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ function CommentsPanelListComment({
// eslint-disable-next-line no-shadow
thread?: Thread
) => void;
rtf: null; //Intl.RelativeTimeFormat; //FIXME: build error
rtf: null; //FIXME: Intl.RelativeTimeFormat gives build error;
thread?: Thread;
}): JSX.Element {
const seconds = Math.round((comment.timeStamp - performance.now()) / 1000);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ToolbarPlugin/components/InsertDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function InsertImageDialog({
onClick={() =>
onClick({
altText: 'Yellow flower in tilt shift lens',
src: null, //yellowFlowerImage, //FIXME: aç burayı
src: null, //yellowFlowerImage,
})
}
>
Expand Down

1 comment on commit f09580e

@ozanyurtsever
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix bug #4

Please sign in to comment.