Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wax-prosemirror
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wax
wax-prosemirror
Commits
ee4e8a0c
Commit
ee4e8a0c
authored
1 year ago
by
chris
Browse files
Options
Downloads
Patches
Plain Diff
remove broken if
parent
562d247e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
editors/demo/src/Editoria/config/config.js
+1
-1
1 addition, 1 deletion
editors/demo/src/Editoria/config/config.js
wax-prosemirror-services/src/CommentsService/plugins/CommentState.js
+15
-22
15 additions, 22 deletions
...rror-services/src/CommentsService/plugins/CommentState.js
with
16 additions
and
23 deletions
editors/demo/src/Editoria/config/config.js
+
1
−
1
View file @
ee4e8a0c
...
@@ -306,7 +306,7 @@ export default {
...
@@ -306,7 +306,7 @@ export default {
// eslint-disable-next-line no-restricted-globals
// eslint-disable-next-line no-restricted-globals
connectionUrl
:
'
ws://localhost:5010
'
,
connectionUrl
:
'
ws://localhost:5010
'
,
// connectionUrl: 'ws://0.tcp.ap.ngrok.io:17607',
// connectionUrl: 'ws://0.tcp.ap.ngrok.io:17607',
docIdentifier
:
'
prosemirror-rweedxefe5dc
'
,
docIdentifier
:
'
prosemirror-rweedx
r
efe5dc
'
,
YjsType
:
'
prosemirror
'
,
YjsType
:
'
prosemirror
'
,
},
},
...
...
This diff is collapsed.
Click to expand it.
wax-prosemirror-services/src/CommentsService/plugins/CommentState.js
+
15
−
22
View file @
ee4e8a0c
...
@@ -69,21 +69,17 @@ export default class CommentState {
...
@@ -69,21 +69,17 @@ export default class CommentState {
if
(
ystate
?.
binding
)
{
if
(
ystate
?.
binding
)
{
const
{
doc
,
type
,
binding
}
=
ystate
;
const
{
doc
,
type
,
binding
}
=
ystate
;
this
.
allCommentsList
().
forEach
((
annotation
,
id
)
=>
{
this
.
allCommentsList
().
forEach
((
annotation
,
id
)
=>
{
if
(
typeof
annotation
.
data
.
yjsFrom
!==
'
object
'
)
{
annotation
.
data
.
yjsFrom
=
absolutePositionToRelativePosition
(
annotation
.
data
.
yjsFrom
=
absolutePositionToRelativePosition
(
annotation
.
data
.
pmFrom
,
annotation
.
data
.
pmFrom
,
type
,
type
,
binding
.
mapping
,
binding
.
mapping
,
);
);
}
if
(
typeof
annotation
.
data
.
yjsTo
!==
'
object
'
)
{
annotation
.
data
.
yjsTo
=
absolutePositionToRelativePosition
(
annotation
.
data
.
yjsTo
=
absolutePositionToRelativePosition
(
annotation
.
data
.
pmTo
,
annotation
.
data
.
pmTo
,
type
,
type
,
binding
.
mapping
,
binding
.
mapping
,
);
);
}
const
from
=
relativePositionToAbsolutePosition
(
const
from
=
relativePositionToAbsolutePosition
(
doc
,
doc
,
...
@@ -198,13 +194,14 @@ export default class CommentState {
...
@@ -198,13 +194,14 @@ export default class CommentState {
if
(
action
.
type
===
'
createDecorations
'
)
{
if
(
action
.
type
===
'
createDecorations
'
)
{
this
.
createDecorations
(
state
);
this
.
createDecorations
(
state
);
}
}
// this.createDecorations(state);
return
this
;
return
this
;
}
}
const
ystate
=
ySyncPluginKey
.
getState
(
state
);
const
ystate
=
ySyncPluginKey
.
getState
(
state
);
if
(
ystate
?.
isChangeOrigin
)
{
if
(
ystate
?.
isChangeOrigin
)
{
this
.
updateCommentPostions
(
ystate
);
//
this.updateCommentPostions(ystate);
this
.
createDecorations
(
state
);
this
.
createDecorations
(
state
);
return
this
;
return
this
;
...
@@ -226,17 +223,13 @@ export default class CommentState {
...
@@ -226,17 +223,13 @@ export default class CommentState {
if
(
ystate
?.
binding
&&
ystate
?.
binding
.
mapping
)
{
if
(
ystate
?.
binding
&&
ystate
?.
binding
.
mapping
)
{
this
.
updateCommentPostions
(
ystate
);
this
.
updateCommentPostions
(
ystate
);
this
.
createDecorations
(
state
);
return
this
;
return
this
;
// eslint-disable-next-line no-else-return
// eslint-disable-next-line no-else-return
}
else
{
}
else
{
// Not YJS
this
.
options
.
map
.
forEach
((
annotation
,
_
)
=>
{
map
.
forEach
((
annotation
,
_
)
=>
{
if
(
'
from
'
in
annotation
&&
'
to
'
in
annotation
)
{
if
(
'
from
'
in
annotation
&&
'
to
'
in
annotation
)
{
annotation
.
data
.
pmFrom
=
transaction
.
mapping
.
map
(
annotation
.
from
=
transaction
.
mapping
.
map
(
annotation
.
from
);
annotation
.
data
.
pmFrom
,
annotation
.
to
=
transaction
.
mapping
.
map
(
annotation
.
to
);
);
annotation
.
data
.
pmTo
=
transaction
.
mapping
.
map
(
annotation
.
data
.
pmTo
);
}
}
});
});
this
.
createDecorations
(
state
);
this
.
createDecorations
(
state
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment