@delmaredigital/payload-puck 0.4.0 → 0.6.1
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 +429 -17
- package/dist/admin/PuckEditorView.d.ts +1 -1
- package/dist/admin/PuckEditorView.d.ts.map +1 -1
- package/dist/ai/collections/AiContext.d.ts +16 -0
- package/dist/ai/collections/AiContext.d.ts.map +1 -0
- package/dist/ai/collections/AiContext.js +87 -0
- package/dist/ai/collections/AiContext.js.map +1 -0
- package/dist/ai/collections/AiPrompts.d.ts +10 -0
- package/dist/ai/collections/AiPrompts.d.ts.map +1 -0
- package/dist/ai/collections/AiPrompts.js +63 -0
- package/dist/ai/collections/AiPrompts.js.map +1 -0
- package/dist/ai/createAiApiRoutes.d.ts +40 -0
- package/dist/ai/createAiApiRoutes.d.ts.map +1 -0
- package/dist/ai/createAiApiRoutes.js +106 -0
- package/dist/ai/createAiApiRoutes.js.map +1 -0
- package/dist/ai/createAiGenerate.d.ts +65 -0
- package/dist/ai/createAiGenerate.d.ts.map +1 -0
- package/dist/ai/createAiGenerate.js +106 -0
- package/dist/ai/createAiGenerate.js.map +1 -0
- package/dist/ai/createAiPlugin.d.ts +39 -0
- package/dist/ai/createAiPlugin.d.ts.map +1 -0
- package/dist/ai/createAiPlugin.js +61 -0
- package/dist/ai/createAiPlugin.js.map +1 -0
- package/dist/ai/hooks/useAiContext.d.ts +63 -0
- package/dist/ai/hooks/useAiContext.d.ts.map +1 -0
- package/dist/ai/hooks/useAiContext.js +146 -0
- package/dist/ai/hooks/useAiContext.js.map +1 -0
- package/dist/ai/hooks/useAiPrompts.d.ts +25 -0
- package/dist/ai/hooks/useAiPrompts.d.ts.map +1 -0
- package/dist/ai/hooks/useAiPrompts.js +74 -0
- package/dist/ai/hooks/useAiPrompts.js.map +1 -0
- package/dist/ai/index.d.ts +51 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +69 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/plugins/ContextEditorPanel.d.ts +9 -0
- package/dist/ai/plugins/ContextEditorPanel.d.ts.map +1 -0
- package/dist/ai/plugins/ContextEditorPanel.js +399 -0
- package/dist/ai/plugins/ContextEditorPanel.js.map +1 -0
- package/dist/ai/plugins/PromptEditorPanel.d.ts +9 -0
- package/dist/ai/plugins/PromptEditorPanel.d.ts.map +1 -0
- package/dist/ai/plugins/PromptEditorPanel.js +270 -0
- package/dist/ai/plugins/PromptEditorPanel.js.map +1 -0
- package/dist/ai/plugins/contextEditorPlugin.d.ts +30 -0
- package/dist/ai/plugins/contextEditorPlugin.d.ts.map +1 -0
- package/dist/ai/plugins/contextEditorPlugin.js +40 -0
- package/dist/ai/plugins/contextEditorPlugin.js.map +1 -0
- package/dist/ai/plugins/promptApiRoutes.d.ts +68 -0
- package/dist/ai/plugins/promptApiRoutes.d.ts.map +1 -0
- package/dist/ai/plugins/promptApiRoutes.js +181 -0
- package/dist/ai/plugins/promptApiRoutes.js.map +1 -0
- package/dist/ai/plugins/promptEditorPlugin.d.ts +29 -0
- package/dist/ai/plugins/promptEditorPlugin.d.ts.map +1 -0
- package/dist/ai/plugins/promptEditorPlugin.js +39 -0
- package/dist/ai/plugins/promptEditorPlugin.js.map +1 -0
- package/dist/ai/presets/componentAiDefaults.d.ts +40 -0
- package/dist/ai/presets/componentAiDefaults.d.ts.map +1 -0
- package/dist/ai/presets/componentAiDefaults.js +239 -0
- package/dist/ai/presets/componentAiDefaults.js.map +1 -0
- package/dist/ai/presets/index.d.ts +94 -0
- package/dist/ai/presets/index.d.ts.map +1 -0
- package/dist/ai/presets/index.js +110 -0
- package/dist/ai/presets/index.js.map +1 -0
- package/dist/ai/presets/instructions/interactive.d.ts +15 -0
- package/dist/ai/presets/instructions/interactive.d.ts.map +1 -0
- package/dist/ai/presets/instructions/interactive.js +334 -0
- package/dist/ai/presets/instructions/interactive.js.map +1 -0
- package/dist/ai/presets/instructions/layout.d.ts +16 -0
- package/dist/ai/presets/instructions/layout.d.ts.map +1 -0
- package/dist/ai/presets/instructions/layout.js +486 -0
- package/dist/ai/presets/instructions/layout.js.map +1 -0
- package/dist/ai/presets/instructions/media.d.ts +15 -0
- package/dist/ai/presets/instructions/media.d.ts.map +1 -0
- package/dist/ai/presets/instructions/media.js +136 -0
- package/dist/ai/presets/instructions/media.js.map +1 -0
- package/dist/ai/presets/instructions/pagePatterns.d.ts +20 -0
- package/dist/ai/presets/instructions/pagePatterns.d.ts.map +1 -0
- package/dist/ai/presets/instructions/pagePatterns.js +290 -0
- package/dist/ai/presets/instructions/pagePatterns.js.map +1 -0
- package/dist/ai/presets/instructions/schemas.d.ts +1247 -0
- package/dist/ai/presets/instructions/schemas.d.ts.map +1 -0
- package/dist/ai/presets/instructions/schemas.js +240 -0
- package/dist/ai/presets/instructions/schemas.js.map +1 -0
- package/dist/ai/presets/instructions/typography.d.ts +16 -0
- package/dist/ai/presets/instructions/typography.d.ts.map +1 -0
- package/dist/ai/presets/instructions/typography.js +192 -0
- package/dist/ai/presets/instructions/typography.js.map +1 -0
- package/dist/ai/tools/index.d.ts +116 -0
- package/dist/ai/tools/index.d.ts.map +1 -0
- package/dist/ai/tools/index.js +214 -0
- package/dist/ai/tools/index.js.map +1 -0
- package/dist/ai/types.d.ts +507 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/ai/utils/injectAiConfig.d.ts +67 -0
- package/dist/ai/utils/injectAiConfig.d.ts.map +1 -0
- package/dist/ai/utils/injectAiConfig.js +216 -0
- package/dist/ai/utils/injectAiConfig.js.map +1 -0
- package/dist/api/createPuckApiRoutesWithId.d.ts.map +1 -1
- package/dist/api/createPuckApiRoutesWithId.js +12 -5
- package/dist/api/createPuckApiRoutesWithId.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/types.d.ts +1 -1
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/utils/mapRootProps.d.ts +19 -0
- package/dist/api/utils/mapRootProps.d.ts.map +1 -1
- package/dist/api/utils/mapRootProps.js +33 -0
- package/dist/api/utils/mapRootProps.js.map +1 -1
- package/dist/components/exports.d.ts +2 -1
- package/dist/components/exports.d.ts.map +1 -1
- package/dist/components/exports.js +5 -1
- package/dist/components/exports.js.map +1 -1
- package/dist/components/interactive/Accordion.d.ts +1 -1
- package/dist/components/interactive/Accordion.d.ts.map +1 -1
- package/dist/components/interactive/Accordion.js +4 -4
- package/dist/components/interactive/Accordion.js.map +1 -1
- package/dist/components/interactive/Accordion.server.d.ts +1 -1
- package/dist/components/interactive/Accordion.server.d.ts.map +1 -1
- package/dist/components/interactive/Button.d.ts +1 -1
- package/dist/components/interactive/Button.d.ts.map +1 -1
- package/dist/components/interactive/Button.server.d.ts +2 -3
- package/dist/components/interactive/Button.server.d.ts.map +1 -1
- package/dist/components/interactive/Button.server.js +1 -2
- package/dist/components/interactive/Button.server.js.map +1 -1
- package/dist/components/interactive/Card.d.ts +1 -1
- package/dist/components/interactive/Card.d.ts.map +1 -1
- package/dist/components/interactive/Card.server.d.ts +1 -1
- package/dist/components/interactive/Card.server.d.ts.map +1 -1
- package/dist/components/interactive/Divider.d.ts +1 -1
- package/dist/components/interactive/Divider.d.ts.map +1 -1
- package/dist/components/interactive/Divider.server.d.ts +1 -1
- package/dist/components/interactive/Divider.server.d.ts.map +1 -1
- package/dist/components/layout/Container.d.ts +3 -1
- package/dist/components/layout/Container.d.ts.map +1 -1
- package/dist/components/layout/Container.js +16 -2
- package/dist/components/layout/Container.js.map +1 -1
- package/dist/components/layout/Container.server.d.ts +3 -1
- package/dist/components/layout/Container.server.d.ts.map +1 -1
- package/dist/components/layout/Container.server.js +5 -2
- package/dist/components/layout/Container.server.js.map +1 -1
- package/dist/components/layout/Flex.d.ts +3 -1
- package/dist/components/layout/Flex.d.ts.map +1 -1
- package/dist/components/layout/Flex.js +18 -2
- package/dist/components/layout/Flex.js.map +1 -1
- package/dist/components/layout/Flex.server.d.ts +3 -1
- package/dist/components/layout/Flex.server.d.ts.map +1 -1
- package/dist/components/layout/Flex.server.js +5 -2
- package/dist/components/layout/Flex.server.js.map +1 -1
- package/dist/components/layout/Grid.d.ts +3 -1
- package/dist/components/layout/Grid.d.ts.map +1 -1
- package/dist/components/layout/Grid.js +15 -2
- package/dist/components/layout/Grid.js.map +1 -1
- package/dist/components/layout/Grid.server.d.ts +3 -1
- package/dist/components/layout/Grid.server.d.ts.map +1 -1
- package/dist/components/layout/Grid.server.js +5 -2
- package/dist/components/layout/Grid.server.js.map +1 -1
- package/dist/components/layout/Section.d.ts +3 -1
- package/dist/components/layout/Section.d.ts.map +1 -1
- package/dist/components/layout/Section.js +32 -5
- package/dist/components/layout/Section.js.map +1 -1
- package/dist/components/layout/Section.server.d.ts +3 -1
- package/dist/components/layout/Section.server.d.ts.map +1 -1
- package/dist/components/layout/Section.server.js +16 -4
- package/dist/components/layout/Section.server.js.map +1 -1
- package/dist/components/layout/Spacer.d.ts +1 -1
- package/dist/components/layout/Spacer.d.ts.map +1 -1
- package/dist/components/layout/Spacer.server.d.ts +1 -1
- package/dist/components/layout/Spacer.server.d.ts.map +1 -1
- package/dist/components/layout/Template.d.ts +1 -1
- package/dist/components/layout/Template.d.ts.map +1 -1
- package/dist/components/layout/Template.server.d.ts +1 -1
- package/dist/components/layout/Template.server.d.ts.map +1 -1
- package/dist/components/media/Image.d.ts +1 -1
- package/dist/components/media/Image.d.ts.map +1 -1
- package/dist/components/media/Image.server.d.ts +1 -1
- package/dist/components/media/Image.server.d.ts.map +1 -1
- package/dist/components/typography/Heading.d.ts +1 -1
- package/dist/components/typography/Heading.d.ts.map +1 -1
- package/dist/components/typography/Heading.server.d.ts +1 -1
- package/dist/components/typography/Heading.server.d.ts.map +1 -1
- package/dist/components/typography/RichText.editor.d.ts +15 -2
- package/dist/components/typography/RichText.editor.d.ts.map +1 -1
- package/dist/components/typography/RichText.editor.js +18 -11
- package/dist/components/typography/RichText.editor.js.map +1 -1
- package/dist/components/typography/RichText.server.d.ts +3 -2
- package/dist/components/typography/RichText.server.d.ts.map +1 -1
- package/dist/components/typography/RichText.server.js +10 -5
- package/dist/components/typography/RichText.server.js.map +1 -1
- package/dist/components/typography/Text.d.ts +1 -1
- package/dist/components/typography/Text.d.ts.map +1 -1
- package/dist/components/typography/Text.server.d.ts +1 -1
- package/dist/components/typography/Text.server.d.ts.map +1 -1
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/index.d.ts.map +1 -1
- package/dist/components/typography/index.js +1 -1
- package/dist/components/typography/index.js.map +1 -1
- package/dist/config/config.editor.d.ts +4 -4
- package/dist/config/config.editor.d.ts.map +1 -1
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/merge.d.ts +1 -1
- package/dist/config/merge.d.ts.map +1 -1
- package/dist/config/presets.d.ts +15 -15
- package/dist/config/presets.d.ts.map +1 -1
- package/dist/config/presets.js +2 -2
- package/dist/config/presets.js.map +1 -1
- package/dist/config/types.d.ts +111 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +8 -0
- package/dist/config/types.js.map +1 -0
- package/dist/editor/PuckEditor.d.ts +88 -2
- package/dist/editor/PuckEditor.d.ts.map +1 -1
- package/dist/editor/PuckEditor.js +41 -13
- package/dist/editor/PuckEditor.js.map +1 -1
- package/dist/editor/PuckEditorImpl.client.d.ts +49 -4
- package/dist/editor/PuckEditorImpl.client.d.ts.map +1 -1
- package/dist/editor/PuckEditorImpl.client.js +191 -14
- package/dist/editor/PuckEditorImpl.client.js.map +1 -1
- package/dist/editor/ai-plugin-overrides.css +20 -0
- package/dist/editor/components/HeaderActions.d.ts +7 -2
- package/dist/editor/components/HeaderActions.d.ts.map +1 -1
- package/dist/editor/components/HeaderActions.js +16 -3
- package/dist/editor/components/HeaderActions.js.map +1 -1
- package/dist/editor/components/IframeWrapper.d.ts +13 -0
- package/dist/editor/components/IframeWrapper.d.ts.map +1 -1
- package/dist/editor/components/IframeWrapper.js +60 -4
- package/dist/editor/components/IframeWrapper.js.map +1 -1
- package/dist/editor/components/PreviewModal.d.ts +9 -1
- package/dist/editor/components/PreviewModal.d.ts.map +1 -1
- package/dist/editor/components/PreviewModal.js +36 -1
- package/dist/editor/components/PreviewModal.js.map +1 -1
- package/dist/editor/index.d.ts +4 -0
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/index.js +4 -0
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/plugins/VersionHistoryPanel.d.ts +43 -0
- package/dist/editor/plugins/VersionHistoryPanel.d.ts.map +1 -0
- package/dist/editor/plugins/VersionHistoryPanel.js +303 -0
- package/dist/editor/plugins/VersionHistoryPanel.js.map +1 -0
- package/dist/editor/plugins/index.d.ts +6 -3
- package/dist/editor/plugins/index.d.ts.map +1 -1
- package/dist/editor/plugins/index.js +7 -3
- package/dist/editor/plugins/index.js.map +1 -1
- package/dist/editor/plugins/versionHistoryPlugin.d.ts +37 -0
- package/dist/editor/plugins/versionHistoryPlugin.d.ts.map +1 -0
- package/dist/editor/plugins/versionHistoryPlugin.js +36 -0
- package/dist/editor/plugins/versionHistoryPlugin.js.map +1 -0
- package/dist/editor/utils/detectPageTree.d.ts +1 -1
- package/dist/editor/utils/detectPageTree.d.ts.map +1 -1
- package/dist/editor/utils/injectPageTreeFields.d.ts +1 -1
- package/dist/editor/utils/injectPageTreeFields.d.ts.map +1 -1
- package/dist/editor/utils/injectPageTreeFields.js +2 -2
- package/dist/editor/utils/injectPageTreeFields.js.map +1 -1
- package/dist/endpoints/ai.d.ts +36 -0
- package/dist/endpoints/ai.d.ts.map +1 -0
- package/dist/endpoints/ai.js +315 -0
- package/dist/endpoints/ai.js.map +1 -0
- package/dist/endpoints/context.d.ts +30 -0
- package/dist/endpoints/context.d.ts.map +1 -0
- package/dist/endpoints/context.js +123 -0
- package/dist/endpoints/context.js.map +1 -0
- package/dist/endpoints/prompts.d.ts +28 -0
- package/dist/endpoints/prompts.d.ts.map +1 -0
- package/dist/endpoints/prompts.js +118 -0
- package/dist/endpoints/prompts.js.map +1 -0
- package/dist/endpoints/styles.d.ts +19 -0
- package/dist/endpoints/styles.d.ts.map +1 -0
- package/dist/endpoints/styles.js +116 -0
- package/dist/endpoints/styles.js.map +1 -0
- package/dist/fields/AlignmentField.d.ts +1 -1
- package/dist/fields/AlignmentField.d.ts.map +1 -1
- package/dist/fields/AlignmentField.js +1 -0
- package/dist/fields/AlignmentField.js.map +1 -1
- package/dist/fields/AnimationField.d.ts +1 -1
- package/dist/fields/AnimationField.d.ts.map +1 -1
- package/dist/fields/BackgroundField.d.ts +1 -1
- package/dist/fields/BackgroundField.d.ts.map +1 -1
- package/dist/fields/BackgroundField.js +9 -4
- package/dist/fields/BackgroundField.js.map +1 -1
- package/dist/fields/BorderField.d.ts +1 -1
- package/dist/fields/BorderField.d.ts.map +1 -1
- package/dist/fields/BorderField.js +1 -0
- package/dist/fields/BorderField.js.map +1 -1
- package/dist/fields/ColorPickerField.d.ts +1 -1
- package/dist/fields/ColorPickerField.d.ts.map +1 -1
- package/dist/fields/ColorPickerField.js +4 -2
- package/dist/fields/ColorPickerField.js.map +1 -1
- package/dist/fields/ContentAlignmentField.d.ts +66 -0
- package/dist/fields/ContentAlignmentField.d.ts.map +1 -0
- package/dist/fields/ContentAlignmentField.js +255 -0
- package/dist/fields/ContentAlignmentField.js.map +1 -0
- package/dist/fields/DimensionsField.d.ts +1 -1
- package/dist/fields/DimensionsField.d.ts.map +1 -1
- package/dist/fields/DimensionsField.js +8 -2
- package/dist/fields/DimensionsField.js.map +1 -1
- package/dist/fields/FlexAlignmentField.d.ts +1 -1
- package/dist/fields/FlexAlignmentField.d.ts.map +1 -1
- package/dist/fields/FolderPickerField.d.ts +1 -1
- package/dist/fields/FolderPickerField.d.ts.map +1 -1
- package/dist/fields/GradientEditor.d.ts.map +1 -1
- package/dist/fields/GradientEditor.js +3 -0
- package/dist/fields/GradientEditor.js.map +1 -1
- package/dist/fields/LockedField.d.ts +1 -1
- package/dist/fields/LockedField.d.ts.map +1 -1
- package/dist/fields/MarginField.d.ts +1 -1
- package/dist/fields/MarginField.d.ts.map +1 -1
- package/dist/fields/MediaField.d.ts +1 -1
- package/dist/fields/MediaField.d.ts.map +1 -1
- package/dist/fields/MediaField.js +3 -2
- package/dist/fields/MediaField.js.map +1 -1
- package/dist/fields/PaddingField.d.ts +1 -1
- package/dist/fields/PaddingField.d.ts.map +1 -1
- package/dist/fields/PageSegmentField.d.ts +18 -1
- package/dist/fields/PageSegmentField.d.ts.map +1 -1
- package/dist/fields/PageSegmentField.js +106 -1
- package/dist/fields/PageSegmentField.js.map +1 -1
- package/dist/fields/ResetField.d.ts +1 -1
- package/dist/fields/ResetField.d.ts.map +1 -1
- package/dist/fields/ResetField.js +1 -1
- package/dist/fields/ResetField.js.map +1 -1
- package/dist/fields/ResponsiveField.d.ts +1 -1
- package/dist/fields/ResponsiveField.d.ts.map +1 -1
- package/dist/fields/ResponsiveField.js +5 -2
- package/dist/fields/ResponsiveField.js.map +1 -1
- package/dist/fields/ResponsiveVisibilityField.d.ts +1 -1
- package/dist/fields/ResponsiveVisibilityField.d.ts.map +1 -1
- package/dist/fields/ResponsiveVisibilityField.js +4 -3
- package/dist/fields/ResponsiveVisibilityField.js.map +1 -1
- package/dist/fields/SizeField.d.ts +3 -25
- package/dist/fields/SizeField.d.ts.map +1 -1
- package/dist/fields/SizeField.js +8 -34
- package/dist/fields/SizeField.js.map +1 -1
- package/dist/fields/SlugPreviewField.d.ts +1 -1
- package/dist/fields/SlugPreviewField.d.ts.map +1 -1
- package/dist/fields/TemplateField.d.ts +1 -1
- package/dist/fields/TemplateField.d.ts.map +1 -1
- package/dist/fields/TemplateField.js +1 -1
- package/dist/fields/TemplateField.js.map +1 -1
- package/dist/fields/TransformField.d.ts +1 -1
- package/dist/fields/TransformField.d.ts.map +1 -1
- package/dist/fields/TransformField.js +2 -0
- package/dist/fields/TransformField.js.map +1 -1
- package/dist/fields/VerticalAlignmentField.d.ts +1 -1
- package/dist/fields/VerticalAlignmentField.d.ts.map +1 -1
- package/dist/fields/WidthField.d.ts +1 -1
- package/dist/fields/WidthField.d.ts.map +1 -1
- package/dist/fields/index.d.ts +9 -37
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.js +21 -79
- package/dist/fields/index.js.map +1 -1
- package/dist/fields/richtext/controls/ColorPickerControl.d.ts +16 -0
- package/dist/fields/richtext/controls/ColorPickerControl.d.ts.map +1 -0
- package/dist/fields/richtext/controls/ColorPickerControl.js +116 -0
- package/dist/fields/richtext/controls/ColorPickerControl.js.map +1 -0
- package/dist/fields/richtext/controls/DropdownPortal.d.ts +17 -0
- package/dist/fields/richtext/controls/DropdownPortal.d.ts.map +1 -0
- package/dist/fields/richtext/controls/DropdownPortal.js +90 -0
- package/dist/fields/richtext/controls/DropdownPortal.js.map +1 -0
- package/dist/fields/richtext/controls/FontSizeControl.d.ts +8 -0
- package/dist/fields/richtext/controls/FontSizeControl.d.ts.map +1 -0
- package/dist/fields/richtext/controls/FontSizeControl.js +62 -0
- package/dist/fields/richtext/controls/FontSizeControl.js.map +1 -0
- package/dist/fields/richtext/controls/HighlightControl.d.ts +9 -0
- package/dist/fields/richtext/controls/HighlightControl.d.ts.map +1 -0
- package/dist/fields/richtext/controls/HighlightControl.js +44 -0
- package/dist/fields/richtext/controls/HighlightControl.js.map +1 -0
- package/dist/fields/richtext/controls/index.d.ts +11 -0
- package/dist/fields/richtext/controls/index.d.ts.map +1 -0
- package/dist/fields/richtext/controls/index.js +16 -0
- package/dist/fields/richtext/controls/index.js.map +1 -0
- package/dist/fields/richtext/controls/shared.d.ts +97 -0
- package/dist/fields/richtext/controls/shared.d.ts.map +1 -0
- package/dist/fields/richtext/controls/shared.js +344 -0
- package/dist/fields/richtext/controls/shared.js.map +1 -0
- package/dist/fields/richtext/createRichTextField.d.ts +165 -0
- package/dist/fields/richtext/createRichTextField.d.ts.map +1 -0
- package/dist/fields/richtext/createRichTextField.js +139 -0
- package/dist/fields/richtext/createRichTextField.js.map +1 -0
- package/dist/fields/richtext/extensions/FontSize.d.ts +23 -0
- package/dist/fields/richtext/extensions/FontSize.d.ts.map +1 -0
- package/dist/fields/richtext/extensions/FontSize.js +47 -0
- package/dist/fields/richtext/extensions/FontSize.js.map +1 -0
- package/dist/fields/richtext/extensions/index.d.ts +5 -0
- package/dist/fields/richtext/extensions/index.d.ts.map +1 -0
- package/dist/fields/richtext/extensions/index.js +5 -0
- package/dist/fields/richtext/extensions/index.js.map +1 -0
- package/dist/fields/richtext/index.d.ts +14 -0
- package/dist/fields/richtext/index.d.ts.map +1 -0
- package/dist/fields/richtext/index.js +19 -0
- package/dist/fields/richtext/index.js.map +1 -0
- package/dist/fields/richtext/richtext-menu.css +50 -0
- package/dist/fields/shared.d.ts +27 -1
- package/dist/fields/shared.d.ts.map +1 -1
- package/dist/fields/shared.js +34 -0
- package/dist/fields/shared.js.map +1 -1
- package/dist/layouts/types.d.ts +30 -0
- package/dist/layouts/types.d.ts.map +1 -1
- package/dist/plugin/index.d.ts +1 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +111 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/render/HybridPageRenderer.d.ts +47 -4
- package/dist/render/HybridPageRenderer.d.ts.map +1 -1
- package/dist/render/HybridPageRenderer.js +45 -0
- package/dist/render/HybridPageRenderer.js.map +1 -1
- package/dist/render/PageRenderer.d.ts +1 -1
- package/dist/render/PageRenderer.d.ts.map +1 -1
- package/dist/render/PageRenderer.js +1 -1
- package/dist/render/PageRenderer.js.map +1 -1
- package/dist/render/PuckEditor.client.d.ts +2 -2
- package/dist/render/PuckEditor.client.d.ts.map +1 -1
- package/dist/render/PuckEditor.client.js +2 -2
- package/dist/render/PuckEditor.client.js.map +1 -1
- package/dist/render/index.d.ts +2 -2
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/types/index.d.ts +36 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/views/PuckConfigContext.d.ts +56 -2
- package/dist/views/PuckConfigContext.d.ts.map +1 -1
- package/dist/views/PuckConfigContext.js +6 -3
- package/dist/views/PuckConfigContext.js.map +1 -1
- package/dist/views/PuckEditorView.d.ts.map +1 -1
- package/dist/views/PuckEditorView.js +36 -8
- package/dist/views/PuckEditorView.js.map +1 -1
- package/package.json +34 -10
- package/dist/components/typography/RichText.d.ts +0 -20
- package/dist/components/typography/RichText.d.ts.map +0 -1
- package/dist/components/typography/RichText.js +0 -73
- package/dist/components/typography/RichText.js.map +0 -1
- package/dist/fields/TiptapField.d.ts +0 -40
- package/dist/fields/TiptapField.d.ts.map +0 -1
- package/dist/fields/TiptapField.js +0 -857
- package/dist/fields/TiptapField.js.map +0 -1
- package/dist/fields/TiptapModal.d.ts +0 -10
- package/dist/fields/TiptapModal.d.ts.map +0 -1
- package/dist/fields/TiptapModal.js +0 -114
- package/dist/fields/TiptapModal.js.map +0 -1
- package/dist/fields/TiptapModalField.d.ts +0 -23
- package/dist/fields/TiptapModalField.d.ts.map +0 -1
- package/dist/fields/TiptapModalField.js +0 -55
- package/dist/fields/TiptapModalField.js.map +0 -1
- package/dist/fields/richtext-output.css +0 -219
- package/dist/fields/tiptap-styles.css +0 -248
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptEditorPlugin.d.ts","sourceRoot":"","sources":["../../../src/ai/plugins/promptEditorPlugin.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,yBAA8B,GACtC,UAAU,CAqBZ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Sparkles } from 'lucide-react';
|
|
4
|
+
import { PromptEditorPanel } from './PromptEditorPanel.js';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a Puck plugin for managing AI prompts in the editor
|
|
7
|
+
*
|
|
8
|
+
* This plugin adds an "AI Prompts" panel to the Puck plugin rail where users
|
|
9
|
+
* can view, create, edit, and delete example prompts without writing code.
|
|
10
|
+
*
|
|
11
|
+
* @example Basic usage
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { createPromptEditorPlugin } from '@delmaredigital/payload-puck/ai'
|
|
14
|
+
*
|
|
15
|
+
* const promptEditorPlugin = createPromptEditorPlugin()
|
|
16
|
+
*
|
|
17
|
+
* <PuckEditor plugins={[aiPlugin, promptEditorPlugin]} />
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example With custom options
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const promptEditorPlugin = createPromptEditorPlugin({
|
|
23
|
+
* apiEndpoint: '/api/puck/ai-prompts',
|
|
24
|
+
* canEdit: true,
|
|
25
|
+
* canCreate: true,
|
|
26
|
+
* canDelete: false, // Disable delete for non-admins
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function createPromptEditorPlugin(options = {}) {
|
|
31
|
+
const { apiEndpoint = '/api/puck/ai-prompts', canEdit = true, canCreate = true, canDelete = true, } = options;
|
|
32
|
+
return {
|
|
33
|
+
name: 'prompt-editor',
|
|
34
|
+
label: 'AI Prompts',
|
|
35
|
+
icon: _jsx(Sparkles, { size: 16 }),
|
|
36
|
+
render: () => (_jsx(PromptEditorPanel, { apiEndpoint: apiEndpoint, canEdit: canEdit, canCreate: canCreate, canDelete: canDelete })),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=promptEditorPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptEditorPlugin.js","sourceRoot":"","sources":["../../../src/ai/plugins/promptEditorPlugin.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAAqC,EAAE;IAEvC,MAAM,EACJ,WAAW,GAAG,sBAAsB,EACpC,OAAO,GAAG,IAAI,EACd,SAAS,GAAG,IAAI,EAChB,SAAS,GAAG,IAAI,GACjB,GAAG,OAAO,CAAA;IAEX,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI;QAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,iBAAiB,IAChB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,GACpB,CACH;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComponentAiOverrides } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Default AI configurations for built-in payload-puck components
|
|
4
|
+
*
|
|
5
|
+
* These provide sensible defaults that help the AI understand how to use
|
|
6
|
+
* each component effectively. Users can override or extend these.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: Custom fields (type: 'custom') are automatically excluded by injectAiConfig.
|
|
9
|
+
* This includes: _reset, visibility, background, media, animation, padding, margin,
|
|
10
|
+
* border, dimensions, transform, alignment fields, etc.
|
|
11
|
+
*
|
|
12
|
+
* @example Using defaults
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { injectAiConfig, defaultComponentAiConfig } from '@delmaredigital/payload-puck/ai'
|
|
15
|
+
*
|
|
16
|
+
* const aiEnabledConfig = injectAiConfig(editorConfig, defaultComponentAiConfig)
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example Extending defaults
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const customAiConfig = {
|
|
22
|
+
* ...defaultComponentAiConfig,
|
|
23
|
+
* Heading: {
|
|
24
|
+
* ...defaultComponentAiConfig.Heading,
|
|
25
|
+
* ai: {
|
|
26
|
+
* instructions: 'Use our brand voice',
|
|
27
|
+
* },
|
|
28
|
+
* },
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const defaultComponentAiConfig: ComponentAiOverrides;
|
|
33
|
+
/**
|
|
34
|
+
* Minimal AI configuration for components
|
|
35
|
+
*
|
|
36
|
+
* Use this for a lighter-weight configuration that only marks
|
|
37
|
+
* required fields. Custom fields are still auto-excluded by injectAiConfig.
|
|
38
|
+
*/
|
|
39
|
+
export declare const minimalComponentAiConfig: ComponentAiOverrides;
|
|
40
|
+
//# sourceMappingURL=componentAiDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentAiDefaults.d.ts","sourceRoot":"","sources":["../../../src/ai/presets/componentAiDefaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,wBAAwB,EAAE,oBA2MtC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,oBA2BtC,CAAA"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default AI configurations for built-in payload-puck components
|
|
3
|
+
*
|
|
4
|
+
* These provide sensible defaults that help the AI understand how to use
|
|
5
|
+
* each component effectively. Users can override or extend these.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: Custom fields (type: 'custom') are automatically excluded by injectAiConfig.
|
|
8
|
+
* This includes: _reset, visibility, background, media, animation, padding, margin,
|
|
9
|
+
* border, dimensions, transform, alignment fields, etc.
|
|
10
|
+
*
|
|
11
|
+
* @example Using defaults
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { injectAiConfig, defaultComponentAiConfig } from '@delmaredigital/payload-puck/ai'
|
|
14
|
+
*
|
|
15
|
+
* const aiEnabledConfig = injectAiConfig(editorConfig, defaultComponentAiConfig)
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example Extending defaults
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const customAiConfig = {
|
|
21
|
+
* ...defaultComponentAiConfig,
|
|
22
|
+
* Heading: {
|
|
23
|
+
* ...defaultComponentAiConfig.Heading,
|
|
24
|
+
* ai: {
|
|
25
|
+
* instructions: 'Use our brand voice',
|
|
26
|
+
* },
|
|
27
|
+
* },
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export const defaultComponentAiConfig = {
|
|
32
|
+
// Typography Components
|
|
33
|
+
Heading: {
|
|
34
|
+
ai: {
|
|
35
|
+
instructions: 'Use for section headings and titles. Choose appropriate heading level (h1-h6) based on document structure.',
|
|
36
|
+
},
|
|
37
|
+
fields: {
|
|
38
|
+
text: {
|
|
39
|
+
ai: { required: true },
|
|
40
|
+
},
|
|
41
|
+
level: {
|
|
42
|
+
ai: {
|
|
43
|
+
instructions: 'Use h1 only once per page for the main title. Use h2 for main sections, h3 for subsections.',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
Text: {
|
|
49
|
+
ai: {
|
|
50
|
+
instructions: 'Use for body text and single paragraphs.',
|
|
51
|
+
},
|
|
52
|
+
fields: {
|
|
53
|
+
content: {
|
|
54
|
+
ai: { required: true },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
RichText: {
|
|
59
|
+
ai: {
|
|
60
|
+
instructions: 'Use for formatted text content with multiple paragraphs, lists, links, or other rich formatting.',
|
|
61
|
+
},
|
|
62
|
+
fields: {
|
|
63
|
+
content: {
|
|
64
|
+
ai: {
|
|
65
|
+
required: true,
|
|
66
|
+
// TipTap content is complex, provide schema hint
|
|
67
|
+
schema: { type: 'string' },
|
|
68
|
+
instructions: 'Provide HTML content for the rich text editor.',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
// Interactive Components
|
|
74
|
+
Button: {
|
|
75
|
+
ai: {
|
|
76
|
+
instructions: 'Use for call-to-action buttons. Always provide meaningful, action-oriented button text.',
|
|
77
|
+
},
|
|
78
|
+
fields: {
|
|
79
|
+
label: {
|
|
80
|
+
ai: {
|
|
81
|
+
required: true,
|
|
82
|
+
instructions: 'Use action-oriented text like "Get Started", "Learn More", "Sign Up", "Contact Us".',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
href: {
|
|
86
|
+
ai: {
|
|
87
|
+
required: true,
|
|
88
|
+
instructions: 'Use # as placeholder if the actual URL is unknown.',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
variant: {
|
|
92
|
+
ai: {
|
|
93
|
+
instructions: 'Use "primary" for main CTAs, "secondary" for less prominent actions, "outline" for subtle actions.',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
// Media Components
|
|
99
|
+
Image: {
|
|
100
|
+
ai: {
|
|
101
|
+
instructions: 'Use for displaying images. Note: AI cannot select actual images from the media library.',
|
|
102
|
+
},
|
|
103
|
+
fields: {
|
|
104
|
+
alt: {
|
|
105
|
+
ai: {
|
|
106
|
+
instructions: 'Provide descriptive alt text for accessibility. Describe what the image shows.',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
// Layout Components
|
|
112
|
+
Section: {
|
|
113
|
+
ai: {
|
|
114
|
+
instructions: 'Use to group related content into a section. Sections can have background colors and padding.',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
Container: {
|
|
118
|
+
ai: {
|
|
119
|
+
instructions: 'Use to constrain content width and center it on the page. Good for text-heavy sections.',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
Flex: {
|
|
123
|
+
ai: {
|
|
124
|
+
instructions: 'Use for horizontal or vertical layouts with flexible spacing between items.',
|
|
125
|
+
},
|
|
126
|
+
fields: {
|
|
127
|
+
direction: {
|
|
128
|
+
ai: {
|
|
129
|
+
instructions: 'Use "row" for horizontal layout, "column" for vertical stacking.',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
gap: {
|
|
133
|
+
ai: {
|
|
134
|
+
instructions: 'Set spacing between items. Common values: 8, 16, 24, 32.',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
Grid: {
|
|
140
|
+
ai: {
|
|
141
|
+
instructions: 'Use for multi-column layouts. Specify the number of columns.',
|
|
142
|
+
},
|
|
143
|
+
fields: {
|
|
144
|
+
columns: {
|
|
145
|
+
ai: {
|
|
146
|
+
instructions: 'Use 2-4 columns for most layouts. 12-column grid for advanced layouts.',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
// Content Components
|
|
152
|
+
Card: {
|
|
153
|
+
ai: {
|
|
154
|
+
instructions: 'Use for content cards with optional image, title, and description. Good for feature lists, team members, products.',
|
|
155
|
+
},
|
|
156
|
+
fields: {
|
|
157
|
+
title: {
|
|
158
|
+
ai: { required: true },
|
|
159
|
+
},
|
|
160
|
+
description: {
|
|
161
|
+
ai: {
|
|
162
|
+
instructions: 'Keep descriptions concise, 1-2 sentences.',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
Accordion: {
|
|
168
|
+
ai: {
|
|
169
|
+
instructions: 'Use for FAQ sections or collapsible content. Each item has a title and expandable content.',
|
|
170
|
+
},
|
|
171
|
+
fields: {
|
|
172
|
+
items: {
|
|
173
|
+
ai: {
|
|
174
|
+
required: true,
|
|
175
|
+
instructions: 'Provide an array of items with title and content properties.',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
// Utility Components
|
|
181
|
+
Spacer: {
|
|
182
|
+
ai: {
|
|
183
|
+
instructions: 'Use to add vertical spacing between elements. Specify height in pixels.',
|
|
184
|
+
},
|
|
185
|
+
fields: {
|
|
186
|
+
height: {
|
|
187
|
+
ai: {
|
|
188
|
+
instructions: 'Common values: 16, 24, 32, 48, 64. Use larger values for section breaks.',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
Divider: {
|
|
194
|
+
ai: {
|
|
195
|
+
instructions: 'Use to visually separate sections of content with a horizontal line.',
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
// Template Component
|
|
199
|
+
Template: {
|
|
200
|
+
ai: {
|
|
201
|
+
instructions: 'Use to insert a saved page template. Note: AI cannot select actual templates.',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Minimal AI configuration for components
|
|
207
|
+
*
|
|
208
|
+
* Use this for a lighter-weight configuration that only marks
|
|
209
|
+
* required fields. Custom fields are still auto-excluded by injectAiConfig.
|
|
210
|
+
*/
|
|
211
|
+
export const minimalComponentAiConfig = {
|
|
212
|
+
Heading: {
|
|
213
|
+
fields: {
|
|
214
|
+
text: { ai: { required: true } },
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
Text: {
|
|
218
|
+
fields: {
|
|
219
|
+
content: { ai: { required: true } },
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
RichText: {
|
|
223
|
+
fields: {
|
|
224
|
+
content: {
|
|
225
|
+
ai: {
|
|
226
|
+
required: true,
|
|
227
|
+
schema: { type: 'string' },
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
Button: {
|
|
233
|
+
fields: {
|
|
234
|
+
label: { ai: { required: true } },
|
|
235
|
+
href: { ai: { required: true } },
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
//# sourceMappingURL=componentAiDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentAiDefaults.js","sourceRoot":"","sources":["../../../src/ai/presets/componentAiDefaults.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Preset Configurations
|
|
3
|
+
*
|
|
4
|
+
* This module exports comprehensive AI instructions for Puck components
|
|
5
|
+
* and page composition patterns.
|
|
6
|
+
*
|
|
7
|
+
* @example Using comprehensive config (recommended)
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { comprehensiveComponentAiConfig } from '@delmaredigital/payload-puck/ai'
|
|
10
|
+
* import { injectAiConfig } from '@delmaredigital/payload-puck/ai'
|
|
11
|
+
*
|
|
12
|
+
* const aiEnabledConfig = injectAiConfig(editorConfig, comprehensiveComponentAiConfig)
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example Adding page pattern context to AI system prompt
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { pagePatternSystemContext } from '@delmaredigital/payload-puck/ai'
|
|
18
|
+
*
|
|
19
|
+
* createPuckAiApiRoutes({
|
|
20
|
+
* ai: {
|
|
21
|
+
* context: `${yourBusinessContext}\n\n${pagePatternSystemContext}`,
|
|
22
|
+
* },
|
|
23
|
+
* })
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
import type { ComponentAiOverrides } from '../types.js';
|
|
27
|
+
import { pagePatternContext, componentFieldReference } from './instructions/pagePatterns.js';
|
|
28
|
+
export { defaultComponentAiConfig, minimalComponentAiConfig, } from './componentAiDefaults.js';
|
|
29
|
+
/**
|
|
30
|
+
* Comprehensive AI configuration for all built-in components
|
|
31
|
+
*
|
|
32
|
+
* Combines detailed instructions from all component categories:
|
|
33
|
+
* - Typography: Heading, Text, RichText
|
|
34
|
+
* - Layout: Section, Container, Flex, Grid, Spacer
|
|
35
|
+
* - Interactive: Button, Card, Accordion, Divider
|
|
36
|
+
* - Media: Image, Template
|
|
37
|
+
*
|
|
38
|
+
* Each component includes:
|
|
39
|
+
* - Purpose and usage guidelines
|
|
40
|
+
* - Correct field names and recommended values
|
|
41
|
+
* - Composition patterns with other components
|
|
42
|
+
* - Common mistakes to avoid
|
|
43
|
+
*/
|
|
44
|
+
export declare const comprehensiveComponentAiConfig: ComponentAiOverrides;
|
|
45
|
+
/**
|
|
46
|
+
* System context string for AI page generation
|
|
47
|
+
*
|
|
48
|
+
* Contains comprehensive guidance on:
|
|
49
|
+
* - Page structure patterns (hero, features, testimonials, FAQ, CTA)
|
|
50
|
+
* - Page type templates (landing, about, services, contact)
|
|
51
|
+
* - Typography hierarchy rules
|
|
52
|
+
* - Spacing and color guidelines
|
|
53
|
+
* - Responsive considerations
|
|
54
|
+
*
|
|
55
|
+
* Add this to your AI context for better page generation:
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* createPuckAiApiRoutes({
|
|
60
|
+
* ai: {
|
|
61
|
+
* context: `${yourBusinessContext}\n\n${pagePatternSystemContext}`,
|
|
62
|
+
* },
|
|
63
|
+
* })
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare const pagePatternSystemContext = "\n## Page Composition Guidelines\n\nWhen creating pages, follow these patterns to build professional, well-structured layouts.\n\n### Page Structure Fundamentals\n\nEVERY page should be composed of multiple Section components at the root level:\n- Pages are built by stacking Section components vertically\n- Each Section represents a distinct content area\n- Sections should NOT be nested inside other Sections\n- Use Flex and Grid INSIDE Sections for layout\n\n### Hero Section Pattern\n\nThe hero is typically the first section on a landing page.\n\nSTRUCTURE:\n```\nSection (with sectionPadding, optional sectionBackground)\n \u2514\u2500 Flex (direction: column, alignItems: center, gap: 24)\n \u251C\u2500 Heading (level: h1, alignment: center) - Main headline\n \u251C\u2500 Text (size: lg, alignment: center) - Subheadline/description\n \u2514\u2500 Flex (direction: row, gap: 16, justifyContent: center) - CTA buttons\n \u251C\u2500 Button (variant: default, size: lg) - Primary CTA\n \u2514\u2500 Button (variant: outline) - Secondary CTA\n```\n\nVARIATIONS:\n- Minimal: Just Heading + Button\n- Standard: Heading + Text + Button(s)\n- Full: Heading + Text + Buttons + Image below\n\n### Features Section Pattern\n\nShowcase features, services, or benefits.\n\nSTRUCTURE:\n```\nSection (light or white background)\n \u251C\u2500 Flex (direction: column, alignItems: center, gap: 16)\n \u2502 \u251C\u2500 Heading (level: h2, alignment: center) - Section title\n \u2502 \u2514\u2500 Text (alignment: center) - Section description\n \u2514\u2500 Grid (numColumns: 3, gap: 24)\n \u251C\u2500 Card (heading + text, no image)\n \u251C\u2500 Card\n \u2514\u2500 Card\n```\n\nVARIATIONS:\n- 2 columns for comparison features\n- 3 columns for standard features (most common)\n- 4 columns for icon-style features\n\n### Testimonials Section Pattern\n\nSocial proof with customer quotes.\n\nSTRUCTURE:\n```\nSection (subtle background color for contrast)\n \u251C\u2500 Heading (level: h2, alignment: center) - \"What Our Customers Say\"\n \u2514\u2500 Grid (numColumns: 2 or 3, gap: 24)\n \u251C\u2500 Card (text: quote, heading: name + role)\n \u251C\u2500 Card\n \u2514\u2500 Card\n```\n\n### FAQ Section Pattern\n\nFrequently asked questions with expandable answers.\n\nSTRUCTURE:\n```\nSection\n \u2514\u2500 Container (for constrained width)\n \u251C\u2500 Heading (level: h2, alignment: center) - \"Frequently Asked Questions\"\n \u2514\u2500 Accordion (items array with questions/answers)\n```\n\n### CTA (Call-to-Action) Section Pattern\n\nFinal conversion section, often with contrasting background.\n\nSTRUCTURE:\n```\nSection (contrasting sectionBackground color)\n \u2514\u2500 Flex (direction: column, alignItems: center, gap: 24)\n \u251C\u2500 Heading (level: h2, alignment: center) - Compelling headline\n \u251C\u2500 Text (alignment: center) - Supporting message\n \u2514\u2500 Button (variant: default, size: lg) - Single strong CTA\n```\n\n### About Section Pattern\n\nCompany or personal introduction.\n\nSTRUCTURE:\n```\nSection\n \u2514\u2500 Flex (direction: row, gap: 48, alignItems: center)\n \u251C\u2500 Image (aspectRatio: 4:3) - Team photo or illustration\n \u2514\u2500 Flex (direction: column, gap: 16)\n \u251C\u2500 Heading (level: h2)\n \u251C\u2500 Text or RichText\n \u2514\u2500 Button (optional)\n```\n\n### Team Section Pattern\n\nTeam members or leadership profiles.\n\nSTRUCTURE:\n```\nSection\n \u251C\u2500 Heading (level: h2, alignment: center) - \"Meet Our Team\"\n \u2514\u2500 Grid (numColumns: 3 or 4, gap: 24)\n \u251C\u2500 Card (image: avatar, heading: name, text: role)\n \u251C\u2500 Card\n \u251C\u2500 Card\n \u2514\u2500 Card\n```\n\n### Pricing Section Pattern\n\nPricing tiers or plans.\n\nSTRUCTURE:\n```\nSection\n \u251C\u2500 Flex (direction: column, alignItems: center)\n \u2502 \u251C\u2500 Heading (level: h2, alignment: center) - \"Simple Pricing\"\n \u2502 \u2514\u2500 Text (alignment: center) - \"Choose the plan that works for you\"\n \u2514\u2500 Grid (numColumns: 3, gap: 24)\n \u251C\u2500 Card (heading: plan name, text: price + features)\n \u251C\u2500 Card (featured tier)\n \u2514\u2500 Card\n```\n\n---\n\n## Page Type Templates\n\n### Landing Page Structure\n1. Hero Section (headline, subheadline, CTA buttons)\n2. Features Section (3-column grid of benefit cards)\n3. About/How It Works Section (image + text side-by-side)\n4. Testimonials Section (2-3 customer quotes)\n5. FAQ Section (common questions in accordion)\n6. CTA Section (final conversion push)\n\n### About Page Structure\n1. Hero Section (company name, mission statement)\n2. Story Section (company history/journey)\n3. Values Section (3-4 core values in cards)\n4. Team Section (team member grid)\n5. CTA Section (contact or join us)\n\n### Services Page Structure\n1. Hero Section (services overview)\n2. Services Grid (3-4 service cards)\n3. Process Section (how you work)\n4. Testimonials (client success stories)\n5. CTA Section (get started)\n\n### Contact Page Structure\n1. Hero Section (contact headline)\n2. Contact Info Section (address, phone, email)\n3. FAQ Section (common questions)\n\n---\n\n## Typography Hierarchy Rules\n\nHEADING LEVELS:\n- h1: Page title in hero (ONE per page maximum)\n- h2: Major section headings\n- h3: Card titles, subsection headings\n- h4-h6: Rarely needed, for deeply nested content\n\nTEXT SIZES:\n- xl/lg: Hero subtitles, important callouts\n- base: Body text, descriptions (default)\n- sm: Secondary text, captions\n- xs: Legal text, fine print\n\n---\n\n## Spacing Guidelines\n\nSECTION PADDING (sectionPadding):\n- Hero sections: 80-96px top/bottom\n- Standard sections: 48-64px top/bottom\n- Dense sections: 32-48px top/bottom\n\nCOMPONENT GAP:\n- Tight: 8px (buttons in a compact row)\n- Compact: 16px (related elements)\n- Comfortable: 24px (card grids, flex items)\n- Spacious: 32-48px (section content groups)\n\nGRID GAP:\n- Cards: 24px typical\n- Compact grid: 16px\n- Spacious grid: 32px\n\n---\n\n## Color & Background Strategy\n\nUse sectionBackground to create visual hierarchy and professional appearance.\n\nSECTION BACKGROUND PATTERNS:\n- Hero Section: Dark or gradient background to create impact\n- Features/Content: Light or white background\n- Testimonials: Subtle contrasting background\n- CTA Section: Brand color or contrasting background\n- Alternating: Switch between white and light gray for visual rhythm\n\nVISUAL RHYTHM:\n- Alternate section backgrounds to create clear visual separation\n- Hero sections typically have bold backgrounds (dark, gradient, or brand color)\n- Content sections typically have light/white backgrounds\n- CTA sections often use brand colors for emphasis\n\n---\n\n## Responsive Considerations\n\nGRID BEHAVIOR:\n- Grid automatically stacks to single column on mobile\n- Plan content to work in both multi-column and stacked views\n\nFLEX BEHAVIOR:\n- Row layouts wrap on narrow screens\n- Consider how button groups will stack\n\nCONTENT WIDTH:\n- Section content constrained to ~1200px max-width by default\n- Text-heavy sections might use narrower (800-900px) constraint\n\n\n\n## Quick Field Reference\n\nBUTTON: text (required), link (required), variant (default/secondary/outline), size (sm/default/lg), openInNewTab (yes/no)\n\nCARD: heading (required), text, image (user selects), link, shadow (none/sm/md/lg/xl)\n\nHEADING: text (required), level (h1-h6), alignment (left/center/right)\n\nTEXT: content (required), size (xs/sm/base/lg/xl), alignment (left/center/right)\n\nRICHTEXT: content (required, HTML string)\n\nACCORDION: items (array of {title, content, defaultOpen}), allowMultiple (yes/no)\n\nSECTION: content (slot), semanticElement, id, sectionBackground, sectionPadding\n - sectionBackground: { type: 'solid', solid: { hex, opacity? } } or { type: 'gradient', gradient: { type, angle, stops } }\n - sectionPadding: { xs: { top, right, bottom, left, unit: 'px', linked: boolean } }\n\nFLEX: content (slot), direction (row/column), justifyContent, alignItems, gap (number), wrap (wrap/nowrap)\n - justifyContent: 'flex-start' | 'center' | 'flex-end' | 'space-between'\n - alignItems: 'flex-start' | 'center' | 'flex-end' | 'stretch'\n\nGRID: content (slot), numColumns (1-12), gap (number)\n\nSPACER: size (8/16/24/32/48/64/80/96/128), direction (vertical/horizontal/both)\n\nDIVIDER: style (solid/dashed/dotted)\n\nIMAGE: image (user selects), alt, aspectRatio (auto/1:1/16:9/4:3/3:2), link\n";
|
|
67
|
+
/**
|
|
68
|
+
* Just the page pattern context (without field reference)
|
|
69
|
+
* Use if you only need the composition patterns
|
|
70
|
+
*/
|
|
71
|
+
export { pagePatternContext };
|
|
72
|
+
/**
|
|
73
|
+
* Just the field reference (without patterns)
|
|
74
|
+
* Use if you only need a quick field name reference
|
|
75
|
+
*/
|
|
76
|
+
export { componentFieldReference };
|
|
77
|
+
/**
|
|
78
|
+
* List of all component names by category
|
|
79
|
+
*/
|
|
80
|
+
export declare const allComponents: {
|
|
81
|
+
readonly typography: readonly ["Heading", "Text", "RichText"];
|
|
82
|
+
readonly layout: readonly ["Section", "Container", "Flex", "Grid", "Spacer"];
|
|
83
|
+
readonly interactive: readonly ["Button", "Card", "Accordion", "Divider"];
|
|
84
|
+
readonly media: readonly ["Image", "Template"];
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Flat list of all component names
|
|
88
|
+
*/
|
|
89
|
+
export declare const componentNames: readonly ["Heading", "Text", "RichText", "Section", "Container", "Flex", "Grid", "Spacer", "Button", "Card", "Accordion", "Divider", "Image", "Template"];
|
|
90
|
+
export { typographyInstructions } from './instructions/typography.js';
|
|
91
|
+
export { layoutInstructions } from './instructions/layout.js';
|
|
92
|
+
export { interactiveInstructions } from './instructions/interactive.js';
|
|
93
|
+
export { mediaInstructions } from './instructions/media.js';
|
|
94
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/presets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAOvD,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAG5F,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,8BAA8B,EAAE,oBAK5C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,g9QAAwD,CAAA;AAE7F;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,CAAA;AAE7B;;;GAGG;AACH,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,cAAc,2JAKjB,CAAA;AAGV,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Preset Configurations
|
|
3
|
+
*
|
|
4
|
+
* This module exports comprehensive AI instructions for Puck components
|
|
5
|
+
* and page composition patterns.
|
|
6
|
+
*
|
|
7
|
+
* @example Using comprehensive config (recommended)
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { comprehensiveComponentAiConfig } from '@delmaredigital/payload-puck/ai'
|
|
10
|
+
* import { injectAiConfig } from '@delmaredigital/payload-puck/ai'
|
|
11
|
+
*
|
|
12
|
+
* const aiEnabledConfig = injectAiConfig(editorConfig, comprehensiveComponentAiConfig)
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example Adding page pattern context to AI system prompt
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { pagePatternSystemContext } from '@delmaredigital/payload-puck/ai'
|
|
18
|
+
*
|
|
19
|
+
* createPuckAiApiRoutes({
|
|
20
|
+
* ai: {
|
|
21
|
+
* context: `${yourBusinessContext}\n\n${pagePatternSystemContext}`,
|
|
22
|
+
* },
|
|
23
|
+
* })
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
// Import instruction modules
|
|
27
|
+
import { typographyInstructions, typographyComponents } from './instructions/typography.js';
|
|
28
|
+
import { layoutInstructions, layoutComponents } from './instructions/layout.js';
|
|
29
|
+
import { interactiveInstructions, interactiveComponents } from './instructions/interactive.js';
|
|
30
|
+
import { mediaInstructions, mediaComponents } from './instructions/media.js';
|
|
31
|
+
import { pagePatternContext, componentFieldReference } from './instructions/pagePatterns.js';
|
|
32
|
+
// Re-export legacy config for backward compatibility
|
|
33
|
+
export { defaultComponentAiConfig, minimalComponentAiConfig, } from './componentAiDefaults.js';
|
|
34
|
+
/**
|
|
35
|
+
* Comprehensive AI configuration for all built-in components
|
|
36
|
+
*
|
|
37
|
+
* Combines detailed instructions from all component categories:
|
|
38
|
+
* - Typography: Heading, Text, RichText
|
|
39
|
+
* - Layout: Section, Container, Flex, Grid, Spacer
|
|
40
|
+
* - Interactive: Button, Card, Accordion, Divider
|
|
41
|
+
* - Media: Image, Template
|
|
42
|
+
*
|
|
43
|
+
* Each component includes:
|
|
44
|
+
* - Purpose and usage guidelines
|
|
45
|
+
* - Correct field names and recommended values
|
|
46
|
+
* - Composition patterns with other components
|
|
47
|
+
* - Common mistakes to avoid
|
|
48
|
+
*/
|
|
49
|
+
export const comprehensiveComponentAiConfig = {
|
|
50
|
+
...typographyInstructions,
|
|
51
|
+
...layoutInstructions,
|
|
52
|
+
...interactiveInstructions,
|
|
53
|
+
...mediaInstructions,
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* System context string for AI page generation
|
|
57
|
+
*
|
|
58
|
+
* Contains comprehensive guidance on:
|
|
59
|
+
* - Page structure patterns (hero, features, testimonials, FAQ, CTA)
|
|
60
|
+
* - Page type templates (landing, about, services, contact)
|
|
61
|
+
* - Typography hierarchy rules
|
|
62
|
+
* - Spacing and color guidelines
|
|
63
|
+
* - Responsive considerations
|
|
64
|
+
*
|
|
65
|
+
* Add this to your AI context for better page generation:
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* createPuckAiApiRoutes({
|
|
70
|
+
* ai: {
|
|
71
|
+
* context: `${yourBusinessContext}\n\n${pagePatternSystemContext}`,
|
|
72
|
+
* },
|
|
73
|
+
* })
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export const pagePatternSystemContext = `${pagePatternContext}\n\n${componentFieldReference}`;
|
|
77
|
+
/**
|
|
78
|
+
* Just the page pattern context (without field reference)
|
|
79
|
+
* Use if you only need the composition patterns
|
|
80
|
+
*/
|
|
81
|
+
export { pagePatternContext };
|
|
82
|
+
/**
|
|
83
|
+
* Just the field reference (without patterns)
|
|
84
|
+
* Use if you only need a quick field name reference
|
|
85
|
+
*/
|
|
86
|
+
export { componentFieldReference };
|
|
87
|
+
/**
|
|
88
|
+
* List of all component names by category
|
|
89
|
+
*/
|
|
90
|
+
export const allComponents = {
|
|
91
|
+
typography: typographyComponents,
|
|
92
|
+
layout: layoutComponents,
|
|
93
|
+
interactive: interactiveComponents,
|
|
94
|
+
media: mediaComponents,
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Flat list of all component names
|
|
98
|
+
*/
|
|
99
|
+
export const componentNames = [
|
|
100
|
+
...typographyComponents,
|
|
101
|
+
...layoutComponents,
|
|
102
|
+
...interactiveComponents,
|
|
103
|
+
...mediaComponents,
|
|
104
|
+
];
|
|
105
|
+
// Re-export instruction modules for advanced usage
|
|
106
|
+
export { typographyInstructions } from './instructions/typography.js';
|
|
107
|
+
export { layoutInstructions } from './instructions/layout.js';
|
|
108
|
+
export { interactiveInstructions } from './instructions/interactive.js';
|
|
109
|
+
export { mediaInstructions } from './instructions/media.js';
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ai/presets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,6BAA6B;AAC7B,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAC3F,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC/E,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC9F,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAE5F,qDAAqD;AACrD,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAyB;IAClE,GAAG,sBAAsB;IACzB,GAAG,kBAAkB;IACrB,GAAG,uBAAuB;IAC1B,GAAG,iBAAiB;CACrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,kBAAkB,OAAO,uBAAuB,EAAE,CAAA;AAE7F;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,CAAA;AAE7B;;;GAGG;AACH,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,UAAU,EAAE,oBAAoB;IAChC,MAAM,EAAE,gBAAgB;IACxB,WAAW,EAAE,qBAAqB;IAClC,KAAK,EAAE,eAAe;CACd,CAAA;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,GAAG,oBAAoB;IACvB,GAAG,gBAAgB;IACnB,GAAG,qBAAqB;IACxB,GAAG,eAAe;CACV,CAAA;AAEV,mDAAmD;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentAiOverrides } from '../../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Comprehensive AI instructions for interactive components
|
|
4
|
+
*
|
|
5
|
+
* These instructions teach the AI:
|
|
6
|
+
* - Button, Card, Accordion, and Divider usage
|
|
7
|
+
* - Correct field names and recommended values
|
|
8
|
+
* - Common patterns and compositions
|
|
9
|
+
*/
|
|
10
|
+
export declare const interactiveInstructions: ComponentAiOverrides;
|
|
11
|
+
/**
|
|
12
|
+
* Interactive component names for reference
|
|
13
|
+
*/
|
|
14
|
+
export declare const interactiveComponents: readonly ["Button", "Card", "Accordion", "Divider"];
|
|
15
|
+
//# sourceMappingURL=interactive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../../../../src/ai/presets/instructions/interactive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAU1D;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,EAAE,oBA4UrC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,qDAAsD,CAAA"}
|