substance / lens Goto Github PK
View Code? Open in Web Editor NEWLens - open science content creation and display
Home Page: http://substance.io/lens
License: MIT License
Lens - open science content creation and display
Home Page: http://substance.io/lens
License: MIT License
Just as Lens Writer but without editable elements.
Reproduce:
Currently we solve it like this:
In lens_writer.js
:
this.handleStateUpdate = function(newState) {
// var oldState = this.state;
var doc = this.getDocument();
function getActiveNodes(state) {
if (state.citationId) {
var targets = doc.get(state.citationId).targets;
return [ state.citationId ].concat(targets);
}
return [];
}
var activeAnnos = getActiveNodes(newState);
// HACK: updates the highlights when state
// transition has finished
setTimeout(function() {
doc.setHighlights(activeAnnos);
}, 0);
};
And in content_panel.js
it's also a bit smelly:
this.onHighlightsUpdated = function(highlights) {
var controller = this.context.controller;
// Triggers a rerender
this.refs.scrollbar.extendProps({
highlights: highlights,
contextId: controller.state.contextId
});
};
We do this just to reach some proper coloring of the scrollbar according to the current context. Maybe we find better solution.
that this "also deletes all references to that figure from the document". Same with the bib manager.
This doesn't happen when a new figure is created. I guess this happens because of the bibliography.compile thing.
Everything works fine for updating the citation.
It is not a sufficient treatment of selections.
There are now 4 categories:
sel.isNull()
sel.isPropertySelection()
sel.isContainerSelection()
sel.isTableSelection()
As in the above case, the code suggests that you want to have property selections only.
A good way is to do either
if (sel.isPropertySelection()) {
...
} else {
...
}
or using a guard:
if (!sel.isPropertySelection()) {
return;
}
Nice for demoing the inner workings. Also debugging.
Check toggleFigureCitation command.
I'd like to try how it feels to have the bib manager implemented as a resource panel, rather then using popup. Everybody ok with that?
Currently we use click handler, but it should all depend on the selection when exactly that citation is selected (one char)
Uncaught TypeError: editor._insertNode is not a function. Because of our transformations refactorings.
Reproduce:
This is actually a nice feature during document production.
Should employ babel ES6 transforms.
Currently it's not possible to search for references in safari.
That way we know even when we loose the focus which citation is currently modified.
Looks like the copy and paste mechanism hooks in here.
Fix
Probably still some regression related to the introduction of numeric-addressing.
The problem is, even when the surface selection is rendered at the very end of a change, still a React's component render / forceUpdate is asynchronous.
Thus, the selection is rendered before the component.
https://github.com/substance/lens-writer/blob/master/lib/article/collections/collection.js#L40
How to do this the new way?
Please don't rely on global variables, i.e. i18n
in https://github.com/substance/lens-writer/blob/master/src/components/content_toolbar.js#L32 or React
in https://github.com/substance/lens-writer/blob/master/src/components/content_toolbar.js#L12
This makes development difficult for people who are integrating lens-writer into different contexts.
Creating a new figure should be possible again. Will realize this with a command, so you can trigger figure insertion with a keybinding as well.
Reproduce:
-> selection gets messed up.
Related: it's hard to select the end of a line currently. Often the cursor just jumps away.
I think the killer feature for managing citations would be macros. E.g. typing @ brings a small dropdown showing most recent bib items. By typing ahead you filter. e.g. you can easily type the name of an author and you'll find the entry very fast. Same would work with figures and tables of course:
@table 1 ENTER.
Would be nice if when we clicked a bib citation [1-4] if we saw all 'related' bib citations too. Which are the ones that have as target 1,2,3 or 4. Or is that getting too messy then.
Open for dicussion.
Much like the Bibliography module. E.g. we could call this a FigureColleciton.
Challenges:
@oliver---- thoughts?
When double clicking on a paragraph i would expect that all text gets selected. Currently those citation islands which are not editable are blocking the selection to be expaned, and also causing some unexpected behavior when selecting with the keyboard combos (alt+shift+left/right etc.). We should think of how this could be improved, maybe we can leave the citations editable but correct the selection manually.
Don't know how to do this in jQuery yet.
E.g. when i insert a new table before the existing table it gets labeled Table 2, when it should be one. Same happens with image-figures. The labels get corrected as soon as I start the cite workflow.
Registry returned 404 for GET on https://registry.npmjs.org/lens-writer
Here it would be good to order by selected in the first place, label in second place and alphabetically when there's no label.
Currently you have to scroll around to find the selected items for a citation. Now if we apply the sorting all the time we would have the problem that the interface jumps. I think what we should do is only refreshing the order when the dialog is opened the next time.
Would help a lot, to have placeholders for title, abstract etc. We just don't have a concept for it, yet.
Currently you can toggle off everything
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.