Compare commits

..

25 Commits
2.3.0 ... 2.3.3

Author SHA1 Message Date
Praveen Juge
3cdbd7f381 📚 Fix spelling: change assents to assets 2024-11-15 09:50:44 +01:00
Andrey Antukh
76caff2b61 Merge pull request #5313 from penpot/alotor-bugfixes-enable-plugins-default
🐛 Activate plugin feature by default
2024-11-15 09:46:59 +01:00
alonso.torres
a58ad2298a 🐛 Activate plugin feature by default 2024-11-15 09:04:59 +01:00
Andrey Antukh
6b9f7e9922 Merge pull request #5308 from penpot/alotor-fix-default-url-plugins
🐛 Fix default plugin list url
2024-11-14 18:21:56 +01:00
alonso.torres
63ee99d46c 🐛 Fix default plugin list url 2024-11-14 17:34:49 +01:00
Andrey Antukh
6b7665947e Merge branch 'ElenaMLopez-patch-1' into staging 2024-11-13 12:35:21 +01:00
Elena Mateos López
4f7659fbf8 📚 Update frontend.md
Fix a typo from `comonents` to `components` in the UI namespaces section, at settings.  :)
2024-11-13 12:34:58 +01:00
Alejandro
d2f30d2b12 Merge pull request #5292 from penpot/palba-revert-open-modal-extra-event
Revert " Send event when an user opens a modal"
2024-11-13 09:34:32 +01:00
Pablo Alba
ccaadeb582 Revert " Send event when an user opens a modal"
This reverts commit 70a1a7a5ea.
2024-11-13 09:30:56 +01:00
trungly1
f1941681ab 📚 Update getting-started.md 2024-11-12 11:36:31 +01:00
Andrey Antukh
9d0ca089fe Merge pull request #5282 from penpot/alotor-hotfix-interactions
🐛 Fix problem creating manual overlay interactions
2024-11-11 23:55:41 +01:00
alonso.torres
2fa81474b9 🐛 Fix problem creating manual overlay interactions 2024-11-11 16:06:37 +01:00
Andrey Antukh
e369b70aeb Merge pull request #5279 from penpot/alotor-hotfix-grid-problem
🐛 Fix problem with grid layout ordering after moving
2024-11-11 12:48:40 +01:00
alonso.torres
c3970255e6 🐛 Fix problem with grid layout ordering after moving 2024-11-11 12:34:07 +01:00
Andrey Antukh
7823eaf890 📎 Update changelog 2024-11-11 12:08:49 +01:00
Andrey Antukh
ec0079461e Merge pull request #5262 from penpot/palba-add-libraries-dialog-event
 Send event when an user opens a modal
2024-11-07 20:52:52 +01:00
Pablo Alba
70a1a7a5ea Send event when an user opens a modal 2024-11-07 16:27:16 +01:00
Andrey Antukh
c3dc165c4c Merge pull request #5241 from penpot/bameda-docs-kubernetes-setup
📚 Add documentation to install with Kubernetes
2024-11-07 10:33:49 +01:00
David Barragán Merino
5a3619c737 📚 Add documentation to install with Kubernetes 2024-11-06 14:55:41 +01:00
Pablo Alba
227f06c1ec Merge pull request #5255 from penpot/niwinz-bugfix-1
🐛 Fix null pointer exception on validating nil with number schema
2024-11-06 09:36:14 +01:00
Andrey Antukh
946dac3c9f 🐛 Fix NPE on number schemas
Mainly, without this fix, happens the following:

user=> (sm/validate [::sm/int {:min 0}] nil)
Execution error (NullPointerException) at app.common.schema/fn$fn (schema.cljc:692).
Cannot invoke "Object.getClass()" because "x" is null

And it should return `false` without an exception.
2024-11-06 09:15:06 +01:00
Andrey Antukh
b160ba1793 📎 Update .gitignore 2024-11-06 09:14:47 +01:00
Andrey Antukh
33d51a51d1 📚 Update changelog 2024-11-04 17:29:52 +01:00
Andrey Antukh
ab4be85669 Merge pull request #5250 from penpot/alotor-hotfix-plugins-api-problem
🐛 Fix problem with promises in plugins
2024-11-04 17:27:41 +01:00
alonso.torres
6c0dce580d 🐛 Fix problem with promises in plugins 2024-11-04 17:12:45 +01:00
17 changed files with 218 additions and 55 deletions

2
.gitignore vendored
View File

@@ -74,3 +74,5 @@ node_modules
/playwright-report/
/blob-report/
/playwright/.cache/
/render-wasm/target/
/**/.yarn/*

View File

@@ -1,5 +1,33 @@
# CHANGELOG
## 2.3.3
### :bug: Bugs fixed
- Fix problem creating manual overlay interactions [Taiga #9146](https://tree.taiga.io/project/penpot/issue/9146)
- Fix plugins list default URL
- Activate plugins feature by default
## 2.3.2
### :bug: Bugs fixed
- Fix null pointer exception on number checking functions
- Fix problem with grid layout ordering after moving [Taiga #9179](https://tree.taiga.io/project/penpot/issue/9179)
### :books: Documentation
- Add initial documentation for Kubernetes
## 2.3.1
### :bug: Bugs fixed
- Fix unexpected issue on interaction between plugins sandbox and
internal impl of promise
## 2.3.0
### :rocket: Epics and highlights

View File

@@ -57,7 +57,8 @@
#{"fdata/shape-data-type"
"styles/v2"
"layout/grid"
"components/v2"})
"components/v2"
"plugins/runtime"})
;; A set of features which only affects on frontend and can be enabled
;; and disabled freely by the user any time. This features does not

View File

@@ -391,13 +391,14 @@
(-> (pcb/update-shapes
[parent-id]
(fn [frame objects]
(-> frame
;; Assign the cell when pushing into a specific grid cell
(cond-> (some? cell)
(-> (ctl/free-cell-shapes ids)
(ctl/push-into-cell ids (:row cell) (:column cell))
(ctl/assign-cells objects)))
(ctl/assign-cell-positions objects)))
(let [[row column] cell]
(-> frame
;; Assign the cell when pushing into a specific grid cell
(cond-> (some? cell)
(-> (ctl/free-cell-shapes ids)
(ctl/push-into-cell ids row column)
(ctl/assign-cells objects)))
(ctl/assign-cell-positions objects))))
{:with-objects? true})
(pcb/reorder-grid-children [parent-id])))

View File

@@ -681,8 +681,8 @@
(let [pred int?
pred (if (some? min)
(fn [v]
(and (>= v min)
(pred v)))
(and (pred v)
(>= v min)))
pred)
pred (if (some? max)
(fn [v]
@@ -719,8 +719,8 @@
(let [pred double?
pred (if (some? min)
(fn [v]
(and (>= v min)
(pred v)))
(and (pred v)
(>= v min)))
pred)
pred (if (some? max)
(fn [v]
@@ -749,8 +749,8 @@
(let [pred number?
pred (if (some? min)
(fn [v]
(and (>= v min)
(pred v)))
(and (pred v)
(>= v min)))
pred)
pred (if (some? max)
(fn [v]

View File

@@ -65,7 +65,7 @@ You will be able to share your plugin with the <a target="_blank" href="https://
### My plugin works on my local machine, but I couldnt install it on Penpot. What could be the problem?
The url you that you need to provide in the plugin manager should look <a target="_blank" href="/plugins/create-a-plugin/#2.6.-step-6.-configure-the-manifest-file">like this</a>: <code class="language-bash">https:\/\/yourdomain.com/assents/manifest.json</code>
The url you that you need to provide in the plugin manager should look <a target="_blank" href="/plugins/create-a-plugin/#2.6.-step-6.-configure-the-manifest-file">like this</a>: <code class="language-bash">https:\/\/yourdomain.com/assets/manifest.json</code>
### Where can I get support if I find a bug or an unexpected behavior?

View File

@@ -157,7 +157,7 @@ Rel(ui_viewer, data_viewer, "Uses")
* **auth** has the web components for the login, register, password recover,
etc. screens.
* **settings** has the web comonents for the user profile and settings screens.
* **settings** has the web components for the user profile and settings screens.
* **dashboard** has the web components for the dashboard and its subsections.

View File

@@ -256,6 +256,142 @@ Postgres database and another one for the assets uploaded by your users (images
clips). There may be more volumes if you enable other features, as explained in the file
itself.
## Install with Kubernetes
This section details everything you need to know to get Penpot up and running in
production environments using a Kubernetes cluster of your choice. To do this, we have
created a <a href="https://helm.sh/" target="_blank">Helm<a> repository with everything
you need.
Therefore, your prerequisite will be to have a Kubernetes cluster on which we can install
Helm.
### What is Helm
*Helm* is the package manager for Kubernetes. A *Chart* is a Helm package. It contains
all of the resource definitions necessary to run an application, tool, or service inside
of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew
formula, an Apt dpkg, or a Yum RPM file.
A Repository is the place where charts can be collected and shared. It's like Perl's CPAN
archive or the Fedora Package Database, but for Kubernetes packages.
A Release is an instance of a chart running in a Kubernetes cluster. One chart can often
be installed many times into the same cluster. And each time it is installed, a new
release is created. Consider a MySQL chart. If you want two databases running in your
cluster, you can install that chart twice. Each one will have its own release, which will
in turn have its own release name.
With these concepts in mind, we can now explain Helm like this:
> Helm installs charts into Kubernetes clusters, creating a new release for each
> installation. And to find new charts, you can search Helm chart repositories.
### Install Helm
<p class="advice">
Skip this section if you already have Helm installed in your system.
</p>
You can install Helm by following the <a href="https://helm.sh/docs/intro/install/" target="_blank">official guide</a>.
There are different ways to install Helm, depending on your infrastructure and operating
system.
### Add Penpot repository
To add the Penpot Helm repository, run the following command:
```bash
helm repo add penpot http://helm.penpot.app
```
This will add the Penpot repository to your Helm configuration, so you can install all
the Penpot charts stored there.
### Install Penpot Chart
To install the chart with the release name `my-release`:
```bash
helm install my-release penpot/penpot
```
You can customize the installation specify each parameter using the `--set key=value[,key=value]`
argument to helm install. For example,
```bash
helm install my-release \
--set global.postgresqlEnabled=true \
--set global.redisEnabled=true \
--set persistence.assets.enabled=true \
penpot/penpot
```
Alternatively, a YAML file that specifies the values for the above parameters can be
provided while installing the chart. For example,
```bash
helm install my-release -f values.yaml penpot/penpot
```
### Configure Penpot with Helm Chart
In the previous section we have shown how to configure penpot during installation by
using parameters or by using a yaml file.
The default values are defined in the
<a href="https://github.com/penpot/penpot-helm/blob/main/charts/penpot/values.yaml" target="_blank">`values.yml`</a>
file itself, which you can use as a basis for creating your own settings.
You can also consult the list of parameters on the
<a href="https://artifacthub.io/packages/helm/penpot/penpot#parameters" target="_blank">ArtifactHub page of the project</a>.
### Upgrade Penpot
When a new version of Penpot's chart is released, or when you want to change the
configuration of your release, you can use the helm upgrade command.
```bash
helm upgrade my-release -f values.yaml penpot/penpot
```
An upgrade takes an existing release and upgrades it according to the information you
provide. Because Kubernetes charts can be large and complex, Helm tries to perform the
least invasive upgrade. It will only update things that have changed since the last
release.
After each upgrade, a new *revision* will be generated. You can check the revision
history of a release with `helm history my-release` and go back to the previous revision
if something went wrong with `helm rollback my-release 1` (`1` is the revision number of
the previous release revision).
### Backup Penpot
The Penpot's Helm Chart uses different Persistent Volumes to store all persistent data.
This allows you to delete and recreate the instance whenever you want without losing
information.
You back up data from a Persistent Volume via snapshots, so you will want to ensure that
your container storage interface (CSI) supports volume snapshots. There are a couple of
different options for the CSI driver that you choose. All of the major cloud providers
have their respective CSI drivers.
At last, there are two Persistent Volumes used: one for the Postgres database and another
one for the assets uploaded by your users (images and svg clips). There may be more
volumes if you enable other features, as explained in the file itself.
You have to back up your custom settings too (the yaml file or the list of parameters you
are using during you setup).
## Unofficial self-host options
There are some other options, **NOT SUPPORTED BY PENPOT**:
@@ -263,7 +399,7 @@ There are some other options, **NOT SUPPORTED BY PENPOT**:
* Install with <a href="https://community.penpot.app/t/how-to-develop-penpot-with-podman-penpotman/2113" target="_blank">Podman</a> instead of Docker.
* Try the under development <a href="https://community.penpot.app/t/introducing-penpot-desktop/1468" target="_blank">Penpot Desktop app</a>.
* Try a simple Kubernetes Deployment option <a href="https://github.com/degola/penpot-kubernetes" target="_blank">penpot-kubernetes</a>.
* Or try a fully manual installation if you have really special needs. For help, you can look at the [Architecture][2] section and the <a href="https://github.com/penpot/penpot/tree/develop/docker/images" target="_blank">Docker configuration files</a>.
* Or try a fully manual installation if you have a really specific use case.. For help, you can look at the [Architecture][2] section and the <a href="https://github.com/penpot/penpot/tree/develop/docker/images" target="_blank">Docker configuration files</a>.
[1]: /technical-guide/configuration/
[2]: /technical-guide/developer/architecture

View File

@@ -110,7 +110,7 @@
(def privacy-policy-uri (obj/get global "penpotPrivacyPolicyURI" "https://penpot.app/privacy"))
(def flex-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/"))
(def grid-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/"))
(def plugins-list-uri (obj/get global "penpotPluginsListUri" "https://penpot-docs-plugins.pages.dev/plugins/getting-started/#examples"))
(def plugins-list-uri (obj/get global "penpotPluginsListUri" "https://penpot.app/penpothub/plugins"))
(def plugins-whitelist (into #{} (obj/get global "penpotPluginsWhitelist" [])))
(defn- normalize-uri

View File

@@ -206,14 +206,16 @@
(watch [_ _ _]
(let [interactions (ctsi/update-interaction (:interactions shape) index update-fn)
interaction (nth interactions index)]
(rx/of (dwsh/update-shapes
[(:id shape)]
(fn [shape]
(assoc shape :interactions interactions))
options)
(rx/of
(dwsh/update-shapes
[(:id shape)]
(fn [shape]
(-> shape
(update :interactions ctsi/update-interaction index update-fn)))
options)
(when (some? (:destination interaction))
(dwsh/update-shapes [(:destination interaction)] cls/show-in-viewer options))))))))
(when (some? (:destination interaction))
(dwsh/update-shapes [(:destination interaction)] cls/show-in-viewer options))))))))
(defn remove-all-interactions-nav-to
"Remove all interactions that navigate to the given frame."

View File

@@ -40,8 +40,7 @@
[app.plugins.viewport :as viewport]
[app.util.code-gen :as cg]
[app.util.object :as obj]
[beicon.v2.core :as rx]
[promesa.core :as p]))
[beicon.v2.core :as rx]))
;;
;; PLUGINS PUBLIC API - The plugins will able to access this functions
@@ -174,7 +173,7 @@
:else
(let [file-id (:current-file-id @st/state)]
(p/create
(js/Promise.
(fn [resolve reject]
(->> (dwm/upload-media-url name file-id url)
(rx/take 1)
@@ -184,7 +183,7 @@
(uploadMediaData
[_ name data mime-type]
(let [file-id (:current-file-id @st/state)]
(p/create
(js/Promise.
(fn [resolve reject]
(->> (dwm/process-blobs
{:file-id file-id

View File

@@ -19,13 +19,12 @@
[app.plugins.shape :as shape]
[app.plugins.user :as user]
[app.plugins.utils :as u]
[beicon.v2.core :as rx]
[promesa.core :as p]))
[beicon.v2.core :as rx]))
(deftype CommentProxy [$plugin $file $page $thread $id]
Object
(remove [_]
(p/create
(js/Promise.
(fn [resolve reject]
(cond
(not (r/check-permission $plugin "comment:write"))
@@ -79,7 +78,7 @@
Object
(findComments
[_]
(p/create
(js/Promise.
(fn [resolve reject]
(cond
(not (r/check-permission $plugin "comment:read"))
@@ -106,7 +105,7 @@
(u/display-not-valid :reply "Not valid")
:else
(p/create
(js/Promise.
(fn [resolve reject]
(->> (rp/cmd! :create-comment {:thread-id $id :content content})
(rx/subs! #(resolve (comment-proxy $plugin $file $page $id $users %)) reject))))))
@@ -121,9 +120,9 @@
(u/display-not-valid :remove "Cannot change content from another user's comments")
:else
(p/create
(js/Promise.
(fn [resolve]
(p/create
(js/Promise.
(st/emit! (dc/delete-comment-thread-on-workspace {:id $id} #(resolve))))))))))
(defn comment-thread-proxy? [p]

View File

@@ -20,8 +20,7 @@
[app.plugins.utils :as u]
[app.util.http :as http]
[app.util.object :as obj]
[beicon.v2.core :as rx]
[promesa.core :as p]))
[beicon.v2.core :as rx]))
(deftype FileProxy [$plugin $id]
Object
@@ -128,7 +127,7 @@
file (u/proxy->file self)
features (features/get-team-enabled-features @st/state)
team-id (:current-team-id @st/state)]
(p/create
(js/Promise.
(fn [resolve reject]
(->> (uw/ask-many!
{:cmd export-cmd

View File

@@ -30,8 +30,7 @@
[app.plugins.utils :as u]
[app.util.object :as obj]
[beicon.v2.core :as rx]
[potok.v2.core :as ptk]
[promesa.core :as p]))
[potok.v2.core :as ptk]))
(declare lib-color-proxy)
(declare lib-typography-proxy)
@@ -915,7 +914,7 @@
(availableLibraries
[_]
(let [team-id (:current-team-id @st/state)]
(p/create
(js/Promise.
(fn [resolve reject]
(let [current-libs (into #{} (map first) (get @st/state :workspace-libraries))]
(->> (rp/cmd! :get-team-shared-files {:team-id team-id})
@@ -939,7 +938,7 @@
(u/display-not-valid :connectLibrary "Plugin doesn't have 'library:write' permission")
:else
(p/create
(js/Promise.
(fn [resolve reject]
(cond
(not (string? library-id))

View File

@@ -29,8 +29,7 @@
[app.plugins.utils :as u]
[app.util.object :as obj]
[beicon.v2.core :as rx]
[cuerdas.core :as str]
[promesa.core :as p]))
[cuerdas.core :as str]))
(deftype FlowProxy [$plugin $file $page $id]
Object
@@ -288,7 +287,7 @@
(some? board)
(-> (update :x - (:x board))
(update :y - (:y board))))]
(p/create
(js/Promise.
(fn [resolve]
(st/emit!
(dc/create-thread-on-workspace
@@ -315,10 +314,10 @@
(u/display-not-valid :removeCommentThread "Plugin doesn't have 'content:write' permission")
:else
(p/create
(js/Promise.
(fn [resolve]
(let [thread-id (obj/get thread "$id")]
(p/create
(js/Promise.
(st/emit! (dc/delete-comment-thread-on-workspace {:id thread-id} #(resolve)))))))))
(findCommentThreads
@@ -326,7 +325,7 @@
(let [only-yours (boolean (obj/get criteria "onlyYours" false))
show-resolved (boolean (obj/get criteria "showResolved" true))
user-id (-> @st/state :profile :id)]
(p/create
(js/Promise.
(fn [resolve reject]
(cond
(not (r/check-permission $plugin "comment:read"))

View File

@@ -52,8 +52,7 @@
[app.util.object :as obj]
[app.util.path.format :as upf]
[beicon.v2.core :as rx]
[cuerdas.core :as str]
[promesa.core :as p]))
[cuerdas.core :as str]))
(declare shape-proxy)
(declare shape-proxy?)
@@ -542,7 +541,7 @@
:type (:type value :png)
:suffix (:suffix value "")
:scale (:scale value 1)}]}]
(p/create
(js/Promise.
(fn [resolve reject]
(->> (rp/cmd! :export payload)
(rx/mapcat #(rp/cmd! :export {:cmd :get-resource :wait true :id (:id %) :blob? true}))

View File

@@ -12,8 +12,7 @@
[app.common.types.container :as ctn]
[app.common.types.file :as ctf]
[app.main.store :as st]
[app.util.object :as obj]
[promesa.core :as p]))
[app.util.object :as obj]))
(defn locate-file
[id]
@@ -175,7 +174,7 @@
[]
(let [ret-v (atom nil)
ret-p
(p/create
(js/Promise.
(fn [resolve _]
(add-watch
ret-v