@symbo.ls/atoms 2.11.126 → 2.11.146

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.
Files changed (3) hide show
  1. package/Media.js +5 -2
  2. package/Text.js +6 -4
  3. package/package.json +2 -2
package/Media.js CHANGED
@@ -13,7 +13,10 @@ export const keySetters = {
13
13
  '[': (key, props, result, element, isSubtree) => applySelectorProps(
14
14
  key, props, isSubtree ? result : (result && result.selector), element
15
15
  ),
16
- '&': (key, props, result, element, isSubtree) => applyEndProps(
16
+ '&': (key, props, result, element, isSubtree) => applyAndProps(
17
+ key, props, isSubtree ? result : (result && result.selector), element
18
+ ),
19
+ '>': (key, props, result, element, isSubtree) => applyAndProps(
17
20
  key, props, isSubtree ? result : (result && result.selector), element
18
21
  ),
19
22
  $: (key, props, result, element, isSubtree) => applyCaseProps(
@@ -87,7 +90,7 @@ const applyMediaProps = (key, props, result, element) => {
87
90
  return result[mediaKey]
88
91
  }
89
92
 
90
- const applyEndProps = (key, props, result, element) => {
93
+ const applyAndProps = (key, props, result, element) => {
91
94
  result[key] = convertPropsToClass(props, result, element)
92
95
  return result[key]
93
96
  }
package/Text.js CHANGED
@@ -1,15 +1,17 @@
1
1
  'use strict'
2
2
 
3
+ import { isObject } from '@domql/utils'
3
4
  import { getFontSizeByKey, getFontFamily } from '@symbo.ls/scratch'
4
5
 
5
6
  export const Text = {
6
- text: ({ key, props, state }) => {
7
- if (props.text === true) return (state && state[key]) || (props && props[key])
7
+ deps: { isObject, getFontSizeByKey, getFontFamily },
8
+ text: ({ key, props, state, deps }) => {
9
+ if (deps.isObject(props) && props.text === true) return (state && state[key]) || (props && props[key])
8
10
  return props.text
9
11
  },
10
12
  class: {
11
- fontSize: ({ props }) => props.fontSize ? getFontSizeByKey(props.fontSize) : null,
12
- fontFamily: ({ props }) => props.fontFamily && ({ fontFamily: getFontFamily(props.fontFamily) || props.fontFamily }),
13
+ fontSize: ({ props, deps }) => props.fontSize ? deps.getFontSizeByKey(props.fontSize) : null,
14
+ fontFamily: ({ props, deps }) => props.fontFamily && ({ fontFamily: deps.getFontFamily(props.fontFamily) || props.fontFamily }),
13
15
  lineHeight: ({ props }) => props.lineHeight && ({ lineHeight: props.lineHeight }),
14
16
  // lineHeight: ({ props }) => props.lineHeight && getSpacingBasedOnRatio(props, 'lineHeight', null, ''),
15
17
  textDecoration: ({ props }) => props.textDecoration && ({ textDecoration: props.textDecoration }),
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.11.126",
3
+ "version": "2.11.146",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "463c4925df4dfbed4611feafe34c6f011d3ba287",
6
+ "gitHead": "b8899bfbe4ca5e7ed373cd5e2e6612aa330899ed",
7
7
  "dependencies": {
8
8
  "@domql/state": "latest",
9
9
  "@domql/utils": "latest",