@opinly/nuxt 1.2.0 → 1.3.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.cjs +17 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -26,11 +26,24 @@ __export(index_exports, {
|
|
|
26
26
|
buildFaqJsonLd: () => import_shared2.buildFaqJsonLd,
|
|
27
27
|
buildMetadata: () => import_shared2.buildMetadata,
|
|
28
28
|
buildPersonJsonLd: () => import_shared2.buildPersonJsonLd,
|
|
29
|
-
opinlyHead: () => opinlyHead
|
|
29
|
+
opinlyHead: () => opinlyHead,
|
|
30
|
+
useOpinly: () => useOpinly,
|
|
31
|
+
useOpinlyPixel: () => useOpinlyPixel
|
|
30
32
|
});
|
|
31
33
|
module.exports = __toCommonJS(index_exports);
|
|
32
34
|
var import_shared = require("@opinly/shared");
|
|
33
35
|
var import_shared2 = require("@opinly/shared");
|
|
36
|
+
|
|
37
|
+
// src/pixel.ts
|
|
38
|
+
var import_pixel = require("@opinly/shared/pixel");
|
|
39
|
+
function useOpinlyPixel(config) {
|
|
40
|
+
return (0, import_pixel.loadOpinlyPixel)(config);
|
|
41
|
+
}
|
|
42
|
+
function useOpinly() {
|
|
43
|
+
return (0, import_pixel.getOpinlyPixel)();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/index.ts
|
|
34
47
|
var metaTags = (m) => {
|
|
35
48
|
const tags = [];
|
|
36
49
|
if (m.description) tags.push({ name: "description", content: m.description });
|
|
@@ -62,6 +75,8 @@ function opinlyHead(args) {
|
|
|
62
75
|
buildFaqJsonLd,
|
|
63
76
|
buildMetadata,
|
|
64
77
|
buildPersonJsonLd,
|
|
65
|
-
opinlyHead
|
|
78
|
+
opinlyHead,
|
|
79
|
+
useOpinly,
|
|
80
|
+
useOpinlyPixel
|
|
66
81
|
});
|
|
67
82
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n buildMetadata,\n type OpinlyConfig,\n type OpinlyMeta,\n type SeoResolved,\n} from \"@opinly/shared\";\n\n/** A Nuxt `useHead()`-compatible input (structural — no Nuxt runtime import). */\nexport interface OpinlyHead {\n title: string;\n meta: { name?: string; property?: string; content: string }[];\n script?: { type: string; innerHTML: string }[];\n}\n\nconst metaTags = (m: OpinlyMeta): OpinlyHead[\"meta\"] => {\n const tags: OpinlyHead[\"meta\"] = [];\n if (m.description) tags.push({ name: \"description\", content: m.description });\n tags.push({ property: \"og:title\", content: m.title });\n if (m.description) tags.push({ property: \"og:description\", content: m.description });\n if (m.ogType) tags.push({ property: \"og:type\", content: m.ogType });\n if (m.ogImage) tags.push({ property: \"og:image\", content: m.ogImage });\n if (m.canonicalUrl) tags.push({ property: \"og:url\", content: m.canonicalUrl });\n return tags;\n};\n\n/**\n * Build a Nuxt `useHead()` input from a resolved blog route. Title + OG tags come\n * from @opinly/shared's `buildMetadata`; pass JSON-LD objects (built with\n * @opinly/shared's `buildBlogPostingJsonLd` etc.) via `jsonLd` to emit ld+json scripts.\n *\n * @example useHead(opinlyHead({ resolved, config, jsonLd: [buildBlogPostingJsonLd(...)] }))\n */\nexport function opinlyHead(args: {\n resolved: SeoResolved;\n config: OpinlyConfig;\n jsonLd?: object[];\n}): OpinlyHead {\n const m = buildMetadata(args.resolved, args.config);\n return {\n title: m.title,\n meta: metaTags(m),\n ...(args.jsonLd?.length\n ? {\n script: args.jsonLd.map((d) => ({\n type: \"application/ld+json\",\n innerHTML: JSON.stringify(d),\n })),\n }\n : {}),\n };\n}\n\nexport {\n buildMetadata,\n buildBlogPostingJsonLd,\n buildFaqJsonLd,\n buildBreadcrumbJsonLd,\n buildPersonJsonLd,\n buildCollectionJsonLd,\n} from \"@opinly/shared\";\nexport type { OpinlyConfig, OpinlyMeta, SeoResolved } from \"@opinly/shared\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKO;AA+CP,IAAAA,iBAOO;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/pixel.ts"],"sourcesContent":["import {\n buildMetadata,\n type OpinlyConfig,\n type OpinlyMeta,\n type SeoResolved,\n} from \"@opinly/shared\";\n\n/** A Nuxt `useHead()`-compatible input (structural — no Nuxt runtime import). */\nexport interface OpinlyHead {\n title: string;\n meta: { name?: string; property?: string; content: string }[];\n script?: { type: string; innerHTML: string }[];\n}\n\nconst metaTags = (m: OpinlyMeta): OpinlyHead[\"meta\"] => {\n const tags: OpinlyHead[\"meta\"] = [];\n if (m.description) tags.push({ name: \"description\", content: m.description });\n tags.push({ property: \"og:title\", content: m.title });\n if (m.description) tags.push({ property: \"og:description\", content: m.description });\n if (m.ogType) tags.push({ property: \"og:type\", content: m.ogType });\n if (m.ogImage) tags.push({ property: \"og:image\", content: m.ogImage });\n if (m.canonicalUrl) tags.push({ property: \"og:url\", content: m.canonicalUrl });\n return tags;\n};\n\n/**\n * Build a Nuxt `useHead()` input from a resolved blog route. Title + OG tags come\n * from @opinly/shared's `buildMetadata`; pass JSON-LD objects (built with\n * @opinly/shared's `buildBlogPostingJsonLd` etc.) via `jsonLd` to emit ld+json scripts.\n *\n * @example useHead(opinlyHead({ resolved, config, jsonLd: [buildBlogPostingJsonLd(...)] }))\n */\nexport function opinlyHead(args: {\n resolved: SeoResolved;\n config: OpinlyConfig;\n jsonLd?: object[];\n}): OpinlyHead {\n const m = buildMetadata(args.resolved, args.config);\n return {\n title: m.title,\n meta: metaTags(m),\n ...(args.jsonLd?.length\n ? {\n script: args.jsonLd.map((d) => ({\n type: \"application/ld+json\",\n innerHTML: JSON.stringify(d),\n })),\n }\n : {}),\n };\n}\n\nexport {\n buildMetadata,\n buildBlogPostingJsonLd,\n buildFaqJsonLd,\n buildBreadcrumbJsonLd,\n buildPersonJsonLd,\n buildCollectionJsonLd,\n} from \"@opinly/shared\";\nexport type { OpinlyConfig, OpinlyMeta, SeoResolved } from \"@opinly/shared\";\nexport * from \"./pixel\";\n","import {\n loadOpinlyPixel,\n getOpinlyPixel,\n type Opinly,\n type OpinlyPixelConfig,\n} from \"@opinly/shared/pixel\";\n\nexport type { Opinly, OpinlyPixelConfig } from \"@opinly/shared/pixel\";\n\nexport function useOpinlyPixel(config: OpinlyPixelConfig): Opinly {\n return loadOpinlyPixel(config);\n}\n\nexport function useOpinly(): Opinly {\n return getOpinlyPixel();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKO;AA+CP,IAAAA,iBAOO;;;AC3DP,mBAKO;AAIA,SAAS,eAAe,QAAmC;AAChE,aAAO,8BAAgB,MAAM;AAC/B;AAEO,SAAS,YAAoB;AAClC,aAAO,6BAAe;AACxB;;;ADDA,IAAM,WAAW,CAAC,MAAsC;AACtD,QAAM,OAA2B,CAAC;AAClC,MAAI,EAAE,YAAa,MAAK,KAAK,EAAE,MAAM,eAAe,SAAS,EAAE,YAAY,CAAC;AAC5E,OAAK,KAAK,EAAE,UAAU,YAAY,SAAS,EAAE,MAAM,CAAC;AACpD,MAAI,EAAE,YAAa,MAAK,KAAK,EAAE,UAAU,kBAAkB,SAAS,EAAE,YAAY,CAAC;AACnF,MAAI,EAAE,OAAQ,MAAK,KAAK,EAAE,UAAU,WAAW,SAAS,EAAE,OAAO,CAAC;AAClE,MAAI,EAAE,QAAS,MAAK,KAAK,EAAE,UAAU,YAAY,SAAS,EAAE,QAAQ,CAAC;AACrE,MAAI,EAAE,aAAc,MAAK,KAAK,EAAE,UAAU,UAAU,SAAS,EAAE,aAAa,CAAC;AAC7E,SAAO;AACT;AASO,SAAS,WAAW,MAIZ;AACb,QAAM,QAAI,6BAAc,KAAK,UAAU,KAAK,MAAM;AAClD,SAAO;AAAA,IACL,OAAO,EAAE;AAAA,IACT,MAAM,SAAS,CAAC;AAAA,IAChB,GAAI,KAAK,QAAQ,SACb;AAAA,MACE,QAAQ,KAAK,OAAO,IAAI,CAAC,OAAO;AAAA,QAC9B,MAAM;AAAA,QACN,WAAW,KAAK,UAAU,CAAC;AAAA,MAC7B,EAAE;AAAA,IACJ,IACA,CAAC;AAAA,EACP;AACF;","names":["import_shared"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { SeoResolved, OpinlyConfig } from '@opinly/shared';
|
|
2
2
|
export { OpinlyConfig, OpinlyMeta, SeoResolved, buildBlogPostingJsonLd, buildBreadcrumbJsonLd, buildCollectionJsonLd, buildFaqJsonLd, buildMetadata, buildPersonJsonLd } from '@opinly/shared';
|
|
3
|
+
import { OpinlyPixelConfig, Opinly } from '@opinly/shared/pixel';
|
|
4
|
+
export { Opinly, OpinlyPixelConfig } from '@opinly/shared/pixel';
|
|
5
|
+
|
|
6
|
+
declare function useOpinlyPixel(config: OpinlyPixelConfig): Opinly;
|
|
7
|
+
declare function useOpinly(): Opinly;
|
|
3
8
|
|
|
4
9
|
/** A Nuxt `useHead()`-compatible input (structural — no Nuxt runtime import). */
|
|
5
10
|
interface OpinlyHead {
|
|
@@ -27,4 +32,4 @@ declare function opinlyHead(args: {
|
|
|
27
32
|
jsonLd?: object[];
|
|
28
33
|
}): OpinlyHead;
|
|
29
34
|
|
|
30
|
-
export { type OpinlyHead, opinlyHead };
|
|
35
|
+
export { type OpinlyHead, opinlyHead, useOpinly, useOpinlyPixel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { SeoResolved, OpinlyConfig } from '@opinly/shared';
|
|
2
2
|
export { OpinlyConfig, OpinlyMeta, SeoResolved, buildBlogPostingJsonLd, buildBreadcrumbJsonLd, buildCollectionJsonLd, buildFaqJsonLd, buildMetadata, buildPersonJsonLd } from '@opinly/shared';
|
|
3
|
+
import { OpinlyPixelConfig, Opinly } from '@opinly/shared/pixel';
|
|
4
|
+
export { Opinly, OpinlyPixelConfig } from '@opinly/shared/pixel';
|
|
5
|
+
|
|
6
|
+
declare function useOpinlyPixel(config: OpinlyPixelConfig): Opinly;
|
|
7
|
+
declare function useOpinly(): Opinly;
|
|
3
8
|
|
|
4
9
|
/** A Nuxt `useHead()`-compatible input (structural — no Nuxt runtime import). */
|
|
5
10
|
interface OpinlyHead {
|
|
@@ -27,4 +32,4 @@ declare function opinlyHead(args: {
|
|
|
27
32
|
jsonLd?: object[];
|
|
28
33
|
}): OpinlyHead;
|
|
29
34
|
|
|
30
|
-
export { type OpinlyHead, opinlyHead };
|
|
35
|
+
export { type OpinlyHead, opinlyHead, useOpinly, useOpinlyPixel };
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,20 @@ import {
|
|
|
10
10
|
buildPersonJsonLd,
|
|
11
11
|
buildCollectionJsonLd
|
|
12
12
|
} from "@opinly/shared";
|
|
13
|
+
|
|
14
|
+
// src/pixel.ts
|
|
15
|
+
import {
|
|
16
|
+
loadOpinlyPixel,
|
|
17
|
+
getOpinlyPixel
|
|
18
|
+
} from "@opinly/shared/pixel";
|
|
19
|
+
function useOpinlyPixel(config) {
|
|
20
|
+
return loadOpinlyPixel(config);
|
|
21
|
+
}
|
|
22
|
+
function useOpinly() {
|
|
23
|
+
return getOpinlyPixel();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/index.ts
|
|
13
27
|
var metaTags = (m) => {
|
|
14
28
|
const tags = [];
|
|
15
29
|
if (m.description) tags.push({ name: "description", content: m.description });
|
|
@@ -40,6 +54,8 @@ export {
|
|
|
40
54
|
buildFaqJsonLd,
|
|
41
55
|
buildMetadata2 as buildMetadata,
|
|
42
56
|
buildPersonJsonLd,
|
|
43
|
-
opinlyHead
|
|
57
|
+
opinlyHead,
|
|
58
|
+
useOpinly,
|
|
59
|
+
useOpinlyPixel
|
|
44
60
|
};
|
|
45
61
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n buildMetadata,\n type OpinlyConfig,\n type OpinlyMeta,\n type SeoResolved,\n} from \"@opinly/shared\";\n\n/** A Nuxt `useHead()`-compatible input (structural — no Nuxt runtime import). */\nexport interface OpinlyHead {\n title: string;\n meta: { name?: string; property?: string; content: string }[];\n script?: { type: string; innerHTML: string }[];\n}\n\nconst metaTags = (m: OpinlyMeta): OpinlyHead[\"meta\"] => {\n const tags: OpinlyHead[\"meta\"] = [];\n if (m.description) tags.push({ name: \"description\", content: m.description });\n tags.push({ property: \"og:title\", content: m.title });\n if (m.description) tags.push({ property: \"og:description\", content: m.description });\n if (m.ogType) tags.push({ property: \"og:type\", content: m.ogType });\n if (m.ogImage) tags.push({ property: \"og:image\", content: m.ogImage });\n if (m.canonicalUrl) tags.push({ property: \"og:url\", content: m.canonicalUrl });\n return tags;\n};\n\n/**\n * Build a Nuxt `useHead()` input from a resolved blog route. Title + OG tags come\n * from @opinly/shared's `buildMetadata`; pass JSON-LD objects (built with\n * @opinly/shared's `buildBlogPostingJsonLd` etc.) via `jsonLd` to emit ld+json scripts.\n *\n * @example useHead(opinlyHead({ resolved, config, jsonLd: [buildBlogPostingJsonLd(...)] }))\n */\nexport function opinlyHead(args: {\n resolved: SeoResolved;\n config: OpinlyConfig;\n jsonLd?: object[];\n}): OpinlyHead {\n const m = buildMetadata(args.resolved, args.config);\n return {\n title: m.title,\n meta: metaTags(m),\n ...(args.jsonLd?.length\n ? {\n script: args.jsonLd.map((d) => ({\n type: \"application/ld+json\",\n innerHTML: JSON.stringify(d),\n })),\n }\n : {}),\n };\n}\n\nexport {\n buildMetadata,\n buildBlogPostingJsonLd,\n buildFaqJsonLd,\n buildBreadcrumbJsonLd,\n buildPersonJsonLd,\n buildCollectionJsonLd,\n} from \"@opinly/shared\";\nexport type { OpinlyConfig, OpinlyMeta, SeoResolved } from \"@opinly/shared\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAIK;AA+CP;AAAA,EACE,iBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/pixel.ts"],"sourcesContent":["import {\n buildMetadata,\n type OpinlyConfig,\n type OpinlyMeta,\n type SeoResolved,\n} from \"@opinly/shared\";\n\n/** A Nuxt `useHead()`-compatible input (structural — no Nuxt runtime import). */\nexport interface OpinlyHead {\n title: string;\n meta: { name?: string; property?: string; content: string }[];\n script?: { type: string; innerHTML: string }[];\n}\n\nconst metaTags = (m: OpinlyMeta): OpinlyHead[\"meta\"] => {\n const tags: OpinlyHead[\"meta\"] = [];\n if (m.description) tags.push({ name: \"description\", content: m.description });\n tags.push({ property: \"og:title\", content: m.title });\n if (m.description) tags.push({ property: \"og:description\", content: m.description });\n if (m.ogType) tags.push({ property: \"og:type\", content: m.ogType });\n if (m.ogImage) tags.push({ property: \"og:image\", content: m.ogImage });\n if (m.canonicalUrl) tags.push({ property: \"og:url\", content: m.canonicalUrl });\n return tags;\n};\n\n/**\n * Build a Nuxt `useHead()` input from a resolved blog route. Title + OG tags come\n * from @opinly/shared's `buildMetadata`; pass JSON-LD objects (built with\n * @opinly/shared's `buildBlogPostingJsonLd` etc.) via `jsonLd` to emit ld+json scripts.\n *\n * @example useHead(opinlyHead({ resolved, config, jsonLd: [buildBlogPostingJsonLd(...)] }))\n */\nexport function opinlyHead(args: {\n resolved: SeoResolved;\n config: OpinlyConfig;\n jsonLd?: object[];\n}): OpinlyHead {\n const m = buildMetadata(args.resolved, args.config);\n return {\n title: m.title,\n meta: metaTags(m),\n ...(args.jsonLd?.length\n ? {\n script: args.jsonLd.map((d) => ({\n type: \"application/ld+json\",\n innerHTML: JSON.stringify(d),\n })),\n }\n : {}),\n };\n}\n\nexport {\n buildMetadata,\n buildBlogPostingJsonLd,\n buildFaqJsonLd,\n buildBreadcrumbJsonLd,\n buildPersonJsonLd,\n buildCollectionJsonLd,\n} from \"@opinly/shared\";\nexport type { OpinlyConfig, OpinlyMeta, SeoResolved } from \"@opinly/shared\";\nexport * from \"./pixel\";\n","import {\n loadOpinlyPixel,\n getOpinlyPixel,\n type Opinly,\n type OpinlyPixelConfig,\n} from \"@opinly/shared/pixel\";\n\nexport type { Opinly, OpinlyPixelConfig } from \"@opinly/shared/pixel\";\n\nexport function useOpinlyPixel(config: OpinlyPixelConfig): Opinly {\n return loadOpinlyPixel(config);\n}\n\nexport function useOpinly(): Opinly {\n return getOpinlyPixel();\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAIK;AA+CP;AAAA,EACE,iBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;AC3DP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAIA,SAAS,eAAe,QAAmC;AAChE,SAAO,gBAAgB,MAAM;AAC/B;AAEO,SAAS,YAAoB;AAClC,SAAO,eAAe;AACxB;;;ADDA,IAAM,WAAW,CAAC,MAAsC;AACtD,QAAM,OAA2B,CAAC;AAClC,MAAI,EAAE,YAAa,MAAK,KAAK,EAAE,MAAM,eAAe,SAAS,EAAE,YAAY,CAAC;AAC5E,OAAK,KAAK,EAAE,UAAU,YAAY,SAAS,EAAE,MAAM,CAAC;AACpD,MAAI,EAAE,YAAa,MAAK,KAAK,EAAE,UAAU,kBAAkB,SAAS,EAAE,YAAY,CAAC;AACnF,MAAI,EAAE,OAAQ,MAAK,KAAK,EAAE,UAAU,WAAW,SAAS,EAAE,OAAO,CAAC;AAClE,MAAI,EAAE,QAAS,MAAK,KAAK,EAAE,UAAU,YAAY,SAAS,EAAE,QAAQ,CAAC;AACrE,MAAI,EAAE,aAAc,MAAK,KAAK,EAAE,UAAU,UAAU,SAAS,EAAE,aAAa,CAAC;AAC7E,SAAO;AACT;AASO,SAAS,WAAW,MAIZ;AACb,QAAM,IAAI,cAAc,KAAK,UAAU,KAAK,MAAM;AAClD,SAAO;AAAA,IACL,OAAO,EAAE;AAAA,IACT,MAAM,SAAS,CAAC;AAAA,IAChB,GAAI,KAAK,QAAQ,SACb;AAAA,MACE,QAAQ,KAAK,OAAO,IAAI,CAAC,OAAO;AAAA,QAC9B,MAAM;AAAA,QACN,WAAW,KAAK,UAAU,CAAC;AAAA,MAC7B,EAAE;AAAA,IACJ,IACA,CAAC;AAAA,EACP;AACF;","names":["buildMetadata"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opinly/nuxt",
|
|
3
3
|
"description": "Nuxt SEO helpers for Opinly content — useHead() input from resolved content.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.cjs",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@opinly/shared": "1.
|
|
18
|
+
"@opinly/shared": "1.3.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"tsup": "^8.5.0",
|