UNPKG

sanity-plugin-seo-tools

Version:

> Upgrading from V2 to V3 is a breaking change. The `seo-tools` input has been replaced by a SEO pane which needs to be set-up using a custom desk structure as per the installation guide. Secondly, the previously automatically provided fields (focus keywo

57 lines (56 loc) 2.41 kB
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function(key) { _defineProperty(target, key, source[key]); }); } return target; } import React, { useMemo } from "react"; import { SeoToolsContext } from "../context"; import { SeoToolsPaneView } from "./SeoToolsPaneView"; import { SeoToolsPaneEmptyView } from "./SeoToolsPaneEmptyView"; export var SeoToolsPane = function(param) { var options = param.options, document = param.document; var _document_displayed, _document_displayed1; var contextValue = useMemo(function() { return _objectSpread({ fetch: true, select: function() { return {}; }, render: function(seo, data, serpPreview) { return serpPreview; }, resolveProductionUrl: function() { return new URL("https://sanity.io"); } }, options); }, []); return /*#__PURE__*/ React.createElement(SeoToolsContext.Provider, { value: contextValue }, (document === null || document === void 0 ? void 0 : (_document_displayed = document.displayed) === null || _document_displayed === void 0 ? void 0 : _document_displayed._rev) && /*#__PURE__*/ React.createElement(SeoToolsPaneView, { document: document === null || document === void 0 ? void 0 : document.displayed }), !(document === null || document === void 0 ? void 0 : (_document_displayed1 = document.displayed) === null || _document_displayed1 === void 0 ? void 0 : _document_displayed1._rev) && /*#__PURE__*/ React.createElement(SeoToolsPaneEmptyView, null)); }; //# sourceMappingURL=SeoToolsPane.js.map