reactjs-slot-layout
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -203,3 +203,3 @@ import React, { useState } from 'react'; | ||
function Section(props) { | ||
return 'You must only use <Section> inside a <Page>'; | ||
return React.createElement(React.Fragment, null, "You must only use Section inside a Page "); | ||
// return (this.props.children); | ||
@@ -206,0 +206,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import t,{useState as e}from"react";var n="[object Object]";var r,o,c=Function.prototype,l=Object.prototype,u=c.toString,a=l.hasOwnProperty,i=u.call(Object),s=l.toString,f=(r=Object.getPrototypeOf,o=Object,function(t){return r(o(t))});var y=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||s.call(t)!=n||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=f(t);if(null===e)return!0;var r=a.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==i};const p=t.createContext({}),m=p.Consumer;function d(e){return t.createElement(m,null,({layouts:n})=>{const r=function t(e){if(y(e))return e.type&&"Section"===e.type.displayName?{[e.props.slot]:e}:{};if(Array.isArray(e)){let n={};const r=e.length;for(let o=0;o<r;o+=1)n=Object.assign({},n,t(e[o]));return n}return{}}(e.children),o=function(n,r,o){const c=r[n],{children:l}=e,u={...e};return delete u.layout,delete u.children,u.sections=o,t.createElement(c,u,l)}(e.layout,n,r);if(!o)throw new Error(`No layout found named: '${e.layout}'`);return o})}function v(n){const[r,o]=e(n.value),[c,l]=e(),[u,a]=e(null);return t.createElement(p.Provider,{value:{layouts:r,layout:c,sections:u,setLayout:l,setSections:a,setLayouts:o}},n.children)}function h(t){return"You must only use <Section> inside a <Page>"}function b(e){const{className:n,style:r={},component:o="div",wrapper:c}=e,l=(u=e.name,e.sections[u]||!1);var u;const a=l?l.props.children:e.children||!1,i={className:n,style:r};return!!a&&(c?t.cloneElement(c,i,a):"<>"!==o&&""!==o?t.createElement(o,i,a):a)}h.displayName="Section";export{d as Page,v as Provider,h as Section,b as Slot}; | ||
import t,{useState as e}from"react";var n="[object Object]";var r,o,c=Function.prototype,l=Object.prototype,u=c.toString,a=l.hasOwnProperty,i=u.call(Object),s=l.toString,f=(r=Object.getPrototypeOf,o=Object,function(t){return r(o(t))});var y=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||s.call(t)!=n||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=f(t);if(null===e)return!0;var r=a.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==i};const p=t.createContext({}),m=p.Consumer;function d(e){return t.createElement(m,null,({layouts:n})=>{const r=function t(e){if(y(e))return e.type&&"Section"===e.type.displayName?{[e.props.slot]:e}:{};if(Array.isArray(e)){let n={};const r=e.length;for(let o=0;o<r;o+=1)n=Object.assign({},n,t(e[o]));return n}return{}}(e.children),o=function(n,r,o){const c=r[n],{children:l}=e,u={...e};return delete u.layout,delete u.children,u.sections=o,t.createElement(c,u,l)}(e.layout,n,r);if(!o)throw new Error(`No layout found named: '${e.layout}'`);return o})}function v(n){const[r,o]=e(n.value),[c,l]=e(),[u,a]=e(null);return t.createElement(p.Provider,{value:{layouts:r,layout:c,sections:u,setLayout:l,setSections:a,setLayouts:o}},n.children)}function h(e){return t.createElement(t.Fragment,null,"You must only use Section inside a Page ")}function b(e){const{className:n,style:r={},component:o="div",wrapper:c}=e,l=(u=e.name,e.sections[u]||!1);var u;const a=l?l.props.children:e.children||!1,i={className:n,style:r};return!!a&&(c?t.cloneElement(c,i,a):"<>"!==o&&""!==o?t.createElement(o,i,a):a)}h.displayName="Section";export{d as Page,v as Provider,h as Section,b as Slot}; | ||
//# sourceMappingURL=index.esm.min.js.map |
@@ -237,3 +237,3 @@ (function (global, factory) { | ||
function Section(props) { | ||
return 'You must only use <Section> inside a <Page>'; | ||
return React__default.createElement(React__default.Fragment, null, "You must only use Section inside a Page "); | ||
// return (this.props.children); | ||
@@ -240,0 +240,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactjsSlotLayout={},e.React)}(this,function(e,s){"use strict";var f="default"in s?s.default:s,y=function(){return(y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var t,n,r=Function.prototype,o=Object.prototype,a=r.toString,c=o.hasOwnProperty,u=a.call(Object),i=o.toString,l=(t=Object.getPrototypeOf,n=Object,function(e){return t(n(e))});var p=function(e){if(!(t=e)||"object"!=typeof t||"[object Object]"!=i.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t,n=l(e);if(null===n)return!0;var r=c.call(n,"constructor")&&n.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==u},d=f.createContext({}),v=d.Consumer;function m(e){return"You must only use <Section> inside a <Page>"}m.displayName="Section",e.Page=function(l){return f.createElement(v,null,function(e){var t,n,r,o,a,c=e.layouts,u=function e(t){var n;if(p(t))return t.type&&"Section"===t.type.displayName?((n={})[t.props.slot]=t,n):{};if(Array.isArray(t)){for(var r={},o=t.length,a=0;a<o;a+=1)r=Object.assign({},r,e(t[a]));return r}return{}}(l.children),i=(t=l.layout,n=u,r=c[t],o=l.children,delete(a=y({},l)).layout,delete a.children,a.sections=n,f.createElement(r,a,o));if(!i)throw new Error("No layout found named: '"+l.layout+"'");return i})},e.Provider=function(e){var t=s.useState(e.value),n=t[0],r=t[1],o=s.useState(),a=o[0],c=o[1],u=s.useState(null),i=u[0],l=u[1];return f.createElement(d.Provider,{value:{layouts:n,layout:a,sections:i,setLayout:c,setSections:l,setLayouts:r}},e.children)},e.Section=m,e.Slot=function(e){var t,n=e.className,r=e.style,o=void 0===r?{}:r,a=e.component,c=void 0===a?"div":a,u=e.wrapper,i=(t=e.name,e.sections[t]||!1),l=i?i.props.children:e.children||!1,s={className:n,style:o};return!!l&&(u?f.cloneElement(u,s,l):"<>"!==c&&""!==c?f.createElement(c,s,l):l)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactjsSlotLayout={},e.React)}(this,function(e,s){"use strict";var f="default"in s?s.default:s,y=function(){return(y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var t,n,r=Function.prototype,o=Object.prototype,a=r.toString,c=o.hasOwnProperty,u=a.call(Object),i=o.toString,l=(t=Object.getPrototypeOf,n=Object,function(e){return t(n(e))});var p=function(e){if(!(t=e)||"object"!=typeof t||"[object Object]"!=i.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t,n=l(e);if(null===n)return!0;var r=c.call(n,"constructor")&&n.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==u},d=f.createContext({}),v=d.Consumer;function m(e){return f.createElement(f.Fragment,null,"You must only use Section inside a Page ")}m.displayName="Section",e.Page=function(l){return f.createElement(v,null,function(e){var t,n,r,o,a,c=e.layouts,u=function e(t){var n;if(p(t))return t.type&&"Section"===t.type.displayName?((n={})[t.props.slot]=t,n):{};if(Array.isArray(t)){for(var r={},o=t.length,a=0;a<o;a+=1)r=Object.assign({},r,e(t[a]));return r}return{}}(l.children),i=(t=l.layout,n=u,r=c[t],o=l.children,delete(a=y({},l)).layout,delete a.children,a.sections=n,f.createElement(r,a,o));if(!i)throw new Error("No layout found named: '"+l.layout+"'");return i})},e.Provider=function(e){var t=s.useState(e.value),n=t[0],r=t[1],o=s.useState(),a=o[0],c=o[1],u=s.useState(null),i=u[0],l=u[1];return f.createElement(d.Provider,{value:{layouts:n,layout:a,sections:i,setLayout:c,setSections:l,setLayouts:r}},e.children)},e.Section=m,e.Slot=function(e){var t,n=e.className,r=e.style,o=void 0===r?{}:r,a=e.component,c=void 0===a?"div":a,u=e.wrapper,i=(t=e.name,e.sections[t]||!1),l=i?i.props.children:e.children||!1,s={className:n,style:o};return!!l&&(u?f.cloneElement(u,s,l):"<>"!==c&&""!==c?f.createElement(c,s,l):l)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=index.umd.min.js.map |
@@ -0,3 +1,4 @@ | ||
import React from 'react'; | ||
export function Section(props) { | ||
return 'You must only use <Section> inside a <Page>'; | ||
return React.createElement(React.Fragment, null, "You must only use Section inside a Page "); | ||
// return (this.props.children); | ||
@@ -4,0 +5,0 @@ } |
@@ -0,3 +1,4 @@ | ||
import React from 'react'; | ||
export function Section(props) { | ||
return 'You must only use <Section> inside a <Page>'; | ||
return React.createElement(React.Fragment, null, "You must only use Section inside a Page "); | ||
// return (this.props.children); | ||
@@ -4,0 +5,0 @@ } |
{ | ||
"name": "reactjs-slot-layout", | ||
"private": false, | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "reactjs slot based layout system", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -6,3 +6,3 @@ import React from 'react'; | ||
} | ||
export declare function Section(props: SectionProps): string; | ||
export declare function Section(props: SectionProps): JSX.Element; | ||
export declare namespace Section { | ||
@@ -9,0 +9,0 @@ var displayName: string; |
{ | ||
"name": "reactjs-slot-layout", | ||
"private": false, | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "reactjs slot based layout system", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
124730
724
0