Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 13 additions & 13 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "penpot-ui-color-palette",
"version": "5.0.0",
"version": "5.0.1",
"private": true,
"description": "UI Color Palette is a Penpot plugin that creates, manages, exports, and publishes consistent and accessible color palettes.",
"author": "Aurélien Grimaud",
Expand Down Expand Up @@ -62,9 +62,9 @@
"vite-tsconfig-paths": "^5.1.4"
},
"dependencies": {
"@a_ng_d/figmug-ui": "^1.16.0",
"@a_ng_d/figmug-ui": "^1.17.2",
"@a_ng_d/figmug-utils": "^0.7.1",
"@a_ng_d/utils-ui-color-palette": "^1.6.2",
"@a_ng_d/utils-ui-color-palette": "^1.6.3",
"@nanostores/preact": "^0.5.2",
"@sentry/react": "^8.8.0",
"@supabase/supabase-js": "^2.44.2",
Expand Down
17 changes: 10 additions & 7 deletions src/bridges/checks/checkTrialStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ const checkTrialStatus = async () => {
else trialStatus = 'UNUSED'
}

let planStatus

if (trialStatus === 'PENDING' || !globalConfig.plan.isProEnabled)
planStatus = 'PAID'
else planStatus = undefined

penpot.ui.sendMessage({
type: 'CHECK_TRIAL_STATUS',
data: {
planStatus:
trialStatus === 'PENDING' || !globalConfig.plan.isProEnabled
? 'PAID'
: 'UNPAID',
planStatus: planStatus,
trialStatus: trialStatus,
trialRemainingTime: Math.ceil(
currentTrialVersion !== globalConfig.versions.trialVersion
Expand All @@ -48,9 +51,9 @@ const checkTrialStatus = async () => {
},
})

return trialStatus === 'PENDING' || !globalConfig.plan.isProEnabled
? 'PAID'
: 'UNPAID'
if (trialStatus === 'PENDING' || !globalConfig.plan.isProEnabled)
return 'PAID'
else return undefined
}

export default checkTrialStatus
18 changes: 12 additions & 6 deletions src/bridges/loadUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ import checkUserConsent from './checks/checkUserConsent'
import checkTrialStatus from './checks/checkTrialStatus'
import checkAnnouncementsStatus from './checks/checkAnnouncementsStatus'

/*penpot.currentPage?.getPluginDataKeys().forEach((key) => {
if (key.startsWith('palette_')) penpot.currentPage?.setPluginData(key, '')
})*/

interface Window {
width: number
height: number
Expand Down Expand Up @@ -272,20 +268,30 @@ const loadUI = async () => {
plans: ['ONE'],
},
}),
GO_TO_ONE: () =>
penpot.ui.sendMessage({
type: 'OPEN_IN_BROWSER',
data: {
url: globalConfig.urls.storeUrl,
isNewTab: true,
},
}),
ENABLE_PRO_PLAN: async () =>
penpot.ui.sendMessage({
type: 'ENABLE_PRO_PLAN',
data: {
id: penpot.currentUser.id,
},
}),
LEAVE_PRO_PLAN: async () =>
LEAVE_PRO_PLAN: async () => {
penpot.ui.sendMessage({
type: 'LEAVE_PRO_PLAN',
data: {
id: penpot.currentUser.id,
},
}),
})
checkTrialStatus()
},
WELCOME_TO_PRO: async () =>
penpot.ui.sendMessage({
type: 'WELCOME_TO_PRO',
Expand Down
47 changes: 28 additions & 19 deletions src/content/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
}
},
"info": {
"askDesigner": "You can ask designers to create a palette or jump to another page",
"addToLocal": "The palette already exists in this page",
"announcements": "There is no announcement for now",
"onboarding": "There is no onboarding for now",
Expand All @@ -260,9 +261,17 @@
"plural": "{count} variables created",
"single": "1 variable created"
},
"maxNumberOfSourceColors": "Upgrade to Pro to add more than {maxCount} source colors",
"maxNumberOfStops": "Upgrade to Pro to add more than {maxCount} stops",
"maxNumberOfLocalPalettes": "Upgrade to Pro to add more than {maxCount} local palettes",
"maxNumberOfSourceColors": "Upgrade to /pro to add more than {maxCount} source colors",
"maxNumberOfStops": "Upgrade to /pro to add more than {maxCount} stops",
"maxNumberOfLocalPalettes": "Upgrade to /pro to add more than {maxCount} local palettes",
"multipleBlockingMessages": {
"head": "Upgrade to /pro or: {messages}",
"sourceColors": "decrease source colors",
"stops": "decrease stops",
"lockedSourceColors": "unlock source colors",
"chroma": "reset chroma",
"visionSimulationMode": "reset vision simulation"
},
"noResult": "No palette matches your search",
"paletteCreated": "{name} palette created",
"removedLocalStyles": {
Expand All @@ -276,7 +285,7 @@
"single": "1 variable removed"
},
"signOut": "See you later",
"themesOnFree": "Upgrade to Pro to add or edit modes",
"themesOnFree": "Upgrade to /pro to add or edit modes",
"updatedLocalStyles": {
"none": "No style updated",
"plural": "{count} styles updated",
Expand Down Expand Up @@ -373,8 +382,8 @@
"plan": {
"dev": "Developer plan",
"free": "Basic plan",
"getPro": "Get Pro",
"pro": "Pro plan",
"getPro": "Go /pro",
"pro": "/pro plan",
"trial": "Trial",
"trialEnded": "Your trial has ended",
"trialFeedback": "How was it?",
Expand All @@ -386,7 +395,7 @@
"plural": "{count} hours left in this trial",
"single": "1 hour left in this trial"
},
"tryPro": "Try Pro"
"tryPro": "Try /pro"
},
"preview": {
"actions": {
Expand All @@ -402,7 +411,7 @@
"label": "Lock source colors",
"preview": "Lock the source colors to include them in the palette",
"tag": "Locked",
"warning": "Upgrade to Pro to save a palette with locked source colors"
"warning": "Upgrade to /pro to save a palette with locked source colors"
},
"score": {
"apca": "Display APCA scores",
Expand All @@ -413,31 +422,31 @@
}
},
"pricing": {
"title": "Subscribe to UI Color Palette Pro",
"title": "Subscribe to UI Color Palette /pro",
"one": {
"cta": "Get your license",
"title": "UI Color Palette Pro /one",
"title": "UI Color Palette /pro /one",
"subtitle": "$5 /month via Lemon Squeezy",
"text": "Your multi-platform license working on:{br}◻ Figma{br}◻ Penpot{br}◻ Sketch{br}◻ Framer/Webflow (soon)"
},
"figma": {
"cta": "Get Pro for Figma only",
"title": "UI Color Palette Pro /figma",
"cta": "Go /pro for Figma only",
"title": "UI Color Palette /pro /figma",
"subtitle": "$5 /month via Figma",
"text": "◻ Unlimited palettes{br}◻ Unlimited source colors{br}◻ Unlimited stops{br}◻ Unlimited color modes{br}◻ Export and Sync with library"
}
},
"proPlan": {
"trial": {
"cta": "Enable the {hours}-hour trial",
"message": "Supercharge your primitive colors for {hours} hours with the Pro plan. You will be able to create more palette, manage your color modes, and export your palette to more formats.",
"option": "Get Pro directly",
"title": "Would you like to upgrade to the Pro plan within the next {hours} hours?"
"message": "Supercharge your primitive colors for {hours} hours with the /pro plan. You will be able to create more palette, manage your color modes, and export your palette to more formats.",
"option": "Go /pro directly",
"title": "Would you like to upgrade to the /pro plan within the next {hours} hours?"
},
"welcome": {
"cta": "Let's build",
"message": "This upgrade will unlock a range of tools that enable you to deploy and transfer your color palette. We hope you will enjoy the benefits.",
"title": "Welcome to UI Color Palette Pro!",
"title": "Welcome to UI Color Palette /pro!",
"trial": "This upgrade will unlock a range of tools that enable you to deploy and transfer your color palette. We hope you will enjoy the benefits for the next {hours} hours."
}
},
Expand Down Expand Up @@ -544,7 +553,7 @@
"shift": {
"chroma": {
"label": "Chroma",
"warning": "Upgrade to Pro to save a palette with a modified chroma shift. Reset it to 100% or upgrade."
"warning": "Upgrade to /pro to save a palette with a modified chroma shift. Reset it to 100% or upgrade."
}
},
"tips": {
Expand Down Expand Up @@ -604,7 +613,7 @@
"protanopia": "Protanopia (red-blind)",
"tritanomaly": "Tritanomaly (blue-weak)",
"tritanopia": "Tritanopia (blue-blind)",
"warning": "Update to Pro to save a palette with this vision simulation mode"
"warning": "Upgrade to /pro to save a palette with this vision simulation mode"
}
},
"contexts": {
Expand Down Expand Up @@ -795,7 +804,7 @@
},
"license": {
"messages": {
"activate": "Enter your license key to unlock the Pro features",
"activate": "Enter your license key to unlock the /pro features",
"active": "Valid",
"unactive": "Not valid"
},
Expand Down
4 changes: 2 additions & 2 deletions src/global.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Config } from './types/config'
import { locales } from './content/locales'

const isDev = import.meta.env.MODE === 'development'
declare const __APP_VERSION__: string

const globalConfig: Config = {
limits: {
Expand Down Expand Up @@ -74,7 +75,7 @@ const globalConfig: Config = {
trialVersion: '2024.03',
algorithmVersion: 'v3',
paletteVersion: '2025.06',
pluginVersion: import.meta.env.VITE_APP_VERSION,
pluginVersion: __APP_VERSION__,
},
features: doSpecificMode(
[
Expand All @@ -98,7 +99,6 @@ const globalConfig: Config = {
'PRESETS_POLARIS',
'PRESETS_CUSTOM_ADD',
'SCALE_CHROMA',
'SCALE_HELPER_DISTRIBUTION',
'THEMES',
'THEMES_NAME',
'THEMES_PARAMS',
Expand Down
4 changes: 4 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default defineConfig(({ mode }) => {
viteSingleFile(),
],

define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
},

resolve: {
alias: {
react: 'preact/compat',
Expand Down
Loading