Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/vls-65' into vls-65
Browse files Browse the repository at this point in the history
  • Loading branch information
veglem committed Jun 1, 2024
2 parents b8599e8 + c762421 commit fa2ffed
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 31 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Frontend проекта "Notion" команды scratch senior devs
* [ScReact](https://www.npmjs.com/package/@veglem/screact)

# UI Kit
* [UI-Kit](https://www.npmjs.com/package/@veglem/ui-kit)
* [UI Kit](https://www.npmjs.com/package/@veglem/ui-kit)

# Авторы
* [Михалёв Ярослав](https://github.com/YarikMix) - _frontend_
Expand All @@ -28,3 +28,7 @@ Frontend проекта "Notion" команды scratch senior devs

# Backend
* [Backend](https://github.com/go-park-mail-ru/2024_1_scratch_senior_devs)

# Как запустить
* npm install
* npm run serve
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"serve": "webpack serve --node-env=development"
},
"devDependencies": {
"@veglem/ui-kit": "^1.0.6",
"@veglem/ui-kit": "^1.0.8",
"@babel/cli": "^7.23.9",
"@babel/core": "^7.24.0",
"@babel/plugin-proposal-decorators": "^7.24.0",
Expand Down
2 changes: 1 addition & 1 deletion public/src/components/Editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class Editor {
: selection.anchorNode.parentElement;

scanTree(this.editable);
console.log(`cursor${AppUserStore.state.username}${AppNotesStore.socket_id?.toString().replaceAll('-','').toLowerCase()}`)


elem.dataset[`cursor${AppUserStore.state.username}${AppNotesStore.socket_id?.toString().replaceAll('-','').toLowerCase()}`] = `${getCaretPosition(elem)}`;
// elem.scrollIntoView();
Expand Down
8 changes: 4 additions & 4 deletions public/src/components/Editor/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export const defaultPlugins: EditorPlugin[] = [
img.src = url;
AppDispatcher.dispatch(NoteStoreActions.PUT_TO_CACHE, {key: id, value: url})
}).catch(error => {
console.log(error)

})
}

Expand All @@ -524,7 +524,7 @@ export const defaultPlugins: EditorPlugin[] = [
img.src = url;
AppDispatcher.dispatch(NoteStoreActions.PUT_TO_CACHE, {key: id, value: url})
}).catch(error => {
console.log(error)

})

return img
Expand Down Expand Up @@ -915,7 +915,7 @@ export const insertBlockPlugin = (pluginName: string, ...args: any) => {
});
}
const newNode = plugin.insertNode([], args);
console.log(newNode)

if (newNode) {
(nodeToReplace as HTMLElement).replaceWith(newNode);
document.getSelection().setPosition(newNode, 0);
Expand Down Expand Up @@ -1054,7 +1054,7 @@ const RenderAttach = (attach_filename:string, attach_id:string) => {
}

const RenderSubNote = (subNoteId:string) => {
console.log("RenderSubNote")


const subNoteWrapper = document.createElement("button")
subNoteWrapper.className = "subnote-wrapper"
Expand Down
6 changes: 3 additions & 3 deletions public/src/components/NoteEditor/NoteEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ export class NoteEditor extends ScReact.Component<NoteEditorProps, NoteEditorTyp
const isEditable = this.state.selectedNote?.collaborators.includes(AppUserStore.state.user_id) || isOwner

// TODO: скелетон для эдитора
// console.log("render")
// console.log(this.state.selectedNote)
//
//
//
// if (!this.state.selectedNote) {
// return (
Expand All @@ -276,7 +276,7 @@ export class NoteEditor extends ScReact.Component<NoteEditorProps, NoteEditorTyp
// )
// }
//
// console.log("123")
//

return (
<div className={'note-editor-wrapper ' + (this.props.open ? ' active ' : '') + (this.state.fullScreen ? ' fullscreen ' : '') } ref={ref => this.editorWrapperRef = ref}>
Expand Down
5 changes: 4 additions & 1 deletion public/src/components/SharePanel/SharePanel.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
border: 1px solid hsl(217.2 32.6% 25%)
background: #18232f
border-radius: 12px
width: min(90vw, 350px)

h3
color: #f4f6f9
Expand All @@ -20,6 +21,7 @@
&__bottom-container
display: flex
gap: 12px
width: 100%

.invite-input
outline: none
Expand All @@ -29,6 +31,7 @@
padding: 4px 8px
color: #eee
transition: 0.3s ease
width: 60%

&:focus
border: 1px solid rgba(13, 65, 227, 0.8)
Expand All @@ -39,12 +42,12 @@
.button
border-radius: 4px
padding: 6px 12px
flex: 1

&:hover
transform: scale(1)
background: #1744d0


&__share-link-container
display: flex
flex-direction: column
Expand Down
4 changes: 2 additions & 2 deletions public/src/components/SharePanel/SharePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class SharePanel extends ScReact.Component<any, any> {
}

shareToVK = () => {
console.log("shareToVK")

const url = "https://vk.com/share.php?url=" + this.getNoteURL()+ "&title=" + parseNoteTitle(this.props.note.data.title)
this.openShareWindow(url)
}
Expand Down Expand Up @@ -48,7 +48,7 @@ export class SharePanel extends ScReact.Component<any, any> {

sendInvite = (e) => {
e.preventDefault()
console.log("sendInvite")


const value = this.inviteInputRef.value

Expand Down
8 changes: 4 additions & 4 deletions public/src/components/TagsFilter/TagsFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ export class TagsFilter extends ScReact.Component<TagsFilterProps, TagsFilterSta
private presstimer = null;

click = (tag) => {
console.log("click")
console.log(this.longpress)



if (this.presstimer !== null) {
clearTimeout(this.presstimer);
Expand All @@ -177,15 +177,15 @@ export class TagsFilter extends ScReact.Component<TagsFilterProps, TagsFilterSta
}

start = (e, tag)=> {
console.log("start")

if (e.type === "click" && e.button !== 0) {
return;
}

this.longpress = false;

this.presstimer = setTimeout(() => {
console.log("long click");

this.onTagRightClick(e, tag)
this.longpress = true;
}, 1000);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {ScReact} from '@veglem/screact';
import {Input} from '../Input/Input';
import './UpdatePasswordModal.sass';
import {ValidatePassword} from '../../modules/validation';
import {AppDispatcher} from '../../modules/dispatcher';
Expand Down Expand Up @@ -120,7 +119,7 @@ export class UpdatePasswordForm extends ScReact.Component<any, any> {
};

render() {
const {Button} = uiKit
const {Button, Input} = uiKit

return (
<div className="change-password-form">
Expand Down
6 changes: 3 additions & 3 deletions public/src/components/ViewerWrapper/ViewerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class ViewerWrapper extends ScReact.Component<ViewerWrapperProps, any> {
private viewerRef

componentDidMount() {
console.log("componentDidMount")

this.noteContentRef.innerHTML = ""
new Viewer(
this.props.note.data.content,
Expand All @@ -32,7 +32,7 @@ export class ViewerWrapper extends ScReact.Component<ViewerWrapperProps, any> {
}

componentDidUpdate() {
console.log("componentDidUpdate")

this.noteContentRef.innerHTML = ""
new Viewer(
this.props.note.data.content,
Expand All @@ -41,7 +41,7 @@ export class ViewerWrapper extends ScReact.Component<ViewerWrapperProps, any> {
}

closeViewer = () => {
console.log("closeViewer")

AppRouter.go("/")

history.pushState(null, null, "/"); // TODO
Expand Down
2 changes: 1 addition & 1 deletion public/src/modules/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class NoteRequests {
content: [
{
pluginName: "textBlock",
content: "Hello You-note"
content: ""
},
{
pluginName: "div",
Expand Down
4 changes: 2 additions & 2 deletions public/src/modules/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ export class Router extends ScReact.Component<any, routerState> {
}

public openSharedNotePage (note:NoteType) {
console.log("openSharedNotePage")
console.log(note)



history.pushState(null, null, "/notes/" + note.id);

Expand Down
2 changes: 1 addition & 1 deletion public/src/modules/stores/NotesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class NotesStore extends BaseStore<NotesStoreState> {
this.selectNote(note);

} catch (e) {
console.log(e.message)

AppToasts.error('Заметка не найдена');
}
}
Expand Down
2 changes: 1 addition & 1 deletion public/src/pages/Notes/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const NotesLoader = async (path:string) => {
// resolve({notes: store.notes});

AppSharedNoteRequests.Get(noteId).then(note => {
console.log(note)

resolve({notes: store.notes, note: note, tags: store.tags});
}).catch(() => {
AppRouter.go("/404")
Expand Down

0 comments on commit fa2ffed

Please sign in to comment.