@symbo.ls/atoms 2.11.418 → 2.11.423

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/Collection.js CHANGED
@@ -1,17 +1,18 @@
1
1
  'use strict'
2
2
 
3
3
  import { isState, getChildStateInKey } from '@domql/state'
4
- import { isString, isNot, isArray, isObject, isObjectLike, deepCloneWithExtend } from '@domql/utils'
4
+ import { isString, isNot, isArray, isObject, isObjectLike, exec, deepCloneWithExtend } from '@domql/utils'
5
5
 
6
6
  export const Collection = {
7
7
  define: {
8
8
  $collection: (param, el, state) => {
9
9
  const { __ref: ref } = el
10
10
  const { children, childrenAs, childrenExtend } = (el.props || {})
11
- const hasChildren = isArray(children)
11
+ const childrenExec = children && exec(children, el, state)
12
+ const hasChildren = isArray(childrenExec)
12
13
 
13
14
  if (hasChildren) {
14
- param = children
15
+ param = deepCloneWithExtend(childrenExec)
15
16
  if (childrenAs) param = param.map(v => ({ extend: childrenExtend, [childrenAs]: v }))
16
17
  } else if (!param) return
17
18
 
@@ -79,7 +80,8 @@ export const Collection = {
79
80
  },
80
81
 
81
82
  $stateCollection: (param, el, state, ctx) => {
82
- if (!param) return
83
+ const { children, childrenAs } = (el.props || {})
84
+ if (!param || children || childrenAs) return
83
85
 
84
86
  if (isString(param)) {
85
87
  if (param === 'state') param = state.parse()
@@ -123,7 +125,8 @@ export const Collection = {
123
125
  },
124
126
 
125
127
  $propsCollection: (param, el, state) => {
126
- if (!param) return
128
+ const { children, childrenAs } = (el.props || {})
129
+ if (!param || children || childrenAs) return
127
130
 
128
131
  if (isString(param)) {
129
132
  if (param === 'state') param = state.parse()
package/Position.js CHANGED
@@ -9,6 +9,7 @@ export const Position = {
9
9
  position: ({ props }) => props.position && ({ position: props.position }),
10
10
  inset: ({ props, deps }) => {
11
11
  const { inset } = props
12
+ if (typeof inset !== 'number') return ({ inset })
12
13
  if (typeof inset !== 'string') return
13
14
  return { inset: inset.split(' ').map(v => deps.getSpacingByKey(v, 'k').k).join(' ') }
14
15
  },
package/Text.js CHANGED
@@ -74,3 +74,5 @@ export const Footnote = {
74
74
  export const B = { tag: 'b' }
75
75
 
76
76
  export const I = { tag: 'i' }
77
+
78
+ export const Data = { tag: 'data' }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.11.418",
3
+ "version": "2.11.423",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "95784936b85d53d4f14104ba7246e347fb2c5b01",
6
+ "gitHead": "1026d12cce4794bf91324f62f9f8eb4c6e07952a",
7
7
  "dependencies": {
8
8
  "@domql/state": "latest",
9
9
  "@domql/utils": "latest",