@excalidraw/excalidraw 0.14.1-3a141ca → 0.14.1-6178-cc37e69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,3 +9,23 @@
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
+
13
+ /**
14
+ * @license React
15
+ * use-sync-external-store-shim.production.min.js
16
+ *
17
+ * Copyright (c) Facebook, Inc. and its affiliates.
18
+ *
19
+ * This source code is licensed under the MIT license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ */
22
+
23
+ /**
24
+ * @license React
25
+ * use-sync-external-store-shim/with-selector.production.min.js
26
+ *
27
+ * Copyright (c) Facebook, Inc. and its affiliates.
28
+ *
29
+ * This source code is licensed under the MIT license found in the
30
+ * LICENSE file in the root directory of this source tree.
31
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/excalidraw",
3
- "version": "0.14.1-3a141ca",
3
+ "version": "0.14.1-6178-cc37e69",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -6,6 +6,7 @@ import { AppProps, AppState, ExcalidrawProps, BinaryFiles } from "../types";
6
6
  import Library from "../data/library";
7
7
  import "./LayerUI.scss";
8
8
  import "./Toolbar.scss";
9
+ import tunnel from "tunnel-rat";
9
10
  interface LayerUIProps {
10
11
  actionManager: ActionManager;
11
12
  appState: AppState;
@@ -19,7 +20,6 @@ interface LayerUIProps {
19
20
  onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
20
21
  showExitZenModeBtn: boolean;
21
22
  langCode: Language["code"];
22
- isCollaborating: boolean;
23
23
  renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
24
24
  renderCustomStats?: ExcalidrawProps["renderCustomStats"];
25
25
  renderCustomSidebar?: ExcalidrawProps["renderSidebar"];
@@ -34,5 +34,15 @@ interface LayerUIProps {
34
34
  renderWelcomeScreen: boolean;
35
35
  children?: React.ReactNode;
36
36
  }
37
- declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
37
+ declare type Tunnel = ReturnType<typeof tunnel>;
38
+ export declare const TunnelsContext: React.Context<{
39
+ mainMenuTunnel: Tunnel;
40
+ welcomeScreenMenuHintTunnel: Tunnel;
41
+ welcomeScreenToolbarHintTunnel: Tunnel;
42
+ welcomeScreenHelpHintTunnel: Tunnel;
43
+ welcomeScreenCenterTunnel: Tunnel;
44
+ footerCenterTunnel: Tunnel;
45
+ jotaiScope: symbol;
46
+ }>;
47
+ declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, renderTopRightUI, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
38
48
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AppState, Device, ExcalidrawProps, UIWelcomeScreenComponents } from "../types";
2
+ import { AppState, Device, ExcalidrawProps } from "../types";
3
3
  import { ActionManager } from "../actions/manager";
4
4
  import { NonDeletedExcalidrawElement } from "../element/types";
5
5
  declare type MobileMenuProps = {
@@ -20,8 +20,6 @@ declare type MobileMenuProps = {
20
20
  renderCustomStats?: ExcalidrawProps["renderCustomStats"];
21
21
  renderSidebars: () => JSX.Element | null;
22
22
  device: Device;
23
- renderMenu: () => React.ReactNode;
24
- welcomeScreenCenter: UIWelcomeScreenComponents["Center"];
25
23
  };
26
- export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderMenu, welcomeScreenCenter, }: MobileMenuProps) => JSX.Element;
24
+ export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, }: MobileMenuProps) => JSX.Element;
27
25
  export {};
@@ -1,12 +1,11 @@
1
1
  import { ActionManager } from "../../actions/manager";
2
- import { AppState, UIChildrenComponents, UIWelcomeScreenComponents } from "../../types";
2
+ import { AppState } from "../../types";
3
3
  declare const Footer: {
4
- ({ appState, actionManager, showExitZenModeBtn, footerCenter, welcomeScreenHelp, }: {
4
+ ({ appState, actionManager, showExitZenModeBtn, renderWelcomeScreen, }: {
5
5
  appState: AppState;
6
6
  actionManager: ActionManager;
7
7
  showExitZenModeBtn: boolean;
8
- footerCenter: UIChildrenComponents["FooterCenter"];
9
- welcomeScreenHelp: UIWelcomeScreenComponents["HelpHint"];
8
+ renderWelcomeScreen: boolean;
10
9
  }): JSX.Element;
11
10
  displayName: string;
12
11
  };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export declare const withInternalFallback: <P>(componentName: string, Component: React.FC<P>) => React.FC<P & {
3
+ __fallback?: boolean | undefined;
4
+ }>;
@@ -1,13 +1,14 @@
1
1
  import React from "react";
2
2
  import * as DefaultItems from "./DefaultItems";
3
- declare const MainMenu: {
4
- ({ children, onSelect, }: {
5
- children?: React.ReactNode;
6
- /**
7
- * Called when any menu item is selected (clicked on).
8
- */
9
- onSelect?: ((event: Event) => void) | undefined;
10
- }): JSX.Element;
3
+ declare const MainMenu: React.FC<{
4
+ children?: React.ReactNode;
5
+ /**
6
+ * Called when any menu item is selected (clicked on).
7
+ */
8
+ onSelect?: ((event: Event) => void) | undefined;
9
+ } & {
10
+ __fallback?: boolean | undefined;
11
+ }> & {
11
12
  Trigger: {
12
13
  ({ className, children, onToggle, }: {
13
14
  className?: string | undefined;
@@ -55,6 +56,5 @@ declare const MainMenu: {
55
56
  displayName: string;
56
57
  };
57
58
  DefaultItems: typeof DefaultItems;
58
- displayName: string;
59
59
  };
60
60
  export default MainMenu;
@@ -2,8 +2,8 @@
2
2
  import "./WelcomeScreen.scss";
3
3
  declare const WelcomeScreen: {
4
4
  (props: {
5
- children: React.ReactNode;
6
- }): null;
5
+ children?: React.ReactNode;
6
+ }): JSX.Element;
7
7
  displayName: string;
8
8
  Center: {
9
9
  ({ children }: {
package/types/types.d.ts CHANGED
@@ -285,11 +285,12 @@ declare type CanvasActions = Partial<{
285
285
  }>;
286
286
  declare type UIOptions = Partial<{
287
287
  dockedSidebarBreakpoint: number;
288
- welcomeScreen: boolean;
289
288
  canvasActions: CanvasActions;
289
+ /** @deprecated does nothing. Will be removed in 0.15 */
290
+ welcomeScreen?: boolean;
290
291
  }>;
291
292
  export declare type AppProps = Merge<ExcalidrawProps, {
292
- UIOptions: Merge<MarkRequired<UIOptions, "welcomeScreen">, {
293
+ UIOptions: Merge<UIOptions, {
293
294
  canvasActions: Required<CanvasActions> & {
294
295
  export: ExportOpts;
295
296
  };
@@ -403,19 +404,4 @@ export declare type Device = Readonly<{
403
404
  isTouchScreen: boolean;
404
405
  canDeviceFitSidebar: boolean;
405
406
  }>;
406
- export declare type UIChildrenComponents = {
407
- [k in "FooterCenter" | "Menu" | "WelcomeScreen"]?: React.ReactElement<{
408
- children?: React.ReactNode;
409
- }, React.JSXElementConstructor<any>>;
410
- };
411
- export declare type UIWelcomeScreenComponents = {
412
- [k in "Center" | "MenuHint" | "ToolbarHint" | "HelpHint"]?: React.ReactElement<{
413
- children?: React.ReactNode;
414
- }, React.JSXElementConstructor<any>>;
415
- };
416
- export declare type UIWelcomeScreenCenterComponents = {
417
- [k in "Logo" | "Heading" | "Menu" | "MenuItemLoadScene" | "MenuItemHelp"]?: React.ReactElement<{
418
- children?: React.ReactNode;
419
- }, React.JSXElementConstructor<any>>;
420
- };
421
407
  export {};
package/types/utils.d.ts CHANGED
@@ -2,7 +2,6 @@ import { EVENT } from "./constants";
2
2
  import { FontFamilyValues, FontString } from "./element/types";
3
3
  import { AppState, LastActiveTool, Zoom } from "./types";
4
4
  import { SHAPES } from "./shapes";
5
- import React from "react";
6
5
  export declare const setDateTimeForTests: (dateTime: string) => void;
7
6
  export declare const getDateTime: () => string;
8
7
  export declare const capitalizeString: (str: string) => string;
@@ -135,21 +134,6 @@ export declare const isPrimitive: (val: any) => boolean;
135
134
  export declare const getFrame: () => "top" | "iframe";
136
135
  export declare const isPromiseLike: (value: any) => value is Promise<any>;
137
136
  export declare const queryFocusableElements: (container: HTMLElement | null) => HTMLElement[];
138
- /**
139
- * Partitions React children into named components and the rest of children.
140
- *
141
- * Returns known children as a dictionary of react children keyed by their
142
- * displayName, and the rest children as an array.
143
- *
144
- * NOTE all named react components are included in the dictionary, irrespective
145
- * of the supplied type parameter. This means you may be throwing away
146
- * children that you aren't expecting, but should nonetheless be rendered.
147
- * To guard against this (provided you care about the rest children at all),
148
- * supply a second parameter with an object with keys of the expected children.
149
- */
150
- export declare const getReactChildren: <KnownChildren extends {
151
- [x: string]: React.ReactNode;
152
- }>(children: React.ReactNode, expectedComponents?: Record<keyof KnownChildren, any> | undefined) => readonly [Partial<KnownChildren>, React.ReactNode[]];
153
137
  export declare const isShallowEqual: <T extends Record<string, any>>(objA: T, objB: T) => boolean;
154
138
  export declare const composeEventHandlers: <E>(originalEventHandler?: ((event: E) => void) | undefined, ourEventHandler?: ((event: E) => void) | undefined, { checkForDefaultPrevented }?: {
155
139
  checkForDefaultPrevented?: boolean | undefined;