@bigbinary/neeto-folders-frontend 2.1.0 → 2.2.1
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/README.md +175 -1
- package/app/javascript/src/translations/ar.json +82 -0
- package/app/javascript/src/translations/bg.json +82 -0
- package/app/javascript/src/translations/ca.json +82 -0
- package/app/javascript/src/translations/da.json +82 -0
- package/app/javascript/src/translations/de.json +82 -0
- package/app/javascript/src/translations/en.json +82 -0
- package/app/javascript/src/translations/es-MX.json +82 -0
- package/app/javascript/src/translations/es.json +82 -0
- package/app/javascript/src/translations/et.json +82 -0
- package/app/javascript/src/translations/fi.json +86 -2
- package/app/javascript/src/translations/fil.json +82 -0
- package/app/javascript/src/translations/fr.json +82 -0
- package/app/javascript/src/translations/he.json +82 -0
- package/app/javascript/src/translations/hi.json +82 -0
- package/app/javascript/src/translations/hr.json +82 -0
- package/app/javascript/src/translations/hu.json +82 -0
- package/app/javascript/src/translations/id.json +82 -0
- package/app/javascript/src/translations/it.json +82 -0
- package/app/javascript/src/translations/ja.json +82 -0
- package/app/javascript/src/translations/ko.json +82 -0
- package/app/javascript/src/translations/lv.json +82 -0
- package/app/javascript/src/translations/nl.json +82 -0
- package/app/javascript/src/translations/pl.json +82 -0
- package/app/javascript/src/translations/pt-BR.json +82 -0
- package/app/javascript/src/translations/pt.json +82 -0
- package/app/javascript/src/translations/ro.json +86 -2
- package/app/javascript/src/translations/ru.json +82 -0
- package/app/javascript/src/translations/sk.json +82 -0
- package/app/javascript/src/translations/sl.json +82 -0
- package/app/javascript/src/translations/sv.json +82 -0
- package/app/javascript/src/translations/th.json +82 -0
- package/app/javascript/src/translations/tr.json +82 -0
- package/app/javascript/src/translations/uk.json +82 -0
- package/app/javascript/src/translations/vi.json +82 -0
- package/app/javascript/src/translations/zh-CN.json +82 -0
- package/app/javascript/src/translations/zh-TW.json +82 -0
- package/dist/.ready +1 -1
- package/dist/cjs/components.js +5 -4
- package/dist/cjs/components.js.map +1 -1
- package/dist/cjs/hooks.js +2 -2
- package/dist/cjs/utils.js +2 -2
- package/dist/cjs/v2/components.js +946 -40
- package/dist/cjs/v2/components.js.map +1 -1
- package/dist/components.js +5 -4
- package/dist/components.js.map +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{index-BXvkr7vp.js → index-CbypYFzw.js} +2 -2
- package/dist/{index-BXvkr7vp.js.map → index-CbypYFzw.js.map} +1 -1
- package/dist/{index-DCIRHXw_.js → index-DPGZgR3c.js} +2 -2
- package/dist/{index-DCIRHXw_.js.map → index-DPGZgR3c.js.map} +1 -1
- package/dist/{internal-UIifJzTd.js → internal-Cg8w0New.js} +8 -2
- package/dist/internal-Cg8w0New.js.map +1 -0
- package/dist/{internal-DAkDv0P1.js → internal-DkESa3he.js} +8 -1
- package/dist/internal-DkESa3he.js.map +1 -0
- package/dist/{useFolderActions-DCKQrv0G.js → useFolderActions-C1AHYJua.js} +2 -2
- package/dist/{useFolderActions-DCKQrv0G.js.map → useFolderActions-C1AHYJua.js.map} +1 -1
- package/dist/{useFolderActions-DImaQ3gr.js → useFolderActions-D_egbV70.js} +2 -2
- package/dist/{useFolderActions-DImaQ3gr.js.map → useFolderActions-D_egbV70.js.map} +1 -1
- package/dist/utils.js +2 -2
- package/dist/v2/components.js +949 -46
- package/dist/v2/components.js.map +1 -1
- package/package.json +9 -9
- package/types.d.ts +64 -0
- package/dist/internal-DAkDv0P1.js.map +0 -1
- package/dist/internal-UIifJzTd.js.map +0 -1
package/dist/v2/components.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Users, Lock, Globe, CornerDownRight, Search, GripVertical, FolderOpen, Folder, Plus } from 'lucide-react';
|
|
2
|
+
import { Badge, RadioGroup, Callout, Typography, Switch, Input, Checkbox, Button, Avatar, Sheet, Alert, Spinner, Toastr, Tree } from '@bigbinary/neeto-atoms';
|
|
3
|
+
import { u as useTranslation, R as REORDER_TREE_INDENT_WIDTH, c as closestCenter, n } from '../inject-css-Bkrn7lFS.js';
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
6
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
|
+
import React, { useState, createElement, useMemo, forwardRef, useEffect, useId, useRef, startTransition } from 'react';
|
|
8
|
+
import { pick, mergeLeft, pluck, isNil, isEmpty, assoc } from 'ramda';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import { Trans } from 'react-i18next';
|
|
11
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
12
|
+
import { ToggleGroup, ToggleGroupItem, RadioGroupItem, RadioGroup as RadioGroup$1 } from '@bigbinary/neeto-atoms/primitives';
|
|
13
|
+
import { withT, useQueryParams, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
3
14
|
import { shallow } from 'zustand/shallow';
|
|
4
|
-
import { Alert, Sheet, Spinner, Typography, Toastr, Button, Callout, Checkbox, Tree } from '@bigbinary/neeto-atoms';
|
|
5
15
|
import { useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { useQueryParams, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
7
16
|
import { buildUrl, showThumbsUpToastr } from '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
8
|
-
import { Trans } from 'react-i18next';
|
|
9
17
|
import { useHistory, Link, NavLink } from 'react-router-dom';
|
|
10
|
-
import { c as useFolderStore, d as useDestroyFolder, b as useFolders, e as useFetchFolders, f as useCreateFolder, g as useUpdateFolder, h as useReorderFolders, D as DEFAULT_CONFIG, u as useFolder, a as useFolderActions } from '../useFolderActions-
|
|
11
|
-
import { u as useTranslation, R as REORDER_TREE_INDENT_WIDTH, c as closestCenter, n } from '../inject-css-Bkrn7lFS.js';
|
|
18
|
+
import { c as useFolderStore, d as useDestroyFolder, b as useFolders, e as useFetchFolders, f as useCreateFolder, g as useUpdateFolder, h as useReorderFolders, D as DEFAULT_CONFIG, u as useFolder, a as useFolderActions } from '../useFolderActions-C1AHYJua.js';
|
|
12
19
|
import { QUERY_KEYS } from '../constants.js';
|
|
13
|
-
import { p as pathToFolder, t as treeToMap, m as measureDepth, a as mapToTree, b as mapToSortedTree } from '../index-
|
|
14
|
-
import { a as isActiveFolder, g as getActiveFolderId, t as toastApiError, i as isArray } from '../internal-
|
|
15
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
20
|
+
import { p as pathToFolder, t as treeToMap, m as measureDepth, a as mapToTree, b as mapToSortedTree } from '../index-CbypYFzw.js';
|
|
21
|
+
import { a as isActiveFolder, g as getActiveFolderId, t as toastApiError, b as isViewOnly, i as isArray } from '../internal-Cg8w0New.js';
|
|
16
22
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
17
|
-
import React, { createElement, useMemo, forwardRef, useState, useEffect, useId, useRef, startTransition } from 'react';
|
|
18
23
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
19
24
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
20
|
-
import { Textarea, Switch, Input, Form, ActionBlock, TreeSelect as TreeSelect$1 } from '@bigbinary/neeto-atoms/formik';
|
|
25
|
+
import { Textarea, Switch as Switch$1, Input as Input$1, Form, ActionBlock, TreeSelect as TreeSelect$1 } from '@bigbinary/neeto-atoms/formik';
|
|
21
26
|
import { t } from 'i18next';
|
|
22
27
|
import { object, string } from 'yup';
|
|
23
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
24
|
-
import { RadioGroupItem, RadioGroup } from '@bigbinary/neeto-atoms/primitives';
|
|
25
28
|
import { hyphenate, isNotPresent, noop, isNotEmpty, removeById } from '@bigbinary/neeto-cist';
|
|
26
29
|
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
27
|
-
import { pluck, isEmpty, assoc } from 'ramda';
|
|
28
|
-
import classNames from 'classnames';
|
|
29
30
|
import { useDraggable, useDroppable, DndContext, DragOverlay, useSensors, useSensor, PointerSensor } from '@dnd-kit/core';
|
|
30
|
-
import { GripVertical, FolderOpen, Folder, Lock, Plus } from 'lucide-react';
|
|
31
31
|
import { createPortal } from 'react-dom';
|
|
32
32
|
import { snapCenterToCursor } from '@dnd-kit/modifiers';
|
|
33
33
|
import MoreDropdown from '@bigbinary/neeto-molecules/v2/MoreDropdown';
|
|
@@ -35,6 +35,757 @@ import { useFormikContext } from 'formik';
|
|
|
35
35
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
36
36
|
import 'zustand';
|
|
37
37
|
|
|
38
|
+
var LABEL_KEYS = {
|
|
39
|
+
sharedWithYou: "access.pill.sharedWithYou",
|
|
40
|
+
onlyYou: "access.pill.onlyYou",
|
|
41
|
+
onlyName: "access.pill.onlyName",
|
|
42
|
+
restricted: "access.pill.restricted"
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var AccessPill = function AccessPill(_ref) {
|
|
46
|
+
var access = _ref.access,
|
|
47
|
+
viewerId = _ref.viewerId;
|
|
48
|
+
var _useTranslation = useTranslation(),
|
|
49
|
+
t = _useTranslation.t;
|
|
50
|
+
var _ref2 = access !== null && access !== void 0 ? access : {},
|
|
51
|
+
accessType = _ref2.accessType,
|
|
52
|
+
memberCount = _ref2.memberCount,
|
|
53
|
+
creatorId = _ref2.creatorId,
|
|
54
|
+
creatorName = _ref2.creatorName,
|
|
55
|
+
viewerIsMember = _ref2.viewerIsMember,
|
|
56
|
+
own = _ref2.own;
|
|
57
|
+
if (!accessType || accessType === "workspace") return null;
|
|
58
|
+
var isCreator = viewerId === creatorId;
|
|
59
|
+
var isSharedWithYou = (own === null || own === void 0 ? void 0 : own.accessType) === "restricted" && viewerIsMember && !isCreator;
|
|
60
|
+
var label, pillIcon;
|
|
61
|
+
if (isSharedWithYou) {
|
|
62
|
+
pillIcon = Users;
|
|
63
|
+
label = t(LABEL_KEYS.sharedWithYou);
|
|
64
|
+
} else if (accessType === "only_me" || !memberCount) {
|
|
65
|
+
pillIcon = Lock;
|
|
66
|
+
label = isCreator ? t(LABEL_KEYS.onlyYou) : t(LABEL_KEYS.onlyName, {
|
|
67
|
+
name: creatorName
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
pillIcon = Users;
|
|
71
|
+
// The creator always has access, so count them as the share pane does.
|
|
72
|
+
label = t(LABEL_KEYS.restricted, {
|
|
73
|
+
count: memberCount + 1
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return /*#__PURE__*/jsx(Badge, {
|
|
77
|
+
label: label,
|
|
78
|
+
"data-testid": "access-pill",
|
|
79
|
+
icon: pillIcon,
|
|
80
|
+
size: "sm",
|
|
81
|
+
variant: "gray-subtle"
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
var ACCESS_TYPES = [{
|
|
86
|
+
value: "only_me",
|
|
87
|
+
icon: Lock
|
|
88
|
+
}, {
|
|
89
|
+
value: "workspace",
|
|
90
|
+
icon: Globe
|
|
91
|
+
}, {
|
|
92
|
+
value: "restricted",
|
|
93
|
+
icon: Users
|
|
94
|
+
}];
|
|
95
|
+
var CAPABILITIES = ["view", "manage"];
|
|
96
|
+
var DEFAULT_CAPABILITY = "manage";
|
|
97
|
+
var MANAGE_CAPABILITY = "manage";
|
|
98
|
+
var NEW_MEMBER_CAPABILITY = "view";
|
|
99
|
+
var NOT_CUSTOM_DRAFT = {
|
|
100
|
+
accessType: null,
|
|
101
|
+
capability: null,
|
|
102
|
+
members: []
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
var AccessTypeCards = function AccessTypeCards(_ref) {
|
|
106
|
+
var kind = _ref.kind,
|
|
107
|
+
ownerName = _ref.ownerName,
|
|
108
|
+
value = _ref.value,
|
|
109
|
+
onChange = _ref.onChange;
|
|
110
|
+
var _useTranslation = useTranslation(),
|
|
111
|
+
t = _useTranslation.t;
|
|
112
|
+
var onlyKey = ownerName ? "only_name" : "only_me";
|
|
113
|
+
var labelKey = function labelKey(type) {
|
|
114
|
+
return type === "only_me" ? onlyKey : type;
|
|
115
|
+
};
|
|
116
|
+
var descriptionKey = function descriptionKey(type) {
|
|
117
|
+
return type === "only_me" ? "".concat(onlyKey, "_").concat(kind) : type;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// The radio and its label already fire onValueChange; only the rest of the card selects here.
|
|
121
|
+
var handleCardClick = function handleCardClick(event, type) {
|
|
122
|
+
if (event.target.closest('[role="radio"], label')) return;
|
|
123
|
+
onChange(type);
|
|
124
|
+
};
|
|
125
|
+
return /*#__PURE__*/jsx(RadioGroup, {
|
|
126
|
+
value: value,
|
|
127
|
+
className: "w-full gap-2",
|
|
128
|
+
"data-testid": "access-type-picker",
|
|
129
|
+
onValueChange: onChange,
|
|
130
|
+
children: ACCESS_TYPES.map(function (_ref2) {
|
|
131
|
+
var type = _ref2.value,
|
|
132
|
+
Icon = _ref2.icon;
|
|
133
|
+
return /*#__PURE__*/jsxs("div", {
|
|
134
|
+
className: classNames("flex w-full cursor-pointer items-start justify-between gap-3 rounded-md border p-3", type === value ? "border-foreground ring-foreground ring-1" : "border-border"),
|
|
135
|
+
onClick: function onClick(event) {
|
|
136
|
+
return handleCardClick(event, type);
|
|
137
|
+
},
|
|
138
|
+
children: [/*#__PURE__*/jsx(RadioGroup.Item, {
|
|
139
|
+
value: type,
|
|
140
|
+
helpText: t("access.dialog.descriptions.".concat(descriptionKey(type)), {
|
|
141
|
+
name: ownerName
|
|
142
|
+
}),
|
|
143
|
+
label: t("access.dialog.types.".concat(labelKey(type)), {
|
|
144
|
+
name: ownerName
|
|
145
|
+
})
|
|
146
|
+
}), /*#__PURE__*/jsx(Icon, {
|
|
147
|
+
className: "text-muted-foreground size-4 shrink-0"
|
|
148
|
+
})]
|
|
149
|
+
}, type);
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
var AffectedNote = function AffectedNote(_ref) {
|
|
155
|
+
var _ref$affected = _ref.affected,
|
|
156
|
+
names = _ref$affected.names,
|
|
157
|
+
total = _ref$affected.total;
|
|
158
|
+
var _useTranslation = useTranslation(),
|
|
159
|
+
t = _useTranslation.t;
|
|
160
|
+
var more = total - names.length;
|
|
161
|
+
var joined = names.join(", ");
|
|
162
|
+
var nameList = more > 0 ? t("access.dialog.namesAndMore", {
|
|
163
|
+
names: joined,
|
|
164
|
+
more: more
|
|
165
|
+
}) : joined;
|
|
166
|
+
return /*#__PURE__*/jsx(Callout, {
|
|
167
|
+
"data-testid": "access-affected-note",
|
|
168
|
+
variant: "info",
|
|
169
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
170
|
+
count: total,
|
|
171
|
+
i18nKey: "access.dialog.affected",
|
|
172
|
+
values: {
|
|
173
|
+
count: total,
|
|
174
|
+
names: nameList
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
var toDraftMember = pick(["userId", "name", "email", "profileImageUrl", "capability"]);
|
|
181
|
+
|
|
182
|
+
// Inheriting nodes seed from the parent's access so turning custom on starts
|
|
183
|
+
// from what the node has today; nodes with nothing to inherit start from own.
|
|
184
|
+
var buildInitialDraft = function buildInitialDraft(_ref) {
|
|
185
|
+
var _source$accessType, _source$members, _source$capability;
|
|
186
|
+
var inheritable = _ref.inheritable,
|
|
187
|
+
own = _ref.own,
|
|
188
|
+
inheritedFrom = _ref.inheritedFrom,
|
|
189
|
+
creatorId = _ref.creatorId;
|
|
190
|
+
var source = inheritable && !own ? inheritedFrom : own;
|
|
191
|
+
var accessType = (_source$accessType = source === null || source === void 0 ? void 0 : source.accessType) !== null && _source$accessType !== void 0 ? _source$accessType : "workspace";
|
|
192
|
+
var members = accessType === "restricted" ? ((_source$members = source.members) !== null && _source$members !== void 0 ? _source$members : []).filter(function (_ref2) {
|
|
193
|
+
var userId = _ref2.userId;
|
|
194
|
+
return userId !== creatorId;
|
|
195
|
+
}).map(toDraftMember) : [];
|
|
196
|
+
return {
|
|
197
|
+
isCustom: !inheritable || !!own,
|
|
198
|
+
accessType: accessType,
|
|
199
|
+
capability: (_source$capability = source === null || source === void 0 ? void 0 : source.capability) !== null && _source$capability !== void 0 ? _source$capability : DEFAULT_CAPABILITY,
|
|
200
|
+
members: members
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// Badge label and "who" line describing an access source in the inherit box.
|
|
205
|
+
// Nothing set anywhere resolves to Workspace, so an empty source reads as Workspace.
|
|
206
|
+
var capWho = function capWho(t, _ref3, _ref4) {
|
|
207
|
+
var _ref3$accessType = _ref3.accessType,
|
|
208
|
+
accessType = _ref3$accessType === void 0 ? "workspace" : _ref3$accessType,
|
|
209
|
+
memberCount = _ref3.memberCount;
|
|
210
|
+
var isCreator = _ref4.isCreator,
|
|
211
|
+
name = _ref4.name;
|
|
212
|
+
if (accessType === "workspace") {
|
|
213
|
+
return {
|
|
214
|
+
label: t("access.dialog.label.workspace"),
|
|
215
|
+
who: t("access.dialog.who.workspace")
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
if (accessType === "restricted") {
|
|
219
|
+
return {
|
|
220
|
+
label: t("access.dialog.label.restricted"),
|
|
221
|
+
who: t("access.dialog.who.restricted", {
|
|
222
|
+
count: memberCount !== null && memberCount !== void 0 ? memberCount : 0
|
|
223
|
+
})
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
return isCreator ? {
|
|
227
|
+
label: t("access.dialog.label.onlyMe"),
|
|
228
|
+
who: t("access.dialog.who.onlyYou")
|
|
229
|
+
} : {
|
|
230
|
+
label: t("access.dialog.label.onlyName", {
|
|
231
|
+
name: name
|
|
232
|
+
}),
|
|
233
|
+
who: t("access.dialog.who.onlyName", {
|
|
234
|
+
name: name
|
|
235
|
+
})
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
var InheritBox = function InheritBox(_ref) {
|
|
240
|
+
var kind = _ref.kind,
|
|
241
|
+
access = _ref.access,
|
|
242
|
+
viewerId = _ref.viewerId,
|
|
243
|
+
isCustom = _ref.isCustom,
|
|
244
|
+
onToggle = _ref.onToggle;
|
|
245
|
+
var _useTranslation = useTranslation(),
|
|
246
|
+
t = _useTranslation.t;
|
|
247
|
+
var inheritedFrom = access.inheritedFrom,
|
|
248
|
+
creatorId = access.creatorId,
|
|
249
|
+
creatorName = access.creatorName;
|
|
250
|
+
var parent = inheritedFrom === null || inheritedFrom === void 0 ? void 0 : inheritedFrom.name;
|
|
251
|
+
var _capWho = capWho(t, inheritedFrom !== null && inheritedFrom !== void 0 ? inheritedFrom : {}, {
|
|
252
|
+
isCreator: viewerId === creatorId,
|
|
253
|
+
name: creatorName
|
|
254
|
+
}),
|
|
255
|
+
label = _capWho.label,
|
|
256
|
+
who = _capWho.who;
|
|
257
|
+
return /*#__PURE__*/jsxs("div", {
|
|
258
|
+
className: "border-border bg-muted flex gap-3 rounded-md border p-3",
|
|
259
|
+
"data-testid": "access-inherit-box",
|
|
260
|
+
children: [/*#__PURE__*/jsx(CornerDownRight, {
|
|
261
|
+
className: "text-muted-foreground mt-0.5 size-4 shrink-0"
|
|
262
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
263
|
+
className: "min-w-0 flex-1",
|
|
264
|
+
children: [isCustom ? /*#__PURE__*/jsx(Typography, {
|
|
265
|
+
variant: "body3",
|
|
266
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
267
|
+
i18nKey: "access.dialog.custom",
|
|
268
|
+
values: {
|
|
269
|
+
kind: kind,
|
|
270
|
+
parent: parent
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
274
|
+
children: [/*#__PURE__*/jsxs(Typography, {
|
|
275
|
+
variant: "body3",
|
|
276
|
+
children: [/*#__PURE__*/jsx(Trans, {
|
|
277
|
+
i18nKey: "access.dialog.inheriting",
|
|
278
|
+
values: {
|
|
279
|
+
kind: kind,
|
|
280
|
+
parent: parent
|
|
281
|
+
}
|
|
282
|
+
}), " ", /*#__PURE__*/jsx(Badge, {
|
|
283
|
+
label: label,
|
|
284
|
+
size: "sm",
|
|
285
|
+
variant: "outline"
|
|
286
|
+
})]
|
|
287
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
288
|
+
className: "mt-1",
|
|
289
|
+
color: "muted",
|
|
290
|
+
variant: "body3",
|
|
291
|
+
children: who
|
|
292
|
+
})]
|
|
293
|
+
}), /*#__PURE__*/jsxs("label", {
|
|
294
|
+
className: "border-border mt-3 flex cursor-pointer items-start gap-3 border-t pt-3",
|
|
295
|
+
"data-testid": "access-custom-toggle",
|
|
296
|
+
children: [/*#__PURE__*/jsx(Switch, {
|
|
297
|
+
checked: isCustom,
|
|
298
|
+
className: "mt-0.5",
|
|
299
|
+
onCheckedChange: onToggle
|
|
300
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
301
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
302
|
+
variant: "body3",
|
|
303
|
+
weight: "semibold",
|
|
304
|
+
children: t("access.dialog.customToggle", {
|
|
305
|
+
kind: kind
|
|
306
|
+
})
|
|
307
|
+
}), !isCustom && /*#__PURE__*/jsx(Typography, {
|
|
308
|
+
color: "muted",
|
|
309
|
+
variant: "body3",
|
|
310
|
+
children: t("access.dialog.customToggleHelp", {
|
|
311
|
+
kind: kind
|
|
312
|
+
})
|
|
313
|
+
})]
|
|
314
|
+
})]
|
|
315
|
+
})]
|
|
316
|
+
})]
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
var CapabilityToggle$1 = function CapabilityToggle(_ref) {
|
|
321
|
+
var t = _ref.t,
|
|
322
|
+
label = _ref.label,
|
|
323
|
+
value = _ref.value,
|
|
324
|
+
onChange = _ref.onChange;
|
|
325
|
+
return /*#__PURE__*/jsx(ToggleGroup, {
|
|
326
|
+
value: value,
|
|
327
|
+
"aria-label": label,
|
|
328
|
+
size: "sm",
|
|
329
|
+
type: "single",
|
|
330
|
+
variant: "outline",
|
|
331
|
+
onValueChange: function onValueChange(next) {
|
|
332
|
+
return next && onChange(next);
|
|
333
|
+
},
|
|
334
|
+
children: CAPABILITIES.map(function (capability) {
|
|
335
|
+
return /*#__PURE__*/jsx(ToggleGroupItem, {
|
|
336
|
+
className: "data-[state=on]:bg-foreground data-[state=on]:text-background",
|
|
337
|
+
value: capability,
|
|
338
|
+
children: t("access.dialog.".concat(capability))
|
|
339
|
+
}, capability);
|
|
340
|
+
})
|
|
341
|
+
});
|
|
342
|
+
};
|
|
343
|
+
var CapabilityToggle = withT(CapabilityToggle$1);
|
|
344
|
+
|
|
345
|
+
var MemberPicker = function MemberPicker(_ref) {
|
|
346
|
+
var candidates = _ref.candidates,
|
|
347
|
+
onAdd = _ref.onAdd;
|
|
348
|
+
var _useTranslation = useTranslation(),
|
|
349
|
+
t = _useTranslation.t;
|
|
350
|
+
var _useState = useState(""),
|
|
351
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
352
|
+
query = _useState2[0],
|
|
353
|
+
setQuery = _useState2[1];
|
|
354
|
+
var _useState3 = useState(false),
|
|
355
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
356
|
+
isOpen = _useState4[0],
|
|
357
|
+
setIsOpen = _useState4[1];
|
|
358
|
+
var _useState5 = useState([]),
|
|
359
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
360
|
+
selectedIds = _useState6[0],
|
|
361
|
+
setSelectedIds = _useState6[1];
|
|
362
|
+
var term = query.trim().toLowerCase();
|
|
363
|
+
var matches = candidates.filter(function (_ref2) {
|
|
364
|
+
var name = _ref2.name,
|
|
365
|
+
email = _ref2.email;
|
|
366
|
+
return !term || (name === null || name === void 0 ? void 0 : name.toLowerCase().includes(term)) || (email === null || email === void 0 ? void 0 : email.toLowerCase().includes(term));
|
|
367
|
+
});
|
|
368
|
+
var close = function close() {
|
|
369
|
+
setIsOpen(false);
|
|
370
|
+
setQuery("");
|
|
371
|
+
setSelectedIds([]);
|
|
372
|
+
};
|
|
373
|
+
var toggle = function toggle(id) {
|
|
374
|
+
return setSelectedIds(function (ids) {
|
|
375
|
+
return ids.includes(id) ? ids.filter(function (other) {
|
|
376
|
+
return other !== id;
|
|
377
|
+
}) : [].concat(_toConsumableArray(ids), [id]);
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
var handleDone = function handleDone() {
|
|
381
|
+
onAdd(candidates.filter(function (_ref3) {
|
|
382
|
+
var id = _ref3.id;
|
|
383
|
+
return selectedIds.includes(id);
|
|
384
|
+
}));
|
|
385
|
+
close();
|
|
386
|
+
};
|
|
387
|
+
var handleBlur = function handleBlur(event) {
|
|
388
|
+
if (!event.currentTarget.contains(event.relatedTarget)) close();
|
|
389
|
+
};
|
|
390
|
+
return /*#__PURE__*/jsxs("div", {
|
|
391
|
+
"data-testid": "access-member-picker",
|
|
392
|
+
onBlur: handleBlur,
|
|
393
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
394
|
+
"aria-label": t("access.dialog.searchPlaceholder"),
|
|
395
|
+
placeholder: t("access.dialog.searchPlaceholder"),
|
|
396
|
+
prefix: /*#__PURE__*/jsx(Search, {}),
|
|
397
|
+
value: query,
|
|
398
|
+
onChange: function onChange(event) {
|
|
399
|
+
return setQuery(event.target.value);
|
|
400
|
+
},
|
|
401
|
+
onFocus: function onFocus() {
|
|
402
|
+
return setIsOpen(true);
|
|
403
|
+
}
|
|
404
|
+
}), isOpen && /*#__PURE__*/jsxs("div", {
|
|
405
|
+
className: "border-border bg-background mt-1 rounded-md border shadow-sm",
|
|
406
|
+
tabIndex: -1,
|
|
407
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
408
|
+
className: "max-h-60 overflow-y-auto p-2",
|
|
409
|
+
children: matches.length === 0 ? /*#__PURE__*/jsx(Typography, {
|
|
410
|
+
className: "p-2",
|
|
411
|
+
color: "muted",
|
|
412
|
+
variant: "body3",
|
|
413
|
+
children: t("access.dialog.noMatch", {
|
|
414
|
+
query: query.trim()
|
|
415
|
+
})
|
|
416
|
+
}) : matches.map(function (_ref4) {
|
|
417
|
+
var id = _ref4.id,
|
|
418
|
+
name = _ref4.name,
|
|
419
|
+
email = _ref4.email;
|
|
420
|
+
return /*#__PURE__*/jsx("div", {
|
|
421
|
+
className: "p-2",
|
|
422
|
+
title: email,
|
|
423
|
+
children: /*#__PURE__*/jsx(Checkbox, {
|
|
424
|
+
checked: selectedIds.includes(id),
|
|
425
|
+
label: name || email,
|
|
426
|
+
onCheckedChange: function onCheckedChange() {
|
|
427
|
+
return toggle(id);
|
|
428
|
+
}
|
|
429
|
+
})
|
|
430
|
+
}, id);
|
|
431
|
+
})
|
|
432
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
433
|
+
className: "border-border flex items-center justify-between border-t p-2",
|
|
434
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
435
|
+
color: "muted",
|
|
436
|
+
variant: "body3",
|
|
437
|
+
children: selectedIds.length ? t("access.dialog.selectedCount", {
|
|
438
|
+
count: selectedIds.length
|
|
439
|
+
}) : t("access.dialog.selectOneOrMore")
|
|
440
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
441
|
+
disabled: !selectedIds.length,
|
|
442
|
+
label: t("access.dialog.done"),
|
|
443
|
+
size: "sm",
|
|
444
|
+
onClick: handleDone
|
|
445
|
+
})]
|
|
446
|
+
})]
|
|
447
|
+
})]
|
|
448
|
+
});
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
function ownKeys$k(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
452
|
+
function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$k(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$k(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
453
|
+
var MemberRow = function MemberRow(_ref) {
|
|
454
|
+
var name = _ref.name,
|
|
455
|
+
email = _ref.email,
|
|
456
|
+
profileImageUrl = _ref.profileImageUrl,
|
|
457
|
+
tag = _ref.tag,
|
|
458
|
+
children = _ref.children;
|
|
459
|
+
return /*#__PURE__*/jsxs("li", {
|
|
460
|
+
className: "border-border flex items-center gap-3 border-t py-2 first:border-t-0",
|
|
461
|
+
children: [/*#__PURE__*/jsx(Avatar, {
|
|
462
|
+
size: "sm",
|
|
463
|
+
user: {
|
|
464
|
+
name: name,
|
|
465
|
+
email: email,
|
|
466
|
+
imageUrl: profileImageUrl
|
|
467
|
+
}
|
|
468
|
+
}), /*#__PURE__*/jsx("div", {
|
|
469
|
+
className: "min-w-0 flex-1",
|
|
470
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
471
|
+
variant: "body3",
|
|
472
|
+
weight: "medium",
|
|
473
|
+
children: [name || email, tag && /*#__PURE__*/jsx(Badge, {
|
|
474
|
+
className: "ml-2",
|
|
475
|
+
label: tag,
|
|
476
|
+
size: "sm",
|
|
477
|
+
variant: "gray-subtle"
|
|
478
|
+
})]
|
|
479
|
+
})
|
|
480
|
+
}), children]
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
var RestrictedMembers = function RestrictedMembers(_ref2) {
|
|
484
|
+
var kind = _ref2.kind,
|
|
485
|
+
access = _ref2.access,
|
|
486
|
+
viewerId = _ref2.viewerId,
|
|
487
|
+
members = _ref2.members,
|
|
488
|
+
candidates = _ref2.candidates,
|
|
489
|
+
initialCapabilities = _ref2.initialCapabilities,
|
|
490
|
+
onChange = _ref2.onChange;
|
|
491
|
+
var _useTranslation = useTranslation(),
|
|
492
|
+
t = _useTranslation.t;
|
|
493
|
+
var creatorId = access.creatorId,
|
|
494
|
+
creatorName = access.creatorName;
|
|
495
|
+
var memberIds = members.map(function (_ref3) {
|
|
496
|
+
var userId = _ref3.userId;
|
|
497
|
+
return userId;
|
|
498
|
+
});
|
|
499
|
+
var pickable = candidates.filter(function (_ref4) {
|
|
500
|
+
var id = _ref4.id;
|
|
501
|
+
return id !== creatorId && !memberIds.includes(id);
|
|
502
|
+
});
|
|
503
|
+
var handleAdd = function handleAdd(picked) {
|
|
504
|
+
return onChange([].concat(_toConsumableArray(members), _toConsumableArray(picked.map(function (_ref5) {
|
|
505
|
+
var id = _ref5.id,
|
|
506
|
+
name = _ref5.name,
|
|
507
|
+
email = _ref5.email,
|
|
508
|
+
profileImageUrl = _ref5.profileImageUrl;
|
|
509
|
+
return {
|
|
510
|
+
userId: id,
|
|
511
|
+
name: name,
|
|
512
|
+
email: email,
|
|
513
|
+
profileImageUrl: profileImageUrl,
|
|
514
|
+
capability: NEW_MEMBER_CAPABILITY
|
|
515
|
+
};
|
|
516
|
+
}))));
|
|
517
|
+
};
|
|
518
|
+
var updateCapability = function updateCapability(userId, capability) {
|
|
519
|
+
return onChange(members.map(function (member) {
|
|
520
|
+
return member.userId === userId ? _objectSpread$k(_objectSpread$k({}, member), {}, {
|
|
521
|
+
capability: capability
|
|
522
|
+
}) : member;
|
|
523
|
+
}));
|
|
524
|
+
};
|
|
525
|
+
var remove = function remove(userId) {
|
|
526
|
+
return onChange(members.filter(function (member) {
|
|
527
|
+
return member.userId !== userId;
|
|
528
|
+
}));
|
|
529
|
+
};
|
|
530
|
+
var emptySummary = viewerId === creatorId ? t("access.dialog.onlyYouUntil") : t("access.dialog.onlyNameUntil", {
|
|
531
|
+
name: creatorName
|
|
532
|
+
});
|
|
533
|
+
var isDemoted = function isDemoted(_ref6) {
|
|
534
|
+
var userId = _ref6.userId,
|
|
535
|
+
capability = _ref6.capability;
|
|
536
|
+
return kind === "folder" && capability === "view" && initialCapabilities[userId] === "manage";
|
|
537
|
+
};
|
|
538
|
+
return /*#__PURE__*/jsxs("div", {
|
|
539
|
+
className: "space-y-3",
|
|
540
|
+
"data-testid": "access-restricted-members",
|
|
541
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
542
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
543
|
+
variant: "body2",
|
|
544
|
+
weight: "semibold",
|
|
545
|
+
children: t("access.dialog.selectMembers")
|
|
546
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
547
|
+
color: "muted",
|
|
548
|
+
variant: "body3",
|
|
549
|
+
children: t("access.dialog.selectMembersHint.".concat(kind))
|
|
550
|
+
})]
|
|
551
|
+
}), /*#__PURE__*/jsx(MemberPicker, {
|
|
552
|
+
candidates: pickable,
|
|
553
|
+
onAdd: handleAdd
|
|
554
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
555
|
+
className: "flex items-center justify-between",
|
|
556
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
557
|
+
variant: "body3",
|
|
558
|
+
weight: "semibold",
|
|
559
|
+
children: t("access.dialog.peopleWithAccess")
|
|
560
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
561
|
+
color: "muted",
|
|
562
|
+
variant: "body3",
|
|
563
|
+
children: members.length ? t("access.dialog.peopleCount", {
|
|
564
|
+
count: members.length + 1
|
|
565
|
+
}) : emptySummary
|
|
566
|
+
})]
|
|
567
|
+
}), /*#__PURE__*/jsxs("ul", {
|
|
568
|
+
"data-testid": "access-member-list",
|
|
569
|
+
children: [/*#__PURE__*/jsx(MemberRow, {
|
|
570
|
+
name: creatorName,
|
|
571
|
+
tag: viewerId === creatorId ? t("access.dialog.you") : t("access.dialog.createdThisFolder")
|
|
572
|
+
}), members.map(function (member) {
|
|
573
|
+
return /*#__PURE__*/createElement(MemberRow, _objectSpread$k(_objectSpread$k({}, member), {}, {
|
|
574
|
+
key: member.userId
|
|
575
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
576
|
+
className: "flex flex-col items-end gap-1",
|
|
577
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
578
|
+
className: "flex items-center gap-2",
|
|
579
|
+
children: [/*#__PURE__*/jsx(CapabilityToggle, {
|
|
580
|
+
value: member.capability,
|
|
581
|
+
label: t("access.dialog.capabilityFor", {
|
|
582
|
+
name: member.name || member.email
|
|
583
|
+
}),
|
|
584
|
+
onChange: function onChange(capability) {
|
|
585
|
+
return updateCapability(member.userId, capability);
|
|
586
|
+
}
|
|
587
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
588
|
+
label: t("access.dialog.remove"),
|
|
589
|
+
size: "sm",
|
|
590
|
+
variant: "link",
|
|
591
|
+
"aria-label": t("access.dialog.removeName", {
|
|
592
|
+
name: member.name || member.email
|
|
593
|
+
}),
|
|
594
|
+
onClick: function onClick() {
|
|
595
|
+
return remove(member.userId);
|
|
596
|
+
}
|
|
597
|
+
})]
|
|
598
|
+
}), isDemoted(member) && /*#__PURE__*/jsx(Typography, {
|
|
599
|
+
color: "muted",
|
|
600
|
+
variant: "body3",
|
|
601
|
+
children: t("access.dialog.demoteHint")
|
|
602
|
+
})]
|
|
603
|
+
}));
|
|
604
|
+
})]
|
|
605
|
+
})]
|
|
606
|
+
});
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
var WorkspaceCapability$1 = function WorkspaceCapability(_ref) {
|
|
610
|
+
var t = _ref.t,
|
|
611
|
+
value = _ref.value,
|
|
612
|
+
onChange = _ref.onChange;
|
|
613
|
+
return /*#__PURE__*/jsxs("div", {
|
|
614
|
+
className: "space-y-2",
|
|
615
|
+
"data-testid": "access-capability-picker",
|
|
616
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
617
|
+
variant: "body2",
|
|
618
|
+
weight: "semibold",
|
|
619
|
+
children: t("access.dialog.capability")
|
|
620
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
621
|
+
className: "flex items-center justify-between gap-3",
|
|
622
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
623
|
+
variant: "body3",
|
|
624
|
+
children: t("access.dialog.everyoneCan")
|
|
625
|
+
}), /*#__PURE__*/jsx(CapabilityToggle, {
|
|
626
|
+
onChange: onChange,
|
|
627
|
+
value: value,
|
|
628
|
+
label: t("access.dialog.everyoneCan")
|
|
629
|
+
})]
|
|
630
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
631
|
+
color: "muted",
|
|
632
|
+
variant: "body3",
|
|
633
|
+
children: t("access.dialog.manageHint")
|
|
634
|
+
})]
|
|
635
|
+
});
|
|
636
|
+
};
|
|
637
|
+
var WorkspaceCapability = withT(WorkspaceCapability$1);
|
|
638
|
+
|
|
639
|
+
var AccessShareDialog = function AccessShareDialog(_ref) {
|
|
640
|
+
var isOpen = _ref.isOpen,
|
|
641
|
+
kind = _ref.kind,
|
|
642
|
+
node = _ref.node,
|
|
643
|
+
access = _ref.access,
|
|
644
|
+
viewerId = _ref.viewerId,
|
|
645
|
+
_ref$members = _ref.members,
|
|
646
|
+
candidates = _ref$members === void 0 ? [] : _ref$members,
|
|
647
|
+
affected = _ref.affected,
|
|
648
|
+
_ref$isSaving = _ref.isSaving,
|
|
649
|
+
isSaving = _ref$isSaving === void 0 ? false : _ref$isSaving,
|
|
650
|
+
onClose = _ref.onClose,
|
|
651
|
+
onSave = _ref.onSave;
|
|
652
|
+
var _useTranslation = useTranslation(),
|
|
653
|
+
t = _useTranslation.t;
|
|
654
|
+
var initialDraft = useMemo(function () {
|
|
655
|
+
return buildInitialDraft(access !== null && access !== void 0 ? access : {});
|
|
656
|
+
}, [access]);
|
|
657
|
+
var _useState = useState(initialDraft),
|
|
658
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
659
|
+
draft = _useState2[0],
|
|
660
|
+
setDraft = _useState2[1];
|
|
661
|
+
var isCustom = draft.isCustom,
|
|
662
|
+
accessType = draft.accessType,
|
|
663
|
+
capability = draft.capability,
|
|
664
|
+
members = draft.members;
|
|
665
|
+
var initialCapabilities = useMemo(function () {
|
|
666
|
+
return Object.fromEntries(initialDraft.members.map(function (_ref2) {
|
|
667
|
+
var userId = _ref2.userId,
|
|
668
|
+
capability = _ref2.capability;
|
|
669
|
+
return [userId, capability];
|
|
670
|
+
}));
|
|
671
|
+
}, [initialDraft]);
|
|
672
|
+
var update = function update(changes) {
|
|
673
|
+
return setDraft(mergeLeft(changes));
|
|
674
|
+
};
|
|
675
|
+
var isOwner = viewerId === (access === null || access === void 0 ? void 0 : access.creatorId);
|
|
676
|
+
var ownerName = isOwner ? null : access === null || access === void 0 ? void 0 : access.creatorName;
|
|
677
|
+
|
|
678
|
+
// A non-owner Manager switching to Restricted starts on the list as Manage,
|
|
679
|
+
// so saving doesn't silently lock them out; they can still remove themselves.
|
|
680
|
+
var handleTypeChange = function handleTypeChange(type) {
|
|
681
|
+
var _candidates$find;
|
|
682
|
+
var addViewer = type === "restricted" && accessType !== "restricted" && !isOwner && !members.some(function (_ref3) {
|
|
683
|
+
var userId = _ref3.userId;
|
|
684
|
+
return userId === viewerId;
|
|
685
|
+
});
|
|
686
|
+
if (!addViewer) return update({
|
|
687
|
+
accessType: type
|
|
688
|
+
});
|
|
689
|
+
var viewer = (_candidates$find = candidates.find(function (_ref4) {
|
|
690
|
+
var id = _ref4.id;
|
|
691
|
+
return id === viewerId;
|
|
692
|
+
})) !== null && _candidates$find !== void 0 ? _candidates$find : {};
|
|
693
|
+
return update({
|
|
694
|
+
accessType: type,
|
|
695
|
+
members: [].concat(_toConsumableArray(members), [{
|
|
696
|
+
userId: viewerId,
|
|
697
|
+
name: viewer.name,
|
|
698
|
+
email: viewer.email,
|
|
699
|
+
profileImageUrl: viewer.profileImageUrl,
|
|
700
|
+
capability: MANAGE_CAPABILITY
|
|
701
|
+
}])
|
|
702
|
+
});
|
|
703
|
+
};
|
|
704
|
+
var handleSave = function handleSave() {
|
|
705
|
+
return onSave(isCustom ? {
|
|
706
|
+
accessType: accessType,
|
|
707
|
+
capability: capability,
|
|
708
|
+
members: accessType === "restricted" ? members.map(function (_ref5) {
|
|
709
|
+
var userId = _ref5.userId,
|
|
710
|
+
capability = _ref5.capability;
|
|
711
|
+
return {
|
|
712
|
+
userId: userId,
|
|
713
|
+
capability: capability
|
|
714
|
+
};
|
|
715
|
+
}) : []
|
|
716
|
+
} : NOT_CUSTOM_DRAFT);
|
|
717
|
+
};
|
|
718
|
+
if (!access) return null;
|
|
719
|
+
return /*#__PURE__*/jsxs(Sheet, {
|
|
720
|
+
isOpen: isOpen,
|
|
721
|
+
onClose: onClose,
|
|
722
|
+
size: "large",
|
|
723
|
+
children: [/*#__PURE__*/jsxs(Sheet.Header, {
|
|
724
|
+
children: [/*#__PURE__*/jsx(Sheet.Title, {
|
|
725
|
+
children: t("access.dialog.title", {
|
|
726
|
+
kind: kind
|
|
727
|
+
})
|
|
728
|
+
}), (node === null || node === void 0 ? void 0 : node.name) && /*#__PURE__*/jsx(Typography, {
|
|
729
|
+
color: "muted",
|
|
730
|
+
variant: "body3",
|
|
731
|
+
children: node.name
|
|
732
|
+
})]
|
|
733
|
+
}), /*#__PURE__*/jsxs(Sheet.Body, {
|
|
734
|
+
className: "items-stretch space-y-4",
|
|
735
|
+
children: [access.inheritable && /*#__PURE__*/jsx(InheritBox, {
|
|
736
|
+
access: access,
|
|
737
|
+
isCustom: isCustom,
|
|
738
|
+
kind: kind,
|
|
739
|
+
viewerId: viewerId,
|
|
740
|
+
onToggle: function onToggle(checked) {
|
|
741
|
+
return update({
|
|
742
|
+
isCustom: checked
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
}), isCustom && /*#__PURE__*/jsxs(Fragment, {
|
|
746
|
+
children: [/*#__PURE__*/jsx(AccessTypeCards, {
|
|
747
|
+
kind: kind,
|
|
748
|
+
ownerName: ownerName,
|
|
749
|
+
value: accessType,
|
|
750
|
+
onChange: handleTypeChange
|
|
751
|
+
}), accessType === "workspace" && /*#__PURE__*/jsx(WorkspaceCapability, {
|
|
752
|
+
value: capability,
|
|
753
|
+
onChange: function onChange(next) {
|
|
754
|
+
return update({
|
|
755
|
+
capability: next
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
}), accessType === "restricted" && /*#__PURE__*/jsx(RestrictedMembers, {
|
|
759
|
+
access: access,
|
|
760
|
+
candidates: candidates,
|
|
761
|
+
initialCapabilities: initialCapabilities,
|
|
762
|
+
kind: kind,
|
|
763
|
+
members: members,
|
|
764
|
+
viewerId: viewerId,
|
|
765
|
+
onChange: function onChange(next) {
|
|
766
|
+
return update({
|
|
767
|
+
members: next
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
}), (affected === null || affected === void 0 ? void 0 : affected.total) > 0 && /*#__PURE__*/jsx(AffectedNote, {
|
|
771
|
+
affected: affected
|
|
772
|
+
})]
|
|
773
|
+
})]
|
|
774
|
+
}), /*#__PURE__*/jsxs(Sheet.Footer, {
|
|
775
|
+
className: "flex justify-end gap-2",
|
|
776
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
777
|
+
label: t("common.cancel"),
|
|
778
|
+
variant: "ghost",
|
|
779
|
+
onClick: onClose
|
|
780
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
781
|
+
label: t("common.save"),
|
|
782
|
+
loading: isSaving,
|
|
783
|
+
onClick: handleSave
|
|
784
|
+
})]
|
|
785
|
+
})]
|
|
786
|
+
});
|
|
787
|
+
};
|
|
788
|
+
|
|
38
789
|
function ownKeys$j(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
790
|
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$j(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$j(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
40
791
|
var FoldersAlerts = function FoldersAlerts(_ref) {
|
|
@@ -125,8 +876,8 @@ var _excluded$7 = ["type"];
|
|
|
125
876
|
function ownKeys$i(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
126
877
|
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
127
878
|
var typeComponentMap = {
|
|
128
|
-
string: Input,
|
|
129
|
-
"boolean": Switch,
|
|
879
|
+
string: Input$1,
|
|
880
|
+
"boolean": Switch$1,
|
|
130
881
|
textarea: Textarea
|
|
131
882
|
};
|
|
132
883
|
var ExtraAttributes = function ExtraAttributes(_ref) {
|
|
@@ -307,7 +1058,7 @@ var AddEditPane = function AddEditPane(_ref) {
|
|
|
307
1058
|
className: "pb-6",
|
|
308
1059
|
children: /*#__PURE__*/jsxs("div", {
|
|
309
1060
|
className: "w-full space-y-5",
|
|
310
|
-
children: [/*#__PURE__*/jsx(Input, {
|
|
1061
|
+
children: [/*#__PURE__*/jsx(Input$1, {
|
|
311
1062
|
required: true,
|
|
312
1063
|
label: t("folders.name"),
|
|
313
1064
|
name: "name",
|
|
@@ -346,6 +1097,119 @@ var AddEditPane = function AddEditPane(_ref) {
|
|
|
346
1097
|
});
|
|
347
1098
|
};
|
|
348
1099
|
|
|
1100
|
+
var buildMessage = function buildMessage(t, preview) {
|
|
1101
|
+
var movedCount = preview.movedCount,
|
|
1102
|
+
changingCount = preview.changingCount,
|
|
1103
|
+
name = preview.name,
|
|
1104
|
+
destinationName = preview.destinationName,
|
|
1105
|
+
affectedCount = preview.affectedCount;
|
|
1106
|
+
var summary;
|
|
1107
|
+
if (movedCount === 1) {
|
|
1108
|
+
summary = t("moveAccess.single", {
|
|
1109
|
+
name: name,
|
|
1110
|
+
destination: destinationName
|
|
1111
|
+
});
|
|
1112
|
+
} else if (destinationName) {
|
|
1113
|
+
summary = t("moveAccess.batch", {
|
|
1114
|
+
count: changingCount,
|
|
1115
|
+
total: movedCount,
|
|
1116
|
+
destination: destinationName
|
|
1117
|
+
});
|
|
1118
|
+
} else {
|
|
1119
|
+
summary = t("moveAccess.batchNewFolders", {
|
|
1120
|
+
count: changingCount,
|
|
1121
|
+
total: movedCount
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
1125
|
+
children: [summary, affectedCount > 0 && /*#__PURE__*/jsxs(Fragment, {
|
|
1126
|
+
children: [" ", t("moveAccess.affected", {
|
|
1127
|
+
count: affectedCount
|
|
1128
|
+
})]
|
|
1129
|
+
})]
|
|
1130
|
+
});
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
// moves: [{ id, kind: "folder" | "item", parentId }]. Without config.api.previewMove, or when the
|
|
1134
|
+
// preview fails, the move goes ahead unconfirmed, as before.
|
|
1135
|
+
var useMoveAccessConfirmation = function useMoveAccessConfirmation(config) {
|
|
1136
|
+
var _useState = useState(null),
|
|
1137
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1138
|
+
pending = _useState2[0],
|
|
1139
|
+
setPending = _useState2[1];
|
|
1140
|
+
var _useTranslation = useTranslation(config),
|
|
1141
|
+
t = _useTranslation.t;
|
|
1142
|
+
var confirmMove = /*#__PURE__*/function () {
|
|
1143
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(moves, performMove) {
|
|
1144
|
+
var _preview;
|
|
1145
|
+
var preview;
|
|
1146
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1147
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1148
|
+
case 0:
|
|
1149
|
+
if (config.api.previewMove) {
|
|
1150
|
+
_context.next = 2;
|
|
1151
|
+
break;
|
|
1152
|
+
}
|
|
1153
|
+
return _context.abrupt("return", performMove());
|
|
1154
|
+
case 2:
|
|
1155
|
+
preview = null;
|
|
1156
|
+
_context.prev = 3;
|
|
1157
|
+
_context.next = 6;
|
|
1158
|
+
return config.api.previewMove({
|
|
1159
|
+
moves: moves
|
|
1160
|
+
});
|
|
1161
|
+
case 6:
|
|
1162
|
+
preview = _context.sent;
|
|
1163
|
+
_context.next = 12;
|
|
1164
|
+
break;
|
|
1165
|
+
case 9:
|
|
1166
|
+
_context.prev = 9;
|
|
1167
|
+
_context.t0 = _context["catch"](3);
|
|
1168
|
+
return _context.abrupt("return", performMove());
|
|
1169
|
+
case 12:
|
|
1170
|
+
if ((_preview = preview) !== null && _preview !== void 0 && _preview.changingCount) {
|
|
1171
|
+
_context.next = 14;
|
|
1172
|
+
break;
|
|
1173
|
+
}
|
|
1174
|
+
return _context.abrupt("return", performMove());
|
|
1175
|
+
case 14:
|
|
1176
|
+
return _context.abrupt("return", setPending({
|
|
1177
|
+
preview: preview,
|
|
1178
|
+
performMove: performMove
|
|
1179
|
+
}));
|
|
1180
|
+
case 15:
|
|
1181
|
+
case "end":
|
|
1182
|
+
return _context.stop();
|
|
1183
|
+
}
|
|
1184
|
+
}, _callee, null, [[3, 9]]);
|
|
1185
|
+
}));
|
|
1186
|
+
return function confirmMove(_x, _x2) {
|
|
1187
|
+
return _ref.apply(this, arguments);
|
|
1188
|
+
};
|
|
1189
|
+
}();
|
|
1190
|
+
var onClose = function onClose() {
|
|
1191
|
+
return setPending(null);
|
|
1192
|
+
};
|
|
1193
|
+
var onSubmit = function onSubmit() {
|
|
1194
|
+
pending.performMove();
|
|
1195
|
+
onClose();
|
|
1196
|
+
};
|
|
1197
|
+
var confirmationAlert = /*#__PURE__*/jsx(Alert, {
|
|
1198
|
+
onClose: onClose,
|
|
1199
|
+
onSubmit: onSubmit,
|
|
1200
|
+
isOpen: !!pending,
|
|
1201
|
+
message: pending && buildMessage(t, pending.preview),
|
|
1202
|
+
style: "warning",
|
|
1203
|
+
submitButtonLabel: t("moveAccess.submit"),
|
|
1204
|
+
title: t("moveAccess.title")
|
|
1205
|
+
});
|
|
1206
|
+
return {
|
|
1207
|
+
confirmMove: confirmMove,
|
|
1208
|
+
confirmationAlert: confirmationAlert,
|
|
1209
|
+
isConfirming: !!pending
|
|
1210
|
+
};
|
|
1211
|
+
};
|
|
1212
|
+
|
|
349
1213
|
var _excluded$6 = ["icon", "itemLabel", "folder", "folderLabel", "depth", "hideTreeIndent", "className", "onClick"];
|
|
350
1214
|
function ownKeys$h(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
351
1215
|
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -499,7 +1363,8 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
499
1363
|
onSubmit = _ref.onSubmit,
|
|
500
1364
|
onClose = _ref.onClose,
|
|
501
1365
|
onRemove = _ref.onRemove,
|
|
502
|
-
parentId = _ref.parentId
|
|
1366
|
+
parentId = _ref.parentId,
|
|
1367
|
+
getMoves = _ref.getMoves;
|
|
503
1368
|
var parent = (item === null || item === void 0 ? void 0 : item.parentId) || parentId || null;
|
|
504
1369
|
var _useState = useState(parent),
|
|
505
1370
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -524,6 +1389,17 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
524
1389
|
};
|
|
525
1390
|
}, shallow),
|
|
526
1391
|
type = _useFolderStore2.type;
|
|
1392
|
+
var _useMoveAccessConfirm = useMoveAccessConfirmation(config),
|
|
1393
|
+
confirmMove = _useMoveAccessConfirm.confirmMove,
|
|
1394
|
+
confirmationAlert = _useMoveAccessConfirm.confirmationAlert,
|
|
1395
|
+
isConfirming = _useMoveAccessConfirm.isConfirming;
|
|
1396
|
+
|
|
1397
|
+
// getMoves(selection) lists the moves so a change of access can be confirmed first.
|
|
1398
|
+
var handleSubmit = function handleSubmit() {
|
|
1399
|
+
return getMoves ? confirmMove(getMoves(selection), function () {
|
|
1400
|
+
return onSubmit(selection);
|
|
1401
|
+
}) : onSubmit(selection);
|
|
1402
|
+
};
|
|
527
1403
|
var tree = useMemo(function () {
|
|
528
1404
|
return createTree(folders, isRootEnabled);
|
|
529
1405
|
}, [folders, isRootEnabled]);
|
|
@@ -567,17 +1443,15 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
567
1443
|
}, shallow),
|
|
568
1444
|
lastCreatedFolderId = _useFolderStore3.lastCreatedFolderId;
|
|
569
1445
|
useEffect(function () {
|
|
570
|
-
if (lastCreatedFolderId
|
|
1446
|
+
if (isNil(lastCreatedFolderId)) return;
|
|
571
1447
|
setSelection(lastCreatedFolderId);
|
|
572
1448
|
setFolderState({
|
|
573
1449
|
lastCreatedFolderId: null
|
|
574
1450
|
});
|
|
575
1451
|
}, [lastCreatedFolderId]);
|
|
576
|
-
useHotkeys(["command+enter", "enter"],
|
|
577
|
-
return onSubmit(selection);
|
|
578
|
-
}, {
|
|
1452
|
+
useHotkeys(["command+enter", "enter"], handleSubmit, {
|
|
579
1453
|
mode: "global",
|
|
580
|
-
enabled: !!type
|
|
1454
|
+
enabled: !!type && !isConfirming
|
|
581
1455
|
});
|
|
582
1456
|
if (isFetching) {
|
|
583
1457
|
return /*#__PURE__*/jsx(Sheet.Body, {
|
|
@@ -604,7 +1478,7 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
604
1478
|
className: "mb-4",
|
|
605
1479
|
variant: "warning",
|
|
606
1480
|
children: nestingWarning
|
|
607
|
-
}), /*#__PURE__*/jsx(RadioGroup, {
|
|
1481
|
+
}), /*#__PURE__*/jsx(RadioGroup$1, {
|
|
608
1482
|
className: "contents",
|
|
609
1483
|
value: toRadioValue(selection),
|
|
610
1484
|
children: tree.map(function (folder) {
|
|
@@ -628,9 +1502,7 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
628
1502
|
children: [/*#__PURE__*/jsx(Button, _objectSpread$f(_objectSpread$f({
|
|
629
1503
|
label: t("common.save"),
|
|
630
1504
|
variant: "default",
|
|
631
|
-
onClick:
|
|
632
|
-
return onSubmit(selection);
|
|
633
|
-
}
|
|
1505
|
+
onClick: handleSubmit
|
|
634
1506
|
}, submitButtonProps), {}, {
|
|
635
1507
|
"data-testid": "save-changes-button",
|
|
636
1508
|
disabled: selection === parent || (submitButtonProps === null || submitButtonProps === void 0 ? void 0 : submitButtonProps.disabled)
|
|
@@ -648,7 +1520,7 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
648
1520
|
}, removeButtonProps), {}, {
|
|
649
1521
|
"data-testid": "remove-from-folder-button"
|
|
650
1522
|
}))]
|
|
651
|
-
})]
|
|
1523
|
+
}), confirmationAlert]
|
|
652
1524
|
});
|
|
653
1525
|
};
|
|
654
1526
|
|
|
@@ -675,7 +1547,8 @@ var MoveFolderPane = function MoveFolderPane(_ref) {
|
|
|
675
1547
|
payload: payload,
|
|
676
1548
|
config: {
|
|
677
1549
|
showToastr: false
|
|
678
|
-
}
|
|
1550
|
+
},
|
|
1551
|
+
initialSlug: item.sid
|
|
679
1552
|
}, {
|
|
680
1553
|
onSuccess: function onSuccess() {
|
|
681
1554
|
var _config$onUpdateSucce;
|
|
@@ -689,6 +1562,13 @@ var MoveFolderPane = function MoveFolderPane(_ref) {
|
|
|
689
1562
|
config: config,
|
|
690
1563
|
item: item,
|
|
691
1564
|
onClose: onClose,
|
|
1565
|
+
getMoves: function getMoves(parentId) {
|
|
1566
|
+
return [{
|
|
1567
|
+
id: item.id,
|
|
1568
|
+
kind: "folder",
|
|
1569
|
+
parentId: parentId
|
|
1570
|
+
}];
|
|
1571
|
+
},
|
|
692
1572
|
submitButtonProps: {
|
|
693
1573
|
loading: isPending,
|
|
694
1574
|
disabled: isPending
|
|
@@ -967,10 +1847,11 @@ var _DraggableNode = function DraggableNode(_ref) {
|
|
|
967
1847
|
var isOverItem = folder.id === (overItem === null || overItem === void 0 ? void 0 : overItem.id);
|
|
968
1848
|
var isOverParent = folder.id === (overItem === null || overItem === void 0 || (_overItem$meta$parent = overItem.meta.parent) === null || _overItem$meta$parent === void 0 ? void 0 : _overItem$meta$parent.id);
|
|
969
1849
|
var isRoot = folder.meta.depth <= 0;
|
|
1850
|
+
var isLocked = isViewOnly(folder);
|
|
970
1851
|
var _useDraggable = useDraggable({
|
|
971
1852
|
id: "draggable-item--".concat(folder.id),
|
|
972
1853
|
data: folder,
|
|
973
|
-
disabled: isRoot
|
|
1854
|
+
disabled: isRoot || isLocked
|
|
974
1855
|
}),
|
|
975
1856
|
isDragging = _useDraggable.isDragging,
|
|
976
1857
|
attributes = _useDraggable.attributes,
|
|
@@ -980,7 +1861,8 @@ var _DraggableNode = function DraggableNode(_ref) {
|
|
|
980
1861
|
var _useDroppable = useDroppable({
|
|
981
1862
|
id: "droppable-item--".concat(folder.id),
|
|
982
1863
|
data: folder,
|
|
983
|
-
|
|
1864
|
+
// Dropping on a node places the dragged folder beside it, inside its parent.
|
|
1865
|
+
disabled: isRoot || isInDraggedSubtree || isViewOnly(folder.meta.parent)
|
|
984
1866
|
}),
|
|
985
1867
|
setDroppableRef = _useDroppable.setNodeRef;
|
|
986
1868
|
|
|
@@ -990,7 +1872,7 @@ var _DraggableNode = function DraggableNode(_ref) {
|
|
|
990
1872
|
children: [/*#__PURE__*/jsx(PlaceholderNode, {
|
|
991
1873
|
dragState: dragState,
|
|
992
1874
|
folder: folder,
|
|
993
|
-
disabled: isInDraggedSubtree
|
|
1875
|
+
disabled: isInDraggedSubtree || isLocked
|
|
994
1876
|
}), isArray(folder.children) && folder.children.map(function (child) {
|
|
995
1877
|
var _child$children$lengt, _child$children;
|
|
996
1878
|
return /*#__PURE__*/createElement(_DraggableNode, _objectSpread$c(_objectSpread$c({}, _objectSpread$c(_objectSpread$c({}, rest), {}, {
|
|
@@ -1017,7 +1899,9 @@ var _DraggableNode = function DraggableNode(_ref) {
|
|
|
1017
1899
|
itemLabel: itemLabel
|
|
1018
1900
|
})), {}, {
|
|
1019
1901
|
className: classNames({
|
|
1020
|
-
"hover:bg-muted w-full
|
|
1902
|
+
"hover:bg-muted w-full transition-colors": true,
|
|
1903
|
+
"cursor-move": !isLocked,
|
|
1904
|
+
"cursor-not-allowed": isLocked,
|
|
1021
1905
|
"bg-muted opacity-50": isInDraggedSubtree,
|
|
1022
1906
|
"bg-accent": isOverParent,
|
|
1023
1907
|
"border-primary border-b-2": isOverItem
|
|
@@ -1075,6 +1959,10 @@ var ReorderFoldersPane = function ReorderFoldersPane(_ref) {
|
|
|
1075
1959
|
};
|
|
1076
1960
|
}, shallow),
|
|
1077
1961
|
type = _useFolderStore.type;
|
|
1962
|
+
var _useMoveAccessConfirm = useMoveAccessConfirmation(config),
|
|
1963
|
+
confirmMove = _useMoveAccessConfirm.confirmMove,
|
|
1964
|
+
confirmationAlert = _useMoveAccessConfirm.confirmationAlert,
|
|
1965
|
+
isConfirming = _useMoveAccessConfirm.isConfirming;
|
|
1078
1966
|
var _useStateWithDependen = useStateWithDependency(function () {
|
|
1079
1967
|
return {
|
|
1080
1968
|
name: "/",
|
|
@@ -1102,6 +1990,9 @@ var ReorderFoldersPane = function ReorderFoldersPane(_ref) {
|
|
|
1102
1990
|
|
|
1103
1991
|
// Guards: Check moving inside invalid directories.
|
|
1104
1992
|
if (!targetFolder || activeFolder.id === targetFolder.id) return;
|
|
1993
|
+
|
|
1994
|
+
// The server refuses the whole batch without Manage on both ends.
|
|
1995
|
+
if (isViewOnly(activeFolder) || isViewOnly(targetFolder)) return;
|
|
1105
1996
|
if (activeFolder.meta.parent.id === targetFolder.id && activeFolder.meta.index === targetIndex) {
|
|
1106
1997
|
return;
|
|
1107
1998
|
}
|
|
@@ -1126,11 +2017,10 @@ var ReorderFoldersPane = function ReorderFoldersPane(_ref) {
|
|
|
1126
2017
|
index: targetIndex
|
|
1127
2018
|
}));
|
|
1128
2019
|
};
|
|
1129
|
-
var
|
|
1130
|
-
|
|
2020
|
+
var saveChanges = function saveChanges() {
|
|
2021
|
+
return reorderFolders({
|
|
1131
2022
|
changes: changes
|
|
1132
|
-
}
|
|
1133
|
-
reorderFolders(payload, {
|
|
2023
|
+
}, {
|
|
1134
2024
|
onSuccess: function onSuccess() {
|
|
1135
2025
|
var _config$onUpdateSucce;
|
|
1136
2026
|
onClose();
|
|
@@ -1138,9 +2028,22 @@ var ReorderFoldersPane = function ReorderFoldersPane(_ref) {
|
|
|
1138
2028
|
}
|
|
1139
2029
|
});
|
|
1140
2030
|
};
|
|
2031
|
+
var onSubmit = function onSubmit() {
|
|
2032
|
+
var moves = Object.entries(changes).map(function (_ref3) {
|
|
2033
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
2034
|
+
id = _ref4[0],
|
|
2035
|
+
parentId = _ref4[1].parentId;
|
|
2036
|
+
return {
|
|
2037
|
+
id: id,
|
|
2038
|
+
kind: "folder",
|
|
2039
|
+
parentId: parentId
|
|
2040
|
+
};
|
|
2041
|
+
});
|
|
2042
|
+
confirmMove(moves, saveChanges);
|
|
2043
|
+
};
|
|
1141
2044
|
useHotkeys(["command+enter", "enter"], onSubmit, {
|
|
1142
2045
|
mode: "global",
|
|
1143
|
-
enabled: !!type
|
|
2046
|
+
enabled: !!type && !isConfirming
|
|
1144
2047
|
});
|
|
1145
2048
|
var nodeProps = {
|
|
1146
2049
|
icon: /*#__PURE__*/jsx(GripVertical, {
|
|
@@ -1163,12 +2066,12 @@ var ReorderFoldersPane = function ReorderFoldersPane(_ref) {
|
|
|
1163
2066
|
sensors: sensors,
|
|
1164
2067
|
collisionDetection: closestCenter(dragState),
|
|
1165
2068
|
measuring: measuringConfig,
|
|
1166
|
-
onDragOver: function onDragOver(
|
|
1167
|
-
var over =
|
|
2069
|
+
onDragOver: function onDragOver(_ref5) {
|
|
2070
|
+
var over = _ref5.over;
|
|
1168
2071
|
setDragState(assoc("overItem", over === null || over === void 0 ? void 0 : over.data.current));
|
|
1169
2072
|
},
|
|
1170
|
-
onDragStart: function onDragStart(
|
|
1171
|
-
var active =
|
|
2073
|
+
onDragStart: function onDragStart(_ref6) {
|
|
2074
|
+
var active = _ref6.active;
|
|
1172
2075
|
setDragState(assoc("activeItem", active.data.current));
|
|
1173
2076
|
},
|
|
1174
2077
|
children: [/*#__PURE__*/jsx(Sheet.Body, {
|
|
@@ -1206,7 +2109,7 @@ var ReorderFoldersPane = function ReorderFoldersPane(_ref) {
|
|
|
1206
2109
|
itemLabel: config.labels[((_dragState$activeItem3 = dragState.activeItem) === null || _dragState$activeItem3 === void 0 ? void 0 : _dragState$activeItem3.itemCount) > 1 ? "items" : "item"]
|
|
1207
2110
|
}))
|
|
1208
2111
|
}), document.body)]
|
|
1209
|
-
})]
|
|
2112
|
+
}), confirmationAlert]
|
|
1210
2113
|
});
|
|
1211
2114
|
};
|
|
1212
2115
|
|
|
@@ -1928,5 +2831,5 @@ TreeSelect.displayName = "TreeSelect";
|
|
|
1928
2831
|
var css = ".neeto-sidebar-folders-tree__folder-node{align-items:center;border-radius:.375rem;border-radius:var(--radius-md,.375rem);color:inherit!important;display:flex;flex:1 1 auto;min-height:1.5rem;min-width:0;padding-inline:8px 0;transition:background-color .15s ease}.neeto-sidebar-folders-tree__folder-node:hover{background-color:var(--sidebar-accent)}.neeto-sidebar-folders-tree [role=treeitem]>*>:first-child:not(:has(.neeto-sidebar-folders-tree__folder-node)){align-items:center;border-radius:.375rem;border-radius:var(--radius-md,.375rem);cursor:pointer;display:flex;flex-shrink:0;height:1.5rem;justify-content:center;transition:background-color .15s ease;width:1.5rem}.neeto-sidebar-folders-tree [role=treeitem]>*>:first-child:not(:has(.neeto-sidebar-folders-tree__folder-node)):hover{background-color:var(--sidebar-accent)!important}.neeto-sidebar-folders-tree [role=treeitem] :has(>.neeto-sidebar-folders-tree__folder-node){padding-block:2px!important}.neeto-sidebar-folders-tree [role=treeitem][aria-selected=true] .neeto-sidebar-folders-tree__folder-node{background-color:var(--sidebar-accent)}.neeto-sidebar-folders-tree [role=treeitem]{outline:none}.neeto-sidebar-folders-tree [role=treeitem]>*{background-color:transparent!important;box-shadow:none!important;-moz-column-gap:0;column-gap:0;padding-inline:0}.neeto-sidebar-folders-tree__folder-node-actions{opacity:0;transition:opacity .15s ease}.neeto-sidebar-folders-tree__folder-node:hover .neeto-sidebar-folders-tree__folder-node-actions{background:linear-gradient(to right,transparent 0,var(--sidebar-accent) 1.5rem);opacity:1}[dir=rtl] .neeto-sidebar-folders-tree__folder-node:hover .neeto-sidebar-folders-tree__folder-node-actions{background:linear-gradient(to left,transparent 0,var(--sidebar-accent) 1.5rem)}[dir=rtl] .neeto-sidebar-folders-tree [role=tree]>div{direction:rtl!important}[dir=rtl] .neeto-sidebar-folders-tree [role=treeitem]>*{padding-left:0!important}[dir=rtl] .neeto-sidebar-folders-tree [role=treeitem][aria-level=\"2\"]>*{padding-right:20px!important}[dir=rtl] .neeto-sidebar-folders-tree [role=treeitem][aria-level=\"3\"]>*{padding-right:40px!important}[dir=rtl] .neeto-sidebar-folders-tree [role=treeitem][aria-level=\"4\"]>*{padding-right:60px!important}[dir=rtl] .neeto-sidebar-folders-tree [role=treeitem][aria-level=\"5\"]>*{padding-right:80px!important}[dir=rtl] .neeto-sidebar-folders-tree [role=treeitem][aria-level=\"6\"]>*{padding-right:100px!important}[dir=rtl] .neeto-sidebar-folders-tree__switcher-collapsed{transform:scaleX(-1)}.neeto-folders-grid-view-wrapper{grid-template-columns:repeat(auto-fill,minmax(256px,1fr))}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy92Mi9jb21wb25lbnRzL25lZXRvLWZvbGRlcnMtbmFuby5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVVBLHlDQUdFLGtCQUFBLENBVUEscUJBQUEsQ0FBQSxzQ0FBQSxDQUNBLHVCQUFBLENBYkEsWUFBQSxDQUNBLGFBQUEsQ0FHQSxpQkFBQSxDQURBLFdBQUEsQ0FRQSxvQkFBQSxDQUdBLHFDQWZGLENBaUJFLCtDQUNFLHNDQWZKLENBdUJBLCtHQU1FLGtCQUFBLENBSUEscUJBQUEsQ0FBQSxzQ0FBQSxDQUNBLGNBQUEsQ0FQQSxZQUFBLENBQ0EsYUFBQSxDQUlBLGFBQUEsQ0FGQSxzQkFBQSxDQUtBLHFDQUFBLENBSkEsWUFuQkYsQ0F5QkUscUhBQ0UsZ0RBdkJKLENBOEJBLDRGQUdFLDJCQTdCRixDQWlDQSx5R0FHRSxzQ0FoQ0YsQ0FzQ0EsNENBQ0UsWUFuQ0YsQ0FxQ0UsOENBTUUsc0NBQUEsQ0FDQSx5QkFBQSxDQUhBLGlCQUFBLENBQUEsWUFBQSxDQUNBLGdCQXBDSixDQThDQSxpREFDRSxTQUFBLENBQ0EsNEJBM0NGLENBZ0RBLGdHQUdFLCtFQUFBLENBREEsU0E3Q0YsQ0F1REEsMEdBR0UsOEVBdERGLENBcUVBLHNEQUNFLHVCQWxFRixDQXFFQSx3REFDRSx3QkFsRUYsQ0FzRUUsd0VBSUUsNEJBdEVKLENBa0VFLHdFQUlFLDRCQWxFSixDQThERSx3RUFJRSw0QkE5REosQ0EwREUsd0VBSUUsNEJBMURKLENBc0RF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ZW1cIl0gPiAqIHtcbiAgcGFkZGluZy1sZWZ0OiAwICFpbXBvcnRhbnQ7XG59XG5cbkBmb3IgJGxldmVsIGZyb20gMiB0aHJvdWdoIDYge1xuICBbZGlyPVwicnRsXCJdXG4gICAgLm5lZXRvLXNpZGViYXItZm9sZGVycy10cmVlXG4gICAgW3JvbGU9XCJ0cmVlaXRlbVwiXVthcmlhLWxldmVsPVwiI3skbGV2ZWx9XCJdXG4gICAgPiAqIHtcbiAgICBwYWRkaW5nLXJpZ2h0OiAjeygkbGV2ZWwgLSAxKSAqIDIwfXB4ICFpbXBvcnRhbnQ7XG4gIH1cbn1cblxuLy8gVGhlIGNvbGxhcHNlZCBzd2l0Y2hlciB0cmlhbmdsZSBwb2ludHMgdG93YXJkIHRoZSBleHBhbmRpbmcgY29udGVudCwgc29cbi8vIG1pcnJvciBpdCBpbiBSVEwgKHRoZSBleHBhbmRlZC9kb3duIHRyaWFuZ2xlIGlzIHN5bW1ldHJpYyBhbmQgbmVlZHMgbm90aGluZykuXG5bZGlyPVwicnRsXCJdIC5uZWV0by1zaWRlYmFyLWZvbGRlcnMtdHJlZV9fc3dpdGNoZXItY29sbGFwc2VkIHtcbiAgdHJhbnNmb3JtOiBzY2FsZVgoLTEpO1xufVxuXG4ubmVldG8tZm9sZGVycy1ncmlkLXZpZXctd3JhcHBlciB7XG4gIGdyaWQtdGVtcGxhdGUtY29sdW1uczogcmVwZWF0KGF1dG8tZmlsbCwgbWlubWF4KDI1NnB4LCAxZnIpKTtcbn1cbiJdfQ== */";
|
|
1929
2832
|
n(css,{});
|
|
1930
2833
|
|
|
1931
|
-
export { AddEditPane, DraggableWrapper, FoldersContext, FoldersDnd, FoldersList, FoldersTree, MoveToFolderPane, TreeSelect };
|
|
2834
|
+
export { AccessPill, AccessShareDialog, AddEditPane, DraggableWrapper, FoldersContext, FoldersDnd, FoldersList, FoldersTree, MoveToFolderPane, TreeSelect, capWho };
|
|
1932
2835
|
//# sourceMappingURL=components.js.map
|