38 Commits

Author SHA1 Message Date
boskodev790
ea265da1f3
🐛 Fix plugin library.connectLibrary breaking Promise contract on permission failure (#9158)
`library.connectLibrary()` declared its permission check **outside** the
`js/Promise.` wrapper, so when a plugin without `library:write` permission
called `await library.connectLibrary(id)` the method did not return a
`Promise` at all:

- With the default `throwValidationErrors` flag off → `u/not-valid`
  logs to console and returns `nil`. `await nil` resolves to `nil`, so
  the plugin sees a "successful" result and crashes later when it tries
  to use methods on what it thinks is a `LibraryProxy`.
- With `throwValidationErrors` on → `u/not-valid` throws synchronously,
  so the caller gets a thrown exception instead of a rejected promise —
  inconsistent with every other `library:*` / `content:*` method which
  always returns a Promise that rejects via `reject-not-valid`.

Additionally, the in-Promise `(not (string? library-id))` branch used
`(reject nil)` — the plugin got a rejected Promise but with no error
message.

Move the permission check inside the Promise constructor and replace
both validation errors with `u/reject-not-valid`, matching the pattern
used by the sibling methods `restore`, `remove`, `pin`, `saveVersion`,
`findVersions` in `frontend/src/app/plugins/file.cljs` and every other
promise-returning plugin method. No new imports.

Also add a CHANGES.md entry under the 2.17.0 Unreleased bugs-fixed section.

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2026-04-27 17:59:09 +02:00
alonso.torres
a1a469449e Add throwValidationErrors flag for plugins 2026-03-19 15:37:08 +01:00
Andrey Antukh
9dfe5b0865 🐛 Fix inconsistencies on using obj/reify on plugins 2025-12-09 11:13:06 +01:00
Alonso Torres
2f0853f5cc
🐛 Fix problem with variant plugins api (#7890) 2025-12-03 13:27:32 +01:00
Andrés Moya
3cc54fd988
🎉 Add design tokens to plugins API (#7602)
Co-authored-by: alonso.torres <alonso.torres@kaleidos.net>
2025-11-14 11:14:56 +01:00
Pablo Alba
04542e1e66
Add variants to plugins API 2025-10-23 10:52:10 +02:00
Andrey Antukh
9ee488009f ♻️ Add substantial refactor on how types are organized
This mainly affects types related to colors, fills and texts, moving library
based operations from color namespace.
2025-07-23 08:03:23 +02:00
Andrey Antukh
7160334cb9 ♻️ Add stricter validation for colors, fills and strokes 2025-06-04 12:46:49 +02:00
Miguel de Benito Delgado
71bb2556f9
♻️ Move page setup out of the data.workspace ns (#6502)
* ♻️ Split history workspace.cljs to workspace/pages.cljs - rename file to target-name

* ♻️ Split history workspace.cljs to workspace/pages.cljs - rename source-file to git-split-temp

* ♻️ Split history workspace.cljs to workspace/pages.cljs - restore name of source-file

* ♻️ Cleanup after adding new ns, add exports

* ♻️ Move set-plugin-data to main.data.plugins

* 🐛 Possible bugfix, cherry-picked from commit 8f7c63d6e2c (conflict during refactor)

---------

Co-authored-by: Eva Marco <eva.marco@kaleidos.net>
2025-05-20 22:11:05 +02:00
Andrey Antukh
bb80da137d Merge remote-tracking branch 'origin/staging' into develop 2025-04-15 12:10:53 +02:00
Andrey Antukh
38e5c161e7 Sanitize plugins uuid parsing 2025-04-11 13:21:26 +02:00
Pablo Alba
b6c4376217
🐛 Fix bugs from varaints design review 2025-03-28 11:20:10 +01:00
alonso.torres
9c626d22c7 🐛 Fix problem in plugins with renaming components 2025-02-05 17:43:01 +01:00
Andrey Antukh
402eacdb22 Merge remote-tracking branch 'origin/staging' into develop 2025-01-20 12:38:23 +01:00
alonso.torres
f553fa10d8 🐛 Fix problem in plugins with replaceColor method 2025-01-20 12:02:54 +01:00
Andrey Antukh
85746e7cb2 ♻️ Refactor state locality
The main purpose of this refactor is reduce
a custom state from different pages and unify
them under common access patterns
2025-01-16 15:31:18 +01:00
Andrey Antukh
c3d4444c0c Merge remote-tracking branch 'origin/staging' into niwinz-merge-staging-1 2025-01-14 10:35:34 +01:00
alonso.torres
58dd23f9c7 🐛 Fix problem when changing color libraries 2025-01-10 12:33:16 +01:00
Andrey Antukh
e5894ceea1 ♻️ Rename workspace-libraries to libraries on state and refs 2024-12-10 14:45:56 +01:00
Pablo Alba
f72c37a198 Add events for use library assets 2024-11-28 11:25:12 +01:00
alonso.torres
eccc4226c7 Migrate proxies to new format 2024-11-27 08:32:07 +01:00
alonso.torres
6c0dce580d 🐛 Fix problem with promises in plugins 2024-11-04 17:12:45 +01:00
alonso.torres
be84b1cb01 🐛 Change place for circular dependency workaround 2024-09-03 13:10:28 +02:00
alonso.torres
395a91c00c Plugins permissions review 2024-07-02 11:01:43 +02:00
alonso.torres
ac58a5b8fa Improved transformation from and to JS for plugins 2024-07-02 10:41:06 +02:00
alonso.torres
4345584384 🐛 Fix problem with recursive properties 2024-06-28 14:57:14 +02:00
alonso.torres
8ff0015458 Add to plugins connect and fetch libraries 2024-06-24 12:34:35 +02:00
alonso.torres
7fd223893b Expose component properties in components 2024-06-21 09:29:09 +02:00
alonso.torres
1794859468 Review input validation for plugins 2024-06-21 09:29:09 +02:00
alonso.torres
c5c8be4b4a Improve input validation in plugins 2024-06-21 09:29:09 +02:00
alonso.torres
2da5dcb619 Add text ranges support in plugins 2024-06-21 09:29:09 +02:00
alonso.torres
5233654da2 Add support for plugin data into penpot objects 2024-06-10 15:12:51 +02:00
alonso.torres
e4e537b960 Add support for components in plugins 2024-06-04 16:44:24 +02:00
alonso.torres
3209511557 Add support for colors and typographies 2024-06-04 16:44:24 +02:00
alonso.torres
007ab3d909 Add library edition mode for plugins 2024-05-29 12:54:49 +02:00
alonso.torres
dcb6315ff6 🐛 Fix problem with minification 2024-05-21 19:53:09 +02:00
alonso.torres
3ca5b13e27 New apis for plugins 2024-05-21 15:24:28 +02:00
alonso.torres
4c71a4367f Add plugins management dialog 2024-05-16 12:26:19 +02:00