diff --git a/package-lock.json b/package-lock.json index cc6b839..76d93cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "penpot-ui-color-palette", - "version": "5.0.0", + "version": "5.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "penpot-ui-color-palette", - "version": "5.0.0", + "version": "5.0.1", "license": "MIT", "workspaces": [ "packages/ui-ui-color-palette", @@ -16,9 +16,9 @@ "packages/ui-ui-color-palette/packages/announcements-yelbolt-worker" ], "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", @@ -60,9 +60,9 @@ } }, "node_modules/@a_ng_d/figmug-ui": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/@a_ng_d/figmug-ui/-/figmug-ui-1.16.0.tgz", - "integrity": "sha512-szCHoCNUgqNGH2YayvCVJLXNZ0lWgGaE4E01IxVnoRFlwonUQ7lu4s1e3WGaHbEyF79+xKmdudFaEbPeSgJivA==", + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/@a_ng_d/figmug-ui/-/figmug-ui-1.17.2.tgz", + "integrity": "sha512-gz61B8ZF28N2BbAgRebFp+tH9WmrDDfpP79gugtyNUp5QAjyQhMODvNSpKZ2DBjrDXmjesXZ4uY10xwz33xqZQ==", "license": "MIT", "dependencies": { "@a_ng_d/figmug-utils": "^0.6.0", @@ -85,9 +85,9 @@ "license": "MIT" }, "node_modules/@a_ng_d/utils-ui-color-palette": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@a_ng_d/utils-ui-color-palette/-/utils-ui-color-palette-1.6.2.tgz", - "integrity": "sha512-nq9sJ5lEQpcV0V7m7I+qULMsShLL8NNlyQ1/xaIfinAsdKHe3mc0jodhFL6oFgoDne9VEba1GGbrHq+OmNNJCQ==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@a_ng_d/utils-ui-color-palette/-/utils-ui-color-palette-1.6.3.tgz", + "integrity": "sha512-6P4P3Yn6JPd61xCeXmB7QvEulRbwE5eaUit99zRPA/27rL107GZ9yUelmk/6Q0wuJRbQgjO+mHgkt3rM+mDPiQ==", "license": "MIT", "dependencies": { "@a_ng_d/figmug-utils": "^0.4.0", @@ -9706,7 +9706,7 @@ } }, "packages/ui-ui-color-palette": { - "version": "1.7.3", + "version": "1.8.4", "license": "MIT", "workspaces": [ "packages/announcements-yelbolt-worker", @@ -9715,9 +9715,9 @@ "packages/auth-yelbolt/ui-color-palette" ], "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": "^9.27.0", "@supabase/supabase-js": "^2.44.2", diff --git a/package.json b/package.json index fe96cbe..121e412 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/packages/ui-ui-color-palette b/packages/ui-ui-color-palette index b28773c..e7b1c98 160000 --- a/packages/ui-ui-color-palette +++ b/packages/ui-ui-color-palette @@ -1 +1 @@ -Subproject commit b28773cd0fec6e86749045f6d5f3a09e262239cd +Subproject commit e7b1c988daea1038e4c870364a6969db9d6bbf24 diff --git a/src/bridges/checks/checkTrialStatus.ts b/src/bridges/checks/checkTrialStatus.ts index a1a2ef9..b9eea4b 100644 --- a/src/bridges/checks/checkTrialStatus.ts +++ b/src/bridges/checks/checkTrialStatus.ts @@ -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 @@ -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 diff --git a/src/bridges/loadUI.ts b/src/bridges/loadUI.ts index d6f1c5b..862f83b 100644 --- a/src/bridges/loadUI.ts +++ b/src/bridges/loadUI.ts @@ -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 @@ -272,6 +268,14 @@ 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', @@ -279,13 +283,15 @@ const loadUI = async () => { 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', diff --git a/src/content/translations/en-US.json b/src/content/translations/en-US.json index 896670e..3d265bc 100644 --- a/src/content/translations/en-US.json +++ b/src/content/translations/en-US.json @@ -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", @@ -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": { @@ -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", @@ -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?", @@ -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": { @@ -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", @@ -413,16 +422,16 @@ } }, "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" } @@ -430,14 +439,14 @@ "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." } }, @@ -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": { @@ -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": { @@ -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" }, diff --git a/src/global.config.ts b/src/global.config.ts index b187eab..b783b8e 100644 --- a/src/global.config.ts +++ b/src/global.config.ts @@ -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: { @@ -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( [ @@ -98,7 +99,6 @@ const globalConfig: Config = { 'PRESETS_POLARIS', 'PRESETS_CUSTOM_ADD', 'SCALE_CHROMA', - 'SCALE_HELPER_DISTRIBUTION', 'THEMES', 'THEMES_NAME', 'THEMES_PARAMS', diff --git a/vite.config.ts b/vite.config.ts index 63f6809..8366cca 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -35,6 +35,10 @@ export default defineConfig(({ mode }) => { viteSingleFile(), ], + define: { + __APP_VERSION__: JSON.stringify(process.env.npm_package_version), + }, + resolve: { alias: { react: 'preact/compat',