katalyst-content 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dabae0594160eb1ebafdd3501b5d521113fdcc8bde6f36eede4296314297255d
4
- data.tar.gz: aace7d35cd049a4c3fcf140f21099d5d04d03020a1935402e8999fa82c368823
3
+ metadata.gz: 4798cc863b36eafa2627fcf3172aa243050f1e1ffc82b5d1c097b167018f8556
4
+ data.tar.gz: d4c8f004f08ed4ad1916f396a7909798bbea2e6d70666858ed7f2e32fdb7ce63
5
5
  SHA512:
6
- metadata.gz: 452af88132002902aef2edfa6858e772a4985ea069cc6b1726c4acd9f3f2594fb84bf2e35a3377d233c5cfe1411caa5c7fc86c795b52d6c648d3a9c80bf616fe
7
- data.tar.gz: 1077d2f70a588105436e553b186f4cd3239a250ef36c2f10e15827973b8ea8375ca62b9b5c227d432f8642ef63a8ccdde832a6c89c482df6b99c79749811e78f
6
+ metadata.gz: 7bd099c031625c6ac55355009377e5b3f58ea2c0a1b0859d988dbf3cc7e069bd7a4c12315df905c917604be0cd58642e091889781a1928c981db577c7ab50f0c
7
+ data.tar.gz: 30047b03e2baedc76652e6e4864f61538423f4930d433e083cbf43708a004940ec984e7dd16b5ec92e781ac7708bceb56a1501d67b439822ee6cbec56721b432
@@ -41,9 +41,7 @@ export default class ContainerController extends Controller {
41
41
  nest(event) {
42
42
  const item = getEventItem(event);
43
43
 
44
- item.traverse((child) => {
45
- child.depth += 1;
46
- });
44
+ item.nest();
47
45
 
48
46
  this.#update();
49
47
  event.preventDefault();
@@ -52,9 +50,7 @@ export default class ContainerController extends Controller {
52
50
  deNest(event) {
53
51
  const item = getEventItem(event);
54
52
 
55
- item.traverse((child) => {
56
- child.depth -= 1;
57
- });
53
+ item.deNest();
58
54
 
59
55
  this.#update();
60
56
  event.preventDefault();
@@ -128,6 +128,39 @@ export default class Item {
128
128
  expanded.forEach((item) => item.traverse(callback));
129
129
  }
130
130
 
131
+ /**
132
+ * Increase the depth of this item and its descendants.
133
+ * If this causes it to become a child of a collapsed item, then collapse this item.
134
+ */
135
+ nest() {
136
+ this.traverse((child) => {
137
+ child.depth += 1;
138
+ });
139
+
140
+ if (this.previousItem.hasCollapsedDescendants()) {
141
+ this.previousItem.collapseChild(this);
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Move the given item into this element's hidden children list.
147
+ * Assumes the list already exists.
148
+ *
149
+ * @param item {Item}
150
+ */
151
+ collapseChild(item) {
152
+ this.#childrenListElement.appendChild(item.node);
153
+ }
154
+
155
+ /**
156
+ * Decrease the depth of this item (and its descendants).
157
+ */
158
+ deNest() {
159
+ this.traverse((child) => {
160
+ child.depth -= 1;
161
+ });
162
+ }
163
+
131
164
  /**
132
165
  * Collapses visible (logical) children into this element's hidden children
133
166
  * list, creating it if it doesn't already exist.
@@ -118,7 +118,7 @@ $status-dirty-color: #aaa !default;
118
118
  }
119
119
 
120
120
  // Ensures vertical alignment of header with rows
121
- [data-controller="content--editor-container"] {
121
+ [data-controller="content--editor--container"] {
122
122
  [role="rowheader"] {
123
123
  min-height: var(--row-height);
124
124
  background: var(--table-header-color);
@@ -16,14 +16,14 @@
16
16
  [data-tree-controls] {
17
17
  [role="button"] {
18
18
  @extend %icon-block;
19
+
19
20
  &::before {
20
21
  @extend %icon;
21
22
  }
22
23
  }
23
24
  }
24
25
 
25
- [role="img"][value="link"],
26
- [role="img"][value="title"] {
26
+ [role="img"][value="content"] {
27
27
  width: 1.5rem;
28
28
  height: 1.5rem;
29
29
  display: grid;
@@ -45,15 +45,9 @@
45
45
  text-align: center;
46
46
  }
47
47
 
48
- &[value="link"] {
49
- &::before {
50
- content: "#";
51
- }
52
- }
53
-
54
- &[value="title"] {
48
+ &[value="content"] {
55
49
  &::before {
56
- content: "T";
50
+ background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 49 49' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.9 0C2.28667 0 0 2.28667 0 4.9C0 6.86 1.30667 8.82008 3.26667 9.47341V39.5266C1.30667 40.1799 0 42.14 0 44.1C0 46.7133 2.28667 49 4.9 49C6.86 49 8.82 47.6933 9.47333 45.7333H39.5267C40.18 47.6933 42.14 49 44.1 49C46.7133 49 49 46.7133 49 44.1C49 42.14 47.6933 40.1799 45.7333 39.5266V9.47341C47.6933 8.82008 49 6.86 49 4.9C49 2.28667 46.7133 0 44.1 0C42.14 0 40.18 1.30667 39.5267 3.26667H9.47333C8.82 1.30667 7.18667 0 4.9 0ZM4.9 3.26667C5.88 3.26667 6.53333 3.92 6.53333 4.9C6.53333 5.88 5.88 6.53333 4.9 6.53333C3.92 6.53333 3.26667 5.88 3.26667 4.9C3.26667 3.92 3.92 3.26667 4.9 3.26667ZM44.1 3.26667C45.08 3.26667 45.7333 3.92 45.7333 4.9C45.7333 5.88 45.08 6.53333 44.1 6.53333C43.12 6.53333 42.4667 5.88 42.4667 4.9C42.4667 3.92 43.12 3.26667 44.1 3.26667ZM9.47333 6.53333H39.5267C40.18 7.84 41.16 9.14675 42.4667 9.47341V39.5266C41.16 40.1799 39.8533 41.16 39.5267 42.4667H9.47333C8.82 41.16 7.84 39.8533 6.53333 39.5266V9.47341C7.84 8.82008 8.82 7.84 9.47333 6.53333ZM4.9 42.4667C5.88 42.4667 6.53333 43.12 6.53333 44.1C6.53333 45.08 5.88 45.7333 4.9 45.7333C3.92 45.7333 3.26667 45.08 3.26667 44.1C3.26667 43.12 3.92 42.4667 4.9 42.4667ZM44.1 42.4667C45.08 42.4667 45.7333 43.12 45.7333 44.1C45.7333 45.08 45.08 45.7333 44.1 45.7333C43.12 45.7333 42.4667 45.08 42.4667 44.1C42.4667 43.12 43.12 42.4667 44.1 42.4667Z' fill='white'/%3E%3Cpath d='M13 19.1667V11H35.8667V19.1667H32.6V14.2667H26.0667V33.8667H29.3333V37.1333H19.5333V33.8667H22.8V14.2667H16.2667V19.1667H13Z' fill='white'/%3E%3C/svg%3E");
57
51
  }
58
52
  }
59
53
  }
@@ -28,12 +28,8 @@
28
28
  position: unset;
29
29
  }
30
30
 
31
- &[data-item-type="link"]:before {
32
- background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_67_1273)'%3E%3Cpath d='M16 22H32V26H16V22ZM40.2 24H44C44 18.48 39.52 14 34 14H26V17.8H34C37.42 17.8 40.2 20.58 40.2 24ZM7.8 24C7.8 20.58 10.58 17.8 14 17.8H22V14H14C8.48 14 4 18.48 4 24C4 29.52 8.48 34 14 34H22V30.2H14C10.58 30.2 7.8 27.42 7.8 24ZM38 24H34V30H28V34H34V40H38V34H44V30H38V24Z' /%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_67_1273'%3E%3Crect width='48' height='48' /%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
33
- }
34
-
35
- &[data-item-type="button"]:before {
36
- background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_67_1276)'%3E%3Cpath d='M44 18V30C44 32.2 42.2 34 40 34H38V30H40V18H8V30H20V34H8C5.8 34 4 32.2 4 30V18C4 15.8 5.8 14 8 14H40C42.2 14 44 15.8 44 18ZM29 38L31.18 33.18L36 31L31.18 28.82L29 24L26.82 28.82L22 31L26.82 33.18L29 38ZM34 28L35.24 25.24L38 24L35.24 22.76L34 20L32.76 22.76L30 24L32.76 25.24L34 28ZM29 38L31.18 33.18L36 31L31.18 28.82L29 24L26.82 28.82L22 31L26.82 33.18L29 38ZM34 28L35.24 25.24L38 24L35.24 22.76L34 20L32.76 22.76L30 24L32.76 25.24L34 28Z' /%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_67_1276'%3E%3Crect width='48' height='48' /%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
31
+ &[data-item-type="content"]:before {
32
+ background-image: url("data:image/svg+xml,%3Csvg width='49' height='49' viewBox='0 0 49 49' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.9 0C2.28667 0 0 2.28667 0 4.9C0 6.86 1.30667 8.82008 3.26667 9.47341V39.5266C1.30667 40.1799 0 42.14 0 44.1C0 46.7133 2.28667 49 4.9 49C6.86 49 8.82 47.6933 9.47333 45.7333H39.5267C40.18 47.6933 42.14 49 44.1 49C46.7133 49 49 46.7133 49 44.1C49 42.14 47.6933 40.1799 45.7333 39.5266V9.47341C47.6933 8.82008 49 6.86 49 4.9C49 2.28667 46.7133 0 44.1 0C42.14 0 40.18 1.30667 39.5267 3.26667H9.47333C8.82 1.30667 7.18667 0 4.9 0ZM4.9 3.26667C5.88 3.26667 6.53333 3.92 6.53333 4.9C6.53333 5.88 5.88 6.53333 4.9 6.53333C3.92 6.53333 3.26667 5.88 3.26667 4.9C3.26667 3.92 3.92 3.26667 4.9 3.26667ZM44.1 3.26667C45.08 3.26667 45.7333 3.92 45.7333 4.9C45.7333 5.88 45.08 6.53333 44.1 6.53333C43.12 6.53333 42.4667 5.88 42.4667 4.9C42.4667 3.92 43.12 3.26667 44.1 3.26667ZM9.47333 6.53333H39.5267C40.18 7.84 41.16 9.14675 42.4667 9.47341V39.5266C41.16 40.1799 39.8533 41.16 39.5267 42.4667H9.47333C8.82 41.16 7.84 39.8533 6.53333 39.5266V9.47341C7.84 8.82008 8.82 7.84 9.47333 6.53333ZM4.9 42.4667C5.88 42.4667 6.53333 43.12 6.53333 44.1C6.53333 45.08 5.88 45.7333 4.9 45.7333C3.92 45.7333 3.26667 45.08 3.26667 44.1C3.26667 43.12 3.92 42.4667 4.9 42.4667ZM44.1 42.4667C45.08 42.4667 45.7333 43.12 45.7333 44.1C45.7333 45.08 45.08 45.7333 44.1 45.7333C43.12 45.7333 42.4667 45.08 42.4667 44.1C42.4667 43.12 43.12 42.4667 44.1 42.4667Z' /%3E%3Cpath d='M13 19.1667V11H35.8667V19.1667H32.6V14.2667H26.0667V33.8667H29.3333V37.1333H19.5333V33.8667H22.8V14.2667H16.2667V19.1667H13Z' /%3E%3C/svg%3E");
37
33
  }
38
34
  }
39
35
  }
@@ -2,10 +2,13 @@
2
2
  <div class="tree" data-invisible="<%= !item.visible? %>">
3
3
  <%= builder.accordion_actions %>
4
4
 
5
- <span role="img" value="<%= item.model_name.to_param %>" title="Type"></span>
5
+ <span role="img" value="<%= item.model_name.param_key %>" title="Type"></span>
6
6
  <h4 class="heading" title="<%= item.heading %>"><%= item.heading %></h4>
7
7
  <span role="img" value="invisible" title="Hidden"></span>
8
8
  </div>
9
9
 
10
+ <div class="item-background-<%= item.background %>">
11
+ </div>
12
+
10
13
  <%= builder.item_actions %>
11
14
  <% end %>
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Katalyst
4
4
  module Content
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2022-09-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: