@byline/admin 6.0.2 → 6.1.0
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/exports-parity.test.node.js +37 -0
- package/dist/fields/array/array-field.jsx +209 -0
- package/dist/fields/blocks/blocks-field.jsx +248 -0
- package/dist/fields/checkbox/checkbox-field.jsx +24 -0
- package/dist/fields/code/code-editor.jsx +211 -0
- package/dist/fields/code/code-field.jsx +109 -0
- package/dist/fields/column-formatter.jsx +25 -0
- package/dist/fields/date-time-formatter.jsx +18 -0
- package/dist/fields/datetime/datetime-field.jsx +22 -0
- package/dist/fields/draggable-context-menu.jsx +50 -0
- package/dist/fields/field-admin.test.node.js +40 -0
- package/dist/fields/field-renderer.jsx +136 -0
- package/dist/fields/field-services-context.jsx +17 -0
- package/dist/fields/file/file-field.jsx +176 -0
- package/dist/fields/file/file-upload-field.jsx +89 -0
- package/dist/fields/group/group-field.jsx +46 -0
- package/dist/fields/image/image-field.jsx +183 -0
- package/dist/fields/image/image-upload-field.jsx +157 -0
- package/dist/fields/local-date-time.jsx +69 -0
- package/dist/fields/locale-badge.jsx +19 -0
- package/dist/fields/numerical/numerical-field.jsx +93 -0
- package/dist/fields/relation/relation-column-formatter.jsx +74 -0
- package/dist/fields/relation/relation-display.jsx +118 -0
- package/dist/fields/relation/relation-field.jsx +108 -0
- package/dist/fields/relation/relation-many-field.jsx +142 -0
- package/dist/fields/relation/relation-picker.jsx +240 -0
- package/dist/fields/relation/relation-summary.jsx +45 -0
- package/dist/fields/select/select-field.jsx +27 -0
- package/dist/fields/sortable-item.jsx +54 -0
- package/dist/fields/text/text-field.jsx +79 -0
- package/dist/fields/text-area/text-area-field.jsx +79 -0
- package/dist/forms/available-locales-reconcile.test.node.js +43 -0
- package/dist/forms/available-locales-widget.jsx +63 -0
- package/dist/forms/document-actions.jsx +486 -0
- package/dist/forms/form-context.jsx +598 -0
- package/dist/forms/form-modals.jsx +128 -0
- package/dist/forms/form-renderer.d.ts +8 -2
- package/dist/forms/form-renderer.js +3 -2
- package/dist/forms/form-renderer.jsx +532 -0
- package/dist/forms/form-status-display.jsx +69 -0
- package/dist/forms/navigation-guard.jsx +68 -0
- package/dist/forms/nested-path.test.node.js +115 -0
- package/dist/forms/path-widget.d.ts +9 -1
- package/dist/forms/path-widget.js +8 -5
- package/dist/forms/path-widget.jsx +125 -0
- package/dist/forms/pending-uploads.test.node.js +19 -0
- package/dist/forms/repeating-items.test.node.js +29 -0
- package/dist/forms/scheduled-publication-control.jsx +389 -0
- package/dist/forms/scheduled-publication-state.test.node.js +121 -0
- package/dist/forms/scheduled-publication-time.test.node.js +70 -0
- package/dist/forms/status-transitions.test.node.js +76 -0
- package/dist/forms/tree-placement-widget.jsx +160 -0
- package/dist/forms/upload-executor.test.node.js +368 -0
- package/dist/forms/use-form-layout.test.node.js +69 -0
- package/dist/modules/admin-account/components/change-password.jsx +169 -0
- package/dist/modules/admin-account/components/container.jsx +164 -0
- package/dist/modules/admin-account/components/preferences.jsx +148 -0
- package/dist/modules/admin-account/components/theme-switch.jsx +52 -0
- package/dist/modules/admin-account/components/update.jsx +186 -0
- package/dist/modules/admin-permissions/components/inspector.jsx +200 -0
- package/dist/modules/admin-preferences/schemas.test.node.js +48 -0
- package/dist/modules/admin-roles/components/create.jsx +155 -0
- package/dist/modules/admin-roles/components/permissions.jsx +239 -0
- package/dist/modules/admin-roles/components/update.jsx +148 -0
- package/dist/modules/admin-users/components/create.jsx +206 -0
- package/dist/modules/admin-users/components/roles.jsx +126 -0
- package/dist/modules/admin-users/components/set-password.jsx +133 -0
- package/dist/modules/admin-users/components/update.jsx +215 -0
- package/dist/modules/analytics/components/dashboard.jsx +208 -0
- package/dist/modules/analytics/components/dashboard.test.node.js +162 -0
- package/dist/modules/analytics/components/timeseries.jsx +193 -0
- package/dist/modules/auth/components/sign-in-form.jsx +89 -0
- package/dist/modules/auth/safe-redirect.test.node.js +40 -0
- package/dist/modules/auth/sign-in-form-props.test.node.js +7 -0
- package/dist/presentation/group.jsx +26 -0
- package/dist/presentation/row.jsx +23 -0
- package/dist/presentation/tabs.jsx +39 -0
- package/dist/services/admin-services-context.jsx +17 -0
- package/dist/widgets/diff-viewer/diff-modal.jsx +110 -0
- package/dist/widgets/source-locale-badge/source-locale-badge.jsx +28 -0
- package/dist/widgets/status-badge/status-badge.jsx +46 -0
- package/package.json +7 -7
- package/src/forms/form-renderer-capabilities.test.tsx +72 -2
- package/src/forms/form-renderer.tsx +14 -2
- package/src/forms/path-widget.test.tsx +96 -2
- package/src/forms/path-widget.tsx +31 -11
|
@@ -66,6 +66,14 @@ export interface PathWidgetProps {
|
|
|
66
66
|
* persisted path. Defaults to `false`.
|
|
67
67
|
*/
|
|
68
68
|
sourceLocked?: boolean
|
|
69
|
+
/**
|
|
70
|
+
* When `true`, the collection declares its paths managed
|
|
71
|
+
* (`CollectionAdminConfig.lockPath`): the input renders read-only in both
|
|
72
|
+
* modes and the preview placeholder and "Regenerate" action are
|
|
73
|
+
* suppressed. Independent of `sourceLocked`, which answers whether the
|
|
74
|
+
* form can derive a preview at all. Defaults to `false`.
|
|
75
|
+
*/
|
|
76
|
+
lockPath?: boolean
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
/**
|
|
@@ -92,6 +100,7 @@ export const PathWidget = ({
|
|
|
92
100
|
mode,
|
|
93
101
|
slugifier,
|
|
94
102
|
sourceLocked = false,
|
|
103
|
+
lockPath = false,
|
|
95
104
|
disabled = false,
|
|
96
105
|
}: PathWidgetProps) => {
|
|
97
106
|
const { setSystemPath } = useFormContext()
|
|
@@ -105,11 +114,15 @@ export const PathWidget = ({
|
|
|
105
114
|
// with what the server persists.
|
|
106
115
|
const runSlugify = slugifier ?? slugify
|
|
107
116
|
|
|
108
|
-
// Phase 1: paths are written/edited only under the default content
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
// Phase 1: paths are written/edited only under the default content locale,
|
|
118
|
+
// so editing a translation locks the widget down.
|
|
119
|
+
const translationLocked = activeLocale !== defaultLocale
|
|
120
|
+
|
|
121
|
+
// A collection may also declare its paths managed. Both conditions produce
|
|
122
|
+
// the same read-only surface, so the placeholder, the Regenerate
|
|
123
|
+
// affordance, the `readOnly` attribute and the change guard all key off the
|
|
124
|
+
// combined flag.
|
|
125
|
+
const isReadOnly = lockPath || translationLocked
|
|
113
126
|
|
|
114
127
|
// Live preview — what the server would derive from the current source
|
|
115
128
|
// field value if no override were set. Used as placeholder in create
|
|
@@ -127,12 +140,14 @@ export const PathWidget = ({
|
|
|
127
140
|
|
|
128
141
|
const handleChange = useCallback(
|
|
129
142
|
(next: string) => {
|
|
130
|
-
|
|
143
|
+
// `readOnly` stops real typing; a programmatic change event still
|
|
144
|
+
// reaches this handler. Refuse the write so the lock holds in the form.
|
|
145
|
+
if (disabled || isReadOnly) return
|
|
131
146
|
// Empty string clears the override — server falls back to derive
|
|
132
147
|
// (create) or sticky (update).
|
|
133
148
|
setSystemPath(next.length === 0 ? null : next)
|
|
134
149
|
},
|
|
135
|
-
[disabled, setSystemPath]
|
|
150
|
+
[disabled, isReadOnly, setSystemPath]
|
|
136
151
|
)
|
|
137
152
|
|
|
138
153
|
const handleRegenerate = useCallback(() => {
|
|
@@ -154,13 +169,18 @@ export const PathWidget = ({
|
|
|
154
169
|
? t('pathWidget.suggestedHint', { formatted })
|
|
155
170
|
: undefined
|
|
156
171
|
|
|
157
|
-
//
|
|
158
|
-
|
|
159
|
-
|
|
172
|
+
// Hint precedence: locked, then translation, then live validation.
|
|
173
|
+
const lockedHint = lockPath
|
|
174
|
+
? mode === 'create'
|
|
175
|
+
? t('pathWidget.lockedCreateHint')
|
|
176
|
+
: t('pathWidget.lockedHint')
|
|
177
|
+
: undefined
|
|
178
|
+
|
|
179
|
+
const translationHint = translationLocked
|
|
160
180
|
? t('pathWidget.readOnlyHint', { locale: defaultLocale })
|
|
161
181
|
: undefined
|
|
162
182
|
|
|
163
|
-
const hint =
|
|
183
|
+
const hint = lockedHint ?? translationHint ?? validationHint
|
|
164
184
|
|
|
165
185
|
const placeholder =
|
|
166
186
|
!isReadOnly && mode === 'create' && livePreview.length > 0
|