Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy committed Oct 10, 2024
1 parent fc25282 commit e2bde11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import type { BaseCommand, CommandFunctionResult, WhenToRun } from './commands'
import * as EP from '../../../core/shared/element-path'
import * as PP from '../../../core/shared/property-path'
import { patchParseSuccessAtElementPath } from './patch-utils'
import type { InteractionLifecycle } from '../canvas-strategies/canvas-strategy-types'
import { mapDropNulls } from '../../../core/shared/array-utils'
import { applyValuesAtPath } from './adjust-number-command'

Expand Down Expand Up @@ -102,10 +101,10 @@ export const runDeleteProperties = (
command.properties,
)

const propertiesToUnsetPatch = getPropertiesToUnsetPatches(editorState, command)
const propertiesToUnsetPatches = getPropertiesToUnsetPatches(editorState, command)

return {
editorStatePatches: [propertyUpdatePatch, ...propertiesToUnsetPatch],
editorStatePatches: [propertyUpdatePatch, ...propertiesToUnsetPatches],
commandDescription: `Delete Properties ${command.properties
.map(PP.toString)
.join(',')} on ${EP.toUid(command.element)}`,
Expand Down
16 changes: 11 additions & 5 deletions editor/src/components/canvas/plugins/tailwind-style-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,20 @@ export const TailwindPlugin = (config: Config | null): StylePlugin => ({

return [
deleteProperties(
'always',
'on-complete',
elementPath,
Object.keys(TailwindPropertyMapping).map((prop) => PP.create('style', prop)),
),
updateClassListCommand('always', elementPath, [
...stylePropConversions.map(({ property, value }) => UCL.add({ property, value })),
...getRemoveUpdates(editorState.canvas.propertiesToUnset),
]),
updateClassListCommand(
'always',
elementPath,
stylePropConversions.map(({ property, value }) => UCL.add({ property, value })),
),
updateClassListCommand(
'always',
elementPath,
getRemoveUpdates(editorState.canvas.propertiesToUnset),
),
]
})
if (commands.length === 0) {
Expand Down

0 comments on commit e2bde11

Please sign in to comment.