mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 17:41:38 +02:00
🐛 Change order to create layout panel
This commit is contained in:
parent
18d954faba
commit
85c301c26b
10 changed files with 98 additions and 53 deletions
|
@ -50,11 +50,21 @@
|
||||||
[:& layer-menu {:ids ids
|
[:& layer-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values layer-values}]
|
:values layer-values}]
|
||||||
|
|
||||||
[:& measures-menu {:ids ids
|
[:& measures-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values measure-values
|
:values measure-values
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
[:& layout-container-menu {:type type :ids [(:id shape)] :values layout-container-values :multiple false}]
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
|
[:& constraints-menu {:ids ids
|
||||||
|
:values constraint-values}])
|
||||||
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids [(:id shape)]
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple false}]
|
||||||
|
|
||||||
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
||||||
[:& grid-cell/options
|
[:& grid-cell/options
|
||||||
|
@ -71,10 +81,6 @@
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:shape shape}])
|
:shape shape}])
|
||||||
|
|
||||||
(when (or (not is-layout-child?) is-layout-child-absolute?)
|
|
||||||
[:& constraints-menu {:ids ids
|
|
||||||
:values constraint-values}])
|
|
||||||
|
|
||||||
[:& fill-menu {:ids ids
|
[:& fill-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values (select-keys shape fill-attrs)}]
|
:values (select-keys shape fill-attrs)}]
|
||||||
|
|
|
@ -52,11 +52,21 @@
|
||||||
[:& layer-menu {:ids ids
|
[:& layer-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values layer-values}]
|
:values layer-values}]
|
||||||
|
|
||||||
[:& measures-menu {:ids ids
|
[:& measures-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values measure-values
|
:values measure-values
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
[:& layout-container-menu {:type type :ids [(:id shape)] :values layout-container-values :multiple false}]
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
|
[:& constraints-menu {:ids ids
|
||||||
|
:values constraint-values}])
|
||||||
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids [(:id shape)]
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple false}]
|
||||||
|
|
||||||
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
||||||
[:& grid-cell/options
|
[:& grid-cell/options
|
||||||
|
@ -72,9 +82,6 @@
|
||||||
:is-flex-parent? is-flex-parent?
|
:is-flex-parent? is-flex-parent?
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:shape shape}])
|
:shape shape}])
|
||||||
(when (or (not is-layout-child?) is-layout-child-absolute?)
|
|
||||||
[:& constraints-menu {:ids ids
|
|
||||||
:values constraint-values}])
|
|
||||||
|
|
||||||
[:& fill-menu {:ids ids
|
[:& fill-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
|
|
|
@ -62,11 +62,18 @@
|
||||||
:values measure-values
|
:values measure-values
|
||||||
:type type
|
:type type
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
|
|
||||||
[:& component-menu {:shapes [shape]}]
|
[:& component-menu {:shapes [shape]}]
|
||||||
(when (or (not is-layout-child?) is-layout-child-absolute?)
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
[:& constraints-menu {:ids ids
|
[:& constraints-menu {:ids ids
|
||||||
:values constraint-values}])
|
:values constraint-values}])
|
||||||
[:& layout-container-menu {:type type :ids [(:id shape)] :values layout-container-values :multiple false}]
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids [(:id shape)]
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple false}]
|
||||||
|
|
||||||
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
||||||
[:& grid-cell/options
|
[:& grid-cell/options
|
||||||
|
|
|
@ -74,7 +74,15 @@
|
||||||
[:& layer-menu {:type type :ids layer-ids :values layer-values}]
|
[:& layer-menu {:type type :ids layer-ids :values layer-values}]
|
||||||
[:& measures-menu {:type type :ids measure-ids :values measure-values :shape shape}]
|
[:& measures-menu {:type type :ids measure-ids :values measure-values :shape shape}]
|
||||||
[:& component-menu {:shapes [shape]}] ;;remove this in components-v2
|
[:& component-menu {:shapes [shape]}] ;;remove this in components-v2
|
||||||
[:& layout-container-menu {:type type :ids [(:id shape)] :values layout-container-values :multiple false}]
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
|
[:& constraints-menu {:ids constraint-ids :values constraint-values}])
|
||||||
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids [(:id shape)]
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple false}]
|
||||||
|
|
||||||
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
||||||
[:& grid-cell/options
|
[:& grid-cell/options
|
||||||
|
@ -91,9 +99,6 @@
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:values layout-item-values}])
|
:values layout-item-values}])
|
||||||
|
|
||||||
(when (or (not is-layout-child?) is-layout-child-absolute?)
|
|
||||||
[:& constraints-menu {:ids constraint-ids :values constraint-values}])
|
|
||||||
|
|
||||||
(when-not (empty? fill-ids)
|
(when-not (empty? fill-ids)
|
||||||
[:& fill-menu {:type type :ids fill-ids :values fill-values}])
|
[:& fill-menu {:type type :ids fill-ids :values fill-values}])
|
||||||
|
|
||||||
|
|
|
@ -52,11 +52,21 @@
|
||||||
[:& layer-menu {:ids ids
|
[:& layer-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values layer-values}]
|
:values layer-values}]
|
||||||
|
|
||||||
[:& measures-menu {:ids ids
|
[:& measures-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values measure-values
|
:values measure-values
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
[:& layout-container-menu {:type type :ids [(:id shape)] :values layout-container-values :multiple false}]
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
|
[:& constraints-menu {:ids ids
|
||||||
|
:values constraint-values}])
|
||||||
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids [(:id shape)]
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple false}]
|
||||||
|
|
||||||
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
||||||
[:& grid-cell/options
|
[:& grid-cell/options
|
||||||
|
@ -73,12 +83,6 @@
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:shape shape}])
|
:shape shape}])
|
||||||
|
|
||||||
(when (or (not is-layout-child?) is-layout-child-absolute?)
|
|
||||||
[:& constraints-menu {:ids ids
|
|
||||||
:values constraint-values}])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[:& fill-menu {:ids ids
|
[:& fill-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values fill-values}]
|
:values fill-values}]
|
||||||
|
|
|
@ -359,8 +359,14 @@
|
||||||
(when-not (empty? components)
|
(when-not (empty? components)
|
||||||
[:& component-menu {:shapes components}])
|
[:& component-menu {:shapes components}])
|
||||||
|
|
||||||
[:& layout-container-menu {:type type :ids layout-container-ids :values layout-container-values :multiple true}]
|
(when-not (or (empty? constraint-ids) ^boolean is-layout-child?)
|
||||||
|
[:& constraints-menu {:ids constraint-ids :values constraint-values}])
|
||||||
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids layout-container-ids
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple true}]
|
||||||
|
|
||||||
(when (or is-layout-child? has-flex-layout-container?)
|
(when (or is-layout-child? has-flex-layout-container?)
|
||||||
[:& layout-item-menu
|
[:& layout-item-menu
|
||||||
|
@ -372,9 +378,6 @@
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:values layout-item-values}])
|
:values layout-item-values}])
|
||||||
|
|
||||||
(when-not (or (empty? constraint-ids) is-layout-child?)
|
|
||||||
[:& constraints-menu {:ids constraint-ids :values constraint-values}])
|
|
||||||
|
|
||||||
(when-not (empty? text-ids)
|
(when-not (empty? text-ids)
|
||||||
[:& ot/text-menu {:type type :ids text-ids :values text-values}])
|
[:& ot/text-menu {:type type :ids text-ids :values text-values}])
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,16 @@
|
||||||
:type type
|
:type type
|
||||||
:values measure-values
|
:values measure-values
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
[:& layout-container-menu {:type type :ids [(:id shape)] :values layout-container-values :multiple false}]
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
|
[:& constraints-menu {:ids ids
|
||||||
|
:values constraint-values}])
|
||||||
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids [(:id shape)]
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple false}]
|
||||||
|
|
||||||
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
||||||
[:& grid-cell/options
|
[:& grid-cell/options
|
||||||
|
@ -72,9 +81,6 @@
|
||||||
:is-flex-parent? is-flex-parent?
|
:is-flex-parent? is-flex-parent?
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:shape shape}])
|
:shape shape}])
|
||||||
(when (or (not is-layout-child?) is-layout-child-absolute?)
|
|
||||||
[:& constraints-menu {:ids ids
|
|
||||||
:values constraint-values}])
|
|
||||||
|
|
||||||
[:& fill-menu {:ids ids
|
[:& fill-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
|
|
|
@ -59,6 +59,11 @@
|
||||||
:type type
|
:type type
|
||||||
:values measure-values
|
:values measure-values
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
|
[:& constraints-menu {:ids ids
|
||||||
|
:values constraint-values}])
|
||||||
|
|
||||||
[:& layout-container-menu
|
[:& layout-container-menu
|
||||||
{:type type
|
{:type type
|
||||||
:ids ids
|
:ids ids
|
||||||
|
@ -80,13 +85,6 @@
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:shape shape}])
|
:shape shape}])
|
||||||
|
|
||||||
(when (or (not ^boolean is-layout-child?)
|
|
||||||
^boolean is-layout-child-absolute?)
|
|
||||||
[:& constraints-menu {:ids ids
|
|
||||||
:values constraint-values}])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[:& fill-menu {:ids ids
|
[:& fill-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values fill-values}]
|
:values fill-values}]
|
||||||
|
|
|
@ -128,12 +128,21 @@
|
||||||
:type type
|
:type type
|
||||||
:values measure-values
|
:values measure-values
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
[:& layout-container-menu {:type type :ids [(:id shape)] :values layout-container-values :multiple false}]
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
|
[:& constraints-menu {:ids ids
|
||||||
|
:values constraint-values}])
|
||||||
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids [(:id shape)]
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple false}]
|
||||||
|
|
||||||
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
||||||
[:& grid-cell/options
|
[:& grid-cell/options
|
||||||
{:shape (first parents)
|
{:shape (first parents)
|
||||||
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])
|
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])
|
||||||
|
|
||||||
(when is-layout-child?
|
(when is-layout-child?
|
||||||
[:& layout-item-menu
|
[:& layout-item-menu
|
||||||
|
@ -145,10 +154,6 @@
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:shape shape}])
|
:shape shape}])
|
||||||
|
|
||||||
(when (or (not is-layout-child?) is-layout-child-absolute?)
|
|
||||||
[:& constraints-menu {:ids ids
|
|
||||||
:values constraint-values}])
|
|
||||||
|
|
||||||
[:& fill-menu {:ids ids
|
[:& fill-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values fill-values}]
|
:values fill-values}]
|
||||||
|
|
|
@ -91,12 +91,23 @@
|
||||||
:type type
|
:type type
|
||||||
:values (select-keys shape measure-attrs)
|
:values (select-keys shape measure-attrs)
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
[:& layout-container-menu {:type type :ids [(:id shape)] :values layout-container-values :multiple false}]
|
|
||||||
|
(when (or (not ^boolean is-layout-child?) ^boolean is-layout-child-absolute?)
|
||||||
|
[:& constraints-menu
|
||||||
|
{:ids ids
|
||||||
|
:values (select-keys shape constraint-attrs)}])
|
||||||
|
|
||||||
|
[:& layout-container-menu
|
||||||
|
{:type type
|
||||||
|
:ids [(:id shape)]
|
||||||
|
:values layout-container-values
|
||||||
|
:multiple false}]
|
||||||
|
|
||||||
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
|
||||||
[:& grid-cell/options
|
[:& grid-cell/options
|
||||||
{:shape (first parents)
|
{:shape (first parents)
|
||||||
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])
|
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])
|
||||||
|
|
||||||
(when is-layout-child?
|
(when is-layout-child?
|
||||||
[:& layout-item-menu
|
[:& layout-item-menu
|
||||||
{:ids ids
|
{:ids ids
|
||||||
|
@ -107,13 +118,6 @@
|
||||||
:is-grid-parent? is-grid-parent?
|
:is-grid-parent? is-grid-parent?
|
||||||
:shape shape}])
|
:shape shape}])
|
||||||
|
|
||||||
(when (or (not is-layout-child?) is-layout-child-absolute?)
|
|
||||||
[:& constraints-menu
|
|
||||||
{:ids ids
|
|
||||||
:values (select-keys shape constraint-attrs)}])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[:& text-menu
|
[:& text-menu
|
||||||
{:ids ids
|
{:ids ids
|
||||||
:type type
|
:type type
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue