|
@@ -259,18 +259,18 @@ const initializeScene = async (opts: {
|
|
|
} else if (scene) {
|
|
|
return isExternalScene && jsonBackendMatch
|
|
|
? {
|
|
|
- scene,
|
|
|
- isExternalScene,
|
|
|
- id: jsonBackendMatch[1],
|
|
|
- key: jsonBackendMatch[2],
|
|
|
- }
|
|
|
+ scene,
|
|
|
+ isExternalScene,
|
|
|
+ id: jsonBackendMatch[1],
|
|
|
+ key: jsonBackendMatch[2],
|
|
|
+ }
|
|
|
: { scene, isExternalScene: false };
|
|
|
}
|
|
|
return { scene: null, isExternalScene: false };
|
|
|
};
|
|
|
|
|
|
const PlusLinkJSX = (
|
|
|
- <p style={{ direction: "ltr", unicodeBidi: "embed" }}>
|
|
|
+ <p style={{ direction: "ltr", unicodeBidi: "embed", display: "none" }}>
|
|
|
Introducing Excalidraw+
|
|
|
<br />
|
|
|
<a
|
|
@@ -311,7 +311,7 @@ const ExcalidrawWrapper = () => {
|
|
|
const [excalidrawAPI, excalidrawRefCallback] =
|
|
|
useCallbackRefState<ExcalidrawImperativeAPI>();
|
|
|
|
|
|
- const collabAPI = useContext(CollabContext)?.api;
|
|
|
+ const collabAPI = useContext(CollabContext) ?.api;
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (!collabAPI || !excalidrawAPI) {
|
|
@@ -342,7 +342,7 @@ const ExcalidrawWrapper = () => {
|
|
|
}
|
|
|
} else {
|
|
|
const fileIds =
|
|
|
- data.scene.elements?.reduce((acc, element) => {
|
|
|
+ data.scene.elements ?.reduce((acc, element) => {
|
|
|
if (isInitializedImageElement(element)) {
|
|
|
return acc.concat(element.fileId);
|
|
|
}
|
|
@@ -445,7 +445,7 @@ const ExcalidrawWrapper = () => {
|
|
|
const elements = excalidrawAPI.getSceneElementsIncludingDeleted();
|
|
|
const currFiles = excalidrawAPI.getFiles();
|
|
|
const fileIds =
|
|
|
- elements?.reduce((acc, element) => {
|
|
|
+ elements ?.reduce((acc, element) => {
|
|
|
if (
|
|
|
isInitializedImageElement(element) &&
|
|
|
// only load and update images that aren't already loaded
|
|
@@ -514,7 +514,7 @@ const ExcalidrawWrapper = () => {
|
|
|
appState: AppState,
|
|
|
files: BinaryFiles,
|
|
|
) => {
|
|
|
- if (collabAPI?.isCollaborating()) {
|
|
|
+ if (collabAPI ?.isCollaborating()) {
|
|
|
collabAPI.broadcastElements(elements);
|
|
|
} else {
|
|
|
saveDebounced(elements, appState, files, () => {
|
|
@@ -694,9 +694,9 @@ const ExcalidrawWrapper = () => {
|
|
|
ref={excalidrawRefCallback}
|
|
|
onChange={onChange}
|
|
|
initialData={initialStatePromiseRef.current.promise}
|
|
|
- onCollabButtonClick={collabAPI?.onCollabButtonClick}
|
|
|
- isCollaborating={collabAPI?.isCollaborating()}
|
|
|
- onPointerUpdate={collabAPI?.onPointerUpdate}
|
|
|
+ onCollabButtonClick={collabAPI ?.onCollabButtonClick}
|
|
|
+ isCollaborating={collabAPI ?.isCollaborating()}
|
|
|
+ onPointerUpdate={collabAPI ?.onPointerUpdate}
|
|
|
UIOptions={{
|
|
|
canvasActions: {
|
|
|
export: {
|
|
@@ -708,7 +708,7 @@ const ExcalidrawWrapper = () => {
|
|
|
appState={appState}
|
|
|
files={files}
|
|
|
onError={(error) => {
|
|
|
- excalidrawAPI?.updateScene({
|
|
|
+ excalidrawAPI ?.updateScene({
|
|
|
appState: {
|
|
|
errorMessage: error.message,
|
|
|
},
|