Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert list components to composites #249

Merged
merged 13 commits into from
Oct 30, 2024
Merged

Conversation

dqnykamp
Copy link
Member

@dqnykamp dqnykamp commented Oct 29, 2024

This PR refactors mathList, numberList, textList, and booleanList as composite components.

This change allows the list components to be used anywhere the singleton components are allowed, as they become a series of the singleton components. Components no longer have to treat the list components as a special case.

The PR introduces some backward-incompatible changes.

  1. Individual components are no longer available from the .math, .number, etc., props. Instead, they are accessed directly using array notation off a reference to the component.
  2. One can no longer construct a list where one entry depends directly on another entry.
  3. It is no longer possible to distinguish between a list of one element and a singleton element, as the list of one element is turned into a single element.
  4. It is no longer possible to represent an empty list, as an empty list just becomes nothing.

Resolves Doenet/DoenetTools#2265, resolves Doenet/DoenetTools#2215

@dqnykamp dqnykamp merged commit 0909ca2 into Doenet:main Oct 30, 2024
3 checks passed
@dqnykamp dqnykamp deleted the list-composites branch October 30, 2024 15:14
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.

<numberList> should take a <math/> list as a child Request: The ability for a map to iterate over a list
1 participant