@excalidraw/common 0.18.0-835eb8d → 0.18.0-8608d7b

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.
Files changed (49) hide show
  1. package/dist/dev/index.js +4 -0
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +2 -2
  4. package/dist/types/common/src/constants.d.ts +3 -0
  5. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +15 -3
  6. package/dist/types/excalidraw/actions/actionBoundText.d.ts +10 -2
  7. package/dist/types/excalidraw/actions/actionCanvas.d.ts +65 -13
  8. package/dist/types/excalidraw/actions/actionClipboard.d.ts +30 -6
  9. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +5 -1
  10. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +15 -3
  11. package/dist/types/excalidraw/actions/actionElementLink.d.ts +5 -1
  12. package/dist/types/excalidraw/actions/actionElementLock.d.ts +10 -2
  13. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +5 -1
  14. package/dist/types/excalidraw/actions/actionExport.d.ts +45 -9
  15. package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -2
  16. package/dist/types/excalidraw/actions/actionFrame.d.ts +20 -4
  17. package/dist/types/excalidraw/actions/actionGroup.d.ts +10 -2
  18. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +5 -1
  19. package/dist/types/excalidraw/actions/actionLink.d.ts +5 -1
  20. package/dist/types/excalidraw/actions/actionMenu.d.ts +15 -3
  21. package/dist/types/excalidraw/actions/actionNavigate.d.ts +10 -2
  22. package/dist/types/excalidraw/actions/actionProperties.d.ts +76 -16
  23. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +5 -1
  24. package/dist/types/excalidraw/actions/actionStyles.d.ts +5 -1
  25. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +5 -1
  26. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -1
  27. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +5 -1
  28. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +5 -1
  29. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +5 -1
  30. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +5 -1
  31. package/dist/types/excalidraw/appState.d.ts +4 -1
  32. package/dist/types/excalidraw/components/Actions.d.ts +9 -2
  33. package/dist/types/excalidraw/components/App.d.ts +8 -3
  34. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -1
  35. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  36. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
  37. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
  38. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  39. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +2 -1
  40. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  41. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
  42. package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
  43. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  44. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  45. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  46. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  47. package/dist/types/excalidraw/components/icons.d.ts +0 -1
  48. package/dist/types/excalidraw/types.d.ts +7 -2
  49. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import "./ToolPopover.scss";
3
+ import type { AppClassProperties } from "../types";
4
+ type ToolOption = {
5
+ type: string;
6
+ icon: React.ReactNode;
7
+ title?: string;
8
+ };
9
+ type ToolPopoverProps = {
10
+ app: AppClassProperties;
11
+ options: readonly ToolOption[];
12
+ activeTool: {
13
+ type: string;
14
+ };
15
+ defaultOption: string;
16
+ className?: string;
17
+ namePrefix: string;
18
+ title: string;
19
+ "data-testid": string;
20
+ onToolChange: (type: string) => void;
21
+ displayedOption: ToolOption;
22
+ fillable?: boolean;
23
+ };
24
+ export declare const ToolPopover: ({ app, options, activeTool, defaultOption, className, namePrefix, title, "data-testid": dataTestId, onToolChange, displayedOption, fillable, }: ToolPopoverProps) => import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import "./DropdownMenu.scss";
3
3
  declare const DropdownMenu: {
4
- ({ children, open, }: {
4
+ ({ children, open, placement, }: {
5
5
  children?: React.ReactNode;
6
6
  open: boolean;
7
+ placement?: "top" | "bottom" | undefined;
7
8
  }): import("react/jsx-runtime").JSX.Element;
8
9
  Trigger: {
9
10
  ({ className, children, onToggle, title, ...rest }: {
@@ -15,12 +16,13 @@ declare const DropdownMenu: {
15
16
  displayName: string;
16
17
  };
17
18
  Content: {
18
- ({ children, onClickOutside, className, onSelect, style, }: {
19
+ ({ children, onClickOutside, className, onSelect, style, placement, }: {
19
20
  children?: React.ReactNode;
20
21
  onClickOutside?: (() => void) | undefined;
21
22
  className?: string | undefined;
22
23
  onSelect?: ((event: Event) => void) | undefined;
23
24
  style?: React.CSSProperties | undefined;
25
+ placement?: "top" | "bottom" | undefined;
24
26
  }): import("react/jsx-runtime").JSX.Element;
25
27
  displayName: string;
26
28
  };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  declare const MenuContent: {
3
- ({ children, onClickOutside, className, onSelect, style, }: {
3
+ ({ children, onClickOutside, className, onSelect, style, placement, }: {
4
4
  children?: React.ReactNode;
5
5
  onClickOutside?: (() => void) | undefined;
6
6
  className?: string | undefined;
@@ -9,6 +9,7 @@ declare const MenuContent: {
9
9
  */
10
10
  onSelect?: ((event: Event) => void) | undefined;
11
11
  style?: React.CSSProperties | undefined;
12
+ placement?: "top" | "bottom" | undefined;
12
13
  }): import("react/jsx-runtime").JSX.Element;
13
14
  displayName: string;
14
15
  };
@@ -226,6 +226,5 @@ export declare const cropIcon: import("react/jsx-runtime").JSX.Element;
226
226
  export declare const elementLinkIcon: import("react/jsx-runtime").JSX.Element;
227
227
  export declare const resizeIcon: import("react/jsx-runtime").JSX.Element;
228
228
  export declare const adjustmentsIcon: import("react/jsx-runtime").JSX.Element;
229
- export declare const backgroundIcon: import("react/jsx-runtime").JSX.Element;
230
229
  export declare const strokeIcon: import("react/jsx-runtime").JSX.Element;
231
230
  export {};
@@ -221,6 +221,10 @@ export interface AppState {
221
221
  locked: boolean;
222
222
  fromSelection: boolean;
223
223
  } & ActiveTool;
224
+ preferredSelectionTool: {
225
+ type: "selection" | "lasso";
226
+ initialized: boolean;
227
+ };
224
228
  penMode: boolean;
225
229
  penDetected: boolean;
226
230
  exportBackground: boolean;
@@ -352,7 +356,7 @@ export interface AppState {
352
356
  [groupId: string]: true;
353
357
  };
354
358
  /** properties sidebar mode - determines whether to show compact or complete sidebar */
355
- stylesPanelMode: "compact" | "full";
359
+ stylesPanelMode: "compact" | "full" | "mobile";
356
360
  }
357
361
  export type SearchMatch = {
358
362
  id: string;
@@ -443,6 +447,7 @@ export interface ExcalidrawProps {
443
447
  onDuplicate?: (nextElements: readonly ExcalidrawElement[],
444
448
  /** excludes the duplicated elements */
445
449
  prevElements: readonly ExcalidrawElement[]) => ExcalidrawElement[] | void;
450
+ renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
446
451
  renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
447
452
  langCode?: Language["code"];
448
453
  viewModeEnabled?: boolean;
@@ -559,7 +564,7 @@ export type AppClassProperties = {
559
564
  excalidrawContainerValue: App["excalidrawContainerValue"];
560
565
  onPointerUpEmitter: App["onPointerUpEmitter"];
561
566
  updateEditorAtom: App["updateEditorAtom"];
562
- defaultSelectionTool: "selection" | "lasso";
567
+ onPointerDownEmitter: App["onPointerDownEmitter"];
563
568
  };
564
569
  export type PointerDownState = Readonly<{
565
570
  origin: Readonly<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/common",
3
- "version": "0.18.0-835eb8d",
3
+ "version": "0.18.0-8608d7b",
4
4
  "type": "module",
5
5
  "types": "./dist/types/common/src/index.d.ts",
6
6
  "main": "./dist/prod/index.js",