@griffel/core
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -8,2 +8,3 @@ 'use strict'; | ||
var isDevToolsEnabled = require('./devtools/isDevToolsEnabled.cjs.js'); | ||
var getSourceURLfromError = require('./devtools/getSourceURLfromError.cjs.js'); | ||
var reduceToClassNameForSlots = require('./runtime/reduceToClassNameForSlots.cjs.js'); | ||
@@ -21,3 +22,8 @@ | ||
let rtlClassNamesForSlots = null; | ||
let sourceURL; | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled.isDevToolsEnabled) { | ||
sourceURL = getSourceURLfromError.getSourceURLfromError(); | ||
} | ||
function computeClasses(options) { | ||
@@ -50,3 +56,3 @@ const { | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled.isDevToolsEnabled) { | ||
store.debugData.addSequenceDetails(classNamesForSlots); | ||
store.debugData.addSequenceDetails(classNamesForSlots, sourceURL); | ||
} | ||
@@ -53,0 +59,0 @@ |
import './constants.esm.js'; | ||
import { debugData } from './devtools/store.esm.js'; | ||
import { isDevToolsEnabled } from './devtools/isDevToolsEnabled.esm.js'; | ||
import { getSourceURLfromError } from './devtools/getSourceURLfromError.esm.js'; | ||
import { reduceToClassNameForSlots } from './runtime/reduceToClassNameForSlots.esm.js'; | ||
@@ -16,3 +17,8 @@ | ||
let rtlClassNamesForSlots = null; | ||
let sourceURL; | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled) { | ||
sourceURL = getSourceURLfromError(); | ||
} | ||
function computeClasses(options) { | ||
@@ -45,3 +51,3 @@ const { | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled) { | ||
debugData.addSequenceDetails(classNamesForSlots); | ||
debugData.addSequenceDetails(classNamesForSlots, sourceURL); | ||
} | ||
@@ -48,0 +54,0 @@ |
@@ -42,2 +42,3 @@ 'use strict'; | ||
node.slot = mapData.slotName; | ||
node.sourceURL = mapData.sourceURL; | ||
} | ||
@@ -44,0 +45,0 @@ |
@@ -38,2 +38,3 @@ import { DEFINITION_LOOKUP_TABLE } from '../constants.esm.js'; | ||
node.slot = mapData.slotName; | ||
node.sourceURL = mapData.sourceURL; | ||
} | ||
@@ -40,0 +41,0 @@ |
export { injectDevTools } from './injectDevTools'; | ||
export { isDevToolsEnabled } from './isDevToolsEnabled'; | ||
export { debugData } from './store'; | ||
export { getSourceURLfromError } from './getSourceURLfromError'; | ||
export type { DebugCSSRules, DebugSequence, DebugResult } from './types'; |
@@ -9,3 +9,3 @@ 'use strict'; | ||
const sequenceDetails = {}; | ||
const cssRules = []; | ||
const cssRules = /*#__PURE__*/new Set(); | ||
const debugData = { | ||
@@ -23,8 +23,9 @@ getChildrenSequences: debugSequenceHash => { | ||
addCSSRule: rule => { | ||
cssRules.push(rule); | ||
cssRules.add(rule); | ||
}, | ||
addSequenceDetails: classNamesForSlots => { | ||
addSequenceDetails: (classNamesForSlots, sourceURL) => { | ||
Object.entries(classNamesForSlots).forEach(([slotName, sequenceHash]) => { | ||
sequenceDetails[sequenceHash.substring(0, constants.SEQUENCE_SIZE)] = { | ||
slotName | ||
slotName, | ||
sourceURL | ||
}; | ||
@@ -34,3 +35,3 @@ }); | ||
getCSSRules: () => { | ||
return cssRules; | ||
return Array.from(cssRules); | ||
}, | ||
@@ -37,0 +38,0 @@ getSequenceDetails: sequenceHash => { |
@@ -1,4 +0,5 @@ | ||
import { SequenceHash } from '../types'; | ||
import type { SequenceHash } from '../types'; | ||
declare const sequenceDetails: Record<SequenceHash, { | ||
slotName: string; | ||
sourceURL?: string; | ||
}>; | ||
@@ -8,3 +9,3 @@ export declare const debugData: { | ||
addCSSRule: (rule: string) => void; | ||
addSequenceDetails: <Slots extends string | number>(classNamesForSlots: Record<Slots, string>) => void; | ||
addSequenceDetails: <Slots extends string | number>(classNamesForSlots: Record<Slots, string>, sourceURL?: string | undefined) => void; | ||
getCSSRules: () => string[]; | ||
@@ -11,0 +12,0 @@ getSequenceDetails: (sequenceHash: SequenceHash) => typeof sequenceDetails[string] | undefined; |
@@ -5,3 +5,3 @@ import { SEQUENCE_PREFIX, SEQUENCE_SIZE } from '../constants.esm.js'; | ||
const sequenceDetails = {}; | ||
const cssRules = []; | ||
const cssRules = /*#__PURE__*/new Set(); | ||
const debugData = { | ||
@@ -19,8 +19,9 @@ getChildrenSequences: debugSequenceHash => { | ||
addCSSRule: rule => { | ||
cssRules.push(rule); | ||
cssRules.add(rule); | ||
}, | ||
addSequenceDetails: classNamesForSlots => { | ||
addSequenceDetails: (classNamesForSlots, sourceURL) => { | ||
Object.entries(classNamesForSlots).forEach(([slotName, sequenceHash]) => { | ||
sequenceDetails[sequenceHash.substring(0, SEQUENCE_SIZE)] = { | ||
slotName | ||
slotName, | ||
sourceURL | ||
}; | ||
@@ -30,3 +31,3 @@ }); | ||
getCSSRules: () => { | ||
return cssRules; | ||
return Array.from(cssRules); | ||
}, | ||
@@ -33,0 +34,0 @@ getSequenceDetails: sequenceHash => { |
@@ -21,3 +21,4 @@ import { SequenceHash } from '../types'; | ||
rules?: DebugCSSRules; | ||
sourceURL?: string; | ||
}; | ||
export declare type DebugResult = DebugSequence; |
@@ -8,2 +8,3 @@ 'use strict'; | ||
var isDevToolsEnabled = require('./devtools/isDevToolsEnabled.cjs.js'); | ||
var getSourceURLfromError = require('./devtools/getSourceURLfromError.cjs.js'); | ||
var resolveStyleRulesForSlots = require('./resolveStyleRulesForSlots.cjs.js'); | ||
@@ -18,3 +19,8 @@ var reduceToClassNameForSlots = require('./runtime/reduceToClassNameForSlots.cjs.js'); | ||
let rtlClassNamesForSlots = null; | ||
let sourceURL; | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled.isDevToolsEnabled) { | ||
sourceURL = getSourceURLfromError.getSourceURLfromError(); | ||
} | ||
function computeClasses(options) { | ||
@@ -52,3 +58,3 @@ const { | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled.isDevToolsEnabled) { | ||
store.debugData.addSequenceDetails(classNamesForSlots); | ||
store.debugData.addSequenceDetails(classNamesForSlots, sourceURL); | ||
} | ||
@@ -55,0 +61,0 @@ |
import './constants.esm.js'; | ||
import { debugData } from './devtools/store.esm.js'; | ||
import { isDevToolsEnabled } from './devtools/isDevToolsEnabled.esm.js'; | ||
import { getSourceURLfromError } from './devtools/getSourceURLfromError.esm.js'; | ||
import { resolveStyleRulesForSlots } from './resolveStyleRulesForSlots.esm.js'; | ||
@@ -13,3 +14,8 @@ import { reduceToClassNameForSlots } from './runtime/reduceToClassNameForSlots.esm.js'; | ||
let rtlClassNamesForSlots = null; | ||
let sourceURL; | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled) { | ||
sourceURL = getSourceURLfromError(); | ||
} | ||
function computeClasses(options) { | ||
@@ -47,3 +53,3 @@ const { | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled) { | ||
debugData.addSequenceDetails(classNamesForSlots); | ||
debugData.addSequenceDetails(classNamesForSlots, sourceURL); | ||
} | ||
@@ -50,0 +56,0 @@ |
{ | ||
"name": "@griffel/core", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "DOM implementation of Atomic CSS-in-JS", | ||
@@ -14,3 +14,3 @@ "license": "MIT", | ||
"csstype": "^3.0.10", | ||
"rtl-css-js": "^1.15.0", | ||
"rtl-css-js": "^1.16.0", | ||
"stylis": "^4.0.13", | ||
@@ -17,0 +17,0 @@ "tslib": "^2.1.0" |
@@ -6,2 +6,5 @@ 'use strict'; | ||
var createIsomorphicStyleSheet = require('./createIsomorphicStyleSheet.cjs.js'); | ||
require('../constants.cjs.js'); | ||
var store = require('../devtools/store.cjs.js'); | ||
var isDevToolsEnabled = require('../devtools/isDevToolsEnabled.cjs.js'); | ||
@@ -43,2 +46,6 @@ // https://github.com/styletron/styletron/blob/e0fcae826744eb00ce679ac613a1b10d44256660/packages/styletron-engine-atomic/src/client/client.js#L8 | ||
renderer.insertionCache[cssRule] = bucketName; | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled.isDevToolsEnabled) { | ||
store.debugData.addCSSRule(cssRule); | ||
} | ||
} | ||
@@ -45,0 +52,0 @@ }); |
import { createIsomorphicStyleSheetFromElement } from './createIsomorphicStyleSheet.esm.js'; | ||
import '../constants.esm.js'; | ||
import { debugData } from '../devtools/store.esm.js'; | ||
import { isDevToolsEnabled } from '../devtools/isDevToolsEnabled.esm.js'; | ||
@@ -38,2 +41,6 @@ // https://github.com/styletron/styletron/blob/e0fcae826744eb00ce679ac613a1b10d44256660/packages/styletron-engine-atomic/src/client/client.js#L8 | ||
renderer.insertionCache[cssRule] = bucketName; | ||
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled) { | ||
debugData.addCSSRule(cssRule); | ||
} | ||
} | ||
@@ -40,0 +47,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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
492204
294
4555
34
Updatedrtl-css-js@^1.16.0