Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dynamic preview before updating palette #155

Merged
merged 55 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7f743cf
refactor: introduce NamingConvention type and update related interfac…
a-ng-d Dec 10, 2024
59158ec
refactor: update distributionEasing and namingConvention types for co…
a-ng-d Dec 10, 2024
0f103cf
refactor: update Slider component types and templates for enhanced fu…
a-ng-d Dec 10, 2024
5bad9a4
refactor: streamline state management in Slider and Scale
a-ng-d Dec 10, 2024
e755a7f
refactor: Knob and Slider to use React hooks ans state management
a-ng-d Dec 10, 2024
c8577fa
feat: upgrade Preview reactivity and display
a-ng-d Dec 10, 2024
0a3f231
fix: reset scale after unselecting palette
a-ng-d Dec 10, 2024
1d88e8a
refactor: remove redundant palette properties assignment in CreatePal…
a-ng-d Dec 10, 2024
4a65b20
fix: set scaling when running without interacting with figma canvas
a-ng-d Dec 10, 2024
3416cae
chore: update @a_ng_d/figmug-ui dependency to version 0.113.3
a-ng-d Dec 11, 2024
ee7e5fd
fix: adjust padding for settings items in Overview component
a-ng-d Dec 11, 2024
7a1178a
fix: rename onCleared event handler to onClear in CommunityPalettes a…
a-ng-d Dec 11, 2024
0c28099
fix: spread props in Preview component for Scale, Settings, and Sourc…
a-ng-d Dec 11, 2024
cea9f31
feat: enhance Preview component with WCAG and APCA contrast scoring, …
a-ng-d Dec 11, 2024
f9062be
fix: standardize WCAG method names and update variable references in …
a-ng-d Dec 11, 2024
d34e58c
feat: add WCAG and APCA score display options in Preview component an…
a-ng-d Dec 11, 2024
1a8bed1
refactor: remove Preview component from Scale, Settings, and Source c…
a-ng-d Dec 11, 2024
3e9f5d6
refactor: rename sourceColors prop to colors in Preview and CreatePal…
a-ng-d Dec 11, 2024
a7eaad8
feat: integrate Preview component into EditPalette for enhanced featu…
a-ng-d Dec 11, 2024
513ac8b
fix: correct spelling of 'algorithm' in Settings component
a-ng-d Dec 11, 2024
269bd65
fix: correct spelling of 'algorithm' in ColorSettings component
a-ng-d Dec 11, 2024
23b3064
feat: add Color and Contrast utility classes for color manipulation a…
a-ng-d Dec 11, 2024
fc1b9d4
refactor: streamline color handling and contrast calculations in Prev…
a-ng-d Dec 11, 2024
3efc162
fix: add outline-offset to user avatar for improved styling
a-ng-d Dec 11, 2024
82d6511
refactor: add TypeScript return types to contrast utility methods for…
a-ng-d Dec 12, 2024
cfe89c9
refactor: remove visionSimulationMode from Contrast calculations in P…
a-ng-d Dec 12, 2024
9cd51d5
feat: add HSLuv conversion methods to Color and Contrast utilities fo…
a-ng-d Dec 12, 2024
1b397fd
refactor: optimize color blending algorithm for better performance an…
a-ng-d Dec 12, 2024
c02774c
refactor: simplify color data initialization in Preview component for…
a-ng-d Dec 12, 2024
262d9a5
feat: update palette properties in Settings component for improved st…
a-ng-d Dec 12, 2024
d93b5c5
feat: add reset source colors functionality and update component stat…
a-ng-d Dec 12, 2024
4bba391
feat: add reset helper text and disable condition for reset action in…
a-ng-d Dec 12, 2024
c875468
feat: update Preview component to include no-height class and adjust …
a-ng-d Dec 12, 2024
322d3c7
feat: enhance Preview component layout and improve color handling logic
a-ng-d Dec 12, 2024
6a5c21c
feat: update @a_ng_d/figmug-ui dependency to version 0.113.5
a-ng-d Dec 12, 2024
e5e9a54
refactor: rename draggable-list class to draggable-item for consistency
a-ng-d Dec 12, 2024
fc738bf
feat: stop allowing real time edit
a-ng-d Dec 12, 2024
10a4451
refactor: remove unused onboarding actions styles from app-components…
a-ng-d Dec 12, 2024
f4a1358
fix: update score threshold logic in Preview component
a-ng-d Dec 12, 2024
7b429fa
fix: hide the overflowed content
a-ng-d Dec 12, 2024
80543ee
refactor: optimize color processing in Preview component
a-ng-d Dec 12, 2024
a688a79
feat: enhance Preview component with additional configuration props
a-ng-d Dec 12, 2024
f60dd0b
refactor: update SettingsProps to replace view string with ViewConfig…
a-ng-d Dec 12, 2024
234d837
chore: update @a_ng_d/figmug-ui dependency to version 0.113.6
a-ng-d Dec 12, 2024
4b6be25
feat: implement dynamic drawer height adjustment in Preview component
a-ng-d Dec 12, 2024
6b15d7e
chore: add @nanostores/preact dependency to package.json and package-…
a-ng-d Dec 12, 2024
a34da7c
feat: add checkUserPreferences function to manage user preference set…
a-ng-d Dec 12, 2024
15776e3
feat: add preferences store and integrate user preference checks in A…
a-ng-d Dec 12, 2024
6f07a72
feat: refactor SyncPreferences component to use subscriptions for dee…
a-ng-d Dec 12, 2024
4419c7c
feat: implement deep synchronization for palette settings in SyncPref…
a-ng-d Dec 12, 2024
aac4f33
feat: encapsulate class properties as private in various components f…
a-ng-d Dec 13, 2024
5b3ebc3
refactor: enhance user preference management by adding WCAG and APCA …
a-ng-d Dec 13, 2024
2015d1c
refactor: rename deep sync state variables for consistency in prefere…
a-ng-d Dec 13, 2024
78b06ff
refactor: adjust drawer height calculation and update CSS for improve…
a-ng-d Dec 13, 2024
2c691d9
refactor: simplify drawer height calculation in Preview component
a-ng-d Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 38 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@
"webpack-cli": "^4.9.1"
},
"dependencies": {
"@a_ng_d/figmug-ui": "^0.112.2",
"@a_ng_d/figmug-ui": "^0.113.6",
"@a_ng_d/figmug-utils": "^0.1.2",
"@nanostores/preact": "^0.5.2",
"@sentry/react": "^8.8.0",
"@sentry/webpack-plugin": "^2.22.6",
"@supabase/supabase-js": "^2.44.2",
Expand Down
43 changes: 43 additions & 0 deletions src/bridges/checks/checkUserPreferences.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const checkUserPreferences = async () => {
const isWCAGDisplayed =
await figma.clientStorage.getAsync('is_wcag_displayed')
const isAPCADisplayed =
await figma.clientStorage.getAsync('is_apca_displayed')
const canDeepSyncPalette = await figma.clientStorage.getAsync(
'can_deep_sync_palette'
)
const canDeepSyncVariables = await figma.clientStorage.getAsync(
'can_deep_sync_variables'
)
const canDeepSyncStyles = await figma.clientStorage.getAsync(
'can_deep_sync_styles'
)

if (isWCAGDisplayed === undefined)
await figma.clientStorage.setAsync('is_wcag_displayed', true)
if (isAPCADisplayed === undefined)
await figma.clientStorage.setAsync('is_apca_displayed', true)
if (canDeepSyncPalette === undefined)
await figma.clientStorage.setAsync('can_deep_sync_palette', false)

if (canDeepSyncVariables === undefined)
await figma.clientStorage.setAsync('can_deep_sync_variables', false)

if (canDeepSyncStyles === undefined)
await figma.clientStorage.setAsync('can_deep_sync_styles', false)

figma.ui.postMessage({
type: 'CHECK_USER_PREFERENCES',
data: {
isWCAGDisplayed: isWCAGDisplayed ?? true,
isAPCADisplayed: isAPCADisplayed ?? true,
canDeepSyncPalette: canDeepSyncPalette ?? false,
canDeepSyncVariables: canDeepSyncVariables ?? false,
canDeepSyncStyles: canDeepSyncStyles ?? false,
},
})

return true
}

export default checkUserPreferences
2 changes: 2 additions & 0 deletions src/bridges/loadUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import checkEditorType from './checks/checkEditorType'
import checkHighlightStatus from './checks/checkHighlightStatus'
import checkPlanStatus from './checks/checkPlanStatus'
import checkUserConsent from './checks/checkUserConsent'
import checkUserPreferences from './checks/checkUserPreferences'
import createLocalStyles from './creations/createLocalStyles'
import createLocalVariables from './creations/createLocalVariables'
import createPalette from './creations/createPalette'
Expand Down Expand Up @@ -48,6 +49,7 @@ const loadUI = async () => {
checkUserConsent()
.then(() => checkEditorType())
.then(() => checkPlanStatus())
.then(() => checkUserPreferences())
.then(() => processSelection())

// Canvas > UI
Expand Down
Loading
Loading