@internetstiftelsen/styleguide 2.21.15 → 2.21.18

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.
@@ -137,7 +137,7 @@ function createToolbar(el, editor) {
137
137
  function getHTML(editor) {
138
138
  var html = editor.getHTML();
139
139
 
140
- return html;
140
+ return html.replace(/<li><p>/g, '<li>').replace(/<\/p><\/li>/g, '</li>');
141
141
  }
142
142
 
143
143
  function setupTextArea(el) {
@@ -158,7 +158,7 @@ function setupTextArea(el) {
158
158
  },
159
159
  onUpdate: function onUpdate(props) {
160
160
  var html = getHTML(props.editor);
161
- console.log(html);
161
+
162
162
  el.value = html;
163
163
  onChange(html);
164
164
  }
package/dist/focusTrap.js CHANGED
@@ -7,17 +7,13 @@ exports.default = focusTrap;
7
7
 
8
8
  var _focusTrap = require('focus-trap');
9
9
 
10
- var _focusTrap2 = _interopRequireDefault(_focusTrap);
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function getContainer(element) {
15
11
  return document.getElementById(element.getAttribute('data-a11y-toggle'));
16
12
  }
17
13
 
18
14
  function focusTrap(container) {
19
15
  if (container && container.getAttribute('data-focus-trap') !== 'false' && !container.focusTrap) {
20
- container.focusTrap = (0, _focusTrap2.default)('#' + container.id, { clickOutsideDeactivates: true });
16
+ container.focusTrap = (0, _focusTrap.createFocusTrap)('#' + container.id, { clickOutsideDeactivates: true });
21
17
  container.setAttribute('data-focus-trap', 'true');
22
18
  }
23
19
  }
@@ -2,10 +2,6 @@
2
2
 
3
3
  var _focusTrap = require('focus-trap');
4
4
 
5
- var _focusTrap2 = _interopRequireDefault(_focusTrap);
6
-
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
-
9
5
  /**
10
6
  * Collect the needed elements.
11
7
  */
@@ -19,7 +15,7 @@ var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
19
15
  var focusTrap = null;
20
16
 
21
17
  if (megaMenu) {
22
- focusTrap = (0, _focusTrap2.default)(megaMenu);
18
+ focusTrap = (0, _focusTrap.createFocusTrap)(megaMenu);
23
19
  }
24
20
 
25
21
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "2.21.15",
3
+ "version": "2.21.18",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -70,7 +70,7 @@
70
70
  "@tiptap/extension-link": "^2.0.0-beta.25",
71
71
  "@tiptap/starter-kit": "^2.0.0-beta.133",
72
72
  "a11y-toggle": "^2.1.0",
73
- "focus-trap": "^4.0.2",
73
+ "focus-trap": "^6.7.3",
74
74
  "glider-js": "^1.7.7",
75
75
  "lodash.template": "^4.5.0",
76
76
  "lodash.throttle": "^4.1.1",
@@ -131,7 +131,9 @@ function createToolbar(el, editor) {
131
131
  function getHTML(editor) {
132
132
  const html = editor.getHTML();
133
133
 
134
- return html;
134
+ return html
135
+ .replace(/<li><p>/g, '<li>')
136
+ .replace(/<\/p><\/li>/g, '</li>');
135
137
  }
136
138
 
137
139
  export function setupTextArea(el, onChange = () => {}) {
@@ -153,7 +155,7 @@ export function setupTextArea(el, onChange = () => {}) {
153
155
  },
154
156
  onUpdate(props) {
155
157
  const html = getHTML(props.editor);
156
- console.log(html);
158
+
157
159
  el.value = html;
158
160
  onChange(html);
159
161
  },
@@ -70,7 +70,7 @@
70
70
  <div class="grid-18 grid-md-14">
71
71
  <ul class="checklist">
72
72
  <li>Lorem ipsum dolor sit amet</li>
73
- <li>Sed nisl justo, <a href="#">pharetra non scelerisque</a></li>
73
+ <li>Sed nisl justo, pharetra non scelerisque</li>
74
74
  <li> Vestibulum ullamcorper</li>
75
75
  <li>
76
76
  Nam vitae mauris blandit
package/src/focusTrap.js CHANGED
@@ -1,4 +1,4 @@
1
- import createFocusTrap from 'focus-trap';
1
+ import { createFocusTrap } from 'focus-trap';
2
2
 
3
3
  function getContainer(element) {
4
4
  return document.getElementById(element.getAttribute('data-a11y-toggle'));
@@ -132,18 +132,21 @@
132
132
  position: relative;
133
133
 
134
134
  &::after {
135
- content: '';
136
- padding: rhythm(1);
135
+ content: 'Förstora bilden';
136
+ color: $color-snow;
137
+ padding: rhythm(1) rhythm(2) rhythm(1) rhythm(4);
137
138
  display: block;
138
139
  position: absolute;
139
140
  top: 0;
140
141
  left: 0;
141
- border-radius: $border-radius;
142
- width: $icon-size-large * 1.4;
142
+ border-top-left-radius: $border-radius;
143
+ border-bottom-right-radius: $border-radius;
144
+ width: auto;
145
+ line-height: 1;
143
146
  height: $icon-size-large * 1.4;
144
147
  background-color: rgba($color-cyberspace, 0.8);
145
148
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' id='icon-search' viewbox='0 0 32 32' width='32' height='32' fill='%23ffffff'%3E%3Cpath d='M24,21.8l8,8L29.9,32l-8-8c-5.9,4.6-14.3,3.6-19-2.2S-0.7,7.6,5.1,2.9S19.3-0.7,24,5.1C27.9,10,27.9,16.9,24,21.8L24,21.8z M13.4,23.9c5.8,0,10.5-4.7,10.5-10.5S19.2,3,13.4,3S3,7.7,3,13.4S7.7,23.9,13.4,23.9z'/%3E%3C/svg%3E");
146
- background-position: center center;
149
+ background-position: rhythm(1) center;
147
150
  background-size: $icon-size-medium $icon-size-medium;
148
151
  background-repeat: no-repeat;
149
152
 
@@ -181,9 +184,13 @@
181
184
  }
182
185
 
183
186
  figcaption {
187
+ max-width: rem(612px);
188
+ text-align: center;
184
189
  color: $color-snow;
185
- padding-left: rhythm(1);
186
- padding-right: rhythm(1);
190
+ padding-left: rhythm(2);
191
+ padding-right: rhythm(2);
192
+ margin-bottom: 0 !important;
193
+ padding-bottom: 0 !important;
187
194
  }
188
195
  }
189
196
  }
@@ -1,4 +1,4 @@
1
- import createFocusTrap from 'focus-trap';
1
+ import { createFocusTrap } from 'focus-trap';
2
2
  /**
3
3
  * Collect the needed elements.
4
4
  */
package/src/.DS_Store DELETED
Binary file
Binary file
Binary file
Binary file