katalyst-content 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4798cc863b36eafa2627fcf3172aa243050f1e1ffc82b5d1c097b167018f8556
4
- data.tar.gz: d4c8f004f08ed4ad1916f396a7909798bbea2e6d70666858ed7f2e32fdb7ce63
3
+ metadata.gz: 15c10b4886c26310eb6a15c64f9b3c31b1b2dc312d9b4088bf530e6610ec3599
4
+ data.tar.gz: 2dd1d7e5179ff4d9f53d66b8ea99cd3d19f497e078d6234da4c8525e13a25ba1
5
5
  SHA512:
6
- metadata.gz: 7bd099c031625c6ac55355009377e5b3f58ea2c0a1b0859d988dbf3cc7e069bd7a4c12315df905c917604be0cd58642e091889781a1928c981db577c7ab50f0c
7
- data.tar.gz: 30047b03e2baedc76652e6e4864f61538423f4930d433e083cbf43708a004940ec984e7dd16b5ec92e781ac7708bceb56a1501d67b439822ee6cbec56721b432
6
+ metadata.gz: 89a50df67af76c48e7978be76eee21da5100a8bf7fb69c6f580dc1868f4f644300f7d782b7cab61c2897717577e1cf4cc865a8b1f437c7d559c9b321f66b0bf0
7
+ data.tar.gz: c5dbc2983e3438642f38a58351010f7b110715ed865fb5851f1c43d4e8801a8c5a0e9bc0e371f5555cad72c976a3fc53d1bbc88cb6efc260d9403f1d0751f26c
@@ -1,31 +1 @@
1
1
  @use "editor";
2
- @use "trix";
3
-
4
- /*
5
- * We need to override trix.css’s image gallery styles to accommodate the
6
- * <action-text-attachment> element we wrap around attachments. Otherwise,
7
- * images in galleries will be squished by the max-width: 33%; rule.
8
- */
9
- .trix-content .attachment-gallery > action-text-attachment,
10
- .trix-content .attachment-gallery > .attachment {
11
- flex: 1 0 33%;
12
- padding: 0 0.5em;
13
- max-width: 33%;
14
- }
15
-
16
- .trix-content
17
- .attachment-gallery.attachment-gallery--2
18
- > action-text-attachment,
19
- .trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
20
- .trix-content
21
- .attachment-gallery.attachment-gallery--4
22
- > action-text-attachment,
23
- .trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
24
- flex-basis: 50%;
25
- max-width: 50%;
26
- }
27
-
28
- .trix-content action-text-attachment .attachment {
29
- padding: 0 !important;
30
- max-width: 100% !important;
31
- }
@@ -4,6 +4,8 @@
4
4
  @use "item-rules";
5
5
  @use "new-items";
6
6
  @use "status-bar";
7
+ @use "trix";
8
+ @use "trix-rails";
7
9
 
8
10
  $grey-light: #f4f4f4 !default;
9
11
  $grey: #ececec !default;
@@ -99,8 +101,7 @@ $status-dirty-color: #aaa !default;
99
101
  align-items: center;
100
102
  }
101
103
 
102
- .title,
103
- .url {
104
+ .heading {
104
105
  text-overflow: ellipsis;
105
106
  overflow: hidden;
106
107
  white-space: nowrap;
@@ -111,12 +112,39 @@ $status-dirty-color: #aaa !default;
111
112
  [data-controller="content--editor--container"] [role="rowheader"],
112
113
  [data-controller="content--editor--item"] {
113
114
  display: grid;
114
- grid-template-columns: 40% 2fr auto;
115
+ grid-template-columns: minmax(10rem, calc(100% - 12rem)) 1fr 10rem;
115
116
  padding: 0.25rem 0.5rem;
116
117
  gap: 1rem;
117
118
  align-items: center;
118
119
  }
119
120
 
121
+ [data-controller="content--editor--item"] {
122
+ .item-background::before {
123
+ content: "A";
124
+ font-family: cursive;
125
+ display: inline-block;
126
+ min-height: 1rem;
127
+ min-width: 1rem;
128
+ text-align: center;
129
+ color: var(--theme-text-color);
130
+ background-color: var(--theme-background-color);
131
+ border: 1px solid var(--theme-border-color);
132
+ border-radius: 2px;
133
+ }
134
+
135
+ .item-background.light {
136
+ --theme-text-color: black;
137
+ --theme-border-color: black;
138
+ --theme-background-color: white;
139
+ }
140
+
141
+ .item-background.dark {
142
+ --theme-text-color: white;
143
+ --theme-border-color: white;
144
+ --theme-background-color: black;
145
+ }
146
+ }
147
+
120
148
  // Ensures vertical alignment of header with rows
121
149
  [data-controller="content--editor--container"] {
122
150
  [role="rowheader"] {
@@ -0,0 +1,30 @@
1
+ // Rails-provided customizations to trix editor
2
+
3
+ /*
4
+ * We need to override trix.css’s image gallery styles to accommodate the
5
+ * <action-text-attachment> element we wrap around attachments. Otherwise,
6
+ * images in galleries will be squished by the max-width: 33%; rule.
7
+ */
8
+ .trix-content .attachment-gallery > action-text-attachment,
9
+ .trix-content .attachment-gallery > .attachment {
10
+ flex: 1 0 33%;
11
+ padding: 0 0.5em;
12
+ max-width: 33%;
13
+ }
14
+
15
+ .trix-content
16
+ .attachment-gallery.attachment-gallery--2
17
+ > action-text-attachment,
18
+ .trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
19
+ .trix-content
20
+ .attachment-gallery.attachment-gallery--4
21
+ > action-text-attachment,
22
+ .trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
23
+ flex-basis: 50%;
24
+ max-width: 50%;
25
+ }
26
+
27
+ .trix-content action-text-attachment .attachment {
28
+ padding: 0 !important;
29
+ max-width: 100% !important;
30
+ }
@@ -7,7 +7,7 @@
7
7
  <span role="img" value="invisible" title="Hidden"></span>
8
8
  </div>
9
9
 
10
- <div class="item-background-<%= item.background %>">
10
+ <div class="item-background <%= item.background %>">
11
11
  </div>
12
12
 
13
13
  <%= builder.item_actions %>
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Katalyst
4
4
  module Content
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
@@ -35,6 +35,7 @@ files:
35
35
  - app/assets/stylesheets/katalyst/content/editor/_item-rules.scss
36
36
  - app/assets/stylesheets/katalyst/content/editor/_new-items.scss
37
37
  - app/assets/stylesheets/katalyst/content/editor/_status-bar.scss
38
+ - app/assets/stylesheets/katalyst/content/editor/_trix-rails.scss
38
39
  - app/controllers/katalyst/content/application_controller.rb
39
40
  - app/controllers/katalyst/content/items_controller.rb
40
41
  - app/helpers/katalyst/content/application_helper.rb