Compare commits

...

3 Commits

Author SHA1 Message Date
Eva Marco
ce76fa8049 🐛 Fix unhandled error 2026-01-22 13:30:51 +01:00
Alonso Torres
656f81f89f ⬆️ Update plugins to 1.4.2 (#8157) 2026-01-21 17:36:58 +01:00
Alonso Torres
01a4ffeb8b ⬆️ Updated plugins release to 1.4.0 (#8148) 2026-01-21 15:41:00 +01:00
18 changed files with 134 additions and 99 deletions

View File

@@ -124,8 +124,6 @@
(throw (IllegalArgumentException. "invalid email body provided")))
(doseq [[name content] attachments]
(prn "attachment" name)
(let [attachment-part (MimeBodyPart.)]
(.setFileName attachment-part ^String name)
(.setContent attachment-part ^String content (str "text/plain; charset=" charset))

View File

@@ -54,7 +54,7 @@
"devDependencies": {
"@penpot/draft-js": "portal:./packages/draft-js",
"@penpot/mousetrap": "portal:./packages/mousetrap",
"@penpot/plugins-runtime": "1.3.2",
"@penpot/plugins-runtime": "1.4.2",
"@penpot/svgo": "penpot/svgo#v3.2",
"@penpot/text-editor": "portal:./text-editor",
"@playwright/test": "1.57.0",

View File

@@ -126,7 +126,7 @@
If the `value` is not parseable and/or has missing references returns a map with `:errors`.
If the `value` is parseable but is out of range returns a map with `warnings`."
[value]
(let [missing-references? (seq (seq (cto/find-token-value-references value)))
(let [missing-references? (seq (cto/find-token-value-references value))
parsed-value (cft/parse-token-value value)
out-of-scope (not (<= 0 (:value parsed-value) 1))
references (seq (cto/find-token-value-references value))]
@@ -152,15 +152,14 @@
[value]
(let [missing-references? (seq (cto/find-token-value-references value))
parsed-value (cft/parse-token-value value)
out-of-scope (< (:value parsed-value) 0)
references (seq (cto/find-token-value-references value))]
out-of-scope (< (:value parsed-value) 0)]
(cond
(and parsed-value (not out-of-scope))
parsed-value
references
{:errors [(wte/error-with-value :error.style-dictionary/missing-reference references)]
:references references}
missing-references?
{:errors [(wte/error-with-value :error.style-dictionary/missing-reference missing-references?)]
:references missing-references?}
(and (not missing-references?) out-of-scope)
{:errors [(wte/error-with-value :error.style-dictionary/invalid-token-value-stroke-width value)]}

View File

@@ -202,7 +202,6 @@
on-restore-immediately
(fn []
(prn files)
(st/emit!
(modal/show {:type :confirm
:title (tr "dashboard-restore-file-confirmation.title")

View File

@@ -53,10 +53,12 @@
(defn- resolve-value
[tokens prev-token value]
[tokens prev-token token-name value]
(let [token
{:value value
:name "__PENPOT__TOKEN__NAME__PLACEHOLDER__"}
:name (if (str/blank? token-name)
"__PENPOT__TOKEN__NAME__PLACEHOLDER__"
token-name)}
tokens
(-> tokens
@@ -131,6 +133,7 @@
(let [form (mf/use-ctx fc/context)
input-name name
token-name (get-in @form [:data :name] nil)
touched?
@@ -260,10 +263,10 @@
:else
props)]
(mf/with-effect [resolve-stream tokens token input-name]
(mf/with-effect [resolve-stream tokens token input-name token-name]
(let [subs (->> resolve-stream
(rx/debounce 300)
(rx/mapcat (partial resolve-value tokens token))
(rx/mapcat (partial resolve-value tokens token token-name))
(rx/map (fn [result]
(d/update-when result :error
(fn [error]
@@ -309,7 +312,7 @@
(let [form (mf/use-ctx fc/context)
input-name name
token-name (get-in @form [:data :name] nil)
error
(get-in @form [:errors :value value-subfield index input-name])
@@ -422,10 +425,10 @@
:hint-message (:message error)})
props)]
(mf/with-effect [resolve-stream tokens token input-name index value-subfield]
(mf/with-effect [resolve-stream tokens token input-name index value-subfield token-name]
(let [subs (->> resolve-stream
(rx/debounce 300)
(rx/mapcat (partial resolve-value tokens token))
(rx/mapcat (partial resolve-value tokens token token-name))
(rx/map (fn [result]
(d/update-when result :error
(fn [error]

View File

@@ -49,10 +49,12 @@
;; validate data within the form state.
(defn- resolve-value
[tokens prev-token value]
[tokens prev-token token-name value]
(let [token
{:value (cto/split-font-family value)
:name "__PENPOT__TOKEN__NAME__PLACEHOLDER__"}
:name (if (str/blank? token-name)
"__PENPOT__TOKEN__NAME__PLACEHOLDER__"
token-name)}
tokens
(-> tokens
@@ -73,6 +75,7 @@
[{:keys [token tokens name] :rest props}]
(let [form (mf/use-ctx fc/context)
input-name name
token-name (get-in @form [:data :name] nil)
touched?
(and (contains? (:data @form) input-name)
@@ -152,10 +155,10 @@
:hint-message (:message error)})
props)]
(mf/with-effect [resolve-stream tokens token input-name touched?]
(mf/with-effect [resolve-stream tokens token input-name touched? token-name]
(let [subs (->> resolve-stream
(rx/debounce 300)
(rx/mapcat (partial resolve-value tokens token))
(rx/mapcat (partial resolve-value tokens token token-name))
(rx/map (fn [result]
(d/update-when result :error
(fn [error]
@@ -200,7 +203,7 @@
[{:keys [token tokens name] :rest props}]
(let [form (mf/use-ctx fc/context)
input-name name
token-name (get-in @form [:data :name] nil)
error
(get-in @form [:errors :value input-name])
@@ -276,10 +279,10 @@
:hint-message (:message error)})
props)]
(mf/with-effect [resolve-stream tokens token input-name]
(mf/with-effect [resolve-stream tokens token input-name token-name]
(let [subs (->> resolve-stream
(rx/debounce 300)
(rx/mapcat (partial resolve-value tokens token))
(rx/mapcat (partial resolve-value tokens token token-name))
(rx/map (fn [result]
(d/update-when result :error
(fn [error]

View File

@@ -139,10 +139,12 @@
(defn- resolve-value
[tokens prev-token value]
[tokens prev-token token-name value]
(let [token
{:value value
:name "__PENPOT__TOKEN__NAME__PLACEHOLDER__"}
:name (if (str/blank? token-name)
"__PENPOT__TOKEN__NAME__PLACEHOLDER__"
token-name)}
tokens
(-> tokens
;; Remove previous token when renaming a token
@@ -163,6 +165,7 @@
(let [form (mf/use-ctx fc/context)
input-name name
token-name (get-in @form [:data :name] nil)
touched?
(and (contains? (:data @form) input-name)
@@ -206,11 +209,11 @@
:hint-message (:message error)})
props)]
(mf/with-effect [resolve-stream tokens token input-name]
(mf/with-effect [resolve-stream tokens token input-name token-name]
(let [subs (->> resolve-stream
(rx/debounce 300)
(rx/mapcat (partial resolve-value tokens token))
(rx/mapcat (partial resolve-value tokens token token-name))
(rx/map (fn [result]
(d/update-when result :error
(fn [error]
@@ -252,6 +255,7 @@
(let [form (mf/use-ctx fc/context)
input-name name
token-name (get-in @form [:data :name] nil)
error
(get-in @form [:errors :value input-name])
@@ -298,10 +302,10 @@
(mf/spread-props props {:hint-formated true})
props)]
(mf/with-effect [resolve-stream tokens token input-name name]
(mf/with-effect [resolve-stream tokens token input-name name token-name]
(let [subs (->> resolve-stream
(rx/debounce 300)
(rx/mapcat (partial resolve-value tokens token))
(rx/mapcat (partial resolve-value tokens token token-name))
(rx/map (fn [result]
(d/update-when result :error
(fn [error]
@@ -365,7 +369,7 @@
(let [form (mf/use-ctx fc/context)
input-name name
token-name (get-in @form [:data :name] nil)
error
(get-in @form [:errors :value value-subfield index input-name])
@@ -410,10 +414,10 @@
(mf/spread-props props {:hint-formated true})
props)]
(mf/with-effect [resolve-stream tokens token input-name index value-subfield]
(mf/with-effect [resolve-stream tokens token input-name index value-subfield token-name]
(let [subs (->> resolve-stream
(rx/debounce 300)
(rx/mapcat (partial resolve-value tokens token))
(rx/mapcat (partial resolve-value tokens token token-name))
(rx/map (fn [result]
(d/update-when result :error
(fn [error]

View File

@@ -23,19 +23,20 @@
(let [token-type
(or (:type token) token-type)
tokens-in-selected-set
(mf/deref refs/workspace-all-tokens-in-selected-set)
token-path
(mf/with-memo [token]
(cft/token-name->path (:name token)))
all-tokens (mf/deref refs/workspace-all-tokens-map)
all-tokens
(mf/with-memo [token-path all-tokens]
(-> (ctob/tokens-tree all-tokens)
tokens-tree-in-selected-set
(mf/with-memo [token-path tokens-in-selected-set]
(-> (ctob/tokens-tree tokens-in-selected-set)
(d/dissoc-in token-path)))
props
(mf/spread-props props {:token-type token-type
:all-token-tree all-tokens
:tokens-tree-in-selected-set tokens-tree-in-selected-set
:token token})
text-case-props (mf/spread-props props {:input-value-placeholder (tr "workspace.tokens.text-case-value-enter")})
text-decoration-props (mf/spread-props props {:input-value-placeholder (tr "workspace.tokens.text-decoration-value-enter")})

View File

@@ -86,7 +86,7 @@
action
is-create
selected-token-set-id
all-token-tree
tokens-tree-in-selected-set
token-type
make-schema
input-component
@@ -111,8 +111,7 @@
token-title (str/lower (:title token-properties))
tokens
(mf/deref refs/workspace-active-theme-sets-tokens)
tokens (mf/deref refs/workspace-all-tokens-map)
tokens
(mf/with-memo [tokens token]
@@ -124,8 +123,8 @@
(assoc (:name token) token)))
schema
(mf/with-memo [all-token-tree active-tab]
(make-schema all-token-tree active-tab))
(mf/with-memo [tokens-tree-in-selected-set active-tab]
(make-schema tokens-tree-in-selected-set active-tab))
initial
(mf/with-memo [token]
@@ -208,11 +207,11 @@
:value (:value valid-token)
:description description}))
(dwtp/propagate-workspace-tokens)
(modal/hide)))))
(fn [{:keys [errors]}]
(let [error-messages (wte/humanize-errors errors)
error-message (first error-messages)]
(swap! form assoc-in [:extra-errors :value] {:message error-message}))))))]
(modal/hide)))
(fn [{:keys [errors]}]
(let [error-messages (wte/humanize-errors errors)
error-message (first error-messages)]
(swap! form assoc-in [:extra-errors :value] {:message error-message}))))))))]
[:> fc/form* {:class (stl/css :form-wrapper)
:form form

View File

@@ -1191,21 +1191,21 @@ __metadata:
languageName: node
linkType: soft
"@penpot/plugin-types@npm:^1.3.2":
version: 1.3.2
resolution: "@penpot/plugin-types@npm:1.3.2"
checksum: 10c0/3f624472c260721ad89bf8d944e75acf6a9c9577271a757acb77574102213914051d1a32d5ab16e6ba16ae077fff78cf7a0f6d11d18351dfc214426677a67468
"@penpot/plugin-types@npm:^1.4.2":
version: 1.4.2
resolution: "@penpot/plugin-types@npm:1.4.2"
checksum: 10c0/b0972fe75c97e697eb1044c89db660393886b3c30676f8436ff4ab56c5bf0397b2c675697ae1b9c5fe40bc95a803aecf6d7ac356dbf6d3535bf8baec5d05eab1
languageName: node
linkType: hard
"@penpot/plugins-runtime@npm:1.3.2":
version: 1.3.2
resolution: "@penpot/plugins-runtime@npm:1.3.2"
"@penpot/plugins-runtime@npm:1.4.2":
version: 1.4.2
resolution: "@penpot/plugins-runtime@npm:1.4.2"
dependencies:
"@penpot/plugin-types": "npm:^1.3.2"
"@penpot/plugin-types": "npm:^1.4.2"
ses: "npm:^1.1.0"
zod: "npm:^3.22.4"
checksum: 10c0/b6d2cb3a57bcbe58232db52b8224d1817495e96b34997bfa72421629b5f34a8c9cc71357c315dcab9d52ea036ed632a5efe0ac50f52e730901c02d498dfa1313
checksum: 10c0/af084d906cce9a6dea956fe5420111d7ea37c7620737a1e3d4f12958cb302a8f697c1229c237107c28fbb3b9f37eee308e6d16262b04ad56ae6f76c7a12f12e5
languageName: node
linkType: hard
@@ -4176,7 +4176,7 @@ __metadata:
dependencies:
"@penpot/draft-js": "portal:./packages/draft-js"
"@penpot/mousetrap": "portal:./packages/mousetrap"
"@penpot/plugins-runtime": "npm:1.3.2"
"@penpot/plugins-runtime": "npm:1.4.2"
"@penpot/svgo": "penpot/svgo#v3.2"
"@penpot/text-editor": "portal:./text-editor"
"@playwright/test": "npm:1.57.0"

View File

@@ -1,3 +1,38 @@
## 1.4.2 (2026-01-21)
- **plugin-types:** fix atob/btoa functions
## 1.4.0 (2026-01-21)
### 🚀 Features
- switch component ([7d68450](https://github.com/penpot/penpot-plugins/commit/7d68450))
- Add variants to plugins API ([04f3c26](https://github.com/penpot/penpot-plugins/commit/04f3c26))
- format ci job ([17b5834](https://github.com/penpot/penpot-plugins/commit/17b5834))
- fix problem with ci ([4b3c50f](https://github.com/penpot/penpot-plugins/commit/4b3c50f))
- change in workflow ([3a69f51](https://github.com/penpot/penpot-plugins/commit/3a69f51))
- **plugin-types:** add methods to modify the index for shapes ([4ad50af](https://github.com/penpot/penpot-plugins/commit/4ad50af))
- **plugin-types:** change content type and added new attributes ([dbb68a5](https://github.com/penpot/penpot-plugins/commit/dbb68a5))
- **plugins-runtime:** add data method to image data ([f077481](https://github.com/penpot/penpot-plugins/commit/f077481))
- **plugins-runtime:** fix problem with linter ([30f4984](https://github.com/penpot/penpot-plugins/commit/30f4984))
- **plugins-runtime:** allow openPage() to toggle opening on a new window or not ([da8288b](https://github.com/penpot/penpot-plugins/commit/da8288b))
### 🩹 Fixes
- package-lock.json ([d1d940a](https://github.com/penpot/penpot-plugins/commit/d1d940a))
- fonts gdpr & switch provider ([d63231e](https://github.com/penpot/penpot-plugins/commit/d63231e))
- missing changes ([b8fc936](https://github.com/penpot/penpot-plugins/commit/b8fc936))
- format ci ([e0fab2e](https://github.com/penpot/penpot-plugins/commit/e0fab2e))
- fetch main only in pr ([e48c5d4](https://github.com/penpot/penpot-plugins/commit/e48c5d4))
### ❤️ Thank You
- alonso.torres
- Juanfran @juanfran
- Michał Korczak
- Miguel de Benito Delgado
- Pablo Alba
## 1.3.2 (2025-07-04)
### 🩹 Fixes

View File

@@ -7,6 +7,29 @@ This guide details the process of publishing `plugin-types`,
for plugin development. Below is a walkthrough for publishing these
packages and managing releases.
**Warning**
Before generating the release, please, check the update the changelog with
the changes that will be released.
## Problem with pnpm
There is an issue with dependencies and release with pnpm. For it to work
you need to add the following into your `.npmrc`
```
link-workspace-packages=true
```
## NPM Authentication
You need to generate a temporary access token in the NPM website.
Once you have the token add the following to the `.npmrc`
```
//registry.npmjs.org/:_authToken=<TOKEN>
```
## Publishing Libraries
Publishing packages enables the distribution of types and styles
@@ -35,28 +58,16 @@ pnpm run release -- --dry-run false
This command will:
- Update the `CHANGELOG.md`
- Update the library's `package.json` version
- Generate a commit
- Create a new git tag
- Publish to NPM with the `latest` tag
Ensure everything is correct before proceeding with the git push. Once
verified, execute the following commands:
```shell
git commit -m ":arrow_up: Updated plugins release to X.X.X"
git push
git push origin vX.X.X
```
Replace `vX.X.X` with the new version number.
> 📘 To update the documentation site, you must also update the `stable` branch:
```shell
git checkout stable
git merge main
git push origin stable
```
For detailed information, refer to the [Nx Release

View File

@@ -1,6 +1,6 @@
{
"name": "@penpot/plugin-types",
"version": "1.3.2",
"version": "1.4.2",
"typings": "./index.d.ts",
"type": "module"
}

View File

@@ -1,8 +1,8 @@
{
"name": "@penpot/plugins-runtime",
"version": "1.3.2",
"version": "1.4.2",
"dependencies": {
"@penpot/plugin-types": "^1.3.2",
"@penpot/plugin-types": "^1.4.2",
"ses": "^1.1.0",
"zod": "^3.22.4"
},

View File

@@ -118,8 +118,8 @@ export function createSandbox(
// Window properties
console: ses.harden(window.console),
devicePixelRatio: ses.harden(window.devicePixelRatio),
atob: ses.harden(window.atob),
btoa: ses.harden(window.btoa),
atob: ses.harden(window.atob.bind(null)),
btoa: ses.harden(window.btoa.bind(null)),
structuredClone: ses.harden(window.structuredClone),
};

View File

@@ -1,5 +1,5 @@
{
"name": "@penpot/plugin-styles",
"version": "1.3.2",
"version": "1.4.2",
"dependencies": {}
}

14
plugins/pnpm-lock.yaml generated
View File

@@ -230,8 +230,8 @@ importers:
libs/plugins-runtime:
dependencies:
'@penpot/plugin-types':
specifier: ^1.3.2
version: 1.3.2
specifier: ^1.4.2
version: link:../plugin-types
ses:
specifier: ^1.1.0
version: 1.14.0
@@ -4200,12 +4200,6 @@ packages:
}
engines: { node: '>= 10.0.0' }
'@penpot/plugin-types@1.3.2':
resolution:
{
integrity: sha512-f0kmmZaFNs9sGtSmqmSJQYCs5Qt+KYgTD8RneUjL+Dv+zfNQnd5e4L+iHSYFJ4HWvcDvTiK7F/gya7PwMTu7WA==,
}
'@phenomnomnominal/tsquery@5.0.1':
resolution:
{
@@ -13194,6 +13188,7 @@ packages:
integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==,
}
engines: { node: '>=10' }
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting i@izs.me
tar@7.5.2:
resolution:
@@ -13201,6 +13196,7 @@ packages:
integrity: sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg==,
}
engines: { node: '>=18' }
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting i@izs.me
terser-webpack-plugin@5.3.16:
resolution:
@@ -18203,8 +18199,6 @@ snapshots:
'@parcel/watcher-win32-x64': 2.5.1
optional: true
'@penpot/plugin-types@1.3.2': {}
'@phenomnomnominal/tsquery@5.0.1(typescript@5.6.3)':
dependencies:
esquery: 1.6.0

View File

@@ -69,17 +69,6 @@ const determineArgs = async () => {
},
);
await releaseChangelog({
dryRun: args.dryRun,
versionData: result.projectsVersionData,
version: result.workspaceVersion,
gitCommitMessage: `chore(release): publish ${result.workspaceVersion} [skip ci]`,
gitCommit: true,
gitTag: true,
verbose: args.verbose,
firstRelease: args.firstRelease,
});
if (!args.skipPublish) {
await releasePublish({
dryRun: args.dryRun,