@hanzogui/web 7.0.0 → 7.3.0
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.
- package/LICENSE +40 -19
- package/dist/cjs/_withStableStyle.cjs +1 -1
- package/dist/cjs/_withStableStyle.native.js +1 -1
- package/dist/cjs/config.cjs +2 -2
- package/dist/cjs/config.native.js +2 -2
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/constants.cjs +3 -3
- package/dist/cjs/constants/constants.native.js +3 -3
- package/dist/cjs/createComponent.cjs +307 -530
- package/dist/cjs/createComponent.native.js +265 -588
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createGui.cjs +19 -48
- package/dist/cjs/createGui.native.js +22 -65
- package/dist/cjs/createGui.native.js.map +1 -1
- package/dist/cjs/eventHandling.native.js +19 -9
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +22 -36
- package/dist/cjs/helpers/createDesignSystem.native.js +19 -91
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +11 -74
- package/dist/cjs/helpers/expandStyle.native.js +29 -81
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.cjs +2 -15
- package/dist/cjs/helpers/expandStyles.native.js +7 -13
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +233 -557
- package/dist/cjs/helpers/getSplitStyles.native.js +204 -659
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +8 -16
- package/dist/cjs/helpers/getTokenForKey.cjs +32 -54
- package/dist/cjs/helpers/getTokenForKey.native.js +40 -59
- package/dist/cjs/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +27 -79
- package/dist/cjs/helpers/insertStyleRule.native.js +16 -335
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isActivePlatform.cjs +2 -17
- package/dist/cjs/helpers/isActivePlatform.native.js +2 -17
- package/dist/cjs/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +1 -4
- package/dist/cjs/helpers/log.native.js +1 -6
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +37 -110
- package/dist/cjs/helpers/propMapper.native.js +54 -131
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +3 -11
- package/dist/cjs/helpers/skipProps.native.js +3 -11
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/useRenderElement.cjs +7 -18
- package/dist/cjs/helpers/useRenderElement.native.js +7 -15
- package/dist/cjs/helpers/useRenderElement.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +11 -15
- package/dist/cjs/helpers/wrapStyleTags.native.js +3 -22
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.cjs +10 -54
- package/dist/cjs/hooks/getThemeProxied.native.js +27 -48
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +2 -2
- package/dist/cjs/hooks/useTheme.native.js +2 -2
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +66 -124
- package/dist/cjs/hooks/useThemeState.native.js +64 -142
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/insertFont.cjs +6 -15
- package/dist/cjs/insertFont.native.js +7 -23
- package/dist/cjs/insertFont.native.js.map +1 -1
- package/dist/cjs/setupReactNative.cjs +4 -24
- package/dist/cjs/setupReactNative.native.js +5 -26
- package/dist/cjs/setupReactNative.native.js.map +1 -1
- package/dist/cjs/views/GuiProvider.cjs +4 -6
- package/dist/cjs/views/GuiProvider.native.js +5 -7
- package/dist/cjs/views/GuiProvider.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +11 -18
- package/dist/cjs/views/Text.native.js +6 -14
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.cjs +9 -11
- package/dist/cjs/views/ThemeProvider.native.js +3 -16
- package/dist/cjs/views/ThemeProvider.native.js.map +1 -1
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/_withStableStyle.mjs +1 -1
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +1 -1
- package/dist/esm/config.mjs +2 -2
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +2 -2
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/constants.mjs +3 -3
- package/dist/esm/constants/constants.native.js +3 -3
- package/dist/esm/createComponent.mjs +311 -536
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +265 -591
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createGui.mjs +20 -51
- package/dist/esm/createGui.mjs.map +1 -1
- package/dist/esm/createGui.native.js +24 -70
- package/dist/esm/createGui.native.js.map +1 -1
- package/dist/esm/createVariables.mjs.map +1 -1
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/eventHandling.native.js +19 -9
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +22 -36
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +18 -90
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/esm/helpers/expandStyle.mjs +12 -73
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +28 -80
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs +2 -15
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +7 -13
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +236 -560
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +205 -662
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +8 -16
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.mjs +32 -54
- package/dist/esm/helpers/getTokenForKey.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.native.js +40 -59
- package/dist/esm/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +27 -79
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +14 -333
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isActivePlatform.mjs +2 -17
- package/dist/esm/helpers/isActivePlatform.mjs.map +1 -1
- package/dist/esm/helpers/isActivePlatform.native.js +2 -17
- package/dist/esm/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +1 -4
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +1 -6
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +37 -108
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +54 -131
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +3 -10
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +2 -10
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/useRenderElement.mjs +9 -22
- package/dist/esm/helpers/useRenderElement.mjs.map +1 -1
- package/dist/esm/helpers/useRenderElement.native.js +8 -17
- package/dist/esm/helpers/useRenderElement.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +11 -15
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +1 -20
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +11 -52
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +27 -48
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +2 -2
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +2 -2
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +67 -124
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +64 -142
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/insertFont.mjs +7 -17
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +7 -24
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/setupReactNative.mjs +4 -24
- package/dist/esm/setupReactNative.mjs.map +1 -1
- package/dist/esm/setupReactNative.native.js +5 -26
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/views/GuiProvider.mjs +4 -6
- package/dist/esm/views/GuiProvider.mjs.map +1 -1
- package/dist/esm/views/GuiProvider.native.js +5 -7
- package/dist/esm/views/GuiProvider.native.js.map +1 -1
- package/dist/esm/views/Slot.mjs.map +1 -1
- package/dist/esm/views/Text.mjs +11 -18
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +5 -12
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs +9 -11
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +1 -14
- package/dist/esm/views/ThemeProvider.native.js.map +1 -1
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +30 -23
- package/src/_withStableStyle.tsx +2 -2
- package/src/config.ts +7 -4
- package/src/constants/accessibilityDirectMap.tsx +1 -1
- package/src/constants/constants.ts +3 -3
- package/src/createComponent.tsx +2 -2
- package/src/createGui.ts +2 -2
- package/src/eventHandling.native.ts +31 -10
- package/src/helpers/createMediaStyle.ts +1 -1
- package/src/helpers/defaultAnimationDriver.tsx +1 -1
- package/src/helpers/getSplitStyles.tsx +1 -1
- package/src/helpers/getTokenForKey.ts +42 -29
- package/src/helpers/insertStyleRule.tsx +2 -2
- package/src/helpers/isActivePlatform.ts +5 -5
- package/src/helpers/mergeProps.ts +1 -1
- package/src/helpers/skipProps.ts +1 -1
- package/src/helpers/useRenderElement.tsx +4 -1
- package/src/hooks/useTheme.tsx +2 -2
- package/src/interfaces/GuiComponentPropsBaseBase.tsx +10 -4
- package/src/styled.tsx +2 -2
- package/src/types.tsx +33 -24
- package/src/views/View.tsx +6 -1
- package/types/config.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/getTokenForKey.d.ts.map +1 -1
- package/types/helpers/isActivePlatform.d.ts +5 -5
- package/types/helpers/skipProps.d.ts +1 -1
- package/types/helpers/useRenderElement.d.ts.map +1 -1
- package/types/helpers/wrapStyleTags.d.ts +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/interfaces/GuiComponentPropsBaseBase.d.ts +3 -3
- package/types/interfaces/GuiComponentPropsBaseBase.d.ts.map +1 -1
- package/types/styled.d.ts +1 -1
- package/types/types.d.ts +17 -17
- package/types/types.d.ts.map +1 -1
- package/types/views/Configuration.d.ts +1 -1
- package/types/views/Configuration.d.ts.map +1 -1
- package/types/views/FontLanguage.d.ts +1 -1
- package/types/views/FontLanguage.native.d.ts +2 -1
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/GuiProvider.d.ts +2 -1
- package/types/views/GuiProvider.d.ts.map +1 -1
- package/types/views/GuiRoot.d.ts +1 -1
- package/types/views/GuiRoot.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/.turbo/turbo-build.log +0 -2
- package/inject-styles/index.cjs +0 -2
- package/inject-styles/index.js +0 -2
- package/tsconfig.json +0 -44
- package/tsconfig.test.json +0 -9
- package/vitest.config.d.ts +0 -3
- package/vitest.config.d.ts.map +0 -1
- package/vitest.config.ts +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","insertStyleRule_exports","__export","getAllRules","getAllSelectors","insertStyleRules","scanAllSheets","setNonce","shouldInsertStyleRules","stopAccumulatingRules","updateRules","module","exports","
|
|
1
|
+
{"version":3,"names":["to","__toCommonJS","mod","__copyProps","__defProp","value","insertStyleRule_exports","__export","getAllRules","getAllSelectors","insertStyleRules","scanAllSheets","setNonce","shouldInsertStyleRules","stopAccumulatingRules","updateRules","module","exports","require","_instanceof","left","right","Symbol","hasInstance","totalSelectorsInserted","Map","allSelectors","allRules","process","env","GUI_DID_OUTPUT_CSS","Object","keys","sort","map","key","arguments","length","NODE_ENV","bailAfterEnv","GUI_BAIL_AFTER_SCANNING_X_CSS_RULES","guiSelectorRegex","getGuiSelector","sheet","rule","collectThemes","CSSStyleRule","text","selectorText","test","id","getIdentifierFromGuiSelector","replace","CSSMediaRule","cssRules","selector","dotIndex","indexOf","slice","trackAllRules","identifier","rules","join","_","rulesToInsert","maxToInsert","GUI_INSERT_SELECTOR_TRIES","IS_STATIC","total","get","GUI_STYLE_INSERTION_WARNING_LIMIT","console","warn"],"sources":["../../../src/helpers/insertStyleRule.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;EAAA;EAAA,OAAAA,EAAA;AAAA;AAAA,IAAAC,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,gBAAA,EAAAA,CAAA,KAAAA,gBAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,sBAAA,EAAAA,CAAA,KAAAA,sBAAA;EAAAC,qBAAwD,EAAAA,CAAA,KAAAA,qBAAA;EACxDC,WAAA,EAAAA,CAAA,KAAAA;AAWA;AACAC,MAAM,CAAAC,OAAA,GAAAhB,YAAA,CAAAK,uBAA6B;AACnCY,OAAM,oBAAwC;AAC9CA,OAAM,8BAAoC;AAEnC,SAAMC,YAAAC,IAAkB,EAAAC,KAAM;EAC9B,IAAAA,KAAM,YAAc,OAAMC,MAAA,oBAAAD,KAAA,CAAAC,MAAA,CAAAC,WAAA,YAAAF,KAAA,CAAAC,MAAA,CAAAC,WAAA,EAAAH,IAAA,OAC3B,OAACA,IAAQ,YAAIC,KAAA;AAEf;AACA,IAAAG,sBAAsB,GAAC,eAAiB,IAAIC,GAAA;AAAA,IAC9CC,YAAA;AACA,IAAAC,QAAQ;AACV,IAAAlB,eAAA,YAAAA,CAAA;EAYA,OAAIiB,YAAA;AAEG;AAIL,IAAAlB,WAAa,YAAAA,CAAA,EAAI;EACf,KAAAoB,OAAI,CAAAC,GAAQ,CAAAC,kBAAiB,SAAQC,MAAA,CAAAC,IAAA,CAAAL,QAAA,EAAAM,IAAA,GAAAC,GAAA,WAAAC,GAAA;IACrC,OAAIR,QAAQ,CAAAQ,GAAI;EAEhB;EAEA,SAAM;AACN;AACA,SAAAxB,aAAgBA,CAAA,EAAI;EAEpByB,SAAA,CAAAC,MAAW,QAASD,SAAS,kBAAAA,SAAA;EAC3BA,SAAI,CAAAC,MAAA,GAAO,KAAAD,SAAA;EACT,KAAAR,OAAA,CAAMC,GAAA,CAAAC,kBAAM,EAAkB;IAC9B,IAAAF,OAAI,CAAAC,GAAK,CAAAS,QAAA;IACP;EAAS;AACX;AACF,IACFC,YAAA,GAAAX,OAAA,CAAAC,GAAA,CAAAW,mCAAA;AAEAD,YAAA,KAAAA,YAAoB;AAEpB,IAAAE,gBAAU;AACR,SAAAC,cAAWC,CAAAC,IAAS;EAClB,IAAAC,aAAI,GAAAT,SAAU,CAAQC,MAAI,IAAK,IAAGD,SAAA,iBAAAA,SAAA;EAChC,IAAAjB,WAAA,CAAAyB,IAAA,EAAAE,YAAkB,CAAO;IAAI,IAAAC,IAC/B,GAAAH,IAAA,CAAAI,YAAA;IAAA,IACFD,IAAA,eAAAA,IAAA,eAAAN,gBAAA,CAAAQ,IAAA,CAAAF,IAAA;MAAA,IACFG,EAAA,GAAAC,4BAAA;MAEA;MACFJ,IAAA,CAAAK,OAAA,CAAAX,gBAAA,KACF;MAEA,OAASI,aAAA,IACPK,EAAA,EACAN,IAAA,EACA,KACF,IAAAM,EAAA,EAAAN,IAAA;IAEA;EACA,OAAM,IAAAzB,WAAY,CAAAyB,IAAA,EAAAS,YAAgB;IAElC,IAAAT,IAAS,CAAAU,QAAA,CAAAjB,MAAA,GACP;IAOA,OAAIK,cAAA,CAAAE,IAAA,CAAAU,QAAA;EACJ;AACE;AACA,IAAAH,4BAAY,YAAAA,CAAAI,QAAA;EACV,IAAAC,QAAA,GAAAD,QAAA,CAAAE,OAAA;EAAA,IACFD,QAAA,cAAAD,QAAA,CAAAG,KAAA,IAAAF,QAAA;EAAA,OACFD,QAAQ,CAAAG,KAAA;AACN;AAAA,IACFC,aAAA;AAEA,SAAM7C,qBAAgBA,CAAA;EACtB6C,aAAM;AACN;AACA,SAAM5C,YAAA6C,UAAc,EAAAC,KAAa,EAAI;EAErC,IAAAF,aAAa,EAAAhC,QAAA,CAAAiC,UAAA,IAAAC,KAAA,CAAAC,IAAA;EAEX,OAAI;AACF;AAAA,SACFlD,SAAAmD,CAAA;AAAA,SACFrD,iBAAAsD,aAAA;AAEA,IAAAC,WAAY,GAAArC,OAAM,CAAAC,GAAA,CAAAqC,yBAAA,IAAAtC,OAAA,CAAAC,GAAA,CAAAqC,yBAAA;AAClB,SAAIrD,sBAAQA,CAAA+C,UAAA;EAEZ,IAAAhC,OAAI,CAAAC,GAAA,CAAAsC,SAAA;EAKJ,IAAAC,KAAM,GAAA5C,sBAA4C,CAAA6C,GAAA,CAAAT,UAAA;EAElD,IAAAhC,OAAS,CAAAC,GAAI,CAAAS,QAAO,KAAK,aAAK;IAC5B,IAAA8B,KAAM,KAAAxC,OAAa,CAACC,GAAA,CAAAyC,iCAAA,SAAAC,OAAA,CAAAC,IAAA;EACpB;EAEA,OAAAJ,KAAM,GAAAH,WAAW;AAEjB","ignoreList":[]}
|
|
@@ -34,22 +34,7 @@ function getPlatformSpecificityBump(mediaKeyShort) {
|
|
|
34
34
|
return 0;
|
|
35
35
|
}
|
|
36
36
|
function isActivePlatform(key) {
|
|
37
|
-
if (!key.startsWith("$platform"))
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
37
|
+
if (!key.startsWith("$platform")) return true;
|
|
40
38
|
const platform = key.slice(10);
|
|
41
|
-
return
|
|
42
|
-
// exact platform match (web, ios, android)
|
|
43
|
-
platform === import_constants.currentPlatform ||
|
|
44
|
-
// native matches all non-web platforms (iOS, Android, tvOS, Android TV)
|
|
45
|
-
platform === "native" && import_constants.currentPlatform !== "web" ||
|
|
46
|
-
// GUI_TARGET fallback (web or native build target)
|
|
47
|
-
platform === "web" ||
|
|
48
|
-
// tv matches both Android TV and tvOS
|
|
49
|
-
platform === "tv" && import_constants.isTV ||
|
|
50
|
-
// androidtv matches Android TV specifically
|
|
51
|
-
platform === "androidtv" && import_constants.isAndroid && import_constants.isTV ||
|
|
52
|
-
// tvos matches tvOS specifically
|
|
53
|
-
platform === "tvos" && import_constants.isIos && import_constants.isTV
|
|
54
|
-
);
|
|
39
|
+
return platform === import_constants.currentPlatform || platform === "native" && import_constants.currentPlatform !== "web" || platform === "web" || platform === "tv" && import_constants.isTV || platform === "androidtv" && import_constants.isAndroid && import_constants.isTV || platform === "tvos" && import_constants.isIos && import_constants.isTV;
|
|
55
40
|
}
|
|
@@ -36,23 +36,8 @@ function getPlatformSpecificityBump(mediaKeyShort) {
|
|
|
36
36
|
return 0;
|
|
37
37
|
}
|
|
38
38
|
function isActivePlatform(key) {
|
|
39
|
-
if (!key.startsWith("$platform"))
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
39
|
+
if (!key.startsWith("$platform")) return true;
|
|
42
40
|
var platform = key.slice(10);
|
|
43
|
-
return
|
|
44
|
-
// exact platform match (web, ios, android)
|
|
45
|
-
platform === import_constants.currentPlatform ||
|
|
46
|
-
// native matches all non-web platforms (iOS, Android, tvOS, Android TV)
|
|
47
|
-
platform === "native" && import_constants.currentPlatform !== "web" ||
|
|
48
|
-
// GUI_TARGET fallback (web or native build target)
|
|
49
|
-
platform === "native" ||
|
|
50
|
-
// tv matches both Android TV and tvOS
|
|
51
|
-
platform === "tv" && import_constants.isTV ||
|
|
52
|
-
// androidtv matches Android TV specifically
|
|
53
|
-
platform === "androidtv" && import_constants.isAndroid && import_constants.isTV ||
|
|
54
|
-
// tvos matches tvOS specifically
|
|
55
|
-
platform === "tvos" && import_constants.isIos && import_constants.isTV
|
|
56
|
-
);
|
|
41
|
+
return platform === import_constants.currentPlatform || platform === "native" && import_constants.currentPlatform !== "web" || platform === "native" || platform === "tv" && import_constants.isTV || platform === "androidtv" && import_constants.isAndroid && import_constants.isTV || platform === "tvos" && import_constants.isIos && import_constants.isTV;
|
|
57
42
|
}
|
|
58
43
|
//# sourceMappingURL=isActivePlatform.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","isActivePlatform_exports","__export","getPlatformSpecificityBump","isActivePlatform","module","exports","import_constants","require","mediaKeyShort","key","startsWith","platform","slice","currentPlatform","isTV","isAndroid","isIos"],"sources":["../../../src/helpers/isActivePlatform.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["to","__toCommonJS","mod","__copyProps","__defProp","value","isActivePlatform_exports","__export","getPlatformSpecificityBump","isActivePlatform","module","exports","import_constants","require","mediaKeyShort","key","startsWith","platform","slice","currentPlatform","isTV","isAndroid","isIos"],"sources":["../../../src/helpers/isActivePlatform.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;EAAA;EAAA,OAAAA,EAAA;AAAA;AAAA,IAAAC,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,0BAAwD,EAAAA,CAAA,KAAAA,0BAAA;EAejDC,gBAAS,EAAAA,CAAA,KAAAA;AACd;AACEC,MAAA,CAAAC,OAAO,GAAAV,YAAA,CAAAK,wBAAA;AACT,IAAAM,gBAAI,GAAAC,OAAkB,sBAAsB;AAC5C,SAAIL,0BAAkBA,CAAAM,aAAsB;EAC5C,IAAAA,aAAO,6BAAAA,aAAA;EACT,IAAAA,aAAA;EAEO,IAAAA,aAAS,uBAA8B,IAAAA,aAAA;EAC5C,OAAK;AACH;AAAO,SACTL,iBAAAM,GAAA;EACA,KAAAA,GAAM,CAAAC,UAAW,YAAY;EAC7B,IAAAC,QAAA,GAAAF,GAAA,CAAAG,KAAA;EAAA,OAAAD,QAAA,KAAAL,gBAAA,CAAAO,eAAA,IAAAF,QAAA,iBAAAL,gBAAA,CAAAO,eAAA,cAAAF,QAAA,iBAAAA,QAAA,aAAAL,gBAAA,CAAAQ,IAAA,IAAAH,QAAA,oBAAAL,gBAAA,CAAAS,SAAA,IAAAT,gBAAA,CAAAQ,IAAA,IAAAH,QAAA,eAAAL,gBAAA,CAAAU,KAAA,IAAAV,gBAAA,CAAAQ,IAAA;AAAA","ignoreList":[]}
|
package/dist/cjs/helpers/log.cjs
CHANGED
|
@@ -30,10 +30,7 @@ function log(...args) {
|
|
|
30
30
|
if (process.env.NODE_ENV === "production") return;
|
|
31
31
|
(0, import_useMedia._disableMediaTouch)(true);
|
|
32
32
|
try {
|
|
33
|
-
|
|
34
|
-
return console.info(...args);
|
|
35
|
-
}
|
|
36
|
-
return console.log(...args);
|
|
33
|
+
return console.info(...args);
|
|
37
34
|
} catch (err) {
|
|
38
35
|
console.error(err);
|
|
39
36
|
} finally {
|
|
@@ -29,15 +29,10 @@ __export(log_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(log_exports);
|
|
30
30
|
var import_useMedia = require("../hooks/useMedia.native.js");
|
|
31
31
|
function log() {
|
|
32
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
|
|
33
|
-
args[_key] = arguments[_key];
|
|
34
|
-
}
|
|
32
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
35
33
|
if (process.env.NODE_ENV === "production") return;
|
|
36
34
|
(0, import_useMedia._disableMediaTouch)(true);
|
|
37
35
|
try {
|
|
38
|
-
if (false) {
|
|
39
|
-
return console.info(...args);
|
|
40
|
-
}
|
|
41
36
|
return console.log(...args);
|
|
42
37
|
} catch (err) {
|
|
43
38
|
console.error(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","log_exports","__export","log","module","exports","import_useMedia","require","_len","arguments","length","args","Array","_key","process","env","NODE_ENV","_disableMediaTouch","console","
|
|
1
|
+
{"version":3,"names":["to","__toCommonJS","mod","__copyProps","__defProp","value","log_exports","__export","log","module","exports","import_useMedia","require","_len","arguments","length","args","Array","_key","process","env","NODE_ENV","_disableMediaTouch","console","err","error"],"sources":["../../../src/helpers/log.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;EAAA;EAAA,OAAAA,EAAA;AAAA;AAAA,IAAAC,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,WAAA;AAAAC,QAAA,CAAAD,WAAA,EAAmC;EAAAE,GAAA,EAAAA,CAAA,KAAAA;AAAA;AAE5BC,MAAA,CAAAC,OAAS,GAAOT,YAAa,CAAAK,WAAA;AAClC,IAAAK,eAAgB,GAAAC,OAAA,8BAA2B;AAC3C,SAAAJ,IAAA;EACA,KAAI,IAAAK,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,IAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;EACF,IAAAC,OAAI,CAAAC,GAAQ,CAAAC,QAAI,iBAAsB;EACpC,IAAAV,eAAO,CAAQW,kBAAY;EAAA,IAC7B;IAEA,OAAAC,OAAO,CAAAf,GAAQ,IAAIQ,IAAG;EAAI,CAC5B,QAAAQ,GAAS;IACPD,OAAA,CAAAE,KAAQ,CAAAD,GAAM;EAAG,CACnB;IACE,IAAAb,eAAA,CAAAW,kBAAA,OAAmB;EAAK;AAE5B","ignoreList":[]}
|
|
@@ -27,27 +27,23 @@ __export(propMapper_exports, {
|
|
|
27
27
|
propMapper: () => propMapper
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(propMapper_exports);
|
|
30
|
-
|
|
30
|
+
require("@hanzogui/constants");
|
|
31
31
|
var import_createVariable = require("../createVariable.cjs");
|
|
32
32
|
var import_expandStyle = require("./expandStyle.cjs");
|
|
33
33
|
var import_getTokenForKey = require("./getTokenForKey.cjs");
|
|
34
34
|
var import_getVariantExtras = require("./getVariantExtras.cjs");
|
|
35
35
|
var import_isObj = require("./isObj.cjs");
|
|
36
36
|
var import_normalizeStyle = require("./normalizeStyle.cjs");
|
|
37
|
-
|
|
37
|
+
require("./parseNativeStyle.cjs");
|
|
38
38
|
var import_pseudoDescriptors = require("./pseudoDescriptors.cjs");
|
|
39
39
|
var import_resolveCompoundTokens = require("./resolveCompoundTokens.cjs");
|
|
40
40
|
var import_resolveRem = require("./resolveRem.cjs");
|
|
41
41
|
var import_skipProps = require("./skipProps.cjs");
|
|
42
42
|
var import_getTokenForKey2 = require("./getTokenForKey.cjs");
|
|
43
43
|
const propMapper = (key, value, styleState, disabled, map) => {
|
|
44
|
-
if (disabled)
|
|
45
|
-
return map(key, value);
|
|
46
|
-
}
|
|
44
|
+
if (disabled) return map(key, value);
|
|
47
45
|
(0, import_getTokenForKey.setLastFontFamilyToken)(null);
|
|
48
|
-
if (
|
|
49
|
-
if (key === "elevationAndroid") return;
|
|
50
|
-
}
|
|
46
|
+
if (key === "elevationAndroid") return;
|
|
51
47
|
const {
|
|
52
48
|
conf,
|
|
53
49
|
styleProps,
|
|
@@ -66,42 +62,20 @@ const propMapper = (key, value, styleState, disabled, map) => {
|
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
64
|
if (!styleProps.disableExpandShorthands) {
|
|
69
|
-
if (key in conf.shorthands)
|
|
70
|
-
key = conf.shorthands[key];
|
|
71
|
-
}
|
|
65
|
+
if (key in conf.shorthands) key = conf.shorthands[key];
|
|
72
66
|
}
|
|
73
67
|
const originalValue = value;
|
|
74
68
|
if (value != null) {
|
|
75
69
|
if (typeof value === "string") {
|
|
76
|
-
if (value[0] === "$") {
|
|
77
|
-
value = (0, import_getTokenForKey.getTokenForKey)(key, value, styleProps, styleState);
|
|
78
|
-
} else {
|
|
70
|
+
if (value[0] === "$") value = (0, import_getTokenForKey.getTokenForKey)(key, value, styleProps, styleState);else {
|
|
79
71
|
const resolved = (0, import_resolveCompoundTokens.resolveCompoundTokens)(key, value, styleProps, styleState);
|
|
80
72
|
value = resolved !== value ? resolved : (0, import_resolveRem.isRemValue)(value) ? (0, import_resolveRem.resolveRem)(value) : value;
|
|
81
73
|
}
|
|
82
|
-
} else if ((0, import_createVariable.isVariable)(value))
|
|
83
|
-
value = (0, import_getTokenForKey.resolveVariableValue)(key, value, styleProps.resolveValues);
|
|
84
|
-
} else if ((0, import_resolveRem.isRemValue)(value)) {
|
|
85
|
-
value = (0, import_resolveRem.resolveRem)(value);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (false) {
|
|
89
|
-
const parsed = parseNativeStyle(key, value);
|
|
90
|
-
if (parsed) {
|
|
91
|
-
if (key === "textShadow" && Array.isArray(parsed) && Array.isArray(parsed[0])) {
|
|
92
|
-
for (const [nkey, nvalue] of parsed) {
|
|
93
|
-
map(nkey, nvalue, originalValue);
|
|
94
|
-
}
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
value = parsed;
|
|
98
|
-
}
|
|
74
|
+
} else if ((0, import_createVariable.isVariable)(value)) value = (0, import_getTokenForKey.resolveVariableValue)(key, value, styleProps.resolveValues);else if ((0, import_resolveRem.isRemValue)(value)) value = (0, import_resolveRem.resolveRem)(value);
|
|
99
75
|
}
|
|
100
76
|
if (value != null) {
|
|
101
77
|
const fontToken = (0, import_getTokenForKey.getLastFontFamilyToken)();
|
|
102
|
-
if (key === "fontFamily" && fontToken)
|
|
103
|
-
styleState.fontFamily = fontToken;
|
|
104
|
-
}
|
|
78
|
+
if (key === "fontFamily" && fontToken) styleState.fontFamily = fontToken;
|
|
105
79
|
const expanded = styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value);
|
|
106
80
|
if (expanded) {
|
|
107
81
|
const max = expanded.length;
|
|
@@ -109,9 +83,7 @@ const propMapper = (key, value, styleState, disabled, map) => {
|
|
|
109
83
|
const [nkey, nvalue] = expanded[i];
|
|
110
84
|
map(nkey, nvalue, originalValue);
|
|
111
85
|
}
|
|
112
|
-
} else
|
|
113
|
-
map(key, value, originalValue);
|
|
114
|
-
}
|
|
86
|
+
} else map(key, value, originalValue);
|
|
115
87
|
}
|
|
116
88
|
};
|
|
117
89
|
const resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
@@ -164,21 +136,15 @@ const resolveVariants = (key, value, styleProps, styleState, parentVariantKey) =
|
|
|
164
136
|
if (fontFamilyUpdate) {
|
|
165
137
|
fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf);
|
|
166
138
|
styleState.fontFamily = fontFamilyResult;
|
|
167
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose")
|
|
168
|
-
console.info(` updating font family`, fontFamilyResult);
|
|
169
|
-
}
|
|
139
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` updating font family`, fontFamilyResult);
|
|
170
140
|
}
|
|
171
141
|
variantValue = resolveTokensAndVariants(key, variantValue, styleProps, styleState, parentVariantKey);
|
|
172
142
|
}
|
|
173
143
|
if (variantValue) {
|
|
174
144
|
const expanded = (0, import_normalizeStyle.normalizeStyle)(variantValue, !!styleProps.noNormalize);
|
|
175
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose")
|
|
176
|
-
console.info(` expanding styles from `, variantValue, `to`, expanded);
|
|
177
|
-
}
|
|
145
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` expanding styles from `, variantValue, `to`, expanded);
|
|
178
146
|
const next = Object.entries(expanded);
|
|
179
|
-
if (fontFamilyResult && fontFamilyResult[0] === "$")
|
|
180
|
-
(0, import_getTokenForKey.setLastFontFamilyToken)((0, import_createVariable.getVariableValue)(fontFamilyResult));
|
|
181
|
-
}
|
|
147
|
+
if (fontFamilyResult && fontFamilyResult[0] === "$") (0, import_getTokenForKey.setLastFontFamilyToken)((0, import_createVariable.getVariableValue)(fontFamilyResult));
|
|
182
148
|
return next;
|
|
183
149
|
}
|
|
184
150
|
};
|
|
@@ -190,15 +156,11 @@ function getFontFamilyFromNameOrVariable(input, conf) {
|
|
|
190
156
|
const familyVariable = conf.fontsParsed[key].family;
|
|
191
157
|
if ((0, import_createVariable.isVariable)(familyVariable)) {
|
|
192
158
|
variableToFontNameCache.set(familyVariable, key);
|
|
193
|
-
if (familyVariable === input)
|
|
194
|
-
return key;
|
|
195
|
-
}
|
|
159
|
+
if (familyVariable === input) return key;
|
|
196
160
|
}
|
|
197
161
|
}
|
|
198
162
|
} else if (typeof input === "string") {
|
|
199
|
-
if (input[0] === "$")
|
|
200
|
-
return input;
|
|
201
|
-
}
|
|
163
|
+
if (input[0] === "$") return input;
|
|
202
164
|
}
|
|
203
165
|
}
|
|
204
166
|
const variableToFontNameCache = /* @__PURE__ */new WeakMap();
|
|
@@ -213,15 +175,11 @@ const resolveTokensAndVariants = (key, value, styleProps, styleState, parentVari
|
|
|
213
175
|
variants
|
|
214
176
|
} = staticConfig;
|
|
215
177
|
const res = {};
|
|
216
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose")
|
|
217
|
-
console.info(` - resolveTokensAndVariants`, key, value);
|
|
218
|
-
}
|
|
178
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` - resolveTokensAndVariants`, key, value);
|
|
219
179
|
for (const _key in value) {
|
|
220
180
|
const subKey = conf.shorthands[_key] || _key;
|
|
221
181
|
const val = value[_key];
|
|
222
|
-
if (!styleProps.noSkip && subKey in import_skipProps.skipProps)
|
|
223
|
-
continue;
|
|
224
|
-
}
|
|
182
|
+
if (!styleProps.noSkip && subKey in import_skipProps.skipProps) continue;
|
|
225
183
|
if (staticConfig) {
|
|
226
184
|
const contextProps = staticConfig.context?.props || staticConfig.parentStaticConfig?.context?.props;
|
|
227
185
|
if (contextProps && subKey in contextProps) {
|
|
@@ -231,34 +189,22 @@ const resolveTokensAndVariants = (key, value, styleProps, styleState, parentVari
|
|
|
231
189
|
styleState.originalContextPropValues[subKey] = val;
|
|
232
190
|
}
|
|
233
191
|
}
|
|
234
|
-
if (styleProps.noExpand) {
|
|
235
|
-
res[subKey] = val;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
for (const [key2, val2] of variantOut) {
|
|
244
|
-
if (val2 == null) continue;
|
|
245
|
-
if (key2 in import_pseudoDescriptors.pseudoDescriptors) {
|
|
246
|
-
res[key2] ??= {};
|
|
247
|
-
Object.assign(res[key2], val2);
|
|
248
|
-
} else {
|
|
249
|
-
res[key2] = val2;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
192
|
+
if (styleProps.noExpand) res[subKey] = val;else if (variants && subKey in variants) {
|
|
193
|
+
if (parentVariantKey && parentVariantKey === key) res[subKey] = val[0] === "$" ? (0, import_getTokenForKey.getTokenForKey)(subKey, val, styleProps, styleState) : val;else {
|
|
194
|
+
const variantOut = resolveVariants(subKey, val, styleProps, styleState, key);
|
|
195
|
+
if (variantOut) for (const [key2, val2] of variantOut) {
|
|
196
|
+
if (val2 == null) continue;
|
|
197
|
+
if (key2 in import_pseudoDescriptors.pseudoDescriptors) {
|
|
198
|
+
res[key2] ??= {};
|
|
199
|
+
Object.assign(res[key2], val2);
|
|
200
|
+
} else res[key2] = val2;
|
|
253
201
|
}
|
|
254
|
-
continue;
|
|
255
202
|
}
|
|
203
|
+
continue;
|
|
256
204
|
}
|
|
257
205
|
if ((0, import_createVariable.isVariable)(val)) {
|
|
258
206
|
res[subKey] = (0, import_getTokenForKey.resolveVariableValue)(subKey, val, styleProps.resolveValues);
|
|
259
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose")
|
|
260
|
-
console.info(`variable`, subKey, res[subKey]);
|
|
261
|
-
}
|
|
207
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(`variable`, subKey, res[subKey]);
|
|
262
208
|
continue;
|
|
263
209
|
}
|
|
264
210
|
if (typeof val === "string") {
|
|
@@ -268,19 +214,13 @@ const resolveTokensAndVariants = (key, value, styleProps, styleState, parentVari
|
|
|
268
214
|
}
|
|
269
215
|
if ((0, import_isObj.isObj)(val)) {
|
|
270
216
|
const subObject = resolveTokensAndVariants(subKey, val, styleProps, styleState, key);
|
|
271
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose")
|
|
272
|
-
console.info(`object`, subKey, subObject);
|
|
273
|
-
}
|
|
217
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(`object`, subKey, subObject);
|
|
274
218
|
res[subKey] ??= {};
|
|
275
219
|
Object.assign(res[subKey], subObject);
|
|
276
|
-
} else
|
|
277
|
-
res[subKey] = val;
|
|
278
|
-
}
|
|
220
|
+
} else res[subKey] = val;
|
|
279
221
|
if (process.env.NODE_ENV === "development") {
|
|
280
222
|
if (debug) {
|
|
281
|
-
if (res[subKey]?.[0] === "$") {
|
|
282
|
-
console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, subKey, res[subKey], theme);
|
|
283
|
-
}
|
|
223
|
+
if (res[subKey]?.[0] === "$") console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, subKey, res[subKey], theme);
|
|
284
224
|
}
|
|
285
225
|
}
|
|
286
226
|
}
|
|
@@ -294,13 +234,9 @@ function getVariantDefinition(variant, value, conf, {
|
|
|
294
234
|
theme
|
|
295
235
|
}) {
|
|
296
236
|
if (!variant) return;
|
|
297
|
-
if (typeof variant === "function")
|
|
298
|
-
return variant;
|
|
299
|
-
}
|
|
237
|
+
if (typeof variant === "function") return variant;
|
|
300
238
|
const exact = variant[value];
|
|
301
|
-
if (exact)
|
|
302
|
-
return exact;
|
|
303
|
-
}
|
|
239
|
+
if (exact) return exact;
|
|
304
240
|
if (value != null) {
|
|
305
241
|
const {
|
|
306
242
|
tokensParsed
|
|
@@ -308,23 +244,14 @@ function getVariantDefinition(variant, value, conf, {
|
|
|
308
244
|
for (const {
|
|
309
245
|
name,
|
|
310
246
|
spreadName
|
|
311
|
-
} of tokenCats) {
|
|
312
|
-
if (
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
if (name === "color" && theme && typeof value === "string" && value[0] === "$") {
|
|
317
|
-
const themeKey = value.slice(1);
|
|
318
|
-
if (themeKey in theme) {
|
|
319
|
-
return variant[spreadName];
|
|
320
|
-
}
|
|
321
|
-
}
|
|
247
|
+
} of tokenCats) if (spreadName in variant) {
|
|
248
|
+
if (name in tokensParsed && value in tokensParsed[name]) return variant[spreadName];
|
|
249
|
+
if (name === "color" && theme && typeof value === "string" && value[0] === "$") {
|
|
250
|
+
if (value.slice(1) in theme) return variant[spreadName];
|
|
322
251
|
}
|
|
323
252
|
}
|
|
324
253
|
const fontSizeVariant = variant["...fontSize"];
|
|
325
|
-
if (fontSizeVariant && conf.fontSizeTokens.has(value))
|
|
326
|
-
return fontSizeVariant;
|
|
327
|
-
}
|
|
254
|
+
if (fontSizeVariant && conf.fontSizeTokens.has(value)) return fontSizeVariant;
|
|
328
255
|
}
|
|
329
256
|
return variant[`:${typeof value}`] || variant["..."];
|
|
330
257
|
}
|