@unhead/schema-org 1.11.15 → 2.0.0-alpha.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 +2 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +4 -6
- package/dist/shared/{schema-org.CwD-TP0q.mjs → schema-org.79PF9OEn.mjs} +4 -4
- package/dist/shared/{schema-org.B_EoSq_p.cjs → schema-org.D-L8HzUn.cjs} +4 -4
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.mjs +2 -2
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const plugin = require('./shared/schema-org.
|
|
3
|
+
const plugin = require('./shared/schema-org.D-L8HzUn.cjs');
|
|
4
4
|
const unhead = require('unhead');
|
|
5
5
|
require('@unhead/shared');
|
|
6
6
|
require('defu');
|
|
@@ -119,9 +119,7 @@ function defineBookEdition(input) {
|
|
|
119
119
|
return provideResolver(input, "bookEdition");
|
|
120
120
|
}
|
|
121
121
|
function useSchemaOrg(input, options) {
|
|
122
|
-
const head = unhead.
|
|
123
|
-
if (!head)
|
|
124
|
-
return;
|
|
122
|
+
const head = options?.head || unhead.useUnhead();
|
|
125
123
|
if (Array.isArray(input) && input.length === 0 || !input) {
|
|
126
124
|
return;
|
|
127
125
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -70,10 +70,10 @@ declare function defineReadAction<T extends Record<string, any>>(input?: ReadAct
|
|
|
70
70
|
declare function defineSoftwareApp<T extends Record<string, any>>(input?: SoftwareApp & T): SoftwareApp & T;
|
|
71
71
|
declare function defineBookEdition<T extends Record<string, any>>(input?: BookEdition & T): BookEdition & T;
|
|
72
72
|
type UseSchemaOrgInput = Arrayable<Thing | Record<string, any>>;
|
|
73
|
-
declare function useSchemaOrg(input: UseSchemaOrgInput, options?:
|
|
73
|
+
declare function useSchemaOrg(input: UseSchemaOrgInput, options?: HeadEntryOptions): _unhead_schema.ActiveHeadEntry<unhead.UseHeadInput<{
|
|
74
74
|
script: {
|
|
75
75
|
nodes: UseSchemaOrgInput;
|
|
76
76
|
};
|
|
77
|
-
}
|
|
77
|
+
}>> | undefined;
|
|
78
78
|
|
|
79
79
|
export { AggregateOffer, AggregateRating, Arrayable, Article, Book, BookEdition, BreadcrumbList, Comment, Course, Event, FoodEstablishment, HowTo, HowToStep, ImageObject, ItemList, JobPosting, ListItem, LocalBusiness, MetaInput, Movie, Offer, OpeningHoursSpecification, Organization, Person, Place, PostalAddress, Product, Question, ReadAction, Recipe, ResolvedMeta, Review, SchemaOrgGraph, SchemaOrgNode, SchemaOrgNodeDefinition, SearchAction, SoftwareApp, Thing, type UseSchemaOrgInput, VideoObject, VirtualLocation, WebPage, WebSite, dedupeNodes, defineAddress, defineAggregateOffer, defineAggregateRating, defineArticle, defineBook, defineBookEdition, defineBreadcrumb, defineComment, defineCourse, defineEvent, defineFoodEstablishment, defineHowTo, defineHowToStep, defineImage, defineItemList, defineJobPosting, defineListItem, defineLocalBusiness, defineMovie, defineOffer, defineOpeningHours, defineOrganization, definePerson, definePlace, defineProduct, defineQuestion, defineReadAction, defineRecipe, defineReview, defineSchemaOrgResolver, defineSearchAction, defineSoftwareApp, defineVideo, defineVirtualLocation, defineWebPage, defineWebSite, normaliseNodes, resolveMeta, resolveNode, resolveNodeId, resolveRelation, useSchemaOrg };
|
package/dist/index.d.mts
CHANGED
|
@@ -70,10 +70,10 @@ declare function defineReadAction<T extends Record<string, any>>(input?: ReadAct
|
|
|
70
70
|
declare function defineSoftwareApp<T extends Record<string, any>>(input?: SoftwareApp & T): SoftwareApp & T;
|
|
71
71
|
declare function defineBookEdition<T extends Record<string, any>>(input?: BookEdition & T): BookEdition & T;
|
|
72
72
|
type UseSchemaOrgInput = Arrayable<Thing | Record<string, any>>;
|
|
73
|
-
declare function useSchemaOrg(input: UseSchemaOrgInput, options?:
|
|
73
|
+
declare function useSchemaOrg(input: UseSchemaOrgInput, options?: HeadEntryOptions): _unhead_schema.ActiveHeadEntry<unhead.UseHeadInput<{
|
|
74
74
|
script: {
|
|
75
75
|
nodes: UseSchemaOrgInput;
|
|
76
76
|
};
|
|
77
|
-
}
|
|
77
|
+
}>> | undefined;
|
|
78
78
|
|
|
79
79
|
export { AggregateOffer, AggregateRating, Arrayable, Article, Book, BookEdition, BreadcrumbList, Comment, Course, Event, FoodEstablishment, HowTo, HowToStep, ImageObject, ItemList, JobPosting, ListItem, LocalBusiness, MetaInput, Movie, Offer, OpeningHoursSpecification, Organization, Person, Place, PostalAddress, Product, Question, ReadAction, Recipe, ResolvedMeta, Review, SchemaOrgGraph, SchemaOrgNode, SchemaOrgNodeDefinition, SearchAction, SoftwareApp, Thing, type UseSchemaOrgInput, VideoObject, VirtualLocation, WebPage, WebSite, dedupeNodes, defineAddress, defineAggregateOffer, defineAggregateRating, defineArticle, defineBook, defineBookEdition, defineBreadcrumb, defineComment, defineCourse, defineEvent, defineFoodEstablishment, defineHowTo, defineHowToStep, defineImage, defineItemList, defineJobPosting, defineListItem, defineLocalBusiness, defineMovie, defineOffer, defineOpeningHours, defineOrganization, definePerson, definePlace, defineProduct, defineQuestion, defineReadAction, defineRecipe, defineReview, defineSchemaOrgResolver, defineSearchAction, defineSoftwareApp, defineVideo, defineVirtualLocation, defineWebPage, defineWebSite, normaliseNodes, resolveMeta, resolveNode, resolveNodeId, resolveRelation, useSchemaOrg };
|
package/dist/index.d.ts
CHANGED
|
@@ -70,10 +70,10 @@ declare function defineReadAction<T extends Record<string, any>>(input?: ReadAct
|
|
|
70
70
|
declare function defineSoftwareApp<T extends Record<string, any>>(input?: SoftwareApp & T): SoftwareApp & T;
|
|
71
71
|
declare function defineBookEdition<T extends Record<string, any>>(input?: BookEdition & T): BookEdition & T;
|
|
72
72
|
type UseSchemaOrgInput = Arrayable<Thing | Record<string, any>>;
|
|
73
|
-
declare function useSchemaOrg(input: UseSchemaOrgInput, options?:
|
|
73
|
+
declare function useSchemaOrg(input: UseSchemaOrgInput, options?: HeadEntryOptions): _unhead_schema.ActiveHeadEntry<unhead.UseHeadInput<{
|
|
74
74
|
script: {
|
|
75
75
|
nodes: UseSchemaOrgInput;
|
|
76
76
|
};
|
|
77
|
-
}
|
|
77
|
+
}>> | undefined;
|
|
78
78
|
|
|
79
79
|
export { AggregateOffer, AggregateRating, Arrayable, Article, Book, BookEdition, BreadcrumbList, Comment, Course, Event, FoodEstablishment, HowTo, HowToStep, ImageObject, ItemList, JobPosting, ListItem, LocalBusiness, MetaInput, Movie, Offer, OpeningHoursSpecification, Organization, Person, Place, PostalAddress, Product, Question, ReadAction, Recipe, ResolvedMeta, Review, SchemaOrgGraph, SchemaOrgNode, SchemaOrgNodeDefinition, SearchAction, SoftwareApp, Thing, type UseSchemaOrgInput, VideoObject, VirtualLocation, WebPage, WebSite, dedupeNodes, defineAddress, defineAggregateOffer, defineAggregateRating, defineArticle, defineBook, defineBookEdition, defineBreadcrumb, defineComment, defineCourse, defineEvent, defineFoodEstablishment, defineHowTo, defineHowToStep, defineImage, defineItemList, defineJobPosting, defineListItem, defineLocalBusiness, defineMovie, defineOffer, defineOpeningHours, defineOrganization, definePerson, definePlace, defineProduct, defineQuestion, defineReadAction, defineRecipe, defineReview, defineSchemaOrgResolver, defineSearchAction, defineSoftwareApp, defineVideo, defineVirtualLocation, defineWebPage, defineWebSite, normaliseNodes, resolveMeta, resolveNode, resolveNodeId, resolveRelation, useSchemaOrg };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { U as UnheadSchemaOrg } from './shared/schema-org.
|
|
2
|
-
export { H as HowToId, a1 as PluginSchemaOrg, P as PrimaryArticleId, k as PrimaryBookId, m as PrimaryBreadcrumbId, s as PrimaryEventId, X as PrimaryWebPageId, _ as PrimaryWebSiteId, M as ProductId, R as RecipeId, a2 as SchemaOrgUnheadPlugin, L as addressResolver, g as aggregateOfferResolver, h as aggregateRatingResolver, i as articleResolver, j as bookEditionResolver, l as bookResolver, o as breadcrumbResolver, p as commentResolver, q as courseResolver, c as createSchemaOrgGraph, f as dedupeNodes, d as defineSchemaOrgResolver, t as eventResolver, w as foodEstablishmentResolver, x as howToResolver, z as howToStepDirectionResolver, y as howToStepResolver, A as imageResolver, B as itemListResolver, C as jobPostingResolver, D as listItemResolver, E as localBusinessResolver, F as movieResolver, n as normaliseNodes, G as offerResolver, I as openingHoursResolver, J as organizationResolver, K as personResolver, u as placeResolver, N as productResolver, O as questionResolver, Q as ratingResolver, Z as readActionResolver, S as recipeResolver, r as resolveMeta, a as resolveNode, b as resolveNodeId, e as resolveRelation, T as reviewResolver, a0 as searchActionResolver, V as softwareAppResolver, W as videoResolver, v as virtualLocationResolver, Y as webPageResolver, $ as webSiteResolver } from './shared/schema-org.
|
|
3
|
-
import {
|
|
1
|
+
import { U as UnheadSchemaOrg } from './shared/schema-org.79PF9OEn.mjs';
|
|
2
|
+
export { H as HowToId, a1 as PluginSchemaOrg, P as PrimaryArticleId, k as PrimaryBookId, m as PrimaryBreadcrumbId, s as PrimaryEventId, X as PrimaryWebPageId, _ as PrimaryWebSiteId, M as ProductId, R as RecipeId, a2 as SchemaOrgUnheadPlugin, L as addressResolver, g as aggregateOfferResolver, h as aggregateRatingResolver, i as articleResolver, j as bookEditionResolver, l as bookResolver, o as breadcrumbResolver, p as commentResolver, q as courseResolver, c as createSchemaOrgGraph, f as dedupeNodes, d as defineSchemaOrgResolver, t as eventResolver, w as foodEstablishmentResolver, x as howToResolver, z as howToStepDirectionResolver, y as howToStepResolver, A as imageResolver, B as itemListResolver, C as jobPostingResolver, D as listItemResolver, E as localBusinessResolver, F as movieResolver, n as normaliseNodes, G as offerResolver, I as openingHoursResolver, J as organizationResolver, K as personResolver, u as placeResolver, N as productResolver, O as questionResolver, Q as ratingResolver, Z as readActionResolver, S as recipeResolver, r as resolveMeta, a as resolveNode, b as resolveNodeId, e as resolveRelation, T as reviewResolver, a0 as searchActionResolver, V as softwareAppResolver, W as videoResolver, v as virtualLocationResolver, Y as webPageResolver, $ as webSiteResolver } from './shared/schema-org.79PF9OEn.mjs';
|
|
3
|
+
import { useUnhead, useHead } from 'unhead';
|
|
4
4
|
import '@unhead/shared';
|
|
5
5
|
import 'defu';
|
|
6
6
|
import 'ufo';
|
|
@@ -118,9 +118,7 @@ function defineBookEdition(input) {
|
|
|
118
118
|
return provideResolver(input, "bookEdition");
|
|
119
119
|
}
|
|
120
120
|
function useSchemaOrg(input, options) {
|
|
121
|
-
const head =
|
|
122
|
-
if (!head)
|
|
123
|
-
return;
|
|
121
|
+
const head = options?.head || useUnhead();
|
|
124
122
|
if (Array.isArray(input) && input.length === 0 || !input) {
|
|
125
123
|
return;
|
|
126
124
|
}
|
|
@@ -16,7 +16,7 @@ function resolvableDateToDate(val) {
|
|
|
16
16
|
try {
|
|
17
17
|
const date = val instanceof Date ? val : new Date(Date.parse(val));
|
|
18
18
|
return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
|
|
19
|
-
} catch
|
|
19
|
+
} catch {
|
|
20
20
|
}
|
|
21
21
|
return typeof val === "string" ? val : val.toString();
|
|
22
22
|
}
|
|
@@ -39,7 +39,7 @@ function resolvableDateToIso(val) {
|
|
|
39
39
|
return val;
|
|
40
40
|
else
|
|
41
41
|
return new Date(Date.parse(val)).toISOString();
|
|
42
|
-
} catch
|
|
42
|
+
} catch {
|
|
43
43
|
}
|
|
44
44
|
return typeof val === "string" ? val : val.toString();
|
|
45
45
|
}
|
|
@@ -103,7 +103,7 @@ function stripEmptyProperties(obj) {
|
|
|
103
103
|
stripEmptyProperties(obj[k]);
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (obj[k] === "" || obj[k] === null || obj[k] ===
|
|
106
|
+
if (obj[k] === "" || obj[k] === null || obj[k] === undefined)
|
|
107
107
|
delete obj[k];
|
|
108
108
|
}
|
|
109
109
|
return obj;
|
|
@@ -1262,7 +1262,7 @@ function resolveNodeId(node, ctx, resolver, resolveAsRoot = false) {
|
|
|
1262
1262
|
if (node["@id"] && node["@id"].startsWith("http"))
|
|
1263
1263
|
return node;
|
|
1264
1264
|
const prefix = resolver ? (Array.isArray(resolver.idPrefix) ? resolver.idPrefix[0] : resolver.idPrefix) || "url" : "url";
|
|
1265
|
-
const rootId = node["@id"] || (resolver ? Array.isArray(resolver.idPrefix) ? resolver.idPrefix?.[1] :
|
|
1265
|
+
const rootId = node["@id"] || (resolver ? Array.isArray(resolver.idPrefix) ? resolver.idPrefix?.[1] : undefined : "");
|
|
1266
1266
|
if (!node["@id"] && resolveAsRoot && rootId) {
|
|
1267
1267
|
node["@id"] = prefixId(ctx.meta[prefix], rootId);
|
|
1268
1268
|
return node;
|
|
@@ -18,7 +18,7 @@ function resolvableDateToDate(val) {
|
|
|
18
18
|
try {
|
|
19
19
|
const date = val instanceof Date ? val : new Date(Date.parse(val));
|
|
20
20
|
return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
|
|
21
|
-
} catch
|
|
21
|
+
} catch {
|
|
22
22
|
}
|
|
23
23
|
return typeof val === "string" ? val : val.toString();
|
|
24
24
|
}
|
|
@@ -41,7 +41,7 @@ function resolvableDateToIso(val) {
|
|
|
41
41
|
return val;
|
|
42
42
|
else
|
|
43
43
|
return new Date(Date.parse(val)).toISOString();
|
|
44
|
-
} catch
|
|
44
|
+
} catch {
|
|
45
45
|
}
|
|
46
46
|
return typeof val === "string" ? val : val.toString();
|
|
47
47
|
}
|
|
@@ -105,7 +105,7 @@ function stripEmptyProperties(obj) {
|
|
|
105
105
|
stripEmptyProperties(obj[k]);
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
-
if (obj[k] === "" || obj[k] === null || obj[k] ===
|
|
108
|
+
if (obj[k] === "" || obj[k] === null || obj[k] === undefined)
|
|
109
109
|
delete obj[k];
|
|
110
110
|
}
|
|
111
111
|
return obj;
|
|
@@ -1264,7 +1264,7 @@ function resolveNodeId(node, ctx, resolver, resolveAsRoot = false) {
|
|
|
1264
1264
|
if (node["@id"] && node["@id"].startsWith("http"))
|
|
1265
1265
|
return node;
|
|
1266
1266
|
const prefix = resolver ? (Array.isArray(resolver.idPrefix) ? resolver.idPrefix[0] : resolver.idPrefix) || "url" : "url";
|
|
1267
|
-
const rootId = node["@id"] || (resolver ? Array.isArray(resolver.idPrefix) ? resolver.idPrefix?.[1] :
|
|
1267
|
+
const rootId = node["@id"] || (resolver ? Array.isArray(resolver.idPrefix) ? resolver.idPrefix?.[1] : undefined : "");
|
|
1268
1268
|
if (!node["@id"] && resolveAsRoot && rootId) {
|
|
1269
1269
|
node["@id"] = prefixId(ctx.meta[prefix], rootId);
|
|
1270
1270
|
return node;
|
package/dist/vue.cjs
CHANGED
package/dist/vue.d.cts
CHANGED
|
@@ -86,7 +86,7 @@ declare function defineReadAction<T extends Record<string, any>>(input?: DeepMay
|
|
|
86
86
|
declare function defineSoftwareApp<T extends Record<string, any>>(input?: DeepMaybeRef<SoftwareApp & T>): DeepMaybeRef<SoftwareApp & T>;
|
|
87
87
|
declare function defineBookEdition<T extends Record<string, any>>(input?: DeepMaybeRef<BookEdition & T>): DeepMaybeRef<BookEdition & T>;
|
|
88
88
|
type UseSchemaOrgInput = Arrayable<DeepMaybeRef<Thing | Record<string, any>>>;
|
|
89
|
-
declare function useSchemaOrg(input: UseSchemaOrgInput):
|
|
89
|
+
declare function useSchemaOrg(input: UseSchemaOrgInput): _unhead_vue.ActiveHeadEntry<_unhead_vue.UseHeadInput<{
|
|
90
90
|
script: {
|
|
91
91
|
nodes: UseSchemaOrgInput;
|
|
92
92
|
};
|
package/dist/vue.d.mts
CHANGED
|
@@ -86,7 +86,7 @@ declare function defineReadAction<T extends Record<string, any>>(input?: DeepMay
|
|
|
86
86
|
declare function defineSoftwareApp<T extends Record<string, any>>(input?: DeepMaybeRef<SoftwareApp & T>): DeepMaybeRef<SoftwareApp & T>;
|
|
87
87
|
declare function defineBookEdition<T extends Record<string, any>>(input?: DeepMaybeRef<BookEdition & T>): DeepMaybeRef<BookEdition & T>;
|
|
88
88
|
type UseSchemaOrgInput = Arrayable<DeepMaybeRef<Thing | Record<string, any>>>;
|
|
89
|
-
declare function useSchemaOrg(input: UseSchemaOrgInput):
|
|
89
|
+
declare function useSchemaOrg(input: UseSchemaOrgInput): _unhead_vue.ActiveHeadEntry<_unhead_vue.UseHeadInput<{
|
|
90
90
|
script: {
|
|
91
91
|
nodes: UseSchemaOrgInput;
|
|
92
92
|
};
|
package/dist/vue.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare function defineReadAction<T extends Record<string, any>>(input?: DeepMay
|
|
|
86
86
|
declare function defineSoftwareApp<T extends Record<string, any>>(input?: DeepMaybeRef<SoftwareApp & T>): DeepMaybeRef<SoftwareApp & T>;
|
|
87
87
|
declare function defineBookEdition<T extends Record<string, any>>(input?: DeepMaybeRef<BookEdition & T>): DeepMaybeRef<BookEdition & T>;
|
|
88
88
|
type UseSchemaOrgInput = Arrayable<DeepMaybeRef<Thing | Record<string, any>>>;
|
|
89
|
-
declare function useSchemaOrg(input: UseSchemaOrgInput):
|
|
89
|
+
declare function useSchemaOrg(input: UseSchemaOrgInput): _unhead_vue.ActiveHeadEntry<_unhead_vue.UseHeadInput<{
|
|
90
90
|
script: {
|
|
91
91
|
nodes: UseSchemaOrgInput;
|
|
92
92
|
};
|
package/dist/vue.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as UnheadSchemaOrg } from './shared/schema-org.
|
|
2
|
-
export { a1 as PluginSchemaOrg, a2 as SchemaOrgUnheadPlugin } from './shared/schema-org.
|
|
1
|
+
import { U as UnheadSchemaOrg } from './shared/schema-org.79PF9OEn.mjs';
|
|
2
|
+
export { a1 as PluginSchemaOrg, a2 as SchemaOrgUnheadPlugin } from './shared/schema-org.79PF9OEn.mjs';
|
|
3
3
|
import { defineComponent, ref, computed, unref, h } from 'vue';
|
|
4
4
|
import { injectHead, useHead } from '@unhead/vue';
|
|
5
5
|
import '@unhead/shared';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/schema-org",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0-alpha.0",
|
|
5
5
|
"description": "Unhead Schema.org for Simple and Automated Google Rich Results",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"vue.d.ts"
|
|
49
49
|
],
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@unhead/vue": "^1.11.
|
|
52
|
-
"unhead": "^1.11.
|
|
51
|
+
"@unhead/vue": "^1.11.15",
|
|
52
|
+
"unhead": "^1.11.15"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@unhead/vue": {
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"defu": "^6.1.4",
|
|
61
61
|
"ohash": "^1.1.4",
|
|
62
62
|
"ufo": "^1.5.4",
|
|
63
|
-
"@unhead/
|
|
64
|
-
"@unhead/
|
|
65
|
-
"
|
|
66
|
-
"unhead": "
|
|
63
|
+
"@unhead/vue": "2.0.0-alpha.0",
|
|
64
|
+
"@unhead/schema": "2.0.0-alpha.0",
|
|
65
|
+
"unhead": "2.0.0-alpha.0",
|
|
66
|
+
"@unhead/shared": "2.0.0-alpha.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"unplugin-vue-components": "^
|
|
69
|
+
"unplugin-vue-components": "^28.0.0"
|
|
70
70
|
},
|
|
71
71
|
"build": {
|
|
72
72
|
"external": [
|