ellmo-ai-react 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ var React = require('react');
18
18
  const EllmoApi = async ({ url, clientId, type, className = '', showErrors = false, children }) => {
19
19
  let data = null;
20
20
  let error = null;
21
- let translatedType = type === 'structured' ? 'structured.json' : 'semantic';
21
+ let translatedType = type === 'structured' ? 'structured' : 'semantic';
22
22
  try {
23
23
  // Validate required props
24
24
  if (!clientId) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/EllmoApi.tsx","../src/middleware.ts"],"sourcesContent":["import React from 'react';\n\nexport type EllmoApiType = 'semantic' | 'structured';\n\nexport interface EllmoApiProps {\n /**\n * The URL path to fetch data for (required).\n * \n * With middleware (recommended):\n * ```tsx\n * import { headers } from 'next/headers';\n * import { getPathnameFromHeaders } from 'ellmo-ai-react/middleware';\n * \n * const pathname = getPathnameFromHeaders(headers());\n * <EllmoApi clientId=\"...\" url={pathname || '/'} />\n * ```\n * \n * Without middleware:\n * ```tsx\n * <EllmoApi clientId=\"...\" url=\"/about\" />\n * ```\n */\n url: string;\n /**\n * The API key/client identifier (required)\n */\n clientId: string;\n /**\n * Type of data to fetch\n */\n type?: EllmoApiType;\n /**\n * Custom className for styling\n */\n className?: string;\n /**\n * Whether to show errors\n */\n showErrors?: boolean;\n /**\n * Children to render when data is available\n */\n children?: (data: any, error: Error | null) => React.ReactNode;\n}\n\n/**\n * Server-only Ellmo API component (React Server Component)\n * This component fetches data during server rendering.\n * It requires Next.js 13+ App Router or other RSC-compatible frameworks.\n * \n * @example\n * ```tsx\n * // In a server component (app/page.tsx)\n * export default async function Page() {\n * return <EllmoApi clientId=\"your-id\" url=\"/about\" />;\n * }\n * ```\n */\nconst EllmoApi = async ({\n url,\n clientId,\n type,\n className = '',\n showErrors = false,\n children\n}: EllmoApiProps): Promise<React.ReactElement | null> => {\n let data: any = null;\n let error: Error | null = null;\n\n let translatedType = type === 'structured' ? 'structured.json' : 'semantic';\n\n try {\n // Validate required props\n if (!clientId) {\n throw new Error('clientId is required. Please provide your Ellmo API client identifier.');\n }\n\n if (!url) {\n throw new Error('url prop is required. Please provide the page pathname.');\n }\n\n // Encode the URL path for the API call\n const encodedUrl = encodeURIComponent(url);\n\n // Build the API URL\n const apiUrl = `https://www.tryellmo.ai/public-api/wordpress?c=${clientId}&t=${translatedType}&u=${encodedUrl}`;\n\n // Fetch data during server render\n const response = await fetch(apiUrl, {\n cache: 'no-store', // Always fetch fresh data\n });\n\n if (!response.ok) {\n throw new Error(`API request failed with status ${response.status}`);\n }\n\n if (type === 'structured') {\n data = await response.json();\n } else if (type === 'semantic') {\n data = await response.text();\n } else {\n throw new Error(`Invalid type: ${type}`);\n }\n } catch (err) {\n error = err instanceof Error ? err : new Error('Unknown error occurred');\n }\n\n // If children prop is provided, use render prop pattern\n if (children) {\n return <>{children(data, error)}</>;\n }\n\n // Show errors if enabled\n if (error && showErrors) {\n return (\n <div className={`ellmo-api-error ${className}`}>\n <div>Error: {error.message}</div>\n </div>\n );\n }\n\n // Show data if showErrors is enabled (for debugging)\n if (data && showErrors) {\n return (\n <div className={`ellmo-api-data ${className}`}>\n <pre>{JSON.stringify(data, null, 2)}</pre>\n </div>\n );\n }\n\n // Invisible component by default - just fetches data during server render\n if (type === 'structured' && data) {\n return <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }} />;\n } else if (type === 'semantic' && data) {\n return <div dangerouslySetInnerHTML={{ __html: data }} />;\n }\n return null;\n};\n\nexport default EllmoApi;\n","/**\n * Custom header name for Ellmo AI to pass pathname information\n * Using 'x-ellmo-pathname' to avoid conflicts with other libraries\n */\nexport const ELLMO_PATHNAME_HEADER = 'x-ellmo-pathname';\n\n/**\n * Type definitions for Next.js middleware (to avoid requiring Next.js as a dependency)\n */\nexport interface EllmoRequest {\n nextUrl: {\n pathname: string;\n };\n}\n\nexport interface EllmoResponse {\n headers: {\n set(name: string, value: string): void;\n };\n}\n\n/**\n * Ellmo AI middleware helper for Next.js\n * \n * This is a vanilla helper that adds pathname to request headers.\n * It doesn't depend on Next.js - you provide the request/response objects.\n * \n * Usage in Next.js:\n * \n * ```ts\n * // middleware.ts\n * import { ellmoMiddleware } from 'ellmo-ai-react/middleware';\n * import { NextResponse } from 'next/server';\n * import type { NextRequest } from 'next/server';\n * \n * export function middleware(request: NextRequest) {\n * const response = NextResponse.next();\n * return ellmoMiddleware(request, response);\n * }\n * \n * export const config = {\n * matcher: [\n * '/((?!_next/static|_next/image|favicon.ico).*)',\n * ],\n * };\n * ```\n * \n * Composing with existing middleware:\n * \n * ```ts\n * export function middleware(request: NextRequest) {\n * let response = NextResponse.next();\n * \n * // Your logic here\n * if (someCondition) {\n * response = NextResponse.redirect(new URL('/login', request.url));\n * }\n * \n * // Apply Ellmo middleware\n * return ellmoMiddleware(request, response);\n * }\n * ```\n */\nexport function ellmoMiddleware<\n Req extends EllmoRequest,\n Res extends EllmoResponse\n>(\n request: Req,\n response: Res\n): Res {\n // Extract pathname from the request URL\n const pathname = request.nextUrl.pathname;\n \n // Add the pathname to a custom header\n response.headers.set(ELLMO_PATHNAME_HEADER, pathname);\n \n return response;\n}\n\n/**\n * Helper to extract pathname from headers object\n * \n * Usage in Next.js Server Components:\n * ```tsx\n * import { headers } from 'next/headers';\n * import { getPathnameFromHeaders } from 'ellmo-ai-react/middleware';\n * \n * export default function Page() {\n * const headersList = headers();\n * const pathname = getPathnameFromHeaders(headersList);\n * \n * return <EllmoApi clientId=\"your-id\" url={pathname} />;\n * }\n * ```\n */\nexport function getPathnameFromHeaders(headers: { get(name: string): string | null }): string | null {\n return headers.get(ELLMO_PATHNAME_HEADER);\n}\n\nexport default ellmoMiddleware;\n"],"names":[],"mappings":";;;;AA6CA;;;;;;;;;;;;AAYG;AACG,MAAA,QAAQ,GAAG,OAAO,EACtB,GAAG,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;AACd;;ACzIA;;;AAGG;AACI,MAAM,qBAAqB,GAAG,mBAAmB;AAiBxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;AACa,SAAA,eAAe,CAI7B,OAAY,EACZ,QAAa,EAAA;;AAGb,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;;IAG1C,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAEtD,IAAA,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;AAeG;AACG,SAAU,sBAAsB,CAAC,OAA6C,EAAA;AAClF,IAAA,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAC5C;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/EllmoApi.tsx","../src/middleware.ts"],"sourcesContent":["import React from 'react';\n\nexport type EllmoApiType = 'semantic' | 'structured';\n\nexport interface EllmoApiProps {\n /**\n * The URL path to fetch data for (required).\n * \n * With middleware (recommended):\n * ```tsx\n * import { headers } from 'next/headers';\n * import { getPathnameFromHeaders } from 'ellmo-ai-react/middleware';\n * \n * const pathname = getPathnameFromHeaders(headers());\n * <EllmoApi clientId=\"...\" url={pathname || '/'} />\n * ```\n * \n * Without middleware:\n * ```tsx\n * <EllmoApi clientId=\"...\" url=\"/about\" />\n * ```\n */\n url: string;\n /**\n * The API key/client identifier (required)\n */\n clientId: string;\n /**\n * Type of data to fetch\n */\n type?: EllmoApiType;\n /**\n * Custom className for styling\n */\n className?: string;\n /**\n * Whether to show errors\n */\n showErrors?: boolean;\n /**\n * Children to render when data is available\n */\n children?: (data: any, error: Error | null) => React.ReactNode;\n}\n\n/**\n * Server-only Ellmo API component (React Server Component)\n * This component fetches data during server rendering.\n * It requires Next.js 13+ App Router or other RSC-compatible frameworks.\n * \n * @example\n * ```tsx\n * // In a server component (app/page.tsx)\n * export default async function Page() {\n * return <EllmoApi clientId=\"your-id\" url=\"/about\" />;\n * }\n * ```\n */\nconst EllmoApi = async ({\n url,\n clientId,\n type,\n className = '',\n showErrors = false,\n children\n}: EllmoApiProps): Promise<React.ReactElement | null> => {\n let data: any = null;\n let error: Error | null = null;\n\n let translatedType = type === 'structured' ? 'structured' : 'semantic';\n\n try {\n // Validate required props\n if (!clientId) {\n throw new Error('clientId is required. Please provide your Ellmo API client identifier.');\n }\n\n if (!url) {\n throw new Error('url prop is required. Please provide the page pathname.');\n }\n\n // Encode the URL path for the API call\n const encodedUrl = encodeURIComponent(url);\n\n // Build the API URL\n const apiUrl = `https://www.tryellmo.ai/public-api/wordpress?c=${clientId}&t=${translatedType}&u=${encodedUrl}`;\n\n // Fetch data during server render\n const response = await fetch(apiUrl, {\n cache: 'no-store', // Always fetch fresh data\n });\n\n if (!response.ok) {\n throw new Error(`API request failed with status ${response.status}`);\n }\n\n if (type === 'structured') {\n data = await response.json();\n } else if (type === 'semantic') {\n data = await response.text();\n } else {\n throw new Error(`Invalid type: ${type}`);\n }\n } catch (err) {\n error = err instanceof Error ? err : new Error('Unknown error occurred');\n }\n\n // If children prop is provided, use render prop pattern\n if (children) {\n return <>{children(data, error)}</>;\n }\n\n // Show errors if enabled\n if (error && showErrors) {\n return (\n <div className={`ellmo-api-error ${className}`}>\n <div>Error: {error.message}</div>\n </div>\n );\n }\n\n // Show data if showErrors is enabled (for debugging)\n if (data && showErrors) {\n return (\n <div className={`ellmo-api-data ${className}`}>\n <pre>{JSON.stringify(data, null, 2)}</pre>\n </div>\n );\n }\n\n // Invisible component by default - just fetches data during server render\n if (type === 'structured' && data) {\n return <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }} />;\n } else if (type === 'semantic' && data) {\n return <div dangerouslySetInnerHTML={{ __html: data }} />;\n }\n return null;\n};\n\nexport default EllmoApi;\n","/**\n * Custom header name for Ellmo AI to pass pathname information\n * Using 'x-ellmo-pathname' to avoid conflicts with other libraries\n */\nexport const ELLMO_PATHNAME_HEADER = 'x-ellmo-pathname';\n\n/**\n * Type definitions for Next.js middleware (to avoid requiring Next.js as a dependency)\n */\nexport interface EllmoRequest {\n nextUrl: {\n pathname: string;\n };\n}\n\nexport interface EllmoResponse {\n headers: {\n set(name: string, value: string): void;\n };\n}\n\n/**\n * Ellmo AI middleware helper for Next.js\n * \n * This is a vanilla helper that adds pathname to request headers.\n * It doesn't depend on Next.js - you provide the request/response objects.\n * \n * Usage in Next.js:\n * \n * ```ts\n * // middleware.ts\n * import { ellmoMiddleware } from 'ellmo-ai-react/middleware';\n * import { NextResponse } from 'next/server';\n * import type { NextRequest } from 'next/server';\n * \n * export function middleware(request: NextRequest) {\n * const response = NextResponse.next();\n * return ellmoMiddleware(request, response);\n * }\n * \n * export const config = {\n * matcher: [\n * '/((?!_next/static|_next/image|favicon.ico).*)',\n * ],\n * };\n * ```\n * \n * Composing with existing middleware:\n * \n * ```ts\n * export function middleware(request: NextRequest) {\n * let response = NextResponse.next();\n * \n * // Your logic here\n * if (someCondition) {\n * response = NextResponse.redirect(new URL('/login', request.url));\n * }\n * \n * // Apply Ellmo middleware\n * return ellmoMiddleware(request, response);\n * }\n * ```\n */\nexport function ellmoMiddleware<\n Req extends EllmoRequest,\n Res extends EllmoResponse\n>(\n request: Req,\n response: Res\n): Res {\n // Extract pathname from the request URL\n const pathname = request.nextUrl.pathname;\n \n // Add the pathname to a custom header\n response.headers.set(ELLMO_PATHNAME_HEADER, pathname);\n \n return response;\n}\n\n/**\n * Helper to extract pathname from headers object\n * \n * Usage in Next.js Server Components:\n * ```tsx\n * import { headers } from 'next/headers';\n * import { getPathnameFromHeaders } from 'ellmo-ai-react/middleware';\n * \n * export default function Page() {\n * const headersList = headers();\n * const pathname = getPathnameFromHeaders(headersList);\n * \n * return <EllmoApi clientId=\"your-id\" url={pathname} />;\n * }\n * ```\n */\nexport function getPathnameFromHeaders(headers: { get(name: string): string | null }): string | null {\n return headers.get(ELLMO_PATHNAME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AA,KAAA,EAAA,EAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAA,CAAI,CAAC;KAC3D;AACD,IAAA,OAAO,IAAI,CAAC;AACd;;ACzIA;;;AAGG;AACI,MAAM,qBAAqB,GAAG,mBAAmB;AAiBxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;AACa,SAAA,eAAe,CAI7B,OAAY,EACZ,QAAa,EAAA;;AAGb,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;;IAG1C,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAEtD,IAAA,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;AAeG;AACG,SAAU,sBAAsB,CAAC,OAA6C,EAAA;AAClF,IAAA,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAC5C;;;;;;;;"}
package/dist/index.mjs CHANGED
@@ -16,7 +16,7 @@ import React from 'react';
16
16
  const EllmoApi = async ({ url, clientId, type, className = '', showErrors = false, children }) => {
17
17
  let data = null;
18
18
  let error = null;
19
- let translatedType = type === 'structured' ? 'structured.json' : 'semantic';
19
+ let translatedType = type === 'structured' ? 'structured' : 'semantic';
20
20
  try {
21
21
  // Validate required props
22
22
  if (!clientId) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/EllmoApi.tsx","../src/middleware.ts"],"sourcesContent":["import React from 'react';\n\nexport type EllmoApiType = 'semantic' | 'structured';\n\nexport interface EllmoApiProps {\n /**\n * The URL path to fetch data for (required).\n * \n * With middleware (recommended):\n * ```tsx\n * import { headers } from 'next/headers';\n * import { getPathnameFromHeaders } from 'ellmo-ai-react/middleware';\n * \n * const pathname = getPathnameFromHeaders(headers());\n * <EllmoApi clientId=\"...\" url={pathname || '/'} />\n * ```\n * \n * Without middleware:\n * ```tsx\n * <EllmoApi clientId=\"...\" url=\"/about\" />\n * ```\n */\n url: string;\n /**\n * The API key/client identifier (required)\n */\n clientId: string;\n /**\n * Type of data to fetch\n */\n type?: EllmoApiType;\n /**\n * Custom className for styling\n */\n className?: string;\n /**\n * Whether to show errors\n */\n showErrors?: boolean;\n /**\n * Children to render when data is available\n */\n children?: (data: any, error: Error | null) => React.ReactNode;\n}\n\n/**\n * Server-only Ellmo API component (React Server Component)\n * This component fetches data during server rendering.\n * It requires Next.js 13+ App Router or other RSC-compatible frameworks.\n * \n * @example\n * ```tsx\n * // In a server component (app/page.tsx)\n * export default async function Page() {\n * return <EllmoApi clientId=\"your-id\" url=\"/about\" />;\n * }\n * ```\n */\nconst EllmoApi = async ({\n url,\n clientId,\n type,\n className = '',\n showErrors = false,\n children\n}: EllmoApiProps): Promise<React.ReactElement | null> => {\n let data: any = null;\n let error: Error | null = null;\n\n let translatedType = type === 'structured' ? 'structured.json' : 'semantic';\n\n try {\n // Validate required props\n if (!clientId) {\n throw new Error('clientId is required. Please provide your Ellmo API client identifier.');\n }\n\n if (!url) {\n throw new Error('url prop is required. Please provide the page pathname.');\n }\n\n // Encode the URL path for the API call\n const encodedUrl = encodeURIComponent(url);\n\n // Build the API URL\n const apiUrl = `https://www.tryellmo.ai/public-api/wordpress?c=${clientId}&t=${translatedType}&u=${encodedUrl}`;\n\n // Fetch data during server render\n const response = await fetch(apiUrl, {\n cache: 'no-store', // Always fetch fresh data\n });\n\n if (!response.ok) {\n throw new Error(`API request failed with status ${response.status}`);\n }\n\n if (type === 'structured') {\n data = await response.json();\n } else if (type === 'semantic') {\n data = await response.text();\n } else {\n throw new Error(`Invalid type: ${type}`);\n }\n } catch (err) {\n error = err instanceof Error ? err : new Error('Unknown error occurred');\n }\n\n // If children prop is provided, use render prop pattern\n if (children) {\n return <>{children(data, error)}</>;\n }\n\n // Show errors if enabled\n if (error && showErrors) {\n return (\n <div className={`ellmo-api-error ${className}`}>\n <div>Error: {error.message}</div>\n </div>\n );\n }\n\n // Show data if showErrors is enabled (for debugging)\n if (data && showErrors) {\n return (\n <div className={`ellmo-api-data ${className}`}>\n <pre>{JSON.stringify(data, null, 2)}</pre>\n </div>\n );\n }\n\n // Invisible component by default - just fetches data during server render\n if (type === 'structured' && data) {\n return <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }} />;\n } else if (type === 'semantic' && data) {\n return <div dangerouslySetInnerHTML={{ __html: data }} />;\n }\n return null;\n};\n\nexport default EllmoApi;\n","/**\n * Custom header name for Ellmo AI to pass pathname information\n * Using 'x-ellmo-pathname' to avoid conflicts with other libraries\n */\nexport const ELLMO_PATHNAME_HEADER = 'x-ellmo-pathname';\n\n/**\n * Type definitions for Next.js middleware (to avoid requiring Next.js as a dependency)\n */\nexport interface EllmoRequest {\n nextUrl: {\n pathname: string;\n };\n}\n\nexport interface EllmoResponse {\n headers: {\n set(name: string, value: string): void;\n };\n}\n\n/**\n * Ellmo AI middleware helper for Next.js\n * \n * This is a vanilla helper that adds pathname to request headers.\n * It doesn't depend on Next.js - you provide the request/response objects.\n * \n * Usage in Next.js:\n * \n * ```ts\n * // middleware.ts\n * import { ellmoMiddleware } from 'ellmo-ai-react/middleware';\n * import { NextResponse } from 'next/server';\n * import type { NextRequest } from 'next/server';\n * \n * export function middleware(request: NextRequest) {\n * const response = NextResponse.next();\n * return ellmoMiddleware(request, response);\n * }\n * \n * export const config = {\n * matcher: [\n * '/((?!_next/static|_next/image|favicon.ico).*)',\n * ],\n * };\n * ```\n * \n * Composing with existing middleware:\n * \n * ```ts\n * export function middleware(request: NextRequest) {\n * let response = NextResponse.next();\n * \n * // Your logic here\n * if (someCondition) {\n * response = NextResponse.redirect(new URL('/login', request.url));\n * }\n * \n * // Apply Ellmo middleware\n * return ellmoMiddleware(request, response);\n * }\n * ```\n */\nexport function ellmoMiddleware<\n Req extends EllmoRequest,\n Res extends EllmoResponse\n>(\n request: Req,\n response: Res\n): Res {\n // Extract pathname from the request URL\n const pathname = request.nextUrl.pathname;\n \n // Add the pathname to a custom header\n response.headers.set(ELLMO_PATHNAME_HEADER, pathname);\n \n return response;\n}\n\n/**\n * Helper to extract pathname from headers object\n * \n * Usage in Next.js Server Components:\n * ```tsx\n * import { headers } from 'next/headers';\n * import { getPathnameFromHeaders } from 'ellmo-ai-react/middleware';\n * \n * export default function Page() {\n * const headersList = headers();\n * const pathname = getPathnameFromHeaders(headersList);\n * \n * return <EllmoApi clientId=\"your-id\" url={pathname} />;\n * }\n * ```\n */\nexport function getPathnameFromHeaders(headers: { get(name: string): string | null }): string | null {\n return headers.get(ELLMO_PATHNAME_HEADER);\n}\n\nexport default ellmoMiddleware;\n"],"names":[],"mappings":";;AA6CA;;;;;;;;;;;;AAYG;AACG,MAAA,QAAQ,GAAG,OAAO,EACtB,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,SAAS,GAAG,EAAE,EACd,UAAU,GAAG,KAAK,EAClB,QAAQ,EACM,KAAwC;IACtD,IAAI,IAAI,GAAQ,IAAI,CAAC;IACrB,IAAI,KAAK,GAAiB,IAAI,CAAC;AAE/B,IAAA,IAAI,cAAc,GAAG,IAAI,KAAK,YAAY,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAE5E,IAAA,IAAI;;QAEF,IAAI,CAAC,QAAQ,EAAE;AACb,YAAA,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;SAC3F;QAED,IAAI,CAAC,GAAG,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;SAC5E;;AAGD,QAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;;QAG3C,MAAM,MAAM,GAAG,CAAkD,+CAAA,EAAA,QAAQ,MAAM,cAAc,CAAA,GAAA,EAAM,UAAU,CAAA,CAAE,CAAC;;AAGhH,QAAA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE;YACnC,KAAK,EAAE,UAAU;AAClB,SAAA,CA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IAAA,EAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAO,CACtC,EACN;KACH;;AAGD,IAAA,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,EAAE;AACjC,QAAA,OAAO,gCAAQ,IAAI,EAAC,qBAAqB,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAI,CAAC;KACzG;AAAM,SAAA,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,EAAE;QACtC,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAA,CAAI,CAAC;KAC3D;AACD,IAAA,OAAO,IAAI,CAAC;AACd;;ACzIA;;;AAGG;AACI,MAAM,qBAAqB,GAAG,mBAAmB;AAiBxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;AACa,SAAA,eAAe,CAI7B,OAAY,EACZ,QAAa,EAAA;;AAGb,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;;IAG1C,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAEtD,IAAA,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;AAeG;AACG,SAAU,sBAAsB,CAAC,OAA6C,EAAA;AAClF,IAAA,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAC5C;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/EllmoApi.tsx","../src/middleware.ts"],"sourcesContent":["import React from 'react';\n\nexport type EllmoApiType = 'semantic' | 'structured';\n\nexport interface EllmoApiProps {\n /**\n * The URL path to fetch data for (required).\n * \n * With middleware (recommended):\n * ```tsx\n * import { headers } from 'next/headers';\n * import { getPathnameFromHeaders } from 'ellmo-ai-react/middleware';\n * \n * const pathname = getPathnameFromHeaders(headers());\n * <EllmoApi clientId=\"...\" url={pathname || '/'} />\n * ```\n * \n * Without middleware:\n * ```tsx\n * <EllmoApi clientId=\"...\" url=\"/about\" />\n * ```\n */\n url: string;\n /**\n * The API key/client identifier (required)\n */\n clientId: string;\n /**\n * Type of data to fetch\n */\n type?: EllmoApiType;\n /**\n * Custom className for styling\n */\n className?: string;\n /**\n * Whether to show errors\n */\n showErrors?: boolean;\n /**\n * Children to render when data is available\n */\n children?: (data: any, error: Error | null) => React.ReactNode;\n}\n\n/**\n * Server-only Ellmo API component (React Server Component)\n * This component fetches data during server rendering.\n * It requires Next.js 13+ App Router or other RSC-compatible frameworks.\n * \n * @example\n * ```tsx\n * // In a server component (app/page.tsx)\n * export default async function Page() {\n * return <EllmoApi clientId=\"your-id\" url=\"/about\" />;\n * }\n * ```\n */\nconst EllmoApi = async ({\n url,\n clientId,\n type,\n className = '',\n showErrors = false,\n children\n}: EllmoApiProps): Promise<React.ReactElement | null> => {\n let data: any = null;\n let error: Error | null = null;\n\n let translatedType = type === 'structured' ? 'structured' : 'semantic';\n\n try {\n // Validate required props\n if (!clientId) {\n throw new Error('clientId is required. Please provide your Ellmo API client identifier.');\n }\n\n if (!url) {\n throw new Error('url prop is required. Please provide the page pathname.');\n }\n\n // Encode the URL path for the API call\n const encodedUrl = encodeURIComponent(url);\n\n // Build the API URL\n const apiUrl = `https://www.tryellmo.ai/public-api/wordpress?c=${clientId}&t=${translatedType}&u=${encodedUrl}`;\n\n // Fetch data during server render\n const response = await fetch(apiUrl, {\n cache: 'no-store', // Always fetch fresh data\n });\n\n if (!response.ok) {\n throw new Error(`API request failed with status ${response.status}`);\n }\n\n if (type === 'structured') {\n data = await response.json();\n } else if (type === 'semantic') {\n data = await response.text();\n } else {\n throw new Error(`Invalid type: ${type}`);\n }\n } catch (err) {\n error = err instanceof Error ? err : new Error('Unknown error occurred');\n }\n\n // If children prop is provided, use render prop pattern\n if (children) {\n return <>{children(data, error)}</>;\n }\n\n // Show errors if enabled\n if (error && showErrors) {\n return (\n <div className={`ellmo-api-error ${className}`}>\n <div>Error: {error.message}</div>\n </div>\n );\n }\n\n // Show data if showErrors is enabled (for debugging)\n if (data && showErrors) {\n return (\n <div className={`ellmo-api-data ${className}`}>\n <pre>{JSON.stringify(data, null, 2)}</pre>\n </div>\n );\n }\n\n // Invisible component by default - just fetches data during server render\n if (type === 'structured' && data) {\n return <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }} />;\n } else if (type === 'semantic' && data) {\n return <div dangerouslySetInnerHTML={{ __html: data }} />;\n }\n return null;\n};\n\nexport default EllmoApi;\n","/**\n * Custom header name for Ellmo AI to pass pathname information\n * Using 'x-ellmo-pathname' to avoid conflicts with other libraries\n */\nexport const ELLMO_PATHNAME_HEADER = 'x-ellmo-pathname';\n\n/**\n * Type definitions for Next.js middleware (to avoid requiring Next.js as a dependency)\n */\nexport interface EllmoRequest {\n nextUrl: {\n pathname: string;\n };\n}\n\nexport interface EllmoResponse {\n headers: {\n set(name: string, value: string): void;\n };\n}\n\n/**\n * Ellmo AI middleware helper for Next.js\n * \n * This is a vanilla helper that adds pathname to request headers.\n * It doesn't depend on Next.js - you provide the request/response objects.\n * \n * Usage in Next.js:\n * \n * ```ts\n * // middleware.ts\n * import { ellmoMiddleware } from 'ellmo-ai-react/middleware';\n * import { NextResponse } from 'next/server';\n * import type { NextRequest } from 'next/server';\n * \n * export function middleware(request: NextRequest) {\n * const response = NextResponse.next();\n * return ellmoMiddleware(request, response);\n * }\n * \n * export const config = {\n * matcher: [\n * '/((?!_next/static|_next/image|favicon.ico).*)',\n * ],\n * };\n * ```\n * \n * Composing with existing middleware:\n * \n * ```ts\n * export function middleware(request: NextRequest) {\n * let response = NextResponse.next();\n * \n * // Your logic here\n * if (someCondition) {\n * response = NextResponse.redirect(new URL('/login', request.url));\n * }\n * \n * // Apply Ellmo middleware\n * return ellmoMiddleware(request, response);\n * }\n * ```\n */\nexport function ellmoMiddleware<\n Req extends EllmoRequest,\n Res extends EllmoResponse\n>(\n request: Req,\n response: Res\n): Res {\n // Extract pathname from the request URL\n const pathname = request.nextUrl.pathname;\n \n // Add the pathname to a custom header\n response.headers.set(ELLMO_PATHNAME_HEADER, pathname);\n \n return response;\n}\n\n/**\n * Helper to extract pathname from headers object\n * \n * Usage in Next.js Server Components:\n * ```tsx\n * import { headers } from 'next/headers';\n * import { getPathnameFromHeaders } from 'ellmo-ai-react/middleware';\n * \n * export default function Page() {\n * const headersList = headers();\n * const pathname = getPathnameFromHeaders(headersList);\n * \n * return <EllmoApi clientId=\"your-id\" url={pathname} />;\n * }\n * ```\n */\nexport function getPathnameFromHeaders(headers: { get(name: string): string | null }): string | null {\n return headers.get(ELLMO_PATHNAME_HEADER);\n}\n\nexport default ellmoMiddleware;\n"],"names":[],"mappings":";;AA6CA;;;;;;;;;;;;AAYG;AACG,MAAA,QAAQ,GAAG,OAAO,EACtB,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,SAAS,GAAG,EAAE,EACd,UAAU,GAAG,KAAK,EAClB,QAAQ,EACM,KAAwC;IACtD,IAAI,IAAI,GAAQ,IAAI,CAAC;IACrB,IAAI,KAAK,GAAiB,IAAI,CAAC;AAE/B,IAAA,IAAI,cAAc,GAAG,IAAI,KAAK,YAAY,GAAG,YAAY,GAAG,UAAU,CAAC;AAEvE,IAAA,IAAI;;QAEF,IAAI,CAAC,QAAQ,EAAE;AACb,YAAA,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;SAC3F;QAED,IAAI,CAAC,GAAG,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;SAC5E;;AAGD,QAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;;QAG3C,MAAM,MAAM,GAAG,CAAkD,+CAAA,EAAA,QAAQ,MAAM,cAAc,CAAA,GAAA,EAAM,UAAU,CAAA,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://www.tryellmo.ai?utm_source=npm&utm_medium=package&utm_campaign=ellmo-ai-react",
5
5
  "description": "React component for integration with Ellmo AI",
6
6
  "main": "dist/index.js",