@xylabs/react-rich-result 7.0.0 → 7.0.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.
- package/dist/browser/index.mjs +4 -9
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +10 -8
package/dist/browser/index.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/jsonld/ActionStatusType.ts
|
|
5
2
|
import { Enum } from "@xylabs/enum";
|
|
6
3
|
var ActionStatusType = Enum({
|
|
@@ -50,15 +47,13 @@ var MapCategoryType = Enum4({
|
|
|
50
47
|
});
|
|
51
48
|
|
|
52
49
|
// src/RichResult.tsx
|
|
53
|
-
import
|
|
54
|
-
var RichResult =
|
|
50
|
+
import { jsx } from "react/jsx-runtime";
|
|
51
|
+
var RichResult = (props) => {
|
|
55
52
|
const { thing } = props;
|
|
56
53
|
const thingWithContext = thing;
|
|
57
54
|
thingWithContext["@context"] = "https://schema.org";
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
}, JSON.stringify(thingWithContext));
|
|
61
|
-
}, "RichResult");
|
|
55
|
+
return /* @__PURE__ */ jsx("script", { type: "application/ld+json", children: JSON.stringify(thingWithContext) });
|
|
56
|
+
};
|
|
62
57
|
export {
|
|
63
58
|
ActionStatusType,
|
|
64
59
|
ContactPointOption,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/jsonld/ActionStatusType.ts","../../src/jsonld/ContactPointOption.ts","../../src/jsonld/ItemAvailability.ts","../../src/jsonld/MapCategoryType.ts","../../src/RichResult.tsx"],"sourcesContent":["import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const ActionStatusType = Enum({\n ActiveActionStatus: 'ActiveActionStatus',\n CompletedActionStatus: 'CompletedActionStatus',\n FailedActionStatus: 'FailedActionStatus',\n PotentialActionStatus: 'PotentialActionStatus',\n})\n\nexport type ActionStatusType = EnumValue<typeof ActionStatusType>\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const ContactPointOption = Enum({\n HearingImpairedSupported: 'HearingImpairedSupported',\n TollFree: 'TollFree',\n})\n\nexport type ContactPointOption = EnumValue<typeof ContactPointOption>\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const ItemAvailability = Enum({\n /** Indicates that the item has been discontinued. */\n Discontinued: 'https://schema.org/Discontinued',\n /** Indicates that the item is in stock. */\n InStock: 'https://schema.org/InStock',\n /** Indicates that the item is available only at physical locations. */\n InStoreOnly: 'https://schema.org/InStoreOnly',\n /** Indicates that the item has limited availability. */\n LimitedAvailability: 'https://schema.org/LimitedAvailability',\n /** Indicates that the item is available only online. */\n OnlineOnly: 'https://schema.org/OnlineOnly',\n /** Indicates that the item is out of stock. */\n OutOfStock: 'https://schema.org/OutOfStock',\n /** Indicates that the item is available for pre-order. */\n PreOrder: 'https://schema.org/PreOrder',\n /** Indicates that the item is available for ordering and delivery before general availability. */\n PreSale: 'https://schema.org/PreSale',\n /** Indicates that the item has sold out. */\n SoldOut: 'https://schema.org/SoldOut',\n})\n\nexport type ItemAvailability = EnumValue<typeof ItemAvailability>\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const MapCategoryType = Enum({\n ParkingMap: 'ParkingMap',\n SeatingMap: 'SeatingMap',\n TransitMap: 'TransitMap',\n VenueMap: 'VenueMap',\n})\n\nexport type MapCategoryType = EnumValue<typeof MapCategoryType>\n","import React from 'react'\n\nimport type { Base, Thing } from './jsonld/index.ts'\n\ntype WithContext<T extends Base> = T & {\n '@context': 'https://schema.org'\n}\n\nexport interface RichResultProps {\n thing: Thing\n}\n\nexport const RichResult: React.FC<RichResultProps> = (props) => {\n const { thing } = props\n const thingWithContext = thing as WithContext<Thing>\n thingWithContext['@context'] = 'https://schema.org'\n return <script type=\"application/ld+json\">{JSON.stringify(thingWithContext)}</script>\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/jsonld/ActionStatusType.ts","../../src/jsonld/ContactPointOption.ts","../../src/jsonld/ItemAvailability.ts","../../src/jsonld/MapCategoryType.ts","../../src/RichResult.tsx"],"sourcesContent":["import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const ActionStatusType = Enum({\n ActiveActionStatus: 'ActiveActionStatus',\n CompletedActionStatus: 'CompletedActionStatus',\n FailedActionStatus: 'FailedActionStatus',\n PotentialActionStatus: 'PotentialActionStatus',\n})\n\nexport type ActionStatusType = EnumValue<typeof ActionStatusType>\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const ContactPointOption = Enum({\n HearingImpairedSupported: 'HearingImpairedSupported',\n TollFree: 'TollFree',\n})\n\nexport type ContactPointOption = EnumValue<typeof ContactPointOption>\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const ItemAvailability = Enum({\n /** Indicates that the item has been discontinued. */\n Discontinued: 'https://schema.org/Discontinued',\n /** Indicates that the item is in stock. */\n InStock: 'https://schema.org/InStock',\n /** Indicates that the item is available only at physical locations. */\n InStoreOnly: 'https://schema.org/InStoreOnly',\n /** Indicates that the item has limited availability. */\n LimitedAvailability: 'https://schema.org/LimitedAvailability',\n /** Indicates that the item is available only online. */\n OnlineOnly: 'https://schema.org/OnlineOnly',\n /** Indicates that the item is out of stock. */\n OutOfStock: 'https://schema.org/OutOfStock',\n /** Indicates that the item is available for pre-order. */\n PreOrder: 'https://schema.org/PreOrder',\n /** Indicates that the item is available for ordering and delivery before general availability. */\n PreSale: 'https://schema.org/PreSale',\n /** Indicates that the item has sold out. */\n SoldOut: 'https://schema.org/SoldOut',\n})\n\nexport type ItemAvailability = EnumValue<typeof ItemAvailability>\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const MapCategoryType = Enum({\n ParkingMap: 'ParkingMap',\n SeatingMap: 'SeatingMap',\n TransitMap: 'TransitMap',\n VenueMap: 'VenueMap',\n})\n\nexport type MapCategoryType = EnumValue<typeof MapCategoryType>\n","import React from 'react'\n\nimport type { Base, Thing } from './jsonld/index.ts'\n\ntype WithContext<T extends Base> = T & {\n '@context': 'https://schema.org'\n}\n\nexport interface RichResultProps {\n thing: Thing\n}\n\nexport const RichResult: React.FC<RichResultProps> = (props) => {\n const { thing } = props\n const thingWithContext = thing as WithContext<Thing>\n thingWithContext['@context'] = 'https://schema.org'\n return <script type=\"application/ld+json\">{JSON.stringify(thingWithContext)}</script>\n}\n"],"mappings":";AACA,SAAS,YAAY;AAEd,IAAM,mBAAmB,KAAK;AAAA,EACnC,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,uBAAuB;AACzB,CAAC;;;ACPD,SAAS,QAAAA,aAAY;AAEd,IAAM,qBAAqBA,MAAK;AAAA,EACrC,0BAA0B;AAAA,EAC1B,UAAU;AACZ,CAAC;;;ACLD,SAAS,QAAAC,aAAY;AAEd,IAAM,mBAAmBA,MAAK;AAAA;AAAA,EAEnC,cAAc;AAAA;AAAA,EAEd,SAAS;AAAA;AAAA,EAET,aAAa;AAAA;AAAA,EAEb,qBAAqB;AAAA;AAAA,EAErB,YAAY;AAAA;AAAA,EAEZ,YAAY;AAAA;AAAA,EAEZ,UAAU;AAAA;AAAA,EAEV,SAAS;AAAA;AAAA,EAET,SAAS;AACX,CAAC;;;ACrBD,SAAS,QAAAC,aAAY;AAEd,IAAM,kBAAkBA,MAAK;AAAA,EAClC,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AACZ,CAAC;;;ACQQ;AAJF,IAAM,aAAwC,CAAC,UAAU;AAC9D,QAAM,EAAE,MAAM,IAAI;AAClB,QAAM,mBAAmB;AACzB,mBAAiB,UAAU,IAAI;AAC/B,SAAO,oBAAC,YAAO,MAAK,uBAAuB,eAAK,UAAU,gBAAgB,GAAE;AAC9E;","names":["Enum","Enum","Enum"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/react-rich-result",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "Common React library for all XY Labs projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"utility",
|
|
@@ -41,17 +41,19 @@
|
|
|
41
41
|
"packages/*"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@xylabs/enum": "
|
|
44
|
+
"@xylabs/enum": "~5.0.8"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/react": "
|
|
48
|
-
"@xylabs/ts-scripts-yarn3": "
|
|
49
|
-
"@xylabs/tsconfig
|
|
50
|
-
"
|
|
51
|
-
"
|
|
47
|
+
"@types/react": "~19.1.10",
|
|
48
|
+
"@xylabs/ts-scripts-yarn3": "~7.1.1",
|
|
49
|
+
"@xylabs/tsconfig": "~7.1.1",
|
|
50
|
+
"@xylabs/tsconfig-dom": "~7.1.1",
|
|
51
|
+
"@xylabs/tsconfig-react": "~7.1.1",
|
|
52
|
+
"react": "~19.1.1",
|
|
53
|
+
"typescript": "~5.9.2"
|
|
52
54
|
},
|
|
53
55
|
"peerDependencies": {
|
|
54
|
-
"react": "
|
|
56
|
+
"react": "~19"
|
|
55
57
|
},
|
|
56
58
|
"publishConfig": {
|
|
57
59
|
"access": "public"
|