pages_core 3.12.2 → 3.12.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -83,10 +83,11 @@ a {
83
83
  */
84
84
 
85
85
  abbr[title] {
86
- border-bottom: none; /* 1 */ /* 2 */
86
+ border-bottom: none; /* 1 */
87
+ -webkit-text-decoration: underline; /* 2 */
87
88
  text-decoration: underline;
88
- -webkit-text-decoration: underline dotted currentColor;
89
- text-decoration: underline dotted currentColor; /* 2 */
89
+ -webkit-text-decoration: underline dotted;
90
+ text-decoration: underline dotted; /* 2 */
90
91
  }
91
92
 
92
93
  /**
@@ -7454,6 +7455,7 @@ header .site-name h1 {
7454
7455
 
7455
7456
  header .site-name h1 a {
7456
7457
  font-weight: bold;
7458
+ -webkit-text-decoration: none;
7457
7459
  text-decoration: none;
7458
7460
  padding-right: 6px;
7459
7461
  }
@@ -7517,6 +7519,7 @@ header .tabs a,
7517
7519
  line-height: 32px;
7518
7520
  height: 32px;
7519
7521
  margin: 0 2px 0 0;
7522
+ -webkit-text-decoration: none;
7520
7523
  text-decoration: none;
7521
7524
  }
7522
7525
 
@@ -7553,6 +7556,7 @@ header .tabs a:hover,
7553
7556
 
7554
7557
  .content-tabs li.current a,
7555
7558
  .content-tabs li.current a:visited {
7559
+ -webkit-text-decoration: none;
7556
7560
  text-decoration: none;
7557
7561
  color: #444;
7558
7562
  }
@@ -7590,6 +7594,7 @@ header .tabs a:hover,
7590
7594
 
7591
7595
  .page-description .links a.current {
7592
7596
  font-weight: bold;
7597
+ -webkit-text-decoration: none;
7593
7598
  text-decoration: none;
7594
7599
  color: #111;
7595
7600
  color: var(--text-color);
@@ -7778,18 +7783,6 @@ main .page-description h3 {
7778
7783
  overflow: hidden;
7779
7784
  }
7780
7785
 
7781
- .image-editor .focal-editor .focal-point:after {
7782
- content: "";
7783
- display: block;
7784
- width: 32px;
7785
- height: 32px;
7786
- border-radius: 16px;
7787
- border: 1px solid rgba(0, 0, 0, 0.3);
7788
- margin-left: -4px;
7789
- margin-top: -4px;
7790
- transition: all 200ms ease-out;
7791
- }
7792
-
7793
7786
  .image-editor .focal-editor .focal-point {
7794
7787
  position: absolute;
7795
7788
  width: 30px;
@@ -7808,11 +7801,17 @@ main .page-description h3 {
7808
7801
  transition: border-radius 200ms, margin 200ms, width 200ms, height 200ms, border-color 200ms ease-out;
7809
7802
  }
7810
7803
 
7811
- .image-editor .focal-editor .focal-point:hover:after {
7812
- width: 42px;
7813
- height: 42px;
7814
- border-radius: 21px;
7815
- }
7804
+ .image-editor .focal-editor .focal-point:after {
7805
+ content: "";
7806
+ display: block;
7807
+ width: 32px;
7808
+ height: 32px;
7809
+ border-radius: 16px;
7810
+ border: 1px solid rgba(0, 0, 0, 0.3);
7811
+ margin-left: -4px;
7812
+ margin-top: -4px;
7813
+ transition: all 200ms ease-out;
7814
+ }
7816
7815
 
7817
7816
  .image-editor .focal-editor .focal-point:hover {
7818
7817
  border-color: rgba(222, 255, 255, 0.9);
@@ -7823,6 +7822,12 @@ main .page-description h3 {
7823
7822
  margin-top: -20px;
7824
7823
  }
7825
7824
 
7825
+ .image-editor .focal-editor .focal-point:hover:after {
7826
+ width: 42px;
7827
+ height: 42px;
7828
+ border-radius: 21px;
7829
+ }
7830
+
7826
7831
  .image-grid {
7827
7832
  --image-padding: 7px;
7828
7833
  margin-bottom: 40px;
@@ -8197,6 +8202,7 @@ a,
8197
8202
  a:visited {
8198
8203
  color: #1d7195;
8199
8204
  color: var(--link-color);
8205
+ -webkit-text-decoration: underline;
8200
8206
  text-decoration: underline;
8201
8207
  }
8202
8208
 
@@ -8241,6 +8247,7 @@ button a {
8241
8247
 
8242
8248
  button a {
8243
8249
  padding: 5px 0;
8250
+ -webkit-text-decoration: none;
8244
8251
  text-decoration: none;
8245
8252
  }
8246
8253
 
@@ -8543,11 +8550,13 @@ body.modal > .wrapper {
8543
8550
  .page-tree .page a:visited {
8544
8551
  color: #111;
8545
8552
  color: var(--text-color);
8553
+ -webkit-text-decoration: none;
8546
8554
  text-decoration: none;
8547
8555
  }
8548
8556
 
8549
8557
  .page-tree .page a:hover,
8550
8558
  .page-tree .page a:focus {
8559
+ -webkit-text-decoration: underline;
8551
8560
  text-decoration: underline;
8552
8561
  }
8553
8562
 
@@ -8652,6 +8661,7 @@ body.modal > .wrapper {
8652
8661
  display: inline-block;
8653
8662
  font-style: normal;
8654
8663
  margin: 0px 1px;
8664
+ -webkit-text-decoration: none;
8655
8665
  text-decoration: none;
8656
8666
  padding: 2px;
8657
8667
  border-radius: 12px;
@@ -8661,6 +8671,7 @@ body.modal > .wrapper {
8661
8671
 
8662
8672
  .pagination a:hover,
8663
8673
  .pagination a:focus {
8674
+ -webkit-text-decoration: underline;
8664
8675
  text-decoration: underline;
8665
8676
  }
8666
8677
 
@@ -9097,11 +9108,13 @@ td.drag-handle {
9097
9108
 
9098
9109
  .page-list .page a.page-name,
9099
9110
  .page-list .page a.page-name:visited {
9111
+ -webkit-text-decoration: none;
9100
9112
  text-decoration: none;
9101
9113
  color: #222;
9102
9114
  }
9103
9115
 
9104
9116
  .page-list .page a.page-name:hover {
9117
+ -webkit-text-decoration: underline;
9105
9118
  text-decoration: underline;
9106
9119
  }
9107
9120
 
@@ -105,7 +105,7 @@
105
105
  width: 60vw;
106
106
  min-height: 450px;
107
107
 
108
- @media --mobile {
108
+ @media (--mobile) {
109
109
  width: 100%;
110
110
  height: 100%;
111
111
  }
@@ -33,7 +33,7 @@
33
33
  height: 80vh;
34
34
  display: flex;
35
35
 
36
- @media --mobile {
36
+ @media (--mobile) {
37
37
  width: 100%;
38
38
  height: 100%;
39
39
  flex-direction: column;
@@ -145,7 +145,7 @@
145
145
  }
146
146
  }
147
147
 
148
- @media --mobile {
148
+ @media (--mobile) {
149
149
  width: 100%;
150
150
  margin-left: 0px;
151
151
  padding-bottom: 20px;
@@ -3,7 +3,7 @@
3
3
  margin-bottom: 40px;
4
4
  display: flex;
5
5
 
6
- @media --mobile {
6
+ @media (--mobile) {
7
7
  flex-direction: column;
8
8
  }
9
9
 
@@ -87,7 +87,7 @@
87
87
  flex-direction: row;
88
88
  visibility: hidden;
89
89
 
90
- @media --mobile {
90
+ @media (--mobile) {
91
91
  visibility: visible;
92
92
  }
93
93
 
@@ -106,7 +106,7 @@
106
106
  & .primary-image {
107
107
  width: 33.33%;
108
108
 
109
- @media --mobile {
109
+ @media (--mobile) {
110
110
  width: 100%;
111
111
  }
112
112
 
@@ -147,11 +147,11 @@
147
147
  justify-content: flex-end;
148
148
  width: 16.66%;
149
149
 
150
- @media --narrow {
150
+ @media (--narrow) {
151
151
  width: 50%;
152
152
  }
153
153
 
154
- @media --mobile {
154
+ @media (--mobile) {
155
155
  width: 50%;
156
156
  }
157
157
  }
@@ -185,7 +185,7 @@
185
185
  & .grid {
186
186
  width: 66.67%;
187
187
 
188
- @media --mobile {
188
+ @media (--mobile) {
189
189
  width: 100%;
190
190
  }
191
191
  }
@@ -193,11 +193,11 @@
193
193
  & .images .grid-image {
194
194
  width: 25%;
195
195
 
196
- @media --narrow {
196
+ @media (--narrow) {
197
197
  width: 50%;
198
198
  }
199
199
 
200
- @media --mobile {
200
+ @media (--mobile) {
201
201
  width: 50%;
202
202
  }
203
203
  }
@@ -9,7 +9,7 @@
9
9
  box-shadow: inset 0px 0px 1px rgba(0, 0, 0, 0.1);
10
10
  padding: 1px;
11
11
 
12
- @media --mobile {
12
+ @media (--mobile) {
13
13
  flex-direction: column;
14
14
  }
15
15
 
@@ -29,7 +29,7 @@
29
29
  max-height: 400px;
30
30
  }
31
31
 
32
- @media --mobile {
32
+ @media (--mobile) {
33
33
  max-width: 100%;
34
34
  }
35
35
  }
@@ -28,7 +28,7 @@ body {
28
28
  display: flex;
29
29
  flex-flow: row nowrap;
30
30
 
31
- @media --mobile {
31
+ @media (--mobile) {
32
32
  flex-flow: column nowrap;
33
33
  }
34
34
 
@@ -42,7 +42,7 @@ body {
42
42
  width: 20%;
43
43
  padding: 0px 16px;
44
44
 
45
- @media --mobile {
45
+ @media (--mobile) {
46
46
  width: 100%;
47
47
  }
48
48
  }
@@ -3,7 +3,7 @@ body.modal {
3
3
  transition: filter 1000ms linear;
4
4
  filter: blur(10px);
5
5
 
6
- @media --mobile {
6
+ @media (--mobile) {
7
7
  filter: none;
8
8
  }
9
9
  }
@@ -41,7 +41,7 @@ body.modal {
41
41
  animation-fill-mode: forwards;
42
42
  z-index: 2;
43
43
 
44
- @media --mobile {
44
+ @media (--mobile) {
45
45
  max-width: 100%;
46
46
  width: 100vw;
47
47
  height: 100vh;
@@ -20,13 +20,22 @@ module PagesCore
20
20
  tag.figcaption(caption)
21
21
  end
22
22
 
23
- def image_figure(image, size: nil, class_name: nil, link: nil, caption: nil)
24
- class_name = ["image", image_class_name(image), class_name].compact
25
- size ||= default_image_size
26
- image_tag = dynamic_image_tag(image,
27
- size: size, crop: false, upscale: false)
28
- tag.figure((link ? image_link_to(image_tag, link) : image_tag) +
29
- image_caption(image, caption: caption),
23
+ # Renders an image figure tag with caption.
24
+ #
25
+ # ==== Options
26
+ # * <tt>:caption</tt>: Override caption with a string, or set to false to
27
+ # disable captions.
28
+ # * <tt>:class_name</tt>: Class name to add to figure tag.
29
+ # * <tt>:link</tt>: Link target for image.
30
+ # * <tt>:ratio</tt>: Ratio to constrain image by.
31
+ # * <tt>:size</tt>: Max size for image.
32
+ def image_figure(image, opts = {})
33
+ class_name = ["image", image_class_name(image), opts[:class_name]].compact
34
+ image_tag = image_figure_image_tag(image,
35
+ size: opts[:size], ratio:
36
+ opts[:ratio])
37
+ content = opts[:link] ? image_link_to(image_tag, opts[:link]) : image_tag
38
+ tag.figure(content + image_caption(image, caption: opts[:caption]),
30
39
  class: class_name)
31
40
  end
32
41
 
@@ -57,6 +66,11 @@ module PagesCore
57
66
  { alt: record.alternative }
58
67
  end
59
68
 
69
+ def fit_ratio(size, ratio)
70
+ v = Vector2d(size)
71
+ Vector2d.new(v.y * ratio, v.y).fit(v)
72
+ end
73
+
60
74
  def image_class_name(image)
61
75
  if image.size.x == image.size.y
62
76
  "square"
@@ -67,6 +81,13 @@ module PagesCore
67
81
  end
68
82
  end
69
83
 
84
+ def image_figure_image_tag(image, size: nil, ratio: nil)
85
+ size ||= default_image_size
86
+ size = fit_ratio(size, ratio) if ratio
87
+
88
+ dynamic_image_tag(image, size: size, crop: ratio && true, upscale: false)
89
+ end
90
+
70
91
  def image_link_to(content, href)
71
92
  tag.a(content, href: href)
72
93
  end
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import ReactDOM from "react-dom";
2
+ import { createRoot } from "react-dom/client";
3
3
  import RichTextArea from "../components/RichTextArea";
4
4
  import readyHandler from "../lib/readyHandler";
5
5
 
@@ -11,10 +11,10 @@ class RichText {
11
11
  });
12
12
  }
13
13
 
14
- enhance (elem) {
14
+ enhance (elem: HTMLTextAreaElement) {
15
15
  const container = document.createElement("div");
16
16
  elem.parentNode.appendChild(container);
17
- ReactDOM.render(
17
+ createRoot(container).render(
18
18
  <RichTextArea value={elem.value}
19
19
  name={elem.name}
20
20
  rows={elem.rows}
@@ -58,7 +58,7 @@ html {
58
58
  @media screen and (max-width: 1440px) {
59
59
  @mixin font-scale 14, 16, $breakpoint-mobile-small, 1440;
60
60
  }
61
- @media --mobile-small {
61
+ @media (--mobile-small) {
62
62
  @mixin font-scale 12, 16, 1, $breakpoint-mobile-small;
63
63
  }
64
64
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pages_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.2
4
+ version: 3.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inge Jørgensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2023-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -509,7 +509,7 @@ files:
509
509
  - app/javascript/controllers/LoginController.ts
510
510
  - app/javascript/controllers/MainController.ts
511
511
  - app/javascript/controllers/PageOptionsController.js
512
- - app/javascript/features/RichText.jsx
512
+ - app/javascript/features/RichText.tsx
513
513
  - app/javascript/hooks.ts
514
514
  - app/javascript/index.ts
515
515
  - app/javascript/lib/Tree.ts