diff --git a/src/App-backup.js b/src/App-backup.js index 6fbfcea..31a81b7 100644 --- a/src/App-backup.js +++ b/src/App-backup.js @@ -2311,6 +2311,89 @@ function Inspector() { `; }; + const generatePseudosSection = () => { + if (!commonLayerTag) data.stylesTarget = null; + let styles = ''; + let selector = ''; + let activeStyle = null; + if (commonLayerTag) { + Object.keys(commonLayerTag).forEach(layerKey => { + const layer = commonLayerTag[layerKey]; + if (!data.stylesTarget) { + data.stylesTarget = layer.style; + } + }); + } + + // Target specific pseudo style + if (data.stylesTarget && data.stylesPropTarget === "pseudos") { + if (project.css.styles[data.stylesTarget].pseudos) { + Object.keys(project.css.styles[data.stylesTarget].pseudos).forEach(index => { + selector = project.css.styles[data.stylesTarget].pseudos[index].selector; + if (data.pseudosSelector === selector) { + buttonClass = buttonItemClass.split('bg-transparent border-0').join(''); + activeStyle = true; + data.pseudosSelectorIndex = index; + } else { + buttonClass = 'bg-transparent text-[.6rem] p-0 m-0 h-full text-left'; + activeStyle = null; + } + styles += ``; + }); + } + } + + return `
+
+ + +
+
+ ${data.stylesTarget ? `
+ ${styles} +
` : ''} + ${data.pseudosSelector && data.stylesTarget ? ` +
+ + +
+ ` : ''} + ${data.pseudosSelector && data.stylesTarget ? ` +
+ +
+ ` : ''} +
+
`; + }; + const generateStylePropertiesSection = () => { let styles = ''; let styleKey = null; @@ -2500,89 +2583,6 @@ function Inspector() { `; }; - const generatePseudosSection = () => { - if (!commonLayerTag) data.stylesTarget = null; - let styles = ''; - let selector = ''; - let activeStyle = null; - if (commonLayerTag) { - Object.keys(commonLayerTag).forEach(layerKey => { - const layer = commonLayerTag[layerKey]; - if (!data.stylesTarget) { - data.stylesTarget = layer.style; - } - }); - } - - // Target specific pseudo style - if (data.stylesTarget && data.stylesPropTarget === "pseudos") { - if (project.css.styles[data.stylesTarget].pseudos) { - Object.keys(project.css.styles[data.stylesTarget].pseudos).forEach(index => { - selector = project.css.styles[data.stylesTarget].pseudos[index].selector; - if (data.pseudosSelector === selector) { - buttonClass = buttonItemClass.split('bg-transparent border-0').join(''); - activeStyle = true; - data.pseudosSelectorIndex = index; - } else { - buttonClass = 'bg-transparent text-[.6rem] p-0 m-0 h-full text-left'; - activeStyle = null; - } - styles += ``; - }); - } - } - - return `
-
- - -
-
- ${data.stylesTarget ? `
- ${styles} -
` : ''} - ${data.pseudosSelector && data.stylesTarget ? ` -
- - -
- ` : ''} - ${data.pseudosSelector && data.stylesTarget ? ` -
- -
- ` : ''} -
-
`; - }; - const generateAnimationsSection = () => { if (!commonLayerTag) data.stylesTarget = null; let styles = ''; @@ -3043,10 +3043,10 @@ function Inspector() { ${generatePreviewSize()} ${generateRootVariablesSection()} ${generateStylesSection()} + ${data.stylesTarget && data.stylesPropTarget === "pseudos" ? generatePseudosSection() : ''} ${data.stylesTarget ? generateStylePropertiesSection() : ''} ${data.stylesTarget ? generateBreakpointsSection() : ''} ${data.breakpointKey ? generateBreakpointStylesSection() : ''} - ${data.stylesTarget && data.stylesPropTarget === "pseudos" ? generatePseudosSection() : ''} ${data.stylesTarget ? generateAnimationsSection() : ''} ${data.animationTarget ? generateAnimationPropertySection() : ''} ${generateAttributesSection()}