docs(2.x): panel form slices (specs 0086, 0088) - #57
Open
glennjacobs wants to merge 4 commits into
Open
glennjacobs wants to merge 4 commits into
glennjacobs wants to merge 4 commits into
Conversation
Adds the Draft Slices page for add-on authors: the add-ons-add rule, the
`addon:{key}` key scheme, registration through draftExtensions(), the
DraftSlice contract with the loyalty tier worked example, the useDraftSlice
return shape, what the slice gets for free, the draftSliceValues prop, and the
first-party slices on the product page. Cross-links the edit drafts, slots,
overview and add-on pages and keeps their example snippets in step with the
example add-on.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Follows the contract split and rename on lunar#2741 and the plain-form composition on lunar#2742: the page is now Form Slices, documents the FormSlice / DraftSlice contracts, formExtensions(), useFormSlice and usePanelForm, and the differences between drafted edit pages and plain create or settings forms. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <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.
Summary
Partner PR to lunarphp/lunar#2741 (spec 0086, the
FormSlice/DraftSlicecontracts on the drafted edit pages) and lunarphp/lunar#2742 (spec 0088, the same slices on the create pages and settings forms). Should merge after both land on2.x.2.x/admin/extending/form-slices.mdx: the panel's stance on extending first-party forms (add-ons add fields under a namespace they own, on any form's save, and never touch the form's own fields), the{namespace}:{field}andaddon:{key}:{field}key schemes, registration throughSection::formExtensions()and what registration rejects, theFormSlicecontract with a method table andDraftSlicefor draft-only state, theLoyaltyTierSliceworked example,useFormSliceand its return shape, what differs between drafted edit pages and plain create or settings forms, the sharedformSliceValuesprop withuseEditDraftandusePanelForm, the first-party slices on the product page, and stale-key handling.dirtyKeysand the slice seeding note on the JS side.formSlices()andformExtensions()in the hook table.LoyaltyCardas the source does.2.xbranch merged intonext.docs.json: the new page sits after Edit Drafts in the Admin Panel → Extending group.Every class, method, prop, and composable name was checked against the two implementation branches.
mint broken-linkspasses.🤖 Generated with Claude Code