Skip to content

chore(version): updated the @aemforms/af packages#176

Merged
sakshi-arora1 merged 7 commits into
mainfrom
versionBump
Jul 3, 2026
Merged

chore(version): updated the @aemforms/af packages#176
sakshi-arora1 merged 7 commits into
mainfrom
versionBump

Conversation

@armaang1729

Copy link
Copy Markdown
Collaborator

Description

Updated the npm packages version as handling for datetime component is missing in older version of @aemforms/af-core

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Comment thread examples/basic-react-apps/package.json Outdated
import sanitizeHTML from 'sanitize-html';
import { FieldViewState } from './type';

/** Legacy rich-text enum option shape; af-core 0.22.175+ types enumNames as string[] only. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file are not required, as the EnumName was already missing in the af-core bundle and is not related to the latest version of it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnumName was a real export from af-core, not a typo — it was defined in types/Json.d.ts at 0.22.65 (the version resolved when this import was originally added in #125):

export declare type EnumName = {
  value: string;
  richText?: boolean;
};

re-exported via types/index.d.tslib/index.d.ts. It was dropped from af-core's exports between 0.22.76 and 0.22.77 — well before this PR's bump to 0.22.176 — so the break was latent in the ^0.22.76 range regardless of this version bump. I've removed the comment that implied 0.22.175+ caused it and kept a local EnumNameItem type with the same shape as the original export.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move all these enum changes into PR: 175, and keep this PR limited to a version bump.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the PR that removed the enum name from the af-core: https://github.com/adobe-aem-forms/af2-web-runtime/pull/509

Approving the PR as this change was merged long ago.

…ted EnumName workaround

af-formatters was never imported in the example app; it's already pulled in
transitively via af-core/af-react-renderer. The EnumName type comment
incorrectly attributed a pre-existing af-core typing gap to this version bump.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@armaang1729
armaang1729 requested a review from rajatofficial July 3, 2026 06:12
const displayName = typeof item === 'object' ? item.value : item;
const localizeEnumId = getOrElse(state, ['properties', 'afs:translationIds', 'enumNames']);
const localizeEnumName = localizeEnumId ? i18n.formatMessage({ id: `localizeEnumId##${index}`, defaultMessage: EnumName }) : EnumName;
const localizeEnumName = localizeEnumId ? i18n.formatMessage({ id: `localizeEnumId##${index}`, defaultMessage: displayName }) : displayName;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here how is escaped string being localized? Run this once manually and test.

Armaan Gupta and others added 2 commits July 3, 2026 13:59
af-core 0.22.176+ always emits enumNames as plain strings (HTML included
inline, e.g. "<b>Item 1</b>"), dropping the old {value, richText} object
shape. getLocalizeEnumNames now returns the localized string as-is instead
of forcing it through richTextString, since that helper returns JSX and
some consumers (DropDown's <option>, Switch's aria-label) can only accept
plain strings. CheckBoxGroup and RadioButtonGroup render their option
labels via richTextString so HTML enum names still display as rich text
where the markup allows it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Fixtures previously used the retired {value, richText} object shape for
enumNames, which no longer matches what af-core produces. Converted
DropDown/CheckBoxGroup/RadioButtonGroup fixtures to plain strings, dropped
the now-redundant duplicate string-fixture tests and the rich-text-object
tests that asserted a shape that can no longer occur, and added a test per
component confirming HTML in enumNames still renders as rich text.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@armaang1729

Copy link
Copy Markdown
Collaborator Author
image

rendering of checkbox group having rich text options in react vanilla components

@sakshi-arora1 sakshi-arora1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a localization test case.

Covers rendering CheckBoxGroup under a non-default locale (fr-FR) to
confirm enumNames display correctly regardless of the active IntlProvider
locale, alongside the existing rich-text and translation-id coverage.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@sakshi-arora1
sakshi-arora1 merged commit 151d3d3 into main Jul 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants