@payloadcms/ui 3.57.0-canary.6 → 3.57.0-internal.1d2ebbc

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 (92) hide show
  1. package/dist/elements/BulkUpload/FileSidebar/index.d.ts.map +1 -1
  2. package/dist/elements/BulkUpload/FileSidebar/index.js +74 -38
  3. package/dist/elements/BulkUpload/FileSidebar/index.js.map +1 -1
  4. package/dist/elements/BulkUpload/FileSidebar/index.scss +14 -1
  5. package/dist/elements/BulkUpload/FormsManager/index.d.ts +6 -1
  6. package/dist/elements/BulkUpload/FormsManager/index.d.ts.map +1 -1
  7. package/dist/elements/BulkUpload/FormsManager/index.js +50 -14
  8. package/dist/elements/BulkUpload/FormsManager/index.js.map +1 -1
  9. package/dist/elements/BulkUpload/FormsManager/reducer.d.ts +2 -2
  10. package/dist/elements/BulkUpload/FormsManager/reducer.d.ts.map +1 -1
  11. package/dist/elements/BulkUpload/FormsManager/reducer.js +5 -5
  12. package/dist/elements/BulkUpload/FormsManager/reducer.js.map +1 -1
  13. package/dist/elements/BulkUpload/index.d.ts +27 -3
  14. package/dist/elements/BulkUpload/index.d.ts.map +1 -1
  15. package/dist/elements/BulkUpload/index.js +117 -28
  16. package/dist/elements/BulkUpload/index.js.map +1 -1
  17. package/dist/elements/LivePreview/IFrame/index.d.ts +7 -1
  18. package/dist/elements/LivePreview/IFrame/index.d.ts.map +1 -1
  19. package/dist/elements/LivePreview/IFrame/index.js +18 -39
  20. package/dist/elements/LivePreview/IFrame/index.js.map +1 -1
  21. package/dist/elements/LivePreview/Window/index.d.ts.map +1 -1
  22. package/dist/elements/LivePreview/Window/index.js +61 -135
  23. package/dist/elements/LivePreview/Window/index.js.map +1 -1
  24. package/dist/elements/SearchBar/index.scss +0 -4
  25. package/dist/elements/Status/index.d.ts.map +1 -1
  26. package/dist/elements/Status/index.js +1 -1
  27. package/dist/elements/Status/index.js.map +1 -1
  28. package/dist/elements/Table/RelationshipProvider/index.d.ts.map +1 -1
  29. package/dist/elements/Table/RelationshipProvider/index.js +28 -44
  30. package/dist/elements/Table/RelationshipProvider/index.js.map +1 -1
  31. package/dist/exports/client/index.js +24 -24
  32. package/dist/exports/client/index.js.map +4 -4
  33. package/dist/exports/rsc/index.d.ts +0 -1
  34. package/dist/exports/rsc/index.d.ts.map +1 -1
  35. package/dist/exports/rsc/index.js +0 -1
  36. package/dist/exports/rsc/index.js.map +1 -1
  37. package/dist/fields/Blocks/index.d.ts.map +1 -1
  38. package/dist/fields/Blocks/index.js +16 -36
  39. package/dist/fields/Blocks/index.js.map +1 -1
  40. package/dist/forms/Form/index.js +2 -1
  41. package/dist/forms/Form/index.js.map +1 -1
  42. package/dist/forms/Form/mergeServerFormState.d.ts.map +1 -1
  43. package/dist/forms/Form/mergeServerFormState.js +0 -8
  44. package/dist/forms/Form/mergeServerFormState.js.map +1 -1
  45. package/dist/forms/Form/types.d.ts +2 -2
  46. package/dist/forms/Form/types.d.ts.map +1 -1
  47. package/dist/forms/Form/types.js.map +1 -1
  48. package/dist/forms/RenderFields/RenderField.js +236 -223
  49. package/dist/forms/RenderFields/RenderField.js.map +1 -1
  50. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
  51. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +1 -32
  52. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
  53. package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
  54. package/dist/forms/fieldSchemasToFormState/renderField.js +1 -2
  55. package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
  56. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.d.ts.map +1 -1
  57. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js +0 -2
  58. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js.map +1 -1
  59. package/dist/forms/fieldSchemasToFormState/types.d.ts +0 -6
  60. package/dist/forms/fieldSchemasToFormState/types.d.ts.map +1 -1
  61. package/dist/forms/fieldSchemasToFormState/types.js.map +1 -1
  62. package/dist/forms/useField/index.d.ts.map +1 -1
  63. package/dist/forms/useField/index.js +73 -76
  64. package/dist/forms/useField/index.js.map +1 -1
  65. package/dist/forms/useField/types.d.ts +9 -5
  66. package/dist/forms/useField/types.d.ts.map +1 -1
  67. package/dist/forms/useField/types.js.map +1 -1
  68. package/dist/providers/LivePreview/context.d.ts +2 -17
  69. package/dist/providers/LivePreview/context.d.ts.map +1 -1
  70. package/dist/providers/LivePreview/context.js +2 -3
  71. package/dist/providers/LivePreview/context.js.map +1 -1
  72. package/dist/providers/LivePreview/index.d.ts +2 -2
  73. package/dist/providers/LivePreview/index.d.ts.map +1 -1
  74. package/dist/providers/LivePreview/index.js +19 -33
  75. package/dist/providers/LivePreview/index.js.map +1 -1
  76. package/dist/styles.css +1 -1
  77. package/dist/utilities/buildFormState.d.ts +0 -2
  78. package/dist/utilities/buildFormState.d.ts.map +1 -1
  79. package/dist/utilities/buildFormState.js +1 -20
  80. package/dist/utilities/buildFormState.js.map +1 -1
  81. package/dist/views/Edit/index.d.ts.map +1 -1
  82. package/dist/views/Edit/index.js +10 -17
  83. package/dist/views/Edit/index.js.map +1 -1
  84. package/package.json +4 -4
  85. package/dist/utilities/formatAbsoluteURL.d.ts +0 -8
  86. package/dist/utilities/formatAbsoluteURL.d.ts.map +0 -1
  87. package/dist/utilities/formatAbsoluteURL.js +0 -15
  88. package/dist/utilities/formatAbsoluteURL.js.map +0 -1
  89. package/dist/utilities/handleLivePreview.d.ts +0 -58
  90. package/dist/utilities/handleLivePreview.d.ts.map +0 -1
  91. package/dist/utilities/handleLivePreview.js +0 -96
  92. package/dist/utilities/handleLivePreview.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"mergeServerFormState.js","names":["dequal","mergeServerFormState","acceptValues","currentState","incomingState","newState","path","incomingField","Object","entries","addedByServer","shouldAcceptValue","overrideLocalChanges","isModified","sanitizedIncomingField","initialValue","value","rest","errorPaths","Array","isArray","rows","forEach","row","indexInCurrentState","findIndex","existingRow","id","newRow","push","valid","passesCondition","blocksFilterOptions"],"sources":["../../../src/forms/Form/mergeServerFormState.ts"],"sourcesContent":["'use client'\nimport type { FormState } from 'payload'\n\nimport { dequal } from 'dequal/lite' // lite: no need for Map and Set support\n\n/**\n * If true, will accept all values from the server, overriding any current values in local state.\n * Can also provide an options object for more granular control.\n */\nexport type AcceptValues =\n | {\n /**\n * When `false`, will accept the values from the server _UNLESS_ the value has been modified locally since the request was made.\n * This is useful for autosave, for example, where hooks may have modified the field's value on the server while you were still making changes.\n * @default undefined\n */\n overrideLocalChanges?: boolean\n }\n | boolean\n\ntype Args = {\n acceptValues?: AcceptValues\n currentState?: FormState\n incomingState: FormState\n}\n\n/**\n * This function receives form state from the server and intelligently merges it into the client state.\n * The server contains extra properties that the client may not have, e.g. custom components and error states.\n * We typically do not want to merge properties that rely on user input, however, such as values, unless explicitly requested.\n * Doing this would cause the client to lose any local changes to those fields.\n *\n * Note: Local state is the source of truth, not the new server state that is getting merged in. This is critical for array row\n * manipulation specifically, where the user may have added, removed, or reordered rows while a request was pending and is now stale.\n *\n * This function applies some defaults, as well as cleans up the server response in preparation for the client.\n * e.g. it will set `valid` and `passesCondition` to true if undefined, and remove `addedByServer` from the response.\n */\nexport const mergeServerFormState = ({\n acceptValues,\n currentState = {},\n incomingState,\n}: Args): FormState => {\n const newState = { ...currentState }\n\n for (const [path, incomingField] of Object.entries(incomingState || {})) {\n if (!(path in currentState) && !incomingField.addedByServer) {\n continue\n }\n\n /**\n * If it's a new field added by the server, always accept the value.\n * Otherwise:\n * a. accept all values when explicitly requested, e.g. on submit\n * b. only accept values for unmodified fields, e.g. on autosave\n */\n const shouldAcceptValue =\n incomingField.addedByServer ||\n acceptValues === true ||\n (typeof acceptValues === 'object' &&\n acceptValues !== null &&\n // Note: Must be explicitly `false`, allow `null` or `undefined` to mean true\n acceptValues.overrideLocalChanges === false &&\n !currentState[path]?.isModified)\n\n let sanitizedIncomingField = incomingField\n\n if (!shouldAcceptValue) {\n /**\n * Note: do not delete properties off `incomingField` as this will mutate the original object\n * Instead, omit them from the destructured object by excluding specific keys\n * This will also ensure we don't set `undefined` into the result unnecessarily\n */\n const { initialValue, value, ...rest } = incomingField\n sanitizedIncomingField = rest\n }\n\n newState[path] = {\n ...currentState[path],\n ...sanitizedIncomingField,\n }\n\n if (\n currentState[path] &&\n 'errorPaths' in currentState[path] &&\n !('errorPaths' in incomingField)\n ) {\n newState[path].errorPaths = []\n }\n\n /**\n * Deeply merge the rows array to ensure changes to local state are not lost while the request was pending\n * For example, the server response could come back with a row which has been deleted on the client\n * Loop over the incoming rows, if it exists in client side form state, merge in any new properties from the server\n * Note: read `currentState` and not `newState` here, as the `rows` property have already been merged above\n */\n if (Array.isArray(incomingField.rows) && path in currentState) {\n newState[path].rows = [...(currentState[path]?.rows || [])] // shallow copy to avoid mutating the original array\n\n incomingField.rows.forEach((row) => {\n const indexInCurrentState = currentState[path].rows?.findIndex(\n (existingRow) => existingRow.id === row.id,\n )\n\n if (indexInCurrentState > -1) {\n newState[path].rows[indexInCurrentState] = {\n ...currentState[path].rows[indexInCurrentState],\n ...row,\n }\n } else if (row.addedByServer) {\n /**\n * Note: This is a known limitation of computed array and block rows\n * If a new row was added by the server, we append it to the _end_ of this array\n * This is because the client is the source of truth, and it has arrays ordered in a certain position\n * For example, the user may have re-ordered rows client-side while a long running request is processing\n * This means that we _cannot_ slice a new row into the second position on the server, for example\n * By the time it gets back to the client, its index is stale\n */\n const newRow = { ...row }\n delete newRow.addedByServer\n newState[path].rows.push(newRow)\n }\n })\n }\n\n // If `valid` is `undefined`, mark it as `true`\n if (incomingField.valid !== false) {\n newState[path].valid = true\n }\n\n // If `passesCondition` is `undefined`, mark it as `true`\n if (incomingField.passesCondition !== false) {\n newState[path].passesCondition = true\n }\n\n /**\n * Undefined values for blocksFilterOptions coming back should be treated as \"all blocks allowed\" and\n * should always be merged in.\n * Without this, an undefined value coming back will incorrectly be ignored, and the previous filter will remain.\n */\n if (!incomingField.blocksFilterOptions) {\n delete newState[path].blocksFilterOptions\n }\n\n // Strip away the `addedByServer` property from the client\n // This will prevent it from being passed back to the server\n delete newState[path].addedByServer\n }\n\n // Return the original object reference if the state is unchanged\n // This will avoid unnecessary re-renders and dependency updates\n return dequal(newState, currentState) ? currentState : newState\n}\n"],"mappings":"AAAA;;AAGA,SAASA,MAAM,QAAQ,cAAa,CAAC;AAuBrC;;;;;;;;;;;;AAYA,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,YAAY;EACZC,YAAA,GAAe,CAAC,CAAC;EACjBC;AAAa,CACR;EACL,MAAMC,QAAA,GAAW;IAAE,GAAGF;EAAa;EAEnC,KAAK,MAAM,CAACG,IAAA,EAAMC,aAAA,CAAc,IAAIC,MAAA,CAAOC,OAAO,CAACL,aAAA,IAAiB,CAAC,IAAI;IACvE,IAAI,EAAEE,IAAA,IAAQH,YAAW,KAAM,CAACI,aAAA,CAAcG,aAAa,EAAE;MAC3D;IACF;IAEA;;;;;;IAMA,MAAMC,iBAAA,GACJJ,aAAA,CAAcG,aAAa,IAC3BR,YAAA,KAAiB,QAChB,OAAOA,YAAA,KAAiB,YACvBA,YAAA,KAAiB;IACjB;IACAA,YAAA,CAAaU,oBAAoB,KAAK,SACtC,CAACT,YAAY,CAACG,IAAA,CAAK,EAAEO,UAAA;IAEzB,IAAIC,sBAAA,GAAyBP,aAAA;IAE7B,IAAI,CAACI,iBAAA,EAAmB;MACtB;;;;;MAKA,MAAM;QAAEI,YAAY;QAAEC,KAAK;QAAE,GAAGC;MAAA,CAAM,GAAGV,aAAA;MACzCO,sBAAA,GAAyBG,IAAA;IAC3B;IAEAZ,QAAQ,CAACC,IAAA,CAAK,GAAG;MACf,GAAGH,YAAY,CAACG,IAAA,CAAK;MACrB,GAAGQ;IACL;IAEA,IACEX,YAAY,CAACG,IAAA,CAAK,IAClB,gBAAgB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I,CAACxB,aAAA,CAAcyB,mBAAmB,EAAE;MACtC,OAAO3B,QAAQ,CAACC,IAAA,CAAK,CAAC0B,mBAAmB;IAC3C;IAEA;IACA;IACA,OAAO3B,QAAQ,CAACC,IAAA,CAAK,CAACI,aAAa;EACrC;EAEA;EACA;EACA,OAAOV,MAAA,CAAOK,QAAA,EAAUF,YAAA,IAAgBA,YAAA,GAAeE,QAAA;AACzD","ignoreList":[]}
1
+ {"version":3,"file":"mergeServerFormState.js","names":["dequal","mergeServerFormState","acceptValues","currentState","incomingState","newState","path","incomingField","Object","entries","addedByServer","shouldAcceptValue","overrideLocalChanges","isModified","sanitizedIncomingField","initialValue","value","rest","errorPaths","Array","isArray","rows","forEach","row","indexInCurrentState","findIndex","existingRow","id","newRow","push","valid","passesCondition"],"sources":["../../../src/forms/Form/mergeServerFormState.ts"],"sourcesContent":["'use client'\nimport type { FormState } from 'payload'\n\nimport { dequal } from 'dequal/lite' // lite: no need for Map and Set support\n\n/**\n * If true, will accept all values from the server, overriding any current values in local state.\n * Can also provide an options object for more granular control.\n */\nexport type AcceptValues =\n | {\n /**\n * When `false`, will accept the values from the server _UNLESS_ the value has been modified locally since the request was made.\n * This is useful for autosave, for example, where hooks may have modified the field's value on the server while you were still making changes.\n * @default undefined\n */\n overrideLocalChanges?: boolean\n }\n | boolean\n\ntype Args = {\n acceptValues?: AcceptValues\n currentState?: FormState\n incomingState: FormState\n}\n\n/**\n * This function receives form state from the server and intelligently merges it into the client state.\n * The server contains extra properties that the client may not have, e.g. custom components and error states.\n * We typically do not want to merge properties that rely on user input, however, such as values, unless explicitly requested.\n * Doing this would cause the client to lose any local changes to those fields.\n *\n * Note: Local state is the source of truth, not the new server state that is getting merged in. This is critical for array row\n * manipulation specifically, where the user may have added, removed, or reordered rows while a request was pending and is now stale.\n *\n * This function applies some defaults, as well as cleans up the server response in preparation for the client.\n * e.g. it will set `valid` and `passesCondition` to true if undefined, and remove `addedByServer` from the response.\n */\nexport const mergeServerFormState = ({\n acceptValues,\n currentState = {},\n incomingState,\n}: Args): FormState => {\n const newState = { ...currentState }\n\n for (const [path, incomingField] of Object.entries(incomingState || {})) {\n if (!(path in currentState) && !incomingField.addedByServer) {\n continue\n }\n\n /**\n * If it's a new field added by the server, always accept the value.\n * Otherwise:\n * a. accept all values when explicitly requested, e.g. on submit\n * b. only accept values for unmodified fields, e.g. on autosave\n */\n const shouldAcceptValue =\n incomingField.addedByServer ||\n acceptValues === true ||\n (typeof acceptValues === 'object' &&\n acceptValues !== null &&\n // Note: Must be explicitly `false`, allow `null` or `undefined` to mean true\n acceptValues.overrideLocalChanges === false &&\n !currentState[path]?.isModified)\n\n let sanitizedIncomingField = incomingField\n\n if (!shouldAcceptValue) {\n /**\n * Note: do not delete properties off `incomingField` as this will mutate the original object\n * Instead, omit them from the destructured object by excluding specific keys\n * This will also ensure we don't set `undefined` into the result unnecessarily\n */\n const { initialValue, value, ...rest } = incomingField\n sanitizedIncomingField = rest\n }\n\n newState[path] = {\n ...currentState[path],\n ...sanitizedIncomingField,\n }\n\n if (\n currentState[path] &&\n 'errorPaths' in currentState[path] &&\n !('errorPaths' in incomingField)\n ) {\n newState[path].errorPaths = []\n }\n\n /**\n * Deeply merge the rows array to ensure changes to local state are not lost while the request was pending\n * For example, the server response could come back with a row which has been deleted on the client\n * Loop over the incoming rows, if it exists in client side form state, merge in any new properties from the server\n * Note: read `currentState` and not `newState` here, as the `rows` property have already been merged above\n */\n if (Array.isArray(incomingField.rows) && path in currentState) {\n newState[path].rows = [...(currentState[path]?.rows || [])] // shallow copy to avoid mutating the original array\n\n incomingField.rows.forEach((row) => {\n const indexInCurrentState = currentState[path].rows?.findIndex(\n (existingRow) => existingRow.id === row.id,\n )\n\n if (indexInCurrentState > -1) {\n newState[path].rows[indexInCurrentState] = {\n ...currentState[path].rows[indexInCurrentState],\n ...row,\n }\n } else if (row.addedByServer) {\n /**\n * Note: This is a known limitation of computed array and block rows\n * If a new row was added by the server, we append it to the _end_ of this array\n * This is because the client is the source of truth, and it has arrays ordered in a certain position\n * For example, the user may have re-ordered rows client-side while a long running request is processing\n * This means that we _cannot_ slice a new row into the second position on the server, for example\n * By the time it gets back to the client, its index is stale\n */\n const newRow = { ...row }\n delete newRow.addedByServer\n newState[path].rows.push(newRow)\n }\n })\n }\n\n // If `valid` is `undefined`, mark it as `true`\n if (incomingField.valid !== false) {\n newState[path].valid = true\n }\n\n // If `passesCondition` is `undefined`, mark it as `true`\n if (incomingField.passesCondition !== false) {\n newState[path].passesCondition = true\n }\n\n // Strip away the `addedByServer` property from the client\n // This will prevent it from being passed back to the server\n delete newState[path].addedByServer\n }\n\n // Return the original object reference if the state is unchanged\n // This will avoid unnecessary re-renders and dependency updates\n return dequal(newState, currentState) ? currentState : newState\n}\n"],"mappings":"AAAA;;AAGA,SAASA,MAAM,QAAQ,cAAa,CAAC;AAuBrC;;;;;;;;;;;;AAYA,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,YAAY;EACZC,YAAA,GAAe,CAAC,CAAC;EACjBC;AAAa,CACR;EACL,MAAMC,QAAA,GAAW;IAAE,GAAGF;EAAa;EAEnC,KAAK,MAAM,CAACG,IAAA,EAAMC,aAAA,CAAc,IAAIC,MAAA,CAAOC,OAAO,CAACL,aAAA,IAAiB,CAAC,IAAI;IACvE,IAAI,EAAEE,IAAA,IAAQH,YAAW,KAAM,CAACI,aAAA,CAAcG,aAAa,EAAE;MAC3D;IACF;IAEA;;;;;;IAMA,MAAMC,iBAAA,GACJJ,aAAA,CAAcG,aAAa,IAC3BR,YAAA,KAAiB,QAChB,OAAOA,YAAA,KAAiB,YACvBA,YAAA,KAAiB;IACjB;IACAA,YAAA,CAAaU,oBAAoB,KAAK,SACtC,CAACT,YAAY,CAACG,IAAA,CAAK,EAAEO,UAAA;IAEzB,IAAIC,sBAAA,GAAyBP,aAAA;IAE7B,IAAI,CAACI,iBAAA,EAAmB;MACtB;;;;;MAKA,MAAM;QAAEI,YAAY;QAAEC,KAAK;QAAE,G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B,KAAK,KAAK,OAAO;MACjCzB,QAAQ,CAACC,IAAA,CAAK,CAACwB,KAAK,GAAG;IACzB;IAEA;IACA,IAAIvB,aAAA,CAAcwB,eAAe,KAAK,OAAO;MAC3C1B,QAAQ,CAACC,IAAA,CAAK,CAACyB,eAAe,GAAG;IACnC;IAEA;IACA;IACA,OAAO1B,QAAQ,CAACC,IAAA,CAAK,CAACI,aAAa;EACrC;EAEA;EACA;EACA,OAAOV,MAAA,CAAOK,QAAA,EAAUF,YAAA,IAAgBA,YAAA,GAAeE,QAAA;AACzD","ignoreList":[]}
@@ -5,13 +5,13 @@ import type { AcceptValues } from './mergeServerFormState.js';
5
5
  export type Preferences = {
6
6
  [key: string]: unknown;
7
7
  };
8
- export type FormOnSuccess<T = unknown, C = Record<string, unknown>> = (json: T, ctx?: {
8
+ export type FormOnSuccess<T = unknown, C = Record<string, unknown>> = (json: T, options?: {
9
9
  /**
10
10
  * Arbitrary context passed to the onSuccess callback.
11
11
  */
12
12
  context?: C;
13
13
  /**
14
- * The form state that was sent with the request when retrieving the `json` arg.
14
+ * Form state at the time of the request used to retrieve the JSON response.
15
15
  */
16
16
  formState?: FormState;
17
17
  }) => Promise<FormState | void> | void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/forms/Form/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EACJ,SAAS,EACT,SAAS,EACT,GAAG,EACH,SAAS,EACT,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,aAAa,CAAC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ClB,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,EAAE,MAAM,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;QAClB,aAAa,CAAC,EAAE,SAAS,CAAA;KAC1B,KAAK,IAAI,CAAA;IACV,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;IACxC,KAAK,EAAE,KAAK,CAAA;IACZ;;;OAGG;IACH,uBAAuB,EAAE,aAAa,CAAA;IACtC,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IACxC,UAAU,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAA;IACzC,WAAW,EAAE,WAAW,CAAA;IACxB,aAAa,EAAE,aAAa,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/forms/Form/types.ts"],"sourcesContent":["import type {\n ClientField,\n Data,\n FormField,\n FormState,\n Row,\n TypedUser,\n ValidationFieldError,\n} from 'payload'\nimport type React from 'react'\nimport type { Dispatch } from 'react'\n\nimport type { AcceptValues } from './mergeServerFormState.js'\n\nexport type Preferences = {\n [key: string]: unknown\n}\n\nexport type FormOnSuccess<T = unknown, C = Record<string, unknown>> = (\n json: T,\n ctx?: {\n /**\n * Arbitrary context passed to the onSuccess callback.\n */\n context?: C\n /**\n * The form state that was sent with the request when retrieving the `json` arg.\n */\n formState?: FormState\n },\n) => Promise<FormState | void> | void\n\nexport type FormProps = {\n beforeSubmit?: ((args: { formState: FormState }) => Promise<FormState>)[]\n children?: React.ReactNode\n className?: string\n disabled?: boolean\n disableSuccessStatus?: boolean\n /**\n * If you would like to solely leverage server-side validation on submit,\n * you can disable checks that the form makes before it submits\n */\n disableValidationOnSubmit?: boolean\n /**\n * If you don't want the form to be a <form> element, you can pass a string here to use as the wrapper element.\n */\n el?: string\n /**\n * By default, the form will get the field schema (not data) from the current document. If you pass this in, you can override that behavior.\n * This is very useful for sub-forms, where the form's field schema is not necessarily the field schema of the current document (e.g. for the Blocks\n * feature of the Lexical Rich Text field)\n */\n fields?: ClientField[]\n handleResponse?: (\n res: Response,\n successToast: (value: string) => void,\n errorToast: (value: string) => void,\n ) => void\n initialState?: FormState\n /**\n * Determines if this Form is the main, top-level Form of a document. If set to true, the\n * Form's children will be wrapped in a DocumentFormContext, which lets you access this document\n * Form's data and fields from any child component - even if that child component is wrapped in a child\n * Form (e.g. a lexical block).\n */\n isDocumentForm?: boolean\n isInitializing?: boolean\n log?: boolean\n onChange?: ((args: { formState: FormState; submitted?: boolean }) => Promise<FormState>)[]\n onSubmit?: (fields: FormState, data: Data) => void\n onSuccess?: FormOnSuccess\n redirect?: string\n submitted?: boolean\n uuid?: string\n validationOperation?: 'create' | 'update'\n waitForAutocomplete?: boolean\n} & (\n | {\n action: (formData: FormData) => Promise<void>\n }\n | {\n action?: string\n method?: 'DELETE' | 'GET' | 'PATCH' | 'POST'\n }\n)\n\nexport type SubmitOptions<C = Record<string, unknown>> = {\n acceptValues?: AcceptValues\n action?: string\n /**\n * If you want to pass additional data to the onSuccess callback, you can use this context object.\n *\n * @experimental This property is experimental and may change in the future.\n */\n context?: C\n /**\n * When true, will disable the form while it is processing.\n * @default true\n */\n disableFormWhileProcessing?: boolean\n /**\n * When true, will disable the success toast after form submission.\n * @default false\n */\n disableSuccessStatus?: boolean\n method?: string\n overrides?: ((formState) => FormData) | Record<string, unknown>\n /**\n * When true, will skip validation before submitting the form.\n * @default false\n */\n skipValidation?: boolean\n}\n\nexport type DispatchFields = React.Dispatch<any>\n\nexport type Submit = <T extends Response, C extends Record<string, unknown>>(\n options?: SubmitOptions<C>,\n e?: React.FormEvent<HTMLFormElement>,\n) => Promise</**\n * Returns the form state and the response from the server.\n *\n * @experimental - Note: the `{ res: ... }` return type is experimental and may change in the future. Use at your own discretion.\n */\n{ formState?: FormState; res: T } | void>\n\nexport type ValidateForm = () => Promise<boolean>\n\nexport type CreateFormData = (\n overrides?: Record<string, unknown>,\n /**\n * If mergeOverrideData true, the data will be merged with the existing data in the form state.\n * @default true\n */\n options?: {\n /**\n * If provided, will use this instead of of derived data from the current form state.\n */\n data?: Data\n mergeOverrideData?: boolean\n },\n) => FormData | Promise<FormData>\n\nexport type GetFields = () => FormState\nexport type GetField = (path: string) => FormField\nexport type GetData = () => Data\nexport type GetSiblingData = (path: string) => Data\nexport type GetDataByPath = <T = unknown>(path: string) => T\nexport type SetModified = (modified: boolean) => void\nexport type SetSubmitted = (submitted: boolean) => void\nexport type SetProcessing = (processing: boolean) => void\n\nexport type Reset = (data: unknown) => Promise<void>\n\nexport type REPLACE_STATE = {\n optimize?: boolean\n /**\n * If `sanitize` is true, default values will be set for form field properties that are not present in the incoming state.\n * For example, `valid` will be set to true if it is not present in the incoming state.\n */\n sanitize?: boolean\n state: FormState\n type: 'REPLACE_STATE'\n}\n\nexport type REMOVE = {\n path: string\n type: 'REMOVE'\n}\n\nexport type MODIFY_CONDITION = {\n path: string\n result: boolean\n type: 'MODIFY_CONDITION'\n user: TypedUser\n}\n\nexport type UPDATE = {\n path: string\n type: 'UPDATE'\n} & Partial<FormField>\n\nexport type UPDATE_MANY = {\n formState: FormState\n type: 'UPDATE_MANY'\n}\n\nexport type REMOVE_ROW = {\n path: string\n rowIndex: number\n type: 'REMOVE_ROW'\n}\n\nexport type ADD_ROW = {\n blockType?: string\n path: string\n rowIndex?: number\n subFieldState?: FormState\n type: 'ADD_ROW'\n}\n\nexport type MERGE_SERVER_STATE = {\n acceptValues?: AcceptValues\n prevStateRef: React.RefObject<FormState>\n serverState: FormState\n type: 'MERGE_SERVER_STATE'\n}\n\nexport type REPLACE_ROW = {\n blockType?: string\n path: string\n rowIndex: number\n subFieldState?: FormState\n type: 'REPLACE_ROW'\n}\n\nexport type DUPLICATE_ROW = {\n path: string\n rowIndex: number\n type: 'DUPLICATE_ROW'\n}\n\nexport type MOVE_ROW = {\n moveFromIndex: number\n moveToIndex: number\n path: string\n type: 'MOVE_ROW'\n}\n\nexport type ADD_SERVER_ERRORS = {\n errors: ValidationFieldError[]\n type: 'ADD_SERVER_ERRORS'\n}\n\nexport type SET_ROW_COLLAPSED = {\n path: string\n type: 'SET_ROW_COLLAPSED'\n updatedRows: Row[]\n}\n\nexport type SET_ALL_ROWS_COLLAPSED = {\n path: string\n type: 'SET_ALL_ROWS_COLLAPSED'\n updatedRows: Row[]\n}\n\nexport type FieldAction =\n | ADD_ROW\n | ADD_SERVER_ERRORS\n | DUPLICATE_ROW\n | MERGE_SERVER_STATE\n | MODIFY_CONDITION\n | MOVE_ROW\n | REMOVE\n | REMOVE_ROW\n | REPLACE_ROW\n | REPLACE_STATE\n | SET_ALL_ROWS_COLLAPSED\n | SET_ROW_COLLAPSED\n | UPDATE\n | UPDATE_MANY\n\nexport type FormFieldsContext = [FormState, Dispatch<FieldAction>]\n\nexport type Context = {\n addFieldRow: ({\n blockType,\n path,\n rowIndex,\n schemaPath,\n subFieldState,\n }: {\n blockType?: string\n path: string\n rowIndex?: number\n schemaPath: string\n subFieldState?: FormState\n }) => void\n buildRowErrors: () => void\n createFormData: CreateFormData\n disabled: boolean\n dispatchFields: Dispatch<FieldAction>\n /**\n * Form context fields may be outdated and should not be relied on. Instead, prefer `useFormFields`.\n */\n fields: FormState\n formRef: React.RefObject<HTMLFormElement>\n getData: GetData\n getDataByPath: GetDataByPath\n getField: GetField\n getFields: GetFields\n getSiblingData: GetSiblingData\n initializing: boolean\n /**\n * Tracks wether the form state passes validation.\n * For example the state could be submitted but invalid as field errors have been returned.\n */\n isValid: boolean\n moveFieldRow: ({\n moveFromIndex,\n moveToIndex,\n path,\n }: {\n moveFromIndex: number\n moveToIndex: number\n path: string\n }) => void\n removeFieldRow: ({ path, rowIndex }: { path: string; rowIndex: number }) => void\n replaceFieldRow: ({\n blockType,\n path,\n rowIndex,\n schemaPath,\n subFieldState,\n }: {\n blockType?: string\n path: string\n rowIndex: number\n schemaPath: string\n subFieldState?: FormState\n }) => void\n replaceState: (state: FormState) => void\n reset: Reset\n /**\n * If the form has started processing in the background (e.g.\n * if autosave is running), this will be true.\n */\n setBackgroundProcessing: SetProcessing\n setDisabled: (disabled: boolean) => void\n setIsValid: (processing: boolean) => void\n setModified: SetModified\n setProcessing: SetProcessing\n setSubmitted: SetSubmitted\n submit: Submit\n uuid?: string\n validateForm: ValidateForm\n}\n"],"mappings":"AAwQA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/forms/Form/types.ts"],"sourcesContent":["import type {\n ClientField,\n Data,\n FormField,\n FormState,\n Row,\n TypedUser,\n ValidationFieldError,\n} from 'payload'\nimport type React from 'react'\nimport type { Dispatch } from 'react'\n\nimport type { AcceptValues } from './mergeServerFormState.js'\n\nexport type Preferences = {\n [key: string]: unknown\n}\n\nexport type FormOnSuccess<T = unknown, C = Record<string, unknown>> = (\n json: T,\n options?: {\n /**\n * Arbitrary context passed to the onSuccess callback.\n */\n context?: C\n /**\n * Form state at the time of the request used to retrieve the JSON response.\n */\n formState?: FormState\n },\n) => Promise<FormState | void> | void\n\nexport type FormProps = {\n beforeSubmit?: ((args: { formState: FormState }) => Promise<FormState>)[]\n children?: React.ReactNode\n className?: string\n disabled?: boolean\n disableSuccessStatus?: boolean\n /**\n * If you would like to solely leverage server-side validation on submit,\n * you can disable checks that the form makes before it submits\n */\n disableValidationOnSubmit?: boolean\n /**\n * If you don't want the form to be a <form> element, you can pass a string here to use as the wrapper element.\n */\n el?: string\n /**\n * By default, the form will get the field schema (not data) from the current document. If you pass this in, you can override that behavior.\n * This is very useful for sub-forms, where the form's field schema is not necessarily the field schema of the current document (e.g. for the Blocks\n * feature of the Lexical Rich Text field)\n */\n fields?: ClientField[]\n handleResponse?: (\n res: Response,\n successToast: (value: string) => void,\n errorToast: (value: string) => void,\n ) => void\n initialState?: FormState\n /**\n * Determines if this Form is the main, top-level Form of a document. If set to true, the\n * Form's children will be wrapped in a DocumentFormContext, which lets you access this document\n * Form's data and fields from any child component - even if that child component is wrapped in a child\n * Form (e.g. a lexical block).\n */\n isDocumentForm?: boolean\n isInitializing?: boolean\n log?: boolean\n onChange?: ((args: { formState: FormState; submitted?: boolean }) => Promise<FormState>)[]\n onSubmit?: (fields: FormState, data: Data) => void\n onSuccess?: FormOnSuccess\n redirect?: string\n submitted?: boolean\n uuid?: string\n validationOperation?: 'create' | 'update'\n waitForAutocomplete?: boolean\n} & (\n | {\n action: (formData: FormData) => Promise<void>\n }\n | {\n action?: string\n method?: 'DELETE' | 'GET' | 'PATCH' | 'POST'\n }\n)\n\nexport type SubmitOptions<C = Record<string, unknown>> = {\n acceptValues?: AcceptValues\n action?: string\n /**\n * If you want to pass additional data to the onSuccess callback, you can use this context object.\n *\n * @experimental This property is experimental and may change in the future.\n */\n context?: C\n /**\n * When true, will disable the form while it is processing.\n * @default true\n */\n disableFormWhileProcessing?: boolean\n /**\n * When true, will disable the success toast after form submission.\n * @default false\n */\n disableSuccessStatus?: boolean\n method?: string\n overrides?: ((formState) => FormData) | Record<string, unknown>\n /**\n * When true, will skip validation before submitting the form.\n * @default false\n */\n skipValidation?: boolean\n}\n\nexport type DispatchFields = React.Dispatch<any>\n\nexport type Submit = <T extends Response, C extends Record<string, unknown>>(\n options?: SubmitOptions<C>,\n e?: React.FormEvent<HTMLFormElement>,\n) => Promise</**\n * Returns the form state and the response from the server.\n *\n * @experimental - Note: the `{ res: ... }` return type is experimental and may change in the future. Use at your own discretion.\n */\n{ formState?: FormState; res: T } | void>\n\nexport type ValidateForm = () => Promise<boolean>\n\nexport type CreateFormData = (\n overrides?: Record<string, unknown>,\n /**\n * If mergeOverrideData true, the data will be merged with the existing data in the form state.\n * @default true\n */\n options?: {\n /**\n * If provided, will use this instead of of derived data from the current form state.\n */\n data?: Data\n mergeOverrideData?: boolean\n },\n) => FormData | Promise<FormData>\n\nexport type GetFields = () => FormState\nexport type GetField = (path: string) => FormField\nexport type GetData = () => Data\nexport type GetSiblingData = (path: string) => Data\nexport type GetDataByPath = <T = unknown>(path: string) => T\nexport type SetModified = (modified: boolean) => void\nexport type SetSubmitted = (submitted: boolean) => void\nexport type SetProcessing = (processing: boolean) => void\n\nexport type Reset = (data: unknown) => Promise<void>\n\nexport type REPLACE_STATE = {\n optimize?: boolean\n /**\n * If `sanitize` is true, default values will be set for form field properties that are not present in the incoming state.\n * For example, `valid` will be set to true if it is not present in the incoming state.\n */\n sanitize?: boolean\n state: FormState\n type: 'REPLACE_STATE'\n}\n\nexport type REMOVE = {\n path: string\n type: 'REMOVE'\n}\n\nexport type MODIFY_CONDITION = {\n path: string\n result: boolean\n type: 'MODIFY_CONDITION'\n user: TypedUser\n}\n\nexport type UPDATE = {\n path: string\n type: 'UPDATE'\n} & Partial<FormField>\n\nexport type UPDATE_MANY = {\n formState: FormState\n type: 'UPDATE_MANY'\n}\n\nexport type REMOVE_ROW = {\n path: string\n rowIndex: number\n type: 'REMOVE_ROW'\n}\n\nexport type ADD_ROW = {\n blockType?: string\n path: string\n rowIndex?: number\n subFieldState?: FormState\n type: 'ADD_ROW'\n}\n\nexport type MERGE_SERVER_STATE = {\n acceptValues?: AcceptValues\n prevStateRef: React.RefObject<FormState>\n serverState: FormState\n type: 'MERGE_SERVER_STATE'\n}\n\nexport type REPLACE_ROW = {\n blockType?: string\n path: string\n rowIndex: number\n subFieldState?: FormState\n type: 'REPLACE_ROW'\n}\n\nexport type DUPLICATE_ROW = {\n path: string\n rowIndex: number\n type: 'DUPLICATE_ROW'\n}\n\nexport type MOVE_ROW = {\n moveFromIndex: number\n moveToIndex: number\n path: string\n type: 'MOVE_ROW'\n}\n\nexport type ADD_SERVER_ERRORS = {\n errors: ValidationFieldError[]\n type: 'ADD_SERVER_ERRORS'\n}\n\nexport type SET_ROW_COLLAPSED = {\n path: string\n type: 'SET_ROW_COLLAPSED'\n updatedRows: Row[]\n}\n\nexport type SET_ALL_ROWS_COLLAPSED = {\n path: string\n type: 'SET_ALL_ROWS_COLLAPSED'\n updatedRows: Row[]\n}\n\nexport type FieldAction =\n | ADD_ROW\n | ADD_SERVER_ERRORS\n | DUPLICATE_ROW\n | MERGE_SERVER_STATE\n | MODIFY_CONDITION\n | MOVE_ROW\n | REMOVE\n | REMOVE_ROW\n | REPLACE_ROW\n | REPLACE_STATE\n | SET_ALL_ROWS_COLLAPSED\n | SET_ROW_COLLAPSED\n | UPDATE\n | UPDATE_MANY\n\nexport type FormFieldsContext = [FormState, Dispatch<FieldAction>]\n\nexport type Context = {\n addFieldRow: ({\n blockType,\n path,\n rowIndex,\n schemaPath,\n subFieldState,\n }: {\n blockType?: string\n path: string\n rowIndex?: number\n schemaPath: string\n subFieldState?: FormState\n }) => void\n buildRowErrors: () => void\n createFormData: CreateFormData\n disabled: boolean\n dispatchFields: Dispatch<FieldAction>\n /**\n * Form context fields may be outdated and should not be relied on. Instead, prefer `useFormFields`.\n */\n fields: FormState\n formRef: React.RefObject<HTMLFormElement>\n getData: GetData\n getDataByPath: GetDataByPath\n getField: GetField\n getFields: GetFields\n getSiblingData: GetSiblingData\n initializing: boolean\n /**\n * Tracks wether the form state passes validation.\n * For example the state could be submitted but invalid as field errors have been returned.\n */\n isValid: boolean\n moveFieldRow: ({\n moveFromIndex,\n moveToIndex,\n path,\n }: {\n moveFromIndex: number\n moveToIndex: number\n path: string\n }) => void\n removeFieldRow: ({ path, rowIndex }: { path: string; rowIndex: number }) => void\n replaceFieldRow: ({\n blockType,\n path,\n rowIndex,\n schemaPath,\n subFieldState,\n }: {\n blockType?: string\n path: string\n rowIndex: number\n schemaPath: string\n subFieldState?: FormState\n }) => void\n replaceState: (state: FormState) => void\n reset: Reset\n /**\n * If the form has started processing in the background (e.g.\n * if autosave is running), this will be true.\n */\n setBackgroundProcessing: SetProcessing\n setDisabled: (disabled: boolean) => void\n setIsValid: (processing: boolean) => void\n setModified: SetModified\n setProcessing: SetProcessing\n setSubmitted: SetSubmitted\n submit: Submit\n uuid?: string\n validateForm: ValidateForm\n}\n"],"mappings":"AAwQA","ignoreList":[]}
@@ -28,7 +28,7 @@ import { UIField } from '../../fields/UI/index.js';
28
28
  import { UploadField } from '../../fields/Upload/index.js';
29
29
  import { useFormFields } from '../../forms/Form/index.js';
30
30
  export function RenderField(t0) {
31
- const $ = _c(13);
31
+ const $ = _c(23);
32
32
  const {
33
33
  clientFieldConfig,
34
34
  forceRender,
@@ -52,228 +52,240 @@ export function RenderField(t0) {
52
52
  t1 = $[1];
53
53
  }
54
54
  const CustomField = useFormFields(t1);
55
- let t2;
56
- if ($[2] !== CustomField || $[3] !== clientFieldConfig || $[4] !== forceRender || $[5] !== indexPath || $[6] !== parentPath || $[7] !== parentSchemaPath || $[8] !== path || $[9] !== permissions || $[10] !== readOnly || $[11] !== schemaPath) {
57
- t2 = Symbol.for("react.early_return_sentinel");
55
+ const t2 = CustomField !== undefined;
56
+ let t3;
57
+ if ($[2] !== CustomField || $[3] !== clientFieldConfig || $[4] !== forceRender || $[5] !== indexPath || $[6] !== parentPath || $[7] !== parentSchemaPath || $[8] !== path || $[9] !== permissions || $[10] !== readOnly || $[11] !== schemaPath || $[12] !== t2) {
58
+ t3 = Symbol.for("react.early_return_sentinel");
58
59
  bb0: {
59
- const baseFieldProps = {
60
- forceRender,
61
- permissions,
62
- readOnly,
63
- schemaPath
64
- };
65
- if (clientFieldConfig.admin?.hidden) {
66
- t2 = _jsx(HiddenField, {
67
- ...baseFieldProps,
68
- path
69
- });
70
- break bb0;
71
- }
72
- if (CustomField !== undefined) {
73
- t2 = CustomField || null;
60
+ if (t2) {
61
+ t3 = CustomField || null;
74
62
  break bb0;
75
63
  }
76
- const iterableFieldProps = {
77
- ...baseFieldProps,
78
- indexPath,
79
- parentPath,
80
- parentSchemaPath
81
- };
82
- switch (clientFieldConfig.type) {
83
- case "array":
84
- {
85
- t2 = _jsx(ArrayField, {
86
- ...iterableFieldProps,
87
- field: clientFieldConfig,
88
- path
89
- });
90
- break bb0;
91
- }
92
- case "blocks":
93
- {
94
- t2 = _jsx(BlocksField, {
95
- ...iterableFieldProps,
96
- field: clientFieldConfig,
97
- path
98
- });
99
- break bb0;
100
- }
101
- case "checkbox":
102
- {
103
- t2 = _jsx(CheckboxField, {
104
- ...baseFieldProps,
105
- field: clientFieldConfig,
106
- path
107
- });
108
- break bb0;
109
- }
110
- case "code":
111
- {
112
- t2 = _jsx(CodeField, {
113
- ...baseFieldProps,
114
- field: clientFieldConfig,
115
- path
116
- });
117
- break bb0;
118
- }
119
- case "collapsible":
120
- {
121
- t2 = _jsx(CollapsibleField, {
122
- ...iterableFieldProps,
123
- field: clientFieldConfig,
124
- path
125
- });
126
- break bb0;
127
- }
128
- case "date":
129
- {
130
- t2 = _jsx(DateTimeField, {
131
- ...baseFieldProps,
132
- field: clientFieldConfig,
133
- path
134
- });
135
- break bb0;
136
- }
137
- case "email":
138
- {
139
- t2 = _jsx(EmailField, {
140
- ...baseFieldProps,
141
- field: clientFieldConfig,
142
- path
143
- });
144
- break bb0;
145
- }
146
- case "group":
147
- {
148
- t2 = _jsx(GroupField, {
149
- ...iterableFieldProps,
150
- field: clientFieldConfig,
151
- path
152
- });
153
- break bb0;
154
- }
155
- case "join":
156
- {
157
- t2 = _jsx(JoinField, {
158
- ...baseFieldProps,
159
- field: clientFieldConfig,
160
- path
161
- });
162
- break bb0;
163
- }
164
- case "json":
165
- {
166
- t2 = _jsx(JSONField, {
167
- ...baseFieldProps,
168
- field: clientFieldConfig,
169
- path
170
- });
171
- break bb0;
172
- }
173
- case "number":
174
- {
175
- t2 = _jsx(NumberField, {
176
- ...baseFieldProps,
177
- field: clientFieldConfig,
178
- path
179
- });
180
- break bb0;
181
- }
182
- case "point":
183
- {
184
- t2 = _jsx(PointField, {
185
- ...baseFieldProps,
186
- field: clientFieldConfig,
187
- path
188
- });
189
- break bb0;
190
- }
191
- case "radio":
192
- {
193
- t2 = _jsx(RadioGroupField, {
194
- ...baseFieldProps,
195
- field: clientFieldConfig,
196
- path
197
- });
198
- break bb0;
199
- }
200
- case "relationship":
201
- {
202
- t2 = _jsx(RelationshipField, {
203
- ...baseFieldProps,
204
- field: clientFieldConfig,
205
- path
206
- });
207
- break bb0;
208
- }
209
- case "richText":
210
- {
211
- t2 = _jsx(RichTextField, {
212
- ...baseFieldProps,
213
- field: clientFieldConfig,
214
- path
215
- });
216
- break bb0;
217
- }
218
- case "row":
219
- {
220
- t2 = _jsx(RowField, {
221
- ...iterableFieldProps,
222
- field: clientFieldConfig
223
- });
224
- break bb0;
225
- }
226
- case "select":
227
- {
228
- t2 = _jsx(SelectField, {
229
- ...baseFieldProps,
230
- field: clientFieldConfig,
231
- path
232
- });
233
- break bb0;
234
- }
235
- case "tabs":
236
- {
237
- t2 = _jsx(TabsField, {
238
- ...iterableFieldProps,
239
- field: clientFieldConfig,
240
- path
241
- });
242
- break bb0;
243
- }
244
- case "text":
245
- {
246
- t2 = _jsx(TextField, {
247
- ...baseFieldProps,
248
- field: clientFieldConfig,
249
- path
250
- });
251
- break bb0;
252
- }
253
- case "textarea":
254
- {
255
- t2 = _jsx(TextareaField, {
256
- ...baseFieldProps,
257
- field: clientFieldConfig,
258
- path
259
- });
260
- break bb0;
261
- }
262
- case "ui":
263
- {
264
- t2 = _jsx(UIField, {});
265
- break bb0;
266
- }
267
- case "upload":
268
- {
269
- t2 = _jsx(UploadField, {
270
- ...baseFieldProps,
271
- field: clientFieldConfig,
272
- path
273
- });
274
- break bb0;
275
- }
276
- }
64
+ if ($[14] !== clientFieldConfig || $[15] !== forceRender || $[16] !== indexPath || $[17] !== parentPath || $[18] !== parentSchemaPath || $[19] !== path || $[20] !== permissions || $[21] !== readOnly || $[22] !== schemaPath) {
65
+ const baseFieldProps = {
66
+ forceRender,
67
+ permissions,
68
+ readOnly,
69
+ schemaPath
70
+ };
71
+ const iterableFieldProps = {
72
+ ...baseFieldProps,
73
+ indexPath,
74
+ parentPath,
75
+ parentSchemaPath
76
+ };
77
+ if (clientFieldConfig.admin?.hidden) {
78
+ t3 = _jsx(HiddenField, {
79
+ ...baseFieldProps,
80
+ path
81
+ });
82
+ break bb0;
83
+ }
84
+ switch (clientFieldConfig.type) {
85
+ case "array":
86
+ {
87
+ t3 = _jsx(ArrayField, {
88
+ ...iterableFieldProps,
89
+ field: clientFieldConfig,
90
+ path
91
+ });
92
+ break bb0;
93
+ }
94
+ case "blocks":
95
+ {
96
+ t3 = _jsx(BlocksField, {
97
+ ...iterableFieldProps,
98
+ field: clientFieldConfig,
99
+ path
100
+ });
101
+ break bb0;
102
+ }
103
+ case "checkbox":
104
+ {
105
+ t3 = _jsx(CheckboxField, {
106
+ ...baseFieldProps,
107
+ field: clientFieldConfig,
108
+ path
109
+ });
110
+ break bb0;
111
+ }
112
+ case "code":
113
+ {
114
+ t3 = _jsx(CodeField, {
115
+ ...baseFieldProps,
116
+ field: clientFieldConfig,
117
+ path
118
+ });
119
+ break bb0;
120
+ }
121
+ case "collapsible":
122
+ {
123
+ t3 = _jsx(CollapsibleField, {
124
+ ...iterableFieldProps,
125
+ field: clientFieldConfig,
126
+ path
127
+ });
128
+ break bb0;
129
+ }
130
+ case "date":
131
+ {
132
+ t3 = _jsx(DateTimeField, {
133
+ ...baseFieldProps,
134
+ field: clientFieldConfig,
135
+ path
136
+ });
137
+ break bb0;
138
+ }
139
+ case "email":
140
+ {
141
+ t3 = _jsx(EmailField, {
142
+ ...baseFieldProps,
143
+ field: clientFieldConfig,
144
+ path
145
+ });
146
+ break bb0;
147
+ }
148
+ case "group":
149
+ {
150
+ t3 = _jsx(GroupField, {
151
+ ...iterableFieldProps,
152
+ field: clientFieldConfig,
153
+ path
154
+ });
155
+ break bb0;
156
+ }
157
+ case "join":
158
+ {
159
+ t3 = _jsx(JoinField, {
160
+ ...baseFieldProps,
161
+ field: clientFieldConfig,
162
+ path
163
+ });
164
+ break bb0;
165
+ }
166
+ case "json":
167
+ {
168
+ t3 = _jsx(JSONField, {
169
+ ...baseFieldProps,
170
+ field: clientFieldConfig,
171
+ path
172
+ });
173
+ break bb0;
174
+ }
175
+ case "number":
176
+ {
177
+ t3 = _jsx(NumberField, {
178
+ ...baseFieldProps,
179
+ field: clientFieldConfig,
180
+ path
181
+ });
182
+ break bb0;
183
+ }
184
+ case "point":
185
+ {
186
+ t3 = _jsx(PointField, {
187
+ ...baseFieldProps,
188
+ field: clientFieldConfig,
189
+ path
190
+ });
191
+ break bb0;
192
+ }
193
+ case "radio":
194
+ {
195
+ t3 = _jsx(RadioGroupField, {
196
+ ...baseFieldProps,
197
+ field: clientFieldConfig,
198
+ path
199
+ });
200
+ break bb0;
201
+ }
202
+ case "relationship":
203
+ {
204
+ t3 = _jsx(RelationshipField, {
205
+ ...baseFieldProps,
206
+ field: clientFieldConfig,
207
+ path
208
+ });
209
+ break bb0;
210
+ }
211
+ case "richText":
212
+ {
213
+ t3 = _jsx(RichTextField, {
214
+ ...baseFieldProps,
215
+ field: clientFieldConfig,
216
+ path
217
+ });
218
+ break bb0;
219
+ }
220
+ case "row":
221
+ {
222
+ t3 = _jsx(RowField, {
223
+ ...iterableFieldProps,
224
+ field: clientFieldConfig
225
+ });
226
+ break bb0;
227
+ }
228
+ case "select":
229
+ {
230
+ t3 = _jsx(SelectField, {
231
+ ...baseFieldProps,
232
+ field: clientFieldConfig,
233
+ path
234
+ });
235
+ break bb0;
236
+ }
237
+ case "tabs":
238
+ {
239
+ t3 = _jsx(TabsField, {
240
+ ...iterableFieldProps,
241
+ field: clientFieldConfig,
242
+ path
243
+ });
244
+ break bb0;
245
+ }
246
+ case "text":
247
+ {
248
+ t3 = _jsx(TextField, {
249
+ ...baseFieldProps,
250
+ field: clientFieldConfig,
251
+ path
252
+ });
253
+ break bb0;
254
+ }
255
+ case "textarea":
256
+ {
257
+ t3 = _jsx(TextareaField, {
258
+ ...baseFieldProps,
259
+ field: clientFieldConfig,
260
+ path
261
+ });
262
+ break bb0;
263
+ }
264
+ case "ui":
265
+ {
266
+ t3 = _jsx(UIField, {});
267
+ break bb0;
268
+ }
269
+ case "upload":
270
+ {
271
+ t3 = _jsx(UploadField, {
272
+ ...baseFieldProps,
273
+ field: clientFieldConfig,
274
+ path
275
+ });
276
+ break bb0;
277
+ }
278
+ }
279
+ $[14] = clientFieldConfig;
280
+ $[15] = forceRender;
281
+ $[16] = indexPath;
282
+ $[17] = parentPath;
283
+ $[18] = parentSchemaPath;
284
+ $[19] = path;
285
+ $[20] = permissions;
286
+ $[21] = readOnly;
287
+ $[22] = schemaPath;
288
+ } else {}
277
289
  }
278
290
  $[2] = CustomField;
279
291
  $[3] = clientFieldConfig;
@@ -286,11 +298,12 @@ export function RenderField(t0) {
286
298
  $[10] = readOnly;
287
299
  $[11] = schemaPath;
288
300
  $[12] = t2;
301
+ $[13] = t3;
289
302
  } else {
290
- t2 = $[12];
303
+ t3 = $[13];
291
304
  }
292
- if (t2 !== Symbol.for("react.early_return_sentinel")) {
293
- return t2;
305
+ if (t3 !== Symbol.for("react.early_return_sentinel")) {
306
+ return t3;
294
307
  }
295
308
  }
296
309
  //# sourceMappingURL=RenderField.js.map