Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.bind(aspectRatio => Maybe.fromNull(
//
// Read out aspect ratio options and filter them
//
values(options).filter(o => o && (o.width / o.height).toFixed(2) === aspectRatio.toFixed(2))[0]
))
.map(o => new ConfiguredAspectRatioStrategy(o.width, o.height, o.label))
protected onSelectionChanged = (): void => {
const item = firstOrElse(this.selection.getSelection(), null)
const selected = Maybe.fromNull(item)
this.setState({
selected,
buffer: selected.isSome ? Maybe.pure({ ...item }) : Maybe.None(),
changed: [],
})
if (DEBUG) console.log(`${NAME}.onSelectionChanged`, this.selection.getSelection())
}
key={viewId}
id={viewId}
label={view.label}
view={view.view}
options={view.viewOptions}
renderSecondaryInspector={renderSecondaryInspector}
node={node}
commit={commit}
/>);
})}
);
const fallback = () => (<div>...</div>);
return Maybe.fromNull(properties).map(propertyGroup).orSome(fallback());
}
}
get resizeAdjustment() {
const {image} = this;
return Maybe.fromNull($get(RESIZE_IMAGE_ADJUSTMENT, image));
}
label={$get('label', item)}
view={$get('view', item)}
options={$get('viewOptions', item) && $get('viewOptions', item).toJS ? $get('viewOptions', item).toJS() : $get('viewOptions', item)}
renderSecondaryInspector={renderSecondaryInspector}
node={node}
commit={commit}
/>);
}
return null;
})}
);
const fallback = () => (<div>...</div>);
return Maybe.fromNull(items).map(propertyGroup).orSome(fallback());
}
}
get cropAdjustment() {
const {image} = this;
return Maybe.fromNull($get(CROP_IMAGE_ADJUSTMENT, image));
}