Merged
Conversation
…pport Made-with: Cursor # Conflicts: # resources/js/components/ui/Publish/Field.vue
Move focus/blur events and field locking logic from Field.vue into Container.vue. Focus is tracked via a reactive fieldFocus map, and locks are derived as a computed from it (first user to focus wins). Emit publish-container-created/destroyed events for addon integration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 tasks
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the pieces needed to make the collaboration addon compatible with v6.
Field focus/blur and locking
The previously-stubbed
focused()andblurred()inField.vueare now wired up. They call newfocusField(handle)/blurField(handle)methods on the container (only for top-level fields — nested paths are ignored). The field's wrapper gets@focusin/@focusoutlisteners, andblurredis a no-op when focus moves to a descendant of the same field.Container.vueowns the state: a reactivefieldFocusmap keyed by user ID, and afieldLockscomputed derived from it (first user to focus a given handle wins the lock).focusField/blurFieldmutate the map and both throw when given a dotted path.A field is locked when
fieldLocks[handle]is set to a user other thanStatamic.user. Locked fields render aui-avatarof the locking user in the label and applypointer-events-none select-noneto the fieldtype wrapper.Publish container events
Container.vuenow emitspublish-container-createdon mount andpublish-container-destroyedon unmount viaStatamic.$events. Thecreatedpayload exposes the container'sname,reference,site,valuesandmetarefs, and methods:setValues,setFieldValue,setMeta,setFieldMeta,pushComponent,fieldFocus,focusField,blurField.New
setMetamethodReplaces the entire
metaobject on the container, analogous to the existingsetValues. Previously onlysetFieldMeta(path, value)existed. Exposed via the container context, thepublish-container-createdpayload, anddefineExpose.The container also now emits
update:meta(deep-watched) so parents canv-model:metait, mirroring the existing pattern formodelValue,visibleValues, andmodifiedFields.debouncere-exported from@statamic/cmsAdded alongside the other utilities (
clone,deepClone, etc.) inpackages/cms/src/index.jsandresources/js/bootstrap/cms/core.jsso addons can import it without bundling their own.Drive-by fixes
Components.vuenow forwardsv-on="component.events"to the dynamic component; event listeners registered viapushComponentwere being dropped.FieldConditionsValidator.test.jsmock gained a$eventsstub now that mounting aContaineremits on mount.