seox 1.1.1 → 1.2.0

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.d.cts CHANGED
@@ -1,87 +1,27 @@
1
- import { TemplateString } from 'next/dist/lib/metadata/types/metadata-types';
2
- import { OpenGraphType } from 'next/dist/lib/metadata/types/opengraph-types';
1
+ import { Metadata } from 'next';
3
2
 
4
- interface SEOAuthor {
5
- name: string;
6
- url?: string;
7
- }
8
- interface SEOImage {
9
- url: string;
10
- width?: number;
11
- height?: number;
12
- alt?: string;
13
- }
14
- interface SEORobots {
15
- index?: boolean;
16
- follow?: boolean;
17
- googleBot?: {
18
- index?: boolean;
19
- follow?: boolean;
20
- 'max-video-preview'?: number;
21
- 'max-image-preview'?: 'none' | 'standard' | 'large';
22
- 'max-snippet'?: number;
23
- };
24
- }
25
- interface SEOTwitter {
26
- card?: 'summary' | 'summary_large_image' | 'app' | 'player';
27
- title?: string;
28
- description?: string;
29
- images?: string[];
30
- creator?: string;
31
- }
32
- interface SEOOpenGraph {
33
- type: OpenGraphType;
34
- locale?: string;
35
- url?: string;
36
- title?: string;
37
- description?: string;
38
- siteName?: string;
39
- images?: SEOImage[];
40
- }
41
- interface SEOFormatDetection {
42
- email?: boolean;
43
- address?: boolean;
44
- telephone?: boolean;
45
- }
46
- interface SEOIcons {
47
- icon?: {
48
- url: string;
49
- sizes?: string;
50
- }[];
51
- apple?: {
52
- url: string;
53
- sizes?: string;
54
- }[];
55
- shortcut?: {
56
- url: string;
57
- sizes?: string;
58
- }[];
59
- }
3
+ /**
4
+ * JSON-LD structured data schema
5
+ */
60
6
  interface SEOJsonLd {
61
7
  '@context': string;
62
8
  '@type': string;
63
- [key: string]: any;
9
+ [key: string]: unknown;
64
10
  }
65
11
  /**
66
- * Main SEO structure for site or page-level configuration
12
+ * SEO configuration extending Next.js Metadata with additional fields
13
+ *
14
+ * - `name`: Site name (used as fallback for openGraph.siteName)
15
+ * - `url`: Site URL (used as fallback for openGraph.url)
16
+ * - `jsonld`: JSON-LD structured data schemas
67
17
  */
68
- interface SEOConfig {
18
+ interface SEOConfig extends Metadata {
19
+ /** Site name, used as fallback for openGraph.siteName */
69
20
  name: string;
21
+ /** Site URL, used as fallback for openGraph.url */
70
22
  url: string;
71
- title?: TemplateString | string;
72
- description?: string;
73
- keywords?: string[];
74
- creator?: string;
75
- publisher?: string;
76
- authors?: SEOAuthor[];
77
- manifest?: string;
78
- icons?: SEOIcons;
79
- formatDetection?: SEOFormatDetection;
80
- openGraph?: SEOOpenGraph;
81
- twitter?: SEOTwitter;
82
- robots?: SEORobots;
23
+ /** JSON-LD structured data schemas */
83
24
  jsonld?: SEOJsonLd[];
84
- locale?: string;
85
25
  }
86
26
 
87
- export type { SEOAuthor, SEOConfig, SEOFormatDetection, SEOIcons, SEOImage, SEOJsonLd, SEOOpenGraph, SEORobots, SEOTwitter };
27
+ export type { SEOConfig, SEOJsonLd };
package/dist/index.d.ts CHANGED
@@ -1,87 +1,27 @@
1
- import { TemplateString } from 'next/dist/lib/metadata/types/metadata-types';
2
- import { OpenGraphType } from 'next/dist/lib/metadata/types/opengraph-types';
1
+ import { Metadata } from 'next';
3
2
 
4
- interface SEOAuthor {
5
- name: string;
6
- url?: string;
7
- }
8
- interface SEOImage {
9
- url: string;
10
- width?: number;
11
- height?: number;
12
- alt?: string;
13
- }
14
- interface SEORobots {
15
- index?: boolean;
16
- follow?: boolean;
17
- googleBot?: {
18
- index?: boolean;
19
- follow?: boolean;
20
- 'max-video-preview'?: number;
21
- 'max-image-preview'?: 'none' | 'standard' | 'large';
22
- 'max-snippet'?: number;
23
- };
24
- }
25
- interface SEOTwitter {
26
- card?: 'summary' | 'summary_large_image' | 'app' | 'player';
27
- title?: string;
28
- description?: string;
29
- images?: string[];
30
- creator?: string;
31
- }
32
- interface SEOOpenGraph {
33
- type: OpenGraphType;
34
- locale?: string;
35
- url?: string;
36
- title?: string;
37
- description?: string;
38
- siteName?: string;
39
- images?: SEOImage[];
40
- }
41
- interface SEOFormatDetection {
42
- email?: boolean;
43
- address?: boolean;
44
- telephone?: boolean;
45
- }
46
- interface SEOIcons {
47
- icon?: {
48
- url: string;
49
- sizes?: string;
50
- }[];
51
- apple?: {
52
- url: string;
53
- sizes?: string;
54
- }[];
55
- shortcut?: {
56
- url: string;
57
- sizes?: string;
58
- }[];
59
- }
3
+ /**
4
+ * JSON-LD structured data schema
5
+ */
60
6
  interface SEOJsonLd {
61
7
  '@context': string;
62
8
  '@type': string;
63
- [key: string]: any;
9
+ [key: string]: unknown;
64
10
  }
65
11
  /**
66
- * Main SEO structure for site or page-level configuration
12
+ * SEO configuration extending Next.js Metadata with additional fields
13
+ *
14
+ * - `name`: Site name (used as fallback for openGraph.siteName)
15
+ * - `url`: Site URL (used as fallback for openGraph.url)
16
+ * - `jsonld`: JSON-LD structured data schemas
67
17
  */
68
- interface SEOConfig {
18
+ interface SEOConfig extends Metadata {
19
+ /** Site name, used as fallback for openGraph.siteName */
69
20
  name: string;
21
+ /** Site URL, used as fallback for openGraph.url */
70
22
  url: string;
71
- title?: TemplateString | string;
72
- description?: string;
73
- keywords?: string[];
74
- creator?: string;
75
- publisher?: string;
76
- authors?: SEOAuthor[];
77
- manifest?: string;
78
- icons?: SEOIcons;
79
- formatDetection?: SEOFormatDetection;
80
- openGraph?: SEOOpenGraph;
81
- twitter?: SEOTwitter;
82
- robots?: SEORobots;
23
+ /** JSON-LD structured data schemas */
83
24
  jsonld?: SEOJsonLd[];
84
- locale?: string;
85
25
  }
86
26
 
87
- export type { SEOAuthor, SEOConfig, SEOFormatDetection, SEOIcons, SEOImage, SEOJsonLd, SEOOpenGraph, SEORobots, SEOTwitter };
27
+ export type { SEOConfig, SEOJsonLd };
package/dist/next.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var i=require('react');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var i__namespace=/*#__PURE__*/_interopNamespace(i);var s=class{config;constructor(t){this.config=t;}configToMetadata(t){let o={...this.config,...t},n={title:o.title,description:o.description,keywords:o.keywords,creator:o.creator,publisher:o.publisher,authors:o.authors?.map(e=>({name:e.name,url:e.url})),manifest:o.manifest,icons:o.icons?{...this.config.icons,...t?.icons}:void 0,formatDetection:o.formatDetection?{...this.config.formatDetection,...t?.formatDetection}:void 0,openGraph:o.openGraph?{...this.config.openGraph,...t?.openGraph,url:t?.openGraph?.url??this.config.openGraph?.url??this.config.url,siteName:t?.openGraph?.siteName??this.config.openGraph?.siteName??this.config.name}:void 0,twitter:o.twitter?{...this.config.twitter,...t?.twitter}:void 0,robots:o.robots?{...this.config.robots,...t?.robots,googleBot:t?.robots?.googleBot||this.config.robots?.googleBot?{...this.config.robots?.googleBot,...t?.robots?.googleBot}:void 0}:void 0};return Object.fromEntries(Object.entries(n).filter(([e,r])=>r!==void 0))}generatePageMetadata(t){return this.configToMetadata(t)}getJsonLd(t){let o=this.config.jsonld??[],n=t??[];return [...o,...n]}getJsonLdStrings(t){return this.getJsonLd(t).map(o=>JSON.stringify(o))}};function f({seo:a,additionalSchemas:t}){let o=a.getJsonLd(t);return !o||o.length===0?null:i__namespace.createElement(i__namespace.Fragment,null,o.map((n,e)=>i__namespace.createElement("script",{key:`jsonld-${e}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(n)}})))}exports.JsonLd=f;exports.Seox=s;
1
+ 'use strict';var r=require('react');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var r__namespace=/*#__PURE__*/_interopNamespace(r);var s=class{config;constructor(o){this.config=o;}configToMetadata(o){let{name:t,url:e,jsonld:p,...n}=this.config,{name:c,url:g,jsonld:m,...a}=o??{},d={...n,...a};return (n.openGraph||a.openGraph)&&(d.openGraph={...n.openGraph,...a.openGraph,url:a.openGraph?.url??n.openGraph?.url??e,siteName:a.openGraph?.siteName??n.openGraph?.siteName??t}),d}generatePageMetadata(o){return this.configToMetadata(o)}getJsonLd(o){let t=this.config.jsonld??[],e=o??[];return [...t,...e]}getJsonLdStrings(o){return this.getJsonLd(o).map(t=>JSON.stringify(t))}};function f({seo:i,additionalSchemas:o}){let t=i.getJsonLd(o);return !t||t.length===0?null:r__namespace.createElement(r__namespace.Fragment,null,t.map((e,p)=>r__namespace.createElement("script",{key:`jsonld-${p}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})))}exports.JsonLd=f;exports.Seox=s;
package/dist/next.d.cts CHANGED
@@ -1,8 +1,6 @@
1
1
  import { SEOConfig, SEOJsonLd } from './index.cjs';
2
2
  import { Metadata } from 'next';
3
3
  import * as React from 'react';
4
- import 'next/dist/lib/metadata/types/metadata-types';
5
- import 'next/dist/lib/metadata/types/opengraph-types';
6
4
 
7
5
  declare class Seox {
8
6
  config: SEOConfig;
package/dist/next.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import { SEOConfig, SEOJsonLd } from './index.js';
2
2
  import { Metadata } from 'next';
3
3
  import * as React from 'react';
4
- import 'next/dist/lib/metadata/types/metadata-types';
5
- import 'next/dist/lib/metadata/types/opengraph-types';
6
4
 
7
5
  declare class Seox {
8
6
  config: SEOConfig;
package/dist/next.js CHANGED
@@ -1 +1 @@
1
- import*as i from'react';var s=class{config;constructor(t){this.config=t;}configToMetadata(t){let o={...this.config,...t},n={title:o.title,description:o.description,keywords:o.keywords,creator:o.creator,publisher:o.publisher,authors:o.authors?.map(e=>({name:e.name,url:e.url})),manifest:o.manifest,icons:o.icons?{...this.config.icons,...t?.icons}:void 0,formatDetection:o.formatDetection?{...this.config.formatDetection,...t?.formatDetection}:void 0,openGraph:o.openGraph?{...this.config.openGraph,...t?.openGraph,url:t?.openGraph?.url??this.config.openGraph?.url??this.config.url,siteName:t?.openGraph?.siteName??this.config.openGraph?.siteName??this.config.name}:void 0,twitter:o.twitter?{...this.config.twitter,...t?.twitter}:void 0,robots:o.robots?{...this.config.robots,...t?.robots,googleBot:t?.robots?.googleBot||this.config.robots?.googleBot?{...this.config.robots?.googleBot,...t?.robots?.googleBot}:void 0}:void 0};return Object.fromEntries(Object.entries(n).filter(([e,r])=>r!==void 0))}generatePageMetadata(t){return this.configToMetadata(t)}getJsonLd(t){let o=this.config.jsonld??[],n=t??[];return [...o,...n]}getJsonLdStrings(t){return this.getJsonLd(t).map(o=>JSON.stringify(o))}};function f({seo:a,additionalSchemas:t}){let o=a.getJsonLd(t);return !o||o.length===0?null:i.createElement(i.Fragment,null,o.map((n,e)=>i.createElement("script",{key:`jsonld-${e}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(n)}})))}export{f as JsonLd,s as Seox};
1
+ import*as r from'react';var s=class{config;constructor(o){this.config=o;}configToMetadata(o){let{name:t,url:e,jsonld:p,...n}=this.config,{name:c,url:g,jsonld:m,...a}=o??{},d={...n,...a};return (n.openGraph||a.openGraph)&&(d.openGraph={...n.openGraph,...a.openGraph,url:a.openGraph?.url??n.openGraph?.url??e,siteName:a.openGraph?.siteName??n.openGraph?.siteName??t}),d}generatePageMetadata(o){return this.configToMetadata(o)}getJsonLd(o){let t=this.config.jsonld??[],e=o??[];return [...t,...e]}getJsonLdStrings(o){return this.getJsonLd(o).map(t=>JSON.stringify(t))}};function f({seo:i,additionalSchemas:o}){let t=i.getJsonLd(o);return !t||t.length===0?null:r.createElement(r.Fragment,null,t.map((e,p)=>r.createElement("script",{key:`jsonld-${p}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})))}export{f as JsonLd,s as Seox};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seox",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },