@byline/admin 6.0.3 → 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.
Files changed (86) hide show
  1. package/dist/exports-parity.test.node.js +37 -0
  2. package/dist/fields/array/array-field.jsx +209 -0
  3. package/dist/fields/blocks/blocks-field.jsx +248 -0
  4. package/dist/fields/checkbox/checkbox-field.jsx +24 -0
  5. package/dist/fields/code/code-editor.jsx +211 -0
  6. package/dist/fields/code/code-field.jsx +109 -0
  7. package/dist/fields/column-formatter.jsx +25 -0
  8. package/dist/fields/date-time-formatter.jsx +18 -0
  9. package/dist/fields/datetime/datetime-field.jsx +22 -0
  10. package/dist/fields/draggable-context-menu.jsx +50 -0
  11. package/dist/fields/field-admin.test.node.js +40 -0
  12. package/dist/fields/field-renderer.jsx +136 -0
  13. package/dist/fields/field-services-context.jsx +17 -0
  14. package/dist/fields/file/file-field.jsx +176 -0
  15. package/dist/fields/file/file-upload-field.jsx +89 -0
  16. package/dist/fields/group/group-field.jsx +46 -0
  17. package/dist/fields/image/image-field.jsx +183 -0
  18. package/dist/fields/image/image-upload-field.jsx +157 -0
  19. package/dist/fields/local-date-time.jsx +69 -0
  20. package/dist/fields/locale-badge.jsx +19 -0
  21. package/dist/fields/numerical/numerical-field.jsx +93 -0
  22. package/dist/fields/relation/relation-column-formatter.jsx +74 -0
  23. package/dist/fields/relation/relation-display.jsx +118 -0
  24. package/dist/fields/relation/relation-field.jsx +108 -0
  25. package/dist/fields/relation/relation-many-field.jsx +142 -0
  26. package/dist/fields/relation/relation-picker.jsx +240 -0
  27. package/dist/fields/relation/relation-summary.jsx +45 -0
  28. package/dist/fields/select/select-field.jsx +27 -0
  29. package/dist/fields/sortable-item.jsx +54 -0
  30. package/dist/fields/text/text-field.jsx +79 -0
  31. package/dist/fields/text-area/text-area-field.jsx +79 -0
  32. package/dist/forms/available-locales-reconcile.test.node.js +43 -0
  33. package/dist/forms/available-locales-widget.jsx +63 -0
  34. package/dist/forms/document-actions.jsx +486 -0
  35. package/dist/forms/form-context.jsx +598 -0
  36. package/dist/forms/form-modals.jsx +128 -0
  37. package/dist/forms/form-renderer.d.ts +8 -2
  38. package/dist/forms/form-renderer.js +3 -2
  39. package/dist/forms/form-renderer.jsx +532 -0
  40. package/dist/forms/form-status-display.jsx +69 -0
  41. package/dist/forms/navigation-guard.jsx +68 -0
  42. package/dist/forms/nested-path.test.node.js +115 -0
  43. package/dist/forms/path-widget.d.ts +9 -1
  44. package/dist/forms/path-widget.js +8 -5
  45. package/dist/forms/path-widget.jsx +125 -0
  46. package/dist/forms/pending-uploads.test.node.js +19 -0
  47. package/dist/forms/repeating-items.test.node.js +29 -0
  48. package/dist/forms/scheduled-publication-control.jsx +389 -0
  49. package/dist/forms/scheduled-publication-state.test.node.js +121 -0
  50. package/dist/forms/scheduled-publication-time.test.node.js +70 -0
  51. package/dist/forms/status-transitions.test.node.js +76 -0
  52. package/dist/forms/tree-placement-widget.jsx +160 -0
  53. package/dist/forms/upload-executor.test.node.js +368 -0
  54. package/dist/forms/use-form-layout.test.node.js +69 -0
  55. package/dist/modules/admin-account/components/change-password.jsx +169 -0
  56. package/dist/modules/admin-account/components/container.jsx +164 -0
  57. package/dist/modules/admin-account/components/preferences.jsx +148 -0
  58. package/dist/modules/admin-account/components/theme-switch.jsx +52 -0
  59. package/dist/modules/admin-account/components/update.jsx +186 -0
  60. package/dist/modules/admin-permissions/components/inspector.jsx +200 -0
  61. package/dist/modules/admin-preferences/schemas.test.node.js +48 -0
  62. package/dist/modules/admin-roles/components/create.jsx +155 -0
  63. package/dist/modules/admin-roles/components/permissions.jsx +239 -0
  64. package/dist/modules/admin-roles/components/update.jsx +148 -0
  65. package/dist/modules/admin-users/components/create.jsx +206 -0
  66. package/dist/modules/admin-users/components/roles.jsx +126 -0
  67. package/dist/modules/admin-users/components/set-password.jsx +133 -0
  68. package/dist/modules/admin-users/components/update.jsx +215 -0
  69. package/dist/modules/analytics/components/dashboard.jsx +208 -0
  70. package/dist/modules/analytics/components/dashboard.test.node.js +162 -0
  71. package/dist/modules/analytics/components/timeseries.jsx +193 -0
  72. package/dist/modules/auth/components/sign-in-form.jsx +89 -0
  73. package/dist/modules/auth/safe-redirect.test.node.js +40 -0
  74. package/dist/modules/auth/sign-in-form-props.test.node.js +7 -0
  75. package/dist/presentation/group.jsx +26 -0
  76. package/dist/presentation/row.jsx +23 -0
  77. package/dist/presentation/tabs.jsx +39 -0
  78. package/dist/services/admin-services-context.jsx +17 -0
  79. package/dist/widgets/diff-viewer/diff-modal.jsx +110 -0
  80. package/dist/widgets/source-locale-badge/source-locale-badge.jsx +28 -0
  81. package/dist/widgets/status-badge/status-badge.jsx +46 -0
  82. package/package.json +7 -7
  83. package/src/forms/form-renderer-capabilities.test.tsx +72 -2
  84. package/src/forms/form-renderer.tsx +14 -2
  85. package/src/forms/path-widget.test.tsx +96 -2
  86. 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
- // locale. When editing a translation, the widget locks down — the
110
- // input is read-only, the Regenerate action is suppressed, and a
111
- // helpText line explains why.
112
- const isReadOnly = activeLocale !== defaultLocale
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
- if (disabled) return
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
- // When read-only, replace the live validation hint with a fixed
158
- // explanatory line so editors understand why the field is locked.
159
- const readOnlyHint = isReadOnly
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 = readOnlyHint ?? validationHint
183
+ const hint = lockedHint ?? translationHint ?? validationHint
164
184
 
165
185
  const placeholder =
166
186
  !isReadOnly && mode === 'create' && livePreview.length > 0