@fabwcie/free-drawing / components/CollaborationModal
components/CollaborationModal
Classes
CollaborationModal
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:16
Live collaboration dialog: start a session, join one from a link (name required), session link with copy button and QR code, users of the session with rights given by the owner, stop session
Extends
Constructors
Constructor
new CollaborationModal(
drawer):CollaborationModal
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:56
Build the dialog: name field, session part (link, users, QR code) and buttons, updated on collaboration changes
Parameters
drawer
Drawer whose collaboration sessions are started, joined and shown
Returns
Overrides
Properties
$backdrop
$backdrop:
HTMLDivElement
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:53
Backdrop around the dialog (only with backdrop option), shown and hidden with it
Inherited from
$cancelButton
$cancelButton:
HTMLButtonElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:40
Cancels joining the room of the link, shown with a link
$intro
$intro:
HTMLParagraphElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:18
Introduction, depends on state: no session, invited by a link, joined session of another user
$joinButton
$joinButton:
HTMLButtonElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:38
Joins the room of the link, shown with a link, enabled once a name is given
$link
$link:
HTMLInputElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:24
Read only link of the session (selected on focus), followed by its copy button
$members
$members:
HTMLUListElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:32
Users of the session (live region): name, who invited them, right to draw (switch for the owner)
$modal
$modal:
HTMLDivElement
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:41
Dialog element (role="dialog", aria-modal), holds header, body and footer
Inherited from
$modalBody
$modalBody:
HTMLDivElement
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:45
Body of the dialog: content of the dialog
Inherited from
$modalFooter
$modalFooter:
HTMLDivElement
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:47
Footer of the dialog: buttons of the dialog
Inherited from
$modalHeader
$modalHeader:
HTMLDivElement
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:43
Header of the dialog: title and close button, removed when showHeader option is false
Inherited from
$name
$name:
HTMLInputElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:20
Name shown to other users (saved on change), required to join; Enter starts or joins
$newUsersCanEdit
$newUsersCanEdit:
HTMLInputElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:30
Switch of the owner: users coming for the first time can draw, else they view only
$qrCode
$qrCode:
HTMLDivElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:26
QR code of the session link (svg rendered by uqr, loaded when needed)
$security
$security:
HTMLParagraphElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:44
Encryption of the session: end to end (lock), or in clear (server reading the drawing)
$session
$session:
HTMLDivElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:22
Session part, shown to the owner only: link, users with their rights, QR code
$startButton
$startButton:
HTMLButtonElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:36
Starts a session, shown without session nor link to join
$stopButton
$stopButton:
HTMLButtonElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:42
Stops the session, shown to the owner
$users
$users:
HTMLParagraphElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:28
Number of connected users, title of the list of users
drawer
drawer:
Drawer
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:51
Drawer the dialog belongs to
Inherited from
invitedBy?
optionalinvitedBy?:string
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:48
Id of user who shared the link
joinKey?
optionaljoinKey?:string
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:50
Key of the encrypted room of the link
joinRoom
joinRoom:
string|null=null
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:46
Room of a link, joined once user gives a name
membersList
membersList:
CollaborationMembers
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:34
Rows of the users of the session, see $members
options
options:
ModalOptions
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:49
Options of the dialog, merged with default ones
Inherited from
Methods
_createField()
private_createField(text,type):HTMLInputElement
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:161
Labelled input, in a field container
Parameters
text
"drawer.label" | "language.auto" | "toast.collaborationUnavailable" | "toast.collaborationFull" | "toast.collaborationTooBig" | "toast.canDraw" | "toast.viewOnly" | "toast.joinedViewOnly" | "toast.presentationStarted" | "toast.presentationEnded" | "toast.requestSent" | "toast.requestReceived" | "toast.requestRefused" | "toast.saveFailed" | "toast.saved" | "toast.styleCopied" | "toast.libraryImported" | "toast.libraryNotSaved" | "toast.loadFailed" | "toast.invalidFile" | "toast.linkCopied" | "toast.linkNotCopied" | "toast.invalidLink" | "toast.invalidShapeLink" | "toast.clipboardUnavailable" | "toast.exportFailed" | "toast.imageCopied" | "toast.storageCleared" | "toast.imageNotCopied" | "error.clipboardUnavailable" | "error.nothingToExport" | "error.notDrawingFile" | "error.notImage" | "error.damagedLink" | "error.drawingTooBig" | "error.imageNotCreated" | "error.serverUnreachable" | "error.notAllowed" | "error.storageFull" | "error.notLibraryFile" | "error.noDrawingInImage" | "error.insecurePage" | "error.roomKey" | "error.encryptionUnsupported" | "toast.selectionTool" | "modal.close" | "confirm.message" | "confirm.clearCanvas" | "confirm.clearStorage" | "confirm.stopCollaboration" | "confirm.leaveCollaboration" | "confirm.cancel" | "confirm.confirm" | "menu.label" | "menu.open" | "menu.saveAs" | "menu.save" | "menu.unsaved" | "menu.copyLink" | "menu.collaboration" | "menu.collaborationOn" | "menu.collaborationUsers" | "menu.export" | "menu.clearCanvas" | "menu.showGrid" | "menu.zenMode" | "menu.darkMode" | "menu.github" | "menu.githubLabel" | "menu.clearStorage" | "menu.background" | "menu.language" | "menu.commands" | "menu.preferences" | "preferences.title" | "preferences.autoSave" | "preferences.shapeRecognition" | "grid.style" | "grid.squares" | "grid.dots" | "grid.lines" | "grid.isometric" | "grid.styleCommand" | "preferences.wheel" | "wheel.zoom" | "wheel.pan" | "wheel.command" | "help.spaceDrag" | "help.wheelDrag" | "preferences.save" | "preferences.appearance" | "preferences.theme" | "preferences.light" | "preferences.dark" | "preferences.system" | "preferences.drawing" | "commands.search" | "commands.empty" | "commands.file" | "commands.language" | "color.white" | "color.lightGray" | "color.lightBlue" | "color.lightYellow" | "color.lightBeige" | "color.lightRed" | "color.lightGreen" | "color.black" | "color.red" | "color.green" | "color.blue" | "color.orange" | "color.yellow" | "color.pink" | "color.transparent" | "color.custom" | "color.pick" | "help.title" | "help.documentation" | "help.issue" | "help.shortcuts" | "help.tools" | "help.editor" | "help.view" | "help.or" | "help.selectAll" | "help.deleteSelection" | "help.duplicate" | "help.group" | "help.selectInGroup" | "help.constrainDrawing" | "help.whileDrawing" | "help.cancelDrawing" | "help.arrowUnlinked" | "help.constrainSelection" | "help.whileTransforming" | "help.move" | "help.forwardBackward" | "help.frontBack" | "help.lock" | "help.paste" | "help.open" | "help.save" | "help.export" | "help.grid" | "help.layers" | "help.layersSelect" | "help.snap" | "help.zoom" | "help.toolsConstrain" | "key.delete" | "key.arrows" | "key.click" | "key.space" | "key.wheel" | "key.ctrl" | "key.shift" | "key.alt" | "key.escape" | "key.enter" | "key.tab" | "key.home" | "key.end" | "key.backspace" | "toolbar.label" | "toolbar.moreTools" | "toolbar.keepTool" | "tools.pan" | "tools.selection" | "tools.brush" | "tools.eraser" | "tools.text" | "tools.note" | "tools.line" | "tools.square" | "tools.circle" | "tools.arrow" | "tools.image" | "tools.triangle" | "tools.diamond" | "tools.laser" | "tools.frame" | "zoom.label" | "zoom.out" | "zoom.in" | "zoom.reset" | "zoom.fit" | "zoom.selection" | "zoom.to100" | "history.label" | "history.undo" | "history.redo" | "position.label" | "position.recenter" | "context.paste" | "context.snap" | "context.lock" | "context.unlock" | "selectionMenu.label" | "action.duplicate" | "action.copyStyle" | "action.pasteStyle" | "library.title" | "library.add" | "library.empty" | "library.hint" | "library.insert" | "library.remove" | "library.import" | "library.export" | "library.close" | "library.shapes" | "search.label" | "search.count" | "search.none" | "slideshow.start" | "slideshow.presentFrom" | "slideshow.label" | "slideshow.previous" | "slideshow.next" | "slideshow.stop" | "slideshow.count" | "slideshow.slide" | "slideshow.slideTitled" | "slideshow.noFrames" | "slideshow.nextPrevious" | "slideshow.firstLast" | "slideshow.whilePresenting" | "replay.start" | "replay.label" | "replay.play" | "replay.pause" | "replay.restart" | "replay.speed" | "replay.stop" | "replay.count" | "replay.empty" | "replay.finished" | "replay.playPause" | "replay.step" | "replay.firstLast" | "replay.whileReplaying" | "navigation.description" | "navigation.text" | "navigation.shapes" | "navigation.from" | "navigation.to" | "navigation.link" | "navigation.locked" | "navigation.in" | "navigation.index" | "navigation.left" | "navigation.nextPrevious" | "navigation.enter" | "navigation.parent" | "navigation.leave" | "navigation.onDrawing" | "search.previous" | "search.next" | "search.close" | "action.group" | "action.ungroup" | "action.sendToBack" | "action.sendBackward" | "action.bringForward" | "action.bringToFront" | "action.delete" | "action.rotateRight" | "action.rotateLeft" | "action.flipHorizontal" | "action.flipVertical" | "action.insertImage" | "toast.imageFailed" | "action.alignLeft" | "action.alignCenter" | "action.alignRight" | "action.alignTop" | "action.alignMiddle" | "action.alignBottom" | "action.distributeHorizontal" | "action.distributeVertical" | "action.stackHorizontal" | "action.stackVertical" | "action.fitTextWidth" | "action.copyPng" | "action.copySvg" | "action.link" | "overlay.tool" | "overlay.selection" | "overlay.shape" | "overlay.brush" | "overlay.recognizeShapes" | "overlay.recognizeShapesHint" | "overlay.note" | "overlay.text" | "overlay.stroke" | "overlay.color" | "overlay.background" | "overlay.strokeWidth" | "overlay.strokeStyle" | "overlay.edges" | "overlay.arrowType" | "overlay.startHead" | "overlay.endHead" | "overlay.opacity" | "overlay.layers" | "overlay.align" | "overlay.distribute" | "overlay.actions" | "link.address" | "link.placeholder" | "link.open" | "link.remove" | "width.thin" | "width.medium" | "width.thick" | "width.extraThick" | "style.solid" | "style.dashed" | "style.dotted" | "edges.sharp" | "edges.round" | "edges.radius" | "edges.auto" | "arrow.straight" | "arrow.curved" | "arrow.elbow" | "arrowhead.none" | "arrowhead.arrow" | "arrowhead.triangle" | "arrowhead.dot" | "arrowhead.bar" | "text.fontFamily" | "text.fontSize" | "text.small" | "text.medium" | "text.large" | "text.extraLarge" | "text.style" | "text.bold" | "text.italic" | "text.underline" | "text.strikethrough" | "text.align" | "text.alignLeft" | "text.alignCenter" | "text.alignRight" | "layers.title" | "layers.group" | "layers.close" | "layers.empty" | "layers.drag" | "layers.shapesOf" | "layers.hide" | "layers.lock" | "layers.delete" | "layers.name" | "layers.toggle" | "layers.range" | "shapes.freehand" | "shapes.line" | "shapes.rect" | "shapes.ellipse" | "shapes.arrow" | "shapes.triangle" | "shapes.diamond" | "shapes.heart" | "shapes.cloud" | "shapes.star" | "shapes.hexagon" | "shapes.blockArrow" | "shapes.bubble" | "shapes.checkbox" | "shapes.shape" | "shapes.highlighter" | "shapes.frame" | "shapes.frameName" | "shapes.text" | "shapes.note" | "shapes.group" | "shapes.image" | "export.title" | "export.empty" | "export.options" | "export.selected" | "export.background" | "export.dark" | "export.withDrawing" | "export.scale" | "export.saveAs" | "export.saveFile" | "export.copy" | "export.preview" | "collab.title" | "collab.intro" | "collab.introInvited" | "collab.introJoined" | "collab.introJoinedOf" | "collab.name" | "collab.anonymous" | "collab.link" | "collab.copy" | "collab.qrCode" | "collab.start" | "collab.join" | "collab.stop" | "collab.leave" | "collab.live" | "collab.liveState" | "collab.connected" | "collab.connecting" | "collab.you" | "collab.invitedBy" | "collab.canDrawLabel" | "collab.canDraw" | "collab.newUsersCanDraw" | "collab.encrypted" | "collab.notEncrypted" | "collab.owner" | "collab.viewOnly" | "collab.present" | "collab.presenting" | "collab.follow" | "collab.followPresentation" | "collab.following" | "collab.youCanDraw" | "collab.youViewOnly" | "collab.requestEdit" | "collab.requestSent" | "collab.requests" | "collab.requestsCount" | "collab.accept" | "collab.refuse" | "collab.acceptLabel" | "collab.refuseLabel" | "collab.users" | "collab.settings"
Key of the label text (translated again when language changes)
type
string
Type of the input
Returns
HTMLInputElement
Input, in its field container (.drawer-collaboration-field) to add to the dialog
_updateMembers()
private_updateMembers():void
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:264
Users of session, with rights: owner gives or removes the right to draw
Returns
void
appendBodyContent()
appendBodyContent(
content):void
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:272
Adds text at the end of the body (as text, not parsed as HTML)
Parameters
content
string
Text added after the body content
Returns
void
Inherited from
cancelJoin()
cancelJoin():
void
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:236
Room of link not joined, removed from page url
Returns
void
copyLink()
copyLink():
Promise<void>
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:246
Copies the session link to clipboard (secure context only), result shown in a toast
Returns
Promise<void>
destroy()
destroy():
void
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:346
Hides the dialog and removes it from the page
Returns
void
Inherited from
hide()
hide():
void
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:318
Hides the dialog and gives focus back to the element which opened it, else to the drawer, unless an element out of the drawer took it (field of the page or another drawer clicked)
Returns
void
Inherited from
isVisible()
isVisible():
boolean
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:339
Whether the dialog is shown
Returns
boolean
True while the dialog is shown
Inherited from
join()
join():
Promise<void>
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:214
Joins the room of the link with the given name (nothing without name), then the dialog is closed (the reminder of the header shows the session) and the join told in a toast; error shown in a toast
Returns
Promise<void>
keepFocus()
protectedkeepFocus(...$preferred):void
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:195
Focus kept in the dialog when an update hid or disabled its focused element (its own button: start, stop...): on the first reachable of the given elements, else on the first element of the dialog, never on the page behind it
Parameters
$preferred
...HTMLElement[]
Elements to focus, in order of preference
Returns
void
Inherited from
setBodyContent()
setBodyContent(
content):void
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:264
Replaces the body with an HTML string
Parameters
content
string
HTML markup of the body, empty to clear it
Returns
void
Inherited from
setFooterContent()
setFooterContent(
content):void
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:280
Replaces the footer with an HTML string
Parameters
content
string
HTML markup of the footer (buttons), empty to clear it
Returns
void
Inherited from
setHeaderContent()
setHeaderContent(
content):void
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:254
Replaces the header with an HTML string (an empty string keeps the current header)
Parameters
content
string
HTML markup of the header
Returns
void
Inherited from
setTitle()
setTitle(
title):void
Defined in: packages/free-drawing/src/components/Modal/Modal.ts:108
Title in header
Parameters
title
string
Text of the title (nothing without header)
Returns
void
Inherited from
show()
show(
joinRoom?,invitedBy?,joinKey?):void
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:182
Show dialog, its name field focused for a link (the name to give before joining)
Parameters
joinRoom?
string | null = null
Room of a link: user gives a name before joining it
invitedBy?
string
Id of user who shared the link
joinKey?
string
Key of the encrypted room of the link
Returns
void
Overrides
start()
start():
Promise<void>
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:199
Starts a session in a new room with the given name, error shown in a toast (server unavailable...)
Returns
Promise<void>
update()
update():
Promise<void>
Defined in: packages/free-drawing/src/components/CollaborationModal/CollaborationModal.ts:279
Owner: session (link, QR code, users and rights, stop), other users: their name only, else join form or start button
Returns
Promise<void>