@byline/admin 4.10.2 → 4.11.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/dist/fields/array/array-field.js +10 -10
- package/dist/fields/blocks/blocks-field.js +15 -15
- package/dist/fields/code/code-field.js +3 -3
- package/dist/fields/datetime/datetime-field.js +2 -2
- package/dist/fields/draggable-context-menu.js +9 -9
- package/dist/fields/field-renderer.js +3 -3
- package/dist/fields/file/file-field.js +21 -21
- package/dist/fields/file/file-upload-field.js +8 -8
- package/dist/fields/group/group-field.js +6 -6
- package/dist/fields/image/image-field.js +23 -23
- package/dist/fields/image/image-upload-field.js +11 -11
- package/dist/fields/locale-badge.js +2 -2
- package/dist/fields/relation/relation-display.js +2 -2
- package/dist/fields/relation/relation-field.js +7 -7
- package/dist/fields/relation/relation-many-field.js +12 -12
- package/dist/fields/relation/relation-picker.js +19 -19
- package/dist/fields/relation/relation-summary.js +9 -9
- package/dist/fields/select/select-field.js +3 -3
- package/dist/fields/sortable-item.js +9 -9
- package/dist/fields/text/text-field.js +2 -2
- package/dist/fields/text-area/text-area-field.js +2 -2
- package/dist/forms/available-locales-widget.js +4 -4
- package/dist/forms/document-actions.js +40 -40
- package/dist/forms/form-modals.js +12 -12
- package/dist/forms/form-renderer.js +17 -17
- package/dist/forms/form-status-display.js +15 -15
- package/dist/forms/path-widget.js +4 -4
- package/dist/forms/tree-placement-widget.js +10 -10
- package/dist/modules/admin-account/components/change-password.js +6 -6
- package/dist/modules/admin-account/components/container.js +28 -28
- package/dist/modules/admin-account/components/preferences.js +9 -9
- package/dist/modules/admin-account/components/theme-switch.js +4 -4
- package/dist/modules/admin-account/components/update.js +6 -6
- package/dist/modules/admin-permissions/components/inspector.js +31 -31
- package/dist/modules/admin-roles/components/create.js +6 -6
- package/dist/modules/admin-roles/components/permissions.js +25 -25
- package/dist/modules/admin-roles/components/update.js +6 -6
- package/dist/modules/admin-users/components/create.js +8 -8
- package/dist/modules/admin-users/components/roles.js +15 -15
- package/dist/modules/admin-users/components/set-password.js +6 -6
- package/dist/modules/admin-users/components/update.js +7 -7
- package/dist/modules/auth/components/sign-in-form.js +8 -8
- package/dist/presentation/group.js +3 -3
- package/dist/presentation/row.js +2 -2
- package/dist/presentation/tabs.js +5 -5
- package/dist/widgets/diff-viewer/diff-modal.js +10 -10
- package/dist/widgets/source-locale-badge/source-locale-badge.js +2 -2
- package/dist/widgets/status-badge/status-badge.js +4 -4
- package/package.json +6 -6
- package/src/fields/array/array-field.tsx +1 -1
- package/src/fields/blocks/blocks-field.tsx +1 -1
- package/src/fields/code/code-field.tsx +1 -1
- package/src/fields/datetime/datetime-field.tsx +1 -1
- package/src/fields/draggable-context-menu.tsx +1 -1
- package/src/fields/field-renderer.tsx +1 -1
- package/src/fields/file/file-field.tsx +1 -1
- package/src/fields/file/file-upload-field.tsx +1 -1
- package/src/fields/group/group-field.tsx +1 -1
- package/src/fields/image/image-field.tsx +1 -1
- package/src/fields/image/image-upload-field.tsx +1 -1
- package/src/fields/locale-badge.tsx +1 -1
- package/src/fields/relation/relation-display.tsx +1 -1
- package/src/fields/relation/relation-field.tsx +1 -1
- package/src/fields/relation/relation-many-field.tsx +1 -1
- package/src/fields/relation/relation-picker.tsx +1 -1
- package/src/fields/relation/relation-summary.tsx +1 -1
- package/src/fields/select/select-field.tsx +1 -1
- package/src/fields/sortable-item.tsx +1 -1
- package/src/fields/text/text-field.tsx +1 -1
- package/src/fields/text-area/text-area-field.tsx +1 -1
- package/src/forms/available-locales-widget.tsx +1 -1
- package/src/forms/document-actions.tsx +1 -1
- package/src/forms/form-modals.tsx +1 -1
- package/src/forms/form-renderer.tsx +1 -1
- package/src/forms/form-status-display.tsx +1 -1
- package/src/forms/path-widget.tsx +1 -1
- package/src/forms/tree-placement-widget.tsx +1 -1
- package/src/modules/admin-account/components/change-password.tsx +1 -1
- package/src/modules/admin-account/components/container.tsx +1 -1
- package/src/modules/admin-account/components/preferences.tsx +1 -1
- package/src/modules/admin-account/components/theme-switch.tsx +1 -1
- package/src/modules/admin-account/components/update.tsx +1 -1
- package/src/modules/admin-permissions/components/inspector.tsx +1 -1
- package/src/modules/admin-roles/components/create.tsx +1 -1
- package/src/modules/admin-roles/components/permissions.tsx +1 -1
- package/src/modules/admin-roles/components/update.tsx +1 -1
- package/src/modules/admin-users/components/create.tsx +1 -1
- package/src/modules/admin-users/components/roles.tsx +1 -1
- package/src/modules/admin-users/components/set-password.tsx +1 -1
- package/src/modules/admin-users/components/update.tsx +1 -1
- package/src/modules/auth/components/sign-in-form.tsx +1 -1
- package/src/presentation/group.tsx +1 -1
- package/src/presentation/row.tsx +1 -1
- package/src/presentation/tabs.tsx +1 -1
- package/src/widgets/diff-viewer/diff-modal.tsx +1 -1
- package/src/widgets/source-locale-badge/source-locale-badge.tsx +1 -1
- package/src/widgets/status-badge/status-badge.tsx +1 -1
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { useTranslation } from "@byline/i18n/react";
|
|
4
4
|
import { DraggableSortable, IconButton, PlusIcon, moveItem } from "@byline/ui/react";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
6
|
import { sliceFieldAdmin } from "../field-admin.js";
|
|
7
7
|
import { defaultScalarForField } from "../field-helpers.js";
|
|
8
8
|
import { FieldRenderer } from "../field-renderer.js";
|
|
@@ -112,10 +112,10 @@ const ArrayField = ({ field, defaultValue, path, disableSorting = false, content
|
|
|
112
112
|
const groupData = initial && 'object' == typeof initial ? initial : {};
|
|
113
113
|
const groupAdmin = sliceFieldAdmin(fieldAdmin, childField.name);
|
|
114
114
|
return /*#__PURE__*/ jsxs("div", {
|
|
115
|
-
className:
|
|
115
|
+
className: clsx('byline-field-array-group-fields', array_field_module["group-fields"]),
|
|
116
116
|
children: [
|
|
117
117
|
childField.label && /*#__PURE__*/ jsx("h4", {
|
|
118
|
-
className:
|
|
118
|
+
className: clsx('byline-field-array-group-header', array_field_module["group-header"]),
|
|
119
119
|
children: childField.label
|
|
120
120
|
}),
|
|
121
121
|
childField.fields.map((innerField)=>/*#__PURE__*/ jsx(FieldRenderer, {
|
|
@@ -148,7 +148,7 @@ const ArrayField = ({ field, defaultValue, path, disableSorting = false, content
|
|
|
148
148
|
onAddBelow: ()=>handleInsertBelow(index),
|
|
149
149
|
onRemove: ()=>handleRemoveItem(index),
|
|
150
150
|
children: /*#__PURE__*/ jsx("div", {
|
|
151
|
-
className:
|
|
151
|
+
className: clsx('byline-field-array-group-fields', array_field_module["group-fields"]),
|
|
152
152
|
children: innerBody
|
|
153
153
|
})
|
|
154
154
|
}, itemWrapper.id);
|
|
@@ -158,13 +158,13 @@ const ArrayField = ({ field, defaultValue, path, disableSorting = false, content
|
|
|
158
158
|
onAddBelow: ()=>handleInsertBelow(index),
|
|
159
159
|
onRemove: ()=>handleRemoveItem(index),
|
|
160
160
|
children: /*#__PURE__*/ jsx("div", {
|
|
161
|
-
className:
|
|
161
|
+
className: clsx('byline-field-array-group-fields', array_field_module["group-fields"]),
|
|
162
162
|
children: innerBody
|
|
163
163
|
})
|
|
164
164
|
}, itemWrapper.id);
|
|
165
165
|
};
|
|
166
166
|
const addRow = /*#__PURE__*/ jsxs("div", {
|
|
167
|
-
className:
|
|
167
|
+
className: clsx('byline-field-array-add-row', array_field_module["add-row"]),
|
|
168
168
|
children: [
|
|
169
169
|
/*#__PURE__*/ jsx(IconButton, {
|
|
170
170
|
onClick: ()=>{
|
|
@@ -179,7 +179,7 @@ const ArrayField = ({ field, defaultValue, path, disableSorting = false, content
|
|
|
179
179
|
onClick: ()=>{
|
|
180
180
|
handleAddItem();
|
|
181
181
|
},
|
|
182
|
-
className:
|
|
182
|
+
className: clsx('byline-field-array-add-label', array_field_module["add-label"]),
|
|
183
183
|
children: t('fields.array.addItem')
|
|
184
184
|
})
|
|
185
185
|
]
|
|
@@ -188,11 +188,11 @@ const ArrayField = ({ field, defaultValue, path, disableSorting = false, content
|
|
|
188
188
|
className: `byline-field-array ${field.name}`,
|
|
189
189
|
children: [
|
|
190
190
|
field.label && /*#__PURE__*/ jsx("h3", {
|
|
191
|
-
className:
|
|
191
|
+
className: clsx('byline-field-array-title', array_field_module.title),
|
|
192
192
|
children: field.label
|
|
193
193
|
}),
|
|
194
194
|
disableSorting ? /*#__PURE__*/ jsxs("div", {
|
|
195
|
-
className:
|
|
195
|
+
className: clsx('byline-field-array-stack', array_field_module.stack),
|
|
196
196
|
children: [
|
|
197
197
|
items.map((item, index)=>renderItem(item, index)),
|
|
198
198
|
addRow
|
|
@@ -200,7 +200,7 @@ const ArrayField = ({ field, defaultValue, path, disableSorting = false, content
|
|
|
200
200
|
}) : /*#__PURE__*/ jsxs(DraggableSortable, {
|
|
201
201
|
ids: items.map((i)=>i.id),
|
|
202
202
|
onDragEnd: handleDragEnd,
|
|
203
|
-
className:
|
|
203
|
+
className: clsx('byline-field-array-stack', array_field_module.stack),
|
|
204
204
|
children: [
|
|
205
205
|
items.map((item, index)=>renderItem(item, index)),
|
|
206
206
|
addRow
|
|
@@ -3,7 +3,7 @@ import { useEffect, useMemo, useState } from "react";
|
|
|
3
3
|
import { getClientConfig } from "@byline/core";
|
|
4
4
|
import { useTranslation } from "@byline/i18n/react";
|
|
5
5
|
import { Card, CloseIcon, DraggableSortable, IconButton, Modal, PlusIcon, moveItem } from "@byline/ui/react";
|
|
6
|
-
import
|
|
6
|
+
import clsx from "clsx";
|
|
7
7
|
import { defaultScalarForField } from "../field-helpers.js";
|
|
8
8
|
import { GroupField } from "../group/group-field.js";
|
|
9
9
|
import { SortableItem } from "../sortable-item.js";
|
|
@@ -154,17 +154,17 @@ const BlocksField = ({ field, defaultValue, path, contentLocale })=>{
|
|
|
154
154
|
className: `byline-field-blocks ${field.name}`,
|
|
155
155
|
children: [
|
|
156
156
|
field.label && /*#__PURE__*/ jsx("h3", {
|
|
157
|
-
className:
|
|
157
|
+
className: clsx('byline-field-blocks-title', blocks_field_module.title),
|
|
158
158
|
children: field.label
|
|
159
159
|
}),
|
|
160
160
|
/*#__PURE__*/ jsxs(DraggableSortable, {
|
|
161
161
|
ids: items.map((i)=>i.id),
|
|
162
162
|
onDragEnd: handleDragEnd,
|
|
163
|
-
className:
|
|
163
|
+
className: clsx('byline-field-blocks-stack', blocks_field_module.stack),
|
|
164
164
|
children: [
|
|
165
165
|
items.map((item, index)=>renderItem(item, index)),
|
|
166
166
|
/*#__PURE__*/ jsxs("div", {
|
|
167
|
-
className:
|
|
167
|
+
className: clsx('byline-field-blocks-add-row', blocks_field_module["add-row"]),
|
|
168
168
|
children: [
|
|
169
169
|
/*#__PURE__*/ jsx(IconButton, {
|
|
170
170
|
onClick: ()=>{
|
|
@@ -184,7 +184,7 @@ const BlocksField = ({ field, defaultValue, path, contentLocale })=>{
|
|
|
184
184
|
setPendingInsertIndex(null);
|
|
185
185
|
setShowAddBlockModal(true);
|
|
186
186
|
},
|
|
187
|
-
className:
|
|
187
|
+
className: clsx('byline-field-blocks-add-label', blocks_field_module["add-label"]),
|
|
188
188
|
children: t('fields.blocks.addBlock')
|
|
189
189
|
})
|
|
190
190
|
]
|
|
@@ -204,10 +204,10 @@ const BlocksField = ({ field, defaultValue, path, contentLocale })=>{
|
|
|
204
204
|
},
|
|
205
205
|
children: [
|
|
206
206
|
/*#__PURE__*/ jsxs(Modal.Header, {
|
|
207
|
-
className:
|
|
207
|
+
className: clsx('byline-field-blocks-modal-head', blocks_field_module["modal-head"]),
|
|
208
208
|
children: [
|
|
209
209
|
/*#__PURE__*/ jsx("h3", {
|
|
210
|
-
className:
|
|
210
|
+
className: clsx('byline-field-blocks-modal-title', blocks_field_module["modal-title"]),
|
|
211
211
|
children: t('fields.blocks.modalTitle')
|
|
212
212
|
}),
|
|
213
213
|
/*#__PURE__*/ jsx(IconButton, {
|
|
@@ -226,38 +226,38 @@ const BlocksField = ({ field, defaultValue, path, contentLocale })=>{
|
|
|
226
226
|
]
|
|
227
227
|
}),
|
|
228
228
|
/*#__PURE__*/ jsx(Modal.Content, {
|
|
229
|
-
className:
|
|
229
|
+
className: clsx('byline-field-blocks-card-cursor', blocks_field_module["modal-content"]),
|
|
230
230
|
children: /*#__PURE__*/ jsx("div", {
|
|
231
|
-
className:
|
|
231
|
+
className: clsx('byline-field-blocks-grid', blocks_field_module.grid),
|
|
232
232
|
children: availableBlocks.map((b, index)=>/*#__PURE__*/ jsxs(Card, {
|
|
233
233
|
hover: true,
|
|
234
234
|
onClick: ()=>void handleAddItem(b.blockType, pendingInsertIndex ?? void 0),
|
|
235
|
-
className:
|
|
235
|
+
className: clsx('byline-field-blocks-card', blocks_field_module.card),
|
|
236
236
|
children: [
|
|
237
237
|
/*#__PURE__*/ jsxs(Card.Header, {
|
|
238
238
|
children: [
|
|
239
239
|
/*#__PURE__*/ jsxs("div", {
|
|
240
|
-
className:
|
|
240
|
+
className: clsx('byline-field-blocks-card-head', blocks_field_module["card-head"]),
|
|
241
241
|
children: [
|
|
242
242
|
/*#__PURE__*/ jsx(Card.Title, {
|
|
243
|
-
className:
|
|
243
|
+
className: clsx('byline-field-blocks-card-title', blocks_field_module["card-title"]),
|
|
244
244
|
children: b.label ?? b.blockType
|
|
245
245
|
}),
|
|
246
246
|
/*#__PURE__*/ jsx("span", {
|
|
247
|
-
className:
|
|
247
|
+
className: clsx('byline-field-blocks-card-index', blocks_field_module["card-index"]),
|
|
248
248
|
children: index + 1
|
|
249
249
|
})
|
|
250
250
|
]
|
|
251
251
|
}),
|
|
252
252
|
/*#__PURE__*/ jsx("code", {
|
|
253
|
-
className:
|
|
253
|
+
className: clsx('byline-field-blocks-card-code', blocks_field_module["card-code"]),
|
|
254
254
|
children: b.blockType
|
|
255
255
|
})
|
|
256
256
|
]
|
|
257
257
|
}),
|
|
258
258
|
/*#__PURE__*/ jsx(Card.Content, {
|
|
259
259
|
children: /*#__PURE__*/ jsx("p", {
|
|
260
|
-
className:
|
|
260
|
+
className: clsx('byline-field-blocks-card-body', blocks_field_module["card-body"]),
|
|
261
261
|
children: b.helpText ?? b.label ?? b.blockType
|
|
262
262
|
})
|
|
263
263
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import react, { Suspense, useCallback } from "react";
|
|
3
3
|
import { ErrorText, HelpText, Label } from "@byline/ui/react";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
5
|
import { useFieldError, useFieldValue } from "../../forms/form-context.js";
|
|
6
6
|
import { LocaleBadge } from "../locale-badge.js";
|
|
7
7
|
import code_field_module from "./code-field.module.js";
|
|
@@ -39,7 +39,7 @@ const CodeField = ({ field, value, defaultValue, onChange, id, path, locale, com
|
|
|
39
39
|
};
|
|
40
40
|
const showBadge = !!locale && !!field.label;
|
|
41
41
|
const hasCustomLabel = !!CustomLabel;
|
|
42
|
-
const labelRowClass =
|
|
42
|
+
const labelRowClass = clsx('byline-field-code-label-row', code_field_module["label-row"]);
|
|
43
43
|
const renderLabel = ()=>{
|
|
44
44
|
if (hasCustomLabel) return /*#__PURE__*/ jsxs("div", {
|
|
45
45
|
className: labelRowClass,
|
|
@@ -79,7 +79,7 @@ const CodeField = ({ field, value, defaultValue, onChange, id, path, locale, com
|
|
|
79
79
|
});
|
|
80
80
|
return /*#__PURE__*/ jsx(Suspense, {
|
|
81
81
|
fallback: /*#__PURE__*/ jsx("textarea", {
|
|
82
|
-
className:
|
|
82
|
+
className: clsx('byline-field-code-loading', code_field_module.loading),
|
|
83
83
|
readOnly: true,
|
|
84
84
|
value: incomingValue,
|
|
85
85
|
rows: 6,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { DatePicker, ErrorText } from "@byline/ui/react";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { useFieldError, useFieldValue, useIsDirty } from "../../forms/form-context.js";
|
|
5
5
|
import datetime_field_module from "./datetime-field.module.js";
|
|
6
6
|
const DateTimeField = ({ field, value, defaultValue, onChange, id, path })=>{
|
|
@@ -22,7 +22,7 @@ const DateTimeField = ({ field, value, defaultValue, onChange, id, path })=>{
|
|
|
22
22
|
yearsInFuture: field.yearsInFuture || 1,
|
|
23
23
|
yearsInPast: field.yearsInPast || 10,
|
|
24
24
|
onDateChange: (date)=>onChange?.(date),
|
|
25
|
-
className:
|
|
25
|
+
className: clsx(isDirty && [
|
|
26
26
|
'byline-field-datetime-dirty',
|
|
27
27
|
datetime_field_module.dirty
|
|
28
28
|
])
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useTranslation } from "@byline/i18n/react";
|
|
4
4
|
import { DeleteIcon, Dropdown, EllipsisIcon, IconButton, PlusIcon } from "@byline/ui/react";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
6
|
import draggable_context_menu_module from "./draggable-context-menu.module.js";
|
|
7
7
|
function DraggableContextMenu({ onAddBelow, onRemove }) {
|
|
8
8
|
const { t } = useTranslation('byline-admin');
|
|
9
|
-
const itemClass =
|
|
10
|
-
const rowClass =
|
|
11
|
-
const iconSlotClass =
|
|
12
|
-
const labelClass =
|
|
9
|
+
const itemClass = clsx('byline-draggable-menu-item', draggable_context_menu_module.item);
|
|
10
|
+
const rowClass = clsx('byline-draggable-menu-row', draggable_context_menu_module.row);
|
|
11
|
+
const iconSlotClass = clsx('byline-draggable-menu-icon-slot', draggable_context_menu_module["icon-slot"]);
|
|
12
|
+
const labelClass = clsx('byline-draggable-menu-label', draggable_context_menu_module.label);
|
|
13
13
|
return /*#__PURE__*/ jsxs(Dropdown.Root, {
|
|
14
14
|
modal: false,
|
|
15
15
|
children: [
|
|
@@ -28,7 +28,7 @@ function DraggableContextMenu({ onAddBelow, onRemove }) {
|
|
|
28
28
|
children: /*#__PURE__*/ jsxs(Dropdown.Content, {
|
|
29
29
|
align: "end",
|
|
30
30
|
sideOffset: 0,
|
|
31
|
-
className:
|
|
31
|
+
className: clsx('byline-draggable-menu', draggable_context_menu_module.menu),
|
|
32
32
|
children: [
|
|
33
33
|
/*#__PURE__*/ jsx(Dropdown.Item, {
|
|
34
34
|
className: itemClass,
|
|
@@ -51,7 +51,7 @@ function DraggableContextMenu({ onAddBelow, onRemove }) {
|
|
|
51
51
|
})
|
|
52
52
|
}),
|
|
53
53
|
/*#__PURE__*/ jsx(Dropdown.Separator, {
|
|
54
|
-
className:
|
|
54
|
+
className: clsx('byline-draggable-menu-separator', draggable_context_menu_module.separator)
|
|
55
55
|
}),
|
|
56
56
|
/*#__PURE__*/ jsx(Dropdown.Item, {
|
|
57
57
|
className: itemClass,
|
|
@@ -66,11 +66,11 @@ function DraggableContextMenu({ onAddBelow, onRemove }) {
|
|
|
66
66
|
children: /*#__PURE__*/ jsx(DeleteIcon, {
|
|
67
67
|
width: "18px",
|
|
68
68
|
height: "18px",
|
|
69
|
-
svgClassName:
|
|
69
|
+
svgClassName: clsx('byline-draggable-menu-delete-icon', draggable_context_menu_module["delete-icon"])
|
|
70
70
|
})
|
|
71
71
|
}),
|
|
72
72
|
/*#__PURE__*/ jsx("span", {
|
|
73
|
-
className:
|
|
73
|
+
className: clsx('byline-draggable-menu-label byline-draggable-menu-label-danger', draggable_context_menu_module.label, draggable_context_menu_module["label-danger"]),
|
|
74
74
|
children: t('fields.draggableMenu.remove')
|
|
75
75
|
})
|
|
76
76
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getClientConfig } from "@byline/core";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
4
|
import { useFormContext } from "../forms/form-context.js";
|
|
5
5
|
import { ArrayField } from "./array/array-field.js";
|
|
6
6
|
import { BlocksField } from "./blocks/blocks-field.js";
|
|
@@ -229,11 +229,11 @@ const FieldRenderer = ({ field, defaultValue: initialDefault, basePath, disableS
|
|
|
229
229
|
};
|
|
230
230
|
const selfBadge = 'text' === field.type || 'textArea' === field.type || 'code' === field.type || 'richText' === field.type;
|
|
231
231
|
if (badge && !selfBadge) return /*#__PURE__*/ jsxs("div", {
|
|
232
|
-
className:
|
|
232
|
+
className: clsx('byline-field-localized-wrap', field_renderer_module["localized-wrap"]),
|
|
233
233
|
children: [
|
|
234
234
|
renderField(),
|
|
235
235
|
/*#__PURE__*/ jsx("span", {
|
|
236
|
-
className:
|
|
236
|
+
className: clsx('byline-field-localized-badge', field_renderer_module["localized-badge"]),
|
|
237
237
|
children: badge
|
|
238
238
|
})
|
|
239
239
|
]
|
|
@@ -2,7 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { isPendingStoredFileValue } from "@byline/core";
|
|
3
3
|
import { useTranslation } from "@byline/i18n/react";
|
|
4
4
|
import { CloseIcon, DocumentIcon, DownloadIcon, ErrorText, HelpText, IconButton, Label, LoaderRing, VideoIcon } from "@byline/ui/react";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
6
|
import { useFieldError, useFieldValue, useFormContext, useIsDirty, useIsFieldUploading } from "../../forms/form-context.js";
|
|
7
7
|
import { useFieldChangeHandler } from "../use-field-change-handler.js";
|
|
8
8
|
import file_field_module from "./file-field.module.js";
|
|
@@ -47,7 +47,7 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
47
47
|
className: `byline-field-file ${field.name}`,
|
|
48
48
|
children: [
|
|
49
49
|
/*#__PURE__*/ jsx("div", {
|
|
50
|
-
className:
|
|
50
|
+
className: clsx('byline-field-file-header', file_field_module.header),
|
|
51
51
|
children: /*#__PURE__*/ jsx(Label, {
|
|
52
52
|
id: htmlId,
|
|
53
53
|
htmlFor: htmlId,
|
|
@@ -56,7 +56,7 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
56
56
|
})
|
|
57
57
|
}),
|
|
58
58
|
showUploadWidget ? uploadGated ? /*#__PURE__*/ jsx("div", {
|
|
59
|
-
className:
|
|
59
|
+
className: clsx('byline-field-file-empty', file_field_module.empty),
|
|
60
60
|
role: "note",
|
|
61
61
|
"data-testid": "upload-require-saved-document",
|
|
62
62
|
children: t('fields.upload.requireSavedDocument')
|
|
@@ -68,19 +68,19 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
68
68
|
handleChange(uploaded);
|
|
69
69
|
}
|
|
70
70
|
}) : /*#__PURE__*/ jsx("div", {
|
|
71
|
-
className:
|
|
71
|
+
className: clsx('byline-field-file-empty', file_field_module.empty),
|
|
72
72
|
children: t('fields.file.empty')
|
|
73
73
|
}) : /*#__PURE__*/ jsxs("div", {
|
|
74
|
-
className:
|
|
74
|
+
className: clsx('byline-field-file-tile', file_field_module.tile),
|
|
75
75
|
children: [
|
|
76
76
|
isUploading && /*#__PURE__*/ jsx("div", {
|
|
77
|
-
className:
|
|
77
|
+
className: clsx('byline-field-file-uploading', file_field_module.uploading),
|
|
78
78
|
"aria-live": "polite",
|
|
79
79
|
"aria-busy": "true",
|
|
80
80
|
children: /*#__PURE__*/ jsx(LoaderRing, {})
|
|
81
81
|
}),
|
|
82
82
|
collectionPath && /*#__PURE__*/ jsxs("div", {
|
|
83
|
-
className:
|
|
83
|
+
className: clsx('byline-field-file-actions', file_field_module.actions),
|
|
84
84
|
children: [
|
|
85
85
|
!isPending && incomingValue?.storageUrl && /*#__PURE__*/ jsx(IconButton, {
|
|
86
86
|
type: "button",
|
|
@@ -115,33 +115,33 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
115
115
|
"aria-label": t('fields.file.openInNewTabAriaLabel', {
|
|
116
116
|
filename: incomingValue.originalFilename ?? incomingValue.filename
|
|
117
117
|
}),
|
|
118
|
-
className:
|
|
118
|
+
className: clsx('byline-field-file-icon-wrap', file_field_module["icon-wrap"]),
|
|
119
119
|
children: /*#__PURE__*/ jsx(FileGlyph, {
|
|
120
120
|
width: "48px",
|
|
121
121
|
height: "48px",
|
|
122
|
-
className:
|
|
122
|
+
className: clsx('byline-field-file-icon', file_field_module.icon)
|
|
123
123
|
})
|
|
124
124
|
}) : /*#__PURE__*/ jsxs("div", {
|
|
125
|
-
className:
|
|
125
|
+
className: clsx('byline-field-file-icon-wrap', file_field_module["icon-wrap"]),
|
|
126
126
|
children: [
|
|
127
127
|
/*#__PURE__*/ jsx(FileGlyph, {
|
|
128
128
|
width: "48px",
|
|
129
129
|
height: "48px",
|
|
130
|
-
className:
|
|
130
|
+
className: clsx('byline-field-file-icon', file_field_module.icon)
|
|
131
131
|
}),
|
|
132
132
|
isPending && /*#__PURE__*/ jsx("div", {
|
|
133
|
-
className:
|
|
133
|
+
className: clsx('byline-field-file-pending', file_field_module.pending),
|
|
134
134
|
children: t('fields.fileMeta.pendingUpload')
|
|
135
135
|
})
|
|
136
136
|
]
|
|
137
137
|
}),
|
|
138
138
|
/*#__PURE__*/ jsxs("div", {
|
|
139
|
-
className:
|
|
139
|
+
className: clsx('byline-field-file-meta', file_field_module.meta),
|
|
140
140
|
children: [
|
|
141
141
|
/*#__PURE__*/ jsxs("div", {
|
|
142
142
|
children: [
|
|
143
143
|
/*#__PURE__*/ jsx("span", {
|
|
144
|
-
className:
|
|
144
|
+
className: clsx('byline-field-file-meta-key', file_field_module["meta-key"]),
|
|
145
145
|
children: t('fields.fileMeta.filename')
|
|
146
146
|
}),
|
|
147
147
|
' ',
|
|
@@ -151,7 +151,7 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
151
151
|
/*#__PURE__*/ jsxs("div", {
|
|
152
152
|
children: [
|
|
153
153
|
/*#__PURE__*/ jsx("span", {
|
|
154
|
-
className:
|
|
154
|
+
className: clsx('byline-field-file-meta-key', file_field_module["meta-key"]),
|
|
155
155
|
children: t('fields.fileMeta.original')
|
|
156
156
|
}),
|
|
157
157
|
' ',
|
|
@@ -161,7 +161,7 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
161
161
|
/*#__PURE__*/ jsxs("div", {
|
|
162
162
|
children: [
|
|
163
163
|
/*#__PURE__*/ jsx("span", {
|
|
164
|
-
className:
|
|
164
|
+
className: clsx('byline-field-file-meta-key', file_field_module["meta-key"]),
|
|
165
165
|
children: t('fields.fileMeta.type')
|
|
166
166
|
}),
|
|
167
167
|
' ',
|
|
@@ -171,7 +171,7 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
171
171
|
/*#__PURE__*/ jsxs("div", {
|
|
172
172
|
children: [
|
|
173
173
|
/*#__PURE__*/ jsx("span", {
|
|
174
|
-
className:
|
|
174
|
+
className: clsx('byline-field-file-meta-key', file_field_module["meta-key"]),
|
|
175
175
|
children: t('fields.fileMeta.size')
|
|
176
176
|
}),
|
|
177
177
|
' ',
|
|
@@ -181,12 +181,12 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
181
181
|
isPending ? /*#__PURE__*/ jsxs("div", {
|
|
182
182
|
children: [
|
|
183
183
|
/*#__PURE__*/ jsx("span", {
|
|
184
|
-
className:
|
|
184
|
+
className: clsx('byline-field-file-meta-key', file_field_module["meta-key"]),
|
|
185
185
|
children: t('fields.fileMeta.status')
|
|
186
186
|
}),
|
|
187
187
|
' ',
|
|
188
188
|
/*#__PURE__*/ jsx("span", {
|
|
189
|
-
className:
|
|
189
|
+
className: clsx('byline-field-file-meta-pending', file_field_module["meta-pending"]),
|
|
190
190
|
children: t('fields.fileMeta.willUploadOnSave')
|
|
191
191
|
})
|
|
192
192
|
]
|
|
@@ -195,7 +195,7 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
195
195
|
/*#__PURE__*/ jsxs("div", {
|
|
196
196
|
children: [
|
|
197
197
|
/*#__PURE__*/ jsx("span", {
|
|
198
|
-
className:
|
|
198
|
+
className: clsx('byline-field-file-meta-key', file_field_module["meta-key"]),
|
|
199
199
|
children: t('fields.fileMeta.storage')
|
|
200
200
|
}),
|
|
201
201
|
' ',
|
|
@@ -205,7 +205,7 @@ const FileField = ({ field, value, defaultValue, onChange: _onChange, path })=>{
|
|
|
205
205
|
/*#__PURE__*/ jsxs("div", {
|
|
206
206
|
children: [
|
|
207
207
|
/*#__PURE__*/ jsx("span", {
|
|
208
|
-
className:
|
|
208
|
+
className: clsx('byline-field-file-meta-key', file_field_module["meta-key"]),
|
|
209
209
|
children: t('fields.fileMeta.path')
|
|
210
210
|
}),
|
|
211
211
|
' ',
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useRef, useState } from "react";
|
|
3
3
|
import { createPendingStoredFileValue } from "@byline/core";
|
|
4
4
|
import { useTranslation } from "@byline/i18n/react";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
6
|
import { useFormContext } from "../../forms/form-context.js";
|
|
7
7
|
import file_upload_field_module from "./file-upload-field.module.js";
|
|
8
8
|
const FileUploadField = ({ field: _field, collectionPath, fieldPath, onUploaded, accept })=>{
|
|
@@ -58,13 +58,13 @@ const FileUploadField = ({ field: _field, collectionPath, fieldPath, onUploaded,
|
|
|
58
58
|
]);
|
|
59
59
|
const isProcessing = 'processing' === status;
|
|
60
60
|
return /*#__PURE__*/ jsxs("div", {
|
|
61
|
-
className:
|
|
61
|
+
className: clsx('byline-field-file-upload', file_upload_field_module.root),
|
|
62
62
|
children: [
|
|
63
63
|
/*#__PURE__*/ jsx("input", {
|
|
64
64
|
ref: inputRef,
|
|
65
65
|
type: "file",
|
|
66
66
|
accept: accept,
|
|
67
|
-
className:
|
|
67
|
+
className: clsx('byline-field-file-upload-input', file_upload_field_module.input),
|
|
68
68
|
onChange: handleFileChange,
|
|
69
69
|
disabled: isProcessing,
|
|
70
70
|
"aria-hidden": "true",
|
|
@@ -84,7 +84,7 @@ const FileUploadField = ({ field: _field, collectionPath, fieldPath, onUploaded,
|
|
|
84
84
|
handleBrowseClick();
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
|
-
className:
|
|
87
|
+
className: clsx('byline-field-file-upload-zone', file_upload_field_module.zone, isDragOver && !isProcessing && [
|
|
88
88
|
'byline-field-file-upload-zone-active',
|
|
89
89
|
file_upload_field_module["zone-active"]
|
|
90
90
|
], isProcessing && [
|
|
@@ -94,7 +94,7 @@ const FileUploadField = ({ field: _field, collectionPath, fieldPath, onUploaded,
|
|
|
94
94
|
children: [
|
|
95
95
|
/*#__PURE__*/ jsx("svg", {
|
|
96
96
|
xmlns: "http://www.w3.org/2000/svg",
|
|
97
|
-
className:
|
|
97
|
+
className: clsx('byline-field-file-upload-icon', file_upload_field_module.icon),
|
|
98
98
|
fill: "none",
|
|
99
99
|
viewBox: "0 0 24 24",
|
|
100
100
|
stroke: "currentColor",
|
|
@@ -107,12 +107,12 @@ const FileUploadField = ({ field: _field, collectionPath, fieldPath, onUploaded,
|
|
|
107
107
|
})
|
|
108
108
|
}),
|
|
109
109
|
/*#__PURE__*/ jsxs("span", {
|
|
110
|
-
className:
|
|
110
|
+
className: clsx('byline-field-file-upload-label', file_upload_field_module.label),
|
|
111
111
|
children: [
|
|
112
112
|
t('fields.file.upload.label'),
|
|
113
113
|
' ',
|
|
114
114
|
/*#__PURE__*/ jsx("span", {
|
|
115
|
-
className:
|
|
115
|
+
className: clsx('byline-field-file-upload-action', file_upload_field_module.action),
|
|
116
116
|
children: t('fields.file.upload.browse')
|
|
117
117
|
})
|
|
118
118
|
]
|
|
@@ -120,7 +120,7 @@ const FileUploadField = ({ field: _field, collectionPath, fieldPath, onUploaded,
|
|
|
120
120
|
]
|
|
121
121
|
}),
|
|
122
122
|
'error' === status && errorMessage && /*#__PURE__*/ jsx("p", {
|
|
123
|
-
className:
|
|
123
|
+
className: clsx('byline-field-file-upload-error', file_upload_field_module.error),
|
|
124
124
|
role: "alert",
|
|
125
125
|
children: errorMessage
|
|
126
126
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { ErrorText } from "@byline/ui/react";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
5
|
import { sliceFieldAdmin } from "../field-admin.js";
|
|
6
6
|
import { placeholderForField } from "../field-helpers.js";
|
|
7
7
|
import { FieldRenderer } from "../field-renderer.js";
|
|
@@ -22,27 +22,27 @@ const GroupField = ({ field, defaultValue, path, disableSorting = true, contentL
|
|
|
22
22
|
className: `byline-field-group ${field.name}`,
|
|
23
23
|
children: [
|
|
24
24
|
field.label && /*#__PURE__*/ jsxs("div", {
|
|
25
|
-
className:
|
|
25
|
+
className: clsx('byline-field-group-header', group_field_module.header),
|
|
26
26
|
children: [
|
|
27
27
|
/*#__PURE__*/ jsxs("h3", {
|
|
28
|
-
className:
|
|
28
|
+
className: clsx('byline-field-group-title', group_field_module.title),
|
|
29
29
|
children: [
|
|
30
30
|
field.label,
|
|
31
31
|
' ',
|
|
32
32
|
!field.optional && /*#__PURE__*/ jsx("span", {
|
|
33
|
-
className:
|
|
33
|
+
className: clsx('byline-field-group-required', group_field_module.required),
|
|
34
34
|
children: "*"
|
|
35
35
|
})
|
|
36
36
|
]
|
|
37
37
|
}),
|
|
38
38
|
field.helpText && /*#__PURE__*/ jsx("p", {
|
|
39
|
-
className:
|
|
39
|
+
className: clsx('byline-field-group-help', group_field_module.help),
|
|
40
40
|
children: field.helpText
|
|
41
41
|
})
|
|
42
42
|
]
|
|
43
43
|
}),
|
|
44
44
|
/*#__PURE__*/ jsx("div", {
|
|
45
|
-
className:
|
|
45
|
+
className: clsx('byline-field-group-body', group_field_module.body),
|
|
46
46
|
children: field.fields.map((innerField)=>/*#__PURE__*/ jsx(FieldRenderer, {
|
|
47
47
|
field: innerField,
|
|
48
48
|
defaultValue: groupData[innerField.name],
|