isomorfeus-preact 10.6.6 → 10.6.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4633f9c0418b61fb8ab950a7f46b1c5d0ab65d0bd826e9129b426b1f537b3d82
4
- data.tar.gz: d30c7e432eeb81dc0f5f7aa7f65a6d537ced0753d85a360eec74fbad4f8582fd
3
+ metadata.gz: a8cc6c49fd65f7f76f101f4f6f8d04701b23ff77570907bf23c62d6a1065848f
4
+ data.tar.gz: 066364eca22b04a87ef58758c936ac722223eeaf70102f33e26c869019be5756
5
5
  SHA512:
6
- metadata.gz: 7fb923fed0c0d376a1963402dc349a602511499ef6879d943adbc1a73d8704adb90bc9b2d9435e4404094db706113a1149ff02b86750c4e1d2b29f8331caf5b4
7
- data.tar.gz: a1f2e1bc21c2ee699723639be60b77c7d99c197d87a29e3c99dd989a35a284490e16512e90092494a19779d0b7b85a5bcc4358a16eadd02fd929ca6c2f48faa5
6
+ metadata.gz: 7129442c4580e1729529e69ebf562f93390963f5c431f14c3cc1635e4f726765fb2de5df2f12047e71c28d452743874ee4bb8ad53a5e1dd72d83d36102a2c841
7
+ data.tar.gz: 1ed86de3e21be8dc40d639cbc1ab7cca854b495689484507b1d99db6ccadb89632e9c5ca4cd3d38e97a2a01ea7ffb5c9477ece63727e4eba59d20135503b69f8
data/README.md CHANGED
@@ -22,36 +22,36 @@ apply, but in the Ruby way, see:
22
22
  - [https://preactjs.com/guide/v10/getting-started](https://preactjs.com/guide/v10/getting-started)
23
23
 
24
24
  Component Types:
25
- - [Class Component](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/class_component.md)
26
- - [Function and Memo Component](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/function_component.md)
27
- - [Lucid App, Lucid Component](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/lucid_component.md)
28
- - [Lucid Func (for use with Hooks)](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/lucid_func_component.md)
29
- - [Preact Javascript Components and Preact Elements](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/javascript_component.md)
25
+ - [Class Component](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/class_component.md)
26
+ - [Function and Memo Component](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/function_component.md)
27
+ - [Lucid App, Lucid Component](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/lucid_component.md)
28
+ - [Lucid Func (for use with Hooks)](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/lucid_func_component.md)
29
+ - [Preact Javascript Components and Preact Elements](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/javascript_component.md)
30
30
 
31
31
  Which component to use?
32
32
  - Usually LucidApp and LucidComponent.
33
33
 
34
34
  Specific to Class, Lucid and LucidMaterial Components:
35
- - [Events](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/events.md)
36
- - [Lifecycle Callbacks](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/lifecycle_callbacks.md)
37
- - [Props](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/props.md)
38
- - [State](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/state.md)
35
+ - [Events](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/events.md)
36
+ - [Lifecycle Callbacks](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/lifecycle_callbacks.md)
37
+ - [Props](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/props.md)
38
+ - [State](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/state.md)
39
39
 
40
40
  For all Components:
41
- - [Accessibility](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/accessibility.md)
42
- - [Render Blocks](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/render_blocks.md)
43
- - [Rendering HTML or SVG Elements](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/rendering_elements.md)
41
+ - [Accessibility](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/accessibility.md)
42
+ - [Render Blocks](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/render_blocks.md)
43
+ - [Rendering HTML or SVG Elements](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/rendering_elements.md)
44
44
 
45
45
  Special Preact Features:
46
- - [Context](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/context.md)
47
- - [Fragments](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/fragments.md)
48
- - [Refs](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/refs.md)
46
+ - [Context](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/context.md)
47
+ - [Fragments](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/fragments.md)
48
+ - [Refs](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/refs.md)
49
49
 
50
50
  Other Features:
51
- - [Hot Module Reloading](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/hot_module_reloading.md)
52
- - [Server Side Rendering](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/server_side_rendering.md)
53
- - [Using Wouter as Router](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/wouter.md)
54
- - [Isomorfeus Helpers](https://github.com/isomorfeus/isomorfeus-preact/blob/master/ruby/docs/isomorfeus_helpers.md)
51
+ - [Hot Module Reloading](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/hot_module_reloading.md)
52
+ - [Server Side Rendering](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/server_side_rendering.md)
53
+ - [Using Wouter as Router](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/wouter.md)
54
+ - [Isomorfeus Helpers](https://github.com/isomorfeus/isomorfeus-preact/blob/master/docs/isomorfeus_helpers.md)
55
55
 
56
56
  ### Development Tools
57
57
  The Preact Devtools allow for analyzing, debugging and profiling components. A very helpful toolset and working very nice with isomorfeus-preact:
@@ -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'])
@@ -70,7 +70,7 @@ module LucidApp
70
70
  return Opal.global.Preact.createElement(Opal.global.LucidApplicationContext.Provider, { value: { iso_store: this.state.isomorfeus_store_state, iso_theme: base.css_theme }}, children);
71
71
  }
72
72
  data_access() {
73
- this.state.isomorfeus_store_state;
73
+ return this.state.isomorfeus_store_state;
74
74
  }
75
75
  listener() {
76
76
  let next_state = Opal.Isomorfeus.store.native.getState();
@@ -16,7 +16,6 @@ module LucidComponent
16
16
  return Opal.global.Preact.createElement(base.lucid_preact_component, Object.assign({}, props, value));
17
17
  };
18
18
  base.preact_component.displayName = #{wrapper_name};
19
-
20
19
  base.lucid_preact_component = class extends Opal.global.Preact.Component {
21
20
  constructor(props) {
22
21
  super(props);
@@ -65,7 +64,7 @@ module LucidComponent
65
64
  return (result.length === 1) ? result[0] : result;
66
65
  }
67
66
  data_access() {
68
- return this.props.iso_store;
67
+ return this.state.isomorfeus_store_state;
69
68
  }
70
69
  shouldComponentUpdate(next_props, next_state) {
71
70
  if (!Opal.Preact.props_are_equal(this.props, next_props)) { return true; }
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('Block name "' + block + '" used more than once.');
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',
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.6'
2
+ VERSION = '10.6.10'
3
3
  end
data/lib/preact.rb CHANGED
@@ -63,7 +63,7 @@ module Preact
63
63
  };
64
64
 
65
65
  self.native_to_ruby_event = function(event) {
66
- if (event.hasOwnProperty('target')) { return #{::Browser::Event.new(`event`)}; }
66
+ if ('target' in event) { return #{::Browser::Event.new(`event`)}; }
67
67
  else if (Array.isArray(event)) { return event; }
68
68
  else { return Opal.Hash.$new(event); }
69
69
  };
@@ -219,7 +219,7 @@ module Preact
219
219
  if (component.__c) { self.deep_force_update(component.__c); }
220
220
  else if (component.base) { self.update_components_from_dom(component.base); }
221
221
  };
222
-
222
+
223
223
  self.update_components_from_dom = function(node, fn) {
224
224
  let children = node.childNodes;
225
225
  for (let i=children && children.length; i--;) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-preact
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.6.6
4
+ version: 10.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-15 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.14.4
89
+ version: 0.14.5
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.14.4
96
+ version: 0.14.5
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: isomorfeus-redux
99
99
  requirement: !ruby/object:Gem::Requirement