feat: add format presets for date and number inline variables#99
Merged
liamwalder merged 2 commits intodevelopfrom Mar 26, 2026
Merged
feat: add format presets for date and number inline variables#99liamwalder merged 2 commits intodevelopfrom
liamwalder merged 2 commits intodevelopfrom
Conversation
- Add date/number format presets using Intl APIs (variable-format-utils) - Add format selector popover for inline variable badges - Apply formatting on canvas, preview, and published pages - Thread user timezone through server-side format rendering - Extract shared DynamicVariable NodeView factory (dynamic-variable-view) - Extract buildFieldVariableData helper to eliminate duplication - Fix variable overwrite bug in injectCollectionData spreads
liamwalder
approved these changes
Mar 26, 2026
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
Add date and number format presets for inline CMS variables, allowing users to choose how dates and numbers are displayed (e.g. "Oct 23, 2025", "23/10/2025", "100%", "1,234.56"). Formatting is applied consistently across the canvas editor, preview mode, and published pages using the user's configured timezone.
Changes
variable-format-utils.tswith date/number format presets usingIntl.DateTimeFormatandIntl.NumberFormatVariableFormatSelectorpopover component for selecting format presets on inline variable badgesdynamic-variable-view.tsxshared factory to eliminate duplicate DynamicVariable NodeView code betweenRichTextEditorandCanvasTextEditorbuildFieldVariableDatahelper to deduplicate variable construction across 3 componentsformatFieldValuewith format preset through all rendering paths (canvas, preview, HTML export)injectCollectionDatawhere...layer.variablesspread could clobber already-resolved text when resolving image/video/audio bindingsTest plan