This is a major re-organization of the code to be better organized into separate files, and to make the UI easier to modify using React. Also fixes some bugs, and re-organized the layout to be based on CSS grid, but mostly the same functionality as before.
App handles routes
FrontPage currently reproduces the automatic page creation, but could be a front page like Comingle. Also shows error upon failure.
DrawApp is the main React module, replacing most of top-level main.coffee code
Name renders name input
Tool renders a tool button, including mode, page, color, and width buttons, with reactive selected/active flags
ToolCategory renders an entire set of buttons
defineTool mechanism to add a tool to tools set, enabling mixing other code in between tool definitions and for loops over defineTool (for colors and widths)
once renamed to click, and now given an event
tools directory with various tool definitions; most code moved here
AppState is a new module storing the state variables of the app. Useful for avoiding cyclic import dependencies.
eventTo... helpers now part of Board
Current selection now part of Board
Board calls onRetransform helper instead of hard-coded links
New Room class maintains subscription, page list, loading status (instead of messy changeRoom/updateBad code)
New Page class maintains Grid and renderers (instead of messy changePage code)
RenderRemotes now runs its own interval timer
RenderRemotes now only given the current page's remotes
RenderRemotes correctly updates on fill
RenderRemotes doesn't seem to need to set viewBox
UndoStack now maintains the main undoStack
dom.listen now works well with useEffect (returns an unsetter)
Use .remove() instead of .removeChild() which behaves better when someone (e.g. React) has already removed the element.
lib/icons.coffee now has Icon, CloseIcon, LoadingIcon React widgets
storage.Variable now subclasses ReactiveVar, making it reactive (and a drop-in replacement for ReactiveVar). Now longer has a sync function, handling instead with Tracker.
Tooltips and QR modal now implemented via react-bootstrap, with nice Popper layout
Factor out code from main.coffee into cursor.coffee, lib/hscroll.coffee, lib/platform.coffee
This is a major re-organization of the code to be better organized into separate files, and to make the UI easier to modify using React. Also fixes some bugs, and re-organized the layout to be based on CSS grid, but mostly the same functionality as before.
App
handles routesFrontPage
currently reproduces the automatic page creation, but could be a front page like Comingle. Also shows error upon failure.DrawApp
is the main React module, replacing most of top-levelmain.coffee
codeName
renders name inputTool
renders a tool button, including mode, page, color, and width buttons, with reactive selected/active flagsToolCategory
renders an entire set of buttonsdefineTool
mechanism to add a tool totools
set, enabling mixing other code in between tool definitions and for loops overdefineTool
(for colors and widths)once
renamed toclick
, and now given an eventtools
directory with various tool definitions; most code moved hereAppState
is a new module storing the state variables of the app. Useful for avoiding cyclic import dependencies.eventTo...
helpers now part ofBoard
selection
now part ofBoard
Board
callsonRetransform
helper instead of hard-coded linksRoom
class maintains subscription, page list, loading status (instead of messychangeRoom
/updateBad
code)Page
class maintainsGrid
and renderers (instead of messychangePage
code)RenderRemotes
now runs its own interval timerRenderRemotes
now only given the current page's remotesRenderRemotes
correctly updates on fillRenderRemotes
doesn't seem to need to setviewBox
UndoStack
now maintains the mainundoStack
dom.listen
now works well withuseEffect
(returns an unsetter).remove()
instead of.removeChild()
which behaves better when someone (e.g. React) has already removed the element.lib/icons.coffee
now hasIcon
,CloseIcon
,LoadingIcon
React widgetsstorage.Variable
now subclassesReactiveVar
, making it reactive (and a drop-in replacement forReactiveVar
). Now longer has async
function, handling instead with Tracker.react-bootstrap
, with nice Popper layoutmain.coffee
intocursor.coffee
,lib/hscroll.coffee
,lib/platform.coffee
Meteor.Error
as recommended by Meteor