Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdax98 committed Feb 24, 2025
1 parent 32ad6c5 commit 3c42279
Show file tree
Hide file tree
Showing 55 changed files with 1,343 additions and 2,314 deletions.
17 changes: 17 additions & 0 deletions .changeset/proud-panthers-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@comet/blocks-admin": minor
"@comet/admin-rte": minor
"@comet/cms-admin": minor
"@comet/cms-api": minor
---

Add content generation capabilities to `createSeoBlock`

The SEO block (when created using the `createSeoBlock` factory) now supports automatic generation of:

- HTML title
- Meta description
- Open Graph title
- Open Graph description

See the [docs](https://docs.comet-dxp.com/docs/features-modules/content-generation/) for instructions on enabling this feature.
15 changes: 15 additions & 0 deletions .changeset/quiet-glasses-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@comet/blocks-admin": minor
"@comet/admin-rte": minor
"@comet/cms-admin": minor
"@comet/cms-api": minor
---

Add `extractTextContents` method to blocks

`extractTextContents` can be used to extract plain text from blocks. This functionality is particularly useful for operations such as search indexing or using the content for LLM-based tasks. The option `includeInvisibleContent` can be set to include the content of invisible blocks in the extracted text.

The method is optional for now, but it is recommended to implement it for all blocks and documents. The default behavior is to return

- if the state is a string: the string itself
- otherwise: an empty array
16 changes: 8 additions & 8 deletions demo/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"start": "run-s intl:compile && run-p gql:types generate-block-types && dotenv -e .env.secrets -e .env.local -e .env -e .env.site-configs -- vite"
},
"dependencies": {
"@apollo/client": "^3.13.0",
"@apollo/client": "^3.13.1",
"@comet/admin": "workspace:*",
"@comet/admin-date-time": "workspace:*",
"@comet/admin-icons": "workspace:*",
Expand All @@ -32,10 +32,10 @@
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@fontsource-variable/roboto-flex": "^5.1.1",
"@mui/material": "^6.4.4",
"@mui/material": "^6.4.5",
"@mui/system": "^6.4.3",
"@mui/x-data-grid": "^7.26.0",
"@mui/x-data-grid-pro": "^7.26.0",
"@mui/x-data-grid": "^7.27.0",
"@mui/x-data-grid-pro": "^7.27.0",
"change-case": "^5.2.0",
"dnd-core": "^16.0.1",
"final-form": "^4.20.10",
Expand Down Expand Up @@ -66,12 +66,12 @@
"@graphql-codegen/introspection": "^4.0.3",
"@graphql-codegen/named-operations-object": "^3.1.0",
"@graphql-codegen/near-operation-file-preset": "^3.0.0",
"@graphql-codegen/typescript": "^4.1.4",
"@graphql-codegen/typescript-operations": "^4.5.0",
"@graphql-codegen/typescript": "^4.1.5",
"@graphql-codegen/typescript-operations": "^4.5.1",
"@parcel/watcher": "^2.5.1",
"@swc/plugin-emotion": "^8.6.0",
"@types/lodash.isequal": "^4.5.8",
"@types/node": "^22.13.4",
"@types/node": "^22.13.5",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@types/react-router": "^5.1.20",
Expand All @@ -82,7 +82,7 @@
"dotenv-cli": "^7.4.4",
"eslint": "^9.20.1",
"npm-run-all2": "^5.0.2",
"prettier": "^3.5.1",
"prettier": "^3.5.2",
"ts-node": "^10.9.2",
"typescript": "^5.7.3",
"vite": "^5.4.14",
Expand Down
2 changes: 1 addition & 1 deletion demo/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { css, Global } from "@emotion/react";
import { createApolloClient } from "@src/common/apollo/createApolloClient";
import { ConfigProvider, createConfig } from "@src/config";
import { ContentScope } from "@src/site-configs";
import { type ContentScope } from "@src/site-configs";
import { theme } from "@src/theme";
import { HTML5toTouch } from "rdndmb-html5-to-touch";
import { DndProvider } from "react-dnd-multi-backend";
Expand Down
112 changes: 10 additions & 102 deletions demo/admin/src/documents/pages/EditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,97 +120,6 @@ export const EditPage = ({ id }: Props) => {

return (
<AzureAiTranslatorProvider showApplyTranslationDialog={true} enabled={true}>
<<<<<<< HEAD
{hasChanges && (
<RouterPrompt
message={(location) => {
if (location.pathname.startsWith(match.url)) return true; //we navigated within our self
return intl.formatMessage({
id: "editPage.discardChanges",
defaultMessage: "Discard unsaved changes?",
});
}}
saveAction={async () => {
try {
await handleSavePage();
return true;
} catch {
return false;
}
}}
/>
)}
<Toolbar scopeIndicator={<ContentScopeIndicator />}>
<ToolbarItem>
<IconButton onClick={stackApi?.goBack} size="large">
<ArrowLeft />
</IconButton>
</ToolbarItem>
<PageName pageId={id} />
<FillSpace />
<ToolbarActions>
<Stack direction="row" spacing={1}>
<Button
startIcon={<Preview />}
variant="textDark"
disabled={!pageState}
onClick={() => {
openSitePreviewWindow(pageState.path, contentScopeMatch.url);
}}
>
<FormattedMessage id="pages.pages.page.edit.preview" defaultMessage="Web preview" />
</Button>
{pageSaveButton}
</Stack>
</ToolbarActions>
</Toolbar>
<MainContent disablePaddingBottom>
<BlockPreviewWithTabs previewUrl={previewUrl} previewState={previewState} previewApi={previewApi}>
{[
{
key: "content",
label: (
<BlockAdminTabLabel isValid={rootBlocksApi.content.isValid}>
<FormattedMessage id="generic.blocks" defaultMessage="Blocks" />
</BlockAdminTabLabel>
),
content: (
<BlockAdminComponentRoot
title={intl.formatMessage({ id: "pages.pages.page.edit.pageBlocks.title", defaultMessage: "Page" })}
>
{rootBlocksApi.content.adminUI}
</BlockAdminComponentRoot>
),
},
{
key: "stage",
label: (
<BlockAdminTabLabel isValid={rootBlocksApi.stage.isValid}>
<FormattedMessage id="pages.page.edit.stage" defaultMessage="Stage" />
</BlockAdminTabLabel>
),
content: (
<BlockAdminComponentRoot
title={intl.formatMessage({ id: "pages.pages.page.edit.stage.title", defaultMessage: "Stage" })}
>
{rootBlocksApi.stage.adminUI}
</BlockAdminComponentRoot>
),
},
{
key: "config",
label: (
<BlockAdminTabLabel isValid={rootBlocksApi.seo.isValid}>
<FormattedMessage id="pages.pages.page.edit.config" defaultMessage="Config" />
</BlockAdminTabLabel>
),
content: rootBlocksApi.seo.adminUI,
},
]}
</BlockPreviewWithTabs>
</MainContent>
{dialogs}
=======
<ContentGenerationConfigProvider
seo={{
getRelevantContent: () => {
Expand Down Expand Up @@ -269,39 +178,39 @@ export const EditPage = ({ id }: Props) => {
{
key: "content",
label: (
<AdminTabLabel isValid={rootBlocksApi.content.isValid}>
<BlockAdminTabLabel isValid={rootBlocksApi.content.isValid}>
<FormattedMessage id="generic.blocks" defaultMessage="Blocks" />
</AdminTabLabel>
</BlockAdminTabLabel>
),
content: (
<AdminComponentRoot
<BlockAdminComponentRoot
title={intl.formatMessage({ id: "pages.pages.page.edit.pageBlocks.title", defaultMessage: "Page" })}
>
{rootBlocksApi.content.adminUI}
</AdminComponentRoot>
</BlockAdminComponentRoot>
),
},
{
key: "stage",
label: (
<AdminTabLabel isValid={rootBlocksApi.stage.isValid}>
<BlockAdminTabLabel isValid={rootBlocksApi.stage.isValid}>
<FormattedMessage id="pages.page.edit.stage" defaultMessage="Stage" />
</AdminTabLabel>
</BlockAdminTabLabel>
),
content: (
<AdminComponentRoot
<BlockAdminComponentRoot
title={intl.formatMessage({ id: "pages.pages.page.edit.stage.title", defaultMessage: "Stage" })}
>
{rootBlocksApi.stage.adminUI}
</AdminComponentRoot>
</BlockAdminComponentRoot>
),
},
{
key: "config",
label: (
<AdminTabLabel isValid={rootBlocksApi.seo.isValid}>
<BlockAdminTabLabel isValid={rootBlocksApi.seo.isValid}>
<FormattedMessage id="pages.pages.page.edit.config" defaultMessage="Config" />
</AdminTabLabel>
</BlockAdminTabLabel>
),
content: rootBlocksApi.seo.adminUI,
},
Expand All @@ -310,7 +219,6 @@ export const EditPage = ({ id }: Props) => {
</MainContent>
{dialogs}
</ContentGenerationConfigProvider>
>>>>>>> main
</AzureAiTranslatorProvider>
);
};
16 changes: 8 additions & 8 deletions demo/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
"@comet/cms-api": "workspace:*",
"@faker-js/faker": "^9.5.0",
"@kubernetes/client-node": "^1.0.0",
"@mikro-orm/cli": "^6.4.6",
"@mikro-orm/core": "^6.4.6",
"@mikro-orm/migrations": "^6.4.6",
"@mikro-orm/nestjs": "^6.1.0",
"@mikro-orm/postgresql": "^6.4.6",
"@mikro-orm/cli": "^6.4.7",
"@mikro-orm/core": "^6.4.7",
"@mikro-orm/migrations": "^6.4.7",
"@mikro-orm/nestjs": "^6.1.1",
"@mikro-orm/postgresql": "^6.4.7",
"@nestjs/apollo": "^12.2.2",
"@nestjs/common": "^10.4.15",
"@nestjs/core": "^10.4.15",
Expand All @@ -60,7 +60,7 @@
"reflect-metadata": "^0.2.2",
"response-time": "^2.3.3",
"rimraf": "^6.0.1",
"rxjs": "^7.8.1",
"rxjs": "^7.8.2",
"slugify": "^1.6.6",
"uuid": "^11.0.5"
},
Expand All @@ -72,13 +72,13 @@
"@types/cookie-parser": "^1.4.8",
"@types/express": "^4.17.21",
"@types/inquirer": "^8.2.10",
"@types/node": "^22.13.4",
"@types/node": "^22.13.5",
"@types/response-time": "^2.3.8",
"chokidar-cli": "^3.0.0",
"dotenv-cli": "^7.4.4",
"eslint": "^9.20.1",
"npm-run-all2": "^5.0.2",
"prettier": "^3.5.1",
"prettier": "^3.5.2",
"ts-node": "^10.9.2",
"tsconfig-paths": "^3.15.0",
"typescript": "^5.7.3"
Expand Down
8 changes: 4 additions & 4 deletions demo/site-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@
"@graphql-codegen/cli": "^5.0.5",
"@graphql-codegen/named-operations-object": "^3.1.0",
"@graphql-codegen/near-operation-file-preset": "^3.0.0",
"@graphql-codegen/typescript": "^4.1.4",
"@graphql-codegen/typescript-operations": "^4.5.0",
"@graphql-codegen/typescript": "^4.1.5",
"@graphql-codegen/typescript-operations": "^4.5.1",
"@parcel/watcher": "^2.5.1",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.13.4",
"@types/node": "^22.13.5",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"chokidar-cli": "^3.0.0",
"eslint": "^9.20.1",
"npm-run-all2": "^5.0.2",
"prettier": "^3.5.1",
"prettier": "^3.5.2",
"rimraf": "^6.0.1",
"typescript": "^5.7.3"
}
Expand Down
22 changes: 0 additions & 22 deletions demo/site-pages/src/common/blocks/AccordionItemBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,39 +83,17 @@ const AnimatedChevron = styled(SvgUse)<{ $isExpanded: boolean }>`
transition: transform 0.4s ease;
`;

<<<<<<< HEAD
const ContentWrapper = styled.div`
overflow: hidden;
`;

const ContentWrapperInner = styled.div<{ $isExpanded: boolean }>`
padding-bottom: ${({ theme }) => theme.spacing.S300};
margin-top: -100%;
opacity: 0;
transition:
margin-top 0.8s ease-out 0.3s,
opacity 0.3s linear;
=======
const ContentWrapper = styled.div<{ $isExpanded: boolean }>`
position: relative;
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.5s ease-out;
>>>>>>> main
${({ $isExpanded }) =>
$isExpanded &&
css`
<<<<<<< HEAD
margin-top: 0;
opacity: 1;
transition:
margin-top 0.5s ease-out,
opacity 0.3s linear 0.4s;
=======
grid-template-rows: 1fr;
padding-bottom: ${({ theme }) => theme.spacing.S300};
>>>>>>> main
`}
`;

Expand Down
8 changes: 4 additions & 4 deletions demo/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@
"@graphql-codegen/cli": "^5.0.5",
"@graphql-codegen/named-operations-object": "^3.1.0",
"@graphql-codegen/near-operation-file-preset": "^3.0.0",
"@graphql-codegen/typescript": "^4.1.4",
"@graphql-codegen/typescript-operations": "^4.5.0",
"@graphql-codegen/typescript": "^4.1.5",
"@graphql-codegen/typescript-operations": "^4.5.1",
"@parcel/watcher": "^2.5.1",
"@types/node": "^22.13.4",
"@types/node": "^22.13.5",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"chokidar-cli": "^3.0.0",
"eslint": "^9.20.1",
"npm-run-all2": "^5.0.2",
"prettier": "^3.5.1",
"prettier": "^3.5.2",
"typescript": "^5.7.3"
},
"engines": {
Expand Down
Loading

0 comments on commit 3c42279

Please sign in to comment.