@myoc/common 0.19.502-ff5a131b0 → 0.19.504

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 (115) hide show
  1. package/dist/dev/index.js +313 -21
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/debug.d.ts +21 -0
  5. package/dist/types/common/src/appEventBus.d.ts +27 -0
  6. package/dist/types/common/src/colors.d.ts +13 -13
  7. package/dist/types/common/src/constants.d.ts +3 -0
  8. package/dist/types/common/src/index.d.ts +3 -0
  9. package/dist/types/common/src/utils.d.ts +4 -7
  10. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  11. package/dist/types/element/src/Scene.d.ts +2 -0
  12. package/dist/types/element/src/arrange-algorithms/maxRects.d.ts +16 -0
  13. package/dist/types/element/src/arrowheads.d.ts +3 -0
  14. package/dist/types/element/src/arrows/focus.d.ts +27 -0
  15. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  16. package/dist/types/element/src/binding.d.ts +13 -8
  17. package/dist/types/element/src/bounds.d.ts +1 -1
  18. package/dist/types/element/src/collision.d.ts +4 -3
  19. package/dist/types/element/src/distribute.d.ts +2 -1
  20. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  21. package/dist/types/element/src/index.d.ts +4 -0
  22. package/dist/types/element/src/linearElementEditor.d.ts +6 -1
  23. package/dist/types/element/src/mutateElement.d.ts +2 -0
  24. package/dist/types/element/src/selection.d.ts +6 -2
  25. package/dist/types/element/src/shapes.d.ts +2 -22
  26. package/dist/types/element/src/textElement.d.ts +1 -1
  27. package/dist/types/element/src/textWrapping.d.ts +26 -0
  28. package/dist/types/element/src/types.d.ts +6 -3
  29. package/dist/types/element/src/utils.d.ts +5 -3
  30. package/dist/types/element/src/zindex.d.ts +1 -1
  31. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +38 -35
  32. package/dist/types/excalidraw/actions/actionBoundText.d.ts +27 -25
  33. package/dist/types/excalidraw/actions/actionCanvas.d.ts +143 -132
  34. package/dist/types/excalidraw/actions/actionClipboard.d.ts +26 -24
  35. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -12
  36. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +42 -37
  37. package/dist/types/excalidraw/actions/actionElementLink.d.ts +9 -12
  38. package/dist/types/excalidraw/actions/actionElementLock.d.ts +26 -24
  39. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -12
  40. package/dist/types/excalidraw/actions/actionExport.d.ts +112 -405
  41. package/dist/types/excalidraw/actions/actionFrame.d.ts +52 -48
  42. package/dist/types/excalidraw/actions/actionGroup.d.ts +29 -27
  43. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -12
  44. package/dist/types/excalidraw/actions/actionLink.d.ts +13 -12
  45. package/dist/types/excalidraw/actions/actionMenu.d.ts +9 -12
  46. package/dist/types/excalidraw/actions/actionProperties.d.ts +30 -28
  47. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +15 -14
  48. package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -11
  49. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  50. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +181 -0
  51. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +13 -12
  52. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +181 -0
  53. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -12
  54. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +9 -12
  55. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -12
  56. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +13 -12
  57. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -12
  58. package/dist/types/excalidraw/actions/index.d.ts +2 -0
  59. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  60. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  61. package/dist/types/excalidraw/appState.d.ts +34 -32
  62. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  63. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  64. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  65. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  66. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  67. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  68. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  69. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  70. package/dist/types/excalidraw/clipboard.d.ts +8 -9
  71. package/dist/types/excalidraw/components/App.d.ts +57 -14
  72. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  73. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
  74. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  75. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  76. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  77. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  78. package/dist/types/excalidraw/components/Toast.d.ts +8 -4
  79. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  80. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -17
  81. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
  82. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -13
  83. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  84. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  85. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  86. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  87. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  88. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  89. package/dist/types/excalidraw/components/icons.d.ts +23 -9
  90. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +17 -0
  91. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -13
  92. package/dist/types/excalidraw/data/blob.d.ts +163 -162
  93. package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
  94. package/dist/types/excalidraw/data/index.d.ts +2 -3
  95. package/dist/types/excalidraw/data/json.d.ts +92 -83
  96. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  97. package/dist/types/excalidraw/editorPreferences.d.ts +11 -0
  98. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  99. package/dist/types/excalidraw/types.d.ts +114 -16
  100. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
  101. package/dist/types/math/src/point.d.ts +7 -2
  102. package/dist/types/math/src/types.d.ts +25 -1
  103. package/package.json +1 -1
  104. package/dist/types/excalidraw/charts.d.ts +0 -27
  105. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  106. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
  107. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  108. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  109. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
  110. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  111. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  112. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
  113. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  114. package/dist/types/excalidraw/index.d.ts +0 -42
  115. package/dist/types/excalidraw/polyfill.d.ts +0 -2
@@ -1,27 +0,0 @@
1
- import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- export type ChartElements = readonly NonDeletedExcalidrawElement[];
3
- export interface Spreadsheet {
4
- title: string | null;
5
- labels: string[] | null;
6
- values: number[];
7
- }
8
- export declare const NOT_SPREADSHEET = "NOT_SPREADSHEET";
9
- export declare const VALID_SPREADSHEET = "VALID_SPREADSHEET";
10
- type ParseSpreadsheetResult = {
11
- type: typeof NOT_SPREADSHEET;
12
- reason: string;
13
- } | {
14
- type: typeof VALID_SPREADSHEET;
15
- spreadsheet: Spreadsheet;
16
- };
17
- /**
18
- * @private exported for testing
19
- */
20
- export declare const tryParseNumber: (s: string) => number | null;
21
- /**
22
- * @private exported for testing
23
- */
24
- export declare const tryParseCells: (cells: string[][]) => ParseSpreadsheetResult;
25
- export declare const tryParseSpreadsheet: (text: string) => ParseSpreadsheetResult;
26
- export declare const renderSpreadsheet: (chartType: string, spreadsheet: Spreadsheet, x: number, y: number) => ChartElements;
27
- export {};
@@ -1,4 +0,0 @@
1
- import type { GenerateDiagramToCode } from "../../types";
2
- export declare const DiagramToCodePlugin: (props: {
3
- generate: GenerateDiagramToCode;
4
- }) => null;
@@ -1,15 +0,0 @@
1
- import "./ExcalidrawLogo.scss";
2
- type LogoSize = "xs" | "small" | "normal" | "large" | "custom" | "mobile";
3
- interface LogoProps {
4
- size?: LogoSize;
5
- withText?: boolean;
6
- style?: React.CSSProperties;
7
- /**
8
- * If true, the logo will not be wrapped in a Link component.
9
- * The link prop will be ignored as well.
10
- * It will merely be a plain div.
11
- */
12
- isNotLink?: boolean;
13
- }
14
- export declare const ExcalidrawLogo: ({ style, size, withText, }: LogoProps) => import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import type { Theme } from "@excalidraw/element/types";
3
- import type { Language } from "../i18n";
4
- interface Props {
5
- langCode: Language["code"];
6
- children: React.ReactElement;
7
- theme?: Theme;
8
- }
9
- export declare const InitializeApp: (props: Props) => import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,8 +0,0 @@
1
- import "./FooterCenter.scss";
2
- declare const FooterCenter: {
3
- ({ children }: {
4
- children?: React.ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- };
8
- export default FooterCenter;
@@ -1,11 +0,0 @@
1
- import { type EditorInterface } from "@excalidraw/common";
2
- import "./LiveCollaborationTrigger.scss";
3
- declare const LiveCollaborationTrigger: {
4
- ({ isCollaborating, onSelect, editorInterface, ...rest }: {
5
- isCollaborating: boolean;
6
- onSelect: () => void;
7
- editorInterface?: EditorInterface;
8
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
9
- displayName: string;
10
- };
11
- export default LiveCollaborationTrigger;
@@ -1,58 +0,0 @@
1
- import type { JSX } from "react";
2
- declare const Center: {
3
- ({ children }: {
4
- children?: React.ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- Logo: {
8
- ({ children }: {
9
- children?: React.ReactNode;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- Heading: {
14
- ({ children }: {
15
- children: React.ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- displayName: string;
18
- };
19
- Menu: {
20
- ({ children }: {
21
- children?: React.ReactNode;
22
- }): import("react/jsx-runtime").JSX.Element;
23
- displayName: string;
24
- };
25
- MenuItem: {
26
- ({ onSelect, children, icon, shortcut, className, ...props }: {
27
- onSelect: () => void;
28
- children: React.ReactNode;
29
- icon?: JSX.Element;
30
- shortcut?: string | null;
31
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
32
- displayName: string;
33
- };
34
- MenuItemLink: {
35
- ({ children, href, icon, shortcut, className, ...props }: {
36
- children: React.ReactNode;
37
- href: string;
38
- icon?: JSX.Element;
39
- shortcut?: string | null;
40
- } & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
41
- displayName: string;
42
- };
43
- MenuItemHelp: {
44
- (): import("react/jsx-runtime").JSX.Element;
45
- displayName: string;
46
- };
47
- MenuItemLoadScene: {
48
- (): import("react/jsx-runtime").JSX.Element | null;
49
- displayName: string;
50
- };
51
- MenuItemLiveCollaborationTrigger: {
52
- ({ onSelect, }: {
53
- onSelect: () => any;
54
- }): import("react/jsx-runtime").JSX.Element;
55
- displayName: string;
56
- };
57
- };
58
- export { Center };
@@ -1,19 +0,0 @@
1
- declare const MenuHint: {
2
- ({ children }: {
3
- children?: React.ReactNode;
4
- }): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
7
- declare const ToolbarHint: {
8
- ({ children }: {
9
- children?: React.ReactNode;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- declare const HelpHint: {
14
- ({ children }: {
15
- children?: React.ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- displayName: string;
18
- };
19
- export { HelpHint, MenuHint, ToolbarHint };
@@ -1,84 +0,0 @@
1
- import "./WelcomeScreen.scss";
2
- declare const WelcomeScreen: {
3
- (props: {
4
- children?: React.ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- Center: {
8
- ({ children }: {
9
- children?: React.ReactNode;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- Logo: {
13
- ({ children }: {
14
- children?: React.ReactNode;
15
- }): import("react/jsx-runtime").JSX.Element;
16
- displayName: string;
17
- };
18
- Heading: {
19
- ({ children }: {
20
- children: React.ReactNode;
21
- }): import("react/jsx-runtime").JSX.Element;
22
- displayName: string;
23
- };
24
- Menu: {
25
- ({ children }: {
26
- children?: React.ReactNode;
27
- }): import("react/jsx-runtime").JSX.Element;
28
- displayName: string;
29
- };
30
- MenuItem: {
31
- ({ onSelect, children, icon, shortcut, className, ...props }: {
32
- onSelect: () => void;
33
- children: React.ReactNode;
34
- icon?: import("react").JSX.Element;
35
- shortcut?: string | null;
36
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
37
- displayName: string;
38
- };
39
- MenuItemLink: {
40
- ({ children, href, icon, shortcut, className, ...props }: {
41
- children: React.ReactNode;
42
- href: string;
43
- icon?: import("react").JSX.Element;
44
- shortcut?: string | null;
45
- } & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
46
- displayName: string;
47
- };
48
- MenuItemHelp: {
49
- (): import("react/jsx-runtime").JSX.Element;
50
- displayName: string;
51
- };
52
- MenuItemLoadScene: {
53
- (): import("react/jsx-runtime").JSX.Element | null;
54
- displayName: string;
55
- };
56
- MenuItemLiveCollaborationTrigger: {
57
- ({ onSelect, }: {
58
- onSelect: () => any;
59
- }): import("react/jsx-runtime").JSX.Element;
60
- displayName: string;
61
- };
62
- };
63
- Hints: {
64
- MenuHint: {
65
- ({ children }: {
66
- children?: React.ReactNode;
67
- }): import("react/jsx-runtime").JSX.Element;
68
- displayName: string;
69
- };
70
- ToolbarHint: {
71
- ({ children }: {
72
- children?: React.ReactNode;
73
- }): import("react/jsx-runtime").JSX.Element;
74
- displayName: string;
75
- };
76
- HelpHint: {
77
- ({ children }: {
78
- children?: React.ReactNode;
79
- }): import("react/jsx-runtime").JSX.Element;
80
- displayName: string;
81
- };
82
- };
83
- };
84
- export default WelcomeScreen;
@@ -1,7 +0,0 @@
1
- import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { MakeBrand } from "@excalidraw/common/utility-types";
3
- import type { AppState } from "../types";
4
- export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
5
- export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
6
- export declare const shouldDiscardRemoteElement: (localAppState: AppState, local: OrderedExcalidrawElement | undefined, remote: RemoteExcalidrawElement) => boolean;
7
- export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
@@ -1,42 +0,0 @@
1
- import React from "react";
2
- import Footer from "./components/footer/FooterCenter";
3
- import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
4
- import MainMenu from "./components/main-menu/MainMenu";
5
- import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
6
- import "./css/app.scss";
7
- import "./css/styles.scss";
8
- import "./fonts/fonts.css";
9
- import type { ExcalidrawProps } from "./types";
10
- export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
11
- export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements, } from "@excalidraw/element";
12
- export { getTextFromElements } from "@excalidraw/element";
13
- export { isInvisiblySmallElement } from "@excalidraw/element";
14
- export { defaultLang, useI18n, languages } from "./i18n";
15
- export { restoreAppState, restoreElement, restoreElements, restoreLibraryItems, } from "./data/restore";
16
- export { reconcileElements } from "./data/reconcile";
17
- export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "@excalidraw/utils/export";
18
- export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
19
- export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
20
- export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
21
- export { isLinearElement } from "@excalidraw/element";
22
- export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, getFormFactor, } from "@excalidraw/common";
23
- export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element";
24
- export { CaptureUpdateAction } from "@excalidraw/element";
25
- export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
26
- export { Sidebar } from "./components/Sidebar/Sidebar";
27
- export { Button } from "./components/Button";
28
- export { Footer };
29
- export { MainMenu };
30
- export { Ellipsify } from "./components/Ellipsify";
31
- export { useEditorInterface, useStylesPanelMode } from "./components/App";
32
- export { WelcomeScreen };
33
- export { LiveCollaborationTrigger };
34
- export { Stats } from "./components/Stats";
35
- export { DefaultSidebar } from "./components/DefaultSidebar";
36
- export { zoomToFitBounds } from "./actions/actionCanvas";
37
- export { getCommonBounds, getVisibleSceneBounds, convertToExcalidrawElements, } from "@excalidraw/element";
38
- export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "@excalidraw/utils/withinBounds";
39
- export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
40
- export { getDataURL } from "./data/blob";
41
- export { isElementLink } from "@excalidraw/element";
42
- export { setCustomTextMetricsProvider } from "@excalidraw/element";
@@ -1,2 +0,0 @@
1
- declare const polyfill: () => void;
2
- export default polyfill;