isomorfeus-preact 10.6.7 → 10.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/preact/imports.rb +1 -0
- data/lib/nano_css.rb +57 -57
- data/lib/preact/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5757a53a68a0b01e3f2b9ac36e1fd96cfdeeceb479c7d7db04b45f7ce50c5e3d
|
4
|
+
data.tar.gz: 983b3d47c597cc1843c2db9022d96258155bd99b73fe38e78b74ea1b5f9fd68b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71b008c2f87eb8d66bb1986f9b9e1fb9296768a3a60f3e023c50c14e5f65e178e000fc3ea42134272a2182720a85228e64bb7d11dfc0e408cad0563f9ec5e549
|
7
|
+
data.tar.gz: f8d133a89b1a835add5e17b408d76cc359d52d8daa513606a50aafc9079689d087d7416236f5fa6100c0a70c788c02ef24ae58b6084bd1a13785b19b6dee4c46
|
@@ -2,6 +2,7 @@ module Isomorfeus
|
|
2
2
|
module Preact
|
3
3
|
module Imports
|
4
4
|
def self.add
|
5
|
+
Isomorfeus.add_web_js_import('preact/debug') if Isomorfeus.development?
|
5
6
|
Isomorfeus.add_common_js_import('preact', 'Preact', '*')
|
6
7
|
Isomorfeus.add_common_js_import('preact/hooks', 'PreactHooks', '*')
|
7
8
|
Isomorfeus.add_common_js_import('wouter-preact', nil, ['Router', 'Link', 'Redirect', 'Route', 'Switch'])
|
data/lib/nano_css.rb
CHANGED
@@ -64,7 +64,7 @@ module NanoCSS
|
|
64
64
|
var sheet = renderer.sh.sheet;
|
65
65
|
|
66
66
|
// Unknown pseudo-selectors will throw, this try/catch swallows all errors.
|
67
|
-
try { sheet.insertRule(rawCssRule, sheet.cssRules.length); }
|
67
|
+
try { sheet.insertRule(rawCssRule, sheet.cssRules.length); }
|
68
68
|
catch (error) {}
|
69
69
|
} else {
|
70
70
|
// Test if .insertRule() works in dev mode. Unknown pseudo-selectors will throw when
|
@@ -126,8 +126,8 @@ module NanoCSS
|
|
126
126
|
|
127
127
|
return renderer;
|
128
128
|
};
|
129
|
-
}
|
130
|
-
|
129
|
+
}
|
130
|
+
|
131
131
|
# addons
|
132
132
|
|
133
133
|
%x{
|
@@ -136,7 +136,7 @@ module NanoCSS
|
|
136
136
|
if (process.env.NODE_ENV !== 'production') {
|
137
137
|
blocks = {};
|
138
138
|
}
|
139
|
-
|
139
|
+
|
140
140
|
renderer.rule = function (css, block) {
|
141
141
|
// Warn user if CSS selectors clash.
|
142
142
|
if (process.env.NODE_ENV !== 'production') {
|
@@ -147,36 +147,36 @@ module NanoCSS
|
|
147
147
|
'For example, use nano.rule({color: "red"}, "RedText").'
|
148
148
|
);
|
149
149
|
}
|
150
|
-
|
150
|
+
|
151
151
|
if (blocks[block]) {
|
152
|
-
console.error('
|
152
|
+
console.error('nano-css block name "' + block + '" used more than once.');
|
153
153
|
}
|
154
|
-
|
154
|
+
|
155
155
|
blocks[block] = 1;
|
156
156
|
}
|
157
157
|
}
|
158
|
-
|
158
|
+
|
159
159
|
block = block || renderer.hash(css);
|
160
160
|
block = renderer.pfx + block;
|
161
161
|
renderer.put('.' + block, css);
|
162
|
-
|
162
|
+
|
163
163
|
return ' ' + block;
|
164
164
|
};
|
165
165
|
};
|
166
166
|
}
|
167
167
|
|
168
168
|
%x{
|
169
|
-
self.sheet = function (renderer) {
|
169
|
+
self.sheet = function (renderer) {
|
170
170
|
renderer.sheet = function (map, block) {
|
171
171
|
var result = {};
|
172
|
-
|
172
|
+
|
173
173
|
if (!block) {
|
174
174
|
block = renderer.hash(map);
|
175
175
|
}
|
176
|
-
|
176
|
+
|
177
177
|
var onElementModifier = function (elementModifier) {
|
178
178
|
var styles = map[elementModifier];
|
179
|
-
|
179
|
+
|
180
180
|
if ((process.env.NODE_ENV !== 'production') && renderer.sourcemaps) {
|
181
181
|
// In dev mode emit CSS immediately to generate sourcemaps.
|
182
182
|
result[elementModifier] = renderer.rule(styles, block + '-' + elementModifier);
|
@@ -186,22 +186,22 @@ module NanoCSS
|
|
186
186
|
enumerable: true,
|
187
187
|
get: function () {
|
188
188
|
var classNames = renderer.rule(styles, block + '-' + elementModifier);
|
189
|
-
|
189
|
+
|
190
190
|
Object.defineProperty(result, elementModifier, {
|
191
191
|
value: classNames,
|
192
192
|
enumerable: true
|
193
193
|
});
|
194
|
-
|
194
|
+
|
195
195
|
return classNames;
|
196
196
|
},
|
197
197
|
});
|
198
198
|
}
|
199
199
|
};
|
200
|
-
|
200
|
+
|
201
201
|
for (var elementModifier in map) {
|
202
202
|
onElementModifier(elementModifier);
|
203
203
|
}
|
204
|
-
|
204
|
+
|
205
205
|
return result;
|
206
206
|
};
|
207
207
|
};
|
@@ -216,11 +216,11 @@ module NanoCSS
|
|
216
216
|
var len1 = parents.length;
|
217
217
|
var len2 = selectors.length;
|
218
218
|
var i, j, sel, pos, parent, replacedSelector;
|
219
|
-
|
219
|
+
|
220
220
|
for (i = 0; i < len2; i++) {
|
221
221
|
sel = selectors[i];
|
222
222
|
pos = sel.indexOf('&');
|
223
|
-
|
223
|
+
|
224
224
|
if (pos > -1) {
|
225
225
|
for (j = 0; j < len1; j++) {
|
226
226
|
parent = parents[j];
|
@@ -230,7 +230,7 @@ module NanoCSS
|
|
230
230
|
} else {
|
231
231
|
for (j = 0; j < len1; j++) {
|
232
232
|
parent = parents[j];
|
233
|
-
|
233
|
+
|
234
234
|
if (parent) {
|
235
235
|
result.push(parent + ' ' + sel);
|
236
236
|
} else {
|
@@ -239,7 +239,7 @@ module NanoCSS
|
|
239
239
|
}
|
240
240
|
}
|
241
241
|
}
|
242
|
-
|
242
|
+
|
243
243
|
return result.join(',');
|
244
244
|
};
|
245
245
|
};
|
@@ -248,28 +248,28 @@ module NanoCSS
|
|
248
248
|
%x{
|
249
249
|
self.hydrate = function (renderer) {
|
250
250
|
var hydrated = {};
|
251
|
-
|
251
|
+
|
252
252
|
renderer.hydrate = function (sh) {
|
253
253
|
var cssRules = sh.cssRules || sh.sheet.cssRules;
|
254
|
-
|
254
|
+
|
255
255
|
for (var i = 0; i < cssRules.length; i++)
|
256
256
|
hydrated[cssRules[i].selectorText] = 1;
|
257
257
|
};
|
258
|
-
|
258
|
+
|
259
259
|
if (renderer.client) {
|
260
260
|
if (renderer.sh) renderer.hydrate(renderer.sh);
|
261
|
-
|
261
|
+
|
262
262
|
var put = renderer.put;
|
263
|
-
|
263
|
+
|
264
264
|
renderer.put = function (selector, css) {
|
265
265
|
if (selector in hydrated) return;
|
266
|
-
|
266
|
+
|
267
267
|
put(selector, css);
|
268
268
|
};
|
269
269
|
}
|
270
270
|
};
|
271
271
|
}
|
272
|
-
|
272
|
+
|
273
273
|
%x{
|
274
274
|
var UNITLESS_NUMBER_PROPS = [
|
275
275
|
'animation-iteration-count',
|
@@ -305,7 +305,7 @@ module NanoCSS
|
|
305
305
|
'widows',
|
306
306
|
'z-index',
|
307
307
|
'zoom',
|
308
|
-
|
308
|
+
|
309
309
|
// SVG-related properties
|
310
310
|
'fill-opacity',
|
311
311
|
'flood-opacity',
|
@@ -316,34 +316,34 @@ module NanoCSS
|
|
316
316
|
'stroke-opacity',
|
317
317
|
'stroke-width',
|
318
318
|
];
|
319
|
-
|
319
|
+
|
320
320
|
var unitlessCssProperties = {};
|
321
|
-
|
321
|
+
|
322
322
|
for (var i = 0; i < UNITLESS_NUMBER_PROPS.length; i++) {
|
323
323
|
var prop = UNITLESS_NUMBER_PROPS[i];
|
324
|
-
|
324
|
+
|
325
325
|
unitlessCssProperties[prop] = 1;
|
326
326
|
unitlessCssProperties['-webkit-' + prop] = 1;
|
327
327
|
unitlessCssProperties['-ms-' + prop] = 1;
|
328
328
|
unitlessCssProperties['-moz-' + prop] = 1;
|
329
329
|
unitlessCssProperties['-o-' + prop] = 1;
|
330
330
|
}
|
331
|
-
|
331
|
+
|
332
332
|
self.unitless = function (renderer) {
|
333
333
|
var decl = renderer.decl;
|
334
|
-
|
334
|
+
|
335
335
|
renderer.decl = function (prop, value) {
|
336
336
|
var str = decl(prop, value);
|
337
|
-
|
337
|
+
|
338
338
|
if (typeof value === 'number') {
|
339
339
|
var pos = str.indexOf(':');
|
340
340
|
var propKebab = str.substr(0, pos);
|
341
|
-
|
341
|
+
|
342
342
|
if (!unitlessCssProperties[propKebab]) {
|
343
343
|
return decl(prop, value + 'px');
|
344
344
|
}
|
345
345
|
}
|
346
|
-
|
346
|
+
|
347
347
|
return str;
|
348
348
|
};
|
349
349
|
};
|
@@ -352,13 +352,13 @@ module NanoCSS
|
|
352
352
|
%x{
|
353
353
|
self.global = function (renderer) {
|
354
354
|
var selector = renderer.selector;
|
355
|
-
|
355
|
+
|
356
356
|
renderer.selector = function (parent, current) {
|
357
357
|
if (parent.indexOf(':global') > -1) parent = '';
|
358
|
-
|
358
|
+
|
359
359
|
return selector(parent, current);
|
360
360
|
};
|
361
|
-
|
361
|
+
|
362
362
|
renderer.global = function (css) {
|
363
363
|
return renderer.put('', css);
|
364
364
|
};
|
@@ -366,58 +366,58 @@ module NanoCSS
|
|
366
366
|
}
|
367
367
|
|
368
368
|
%x{
|
369
|
-
self.keyframes = function (renderer, config) {
|
369
|
+
self.keyframes = function (renderer, config) {
|
370
370
|
config = renderer.assign({
|
371
371
|
prefixes: ['-webkit-', '-moz-', '-o-', ''],
|
372
372
|
}, config || {});
|
373
|
-
|
373
|
+
|
374
374
|
var prefixes = config.prefixes;
|
375
|
-
|
375
|
+
|
376
376
|
if (renderer.client) {
|
377
377
|
// Craete @keyframe Stylesheet `ksh`.
|
378
378
|
document.head.appendChild(renderer.ksh = document.createElement('style'));
|
379
379
|
}
|
380
|
-
|
380
|
+
|
381
381
|
var putAt = renderer.putAt;
|
382
|
-
|
382
|
+
|
383
383
|
renderer.putAt = function (__, keyframes, prelude) {
|
384
384
|
// @keyframes
|
385
385
|
if (prelude[1] === 'k') {
|
386
386
|
var str = '';
|
387
|
-
|
387
|
+
|
388
388
|
for (var keyframe in keyframes) {
|
389
389
|
var decls = keyframes[keyframe];
|
390
390
|
var strDecls = '';
|
391
|
-
|
391
|
+
|
392
392
|
for (var prop in decls)
|
393
393
|
strDecls += renderer.decl(prop, decls[prop]);
|
394
|
-
|
394
|
+
|
395
395
|
str += keyframe + '{' + strDecls + '}';
|
396
396
|
}
|
397
|
-
|
397
|
+
|
398
398
|
for (var i = 0; i < prefixes.length; i++) {
|
399
399
|
var prefix = prefixes[i];
|
400
400
|
var rawKeyframes = prelude.replace('@keyframes', '@' + prefix + 'keyframes') + '{' + str + '}';
|
401
|
-
|
401
|
+
|
402
402
|
if (renderer.client) {
|
403
403
|
renderer.ksh.appendChild(document.createTextNode(rawKeyframes));
|
404
404
|
} else {
|
405
405
|
renderer.putRaw(rawKeyframes);
|
406
406
|
}
|
407
407
|
}
|
408
|
-
|
408
|
+
|
409
409
|
return;
|
410
410
|
}
|
411
|
-
|
411
|
+
|
412
412
|
putAt(__, keyframes, prelude);
|
413
413
|
};
|
414
|
-
|
414
|
+
|
415
415
|
renderer.keyframes = function (keyframes, block) {
|
416
416
|
if (!block) block = renderer.hash(keyframes);
|
417
417
|
block = renderer.pfx + block;
|
418
|
-
|
418
|
+
|
419
419
|
renderer.putAt('', keyframes, '@keyframes ' + block);
|
420
|
-
|
420
|
+
|
421
421
|
return block;
|
422
422
|
};
|
423
423
|
};
|
@@ -434,7 +434,7 @@ module NanoCSS
|
|
434
434
|
opacity: 1,
|
435
435
|
}
|
436
436
|
},
|
437
|
-
|
437
|
+
|
438
438
|
'.fadeIn': {
|
439
439
|
animation: 'fadeIn .4s linear',
|
440
440
|
}
|
@@ -453,7 +453,7 @@ module NanoCSS
|
|
453
453
|
opacity: 0,
|
454
454
|
}
|
455
455
|
},
|
456
|
-
|
456
|
+
|
457
457
|
'.fadeOut': {
|
458
458
|
animation: 'fadeOut .3s linear',
|
459
459
|
'animation-fill-mode': 'forwards',
|
data/lib/preact/version.rb
CHANGED