Skip to content

Commit

Permalink
Merge pull request #10 from junyiacademy/refactor/widget-group-id
Browse files Browse the repository at this point in the history
refactor: drill widgetGroupId for scoring grouped widgets
  • Loading branch information
jiaojiaojiaoCpbr authored Mar 15, 2024
2 parents 513fff0 + d0af35b commit 3026935
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@junyiacademy/perseus-core",
"version": "1.0.23",
"version": "1.0.26",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions packages/perseus/src/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ type Props = Partial<React.ContextType<typeof DependenciesContext>> & {
widgets: PerseusRenderer["widgets"];
// Skip adding paragraph class
inline?: boolean;
parentGroups?: {id: string; groupType: string}[];
};

type State = {
Expand Down Expand Up @@ -628,6 +629,9 @@ class Renderer extends React.Component<Props, State> {
},
trackInteraction: interactionTracker.track,
isLastUsedWidget: id === this.state.lastUsedWidgetId,
...(this.props.parentGroups
? {parentGroups: this.props.parentGroups}
: {}),
};
};

Expand Down

0 comments on commit 3026935

Please sign in to comment.