elegantthemes / Divi-Beta

8 stars 0 forks source link

Conversion Outline :: Unable to use convertFontIcon on conversion-outline.ts #111

Closed carlfromfelton closed 1 week ago

carlfromfelton commented 2 weeks ago

Problem Description

Added to my conversion-outline.ts file the following code to handle the conversion of the icon font selection field

import {ModuleConversionOutline} from '@divi/types';
import {convertFontIcon} from "@divi/conversion";

export const conversionOutline: ModuleConversionOutline = {
...
valueExpansionFunctionMap: {
       prev_icon: convertFontIcon,
        next_icon: convertFontIcon,
        overlay_icon: convertFontIcon,
    },
...
}

Describe what you expected to happen Expect the D4 module to load the correct value for the icon selection when open for the first time on D5

Describe what actually happened After saving the change on my conversion-outline.ts file, I get the following error in the console

ERROR in ./src/components/dynamic-gallery/conversion-outline.ts 1:0-51
Module not found: Error: Can't resolve '@divi/conversion' in '/Users/carlos/Local Sites/dividev/app/public/wp-content/plugins/dp-divi-dynamic-gallery/src/components/dynamic-gallery'

Related Links or Information

Screenshot and/or gif

Screenshot 2024-11-05 at 7 45 07 AM Screenshot 2024-11-05 at 7 49 27 AM Screenshot 2024-11-05 at 7 51 20 AM

System Information

carlfromfelton commented 2 weeks ago

It works if I use

// @ts-ignore
const {convertFontIcon} = window?.divi?.conversion;

Instead of

import {convertFontIcon} from "@divi/conversion";
robicse11127 commented 1 week ago

As the issue gets resolved I am closing this one. Thanks.