rulecms_source_components 0.5.0
rulecms_source_components: ^0.5.0 copied to clipboard
Default RuleCMS Flutter components — the Flutter counterpart of @rulecms/source-components-react.
rulecms_source_components #
Default RuleCMS Flutter components — the Flutter counterpart of @rulecms/source-components-react.
Provides the same default-library type ids. Register as the default library on rulecms_widget:
libraries: {'default': rulecmsSourceComponentsLibrary},
| Type id | Widget |
|---|---|
r-text |
Text, {n|label} links, {b|} / {i|} / {s|} marks, {br|} breaks, enclosing-tag-3-resolutions |
cloudinary-advanced-image |
Image.network via Cloudinary URL builder |
r-video |
video_player via Cloudinary delivery URLs |
r-icon |
Lucide icon resolved by name (lucide_flutter 1.28.0) |
r-button |
Preset + optional link, icon, disabled, host onClick |
r-divider |
Horizontal rule (solid / dashed / dotted) |
r-embed |
Allowlisted YouTube, Vimeo, Google Maps, Calendly WebView |
r-list |
Flat bulleted or numbered list with shared links |
r-accordion |
Summary / detail disclosure |
r-mount |
Slot for a host-app widget factory registered on RuleCMSWidget.mounts by name |
The package also exports the React library contract that rulecms_widget 0.2.0 consumes:
manifest,components,editorgetSourceComponentsPlugin(),getComponentMetadataForEditing(),getPreviewComponents()- link helpers (
isSafeHref,resolveLinkAttributes,parseInlineLinkMarkers) - inline markup (
parseInlineMarkers,serializeInlineMarkers,renderInlineMarkup) - button presets, list/embed/accordion allowlists
- icon registry (
resolveIconName,searchIconNames,resolveIconData)
Host onClick and nested children #
r-button reads onClick from SourceComponentBuildContext.widgetInstanceProps. Address the instance on RuleCMSWidget.componentProps by column id:
RuleCMSWidget(
publishedKey: publishedKey,
componentProps: {
ctaColumnId: {'onClick': handleCta},
},
)
r-accordion renders children after the authored detail when the renderer supplies a nested subtree (that composition path is still unshipped on both platforms).
Install #
dependencies:
rulecms_widget: ^0.2.1
rulecms_source_components: ^0.3.0
Develop locally #
cd source-components-flutter
flutter pub get
flutter test
flutter analyze
Publishing #
This package publishes to
pub.dev when a
vX.Y.Z tag is pushed. GitHub Actions uses pub.dev automated publishing
(OIDC). Do not run dart pub publish locally after the first upload.
Publish rulecms_widget first when the widget contract changes, then
bump the constraint here.
flutter pub get
flutter analyze
flutter test
dart pub publish --dry-run
./tool/bump_version.sh patch # or minor / major
git push && git push --tags
See __docs__/RUNBOOK_version-bump-and-release.md.
License #
Proprietary — RuleCMS, LLC