@firecms/core 3.0.0-canary.294 → 3.0.0-canary.296

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/core",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.294",
4
+ "version": "3.0.0-canary.296",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -53,9 +53,9 @@
53
53
  "@dnd-kit/core": "^6.3.1",
54
54
  "@dnd-kit/modifiers": "^9.0.0",
55
55
  "@dnd-kit/sortable": "^10.0.0",
56
- "@firecms/editor": "^3.0.0-canary.294",
57
- "@firecms/formex": "^3.0.0-canary.294",
58
- "@firecms/ui": "^3.0.0-canary.294",
56
+ "@firecms/editor": "^3.0.0-canary.296",
57
+ "@firecms/formex": "^3.0.0-canary.296",
58
+ "@firecms/ui": "^3.0.0-canary.296",
59
59
  "@radix-ui/react-portal": "^1.1.10",
60
60
  "clsx": "^2.1.1",
61
61
  "compressorjs": "^1.2.1",
@@ -108,7 +108,7 @@
108
108
  "dist",
109
109
  "src"
110
110
  ],
111
- "gitHead": "4b3837d3153e7b93719766c00ccfe787306a4f80",
111
+ "gitHead": "ec9f43e9e3b2fc41d539468a3a6b58587892c022",
112
112
  "publishConfig": {
113
113
  "access": "public"
114
114
  },
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
1
+ import React, { useContext, useEffect, useState } from "react";
2
2
  import { useSideDialogsController } from "../hooks";
3
3
  import { SideDialogPanelProps } from "../types";
4
4
  import { Sheet } from "@firecms/ui";
@@ -61,15 +61,15 @@ export function SideDialogs() {
61
61
  <SideDialogView
62
62
  key={`side_dialog_${index}`}
63
63
  panel={panel}
64
- offsetPosition={sidePanels.length - index - 1}/>)
64
+ offsetPosition={sidePanels.length - index - 1} />)
65
65
  }
66
66
  </>;
67
67
  }
68
68
 
69
69
  function SideDialogView({
70
- offsetPosition,
71
- panel
72
- }: {
70
+ offsetPosition,
71
+ panel
72
+ }: {
73
73
  offsetPosition: number,
74
74
  panel?: SideDialogPanelProps
75
75
  }) {
@@ -134,7 +134,17 @@ function SideDialogView({
134
134
 
135
135
  <Sheet
136
136
  open={Boolean(panel)}
137
- onOpenChange={(open) => !open && onCloseRequest()}
137
+ onOpenChange={(open) => {
138
+ if (!open) {
139
+ // Check if any suggestion menu (e.g., slash command) is visible in DOM
140
+ const suggestionMenu = document.querySelector("[data-suggestion-menu=\"true\"]");
141
+ if (suggestionMenu && window.getComputedStyle(suggestionMenu).visibility !== "hidden") {
142
+ // Don't close the sheet if a suggestion menu is visible
143
+ return;
144
+ }
145
+ onCloseRequest();
146
+ }
147
+ }}
138
148
  title={"Side dialog " + panel?.key}
139
149
  >
140
150
  {panel &&
@@ -150,7 +160,7 @@ function SideDialogView({
150
160
  </ErrorBoundary>
151
161
  </div>}
152
162
 
153
- {!panel && <div style={{ width }}/>}
163
+ {!panel && <div style={{ width }} />}
154
164
 
155
165
  </Sheet>
156
166
 
@@ -158,7 +168,7 @@ function SideDialogView({
158
168
  open={drawerCloseRequested}
159
169
  handleOk={drawerCloseRequested ? handleDrawerCloseOk : handleNavigationOk}
160
170
  handleCancel={drawerCloseRequested ? handleDrawerCloseCancel : handleNavigationCancel}
161
- body={blockedNavigationMessage}/>
171
+ body={blockedNavigationMessage} />
162
172
 
163
173
  </SideDialogContext.Provider>
164
174