@strapi/content-type-builder 5.48.1 → 5.50.0

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 (185) hide show
  1. package/dist/admin/components/AIChat/components/Messages/Message.js +5 -1
  2. package/dist/admin/components/AIChat/components/Messages/Message.js.map +1 -1
  3. package/dist/admin/components/AIChat/components/SimpleMenu.js +3 -2
  4. package/dist/admin/components/AIChat/components/SimpleMenu.js.map +1 -1
  5. package/dist/admin/components/AIChat/hooks/useCodeUpload.js +7 -2
  6. package/dist/admin/components/AIChat/hooks/useCodeUpload.js.map +1 -1
  7. package/dist/admin/components/AIChat/lib/transforms/schemas/toCTB.js +11 -5
  8. package/dist/admin/components/AIChat/lib/transforms/schemas/toCTB.js.map +1 -1
  9. package/dist/admin/components/AllowedTypesSelect.js +5 -1
  10. package/dist/admin/components/AllowedTypesSelect.js.map +1 -1
  11. package/dist/admin/components/AttributeOptions/EmptyAttributes.js +3 -2
  12. package/dist/admin/components/AttributeOptions/EmptyAttributes.js.map +1 -1
  13. package/dist/admin/components/AttributeRow.js +10 -5
  14. package/dist/admin/components/AttributeRow.js.map +1 -1
  15. package/dist/admin/components/AutoReloadOverlayBlocker.js +3 -2
  16. package/dist/admin/components/AutoReloadOverlayBlocker.js.map +1 -1
  17. package/dist/admin/components/ComponentCard/ComponentCard.js +5 -1
  18. package/dist/admin/components/ComponentCard/ComponentCard.js.map +1 -1
  19. package/dist/admin/components/ComponentList.js +5 -1
  20. package/dist/admin/components/ComponentList.js.map +1 -1
  21. package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.js +5 -1
  22. package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.js.map +1 -1
  23. package/dist/admin/components/DataManager/DataManagerProvider.js +12 -6
  24. package/dist/admin/components/DataManager/DataManagerProvider.js.map +1 -1
  25. package/dist/admin/components/DataManager/reducer.js +7 -2
  26. package/dist/admin/components/DataManager/reducer.js.map +1 -1
  27. package/dist/admin/components/DataManager/utils/cleanData.js +10 -4
  28. package/dist/admin/components/DataManager/utils/cleanData.js.map +1 -1
  29. package/dist/admin/components/DataManager/utils/retrieveComponentsThatHaveComponents.js +5 -1
  30. package/dist/admin/components/DataManager/utils/retrieveComponentsThatHaveComponents.js.map +1 -1
  31. package/dist/admin/components/DataManager/utils/retrieveSpecificInfoFromComponents.js +5 -1
  32. package/dist/admin/components/DataManager/utils/retrieveSpecificInfoFromComponents.js.map +1 -1
  33. package/dist/admin/components/FormModal/FormModal.js +30 -22
  34. package/dist/admin/components/FormModal/FormModal.js.map +1 -1
  35. package/dist/admin/components/FormModal/attributes/ConditionForm.js +3 -2
  36. package/dist/admin/components/FormModal/attributes/ConditionForm.js.map +1 -1
  37. package/dist/admin/components/FormModal/attributes/types.js +7 -3
  38. package/dist/admin/components/FormModal/attributes/types.js.map +1 -1
  39. package/dist/admin/components/FormModal/attributes/validation/common.js +8 -4
  40. package/dist/admin/components/FormModal/attributes/validation/common.js.map +1 -1
  41. package/dist/admin/components/FormModal/component/createComponentSchema.js +4 -3
  42. package/dist/admin/components/FormModal/component/createComponentSchema.js.map +1 -1
  43. package/dist/admin/components/FormModal/component/createComponentSchema.mjs +1 -1
  44. package/dist/admin/components/FormModal/component/createComponentSchema.mjs.map +1 -1
  45. package/dist/admin/components/FormModal/contentType/createContentTypeSchema.js +3 -2
  46. package/dist/admin/components/FormModal/contentType/createContentTypeSchema.js.map +1 -1
  47. package/dist/admin/components/FormModal/forms/utils/createCollectionName.js +5 -1
  48. package/dist/admin/components/FormModal/forms/utils/createCollectionName.js.map +1 -1
  49. package/dist/admin/components/FormModal/reducer.js +32 -26
  50. package/dist/admin/components/FormModal/reducer.js.map +1 -1
  51. package/dist/admin/components/FormModalHeader.js +6 -2
  52. package/dist/admin/components/FormModalHeader.js.map +1 -1
  53. package/dist/admin/components/FormModalNavigation/FormModalNavigationContext.js +3 -2
  54. package/dist/admin/components/FormModalNavigation/FormModalNavigationContext.js.map +1 -1
  55. package/dist/admin/components/FormModalSubHeader.js +6 -2
  56. package/dist/admin/components/FormModalSubHeader.js.map +1 -1
  57. package/dist/admin/components/GenericInputs.js +9 -4
  58. package/dist/admin/components/GenericInputs.js.map +1 -1
  59. package/dist/admin/components/IconPicker/constants.js +4 -3
  60. package/dist/admin/components/IconPicker/constants.js.map +1 -1
  61. package/dist/admin/components/PluralName.js +5 -1
  62. package/dist/admin/components/PluralName.js.map +1 -1
  63. package/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.js +13 -7
  64. package/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.js.map +1 -1
  65. package/dist/admin/components/TabForm.js +7 -3
  66. package/dist/admin/components/TabForm.js.map +1 -1
  67. package/dist/admin/pages/ListView/ListView.js +5 -1
  68. package/dist/admin/pages/ListView/ListView.js.map +1 -1
  69. package/dist/admin/src/components/AIChat/components/AnimatedBox.d.ts +4 -5
  70. package/dist/admin/src/components/AIChat/components/Attachments/AttachmentPreview.d.ts +1 -1
  71. package/dist/admin/src/components/AIChat/components/Dropzone.d.ts +0 -1
  72. package/dist/admin/src/components/AIChat/components/FloatingPanel.d.ts +0 -1
  73. package/dist/admin/src/components/AIChat/components/Input.d.ts +2 -3
  74. package/dist/admin/src/components/AIChat/components/ResizableTextArea.d.ts +0 -1
  75. package/dist/admin/src/components/AIChat/components/SimpleMenu.d.ts +9 -9
  76. package/dist/admin/src/components/AIChat/components/icons/FigmaIcon.d.ts +0 -1
  77. package/dist/admin/src/components/AIChat/components/icons/StopIcon.d.ts +0 -1
  78. package/dist/admin/src/components/AIChat/hooks/useAIFetch.d.ts +5 -5
  79. package/dist/admin/src/components/AttributeOptions/OptionBoxWrapper.d.ts +2 -3
  80. package/dist/admin/src/components/AttributeRow.d.ts +7 -8
  81. package/dist/admin/src/components/CTBSession/sessionContext.d.ts +0 -1
  82. package/dist/admin/src/components/ComponentRow.d.ts +6 -7
  83. package/dist/admin/src/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.d.ts +0 -1
  84. package/dist/admin/src/components/CustomRadioGroup/Styles.d.ts +3 -4
  85. package/dist/admin/src/components/DataManager/DataManagerContext.d.ts +0 -1
  86. package/dist/admin/src/components/DataManager/reducer.d.ts +2 -2
  87. package/dist/admin/src/components/DataManager/utils/cleanData.d.ts +56 -56
  88. package/dist/admin/src/components/FormModal/attributes/form.d.ts +3 -3
  89. package/dist/admin/src/components/FormModal/attributes/validation/common.d.ts +1 -1
  90. package/dist/admin/src/components/FormModal/forms/forms.d.ts +2 -2
  91. package/dist/admin/src/components/FormModalNavigation/FormModalNavigationProvider.d.ts +0 -1
  92. package/dist/admin/src/components/List.d.ts +2 -3
  93. package/dist/admin/src/components/Relation/RelationNaturePicker/Components.d.ts +6 -7
  94. package/dist/admin/src/pages/ListView/LinkToCMSettingsView.d.ts +0 -1
  95. package/dist/admin/src/utils/isAllowedContentTypesForRelations.d.ts +1 -1
  96. package/dist/admin/translations/en.json.js +1 -0
  97. package/dist/admin/translations/en.json.js.map +1 -1
  98. package/dist/admin/translations/en.json.mjs +1 -0
  99. package/dist/admin/translations/en.json.mjs.map +1 -1
  100. package/dist/admin/translations/ja.json.js +109 -50
  101. package/dist/admin/translations/ja.json.js.map +1 -1
  102. package/dist/admin/translations/ja.json.mjs +109 -50
  103. package/dist/admin/translations/ja.json.mjs.map +1 -1
  104. package/dist/admin/utils/formAPI.js +11 -6
  105. package/dist/admin/utils/formAPI.js.map +1 -1
  106. package/dist/admin/utils/getMaxDepth.js.map +1 -1
  107. package/dist/admin/utils/getMaxDepth.mjs.map +1 -1
  108. package/dist/admin/utils/nameToSlug.js +5 -1
  109. package/dist/admin/utils/nameToSlug.js.map +1 -1
  110. package/dist/admin/utils/toRegressedEnumValue.js +5 -1
  111. package/dist/admin/utils/toRegressedEnumValue.js.map +1 -1
  112. package/dist/server/controllers/components.js +6 -2
  113. package/dist/server/controllers/components.js.map +1 -1
  114. package/dist/server/controllers/content-types.js +8 -4
  115. package/dist/server/controllers/content-types.js.map +1 -1
  116. package/dist/server/controllers/validation/common.js +6 -2
  117. package/dist/server/controllers/validation/common.js.map +1 -1
  118. package/dist/server/controllers/validation/common.mjs +1 -1
  119. package/dist/server/controllers/validation/common.mjs.map +1 -1
  120. package/dist/server/controllers/validation/component.js +9 -5
  121. package/dist/server/controllers/validation/component.js.map +1 -1
  122. package/dist/server/controllers/validation/data-transform.js +6 -2
  123. package/dist/server/controllers/validation/data-transform.js.map +1 -1
  124. package/dist/server/controllers/validation/model-schema.js +6 -2
  125. package/dist/server/controllers/validation/model-schema.js.map +1 -1
  126. package/dist/server/controllers/validation/types.js +8 -4
  127. package/dist/server/controllers/validation/types.js.map +1 -1
  128. package/dist/server/routes/content-api.js +3 -2
  129. package/dist/server/routes/content-api.js.map +1 -1
  130. package/dist/server/services/api-handler.js +4 -3
  131. package/dist/server/services/api-handler.js.map +1 -1
  132. package/dist/server/services/api-handler.mjs.map +1 -1
  133. package/dist/server/services/components.js.map +1 -1
  134. package/dist/server/services/components.mjs.map +1 -1
  135. package/dist/server/services/content-types.js +8 -4
  136. package/dist/server/services/content-types.js.map +1 -1
  137. package/dist/server/services/schema-builder/component-builder.js +11 -5
  138. package/dist/server/services/schema-builder/component-builder.js.map +1 -1
  139. package/dist/server/services/schema-builder/content-type-builder.js +13 -8
  140. package/dist/server/services/schema-builder/content-type-builder.js.map +1 -1
  141. package/dist/server/services/schema-builder/index.js +5 -1
  142. package/dist/server/services/schema-builder/index.js.map +1 -1
  143. package/dist/server/services/schema-builder/schema-handler.js +35 -29
  144. package/dist/server/services/schema-builder/schema-handler.js.map +1 -1
  145. package/dist/server/services/schema-builder/schema-handler.mjs.map +1 -1
  146. package/dist/server/services/schema.js +5 -1
  147. package/dist/server/services/schema.js.map +1 -1
  148. package/dist/server/src/bootstrap.d.ts.map +1 -1
  149. package/dist/server/src/controllers/validation/common.d.ts.map +1 -1
  150. package/dist/server/src/controllers/validation/component-category.d.ts +1 -1
  151. package/dist/server/src/controllers/validation/component.d.ts +1 -1
  152. package/dist/server/src/controllers/validation/component.d.ts.map +1 -1
  153. package/dist/server/src/controllers/validation/content-type.d.ts +1 -1
  154. package/dist/server/src/controllers/validation/content-type.d.ts.map +1 -1
  155. package/dist/server/src/controllers/validation/data-transform.d.ts.map +1 -1
  156. package/dist/server/src/controllers/validation/model-schema.d.ts +1 -1
  157. package/dist/server/src/controllers/validation/model-schema.d.ts.map +1 -1
  158. package/dist/server/src/controllers/validation/relations.d.ts.map +1 -1
  159. package/dist/server/src/controllers/validation/schema.d.ts +1 -1
  160. package/dist/server/src/controllers/validation/types.d.ts.map +1 -1
  161. package/dist/server/src/middlewares/is-development-mode.d.ts.map +1 -1
  162. package/dist/server/src/register.d.ts.map +1 -1
  163. package/dist/server/src/services/builder.d.ts.map +1 -1
  164. package/dist/server/src/services/component-categories.d.ts.map +1 -1
  165. package/dist/server/src/services/components.d.ts +3 -26
  166. package/dist/server/src/services/components.d.ts.map +1 -1
  167. package/dist/server/src/services/content-types.d.ts +1 -1
  168. package/dist/server/src/services/content-types.d.ts.map +1 -1
  169. package/dist/server/src/services/schema-builder/component-builder.d.ts +12 -12
  170. package/dist/server/src/services/schema-builder/component-builder.d.ts.map +1 -1
  171. package/dist/server/src/services/schema-builder/content-type-builder.d.ts +14 -14
  172. package/dist/server/src/services/schema-builder/content-type-builder.d.ts.map +1 -1
  173. package/dist/server/src/services/schema-builder/index.d.ts +27 -27
  174. package/dist/server/src/services/schema-builder/index.d.ts.map +1 -1
  175. package/dist/server/src/services/schema-builder/schema-handler.d.ts +13 -12
  176. package/dist/server/src/services/schema-builder/schema-handler.d.ts.map +1 -1
  177. package/dist/server/src/services/schema.d.ts +66 -66
  178. package/dist/server/src/services/schema.d.ts.map +1 -1
  179. package/dist/server/src/utils/attributes.d.ts +2 -2
  180. package/dist/server/src/utils/attributes.d.ts.map +1 -1
  181. package/dist/server/src/utils/helpers.d.ts.map +1 -1
  182. package/dist/server/src/utils/typeguards.d.ts.map +1 -1
  183. package/dist/server/utils/attributes.js +12 -7
  184. package/dist/server/utils/attributes.js.map +1 -1
  185. package/package.json +12 -8
@@ -1,6 +1,8 @@
1
1
  var configurations = "設定";
2
- var from = "from";
2
+ var from = "から";
3
3
  var ja = {
4
+ "attribute.blocks": "リッチテキスト (Blocks)",
5
+ "attribute.blocks.description": "新しいJSON形式のリッチテキストエディタ",
4
6
  "attribute.boolean": "Boolean",
5
7
  "attribute.boolean.description": "はいまたはいいえ、1または0、真または偽",
6
8
  "attribute.component": "Component",
@@ -28,8 +30,6 @@ var ja = {
28
30
  "attribute.relation.description": "Collection Typeを参照",
29
31
  "attribute.richtext": "リッチテキスト (Markdown)",
30
32
  "attribute.richtext.description": "クラシックなリッチテキストエディタ",
31
- "attribute.blocks": "リッチテキスト (Blocks)",
32
- "attribute.blocks.description": "新しいJSON形式のリッチテキストエディタ",
33
33
  "attribute.text": "Text",
34
34
  "attribute.text.description": "タイトルや説明などの短いまたは長いテキスト",
35
35
  "attribute.time": "時間",
@@ -41,12 +41,57 @@ var ja = {
41
41
  "button.component.create": "新しいコンポーネントを作成",
42
42
  "button.model.create": "新しいCollection Typeを作成",
43
43
  "button.single-types.create": "新しいSingle Typeを作成",
44
+ "chat.attachments.menu.attach-image": "画像を添付",
45
+ "chat.attachments.menu.import-code": "コードをインポート",
46
+ "chat.attachments.menu.import-figma": "Figmaからインポート",
47
+ "chat.code-upload.description": "アプリはAIによって分析されます。インポート前に機密データをすべて削除してください。",
48
+ "chat.code-upload.drop-zone": ".zipファイルをここにドロップするか、",
49
+ "chat.code-upload.drop-zone-browse": "ファイルを参照",
50
+ "chat.code-upload.drop-zone-folder": "フォルダをここにドロップ、または",
51
+ "chat.code-upload.header": "Next.jsアプリをインポート",
52
+ "chat.code-upload.title": "Next.jsアプリをインポート",
53
+ "chat.feedback.comment.label": "改善点は?(オプション)",
54
+ "chat.feedback.error": "フィードバックの送信中にエラーが発生しました",
55
+ "chat.feedback.placeholder": "フィードバック...",
56
+ "chat.feedback.reason.bad_recommendation": "不適切な推奨",
57
+ "chat.feedback.reason.being_lazy": "手抜き",
58
+ "chat.feedback.reason.instructions_ignored": "指示が無視された",
59
+ "chat.feedback.reason.invalid_schema": "無効なスキーマ",
60
+ "chat.feedback.reason.other": "その他",
61
+ "chat.feedback.reason.slow": "遅い",
62
+ "chat.feedback.submitted": "フィードバックありがとうございます!",
63
+ "chat.feedback.subtitle": "このメッセージについて追加のフィードバックをお送りください。該当するものをすべて選択してください。",
64
+ "chat.feedback.title": "フィードバックを送信",
65
+ "chat.figma-upload.import-button": "インポート",
66
+ "chat.figma-upload.no-images": "Figmaファイルにフレームが見つかりません。",
67
+ "chat.figma-upload.select-images": "インポートするフレームを選択",
68
+ "chat.figma-upload.step1-title": "FigmaのURLを入力",
69
+ "chat.figma-upload.step2-title": "画像プレビュー",
70
+ "chat.header.default-title": "新しい会話",
71
+ "chat.input.defaults.ctb": "Content-Type Builderについて教えてください",
72
+ "chat.input.defaults.generate": "製品スキーマを生成",
73
+ "chat.input.defaults.strapi": "Strapiについて教えてください",
74
+ "chat.input.defaults.title": "どのようにお手伝いできますか?",
75
+ "chat.input.placeholder": "Strapi AIに質問...",
76
+ "chat.input.strapi-ai-can-make-errors": "Strapi AIは間違えることがあります。",
77
+ "chat.input.thinking": "Strapi AIが考えています...",
78
+ "chat.messages.error": "問題が発生しました。",
79
+ "chat.messages.license-limit-exceeded": "AIクレジットの上限を超えました。",
80
+ "chat.messages.license-limit-reached": "ライセンス上限に達しました。明日もう一度お試しください。",
81
+ "chat.messages.too-long-error": "この会話は最大長に達しました。新しい会話を開始してください",
82
+ "chat.messages.too-many-requests": "リクエストが多すぎます。しばらくしてからもう一度お試しください。",
83
+ "chat.tooltips.close-chat": "チャットを閉じる",
84
+ "chat.tooltips.create-chat": "新しい会話",
85
+ "chat.tooltips.open-chat": "チャットを開く",
86
+ "chat.tooltips.send-message": "送信",
87
+ "chat.tooltips.stop-generation": "停止",
88
+ "chat.tooltips.upload-attachments": "添付ファイルをアップロード",
44
89
  "component.repeatable": "(繰り返し可能)",
45
- "components.SelectComponents.displayed-value": "{number, plural, =0 {# コンポーネント} other {# コンポーネント}} 選択済み",
46
90
  "components.componentSelect.no-component-available": "すべてのコンポーネントを追加済みです",
47
91
  "components.componentSelect.no-component-available.with-search": "検索に一致するコンポーネントがありません",
48
92
  "components.componentSelect.value-component": "{number}コンポーネントが選択されました(コンポーネントを検索するには入力してください)",
49
93
  "components.componentSelect.value-components": "{number}コンポーネントが選択されました",
94
+ "components.SelectComponents.displayed-value": "{number, plural, =0 {# コンポーネント} other {# コンポーネント}} 選択済み",
50
95
  configurations: configurations,
51
96
  "contentType.apiId-plural.description": "複数形のAPI ID",
52
97
  "contentType.apiId-plural.label": "API ID(複数形)",
@@ -57,11 +102,11 @@ var ja = {
57
102
  "contentType.displayName.label": "表示名",
58
103
  "contentType.kind.change.warning": "コンテンツタイプの種類を変更しました:APIがリセットされます(ルート、コントローラー、サービスが上書きされます)。",
59
104
  "error.attributeName.reserved-name": "この名前は他の機能を壊す可能性があるため、コンテンツタイプで使用できません",
105
+ "error.contentType.pluralName-equals-collectionName": "この値は既に他のコンテンツタイプで使用されています。",
106
+ "error.contentType.pluralName-equals-singularName": "この値は他のコンテンツタイプの単数形API IDと同じにすることはできません。",
60
107
  "error.contentType.pluralName-used": "この値は単数形と同じにすることはできません",
61
- "error.contentType.singularName-used": "この値は複数形と同じにすることはできません",
62
108
  "error.contentType.singularName-equals-pluralName": "この値は他のコンテンツタイプの複数形API IDと同じにすることはできません。",
63
- "error.contentType.pluralName-equals-singularName": "この値は他のコンテンツタイプの単数形API IDと同じにすることはできません。",
64
- "error.contentType.pluralName-equals-collectionName": "この値は既に他のコンテンツタイプで使用されています。",
109
+ "error.contentType.singularName-used": "この値は複数形と同じにすることはできません",
65
110
  "error.contentTypeName.reserved-name": "この名前は他の機能を壊す可能性があるため、プロジェクトで使用できません",
66
111
  "error.validation.enum-duplicate": "重複値は許可されていません(英数字のみが考慮されます)。",
67
112
  "error.validation.enum-empty-string": "空の文字列は許可されていません",
@@ -79,6 +124,27 @@ var ja = {
79
124
  "form.attribute.component.option.reuse-existing.description": "コンテンツタイプ間でデータの一貫性を保つために、既に作成されたコンポーネントを再利用します。",
80
125
  "form.attribute.component.option.single": "単一コンポーネント",
81
126
  "form.attribute.component.option.single.description": "住所全体、主要情報などのフィールドのグループ化に最適です。",
127
+ "form.attribute.condition.action": "アクション",
128
+ "form.attribute.condition.action.hide": "非表示",
129
+ "form.attribute.condition.action.show": "表示",
130
+ "form.attribute.condition.apply": "条件を適用",
131
+ "form.attribute.condition.description": "別のブールまたは列挙型フィールドの値に応じてフィールド設定を切り替えます。",
132
+ "form.attribute.condition.enum-change-warning": "次のフィールドがこのフィールドに依存する条件を持っています: {fieldNames}。列挙値 {values} を変更または削除すると、これらの条件が壊れます。続行しますか?",
133
+ "form.attribute.condition.enum-change-warning-end": " を変更または削除すると、これらの条件が壊れます。続行しますか?",
134
+ "form.attribute.condition.enum-change-warning-values": "。列挙値 ",
135
+ "form.attribute.condition.field": "フィールド",
136
+ "form.attribute.condition.field-change-warning": "次のフィールドがこのフィールドに依存する条件を持っています: {fieldNames}。名前を変更すると、これらの条件が壊れます。続行しますか?",
137
+ "form.attribute.condition.field-change-warning-end": "。名前を変更すると、これらの条件が壊れます。続行しますか?",
138
+ "form.attribute.condition.label": "条件",
139
+ "form.attribute.condition.no-fields": "条件を設定できるブールまたは列挙型フィールドがありません。",
140
+ "form.attribute.condition.operator": "演算子",
141
+ "form.attribute.condition.operator.is": "である",
142
+ "form.attribute.condition.operator.isNot": "でない",
143
+ "form.attribute.condition.then": "ならば",
144
+ "form.attribute.condition.title": "条件",
145
+ "form.attribute.condition.value": "値",
146
+ "form.attribute.condition.value.false": "false",
147
+ "form.attribute.condition.value.true": "true",
82
148
  "form.attribute.item.customColumnName": "カスタム列名",
83
149
  "form.attribute.item.customColumnName.description": "これは、データベースのカラム名をAPIのレスポンスのより包括的なフォーマットに変更する場合に便利です",
84
150
  "form.attribute.item.date.type.date": "日付 (例: 01/01/{currentYear})",
@@ -90,8 +156,10 @@ var ja = {
90
156
  "form.attribute.item.enumeration.placeholder": "例:\n朝\n昼\n夕方",
91
157
  "form.attribute.item.enumeration.rules": "値(1行につき1つの値)",
92
158
  "form.attribute.item.maximum": "最大値",
159
+ "form.attribute.item.maximumComponents": "コンポーネント最大数",
93
160
  "form.attribute.item.maximumLength": "最大長",
94
161
  "form.attribute.item.minimum": "最小値",
162
+ "form.attribute.item.minimumComponents": "コンポーネント最小数",
95
163
  "form.attribute.item.minimumLength": "最小長",
96
164
  "form.attribute.item.number.type": "数値形式",
97
165
  "form.attribute.item.number.type.biginteger": "大整数 (例: 123456789)",
@@ -106,8 +174,8 @@ var ja = {
106
174
  "form.attribute.item.text.regex.description": "正規表現のテキスト",
107
175
  "form.attribute.item.uniqueField": "一意のフィールド",
108
176
  "form.attribute.item.uniqueField.description": "同じ内容の既存のエントリがある場合、エントリを作成することはできません",
109
- "form.attribute.item.uniqueField.v5.willBeDisabled'": "現在、一意のフィールドはコンポーネントで正しく機能しません。この機能を無効にすると、問題が修正されるまでフィールドは無効になります。",
110
177
  "form.attribute.item.uniqueField.v5.disabled": "現在、一意のフィールドはコンポーネントで正しく機能しません。この問題が修正されるまで、このフィールドは無効になっています。",
178
+ "form.attribute.item.uniqueField.v5.willBeDisabled'": "現在、一意のフィールドはコンポーネントで正しく機能しません。この機能を無効にすると、問題が修正されるまでフィールドは無効になります。",
111
179
  "form.attribute.media.allowed-types": "許可するメディアタイプを選択",
112
180
  "form.attribute.media.allowed-types.option-files": "ファイル",
113
181
  "form.attribute.media.allowed-types.option-images": "画像",
@@ -128,18 +196,29 @@ var ja = {
128
196
  "form.button.add.field.to.component": "このコンポーネントに別のフィールドを追加",
129
197
  "form.button.add.field.to.contentType": "このコンテンツタイプに別のフィールドを追加",
130
198
  "form.button.add.field.to.singleType": "このSingle Typeに別のフィールドを追加",
199
+ "form.button.back": "戻る",
131
200
  "form.button.cancel": "キャンセル",
132
201
  "form.button.collection-type.description": "記事、製品、コメントなどの複数のインスタンスに最適",
133
- "form.button.collection-type.name": "Collection Type",
202
+ "form.button.collection-type.name": "コレクションタイプ",
134
203
  "form.button.configure-component": "コンポーネントを設定",
135
204
  "form.button.configure-view": "ビューを設定",
205
+ "form.button.finish": "完了",
136
206
  "form.button.select-component": "コンポーネントを選択",
137
207
  "form.button.single-type.description": "会社概要、ホームページなどの単一インスタンスに最適",
138
- "form.button.single-type.name": "Single Type",
208
+ "form.button.single-type.name": "シングルタイプ",
209
+ "form.button.submit": "送信",
139
210
  from: from,
211
+ "IconPicker.emptyState.label": "アイコンが見つかりません",
212
+ "IconPicker.icon.label": "{icon}アイコンを選択",
213
+ "IconPicker.remove.button": "選択したアイコンを削除するボタン",
214
+ "IconPicker.remove.tooltip": "選択したアイコンを削除",
215
+ "IconPicker.search.button.label": "アイコン検索ボタン",
216
+ "IconPicker.search.clear.label": "アイコン検索をクリア",
217
+ "IconPicker.search.placeholder.label": "アイコンを検索",
218
+ "media.multiple": "複数",
140
219
  "menu.section.components.name": "コンポーネント",
141
- "menu.section.models.name": "Collection Types",
142
- "menu.section.single-types.name": "Single Types",
220
+ "menu.section.models.name": "コレクションタイプ",
221
+ "menu.section.single-types.name": "シングルタイプ",
143
222
  "modalForm.attribute.form.base.name.description": "属性名にスペースは使用できません",
144
223
  "modalForm.attribute.form.base.name.placeholder": "例:slug、seoUrl、canonicalUrl",
145
224
  "modalForm.attribute.target-field": "添付フィールド",
@@ -149,13 +228,14 @@ var ja = {
149
228
  "modalForm.component.header-create": "コンポーネントを作成",
150
229
  "modalForm.components.create-component.category.label": "カテゴリを選択するか、新しいカテゴリを作成する名前を入力してください",
151
230
  "modalForm.components.icon.label": "アイコン",
231
+ "modalForm.custom-fields.advanced.settings.extended": "拡張設定",
232
+ "modalForm.editCategory.base.name.description": "カテゴリ名にスペースは使用できません",
152
233
  "modalForm.empty.button": "カスタムフィールドを追加",
153
234
  "modalForm.empty.heading": "まだ何もありません。",
154
235
  "modalForm.empty.sub-heading": "幅広い拡張機能を通じて、探しているものを見つけてください。",
155
- "modalForm.editCategory.base.name.description": "カテゴリ名にスペースは使用できません",
156
236
  "modalForm.header-edit": "{name}を編集",
157
- "modalForm.header.categories": "カテゴリ",
158
237
  "modalForm.header.back": "戻る",
238
+ "modalForm.header.categories": "カテゴリ",
159
239
  "modalForm.singleType.header-create": "Single Typeを作成",
160
240
  "modalForm.sub-header.addComponentToDynamicZone": "ダイナミックゾーンに新しいコンポーネントを追加",
161
241
  "modalForm.sub-header.attribute.create": "新しい{type}フィールドを追加",
@@ -164,19 +244,19 @@ var ja = {
164
244
  "modalForm.sub-header.chooseAttribute.collectionType": "Collection Type用のフィールドを選択",
165
245
  "modalForm.sub-header.chooseAttribute.component": "コンポーネント用のフィールドを選択",
166
246
  "modalForm.sub-header.chooseAttribute.singleType": "Single Type用のフィールドを選択",
167
- "modalForm.custom-fields.advanced.settings.extended": "拡張設定",
168
247
  "modalForm.tabs.custom": "カスタム",
169
248
  "modalForm.tabs.custom.howToLink": "カスタムフィールドを追加する方法",
170
249
  "modalForm.tabs.default": "デフォルト",
171
250
  "modalForm.tabs.label": "デフォルトとカスタムタイプのタブ",
172
251
  "modelPage.attribute.relation-polymorphic": "関係(ポリモーフィック)",
173
252
  "modelPage.attribute.relationWith": "関係",
253
+ "modelPage.attribute.with": "対象:",
174
254
  "notification.error.dynamiczone-min.validation": "コンテンツタイプを保存するには、ダイナミックゾーンに少なくとも1つのコンポーネントが必要です",
175
255
  "notification.info.autoreaload-disable": "Strapiは本番モードで、コンテンツタイプの編集は無効です。strapi developでサーバーを起動して開発モードに切り替えてください。",
176
256
  "notification.info.creating.notSaved": "新しいCollection Typeまたはコンポーネントを作成する前に、作業を保存してください",
177
257
  "plugin.description.long": "APIのデータ構造をモデル化します。数分で新しいフィールドと関係を作成します。ファイルはプロジェクトで自動的に作成され、更新されます。",
178
258
  "plugin.description.short": "APIのデータ構造をモデル化します。",
179
- "plugin.name": "Content-Type Builder",
259
+ "plugin.name": "コンテンツタイプビルダー",
180
260
  "popUpForm.navContainer.advanced": "高度な設定",
181
261
  "popUpForm.navContainer.base": "基本設定",
182
262
  "popUpWarning.bodyMessage.cancel-modifications": "変更をキャンセルしてもよろしいですか?",
@@ -184,49 +264,28 @@ var ja = {
184
264
  "popUpWarning.bodyMessage.category.delete": "このカテゴリを削除してもよろしいですか?すべてのコンポーネントも削除されます。",
185
265
  "popUpWarning.bodyMessage.component.delete": "このコンポーネントを削除してもよろしいですか?",
186
266
  "popUpWarning.bodyMessage.contentType.delete": "このコンテンツタイプを削除してもよろしいですか?",
267
+ "popUpWarning.bodyMessage.delete-attribute-with-conditions": "次のフィールドがこのフィールドに依存する条件を持っています: ",
268
+ "popUpWarning.bodyMessage.delete-attribute-with-conditions-end": "。削除してもよろしいですか?",
269
+ "popUpWarning.bodyMessage.delete-condition": "この条件を削除してもよろしいですか?",
270
+ "popUpWarning.discardAll.message": "すべての変更を破棄してもよろしいですか?",
187
271
  "popUpWarning.draft-publish.button.confirm": "はい、無効にする",
188
272
  "popUpWarning.draft-publish.message": "下書きと公開を無効にすると、下書きは削除されます。",
189
273
  "popUpWarning.draft-publish.second-message": "無効にしてもよろしいですか?",
190
274
  "prompt.unsaved": "離れてもよろしいですか?すべての変更が失われます。",
191
275
  "relation.attributeName.placeholder": "例:author、category、tag",
192
- "relation.manyToMany": "has and belongs to many",
193
- "relation.manyToOne": "has many",
194
- "relation.manyWay": "has many",
195
- "relation.oneToMany": "belongs to many",
196
- "relation.oneToOne": "has and belongs to one",
197
- "relation.oneWay": "has one",
276
+ "relation.manyToMany": "多対多",
277
+ "relation.manyToOne": "多対一",
278
+ "relation.manyWay": "多方向",
279
+ "relation.oneToMany": "一対多",
280
+ "relation.oneToOne": "一対一",
281
+ "relation.oneWay": "一方向",
198
282
  "table.button.no-fields": "フィールドを追加",
199
- "table.content.create-first-content-type.title": "コンテンツタイプがありません",
200
283
  "table.content.create-first-content-type.description": "スキーマを構築するためにコレクションタイプ、シングルタイプ、コンポーネントを作成します。",
284
+ "table.content.create-first-content-type.import-code": "コンピュータからインポート",
201
285
  "table.content.create-first-content-type.start-with-prompt": "プロンプトから始める",
286
+ "table.content.create-first-content-type.title": "コンテンツタイプがありません",
202
287
  "table.content.no-fields.collection-type": "このコレクションタイプに最初のフィールドを追加する",
203
- "table.content.no-fields.component": "このコンポーネントに最初のフィールドを追加する",
204
- "IconPicker.search.placeholder.label": "アイコンを検索",
205
- "IconPicker.search.clear.label": "アイコン検索をクリア",
206
- "IconPicker.search.button.label": "アイコン検索ボタン",
207
- "IconPicker.remove.tooltip": "選択したアイコンを削除",
208
- "IconPicker.remove.button": "選択したアイコンを削除するボタン",
209
- "IconPicker.emptyState.label": "アイコンが見つかりません",
210
- "IconPicker.icon.label": "{icon}アイコンを選択",
211
- "chat.tooltips.close-chat": "チャットを閉じる",
212
- "chat.tooltips.create-chat": "新しい会話",
213
- "chat.tooltips.open-chat": "チャットを開く",
214
- "chat.tooltips.send-message": "送信",
215
- "chat.tooltips.stop-generation": "停止",
216
- "chat.header.default-title": "新しい会話",
217
- "chat.input.defaults.title": "どのようにお手伝いできますか?",
218
- "chat.input.defaults.generate": "製品スキーマを生成",
219
- "chat.input.defaults.ctb": "Content-Type Builderについて教えてください",
220
- "chat.input.defaults.strapi": "Strapiについて教えてください",
221
- "chat.input.thinking": "Strapi AIが考えています...",
222
- "chat.input.placeholder": "Strapi AIに質問...",
223
- "chat.input.strapi-ai-can-make-errors": "Strapi AIは間違えることがあります。",
224
- "chat.messages.error": "問題が発生しました。",
225
- "chat.code-upload.header": "Next.jsアプリをインポート",
226
- "chat.code-upload.title": "Next.jsアプリをインポート",
227
- "chat.code-upload.description": "アプリはAIによって分析されます。インポート前に機密データをすべて削除してください。",
228
- "chat.code-upload.drop-zone": ".zipファイルをここにドロップするか、",
229
- "chat.code-upload.drop-zone-browse": "ファイルを参照"
288
+ "table.content.no-fields.component": "このコンポーネントに最初のフィールドを追加する"
230
289
  };
231
290
 
232
291
  export { configurations, ja as default, from };
@@ -1 +1 @@
1
- {"version":3,"file":"ja.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ja.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,7 +4,10 @@ var cloneDeep = require('lodash/cloneDeep');
4
4
  var get = require('lodash/get');
5
5
  var yup = require('yup');
6
6
 
7
- function _interopNamespaceDefault(e) {
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
8
11
  var n = Object.create(null);
9
12
  if (e) {
10
13
  Object.keys(e).forEach(function (k) {
@@ -21,7 +24,9 @@ function _interopNamespaceDefault(e) {
21
24
  return Object.freeze(n);
22
25
  }
23
26
 
24
- var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
27
+ var cloneDeep__default = /*#__PURE__*/_interopDefault(cloneDeep);
28
+ var get__default = /*#__PURE__*/_interopDefault(get);
29
+ var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
25
30
 
26
31
  const formsAPI = {
27
32
  components: {
@@ -82,7 +87,7 @@ const formsAPI = {
82
87
  });
83
88
  },
84
89
  getAdvancedForm (target, props = null) {
85
- const sectionsToAdd = get(this.types, [
90
+ const sectionsToAdd = get__default.default(this.types, [
86
91
  ...target,
87
92
  'form',
88
93
  'advanced'
@@ -104,7 +109,7 @@ const formsAPI = {
104
109
  });
105
110
  },
106
111
  makeValidator (target, initShape, ...args) {
107
- const validators = get(this.types, [
112
+ const validators = get__default.default(this.types, [
108
113
  ...target,
109
114
  'validators'
110
115
  ], []);
@@ -120,8 +125,8 @@ const formsAPI = {
120
125
  });
121
126
  },
122
127
  mutateContentTypeSchema (data, initialData) {
123
- let enhancedData = cloneDeep(data);
124
- const refData = cloneDeep(initialData);
128
+ let enhancedData = cloneDeep__default.default(data);
129
+ const refData = cloneDeep__default.default(initialData);
125
130
  this.contentTypeSchemaMutations.forEach((cb)=>{
126
131
  enhancedData = cb(enhancedData, refData);
127
132
  });
@@ -1 +1 @@
1
- {"version":3,"file":"formAPI.js","sources":["../../../admin/src/utils/formAPI.ts"],"sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\nimport get from 'lodash/get';\nimport * as yup from 'yup';\n\nexport interface FormAPI {\n components: {\n inputs: Record<string, any>;\n add: ({ id, component }: { id: string; component: any }) => void;\n };\n types: {\n attribute: {\n [key: string]: {\n validators: any[];\n form: {\n advanced: any[];\n base: any[];\n };\n };\n };\n contentType: {\n validators: any[];\n form: {\n advanced: any[];\n base: any[];\n };\n };\n component: {\n validators: any[];\n form: {\n advanced: any[];\n base: any[];\n };\n };\n };\n contentTypeSchemaMutations: any[];\n addContentTypeSchemaMutation: (cb: any) => void;\n extendContentType: (data: any) => void;\n extendFields: (fields: any[], data: any) => void;\n getAdvancedForm: (target: any, props?: any) => any[];\n makeCustomFieldValidator: (attributeShape: any, validator: any, ...validatorArgs: any) => any;\n makeValidator: (target: any, initShape: any, ...args: any) => any;\n mutateContentTypeSchema: (\n data: Record<string, unknown>,\n initialData: Record<string, unknown>\n ) => any;\n}\n\nexport const formsAPI: FormAPI = {\n components: {\n inputs: {},\n add({ id, component }) {\n if (!this.inputs[id]) {\n this.inputs[id] = component;\n }\n },\n },\n types: {\n attribute: {\n // test: {\n // validators: [],\n // form: {\n // advanced: [\n // /* cb */\n // ],\n // base: [\n // /* cb */\n // ],\n // },\n // },\n },\n contentType: {\n validators: [],\n form: {\n advanced: [],\n base: [],\n },\n },\n component: {\n validators: [],\n form: {\n advanced: [],\n base: [],\n },\n },\n },\n contentTypeSchemaMutations: [],\n addContentTypeSchemaMutation(cb) {\n this.contentTypeSchemaMutations.push(cb);\n },\n extendContentType({ validator, form: { advanced, base } }) {\n const { contentType } = this.types;\n\n if (validator) {\n contentType.validators.push(validator);\n }\n contentType.form.advanced.push(advanced);\n contentType.form.base.push(base);\n },\n extendFields(fields, { validator, form: { advanced, base } }) {\n const formType = this.types.attribute;\n\n fields.forEach((field) => {\n if (!formType[field]) {\n formType[field] = {\n validators: [],\n form: {\n advanced: [\n /* cb */\n ],\n base: [\n /* cb */\n ],\n },\n };\n }\n\n if (validator) {\n formType[field].validators.push(validator);\n }\n formType[field].form.advanced.push(advanced);\n formType[field].form.base.push(base);\n });\n },\n\n getAdvancedForm(target, props = null) {\n const sectionsToAdd = get(this.types, [...target, 'form', 'advanced'], []).reduce(\n (acc: any, current: any) => {\n const sections = current(props);\n\n return [...acc, ...sections];\n },\n []\n );\n\n return sectionsToAdd;\n },\n\n makeCustomFieldValidator(attributeShape, validator, ...validatorArgs) {\n // When no validator, return the attribute shape\n if (!validator) return attributeShape;\n\n // Otherwise extend the shape with the provided validator\n return attributeShape.shape({ options: yup.object().shape(validator(validatorArgs)) });\n },\n\n makeValidator(target, initShape, ...args) {\n const validators = get(this.types, [...target, 'validators'], []);\n\n const pluginOptionsShape = validators.reduce((acc: any, current: any) => {\n const pluginOptionShape = current(args);\n\n return { ...acc, ...pluginOptionShape };\n }, {});\n\n return initShape.shape({ pluginOptions: yup.object().shape(pluginOptionsShape) });\n },\n mutateContentTypeSchema(data: Record<string, unknown>, initialData: Record<string, unknown>) {\n let enhancedData = cloneDeep(data);\n\n const refData = cloneDeep(initialData);\n\n this.contentTypeSchemaMutations.forEach((cb: any) => {\n enhancedData = cb(enhancedData, refData);\n });\n\n return enhancedData;\n },\n};\n"],"names":["formsAPI","components","inputs","add","id","component","types","attribute","contentType","validators","form","advanced","base","contentTypeSchemaMutations","addContentTypeSchemaMutation","cb","push","extendContentType","validator","extendFields","fields","formType","forEach","field","getAdvancedForm","target","props","sectionsToAdd","get","reduce","acc","current","sections","makeCustomFieldValidator","attributeShape","validatorArgs","shape","options","yup","object","makeValidator","initShape","args","pluginOptionsShape","pluginOptionShape","pluginOptions","mutateContentTypeSchema","data","initialData","enhancedData","cloneDeep","refData"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MA+CaA,QAAAA,GAAoB;IAC/BC,UAAAA,EAAY;AACVC,QAAAA,MAAAA,EAAQ,EAAC;AACTC,QAAAA,GAAAA,CAAAA,CAAI,EAAEC,EAAE,EAAEC,SAAS,EAAE,EAAA;AACnB,YAAA,IAAI,CAAC,IAAI,CAACH,MAAM,CAACE,GAAG,EAAE;AACpB,gBAAA,IAAI,CAACF,MAAM,CAACE,EAAAA,CAAG,GAAGC,SAAAA;AACpB,YAAA;AACF,QAAA;AACF,KAAA;IACAC,KAAAA,EAAO;QACLC,SAAAA,EAAW;AAYX,SAAA;QACAC,WAAAA,EAAa;AACXC,YAAAA,UAAAA,EAAY,EAAE;YACdC,IAAAA,EAAM;AACJC,gBAAAA,QAAAA,EAAU,EAAE;AACZC,gBAAAA,IAAAA,EAAM;AACR;AACF,SAAA;QACAP,SAAAA,EAAW;AACTI,YAAAA,UAAAA,EAAY,EAAE;YACdC,IAAAA,EAAM;AACJC,gBAAAA,QAAAA,EAAU,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GAAAA,MAAAA;AAAQ,YAAA;AAAa,SAAA,EAAE,EAAE,CAAA;AAEhE,QAAA,MAAMkB,kBAAAA,GAAqBlC,UAAAA,CAAWoB,MAAM,CAAC,CAACC,GAAAA,EAAUC,OAAAA,GAAAA;AACtD,YAAA,MAAMa,oBAAoBb,OAAAA,CAAQW,IAAAA,CAAAA;YAElC,OAAO;AAAE,gBAAA,GAAGZ,GAAG;AAAE,gBAAA,GAAGc;AAAkB,aAAA;AACxC,QAAA,CAAA,EAAG,EAAC,CAAA;QAEJ,OAAOH,SAAAA,CAAUL,KAAK,CAAC;AAAES,YAAAA,aAAAA,EAAeP,cAAAA,CAAIC,MAAM,EAAA,CAAGH,KAAK,CAACO,kBAAAA;AAAoB,SAAA,CAAA;AACjF,IAAA,CAAA;IACAG,uBAAAA,CAAAA,CAAwBC,IAA6B,EAAEC,WAAoC,EAAA;AACzF,QAAA,IAAIC,eAAeC,SAAAA,CAAUH,IAAAA,CAAAA;AAE7B,QAAA,MAAMI,UAAUD,SAAAA,CAAUF,WAAAA,CAAAA;AAE1B,QAAA,IAAI,CAACnC,0BAA0B,CAACS,OAAO,CAAC,CAACP,EAAAA,GAAAA;AACvCkC,YAAAA,YAAAA,GAAelC,GAAGkC,YAAAA,EAAcE,OAAAA,CAAAA;AAClC,QAAA,CAAA,CAAA;QAEA,OAAOF,YAAAA;AACT,IAAA;AACF;;;;"}
1
+ {"version":3,"file":"formAPI.js","sources":["../../../admin/src/utils/formAPI.ts"],"sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\nimport get from 'lodash/get';\nimport * as yup from 'yup';\n\nexport interface FormAPI {\n components: {\n inputs: Record<string, any>;\n add: ({ id, component }: { id: string; component: any }) => void;\n };\n types: {\n attribute: {\n [key: string]: {\n validators: any[];\n form: {\n advanced: any[];\n base: any[];\n };\n };\n };\n contentType: {\n validators: any[];\n form: {\n advanced: any[];\n base: any[];\n };\n };\n component: {\n validators: any[];\n form: {\n advanced: any[];\n base: any[];\n };\n };\n };\n contentTypeSchemaMutations: any[];\n addContentTypeSchemaMutation: (cb: any) => void;\n extendContentType: (data: any) => void;\n extendFields: (fields: any[], data: any) => void;\n getAdvancedForm: (target: any, props?: any) => any[];\n makeCustomFieldValidator: (attributeShape: any, validator: any, ...validatorArgs: any) => any;\n makeValidator: (target: any, initShape: any, ...args: any) => any;\n mutateContentTypeSchema: (\n data: Record<string, unknown>,\n initialData: Record<string, unknown>\n ) => any;\n}\n\nexport const formsAPI: FormAPI = {\n components: {\n inputs: {},\n add({ id, component }) {\n if (!this.inputs[id]) {\n this.inputs[id] = component;\n }\n },\n },\n types: {\n attribute: {\n // test: {\n // validators: [],\n // form: {\n // advanced: [\n // /* cb */\n // ],\n // base: [\n // /* cb */\n // ],\n // },\n // },\n },\n contentType: {\n validators: [],\n form: {\n advanced: [],\n base: [],\n },\n },\n component: {\n validators: [],\n form: {\n advanced: [],\n base: [],\n },\n },\n },\n contentTypeSchemaMutations: [],\n addContentTypeSchemaMutation(cb) {\n this.contentTypeSchemaMutations.push(cb);\n },\n extendContentType({ validator, form: { advanced, base } }) {\n const { contentType } = this.types;\n\n if (validator) {\n contentType.validators.push(validator);\n }\n contentType.form.advanced.push(advanced);\n contentType.form.base.push(base);\n },\n extendFields(fields, { validator, form: { advanced, base } }) {\n const formType = this.types.attribute;\n\n fields.forEach((field) => {\n if (!formType[field]) {\n formType[field] = {\n validators: [],\n form: {\n advanced: [\n /* cb */\n ],\n base: [\n /* cb */\n ],\n },\n };\n }\n\n if (validator) {\n formType[field].validators.push(validator);\n }\n formType[field].form.advanced.push(advanced);\n formType[field].form.base.push(base);\n });\n },\n\n getAdvancedForm(target, props = null) {\n const sectionsToAdd = get(this.types, [...target, 'form', 'advanced'], []).reduce(\n (acc: any, current: any) => {\n const sections = current(props);\n\n return [...acc, ...sections];\n },\n []\n );\n\n return sectionsToAdd;\n },\n\n makeCustomFieldValidator(attributeShape, validator, ...validatorArgs) {\n // When no validator, return the attribute shape\n if (!validator) return attributeShape;\n\n // Otherwise extend the shape with the provided validator\n return attributeShape.shape({ options: yup.object().shape(validator(validatorArgs)) });\n },\n\n makeValidator(target, initShape, ...args) {\n const validators = get(this.types, [...target, 'validators'], []);\n\n const pluginOptionsShape = validators.reduce((acc: any, current: any) => {\n const pluginOptionShape = current(args);\n\n return { ...acc, ...pluginOptionShape };\n }, {});\n\n return initShape.shape({ pluginOptions: yup.object().shape(pluginOptionsShape) });\n },\n mutateContentTypeSchema(data: Record<string, unknown>, initialData: Record<string, unknown>) {\n let enhancedData = cloneDeep(data);\n\n const refData = cloneDeep(initialData);\n\n this.contentTypeSchemaMutations.forEach((cb: any) => {\n enhancedData = cb(enhancedData, refData);\n });\n\n return enhancedData;\n },\n};\n"],"names":["formsAPI","components","inputs","add","id","component","types","attribute","contentType","validators","form","advanced","base","contentTypeSchemaMutations","addContentTypeSchemaMutation","cb","push","extendContentType","validator","extendFields","fields","formType","forEach","field","getAdvancedForm","target","props","sectionsToAdd","get","reduce","acc","current","sections","makeCustomFieldValidator","attributeShape","validatorArgs","shape","options","yup","object","makeValidator","initShape","args","pluginOptionsShape","pluginOptionShape","pluginOptions","mutateContentTypeSchema","data","initialData","enhancedData","cloneDeep","refData"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+CaA,QAAAA,GAAoB;IAC/BC,UAAAA,EAAY;AACVC,QAAAA,MAAAA,EAAQ,EAAC;AACTC,QAAAA,GAAAA,CAAAA,CAAI,EAAEC,EAAE,EAAEC,SAAS,EAAE,EAAA;AACnB,YAAA,IAAI,CAAC,IAAI,CAACH,MAAM,CAACE,GAAG,EAAE;AACpB,gBAAA,IAAI,CAACF,MAAM,CAACE,EAAAA,CAAG,GAAGC,SAAAA;AACpB,YAAA;AACF,QAAA;AACF,KAAA;IACAC,KAAAA,EAAO;QACLC,SAAAA,EAAW;AAYX,SAAA;QACAC,WAAAA,EAAa;AACXC,YAAAA,UAAAA,EAAY,EAAE;YACdC,IAAAA,EAAM;AACJC,gBAAAA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,IAAAA,aAAAA,CAAAA,CAAcf,MAAM,EAAEgB,SAAS,EAAE,GAAGC,IAAI,EAAA;AACtC,QAAA,MAAMjC,UAAAA,GAAamB,oBAAAA,CAAI,IAAI,CAACtB,KAAK,EAAE;AAAImB,YAAAA,GAAAA,MAAAA;AAAQ,YAAA;AAAa,SAAA,EAAE,EAAE,CAAA;AAEhE,QAAA,MAAMkB,kBAAAA,GAAqBlC,UAAAA,CAAWoB,MAAM,CAAC,CAACC,GAAAA,EAAUC,OAAAA,GAAAA;AACtD,YAAA,MAAMa,oBAAoBb,OAAAA,CAAQW,IAAAA,CAAAA;YAElC,OAAO;AAAE,gBAAA,GAAGZ,GAAG;AAAE,gBAAA,GAAGc;AAAkB,aAAA;AACxC,QAAA,CAAA,EAAG,EAAC,CAAA;QAEJ,OAAOH,SAAAA,CAAUL,KAAK,CAAC;AAAES,YAAAA,aAAAA,EAAeP,cAAAA,CAAIC,MAAM,EAAA,CAAGH,KAAK,CAACO,kBAAAA;AAAoB,SAAA,CAAA;AACjF,IAAA,CAAA;IACAG,uBAAAA,CAAAA,CAAwBC,IAA6B,EAAEC,WAAoC,EAAA;AACzF,QAAA,IAAIC,eAAeC,0BAAAA,CAAUH,IAAAA,CAAAA;AAE7B,QAAA,MAAMI,UAAUD,0BAAAA,CAAUF,WAAAA,CAAAA;AAE1B,QAAA,IAAI,CAACnC,0BAA0B,CAACS,OAAO,CAAC,CAACP,EAAAA,GAAAA;AACvCkC,YAAAA,YAAAA,GAAelC,GAAGkC,YAAAA,EAAcE,OAAAA,CAAAA;AAClC,QAAA,CAAA,CAAA;QAEA,OAAOF,YAAAA;AACT,IAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMaxDepth.js","sources":["../../../admin/src/utils/getMaxDepth.ts"],"sourcesContent":["import type { ComponentWithChildren } from '../components/DataManager/utils/retrieveComponentsThatHaveComponents';\nimport type { NestedComponent } from '../components/DataManager/utils/retrieveNestedComponents';\nimport type { Internal } from '@strapi/types';\n\nconst findComponent = <T extends { component: Internal.UID.Component }>(\n componentUid: Internal.UID.Schema,\n components: Array<T>\n) => {\n return components.find((c) => c.component === componentUid);\n};\n\n/**\n * Recursively calculates the maximum depth of nested child components\n * for a given component UID.\n *\n * @param componentUid - The UID of the component to start from.\n * @param components - The array of all components with their child components.\n * @param currentDepth - The current depth of the recursion. Defaults to 0.\n * @returns The maximum depth of the nested child components.\n */\nexport const getChildrenMaxDepth = (\n componentUid: Internal.UID.Component,\n components: Array<ComponentWithChildren>,\n currentDepth = 0\n) => {\n const component = findComponent(componentUid, components);\n\n // If the component doesn't exist or has no child components, return the current depth.\n if (!component || !component.childComponents || component.childComponents.length === 0) {\n return currentDepth;\n }\n\n let maxDepth = currentDepth;\n\n // Iterate through each child component to calculate their respective depths.\n component.childComponents.forEach((child) => {\n // Recursively calculate the depth of the child component.\n const depth = getChildrenMaxDepth(child.component, components, currentDepth + 1);\n // Update the maximum depth if the child's depth is greater.\n if (depth > maxDepth) {\n maxDepth = depth;\n }\n });\n\n return maxDepth;\n};\n\n/**\n * Calculates the depth of a component within a nested component tree.\n * Depth is defined as the level at which the component is nested.\n * For example, a component at Depth 3 is the third nested component.\n *\n * @param component - The UID of the component to find the depth for.\n * @param components - The array of all nested components.\n * @returns The depth level of the component within the nested tree.\n */\nexport const getComponentDepth = (\n component: Internal.UID.Schema,\n components: Array<NestedComponent>\n) => {\n /**\n * Helper function to recursively calculate the depth of a component.\n *\n * @param currentComponent - The current component being inspected.\n * @param currentLevel - The current level of depth in the tree.\n * @returns An array of depth levels found for the component.\n */\n const getDepth = (currentComponent: NestedComponent, currentLevel: number): Array<number> => {\n const levels = [];\n levels.push(currentLevel);\n\n // If the component has no parent UIDs, return the current levels\n if (!currentComponent.uidsOfAllParents) {\n return levels;\n }\n\n // Iterate over each parent UID to calculate their respective depths\n for (const parentUid of currentComponent.uidsOfAllParents) {\n const parentComponent = findComponent(parentUid, components);\n if (parentComponent) {\n levels.push(...getDepth(parentComponent, currentLevel + 1));\n }\n }\n\n return levels;\n };\n\n const nestedCompo = findComponent(component, components);\n // return depth 0 if component is not nested\n if (!nestedCompo) {\n return 0;\n }\n const compoDepth = Math.max(...getDepth(nestedCompo, 1));\n return compoDepth;\n};\n"],"names":["findComponent","componentUid","components","find","c","component","getChildrenMaxDepth","currentDepth","childComponents","length","maxDepth","forEach","child","depth","getComponentDepth","getDepth","currentComponent","currentLevel","levels","push","uidsOfAllParents","parentUid","parentComponent","nestedCompo","compoDepth","Math","max"],"mappings":";;AAIA,MAAMA,aAAAA,GAAgB,CACpBC,YAAAA,EACAC,UAAAA,GAAAA;AAEA,IAAA,OAAOA,WAAWC,IAAI,CAAC,CAACC,CAAAA,GAAMA,CAAAA,CAAEC,SAAS,KAAKJ,YAAAA,CAAAA;AAChD,CAAA;AAEA;;;;;;;;AAQC,IACM,MAAMK,mBAAAA,GAAsB,CACjCL,YAAAA,EACAC,UAAAA,EACAK,eAAe,CAAC,GAAA;IAEhB,MAAMF,SAAAA,GAAYL,cAAcC,YAAAA,EAAcC,UAAAA,CAAAA;;IAG9C,IAAI,CAACG,SAAAA,IAAa,CAACA,SAAAA,CAAUG,eAAe,IAAIH,SAAAA,CAAUG,eAAe,CAACC,MAAM,KAAK,CAAA,EAAG;QACtF,OAAOF,YAAAA;AACT,IAAA;AAEA,IAAA,IAAIG,QAAAA,GAAWH,YAAAA;;AAGfF,IAAAA,SAAAA,CAAUG,eAAe,CAACG,OAAO,CAAC,CAACC,KAAAA,GAAAA;;AAEjC,QAAA,MAAMC,QAAQP,mBAAAA,CAAoBM,KAAAA,CAAMP,SAAS,EAAEH,YAAYK,YAAAA,GAAe,CAAA,CAAA;;AAE9E,QAAA,IAAIM,QAAQH,QAAAA,EAAU;YACpBA,QAAAA,GAAWG,KAAAA;AACb,QAAA;AACF,IAAA,CAAA,CAAA;IAEA,OAAOH,QAAAA;AACT;AAEA;;;;;;;;AAQC,IACM,MAAMI,iBAAAA,GAAoB,CAC/BT,SAAAA,EACAH,UAAAA,GAAAA;AAEA;;;;;;MAOA,MAAMa,QAAAA,GAAW,CAACC,gBAAAA,EAAmCC,YAAAA,GAAAA;AACnD,QAAA,MAAMC,SAAS,EAAE;AACjBA,QAAAA,MAAAA,CAAOC,IAAI,CAACF,YAAAA,CAAAA;;QAGZ,IAAI,CAACD,gBAAAA,CAAiBI,gBAAgB,EAAE;YACtC,OAAOF,MAAAA;AACT,QAAA;;AAGA,QAAA,KAAK,MAAMG,SAAAA,IAAaL,gBAAAA,CAAiBI,gBAAgB,CAAE;YACzD,MAAME,eAAAA,GAAkBtB,cAAcqB,SAAAA,EAAWnB,UAAAA,CAAAA;AACjD,YAAA,IAAIoB,eAAAA,EAAiB;AACnBJ,gBAAAA,MAAAA,CAAOC,IAAI,CAAA,GAAIJ,QAAAA,CAASO,eAAAA,EAAiBL,YAAAA,GAAe,CAAA,CAAA,CAAA;AAC1D,YAAA;AACF,QAAA;QAEA,OAAOC,MAAAA;AACT,IAAA,CAAA;IAEA,MAAMK,WAAAA,GAAcvB,cAAcK,SAAAA,EAAWH,UAAAA,CAAAA;;AAE7C,IAAA,IAAI,CAACqB,WAAAA,EAAa;QAChB,OAAO,CAAA;AACT,IAAA;AACA,IAAA,MAAMC,UAAAA,GAAaC,IAAAA,CAAKC,GAAG,CAAA,GAAIX,SAASQ,WAAAA,EAAa,CAAA,CAAA,CAAA;IACrD,OAAOC,UAAAA;AACT;;;;;"}
1
+ {"version":3,"file":"getMaxDepth.js","sources":["../../../admin/src/utils/getMaxDepth.ts"],"sourcesContent":["import type { ComponentWithChildren } from '../components/DataManager/utils/retrieveComponentsThatHaveComponents';\nimport type { NestedComponent } from '../components/DataManager/utils/retrieveNestedComponents';\nimport type { Internal } from '@strapi/types';\n\nconst findComponent = <T extends { component: Internal.UID.Component }>(\n componentUid: Internal.UID.Schema,\n components: Array<T>\n) => {\n return components.find((c) => c.component === componentUid);\n};\n\n/**\n * Recursively calculates the maximum depth of nested child components\n * for a given component UID.\n *\n * @param componentUid - The UID of the component to start from.\n * @param components - The array of all components with their child components.\n * @param currentDepth - The current depth of the recursion. Defaults to 0.\n * @returns The maximum depth of the nested child components.\n */\nexport const getChildrenMaxDepth = (\n componentUid: Internal.UID.Component,\n components: Array<ComponentWithChildren>,\n currentDepth = 0\n): number => {\n const component = findComponent(componentUid, components);\n\n // If the component doesn't exist or has no child components, return the current depth.\n if (!component || !component.childComponents || component.childComponents.length === 0) {\n return currentDepth;\n }\n\n let maxDepth = currentDepth;\n\n // Iterate through each child component to calculate their respective depths.\n component.childComponents.forEach((child) => {\n // Recursively calculate the depth of the child component.\n const depth = getChildrenMaxDepth(child.component, components, currentDepth + 1);\n // Update the maximum depth if the child's depth is greater.\n if (depth > maxDepth) {\n maxDepth = depth;\n }\n });\n\n return maxDepth;\n};\n\n/**\n * Calculates the depth of a component within a nested component tree.\n * Depth is defined as the level at which the component is nested.\n * For example, a component at Depth 3 is the third nested component.\n *\n * @param component - The UID of the component to find the depth for.\n * @param components - The array of all nested components.\n * @returns The depth level of the component within the nested tree.\n */\nexport const getComponentDepth = (\n component: Internal.UID.Schema,\n components: Array<NestedComponent>\n) => {\n /**\n * Helper function to recursively calculate the depth of a component.\n *\n * @param currentComponent - The current component being inspected.\n * @param currentLevel - The current level of depth in the tree.\n * @returns An array of depth levels found for the component.\n */\n const getDepth = (currentComponent: NestedComponent, currentLevel: number): Array<number> => {\n const levels = [];\n levels.push(currentLevel);\n\n // If the component has no parent UIDs, return the current levels\n if (!currentComponent.uidsOfAllParents) {\n return levels;\n }\n\n // Iterate over each parent UID to calculate their respective depths\n for (const parentUid of currentComponent.uidsOfAllParents) {\n const parentComponent = findComponent(parentUid, components);\n if (parentComponent) {\n levels.push(...getDepth(parentComponent, currentLevel + 1));\n }\n }\n\n return levels;\n };\n\n const nestedCompo = findComponent(component, components);\n // return depth 0 if component is not nested\n if (!nestedCompo) {\n return 0;\n }\n const compoDepth = Math.max(...getDepth(nestedCompo, 1));\n return compoDepth;\n};\n"],"names":["findComponent","componentUid","components","find","c","component","getChildrenMaxDepth","currentDepth","childComponents","length","maxDepth","forEach","child","depth","getComponentDepth","getDepth","currentComponent","currentLevel","levels","push","uidsOfAllParents","parentUid","parentComponent","nestedCompo","compoDepth","Math","max"],"mappings":";;AAIA,MAAMA,aAAAA,GAAgB,CACpBC,YAAAA,EACAC,UAAAA,GAAAA;AAEA,IAAA,OAAOA,WAAWC,IAAI,CAAC,CAACC,CAAAA,GAAMA,CAAAA,CAAEC,SAAS,KAAKJ,YAAAA,CAAAA;AAChD,CAAA;AAEA;;;;;;;;AAQC,IACM,MAAMK,mBAAAA,GAAsB,CACjCL,YAAAA,EACAC,UAAAA,EACAK,eAAe,CAAC,GAAA;IAEhB,MAAMF,SAAAA,GAAYL,cAAcC,YAAAA,EAAcC,UAAAA,CAAAA;;IAG9C,IAAI,CAACG,SAAAA,IAAa,CAACA,SAAAA,CAAUG,eAAe,IAAIH,SAAAA,CAAUG,eAAe,CAACC,MAAM,KAAK,CAAA,EAAG;QACtF,OAAOF,YAAAA;AACT,IAAA;AAEA,IAAA,IAAIG,QAAAA,GAAWH,YAAAA;;AAGfF,IAAAA,SAAAA,CAAUG,eAAe,CAACG,OAAO,CAAC,CAACC,KAAAA,GAAAA;;AAEjC,QAAA,MAAMC,QAAQP,mBAAAA,CAAoBM,KAAAA,CAAMP,SAAS,EAAEH,YAAYK,YAAAA,GAAe,CAAA,CAAA;;AAE9E,QAAA,IAAIM,QAAQH,QAAAA,EAAU;YACpBA,QAAAA,GAAWG,KAAAA;AACb,QAAA;AACF,IAAA,CAAA,CAAA;IAEA,OAAOH,QAAAA;AACT;AAEA;;;;;;;;AAQC,IACM,MAAMI,iBAAAA,GAAoB,CAC/BT,SAAAA,EACAH,UAAAA,GAAAA;AAEA;;;;;;MAOA,MAAMa,QAAAA,GAAW,CAACC,gBAAAA,EAAmCC,YAAAA,GAAAA;AACnD,QAAA,MAAMC,SAAS,EAAE;AACjBA,QAAAA,MAAAA,CAAOC,IAAI,CAACF,YAAAA,CAAAA;;QAGZ,IAAI,CAACD,gBAAAA,CAAiBI,gBAAgB,EAAE;YACtC,OAAOF,MAAAA;AACT,QAAA;;AAGA,QAAA,KAAK,MAAMG,SAAAA,IAAaL,gBAAAA,CAAiBI,gBAAgB,CAAE;YACzD,MAAME,eAAAA,GAAkBtB,cAAcqB,SAAAA,EAAWnB,UAAAA,CAAAA;AACjD,YAAA,IAAIoB,eAAAA,EAAiB;AACnBJ,gBAAAA,MAAAA,CAAOC,IAAI,CAAA,GAAIJ,QAAAA,CAASO,eAAAA,EAAiBL,YAAAA,GAAe,CAAA,CAAA,CAAA;AAC1D,YAAA;AACF,QAAA;QAEA,OAAOC,MAAAA;AACT,IAAA,CAAA;IAEA,MAAMK,WAAAA,GAAcvB,cAAcK,SAAAA,EAAWH,UAAAA,CAAAA;;AAE7C,IAAA,IAAI,CAACqB,WAAAA,EAAa;QAChB,OAAO,CAAA;AACT,IAAA;AACA,IAAA,MAAMC,UAAAA,GAAaC,IAAAA,CAAKC,GAAG,CAAA,GAAIX,SAASQ,WAAAA,EAAa,CAAA,CAAA,CAAA;IACrD,OAAOC,UAAAA;AACT;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMaxDepth.mjs","sources":["../../../admin/src/utils/getMaxDepth.ts"],"sourcesContent":["import type { ComponentWithChildren } from '../components/DataManager/utils/retrieveComponentsThatHaveComponents';\nimport type { NestedComponent } from '../components/DataManager/utils/retrieveNestedComponents';\nimport type { Internal } from '@strapi/types';\n\nconst findComponent = <T extends { component: Internal.UID.Component }>(\n componentUid: Internal.UID.Schema,\n components: Array<T>\n) => {\n return components.find((c) => c.component === componentUid);\n};\n\n/**\n * Recursively calculates the maximum depth of nested child components\n * for a given component UID.\n *\n * @param componentUid - The UID of the component to start from.\n * @param components - The array of all components with their child components.\n * @param currentDepth - The current depth of the recursion. Defaults to 0.\n * @returns The maximum depth of the nested child components.\n */\nexport const getChildrenMaxDepth = (\n componentUid: Internal.UID.Component,\n components: Array<ComponentWithChildren>,\n currentDepth = 0\n) => {\n const component = findComponent(componentUid, components);\n\n // If the component doesn't exist or has no child components, return the current depth.\n if (!component || !component.childComponents || component.childComponents.length === 0) {\n return currentDepth;\n }\n\n let maxDepth = currentDepth;\n\n // Iterate through each child component to calculate their respective depths.\n component.childComponents.forEach((child) => {\n // Recursively calculate the depth of the child component.\n const depth = getChildrenMaxDepth(child.component, components, currentDepth + 1);\n // Update the maximum depth if the child's depth is greater.\n if (depth > maxDepth) {\n maxDepth = depth;\n }\n });\n\n return maxDepth;\n};\n\n/**\n * Calculates the depth of a component within a nested component tree.\n * Depth is defined as the level at which the component is nested.\n * For example, a component at Depth 3 is the third nested component.\n *\n * @param component - The UID of the component to find the depth for.\n * @param components - The array of all nested components.\n * @returns The depth level of the component within the nested tree.\n */\nexport const getComponentDepth = (\n component: Internal.UID.Schema,\n components: Array<NestedComponent>\n) => {\n /**\n * Helper function to recursively calculate the depth of a component.\n *\n * @param currentComponent - The current component being inspected.\n * @param currentLevel - The current level of depth in the tree.\n * @returns An array of depth levels found for the component.\n */\n const getDepth = (currentComponent: NestedComponent, currentLevel: number): Array<number> => {\n const levels = [];\n levels.push(currentLevel);\n\n // If the component has no parent UIDs, return the current levels\n if (!currentComponent.uidsOfAllParents) {\n return levels;\n }\n\n // Iterate over each parent UID to calculate their respective depths\n for (const parentUid of currentComponent.uidsOfAllParents) {\n const parentComponent = findComponent(parentUid, components);\n if (parentComponent) {\n levels.push(...getDepth(parentComponent, currentLevel + 1));\n }\n }\n\n return levels;\n };\n\n const nestedCompo = findComponent(component, components);\n // return depth 0 if component is not nested\n if (!nestedCompo) {\n return 0;\n }\n const compoDepth = Math.max(...getDepth(nestedCompo, 1));\n return compoDepth;\n};\n"],"names":["findComponent","componentUid","components","find","c","component","getChildrenMaxDepth","currentDepth","childComponents","length","maxDepth","forEach","child","depth","getComponentDepth","getDepth","currentComponent","currentLevel","levels","push","uidsOfAllParents","parentUid","parentComponent","nestedCompo","compoDepth","Math","max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AAiBI,gBAAgB,CAAE;YACzD,MAAME,eAAAA,GAAkBtB,cAAcqB,SAAAA,EAAWnB,UAAAA,CAAAA;AACjD,YAAA,IAAIoB,eAAAA,EAAiB;AACnBJ,gBAAAA,MAAAA,CAAOC,IAAI,CAAA,GAAIJ,QAAAA,CAASO,eAAAA,EAAiBL,YAAAA,GAAe,CAAA,CAAA,CAAA;AAC1D,YAAA;AACF,QAAA;QAEA,OAAOC,MAAAA;AACT,IAAA,CAAA;IAEA,MAAMK,WAAAA,GAAcvB,cAAcK,SAAAA,EAAWH,UAAAA,CAAAA;;AAE7C,IAAA,IAAI,CAACqB,WAAAA,EAAa;QAChB,OAAO,CAAA;AACT,IAAA;AACA,IAAA,MAAMC,UAAAA,GAAaC,IAAAA,CAAKC,GAAG,CAAA,GAAIX,SAASQ,WAAAA,EAAa,CAAA,CAAA,CAAA;IACrD,OAAOC,UAAAA;AACT;;;;"}
1
+ {"version":3,"file":"getMaxDepth.mjs","sources":["../../../admin/src/utils/getMaxDepth.ts"],"sourcesContent":["import type { ComponentWithChildren } from '../components/DataManager/utils/retrieveComponentsThatHaveComponents';\nimport type { NestedComponent } from '../components/DataManager/utils/retrieveNestedComponents';\nimport type { Internal } from '@strapi/types';\n\nconst findComponent = <T extends { component: Internal.UID.Component }>(\n componentUid: Internal.UID.Schema,\n components: Array<T>\n) => {\n return components.find((c) => c.component === componentUid);\n};\n\n/**\n * Recursively calculates the maximum depth of nested child components\n * for a given component UID.\n *\n * @param componentUid - The UID of the component to start from.\n * @param components - The array of all components with their child components.\n * @param currentDepth - The current depth of the recursion. Defaults to 0.\n * @returns The maximum depth of the nested child components.\n */\nexport const getChildrenMaxDepth = (\n componentUid: Internal.UID.Component,\n components: Array<ComponentWithChildren>,\n currentDepth = 0\n): number => {\n const component = findComponent(componentUid, components);\n\n // If the component doesn't exist or has no child components, return the current depth.\n if (!component || !component.childComponents || component.childComponents.length === 0) {\n return currentDepth;\n }\n\n let maxDepth = currentDepth;\n\n // Iterate through each child component to calculate their respective depths.\n component.childComponents.forEach((child) => {\n // Recursively calculate the depth of the child component.\n const depth = getChildrenMaxDepth(child.component, components, currentDepth + 1);\n // Update the maximum depth if the child's depth is greater.\n if (depth > maxDepth) {\n maxDepth = depth;\n }\n });\n\n return maxDepth;\n};\n\n/**\n * Calculates the depth of a component within a nested component tree.\n * Depth is defined as the level at which the component is nested.\n * For example, a component at Depth 3 is the third nested component.\n *\n * @param component - The UID of the component to find the depth for.\n * @param components - The array of all nested components.\n * @returns The depth level of the component within the nested tree.\n */\nexport const getComponentDepth = (\n component: Internal.UID.Schema,\n components: Array<NestedComponent>\n) => {\n /**\n * Helper function to recursively calculate the depth of a component.\n *\n * @param currentComponent - The current component being inspected.\n * @param currentLevel - The current level of depth in the tree.\n * @returns An array of depth levels found for the component.\n */\n const getDepth = (currentComponent: NestedComponent, currentLevel: number): Array<number> => {\n const levels = [];\n levels.push(currentLevel);\n\n // If the component has no parent UIDs, return the current levels\n if (!currentComponent.uidsOfAllParents) {\n return levels;\n }\n\n // Iterate over each parent UID to calculate their respective depths\n for (const parentUid of currentComponent.uidsOfAllParents) {\n const parentComponent = findComponent(parentUid, components);\n if (parentComponent) {\n levels.push(...getDepth(parentComponent, currentLevel + 1));\n }\n }\n\n return levels;\n };\n\n const nestedCompo = findComponent(component, components);\n // return depth 0 if component is not nested\n if (!nestedCompo) {\n return 0;\n }\n const compoDepth = Math.max(...getDepth(nestedCompo, 1));\n return compoDepth;\n};\n"],"names":["findComponent","componentUid","components","find","c","component","getChildrenMaxDepth","currentDepth","childComponents","length","maxDepth","forEach","child","depth","getComponentDepth","getDepth","currentComponent","currentLevel","levels","push","uidsOfAllParents","parentUid","parentComponent","nestedCompo","compoDepth","Math","max"],"mappings":"AAIA,MAAMA,aAAAA,GAAgB,CACpBC,YAAAA,EACAC,UAAAA,GAAAA;AAEA,IAAA,OAAOA,WAAWC,IAAI,CAAC,CAACC,CAAAA,GAAMA,CAAAA,CAAEC,SAAS,KAAKJ,YA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AAA,GAAIJ,QAAAA,CAASO,eAAAA,EAAiBL,YAAAA,GAAe,CAAA,CAAA,CAAA;AAC1D,YAAA;AACF,QAAA;QAEA,OAAOC,MAAAA;AACT,IAAA,CAAA;IAEA,MAAMK,WAAAA,GAAcvB,cAAcK,SAAAA,EAAWH,UAAAA,CAAAA;;AAE7C,IAAA,IAAI,CAACqB,WAAAA,EAAa;QAChB,OAAO,CAAA;AACT,IAAA;AACA,IAAA,MAAMC,UAAAA,GAAaC,IAAAA,CAAKC,GAAG,CAAA,GAAIX,SAASQ,WAAAA,EAAa,CAAA,CAAA,CAAA;IACrD,OAAOC,UAAAA;AACT;;;;"}
@@ -2,7 +2,11 @@
2
2
 
3
3
  var slugify = require('@sindresorhus/slugify');
4
4
 
5
- const nameToSlug = (name)=>slugify(name, {
5
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
+
7
+ var slugify__default = /*#__PURE__*/_interopDefault(slugify);
8
+
9
+ const nameToSlug = (name)=>slugify__default.default(name, {
6
10
  separator: '-'
7
11
  });
8
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"nameToSlug.js","sources":["../../../admin/src/utils/nameToSlug.ts"],"sourcesContent":["import slugify from '@sindresorhus/slugify';\n\nexport const nameToSlug = (name: string) => slugify(name, { separator: '-' });\n"],"names":["nameToSlug","name","slugify","separator"],"mappings":";;;;AAEO,MAAMA,UAAAA,GAAa,CAACC,IAAAA,GAAiBC,QAAQD,IAAAA,EAAM;QAAEE,SAAAA,EAAW;KAAI;;;;"}
1
+ {"version":3,"file":"nameToSlug.js","sources":["../../../admin/src/utils/nameToSlug.ts"],"sourcesContent":["import slugify from '@sindresorhus/slugify';\n\nexport const nameToSlug = (name: string) => slugify(name, { separator: '-' });\n"],"names":["nameToSlug","name","slugify","separator"],"mappings":";;;;;;;;AAEO,MAAMA,UAAAA,GAAa,CAACC,IAAAA,GAAiBC,yBAAQD,IAAAA,EAAM;QAAEE,SAAAA,EAAW;KAAI;;;;"}
@@ -2,11 +2,15 @@
2
2
 
3
3
  var slugify = require('@sindresorhus/slugify');
4
4
 
5
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
+
7
+ var slugify__default = /*#__PURE__*/_interopDefault(slugify);
8
+
5
9
  const toRegressedEnumValue = (value)=>{
6
10
  if (!value) {
7
11
  return '';
8
12
  }
9
- return slugify(value, {
13
+ return slugify__default.default(value, {
10
14
  decamelize: false,
11
15
  lowercase: false,
12
16
  separator: '_'
@@ -1 +1 @@
1
- {"version":3,"file":"toRegressedEnumValue.js","sources":["../../../admin/src/utils/toRegressedEnumValue.ts"],"sourcesContent":["import slugify from '@sindresorhus/slugify';\n\nexport const toRegressedEnumValue = (value: string | undefined) => {\n if (!value) {\n return '';\n }\n return slugify(value, {\n decamelize: false,\n lowercase: false,\n separator: '_',\n });\n};\n"],"names":["toRegressedEnumValue","value","slugify","decamelize","lowercase","separator"],"mappings":";;;;AAEO,MAAMA,uBAAuB,CAACC,KAAAA,GAAAA;AACnC,IAAA,IAAI,CAACA,KAAAA,EAAO;QACV,OAAO,EAAA;AACT,IAAA;AACA,IAAA,OAAOC,QAAQD,KAAAA,EAAO;QACpBE,UAAAA,EAAY,KAAA;QACZC,SAAAA,EAAW,KAAA;QACXC,SAAAA,EAAW;AACb,KAAA,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"toRegressedEnumValue.js","sources":["../../../admin/src/utils/toRegressedEnumValue.ts"],"sourcesContent":["import slugify from '@sindresorhus/slugify';\n\nexport const toRegressedEnumValue = (value: string | undefined) => {\n if (!value) {\n return '';\n }\n return slugify(value, {\n decamelize: false,\n lowercase: false,\n separator: '_',\n });\n};\n"],"names":["toRegressedEnumValue","value","slugify","decamelize","lowercase","separator"],"mappings":";;;;;;;;AAEO,MAAMA,uBAAuB,CAACC,KAAAA,GAAAA;AACnC,IAAA,IAAI,CAACA,KAAAA,EAAO;QACV,OAAO,EAAA;AACT,IAAA;AACA,IAAA,OAAOC,yBAAQD,KAAAA,EAAO;QACpBE,UAAAA,EAAY,KAAA;QACZC,SAAAA,EAAW,KAAA;QACXC,SAAAA,EAAW;AACb,KAAA,CAAA;AACF;;;;"}
@@ -4,6 +4,10 @@ var _ = require('lodash');
4
4
  var index = require('../utils/index.js');
5
5
  var component = require('./validation/component.js');
6
6
 
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var ___default = /*#__PURE__*/_interopDefault(_);
10
+
7
11
  /**
8
12
  * Components controller
9
13
  */ var components = {
@@ -78,7 +82,7 @@ var component = require('./validation/component.js');
78
82
  */ async updateComponent (ctx) {
79
83
  const { uid } = ctx.params;
80
84
  const body = ctx.request.body;
81
- if (!_.has(strapi.components, uid)) {
85
+ if (!___default.default.has(strapi.components, uid)) {
82
86
  return ctx.send({
83
87
  error: 'component.notFound'
84
88
  }, 404);
@@ -116,7 +120,7 @@ var component = require('./validation/component.js');
116
120
  * @param {Object} ctx - koa context
117
121
  */ async deleteComponent (ctx) {
118
122
  const { uid } = ctx.params;
119
- if (!_.has(strapi.components, uid)) {
123
+ if (!___default.default.has(strapi.components, uid)) {
120
124
  return ctx.send({
121
125
  error: 'component.notFound'
122
126
  }, 404);
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sources":["../../../server/src/controllers/components.ts"],"sourcesContent":["import _ from 'lodash';\nimport type { Context } from 'koa';\nimport type { UID } from '@strapi/types';\nimport { getService } from '../utils';\nimport { validateComponentInput, validateUpdateComponentInput } from './validation/component';\n\n/**\n * Components controller\n */\n\nexport default {\n /**\n * GET /components handler\n * Returns a list of available components\n * @param {Object} ctx - koa context\n */\n async getComponents(ctx: Context) {\n const componentService = getService('components');\n const componentUIDs = Object.keys(strapi.components) as UID.Component[];\n\n const data = componentUIDs.map((uid) => {\n return componentService.formatComponent(strapi.components[uid]);\n });\n\n ctx.send({ data });\n },\n\n /**\n * GET /components/:uid\n * Returns a specific component\n * @param {Object} ctx - koa context\n */\n async getComponent(ctx: Context) {\n const { uid } = ctx.params;\n\n const component = strapi.components[uid];\n\n if (!component) {\n return ctx.send({ error: 'component.notFound' }, 404);\n }\n\n const componentService = getService('components');\n\n ctx.send({ data: componentService.formatComponent(component) });\n },\n\n /**\n * POST /components\n * Creates a component and returns its infos\n * @param {Object} ctx - koa context\n */\n async createComponent(ctx: Context) {\n const body = ctx.request.body as any;\n\n try {\n await validateComponentInput(body);\n } catch (error) {\n return ctx.send({ error }, 400);\n }\n\n try {\n strapi.reload.isWatching = false;\n\n const componentService = getService('components');\n\n const component = await componentService.createComponent({\n component: body.component,\n components: body.components,\n });\n\n setImmediate(() => strapi.reload());\n\n ctx.send({ data: { uid: component.uid } }, 201);\n } catch (error) {\n strapi.log.error(error);\n ctx.send({ error: (error as any)?.message || 'Unknown error' }, 400);\n }\n },\n\n /**\n * PUT /components/:uid\n * Updates a component and return its infos\n * @param {Object} ctx - koa context - enhanced koa context\n */\n async updateComponent(ctx: Context) {\n const { uid } = ctx.params;\n const body = ctx.request.body as any;\n\n if (!_.has(strapi.components, uid)) {\n return ctx.send({ error: 'component.notFound' }, 404);\n }\n\n try {\n await validateUpdateComponentInput(body);\n } catch (error) {\n return ctx.send({ error }, 400);\n }\n\n try {\n strapi.reload.isWatching = false;\n\n const componentService = getService('components');\n\n const component = (await componentService.editComponent(uid, {\n component: body.component,\n components: body.components,\n })) as any;\n\n setImmediate(() => strapi.reload());\n\n ctx.send({ data: { uid: component.uid } });\n } catch (error) {\n strapi.log.error(error);\n\n ctx.send({ error: (error as any)?.message || 'Unknown error' }, 400);\n }\n },\n\n /**\n * DELETE /components/:uid\n * Deletes a components and returns its old infos\n * @param {Object} ctx - koa context\n */\n async deleteComponent(ctx: Context) {\n const { uid } = ctx.params;\n\n if (!_.has(strapi.components, uid)) {\n return ctx.send({ error: 'component.notFound' }, 404);\n }\n\n try {\n strapi.reload.isWatching = false;\n\n const componentService = getService('components');\n\n const component = await componentService.deleteComponent(uid);\n\n setImmediate(() => strapi.reload());\n\n ctx.send({ data: { uid: component.uid } });\n } catch (error) {\n strapi.log.error(error);\n ctx.send({ error: (error as any)?.message || 'Unknown error' }, 400);\n }\n },\n};\n"],"names":["getComponents","ctx","componentService","getService","componentUIDs","Object","keys","strapi","components","data","map","uid","formatComponent","send","getComponent","params","component","error","createComponent","body","request","validateComponentInput","reload","isWatching","setImmediate","log","message","updateComponent","_","has","validateUpdateComponentInput","editComponent","deleteComponent"],"mappings":";;;;;;AAMA;;AAEC,IAED,iBAAe;AACb;;;;MAKA,MAAMA,eAAcC,GAAY,EAAA;AAC9B,QAAA,MAAMC,mBAAmBC,gBAAAA,CAAW,YAAA,CAAA;AACpC,QAAA,MAAMC,aAAAA,GAAgBC,MAAAA,CAAOC,IAAI,CAACC,OAAOC,UAAU,CAAA;AAEnD,QAAA,MAAMC,IAAAA,GAAOL,aAAAA,CAAcM,GAAG,CAAC,CAACC,GAAAA,GAAAA;AAC9B,YAAA,OAAOT,iBAAiBU,eAAe,CAACL,MAAAA,CAAOC,UAAU,CAACG,GAAAA,CAAI,CAAA;AAChE,QAAA,CAAA,CAAA;AAEAV,QAAAA,GAAAA,CAAIY,IAAI,CAAC;AAAEJ,YAAAA;AAAK,SAAA,CAAA;AAClB,IAAA,CAAA;AAEA;;;;MAKA,MAAMK,cAAab,GAAY,EAAA;AAC7B,QAAA,MAAM,EAAEU,GAAG,EAAE,GAAGV,IAAIc,MAAM;AAE1B,QAAA,MAAMC,SAAAA,GAAYT,MAAAA,CAAOC,UAAU,CAACG,GAAAA,CAAI;AAExC,QAAA,IAAI,CAACK,SAAAA,EAAW;YACd,OAAOf,GAAAA,CAAIY,IAAI,CAAC;gBAAEI,KAAAA,EAAO;aAAqB,EAAG,GAAA,CAAA;AACnD,QAAA;AAEA,QAAA,MAAMf,mBAAmBC,gBAAAA,CAAW,YAAA,CAAA;AAEpCF,QAAAA,GAAAA,CAAIY,IAAI,CAAC;YAAEJ,IAAAA,EAAMP,gBAAAA,CAAiBU,eAAe,CAACI,SAAAA;AAAW,SAAA,CAAA;AAC/D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B,QAAA,IAAI,CAACa,CAAAA,CAAEC,GAAG,CAACtB,MAAAA,CAAOC,UAAU,EAAEG,GAAAA,CAAAA,EAAM;YAClC,OAAOV,GAAAA,CAAIY,IAAI,CAAC;gBAAEI,KAAAA,EAAO;aAAqB,EAAG,GAAA,CAAA;AACnD,QAAA;QAEA,IAAI;YACFV,MAAAA,CAAOe,MAAM,CAACC,UAAU,GAAG,KAAA;AAE3B,YAAA,MAAMrB,mBAAmBC,gBAAAA,CAAW,YAAA,CAAA;AAEpC,YAAA,MAAMa,SAAAA,GAAY,MAAMd,gBAAAA,CAAiB8B,eAAe,CAACrB,GAAAA,CAAAA;YAEzDa,YAAAA,CAAa,IAAMjB,OAAOe,MAAM,EAAA,CAAA;AAEhCrB,YAAAA,GAAAA,CAAIY,IAAI,CAAC;gBAAEJ,IAAAA,EAAM;AAAEE,oBAAAA,GAAAA,EAAKK,UAAUL;AAAI;AAAE,aAAA,CAAA;AAC1C,QAAA,CAAA,CAAE,OAAOM,KAAAA,EAAO;YACdV,MAAAA,CAAOkB,GAAG,CAACR,KAAK,CAACA,KAAAA,CAAAA;AACjBhB,YAAAA,GAAAA,CAAIY,IAAI,CAAC;gBAAEI,KAAAA,EAAQA,OAAeS,OAAAA,IAAW;aAAgB,EAAG,GAAA,CAAA;AAClE,QAAA;AACF,IAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"components.js","sources":["../../../server/src/controllers/components.ts"],"sourcesContent":["import _ from 'lodash';\nimport type { Context } from 'koa';\nimport type { UID } from '@strapi/types';\nimport { getService } from '../utils';\nimport { validateComponentInput, validateUpdateComponentInput } from './validation/component';\n\n/**\n * Components controller\n */\n\nexport default {\n /**\n * GET /components handler\n * Returns a list of available components\n * @param {Object} ctx - koa context\n */\n async getComponents(ctx: Context) {\n const componentService = getService('components');\n const componentUIDs = Object.keys(strapi.components) as UID.Component[];\n\n const data = componentUIDs.map((uid) => {\n return componentService.formatComponent(strapi.components[uid]);\n });\n\n ctx.send({ data });\n },\n\n /**\n * GET /components/:uid\n * Returns a specific component\n * @param {Object} ctx - koa context\n */\n async getComponent(ctx: Context) {\n const { uid } = ctx.params;\n\n const component = strapi.components[uid];\n\n if (!component) {\n return ctx.send({ error: 'component.notFound' }, 404);\n }\n\n const componentService = getService('components');\n\n ctx.send({ data: componentService.formatComponent(component) });\n },\n\n /**\n * POST /components\n * Creates a component and returns its infos\n * @param {Object} ctx - koa context\n */\n async createComponent(ctx: Context) {\n const body = ctx.request.body as any;\n\n try {\n await validateComponentInput(body);\n } catch (error) {\n return ctx.send({ error }, 400);\n }\n\n try {\n strapi.reload.isWatching = false;\n\n const componentService = getService('components');\n\n const component = await componentService.createComponent({\n component: body.component,\n components: body.components,\n });\n\n setImmediate(() => strapi.reload());\n\n ctx.send({ data: { uid: component.uid } }, 201);\n } catch (error) {\n strapi.log.error(error);\n ctx.send({ error: (error as any)?.message || 'Unknown error' }, 400);\n }\n },\n\n /**\n * PUT /components/:uid\n * Updates a component and return its infos\n * @param {Object} ctx - koa context - enhanced koa context\n */\n async updateComponent(ctx: Context) {\n const { uid } = ctx.params;\n const body = ctx.request.body as any;\n\n if (!_.has(strapi.components, uid)) {\n return ctx.send({ error: 'component.notFound' }, 404);\n }\n\n try {\n await validateUpdateComponentInput(body);\n } catch (error) {\n return ctx.send({ error }, 400);\n }\n\n try {\n strapi.reload.isWatching = false;\n\n const componentService = getService('components');\n\n const component = (await componentService.editComponent(uid, {\n component: body.component,\n components: body.components,\n })) as any;\n\n setImmediate(() => strapi.reload());\n\n ctx.send({ data: { uid: component.uid } });\n } catch (error) {\n strapi.log.error(error);\n\n ctx.send({ error: (error as any)?.message || 'Unknown error' }, 400);\n }\n },\n\n /**\n * DELETE /components/:uid\n * Deletes a components and returns its old infos\n * @param {Object} ctx - koa context\n */\n async deleteComponent(ctx: Context) {\n const { uid } = ctx.params;\n\n if (!_.has(strapi.components, uid)) {\n return ctx.send({ error: 'component.notFound' }, 404);\n }\n\n try {\n strapi.reload.isWatching = false;\n\n const componentService = getService('components');\n\n const component = await componentService.deleteComponent(uid);\n\n setImmediate(() => strapi.reload());\n\n ctx.send({ data: { uid: component.uid } });\n } catch (error) {\n strapi.log.error(error);\n ctx.send({ error: (error as any)?.message || 'Unknown error' }, 400);\n }\n },\n};\n"],"names":["getComponents","ctx","componentService","getService","componentUIDs","Object","keys","strapi","components","data","map","uid","formatComponent","send","getComponent","params","component","error","createComponent","body","request","validateComponentInput","reload","isWatching","setImmediate","log","message","updateComponent","_","has","validateUpdateComponentInput","editComponent","deleteComponent"],"mappings":";;;;;;;;;;AAMA;;AAEC,IAED,iBAAe;AACb;;;;MAKA,MAAMA,eAAcC,GAAY,EAAA;AAC9B,QAAA,MAAMC,mBAAmBC,gBAAAA,CAAW,YAAA,CAAA;AACpC,QAAA,MAAMC,aAAAA,GAAgBC,MAAAA,CAAOC,IAAI,CAACC,OAAOC,UAAU,CAAA;AAEnD,QAAA,MAAMC,IAAAA,GAAOL,aAAAA,CAAcM,GAAG,CAAC,CAACC,GAAAA,GAAAA;AAC9B,YAAA,OAAOT,iBAAiBU,eAAe,CAACL,MAAAA,CAAOC,UAAU,CAACG,GAAAA,CAAI,CAAA;AAChE,QAAA,CAAA,CAAA;AAEAV,QAAAA,GAAAA,CAAIY,IAAI,CAAC;AAAEJ,YAAAA;AAAK,SAAA,CAAA;AAClB,IAAA,CAAA;AAEA;;;;MAKA,MAAMK,cAAab,GAAY,EAAA;AAC7B,QAAA,MAAM,EAAEU,GAAG,EAAE,GAAGV,IAAIc,MAAM;AAE1B,QAAA,MAAMC,SAAAA,GAAYT,MAAAA,CAAOC,UAAU,CAACG,GAAAA,CAAI;AAExC,QAAA,IAAI,CAACK,SAAAA,EAAW;YACd,OAAOf,GAAAA,CAAIY,IAAI,CAAC;gBAAEI,KAAAA,EAAO;aAAqB,EAAG,GAAA,CAAA;AACnD,QAAA;AAEA,QAAA,MAAMf,mBAAmBC,gBAAAA,CAAW,YAAA,CAAA;AAEpCF,QAAAA,GAAAA,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;;;;MAKA,MAAMM,iBAAgB/B,GAAY,EAAA;AAChC,QAAA,MAAM,EAAEU,GAAG,EAAE,GAAGV,IAAIc,MAAM;AAE1B,QAAA,IAAI,CAACa,kBAAAA,CAAEC,GAAG,CAACtB,MAAAA,CAAOC,UAAU,EAAEG,GAAAA,CAAAA,EAAM;YAClC,OAAOV,GAAAA,CAAIY,IAAI,CAAC;gBAAEI,KAAAA,EAAO;aAAqB,EAAG,GAAA,CAAA;AACnD,QAAA;QAEA,IAAI;YACFV,MAAAA,CAAOe,MAAM,CAACC,UAAU,GAAG,KAAA;AAE3B,YAAA,MAAMrB,mBAAmBC,gBAAAA,CAAW,YAAA,CAAA;AAEpC,YAAA,MAAMa,SAAAA,GAAY,MAAMd,gBAAAA,CAAiB8B,eAAe,CAACrB,GAAAA,CAAAA;YAEzDa,YAAAA,CAAa,IAAMjB,OAAOe,MAAM,EAAA,CAAA;AAEhCrB,YAAAA,GAAAA,CAAIY,IAAI,CAAC;gBAAEJ,IAAAA,EAAM;AAAEE,oBAAAA,GAAAA,EAAKK,UAAUL;AAAI;AAAE,aAAA,CAAA;AAC1C,QAAA,CAAA,CAAE,OAAOM,KAAAA,EAAO;YACdV,MAAAA,CAAOkB,GAAG,CAACR,KAAK,CAACA,KAAAA,CAAAA;AACjBhB,YAAAA,GAAAA,CAAIY,IAAI,CAAC;gBAAEI,KAAAA,EAAQA,OAAeS,OAAAA,IAAW;aAAgB,EAAG,GAAA,CAAA;AAClE,QAAA;AACF,IAAA;AACF,CAAA;;;;"}
@@ -5,6 +5,10 @@ var index = require('../utils/index.js');
5
5
  var contentType = require('./validation/content-type.js');
6
6
  var contentTypes$1 = require('../services/content-types.js');
7
7
 
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var ___default = /*#__PURE__*/_interopDefault(_);
11
+
8
12
  /**
9
13
  * Telemetry uses a bounded HTTP timeout (~1s in the metrics sender); cap how long we defer
10
14
  * dev reload so a stuck client cannot block restart indefinitely.
@@ -33,7 +37,7 @@ var contentTypes = {
33
37
  }, 400);
34
38
  }
35
39
  const contentTypeService = index.getService('content-types');
36
- const contentTypes = Object.keys(strapi.contentTypes).filter((uid)=>!kind || _.get(strapi.contentTypes[uid], 'kind', 'collectionType') === kind).map((uid)=>contentTypeService.formatContentType(strapi.contentTypes[uid]));
40
+ const contentTypes = Object.keys(strapi.contentTypes).filter((uid)=>!kind || ___default.default.get(strapi.contentTypes[uid], 'kind', 'collectionType') === kind).map((uid)=>contentTypeService.formatContentType(strapi.contentTypes[uid]));
37
41
  ctx.send({
38
42
  data: contentTypes
39
43
  });
@@ -77,7 +81,7 @@ var contentTypes = {
77
81
  kind: contentType.kind
78
82
  }
79
83
  };
80
- const telemetryPromise = _.isEmpty(strapi.apis) ? strapi.telemetry.send('didCreateFirstContentType', metricsPayload) : strapi.telemetry.send('didCreateContentType', metricsPayload);
84
+ const telemetryPromise = ___default.default.isEmpty(strapi.apis) ? strapi.telemetry.send('didCreateFirstContentType', metricsPayload) : strapi.telemetry.send('didCreateContentType', metricsPayload);
81
85
  scheduleReloadAfterOutboundTelemetry(telemetryPromise);
82
86
  ctx.send({
83
87
  data: {
@@ -99,7 +103,7 @@ var contentTypes = {
99
103
  async updateContentType (ctx) {
100
104
  const { uid } = ctx.params;
101
105
  const body = ctx.request.body;
102
- if (!_.has(strapi.contentTypes, uid)) {
106
+ if (!___default.default.has(strapi.contentTypes, uid)) {
103
107
  return ctx.send({
104
108
  error: 'contentType.notFound'
105
109
  }, 404);
@@ -133,7 +137,7 @@ var contentTypes = {
133
137
  },
134
138
  async deleteContentType (ctx) {
135
139
  const { uid } = ctx.params;
136
- if (!_.has(strapi.contentTypes, uid)) {
140
+ if (!___default.default.has(strapi.contentTypes, uid)) {
137
141
  return ctx.send({
138
142
  error: 'contentType.notFound'
139
143
  }, 404);