@pageboard/html 0.11.1 → 0.11.4
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.
- package/elements/fieldsets.js +4 -2
- package/elements/grid.js +12 -7
- package/elements/layout.js +33 -1
- package/lib/stickyfill.js +546 -0
- package/package.json +1 -1
- package/ui/card.css +4 -4
- package/ui/fieldset.css +14 -0
- package/ui/item.css +4 -4
- package/ui/loading.css +3 -3
- package/ui/menu.css +1 -1
- package/ui/rating.css +2 -2
- package/ui/site.css +5 -1
- package/ui/transition.css +6 -6
package/elements/fieldsets.js
CHANGED
|
@@ -25,14 +25,16 @@ exports.fieldset = {
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
plain: {
|
|
28
|
-
title: '
|
|
28
|
+
title: 'Plain',
|
|
29
|
+
description: 'Without legend or borders',
|
|
29
30
|
type: 'boolean',
|
|
30
31
|
default: false
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
contents: "fieldset_legend block+",
|
|
34
35
|
html: '<fieldset class="[plain|?]" data-name="[name]" data-value="[value]" is="element-fieldset"></fieldset>',
|
|
35
|
-
scripts: ["../ui/fieldset.js"]
|
|
36
|
+
scripts: ["../ui/fieldset.js"],
|
|
37
|
+
stylesheets: ['../ui/fieldset.css']
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
exports.fieldset_legend = {
|
package/elements/grid.js
CHANGED
|
@@ -6,20 +6,25 @@ exports.grid = {
|
|
|
6
6
|
properties: {
|
|
7
7
|
width: {
|
|
8
8
|
title: 'Width',
|
|
9
|
-
default: "full",
|
|
10
9
|
anyOf: [{
|
|
10
|
+
type: 'null',
|
|
11
|
+
title: 'normal'
|
|
12
|
+
}, {
|
|
13
|
+
const: "min",
|
|
14
|
+
title: "minimal"
|
|
15
|
+
}, {
|
|
11
16
|
const: "full",
|
|
12
|
-
title: "
|
|
17
|
+
title: "maximal"
|
|
13
18
|
}, {
|
|
14
19
|
const: "contained",
|
|
15
|
-
title: "
|
|
20
|
+
title: "contained"
|
|
16
21
|
}]
|
|
17
22
|
},
|
|
18
23
|
responsive: {
|
|
19
24
|
title: 'Responsive',
|
|
20
25
|
anyOf: [{
|
|
21
26
|
title: 'No',
|
|
22
|
-
|
|
27
|
+
type: 'null'
|
|
23
28
|
}, {
|
|
24
29
|
title: 'Stackable',
|
|
25
30
|
const: 'stackable'
|
|
@@ -38,7 +43,7 @@ exports.grid = {
|
|
|
38
43
|
maximum: 16
|
|
39
44
|
}
|
|
40
45
|
},
|
|
41
|
-
html: '<div class="ui [responsive] equal width [columns|num: columns] grid [width|eq:contained:container]"></div>',
|
|
46
|
+
html: '<div class="ui [responsive] [width|neq:min:equal width:] [columns|num: columns] grid [width|eq:contained:container]"></div>',
|
|
42
47
|
stylesheets: [
|
|
43
48
|
'../lib/components/grid.css'
|
|
44
49
|
]
|
|
@@ -71,7 +76,7 @@ exports.grid_row = {
|
|
|
71
76
|
title: 'Responsive',
|
|
72
77
|
anyOf: [{
|
|
73
78
|
title: 'No',
|
|
74
|
-
|
|
79
|
+
type: 'null'
|
|
75
80
|
}, {
|
|
76
81
|
title: 'Stackable',
|
|
77
82
|
const: 'stackable'
|
|
@@ -90,5 +95,5 @@ exports.grid_row = {
|
|
|
90
95
|
maximum: 16
|
|
91
96
|
}
|
|
92
97
|
},
|
|
93
|
-
html: '<div class="[responsive]
|
|
98
|
+
html: '<div class="[responsive] [columns|num: columns] row"></div>'
|
|
94
99
|
};
|
package/elements/layout.js
CHANGED
|
@@ -57,8 +57,10 @@ exports.layout = {
|
|
|
57
57
|
},
|
|
58
58
|
width: {
|
|
59
59
|
title: 'Width',
|
|
60
|
-
default: "full",
|
|
61
60
|
anyOf: [{
|
|
61
|
+
type: "null",
|
|
62
|
+
title: "None"
|
|
63
|
+
}, {
|
|
62
64
|
const: "full",
|
|
63
65
|
title: "Full"
|
|
64
66
|
}, {
|
|
@@ -92,6 +94,33 @@ exports.layout = {
|
|
|
92
94
|
const: '%'
|
|
93
95
|
}]
|
|
94
96
|
},
|
|
97
|
+
margins: {
|
|
98
|
+
title: 'Margins',
|
|
99
|
+
type: 'object',
|
|
100
|
+
nullable: true,
|
|
101
|
+
properties: {
|
|
102
|
+
inline: {
|
|
103
|
+
title: 'Inline (em)',
|
|
104
|
+
type: 'number',
|
|
105
|
+
default: 0,
|
|
106
|
+
multipleOf: 0.1,
|
|
107
|
+
nullable: true
|
|
108
|
+
},
|
|
109
|
+
inlineUnits: {
|
|
110
|
+
const: 'em'
|
|
111
|
+
},
|
|
112
|
+
block: {
|
|
113
|
+
title: 'Block (rem)',
|
|
114
|
+
type: 'number',
|
|
115
|
+
default: 0,
|
|
116
|
+
multipleOf: 0.1,
|
|
117
|
+
nullable: true
|
|
118
|
+
},
|
|
119
|
+
blockUnits: {
|
|
120
|
+
const: 'rem'
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
95
124
|
invert: {
|
|
96
125
|
title: 'Invert',
|
|
97
126
|
description: 'Invert background',
|
|
@@ -125,6 +154,7 @@ exports.layout = {
|
|
|
125
154
|
crop: {
|
|
126
155
|
title: 'Crop and scale',
|
|
127
156
|
type: "object",
|
|
157
|
+
nullable: true,
|
|
128
158
|
properties: {
|
|
129
159
|
x: {
|
|
130
160
|
type: "number",
|
|
@@ -258,6 +288,8 @@ exports.layout = {
|
|
|
258
288
|
[direction]
|
|
259
289
|
[invert|?:inverted]"
|
|
260
290
|
is="element-layout"
|
|
291
|
+
style-margin-block="[margins.block|eq:0:|not|magnet][margins.blockUnits]"
|
|
292
|
+
style-margin-inline="[margins.inline|eq:0:|not|magnet][margins.inlineUnits]"
|
|
261
293
|
style-height="[height|eq:0:|not|magnet][heightUnits]"
|
|
262
294
|
data-src="[background.image]"
|
|
263
295
|
data-crop="[background.crop.x];[background.crop.y];[background.crop.width];[background.crop.height];[background.crop.zoom]"
|
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Stickyfill – `position: sticky` polyfill
|
|
3
|
+
* v. 2.1.0 | https://github.com/wilddeer/stickyfill
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
;(function(window, document) {
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* 1. Check if the browser supports `position: sticky` natively or is too old to run the polyfill.
|
|
12
|
+
* If either of these is the case set `seppuku` flag. It will be checked later to disable key features
|
|
13
|
+
* of the polyfill, but the API will remain functional to avoid breaking things.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
17
|
+
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
|
|
20
|
+
var seppuku = false;
|
|
21
|
+
|
|
22
|
+
var isWindowDefined = typeof window !== 'undefined';
|
|
23
|
+
|
|
24
|
+
// The polyfill can’t function properly without `window` or `window.getComputedStyle`.
|
|
25
|
+
if (!isWindowDefined || !window.getComputedStyle) seppuku = true;
|
|
26
|
+
// Dont’t get in a way if the browser supports `position: sticky` natively.
|
|
27
|
+
else {
|
|
28
|
+
(function () {
|
|
29
|
+
var testNode = document.createElement('div');
|
|
30
|
+
|
|
31
|
+
if (['', '-webkit-', '-moz-', '-ms-'].some(function (prefix) {
|
|
32
|
+
try {
|
|
33
|
+
testNode.style.position = prefix + 'sticky';
|
|
34
|
+
} catch (e) {}
|
|
35
|
+
|
|
36
|
+
return testNode.style.position != '';
|
|
37
|
+
})) seppuku = true;
|
|
38
|
+
})();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* 2. “Global” vars used across the polyfill
|
|
43
|
+
*/
|
|
44
|
+
var isInitialized = false;
|
|
45
|
+
|
|
46
|
+
// Check if Shadow Root constructor exists to make further checks simpler
|
|
47
|
+
var shadowRootExists = typeof ShadowRoot !== 'undefined';
|
|
48
|
+
|
|
49
|
+
// Last saved scroll position
|
|
50
|
+
var scroll = {
|
|
51
|
+
top: null,
|
|
52
|
+
left: null
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Array of created Sticky instances
|
|
56
|
+
var stickies = [];
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* 3. Utility functions
|
|
60
|
+
*/
|
|
61
|
+
function extend(targetObj, sourceObject) {
|
|
62
|
+
for (var key in sourceObject) {
|
|
63
|
+
if (sourceObject.hasOwnProperty(key)) {
|
|
64
|
+
targetObj[key] = sourceObject[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function parseNumeric(val) {
|
|
70
|
+
return parseFloat(val) || 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getDocOffsetTop(node) {
|
|
74
|
+
var docOffsetTop = 0;
|
|
75
|
+
|
|
76
|
+
while (node) {
|
|
77
|
+
docOffsetTop += node.offsetTop;
|
|
78
|
+
node = node.offsetParent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return docOffsetTop;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
* 4. Sticky class
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
var Sticky = function () {
|
|
89
|
+
function Sticky(node) {
|
|
90
|
+
_classCallCheck(this, Sticky);
|
|
91
|
+
|
|
92
|
+
if (!(node instanceof HTMLElement)) throw new Error('First argument must be HTMLElement');
|
|
93
|
+
if (stickies.some(function (sticky) {
|
|
94
|
+
return sticky._node === node;
|
|
95
|
+
})) throw new Error('Stickyfill is already applied to this node');
|
|
96
|
+
|
|
97
|
+
this._node = node;
|
|
98
|
+
this._stickyMode = null;
|
|
99
|
+
this._active = false;
|
|
100
|
+
|
|
101
|
+
stickies.push(this);
|
|
102
|
+
|
|
103
|
+
this.refresh();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
_createClass(Sticky, [{
|
|
107
|
+
key: 'refresh',
|
|
108
|
+
value: function refresh() {
|
|
109
|
+
if (seppuku || this._removed) return;
|
|
110
|
+
if (this._active) this._deactivate();
|
|
111
|
+
|
|
112
|
+
var node = this._node;
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* 1. Save node computed props
|
|
116
|
+
*/
|
|
117
|
+
var nodeComputedStyle = getComputedStyle(node);
|
|
118
|
+
var nodeComputedProps = {
|
|
119
|
+
position: nodeComputedStyle.position,
|
|
120
|
+
top: nodeComputedStyle.top,
|
|
121
|
+
display: nodeComputedStyle.display,
|
|
122
|
+
marginTop: nodeComputedStyle.marginTop,
|
|
123
|
+
marginBottom: nodeComputedStyle.marginBottom,
|
|
124
|
+
marginLeft: nodeComputedStyle.marginLeft,
|
|
125
|
+
marginRight: nodeComputedStyle.marginRight,
|
|
126
|
+
cssFloat: nodeComputedStyle.cssFloat
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/*
|
|
130
|
+
* 2. Check if the node can be activated
|
|
131
|
+
*/
|
|
132
|
+
if (isNaN(parseFloat(nodeComputedProps.top)) || nodeComputedProps.display == 'table-cell' || nodeComputedProps.display == 'none') return;
|
|
133
|
+
|
|
134
|
+
this._active = true;
|
|
135
|
+
|
|
136
|
+
/*
|
|
137
|
+
* 3. Check if the current node position is `sticky`. If it is, it means that the browser supports sticky positioning,
|
|
138
|
+
* but the polyfill was force-enabled. We set the node’s position to `static` before continuing, so that the node
|
|
139
|
+
* is in it’s initial position when we gather its params.
|
|
140
|
+
*/
|
|
141
|
+
var originalPosition = node.style.position;
|
|
142
|
+
if (nodeComputedStyle.position == 'sticky' || nodeComputedStyle.position == '-webkit-sticky') node.style.position = 'static';
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
* 4. Get necessary node parameters
|
|
146
|
+
*/
|
|
147
|
+
var referenceNode = node.parentNode;
|
|
148
|
+
var parentNode = shadowRootExists && referenceNode instanceof ShadowRoot ? referenceNode.host : referenceNode;
|
|
149
|
+
var nodeWinOffset = node.getBoundingClientRect();
|
|
150
|
+
var parentWinOffset = parentNode.getBoundingClientRect();
|
|
151
|
+
var parentComputedStyle = getComputedStyle(parentNode);
|
|
152
|
+
|
|
153
|
+
this._parent = {
|
|
154
|
+
node: parentNode,
|
|
155
|
+
styles: {
|
|
156
|
+
position: parentNode.style.position
|
|
157
|
+
},
|
|
158
|
+
offsetHeight: parentNode.offsetHeight
|
|
159
|
+
};
|
|
160
|
+
this._offsetToWindow = {
|
|
161
|
+
left: nodeWinOffset.left,
|
|
162
|
+
right: document.documentElement.clientWidth - nodeWinOffset.right
|
|
163
|
+
};
|
|
164
|
+
this._offsetToParent = {
|
|
165
|
+
top: nodeWinOffset.top - parentWinOffset.top - parseNumeric(parentComputedStyle.borderTopWidth),
|
|
166
|
+
left: nodeWinOffset.left - parentWinOffset.left - parseNumeric(parentComputedStyle.borderLeftWidth),
|
|
167
|
+
right: -nodeWinOffset.right + parentWinOffset.right - parseNumeric(parentComputedStyle.borderRightWidth)
|
|
168
|
+
};
|
|
169
|
+
this._styles = {
|
|
170
|
+
position: originalPosition,
|
|
171
|
+
top: node.style.top,
|
|
172
|
+
bottom: node.style.bottom,
|
|
173
|
+
left: node.style.left,
|
|
174
|
+
right: node.style.right,
|
|
175
|
+
width: node.style.width,
|
|
176
|
+
marginTop: node.style.marginTop,
|
|
177
|
+
marginLeft: node.style.marginLeft,
|
|
178
|
+
marginRight: node.style.marginRight
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
var nodeTopValue = parseNumeric(nodeComputedProps.top);
|
|
182
|
+
this._limits = {
|
|
183
|
+
start: nodeWinOffset.top + window.pageYOffset - nodeTopValue,
|
|
184
|
+
end: parentWinOffset.top + window.pageYOffset + parentNode.offsetHeight - parseNumeric(parentComputedStyle.borderBottomWidth) - node.offsetHeight - nodeTopValue - parseNumeric(nodeComputedProps.marginBottom)
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/*
|
|
188
|
+
* 5. Ensure that the node will be positioned relatively to the parent node
|
|
189
|
+
*/
|
|
190
|
+
var parentPosition = parentComputedStyle.position;
|
|
191
|
+
|
|
192
|
+
if (parentPosition != 'absolute' && parentPosition != 'relative') {
|
|
193
|
+
parentNode.style.position = 'relative';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/*
|
|
197
|
+
* 6. Recalc node position.
|
|
198
|
+
* It’s important to do this before clone injection to avoid scrolling bug in Chrome.
|
|
199
|
+
*/
|
|
200
|
+
this._recalcPosition();
|
|
201
|
+
|
|
202
|
+
/*
|
|
203
|
+
* 7. Create a clone
|
|
204
|
+
*/
|
|
205
|
+
var clone = this._clone = {};
|
|
206
|
+
clone.node = document.createElement('div');
|
|
207
|
+
|
|
208
|
+
// Apply styles to the clone
|
|
209
|
+
extend(clone.node.style, {
|
|
210
|
+
width: nodeWinOffset.right - nodeWinOffset.left + 'px',
|
|
211
|
+
height: nodeWinOffset.bottom - nodeWinOffset.top + 'px',
|
|
212
|
+
marginTop: nodeComputedProps.marginTop,
|
|
213
|
+
marginBottom: nodeComputedProps.marginBottom,
|
|
214
|
+
marginLeft: nodeComputedProps.marginLeft,
|
|
215
|
+
marginRight: nodeComputedProps.marginRight,
|
|
216
|
+
cssFloat: nodeComputedProps.cssFloat,
|
|
217
|
+
padding: 0,
|
|
218
|
+
border: 0,
|
|
219
|
+
borderSpacing: 0,
|
|
220
|
+
fontSize: '1em',
|
|
221
|
+
position: 'static'
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
referenceNode.insertBefore(clone.node, node);
|
|
225
|
+
clone.docOffsetTop = getDocOffsetTop(clone.node);
|
|
226
|
+
}
|
|
227
|
+
}, {
|
|
228
|
+
key: '_recalcPosition',
|
|
229
|
+
value: function _recalcPosition() {
|
|
230
|
+
if (!this._active || this._removed) return;
|
|
231
|
+
|
|
232
|
+
var stickyMode = scroll.top <= this._limits.start ? 'start' : scroll.top >= this._limits.end ? 'end' : 'middle';
|
|
233
|
+
|
|
234
|
+
if (this._stickyMode == stickyMode) return;
|
|
235
|
+
|
|
236
|
+
switch (stickyMode) {
|
|
237
|
+
case 'start':
|
|
238
|
+
extend(this._node.style, {
|
|
239
|
+
position: 'absolute',
|
|
240
|
+
left: this._offsetToParent.left + 'px',
|
|
241
|
+
right: this._offsetToParent.right + 'px',
|
|
242
|
+
top: this._offsetToParent.top + 'px',
|
|
243
|
+
bottom: 'auto',
|
|
244
|
+
width: 'auto',
|
|
245
|
+
marginLeft: 0,
|
|
246
|
+
marginRight: 0,
|
|
247
|
+
marginTop: 0
|
|
248
|
+
});
|
|
249
|
+
break;
|
|
250
|
+
|
|
251
|
+
case 'middle':
|
|
252
|
+
extend(this._node.style, {
|
|
253
|
+
position: 'fixed',
|
|
254
|
+
left: this._offsetToWindow.left + 'px',
|
|
255
|
+
right: this._offsetToWindow.right + 'px',
|
|
256
|
+
top: this._styles.top,
|
|
257
|
+
bottom: 'auto',
|
|
258
|
+
width: 'auto',
|
|
259
|
+
marginLeft: 0,
|
|
260
|
+
marginRight: 0,
|
|
261
|
+
marginTop: 0
|
|
262
|
+
});
|
|
263
|
+
break;
|
|
264
|
+
|
|
265
|
+
case 'end':
|
|
266
|
+
extend(this._node.style, {
|
|
267
|
+
position: 'absolute',
|
|
268
|
+
left: this._offsetToParent.left + 'px',
|
|
269
|
+
right: this._offsetToParent.right + 'px',
|
|
270
|
+
top: 'auto',
|
|
271
|
+
bottom: 0,
|
|
272
|
+
width: 'auto',
|
|
273
|
+
marginLeft: 0,
|
|
274
|
+
marginRight: 0
|
|
275
|
+
});
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
this._stickyMode = stickyMode;
|
|
280
|
+
}
|
|
281
|
+
}, {
|
|
282
|
+
key: '_fastCheck',
|
|
283
|
+
value: function _fastCheck() {
|
|
284
|
+
if (!this._active || this._removed) return;
|
|
285
|
+
|
|
286
|
+
if (Math.abs(getDocOffsetTop(this._clone.node) - this._clone.docOffsetTop) > 1 || Math.abs(this._parent.node.offsetHeight - this._parent.offsetHeight) > 1) this.refresh();
|
|
287
|
+
}
|
|
288
|
+
}, {
|
|
289
|
+
key: '_deactivate',
|
|
290
|
+
value: function _deactivate() {
|
|
291
|
+
var _this = this;
|
|
292
|
+
|
|
293
|
+
if (!this._active || this._removed) return;
|
|
294
|
+
|
|
295
|
+
this._clone.node.parentNode.removeChild(this._clone.node);
|
|
296
|
+
delete this._clone;
|
|
297
|
+
|
|
298
|
+
extend(this._node.style, this._styles);
|
|
299
|
+
delete this._styles;
|
|
300
|
+
|
|
301
|
+
// Check whether element’s parent node is used by other stickies.
|
|
302
|
+
// If not, restore parent node’s styles.
|
|
303
|
+
if (!stickies.some(function (sticky) {
|
|
304
|
+
return sticky !== _this && sticky._parent && sticky._parent.node === _this._parent.node;
|
|
305
|
+
})) {
|
|
306
|
+
extend(this._parent.node.style, this._parent.styles);
|
|
307
|
+
}
|
|
308
|
+
delete this._parent;
|
|
309
|
+
|
|
310
|
+
this._stickyMode = null;
|
|
311
|
+
this._active = false;
|
|
312
|
+
|
|
313
|
+
delete this._offsetToWindow;
|
|
314
|
+
delete this._offsetToParent;
|
|
315
|
+
delete this._limits;
|
|
316
|
+
}
|
|
317
|
+
}, {
|
|
318
|
+
key: 'remove',
|
|
319
|
+
value: function remove() {
|
|
320
|
+
var _this2 = this;
|
|
321
|
+
|
|
322
|
+
this._deactivate();
|
|
323
|
+
|
|
324
|
+
stickies.some(function (sticky, index) {
|
|
325
|
+
if (sticky._node === _this2._node) {
|
|
326
|
+
stickies.splice(index, 1);
|
|
327
|
+
return true;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
this._removed = true;
|
|
332
|
+
}
|
|
333
|
+
}]);
|
|
334
|
+
|
|
335
|
+
return Sticky;
|
|
336
|
+
}();
|
|
337
|
+
|
|
338
|
+
/*
|
|
339
|
+
* 5. Stickyfill API
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
var Stickyfill = {
|
|
344
|
+
stickies: stickies,
|
|
345
|
+
Sticky: Sticky,
|
|
346
|
+
|
|
347
|
+
forceSticky: function forceSticky() {
|
|
348
|
+
seppuku = false;
|
|
349
|
+
init();
|
|
350
|
+
|
|
351
|
+
this.refreshAll();
|
|
352
|
+
},
|
|
353
|
+
addOne: function addOne(node) {
|
|
354
|
+
// Check whether it’s a node
|
|
355
|
+
if (!(node instanceof HTMLElement)) {
|
|
356
|
+
// Maybe it’s a node list of some sort?
|
|
357
|
+
// Take first node from the list then
|
|
358
|
+
if (node.length && node[0]) node = node[0];else return;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Check if Stickyfill is already applied to the node
|
|
362
|
+
// and return existing sticky
|
|
363
|
+
for (var i = 0; i < stickies.length; i++) {
|
|
364
|
+
if (stickies[i]._node === node) return stickies[i];
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// Create and return new sticky
|
|
368
|
+
return new Sticky(node);
|
|
369
|
+
},
|
|
370
|
+
add: function add(nodeList) {
|
|
371
|
+
// If it’s a node make an array of one node
|
|
372
|
+
if (nodeList instanceof HTMLElement) nodeList = [nodeList];
|
|
373
|
+
// Check if the argument is an iterable of some sort
|
|
374
|
+
if (!nodeList.length) return;
|
|
375
|
+
|
|
376
|
+
// Add every element as a sticky and return an array of created Sticky instances
|
|
377
|
+
var addedStickies = [];
|
|
378
|
+
|
|
379
|
+
var _loop = function _loop(i) {
|
|
380
|
+
var node = nodeList[i];
|
|
381
|
+
|
|
382
|
+
// If it’s not an HTMLElement – create an empty element to preserve 1-to-1
|
|
383
|
+
// correlation with input list
|
|
384
|
+
if (!(node instanceof HTMLElement)) {
|
|
385
|
+
addedStickies.push(void 0);
|
|
386
|
+
return 'continue';
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// If Stickyfill is already applied to the node
|
|
390
|
+
// add existing sticky
|
|
391
|
+
if (stickies.some(function (sticky) {
|
|
392
|
+
if (sticky._node === node) {
|
|
393
|
+
addedStickies.push(sticky);
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
})) return 'continue';
|
|
397
|
+
|
|
398
|
+
// Create and add new sticky
|
|
399
|
+
addedStickies.push(new Sticky(node));
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
for (var i = 0; i < nodeList.length; i++) {
|
|
403
|
+
var _ret2 = _loop(i);
|
|
404
|
+
|
|
405
|
+
if (_ret2 === 'continue') continue;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return addedStickies;
|
|
409
|
+
},
|
|
410
|
+
refreshAll: function refreshAll() {
|
|
411
|
+
stickies.forEach(function (sticky) {
|
|
412
|
+
return sticky.refresh();
|
|
413
|
+
});
|
|
414
|
+
},
|
|
415
|
+
removeOne: function removeOne(node) {
|
|
416
|
+
// Check whether it’s a node
|
|
417
|
+
if (!(node instanceof HTMLElement)) {
|
|
418
|
+
// Maybe it’s a node list of some sort?
|
|
419
|
+
// Take first node from the list then
|
|
420
|
+
if (node.length && node[0]) node = node[0];else return;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Remove the stickies bound to the nodes in the list
|
|
424
|
+
stickies.some(function (sticky) {
|
|
425
|
+
if (sticky._node === node) {
|
|
426
|
+
sticky.remove();
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
},
|
|
431
|
+
remove: function remove(nodeList) {
|
|
432
|
+
// If it’s a node make an array of one node
|
|
433
|
+
if (nodeList instanceof HTMLElement) nodeList = [nodeList];
|
|
434
|
+
// Check if the argument is an iterable of some sort
|
|
435
|
+
if (!nodeList.length) return;
|
|
436
|
+
|
|
437
|
+
// Remove the stickies bound to the nodes in the list
|
|
438
|
+
|
|
439
|
+
var _loop2 = function _loop2(i) {
|
|
440
|
+
var node = nodeList[i];
|
|
441
|
+
|
|
442
|
+
stickies.some(function (sticky) {
|
|
443
|
+
if (sticky._node === node) {
|
|
444
|
+
sticky.remove();
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
for (var i = 0; i < nodeList.length; i++) {
|
|
451
|
+
_loop2(i);
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
removeAll: function removeAll() {
|
|
455
|
+
while (stickies.length) {
|
|
456
|
+
stickies[0].remove();
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
/*
|
|
462
|
+
* 6. Setup events (unless the polyfill was disabled)
|
|
463
|
+
*/
|
|
464
|
+
function init() {
|
|
465
|
+
if (isInitialized) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
isInitialized = true;
|
|
470
|
+
|
|
471
|
+
// Watch for scroll position changes and trigger recalc/refresh if needed
|
|
472
|
+
function checkScroll() {
|
|
473
|
+
if (window.pageXOffset != scroll.left) {
|
|
474
|
+
scroll.top = window.pageYOffset;
|
|
475
|
+
scroll.left = window.pageXOffset;
|
|
476
|
+
|
|
477
|
+
Stickyfill.refreshAll();
|
|
478
|
+
} else if (window.pageYOffset != scroll.top) {
|
|
479
|
+
scroll.top = window.pageYOffset;
|
|
480
|
+
scroll.left = window.pageXOffset;
|
|
481
|
+
|
|
482
|
+
// recalc position for all stickies
|
|
483
|
+
stickies.forEach(function (sticky) {
|
|
484
|
+
return sticky._recalcPosition();
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
checkScroll();
|
|
490
|
+
window.addEventListener('scroll', checkScroll);
|
|
491
|
+
|
|
492
|
+
// Watch for window resizes and device orientation changes and trigger refresh
|
|
493
|
+
window.addEventListener('resize', Stickyfill.refreshAll);
|
|
494
|
+
window.addEventListener('orientationchange', Stickyfill.refreshAll);
|
|
495
|
+
|
|
496
|
+
//Fast dirty check for layout changes every 500ms
|
|
497
|
+
var fastCheckTimer = void 0;
|
|
498
|
+
|
|
499
|
+
function startFastCheckTimer() {
|
|
500
|
+
fastCheckTimer = setInterval(function () {
|
|
501
|
+
stickies.forEach(function (sticky) {
|
|
502
|
+
return sticky._fastCheck();
|
|
503
|
+
});
|
|
504
|
+
}, 500);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
function stopFastCheckTimer() {
|
|
508
|
+
clearInterval(fastCheckTimer);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
var docHiddenKey = void 0;
|
|
512
|
+
var visibilityChangeEventName = void 0;
|
|
513
|
+
|
|
514
|
+
if ('hidden' in document) {
|
|
515
|
+
docHiddenKey = 'hidden';
|
|
516
|
+
visibilityChangeEventName = 'visibilitychange';
|
|
517
|
+
} else if ('webkitHidden' in document) {
|
|
518
|
+
docHiddenKey = 'webkitHidden';
|
|
519
|
+
visibilityChangeEventName = 'webkitvisibilitychange';
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
if (visibilityChangeEventName) {
|
|
523
|
+
if (!document[docHiddenKey]) startFastCheckTimer();
|
|
524
|
+
|
|
525
|
+
document.addEventListener(visibilityChangeEventName, function () {
|
|
526
|
+
if (document[docHiddenKey]) {
|
|
527
|
+
stopFastCheckTimer();
|
|
528
|
+
} else {
|
|
529
|
+
startFastCheckTimer();
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
} else startFastCheckTimer();
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
if (!seppuku) init();
|
|
536
|
+
|
|
537
|
+
/*
|
|
538
|
+
* 7. Expose Stickyfill
|
|
539
|
+
*/
|
|
540
|
+
if (typeof module != 'undefined' && module.exports) {
|
|
541
|
+
module.exports = Stickyfill;
|
|
542
|
+
} else if (isWindowDefined) {
|
|
543
|
+
window.Stickyfill = Stickyfill;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
})(window, document);
|
package/package.json
CHANGED
package/ui/card.css
CHANGED
|
@@ -298,11 +298,11 @@
|
|
|
298
298
|
/* Icon */
|
|
299
299
|
.ui.cards > .ui > .content .star.icon {
|
|
300
300
|
cursor: pointer;
|
|
301
|
-
opacity: 75
|
|
301
|
+
opacity: 0.75;
|
|
302
302
|
transition: color 0.1s ease;
|
|
303
303
|
}
|
|
304
304
|
.ui.cards > .ui > .content .star.icon:hover {
|
|
305
|
-
opacity:
|
|
305
|
+
opacity: 1;
|
|
306
306
|
color: #FFB70A;
|
|
307
307
|
}
|
|
308
308
|
.ui.cards > .ui > .content .active.star.icon {
|
|
@@ -315,11 +315,11 @@
|
|
|
315
315
|
/* Icon */
|
|
316
316
|
.ui.cards > .ui > .content .like.icon {
|
|
317
317
|
cursor: pointer;
|
|
318
|
-
opacity: 75
|
|
318
|
+
opacity: 0.75;
|
|
319
319
|
transition: color 0.1s ease;
|
|
320
320
|
}
|
|
321
321
|
.ui.cards > .ui > .content .like.icon:hover {
|
|
322
|
-
opacity:
|
|
322
|
+
opacity: 1;
|
|
323
323
|
color: #FF2733;
|
|
324
324
|
}
|
|
325
325
|
.ui.cards > .ui > .content .active.like.icon {
|
package/ui/fieldset.css
ADDED
package/ui/item.css
CHANGED
|
@@ -244,11 +244,11 @@
|
|
|
244
244
|
/* Icon */
|
|
245
245
|
.ui.items > .ui > .content .favorite.icon {
|
|
246
246
|
cursor: pointer;
|
|
247
|
-
opacity: 75
|
|
247
|
+
opacity: 0.75;
|
|
248
248
|
transition: color 0.1s ease;
|
|
249
249
|
}
|
|
250
250
|
.ui.items > .ui > .content .favorite.icon:hover {
|
|
251
|
-
opacity:
|
|
251
|
+
opacity: 1;
|
|
252
252
|
color: #FFB70A;
|
|
253
253
|
}
|
|
254
254
|
.ui.items > .ui > .content .active.favorite.icon {
|
|
@@ -261,11 +261,11 @@
|
|
|
261
261
|
/* Icon */
|
|
262
262
|
.ui.items > .ui > .content .like.icon {
|
|
263
263
|
cursor: pointer;
|
|
264
|
-
opacity: 75
|
|
264
|
+
opacity: 0.75;
|
|
265
265
|
transition: color 0.1s ease;
|
|
266
266
|
}
|
|
267
267
|
.ui.items > .ui > .content .like.icon:hover {
|
|
268
|
-
opacity:
|
|
268
|
+
opacity: 1;
|
|
269
269
|
color: #FF2733;
|
|
270
270
|
}
|
|
271
271
|
.ui.items > .ui > .content .active.like.icon {
|
package/ui/loading.css
CHANGED
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
0% {
|
|
22
22
|
width:0%;
|
|
23
23
|
margin-left:0px;
|
|
24
|
-
opacity:
|
|
24
|
+
opacity:0.3;
|
|
25
25
|
}
|
|
26
26
|
50% {
|
|
27
27
|
width:20px;
|
|
28
28
|
margin-left:-10px;
|
|
29
|
-
opacity:
|
|
29
|
+
opacity:1;
|
|
30
30
|
}
|
|
31
31
|
100% {
|
|
32
32
|
width:0%;
|
|
33
33
|
margin-left:0px;
|
|
34
|
-
opacity:
|
|
34
|
+
opacity:0.3;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
package/ui/menu.css
CHANGED
package/ui/rating.css
CHANGED
|
@@ -101,10 +101,10 @@ element-rating.disabled .icon {
|
|
|
101
101
|
|
|
102
102
|
/* Selected Rating */
|
|
103
103
|
element-rating.selected .active.icon {
|
|
104
|
-
opacity:
|
|
104
|
+
opacity: 1;
|
|
105
105
|
}
|
|
106
106
|
element-rating .icon.selected,
|
|
107
107
|
element-rating.selected .icon.selected {
|
|
108
|
-
opacity:
|
|
108
|
+
opacity: 1;
|
|
109
109
|
}
|
|
110
110
|
|
package/ui/site.css
CHANGED
|
@@ -193,6 +193,7 @@ i.icon::before {
|
|
|
193
193
|
.caret-icon::before {
|
|
194
194
|
content: "\f0da";
|
|
195
195
|
transform: rotate(0deg);
|
|
196
|
+
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
|
|
196
197
|
font-family: Accordion;
|
|
197
198
|
font-style:normal;
|
|
198
199
|
vertical-align: top;
|
|
@@ -290,6 +291,9 @@ body .ui.inverted::-webkit-scrollbar-thumb:hover {
|
|
|
290
291
|
.ui.grid.container {
|
|
291
292
|
display:flex;
|
|
292
293
|
}
|
|
294
|
+
.ui.grid.full {
|
|
295
|
+
width: 100% !important;
|
|
296
|
+
}
|
|
293
297
|
|
|
294
298
|
/* for editor only, but semantic-ui dependent */
|
|
295
299
|
[contenteditable] .ui.buttons .disabled.button,
|
|
@@ -305,7 +309,7 @@ body .ui.inverted::-webkit-scrollbar-thumb:hover {
|
|
|
305
309
|
width: auto;
|
|
306
310
|
height: auto;
|
|
307
311
|
top: 100% !important;
|
|
308
|
-
opacity:
|
|
312
|
+
opacity: 1;
|
|
309
313
|
}
|
|
310
314
|
|
|
311
315
|
[contenteditable] .field[block-focused] .dropdown > .menu {
|
package/ui/transition.css
CHANGED
|
@@ -8,7 +8,7 @@ body::after {
|
|
|
8
8
|
top:1px;
|
|
9
9
|
width:0%;
|
|
10
10
|
height:0;
|
|
11
|
-
opacity:
|
|
11
|
+
opacity:0.7;
|
|
12
12
|
background: #4486cc;
|
|
13
13
|
box-shadow: 0 0 5px rgb(99 162 235 / 70%);
|
|
14
14
|
z-index:1000;
|
|
@@ -75,7 +75,7 @@ html.transition > body + body[data-transition-open] {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
html.transition > body + body[data-transition-open] > *:not([block-type="main"]) {
|
|
78
|
-
opacity:0
|
|
78
|
+
opacity:0;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
html.transition > body + body[data-transition-open="tr-right"] {
|
|
@@ -99,7 +99,7 @@ html.transition > body + body[data-transition-open="tr-bottom"] {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
html.transition > body + body[data-transition-open="fade"] {
|
|
102
|
-
opacity:0
|
|
102
|
+
opacity:0;
|
|
103
103
|
transition: opacity 1.5s ease-in;
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -107,7 +107,7 @@ html.transition.transitioning > body + body[data-transition-open|="tr"] {
|
|
|
107
107
|
transform: translate3d(0, 0, 0);
|
|
108
108
|
}
|
|
109
109
|
html.transition.transitioning > body + body[data-transition-open="fade"] {
|
|
110
|
-
opacity:
|
|
110
|
+
opacity:1;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/* closing transitions */
|
|
@@ -118,7 +118,7 @@ html.transition > body[data-transition-close|="tr"]:first-of-type {
|
|
|
118
118
|
|
|
119
119
|
html.transition > body[data-transition-close="fade"]:first-of-type {
|
|
120
120
|
z-index:1;
|
|
121
|
-
opacity:
|
|
121
|
+
opacity:1;
|
|
122
122
|
transition: opacity 1.5s ease-in;
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -139,6 +139,6 @@ html.transition.transitioning > body[data-transition-close="tr-bottom"]:first-of
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
html.transition.transitioning > body[data-transition-close="fade"]:first-of-type {
|
|
142
|
-
opacity:0
|
|
142
|
+
opacity:0;
|
|
143
143
|
}
|
|
144
144
|
|