Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@griffel/core

Package Overview
Dependencies
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@griffel/core - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

__resetCSS.cjs.js

4

index.cjs.js

@@ -32,2 +32,4 @@ 'use strict';

var __styles = require('./__styles.cjs.js');
var __resetCSS = require('./__resetCSS.cjs.js');
var __resetStyles = require('./__resetStyles.cjs.js');
var normalizeCSSBucketEntry = require('./runtime/utils/normalizeCSSBucketEntry.cjs.js');

@@ -73,2 +75,4 @@ var getStyleSheetForBucket = require('./renderer/getStyleSheetForBucket.cjs.js');

exports.__styles = __styles.__styles;
exports.__resetCSS = __resetCSS.__resetCSS;
exports.__resetStyles = __resetStyles.__resetStyles;
exports.normalizeCSSBucketEntry = normalizeCSSBucketEntry.normalizeCSSBucketEntry;

@@ -75,0 +79,0 @@ exports.styleBucketOrdering = getStyleSheetForBucket.styleBucketOrdering;

@@ -32,2 +32,4 @@ import { border, borderLeft, borderBottom, borderRight, borderTop, borderColor, borderStyle, borderRadius, borderWidth, flex, gap, gridArea, margin, padding, overflow, inset, outline, transition } from './shorthands/index';

export { __styles } from './__styles';
export { __resetCSS } from './__resetCSS';
export { __resetStyles } from './__resetStyles';
export { normalizeCSSBucketEntry } from './runtime/utils/normalizeCSSBucketEntry';

@@ -34,0 +36,0 @@ export { styleBucketOrdering } from './renderer/getStyleSheetForBucket';

@@ -28,2 +28,4 @@ import { border } from './shorthands/border.esm.js';

export { __styles } from './__styles.esm.js';
export { __resetCSS } from './__resetCSS.esm.js';
export { __resetStyles } from './__resetStyles.esm.js';
export { normalizeCSSBucketEntry } from './runtime/utils/normalizeCSSBucketEntry.esm.js';

@@ -30,0 +32,0 @@ export { styleBucketOrdering } from './renderer/getStyleSheetForBucket.esm.js';

2

package.json
{
"name": "@griffel/core",
"version": "1.7.0",
"version": "1.8.0",
"description": "DOM implementation of Atomic CSS-in-JS",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -8,3 +8,2 @@ 'use strict';

var constants = require('../constants.cjs.js');
var compileCSS = require('./compileCSS.cjs.js');
var isMediaQuerySelector = require('./utils/isMediaQuerySelector.cjs.js');

@@ -16,2 +15,4 @@ var isLayerSelector = require('./utils/isLayerSelector.cjs.js');

var hyphenateProperty = require('./utils/hyphenateProperty.cjs.js');
var compileCSS = require('./compileCSS.cjs.js');
var compileKeyframeCSS = require('./compileKeyframeCSS.cjs.js');

@@ -47,5 +48,24 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

if (property === 'animationName') {
// TODO: handle animations
throw new Error();
if (property === 'animationName' && typeof value === 'object') {
const values = Array.isArray(value) ? value : [value];
const ltrAnimationNames = [];
const rtlAnimationNames = [];
for (const keyframeObject of values) {
const ltrKeyframeRule = compileKeyframeCSS.compileKeyframeRule(keyframeObject);
const rtlKeyframeRule = compileKeyframeCSS.compileKeyframeRule(core.convert(keyframeObject));
const ltrAnimationName = constants.RESET_HASH_PREFIX + hashString__default["default"](ltrKeyframeRule);
const rtlAnimationName = constants.RESET_HASH_PREFIX + hashString__default["default"](rtlKeyframeRule);
ltrAnimationNames.push(ltrAnimationName);
rtlAnimationNames.push(rtlAnimationName);
ltrCSS += compileKeyframeCSS.compileKeyframesCSS(ltrAnimationName, ltrKeyframeRule).join('');
if (ltrAnimationName !== rtlAnimationName) {
rtlCSS += compileKeyframeCSS.compileKeyframesCSS(rtlAnimationName, rtlKeyframeRule).join('');
}
}
ltrCSS += `animation-name:${ltrAnimationNames.join(',')};`;
rtlCSS += `animation-name:${rtlAnimationNames.join(',')};`;
continue;
}

@@ -52,0 +72,0 @@

import hashString from '@emotion/hash';
import { convertProperty } from 'rtl-css-js/core';
import { convertProperty, convert } from 'rtl-css-js/core';
import { RESET_HASH_PREFIX } from '../constants.esm.js';
import { compileCSSRules, normalizePseudoSelector } from './compileCSS.esm.js';
import { isMediaQuerySelector } from './utils/isMediaQuerySelector.esm.js';

@@ -11,2 +10,4 @@ import { isLayerSelector } from './utils/isLayerSelector.esm.js';

import { hyphenateProperty } from './utils/hyphenateProperty.esm.js';
import { compileCSSRules, normalizePseudoSelector } from './compileCSS.esm.js';
import { compileKeyframeRule, compileKeyframesCSS } from './compileKeyframeCSS.esm.js';

@@ -38,5 +39,24 @@ /**

if (property === 'animationName') {
// TODO: handle animations
throw new Error();
if (property === 'animationName' && typeof value === 'object') {
const values = Array.isArray(value) ? value : [value];
const ltrAnimationNames = [];
const rtlAnimationNames = [];
for (const keyframeObject of values) {
const ltrKeyframeRule = compileKeyframeRule(keyframeObject);
const rtlKeyframeRule = compileKeyframeRule(convert(keyframeObject));
const ltrAnimationName = RESET_HASH_PREFIX + hashString(ltrKeyframeRule);
const rtlAnimationName = RESET_HASH_PREFIX + hashString(rtlKeyframeRule);
ltrAnimationNames.push(ltrAnimationName);
rtlAnimationNames.push(rtlAnimationName);
ltrCSS += compileKeyframesCSS(ltrAnimationName, ltrKeyframeRule).join('');
if (ltrAnimationName !== rtlAnimationName) {
rtlCSS += compileKeyframesCSS(rtlAnimationName, rtlKeyframeRule).join('');
}
}
ltrCSS += `animation-name:${ltrAnimationNames.join(',')};`;
rtlCSS += `animation-name:${rtlAnimationNames.join(',')};`;
continue;
}

@@ -43,0 +63,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc