@remotion/studio 4.0.501 → 4.0.503

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 (171) hide show
  1. package/dist/components/AssetSelectorItem.js +4 -4
  2. package/dist/components/Canvas.js +37 -57
  3. package/dist/components/ColorPicker/AlphaSlider.js +14 -10
  4. package/dist/components/ColorPicker/HueSlider.js +14 -10
  5. package/dist/components/ColorPicker/SaturationValueArea.js +14 -12
  6. package/dist/components/CompositionContextButton.js +1 -1
  7. package/dist/components/CompositionSelector.js +4 -4
  8. package/dist/components/CompositionSelectorItem.js +5 -5
  9. package/dist/components/ConfigureDefaultEditorModal.d.ts +2 -0
  10. package/dist/components/ConfigureDefaultEditorModal.js +151 -0
  11. package/dist/components/ConfirmationDialog.js +6 -3
  12. package/dist/components/ContextMenu.js +0 -2
  13. package/dist/components/Editor.js +1 -4
  14. package/dist/components/EditorContent.js +1 -1
  15. package/dist/components/EditorGuides/Guide.js +48 -74
  16. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  17. package/dist/components/EditorRuler/Ruler.js +3 -1
  18. package/dist/components/EditorRuler/index.js +26 -23
  19. package/dist/components/ElementInstallConfirmation.d.ts +12 -0
  20. package/dist/components/ElementInstallConfirmation.js +205 -0
  21. package/dist/components/ForceSpecificCursor.js +14 -0
  22. package/dist/components/FullscreenToggle.d.ts +3 -1
  23. package/dist/components/FullscreenToggle.js +2 -2
  24. package/dist/components/InlineAction.d.ts +2 -1
  25. package/dist/components/InlineAction.js +4 -4
  26. package/dist/components/InspectorLocationCopy.d.ts +1 -0
  27. package/dist/components/InspectorLocationCopy.js +7 -3
  28. package/dist/components/InspectorOpenInEditor.d.ts +5 -0
  29. package/dist/components/InspectorOpenInEditor.js +135 -0
  30. package/dist/components/InspectorPanel/AlignmentControls.js +1 -1
  31. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +3 -3
  32. package/dist/components/InspectorPanel/CompositionMetadata.js +1 -1
  33. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +2 -2
  34. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -2
  35. package/dist/components/InspectorPanel/use-composition-actions.d.ts +1 -1
  36. package/dist/components/InspectorPanel/use-composition-actions.js +46 -3
  37. package/dist/components/InspectorSequenceSection.js +2 -2
  38. package/dist/components/LoopToggle.d.ts +1 -0
  39. package/dist/components/LoopToggle.js +9 -5
  40. package/dist/components/Menu/MenuItem.js +13 -6
  41. package/dist/components/Menu/MenuSubItem.js +11 -1
  42. package/dist/components/MenuBuildIndicator.js +1 -1
  43. package/dist/components/MenuCompositionName.js +1 -1
  44. package/dist/components/MobilePanel.js +5 -1
  45. package/dist/components/ModalContainer.js +1 -1
  46. package/dist/components/ModalFooter.d.ts +1 -0
  47. package/dist/components/ModalFooter.js +2 -2
  48. package/dist/components/Modals.js +11 -2
  49. package/dist/components/NewComposition/InputDragger.js +19 -29
  50. package/dist/components/ObserveDefaultPropsContext.js +7 -4
  51. package/dist/components/PlayPause.d.ts +1 -0
  52. package/dist/components/PlayPause.js +2 -4
  53. package/dist/components/PlaybackRateSelector.d.ts +9 -2
  54. package/dist/components/PlaybackRateSelector.js +21 -10
  55. package/dist/components/PreviewToolbar.js +19 -109
  56. package/dist/components/PreviewToolbarOverflowButton.d.ts +12 -0
  57. package/dist/components/PreviewToolbarOverflowButton.js +217 -0
  58. package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +1 -0
  59. package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +1 -0
  60. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +16 -1
  61. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -0
  62. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +7 -1
  63. package/dist/components/RenderButton.d.ts +1 -0
  64. package/dist/components/RenderButton.js +6 -4
  65. package/dist/components/RenderModal/InlineEyeIcon.js +1 -1
  66. package/dist/components/RenderModal/InlineRemoveButton.js +1 -1
  67. package/dist/components/RenderModal/RenderModalOutputName.js +1 -1
  68. package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +1 -1
  69. package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +1 -1
  70. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +1 -1
  71. package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +1 -1
  72. package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +1 -1
  73. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -1
  74. package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
  75. package/dist/components/SelectedOutlineCropControls.js +7 -6
  76. package/dist/components/SelectedOutlineElement.js +28 -26
  77. package/dist/components/SelectedOutlineUvControls.js +25 -24
  78. package/dist/components/ShowGuidesProvider.js +2 -0
  79. package/dist/components/SidebarCollapserControls.js +2 -2
  80. package/dist/components/SidebarRenderButton.js +1 -1
  81. package/dist/components/SizeSelector.d.ts +6 -0
  82. package/dist/components/SizeSelector.js +17 -8
  83. package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
  84. package/dist/components/Splitter/SplitterContainer.js +23 -3
  85. package/dist/components/Splitter/SplitterContext.d.ts +14 -0
  86. package/dist/components/Splitter/SplitterContext.js +16 -1
  87. package/dist/components/Splitter/SplitterHandle.js +25 -74
  88. package/dist/components/Timeline/EasingEditorModal.js +27 -19
  89. package/dist/components/Timeline/Timeline.js +2 -1
  90. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  91. package/dist/components/Timeline/TimelineAssetField.js +37 -2
  92. package/dist/components/Timeline/TimelineDragHandler.js +39 -8
  93. package/dist/components/Timeline/TimelineInOutDragHandler.js +26 -11
  94. package/dist/components/Timeline/TimelineLayerEye.js +36 -4
  95. package/dist/components/Timeline/TimelineSelection.js +14 -21
  96. package/dist/components/Timeline/TimelineSequence.js +7 -3
  97. package/dist/components/Timeline/TimelineSequenceItem.js +24 -18
  98. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +1 -1
  99. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +76 -43
  100. package/dist/components/Timeline/TimelineStack/get-stack.js +13 -0
  101. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +4 -2
  102. package/dist/components/Timeline/get-sequence-context-menu-items.js +38 -2
  103. package/dist/components/Timeline/save-sequence-prop.js +4 -4
  104. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -2
  105. package/dist/components/Timeline/sequence-props-subscription-store.js +3 -3
  106. package/dist/components/Timeline/should-subscribe-to-source-file.d.ts +1 -0
  107. package/dist/components/Timeline/should-subscribe-to-source-file.js +11 -0
  108. package/dist/components/Timeline/use-open-sequence-in-editor.d.ts +3 -1
  109. package/dist/components/Timeline/use-open-sequence-in-editor.js +5 -2
  110. package/dist/components/Timeline/use-sequence-props-subscription.js +2 -0
  111. package/dist/components/Timeline/use-timeline-asset-drop.js +0 -4
  112. package/dist/components/Timeline/use-timeline-keyframe-drag.js +31 -16
  113. package/dist/components/TopPanel.js +1 -1
  114. package/dist/components/UndoRedoButtons.js +1 -1
  115. package/dist/components/UpdateCheck.d.ts +2 -0
  116. package/dist/components/UpdateCheck.js +20 -8
  117. package/dist/components/UpdateModal/UpdateModal.js +26 -10
  118. package/dist/components/VisualControls/ClickableFileName.js +5 -2
  119. package/dist/components/composition-menu-items.js +1 -1
  120. package/dist/components/default-props-api.d.ts +3 -0
  121. package/dist/components/default-props-api.js +19 -0
  122. package/dist/components/drop-handler-data.d.ts +1 -1
  123. package/dist/components/drop-handler-data.js +6 -6
  124. package/dist/components/effect-drag-and-drop.d.ts +1 -1
  125. package/dist/components/effect-drag-and-drop.js +3 -3
  126. package/dist/components/element-drag-and-drop.d.ts +1 -1
  127. package/dist/components/element-drag-and-drop.js +3 -3
  128. package/dist/components/element-install-request.d.ts +3 -0
  129. package/dist/components/element-install-request.js +17 -0
  130. package/dist/components/folder-menu-items.js +1 -1
  131. package/dist/components/handle-drop.d.ts +2 -3
  132. package/dist/components/handle-drop.js +11 -4
  133. package/dist/components/import-assets.d.ts +9 -9
  134. package/dist/components/import-assets.js +4 -15
  135. package/dist/components/sequence-props-api.d.ts +4 -0
  136. package/dist/components/sequence-props-api.js +26 -0
  137. package/dist/components/use-default-editor-info.d.ts +4 -0
  138. package/dist/components/use-default-editor-info.js +47 -0
  139. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -0
  140. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +29 -5
  141. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -20
  142. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +1 -1
  143. package/dist/error-overlay/remotion-overlay/StackFrame.js +1 -1
  144. package/dist/esm/{chunk-n1kj09yv.js → chunk-bj1r1hh5.js} +8153 -6662
  145. package/dist/esm/internals.mjs +8153 -6662
  146. package/dist/esm/previewEntry.mjs +8210 -6719
  147. package/dist/esm/renderEntry.mjs +1 -1
  148. package/dist/helpers/inject-css.js +18 -44
  149. package/dist/helpers/open-in-editor.d.ts +3 -3
  150. package/dist/helpers/open-in-editor.js +10 -6
  151. package/dist/helpers/pointer-session.d.ts +9 -0
  152. package/dist/helpers/pointer-session.js +94 -0
  153. package/dist/helpers/use-menu-structure.js +24 -2
  154. package/dist/icons/custom-editor.d.ts +4 -0
  155. package/dist/icons/custom-editor.js +11 -0
  156. package/dist/icons/editor.d.ts +6 -0
  157. package/dist/icons/editor.js +52 -0
  158. package/dist/icons/upload.d.ts +4 -0
  159. package/dist/icons/upload.js +8 -0
  160. package/dist/state/editor-guides.d.ts +1 -0
  161. package/dist/state/editor-guides.js +1 -0
  162. package/dist/state/modals.d.ts +3 -0
  163. package/dist/state/z-index.d.ts +1 -0
  164. package/dist/state/z-index.js +34 -18
  165. package/package.json +12 -13
  166. package/dist/components/StudioCanvasCapture.d.ts +0 -5
  167. package/dist/components/StudioCanvasCapture.js +0 -40
  168. package/dist/components/canvas-capture-enabled.d.ts +0 -1
  169. package/dist/components/canvas-capture-enabled.js +0 -4
  170. package/dist/components/use-element-overwrite-confirmation.d.ts +0 -2
  171. package/dist/components/use-element-overwrite-confirmation.js +0 -73
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
7
  const z_index_1 = require("../state/z-index");
8
- const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor = colors_1.LIGHT_TEXT, }) => {
8
+ const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor = colors_1.LIGHT_TEXT, variant, }) => {
9
9
  const { tabIndex } = (0, z_index_1.useZIndex)();
10
10
  const [hovered, setHovered] = (0, react_1.useState)(false);
11
11
  const onPointerEnter = (0, react_1.useCallback)(() => {
@@ -21,7 +21,7 @@ const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor =
21
21
  ? colors_1.TRANSPARENT
22
22
  : (0, colors_1.getBackgroundFromHoverState)({ hovered, selected: false }),
23
23
  height: 24,
24
- width: 24,
24
+ width: variant === 'compact' ? 14 : 24,
25
25
  padding: 0,
26
26
  display: 'inline-flex',
27
27
  justifyContent: 'center',
@@ -30,7 +30,7 @@ const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor =
30
30
  opacity: disabled ? 0.5 : 1,
31
31
  pointerEvents: disabled ? 'none' : 'auto',
32
32
  };
33
- }, [disabled, hovered]);
34
- return (jsx_runtime_1.jsx("button", { type: "button", disabled: disabled, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, children: renderAction(hovered ? colors_1.WHITE : unhoveredColor) }));
33
+ }, [disabled, hovered, variant]);
34
+ return (jsx_runtime_1.jsx("button", { type: "button", disabled: disabled, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, "aria-label": title, children: renderAction(hovered ? colors_1.WHITE : unhoveredColor) }));
35
35
  };
36
36
  exports.InlineAction = InlineAction;
@@ -4,4 +4,5 @@ export declare const InspectorLocationCopy: React.FC<{
4
4
  readonly children: React.ReactNode;
5
5
  readonly location: OriginalPosition | null;
6
6
  readonly name: string | null;
7
+ readonly openInEditorLocation: OriginalPosition | null;
7
8
  }>;
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const format_file_location_1 = require("../helpers/format-file-location");
7
7
  const clipboard_1 = require("../icons/clipboard");
8
8
  const InlineAction_1 = require("./InlineAction");
9
+ const InspectorOpenInEditor_1 = require("./InspectorOpenInEditor");
9
10
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
10
11
  const row = {
11
12
  alignItems: 'center',
@@ -22,6 +23,8 @@ const content = {
22
23
  overflow: 'hidden',
23
24
  };
24
25
  const action = {
26
+ alignItems: 'center',
27
+ display: 'flex',
25
28
  flexShrink: 0,
26
29
  height: 24,
27
30
  marginLeft: 0,
@@ -32,7 +35,7 @@ const icon = {
32
35
  height: 12,
33
36
  width: 12,
34
37
  };
35
- const InspectorLocationCopy = ({ children, location, name }) => {
38
+ const InspectorLocationCopy = ({ children, location, name, openInEditorLocation }) => {
36
39
  const [hovered, setHovered] = (0, react_1.useState)(false);
37
40
  const [focusedWithin, setFocusedWithin] = (0, react_1.useState)(false);
38
41
  const textToCopy = (0, react_1.useMemo)(() => {
@@ -56,10 +59,11 @@ const InspectorLocationCopy = ({ children, location, name }) => {
56
59
  }, [textToCopy]);
57
60
  const showAction = hovered || focusedWithin;
58
61
  return (jsx_runtime_1.jsxs("div", { style: row, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), onFocus: () => setFocusedWithin(true), onBlur: () => setFocusedWithin(false), children: [
59
- jsx_runtime_1.jsx("div", { style: content, children: children }), textToCopy ? (jsx_runtime_1.jsx("div", { style: {
62
+ jsx_runtime_1.jsx("div", { style: content, children: children }), textToCopy || openInEditorLocation ? (jsx_runtime_1.jsxs("div", { style: {
60
63
  ...action,
61
64
  opacity: showAction ? 1 : 0,
62
65
  pointerEvents: showAction ? 'auto' : 'none',
63
- }, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onCopy, renderAction: renderCopyAction, title: "Copy location for agents" }) })) : null] }));
66
+ }, children: [
67
+ jsx_runtime_1.jsx(InspectorOpenInEditor_1.InspectorOpenInEditor, { location: openInEditorLocation }), textToCopy ? (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onCopy, renderAction: renderCopyAction, title: "Copy location for agents" })) : null] })) : null] }));
64
68
  };
65
69
  exports.InspectorLocationCopy = InspectorLocationCopy;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
3
+ export declare const InspectorOpenInEditor: React.FC<{
4
+ readonly location: OriginalPosition | null;
5
+ }>;
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InspectorOpenInEditor = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const client_id_1 = require("../helpers/client-id");
7
+ const colors_1 = require("../helpers/colors");
8
+ const open_in_editor_1 = require("../helpers/open-in-editor");
9
+ const caret_1 = require("../icons/caret");
10
+ const editor_1 = require("../icons/editor");
11
+ const modals_1 = require("../state/modals");
12
+ const z_index_1 = require("../state/z-index");
13
+ const InlineDropdown_1 = require("./InlineDropdown");
14
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
15
+ const use_default_editor_info_1 = require("./use-default-editor-info");
16
+ const splitButton = {
17
+ alignItems: 'center',
18
+ display: 'inline-flex',
19
+ flexDirection: 'row',
20
+ flexShrink: 0,
21
+ height: 24,
22
+ };
23
+ const mainButtonBase = {
24
+ alignItems: 'center',
25
+ background: colors_1.TRANSPARENT,
26
+ border: 'none',
27
+ borderRadius: 3,
28
+ color: colors_1.LIGHT_TEXT,
29
+ display: 'inline-flex',
30
+ fontFamily: 'sans-serif',
31
+ fontSize: 11,
32
+ height: 24,
33
+ lineHeight: '14px',
34
+ padding: '0 6px',
35
+ whiteSpace: 'nowrap',
36
+ };
37
+ const menuLabel = {
38
+ color: 'inherit',
39
+ fontFamily: 'sans-serif',
40
+ fontSize: 13,
41
+ lineHeight: '16px',
42
+ };
43
+ const editorButtonIconSize = 18;
44
+ const editorMenuIconSize = 18;
45
+ const InspectorOpenInEditor = ({ location }) => {
46
+ var _a;
47
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
48
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
49
+ const { tabIndex } = (0, z_index_1.useZIndex)();
50
+ const [hovered, setHovered] = (0, react_1.useState)(false);
51
+ const editorPickerAvailable = (0, use_default_editor_info_1.canUseEditorPicker)(previewServerState.type === 'connected');
52
+ const editorInfo = (0, use_default_editor_info_1.useDefaultEditorInfo)(editorPickerAvailable);
53
+ const openWithEditor = (0, react_1.useCallback)(async (editorId) => {
54
+ if (!location) {
55
+ return;
56
+ }
57
+ try {
58
+ await (0, open_in_editor_1.openOriginalPositionInEditor)(location, editorId);
59
+ }
60
+ catch (err) {
61
+ (0, NotificationCenter_1.showNotification)(err.message, 2000);
62
+ }
63
+ }, [location]);
64
+ const preferredEditorId = (0, use_default_editor_info_1.getPreferredEditorId)(editorInfo);
65
+ const editorName = (_a = window.remotion_editorName) !== null && _a !== void 0 ? _a : 'default editor';
66
+ const canOpenDefault = location !== null && window.remotion_editorName !== null;
67
+ const onOpenDefault = (0, react_1.useCallback)((event) => {
68
+ event.stopPropagation();
69
+ openWithEditor(null).catch(() => undefined);
70
+ }, [openWithEditor]);
71
+ const mainButtonStyle = (0, react_1.useMemo)(() => {
72
+ return {
73
+ ...mainButtonBase,
74
+ background: (0, colors_1.getBackgroundFromHoverState)({
75
+ hovered,
76
+ selected: false,
77
+ }),
78
+ color: hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
79
+ opacity: canOpenDefault ? 1 : 0.5,
80
+ pointerEvents: canOpenDefault ? 'auto' : 'none',
81
+ };
82
+ }, [canOpenDefault, hovered]);
83
+ const renderDropdownAction = (0, react_1.useCallback)((color) => {
84
+ return jsx_runtime_1.jsx(caret_1.CaretDown, { color: color, small: true });
85
+ }, []);
86
+ const menuItems = (0, react_1.useMemo)(() => {
87
+ var _a;
88
+ const alternateEditors = ((_a = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors) !== null && _a !== void 0 ? _a : [])
89
+ .filter((editor) => editor.id !== preferredEditorId)
90
+ .map((editor) => ({
91
+ id: `open-in-${editor.id}`,
92
+ keyHint: null,
93
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: editor.name }),
94
+ leftItem: jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: editor.id, size: editorMenuIconSize }),
95
+ onClick: () => {
96
+ openWithEditor(editor.id).catch(() => undefined);
97
+ },
98
+ quickSwitcherLabel: null,
99
+ subMenu: null,
100
+ type: 'item',
101
+ value: editor.id,
102
+ }));
103
+ const settingsItems = [
104
+ ...(alternateEditors.length > 0
105
+ ? [{ type: 'divider', id: 'editor-settings-divider' }]
106
+ : []),
107
+ {
108
+ id: 'set-default-editor',
109
+ keyHint: null,
110
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Set default editor..." }),
111
+ leftItem: null,
112
+ onClick: () => {
113
+ setSelectedModal({ type: 'configure-default-editor' });
114
+ },
115
+ quickSwitcherLabel: null,
116
+ subMenu: null,
117
+ type: 'item',
118
+ value: 'set-default-editor',
119
+ },
120
+ ];
121
+ return [...alternateEditors, ...settingsItems];
122
+ }, [
123
+ editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors,
124
+ openWithEditor,
125
+ preferredEditorId,
126
+ setSelectedModal,
127
+ ]);
128
+ if (!editorPickerAvailable) {
129
+ return null;
130
+ }
131
+ return (jsx_runtime_1.jsxs("div", { style: splitButton, children: [
132
+ jsx_runtime_1.jsx("button", { "aria-label": `Open in ${editorName}`, disabled: !canOpenDefault, onClick: onOpenDefault, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${editorName}`, type: "button", children: jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: preferredEditorId, size: editorButtonIconSize }) }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderDropdownAction, title: "Open in another editor", values: menuItems, variant: "compact" })
133
+ ] }));
134
+ };
135
+ exports.InspectorOpenInEditor = InspectorOpenInEditor;
@@ -44,7 +44,7 @@ const verticalDivider = {
44
44
  margin: '0 8px',
45
45
  };
46
46
  const AlignmentButton = ({ onClick, title, Icon, disabled }) => {
47
- return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title: title, onClick: onClick, renderAction: (color) => jsx_runtime_1.jsx(Icon, { style: iconStyle, color: color }), disabled: disabled }));
47
+ return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, title: title, onClick: onClick, renderAction: (color) => jsx_runtime_1.jsx(Icon, { style: iconStyle, color: color }), disabled: disabled }));
48
48
  };
49
49
  const AlignmentControls = ({ track }) => {
50
50
  var _a;
@@ -72,7 +72,7 @@ const CompositionInspectorHeader = () => {
72
72
  if (!validatedLocation) {
73
73
  return;
74
74
  }
75
- (0, open_in_editor_1.openOriginalPositionInEditor)(validatedLocation).catch((err) => {
75
+ (0, open_in_editor_1.openOriginalPositionInEditor)(validatedLocation, null).catch((err) => {
76
76
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
77
77
  });
78
78
  }, [validatedLocation]);
@@ -80,7 +80,7 @@ const CompositionInspectorHeader = () => {
80
80
  if (!componentLocation) {
81
81
  return;
82
82
  }
83
- (0, open_in_editor_1.openOriginalPositionInEditor)(componentLocation).catch((err) => {
83
+ (0, open_in_editor_1.openOriginalPositionInEditor)(componentLocation, null).catch((err) => {
84
84
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
85
85
  });
86
86
  }, [componentLocation]);
@@ -90,7 +90,7 @@ const CompositionInspectorHeader = () => {
90
90
  }
91
91
  return (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: color, style: sourceLocationIconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: sourceLocationIconStyle }));
92
92
  }, [video]);
93
- return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { minHeight: COMPOSITION_INSPECTOR_HEADER_HEIGHT, padding: "4px 0", children: video ? (jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: validatedLocation, name: video.id, children: [
93
+ return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { minHeight: COMPOSITION_INSPECTOR_HEADER_HEIGHT, padding: "4px 0", children: video ? (jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: validatedLocation, name: video.id, openInEditorLocation: componentLocation, children: [
94
94
  jsx_runtime_1.jsx(InlineCompositionName_1.InlineCompositionName, { compositionId: video.id, stack: (_e = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _e !== void 0 ? _e : null, compositions: compositions }, video.id), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null, onOpen: openFileLocation, renderIcon: renderCompositionIcon, size: "inline-action" }), compositionComponentInfo === null &&
95
95
  compositionFile !== null &&
96
96
  compositionId !== null ? (jsx_runtime_1.jsx("div", { "aria-hidden": true, style: componentLocationPlaceholder })) : (jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: componentLocation, canOpen: componentLocation !== null, onOpen: openComponentLocation, renderIcon: renderReactIcon, size: "inline-action" }))] })) : null }));
@@ -97,7 +97,7 @@ const PresetDropdown = ({ disabled, title, values, visible }) => {
97
97
  return (jsx_runtime_1.jsx("div", { style: {
98
98
  ...presetDropdownContainer,
99
99
  visibility: visible ? 'visible' : 'hidden',
100
- }, children: jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { disabled: disabled, renderAction: renderAction, title: title, values: values }) }));
100
+ }, children: jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { disabled: disabled, renderAction: renderAction, title: title, values: values, variant: "compact" }) }));
101
101
  };
102
102
  const CompositionMetadataValue = ({ computed, disabled, field, onSave, pendingValue, value }) => {
103
103
  var _a;
@@ -139,8 +139,8 @@ const KeyframeEasingNavigator = ({ currentSelection, includeEasings, keyframes,
139
139
  if (currentItem === null) {
140
140
  return null;
141
141
  }
142
- return (jsx_runtime_1.jsxs("div", { style: navigatorContainer, children: [jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: previousItem === null, onClick: selectPrevious, title: "Previous animation item", renderAction: (color) => (jsx_runtime_1.jsx(NavigationChevron, { color: previousItem === null ? disabledChevronColor : color, direction: "left" })) }), jsx_runtime_1.jsxs("div", { style: itemStrip, children: [
142
+ return (jsx_runtime_1.jsxs("div", { style: navigatorContainer, children: [jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, disabled: previousItem === null, onClick: selectPrevious, title: "Previous animation item", renderAction: (color) => (jsx_runtime_1.jsx(NavigationChevron, { color: previousItem === null ? disabledChevronColor : color, direction: "left" })) }), jsx_runtime_1.jsxs("div", { style: itemStrip, children: [
143
143
  jsx_runtime_1.jsx(TimelineNavigatorItem, { extendLineLeft: false, extendLineRight: currentItem.type === 'keyframe', item: previousItem, onSelect: selectItem, selected: previousItem === null ? false : isSelected(previousItem.selection) }), jsx_runtime_1.jsx(TimelineNavigatorItem, { extendLineLeft: (previousItem === null || previousItem === void 0 ? void 0 : previousItem.type) === 'keyframe', extendLineRight: (nextItem === null || nextItem === void 0 ? void 0 : nextItem.type) === 'keyframe', item: currentItem, onSelect: selectItem, selected: isSelected(currentItem.selection) }), jsx_runtime_1.jsx(TimelineNavigatorItem, { extendLineLeft: currentItem.type === 'keyframe', extendLineRight: false, item: nextItem, onSelect: selectItem, selected: nextItem === null ? false : isSelected(nextItem.selection) })
144
- ] }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: nextItem === null, onClick: selectNext, title: "Next animation item", renderAction: (color) => (jsx_runtime_1.jsx(NavigationChevron, { color: nextItem === null ? disabledChevronColor : color, direction: "right" })) })] }));
144
+ ] }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, disabled: nextItem === null, onClick: selectNext, title: "Next animation item", renderAction: (color) => (jsx_runtime_1.jsx(NavigationChevron, { color: nextItem === null ? disabledChevronColor : color, direction: "right" })) })] }));
145
145
  };
146
146
  exports.KeyframeEasingNavigator = KeyframeEasingNavigator;
@@ -56,7 +56,7 @@ const useSequenceInspectorSourceLocation = (sequence) => {
56
56
  if (!canOpenInEditor) {
57
57
  return;
58
58
  }
59
- openInEditor();
59
+ openInEditor(null);
60
60
  }, [canOpenInEditor, openInEditor]);
61
61
  return {
62
62
  canOpenInEditor,
@@ -94,7 +94,7 @@ const SequenceInspectorHeader = ({ sourceLocation, track }) => {
94
94
  const onRename = (0, react_1.useCallback)((newName) => {
95
95
  saveName(newName).catch(() => undefined);
96
96
  }, [saveName]);
97
- return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: true, padding: "4px 0", children: jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: sourceLocation.validatedLocation, name: componentName !== null && componentName !== void 0 ? componentName : null, children: [
97
+ return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: true, padding: "4px 0", children: jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: sourceLocation.validatedLocation, name: componentName !== null && componentName !== void 0 ? componentName : null, openInEditorLocation: sourceLocation.validatedLocation, children: [
98
98
  jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename, size: "inspector" }), documentationLink ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, style: defaultCursor, size: "compact", title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation, renderIcon: renderReactIcon, size: "inline-action" })
99
99
  ] }) }));
100
100
  };
@@ -5,7 +5,7 @@ export declare const useCompositionActions: () => {
5
5
  canShowInsertAsset: boolean;
6
6
  canShowInsertComposition: boolean;
7
7
  canShowInsertSolid: boolean;
8
- insertAsset: () => Promise<void>;
8
+ insertAsset: () => void;
9
9
  insertComposition: () => void;
10
10
  insertSolid: () => Promise<void>;
11
11
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCompositionActions = void 0;
4
- const drag_and_drop_1 = require("@remotion/drag-and-drop");
4
+ const studio_protocol_1 = require("@remotion/studio-protocol");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
@@ -100,7 +100,7 @@ const useCompositionActions = () => {
100
100
  currentCompositionId,
101
101
  videoConfig,
102
102
  ]);
103
- const insertAsset = (0, react_1.useCallback)(async () => {
103
+ const onFilesSelected = (0, react_1.useCallback)(async () => {
104
104
  if (!canInsertAsset ||
105
105
  currentCompositionId === null ||
106
106
  compositionFile === null ||
@@ -128,6 +128,49 @@ const useCompositionActions = () => {
128
128
  setIsAddingAsset(false);
129
129
  }
130
130
  }, [canInsertAsset, compositionFile, currentCompositionId, videoConfig]);
131
+ const onAssetSelected = (0, react_1.useCallback)(async (asset) => {
132
+ if (!canInsertAsset ||
133
+ currentCompositionId === null ||
134
+ compositionFile === null ||
135
+ videoConfig === null) {
136
+ return;
137
+ }
138
+ setIsAddingAsset(true);
139
+ try {
140
+ await (0, import_assets_1.insertExistingAssets)({
141
+ assetPaths: [asset.name],
142
+ fps: videoConfig.fps,
143
+ compositionFile,
144
+ compositionId: currentCompositionId,
145
+ destinationDimensions: null,
146
+ dropPosition: null,
147
+ from: null,
148
+ });
149
+ }
150
+ finally {
151
+ setIsAddingAsset(false);
152
+ }
153
+ }, [canInsertAsset, compositionFile, currentCompositionId, videoConfig]);
154
+ const insertAsset = (0, react_1.useCallback)(() => {
155
+ if (!canInsertAsset) {
156
+ return;
157
+ }
158
+ setSelectedModal({
159
+ type: 'quick-switcher',
160
+ mode: 'assets',
161
+ invocationTimestamp: Date.now(),
162
+ assetSelection: {
163
+ initialQuery: '',
164
+ onSelectFile: () => {
165
+ onFilesSelected().catch(() => undefined);
166
+ },
167
+ onSelected: (asset) => {
168
+ onAssetSelected(asset).catch(() => undefined);
169
+ },
170
+ },
171
+ compositionSelection: null,
172
+ });
173
+ }, [canInsertAsset, onAssetSelected, onFilesSelected, setSelectedModal]);
131
174
  const onCompositionSelected = (0, react_1.useCallback)(async (composition) => {
132
175
  var _a, _b, _c, _d, _e;
133
176
  if (!canInsertComposition ||
@@ -141,7 +184,7 @@ const useCompositionActions = () => {
141
184
  ? await (0, get_stack_1.getOriginalLocationFromStack)(composition.stack, 'sequence')
142
185
  : null;
143
186
  const selectedCompositionFile = (_b = (_a = resolvedLocation === null || resolvedLocation === void 0 ? void 0 : resolvedLocation.source) !== null && _a !== void 0 ? _a : browserStudioOperations === null || browserStudioOperations === void 0 ? void 0 : browserStudioOperations.getCompositionFile(composition.id)) !== null && _b !== void 0 ? _b : null;
144
- const compositionDragData = drag_and_drop_1.DragAndDropInternals.makeDragData({
187
+ const compositionDragData = studio_protocol_1.StudioProtocolInternals.makeDragData({
145
188
  type: 'composition',
146
189
  compositionFile: selectedCompositionFile,
147
190
  compositionId: composition.id,
@@ -468,7 +468,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
468
468
  setPropStatuses,
469
469
  validatedLocation.source,
470
470
  ]);
471
- const borderRadiusAction = borderRadiusGroup ? (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: borderRadiusConversion === null ||
471
+ const borderRadiusAction = borderRadiusGroup ? (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, disabled: borderRadiusConversion === null ||
472
472
  previewServerState.type !== 'connected', onClick: onConvertBorderRadius, title: borderRadiusConversion === null
473
473
  ? borderRadiusUsesShorthand
474
474
  ? 'A static border radius is required to use individual corners'
@@ -477,7 +477,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
477
477
  ? 'Use individual corner radii'
478
478
  : 'Use one border radius value', renderAction: (color) => borderRadiusUsesShorthand ? (jsx_runtime_1.jsx(fullscreen_1.FullscreenIcon, { color: color, style: borderRadiusToggleIcon })) : (jsx_runtime_1.jsx(border_radius_1.BorderRadiusIcon, { color: color, style: borderRadiusToggleIcon })) })) : null;
479
479
  const effectsHeader = (jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
480
- jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: "Effects" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: !canAddEffect, onClick: onAddEffect, title: canAddEffect ? 'Add effect' : undefined, renderAction: (color) => jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: plusIcon }) })] }));
480
+ jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: "Effects" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, disabled: !canAddEffect, onClick: onAddEffect, title: canAddEffect ? 'Add effect' : undefined, renderAction: (color) => jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: plusIcon }) })] }));
481
481
  const renderRow = ({ node, depth }) => {
482
482
  return (jsx_runtime_1.jsx(TimelineRowLayoutContext_1.TimelineRowLayoutContext.Provider, { value: TimelineRowLayoutContext_1.INSPECTOR_TIMELINE_ROW_LAYOUT, children: jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: 0, rowDepthBase: 0, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "inspector" }) }, JSON.stringify(node.nodePathInfo)));
483
483
  };
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export declare const toggleLoop: (setLoop: React.Dispatch<React.SetStateAction<boolean>>) => void;
2
3
  export declare const LoopToggle: React.FC<{
3
4
  readonly loop: boolean;
4
5
  readonly setLoop: React.Dispatch<React.SetStateAction<boolean>>;
@@ -1,18 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoopToggle = void 0;
3
+ exports.LoopToggle = exports.toggleLoop = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
7
  const loop_1 = require("../state/loop");
8
8
  const ControlButton_1 = require("./ControlButton");
9
9
  const accessibilityLabel = 'Loop video';
10
+ const toggleLoop = (setLoop) => {
11
+ setLoop((currentLoop) => {
12
+ (0, loop_1.persistLoopOption)(!currentLoop);
13
+ return !currentLoop;
14
+ });
15
+ };
16
+ exports.toggleLoop = toggleLoop;
10
17
  const LoopToggle = ({ loop, setLoop }) => {
11
18
  const onClick = (0, react_1.useCallback)(() => {
12
- setLoop((c) => {
13
- (0, loop_1.persistLoopOption)(!c);
14
- return !c;
15
- });
19
+ (0, exports.toggleLoop)(setLoop);
16
20
  }, [setLoop]);
17
21
  return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: jsx_runtime_1.jsx("path", { fill: loop ? colors_1.BLUE : colors_1.WHITE, d: "M493.544 181.463c11.956 22.605 18.655 48.4 18.452 75.75C511.339 345.365 438.56 416 350.404 416H192v47.495c0 22.475-26.177 32.268-40.971 17.475l-80-80c-9.372-9.373-9.372-24.569 0-33.941l80-80C166.138 271.92 192 282.686 192 304v48h158.875c52.812 0 96.575-42.182 97.12-94.992.155-15.045-3.17-29.312-9.218-42.046-4.362-9.185-2.421-20.124 4.8-27.284 4.745-4.706 8.641-8.555 11.876-11.786 11.368-11.352 30.579-8.631 38.091 5.571zM64.005 254.992c.545-52.81 44.308-94.992 97.12-94.992H320v47.505c0 22.374 26.121 32.312 40.971 17.465l80-80c9.372-9.373 9.372-24.569 0-33.941l-80-80C346.014 16.077 320 26.256 320 48.545V96H161.596C73.44 96 .661 166.635.005 254.788c-.204 27.35 6.495 53.145 18.452 75.75 7.512 14.202 26.723 16.923 38.091 5.57 3.235-3.231 7.13-7.08 11.876-11.786 7.22-7.16 9.162-18.098 4.8-27.284-6.049-12.735-9.374-27.001-9.219-42.046z" }) }) }));
18
22
  };
@@ -9,6 +9,7 @@ const player_1 = require("@remotion/player");
9
9
  const react_1 = require("react");
10
10
  const react_dom_1 = __importDefault(require("react-dom"));
11
11
  const colors_1 = require("../../helpers/colors");
12
+ const pointer_session_1 = require("../../helpers/pointer-session");
12
13
  const z_index_1 = require("../../state/z-index");
13
14
  const MenuContent_1 = require("../NewComposition/MenuContent");
14
15
  const is_menu_item_1 = require("./is-menu-item");
@@ -68,12 +69,18 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
68
69
  return;
69
70
  }
70
71
  onItemSelected(id);
71
- window.addEventListener('pointerup', (evt) => {
72
- if (!(0, is_menu_item_1.isMenuItem)(evt.target)) {
73
- onItemQuit();
74
- }
75
- }, {
76
- once: true,
72
+ (0, pointer_session_1.startPointerSession)({
73
+ event: e.nativeEvent,
74
+ target: e.currentTarget,
75
+ onEnd: (reason, evt) => {
76
+ if ((reason === 'pointerup' || reason === 'buttons-released') &&
77
+ evt) {
78
+ const target = document.elementFromPoint(evt.clientX, evt.clientY);
79
+ if (!target || !(0, is_menu_item_1.isMenuItem)(target)) {
80
+ onItemQuit();
81
+ }
82
+ }
83
+ },
77
84
  });
78
85
  }, [id, onItemQuit, onItemSelected]);
79
86
  const onMenuPointerDown = (0, react_1.useCallback)((e) => {
@@ -90,9 +90,19 @@ const MenuSubItem = ({ label, leaveLeftSpace, leftItem, onActionChosen, id, sele
90
90
  return null;
91
91
  }
92
92
  const left = size.left + size.width + styles_1.SUBMENU_LEFT_INSET;
93
+ const minSpaceRequired = mobileLayout
94
+ ? styles_1.MAX_MOBILE_MENU_WIDTH
95
+ : styles_1.MAX_MENU_WIDTH;
96
+ const spaceToLeft = size.left;
97
+ const spaceToRight = size.windowSize.width - size.left - size.width;
98
+ const canOpenOnRight = spaceToRight >= minSpaceRequired || spaceToRight >= spaceToLeft;
93
99
  return {
94
100
  ...styles_1.menuContainerTowardsBottom,
95
- left: mobileLayout ? left * 0.7 : left,
101
+ ...(canOpenOnRight
102
+ ? { left }
103
+ : {
104
+ right: size.windowSize.width - size.left + styles_1.SUBMENU_LEFT_INSET,
105
+ }),
96
106
  top: size.top - styles_1.MENU_VERTICAL_PADDING,
97
107
  };
98
108
  }, [mobileLayout, selected, size, subMenu, subMenuActivated]);
@@ -55,7 +55,7 @@ const MenuBuildIndicator = () => {
55
55
  originalColumnNumber: 1,
56
56
  originalFunctionName: null,
57
57
  originalScriptCode: null,
58
- })
58
+ }, null)
59
59
  .then(({ success }) => {
60
60
  if (!success) {
61
61
  (0, NotificationCenter_1.showNotification)(`Could not open ${window.remotion_editorName}`, 2000);
@@ -72,7 +72,7 @@ const MenuCompositionName = () => {
72
72
  });
73
73
  }
74
74
  else if (resolvedLocation) {
75
- await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation);
75
+ await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation, null);
76
76
  }
77
77
  }
78
78
  catch (err) {
@@ -21,12 +21,15 @@ const overlay = {
21
21
  const panel = {
22
22
  position: 'fixed',
23
23
  top: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
24
- width: 'min(350px, calc(100% - 50px))',
25
24
  height: `calc(100% - ${menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT}px)`,
26
25
  overflow: 'hidden',
27
26
  background: colors_1.BACKGROUND,
28
27
  boxShadow: colors_1.SHADOW_BLACK,
29
28
  };
29
+ const sidebarWidth = {
30
+ left: 'min(210px, calc(100% - 50px))',
31
+ right: 'min(245px, calc(100% - 50px))',
32
+ };
30
33
  function MobilePanel({ children, onClose, side, }) {
31
34
  const { currentZIndex } = (0, z_index_1.useZIndex)();
32
35
  const onOutsideClick = react_1.default.useCallback((target) => {
@@ -41,6 +44,7 @@ function MobilePanel({ children, onClose, side, }) {
41
44
  }, [onClose, side]);
42
45
  return react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: overlay, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onClose, onOutsideClick: onOutsideClick, children: jsx_runtime_1.jsx("div", { style: {
43
46
  ...panel,
47
+ width: sidebarWidth[side],
44
48
  left: side === 'left' ? 0 : undefined,
45
49
  right: side === 'right' ? 0 : undefined,
46
50
  }, children: children }) }) }), (0, portals_1.getPortal)(currentZIndex));
@@ -34,6 +34,6 @@ const ModalContainer = ({ children, onEscape, onOutsideClick, noZIndex, panelSty
34
34
  // Prevent deselection of currently selected items
35
35
  e.stopPropagation();
36
36
  }, []);
37
- return (jsx_runtime_1.jsx("div", { className: "css-reset", style: backgroundOverlay, role: "dialog", "aria-modal": "true", onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { disabled: noZIndex, onOutsideClick: onOutsideClick, onEscape: onEscape, children: jsx_runtime_1.jsx("div", { style: { ...panel, ...panelStyle }, children: children }) }) }));
37
+ return (jsx_runtime_1.jsx("div", { className: "css-reset", style: backgroundOverlay, role: "dialog", "aria-modal": "true", onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { disabled: noZIndex, onOutsideClick: onOutsideClick, onEscape: onEscape, stackOnHighest: true, children: jsx_runtime_1.jsx("div", { style: { ...panel, ...panelStyle }, children: children }) }) }));
38
38
  };
39
39
  exports.ModalContainer = ModalContainer;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const ModalFooterContainer: React.FC<{
3
3
  readonly children: React.ReactNode;
4
+ readonly style?: React.CSSProperties;
4
5
  }>;
@@ -10,7 +10,7 @@ const content = {
10
10
  fontSize: 13,
11
11
  minWidth: 500,
12
12
  };
13
- const ModalFooterContainer = ({ children }) => {
14
- return jsx_runtime_1.jsx("div", { style: { ...content, borderTop: colors_1.BORDER_BLACK }, children: children });
13
+ const ModalFooterContainer = ({ children, style }) => {
14
+ return (jsx_runtime_1.jsx("div", { style: { ...content, ...style, borderTop: colors_1.BORDER_BLACK }, children: children }));
15
15
  };
16
16
  exports.ModalFooterContainer = ModalFooterContainer;