{"version":3,"file":"InputRenderer.mjs","sources":["../../../../../admin/src/pages/EditView/components/InputRenderer.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n  useStrapiApp,\n  useForm,\n  InputRenderer as FormInputRenderer,\n  useField,\n} from '@strapi/admin/strapi-admin';\nimport { useIntl } from 'react-intl';\n\nimport { SINGLE_TYPES } from '../../../constants/collections';\nimport { useDocumentRBAC } from '../../../features/DocumentRBAC';\nimport { type UseDocument } from '../../../hooks/useDocument';\nimport { useDocumentContext } from '../../../hooks/useDocumentContext';\nimport { useDocumentLayout } from '../../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../../hooks/useLazyComponents';\nimport { useHasInputPopoverParent } from '../../../preview/components/InputPopover';\nimport { usePreviewInputManager } from '../../../preview/hooks/usePreviewInputManager';\n\nimport { BlocksInput } from './FormInputs/BlocksInput/BlocksInput';\nimport { ComponentInput } from './FormInputs/Component/Input';\nimport { DynamicZone, useDynamicZone } from './FormInputs/DynamicZone/Field';\nimport { NotAllowedInput } from './FormInputs/NotAllowed';\nimport { RelationsInput } from './FormInputs/Relations/Relations';\nimport { UIDInput } from './FormInputs/UID';\nimport { Wysiwyg } from './FormInputs/Wysiwyg/Field';\n\nimport type { EditFieldLayout } from '../../../hooks/useDocumentLayout';\nimport type { Schema } from '@strapi/types';\nimport type { DistributiveOmit } from 'react-redux';\n\ntype InputRendererProps = DistributiveOmit<EditFieldLayout, 'size'> & {\n  document: ReturnType<UseDocument>;\n};\n\n/**\n * @internal\n *\n * @description An abstraction around the regular form input renderer designed\n * specifically to be used in the EditView of the content-manager this understands\n * the complete EditFieldLayout and will handle RBAC conditions and rendering CM specific\n * components such as Blocks / Relations.\n */\nconst InputRenderer = ({\n  visible,\n  hint: providedHint,\n  document,\n  ...inputProps\n}: InputRendererProps) => {\n  const localeKey = document?.document?.locale || 'default';\n  const { currentDocumentMeta } = useDocumentContext('DynamicComponent');\n  const {\n    edit: { components },\n  } = useDocumentLayout(currentDocumentMeta.model);\n\n  const collectionType =\n    document.schema?.kind === 'collectionType' ? 'collection-types' : 'single-types';\n\n  const isInDynamicZone = useDynamicZone('isInDynamicZone', (state) => state.isInDynamicZone);\n  const isInPreviewPopover = useHasInputPopoverParent();\n  const shouldIgnorePermissions = isInDynamicZone || isInPreviewPopover;\n\n  const isFormDisabled = useForm('InputRenderer', (state) => state.disabled);\n  const canCreateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canCreateFields);\n  const canReadFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canReadFields);\n  const canUpdateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUpdateFields);\n  const canUserAction = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUserAction);\n\n  let idToCheck = document.document?.documentId;\n  if (collectionType === SINGLE_TYPES) {\n    idToCheck = document?.document?.documentId;\n  }\n\n  const editableFields = idToCheck ? canUpdateFields : canCreateFields;\n  const readableFields = idToCheck ? canReadFields : canCreateFields;\n\n  // Everything preview related\n  const previewProps = usePreviewInputManager(inputProps.name, inputProps.attribute);\n  const props = { ...inputProps, ...previewProps };\n\n  /**\n   * Component fields are always readable and editable,\n   * however the fields within them may not be.\n   */\n  const canUserReadField = canUserAction(props.name, readableFields, props.type);\n  const canUserEditField = canUserAction(props.name, editableFields, props.type);\n\n  const fields = useStrapiApp('InputRenderer', (app) => app.fields);\n  const { lazyComponentStore } = useLazyComponents(\n    attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : undefined\n  );\n\n  const hint = useFieldHint(providedHint, props.attribute);\n\n  // We pass field in case of Custom Fields to keep backward compatibility\n  const field = useField(props.name);\n\n  if (!visible) {\n    return null;\n  }\n\n  /**\n   * If the user can't read the field then we don't want to ever render it.\n   */\n  if (!canUserReadField && !shouldIgnorePermissions) {\n    return <NotAllowedInput hint={hint} {...props} />;\n  }\n\n  const fieldIsDisabled =\n    (!canUserEditField && !shouldIgnorePermissions) || props.disabled || isFormDisabled;\n\n  /**\n   * Because a custom field has a unique prop but the type could be confused with either\n   * the useField hook or the type of the field we need to handle it separately and first.\n   */\n  if (attributeHasCustomFieldProperty(props.attribute)) {\n    const CustomInput = lazyComponentStore[props.attribute.customField];\n\n    if (CustomInput) {\n      return (\n        <CustomInput\n          {...props}\n          {...field}\n          // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n          hint={hint}\n          disabled={fieldIsDisabled}\n        />\n      );\n    }\n\n    return (\n      <FormInputRenderer\n        key={`input-${props.name}-${localeKey}`}\n        {...props}\n        {...previewProps}\n        hint={hint}\n        // @ts-expect-error – this workaround lets us display that the custom field is missing.\n        type={props.attribute.customField}\n        disabled={fieldIsDisabled}\n      />\n    );\n  }\n\n  /**\n   * This is where we handle ONLY the fields from the `useLibrary` hook.\n   */\n  const addedInputTypes = Object.keys(fields);\n  if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {\n    const CustomInput = fields[props.type];\n    return (\n      <CustomInput\n        key={`input-${props.name}-${localeKey}`}\n        {...props}\n        // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n        hint={hint}\n        disabled={fieldIsDisabled}\n      />\n    );\n  }\n\n  /**\n   * These include the content-manager specific fields, failing that we fall back\n   * to the more generic form input renderer.\n   */\n  switch (props.type) {\n    case 'blocks':\n      return (\n        <BlocksInput\n          key={`input-${props.name}-${localeKey}`}\n          {...props}\n          hint={hint}\n          type={props.type}\n          disabled={fieldIsDisabled}\n        />\n      );\n    case 'component':\n      return (\n        <ComponentInput\n          key={`input-${props.name}-${localeKey}`}\n          {...props}\n          hint={hint}\n          layout={components[props.attribute.component].layout}\n          disabled={fieldIsDisabled}\n        >\n          {(componentInputProps) => (\n            <InputRenderer\n              key={`input-${componentInputProps.name}-${localeKey}`}\n              {...componentInputProps}\n            />\n          )}\n        </ComponentInput>\n      );\n    case 'dynamiczone':\n      return (\n        <DynamicZone\n          key={`input-${props.name}-${localeKey}`}\n          {...props}\n          hint={hint}\n          disabled={fieldIsDisabled}\n        />\n      );\n    case 'relation':\n      return (\n        <RelationsInput\n          key={`input-${props.name}-${localeKey}`}\n          {...props}\n          hint={hint}\n          disabled={fieldIsDisabled}\n        />\n      );\n    case 'richtext':\n      return (\n        <Wysiwyg\n          key={`input-${props.name}-${localeKey}`}\n          {...props}\n          hint={hint}\n          type={props.type}\n          disabled={fieldIsDisabled}\n        />\n      );\n    case 'uid':\n      return (\n        <UIDInput\n          key={`input-${props.name}-${localeKey}`}\n          {...props}\n          hint={hint}\n          type={props.type}\n          disabled={fieldIsDisabled}\n        />\n      );\n    /**\n     * Enumerations are a special case because they require options.\n     */\n    case 'enumeration':\n      return (\n        <FormInputRenderer\n          key={`input-${props.name}-${localeKey}`}\n          {...props}\n          {...previewProps}\n          hint={hint}\n          options={props.attribute.enum.map((value) => ({ value }))}\n          // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n          type={props.customField ? 'custom-field' : props.type}\n          disabled={fieldIsDisabled}\n        />\n      );\n    default:\n      // These props are not needed for the generic form input renderer.\n      const { unique: _unique, mainField: _mainField, ...restProps } = props;\n      return (\n        <FormInputRenderer\n          key={`input-${props.name}-${localeKey}`}\n          {...restProps}\n          {...previewProps}\n          hint={hint}\n          // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n          type={props.customField ? 'custom-field' : props.type}\n          disabled={fieldIsDisabled}\n        />\n      );\n  }\n};\n\nconst attributeHasCustomFieldProperty = (\n  attribute: Schema.Attribute.AnyAttribute\n): attribute is Schema.Attribute.AnyAttribute & Schema.Attribute.CustomField<string> =>\n  'customField' in attribute && typeof attribute.customField === 'string';\n\nconst useFieldHint = (\n  hint: React.ReactNode = undefined,\n  attribute: Schema.Attribute.AnyAttribute\n) => {\n  const { formatMessage } = useIntl();\n\n  const { maximum, minimum } = getMinMax(attribute);\n\n  if (!maximum && !minimum) {\n    return hint;\n  }\n\n  const units = !['biginteger', 'integer', 'number', 'dynamiczone', 'component'].includes(\n    attribute.type\n  )\n    ? formatMessage(\n        {\n          id: 'content-manager.form.Input.hint.character.unit',\n          defaultMessage: '{maxValue, plural, one { character} other { characters}}',\n        },\n        {\n          maxValue: Math.max(minimum || 0, maximum || 0),\n        }\n      )\n    : null;\n\n  const hasMinAndMax = typeof minimum === 'number' && typeof maximum === 'number';\n\n  return formatMessage(\n    {\n      id: 'content-manager.form.Input.hint.text',\n      defaultMessage:\n        '{min, select, undefined {} other {min. {min}}}{divider}{max, select, undefined {} other {max. {max}}}{unit}{br}{description}',\n    },\n    {\n      min: minimum,\n      max: maximum,\n      description: hint,\n      unit: units,\n      divider: hasMinAndMax\n        ? formatMessage({\n            id: 'content-manager.form.Input.hint.minMaxDivider',\n            defaultMessage: ' / ',\n          })\n        : null,\n      br: <br />,\n    }\n  );\n};\n\nconst getMinMax = (attribute: Schema.Attribute.AnyAttribute) => {\n  if ('min' in attribute || 'max' in attribute) {\n    return {\n      maximum: !Number.isNaN(Number(attribute.max)) ? Number(attribute.max) : undefined,\n      minimum: !Number.isNaN(Number(attribute.min)) ? Number(attribute.min) : undefined,\n    };\n  } else if ('maxLength' in attribute || 'minLength' in attribute) {\n    return { maximum: attribute.maxLength, minimum: attribute.minLength };\n  } else {\n    return { maximum: undefined, minimum: undefined };\n  }\n};\n\nconst MemoizedInputRenderer = React.memo(InputRenderer);\n\nexport type { InputRendererProps };\nexport { MemoizedInputRenderer as InputRenderer, useFieldHint };\n"],"names":["InputRenderer","visible","hint","providedHint","document","inputProps","localeKey","locale","currentDocumentMeta","useDocumentContext","edit","components","useDocumentLayout","model","collectionType","schema","kind","isInDynamicZone","useDynamicZone","state","isInPreviewPopover","useHasInputPopoverParent","shouldIgnorePermissions","isFormDisabled","useForm","disabled","canCreateFields","useDocumentRBAC","rbac","canReadFields","canUpdateFields","canUserAction","idToCheck","documentId","SINGLE_TYPES","editableFields","readableFields","previewProps","usePreviewInputManager","name","attribute","props","canUserReadField","type","canUserEditField","fields","useStrapiApp","app","lazyComponentStore","useLazyComponents","attributeHasCustomFieldProperty","customField","undefined","useFieldHint","field","useField","_jsx","NotAllowedInput","fieldIsDisabled","CustomInput","FormInputRenderer","addedInputTypes","Object","keys","includes","BlocksInput","ComponentInput","layout","component","componentInputProps","DynamicZone","RelationsInput","Wysiwyg","UIDInput","options","enum","map","value","unique","_unique","mainField","_mainField","restProps","formatMessage","useIntl","maximum","minimum","getMinMax","units","id","defaultMessage","maxValue","Math","max","hasMinAndMax","min","description","unit","divider","br","Number","isNaN","maxLength","minLength","MemoizedInputRenderer","React","memo"],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA;;;;;;;AAOC,IACD,MAAMA,aAAAA,GAAgB,CAAC,EACrBC,OAAO,EACPC,IAAMC,EAAAA,YAAY,EAClBC,QAAQ,EACR,GAAGC,UACgB,EAAA,GAAA;IACnB,MAAMC,SAAAA,GAAYF,QAAUA,EAAAA,QAAAA,EAAUG,MAAU,IAAA,SAAA;AAChD,IAAA,MAAM,EAAEC,mBAAmB,EAAE,GAAGC,kBAAmB,CAAA,kBAAA,CAAA;IACnD,MAAM,EACJC,MAAM,EAAEC,UAAU,EAAE,EACrB,GAAGC,iBAAkBJ,CAAAA,mBAAAA,CAAoBK,KAAK,CAAA;AAE/C,IAAA,MAAMC,iBACJV,QAASW,CAAAA,MAAM,EAAEC,IAAAA,KAAS,mBAAmB,kBAAqB,GAAA,cAAA;AAEpE,IAAA,MAAMC,kBAAkBC,cAAe,CAAA,iBAAA,EAAmB,CAACC,KAAAA,GAAUA,MAAMF,eAAe,CAAA;AAC1F,IAAA,MAAMG,kBAAqBC,GAAAA,wBAAAA,EAAAA;AAC3B,IAAA,MAAMC,0BAA0BL,eAAmBG,IAAAA,kBAAAA;AAEnD,IAAA,MAAMG,iBAAiBC,OAAQ,CAAA,eAAA,EAAiB,CAACL,KAAAA,GAAUA,MAAMM,QAAQ,CAAA;AACzE,IAAA,MAAMC,kBAAkBC,eAAgB,CAAA,eAAA,EAAiB,CAACC,IAAAA,GAASA,KAAKF,eAAe,CAAA;AACvF,IAAA,MAAMG,gBAAgBF,e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