@symbo.ls/atoms 2.11.353 → 2.11.357

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/Collection.js +2 -1
  2. package/Img.js +9 -2
  3. package/package.json +2 -2
package/Collection.js CHANGED
@@ -12,7 +12,8 @@ export const Collection = {
12
12
  if (hasChildren) {
13
13
  param = el.props?.children
14
14
  const childrenAs = el.props?.childrenAs
15
- if (childrenAs) param = param.map(v => ({ [childrenAs]: v }))
15
+ const extend = el.props?.childrenExtend
16
+ if (childrenAs) param = param.map(v => ({ extend, [childrenAs]: v }))
16
17
  } else if (!param) return
17
18
 
18
19
  if (isString(param)) {
package/Img.js CHANGED
@@ -4,8 +4,15 @@ export const Img = {
4
4
  tag: 'img',
5
5
 
6
6
  attr: {
7
- src: ({ props, context }) => {
8
- const src = props.src
7
+ src: (el) => {
8
+ const { props, context } = el
9
+ const { exec, isString, replaceLiteralsWithObjectFields } = context.utils
10
+ let src = exec(props.src, el)
11
+
12
+ if (isString(src) && src.includes('{{')) {
13
+ src = replaceLiteralsWithObjectFields(src, el.state)
14
+ }
15
+
9
16
  let isUrl
10
17
  try { isUrl = new URL(src) } catch (e) {}
11
18
  if (isUrl) return src
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.11.353",
3
+ "version": "2.11.357",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "c5d01a30797fc044b539a5309a879f6b249e3888",
6
+ "gitHead": "b5300a7b7e31509580190626af6c392176d2942d",
7
7
  "dependencies": {
8
8
  "@domql/state": "latest",
9
9
  "@domql/utils": "latest",