create-nextblock 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ import {
30
30
  import {
31
31
  createCortexAiStoredModelSelection,
32
32
  type CortexAiStoredModelSelection,
33
- } from '@nextblock/cortex/client';
33
+ } from '@nextblock-cms/cortex/client';
34
34
 
35
35
  const CORTEX_AI_SANDBOX_KEY_LOCAL_STORAGE = 'cortex_ai_sandbox_openrouter_api_key';
36
36
  const CORTEX_AI_SANDBOX_MODEL_LOCAL_STORAGE = 'cortex_ai_sandbox_openrouter_model_selection';
@@ -27,7 +27,7 @@ import {
27
27
  Trash2,
28
28
  } from 'lucide-react';
29
29
 
30
- import type { CortexAiStoredModelSelection } from '@nextblock/cortex/client';
30
+ import type { CortexAiStoredModelSelection } from '@nextblock-cms/cortex/client';
31
31
  import {
32
32
  clearCortexAiModelSelectionAction,
33
33
  clearOpenRouterApiKeyAction,
@@ -17,7 +17,7 @@ import {
17
17
  listCortexAiCompatibleOpenRouterModels,
18
18
  safeParseCortexAiModelSelection,
19
19
  type CortexAiStoredModelSelection,
20
- } from '@nextblock/cortex';
20
+ } from '@nextblock-cms/cortex';
21
21
 
22
22
  const CORTEX_AI_SETTINGS_PATH = '/cms/settings/cortex-ai';
23
23
 
@@ -1,80 +1,80 @@
1
- import { listCortexAiCompatibleOpenRouterModels } from '@nextblock/cortex';
2
- import { getCortexAiSettingsStatus } from './actions';
3
- import { SandboxCortexAiSettingsClient } from './SandboxCortexAiSettingsClient';
4
- import { StoredCortexAiSettingsClient } from './StoredCortexAiSettingsClient';
5
- import { redirect } from 'next/navigation';
6
-
7
- type CortexAiSettingsPageProps = {
8
- searchParams?: Promise<{
9
- error?: string;
10
- success?: string;
11
- }>;
12
- };
13
-
14
- function formatDate(value: string | null) {
15
- if (!value) {
16
- return null;
17
- }
18
-
19
- return new Intl.DateTimeFormat('en', {
20
- dateStyle: 'medium',
21
- timeStyle: 'short',
22
- }).format(new Date(value));
23
- }
24
-
25
- export default async function CortexAiSettingsPage({
26
- searchParams,
27
- }: CortexAiSettingsPageProps) {
28
- const status = await getCortexAiSettingsStatus();
29
-
30
- if (!status.isPackageActive) {
31
- redirect('/cms/dashboard');
32
- }
33
-
34
- const params: { error?: string; success?: string } = searchParams
35
- ? await searchParams
36
- : {};
37
- const storedKeyUpdatedAt = formatDate(status.storedOpenRouterKeyUpdatedAt);
38
- const selectedModelUpdatedAt = formatDate(status.selectedModel?.updatedAt || null);
39
- let compatibleModels: Awaited<ReturnType<typeof listCortexAiCompatibleOpenRouterModels>> = [];
40
- let modelCatalogError: string | null = null;
41
-
42
- if (status.hasStoredOpenRouterKey || process.env.NEXT_PUBLIC_IS_SANDBOX === 'true') {
43
- try {
44
- compatibleModels = await listCortexAiCompatibleOpenRouterModels();
45
- } catch (error) {
46
- modelCatalogError =
47
- error instanceof Error ? error.message : 'Failed to load compatible OpenRouter models.';
48
- }
49
- }
50
-
51
- if (process.env.NEXT_PUBLIC_IS_SANDBOX === 'true') {
52
- return (
53
- <SandboxCortexAiSettingsClient
54
- compatibleModels={compatibleModels as any}
55
- isPackageActive={status.isPackageActive}
56
- hasEnvOpenRouterKey={status.hasEnvOpenRouterKey}
57
- maskedEnvOpenRouterKey={status.maskedEnvOpenRouterKey}
58
- modelCatalogError={modelCatalogError}
59
- />
60
- );
61
- }
62
-
63
- return (
64
- <StoredCortexAiSettingsClient
65
- compatibleModels={compatibleModels as any}
66
- isPackageActive={status.isPackageActive}
67
- hasEnvOpenRouterKey={status.hasEnvOpenRouterKey}
68
- maskedEnvOpenRouterKey={status.maskedEnvOpenRouterKey}
69
- hasStoredOpenRouterKey={status.hasStoredOpenRouterKey}
70
- maskedStoredOpenRouterKey={status.maskedStoredOpenRouterKey}
71
- storedKeyUpdatedAt={storedKeyUpdatedAt}
72
- selectedModel={status.selectedModel}
73
- selectedModelUpdatedAt={selectedModelUpdatedAt}
74
- hasEncryptionKey={status.hasEncryptionKey}
75
- modelCatalogError={modelCatalogError}
76
- successMessage={params.success}
77
- errorMessage={params.error}
78
- />
79
- );
80
- }
1
+ import { listCortexAiCompatibleOpenRouterModels } from '@nextblock-cms/cortex';
2
+ import { getCortexAiSettingsStatus } from './actions';
3
+ import { SandboxCortexAiSettingsClient } from './SandboxCortexAiSettingsClient';
4
+ import { StoredCortexAiSettingsClient } from './StoredCortexAiSettingsClient';
5
+ import { redirect } from 'next/navigation';
6
+
7
+ type CortexAiSettingsPageProps = {
8
+ searchParams?: Promise<{
9
+ error?: string;
10
+ success?: string;
11
+ }>;
12
+ };
13
+
14
+ function formatDate(value: string | null) {
15
+ if (!value) {
16
+ return null;
17
+ }
18
+
19
+ return new Intl.DateTimeFormat('en', {
20
+ dateStyle: 'medium',
21
+ timeStyle: 'short',
22
+ }).format(new Date(value));
23
+ }
24
+
25
+ export default async function CortexAiSettingsPage({
26
+ searchParams,
27
+ }: CortexAiSettingsPageProps) {
28
+ const status = await getCortexAiSettingsStatus();
29
+
30
+ if (!status.isPackageActive) {
31
+ redirect('/cms/dashboard');
32
+ }
33
+
34
+ const params: { error?: string; success?: string } = searchParams
35
+ ? await searchParams
36
+ : {};
37
+ const storedKeyUpdatedAt = formatDate(status.storedOpenRouterKeyUpdatedAt);
38
+ const selectedModelUpdatedAt = formatDate(status.selectedModel?.updatedAt || null);
39
+ let compatibleModels: Awaited<ReturnType<typeof listCortexAiCompatibleOpenRouterModels>> = [];
40
+ let modelCatalogError: string | null = null;
41
+
42
+ if (status.hasStoredOpenRouterKey || process.env.NEXT_PUBLIC_IS_SANDBOX === 'true') {
43
+ try {
44
+ compatibleModels = await listCortexAiCompatibleOpenRouterModels();
45
+ } catch (error) {
46
+ modelCatalogError =
47
+ error instanceof Error ? error.message : 'Failed to load compatible OpenRouter models.';
48
+ }
49
+ }
50
+
51
+ if (process.env.NEXT_PUBLIC_IS_SANDBOX === 'true') {
52
+ return (
53
+ <SandboxCortexAiSettingsClient
54
+ compatibleModels={compatibleModels as any}
55
+ isPackageActive={status.isPackageActive}
56
+ hasEnvOpenRouterKey={status.hasEnvOpenRouterKey}
57
+ maskedEnvOpenRouterKey={status.maskedEnvOpenRouterKey}
58
+ modelCatalogError={modelCatalogError}
59
+ />
60
+ );
61
+ }
62
+
63
+ return (
64
+ <StoredCortexAiSettingsClient
65
+ compatibleModels={compatibleModels as any}
66
+ isPackageActive={status.isPackageActive}
67
+ hasEnvOpenRouterKey={status.hasEnvOpenRouterKey}
68
+ maskedEnvOpenRouterKey={status.maskedEnvOpenRouterKey}
69
+ hasStoredOpenRouterKey={status.hasStoredOpenRouterKey}
70
+ maskedStoredOpenRouterKey={status.maskedStoredOpenRouterKey}
71
+ storedKeyUpdatedAt={storedKeyUpdatedAt}
72
+ selectedModel={status.selectedModel}
73
+ selectedModelUpdatedAt={selectedModelUpdatedAt}
74
+ hasEncryptionKey={status.hasEncryptionKey}
75
+ modelCatalogError={modelCatalogError}
76
+ successMessage={params.success}
77
+ errorMessage={params.error}
78
+ />
79
+ );
80
+ }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- import "./.next/dev/types/routes.d.ts";
3
+ import "./.next/types/routes.d.ts";
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextblock-cms/template",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "next dev",
@@ -24,13 +24,13 @@
24
24
  "@dnd-kit/utilities": "^3.2.2",
25
25
  "@hookform/resolvers": "^5.2.2",
26
26
  "@next/third-parties": "^16.2.7",
27
+ "@nextblock-cms/cortex": "workspace:*",
27
28
  "@nextblock-cms/db": "workspace:*",
28
29
  "@nextblock-cms/ecommerce": "npm:@nextblock-cms/ecom@latest",
29
30
  "@nextblock-cms/editor": "workspace:*",
30
31
  "@nextblock-cms/sdk": "workspace:*",
31
32
  "@nextblock-cms/ui": "workspace:*",
32
33
  "@nextblock-cms/utils": "workspace:*",
33
- "@nextblock/cortex": "workspace:*",
34
34
  "@radix-ui/react-tooltip": "^1.2.8",
35
35
  "@supabase/ssr": "^0.10.2",
36
36
  "@supabase/supabase-js": "^2.105.1",
@@ -7,7 +7,7 @@ import {
7
7
  buildCortexWidgetDefinitionInsertPayload,
8
8
  buildCortexProfileCardVerificationDefinition,
9
9
  validateCortexWidgetDefinitionOutput,
10
- } from '@nextblock/cortex';
10
+ } from '@nextblock-cms/cortex';
11
11
 
12
12
  dotenv.config({ path: '.env.local' });
13
13
 
@@ -1,6 +1,6 @@
1
1
  import dotenv from 'dotenv';
2
2
 
3
- import { generateEditorHtmlFragment } from '@nextblock/cortex';
3
+ import { generateEditorHtmlFragment } from '@nextblock-cms/cortex';
4
4
 
5
5
  dotenv.config({ path: '.env.local' });
6
6
 
@@ -8,7 +8,7 @@ import {
8
8
  executeUpdateFooter,
9
9
  executeUpdateNavigationBar,
10
10
  executeUpdateSectionColumnBlock,
11
- } from '@nextblock/cortex';
11
+ } from '@nextblock-cms/cortex';
12
12
 
13
13
  type MockRow = Record<string, any>;
14
14
 
@@ -3,7 +3,7 @@ import dotenv from 'dotenv';
3
3
  import {
4
4
  CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL,
5
5
  generateCortexAiText,
6
- } from '@nextblock/cortex';
6
+ } from '@nextblock-cms/cortex';
7
7
 
8
8
  dotenv.config({ path: '.env.local' });
9
9