|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { isString, isUndefined } from "lodash/fp" |
|
|
|
import { isString, isUndefined, cloneDeep } from "lodash/fp" |
|
|
|
import { TYPE_MAP } from "./types" |
|
|
|
import { assign } from "lodash" |
|
|
|
import { uuid } from "builderStore/uuid" |
|
|
|
@ -83,13 +83,13 @@ const parsePropDef = propDef => { |
|
|
|
if (isString(propDef)) { |
|
|
|
if (!TYPE_MAP[propDef]) return error(`Type ${propDef} is not recognised.`) |
|
|
|
|
|
|
|
return TYPE_MAP[propDef].default |
|
|
|
return cloneDeep(TYPE_MAP[propDef].default) |
|
|
|
} |
|
|
|
|
|
|
|
const type = TYPE_MAP[propDef.type] |
|
|
|
if (!type) return error(`Type ${propDef.type} is not recognised.`) |
|
|
|
|
|
|
|
return propDef.default |
|
|
|
return cloneDeep(propDef.default) |
|
|
|
} |
|
|
|
|
|
|
|
export const arrayElementComponentName = (parentComponentName, arrayPropName) => |
|
|
|
|