@ai-stack/payloadcms 3.2.16-beta → 3.2.17-beta
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.
- package/README.md +79 -0
- package/dist/ai/analyse.d.ts +0 -1
- package/dist/ai/models/anthropic/generateRichText.d.ts +0 -1
- package/dist/ai/models/anthropic/generateRichText.js +7 -8
- package/dist/ai/models/anthropic/generateRichText.js.map +1 -1
- package/dist/ai/models/anthropic/index.d.ts +0 -1
- package/dist/ai/models/anthropic/index.js +54 -3
- package/dist/ai/models/anthropic/index.js.map +1 -1
- package/dist/ai/models/elevenLabs/generateVoice.d.ts +1 -2
- package/dist/ai/models/elevenLabs/index.d.ts +0 -1
- package/dist/ai/models/elevenLabs/index.js +5 -2
- package/dist/ai/models/elevenLabs/index.js.map +1 -1
- package/dist/ai/models/elevenLabs/voices.d.ts +6 -2
- package/dist/ai/models/elevenLabs/voices.js.map +1 -1
- package/dist/ai/models/index.d.ts +0 -1
- package/dist/ai/models/openai/generateImage.d.ts +1 -2
- package/dist/ai/models/openai/generateImage.js +6 -4
- package/dist/ai/models/openai/generateImage.js.map +1 -1
- package/dist/ai/models/openai/generateRichText.d.ts +0 -1
- package/dist/ai/models/openai/generateRichText.js +9 -12
- package/dist/ai/models/openai/generateRichText.js.map +1 -1
- package/dist/ai/models/openai/generateVoice.d.ts +1 -2
- package/dist/ai/models/openai/index.d.ts +0 -1
- package/dist/ai/models/openai/index.js +63 -4
- package/dist/ai/models/openai/index.js.map +1 -1
- package/dist/ai/models/openai/openai.d.ts +0 -1
- package/dist/ai/models/openai/openai.js +1 -2
- package/dist/ai/models/openai/openai.js.map +1 -1
- package/dist/ai/prompts.d.ts +2 -23
- package/dist/ai/prompts.js +2 -2
- package/dist/ai/prompts.js.map +1 -1
- package/dist/ai/schemas/lexicalJsonSchema.d.ts +5 -4
- package/dist/ai/schemas/lexicalJsonSchema.js +3 -1
- package/dist/ai/schemas/lexicalJsonSchema.js.map +1 -1
- package/dist/ai/utils/editImagesWithOpenAI.d.ts +0 -1
- package/dist/ai/utils/filterEditorSchemaByNodes.d.ts +19 -29
- package/dist/ai/utils/filterEditorSchemaByNodes.js +4 -2
- package/dist/ai/utils/filterEditorSchemaByNodes.js.map +1 -1
- package/dist/ai/utils/generateFileNameByPrompt.d.ts +1 -2
- package/dist/ai/utils/generateFileNameByPrompt.js.map +1 -1
- package/dist/ai/utils/isObjectSchema.d.ts +0 -1
- package/dist/ai/utils/systemGenerate.d.ts +0 -1
- package/dist/collections/Instructions.d.ts +0 -1
- package/dist/collections/Instructions.js +2 -2
- package/dist/collections/Instructions.js.map +1 -1
- package/dist/defaults.d.ts +0 -1
- package/dist/endpoints/fetchFields.d.ts +2 -3
- package/dist/endpoints/fetchFields.js +7 -3
- package/dist/endpoints/fetchFields.js.map +1 -1
- package/dist/endpoints/index.d.ts +0 -1
- package/dist/endpoints/index.js +111 -31
- package/dist/endpoints/index.js.map +1 -1
- package/dist/exports/client.d.ts +1 -1
- package/dist/exports/client.js +1 -0
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/fields.d.ts +0 -1
- package/dist/exports/types.d.ts +2 -3
- package/dist/exports/types.js.map +1 -1
- package/dist/fields/ComposeField/ComposeField.d.ts +10 -2
- package/dist/fields/ComposeField/ComposeField.js +13 -5
- package/dist/fields/ComposeField/ComposeField.js.map +1 -1
- package/dist/fields/LexicalEditor/ComposeFeatureComponent.d.ts +2 -2
- package/dist/fields/LexicalEditor/feature.client.d.ts +2 -3
- package/dist/fields/LexicalEditor/feature.server.d.ts +0 -1
- package/dist/fields/PromptEditorField/PromptEditorField.d.ts +0 -1
- package/dist/fields/PromptEditorField/PromptEditorField.js +1 -1
- package/dist/fields/PromptEditorField/PromptEditorField.js.map +1 -1
- package/dist/fields/PromptEditorField/defaultStyle.d.ts +0 -1
- package/dist/fields/SelectField/SelectField.d.ts +2 -2
- package/dist/fields/SelectField/SelectField.js +15 -4
- package/dist/fields/SelectField/SelectField.js.map +1 -1
- package/dist/index.d.ts +2 -6
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +5 -2
- package/dist/init.js +8 -7
- package/dist/init.js.map +1 -1
- package/dist/libraries/handlebars/asyncHandlebars.d.ts +0 -1
- package/dist/libraries/handlebars/helpers.d.ts +1 -2
- package/dist/libraries/handlebars/helpers.js +6 -1
- package/dist/libraries/handlebars/helpers.js.map +1 -1
- package/dist/libraries/handlebars/helpersMap.d.ts +0 -1
- package/dist/libraries/handlebars/replacePlaceholders.d.ts +0 -1
- package/dist/plugin.d.ts +0 -1
- package/dist/plugin.js +7 -5
- package/dist/plugin.js.map +1 -1
- package/dist/providers/FieldProvider/FieldProvider.d.ts +1 -2
- package/dist/providers/FieldProvider/useFieldProps.d.ts +3 -4
- package/dist/providers/InstructionsProvider/InstructionsProvider.d.ts +2 -12
- package/dist/providers/InstructionsProvider/InstructionsProvider.js +7 -9
- package/dist/providers/InstructionsProvider/InstructionsProvider.js.map +1 -1
- package/dist/providers/InstructionsProvider/context.d.ts +16 -0
- package/dist/providers/InstructionsProvider/context.js +13 -0
- package/dist/providers/InstructionsProvider/context.js.map +1 -0
- package/dist/providers/InstructionsProvider/useInstructions.d.ts +0 -1
- package/dist/providers/InstructionsProvider/useInstructions.js +29 -15
- package/dist/providers/InstructionsProvider/useInstructions.js.map +1 -1
- package/dist/translations/index.d.ts +0 -1
- package/dist/types/handlebars-async-helpers.d.js +2 -0
- package/dist/types/handlebars-async-helpers.d.js.map +1 -0
- package/dist/types/handlebars-dist-handlebars.d.js +2 -0
- package/dist/types/handlebars-dist-handlebars.d.js.map +1 -0
- package/dist/types/react-mentions.d.js +2 -0
- package/dist/types/react-mentions.d.js.map +1 -0
- package/dist/types.d.ts +45 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/Compose/Compose.d.ts +0 -1
- package/dist/ui/Compose/Compose.js +61 -25
- package/dist/ui/Compose/Compose.js.map +1 -1
- package/dist/ui/Compose/UndoRedoActions.d.ts +2 -2
- package/dist/ui/Compose/hooks/menu/Item.d.ts +3 -2
- package/dist/ui/Compose/hooks/menu/Item.js +2 -2
- package/dist/ui/Compose/hooks/menu/Item.js.map +1 -1
- package/dist/ui/Compose/hooks/menu/TranslateMenu.d.ts +8 -5
- package/dist/ui/Compose/hooks/menu/TranslateMenu.js +1 -1
- package/dist/ui/Compose/hooks/menu/TranslateMenu.js.map +1 -1
- package/dist/ui/Compose/hooks/menu/items.d.ts +8 -9
- package/dist/ui/Compose/hooks/menu/itemsMap.d.ts +0 -1
- package/dist/ui/Compose/hooks/menu/useMenu.d.ts +7 -7
- package/dist/ui/Compose/hooks/menu/useMenu.js +12 -9
- package/dist/ui/Compose/hooks/menu/useMenu.js.map +1 -1
- package/dist/ui/Compose/hooks/useGenerate.d.ts +0 -1
- package/dist/ui/Compose/hooks/useGenerate.js +41 -20
- package/dist/ui/Compose/hooks/useGenerate.js.map +1 -1
- package/dist/ui/Compose/hooks/useHistory.d.ts +0 -1
- package/dist/ui/Compose/hooks/useHistory.js +2 -2
- package/dist/ui/Compose/hooks/useHistory.js.map +1 -1
- package/dist/ui/Icons/Icons.d.ts +34 -34
- package/dist/ui/Icons/Icons.js +1 -1
- package/dist/ui/Icons/Icons.js.map +1 -1
- package/dist/ui/Icons/LottieAnimation.d.ts +3 -3
- package/dist/ui/Icons/LottieAnimation.js +1 -0
- package/dist/ui/Icons/LottieAnimation.js.map +1 -1
- package/dist/utilities/editorSchemaValidator.d.ts +1 -2
- package/dist/utilities/editorSchemaValidator.js.map +1 -1
- package/dist/utilities/extractImageData.d.ts +0 -1
- package/dist/utilities/extractPromptAttachments.d.ts +2 -0
- package/dist/utilities/extractPromptAttachments.js +32 -0
- package/dist/utilities/extractPromptAttachments.js.map +1 -0
- package/dist/utilities/getFieldBySchemaPath.d.ts +0 -1
- package/dist/utilities/getFieldBySchemaPath.js +12 -4
- package/dist/utilities/getFieldBySchemaPath.js.map +1 -1
- package/dist/utilities/getFieldInfo.d.ts +1 -2
- package/dist/utilities/getGenerationModels.d.ts +1 -2
- package/dist/utilities/isPluginActivated.d.ts +0 -1
- package/dist/utilities/isPluginActivated.js +1 -1
- package/dist/utilities/isPluginActivated.js.map +1 -1
- package/dist/utilities/lexicalToHTML.d.ts +0 -1
- package/dist/utilities/setSafeLexicalState.d.ts +1 -2
- package/dist/utilities/setSafeLexicalState.js.map +1 -1
- package/dist/utilities/updateFieldsConfig.d.ts +0 -1
- package/dist/utilities/updateFieldsConfig.js +10 -3
- package/dist/utilities/updateFieldsConfig.js.map +1 -1
- package/package.json +104 -65
- package/dist/ai/analyse.d.ts.map +0 -1
- package/dist/ai/models/anthropic/generateRichText.d.ts.map +0 -1
- package/dist/ai/models/anthropic/index.d.ts.map +0 -1
- package/dist/ai/models/elevenLabs/generateVoice.d.ts.map +0 -1
- package/dist/ai/models/elevenLabs/index.d.ts.map +0 -1
- package/dist/ai/models/elevenLabs/voices.d.ts.map +0 -1
- package/dist/ai/models/index.d.ts.map +0 -1
- package/dist/ai/models/openai/generateImage.d.ts.map +0 -1
- package/dist/ai/models/openai/generateRichText.d.ts.map +0 -1
- package/dist/ai/models/openai/generateVoice.d.ts.map +0 -1
- package/dist/ai/models/openai/index.d.ts.map +0 -1
- package/dist/ai/models/openai/openai.d.ts.map +0 -1
- package/dist/ai/prompts.d.ts.map +0 -1
- package/dist/ai/schemas/lexicalJsonSchema.d.ts.map +0 -1
- package/dist/ai/utils/editImagesWithOpenAI.d.ts.map +0 -1
- package/dist/ai/utils/filterEditorSchemaByNodes.d.ts.map +0 -1
- package/dist/ai/utils/generateFileNameByPrompt.d.ts.map +0 -1
- package/dist/ai/utils/isObjectSchema.d.ts.map +0 -1
- package/dist/ai/utils/systemGenerate.d.ts.map +0 -1
- package/dist/collections/Instructions.d.ts.map +0 -1
- package/dist/defaults.d.ts.map +0 -1
- package/dist/endpoints/fetchFields.d.ts.map +0 -1
- package/dist/endpoints/index.d.ts.map +0 -1
- package/dist/exports/client.d.ts.map +0 -1
- package/dist/exports/fields.d.ts.map +0 -1
- package/dist/exports/types.d.ts.map +0 -1
- package/dist/fields/ComposeField/ComposeField.d.ts.map +0 -1
- package/dist/fields/LexicalEditor/ComposeFeatureComponent.d.ts.map +0 -1
- package/dist/fields/LexicalEditor/feature.client.d.ts.map +0 -1
- package/dist/fields/LexicalEditor/feature.server.d.ts.map +0 -1
- package/dist/fields/PromptEditorField/PromptEditorField.d.ts.map +0 -1
- package/dist/fields/PromptEditorField/defaultStyle.d.ts.map +0 -1
- package/dist/fields/SelectField/SelectField.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/init.d.ts.map +0 -1
- package/dist/libraries/handlebars/asyncHandlebars.d.ts.map +0 -1
- package/dist/libraries/handlebars/helpers.d.ts.map +0 -1
- package/dist/libraries/handlebars/helpersMap.d.ts.map +0 -1
- package/dist/libraries/handlebars/replacePlaceholders.d.ts.map +0 -1
- package/dist/plugin.d.ts.map +0 -1
- package/dist/providers/FieldProvider/FieldProvider.d.ts.map +0 -1
- package/dist/providers/FieldProvider/useFieldProps.d.ts.map +0 -1
- package/dist/providers/InstructionsProvider/InstructionsProvider.d.ts.map +0 -1
- package/dist/providers/InstructionsProvider/useInstructions.d.ts.map +0 -1
- package/dist/translations/index.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/ui/Compose/Compose.d.ts.map +0 -1
- package/dist/ui/Compose/UndoRedoActions.d.ts.map +0 -1
- package/dist/ui/Compose/hooks/menu/Item.d.ts.map +0 -1
- package/dist/ui/Compose/hooks/menu/TranslateMenu.d.ts.map +0 -1
- package/dist/ui/Compose/hooks/menu/items.d.ts.map +0 -1
- package/dist/ui/Compose/hooks/menu/itemsMap.d.ts.map +0 -1
- package/dist/ui/Compose/hooks/menu/useMenu.d.ts.map +0 -1
- package/dist/ui/Compose/hooks/useGenerate.d.ts.map +0 -1
- package/dist/ui/Compose/hooks/useHistory.d.ts.map +0 -1
- package/dist/ui/Icons/Icons.d.ts.map +0 -1
- package/dist/ui/Icons/LottieAnimation.d.ts.map +0 -1
- package/dist/utilities/editorSchemaValidator.d.ts.map +0 -1
- package/dist/utilities/extractImageData.d.ts.map +0 -1
- package/dist/utilities/getFieldBySchemaPath.d.ts.map +0 -1
- package/dist/utilities/getFieldInfo.d.ts.map +0 -1
- package/dist/utilities/getGenerationModels.d.ts.map +0 -1
- package/dist/utilities/isPluginActivated.d.ts.map +0 -1
- package/dist/utilities/lexicalToHTML.d.ts.map +0 -1
- package/dist/utilities/setSafeLexicalState.d.ts.map +0 -1
- package/dist/utilities/updateFieldsConfig.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/Icons/Icons.tsx"],"sourcesContent":["import React from 'react'\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/Icons/Icons.tsx"],"sourcesContent":["import React from 'react'\n\nimport styles from './icons.module.css'\nimport LottieAnimation from './LottieAnimation.js'\n\nexport const PluginIcon = ({\n color = 'white',\n isLoading,\n}: {\n color?: string\n isLoading?: boolean\n}) => {\n return (\n <span className={styles.actions_icon}>\n <LottieAnimation isLoading={isLoading} />\n </span>\n )\n}\n\nexport const TuneIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M450-130v-220h60v80h320v60H510v80h-60Zm-320-80v-60h220v60H130Zm160-160v-80H130v-60h160v-80h60v220h-60Zm160-80v-60h380v60H450Zm160-160v-220h60v80h160v60H670v80h-60Zm-480-80v-60h380v60H130Z\" />\n </svg>\n </span>\n )\n}\n\nexport const LocalLibraryIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M480-115.38q-67.38-54.93-148.85-86.7Q249.69-233.85 160-240v-373.85q91.77 5.39 174.38 43.81Q417-531.62 480-474.92q63-56.7 145.62-95.12 82.61-38.42 174.38-43.81V-240q-89.92 6.15-171.27 37.92-81.35 31.77-148.73 86.7Zm0-50.16q63-46.23 134-74.56 71-28.33 146-37.44v-291.38q-78.38 13-149.65 50.57-71.27 37.58-130.35 96.66-59.08-59.08-130.35-96.66-71.27-37.57-149.65-50.57v291.38q75 9.11 146 37.44t134 74.56Zm0-451.38q-53.31 0-91.27-37.96-37.96-37.97-37.96-91.27 0-53.31 37.96-91.27 37.96-37.96 91.27-37.96 53.31 0 91.27 37.96 37.96 37.96 37.96 91.27 0 53.3-37.96 91.27-37.96 37.96-91.27 37.96Zm.03-40q36.82 0 63.01-26.22 26.19-26.22 26.19-63.04t-26.22-63.01q-26.22-26.19-63.04-26.19t-63.01 26.21q-26.19 26.22-26.19 63.04t26.22 63.01q26.22 26.2 63.04 26.2Zm-.03-89.23Zm0 324.46Z\" />\n </svg>\n </span>\n )\n}\n\nexport const SpellCheckIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M564-93.85 407.85-250 450-292.15l114 114 226.77-226.77 42.15 42.15L564-93.85ZM135.39-320l191.69-520h69.38l190.92 520h-68.92l-49.07-142H250.92l-49.84 142h-65.69ZM272-518h178.31L362-765.54h-3.23L272-518Z\" />\n </svg>\n </span>\n )\n}\n\nexport const TranslateIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m476-100 178.15-460h62.46l178.16 460h-63.62l-45.3-122H584.92l-45.31 122H476ZM160.38-217.69l-42.15-42.16 198.92-199.3q-34.61-35-65.8-83.08Q220.15-590.31 200-640h63.61q17.31 36.31 42.12 72.62 24.81 36.3 53.58 66.07 42.61-43 80.61-104.42T493.62-720H67.69v-60H330v-64.61h60V-780h262.31v60h-97.93q-19.46 67.38-62.03 140.88-42.58 73.5-90.89 121.2l98.69 101.07-22.69 61.62-118.15-121.16-198.93 198.7Zm443.77-57.39h162.46l-81.23-218.23-81.23 218.23Z\" />\n </svg>\n </span>\n )\n}\n\nexport const DocsAddOnIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M650-131v-120H530v-60h120v-120h60v120h120v60H710v120h-60ZM170-250v-60h281.85q-1.85 15.8-1.35 30.09t2.35 29.91H170Zm0-160v-60h379.08q-17.23 12.15-31.5 27.15-14.27 15-25.96 32.85H170Zm0-160v-60h580v60H170Zm0-160v-60h580v60H170Z\" />\n </svg>\n </span>\n )\n}\n\nexport const SummarizeIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M320-603.85q15.08 0 25.62-10.53 10.53-10.54 10.53-25.62 0-15.08-10.53-25.62-10.54-10.53-25.62-10.53-15.08 0-25.62 10.53-10.53 10.54-10.53 25.62 0 15.08 10.53 25.62 10.54 10.53 25.62 10.53Zm0 160q15.08 0 25.62-10.53 10.53-10.54 10.53-25.62 0-15.08-10.53-25.62-10.54-10.53-25.62-10.53-15.08 0-25.62 10.53-10.53 10.54-10.53 25.62 0 15.08 10.53 25.62 10.54 10.53 25.62 10.53Zm0 160q15.08 0 25.62-10.53 10.53-10.54 10.53-25.62 0-15.08-10.53-25.62-10.54-10.53-25.62-10.53-15.08 0-25.62 10.53-10.53 10.54-10.53 25.62 0 15.08 10.53 25.62 10.54 10.53 25.62 10.53ZM212.31-140Q182-140 161-161q-21-21-21-51.31v-535.38Q140-778 161-799q21-21 51.31-21h419.23L820-631.54v419.23Q820-182 799-161q-21 21-51.31 21H212.31Zm0-60h535.38q5.39 0 8.85-3.46t3.46-8.85V-600H600v-160H212.31q-5.39 0-8.85 3.46t-3.46 8.85v535.38q0 5.39 3.46 8.85t8.85 3.46ZM200-760v160-160V-200v-560Z\" />\n </svg>\n </span>\n )\n}\n\nexport const SegmentIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M380-254.62v-59.99h440v59.99H380ZM380-450v-60h440v60H380ZM140-645.39v-59.99h680v59.99H140Z\" />\n </svg>\n </span>\n )\n}\n\nexport const StylusNoteIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m487.46-283.15 332.31-332.31q2.69-2.69 2.69-6.54t-2.69-6.54l-38.92-38.92q-2.7-2.69-6.54-2.69-3.85 0-6.54 2.69L435.46-335.15l52 52Zm-251 72.38q-89.23-5-134-39.69-44.77-34.69-44.77-98.16 0-60.76 51-98.57 51-37.81 141.77-45.81 43.62-3.77 65.43-15.77 21.8-12 21.8-33.23 0-29.46-29.5-44.96t-96.73-22.27l5.46-59.62q92.23 8.77 136.5 39.77 44.27 31 44.27 87.08 0 47.61-36.57 75.5-36.58 27.88-106.2 33.5-68.61 5.77-102.92 26.77t-34.31 57.61q0 37.31 28.58 55.51 28.58 18.19 92.65 22.34l-2.46 60Zm260.38 3.15L359.92-344.54l373.54-373.15q17.69-17.69 41.35-17.5 23.65.19 41.34 17.5L870-663.85q17.69 17.7 17.69 41.54 0 23.85-17.69 41.54L496.84-207.62ZM363.23-180q-13.54 3.23-23.84-7.08-10.31-10.31-7.08-23.84l27.61-133.62 136.92 136.92L363.23-180Z\" />\n </svg>\n </span>\n )\n}\n\nexport const EditNoteIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M180-400v-60h280v60H180Zm0-160v-60h440v60H180Zm0-160v-60h440v60H180Zm344.62 540v-105.69l217.15-216.16q7.46-7.46 16.11-10.5 8.65-3.03 17.3-3.03 9.43 0 18.25 3.53 8.82 3.54 16.03 10.62l37 37.38q6.46 7.47 10 16.16Q860-439 860-430.31t-3.23 17.69q-3.23 9-10.31 16.46L630.31-180H524.62Zm287.69-250.31-37-37.38 37 37.38Zm-240 202.62h38l129.84-130.47-18.38-19-18.62-18.76-130.84 130.23v38Zm149.46-149.47-18.62-18.76 37 37.76-18.38-19Z\" />\n </svg>\n </span>\n )\n}\n\nexport const ArrowIcon = ({ color = 'white', size = 24 }) => {\n return (\n <span className={styles.icon}>\n <svg height={size} viewBox=\"0 -960 960 960\" width={size} xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m531.69-480-184-184L376-692.31 588.31-480 376-267.69 347.69-296l184-184Z\" />\n </svg>\n </span>\n )\n}\n"],"names":["React","styles","LottieAnimation","PluginIcon","color","isLoading","span","className","actions_icon","TuneIcon","size","icon","svg","height","viewBox","width","xmlns","path","d","LocalLibraryIcon","SpellCheckIcon","TranslateIcon","DocsAddOnIcon","SummarizeIcon","SegmentIcon","StylusNoteIcon","EditNoteIcon","ArrowIcon"],"mappings":";AAAA,OAAOA,WAAW,QAAO;AAEzB,OAAOC,YAAY,qBAAoB;AACvC,OAAOC,qBAAqB,uBAAsB;AAElD,OAAO,MAAMC,aAAa,CAAC,EACzBC,QAAQ,OAAO,EACfC,SAAS,EAIV;IACC,qBACE,KAACC;QAAKC,WAAWN,OAAOO,YAAY;kBAClC,cAAA,KAACN;YAAgBG,WAAWA;;;AAGlC,EAAC;AAED,OAAO,MAAMI,WAAW,CAAC,EAAEL,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IACrD,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAMC,mBAAmB,CAAC,EAAEf,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IAC7D,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAME,iBAAiB,CAAC,EAAEhB,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IAC3D,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAMG,gBAAgB,CAAC,EAAEjB,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IAC1D,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAMI,gBAAgB,CAAC,EAAElB,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IAC1D,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAMK,gBAAgB,CAAC,EAAEnB,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IAC1D,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAMM,cAAc,CAAC,EAAEpB,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IACxD,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAMO,iBAAiB,CAAC,EAAErB,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IAC3D,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAMQ,eAAe,CAAC,EAAEtB,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IACzD,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC;AAED,OAAO,MAAMS,YAAY,CAAC,EAAEvB,QAAQ,OAAO,EAAEM,OAAO,EAAE,EAAE;IACtD,qBACE,KAACJ;QAAKC,WAAWN,OAAOU,IAAI;kBAC1B,cAAA,KAACC;YAAIC,QAAQH;YAAMI,SAAQ;YAAiBC,OAAOL;YAAMM,OAAM;sBAC7D,cAAA,KAACC;gBAAKC,GAAE;;;;AAIhB,EAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
declare const LottieAnimation: ({ isLoading }: {
|
|
2
|
-
isLoading?: boolean;
|
|
3
|
-
}) =>
|
|
3
|
+
isLoading?: boolean | undefined;
|
|
4
|
+
}) => React.JSX.Element;
|
|
4
5
|
export default LottieAnimation;
|
|
5
|
-
//# sourceMappingURL=LottieAnimation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/Icons/LottieAnimation.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../src/ui/Icons/LottieAnimation.tsx"],"sourcesContent":["// @ts-nocheck\n\nimport React, { useEffect, useRef, useState } from 'react'\n\nimport styles from './icons.module.css'\n\nconst LottieAnimation = ({ isLoading = false }) => {\n const svgRef = useRef(null)\n const [animations, setAnimations] = useState([])\n\n useEffect(() => {\n const svg = svgRef.current\n if (!svg) return\n\n const animateTransform = (element, keyframes) => {\n const animation = element.animate(keyframes, {\n direction: 'alternate',\n duration: 1000,\n easing: 'ease-in-out',\n iterations: Infinity,\n })\n return animation\n }\n\n // Animate Group 2 (Rectangle)\n const rectangle = svg.querySelector('#group2')\n const rectangleAnimation = animateTransform(rectangle, [\n { transform: 'translate(0, 0) scale(1)' },\n { transform: 'translate(0, 0) scale(2.54)' },\n { transform: 'translate(0, 0) scale(1)' },\n ])\n\n // Animate Group 3 (Triangle)\n const triangle = svg.querySelector('#group3')\n const triangleAnimation = animateTransform(triangle, [\n { transform: 'translate(-69.5px, 77.5px) scale(1)' },\n { transform: 'translate(-70px, 73px) scale(0.36)' },\n { transform: 'translate(-69.5px, 77.5px) scale(1)' },\n ])\n\n setAnimations([rectangleAnimation, triangleAnimation])\n\n // Clean up animations on unmount\n return () => {\n rectangleAnimation.cancel()\n triangleAnimation.cancel()\n }\n }, [])\n\n useEffect(() => {\n if (isLoading) {\n animations.forEach((animation) => animation.play())\n } else {\n animations.forEach((animation) => animation.pause())\n }\n }, [isLoading, animations])\n\n return (\n <span\n style={{\n left: '3px',\n position: 'relative',\n top: '-6px',\n }}\n >\n <svg height=\"41\" ref={svgRef} viewBox=\"-250 -250 500 500\" width=\"41\">\n <g id=\"group2\">\n <rect className={styles.color_fill} height=\"41\" width=\"41\" x=\"-20.5\" y=\"-20.5\" />\n </g>\n <g id=\"group3\">\n <path className={styles.color_fill} d=\"M48.5 57.5L48.5 -57.5L-49.5 -1.093L48.5 57.5Z\" />\n </g>\n </svg>\n </span>\n )\n}\n\nexport default LottieAnimation\n"],"names":["React","useEffect","useRef","useState","styles","LottieAnimation","isLoading","svgRef","animations","setAnimations","svg","current","animateTransform","element","keyframes","animation","animate","direction","duration","easing","iterations","Infinity","rectangle","querySelector","rectangleAnimation","transform","triangle","triangleAnimation","cancel","forEach","play","pause","span","style","left","position","top","height","ref","viewBox","width","g","id","rect","className","color_fill","x","y","path","d"],"mappings":"AAAA,cAAc;;AAEd,OAAOA,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAE1D,OAAOC,YAAY,qBAAoB;AAEvC,MAAMC,kBAAkB,CAAC,EAAEC,YAAY,KAAK,EAAE;IAC5C,MAAMC,SAASL,OAAO;IACtB,MAAM,CAACM,YAAYC,cAAc,GAAGN,SAAS,EAAE;IAE/CF,UAAU;QACR,MAAMS,MAAMH,OAAOI,OAAO;QAC1B,IAAI,CAACD,KAAK;QAEV,MAAME,mBAAmB,CAACC,SAASC;YACjC,MAAMC,YAAYF,QAAQG,OAAO,CAACF,WAAW;gBAC3CG,WAAW;gBACXC,UAAU;gBACVC,QAAQ;gBACRC,YAAYC;YACd;YACA,OAAON;QACT;QAEA,8BAA8B;QAC9B,MAAMO,YAAYZ,IAAIa,aAAa,CAAC;QACpC,MAAMC,qBAAqBZ,iBAAiBU,WAAW;YACrD;gBAAEG,WAAW;YAA2B;YACxC;gBAAEA,WAAW;YAA8B;YAC3C;gBAAEA,WAAW;YAA2B;SACzC;QAED,6BAA6B;QAC7B,MAAMC,WAAWhB,IAAIa,aAAa,CAAC;QACnC,MAAMI,oBAAoBf,iBAAiBc,UAAU;YACnD;gBAAED,WAAW;YAAsC;YACnD;gBAAEA,WAAW;YAAqC;YAClD;gBAAEA,WAAW;YAAsC;SACpD;QAEDhB,cAAc;YAACe;YAAoBG;SAAkB;QAErD,iCAAiC;QACjC,OAAO;YACLH,mBAAmBI,MAAM;YACzBD,kBAAkBC,MAAM;QAC1B;IACF,GAAG,EAAE;IAEL3B,UAAU;QACR,IAAIK,WAAW;YACbE,WAAWqB,OAAO,CAAC,CAACd,YAAcA,UAAUe,IAAI;QAClD,OAAO;YACLtB,WAAWqB,OAAO,CAAC,CAACd,YAAcA,UAAUgB,KAAK;QACnD;IACF,GAAG;QAACzB;QAAWE;KAAW;IAE1B,qBACE,KAACwB;QACCC,OAAO;YACLC,MAAM;YACNC,UAAU;YACVC,KAAK;QACP;kBAEA,cAAA,MAAC1B;YAAI2B,QAAO;YAAKC,KAAK/B;YAAQgC,SAAQ;YAAoBC,OAAM;;8BAC9D,KAACC;oBAAEC,IAAG;8BACJ,cAAA,KAACC;wBAAKC,WAAWxC,OAAOyC,UAAU;wBAAER,QAAO;wBAAKG,OAAM;wBAAKM,GAAE;wBAAQC,GAAE;;;8BAEzE,KAACN;oBAAEC,IAAG;8BACJ,cAAA,KAACM;wBAAKJ,WAAWxC,OAAOyC,UAAU;wBAAEI,GAAE;;;;;;AAKhD;AAEA,eAAe5C,gBAAe"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import ajvModule from 'ajv';
|
|
2
|
-
export declare const editorSchemaValidator: (schema:
|
|
3
|
-
//# sourceMappingURL=editorSchemaValidator.d.ts.map
|
|
2
|
+
export declare const editorSchemaValidator: (schema: unknown) => ajvModule.ValidateFunction<unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/editorSchemaValidator.ts"],"sourcesContent":["import ajvModule from 'ajv'\n\nexport const editorSchemaValidator = (schema) => {\n const modifiedSchema = JSON.parse(JSON.stringify(schema), function (key: string, value: any) {\n if (key === 'required' && Array.isArray(value)) {\n // Safely access properties from parent\n const parent = this as { properties?: Record<string, any> }\n const parentProperties = parent.properties\n\n if (parentProperties) {\n const requiredFields = ['type'] // type is always required\n\n // Check if this node has children property\n if ('children' in parentProperties) {\n requiredFields.push('children')\n }\n\n // Check if this node has text property\n if ('text' in parentProperties) {\n requiredFields.push('text')\n }\n\n const filteredRequired = value.filter((field) => requiredFields.includes(field))\n return filteredRequired.length ? filteredRequired : undefined\n }\n }\n return value\n })\n\n const Ajv = ajvModule.default\n const ajv = new Ajv()\n\n return ajv.compile(modifiedSchema)\n}\n"],"names":["ajvModule","editorSchemaValidator","schema","modifiedSchema","JSON","parse","stringify","key","value","Array","isArray","parent","parentProperties","properties","requiredFields","push","filteredRequired","filter","field","includes","length","undefined","Ajv","default","ajv","compile"],"mappings":"AAAA,OAAOA,eAAe,MAAK;AAE3B,OAAO,MAAMC,wBAAwB,CAACC;IACpC,MAAMC,iBAAiBC,KAAKC,KAAK,CAACD,KAAKE,SAAS,CAACJ,SAAS,SAAUK,GAAW,EAAEC,KAAU;QACzF,IAAID,QAAQ,cAAcE,MAAMC,OAAO,CAACF,QAAQ;YAC9C,uCAAuC;YACvC,MAAMG,SAAS,IAAI;YACnB,MAAMC,mBAAmBD,OAAOE,UAAU;YAE1C,IAAID,kBAAkB;gBACpB,MAAME,iBAAiB;oBAAC;iBAAO,CAAC,0BAA0B;;gBAE1D,2CAA2C;gBAC3C,IAAI,cAAcF,kBAAkB;oBAClCE,eAAeC,IAAI,CAAC;gBACtB;gBAEA,uCAAuC;gBACvC,IAAI,UAAUH,kBAAkB;oBAC9BE,eAAeC,IAAI,CAAC;gBACtB;gBAEA,MAAMC,mBAAmBR,MAAMS,MAAM,CAAC,CAACC,QAAUJ,eAAeK,QAAQ,CAACD;gBACzE,OAAOF,iBAAiBI,MAAM,GAAGJ,mBAAmBK;YACtD;QACF;QACA,OAAOb;IACT;IAEA,MAAMc,MAAMtB,UAAUuB,OAAO;IAC7B,MAAMC,MAAM,IAAIF;IAEhB,OAAOE,IAAIC,OAAO,CAACtB;AACrB,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/editorSchemaValidator.ts"],"sourcesContent":["import ajvModule from 'ajv'\n\nexport const editorSchemaValidator = (schema: unknown) => {\n const modifiedSchema = JSON.parse(JSON.stringify(schema), function (key: string, value: any) {\n if (key === 'required' && Array.isArray(value)) {\n // Safely access properties from parent\n const parent = this as { properties?: Record<string, any> }\n const parentProperties = parent.properties\n\n if (parentProperties) {\n const requiredFields = ['type'] // type is always required\n\n // Check if this node has children property\n if ('children' in parentProperties) {\n requiredFields.push('children')\n }\n\n // Check if this node has text property\n if ('text' in parentProperties) {\n requiredFields.push('text')\n }\n\n const filteredRequired = value.filter((field) => requiredFields.includes(field))\n return filteredRequired.length ? filteredRequired : undefined\n }\n }\n return value\n })\n\n const Ajv = ajvModule.default\n const ajv = new Ajv()\n\n return ajv.compile(modifiedSchema)\n}\n"],"names":["ajvModule","editorSchemaValidator","schema","modifiedSchema","JSON","parse","stringify","key","value","Array","isArray","parent","parentProperties","properties","requiredFields","push","filteredRequired","filter","field","includes","length","undefined","Ajv","default","ajv","compile"],"mappings":"AAAA,OAAOA,eAAe,MAAK;AAE3B,OAAO,MAAMC,wBAAwB,CAACC;IACpC,MAAMC,iBAAiBC,KAAKC,KAAK,CAACD,KAAKE,SAAS,CAACJ,SAAS,SAAUK,GAAW,EAAEC,KAAU;QACzF,IAAID,QAAQ,cAAcE,MAAMC,OAAO,CAACF,QAAQ;YAC9C,uCAAuC;YACvC,MAAMG,SAAS,IAAI;YACnB,MAAMC,mBAAmBD,OAAOE,UAAU;YAE1C,IAAID,kBAAkB;gBACpB,MAAME,iBAAiB;oBAAC;iBAAO,CAAC,0BAA0B;;gBAE1D,2CAA2C;gBAC3C,IAAI,cAAcF,kBAAkB;oBAClCE,eAAeC,IAAI,CAAC;gBACtB;gBAEA,uCAAuC;gBACvC,IAAI,UAAUH,kBAAkB;oBAC9BE,eAAeC,IAAI,CAAC;gBACtB;gBAEA,MAAMC,mBAAmBR,MAAMS,MAAM,CAAC,CAACC,QAAUJ,eAAeK,QAAQ,CAACD;gBACzE,OAAOF,iBAAiBI,MAAM,GAAGJ,mBAAmBK;YACtD;QACF;QACA,OAAOb;IACT;IAEA,MAAMc,MAAMtB,UAAUuB,OAAO;IAC7B,MAAMC,MAAM,IAAIF;IAEhB,OAAOE,IAAIC,OAAO,CAACtB;AACrB,EAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Converts prompt into messages, extracting images in the process
|
|
2
|
+
export function extractPromptAttachments(prompt) {
|
|
3
|
+
// Regex to match absolute HTTPS URLs with image extensions
|
|
4
|
+
const imageUrlRegex = /https:\/\/\S+\.(?:png|jpe?g|webp)/gi;
|
|
5
|
+
const messages = [];
|
|
6
|
+
const imageUrls = [];
|
|
7
|
+
// Find all image URLs in the prompt
|
|
8
|
+
let match;
|
|
9
|
+
while((match = imageUrlRegex.exec(prompt)) !== null){
|
|
10
|
+
imageUrls.push(match[0]);
|
|
11
|
+
}
|
|
12
|
+
// Create image messages first
|
|
13
|
+
for (const imageUrl of imageUrls){
|
|
14
|
+
messages.push({
|
|
15
|
+
content: [
|
|
16
|
+
{
|
|
17
|
+
type: 'image',
|
|
18
|
+
image: new URL(imageUrl)
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
role: 'user'
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
// Add the text prompt as a regular user message if there's any text left
|
|
25
|
+
messages.push({
|
|
26
|
+
content: prompt,
|
|
27
|
+
role: 'user'
|
|
28
|
+
});
|
|
29
|
+
return messages;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=extractPromptAttachments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/extractPromptAttachments.ts"],"sourcesContent":["import type { UserModelMessage } from \"ai\"\n\n// Converts prompt into messages, extracting images in the process\nexport function extractPromptAttachments(prompt: string): UserModelMessage[] {\n // Regex to match absolute HTTPS URLs with image extensions\n const imageUrlRegex = /https:\\/\\/\\S+\\.(?:png|jpe?g|webp)/gi\n \n const messages: UserModelMessage[] = []\n const imageUrls: string[] = []\n \n // Find all image URLs in the prompt\n let match\n while ((match = imageUrlRegex.exec(prompt)) !== null) {\n imageUrls.push(match[0])\n }\n \n // Create image messages first\n for (const imageUrl of imageUrls) {\n messages.push({\n content: [\n {\n type: 'image',\n image: new URL(imageUrl)\n }\n ],\n role: 'user'\n })\n }\n \n // Add the text prompt as a regular user message if there's any text left\n messages.push({\n content: prompt,\n role: 'user'\n })\n\n return messages\n}"],"names":["extractPromptAttachments","prompt","imageUrlRegex","messages","imageUrls","match","exec","push","imageUrl","content","type","image","URL","role"],"mappings":"AAEA,kEAAkE;AAClE,OAAO,SAASA,yBAAyBC,MAAc;IACrD,2DAA2D;IAC3D,MAAMC,gBAAgB;IAEtB,MAAMC,WAA+B,EAAE;IACvC,MAAMC,YAAsB,EAAE;IAE9B,oCAAoC;IACpC,IAAIC;IACJ,MAAO,AAACA,CAAAA,QAAQH,cAAcI,IAAI,CAACL,OAAM,MAAO,KAAM;QACpDG,UAAUG,IAAI,CAACF,KAAK,CAAC,EAAE;IACzB;IAEA,8BAA8B;IAC9B,KAAK,MAAMG,YAAYJ,UAAW;QAChCD,SAASI,IAAI,CAAC;YACZE,SAAS;gBACP;oBACEC,MAAM;oBACNC,OAAO,IAAIC,IAAIJ;gBACjB;aACD;YACDK,MAAM;QACR;IACF;IAEA,yEAAyE;IACzEV,SAASI,IAAI,CAAC;QACZE,SAASR;QACTY,MAAM;IACR;IAEA,OAAOV;AACT"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { ClientCollectionConfig, CollectionConfig, Field } from 'payload';
|
|
2
2
|
export declare const getFieldBySchemaPath: (collectionConfig: ClientCollectionConfig | CollectionConfig, schemaPath: string) => Field | null;
|
|
3
|
-
//# sourceMappingURL=getFieldBySchemaPath.d.ts.map
|
|
@@ -8,23 +8,31 @@ export const getFieldBySchemaPath = (collectionConfig, schemaPath)=>{
|
|
|
8
8
|
}
|
|
9
9
|
if (field.type === 'group' && field.fields) {
|
|
10
10
|
const result = findField(field.fields, remainingPath.slice(1));
|
|
11
|
-
if (result)
|
|
11
|
+
if (result) {
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
12
14
|
}
|
|
13
15
|
if (field.type === 'array' && field.fields) {
|
|
14
16
|
const result = findField(field.fields, remainingPath.slice(1));
|
|
15
|
-
if (result)
|
|
17
|
+
if (result) {
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
if (field.type === 'tabs') {
|
|
18
22
|
for (const tab of field.tabs){
|
|
19
23
|
const result = findField(tab.fields, remainingPath);
|
|
20
|
-
if (result)
|
|
24
|
+
if (result) {
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
29
|
if (field.type === 'blocks') {
|
|
24
30
|
for (const block of field.blocks){
|
|
25
31
|
if (block.slug === remainingPath[0]) {
|
|
26
32
|
const result = findField(block.fields, remainingPath.slice(1));
|
|
27
|
-
if (result)
|
|
33
|
+
if (result) {
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
28
36
|
}
|
|
29
37
|
}
|
|
30
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/getFieldBySchemaPath.ts"],"sourcesContent":["import type { ClientCollectionConfig, CollectionConfig, Field } from 'payload'\n\nexport const getFieldBySchemaPath = (\n collectionConfig: ClientCollectionConfig | CollectionConfig,\n schemaPath: string, // e.g., \"posts.content\"\n): Field | null => {\n const pathParts = schemaPath.split('.')\n const targetFieldName = pathParts[pathParts.length - 1]\n\n const findField = (fields, remainingPath: string[]): Field | null => {\n for (const field of fields) {\n if (remainingPath.length === 1 && field.name === targetFieldName) {\n return field\n }\n\n if (field.type === 'group' && field.fields) {\n const result = findField(field.fields, remainingPath.slice(1))\n if (result) return result\n }\n\n if (field.type === 'array' && field.fields) {\n const result = findField(field.fields, remainingPath.slice(1))\n if (result) return result\n }\n\n if (field.type === 'tabs') {\n for (const tab of field.tabs) {\n const result = findField(tab.fields, remainingPath)\n if (result) return result\n }\n }\n\n if (field.type === 'blocks') {\n for (const block of field.blocks) {\n if (block.slug === remainingPath[0]) {\n const result = findField(block.fields, remainingPath.slice(1))\n if (result) return result\n }\n }\n }\n }\n\n return null\n }\n\n return findField(collectionConfig.fields, pathParts.slice(1))\n}\n"],"names":["getFieldBySchemaPath","collectionConfig","schemaPath","pathParts","split","targetFieldName","length","findField","fields","remainingPath","field","name","type","result","slice","tab","tabs","block","blocks","slug"],"mappings":"AAEA,OAAO,MAAMA,uBAAuB,CAClCC,kBACAC;IAEA,MAAMC,YAAYD,WAAWE,KAAK,CAAC;IACnC,MAAMC,kBAAkBF,SAAS,CAACA,UAAUG,MAAM,GAAG,EAAE;IAEvD,MAAMC,YAAY,CAACC,
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getFieldBySchemaPath.ts"],"sourcesContent":["import type { ClientCollectionConfig, CollectionConfig, Field } from 'payload'\n\nexport const getFieldBySchemaPath = (\n collectionConfig: ClientCollectionConfig | CollectionConfig,\n schemaPath: string, // e.g., \"posts.content\"\n): Field | null => {\n const pathParts = schemaPath.split('.')\n const targetFieldName = pathParts[pathParts.length - 1]\n\n const findField = (fields: any[], remainingPath: string[]): Field | null => {\n for (const field of fields) {\n if (remainingPath.length === 1 && field.name === targetFieldName) {\n return field\n }\n\n if (field.type === 'group' && field.fields) {\n const result = findField(field.fields, remainingPath.slice(1))\n if (result) {\n return result\n }\n }\n\n if (field.type === 'array' && field.fields) {\n const result = findField(field.fields, remainingPath.slice(1))\n if (result) {\n return result\n }\n }\n\n if (field.type === 'tabs') {\n for (const tab of field.tabs) {\n const result = findField(tab.fields, remainingPath)\n if (result) {\n return result\n }\n }\n }\n\n if (field.type === 'blocks') {\n for (const block of field.blocks) {\n if (block.slug === remainingPath[0]) {\n const result = findField(block.fields, remainingPath.slice(1))\n if (result) {\n return result\n }\n }\n }\n }\n }\n\n return null\n }\n\n return findField(collectionConfig.fields, pathParts.slice(1))\n}\n"],"names":["getFieldBySchemaPath","collectionConfig","schemaPath","pathParts","split","targetFieldName","length","findField","fields","remainingPath","field","name","type","result","slice","tab","tabs","block","blocks","slug"],"mappings":"AAEA,OAAO,MAAMA,uBAAuB,CAClCC,kBACAC;IAEA,MAAMC,YAAYD,WAAWE,KAAK,CAAC;IACnC,MAAMC,kBAAkBF,SAAS,CAACA,UAAUG,MAAM,GAAG,EAAE;IAEvD,MAAMC,YAAY,CAACC,QAAeC;QAChC,KAAK,MAAMC,SAASF,OAAQ;YAC1B,IAAIC,cAAcH,MAAM,KAAK,KAAKI,MAAMC,IAAI,KAAKN,iBAAiB;gBAChE,OAAOK;YACT;YAEA,IAAIA,MAAME,IAAI,KAAK,WAAWF,MAAMF,MAAM,EAAE;gBAC1C,MAAMK,SAASN,UAAUG,MAAMF,MAAM,EAAEC,cAAcK,KAAK,CAAC;gBAC3D,IAAID,QAAQ;oBACV,OAAOA;gBACT;YACF;YAEA,IAAIH,MAAME,IAAI,KAAK,WAAWF,MAAMF,MAAM,EAAE;gBAC1C,MAAMK,SAASN,UAAUG,MAAMF,MAAM,EAAEC,cAAcK,KAAK,CAAC;gBAC3D,IAAID,QAAQ;oBACV,OAAOA;gBACT;YACF;YAEA,IAAIH,MAAME,IAAI,KAAK,QAAQ;gBACzB,KAAK,MAAMG,OAAOL,MAAMM,IAAI,CAAE;oBAC5B,MAAMH,SAASN,UAAUQ,IAAIP,MAAM,EAAEC;oBACrC,IAAII,QAAQ;wBACV,OAAOA;oBACT;gBACF;YACF;YAEA,IAAIH,MAAME,IAAI,KAAK,UAAU;gBAC3B,KAAK,MAAMK,SAASP,MAAMQ,MAAM,CAAE;oBAChC,IAAID,MAAME,IAAI,KAAKV,aAAa,CAAC,EAAE,EAAE;wBACnC,MAAMI,SAASN,UAAUU,MAAMT,MAAM,EAAEC,cAAcK,KAAK,CAAC;wBAC3D,IAAID,QAAQ;4BACV,OAAOA;wBACT;oBACF;gBACF;YACF;QACF;QAEA,OAAO;IACT;IAEA,OAAON,UAAUN,iBAAiBO,MAAM,EAAEL,UAAUW,KAAK,CAAC;AAC5D,EAAC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { BasePayload } from 'payload';
|
|
2
|
-
export declare const getFieldInfo: (collections: BasePayload["collections"], schemaPath: string) =>
|
|
3
|
-
//# sourceMappingURL=getFieldInfo.d.ts.map
|
|
2
|
+
export declare const getFieldInfo: (collections: BasePayload["collections"], schemaPath: string) => import("payload").Field | undefined;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { PluginConfig } from '../types.js';
|
|
2
|
-
export declare function getGenerationModels(pluginConfig: PluginConfig): import("../types.js").GenerationModel[];
|
|
3
|
-
//# sourceMappingURL=getGenerationModels.d.ts.map
|
|
2
|
+
export declare function getGenerationModels(pluginConfig: PluginConfig): import("../types.js").GenerationModel[] | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getGenerationModels } from './getGenerationModels.js';
|
|
2
2
|
export const isPluginActivated = (pluginConfig)=>{
|
|
3
|
-
return getGenerationModels(pluginConfig).length > 0;
|
|
3
|
+
return (getGenerationModels(pluginConfig) ?? []).length > 0;
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
//# sourceMappingURL=isPluginActivated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/isPluginActivated.ts"],"sourcesContent":["import type { PluginConfig } from '../types.js'\n\nimport { getGenerationModels } from './getGenerationModels.js'\n\nexport const isPluginActivated = (pluginConfig: PluginConfig) => {\n return getGenerationModels(pluginConfig).length > 0\n}\n"],"names":["getGenerationModels","isPluginActivated","pluginConfig","length"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,2BAA0B;AAE9D,OAAO,MAAMC,oBAAoB,CAACC;IAChC,
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/isPluginActivated.ts"],"sourcesContent":["import type { PluginConfig } from '../types.js'\n\nimport { getGenerationModels } from './getGenerationModels.js'\n\nexport const isPluginActivated = (pluginConfig: PluginConfig) => {\n return (getGenerationModels(pluginConfig) ?? []).length > 0\n}\n"],"names":["getGenerationModels","isPluginActivated","pluginConfig","length"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,2BAA0B;AAE9D,OAAO,MAAMC,oBAAoB,CAACC;IAChC,OAAO,AAACF,CAAAA,oBAAoBE,iBAAiB,EAAE,AAAD,EAAGC,MAAM,GAAG;AAC5D,EAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { SerializedEditorState } from 'lexical';
|
|
2
2
|
import { type SanitizedServerEditorConfig } from '@payloadcms/richtext-lexical';
|
|
3
3
|
export declare function lexicalToHTML(editorData: SerializedEditorState, editorConfig: SanitizedServerEditorConfig): Promise<string>;
|
|
4
|
-
//# sourceMappingURL=lexicalToHTML.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { LexicalEditor } from 'lexical';
|
|
2
2
|
type EditorAction = 'replace' | 'update';
|
|
3
|
-
export declare const setSafeLexicalState: (state:
|
|
3
|
+
export declare const setSafeLexicalState: (state: unknown, editorInstance: LexicalEditor, action?: EditorAction) => void;
|
|
4
4
|
export {};
|
|
5
|
-
//# sourceMappingURL=setSafeLexicalState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/setSafeLexicalState.ts"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\ntype EditorAction = 'replace' | 'update'\n\nexport const setSafeLexicalState = (\n state,\n editorInstance: LexicalEditor,\n action: EditorAction = 'replace',\n) => {\n try {\n const editorState = editorInstance.parseEditorState(state)\n if (editorState.isEmpty()) {\n return\n }\n\n editorInstance.setEditorState(editorState)\n } catch (error) {\n console.error('Error setting editor state: ', { error, state })\n }\n}\n"],"names":["setSafeLexicalState","state","editorInstance","action","editorState","parseEditorState","isEmpty","setEditorState","error","console"],"mappings":"AAIA,OAAO,MAAMA,sBAAsB,CACjCC,OACAC,gBACAC,SAAuB,SAAS;IAEhC,IAAI;QACF,MAAMC,cAAcF,eAAeG,gBAAgB,CAACJ;QACpD,IAAIG,YAAYE,OAAO,IAAI;YACzB;QACF;QAEAJ,eAAeK,cAAc,CAACH;IAChC,EAAE,OAAOI,OAAO;QACdC,QAAQD,KAAK,CAAC,gCAAgC;YAAEA;YAAOP;QAAM;IAC/D;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/setSafeLexicalState.ts"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\ntype EditorAction = 'replace' | 'update'\n\nexport const setSafeLexicalState = (\n state: unknown,\n editorInstance: LexicalEditor,\n action: EditorAction = 'replace',\n) => {\n try {\n const editorState = editorInstance.parseEditorState(state as any)\n if (editorState.isEmpty()) {\n return\n }\n\n editorInstance.setEditorState(editorState)\n } catch (error) {\n console.error('Error setting editor state: ', { error, state })\n }\n}\n"],"names":["setSafeLexicalState","state","editorInstance","action","editorState","parseEditorState","isEmpty","setEditorState","error","console"],"mappings":"AAIA,OAAO,MAAMA,sBAAsB,CACjCC,OACAC,gBACAC,SAAuB,SAAS;IAEhC,IAAI;QACF,MAAMC,cAAcF,eAAeG,gBAAgB,CAACJ;QACpD,IAAIG,YAAYE,OAAO,IAAI;YACzB;QACF;QAEAJ,eAAeK,cAAc,CAACH;IAChC,EAAE,OAAOI,OAAO;QACdC,QAAQD,KAAK,CAAC,gCAAgC;YAAEA;YAAOP;QAAM;IAC/D;AACF,EAAC"}
|
|
@@ -35,7 +35,8 @@ export const updateFieldsConfig = (collectionConfig)=>{
|
|
|
35
35
|
// Custom fields don't fully adhere to the Payload schema, making it difficult to
|
|
36
36
|
// determine which components support injecting ComposeField as a Description.
|
|
37
37
|
if (field.admin?.components?.Field || field.admin?.components?.Description) {
|
|
38
|
-
// TODO:
|
|
38
|
+
// TODO: If a field already provides its own Description, we still inject our ComposeField
|
|
39
|
+
// by overriding Description. If you need both, consider composing your own wrapper.
|
|
39
40
|
customField = {};
|
|
40
41
|
}
|
|
41
42
|
return {
|
|
@@ -44,7 +45,12 @@ export const updateFieldsConfig = (collectionConfig)=>{
|
|
|
44
45
|
...field.admin,
|
|
45
46
|
components: {
|
|
46
47
|
...field.admin?.components || {},
|
|
47
|
-
Description:
|
|
48
|
+
Description: {
|
|
49
|
+
clientProps: {
|
|
50
|
+
schemaPath: currentSchemaPath
|
|
51
|
+
},
|
|
52
|
+
path: '@ai-stack/payloadcms/fields#ComposeField'
|
|
53
|
+
},
|
|
48
54
|
...customField
|
|
49
55
|
}
|
|
50
56
|
}
|
|
@@ -62,7 +68,8 @@ export const updateFieldsConfig = (collectionConfig)=>{
|
|
|
62
68
|
tabs: field.tabs.map((tab)=>{
|
|
63
69
|
return {
|
|
64
70
|
...tab,
|
|
65
|
-
|
|
71
|
+
// Tabs are a UI construct and should not add to the schema path
|
|
72
|
+
fields: (tab.fields || []).map((subField)=>updateField(subField, parentPath))
|
|
66
73
|
};
|
|
67
74
|
})
|
|
68
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/updateFieldsConfig.ts"],"sourcesContent":["import type { CollectionConfig, GlobalConfig } from 'payload'\n\ninterface UpdateFieldsConfig {\n schemaPathMap: Record<string, string>\n updatedCollectionConfig: CollectionConfig | GlobalConfig\n}\n\nexport const updateFieldsConfig = (collectionConfig: CollectionConfig | GlobalConfig): UpdateFieldsConfig => {\n let schemaPathMap = {}\n\n function updateField(field: any, parentPath = ''): any {\n const currentPath = parentPath ? `${parentPath}.${field.name}` : field.name\n const currentSchemaPath = `${collectionConfig.slug}.${currentPath}`\n\n // Disabled fields/ field types\n if (\n field.admin?.disabled ||\n field.admin?.readOnly ||\n field.admin?.hidden ||\n field.type === 'row'\n ) {\n return field\n }\n\n // Map field path for global fieldInstructionsMap to load related instructions\n // This is done due to save extra API call to get instructions when Field components are loaded in admin\n // Doing is will only call instructions data when user clicks on settings\n if (['richText', 'text', 'textarea', 'upload'].includes(field.type)) {\n schemaPathMap = {\n ...schemaPathMap,\n [currentSchemaPath]: {\n type: field.type,\n label: field.label || field.name,\n relationTo: field.relationTo,\n },\n }\n }\n\n // Inject AI actions, richText is not included here as it has to be explicitly defined by user\n if (['text', 'textarea', 'upload'].includes(field.type)) {\n let customField = {}\n\n // Custom fields don't fully adhere to the Payload schema, making it difficult to\n // determine which components support injecting ComposeField as a Description.\n if (field.admin?.components?.Field || field.admin?.components?.Description) {\n // TODO:
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/updateFieldsConfig.ts"],"sourcesContent":["import type { CollectionConfig, GlobalConfig } from 'payload'\n\ninterface UpdateFieldsConfig {\n schemaPathMap: Record<string, string>\n updatedCollectionConfig: CollectionConfig | GlobalConfig\n}\n\nexport const updateFieldsConfig = (collectionConfig: CollectionConfig | GlobalConfig): UpdateFieldsConfig => {\n let schemaPathMap = {}\n\n function updateField(field: any, parentPath = ''): any {\n const currentPath = parentPath ? `${parentPath}.${field.name}` : field.name\n const currentSchemaPath = `${collectionConfig.slug}.${currentPath}`\n\n // Disabled fields/ field types\n if (\n field.admin?.disabled ||\n field.admin?.readOnly ||\n field.admin?.hidden ||\n field.type === 'row'\n ) {\n return field\n }\n\n // Map field path for global fieldInstructionsMap to load related instructions\n // This is done due to save extra API call to get instructions when Field components are loaded in admin\n // Doing is will only call instructions data when user clicks on settings\n if (['richText', 'text', 'textarea', 'upload'].includes(field.type)) {\n schemaPathMap = {\n ...schemaPathMap,\n [currentSchemaPath]: {\n type: field.type,\n label: field.label || field.name,\n relationTo: field.relationTo,\n },\n }\n }\n\n // Inject AI actions, richText is not included here as it has to be explicitly defined by user\n if (['text', 'textarea', 'upload'].includes(field.type)) {\n let customField = {}\n\n // Custom fields don't fully adhere to the Payload schema, making it difficult to\n // determine which components support injecting ComposeField as a Description.\n if (field.admin?.components?.Field || field.admin?.components?.Description) {\n // TODO: If a field already provides its own Description, we still inject our ComposeField\n // by overriding Description. If you need both, consider composing your own wrapper.\n customField = {}\n }\n\n return {\n ...field,\n admin: {\n ...field.admin,\n components: {\n ...(field.admin?.components || {}),\n Description: {\n clientProps: {\n schemaPath: currentSchemaPath,\n },\n path: '@ai-stack/payloadcms/fields#ComposeField',\n },\n ...customField,\n },\n },\n }\n }\n\n if (field.fields) {\n return {\n ...field,\n fields: field.fields.map((subField: any) => updateField(subField, currentPath)),\n }\n }\n\n if (field.tabs) {\n return {\n ...field,\n tabs: field.tabs.map((tab: any) => {\n return {\n ...tab,\n // Tabs are a UI construct and should not add to the schema path\n fields: (tab.fields || []).map((subField: any) => updateField(subField, parentPath)),\n }\n }),\n }\n }\n\n if (field.blocks) {\n return {\n ...field,\n blocks: field.blocks.map((block: any) => ({\n ...block,\n fields: block.fields.map((subField: any) =>\n updateField(subField, `${currentPath}.${block.slug}`),\n ),\n })),\n }\n }\n\n return field\n }\n\n const updatedCollectionConfig = {\n ...collectionConfig,\n fields: collectionConfig.fields.map((field) => updateField(field)),\n }\n\n return {\n schemaPathMap,\n updatedCollectionConfig,\n }\n}\n"],"names":["updateFieldsConfig","collectionConfig","schemaPathMap","updateField","field","parentPath","currentPath","name","currentSchemaPath","slug","admin","disabled","readOnly","hidden","type","includes","label","relationTo","customField","components","Field","Description","clientProps","schemaPath","path","fields","map","subField","tabs","tab","blocks","block","updatedCollectionConfig"],"mappings":"AAOA,OAAO,MAAMA,qBAAqB,CAACC;IACjC,IAAIC,gBAAgB,CAAC;IAErB,SAASC,YAAYC,KAAU,EAAEC,aAAa,EAAE;QAC9C,MAAMC,cAAcD,aAAa,GAAGA,WAAW,CAAC,EAAED,MAAMG,IAAI,EAAE,GAAGH,MAAMG,IAAI;QAC3E,MAAMC,oBAAoB,GAAGP,iBAAiBQ,IAAI,CAAC,CAAC,EAAEH,aAAa;QAEnE,+BAA+B;QAC/B,IACEF,MAAMM,KAAK,EAAEC,YACbP,MAAMM,KAAK,EAAEE,YACbR,MAAMM,KAAK,EAAEG,UACbT,MAAMU,IAAI,KAAK,OACf;YACA,OAAOV;QACT;QAEA,8EAA8E;QAC9E,wGAAwG;QACxG,yEAAyE;QACzE,IAAI;YAAC;YAAY;YAAQ;YAAY;SAAS,CAACW,QAAQ,CAACX,MAAMU,IAAI,GAAG;YACnEZ,gBAAgB;gBACd,GAAGA,aAAa;gBAChB,CAACM,kBAAkB,EAAE;oBACnBM,MAAMV,MAAMU,IAAI;oBAChBE,OAAOZ,MAAMY,KAAK,IAAIZ,MAAMG,IAAI;oBAChCU,YAAYb,MAAMa,UAAU;gBAC9B;YACF;QACF;QAEA,8FAA8F;QAC9F,IAAI;YAAC;YAAQ;YAAY;SAAS,CAACF,QAAQ,CAACX,MAAMU,IAAI,GAAG;YACvD,IAAII,cAAc,CAAC;YAEnB,iFAAiF;YACjF,8EAA8E;YAC9E,IAAId,MAAMM,KAAK,EAAES,YAAYC,SAAShB,MAAMM,KAAK,EAAES,YAAYE,aAAa;gBAC1E,0FAA0F;gBAC1F,oFAAoF;gBACpFH,cAAc,CAAC;YACjB;YAEA,OAAO;gBACL,GAAGd,KAAK;gBACRM,OAAO;oBACL,GAAGN,MAAMM,KAAK;oBACdS,YAAY;wBACV,GAAIf,MAAMM,KAAK,EAAES,cAAc,CAAC,CAAC;wBACjCE,aAAa;4BACXC,aAAa;gCACXC,YAAYf;4BACd;4BACAgB,MAAM;wBACR;wBACA,GAAGN,WAAW;oBAChB;gBACF;YACF;QACF;QAEA,IAAId,MAAMqB,MAAM,EAAE;YAChB,OAAO;gBACL,GAAGrB,KAAK;gBACRqB,QAAQrB,MAAMqB,MAAM,CAACC,GAAG,CAAC,CAACC,WAAkBxB,YAAYwB,UAAUrB;YACpE;QACF;QAEA,IAAIF,MAAMwB,IAAI,EAAE;YACd,OAAO;gBACL,GAAGxB,KAAK;gBACRwB,MAAMxB,MAAMwB,IAAI,CAACF,GAAG,CAAC,CAACG;oBACpB,OAAO;wBACL,GAAGA,GAAG;wBACN,gEAAgE;wBAChEJ,QAAQ,AAACI,CAAAA,IAAIJ,MAAM,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACC,WAAkBxB,YAAYwB,UAAUtB;oBAC1E;gBACF;YACF;QACF;QAEA,IAAID,MAAM0B,MAAM,EAAE;YAChB,OAAO;gBACL,GAAG1B,KAAK;gBACR0B,QAAQ1B,MAAM0B,MAAM,CAACJ,GAAG,CAAC,CAACK,QAAgB,CAAA;wBACxC,GAAGA,KAAK;wBACRN,QAAQM,MAAMN,MAAM,CAACC,GAAG,CAAC,CAACC,WACxBxB,YAAYwB,UAAU,GAAGrB,YAAY,CAAC,EAAEyB,MAAMtB,IAAI,EAAE;oBAExD,CAAA;YACF;QACF;QAEA,OAAOL;IACT;IAEA,MAAM4B,0BAA0B;QAC9B,GAAG/B,gBAAgB;QACnBwB,QAAQxB,iBAAiBwB,MAAM,CAACC,GAAG,CAAC,CAACtB,QAAUD,YAAYC;IAC7D;IAEA,OAAO;QACLF;QACA8B;IACF;AACF,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-stack/payloadcms",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.17-beta",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bugs": "https://github.com/ashbuilds/payload-ai/issues",
|
|
6
6
|
"repository": "https://github.com/ashbuilds/payload-ai",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "ashbuilds",
|
|
9
|
+
"type": "module",
|
|
9
10
|
"keywords": [
|
|
10
|
-
"
|
|
11
|
-
"text-to-speech",
|
|
11
|
+
"payload",
|
|
12
12
|
"ai",
|
|
13
|
+
"plugin",
|
|
13
14
|
"text-generation",
|
|
15
|
+
"text-to-speech",
|
|
14
16
|
"text-to-image",
|
|
15
17
|
"content-generation",
|
|
16
18
|
"ai-writing",
|
|
@@ -18,11 +20,9 @@
|
|
|
18
20
|
"smart-generation",
|
|
19
21
|
"ai-translate",
|
|
20
22
|
"ai-writing-tool",
|
|
21
|
-
"gpt-image-1"
|
|
23
|
+
"gpt-image-1",
|
|
24
|
+
"payload-plugin"
|
|
22
25
|
],
|
|
23
|
-
"type": "module",
|
|
24
|
-
"main": "./dist/index.js",
|
|
25
|
-
"types": "./dist/index.d.ts",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"import": "./dist/index.js",
|
|
@@ -45,17 +45,89 @@
|
|
|
45
45
|
"default": "./dist/exports/client.js"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
"main": "./dist/index.js",
|
|
49
|
+
"types": "./dist/index.d.ts",
|
|
50
|
+
"typesVersions": {
|
|
51
|
+
"*": {
|
|
52
|
+
"client": [
|
|
53
|
+
"src/exports/client.ts"
|
|
54
|
+
],
|
|
55
|
+
"types": [
|
|
56
|
+
"src/exports/types.ts"
|
|
57
|
+
],
|
|
58
|
+
"fields": [
|
|
59
|
+
"src/exports/fields.ts"
|
|
60
|
+
],
|
|
61
|
+
"*": [
|
|
62
|
+
"src/*"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
48
66
|
"files": [
|
|
49
67
|
"dist"
|
|
50
68
|
],
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
71
|
+
"@lexical/html": "0.35.0",
|
|
72
|
+
"@payloadcms/db-mongodb": "^3.55.1",
|
|
73
|
+
"@payloadcms/db-postgres": "^3.55.1",
|
|
74
|
+
"@payloadcms/db-sqlite": "^3.55.1",
|
|
75
|
+
"@payloadcms/eslint-config": "3.9.0",
|
|
76
|
+
"@payloadcms/next": "^3.55.1",
|
|
77
|
+
"@payloadcms/richtext-lexical": "^3.55.1",
|
|
78
|
+
"@payloadcms/ui": "^3.55.1",
|
|
79
|
+
"@playwright/test": "^1.52.0",
|
|
80
|
+
"@swc-node/register": "1.10.9",
|
|
81
|
+
"@swc/cli": "0.6.0",
|
|
82
|
+
"@types/node": "^22.5.4",
|
|
83
|
+
"@types/react": "19.1.8",
|
|
84
|
+
"@types/react-dom": "19.1.6",
|
|
85
|
+
"copyfiles": "2.4.1",
|
|
86
|
+
"cross-env": "^7.0.3",
|
|
87
|
+
"eslint": "^9.23.0",
|
|
88
|
+
"eslint-config-next": "15.4.4",
|
|
89
|
+
"graphql": "^16.8.1",
|
|
90
|
+
"lexical": "0.35.0",
|
|
91
|
+
"mongodb-memory-server": "10.1.4",
|
|
92
|
+
"next": "15.4.7",
|
|
93
|
+
"open": "^10.1.0",
|
|
94
|
+
"payload": "^3.55.1",
|
|
95
|
+
"prettier": "^3.4.2",
|
|
96
|
+
"qs-esm": "7.0.2",
|
|
97
|
+
"react": "19.1.0",
|
|
98
|
+
"react-dom": "19.1.0",
|
|
99
|
+
"rimraf": "3.0.2",
|
|
100
|
+
"sharp": "0.34.2",
|
|
101
|
+
"sort-package-json": "^2.10.0",
|
|
102
|
+
"typescript": "5.7.3",
|
|
103
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
104
|
+
"vitest": "^3.1.2"
|
|
105
|
+
},
|
|
106
|
+
"peerDependencies": {
|
|
107
|
+
"@lexical/html": "^0.35.0",
|
|
108
|
+
"@payloadcms/richtext-lexical": "^3.55.1",
|
|
109
|
+
"@payloadcms/translations": "^3.55.1",
|
|
110
|
+
"@payloadcms/ui": "^3.55.1",
|
|
111
|
+
"lexical": "^0.35.0",
|
|
112
|
+
"payload": "^3.55.1"
|
|
113
|
+
},
|
|
114
|
+
"engines": {
|
|
115
|
+
"node": "^18.20.2 || >=20.9.0"
|
|
116
|
+
},
|
|
117
|
+
"publishConfig": {
|
|
118
|
+
"@ai-stack:registry": "https://registry.npmjs.org",
|
|
119
|
+
"access": "public",
|
|
120
|
+
"provenance": true
|
|
121
|
+
},
|
|
122
|
+
"registry": "https://registry.npmjs.org/",
|
|
51
123
|
"dependencies": {
|
|
52
|
-
"@ai-sdk/anthropic": "^
|
|
53
|
-
"@ai-sdk/openai": "^
|
|
54
|
-
"@ai-sdk/provider-utils": "^
|
|
55
|
-
"@ai-sdk/react": "^
|
|
124
|
+
"@ai-sdk/anthropic": "^2.0.15",
|
|
125
|
+
"@ai-sdk/openai": "^2.0.28",
|
|
126
|
+
"@ai-sdk/provider-utils": "^3.0.8",
|
|
127
|
+
"@ai-sdk/react": "^2.0.39",
|
|
56
128
|
"@ai-sdk/ui-utils": "^1.2.10",
|
|
57
|
-
"@anthropic-ai/sdk": "^0.
|
|
58
|
-
"ai": "^
|
|
129
|
+
"@anthropic-ai/sdk": "^0.62.0",
|
|
130
|
+
"ai": "^5.0.39",
|
|
59
131
|
"ajv": "^8.17.1",
|
|
60
132
|
"elevenlabs": "^0.8.2",
|
|
61
133
|
"get-input-selection": "^1.1.4",
|
|
@@ -63,62 +135,29 @@
|
|
|
63
135
|
"handlebars-async-helpers": "^1.0.6",
|
|
64
136
|
"locale-codes": "^1.3.1",
|
|
65
137
|
"lodash.isequal": "^4.5.0",
|
|
66
|
-
"openai": "^
|
|
138
|
+
"openai": "^5.20.1",
|
|
67
139
|
"react-mentions": "^4.4.10",
|
|
68
140
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
69
|
-
"textarea-caret": "^3.0.2"
|
|
70
|
-
|
|
71
|
-
"devDependencies": {
|
|
72
|
-
"@eslint/compat": "^1.1.1",
|
|
73
|
-
"@eslint/js": "^9.9.1",
|
|
74
|
-
"@swc/cli": ">=0.4.0",
|
|
75
|
-
"@types/dot-object": "2.1.6",
|
|
76
|
-
"@types/handlebars": "^4.1.0",
|
|
77
|
-
"@types/json-schema": "^7.0.15",
|
|
78
|
-
"@types/react": "^19.0.0",
|
|
79
|
-
"@types/react-dom": "^19.0.0",
|
|
80
|
-
"@types/react-mentions": "^4.4.1",
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
82
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
83
|
-
"copyfiles": "^2.4.1",
|
|
84
|
-
"eslint": "^9.9.1",
|
|
85
|
-
"eslint-config-prettier": "^9.1.0",
|
|
86
|
-
"eslint-plugin-import": "^2.29.1",
|
|
87
|
-
"eslint-plugin-import-x": "^3.1.0",
|
|
88
|
-
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
89
|
-
"eslint-plugin-perfectionist": "^2.11.0",
|
|
90
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
91
|
-
"eslint-plugin-react": "^7.35.0",
|
|
92
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
93
|
-
"eslint-plugin-regexp": "^2.6.0",
|
|
94
|
-
"globals": "^15.9.0",
|
|
95
|
-
"prettier": "^3.3.3",
|
|
96
|
-
"react": "^19.0.0",
|
|
97
|
-
"react-dom": "^19.0.0",
|
|
98
|
-
"rimraf": "^6.0.1",
|
|
99
|
-
"typescript": "^5.5.4",
|
|
100
|
-
"typescript-eslint": "^7.18.0"
|
|
101
|
-
},
|
|
102
|
-
"peerDependencies": {
|
|
103
|
-
"@lexical/html": "^0.28.0",
|
|
104
|
-
"@payloadcms/richtext-lexical": "^3.38.0",
|
|
105
|
-
"@payloadcms/translations": "^3.38.0",
|
|
106
|
-
"@payloadcms/ui": "^3.38.0",
|
|
107
|
-
"lexical": "^0.28.0",
|
|
108
|
-
"payload": "^3.38.0"
|
|
109
|
-
},
|
|
110
|
-
"publishConfig": {
|
|
111
|
-
"@ai-stack:registry": "https://registry.npmjs.org",
|
|
112
|
-
"access": "public",
|
|
113
|
-
"provenance": true
|
|
141
|
+
"textarea-caret": "^3.0.2",
|
|
142
|
+
"zod": "^4.1.7"
|
|
114
143
|
},
|
|
115
144
|
"scripts": {
|
|
116
|
-
"build": "pnpm build:types && pnpm build:swc",
|
|
117
|
-
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths --copy-files",
|
|
145
|
+
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
|
|
118
146
|
"build:dev": "pnpm build --watch",
|
|
119
|
-
"build:
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
147
|
+
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
148
|
+
"build:types": "tsc --outDir dist --rootDir ./src",
|
|
149
|
+
"clean": "rimraf {dist,*.tsbuildinfo}",
|
|
150
|
+
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
151
|
+
"dev": "next dev dev --turbo",
|
|
152
|
+
"dev:generate-importmap": "pnpm dev:payload generate:importmap",
|
|
153
|
+
"dev:generate-types": "pnpm dev:payload generate:types",
|
|
154
|
+
"dev:payload": "cross-env PAYLOAD_CONFIG_PATH=./dev/payload.config.ts payload",
|
|
155
|
+
"generate:importmap": "pnpm dev:generate-importmap",
|
|
156
|
+
"generate:types": "pnpm dev:generate-types",
|
|
157
|
+
"lint": "eslint",
|
|
158
|
+
"lint:fix": "eslint ./src --fix",
|
|
159
|
+
"test": "pnpm test:int && pnpm test:e2e",
|
|
160
|
+
"test:e2e": "playwright test",
|
|
161
|
+
"test:int": "vitest"
|
|
123
162
|
}
|
|
124
163
|
}
|
package/dist/ai/analyse.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyse.d.ts","sourceRoot":"","sources":["../../src/ai/analyse.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateRichText.d.ts","sourceRoot":"","sources":["../../../../src/ai/models/anthropic/generateRichText.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,SAAS,GAAG,aAiC1D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/models/anthropic/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAOzD,eAAO,MAAM,eAAe,EAAE,gBA+E7B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateVoice.d.ts","sourceRoot":"","sources":["../../../../src/ai/models/elevenLabs/generateVoice.ts"],"names":[],"mappings":"AAEA,KAAK,6BAA6B,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa,GAAU,MAAM,MAAM,EAAE,SAAS,6BAA6B;;;EAoBvF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/models/elevenLabs/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAmGzD,eAAO,MAAM,gBAAgB,EAAE,gBAmC9B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../../../../src/ai/models/elevenLabs/voices.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;EAiBxB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/models/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMrD,eAAO,MAAM,uBAAuB,EAAE,eAAe,EAIpD,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateImage.d.ts","sourceRoot":"","sources":["../../../../src/ai/models/openai/generateImage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAI5D,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,oCAKG,mBAAwB;;;EA4B5B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateRichText.d.ts","sourceRoot":"","sources":["../../../../src/ai/models/openai/generateRichText.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,UAAS,GAAQ,aAmC/D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateVoice.d.ts","sourceRoot":"","sources":["../../../../src/ai/models/openai/generateVoice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAIvE,KAAK,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAA;AAErE,eAAO,MAAM,aAAa,GAAU,MAAM,MAAM,EAAE,SAAS,yBAAyB;;EAiBnF,CAAA"}
|