@navita/engine 0.1.1 → 0.1.3

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.
@@ -8,7 +8,7 @@ function splitStyleBlocks(blocks) {
8
8
  const rules = [];
9
9
  const lowPrioRules = [];
10
10
  for (const block of blocks){
11
- if (block.media || block.support) {
11
+ if (block.media || block.support || block.container) {
12
12
  atRules.push(block);
13
13
  continue;
14
14
  }
@@ -6,7 +6,7 @@ function splitStyleBlocks(blocks) {
6
6
  const rules = [];
7
7
  const lowPrioRules = [];
8
8
  for (const block of blocks){
9
- if (block.media || block.support) {
9
+ if (block.media || block.support || block.container) {
10
10
  atRules.push(block);
11
11
  continue;
12
12
  }
@@ -5,8 +5,8 @@ var identifiers_alphaIDGenerator = require('./alphaIDGenerator.cjs');
5
5
  class PropertyValueIDGenerator {
6
6
  property = new identifiers_alphaIDGenerator.AlphaIDGenerator();
7
7
  cache = {};
8
- next({ property , media ='' , support ='' , pseudo ='' , value }) {
9
- const propertyKey = `${media}${support}${pseudo}${property}`;
8
+ next({ property , media ='' , support ='' , container ='' , pseudo ='' , value }) {
9
+ const propertyKey = `m${media}s${support}c${container}ps${pseudo}p${property}`;
10
10
  if (this.cache[propertyKey] === undefined) {
11
11
  this.cache[propertyKey] = {
12
12
  key: this.property.next(),
@@ -3,8 +3,8 @@ import { AlphaIDGenerator } from './alphaIDGenerator.mjs';
3
3
  class PropertyValueIDGenerator {
4
4
  property = new AlphaIDGenerator();
5
5
  cache = {};
6
- next({ property , media ='' , support ='' , pseudo ='' , value }) {
7
- const propertyKey = `${media}${support}${pseudo}${property}`;
6
+ next({ property , media ='' , support ='' , container ='' , pseudo ='' , value }) {
7
+ const propertyKey = `m${media}s${support}c${container}ps${pseudo}p${property}`;
8
8
  if (this.cache[propertyKey] === undefined) {
9
9
  this.cache[propertyKey] = {
10
10
  key: this.property.next(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navita/engine",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Navitas CSS-in-JS engine",
5
5
  "keywords": [
6
6
  "css-in-js",
@@ -4,7 +4,7 @@ var createSort = require('sort-css-media-queries/lib/create-sort.js');
4
4
 
5
5
  const sortCSSMediaQueries = createSort();
6
6
  function sortAtRules(blocks) {
7
- return blocks.sort((a, b)=>sortCSSMediaQueries(a.media, b.media) || a.support.localeCompare(b.support));
7
+ return blocks.sort((a, b)=>sortCSSMediaQueries(a.media, b.media) || sortCSSMediaQueries(a.container, b.container) || a.support.localeCompare(b.support));
8
8
  }
9
9
 
10
10
  exports.sortAtRules = sortAtRules;
@@ -2,7 +2,7 @@ import createSort from 'sort-css-media-queries/lib/create-sort.js';
2
2
 
3
3
  const sortCSSMediaQueries = createSort();
4
4
  function sortAtRules(blocks) {
5
- return blocks.sort((a, b)=>sortCSSMediaQueries(a.media, b.media) || a.support.localeCompare(b.support));
5
+ return blocks.sort((a, b)=>sortCSSMediaQueries(a.media, b.media) || sortCSSMediaQueries(a.container, b.container) || a.support.localeCompare(b.support));
6
6
  }
7
7
 
8
8
  export { sortAtRules };