New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@design-sync/w3c-dtfm

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@design-sync/w3c-dtfm - npm Package Compare versions

Comparing version 0.9.1 to 0.10.0

66

dist/index.d.ts

@@ -0,1 +1,2 @@

import { camelCase } from '@design-sync/utils';
import * as culori_fn from 'culori/fn';

@@ -130,4 +131,6 @@ import { Color as Color$1 } from 'culori/fn';

declare function tokenAliasToCssVarName(path: string, prefix?: string): string;
declare function pathToStyleName(path: string, camel?: boolean, count?: number): string;
declare function pathToCssVarName(path: string, prefix?: string): string;
declare function processCssVarRef(tokenValue: string | number, prefix?: string, defaultValue?: string): string | number;
declare function tokenPathToStyleName(path: string, textTransform?: typeof camelCase, count?: number): string;
declare function tokenValueToCssValue(tokenValue: unknown): unknown;

@@ -249,3 +252,3 @@ declare function colorToCssValue(color?: TokenDefinition<'color'>['$value']): string;

declare function processJSKey(key: string): string;
declare function correctJSObjectKey(path: string): string;
declare function correctJSObjectPath(path: string): string;
declare function processJSValue(value: unknown): string | null | undefined;

@@ -265,3 +268,3 @@ declare function processCSSKey(key: string): string;

type TokenIterator<T> = (data: ProcessedDesignToken) => T;
type TokenIterator<T> = (token: WalkerDesignToken) => T;
declare const DEFAULT_MODE = "default";

@@ -316,10 +319,10 @@ /**

constructor(tokensObj?: Record<string, unknown>, options?: TokensWalkerOptions);
[Symbol.iterator](): IterableIterator<ProcessedDesignToken>;
[Symbol.iterator](): IterableIterator<WalkerDesignToken>;
use(extension: TokensWalkerSchemaExtension | TokensWalkerSchemaExtension[]): void;
walk(iterator: TokenIterator<void>): void;
map<T>(iterator: TokenIterator<T>): T[];
filter(iterator: TokenIterator<boolean>): ProcessedDesignToken[];
reduce<T>(iterator: (acc: T, token: ProcessedDesignToken) => T, initialValue: T): T;
find(predicate: TokenIterator<boolean>): ProcessedDesignToken | undefined;
getTokens(): IterableIterator<ProcessedDesignToken>;
filter(iterator: TokenIterator<boolean>): WalkerDesignToken[];
reduce<T>(iterator: (acc: T, token: WalkerDesignToken) => T, initialValue: T): T;
find(predicate: TokenIterator<boolean>): WalkerDesignToken | undefined;
getTokens(): IterableIterator<WalkerDesignToken>;
setTokens(tokens: Record<string, unknown>): void;

@@ -334,11 +337,38 @@ setOptions(options: TokensWalkerOptions): void;

derefTokenValue(tokenValue: unknown): unknown;
private derefTokenValueHelper;
normalizeTokenValue(tokenValue: unknown): unknown;
private processTokens;
private createRawTokenFromAction;
private processTokenActions;
hasSchemaExtensions(path: string, token: DesignToken): boolean;
buildTokenValueByMode(token: DesignToken, path: string, normalize?: boolean): DesignTokenValueByMode;
private runTokenExtensions;
private buildTokenValueByMode;
private processToken;
private createToken;
private createRawToken;
private walkTokens;
}
declare class WalkerDesignToken {
#private;
path: string;
raw: DesignToken;
private walker;
isResponsive: boolean;
isGenerated: boolean;
defaultMode: string;
requiredModes: string[];
constructor(path: string, raw: DesignToken, walker: TokensWalker);
get type(): TokenType;
get extensions(): Record<string, unknown> | undefined;
get description(): string | undefined;
get rawValue(): DesignToken['$value'];
get valueByMode(): DesignTokenValueByMode;
get normalizedValue(): DerefToken<DesignToken>['$value'];
getRawValueByMode(mode: string): DerefToken<DesignToken>['$value'];
getNormalizeValueByMode(mode: string): DerefToken<DesignToken>['$value'];
derefValue(): DerefToken<DesignToken>['$value'];
hasSchemaExtensions(): boolean;
applyTokenAction(action: TokensWalkerAction): void;
}
interface DesignTokenValueRecord {

@@ -349,14 +379,2 @@ normalized: DerefToken<DesignToken>['$value'];

type DesignTokenValueByMode = Record<string, DerefToken<DesignToken>['$value'] | DesignToken['$value'] | DesignTokenValueRecord>;
interface ProcessedDesignToken {
normalizedValue?: DerefToken<DesignToken>['$value'];
type: TokenType;
rawValue: DesignToken['$value'];
extensions?: Record<string, unknown>;
description?: string;
path: string;
valueByMode: DesignTokenValueByMode;
original: DesignToken;
isResponsive?: boolean;
isGenerated?: boolean;
}
interface TokensWalkerBaseAction {

@@ -389,3 +407,3 @@ extension: string;

filter: TokensWalkerFilter;
run(token: ProcessedDesignToken, walker: TokensWalker): TokensWalkerAction[];
run(token: WalkerDesignToken, walker: TokensWalker): TokensWalkerAction[];
}

@@ -436,2 +454,2 @@ type TokenOverrideFn = (mode: string, token: DesignToken) => unknown;

export { type Border, type Color, type ColorModifier, type ColorModifiersExtensionOptions, type ColorTokenModifier, type ColorTokenModifiersExtension, type CubicBezier, DEFAULT_MODE, DIMENSION_REGEX, type DerefToken, type DesignToken, type DesignTokenDefinition, type DesignTokenValueByMode, type DesignTokenValueRecord, type DesignTokens, type Dimension, type Duration, type FontFamily, type FontWeight, type FontWeightName, type Gradient, type GradientStop, type ModeExtension, type ModesExtension, type Number, type PathMatcher, type ProcessedDesignToken, type ReplaceTofK, type RequiredKeys, type ResponsiveExtensionOptions, type Shadow, type StrokeStyle, type StrokeStyleName, type StrokeStyleObject, type TokenAlias, type TokenDefinition, type TokenFilterObj, type TokenGenerator, type TokenGeneratorsExtension, type TokenGroupDefinition, type TokenGroupItemDefinition, type TokenIterator, type TokenOverrideFn, type TokenOverrides, type TokenType, type TokenValue, type Tokens, type TokensFilter, type TokensFilterParams, TokensWalker, type TokensWalkerAction, type TokensWalkerBaseAction, type TokensWalkerFilter, type TokensWalkerOptions, type TokensWalkerSchemaExtension, type Transition, type Typography, type WithExtension, applyColorModifier, applyColorModifiers, borderToCssStyle, borderToCssValue, colorGeneratorsExtension, colorModifiersExtension, colorToCssValue, contrastColor, correctJSObjectKey, cubicBezierToCssValue, darkenColor, desaturateColor, destructDimensionValue, fontFamilyToCssValue, fontWeightToCssValue, formatColor, getModeNormalizeValue, getModeRawValue, gradientToCssValue, grayscaleColor, hasColorTokenModifiersExtension, hasGeneratorsExtension, hasModeExtension, hasModesExtension, hasTokenAlias, hasTokenExtensions, hueRotateColor, invertColor, isBorderToken, isColorToken, isCompositeToken, isCubicBezierToken, isDesignToken, isDesignTokenGroup, isDesignTokenLike, isDesignTokenValueRecord, isDimensionToken, isDurationToken, isFontFamilyToken, isFontWeightToken, isGradientToken, isMatchingTokensFilter, isNumberToken, isObject, isOtherToken, isShadowToken, isString, isStrokeStyleToken, isSupportedTypeFilter, isTokenAlias, isTransitionToken, isTypographyToken, lightenColor, normalizeBorderValue, normalizeColorValue, normalizeCubicBezierValue, normalizeDimensionValue, normalizeDurationValue, normalizeFontFamilyValue, normalizeFontWeightValue, normalizeGradientValue, normalizeShadowValue, normalizeStrokeStyleValue, normalizeTokenAlias, normalizeTransitionValue, normalizeTypographyValue, opacifyColor, parseColor, parseModifierValue, processCSSKey, processCssVarRef, processJSKey, processJSValue, processPrimitiveValue, responsiveExtension, saturateColor, sepiaColor, serializeObject, serializeObjectToCSS, shadowToCssValue, strokeStyleToCssValue, tokenAliasToCssVarName, tokenToCss, tokenValueToCss, tokenValueToCssValue, transitionToCssStyle, transitionToCssValue, typographyToCssStyle, typographyToCssValue };
export { type Border, type Color, type ColorModifier, type ColorModifiersExtensionOptions, type ColorTokenModifier, type ColorTokenModifiersExtension, type CubicBezier, DEFAULT_MODE, DIMENSION_REGEX, type DerefToken, type DesignToken, type DesignTokenDefinition, type DesignTokenValueByMode, type DesignTokenValueRecord, type DesignTokens, type Dimension, type Duration, type FontFamily, type FontWeight, type FontWeightName, type Gradient, type GradientStop, type ModeExtension, type ModesExtension, type Number, type PathMatcher, type ReplaceTofK, type RequiredKeys, type ResponsiveExtensionOptions, type Shadow, type StrokeStyle, type StrokeStyleName, type StrokeStyleObject, type TokenAlias, type TokenDefinition, type TokenFilterObj, type TokenGenerator, type TokenGeneratorsExtension, type TokenGroupDefinition, type TokenGroupItemDefinition, type TokenIterator, type TokenOverrideFn, type TokenOverrides, type TokenType, type TokenValue, type Tokens, type TokensFilter, type TokensFilterParams, TokensWalker, type TokensWalkerAction, type TokensWalkerBaseAction, type TokensWalkerFilter, type TokensWalkerOptions, type TokensWalkerSchemaExtension, type Transition, type Typography, WalkerDesignToken, type WithExtension, applyColorModifier, applyColorModifiers, borderToCssStyle, borderToCssValue, colorGeneratorsExtension, colorModifiersExtension, colorToCssValue, contrastColor, correctJSObjectPath, cubicBezierToCssValue, darkenColor, desaturateColor, destructDimensionValue, fontFamilyToCssValue, fontWeightToCssValue, formatColor, getModeNormalizeValue, getModeRawValue, gradientToCssValue, grayscaleColor, hasColorTokenModifiersExtension, hasGeneratorsExtension, hasModeExtension, hasModesExtension, hasTokenAlias, hasTokenExtensions, hueRotateColor, invertColor, isBorderToken, isColorToken, isCompositeToken, isCubicBezierToken, isDesignToken, isDesignTokenGroup, isDesignTokenLike, isDesignTokenValueRecord, isDimensionToken, isDurationToken, isFontFamilyToken, isFontWeightToken, isGradientToken, isMatchingTokensFilter, isNumberToken, isObject, isOtherToken, isShadowToken, isString, isStrokeStyleToken, isSupportedTypeFilter, isTokenAlias, isTransitionToken, isTypographyToken, lightenColor, normalizeBorderValue, normalizeColorValue, normalizeCubicBezierValue, normalizeDimensionValue, normalizeDurationValue, normalizeFontFamilyValue, normalizeFontWeightValue, normalizeGradientValue, normalizeShadowValue, normalizeStrokeStyleValue, normalizeTokenAlias, normalizeTransitionValue, normalizeTypographyValue, opacifyColor, parseColor, parseModifierValue, pathToCssVarName, pathToStyleName, processCSSKey, processCssVarRef, processJSKey, processJSValue, processPrimitiveValue, responsiveExtension, saturateColor, sepiaColor, serializeObject, serializeObjectToCSS, shadowToCssValue, strokeStyleToCssValue, tokenPathToStyleName, tokenToCss, tokenValueToCss, tokenValueToCssValue, transitionToCssStyle, transitionToCssValue, typographyToCssStyle, typographyToCssValue };
{
"name": "@design-sync/w3c-dtfm",
"version": "0.9.1",
"version": "0.10.0",
"description": "Design tokens module format (DTFM) utils and types",

@@ -18,14 +18,14 @@ "repository": "salamaashoush/design-sync",

"culori": "^3.3.0",
"@design-sync/utils": "0.4.0"
"@design-sync/utils": "0.5.0"
},
"devDependencies": {
"@types/culori": "^2.0.4",
"@types/node": "^20.9.3",
"@vitest/coverage-v8": "^0.34.6",
"eslint": "^8.54.0",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0",
"typescript": "^5.3.2",
"@types/node": "^20.10.4",
"@vitest/coverage-v8": "^1.0.4",
"eslint": "^8.55.0",
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
"typescript": "^5.3.3",
"unbuild": "^2.0.0",
"vitest": "^0.34.6",
"vitest": "^1.0.4",
"@design-sync/eslint-config": "0.0.1",

@@ -32,0 +32,0 @@ "@design-sync/tsconfig": "0.0.1"

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