Hey all - I'm trying to display a conditional field within an Asset Blueprint. Is there a way to get the current asset's filename or extension so I can display a field based on that when inside the Asset editor? I'm stumped at the moment. I thought I might be able to access the filename through the root values parameter but it doesn't seem to be the case.

The yaml:

if:
  asset_filename: 'custom isFiletype:mp4'

The JS:

Statamic.$conditions.add('isFiletype', ({ root, store, target, params }) => {
    console.log(root.filename, store.state.filename); // just an example of what I was expecting to find
    return new RegExp(params.join('|') + '$').test(target);
});

Both of those examples are just that... examples. asset_filename is made up - was wondering if there is maybe a this type variable in place of that, that will pass the asset information as the target in the isFiletype custom function.

Any ideas on how to access the filename or extension when in the Asset editor view?