Skip to content

Commit

Permalink
Merge pull request #147 from a-ng-d:ui-color-palette-410-dev
Browse files Browse the repository at this point in the history
UI Color Palette 4.1.0
  • Loading branch information
a-ng-d authored Sep 5, 2024
2 parents b4946fc + 23f78d7 commit 4137f80
Show file tree
Hide file tree
Showing 60 changed files with 385 additions and 471 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
echo REACT_APP_SENTRY_DSN="${{ vars.REACT_APP_SENTRY_DSN }}" >> .env
echo SENTRY_AUTH_TOKEN="${{ secrets.SENTRY_AUTH_TOKEN }}" >> .env
echo REACT_APP_MIXPANEL_TOKEN="${{ vars.REACT_APP_MIXPANEL_TOKEN }}" >> .env
echo REACT_APP_WORKER_URL="${{ vars.REACT_APP_WORKER_URL }}" >> .env
echo REACT_APP_AUTH_WORKER_URL="${{ vars.REACT_APP_AUTH_WORKER_URL }}" >> .env
cat .env
- name: Install and Build
Expand Down
7 changes: 5 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@
"https://corsproxy.io",
"https://zclweepgvqkrelyfwhma.supabase.co",
"https://oauth.yelbolt.workers.dev",
"https://announcements.yelbolt.workers.dev",
"https://www.colourlovers.com",
"https://*.mixpanel.com",
"https://asset.brandfetch.io",
"https://*.sentry.io"
"https://*.sentry.io",
"https://*.amazonaws.com"
],
"devAllowedDomains": [
"http://localhost:3000",
"http://localhost:8787"
"http://localhost:8787",
"http://localhost:8888"
]
},
"parameters": [
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "figma-ui-color-palette",
"version": "4.0.4",
"version": "4.1.0",
"description": "Create accessible UI color palettes with consistent lightness and contrast",
"main": "code.js",
"scripts": {
Expand Down Expand Up @@ -59,7 +59,7 @@
"webpack-cli": "^4.9.1"
},
"dependencies": {
"@a_ng_d/figmug-ui": "^0.76.0",
"@a_ng_d/figmug-ui": "^0.81.0",
"@a-ng-d/figmug.modules.do-camel-case": "^0.0.4",
"@a-ng-d/figmug.modules.do-kebab-case": "^0.0.4",
"@a-ng-d/figmug.modules.do-map": "^0.0.3",
Expand Down
48 changes: 30 additions & 18 deletions src/bridges/checks/checkHighlightStatus.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
import { releaseNotesVersion } from '../../utils/config'
const checkHighlightStatus = async (remoteVersion: string) => {
// figma.clientStorage.deleteAsync('highlight_version')
// console.log('localVersion', localVersion)
// console.log('remoteVersion', remoteVersion)
const localVersion = await figma.clientStorage.getAsync('highlight_version')

const checkHighlightStatus = async () => {
// figma.clientStorage.deleteAsync(`${version}_isRead`)
const isRead = await figma.clientStorage.getAsync(
`${releaseNotesVersion}_isRead`
)

if (isRead === undefined || !isRead)
figma.ui.postMessage({
type: 'CHECK_HIGHLIGHT_STATUS',
if (localVersion === undefined)
return figma.ui.postMessage({
type: 'PUSH_HIGHLIGHT_STATUS',
data:
figma.payments !== undefined
? figma.payments.getUserFirstRanSecondsAgo() > 60
? 'UNREAD_RELEASE_NOTE'
: 'READ_RELEASE_NOTE'
: 'READ_RELEASE_NOTE',
})
else
figma.ui.postMessage({
type: 'CHECK_HIGHLIGHT_STATUS',
data: 'READ_RELEASE_NOTE',
? 'DISPLAY_HIGHLIGHT_DIALOG'
: 'NO_HIGHLIGHT'
: 'NO_HIGHLIGHT',
})
else {
const remoteMajorVersion = remoteVersion.split('.')[0],
remoteMinorVersion = remoteVersion.split('.')[1]

const localMajorVersion = localVersion.split('.')[0],
localMinorVersion = localVersion.split('.')[1]

if (remoteMajorVersion !== localMajorVersion)
return figma.ui.postMessage({
type: 'PUSH_HIGHLIGHT_STATUS',
data: 'DISPLAY_HIGHLIGHT_DIALOG',
})

if (remoteMinorVersion !== localMinorVersion)
return figma.ui.postMessage({
type: 'PUSH_HIGHLIGHT_STATUS',
data: 'DISPLAY_HIGHLIGHT_NOTIFICATION',
})
}
}

export default checkHighlightStatus
6 changes: 3 additions & 3 deletions src/bridges/loadUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ const loadUI = async () => {
themeColors: true,
})

checkUserConsent()
.then(() => checkEditorType())
.then(() => checkHighlightStatus())
checkUserConsent().then(() => checkEditorType())

processSelection()

await checkPlanStatus()
Expand Down Expand Up @@ -81,6 +80,7 @@ const loadUI = async () => {
figma.ui.resize(windowSize.w, windowSize.h)
},
CHECK_USER_CONSENT: () => checkUserConsent(),
CHECK_HIGHLIGHT_STATUS: () => checkHighlightStatus(msg.version),
CREATE_PALETTE: () => createPalette(msg),
UPDATE_SCALE: () => updateScale(msg),
UPDATE_VIEW: () => updateView(msg),
Expand Down
6 changes: 3 additions & 3 deletions src/bridges/publication/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createClient } from '@supabase/supabase-js'

import { lang, locals } from '../../content/locals'
import { authUrl, databaseUrl, workerUrl } from '../../utils/config'
import { authUrl, authWorkerUrl, databaseUrl } from '../../utils/config'
import checkConnectionStatus from '../checks/checkConnectionStatus'

let isAuthenticated = false
Expand All @@ -13,7 +13,7 @@ export const supabase = createClient(

export const signIn = async (disinctId: string) => {
return new Promise((resolve, reject) => {
fetch(workerUrl, {
fetch(authWorkerUrl, {
method: 'GET',
cache: 'no-cache',
credentials: 'omit',
Expand All @@ -38,7 +38,7 @@ export const signIn = async (disinctId: string) => {
'https://www.figma.com'
)
const poll = setInterval(async () => {
fetch(workerUrl, {
fetch(authWorkerUrl, {
method: 'GET',
cache: 'no-cache',
credentials: 'omit',
Expand Down
Binary file removed src/content/images/release_note_v19.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v20.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v21.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v22.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v23.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v24_1.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v24_2.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v25_1.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v25_2.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v25_3.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v28_1.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v28_2.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v28_3.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v29_1.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v29_2.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v30_1.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v30_2.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v31_1.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v31_2.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v31_3.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v32_1.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v32_2.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v32_3.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v33_1.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v33_2.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v33_3.webp
Binary file not shown.
Binary file removed src/content/images/release_note_v33_4.webp
Binary file not shown.
9 changes: 7 additions & 2 deletions src/content/locals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ export const locals: { [key: string]: any } = {
statusUptoDate: 'No change',
statusUnpublished: 'Unpublished',
statusRemoteChanges: 'Remote changes',
statusWaiting: 'Waiting…',
statusWaiting: 'Pending…',
statusNotFound: 'Not found',
publish: 'Publish…',
unpublish: 'Unpublish',
synchronize: 'Synchronize…',
revert: 'Revert',
detach: 'Detach',
waiting: 'Waiting…',
signIn: 'Sign in to publish',
},
relaunch: {
Expand Down Expand Up @@ -456,6 +455,11 @@ export const locals: { [key: string]: any } = {
'A top analytics platform for tracking and understanding user interactions',
},
},
pending: {
announcements: 'Pending announcements…',
primaryAction: '………',
secondaryAction: '………',
},
success: {
publication: '✓ The palette has been published',
nonPublication: '✓ The palette has been unpublished',
Expand Down Expand Up @@ -511,6 +515,7 @@ export const locals: { [key: string]: any } = {
addToFile: '✕ The palette cannot be added',
noInternetConnection:
'✕ The connection with the remote palette is unlinked',
announcements: 'The announcements cannot be loaded',
},
},
}
Loading

0 comments on commit 4137f80

Please sign in to comment.