diff --git a/.changeset/brave-otters-spend.md b/.changeset/brave-otters-spend.md
new file mode 100644
index 00000000..244f2171
--- /dev/null
+++ b/.changeset/brave-otters-spend.md
@@ -0,0 +1,29 @@
+---
+'@o2s/blocks.featured-service-list': minor
+'@o2s/blocks.notification-details': minor
+'@o2s/blocks.notification-list': minor
+'@o2s/blocks.payments-history': minor
+'@o2s/blocks.payments-summary': minor
+'@o2s/blocks.service-details': minor
+'@o2s/blocks.article-search': minor
+'@o2s/blocks.orders-summary': minor
+'@o2s/blocks.ticket-details': minor
+'@o2s/blocks.category-list': minor
+'@o2s/blocks.order-details': minor
+'@o2s/blocks.surveyjs-form': minor
+'@o2s/blocks.ticket-recent': minor
+'@o2s/blocks.article-list': minor
+'@o2s/blocks.invoice-list': minor
+'@o2s/blocks.service-list': minor
+'@o2s/blocks.user-account': minor
+'@o2s/blocks.quick-links': minor
+'@o2s/blocks.ticket-list': minor
+'@o2s/blocks.order-list': minor
+'@o2s/blocks.category': minor
+'@o2s/blocks.article': minor
+'@o2s/blocks.faq': minor
+'@o2s/frontend': minor
+'@o2s/ui': minor
+---
+
+added support for prioritizing image rendering in order to disable lazyloading for images above the fold
diff --git a/.changeset/chubby-candles-cut.md b/.changeset/chubby-candles-cut.md
new file mode 100644
index 00000000..6419b7c5
--- /dev/null
+++ b/.changeset/chubby-candles-cut.md
@@ -0,0 +1,31 @@
+---
+'@o2s/blocks.featured-service-list': minor
+'@o2s/blocks.notification-details': minor
+'@o2s/blocks.notification-list': minor
+'@o2s/blocks.payments-history': minor
+'@o2s/blocks.payments-summary': minor
+'@o2s/blocks.service-details': minor
+'@o2s/blocks.article-search': minor
+'@o2s/blocks.orders-summary': minor
+'@o2s/blocks.ticket-details': minor
+'@o2s/blocks.category-list': minor
+'@o2s/blocks.order-details': minor
+'@o2s/blocks.surveyjs-form': minor
+'@o2s/blocks.ticket-recent': minor
+'@o2s/blocks.article-list': minor
+'@o2s/blocks.invoice-list': minor
+'@o2s/blocks.service-list': minor
+'@o2s/blocks.user-account': minor
+'@o2s/integrations.mocked': minor
+'@o2s/blocks.quick-links': minor
+'@o2s/blocks.ticket-list': minor
+'@o2s/blocks.order-list': minor
+'@o2s/modules.surveyjs': minor
+'@o2s/blocks.category': minor
+'@o2s/blocks.article': minor
+'@o2s/api-harmonization': minor
+'@o2s/blocks.faq': minor
+'@o2s/frontend': minor
+---
+
+made improvements to the way the code splitting to reduce the total size of JS bundles
diff --git a/.changeset/stale-forks-pay.md b/.changeset/stale-forks-pay.md
new file mode 100644
index 00000000..87e7d7b0
--- /dev/null
+++ b/.changeset/stale-forks-pay.md
@@ -0,0 +1,6 @@
+---
+'@o2s/frontend': minor
+'@o2s/ui': minor
+---
+
+reduced JS bundle size by not moving to dynamic icon loading
diff --git a/.gitattributes b/.gitattributes
index 7bc07c75..92c5d525 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -13,3 +13,8 @@
*.jpg binary
*.jpeg binary
*.png binary
+*.gif binary
+*.webp binary
+
+# Videos
+*.mp4 binary
diff --git a/apps/api-harmonization/package.json b/apps/api-harmonization/package.json
index 1447dd27..377a8f09 100644
--- a/apps/api-harmonization/package.json
+++ b/apps/api-harmonization/package.json
@@ -7,8 +7,8 @@
"license": "MIT",
"exports": {
".": "./src/index.ts",
- "./blocks": "./src/blocks/index.ts",
- "./modules": "./src/modules/index.ts"
+ "./blocks/*": "./src/blocks/*.ts",
+ "./modules/*": "./src/modules/*.ts"
},
"scripts": {
"dev": "cross-env NODE_ENV=development nest start --watch",
@@ -42,7 +42,6 @@
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2",
"string-template": "^1.0.0",
- "survey-core": "^2.0.9",
"winston": "^3.17.0",
"xmlbuilder2": "^3.1.1",
"@o2s/blocks.faq": "*",
diff --git a/apps/api-harmonization/src/modules/login-page/index.ts b/apps/api-harmonization/src/modules/login-page/index.ts
index 37c7f4a1..0566ece4 100644
--- a/apps/api-harmonization/src/modules/login-page/index.ts
+++ b/apps/api-harmonization/src/modules/login-page/index.ts
@@ -1,4 +1,4 @@
-export const URL = '/login-page';
+export { URL } from './login-page.url';
export * as Model from './login-page.model';
export * as Request from './login-page.request';
diff --git a/apps/api-harmonization/src/modules/login-page/login-page.url.ts b/apps/api-harmonization/src/modules/login-page/login-page.url.ts
new file mode 100644
index 00000000..89dbcc2c
--- /dev/null
+++ b/apps/api-harmonization/src/modules/login-page/login-page.url.ts
@@ -0,0 +1 @@
+export const URL = '/login-page';
diff --git a/apps/api-harmonization/src/modules/not-found-page/index.ts b/apps/api-harmonization/src/modules/not-found-page/index.ts
index 4b050b76..24baed79 100644
--- a/apps/api-harmonization/src/modules/not-found-page/index.ts
+++ b/apps/api-harmonization/src/modules/not-found-page/index.ts
@@ -1,4 +1,4 @@
-export const URL = '/not-found-page';
+export { URL } from './not-found-page.url';
export * as Model from './not-found-page.model';
export * as Request from './not-found-page.request';
diff --git a/apps/api-harmonization/src/modules/not-found-page/not-found-page.url.ts b/apps/api-harmonization/src/modules/not-found-page/not-found-page.url.ts
new file mode 100644
index 00000000..926f491b
--- /dev/null
+++ b/apps/api-harmonization/src/modules/not-found-page/not-found-page.url.ts
@@ -0,0 +1 @@
+export const URL = '/not-found-page';
diff --git a/apps/api-harmonization/src/modules/organizations/index.ts b/apps/api-harmonization/src/modules/organizations/index.ts
index 0e0a23aa..2a7a1014 100644
--- a/apps/api-harmonization/src/modules/organizations/index.ts
+++ b/apps/api-harmonization/src/modules/organizations/index.ts
@@ -1,4 +1,4 @@
-export const URL = '/organization-list';
+export { URL } from './organizations.url';
export * as Model from './organizations.model';
export * as Request from './organizations.request';
diff --git a/apps/api-harmonization/src/modules/organizations/organizations.url.ts b/apps/api-harmonization/src/modules/organizations/organizations.url.ts
new file mode 100644
index 00000000..fce39e95
--- /dev/null
+++ b/apps/api-harmonization/src/modules/organizations/organizations.url.ts
@@ -0,0 +1 @@
+export const URL = '/organization-list';
diff --git a/apps/api-harmonization/src/modules/page/index.ts b/apps/api-harmonization/src/modules/page/index.ts
index cb344b5e..f2962398 100644
--- a/apps/api-harmonization/src/modules/page/index.ts
+++ b/apps/api-harmonization/src/modules/page/index.ts
@@ -1,4 +1,4 @@
-export const URL = '/page';
+export { URL } from './page.url';
export * as Model from './page.model';
export * as Request from './page.request';
diff --git a/apps/api-harmonization/src/modules/page/page.url.ts b/apps/api-harmonization/src/modules/page/page.url.ts
new file mode 100644
index 00000000..cf3a5ecd
--- /dev/null
+++ b/apps/api-harmonization/src/modules/page/page.url.ts
@@ -0,0 +1 @@
+export const URL = '/page';
diff --git a/apps/api-harmonization/src/modules/routes/index.ts b/apps/api-harmonization/src/modules/routes/index.ts
index cdf01a9d..5f100360 100644
--- a/apps/api-harmonization/src/modules/routes/index.ts
+++ b/apps/api-harmonization/src/modules/routes/index.ts
@@ -1,4 +1,4 @@
-export const URL = '/routes';
+export { URL } from './routes.url';
export * as Model from './routes.model';
export * as Request from './routes.request';
diff --git a/apps/api-harmonization/src/modules/routes/routes.url.ts b/apps/api-harmonization/src/modules/routes/routes.url.ts
new file mode 100644
index 00000000..d40cdb86
--- /dev/null
+++ b/apps/api-harmonization/src/modules/routes/routes.url.ts
@@ -0,0 +1 @@
+export const URL = '/routes';
diff --git a/apps/docs/blog/articles/building-composable-frontends-with-strapi-and-nextjs/index.md b/apps/docs/blog/articles/building-composable-frontends-with-strapi-and-nextjs/index.md
index 42307682..00274649 100644
--- a/apps/docs/blog/articles/building-composable-frontends-with-strapi-and-nextjs/index.md
+++ b/apps/docs/blog/articles/building-composable-frontends-with-strapi-and-nextjs/index.md
@@ -1,6 +1,8 @@
---
slug: building-composable-frontends-with-strapi-and-nextjs
title: 'Building composable frontends with Strapi and Next.js'
+description: 'Learn how to build composable frontends using Strapi CMS and Next.js. Discover dynamic content modeling, reusable UI blocks, flexible layouts, and scalable component architecture for modern web applications.'
+keywords: ['Strapi CMS', 'Next.js', 'composable frontend', 'headless CMS', 'content modeling', 'dynamic layouts', 'reusable components', 'UI blocks', 'content management', 'frontend architecture', 'component composition', 'page builder', 'content modeling', 'API integration', 'React components', 'TypeScript', 'frontend framework']
date: 2025-03-28
tags: [tech, integrations]
authors: [marcin.krasowski]
@@ -14,11 +16,11 @@ We’re building a frontend-first framework for composable customer portals –
To support dynamic content, reusable UI blocks, and flexible layouts, we needed a CMS that gives developers control over structure while staying accessible to business users.
That’s where **[Strapi](https://strapi.io/)** comes in. In O2S, we use it not just for managing page content, but also for defining layout templates, page structures, and component configurations. This approach helps us find the right balance between flexibility for editors and consistency in the frontend.
+
In this article, we’ll show how Strapi powers the content architecture behind our composable frontend, and how it integrates with Next.js to deliver dynamic pages, structured layouts, and scalable UI patterns.
-
## Web content management in modern front-end apps
One of the challenges that often comes with large-scale frontend applications is managing the content in a way that on one hand gives the content editors
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/cumulative-layout-shift.gif b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/cumulative-layout-shift.gif
new file mode 100644
index 00000000..fceac11b
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/cumulative-layout-shift.gif differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/high-level-architecture.png b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/high-level-architecture.png
new file mode 100644
index 00000000..7ab752fd
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/high-level-architecture.png differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/high-level-architecture.svg b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/high-level-architecture.svg
new file mode 100644
index 00000000..e679ce26
--- /dev/null
+++ b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/high-level-architecture.svg
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/index.md b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/index.md
new file mode 100644
index 00000000..25376c08
--- /dev/null
+++ b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/index.md
@@ -0,0 +1,432 @@
+---
+slug: ensuring-high-frontend-performance-in-composable-nextjs-apps
+title: Ensuring high frontend performance in composable Next.js apps
+description: Learn proven strategies for optimizing frontend performance in composable Next.js applications. Discover server components, streaming, caching, and Core Web Vitals optimization techniques for enterprise-grade apps.
+image: ./lighthouse-2.png
+keywords: ['Next.js performance', 'composable architecture', 'frontend optimization', 'server components', 'Core Web Vitals', 'Lighthouse', 'React Suspense', 'streaming', 'performance optimization', 'enterprise frontend', 'API composition', 'caching strategies', 'image optimization', 'bundle splitting', 'FCP', 'LCP', 'CLS', 'TBT']
+date: 2025-10-06
+tags: [tech, performance]
+authors: [marcin.krasowski]
+toc_max_heading_level: 3
+hide_table_of_contents: false
+---
+
+# Ensuring high frontend performance in composable Next.js apps
+
+In today's web development landscape, composable architectures are gaining popularity for their flexibility and scalability. However, this approach introduces unique performance challenges. In this article, we will explore strategies and best practices for ensuring high frontend performance in composable applications, using [**Open Self Service**](https://www.openselfservice.com/) as a practical example.
+
+
+
+
+
+Open Self Service is a new framework for building enterprise-grade frontend solutions.
+
+Our aim is to create an open-source set of tools that would allow building not only storefronts but different client-facing frontends, with the main focus on customer self-service apps. We want to be backend-agnostic and to some extent eliminate vendor lock-in, so that the frontends you build are safe from backend changes or upgrades. Composable architecture helps us to achieve all of this, so we need to introduce it before we show you how we deal with the performance challenges we faced.
+
+## Understanding composable architecture
+
+### What is a composable architecture?
+
+In a nutshell, composable architecture is an approach to building applications by assembling modular, independent components that work together to create a complete solution - not only in the context of frontend, but across the whole system architecture, especially backend components. In the context of Open Self Service, we implemented this architecture in the form of a framework that enables the integration of multiple API-based services to provide a seamless user experience.
+
+At its core, a few principles characterize composable architecture:
+
+- applications are built from discrete, **interchangeable components** that can be developed, deployed, and scaled independently,
+- components communicate through **well-defined APIs** allowing for a wide flexibility in implementation details,
+- **decoupled systems** (like frontend and backend components), which allows for each to evolve independently without affecting the other.
+
+Composable frontends provide significant advantages - you can be quite flexible in replacing backend components without disruption, are free from vendor lock-in through multi-backend integration, and are able to adapt to changing requirements with the ability to scale specific parts based on business demands.
+
+### The separation of concerns
+
+In building Open Self Service, we chose to implement a clear separation of concerns between different layers of the application. While there are multiple ways to achieve composable architecture, our approach focuses on:
+
+- complete **separation of the presentation layer from the data and business logic layers**, which allows each to evolve independently and enables the frontend to work seamlessly with multiple backend services
+
+- introduction of an intermediate **API composition layer** that acts as a bridge between the frontend and various backend APIs. This layer aggregates data from multiple sources and orchestrates data flows between systems. It efficiently combines static content with dynamic data while handling complex logic server-side, reducing browser processing overhead
+
+
+
+This kind of approach ensures backend service changes don't require frontend code modifications (as long as that backend API is still backwards compatible), reducing maintenance overhead and increasing the overall flexibility.
+
+## Performance strategies
+
+Now that we understand the architectural foundation, let's explore the specific performance strategies that make composable applications fast and responsive. These techniques leverage the modular nature of our [blocks system](https://www.openselfservice.com/docs/main-components/blocks/) to deliver optimal user experiences.
+
+### Leveraging server components
+
+Probably one of the easiest "wins" is to take full advantage of [Next.js server components](https://nextjs.org/docs/app/getting-started/server-and-client-components) to perform data fetching and initial rendering on the server. Each block in our system follows a clear separation between server and client components:
+
+```typescript
+export const OrderDetailsServer = async ({ id, orderId }) => {
+ // Fetch block data from API composition layer
+ const data = await sdk.blocks.getOrderDetails({ id: orderId });
+
+ // Pass data to the client component
+ return ;
+};
+```
+
+```typescript
+'use client';
+
+export const OrderDetailsClient = (props) => {
+ // Render the actual component
+ return (
...
);
+};
+```
+
+This pattern ensures that data fetching occurs on the server, reducing client-side JavaScript bundle size and eliminating client-server waterfalls. The server component fetches the necessary data and passes it to a client component that handles interactivity.
+
+### Streaming with Suspense
+
+By using server components, we can also easily implement component-level streaming using React's Suspense, allowing parts of the page to load progressively rather than waiting for all data to be available. This approach ensures that slow-loading blocks (e.g. due to a slow or complex backend API calls) don't block the rendering of faster ones, and users can start interacting with parts of the page while others are still loading.
+
+Strategic placement of Suspense boundaries is crucial for optimal streaming performance. In our implementation, we place these boundaries at the block level rather than at the page level, allowing for more granular control over the loading experience:
+
+- each block has its own Suspense boundary, allowing it to stream independently
+- more complex blocks can prepare the loading state to more or less represent how the component may actually look when it's ready
+
+Let's look at the `OrderDetails` block that is responsible for showing the users the details of one of their orders. It consists of a title, some tiles arranged in a grid, and a list of products that were purchased.
+
+
+
+For optimal user experience - and to minimize layout shift that could occur during the page load - we prepare a similar layout in a "renderer" component that wraps the server component, using [shadcn/ui's Skeleton components](https://ui.shadcn.com/docs/components/skeleton):
+
+```typescript
+export const OrderDetailsRenderer: React.FC = ({ id }) => {
+ return (
+
+
+
+
+
+ }>
+ // The component itself that is rendered when it's fully ready
+
+
+ );
+};
+```
+
+When users enter this page, they will be able to:
+
+- see meaningful loading states while data is being fetched
+- partly interact with the app (e.g. use the main navigation) even before the main content is fully ready
+
+And once the initial HTML is prepared server-side, it is immediately streamed to the browser, which can be seen on the following (artificially slowed-down so that loading states are actually visible) video showing a single block:
+
+
+
+### Parallel data loading
+
+By using server components, we can enable parallel data loading, where multiple blocks on a page can fetch their data simultaneously rather than sequentially. Each block is responsible for its own data fetching, and the Suspense boundaries around each block allow them to load independently:
+
+```typescript
+export default function KnowledgeBasePage() {
+ return (
+
+ );
+}
+```
+
+This effect is more interesting on pages that include more than one component, where each can take a different time to load (due to more complex backend logic, database access, network delays, or other causes).
+
+Let's take a look at [another example](https://demo-dxp.openselfservice.com/en/personal/help-and-support), this time a digital experience portal with a knowledge base area. Once more, each component is streamed to the browser as soon as it's ready and is then available to interact with:
+
+
+
+While the fallback components are not sized to perfectly match their full counterparts, they don't have to be. It's enough for them to be "close enough", just so that they can be visually similar to the final rendered components, especially considering that some content will be very dynamic when it e.g. depends on a CMS configuration.
+
+As already mentioned, using Suspense has the additional benefit of reducing [Cumulative Layout Shift](https://web.dev/articles/cls). Let's see what this process would look like if only one block did not provide any fallback states and notice how the article tiles "jump down" when the tiles above them appear:
+
+
+
+While this is a mostly harmless example, just take a look at another, more dangerous example from [web.dev](https://web.dev/articles/cls):
+
+
+
+It's obvious that providing appropriate placeholders is critical not only to increase the overall performance (a high CLS will lower your Lighthouse score) but also to safeguard against potentially harmful actions.
+
+So to sum up - this pattern eliminates the "waterfall" effect where one component must finish loading before the next one begins, significantly reducing the overall page load time. As a side effect, it can also provide a better user experience. Instead of using a single loader for the whole page or even delaying the page rendering until every single piece of data is fetched and ready for rendering, you can actually show the page loading progress.
+
+### Component-level dynamic imports
+
+Beyond block-level code splitting, we use dynamic imports for heavy components within blocks. This is particularly beneficial, e.g., for data visualization components that rely on large third-party libraries:
+
+```typescript
+'use client';
+
+import dynamic from 'next/dynamic';
+
+// Dynamically import the chart component to reduce initial bundle size
+const StackedBarChart = dynamic(
+ () => import('@o2s/ui/components/Chart/StackedBarChart').then((module) => module.StackedBarChart),
+);
+
+export const PaymentsHistoryClient = ({ title, chartData }) => {
+ return (
+
+ {title}
+ ...
+
+
+ );
+};
+```
+
+In this example, the chart component (which depends on the [recharts library](https://recharts.org/)) is dynamically imported only when needed (in other words, when that block is rendered on the frontend). Chart libraries are typically large and would significantly increase the initial bundle size, and typically not every page in the app will contain a chart component - so there's no point in preloading a resource-heavy library before it's actually necessary.
+
+### API composition layer
+
+The API composition layer serves as a critical intermediary between frontend blocks and backend services. It can be implemented in a variety of different ways, but we chose to use [Nest.js](https://nestjs.com/) as a framework which fits in nicely in the whole TypeScript-based tech stack.
+
+As an example for what we can achieve using such architecture, let's look at the service that is responsible for the endpoint for fetching data for the `OrderDetails` block:
+
+```typescript
+// Data aggregation from multiple sources
+export class OrderDetailsService {
+ constructor(
+ // Service for fetching static content e.g. from some CMS
+ private readonly cmsService: CMS.Service,
+ // Service that returns dynamic data for the user from some backend API
+ private readonly orderService: Orders.Service,
+ ) {}
+
+ getOrderDetailsBlock(params, query, headers) {
+ const cms = this.cmsService.getOrderDetailsBlock({ ...query, locale: headers['x-locale'] });
+ const order = this.orderService.getOrder({ id: params.id });
+
+ // Fetch data from both sources simultaneously
+ return forkJoin([cms, order]).pipe(
+ map((order) => {
+ // Transform and combine data for the frontend app
+ return mapOrderDetails(cms, order);
+ }),
+ );
+ }
+}
+```
+
+This approach provides several benefits for the overall performance. Firstly, the composition layer combines data from multiple backend services into a single, optimized response that is specifically tailored for each block - returning only the information that block needs and nothing else, which eliminates overfetching.
+
+Instead of making multiple API calls directly from the browser (e.g. for user actions like filtering or form submissions), the composition layer handles the communication with backend services, which reduces latency and bandwidth usage. The composition layer can fetch data from multiple sources in parallel using, for example, [RxJS observables](https://rxjs.dev/), optimizing the overall response time
+
+Additionally, raw data from various backend services is transformed into a consistent format, which does not necessarily improve performance itself but allows the frontend to be implemented in an API-agnostic way.
+
+### API-level caching
+
+However, in a composable architecture where each block independently fetches its own data, there's a risk of redundant API calls to the same backend services. Therefore, it's important to also provide a caching mechanism that can help to reduce the load on backend services.
+
+We chose to address this issue by leveraging [Redis](https://redis.io/) that can e.g. cache static CMS responses for use in other blocks. While, of course, some static content is still very block-dependant, other is shared - like general config or reusable generic translations - and can be safely cached.
+
+In our framework, blocks don't need to implement caching logic themselves; they benefit automatically from the centralized caching system. When multiple blocks on a page require the same underlying data, the first request populates the cache, and subsequent requests are served from the cache without hitting the backend services.
+
+### Request memoization
+
+Next.js 13 and later versions introduced an important performance optimization feature: automatic request memoization. It ensures that identical data fetching requests within the same render pass are actually called only once, significantly reducing unnecessary network calls and improving performance.
+
+This is especially important for composable apps where the frontend does not define every page, instead relying on a CMS configuration. In such cases, there will be, for example, two identical requests needed for a single page render: one to [generate metadata](https://nextjs.org/docs/app/getting-started/metadata-and-og-images#generated-metadata) and the second to actually render page body:
+
+```typescript jsx
+export async function generateMetadata({ params }: Props): Promise {
+ const { locale, slug } = await params;
+ const { data, meta } = await sdk.modules.getPage({ slug }, locale);
+
+ return generateSeo({ data, meta });
+}
+
+export default async function Page({ params }: Props) {
+ const { locale, slug } = await params;
+ const { data } = await sdk.modules.getPage({ slug }, locale);
+
+ return (
+
+
+
+
+
+ );
+}
+```
+
+Notice that `sdk.modules.getPage({ slug }, locale)` is identical in both cases - request memoization will then ensure that it is called only once.
+
+By default, the native `fetch` API in Next.js is automatically memoized. This means that if multiple components on the same page make identical fetch requests, Next.js will only execute the actual network request once and reuse the result for all components. This is particularly valuable in our composable architecture, where different blocks might need the same underlying data.
+
+```typescript
+// In multiple server components across the page
+const data = await fetch('https://api.example.com/data');
+const result = await data.json();
+```
+
+In the example above, even if this code appears in multiple server components on the same page, the actual network request will only be made once.
+
+However, it's important to note that while the native `fetch` API is supported out of the box, other HTTP client libraries may require additional configuration or adaptations to benefit from Next.js's memoization capabilities.
+
+In our implementation, we initially used [axios](https://axios-http.com/) for API requests but later switched to [ofetch](https://github.com/unjs/ofetch), which provided a more seamless integration with Next.js's memoization system while still offering advanced features like interceptors for request/response handling. The transition was quite straightforward and didn't require too many additional adjustments:
+
+```typescript
+// Our SDK implementation using ofetch
+const ofetchInstance = ofetch.create({
+ baseURL: apiUrl,
+ onRequest,
+ onRequestError,
+ onResponse,
+ onResponseError,
+});
+
+const makeRequest = (config: CompatRequestConfig): Promise => {
+ // Configuration mapping from our standard format to ofetch format
+ const fetchOptions = {
+ method: config.method,
+ query: config.params,
+ body: config.data,
+ headers: config.headers,
+ };
+
+ return ofetchInstance(config.url, fetchOptions) as Promise;
+};
+```
+
+This approach ensures that API requests are automatically memoized when used in server components, preventing redundant network calls and improving overall application performance without requiring block developers to implement any special logic.
+
+### Image optimization
+
+Images are often the largest assets on a page, so getting them right has an outsized impact on LCP, CLS, and bandwidth. Next.js provides powerful, safe-by-default primitives through [Image component](https://nextjs.org/docs/app/api-reference/components/image) that we use across blocks, with a few conventions to keep things fast and stable.
+
+We always provide `width`/`height` or `fill` to prevent layout shift and enable responsive sizing and lazy loading. Our `Image` component wraps `next/image` and only falls back to a plain ` ` when dimensions are missing (prefer providing dimensions whenever possible). This is alongside with a default `quality=90` that is high enough to not be noticable, but still has a noticeable impact on image weight:
+
+```typescript jsx
+export const Image: React.FC = ({ src, alt = '', width, height, quality = 90, fill, priority, ...rest }) => {
+ if ((width && height) || fill) {
+ return (
+
+ );
+ }
+
+ return ;
+};
+```
+
+Next.js by default [lazy loads images](https://nextjs.org/docs/app/api-reference/components/image#priority), which is great if they are below-the-fold but should be manually disabled for images that are within the initial viewport, like a hero image. We compute `hasPriority` only for blocks above the fold and pass it down to images within:
+
+```typescript jsx
+export const renderBlocks = async (blocks) => {
+ return blocks.map((block, index) => {
+ // decides whether the block is above the fold,
+ // e.g., to disable image lazy loading
+ const hasPriority = index < 2;
+
+ return (
+
+ {renderBlock(block, hasPriority)}
+
+ );
+ });
+};
+```
+
+Keep in mind that this "predictive algorithm", if it can be called that, is very basic and is prone to being wrong as it does not predict how large the components are. Which means that there can be situations where the third component on the page is still visible, if the first two are quite small.
+
+This is one of the risks that come from page content being fully dependent on CMS configuration - the code cannot always predict every situation. A better, more foolproof solution would be to define the priority directly in the CMS, where app admins know how the component looks and if it is positioned above-the-fold or not - an improvement that we have in plans for the future.
+
+Nevertheless, this flag flows into other nested components and ultimately the Image component itself, which also sets the browser `fetchPriority` accordingly, as shown earlier.
+
+A good way to save on bandwidth is to set the [sizes prop](https://nextjs.org/docs/app/api-reference/components/image#sizes) that matches your CSS breakpoints so the browser downloads the smallest correct candidate.
+
+For example, for a Hero component with an image that on desktop is always no larger than 50% of the viewport and on mobile is always full width:
+
+
+
+The `sizes` prop can be defined accordingly with media queries that match the app's breakpoints (`100vw` on smaller screens and `50vw` on larger):
+
+```typescript jsx
+
+```
+
+This will generate all the `srcset` accordingly so that the browser downloads the version that the closely matches the current viewport:
+
+```html
+
+```
+
+This output is based on [deviceSizes config](https://nextjs.org/docs/app/api-reference/components/image#devicesizes) that you can also adjust to your own needs. For example, you might want to narrow down the list of possible viewports if your app is very image-heavy to simply save on the amount of HTML generated:
+
+```typescript
+deviceSizes: [430, 828, 1200, 2048, 3840]
+```
+
+At the end it's quite critical to monitor LCP and preloads in Lighthouse and check if it's possible to adjust the `priority` if you see that lazy loading:
+
+- does not occur on images below-the-fold
+- or it does occur for images above-the-fold
+
+## Conclusion
+
+Building high-performance composable frontends requires addressing challenges across multiple architectural levels. The approach we've described combines modular architecture with Next.js server components for efficient rendering, strategic Suspense boundaries for progressive loading, and an API composition layer that optimizes data flow. We further enhance performance through caching, request memoization, and component-level dynamic imports.
+
+These strategies deliver real benefits: faster page loads, smoother interactions, and responsive applications even under challenging network conditions. For developers, the composable approach improves maintainability, simplifies testing, and allows independent evolution of different application parts.
+
+As shown in the Lighthouse performance audits, these optimizations result in excellent scores across all Core Web Vitals and performance metrics:
+
+
+
+The Open Self Service framework demonstrates this in practice, providing a foundation for building performant composable applications that scale with business needs while delivering exceptional user experiences. This approach is particularly effective in enterprise environments where complex integration requirements, high traffic, and demanding performance standards are common. Open Self Service delivers outstanding results by enabling organizations to build fast, maintainable frontends that seamlessly integrate with multiple backend systems while achieving superior performance metrics.
+
+Want to see it in action?
+
+- [**Open Self Service website**](https://www.openselfservice.com)
+- [**Documentation**](https://www.openselfservice.com/docs)
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/lighthouse-1.png b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/lighthouse-1.png
new file mode 100644
index 00000000..b9af2192
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/lighthouse-1.png differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/lighthouse-2.png b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/lighthouse-2.png
new file mode 100644
index 00000000..aa91d4c6
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/lighthouse-2.png differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/multi-block-loading-1.gif b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/multi-block-loading-1.gif
new file mode 100644
index 00000000..35d9e0c9
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/multi-block-loading-1.gif differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/multi-block-loading-2.gif b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/multi-block-loading-2.gif
new file mode 100644
index 00000000..85044369
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/multi-block-loading-2.gif differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/order-details-block.png b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/order-details-block.png
new file mode 100644
index 00000000..d86e10d5
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/order-details-block.png differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/single-block-loading.gif b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/single-block-loading.gif
new file mode 100644
index 00000000..7ba39018
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/single-block-loading.gif differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes-desktop.png b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes-desktop.png
new file mode 100644
index 00000000..41bf8e89
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes-desktop.png differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes-mobile.png b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes-mobile.png
new file mode 100644
index 00000000..1f66c5be
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes-mobile.png differ
diff --git a/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes.png b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes.png
new file mode 100644
index 00000000..980c0209
Binary files /dev/null and b/apps/docs/blog/articles/ensuring-high-frontend-performance-in-composable-nextjs-apps/sizes.png differ
diff --git a/apps/docs/blog/tags.yml b/apps/docs/blog/tags.yml
index 2fed2137..6a796dcf 100644
--- a/apps/docs/blog/tags.yml
+++ b/apps/docs/blog/tags.yml
@@ -8,7 +8,6 @@ tech:
permalink: '/tech-articles'
description: 'Content related to technology or development of O2S.'
-
integrations:
label: 'Integrations'
@@ -18,6 +17,9 @@ frontend:
backend:
label: 'Backend'
+performance:
+ label: 'Performance'
+
# An empty tag definition is also valid
# Other attributes will be inferred from the key
emptyTag:
diff --git a/apps/docs/src/pages/index.tsx b/apps/docs/src/pages/index.tsx
index bc39e8be..8b27fbbb 100644
--- a/apps/docs/src/pages/index.tsx
+++ b/apps/docs/src/pages/index.tsx
@@ -51,9 +51,9 @@ export default function Home(): ReactNode {
self-service experiences using Next.js, TypeScript, and NestJS.
- The framework provides the frontend layer designed to connect with
- your existing backend services or integrate with headless platforms
- using our ready-to-use connectors.
+ The framework provides the frontend layer designed to connect with your
+ existing backend services or integrate with headless platforms using our
+ ready-to-use connectors.
>
}
diff --git a/apps/frontend/.env.development b/apps/frontend/.env.development
index a3c49ee6..80c08ba9 100644
--- a/apps/frontend/.env.development
+++ b/apps/frontend/.env.development
@@ -1,3 +1,5 @@
+PORT=3000
+
ANALYZE=false
NEXT_PUBLIC_LOG_LEVEL=verbose
diff --git a/apps/frontend/next.config.ts b/apps/frontend/next.config.ts
index 7634b1fd..d7bc6874 100644
--- a/apps/frontend/next.config.ts
+++ b/apps/frontend/next.config.ts
@@ -13,6 +13,7 @@ const withNextIntl = createNextIntlPlugin();
const nextConfig: NextConfig = {
output: 'standalone',
images: {
+ // deviceSizes: [430, 828, 1200, 2048, 3840],
remotePatterns: [
{
protocol: 'https',
diff --git a/apps/frontend/package.json b/apps/frontend/package.json
index 0795e8bd..8cfb19df 100644
--- a/apps/frontend/package.json
+++ b/apps/frontend/package.json
@@ -34,8 +34,6 @@
"react-indiana-drag-scroll": "^2.2.1",
"react-string-replace": "^1.1.1",
"string-template": "^1.0.0",
- "survey-core": "^2.0.9",
- "survey-react-ui": "^2.0.9",
"throttle-debounce": "^5.0.2",
"yup": "^1.6.1",
"zod": "^3.25.4",
diff --git a/apps/frontend/src/api/modules/login-page.ts b/apps/frontend/src/api/modules/login-page.ts
index db323bea..71a366c4 100644
--- a/apps/frontend/src/api/modules/login-page.ts
+++ b/apps/frontend/src/api/modules/login-page.ts
@@ -1,4 +1,5 @@
import { Modules } from '@o2s/api-harmonization';
+import { URL } from '@o2s/api-harmonization/modules/login-page/login-page.url';
import { Models } from '@o2s/utils.api-harmonization';
@@ -6,7 +7,7 @@ import { Sdk } from '@o2s/framework/sdk';
import { getApiHeaders } from '../../utils/api';
-const API_URL = Modules.LoginPage.URL;
+const API_URL = URL;
export const loginPage = (sdk: Sdk) => ({
modules: {
diff --git a/apps/frontend/src/api/modules/not-found-page.ts b/apps/frontend/src/api/modules/not-found-page.ts
index 6d7375d4..70ba648e 100644
--- a/apps/frontend/src/api/modules/not-found-page.ts
+++ b/apps/frontend/src/api/modules/not-found-page.ts
@@ -1,4 +1,5 @@
import { Modules } from '@o2s/api-harmonization';
+import { URL } from '@o2s/api-harmonization/modules/not-found-page/not-found-page.url';
import { Models } from '@o2s/utils.api-harmonization';
@@ -6,7 +7,7 @@ import { Sdk } from '@o2s/framework/sdk';
import { getApiHeaders } from '../../utils/api';
-const API_URL = Modules.NotFoundPage.URL;
+const API_URL = URL;
export const notFoundPage = (sdk: Sdk) => ({
modules: {
diff --git a/apps/frontend/src/api/modules/organizations.ts b/apps/frontend/src/api/modules/organizations.ts
index d5c9818d..b6bee90c 100644
--- a/apps/frontend/src/api/modules/organizations.ts
+++ b/apps/frontend/src/api/modules/organizations.ts
@@ -1,4 +1,5 @@
import { Modules } from '@o2s/api-harmonization';
+import { URL } from '@o2s/api-harmonization/modules/organizations/organizations.url';
import { Models } from '@o2s/utils.api-harmonization';
@@ -6,7 +7,7 @@ import { Sdk } from '@o2s/framework/sdk';
import { getApiHeaders } from '../../utils/api';
-const API_URL = Modules.Organizations.URL;
+const API_URL = URL;
export const organizations = (sdk: Sdk) => ({
modules: {
diff --git a/apps/frontend/src/api/modules/page.ts b/apps/frontend/src/api/modules/page.ts
index 06f74426..3f56c9ce 100644
--- a/apps/frontend/src/api/modules/page.ts
+++ b/apps/frontend/src/api/modules/page.ts
@@ -1,4 +1,5 @@
import { Modules } from '@o2s/api-harmonization';
+import { URL } from '@o2s/api-harmonization/modules/page/page.url';
import { Models } from '@o2s/utils.api-harmonization';
@@ -6,7 +7,7 @@ import { Sdk } from '@o2s/framework/sdk';
import { getApiHeaders } from '../../utils/api';
-const API_URL = Modules.Page.URL;
+const API_URL = URL;
export const page = (sdk: Sdk) => ({
modules: {
diff --git a/apps/frontend/src/app/[locale]/layout.tsx b/apps/frontend/src/app/[locale]/layout.tsx
index 5cb9d367..3776165f 100644
--- a/apps/frontend/src/app/[locale]/layout.tsx
+++ b/apps/frontend/src/app/[locale]/layout.tsx
@@ -16,6 +16,7 @@ import '@/styles/global.css';
const inter = Inter({
subsets: ['latin-ext'],
display: 'swap',
+ variable: '--font-body',
});
interface Props {
@@ -39,7 +40,7 @@ export default async function RootLayout({ children, params }: Props) {
const messages = await getMessages();
return (
-
+
diff --git a/apps/frontend/src/auth/auth.config.ts b/apps/frontend/src/auth/auth.config.ts
index 01b5c3f8..9476cf07 100644
--- a/apps/frontend/src/auth/auth.config.ts
+++ b/apps/frontend/src/auth/auth.config.ts
@@ -3,9 +3,6 @@ import type { Account, DefaultSession, Profile } from '@auth/core/types';
import { Session, User } from 'next-auth';
import { AdapterUser } from 'next-auth/adapters';
import { JWT } from 'next-auth/jwt';
-import { useSession } from 'next-auth/react';
-
-import { Models } from '@o2s/framework/modules';
import * as Auth from '@o2s/integrations.mocked/auth';
@@ -43,10 +40,6 @@ export const Providers = Auth.Providers;
export const onSignOut = Auth.signOut;
-export async function updateOrganization(session: ReturnType, customer: Models.Customer.Customer) {
- return Auth.updateOrganization(session, customer);
-}
-
export const jwtCallback = async (params: JwtCallbackParams): Promise => {
const getCustomer = async (id: string | undefined, accessToken: string) => {
return id
diff --git a/apps/frontend/src/auth/auth.organizations.ts b/apps/frontend/src/auth/auth.organizations.ts
new file mode 100644
index 00000000..ec364594
--- /dev/null
+++ b/apps/frontend/src/auth/auth.organizations.ts
@@ -0,0 +1,9 @@
+import { useSession } from 'next-auth/react';
+
+import { Models } from '@o2s/framework/modules';
+
+import { updateOrganization as updateOrganizationAuth } from '@o2s/integrations.mocked/auth.updateOrganization';
+
+export async function updateOrganization(session: ReturnType, customer: Models.Customer.Customer) {
+ return updateOrganizationAuth(session, customer);
+}
diff --git a/apps/frontend/src/auth/auth.ts b/apps/frontend/src/auth/auth.ts
index 29a42f0b..aa4c4203 100644
--- a/apps/frontend/src/auth/auth.ts
+++ b/apps/frontend/src/auth/auth.ts
@@ -1,6 +1,6 @@
import NextAuth, { NextAuthResult } from 'next-auth';
-import { Adapter, DefaultAuthProvider, jwtCallback, sessionCallback, updateOrganization } from './auth.config';
+import { Adapter, DefaultAuthProvider, jwtCallback, sessionCallback } from './auth.config';
import { providers } from './auth.providers';
export const nextAuthResult = NextAuth({
@@ -36,4 +36,3 @@ export const nextAuthResult = NextAuth({
export const { handlers, signIn, signOut } = nextAuthResult;
export const auth: NextAuthResult['auth'] = nextAuthResult.auth;
-export { updateOrganization };
diff --git a/apps/frontend/src/blocks/renderBlocks.tsx b/apps/frontend/src/blocks/renderBlocks.tsx
index 3f1c846b..0976f0ae 100644
--- a/apps/frontend/src/blocks/renderBlocks.tsx
+++ b/apps/frontend/src/blocks/renderBlocks.tsx
@@ -29,6 +29,8 @@ import React from 'react';
import { CMS } from '@o2s/framework/modules';
+import { Container } from '@o2s/ui/components/Container';
+
import { auth } from '@/auth';
// BLOCK IMPORT
@@ -36,74 +38,99 @@ import { routing } from '@/i18n';
import { onSignOut } from '../actions/signOut';
+interface BlockProps {
+ id: string;
+ slug: string[];
+ locale: string;
+ accessToken: string | undefined;
+ userId: string | undefined;
+ routing: typeof routing;
+ hasPriority?: boolean;
+}
+
export const renderBlocks = async (blocks: CMS.Model.Page.SlotBlock[], slug: string[]) => {
const session = await auth();
const locale = await getLocale();
- return blocks.map((block) => {
- const blockProps = {
+ return blocks.map((block, index) => {
+ // decides whether the block is above the fold,
+ // e.g., to disable image lazy loading
+ const hasPriority = index < 2;
+
+ const blockProps: BlockProps = {
id: block.id,
slug: slug,
locale: locale,
accessToken: session?.accessToken,
+ userId: session?.user?.id,
routing: routing,
+ hasPriority,
};
- switch (block.__typename as Modules.Page.Model.Blocks) {
- case 'TicketListBlock':
- return ;
- case 'TicketRecentBlock':
- return ;
- case 'TicketDetailsBlock':
- return ;
- case 'NotificationListBlock':
- return ;
- case 'NotificationDetailsBlock':
- return ;
- case 'FaqBlock':
- return ;
- case 'InvoiceListBlock':
- return ;
- case 'PaymentsSummaryBlock':
- return ;
- case 'PaymentsHistoryBlock':
- return ;
- case 'UserAccountBlock':
- return (
-
- );
- case 'ServiceListBlock':
- return ;
- case 'ServiceDetailsBlock':
- return ;
- case 'SurveyJsBlock':
- return ;
- case 'OrderListBlock':
- return ;
- case 'OrdersSummaryBlock':
- return ;
- case 'OrderDetailsBlock':
- return ;
- case 'QuickLinksBlock':
- return ;
- case 'CategoryListBlock':
- return ;
- case 'ArticleListBlock':
- return ;
- case 'CategoryBlock':
- return ;
- case 'ArticleBlock':
- return ;
- case 'ArticleSearchBlock':
- return ;
- case 'FeaturedServiceListBlock':
- return ;
- // BLOCK REGISTER
- }
+ return (
+
+ {renderBlock(block.__typename, blockProps)}
+
+ );
});
};
+
+const renderBlock = (typename: string, blockProps: BlockProps) => {
+ switch (typename as Modules.Page.Model.Blocks) {
+ case 'TicketListBlock':
+ return ;
+ case 'TicketRecentBlock':
+ return ;
+ case 'TicketDetailsBlock':
+ return ;
+ case 'NotificationListBlock':
+ return ;
+ case 'NotificationDetailsBlock':
+ return ;
+ case 'FaqBlock':
+ return ;
+ case 'InvoiceListBlock':
+ return ;
+ case 'PaymentsSummaryBlock':
+ return ;
+ case 'PaymentsHistoryBlock':
+ return ;
+ case 'UserAccountBlock':
+ return ;
+ case 'ServiceListBlock':
+ return ;
+ case 'ServiceDetailsBlock':
+ return ;
+ case 'SurveyJsBlock':
+ return ;
+ case 'OrderListBlock':
+ return ;
+ case 'OrdersSummaryBlock':
+ return ;
+ case 'OrderDetailsBlock':
+ return ;
+ case 'QuickLinksBlock':
+ return ;
+ case 'CategoryListBlock':
+ return ;
+ case 'ArticleListBlock':
+ return ;
+ case 'CategoryBlock':
+ return ;
+ case 'ArticleBlock':
+ return ;
+ case 'ArticleSearchBlock':
+ return ;
+ case 'FeaturedServiceListBlock':
+ return ;
+ // BLOCK REGISTER
+ default:
+ return null;
+ }
+};
diff --git a/apps/frontend/src/containers/ContextSwitcher/Content/Content.tsx b/apps/frontend/src/containers/ContextSwitcher/Content/Content.tsx
index d02b4f5f..133a4dee 100644
--- a/apps/frontend/src/containers/ContextSwitcher/Content/Content.tsx
+++ b/apps/frontend/src/containers/ContextSwitcher/Content/Content.tsx
@@ -12,7 +12,7 @@ import { RadioGroup, RadioGroupItem } from '@o2s/ui/elements/radio-group';
import { SheetDescription, SheetFooter, SheetHeader, SheetTitle } from '@o2s/ui/elements/sheet';
import { Typography } from '@o2s/ui/elements/typography';
-import { updateOrganization } from '@/auth';
+import { updateOrganization } from '@/auth/auth.organizations';
import { ContentProps, ContextSwitcherFormValues } from './Content.types';
diff --git a/packages/blocks/article-list/src/api-harmonization/article-list.client.ts b/packages/blocks/article-list/src/api-harmonization/article-list.client.ts
index 19dd3351..a3780d76 100644
--- a/packages/blocks/article-list/src/api-harmonization/article-list.client.ts
+++ b/packages/blocks/article-list/src/api-harmonization/article-list.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/article-list';
+export { URL } from './article-list.url';
export * as Model from './article-list.model';
export * as Request from './article-list.request';
diff --git a/packages/blocks/article-list/src/api-harmonization/article-list.url.ts b/packages/blocks/article-list/src/api-harmonization/article-list.url.ts
new file mode 100644
index 00000000..fa39f1dc
--- /dev/null
+++ b/packages/blocks/article-list/src/api-harmonization/article-list.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/article-list';
diff --git a/packages/blocks/article-list/src/frontend/ArticleList.client.tsx b/packages/blocks/article-list/src/frontend/ArticleList.client.tsx
index cc480b86..aaa3eceb 100644
--- a/packages/blocks/article-list/src/frontend/ArticleList.client.tsx
+++ b/packages/blocks/article-list/src/frontend/ArticleList.client.tsx
@@ -8,7 +8,7 @@ import { ContentSection } from '@o2s/ui/components/ContentSection';
import { ArticleListPureProps } from './ArticleList.types';
-export const ArticleListPure: React.FC> = ({ routing, ...component }) => {
+export const ArticleListPure: React.FC> = ({ routing, hasPriority, ...component }) => {
const { Link: LinkComponent } = createNavigation(routing);
return (
> = ({ rout
}
categoryTitle={item.category?.title}
LinkComponent={LinkComponent}
+ priority={hasPriority}
/>
))}
diff --git a/packages/blocks/article-list/src/frontend/ArticleList.renderer.tsx b/packages/blocks/article-list/src/frontend/ArticleList.renderer.tsx
index 8eae25bb..3e6359cb 100644
--- a/packages/blocks/article-list/src/frontend/ArticleList.renderer.tsx
+++ b/packages/blocks/article-list/src/frontend/ArticleList.renderer.tsx
@@ -6,7 +6,7 @@ import { Loading } from '@o2s/ui/components/Loading';
import { ArticleList } from './ArticleList.server';
import { ArticleListRendererProps } from './ArticleList.types';
-export const ArticleListRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const ArticleListRenderer: React.FC = ({ id, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
= ({ id, ac
}
>
-
+
);
};
diff --git a/packages/blocks/article-list/src/frontend/ArticleList.server.tsx b/packages/blocks/article-list/src/frontend/ArticleList.server.tsx
index b9d91d18..5310e050 100644
--- a/packages/blocks/article-list/src/frontend/ArticleList.server.tsx
+++ b/packages/blocks/article-list/src/frontend/ArticleList.server.tsx
@@ -9,7 +9,7 @@ export const ArticleListDynamic = dynamic(() =>
import('./ArticleList.client').then((module) => module.ArticleListPure),
);
-export const ArticleList: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const ArticleList: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => {
try {
const data = await sdk.blocks.getArticleList(
{
@@ -18,7 +18,16 @@ export const ArticleList: React.FC = async ({ id, accessToken,
{ 'x-locale': locale },
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/article-list/src/frontend/ArticleList.types.ts b/packages/blocks/article-list/src/frontend/ArticleList.types.ts
index 51447adb..3c1e5233 100644
--- a/packages/blocks/article-list/src/frontend/ArticleList.types.ts
+++ b/packages/blocks/article-list/src/frontend/ArticleList.types.ts
@@ -7,6 +7,7 @@ export interface ArticleListProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type ArticleListPureProps = ArticleListProps & Model.ArticleListBlock;
diff --git a/packages/blocks/article-list/src/sdk/article-list.ts b/packages/blocks/article-list/src/sdk/article-list.ts
index 67a6fb57..d9f75b3f 100644
--- a/packages/blocks/article-list/src/sdk/article-list.ts
+++ b/packages/blocks/article-list/src/sdk/article-list.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/article-list.client';
+import { Model, Request } from '../api-harmonization/article-list.client';
+import { URL } from '../api-harmonization/article-list.url';
const API_URL = URL;
diff --git a/packages/blocks/article-list/tsconfig.frontend.json b/packages/blocks/article-list/tsconfig.frontend.json
index 63f7da10..8f7c6d81 100644
--- a/packages/blocks/article-list/tsconfig.frontend.json
+++ b/packages/blocks/article-list/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/article-list.url.ts",
"src/api-harmonization/article-list.client.ts",
"src/api-harmonization/article-list.model.ts",
"src/api-harmonization/article-list.request.ts",
diff --git a/packages/blocks/article-list/tsconfig.sdk.json b/packages/blocks/article-list/tsconfig.sdk.json
index ee7573b3..f8546024 100644
--- a/packages/blocks/article-list/tsconfig.sdk.json
+++ b/packages/blocks/article-list/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/article-list.url.ts",
"src/api-harmonization/article-list.client.ts",
"src/api-harmonization/article-list.model.ts",
"src/api-harmonization/article-list.request.ts"
diff --git a/packages/blocks/article-search/src/api-harmonization/article-search.client.ts b/packages/blocks/article-search/src/api-harmonization/article-search.client.ts
index b1757b0b..765b23c1 100644
--- a/packages/blocks/article-search/src/api-harmonization/article-search.client.ts
+++ b/packages/blocks/article-search/src/api-harmonization/article-search.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/article-search';
+export { URL } from './article-search.url';
export * as Model from './article-search.model';
export * as Request from './article-search.request';
diff --git a/packages/blocks/article-search/src/api-harmonization/article-search.url.ts b/packages/blocks/article-search/src/api-harmonization/article-search.url.ts
new file mode 100644
index 00000000..f726636a
--- /dev/null
+++ b/packages/blocks/article-search/src/api-harmonization/article-search.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/article-search';
diff --git a/packages/blocks/article-search/src/frontend/ArticleSearch.renderer.tsx b/packages/blocks/article-search/src/frontend/ArticleSearch.renderer.tsx
index f2c10bb5..0610fbb8 100644
--- a/packages/blocks/article-search/src/frontend/ArticleSearch.renderer.tsx
+++ b/packages/blocks/article-search/src/frontend/ArticleSearch.renderer.tsx
@@ -7,7 +7,12 @@ import { Loading } from '@o2s/ui/components/Loading';
import { ArticleSearch } from './ArticleSearch.server';
import { ArticleSearchRendererProps } from './ArticleSearch.types';
-export const ArticleSearchRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const ArticleSearchRenderer: React.FC = ({
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
return (
= ({ id
}
>
-
+
);
};
diff --git a/packages/blocks/article-search/src/frontend/ArticleSearch.server.tsx b/packages/blocks/article-search/src/frontend/ArticleSearch.server.tsx
index 1c54ed24..e1bf9eee 100644
--- a/packages/blocks/article-search/src/frontend/ArticleSearch.server.tsx
+++ b/packages/blocks/article-search/src/frontend/ArticleSearch.server.tsx
@@ -9,7 +9,13 @@ export const ArticleSearchDynamic = dynamic(() =>
import('./ArticleSearch.client').then((module) => module.ArticleSearchPure),
);
-export const ArticleSearch: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const ArticleSearch: React.FC = async ({
+ id,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getArticleSearch(
{
@@ -18,7 +24,16 @@ export const ArticleSearch: React.FC = async ({ id, accessTo
{ 'x-locale': locale },
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/article-search/src/frontend/ArticleSearch.types.ts b/packages/blocks/article-search/src/frontend/ArticleSearch.types.ts
index a15cc2e7..b14e7148 100644
--- a/packages/blocks/article-search/src/frontend/ArticleSearch.types.ts
+++ b/packages/blocks/article-search/src/frontend/ArticleSearch.types.ts
@@ -7,6 +7,7 @@ export interface ArticleSearchProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type ArticleSearchPureProps = ArticleSearchProps & Model.ArticleSearchBlock;
diff --git a/packages/blocks/article-search/src/sdk/article-search.ts b/packages/blocks/article-search/src/sdk/article-search.ts
index fcaa1b4d..a3990d3d 100644
--- a/packages/blocks/article-search/src/sdk/article-search.ts
+++ b/packages/blocks/article-search/src/sdk/article-search.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/article-search.client';
+import { Model, Request } from '../api-harmonization/article-search.client';
+import { URL } from '../api-harmonization/article-search.url';
const API_URL = URL;
diff --git a/packages/blocks/article-search/tsconfig.frontend.json b/packages/blocks/article-search/tsconfig.frontend.json
index 63b0e69d..c5fad5bb 100644
--- a/packages/blocks/article-search/tsconfig.frontend.json
+++ b/packages/blocks/article-search/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/article-search.url.ts",
"src/api-harmonization/article-search.client.ts",
"src/api-harmonization/article-search.model.ts",
"src/api-harmonization/article-search.request.ts",
diff --git a/packages/blocks/article-search/tsconfig.sdk.json b/packages/blocks/article-search/tsconfig.sdk.json
index 63a2f8ab..a2574634 100644
--- a/packages/blocks/article-search/tsconfig.sdk.json
+++ b/packages/blocks/article-search/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/article-search.url.ts",
"src/api-harmonization/article-search.client.ts",
"src/api-harmonization/article-search.model.ts",
"src/api-harmonization/article-search.request.ts"
diff --git a/packages/blocks/article/src/api-harmonization/article.client.ts b/packages/blocks/article/src/api-harmonization/article.client.ts
index 3edbb1b9..30e79226 100644
--- a/packages/blocks/article/src/api-harmonization/article.client.ts
+++ b/packages/blocks/article/src/api-harmonization/article.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/article';
+export { URL } from './article.url';
export * as Model from './article.model';
export * as Request from './article.request';
diff --git a/packages/blocks/article/src/api-harmonization/article.url.ts b/packages/blocks/article/src/api-harmonization/article.url.ts
new file mode 100644
index 00000000..5e88a806
--- /dev/null
+++ b/packages/blocks/article/src/api-harmonization/article.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/article';
diff --git a/packages/blocks/article/src/frontend/Article.client.tsx b/packages/blocks/article/src/frontend/Article.client.tsx
index 80301d72..445ffc2d 100644
--- a/packages/blocks/article/src/frontend/Article.client.tsx
+++ b/packages/blocks/article/src/frontend/Article.client.tsx
@@ -12,7 +12,7 @@ import { Typography } from '@o2s/ui/elements/typography';
import { ArticlePureProps } from './Article.types';
-export const ArticlePure: React.FC> = ({ ...component }) => {
+export const ArticlePure: React.FC> = ({ hasPriority, ...component }) => {
const {
data: { author, createdAt, sections },
} = component;
@@ -67,6 +67,8 @@ export const ArticlePure: React.FC> = ({ ...component
width={section.image.width}
height={section.image.height}
className="w-full h-auto object-cover"
+ sizes="100vw"
+ priority={hasPriority}
/>
{section.caption && (
diff --git a/packages/blocks/article/src/frontend/Article.renderer.tsx b/packages/blocks/article/src/frontend/Article.renderer.tsx
index ba2bdee2..6f855c76 100644
--- a/packages/blocks/article/src/frontend/Article.renderer.tsx
+++ b/packages/blocks/article/src/frontend/Article.renderer.tsx
@@ -7,22 +7,29 @@ import { Loading } from '@o2s/ui/components/Loading';
import { Article } from './Article.server';
import { ArticleRendererProps } from './Article.types';
-export const ArticleRenderer: React.FC = ({ id, slug, accessToken, routing }) => {
+export const ArticleRenderer: React.FC = ({ id, slug, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
+
- >
+
}
>
-
+
);
};
diff --git a/packages/blocks/article/src/frontend/Article.server.tsx b/packages/blocks/article/src/frontend/Article.server.tsx
index 3a91fcbf..3f1d0b15 100644
--- a/packages/blocks/article/src/frontend/Article.server.tsx
+++ b/packages/blocks/article/src/frontend/Article.server.tsx
@@ -7,7 +7,7 @@ import { ArticleProps } from './Article.types';
export const ArticleDynamic = dynamic(() => import('./Article.client').then((module) => module.ArticlePure));
-export const Article: React.FC = async ({ slug, accessToken, locale, routing }) => {
+export const Article: React.FC = async ({ slug, accessToken, locale, routing, hasPriority }) => {
try {
const data = await sdk.blocks.getArticle(
{
@@ -17,7 +17,16 @@ export const Article: React.FC = async ({ slug, accessToken, local
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/article/src/frontend/Article.types.ts b/packages/blocks/article/src/frontend/Article.types.ts
index b1bbb5b0..49f565bf 100644
--- a/packages/blocks/article/src/frontend/Article.types.ts
+++ b/packages/blocks/article/src/frontend/Article.types.ts
@@ -8,6 +8,7 @@ export interface ArticleProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type ArticlePureProps = ArticleProps & Model.ArticleBlock;
diff --git a/packages/blocks/article/src/sdk/article.ts b/packages/blocks/article/src/sdk/article.ts
index 283f2faf..13b32597 100644
--- a/packages/blocks/article/src/sdk/article.ts
+++ b/packages/blocks/article/src/sdk/article.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/article.client';
+import { Model, Request } from '../api-harmonization/article.client';
+import { URL } from '../api-harmonization/article.url';
const API_URL = URL;
diff --git a/packages/blocks/article/tsconfig.frontend.json b/packages/blocks/article/tsconfig.frontend.json
index d43a8e4e..44c74d20 100644
--- a/packages/blocks/article/tsconfig.frontend.json
+++ b/packages/blocks/article/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/article.url.ts",
"src/api-harmonization/article.client.ts",
"src/api-harmonization/article.model.ts",
"src/api-harmonization/article.request.ts",
diff --git a/packages/blocks/article/tsconfig.sdk.json b/packages/blocks/article/tsconfig.sdk.json
index 90451cc6..e77dde1d 100644
--- a/packages/blocks/article/tsconfig.sdk.json
+++ b/packages/blocks/article/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/article.url.ts",
"src/api-harmonization/article.client.ts",
"src/api-harmonization/article.model.ts",
"src/api-harmonization/article.request.ts"
diff --git a/packages/blocks/category-list/src/api-harmonization/category-list.client.ts b/packages/blocks/category-list/src/api-harmonization/category-list.client.ts
index aa5ee6eb..638395a5 100644
--- a/packages/blocks/category-list/src/api-harmonization/category-list.client.ts
+++ b/packages/blocks/category-list/src/api-harmonization/category-list.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/category-list';
+export { URL } from './category-list.url';
export * as Model from './category-list.model';
export * as Request from './category-list.request';
diff --git a/packages/blocks/category-list/src/api-harmonization/category-list.url.ts b/packages/blocks/category-list/src/api-harmonization/category-list.url.ts
new file mode 100644
index 00000000..ed93f54d
--- /dev/null
+++ b/packages/blocks/category-list/src/api-harmonization/category-list.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/category-list';
diff --git a/packages/blocks/category-list/src/frontend/CategoryList.renderer.tsx b/packages/blocks/category-list/src/frontend/CategoryList.renderer.tsx
index e9290141..e6e7b147 100644
--- a/packages/blocks/category-list/src/frontend/CategoryList.renderer.tsx
+++ b/packages/blocks/category-list/src/frontend/CategoryList.renderer.tsx
@@ -6,7 +6,13 @@ import { Loading } from '@o2s/ui/components/Loading';
import { CategoryList } from './CategoryList.server';
import { CategoryListRendererProps } from './CategoryList.types';
-export const CategoryListRenderer: React.FC = ({ id, accessToken, slug, routing }) => {
+export const CategoryListRenderer: React.FC = ({
+ id,
+ accessToken,
+ slug,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
return (
= ({ id,
}
>
-
+
);
};
diff --git a/packages/blocks/category-list/src/frontend/CategoryList.server.tsx b/packages/blocks/category-list/src/frontend/CategoryList.server.tsx
index abb44dc1..dc6a5733 100644
--- a/packages/blocks/category-list/src/frontend/CategoryList.server.tsx
+++ b/packages/blocks/category-list/src/frontend/CategoryList.server.tsx
@@ -9,7 +9,7 @@ export const CategoryListDynamic = dynamic(() =>
import('./CategoryList.client').then((module) => module.CategoryListPure),
);
-export const CategoryList: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const CategoryList: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => {
try {
const data = await sdk.blocks.getCategoryList(
{
@@ -18,7 +18,16 @@ export const CategoryList: React.FC = async ({ id, accessToke
{ 'x-locale': locale },
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/category-list/src/frontend/CategoryList.types.ts b/packages/blocks/category-list/src/frontend/CategoryList.types.ts
index 615218f2..668cfa4e 100644
--- a/packages/blocks/category-list/src/frontend/CategoryList.types.ts
+++ b/packages/blocks/category-list/src/frontend/CategoryList.types.ts
@@ -7,6 +7,7 @@ export interface CategoryListProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type CategoryListPureProps = CategoryListProps & Model.CategoryListBlock;
diff --git a/packages/blocks/category-list/src/sdk/category-list.ts b/packages/blocks/category-list/src/sdk/category-list.ts
index 5d831830..a09281b6 100644
--- a/packages/blocks/category-list/src/sdk/category-list.ts
+++ b/packages/blocks/category-list/src/sdk/category-list.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/category-list.client';
+import { Model, Request } from '../api-harmonization/category-list.client';
+import { URL } from '../api-harmonization/category-list.url';
const API_URL = URL;
diff --git a/packages/blocks/category-list/tsconfig.frontend.json b/packages/blocks/category-list/tsconfig.frontend.json
index 87442e19..7fdfcf19 100644
--- a/packages/blocks/category-list/tsconfig.frontend.json
+++ b/packages/blocks/category-list/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/category-list.url.ts",
"src/api-harmonization/category-list.client.ts",
"src/api-harmonization/category-list.model.ts",
"src/api-harmonization/category-list.request.ts",
diff --git a/packages/blocks/category-list/tsconfig.sdk.json b/packages/blocks/category-list/tsconfig.sdk.json
index fd8b134e..3876983f 100644
--- a/packages/blocks/category-list/tsconfig.sdk.json
+++ b/packages/blocks/category-list/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/category-list.url.ts",
"src/api-harmonization/category-list.client.ts",
"src/api-harmonization/category-list.model.ts",
"src/api-harmonization/category-list.request.ts"
diff --git a/packages/blocks/category/src/api-harmonization/category.client.ts b/packages/blocks/category/src/api-harmonization/category.client.ts
index 100ba3df..bc005988 100644
--- a/packages/blocks/category/src/api-harmonization/category.client.ts
+++ b/packages/blocks/category/src/api-harmonization/category.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/category';
+export { URL } from './category.url';
export * as Model from './category.model';
export * as Request from './category.request';
diff --git a/packages/blocks/category/src/api-harmonization/category.url.ts b/packages/blocks/category/src/api-harmonization/category.url.ts
new file mode 100644
index 00000000..b43f57a2
--- /dev/null
+++ b/packages/blocks/category/src/api-harmonization/category.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/category';
diff --git a/packages/blocks/category/src/frontend/Category.client.tsx b/packages/blocks/category/src/frontend/Category.client.tsx
index 51bdb8e8..4e839714 100644
--- a/packages/blocks/category/src/frontend/Category.client.tsx
+++ b/packages/blocks/category/src/frontend/Category.client.tsx
@@ -24,6 +24,7 @@ export const CategoryPure: React.FC = ({
accessToken,
routing,
blocks,
+ hasPriority,
...component
}) => {
const { Link: LinkComponent } = createNavigation(routing);
@@ -94,6 +95,7 @@ export const CategoryPure: React.FC = ({
}
categoryTitle={item.category?.title}
LinkComponent={LinkComponent}
+ priority={hasPriority}
/>
))}
diff --git a/packages/blocks/category/src/frontend/Category.renderer.tsx b/packages/blocks/category/src/frontend/Category.renderer.tsx
index aa5bd7b6..494a3cd1 100644
--- a/packages/blocks/category/src/frontend/Category.renderer.tsx
+++ b/packages/blocks/category/src/frontend/Category.renderer.tsx
@@ -7,7 +7,14 @@ import { Loading } from '@o2s/ui/components/Loading';
import { Category } from './Category.server';
import { CategoryRendererProps } from './Category.types';
-export const CategoryRenderer: React.FC = ({ slug, id, accessToken, routing, renderBlocks }) => {
+export const CategoryRenderer: React.FC = ({
+ slug,
+ id,
+ accessToken,
+ routing,
+ renderBlocks,
+ hasPriority,
+}) => {
const locale = useLocale();
return (
@@ -38,6 +45,7 @@ export const CategoryRenderer: React.FC = ({ slug, id, ac
locale={locale}
routing={routing}
renderBlocks={renderBlocks}
+ hasPriority={hasPriority}
/>
);
diff --git a/packages/blocks/category/src/frontend/Category.server.tsx b/packages/blocks/category/src/frontend/Category.server.tsx
index 102602a1..5fb2cfaa 100644
--- a/packages/blocks/category/src/frontend/Category.server.tsx
+++ b/packages/blocks/category/src/frontend/Category.server.tsx
@@ -8,7 +8,15 @@ import { CategoryBlocks } from './CategoryBlocks';
export const CategoryDynamic = dynamic(() => import('./Category.client').then((module) => module.CategoryPure));
-export const Category: React.FC = async ({ id, slug, accessToken, locale, routing, renderBlocks }) => {
+export const Category: React.FC = async ({
+ id,
+ slug,
+ accessToken,
+ locale,
+ routing,
+ renderBlocks,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getCategory(
{
@@ -28,6 +36,7 @@ export const Category: React.FC = async ({ id, slug, accessToken,
routing={routing}
blocks={ }
renderBlocks={renderBlocks}
+ hasPriority={hasPriority}
/>
);
} catch (_error) {
diff --git a/packages/blocks/category/src/frontend/Category.types.ts b/packages/blocks/category/src/frontend/Category.types.ts
index 8857845a..00b45224 100644
--- a/packages/blocks/category/src/frontend/Category.types.ts
+++ b/packages/blocks/category/src/frontend/Category.types.ts
@@ -11,6 +11,7 @@ export interface CategoryProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
renderBlocks: (blocks: CMS.Model.Page.SlotBlock[], slug: string[]) => React.ReactNode;
}
diff --git a/packages/blocks/category/src/sdk/category.ts b/packages/blocks/category/src/sdk/category.ts
index 92f15c79..283ac7c7 100644
--- a/packages/blocks/category/src/sdk/category.ts
+++ b/packages/blocks/category/src/sdk/category.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/category.client';
+import { Model, Request } from '../api-harmonization/category.client';
+import { URL } from '../api-harmonization/category.url';
const API_URL = URL;
diff --git a/packages/blocks/category/tsconfig.frontend.json b/packages/blocks/category/tsconfig.frontend.json
index bf336912..78e003cb 100644
--- a/packages/blocks/category/tsconfig.frontend.json
+++ b/packages/blocks/category/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/category.url.ts",
"src/api-harmonization/category.client.ts",
"src/api-harmonization/category.model.ts",
"src/api-harmonization/category.request.ts",
diff --git a/packages/blocks/category/tsconfig.sdk.json b/packages/blocks/category/tsconfig.sdk.json
index dfbf0fc1..e37555a1 100644
--- a/packages/blocks/category/tsconfig.sdk.json
+++ b/packages/blocks/category/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/category.url.ts",
"src/api-harmonization/category.client.ts",
"src/api-harmonization/category.model.ts",
"src/api-harmonization/category.request.ts"
diff --git a/packages/blocks/faq/src/api-harmonization/faq.client.ts b/packages/blocks/faq/src/api-harmonization/faq.client.ts
index 106007ab..cc84c7c0 100644
--- a/packages/blocks/faq/src/api-harmonization/faq.client.ts
+++ b/packages/blocks/faq/src/api-harmonization/faq.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/faq';
+export { URL } from './faq.url';
export * as Model from './faq.model';
export * as Request from './faq.request';
diff --git a/packages/blocks/faq/src/api-harmonization/faq.url.ts b/packages/blocks/faq/src/api-harmonization/faq.url.ts
new file mode 100644
index 00000000..983f7a66
--- /dev/null
+++ b/packages/blocks/faq/src/api-harmonization/faq.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/faq';
diff --git a/packages/blocks/faq/src/frontend/Faq.renderer.tsx b/packages/blocks/faq/src/frontend/Faq.renderer.tsx
index 2ab525dc..b20c44e9 100644
--- a/packages/blocks/faq/src/frontend/Faq.renderer.tsx
+++ b/packages/blocks/faq/src/frontend/Faq.renderer.tsx
@@ -7,7 +7,7 @@ import { Loading } from '@o2s/ui/components/Loading';
import { Faq } from './Faq.server';
import { FaqRendererProps } from './Faq.types';
-export const FaqRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const FaqRenderer: React.FC = ({ id, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
@@ -19,7 +19,7 @@ export const FaqRenderer: React.FC = ({ id, accessToken, routi
}
>
-
+
);
};
diff --git a/packages/blocks/faq/src/frontend/Faq.server.tsx b/packages/blocks/faq/src/frontend/Faq.server.tsx
index 4bab7f90..85344037 100644
--- a/packages/blocks/faq/src/frontend/Faq.server.tsx
+++ b/packages/blocks/faq/src/frontend/Faq.server.tsx
@@ -7,7 +7,7 @@ import { FaqProps } from './Faq.types';
export const FaqDynamic = dynamic(() => import('./Faq.client').then((module) => module.FaqPure));
-export const Faq: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const Faq: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => {
try {
const data = await sdk.blocks.getFaq(
{
@@ -17,7 +17,16 @@ export const Faq: React.FC = async ({ id, accessToken, locale, routing
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/faq/src/frontend/Faq.types.ts b/packages/blocks/faq/src/frontend/Faq.types.ts
index d3a55d27..c1df6e86 100644
--- a/packages/blocks/faq/src/frontend/Faq.types.ts
+++ b/packages/blocks/faq/src/frontend/Faq.types.ts
@@ -7,6 +7,7 @@ export interface FaqProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type FaqPureProps = FaqProps & Model.FaqBlock;
diff --git a/packages/blocks/faq/src/sdk/faq.ts b/packages/blocks/faq/src/sdk/faq.ts
index cd4e9c14..667fc632 100644
--- a/packages/blocks/faq/src/sdk/faq.ts
+++ b/packages/blocks/faq/src/sdk/faq.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/faq.client';
+import { Model, Request } from '../api-harmonization/faq.client';
+import { URL } from '../api-harmonization/faq.url';
const API_URL = URL;
diff --git a/packages/blocks/faq/tsconfig.frontend.json b/packages/blocks/faq/tsconfig.frontend.json
index 13972a96..d93023d7 100644
--- a/packages/blocks/faq/tsconfig.frontend.json
+++ b/packages/blocks/faq/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/faq.url.ts",
"src/api-harmonization/faq.client.ts",
"src/api-harmonization/faq.model.ts",
"src/api-harmonization/faq.request.ts",
diff --git a/packages/blocks/faq/tsconfig.sdk.json b/packages/blocks/faq/tsconfig.sdk.json
index 20d6f7ff..87066c1f 100644
--- a/packages/blocks/faq/tsconfig.sdk.json
+++ b/packages/blocks/faq/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/faq.url.ts",
"src/api-harmonization/faq.client.ts",
"src/api-harmonization/faq.model.ts",
"src/api-harmonization/faq.request.ts"
diff --git a/packages/blocks/featured-service-list/src/api-harmonization/featured-service-list.client.ts b/packages/blocks/featured-service-list/src/api-harmonization/featured-service-list.client.ts
index 20f5070e..8925872a 100644
--- a/packages/blocks/featured-service-list/src/api-harmonization/featured-service-list.client.ts
+++ b/packages/blocks/featured-service-list/src/api-harmonization/featured-service-list.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/featured-service-list';
+export { URL } from './featured-service-list.url';
export * as Model from './featured-service-list.model';
export * as Request from './featured-service-list.request';
diff --git a/packages/blocks/featured-service-list/src/api-harmonization/featured-service-list.url.ts b/packages/blocks/featured-service-list/src/api-harmonization/featured-service-list.url.ts
new file mode 100644
index 00000000..66344b9c
--- /dev/null
+++ b/packages/blocks/featured-service-list/src/api-harmonization/featured-service-list.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/featured-service-list';
diff --git a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.renderer.tsx b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.renderer.tsx
index 7f78a406..6481ec96 100644
--- a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.renderer.tsx
+++ b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.renderer.tsx
@@ -7,7 +7,13 @@ import { Loading } from '@o2s/ui/components/Loading';
import { FeaturedServiceList } from './FeaturedServiceList.server';
import { FeaturedServiceListRendererProps } from './FeaturedServiceList.types';
-export const Renderer: React.FC = ({ id, accessToken, slug, routing }) => {
+export const Renderer: React.FC = ({
+ id,
+ accessToken,
+ slug,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
return (
@@ -19,7 +25,13 @@ export const Renderer: React.FC = ({ id, acces
>
}
>
-
+
);
};
diff --git a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.server.tsx b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.server.tsx
index 9edf64c8..c290b73c 100644
--- a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.server.tsx
+++ b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.server.tsx
@@ -9,7 +9,13 @@ export const FeaturedServiceListDynamic = dynamic(() =>
import('./FeaturedServiceList.client').then((module) => module.FeaturedServiceListPure),
);
-export const FeaturedServiceList: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const FeaturedServiceList: React.FC = async ({
+ id,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getFeaturedServiceList(
{
@@ -20,7 +26,14 @@ export const FeaturedServiceList: React.FC = async ({
);
return (
-
+
);
} catch (_error) {
return null;
diff --git a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.types.ts b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.types.ts
index 74df6182..93f10df4 100644
--- a/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.types.ts
+++ b/packages/blocks/featured-service-list/src/frontend/FeaturedServiceList.types.ts
@@ -7,6 +7,7 @@ export interface FeaturedServiceListProps {
locale: string;
accessToken?: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type FeaturedServiceListPureProps = FeaturedServiceListProps & Model.FeaturedServiceListBlock;
diff --git a/packages/blocks/featured-service-list/tsconfig.frontend.json b/packages/blocks/featured-service-list/tsconfig.frontend.json
index 5615b6fa..e6569efe 100644
--- a/packages/blocks/featured-service-list/tsconfig.frontend.json
+++ b/packages/blocks/featured-service-list/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/featured-service-list.url.ts",
"src/api-harmonization/featured-service-list.client.ts",
"src/api-harmonization/featured-service-list.model.ts",
"src/api-harmonization/featured-service-list.request.ts",
diff --git a/packages/blocks/featured-service-list/tsconfig.sdk.json b/packages/blocks/featured-service-list/tsconfig.sdk.json
index 2d77d4f5..deb63e41 100644
--- a/packages/blocks/featured-service-list/tsconfig.sdk.json
+++ b/packages/blocks/featured-service-list/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/featured-service-list.url.ts",
"src/api-harmonization/featured-service-list.client.ts",
"src/api-harmonization/featured-service-list.model.ts",
"src/api-harmonization/featured-service-list.request.ts"
diff --git a/packages/blocks/invoice-list/src/api-harmonization/invoice-list.client.ts b/packages/blocks/invoice-list/src/api-harmonization/invoice-list.client.ts
index 7eb2b351..8121a879 100644
--- a/packages/blocks/invoice-list/src/api-harmonization/invoice-list.client.ts
+++ b/packages/blocks/invoice-list/src/api-harmonization/invoice-list.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/invoice-list';
+export { URL } from './invoice-list.url';
export * as Model from './invoice-list.model';
export * as Request from './invoice-list.request';
diff --git a/packages/blocks/invoice-list/src/api-harmonization/invoice-list.url.ts b/packages/blocks/invoice-list/src/api-harmonization/invoice-list.url.ts
new file mode 100644
index 00000000..67b4916c
--- /dev/null
+++ b/packages/blocks/invoice-list/src/api-harmonization/invoice-list.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/invoice-list';
diff --git a/packages/blocks/invoice-list/src/frontend/InvoiceList.renderer.tsx b/packages/blocks/invoice-list/src/frontend/InvoiceList.renderer.tsx
index feed9522..ee39ed67 100644
--- a/packages/blocks/invoice-list/src/frontend/InvoiceList.renderer.tsx
+++ b/packages/blocks/invoice-list/src/frontend/InvoiceList.renderer.tsx
@@ -7,22 +7,26 @@ import { Loading } from '@o2s/ui/components/Loading';
import { InvoiceListServer } from './InvoiceList.server';
import { InvoiceListRendererProps } from './InvoiceList.types';
-export const InvoiceListRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const InvoiceListRenderer: React.FC = ({ id, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
+
-
-
-
- >
+
+
}
>
-
+
);
};
diff --git a/packages/blocks/invoice-list/src/frontend/InvoiceList.server.tsx b/packages/blocks/invoice-list/src/frontend/InvoiceList.server.tsx
index d6a58517..28465ac2 100644
--- a/packages/blocks/invoice-list/src/frontend/InvoiceList.server.tsx
+++ b/packages/blocks/invoice-list/src/frontend/InvoiceList.server.tsx
@@ -9,7 +9,13 @@ export const InvoiceListDynamic = dynamic(() =>
import('./InvoiceList.client').then((module) => module.InvoiceListPure),
);
-export const InvoiceListServer: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const InvoiceListServer: React.FC = async ({
+ id,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getInvoiceList(
{
@@ -19,7 +25,16 @@ export const InvoiceListServer: React.FC = async ({ id, access
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/invoice-list/src/frontend/InvoiceList.types.ts b/packages/blocks/invoice-list/src/frontend/InvoiceList.types.ts
index 584e3af7..911279c1 100644
--- a/packages/blocks/invoice-list/src/frontend/InvoiceList.types.ts
+++ b/packages/blocks/invoice-list/src/frontend/InvoiceList.types.ts
@@ -7,6 +7,7 @@ export interface InvoiceListProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type InvoiceListPureProps = InvoiceListProps & Model.InvoiceListBlock;
diff --git a/packages/blocks/invoice-list/src/sdk/invoice-list.ts b/packages/blocks/invoice-list/src/sdk/invoice-list.ts
index 0b08b82a..18639800 100644
--- a/packages/blocks/invoice-list/src/sdk/invoice-list.ts
+++ b/packages/blocks/invoice-list/src/sdk/invoice-list.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/invoice-list.client';
+import { Model, Request } from '../api-harmonization/invoice-list.client';
+import { URL } from '../api-harmonization/invoice-list.url';
const API_URL = URL;
diff --git a/packages/blocks/invoice-list/tsconfig.frontend.json b/packages/blocks/invoice-list/tsconfig.frontend.json
index 3702fafb..e345e95c 100644
--- a/packages/blocks/invoice-list/tsconfig.frontend.json
+++ b/packages/blocks/invoice-list/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/invoice-list.url.ts",
"src/api-harmonization/invoice-list.client.ts",
"src/api-harmonization/invoice-list.model.ts",
"src/api-harmonization/invoice-list.request.ts",
diff --git a/packages/blocks/invoice-list/tsconfig.sdk.json b/packages/blocks/invoice-list/tsconfig.sdk.json
index d3d26830..8d2c6ae0 100644
--- a/packages/blocks/invoice-list/tsconfig.sdk.json
+++ b/packages/blocks/invoice-list/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/invoice-list.url.ts",
"src/api-harmonization/invoice-list.client.ts",
"src/api-harmonization/invoice-list.model.ts",
"src/api-harmonization/invoice-list.request.ts"
diff --git a/packages/blocks/notification-details/src/api-harmonization/notification-details.client.ts b/packages/blocks/notification-details/src/api-harmonization/notification-details.client.ts
index 857433d8..87752dc3 100644
--- a/packages/blocks/notification-details/src/api-harmonization/notification-details.client.ts
+++ b/packages/blocks/notification-details/src/api-harmonization/notification-details.client.ts
@@ -1,4 +1,4 @@
-export const URL = '/blocks/notification-details';
+export { URL } from './notification-details.url';
export * as Model from './notification-details.model';
export * as Request from './notification-details.request';
diff --git a/packages/blocks/notification-details/src/api-harmonization/notification-details.url.ts b/packages/blocks/notification-details/src/api-harmonization/notification-details.url.ts
new file mode 100644
index 00000000..ccb7af24
--- /dev/null
+++ b/packages/blocks/notification-details/src/api-harmonization/notification-details.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/notification-details';
diff --git a/packages/blocks/notification-details/src/frontend/NotificationDetails.renderer.tsx b/packages/blocks/notification-details/src/frontend/NotificationDetails.renderer.tsx
index 1ee44bfc..d3ef99a4 100644
--- a/packages/blocks/notification-details/src/frontend/NotificationDetails.renderer.tsx
+++ b/packages/blocks/notification-details/src/frontend/NotificationDetails.renderer.tsx
@@ -1,12 +1,19 @@
import { useLocale } from 'next-intl';
import React, { Suspense } from 'react';
+import { Container } from '@o2s/ui/components/Container';
import { Loading } from '@o2s/ui/components/Loading';
import { NotificationDetails } from './NotificationDetails.server';
import { FaqRendererProps } from './NotificationDetails.types';
-export const NotificationDetailsRenderer: React.FC = ({ slug, id, accessToken, routing }) => {
+export const NotificationDetailsRenderer: React.FC = ({
+ slug,
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
if (!slug[1]) {
@@ -14,13 +21,24 @@ export const NotificationDetailsRenderer: React.FC = ({ slug,
}
return (
- }>
+
+
+
+
+
+
+ }
+ >
);
diff --git a/packages/blocks/notification-details/src/frontend/NotificationDetails.server.tsx b/packages/blocks/notification-details/src/frontend/NotificationDetails.server.tsx
index 2d9f4f28..2f968a81 100644
--- a/packages/blocks/notification-details/src/frontend/NotificationDetails.server.tsx
+++ b/packages/blocks/notification-details/src/frontend/NotificationDetails.server.tsx
@@ -15,6 +15,7 @@ export const NotificationDetails: React.FC = async ({
accessToken,
locale,
routing,
+ hasPriority,
}) => {
try {
const data = await sdk.blocks.getNotificationDetails(
@@ -36,6 +37,7 @@ export const NotificationDetails: React.FC = async ({
accessToken={accessToken}
locale={locale}
routing={routing}
+ hasPriority={hasPriority}
/>
);
} catch (_error) {
diff --git a/packages/blocks/notification-details/src/frontend/NotificationDetails.types.ts b/packages/blocks/notification-details/src/frontend/NotificationDetails.types.ts
index 60767d2a..a71ab3b2 100644
--- a/packages/blocks/notification-details/src/frontend/NotificationDetails.types.ts
+++ b/packages/blocks/notification-details/src/frontend/NotificationDetails.types.ts
@@ -8,6 +8,7 @@ export interface NotificationDetailsProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type NotificationDetailsPureProps = NotificationDetailsProps & Model.NotificationDetailsBlock;
diff --git a/packages/blocks/notification-details/src/sdk/notification-details.ts b/packages/blocks/notification-details/src/sdk/notification-details.ts
index 0b3f14c1..1c8aa633 100644
--- a/packages/blocks/notification-details/src/sdk/notification-details.ts
+++ b/packages/blocks/notification-details/src/sdk/notification-details.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/notification-details.client';
+import { Model, Request } from '../api-harmonization/notification-details.client';
+import { URL } from '../api-harmonization/notification-details.url';
const API_URL = URL;
diff --git a/packages/blocks/notification-details/tsconfig.frontend.json b/packages/blocks/notification-details/tsconfig.frontend.json
index f91e3821..dd899440 100644
--- a/packages/blocks/notification-details/tsconfig.frontend.json
+++ b/packages/blocks/notification-details/tsconfig.frontend.json
@@ -13,6 +13,7 @@
},
"include": [
"src/frontend",
+ "src/api-harmonization/notification-details.url.ts",
"src/api-harmonization/notification-details.client.ts",
"src/api-harmonization/notification-details.model.ts",
"src/api-harmonization/notification-details.request.ts",
diff --git a/packages/blocks/notification-details/tsconfig.sdk.json b/packages/blocks/notification-details/tsconfig.sdk.json
index 14c92fed..5f3bf827 100644
--- a/packages/blocks/notification-details/tsconfig.sdk.json
+++ b/packages/blocks/notification-details/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/notification-details.url.ts",
"src/api-harmonization/notification-details.client.ts",
"src/api-harmonization/notification-details.model.ts",
"src/api-harmonization/notification-details.request.ts"
diff --git a/packages/blocks/notification-list/src/api-harmonization/notification-list.url.ts b/packages/blocks/notification-list/src/api-harmonization/notification-list.url.ts
new file mode 100644
index 00000000..b2be78b2
--- /dev/null
+++ b/packages/blocks/notification-list/src/api-harmonization/notification-list.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/notification-list';
diff --git a/packages/blocks/notification-list/src/frontend/NotificationList.renderer.tsx b/packages/blocks/notification-list/src/frontend/NotificationList.renderer.tsx
index fbba7506..4d64c011 100644
--- a/packages/blocks/notification-list/src/frontend/NotificationList.renderer.tsx
+++ b/packages/blocks/notification-list/src/frontend/NotificationList.renderer.tsx
@@ -6,12 +6,31 @@ import { Loading } from '@o2s/ui/components/Loading';
import { NotificationListServer } from './NotificationList.server';
import { NotificationListRendererProps } from './NotificationList.types';
-export const NotificationListRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const NotificationListRenderer: React.FC = ({
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
return (
- }>
-
+
+
+
+
+ }
+ >
+
);
};
diff --git a/packages/blocks/notification-list/src/frontend/NotificationList.server.tsx b/packages/blocks/notification-list/src/frontend/NotificationList.server.tsx
index 14ff0e14..03d925e2 100644
--- a/packages/blocks/notification-list/src/frontend/NotificationList.server.tsx
+++ b/packages/blocks/notification-list/src/frontend/NotificationList.server.tsx
@@ -9,7 +9,13 @@ export const NotificationListDynamic = dynamic(() =>
import('./NotificationList.client').then((module) => module.NotificationListPure),
);
-export const NotificationListServer: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const NotificationListServer: React.FC = async ({
+ id,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getNotificationList(
{
@@ -20,7 +26,14 @@ export const NotificationListServer: React.FC = async ({
);
return (
-
+
);
} catch (_error) {
return null;
diff --git a/packages/blocks/notification-list/src/frontend/NotificationList.types.ts b/packages/blocks/notification-list/src/frontend/NotificationList.types.ts
index 7c8c0156..89da92eb 100644
--- a/packages/blocks/notification-list/src/frontend/NotificationList.types.ts
+++ b/packages/blocks/notification-list/src/frontend/NotificationList.types.ts
@@ -7,6 +7,7 @@ export interface NotificationListProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type NotificationListPureProps = NotificationListProps & Model.NotificationListBlock;
diff --git a/packages/blocks/notification-list/src/sdk/notification-list.ts b/packages/blocks/notification-list/src/sdk/notification-list.ts
index 0e3b7cf0..12d4a426 100644
--- a/packages/blocks/notification-list/src/sdk/notification-list.ts
+++ b/packages/blocks/notification-list/src/sdk/notification-list.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/notification-list.client';
+import { Model, Request } from '../api-harmonization/notification-list.client';
+import { URL } from '../api-harmonization/notification-list.url';
const API_URL = URL;
diff --git a/packages/blocks/notification-list/tsconfig.frontend.json b/packages/blocks/notification-list/tsconfig.frontend.json
index e6523124..18320d2e 100644
--- a/packages/blocks/notification-list/tsconfig.frontend.json
+++ b/packages/blocks/notification-list/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/notification-list.client.ts",
"src/api-harmonization/notification-list.model.ts",
"src/api-harmonization/notification-list.request.ts",
+ "src/api-harmonization/notification-list.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/notification-list/tsconfig.sdk.json b/packages/blocks/notification-list/tsconfig.sdk.json
index b3390ca2..c72ab187 100644
--- a/packages/blocks/notification-list/tsconfig.sdk.json
+++ b/packages/blocks/notification-list/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/notification-list.url.ts",
"src/api-harmonization/notification-list.client.ts",
"src/api-harmonization/notification-list.model.ts",
"src/api-harmonization/notification-list.request.ts"
diff --git a/packages/blocks/order-details/src/api-harmonization/order-details.url.ts b/packages/blocks/order-details/src/api-harmonization/order-details.url.ts
new file mode 100644
index 00000000..8c53d41e
--- /dev/null
+++ b/packages/blocks/order-details/src/api-harmonization/order-details.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/order-details';
diff --git a/packages/blocks/order-details/src/frontend/OrderDetails.renderer.tsx b/packages/blocks/order-details/src/frontend/OrderDetails.renderer.tsx
index 81ad51e3..4f6d546c 100644
--- a/packages/blocks/order-details/src/frontend/OrderDetails.renderer.tsx
+++ b/packages/blocks/order-details/src/frontend/OrderDetails.renderer.tsx
@@ -6,7 +6,13 @@ import { Loading } from '@o2s/ui/components/Loading';
import { OrderDetails } from './OrderDetails.server';
import { OrderDetailsRendererProps } from './OrderDetails.types';
-export const OrderDetailsRenderer: React.FC = ({ slug, id, accessToken, routing }) => {
+export const OrderDetailsRenderer: React.FC = ({
+ slug,
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
if (!slug[1]) {
@@ -17,17 +23,36 @@ export const OrderDetailsRenderer: React.FC = ({ slug
-
+
}
>
-
+
);
};
diff --git a/packages/blocks/order-details/src/frontend/OrderDetails.server.tsx b/packages/blocks/order-details/src/frontend/OrderDetails.server.tsx
index b1f41b6f..66ae12d3 100644
--- a/packages/blocks/order-details/src/frontend/OrderDetails.server.tsx
+++ b/packages/blocks/order-details/src/frontend/OrderDetails.server.tsx
@@ -10,7 +10,14 @@ export const OrderDetailsDynamic = dynamic(() =>
import('./OrderDetails.client').then((module) => module.OrderDetailsPure),
);
-export const OrderDetails: React.FC = async ({ id, orderId, accessToken, locale, routing }) => {
+export const OrderDetails: React.FC = async ({
+ id,
+ orderId,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getOrderDetails(
{
@@ -31,6 +38,7 @@ export const OrderDetails: React.FC = async ({ id, orderId, a
accessToken={accessToken}
locale={locale}
routing={routing}
+ hasPriority={hasPriority}
/>
);
} catch (_error) {
diff --git a/packages/blocks/order-details/src/frontend/OrderDetails.types.ts b/packages/blocks/order-details/src/frontend/OrderDetails.types.ts
index e2c965fa..5dde7653 100644
--- a/packages/blocks/order-details/src/frontend/OrderDetails.types.ts
+++ b/packages/blocks/order-details/src/frontend/OrderDetails.types.ts
@@ -8,6 +8,7 @@ export interface OrderDetailsProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type OrderDetailsPureProps = OrderDetailsProps & Model.OrderDetailsBlock;
diff --git a/packages/blocks/order-details/src/sdk/order-details.ts b/packages/blocks/order-details/src/sdk/order-details.ts
index 8ff28133..9331ba03 100644
--- a/packages/blocks/order-details/src/sdk/order-details.ts
+++ b/packages/blocks/order-details/src/sdk/order-details.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/order-details.client';
+import { Model, Request } from '../api-harmonization/order-details.client';
+import { URL } from '../api-harmonization/order-details.url';
const API_URL = URL;
diff --git a/packages/blocks/order-details/tsconfig.frontend.json b/packages/blocks/order-details/tsconfig.frontend.json
index 2783925d..355574bd 100644
--- a/packages/blocks/order-details/tsconfig.frontend.json
+++ b/packages/blocks/order-details/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/order-details.client.ts",
"src/api-harmonization/order-details.model.ts",
"src/api-harmonization/order-details.request.ts",
+ "src/api-harmonization/order-details.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/order-details/tsconfig.sdk.json b/packages/blocks/order-details/tsconfig.sdk.json
index 1707728e..9f0db731 100644
--- a/packages/blocks/order-details/tsconfig.sdk.json
+++ b/packages/blocks/order-details/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/order-details.url.ts",
"src/api-harmonization/order-details.client.ts",
"src/api-harmonization/order-details.model.ts",
"src/api-harmonization/order-details.request.ts"
diff --git a/packages/blocks/order-list/src/api-harmonization/order-list.url.ts b/packages/blocks/order-list/src/api-harmonization/order-list.url.ts
new file mode 100644
index 00000000..c2e6320f
--- /dev/null
+++ b/packages/blocks/order-list/src/api-harmonization/order-list.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/order-list';
diff --git a/packages/blocks/order-list/src/frontend/OrderList.renderer.tsx b/packages/blocks/order-list/src/frontend/OrderList.renderer.tsx
index 69656833..83621052 100644
--- a/packages/blocks/order-list/src/frontend/OrderList.renderer.tsx
+++ b/packages/blocks/order-list/src/frontend/OrderList.renderer.tsx
@@ -6,26 +6,12 @@ import { Loading } from '@o2s/ui/components/Loading';
import { OrderList } from './OrderList.server';
import { OrderListRendererProps } from './OrderList.types';
-export const Renderer: React.FC = ({ id, accessToken, routing }) => {
+export const Renderer: React.FC = ({ id, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
-
-
-
-
- }
- >
-
+ }>
+
);
};
diff --git a/packages/blocks/order-list/src/frontend/OrderList.server.tsx b/packages/blocks/order-list/src/frontend/OrderList.server.tsx
index 5fee4d7d..1c180de8 100644
--- a/packages/blocks/order-list/src/frontend/OrderList.server.tsx
+++ b/packages/blocks/order-list/src/frontend/OrderList.server.tsx
@@ -7,7 +7,7 @@ import { OrderListProps } from './OrderList.types';
export const OrderListDynamic = dynamic(() => import('./OrderList.client').then((module) => module.OrderListPure));
-export const OrderList: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const OrderList: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => {
try {
const data = await sdk.blocks.getOrderList(
{
@@ -17,7 +17,16 @@ export const OrderList: React.FC = async ({ id, accessToken, loc
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/order-list/src/frontend/OrderList.types.ts b/packages/blocks/order-list/src/frontend/OrderList.types.ts
index 9b3e4f34..21d2932f 100644
--- a/packages/blocks/order-list/src/frontend/OrderList.types.ts
+++ b/packages/blocks/order-list/src/frontend/OrderList.types.ts
@@ -7,6 +7,7 @@ export interface OrderListProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export interface OrderListRendererProps extends Omit {
diff --git a/packages/blocks/order-list/src/sdk/order-list.ts b/packages/blocks/order-list/src/sdk/order-list.ts
index 7749614c..db78cfc0 100644
--- a/packages/blocks/order-list/src/sdk/order-list.ts
+++ b/packages/blocks/order-list/src/sdk/order-list.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/order-list.client';
+import { Model, Request } from '../api-harmonization/order-list.client';
+import { URL } from '../api-harmonization/order-list.url';
export const orderList = (sdk: Sdk) => ({
blocks: {
diff --git a/packages/blocks/order-list/tsconfig.frontend.json b/packages/blocks/order-list/tsconfig.frontend.json
index a98e593f..b4551382 100644
--- a/packages/blocks/order-list/tsconfig.frontend.json
+++ b/packages/blocks/order-list/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/order-list.client.ts",
"src/api-harmonization/order-list.model.ts",
"src/api-harmonization/order-list.request.ts",
+ "src/api-harmonization/order-list.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/order-list/tsconfig.sdk.json b/packages/blocks/order-list/tsconfig.sdk.json
index cc2ce2b1..e508fcd0 100644
--- a/packages/blocks/order-list/tsconfig.sdk.json
+++ b/packages/blocks/order-list/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/order-list.url.ts",
"src/api-harmonization/order-list.client.ts",
"src/api-harmonization/order-list.model.ts",
"src/api-harmonization/order-list.request.ts"
diff --git a/packages/blocks/orders-summary/src/api-harmonization/orders-summary.url.ts b/packages/blocks/orders-summary/src/api-harmonization/orders-summary.url.ts
new file mode 100644
index 00000000..08221795
--- /dev/null
+++ b/packages/blocks/orders-summary/src/api-harmonization/orders-summary.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/orders-summary';
diff --git a/packages/blocks/orders-summary/src/frontend/OrdersSummary.client.tsx b/packages/blocks/orders-summary/src/frontend/OrdersSummary.client.tsx
index 832d60e4..3525ca6b 100644
--- a/packages/blocks/orders-summary/src/frontend/OrdersSummary.client.tsx
+++ b/packages/blocks/orders-summary/src/frontend/OrdersSummary.client.tsx
@@ -2,12 +2,12 @@
import dayjs from 'dayjs';
import { useLocale } from 'next-intl';
+import dynamic from 'next/dynamic';
import React, { useState, useTransition } from 'react';
import { cn } from '@o2s/ui/lib/utils';
import { InfoCard } from '@o2s/ui/components/Cards/InfoCard';
-import { DoubleLineChart } from '@o2s/ui/components/Chart/DoubleLineChart';
import { Price } from '@o2s/ui/components/Price';
import { Card } from '@o2s/ui/elements/card';
@@ -20,6 +20,11 @@ import { sdk } from '../sdk';
import { OrdersSummaryPureProps } from './OrdersSummary.types';
+const DoubleLineChart = dynamic(
+ () => import('@o2s/ui/components/Chart/DoubleLineChart').then((module) => module.DoubleLineChart),
+ {},
+);
+
const Trend: React.FC> = ({ value }) => {
const locale = useLocale();
diff --git a/packages/blocks/orders-summary/src/frontend/OrdersSummary.renderer.tsx b/packages/blocks/orders-summary/src/frontend/OrdersSummary.renderer.tsx
index 6908a17f..3a8fdd44 100644
--- a/packages/blocks/orders-summary/src/frontend/OrdersSummary.renderer.tsx
+++ b/packages/blocks/orders-summary/src/frontend/OrdersSummary.renderer.tsx
@@ -3,37 +3,42 @@ import React, { Suspense } from 'react';
import { Loading } from '@o2s/ui/components/Loading';
-import { Model, Request } from '../api-harmonization/orders-summary.client';
-
import { OrdersSummary } from './OrdersSummary.server';
import { OrdersSummaryRendererProps } from './OrdersSummary.types';
-export const OrdersSummaryRenderer: React.FC = ({ id, accessToken, routing, slug }) => {
+export const OrdersSummaryRenderer: React.FC = ({
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
return (
-
-
-
+
}
>
-
+
);
};
diff --git a/packages/blocks/orders-summary/src/frontend/OrdersSummary.server.tsx b/packages/blocks/orders-summary/src/frontend/OrdersSummary.server.tsx
index 7948d2ba..5e5d8b6e 100644
--- a/packages/blocks/orders-summary/src/frontend/OrdersSummary.server.tsx
+++ b/packages/blocks/orders-summary/src/frontend/OrdersSummary.server.tsx
@@ -11,7 +11,13 @@ export const OrdersSummaryDynamic = dynamic(() =>
import('./OrdersSummary.client').then((module) => module.OrdersSummaryPure),
);
-export const OrdersSummary: React.FC
= async ({ id, accessToken, locale, routing }) => {
+export const OrdersSummary: React.FC = async ({
+ id,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getOrdersSummary(
{
@@ -24,7 +30,16 @@ export const OrdersSummary: React.FC = async ({ id, accessTo
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
console.error(_error);
return null;
diff --git a/packages/blocks/orders-summary/src/frontend/OrdersSummary.types.ts b/packages/blocks/orders-summary/src/frontend/OrdersSummary.types.ts
index c90697f5..f623485d 100644
--- a/packages/blocks/orders-summary/src/frontend/OrdersSummary.types.ts
+++ b/packages/blocks/orders-summary/src/frontend/OrdersSummary.types.ts
@@ -7,6 +7,7 @@ export interface OrdersSummaryProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type OrdersSummaryPureProps = OrdersSummaryProps & Model.OrdersSummaryBlock;
diff --git a/packages/blocks/orders-summary/src/sdk/orders-summary.ts b/packages/blocks/orders-summary/src/sdk/orders-summary.ts
index ae92d825..b7e22298 100644
--- a/packages/blocks/orders-summary/src/sdk/orders-summary.ts
+++ b/packages/blocks/orders-summary/src/sdk/orders-summary.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/orders-summary.client';
+import { Model, Request } from '../api-harmonization/orders-summary.client';
+import { URL } from '../api-harmonization/orders-summary.url';
const API_URL = URL;
diff --git a/packages/blocks/orders-summary/tsconfig.frontend.json b/packages/blocks/orders-summary/tsconfig.frontend.json
index 8f135bf8..916f1090 100644
--- a/packages/blocks/orders-summary/tsconfig.frontend.json
+++ b/packages/blocks/orders-summary/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/orders-summary.client.ts",
"src/api-harmonization/orders-summary.model.ts",
"src/api-harmonization/orders-summary.request.ts",
+ "src/api-harmonization/orders-summary.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/orders-summary/tsconfig.sdk.json b/packages/blocks/orders-summary/tsconfig.sdk.json
index 00513988..f290db09 100644
--- a/packages/blocks/orders-summary/tsconfig.sdk.json
+++ b/packages/blocks/orders-summary/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/orders-summary.url.ts",
"src/api-harmonization/orders-summary.client.ts",
"src/api-harmonization/orders-summary.model.ts",
"src/api-harmonization/orders-summary.request.ts"
diff --git a/packages/blocks/payments-history/src/api-harmonization/payments-history.url.ts b/packages/blocks/payments-history/src/api-harmonization/payments-history.url.ts
new file mode 100644
index 00000000..44eef33e
--- /dev/null
+++ b/packages/blocks/payments-history/src/api-harmonization/payments-history.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/payments-history';
diff --git a/packages/blocks/payments-history/src/frontend/PaymentsHistory.client.tsx b/packages/blocks/payments-history/src/frontend/PaymentsHistory.client.tsx
index 9c45e8ab..041018e7 100644
--- a/packages/blocks/payments-history/src/frontend/PaymentsHistory.client.tsx
+++ b/packages/blocks/payments-history/src/frontend/PaymentsHistory.client.tsx
@@ -1,14 +1,17 @@
'use client';
+import dynamic from 'next/dynamic';
import React from 'react';
-import { StackedBarChart } from '@o2s/ui/components/Chart/StackedBarChart';
-
import { Card } from '@o2s/ui/elements/card';
import { Typography } from '@o2s/ui/elements/typography';
import { PaymentsHistoryPureProps } from './PaymentsHistory.types';
+const StackedBarChart = dynamic(() =>
+ import('@o2s/ui/components/Chart/StackedBarChart').then((module) => module.StackedBarChart),
+);
+
export const PaymentsHistoryPure: React.FC = ({ ...component }) => {
const { chartData, labels, title, currency } = component;
diff --git a/packages/blocks/payments-history/src/frontend/PaymentsHistory.renderer.tsx b/packages/blocks/payments-history/src/frontend/PaymentsHistory.renderer.tsx
index e0a96b12..52fdcc08 100644
--- a/packages/blocks/payments-history/src/frontend/PaymentsHistory.renderer.tsx
+++ b/packages/blocks/payments-history/src/frontend/PaymentsHistory.renderer.tsx
@@ -8,14 +8,15 @@ import { PaymentsHistory } from './PaymentsHistory.server';
export interface PaymentsHistoryRendererProps {
id: string;
accessToken?: string;
+ hasPriority?: boolean;
}
-export const PaymentsHistoryRenderer: React.FC = ({ id, accessToken }) => {
+export const PaymentsHistoryRenderer: React.FC = ({ id, accessToken, hasPriority }) => {
const locale = useLocale();
return (
}>
-
+
);
};
diff --git a/packages/blocks/payments-history/src/frontend/PaymentsHistory.server.tsx b/packages/blocks/payments-history/src/frontend/PaymentsHistory.server.tsx
index 3d19edaa..c3751b2d 100644
--- a/packages/blocks/payments-history/src/frontend/PaymentsHistory.server.tsx
+++ b/packages/blocks/payments-history/src/frontend/PaymentsHistory.server.tsx
@@ -9,7 +9,7 @@ export const PaymentsHistoryDynamic = dynamic(() =>
import('./PaymentsHistory.client').then((module) => module.PaymentsHistoryPure),
);
-export const PaymentsHistory: React.FC = async ({ id, accessToken, locale }) => {
+export const PaymentsHistory: React.FC = async ({ id, accessToken, locale, hasPriority }) => {
try {
const data = await sdk.blocks.getPaymentsHistory(
{
@@ -21,7 +21,15 @@ export const PaymentsHistory: React.FC = async ({ id, acce
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/payments-history/src/frontend/PaymentsHistory.types.ts b/packages/blocks/payments-history/src/frontend/PaymentsHistory.types.ts
index fe3aabbd..d533ed8a 100644
--- a/packages/blocks/payments-history/src/frontend/PaymentsHistory.types.ts
+++ b/packages/blocks/payments-history/src/frontend/PaymentsHistory.types.ts
@@ -4,6 +4,7 @@ export interface PaymentsHistoryProps {
id: string;
accessToken?: string;
locale: string;
+ hasPriority?: boolean;
}
export type PaymentsHistoryPureProps = PaymentsHistoryProps & Model.PaymentsHistoryBlock;
diff --git a/packages/blocks/payments-history/src/sdk/payments-history.ts b/packages/blocks/payments-history/src/sdk/payments-history.ts
index 2580e3b1..6e115417 100644
--- a/packages/blocks/payments-history/src/sdk/payments-history.ts
+++ b/packages/blocks/payments-history/src/sdk/payments-history.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/payments-history.client';
+import { Model, Request } from '../api-harmonization/payments-history.client';
+import { URL } from '../api-harmonization/payments-history.url';
const API_URL = URL;
diff --git a/packages/blocks/payments-history/tsconfig.frontend.json b/packages/blocks/payments-history/tsconfig.frontend.json
index b833576d..5a7b721a 100644
--- a/packages/blocks/payments-history/tsconfig.frontend.json
+++ b/packages/blocks/payments-history/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/payments-history.client.ts",
"src/api-harmonization/payments-history.model.ts",
"src/api-harmonization/payments-history.request.ts",
+ "src/api-harmonization/payments-history.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/payments-history/tsconfig.sdk.json b/packages/blocks/payments-history/tsconfig.sdk.json
index 256125a3..fbd4f425 100644
--- a/packages/blocks/payments-history/tsconfig.sdk.json
+++ b/packages/blocks/payments-history/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/payments-history.url.ts",
"src/api-harmonization/payments-history.client.ts",
"src/api-harmonization/payments-history.model.ts",
"src/api-harmonization/payments-history.request.ts"
diff --git a/packages/blocks/payments-summary/src/api-harmonization/payments-summary.url.ts b/packages/blocks/payments-summary/src/api-harmonization/payments-summary.url.ts
new file mode 100644
index 00000000..667a3904
--- /dev/null
+++ b/packages/blocks/payments-summary/src/api-harmonization/payments-summary.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/payments-summary';
diff --git a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.renderer.tsx b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.renderer.tsx
index 743a02b9..5e8462d3 100644
--- a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.renderer.tsx
+++ b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.renderer.tsx
@@ -6,12 +6,23 @@ import { Loading } from '@o2s/ui/components/Loading';
import { PaymentsSummary } from './PaymentsSummary.server';
import { PaymentsSummaryRendererProps } from './PaymentsSummary.types';
-export const PaymentsSummaryRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const PaymentsSummaryRenderer: React.FC = ({
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
return (
}>
-
+
);
};
diff --git a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.server.tsx b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.server.tsx
index cb6bccc9..56cf0bf0 100644
--- a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.server.tsx
+++ b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.server.tsx
@@ -9,7 +9,13 @@ export const PaymentsSummaryDynamic = dynamic(() =>
import('./PaymentsSummary.client').then((module) => module.PaymentsSummaryPure),
);
-export const PaymentsSummary: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const PaymentsSummary: React.FC = async ({
+ id,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getPaymentsSummary(
{
@@ -21,7 +27,16 @@ export const PaymentsSummary: React.FC = async ({ id, acce
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.types.ts b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.types.ts
index 4bd380c4..9ed26cc4 100644
--- a/packages/blocks/payments-summary/src/frontend/PaymentsSummary.types.ts
+++ b/packages/blocks/payments-summary/src/frontend/PaymentsSummary.types.ts
@@ -7,6 +7,7 @@ export interface PaymentsSummaryProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type PaymentsSummaryPureProps = PaymentsSummaryProps & Model.PaymentsSummaryBlock;
diff --git a/packages/blocks/payments-summary/src/sdk/payments-summary.ts b/packages/blocks/payments-summary/src/sdk/payments-summary.ts
index 455ede0e..412f2681 100644
--- a/packages/blocks/payments-summary/src/sdk/payments-summary.ts
+++ b/packages/blocks/payments-summary/src/sdk/payments-summary.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/payments-summary.client';
+import { Model, Request } from '../api-harmonization/payments-summary.client';
+import { URL } from '../api-harmonization/payments-summary.url';
const API_URL = URL;
diff --git a/packages/blocks/payments-summary/tsconfig.frontend.json b/packages/blocks/payments-summary/tsconfig.frontend.json
index 8f7fd622..23827b0b 100644
--- a/packages/blocks/payments-summary/tsconfig.frontend.json
+++ b/packages/blocks/payments-summary/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/payments-summary.client.ts",
"src/api-harmonization/payments-summary.model.ts",
"src/api-harmonization/payments-summary.request.ts",
+ "src/api-harmonization/payments-summary.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/payments-summary/tsconfig.sdk.json b/packages/blocks/payments-summary/tsconfig.sdk.json
index 2ee949bf..3502f9eb 100644
--- a/packages/blocks/payments-summary/tsconfig.sdk.json
+++ b/packages/blocks/payments-summary/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/payments-summary.url.ts",
"src/api-harmonization/payments-summary.client.ts",
"src/api-harmonization/payments-summary.model.ts",
"src/api-harmonization/payments-summary.request.ts"
diff --git a/packages/blocks/quick-links/src/api-harmonization/quick-links.url.ts b/packages/blocks/quick-links/src/api-harmonization/quick-links.url.ts
new file mode 100644
index 00000000..d375ae8d
--- /dev/null
+++ b/packages/blocks/quick-links/src/api-harmonization/quick-links.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/quick-links';
diff --git a/packages/blocks/quick-links/src/frontend/QuickLinks.renderer.tsx b/packages/blocks/quick-links/src/frontend/QuickLinks.renderer.tsx
index 108a7053..c190f31c 100644
--- a/packages/blocks/quick-links/src/frontend/QuickLinks.renderer.tsx
+++ b/packages/blocks/quick-links/src/frontend/QuickLinks.renderer.tsx
@@ -7,7 +7,7 @@ import { Loading } from '@o2s/ui/components/Loading';
import { QuickLinks } from './QuickLinks.server';
import { QuickLinksRendererProps } from './QuickLinks.types';
-export const QuickLinksRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const QuickLinksRenderer: React.FC = ({ id, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
@@ -19,7 +19,7 @@ export const QuickLinksRenderer: React.FC = ({ id, acce
}
>
-
+
);
};
diff --git a/packages/blocks/quick-links/src/frontend/QuickLinks.server.tsx b/packages/blocks/quick-links/src/frontend/QuickLinks.server.tsx
index d9b0a9ce..fd28f81c 100644
--- a/packages/blocks/quick-links/src/frontend/QuickLinks.server.tsx
+++ b/packages/blocks/quick-links/src/frontend/QuickLinks.server.tsx
@@ -7,7 +7,7 @@ import { QuickLinksProps } from './QuickLinks.types';
export const QuickLinksDynamic = dynamic(() => import('./QuickLinks.client').then((module) => module.QuickLinksPure));
-export const QuickLinks: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const QuickLinks: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => {
try {
const data = await sdk.blocks.getQuickLinks(
{
@@ -17,7 +17,16 @@ export const QuickLinks: React.FC = async ({ id, accessToken, l
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/quick-links/src/frontend/QuickLinks.types.ts b/packages/blocks/quick-links/src/frontend/QuickLinks.types.ts
index 58a6ea0e..179a6b69 100644
--- a/packages/blocks/quick-links/src/frontend/QuickLinks.types.ts
+++ b/packages/blocks/quick-links/src/frontend/QuickLinks.types.ts
@@ -7,6 +7,7 @@ export interface QuickLinksProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type QuickLinksPureProps = QuickLinksProps & Model.QuickLinksBlock;
diff --git a/packages/blocks/quick-links/src/sdk/quick-links.ts b/packages/blocks/quick-links/src/sdk/quick-links.ts
index 6edddce9..7c820b53 100644
--- a/packages/blocks/quick-links/src/sdk/quick-links.ts
+++ b/packages/blocks/quick-links/src/sdk/quick-links.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/quick-links.client';
+import { Model, Request } from '../api-harmonization/quick-links.client';
+import { URL } from '../api-harmonization/quick-links.url';
const API_URL = URL;
diff --git a/packages/blocks/quick-links/tsconfig.frontend.json b/packages/blocks/quick-links/tsconfig.frontend.json
index c51316d3..8909ba80 100644
--- a/packages/blocks/quick-links/tsconfig.frontend.json
+++ b/packages/blocks/quick-links/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/quick-links.client.ts",
"src/api-harmonization/quick-links.model.ts",
"src/api-harmonization/quick-links.request.ts",
+ "src/api-harmonization/quick-links.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/quick-links/tsconfig.sdk.json b/packages/blocks/quick-links/tsconfig.sdk.json
index 4beacc0b..31cd0cb5 100644
--- a/packages/blocks/quick-links/tsconfig.sdk.json
+++ b/packages/blocks/quick-links/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/quick-links.url.ts",
"src/api-harmonization/quick-links.client.ts",
"src/api-harmonization/quick-links.model.ts",
"src/api-harmonization/quick-links.request.ts"
diff --git a/packages/blocks/service-details/src/api-harmonization/service-details.url.ts b/packages/blocks/service-details/src/api-harmonization/service-details.url.ts
new file mode 100644
index 00000000..f69764d1
--- /dev/null
+++ b/packages/blocks/service-details/src/api-harmonization/service-details.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/service-details';
diff --git a/packages/blocks/service-details/src/frontend/ServiceDetails.renderer.tsx b/packages/blocks/service-details/src/frontend/ServiceDetails.renderer.tsx
index 7eb159bd..b2981122 100644
--- a/packages/blocks/service-details/src/frontend/ServiceDetails.renderer.tsx
+++ b/packages/blocks/service-details/src/frontend/ServiceDetails.renderer.tsx
@@ -7,7 +7,13 @@ import { Loading } from '@o2s/ui/components/Loading';
import { ServiceDetails } from './ServiceDetails.server';
import { ServiceDetailsRendererProps } from './ServiceDetails.types';
-export const ServiceDetailsRenderer: React.FC = ({ slug, id, accessToken, routing }) => {
+export const ServiceDetailsRenderer: React.FC = ({
+ slug,
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
if (!slug[1]) {
@@ -18,15 +24,27 @@ export const ServiceDetailsRenderer: React.FC = ({
+
}
>
-
+
);
};
diff --git a/packages/blocks/service-details/src/frontend/ServiceDetails.server.tsx b/packages/blocks/service-details/src/frontend/ServiceDetails.server.tsx
index 315201d7..9302df1c 100644
--- a/packages/blocks/service-details/src/frontend/ServiceDetails.server.tsx
+++ b/packages/blocks/service-details/src/frontend/ServiceDetails.server.tsx
@@ -15,6 +15,7 @@ export const ServiceDetails: React.FC = async ({
accessToken,
locale,
routing,
+ hasPriority,
}) => {
try {
const data = await sdk.blocks.getServiceDetails(
@@ -36,6 +37,7 @@ export const ServiceDetails: React.FC = async ({
accessToken={accessToken}
locale={locale}
routing={routing}
+ hasPriority={hasPriority}
/>
);
} catch (_error) {
diff --git a/packages/blocks/service-details/src/frontend/ServiceDetails.types.ts b/packages/blocks/service-details/src/frontend/ServiceDetails.types.ts
index 4142d73e..23c0574a 100644
--- a/packages/blocks/service-details/src/frontend/ServiceDetails.types.ts
+++ b/packages/blocks/service-details/src/frontend/ServiceDetails.types.ts
@@ -8,6 +8,7 @@ export interface ServiceDetailsProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type ServiceDetailsPureProps = ServiceDetailsProps & Model.ServiceDetailsBlock;
diff --git a/packages/blocks/service-details/src/sdk/service-details.ts b/packages/blocks/service-details/src/sdk/service-details.ts
index a2429bfa..eceaa2de 100644
--- a/packages/blocks/service-details/src/sdk/service-details.ts
+++ b/packages/blocks/service-details/src/sdk/service-details.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/service-details.client';
+import { Model, Request } from '../api-harmonization/service-details.client';
+import { URL } from '../api-harmonization/service-details.url';
const API_URL = URL;
diff --git a/packages/blocks/service-details/tsconfig.frontend.json b/packages/blocks/service-details/tsconfig.frontend.json
index b8bc303b..7556a552 100644
--- a/packages/blocks/service-details/tsconfig.frontend.json
+++ b/packages/blocks/service-details/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/service-details.client.ts",
"src/api-harmonization/service-details.model.ts",
"src/api-harmonization/service-details.request.ts",
+ "src/api-harmonization/service-details.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/service-details/tsconfig.sdk.json b/packages/blocks/service-details/tsconfig.sdk.json
index de6567f5..80a4c66f 100644
--- a/packages/blocks/service-details/tsconfig.sdk.json
+++ b/packages/blocks/service-details/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/service-details.url.ts",
"src/api-harmonization/service-details.client.ts",
"src/api-harmonization/service-details.model.ts",
"src/api-harmonization/service-details.request.ts"
diff --git a/packages/blocks/service-list/src/api-harmonization/service-list.url.ts b/packages/blocks/service-list/src/api-harmonization/service-list.url.ts
new file mode 100644
index 00000000..968c6278
--- /dev/null
+++ b/packages/blocks/service-list/src/api-harmonization/service-list.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/service-list';
diff --git a/packages/blocks/service-list/src/frontend/ServiceList.renderer.tsx b/packages/blocks/service-list/src/frontend/ServiceList.renderer.tsx
index b2f6c74e..b564d47a 100644
--- a/packages/blocks/service-list/src/frontend/ServiceList.renderer.tsx
+++ b/packages/blocks/service-list/src/frontend/ServiceList.renderer.tsx
@@ -6,7 +6,7 @@ import { Loading } from '@o2s/ui/components/Loading';
import { ServiceList } from './ServiceList.server';
import { ServiceListRendererProps } from './ServiceList.types';
-export const Renderer: React.FC = ({ id, accessToken, slug, routing }) => {
+export const Renderer: React.FC = ({ id, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
@@ -14,11 +14,21 @@ export const Renderer: React.FC = ({ id, accessToken,
key={id}
fallback={
<>
-
+
+
+
+
+
>
}
>
-
+
);
};
diff --git a/packages/blocks/service-list/src/frontend/ServiceList.server.tsx b/packages/blocks/service-list/src/frontend/ServiceList.server.tsx
index e57e681e..81ad7362 100644
--- a/packages/blocks/service-list/src/frontend/ServiceList.server.tsx
+++ b/packages/blocks/service-list/src/frontend/ServiceList.server.tsx
@@ -9,7 +9,7 @@ export const ServiceListDynamic = dynamic(() =>
import('./ServiceList.client').then((module) => module.ServiceListPure),
);
-export const ServiceList: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const ServiceList: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => {
try {
const data = await sdk.blocks.getServiceList(
{
@@ -18,7 +18,16 @@ export const ServiceList: React.FC = async ({ id, accessToken,
{ 'x-locale': locale },
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/service-list/src/frontend/ServiceList.types.ts b/packages/blocks/service-list/src/frontend/ServiceList.types.ts
index abf66d1a..c793d19e 100644
--- a/packages/blocks/service-list/src/frontend/ServiceList.types.ts
+++ b/packages/blocks/service-list/src/frontend/ServiceList.types.ts
@@ -7,6 +7,7 @@ export interface ServiceListProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type ServiceListPureProps = ServiceListProps & Model.ServiceListBlock;
diff --git a/packages/blocks/service-list/src/sdk/service-list.ts b/packages/blocks/service-list/src/sdk/service-list.ts
index 415c6d51..ac6081b0 100644
--- a/packages/blocks/service-list/src/sdk/service-list.ts
+++ b/packages/blocks/service-list/src/sdk/service-list.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/service-list.client';
+import { Model, Request } from '../api-harmonization/service-list.client';
+import { URL } from '../api-harmonization/service-list.url';
const API_URL = URL;
diff --git a/packages/blocks/service-list/tsconfig.frontend.json b/packages/blocks/service-list/tsconfig.frontend.json
index 3c2e8ac8..4b1dbcef 100644
--- a/packages/blocks/service-list/tsconfig.frontend.json
+++ b/packages/blocks/service-list/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/service-list.client.ts",
"src/api-harmonization/service-list.model.ts",
"src/api-harmonization/service-list.request.ts",
+ "src/api-harmonization/service-list.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/service-list/tsconfig.sdk.json b/packages/blocks/service-list/tsconfig.sdk.json
index 7e4df858..61d1c593 100644
--- a/packages/blocks/service-list/tsconfig.sdk.json
+++ b/packages/blocks/service-list/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/service-list.url.ts",
"src/api-harmonization/service-list.client.ts",
"src/api-harmonization/service-list.model.ts",
"src/api-harmonization/service-list.request.ts"
diff --git a/packages/blocks/surveyjs-form/package.json b/packages/blocks/surveyjs-form/package.json
index 321003de..271b4e13 100644
--- a/packages/blocks/surveyjs-form/package.json
+++ b/packages/blocks/surveyjs-form/package.json
@@ -36,6 +36,8 @@
"concurrently": "^9.1.2",
"eslint": "^9.27.0",
"prettier": "^3.5.3",
+ "survey-core": "^2.0.9",
+ "survey-react-ui": "^2.0.9",
"tsc-alias": "^1.8.16",
"typescript": "^5.8.3"
},
diff --git a/packages/blocks/surveyjs-form/src/api-harmonization/surveyjs.url.ts b/packages/blocks/surveyjs-form/src/api-harmonization/surveyjs.url.ts
new file mode 100644
index 00000000..00e0c7db
--- /dev/null
+++ b/packages/blocks/surveyjs-form/src/api-harmonization/surveyjs.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/surveyjs';
diff --git a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.renderer.tsx b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.renderer.tsx
index c177709d..9001bc02 100644
--- a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.renderer.tsx
+++ b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.renderer.tsx
@@ -7,7 +7,7 @@ import { Loading } from '@o2s/ui/components/Loading';
import { SurveyJsServer } from './SurveyJs.server';
import { SurveyJsFormRendererProps } from './SurveyJs.types';
-export const SurveyJsRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const SurveyJsRenderer: React.FC = ({ id, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
@@ -22,7 +22,13 @@ export const SurveyJsRenderer: React.FC = ({ id, acce
>
}
>
-
+
);
};
diff --git a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.server.tsx b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.server.tsx
index 2279f357..0ede0b4a 100644
--- a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.server.tsx
+++ b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.server.tsx
@@ -7,7 +7,13 @@ import { SurveyJsFormProps } from './SurveyJs.types';
export const SurveyJsDynamic = dynamic(() => import('./SurveyJs.client').then((module) => module.SurveyJsPure));
-export const SurveyJsServer: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const SurveyJsServer: React.FC = async ({
+ id,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getSurveyjsBlock(
{
@@ -17,7 +23,16 @@ export const SurveyJsServer: React.FC = async ({ id, accessTo
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.types.ts b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.types.ts
index 95a5feb9..92402988 100644
--- a/packages/blocks/surveyjs-form/src/frontend/SurveyJs.types.ts
+++ b/packages/blocks/surveyjs-form/src/frontend/SurveyJs.types.ts
@@ -7,6 +7,7 @@ export interface SurveyJsFormProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type SurveyJsFormPureProps = SurveyJsFormProps & Model.SurveyjsBlock;
diff --git a/packages/blocks/surveyjs-form/src/sdk/surveyjs.ts b/packages/blocks/surveyjs-form/src/sdk/surveyjs.ts
index 3d41054f..db52855f 100644
--- a/packages/blocks/surveyjs-form/src/sdk/surveyjs.ts
+++ b/packages/blocks/surveyjs-form/src/sdk/surveyjs.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/surveyjs.client';
+import { Model, Request } from '../api-harmonization/surveyjs.client';
+import { URL } from '../api-harmonization/surveyjs.url';
const API_URL = URL;
diff --git a/packages/blocks/surveyjs-form/tsconfig.frontend.json b/packages/blocks/surveyjs-form/tsconfig.frontend.json
index ee55fc17..6431555d 100644
--- a/packages/blocks/surveyjs-form/tsconfig.frontend.json
+++ b/packages/blocks/surveyjs-form/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/surveyjs.client.ts",
"src/api-harmonization/surveyjs.model.ts",
"src/api-harmonization/surveyjs.request.ts",
+ "src/api-harmonization/surveyjs.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/surveyjs-form/tsconfig.sdk.json b/packages/blocks/surveyjs-form/tsconfig.sdk.json
index 700281f5..190513a3 100644
--- a/packages/blocks/surveyjs-form/tsconfig.sdk.json
+++ b/packages/blocks/surveyjs-form/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/surveyjs.url.ts",
"src/api-harmonization/surveyjs.client.ts",
"src/api-harmonization/surveyjs.model.ts",
"src/api-harmonization/surveyjs.request.ts"
diff --git a/packages/blocks/ticket-details/src/api-harmonization/ticket-details.url.ts b/packages/blocks/ticket-details/src/api-harmonization/ticket-details.url.ts
new file mode 100644
index 00000000..21c5bf6c
--- /dev/null
+++ b/packages/blocks/ticket-details/src/api-harmonization/ticket-details.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/ticket-details';
diff --git a/packages/blocks/ticket-details/src/frontend/TicketDetails.renderer.tsx b/packages/blocks/ticket-details/src/frontend/TicketDetails.renderer.tsx
index 3965bbf6..a1a5365f 100644
--- a/packages/blocks/ticket-details/src/frontend/TicketDetails.renderer.tsx
+++ b/packages/blocks/ticket-details/src/frontend/TicketDetails.renderer.tsx
@@ -7,7 +7,13 @@ import { Loading } from '@o2s/ui/components/Loading';
import { TicketDetails } from './TicketDetails.server';
import { TicketDetailsRendererProps } from './TicketDetails.types';
-export const TicketDetailsRenderer: React.FC = ({ slug, id, accessToken, routing }) => {
+export const TicketDetailsRenderer: React.FC = ({
+ slug,
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
if (!slug[1]) {
@@ -18,15 +24,22 @@ export const TicketDetailsRenderer: React.FC = ({ sl
+
- >
+
}
>
-
+
);
};
diff --git a/packages/blocks/ticket-details/src/frontend/TicketDetails.server.tsx b/packages/blocks/ticket-details/src/frontend/TicketDetails.server.tsx
index d93f5a5a..13f4c1bd 100644
--- a/packages/blocks/ticket-details/src/frontend/TicketDetails.server.tsx
+++ b/packages/blocks/ticket-details/src/frontend/TicketDetails.server.tsx
@@ -9,7 +9,14 @@ export const TicketDetailsDynamic = dynamic(() =>
import('./TicketDetails.client').then((module) => module.TicketDetailsPure),
);
-export const TicketDetails: React.FC = async ({ id, ticketId, accessToken, locale, routing }) => {
+export const TicketDetails: React.FC = async ({
+ id,
+ ticketId,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getTicketDetails(
{
@@ -30,6 +37,7 @@ export const TicketDetails: React.FC = async ({ id, ticketId
accessToken={accessToken}
locale={locale}
routing={routing}
+ hasPriority={hasPriority}
/>
);
} catch (_error) {
diff --git a/packages/blocks/ticket-details/src/frontend/TicketDetails.types.ts b/packages/blocks/ticket-details/src/frontend/TicketDetails.types.ts
index 51f00e09..0dbe0f61 100644
--- a/packages/blocks/ticket-details/src/frontend/TicketDetails.types.ts
+++ b/packages/blocks/ticket-details/src/frontend/TicketDetails.types.ts
@@ -8,6 +8,7 @@ export interface TicketDetailsProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type TicketDetailsPureProps = TicketDetailsProps & Model.TicketDetailsBlock;
diff --git a/packages/blocks/ticket-details/src/sdk/ticket-details.ts b/packages/blocks/ticket-details/src/sdk/ticket-details.ts
index e485e51a..06fe1fc7 100644
--- a/packages/blocks/ticket-details/src/sdk/ticket-details.ts
+++ b/packages/blocks/ticket-details/src/sdk/ticket-details.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/ticket-details.client';
+import { Model, Request } from '../api-harmonization/ticket-details.client';
+import { URL } from '../api-harmonization/ticket-details.url';
const API_URL = URL;
diff --git a/packages/blocks/ticket-details/tsconfig.frontend.json b/packages/blocks/ticket-details/tsconfig.frontend.json
index b87c0a20..09cfba51 100644
--- a/packages/blocks/ticket-details/tsconfig.frontend.json
+++ b/packages/blocks/ticket-details/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/ticket-details.client.ts",
"src/api-harmonization/ticket-details.model.ts",
"src/api-harmonization/ticket-details.request.ts",
+ "src/api-harmonization/ticket-details.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/ticket-details/tsconfig.sdk.json b/packages/blocks/ticket-details/tsconfig.sdk.json
index 04863c5e..0c4f5318 100644
--- a/packages/blocks/ticket-details/tsconfig.sdk.json
+++ b/packages/blocks/ticket-details/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/ticket-details.url.ts",
"src/api-harmonization/ticket-details.client.ts",
"src/api-harmonization/ticket-details.model.ts",
"src/api-harmonization/ticket-details.request.ts"
diff --git a/packages/blocks/ticket-list/src/api-harmonization/ticket-list.url.ts b/packages/blocks/ticket-list/src/api-harmonization/ticket-list.url.ts
new file mode 100644
index 00000000..78af8a3a
--- /dev/null
+++ b/packages/blocks/ticket-list/src/api-harmonization/ticket-list.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/ticket-list';
diff --git a/packages/blocks/ticket-list/src/frontend/TicketList.renderer.tsx b/packages/blocks/ticket-list/src/frontend/TicketList.renderer.tsx
index 4b4f38a0..cd3dd19c 100644
--- a/packages/blocks/ticket-list/src/frontend/TicketList.renderer.tsx
+++ b/packages/blocks/ticket-list/src/frontend/TicketList.renderer.tsx
@@ -6,12 +6,26 @@ import { Loading } from '@o2s/ui/components/Loading';
import { TicketListServer } from './TicketList.server';
import { TicketListRendererProps } from './TicketList.types';
-export const TicketListRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const TicketListRenderer: React.FC = ({ id, accessToken, routing, hasPriority }) => {
const locale = useLocale();
return (
- }>
-
+
+
+
+
+ }
+ >
+
);
};
diff --git a/packages/blocks/ticket-list/src/frontend/TicketList.server.tsx b/packages/blocks/ticket-list/src/frontend/TicketList.server.tsx
index 75db6b8c..0c8287a9 100644
--- a/packages/blocks/ticket-list/src/frontend/TicketList.server.tsx
+++ b/packages/blocks/ticket-list/src/frontend/TicketList.server.tsx
@@ -7,7 +7,13 @@ import { TicketListProps } from './TicketList.types';
export const TicketListDynamic = dynamic(() => import('./TicketList.client').then((module) => module.TicketListPure));
-export const TicketListServer: React.FC
= async ({ id, accessToken, locale, routing }) => {
+export const TicketListServer: React.FC = async ({
+ id,
+ accessToken,
+ locale,
+ routing,
+ hasPriority,
+}) => {
try {
const data = await sdk.blocks.getTicketList(
{
@@ -17,7 +23,16 @@ export const TicketListServer: React.FC = async ({ id, accessTo
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/ticket-list/src/frontend/TicketList.types.ts b/packages/blocks/ticket-list/src/frontend/TicketList.types.ts
index ad11a887..18385b50 100644
--- a/packages/blocks/ticket-list/src/frontend/TicketList.types.ts
+++ b/packages/blocks/ticket-list/src/frontend/TicketList.types.ts
@@ -7,6 +7,7 @@ export interface TicketListProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type TicketListPureProps = TicketListProps & Model.TicketListBlock;
diff --git a/packages/blocks/ticket-list/src/sdk/ticket-list.ts b/packages/blocks/ticket-list/src/sdk/ticket-list.ts
index b4c2740e..1da1b6e1 100644
--- a/packages/blocks/ticket-list/src/sdk/ticket-list.ts
+++ b/packages/blocks/ticket-list/src/sdk/ticket-list.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/ticket-list.client';
+import { Model, Request } from '../api-harmonization/ticket-list.client';
+import { URL } from '../api-harmonization/ticket-list.url';
const API_URL = URL;
diff --git a/packages/blocks/ticket-list/tsconfig.frontend.json b/packages/blocks/ticket-list/tsconfig.frontend.json
index 8af15a09..cb2e417b 100644
--- a/packages/blocks/ticket-list/tsconfig.frontend.json
+++ b/packages/blocks/ticket-list/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/ticket-list.client.ts",
"src/api-harmonization/ticket-list.model.ts",
"src/api-harmonization/ticket-list.request.ts",
+ "src/api-harmonization/ticket-list.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/ticket-list/tsconfig.sdk.json b/packages/blocks/ticket-list/tsconfig.sdk.json
index 51e0a3b2..47860291 100644
--- a/packages/blocks/ticket-list/tsconfig.sdk.json
+++ b/packages/blocks/ticket-list/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/ticket-list.url.ts",
"src/api-harmonization/ticket-list.client.ts",
"src/api-harmonization/ticket-list.model.ts",
"src/api-harmonization/ticket-list.request.ts"
diff --git a/packages/blocks/ticket-recent/src/api-harmonization/ticket-recent.url.ts b/packages/blocks/ticket-recent/src/api-harmonization/ticket-recent.url.ts
new file mode 100644
index 00000000..8cd528a0
--- /dev/null
+++ b/packages/blocks/ticket-recent/src/api-harmonization/ticket-recent.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/ticket-recent';
diff --git a/packages/blocks/ticket-recent/src/frontend/TicketRecent.renderer.tsx b/packages/blocks/ticket-recent/src/frontend/TicketRecent.renderer.tsx
index da9d2b54..64ba4cea 100644
--- a/packages/blocks/ticket-recent/src/frontend/TicketRecent.renderer.tsx
+++ b/packages/blocks/ticket-recent/src/frontend/TicketRecent.renderer.tsx
@@ -7,22 +7,31 @@ import { Loading } from '@o2s/ui/components/Loading';
import { TicketRecent } from './TicketRecent.server';
import { TicketRecentRendererProps } from './TicketRecent.types';
-export const TicketRecentRenderer: React.FC = ({ id, accessToken, routing }) => {
+export const TicketRecentRenderer: React.FC = ({
+ id,
+ accessToken,
+ routing,
+ hasPriority,
+}) => {
const locale = useLocale();
return (
+
-
-
-
- >
+
+
}
>
-
+
);
};
diff --git a/packages/blocks/ticket-recent/src/frontend/TicketRecent.server.tsx b/packages/blocks/ticket-recent/src/frontend/TicketRecent.server.tsx
index d74d14c8..0dd1ed75 100644
--- a/packages/blocks/ticket-recent/src/frontend/TicketRecent.server.tsx
+++ b/packages/blocks/ticket-recent/src/frontend/TicketRecent.server.tsx
@@ -9,7 +9,7 @@ export const TicketRecentDynamic = dynamic(() =>
import('./TicketRecent.client').then((module) => module.TicketRecentPure),
);
-export const TicketRecent: React.FC = async ({ id, accessToken, locale, routing }) => {
+export const TicketRecent: React.FC = async ({ id, accessToken, locale, routing, hasPriority }) => {
try {
const data = await sdk.blocks.getTicketRecent(
{
@@ -19,7 +19,16 @@ export const TicketRecent: React.FC = async ({ id, accessToke
accessToken,
);
- return ;
+ return (
+
+ );
} catch (_error) {
return null;
}
diff --git a/packages/blocks/ticket-recent/src/frontend/TicketRecent.types.ts b/packages/blocks/ticket-recent/src/frontend/TicketRecent.types.ts
index 9d7905b5..0728e220 100644
--- a/packages/blocks/ticket-recent/src/frontend/TicketRecent.types.ts
+++ b/packages/blocks/ticket-recent/src/frontend/TicketRecent.types.ts
@@ -7,6 +7,7 @@ export interface TicketRecentProps {
accessToken?: string;
locale: string;
routing: ReturnType;
+ hasPriority?: boolean;
}
export type TicketRecentPureProps = TicketRecentProps & Model.TicketRecentBlock;
diff --git a/packages/blocks/ticket-recent/src/sdk/ticket-recent.ts b/packages/blocks/ticket-recent/src/sdk/ticket-recent.ts
index 66e6a52c..b2ebae6c 100644
--- a/packages/blocks/ticket-recent/src/sdk/ticket-recent.ts
+++ b/packages/blocks/ticket-recent/src/sdk/ticket-recent.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/ticket-recent.client';
+import { Model, Request } from '../api-harmonization/ticket-recent.client';
+import { URL } from '../api-harmonization/ticket-recent.url';
const API_URL = URL;
diff --git a/packages/blocks/ticket-recent/tsconfig.frontend.json b/packages/blocks/ticket-recent/tsconfig.frontend.json
index 2eeebded..ccf9f81a 100644
--- a/packages/blocks/ticket-recent/tsconfig.frontend.json
+++ b/packages/blocks/ticket-recent/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/ticket-recent.client.ts",
"src/api-harmonization/ticket-recent.model.ts",
"src/api-harmonization/ticket-recent.request.ts",
+ "src/api-harmonization/ticket-recent.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/ticket-recent/tsconfig.sdk.json b/packages/blocks/ticket-recent/tsconfig.sdk.json
index 4e261667..e5bfffb7 100644
--- a/packages/blocks/ticket-recent/tsconfig.sdk.json
+++ b/packages/blocks/ticket-recent/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/ticket-recent.url.ts",
"src/api-harmonization/ticket-recent.client.ts",
"src/api-harmonization/ticket-recent.model.ts",
"src/api-harmonization/ticket-recent.request.ts"
diff --git a/packages/blocks/user-account/src/api-harmonization/user-account.url.ts b/packages/blocks/user-account/src/api-harmonization/user-account.url.ts
new file mode 100644
index 00000000..0a7ba167
--- /dev/null
+++ b/packages/blocks/user-account/src/api-harmonization/user-account.url.ts
@@ -0,0 +1 @@
+export const URL = '/blocks/user-account';
diff --git a/packages/blocks/user-account/src/frontend/UserAccount.renderer.tsx b/packages/blocks/user-account/src/frontend/UserAccount.renderer.tsx
index 8c2f822f..c62ea81e 100644
--- a/packages/blocks/user-account/src/frontend/UserAccount.renderer.tsx
+++ b/packages/blocks/user-account/src/frontend/UserAccount.renderer.tsx
@@ -13,6 +13,7 @@ export const UserAccountRenderer: React.FC = ({
routing,
userId,
onSignOut,
+ hasPriority,
}) => {
const locale = useLocale();
@@ -36,6 +37,7 @@ export const UserAccountRenderer: React.FC = ({
routing={routing}
userId={userId}
onSignOut={onSignOut}
+ hasPriority={hasPriority}
/>
);
diff --git a/packages/blocks/user-account/src/frontend/UserAccount.server.tsx b/packages/blocks/user-account/src/frontend/UserAccount.server.tsx
index 23481cbb..6ac0e31e 100644
--- a/packages/blocks/user-account/src/frontend/UserAccount.server.tsx
+++ b/packages/blocks/user-account/src/frontend/UserAccount.server.tsx
@@ -16,6 +16,7 @@ export const UserAccount: React.FC = async ({
routing,
userId,
onSignOut,
+ hasPriority,
}) => {
if (!userId) {
return null;
@@ -40,6 +41,7 @@ export const UserAccount: React.FC = async ({
routing={routing}
userId={userId}
onSignOut={onSignOut}
+ hasPriority={hasPriority}
/>
);
} catch (_error) {
diff --git a/packages/blocks/user-account/src/frontend/UserAccount.types.ts b/packages/blocks/user-account/src/frontend/UserAccount.types.ts
index fde6a2d5..1f4a01ca 100644
--- a/packages/blocks/user-account/src/frontend/UserAccount.types.ts
+++ b/packages/blocks/user-account/src/frontend/UserAccount.types.ts
@@ -9,6 +9,7 @@ export interface UserAccountProps {
routing: ReturnType;
userId?: string;
onSignOut: () => void;
+ hasPriority?: boolean;
}
export type UserAccountPureProps = UserAccountProps & Model.UserAccountBlock;
diff --git a/packages/blocks/user-account/src/sdk/user-account.ts b/packages/blocks/user-account/src/sdk/user-account.ts
index 29b8c70d..7c977223 100644
--- a/packages/blocks/user-account/src/sdk/user-account.ts
+++ b/packages/blocks/user-account/src/sdk/user-account.ts
@@ -3,7 +3,8 @@ import { Utils } from '@o2s/utils.frontend';
import { Sdk } from '@o2s/framework/sdk';
-import { Model, Request, URL } from '../api-harmonization/user-account.client';
+import { Model, Request } from '../api-harmonization/user-account.client';
+import { URL } from '../api-harmonization/user-account.url';
const API_URL = URL;
diff --git a/packages/blocks/user-account/tsconfig.frontend.json b/packages/blocks/user-account/tsconfig.frontend.json
index d8da3e38..68979e4e 100644
--- a/packages/blocks/user-account/tsconfig.frontend.json
+++ b/packages/blocks/user-account/tsconfig.frontend.json
@@ -16,6 +16,7 @@
"src/api-harmonization/user-account.client.ts",
"src/api-harmonization/user-account.model.ts",
"src/api-harmonization/user-account.request.ts",
+ "src/api-harmonization/user-account.url.ts",
"src/sdk"
]
}
diff --git a/packages/blocks/user-account/tsconfig.sdk.json b/packages/blocks/user-account/tsconfig.sdk.json
index c9f29e4e..e16b0b17 100644
--- a/packages/blocks/user-account/tsconfig.sdk.json
+++ b/packages/blocks/user-account/tsconfig.sdk.json
@@ -12,6 +12,7 @@
},
"include": [
"src/sdk",
+ "src/api-harmonization/user-account.url.ts",
"src/api-harmonization/user-account.client.ts",
"src/api-harmonization/user-account.model.ts",
"src/api-harmonization/user-account.request.ts"
diff --git a/packages/integrations/mocked/package.json b/packages/integrations/mocked/package.json
index a50950b3..b1c384e5 100644
--- a/packages/integrations/mocked/package.json
+++ b/packages/integrations/mocked/package.json
@@ -6,7 +6,8 @@
"exports": {
"./integration": "./dist/integration.js",
"./sdk": "./dist/sdk/index.js",
- "./auth": "./dist/auth/index.js"
+ "./auth": "./dist/auth/index.js",
+ "./auth.updateOrganization": "./dist/auth/auth.updateOrganization.js"
},
"files": [
"dist",
diff --git a/packages/modules/surveyjs/package.json b/packages/modules/surveyjs/package.json
index 53c8582c..6892ee7f 100644
--- a/packages/modules/surveyjs/package.json
+++ b/packages/modules/surveyjs/package.json
@@ -35,6 +35,8 @@
"concurrently": "^9.1.2",
"eslint": "^9.27.0",
"prettier": "^3.5.3",
+ "survey-core": "^2.0.9",
+ "survey-react-ui": "^2.0.9",
"tsc-alias": "^1.8.16",
"typescript": "^5.8.3"
},
diff --git a/packages/modules/surveyjs/src/frontend/Survey.tsx b/packages/modules/surveyjs/src/frontend/Survey.tsx
index 3c1e1544..fff10d32 100644
--- a/packages/modules/surveyjs/src/frontend/Survey.tsx
+++ b/packages/modules/surveyjs/src/frontend/Survey.tsx
@@ -1,8 +1,7 @@
'use client';
+import dynamic from 'next/dynamic';
import React, { startTransition, useActionState, useEffect } from 'react';
-import { Model as SurveyJsModel } from 'survey-core';
-import { Survey as SurveySDK } from 'survey-react-ui';
import { cn } from '@o2s/ui/lib/utils';
@@ -15,28 +14,22 @@ import { LoadingOverlay } from '@o2s/ui/elements/loading-overlay';
import { Model } from '../api-harmonization/surveyjs.client';
import { sdk } from '../sdk';
-import './Elements/CustomSurveyNavigationButton';
-import './Elements/CustomSurveyPanel';
-import './Elements/CustomSurveyQuestion';
-import './Questions/CustomSurveyQuestionBoolean';
-import './Questions/CustomSurveyQuestionCheckbox';
-import './Questions/CustomSurveyQuestionComment';
-import './Questions/CustomSurveyQuestionDropdown';
-import './Questions/CustomSurveyQuestionRadioGroup';
-import './Questions/CustomSurveyQuestionText';
import { Labels, SurveyAction, SurveyProps, SurveyState } from './Survey.types';
+const SurveySDK = dynamic(() => import('./lib').then((module) => module.SurveySDK));
+
const initialState: SurveyState = {
isLoading: true,
error: null,
model: null,
};
-const createSurveyModel = (
+const createSurveyModel = async (
schema: Model.SurveyJSLibraryJsonSchema,
locale: string,
onComplete: (data: Model.SurveyResult) => void,
-): SurveyJsModel => {
+) => {
+ const SurveyJsModel = await import('./lib').then((module) => module.SurveyJsModel);
const survey = new SurveyJsModel(schema);
survey.loadingHtml = '';
@@ -148,7 +141,7 @@ export const Survey: React.FC = ({ code, labels, locale, accessToke
throw new Error(`No survey with code '${code}' found`);
}
- const model = createSurveyModel(schema, locale, handleSubmit);
+ const model = await createSurveyModel(schema, locale, handleSubmit);
dispatch({ type: 'SET_MODEL', payload: model });
} catch (error) {
diff --git a/packages/modules/surveyjs/src/frontend/Survey.types.ts b/packages/modules/surveyjs/src/frontend/Survey.types.ts
index eb71b81f..6baeda4c 100644
--- a/packages/modules/surveyjs/src/frontend/Survey.types.ts
+++ b/packages/modules/surveyjs/src/frontend/Survey.types.ts
@@ -1,4 +1,4 @@
-import { Model } from 'survey-core';
+import type { Model } from 'survey-core';
export interface SurveyProps {
code: string;
diff --git a/packages/modules/surveyjs/src/frontend/lib.ts b/packages/modules/surveyjs/src/frontend/lib.ts
new file mode 100644
index 00000000..d737447d
--- /dev/null
+++ b/packages/modules/surveyjs/src/frontend/lib.ts
@@ -0,0 +1,12 @@
+import './Elements/CustomSurveyNavigationButton';
+import './Elements/CustomSurveyPanel';
+import './Elements/CustomSurveyQuestion';
+import './Questions/CustomSurveyQuestionBoolean';
+import './Questions/CustomSurveyQuestionCheckbox';
+import './Questions/CustomSurveyQuestionComment';
+import './Questions/CustomSurveyQuestionDropdown';
+import './Questions/CustomSurveyQuestionRadioGroup';
+import './Questions/CustomSurveyQuestionText';
+
+export { Model as SurveyJsModel } from 'survey-core';
+export { Survey as SurveySDK } from 'survey-react-ui';
diff --git a/packages/ui/src/components/Cards/BlogCard/BlogCard.tsx b/packages/ui/src/components/Cards/BlogCard/BlogCard.tsx
index 82c5eb7b..8900cd9c 100644
--- a/packages/ui/src/components/Cards/BlogCard/BlogCard.tsx
+++ b/packages/ui/src/components/Cards/BlogCard/BlogCard.tsx
@@ -3,7 +3,6 @@ import React from 'react';
import { Author } from '@o2s/ui/components/Author';
import { Image } from '@o2s/ui/components/Image';
-import { Link } from '@o2s/ui/elements/link';
import { Typography } from '@o2s/ui/elements/typography';
import { BlogCardProps } from './BlogCard.types';
@@ -17,50 +16,51 @@ export const BlogCard: React.FC> = ({
author,
categoryTitle,
LinkComponent,
+ priority,
}) => {
return (
-
-
-
- {image && (
-
- {image?.url && (
-
- )}
-
- )}
-
-
- {date}
- {categoryTitle && (
- <>
- ·
- {categoryTitle}
- >
- )}
-
-
- {title}
-
-
- {lead}
-
+
+ {image && (
+
+ {image?.url && (
+
+ )}
- {author &&
}
+ )}
+
+
+ {date}
+ {categoryTitle && (
+ <>
+ ·
+ {categoryTitle}
+ >
+ )}
+
+
+ {title}
+
+
+ {lead}
+
-
-
+ {author &&
}
+
+
);
};
diff --git a/packages/ui/src/components/Cards/BlogCard/BlogCard.types.ts b/packages/ui/src/components/Cards/BlogCard/BlogCard.types.ts
index 4d1f07f5..64b40af1 100644
--- a/packages/ui/src/components/Cards/BlogCard/BlogCard.types.ts
+++ b/packages/ui/src/components/Cards/BlogCard/BlogCard.types.ts
@@ -17,4 +17,5 @@ export interface BlogCardProps {
author?: AuthorProps;
categoryTitle?: string;
LinkComponent: FrontendModels.Link.LinkComponent;
+ priority?: boolean;
}
diff --git a/packages/ui/src/components/Cards/FeatureCard/FeatureCard.tsx b/packages/ui/src/components/Cards/FeatureCard/FeatureCard.tsx
index 455d58cc..889c2577 100644
--- a/packages/ui/src/components/Cards/FeatureCard/FeatureCard.tsx
+++ b/packages/ui/src/components/Cards/FeatureCard/FeatureCard.tsx
@@ -10,7 +10,7 @@ import { RichText } from '@o2s/ui/components/RichText';
import { Link } from '@o2s/ui/elements/link';
import { Typography } from '@o2s/ui/elements/typography';
-import { FeatureCardProps } from '././FeatureCard.types';
+import { FeatureCardProps } from './FeatureCard.types';
export const FeatureCardContent: React.FC
= ({ title, description, image, link, LinkComponent }) => {
return (
diff --git a/packages/ui/src/components/Cards/InformativeCard/InformativeCard.tsx b/packages/ui/src/components/Cards/InformativeCard/InformativeCard.tsx
index a6b9ba0d..bd87b440 100644
--- a/packages/ui/src/components/Cards/InformativeCard/InformativeCard.tsx
+++ b/packages/ui/src/components/Cards/InformativeCard/InformativeCard.tsx
@@ -5,7 +5,6 @@ import { cn } from '@o2s/ui/lib/utils';
import { DynamicIcon } from '@o2s/ui/components/DynamicIcon';
-import { Link } from '@o2s/ui/elements/link';
import { Typography } from '@o2s/ui/elements/typography';
import { RichText } from '../../RichText';
@@ -61,14 +60,13 @@ export const InformativeCard: React.FC> = (props)
if (props.href) {
return (
-
-
-
-
-
+
+
);
}
return ;
diff --git a/packages/ui/src/components/DynamicIcon/DynamicIcon.tsx b/packages/ui/src/components/DynamicIcon/DynamicIcon.tsx
index 00323610..6103f41a 100644
--- a/packages/ui/src/components/DynamicIcon/DynamicIcon.tsx
+++ b/packages/ui/src/components/DynamicIcon/DynamicIcon.tsx
@@ -1,8 +1,10 @@
-import * as Icons from 'lucide-react';
+import { IconName, DynamicIcon as LucideDynamicIcon, dynamicIconImports } from 'lucide-react/dynamic';
import React from 'react';
import { DynamicIconProps } from './DynamicIcon.types';
+const toKebabCase = (str: string) => str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
+
export const DynamicIcon: React.FC = ({
name,
size = 24,
@@ -10,25 +12,27 @@ export const DynamicIcon: React.FC = ({
className,
strokeWidth = 2,
}) => {
- const Icon = Icons[name as keyof typeof Icons] as React.ComponentType<{
- width?: number;
- height?: number;
- color?: string;
- className?: string;
- style?: React.CSSProperties;
- }>;
+ const iconName = toKebabCase(name) as IconName;
- if (!Icon) {
+ if (!(iconName in dynamicIconImports)) {
return null;
}
return (
-
+
+
+
);
};
diff --git a/packages/ui/src/components/Image/Image.tsx b/packages/ui/src/components/Image/Image.tsx
index d36751b6..c80e43bb 100644
--- a/packages/ui/src/components/Image/Image.tsx
+++ b/packages/ui/src/components/Image/Image.tsx
@@ -5,14 +5,25 @@ import React from 'react';
import { ImageProps } from './Image.types';
-const imageLoader: ImageLoader = ({ src, width, quality }) => {
+// custom loader example
+const _imageLoader: ImageLoader = ({ src, width, quality }) => {
return `${src}?w=${width}&q=${quality || 99}&fm=webp`;
};
-export const Image: React.FC = ({ src, alt, width, height, fill, ...rest }) => {
+export const Image: React.FC = ({ src, alt, width, height, quality = 90, fill, priority, ...rest }) => {
if ((width && height) || fill) {
return (
-
+
);
}
diff --git a/packages/ui/src/components/Loading/Loading.tsx b/packages/ui/src/components/Loading/Loading.tsx
index f78fd81d..09d322de 100644
--- a/packages/ui/src/components/Loading/Loading.tsx
+++ b/packages/ui/src/components/Loading/Loading.tsx
@@ -10,49 +10,53 @@ export const Loading: React.FC = ({ bars = 2, variant = 'component
return (
-
- {typeof bars === 'number' ? (
- Array.from(Array(bars).keys()).map((i) =>
)
- ) : (
- <>
-
- {Array.from(Array(bars[0]).keys()).map((i) => (
-
- ))}
-
-
- {Array.from(Array(bars[1]).keys()).map((i) => (
-
- ))}
-
- >
- )}
-
+ {bars !== 0 && (
+
+ {typeof bars === 'number' ? (
+ Array.from(Array(bars).keys()).map((i) =>
)
+ ) : (
+ <>
+
+ {Array.from(Array(bars[0]).keys()).map((i) => (
+
+ ))}
+
+
+ {Array.from(Array(bars[1]).keys()).map((i) => (
+
+ ))}
+
+ >
+ )}
+
+ )}
);
case 'component':
return (
-
- {typeof bars === 'number' ? (
- Array.from(Array(bars).keys()).map((i) =>
)
- ) : (
- <>
-
- {Array.from(Array(bars[0]).keys()).map((i) => (
-
- ))}
-
-
- {Array.from(Array(bars[1]).keys()).map((i) => (
-
- ))}
-
- >
- )}
-
-
+ {bars !== 0 && (
+
+ {typeof bars === 'number' ? (
+ Array.from(Array(bars).keys()).map((i) =>
)
+ ) : (
+ <>
+
+ {Array.from(Array(bars[0]).keys()).map((i) => (
+
+ ))}
+
+
+ {Array.from(Array(bars[1]).keys()).map((i) => (
+
+ ))}
+
+ >
+ )}
+
+
+ )}
);
}
diff --git a/packages/ui/src/elements/avatar.tsx b/packages/ui/src/elements/avatar.tsx
index b075dd22..7ce8881b 100644
--- a/packages/ui/src/elements/avatar.tsx
+++ b/packages/ui/src/elements/avatar.tsx
@@ -40,8 +40,8 @@ Avatar.displayName = AvatarPrimitive.Root.displayName;
const AvatarImage = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
+>(({ className, alt = '', ...props }, ref) => (
+
));
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
diff --git a/packages/ui/src/elements/typography.tsx b/packages/ui/src/elements/typography.tsx
index db947728..ecc3f0f4 100644
--- a/packages/ui/src/elements/typography.tsx
+++ b/packages/ui/src/elements/typography.tsx
@@ -7,14 +7,14 @@ import { cn } from '@o2s/ui/lib/utils';
const typographyVariants = cva('', {
variants: {
variant: {
- h1: 'scroll-m-20 text-2xl md:text-3xl font-bold tracking-tight',
- h2: 'scroll-m-20 text-lg md:text-2xl font-semibold tracking-tight',
- h3: 'scroll-m-20 text-base md:text-xl font-semibold tracking-tight',
- h4: 'scroll-m-20 text-base md:text-lg font-semibold tracking-tight',
- highlightedBig: 'text-3xl/12 md:text-4xl/[54px] font-semibold tracking-tight',
- highlightedMedium: 'text-2xl/12 md:text-4xl/[48px] font-bold tracking-tight',
- highlightedSmall: 'text-base md:text-xl/8 font-semibold tracking-tight',
- subtitle: 'scroll-m-20 text-sm md:text-base font-semibold tracking-tight',
+ h1: 'scroll-m-20 text-2xl md:text-3xl font-bold',
+ h2: 'scroll-m-20 text-lg md:text-2xl font-semibold',
+ h3: 'scroll-m-20 text-base md:text-xl font-semibold',
+ h4: 'scroll-m-20 text-base md:text-lg font-semibold',
+ highlightedBig: 'text-3xl/12 md:text-4xl/[54px] font-semibold',
+ highlightedMedium: 'text-2xl/12 md:text-4xl/[48px] font-bold',
+ highlightedSmall: 'text-base md:text-xl/8 font-semibold',
+ subtitle: 'scroll-m-20 text-sm md:text-base font-semibold',
small: 'text-sm',
body: 'text-sm md:text-base',
large: 'text-lg',
diff --git a/packages/ui/src/globals.css b/packages/ui/src/globals.css
index 79824c8a..1a9a3c7b 100644
--- a/packages/ui/src/globals.css
+++ b/packages/ui/src/globals.css
@@ -12,7 +12,7 @@
@theme inline {
--font-*: initial;
- --font-sans: Inter, sans-serif;
+ --font-sans: var(--font-body), sans-serif;
--color-border: var(--border);
--color-input: var(--input);
@@ -182,6 +182,7 @@
* {
@apply border-border;
}
+
body {
@apply font-sans antialiased bg-background text-foreground;
}
@@ -191,6 +192,7 @@
* {
@apply border-border outline-ring/50;
}
+
body {
@apply bg-background text-foreground;
}