Skip to content

Commit f71a66b

Browse files
author
susan101566
committed
editor: DataEnum in library (#9603) 3df92e66a4
Please review commit-by-commit :) This PR adds DataEnum as a publishable component. Then in the host file, you can drag the DataEnum into the stage. This DataEnum will appear in the Data sidebar, but will be read-only (no re-ordering or adding new values) ![image](https://github.com/user-attachments/assets/09007ca1-0ed4-46de-a87f-88010b0895bc) ![image](https://github.com/user-attachments/assets/2eda4c1e-8e41-46d1-9ddb-c01562bcc1bc) Then, in a view model in the host, you can use this DataEnum as if it's defined locally. Some notes 1. A LibraryDataEnum extends DataEnum. The only difference is that it has an asset ID and a component ID. I think this approach makes it such that existing UI's will just work. 2. The runtime exporter now has a concept of what DataEnums are required from each file. This makes sure we always include the DataEnum's needed by the host file. 3. I changed the ID resolving logic into the runtime exporter's bindable hooks. Going forward, this is a unified place to remap ID's. Tests: 1. I added some tests, and also manually verified that transitions understands library data enums. Here's a video: https://2dimensions.slack.com/archives/C07M7DQL4F2/p1746486246058399
1 parent 3d2bc57 commit f71a66b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.rive_head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
126c53a0f5663effc1badced3a786f2f5b5f0eb2
1+
3df92e66a45589d9114de55ecbfea494a068198f

0 commit comments

Comments
 (0)