@plasmicapp/react-web 0.2.331 → 0.2.332

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.
Files changed (30) hide show
  1. package/dist/all.d.ts +3 -2
  2. package/dist/index.cjs.js +21 -0
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/nextjs-app-router/react-server/index.d.ts +2 -2
  5. package/dist/react-web.esm.js +21 -0
  6. package/dist/react-web.esm.js.map +1 -1
  7. package/dist/render/PlasmicHead/index.d.ts +2 -8
  8. package/lib/nextjs-app-router/react-server/index.cjs.js +8 -0
  9. package/lib/nextjs-app-router/react-server/index.cjs.js.map +1 -1
  10. package/lib/nextjs-app-router/react-server/index.d.ts +2 -2
  11. package/lib/nextjs-app-router/react-server/index.js +1 -1
  12. package/lib/nextjs-app-router/react-server/index.js.map +1 -1
  13. package/package.json +8 -8
  14. package/skinny/dist/index.js +3 -3
  15. package/skinny/dist/nextjs-app-router/react-server/index.d.ts +2 -2
  16. package/skinny/dist/plume/checkbox/index.js +3 -2
  17. package/skinny/dist/plume/checkbox/index.js.map +1 -1
  18. package/skinny/dist/plume/menu/index.js +3 -2
  19. package/skinny/dist/plume/menu/index.js.map +1 -1
  20. package/skinny/dist/plume/menu-button/index.js +3 -2
  21. package/skinny/dist/plume/menu-button/index.js.map +1 -1
  22. package/skinny/dist/plume/select/index.js +2 -1
  23. package/skinny/dist/plume/select/index.js.map +1 -1
  24. package/skinny/dist/plume/switch/index.js +3 -2
  25. package/skinny/dist/plume/switch/index.js.map +1 -1
  26. package/skinny/dist/render/PlasmicHead/index.d.ts +2 -8
  27. package/skinny/dist/render/PlasmicHead/index.js +22 -0
  28. package/skinny/dist/render/PlasmicHead/index.js.map +1 -1
  29. package/skinny/dist/{ssr-145c6cd2.js → ssr-f37a883d.js} +2 -2
  30. package/skinny/dist/{ssr-145c6cd2.js.map → ssr-f37a883d.js.map} +1 -1
package/dist/all.d.ts CHANGED
@@ -12514,13 +12514,14 @@ declare function deriveRenderOpts(props: Record<string, any>, config: {
12514
12514
 
12515
12515
  declare function ensureGlobalVariants<T extends Record<string, any>>(globalVariantValues: T): T;
12516
12516
 
12517
- type PlasmicHeadProps = {
12517
+ declare type HeadMetadata = {
12518
12518
  title?: string;
12519
12519
  description?: string;
12520
12520
  image?: string;
12521
12521
  canonical?: string;
12522
12522
  };
12523
- declare function PlasmicHead(props: PlasmicHeadProps): React$1.JSX.Element | null;
12523
+
12524
+ declare function PlasmicHead(props: HeadMetadata): React$1.JSX.Element | null;
12524
12525
  declare const plasmicHeadMeta: {
12525
12526
  name: string;
12526
12527
  displayName: string;
package/dist/index.cjs.js CHANGED
@@ -1058,6 +1058,27 @@ function ensureGlobalVariants(globalVariantValues) {
1058
1058
  var PlasmicHeadContext = React__namespace.createContext(undefined);
1059
1059
  function PlasmicHead(props) {
1060
1060
  var Head = React__namespace.useContext(PlasmicHeadContext);
1061
+ var headMetadata =
1062
+ // Check if `HeadMetadataContext` is exported for backward compatibility
1063
+ "HeadMetadataContext" in plasmicQuery__namespace
1064
+ ? React__namespace.useContext(plasmicQuery__namespace.HeadMetadataContext)
1065
+ : undefined;
1066
+ if (headMetadata) {
1067
+ // If we have the Head metadata object specified, mutate it so to ensure it
1068
+ // stores the data that should go in the <head>.
1069
+ if (props.image) {
1070
+ headMetadata.image = props.image;
1071
+ }
1072
+ if (props.title) {
1073
+ headMetadata.title = props.title;
1074
+ }
1075
+ if (props.description) {
1076
+ headMetadata.description = props.description;
1077
+ }
1078
+ if (props.canonical) {
1079
+ headMetadata.canonical = props.canonical;
1080
+ }
1081
+ }
1061
1082
  if (!Head) {
1062
1083
  console.warn("Plasmic: Head meta tags are being ignored. To make them work, pass a Head component into PlasmicRootProvider.");
1063
1084
  // TODO: Link to doc about Head.