@vitus-labs/core 0.15.2 → 0.16.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.
@@ -7060,7 +7060,7 @@ var drawChart = (function (exports) {
7060
7060
  </script>
7061
7061
  <script>
7062
7062
  /*<!--*/
7063
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.js","children":[{"name":"src","children":[{"uid":"45b6-1","name":"config.ts"},{"uid":"45b6-3","name":"isEmpty.ts"},{"uid":"45b6-5","name":"context.tsx"},{"uid":"45b6-7","name":"compose.ts"},{"uid":"45b6-9","name":"renderContent.ts"},{"uid":"45b6-11","name":"htmlTags.ts"},{"uid":"45b6-13","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"45b6-1":{"renderedLength":810,"gzipLength":292,"brotliLength":0,"mainUid":"45b6-0"},"45b6-3":{"renderedLength":358,"gzipLength":180,"brotliLength":0,"mainUid":"45b6-2"},"45b6-5":{"renderedLength":752,"gzipLength":316,"brotliLength":0,"mainUid":"45b6-4"},"45b6-7":{"renderedLength":264,"gzipLength":190,"brotliLength":0,"mainUid":"45b6-6"},"45b6-9":{"renderedLength":858,"gzipLength":350,"brotliLength":0,"mainUid":"45b6-8"},"45b6-11":{"renderedLength":1655,"gzipLength":467,"brotliLength":0,"mainUid":"45b6-10"},"45b6-13":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"45b6-12"}},"nodeMetas":{"45b6-0":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.js":"45b6-1"},"imported":[{"uid":"45b6-16"}],"importedBy":[{"uid":"45b6-12"},{"uid":"45b6-4"}]},"45b6-2":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.js":"45b6-3"},"imported":[],"importedBy":[{"uid":"45b6-12"},{"uid":"45b6-4"},{"uid":"45b6-8"}]},"45b6-4":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.js":"45b6-5"},"imported":[{"uid":"45b6-17"},{"uid":"45b6-0"},{"uid":"45b6-2"}],"importedBy":[{"uid":"45b6-12"}]},"45b6-6":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.js":"45b6-7"},"imported":[],"importedBy":[{"uid":"45b6-12"}]},"45b6-8":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.js":"45b6-9"},"imported":[{"uid":"45b6-17"},{"uid":"45b6-2"}],"importedBy":[{"uid":"45b6-12"}]},"45b6-10":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.js":"45b6-11"},"imported":[],"importedBy":[{"uid":"45b6-12"}]},"45b6-12":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.js":"45b6-13"},"imported":[{"uid":"45b6-14"},{"uid":"45b6-15"},{"uid":"45b6-0"},{"uid":"45b6-4"},{"uid":"45b6-6"},{"uid":"45b6-2"},{"uid":"45b6-8"},{"uid":"45b6-10"}],"importedBy":[],"isEntry":true},"45b6-14":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-12"}],"isExternal":true},"45b6-15":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-12"}],"isExternal":true},"45b6-16":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-0"}],"isExternal":true},"45b6-17":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-4"},{"uid":"45b6-8"}],"isExternal":true}},"env":{"rollup":"2.56.3"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
7063
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.js","children":[{"name":"src","children":[{"uid":"5f2c-1","name":"config.ts"},{"uid":"5f2c-3","name":"isEmpty.ts"},{"uid":"5f2c-5","name":"context.tsx"},{"uid":"5f2c-7","name":"compose.ts"},{"uid":"5f2c-9","name":"renderContent.ts"},{"uid":"5f2c-11","name":"htmlTags.ts"},{"uid":"5f2c-13","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"5f2c-1":{"renderedLength":810,"gzipLength":294,"brotliLength":0,"mainUid":"5f2c-0"},"5f2c-3":{"renderedLength":358,"gzipLength":180,"brotliLength":0,"mainUid":"5f2c-2"},"5f2c-5":{"renderedLength":695,"gzipLength":280,"brotliLength":0,"mainUid":"5f2c-4"},"5f2c-7":{"renderedLength":207,"gzipLength":153,"brotliLength":0,"mainUid":"5f2c-6"},"5f2c-9":{"renderedLength":893,"gzipLength":284,"brotliLength":0,"mainUid":"5f2c-8"},"5f2c-11":{"renderedLength":1688,"gzipLength":493,"brotliLength":0,"mainUid":"5f2c-10"},"5f2c-13":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"5f2c-12"}},"nodeMetas":{"5f2c-0":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.js":"5f2c-1"},"imported":[{"uid":"5f2c-16"}],"importedBy":[{"uid":"5f2c-12"},{"uid":"5f2c-4"}]},"5f2c-2":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.js":"5f2c-3"},"imported":[],"importedBy":[{"uid":"5f2c-12"},{"uid":"5f2c-4"},{"uid":"5f2c-8"}]},"5f2c-4":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.js":"5f2c-5"},"imported":[{"uid":"5f2c-17"},{"uid":"5f2c-0"},{"uid":"5f2c-2"}],"importedBy":[{"uid":"5f2c-12"}]},"5f2c-6":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.js":"5f2c-7"},"imported":[],"importedBy":[{"uid":"5f2c-12"}]},"5f2c-8":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.js":"5f2c-9"},"imported":[{"uid":"5f2c-18"},{"uid":"5f2c-17"},{"uid":"5f2c-2"}],"importedBy":[{"uid":"5f2c-12"}]},"5f2c-10":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.js":"5f2c-11"},"imported":[],"importedBy":[{"uid":"5f2c-12"}]},"5f2c-12":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.js":"5f2c-13"},"imported":[{"uid":"5f2c-14"},{"uid":"5f2c-15"},{"uid":"5f2c-0"},{"uid":"5f2c-4"},{"uid":"5f2c-6"},{"uid":"5f2c-2"},{"uid":"5f2c-8"},{"uid":"5f2c-10"}],"importedBy":[],"isEntry":true},"5f2c-14":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-12"}],"isExternal":true},"5f2c-15":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-12"}],"isExternal":true},"5f2c-16":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-0"}],"isExternal":true},"5f2c-17":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-4"},{"uid":"5f2c-8"}],"isExternal":true},"5f2c-18":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-8"}],"isExternal":true}},"env":{"rollup":"2.60.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
7064
7064
 
7065
7065
  const run = () => {
7066
7066
  const width = window.innerWidth;
@@ -7060,7 +7060,7 @@ var drawChart = (function (exports) {
7060
7060
  </script>
7061
7061
  <script>
7062
7062
  /*<!--*/
7063
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.module.js","children":[{"name":"src","children":[{"uid":"45b6-19","name":"config.ts"},{"uid":"45b6-21","name":"isEmpty.ts"},{"uid":"45b6-23","name":"context.tsx"},{"uid":"45b6-25","name":"compose.ts"},{"uid":"45b6-27","name":"renderContent.ts"},{"uid":"45b6-29","name":"htmlTags.ts"},{"uid":"45b6-31","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"45b6-19":{"renderedLength":763,"gzipLength":273,"brotliLength":0,"mainUid":"45b6-18"},"45b6-21":{"renderedLength":358,"gzipLength":180,"brotliLength":0,"mainUid":"45b6-20"},"45b6-23":{"renderedLength":646,"gzipLength":296,"brotliLength":0,"mainUid":"45b6-22"},"45b6-25":{"renderedLength":264,"gzipLength":190,"brotliLength":0,"mainUid":"45b6-24"},"45b6-27":{"renderedLength":828,"gzipLength":340,"brotliLength":0,"mainUid":"45b6-26"},"45b6-29":{"renderedLength":1655,"gzipLength":467,"brotliLength":0,"mainUid":"45b6-28"},"45b6-31":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"45b6-30"}},"nodeMetas":{"45b6-18":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.module.js":"45b6-19"},"imported":[{"uid":"45b6-34"}],"importedBy":[{"uid":"45b6-30"},{"uid":"45b6-22"}]},"45b6-20":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.module.js":"45b6-21"},"imported":[],"importedBy":[{"uid":"45b6-30"},{"uid":"45b6-22"},{"uid":"45b6-26"}]},"45b6-22":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.module.js":"45b6-23"},"imported":[{"uid":"45b6-35"},{"uid":"45b6-18"},{"uid":"45b6-20"}],"importedBy":[{"uid":"45b6-30"}]},"45b6-24":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.module.js":"45b6-25"},"imported":[],"importedBy":[{"uid":"45b6-30"}]},"45b6-26":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.module.js":"45b6-27"},"imported":[{"uid":"45b6-35"},{"uid":"45b6-20"}],"importedBy":[{"uid":"45b6-30"}]},"45b6-28":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.module.js":"45b6-29"},"imported":[],"importedBy":[{"uid":"45b6-30"}]},"45b6-30":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.module.js":"45b6-31"},"imported":[{"uid":"45b6-32"},{"uid":"45b6-33"},{"uid":"45b6-18"},{"uid":"45b6-22"},{"uid":"45b6-24"},{"uid":"45b6-20"},{"uid":"45b6-26"},{"uid":"45b6-28"}],"importedBy":[],"isEntry":true},"45b6-32":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-30"}],"isExternal":true},"45b6-33":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-30"}],"isExternal":true},"45b6-34":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-18"}],"isExternal":true},"45b6-35":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-22"},{"uid":"45b6-26"}],"isExternal":true}},"env":{"rollup":"2.56.3"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
7063
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.module.js","children":[{"name":"src","children":[{"uid":"5f2c-20","name":"config.ts"},{"uid":"5f2c-22","name":"isEmpty.ts"},{"uid":"5f2c-24","name":"context.tsx"},{"uid":"5f2c-26","name":"compose.ts"},{"uid":"5f2c-28","name":"renderContent.ts"},{"uid":"5f2c-30","name":"htmlTags.ts"},{"uid":"5f2c-32","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"5f2c-20":{"renderedLength":763,"gzipLength":273,"brotliLength":0,"mainUid":"5f2c-19"},"5f2c-22":{"renderedLength":358,"gzipLength":180,"brotliLength":0,"mainUid":"5f2c-21"},"5f2c-24":{"renderedLength":589,"gzipLength":261,"brotliLength":0,"mainUid":"5f2c-23"},"5f2c-26":{"renderedLength":207,"gzipLength":153,"brotliLength":0,"mainUid":"5f2c-25"},"5f2c-28":{"renderedLength":835,"gzipLength":269,"brotliLength":0,"mainUid":"5f2c-27"},"5f2c-30":{"renderedLength":1688,"gzipLength":493,"brotliLength":0,"mainUid":"5f2c-29"},"5f2c-32":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"5f2c-31"}},"nodeMetas":{"5f2c-19":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.module.js":"5f2c-20"},"imported":[{"uid":"5f2c-35"}],"importedBy":[{"uid":"5f2c-31"},{"uid":"5f2c-23"}]},"5f2c-21":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.module.js":"5f2c-22"},"imported":[],"importedBy":[{"uid":"5f2c-31"},{"uid":"5f2c-23"},{"uid":"5f2c-27"}]},"5f2c-23":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.module.js":"5f2c-24"},"imported":[{"uid":"5f2c-36"},{"uid":"5f2c-19"},{"uid":"5f2c-21"}],"importedBy":[{"uid":"5f2c-31"}]},"5f2c-25":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.module.js":"5f2c-26"},"imported":[],"importedBy":[{"uid":"5f2c-31"}]},"5f2c-27":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.module.js":"5f2c-28"},"imported":[{"uid":"5f2c-37"},{"uid":"5f2c-36"},{"uid":"5f2c-21"}],"importedBy":[{"uid":"5f2c-31"}]},"5f2c-29":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.module.js":"5f2c-30"},"imported":[],"importedBy":[{"uid":"5f2c-31"}]},"5f2c-31":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.module.js":"5f2c-32"},"imported":[{"uid":"5f2c-33"},{"uid":"5f2c-34"},{"uid":"5f2c-19"},{"uid":"5f2c-23"},{"uid":"5f2c-25"},{"uid":"5f2c-21"},{"uid":"5f2c-27"},{"uid":"5f2c-29"}],"importedBy":[],"isEntry":true},"5f2c-33":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-31"}],"isExternal":true},"5f2c-34":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-31"}],"isExternal":true},"5f2c-35":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-19"}],"isExternal":true},"5f2c-36":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-23"},{"uid":"5f2c-27"}],"isExternal":true},"5f2c-37":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-27"}],"isExternal":true}},"env":{"rollup":"2.60.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
7064
7064
 
7065
7065
  const run = () => {
7066
7066
  const width = window.innerWidth;
@@ -7060,7 +7060,7 @@ var drawChart = (function (exports) {
7060
7060
  </script>
7061
7061
  <script>
7062
7062
  /*<!--*/
7063
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.umd.js","children":[{"name":"src","children":[{"uid":"45b6-37","name":"config.ts"},{"uid":"45b6-39","name":"isEmpty.ts"},{"uid":"45b6-41","name":"context.tsx"},{"uid":"45b6-43","name":"compose.ts"},{"uid":"45b6-45","name":"renderContent.ts"},{"uid":"45b6-47","name":"htmlTags.ts"},{"uid":"45b6-49","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"45b6-37":{"renderedLength":872,"gzipLength":296,"brotliLength":0,"mainUid":"45b6-36"},"45b6-39":{"renderedLength":388,"gzipLength":181,"brotliLength":0,"mainUid":"45b6-38"},"45b6-41":{"renderedLength":778,"gzipLength":317,"brotliLength":0,"mainUid":"45b6-40"},"45b6-43":{"renderedLength":272,"gzipLength":191,"brotliLength":0,"mainUid":"45b6-42"},"45b6-45":{"renderedLength":910,"gzipLength":353,"brotliLength":0,"mainUid":"45b6-44"},"45b6-47":{"renderedLength":1903,"gzipLength":476,"brotliLength":0,"mainUid":"45b6-46"},"45b6-49":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"45b6-48"}},"nodeMetas":{"45b6-36":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.umd.js":"45b6-37"},"imported":[{"uid":"45b6-52"}],"importedBy":[{"uid":"45b6-48"},{"uid":"45b6-40"}]},"45b6-38":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.umd.js":"45b6-39"},"imported":[],"importedBy":[{"uid":"45b6-48"},{"uid":"45b6-40"},{"uid":"45b6-44"}]},"45b6-40":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.umd.js":"45b6-41"},"imported":[{"uid":"45b6-53"},{"uid":"45b6-36"},{"uid":"45b6-38"}],"importedBy":[{"uid":"45b6-48"}]},"45b6-42":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.umd.js":"45b6-43"},"imported":[],"importedBy":[{"uid":"45b6-48"}]},"45b6-44":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.umd.js":"45b6-45"},"imported":[{"uid":"45b6-53"},{"uid":"45b6-38"}],"importedBy":[{"uid":"45b6-48"}]},"45b6-46":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.umd.js":"45b6-47"},"imported":[],"importedBy":[{"uid":"45b6-48"}]},"45b6-48":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.umd.js":"45b6-49"},"imported":[{"uid":"45b6-50"},{"uid":"45b6-51"},{"uid":"45b6-36"},{"uid":"45b6-40"},{"uid":"45b6-42"},{"uid":"45b6-38"},{"uid":"45b6-44"},{"uid":"45b6-46"}],"importedBy":[],"isEntry":true},"45b6-50":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-48"}],"isExternal":true},"45b6-51":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-48"}],"isExternal":true},"45b6-52":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-36"}],"isExternal":true},"45b6-53":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-40"},{"uid":"45b6-44"}],"isExternal":true}},"env":{"rollup":"2.56.3"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
7063
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.umd.js","children":[{"name":"src","children":[{"uid":"5f2c-39","name":"config.ts"},{"uid":"5f2c-41","name":"isEmpty.ts"},{"uid":"5f2c-43","name":"context.tsx"},{"uid":"5f2c-45","name":"compose.ts"},{"uid":"5f2c-47","name":"renderContent.ts"},{"uid":"5f2c-49","name":"htmlTags.ts"},{"uid":"5f2c-51","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"5f2c-39":{"renderedLength":872,"gzipLength":297,"brotliLength":0,"mainUid":"5f2c-38"},"5f2c-41":{"renderedLength":388,"gzipLength":181,"brotliLength":0,"mainUid":"5f2c-40"},"5f2c-43":{"renderedLength":719,"gzipLength":280,"brotliLength":0,"mainUid":"5f2c-42"},"5f2c-45":{"renderedLength":213,"gzipLength":155,"brotliLength":0,"mainUid":"5f2c-44"},"5f2c-47":{"renderedLength":947,"gzipLength":287,"brotliLength":0,"mainUid":"5f2c-46"},"5f2c-49":{"renderedLength":1936,"gzipLength":501,"brotliLength":0,"mainUid":"5f2c-48"},"5f2c-51":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"5f2c-50"}},"nodeMetas":{"5f2c-38":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.umd.js":"5f2c-39"},"imported":[{"uid":"5f2c-54"}],"importedBy":[{"uid":"5f2c-50"},{"uid":"5f2c-42"}]},"5f2c-40":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.umd.js":"5f2c-41"},"imported":[],"importedBy":[{"uid":"5f2c-50"},{"uid":"5f2c-42"},{"uid":"5f2c-46"}]},"5f2c-42":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.umd.js":"5f2c-43"},"imported":[{"uid":"5f2c-55"},{"uid":"5f2c-38"},{"uid":"5f2c-40"}],"importedBy":[{"uid":"5f2c-50"}]},"5f2c-44":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.umd.js":"5f2c-45"},"imported":[],"importedBy":[{"uid":"5f2c-50"}]},"5f2c-46":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.umd.js":"5f2c-47"},"imported":[{"uid":"5f2c-56"},{"uid":"5f2c-55"},{"uid":"5f2c-40"}],"importedBy":[{"uid":"5f2c-50"}]},"5f2c-48":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.umd.js":"5f2c-49"},"imported":[],"importedBy":[{"uid":"5f2c-50"}]},"5f2c-50":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.umd.js":"5f2c-51"},"imported":[{"uid":"5f2c-52"},{"uid":"5f2c-53"},{"uid":"5f2c-38"},{"uid":"5f2c-42"},{"uid":"5f2c-44"},{"uid":"5f2c-40"},{"uid":"5f2c-46"},{"uid":"5f2c-48"}],"importedBy":[],"isEntry":true},"5f2c-52":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-50"}],"isExternal":true},"5f2c-53":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-50"}],"isExternal":true},"5f2c-54":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-38"}],"isExternal":true},"5f2c-55":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-42"},{"uid":"5f2c-46"}],"isExternal":true},"5f2c-56":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-46"}],"isExternal":true}},"env":{"rollup":"2.60.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
7064
7064
 
7065
7065
  const run = () => {
7066
7066
  const width = window.innerWidth;
@@ -7060,7 +7060,7 @@ var drawChart = (function (exports) {
7060
7060
  </script>
7061
7061
  <script>
7062
7062
  /*<!--*/
7063
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.umd.min.js","children":[{"name":"src","children":[{"uid":"45b6-55","name":"config.ts"},{"uid":"45b6-57","name":"isEmpty.ts"},{"uid":"45b6-59","name":"context.tsx"},{"uid":"45b6-61","name":"compose.ts"},{"uid":"45b6-63","name":"renderContent.ts"},{"uid":"45b6-65","name":"htmlTags.ts"},{"uid":"45b6-67","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"45b6-55":{"renderedLength":872,"gzipLength":296,"brotliLength":0,"mainUid":"45b6-54"},"45b6-57":{"renderedLength":388,"gzipLength":181,"brotliLength":0,"mainUid":"45b6-56"},"45b6-59":{"renderedLength":778,"gzipLength":317,"brotliLength":0,"mainUid":"45b6-58"},"45b6-61":{"renderedLength":272,"gzipLength":191,"brotliLength":0,"mainUid":"45b6-60"},"45b6-63":{"renderedLength":910,"gzipLength":353,"brotliLength":0,"mainUid":"45b6-62"},"45b6-65":{"renderedLength":1903,"gzipLength":476,"brotliLength":0,"mainUid":"45b6-64"},"45b6-67":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"45b6-66"}},"nodeMetas":{"45b6-54":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.umd.min.js":"45b6-55"},"imported":[{"uid":"45b6-70"}],"importedBy":[{"uid":"45b6-66"},{"uid":"45b6-58"}]},"45b6-56":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.umd.min.js":"45b6-57"},"imported":[],"importedBy":[{"uid":"45b6-66"},{"uid":"45b6-58"},{"uid":"45b6-62"}]},"45b6-58":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.umd.min.js":"45b6-59"},"imported":[{"uid":"45b6-71"},{"uid":"45b6-54"},{"uid":"45b6-56"}],"importedBy":[{"uid":"45b6-66"}]},"45b6-60":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.umd.min.js":"45b6-61"},"imported":[],"importedBy":[{"uid":"45b6-66"}]},"45b6-62":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.umd.min.js":"45b6-63"},"imported":[{"uid":"45b6-71"},{"uid":"45b6-56"}],"importedBy":[{"uid":"45b6-66"}]},"45b6-64":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.umd.min.js":"45b6-65"},"imported":[],"importedBy":[{"uid":"45b6-66"}]},"45b6-66":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.umd.min.js":"45b6-67"},"imported":[{"uid":"45b6-68"},{"uid":"45b6-69"},{"uid":"45b6-54"},{"uid":"45b6-58"},{"uid":"45b6-60"},{"uid":"45b6-56"},{"uid":"45b6-62"},{"uid":"45b6-64"}],"importedBy":[],"isEntry":true},"45b6-68":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-66"}],"isExternal":true},"45b6-69":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-66"}],"isExternal":true},"45b6-70":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-54"}],"isExternal":true},"45b6-71":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"45b6-58"},{"uid":"45b6-62"}],"isExternal":true}},"env":{"rollup":"2.56.3"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
7063
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.umd.min.js","children":[{"name":"src","children":[{"uid":"5f2c-58","name":"config.ts"},{"uid":"5f2c-60","name":"isEmpty.ts"},{"uid":"5f2c-62","name":"context.tsx"},{"uid":"5f2c-64","name":"compose.ts"},{"uid":"5f2c-66","name":"renderContent.ts"},{"uid":"5f2c-68","name":"htmlTags.ts"},{"uid":"5f2c-70","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"5f2c-58":{"renderedLength":872,"gzipLength":297,"brotliLength":0,"mainUid":"5f2c-57"},"5f2c-60":{"renderedLength":388,"gzipLength":181,"brotliLength":0,"mainUid":"5f2c-59"},"5f2c-62":{"renderedLength":719,"gzipLength":280,"brotliLength":0,"mainUid":"5f2c-61"},"5f2c-64":{"renderedLength":213,"gzipLength":155,"brotliLength":0,"mainUid":"5f2c-63"},"5f2c-66":{"renderedLength":947,"gzipLength":287,"brotliLength":0,"mainUid":"5f2c-65"},"5f2c-68":{"renderedLength":1936,"gzipLength":501,"brotliLength":0,"mainUid":"5f2c-67"},"5f2c-70":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"5f2c-69"}},"nodeMetas":{"5f2c-57":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.umd.min.js":"5f2c-58"},"imported":[{"uid":"5f2c-73"}],"importedBy":[{"uid":"5f2c-69"},{"uid":"5f2c-61"}]},"5f2c-59":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.umd.min.js":"5f2c-60"},"imported":[],"importedBy":[{"uid":"5f2c-69"},{"uid":"5f2c-61"},{"uid":"5f2c-65"}]},"5f2c-61":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.umd.min.js":"5f2c-62"},"imported":[{"uid":"5f2c-74"},{"uid":"5f2c-57"},{"uid":"5f2c-59"}],"importedBy":[{"uid":"5f2c-69"}]},"5f2c-63":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.umd.min.js":"5f2c-64"},"imported":[],"importedBy":[{"uid":"5f2c-69"}]},"5f2c-65":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.umd.min.js":"5f2c-66"},"imported":[{"uid":"5f2c-75"},{"uid":"5f2c-74"},{"uid":"5f2c-59"}],"importedBy":[{"uid":"5f2c-69"}]},"5f2c-67":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.umd.min.js":"5f2c-68"},"imported":[],"importedBy":[{"uid":"5f2c-69"}]},"5f2c-69":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.umd.min.js":"5f2c-70"},"imported":[{"uid":"5f2c-71"},{"uid":"5f2c-72"},{"uid":"5f2c-57"},{"uid":"5f2c-61"},{"uid":"5f2c-63"},{"uid":"5f2c-59"},{"uid":"5f2c-65"},{"uid":"5f2c-67"}],"importedBy":[],"isEntry":true},"5f2c-71":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-69"}],"isExternal":true},"5f2c-72":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-69"}],"isExternal":true},"5f2c-73":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-57"}],"isExternal":true},"5f2c-74":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-61"},{"uid":"5f2c-65"}],"isExternal":true},"5f2c-75":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"5f2c-65"}],"isExternal":true}},"env":{"rollup":"2.60.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
7064
7064
 
7065
7065
  const run = () => {
7066
7066
  const width = window.innerWidth;
package/lib/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { get, merge, omit, pick, set, throttle } from 'lodash';
2
2
  export { default as memoize } from 'moize';
3
- import React, { ComponentType, FC, ReactNode } from 'react';
3
+ import React, { ComponentType, FC, ReactNode, createElement, cloneElement } from 'react';
4
4
  import { ThemedCssFunction, DefaultTheme, StyledInterface, ThemeProviderComponent } from 'styled-components';
5
5
 
6
- declare const TAGS: readonly ["a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"];
6
+ declare const TAGS: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"];
7
7
  declare type HTMLTags = typeof TAGS[number];
8
8
 
9
9
  declare type Init = ({ styled, css, context, component, textComponent, }: {
@@ -44,7 +44,9 @@ declare const compose: <T extends ArityOneFn[]>(...fns: T) => (p: FirstFnParamet
44
44
  declare type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(param?: T) => null | undefined extends T ? true : keyof T extends never ? true : false;
45
45
  declare const isEmpty: IsEmpty;
46
46
 
47
- declare type RenderContent = (content?: ReactNode | ComponentType, attachProps?: Record<string, any>) => ReactNode;
47
+ declare type CreateTypes = Parameters<typeof createElement>[0];
48
+ declare type CloneTypes = Parameters<typeof cloneElement>[0];
49
+ declare type RenderContent = (content?: CreateTypes | CloneTypes | ReactNode | ReactNode[], attachProps?: Record<string, any>) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null;
48
50
  declare const renderContent: RenderContent;
49
51
 
50
52
  export { HTMLTags, IsEmpty, Provider, RenderContent, compose, internal as config, context, TAGS as htmlTags, init, isEmpty, renderContent };
@@ -1,3 +1,3 @@
1
- declare const TAGS: readonly ["a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"];
1
+ declare const TAGS: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"];
2
2
  export declare type HTMLTags = typeof TAGS[number];
3
3
  export default TAGS;
@@ -1,4 +1,6 @@
1
- import { ReactNode, ComponentType } from 'react';
2
- export declare type RenderContent = (content?: ReactNode | ComponentType, attachProps?: Record<string, any>) => ReactNode;
1
+ import { createElement, cloneElement, ReactNode } from 'react';
2
+ declare type CreateTypes = Parameters<typeof createElement>[0];
3
+ declare type CloneTypes = Parameters<typeof cloneElement>[0];
4
+ export declare type RenderContent = (content?: CreateTypes | CloneTypes | ReactNode | ReactNode[], attachProps?: Record<string, any>) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null;
3
5
  declare const renderContent: RenderContent;
4
6
  export default renderContent;
@@ -6,6 +6,7 @@ var lodash = require('lodash');
6
6
  var moize = require('moize');
7
7
  var styled = require('styled-components');
8
8
  var React = require('react');
9
+ var reactIs = require('react-is');
9
10
 
10
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
12
 
@@ -14,7 +15,7 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
14
15
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
16
 
16
17
  const OPTIONS = {
17
- styled: styled__default['default'],
18
+ styled: styled__default["default"],
18
19
  css: styled.css,
19
20
  styledContext: styled.ThemeProvider,
20
21
  component: 'div',
@@ -61,48 +62,47 @@ const isEmpty = (param) => {
61
62
  return false;
62
63
  };
63
64
 
64
- /* eslint-disable @typescript-eslint/no-explicit-any */
65
65
  const context = React.createContext({});
66
66
  const VitusLabsProvider = context.Provider;
67
67
  const Provider = ({ theme, children, ...props }) => {
68
68
  if (!theme || isEmpty(theme))
69
- return React__default['default'].createElement(React__default['default'].Fragment, null, children);
69
+ return React__default["default"].createElement(React__default["default"].Fragment, null, children);
70
70
  const StyledContext = internal.styledContext;
71
71
  if (StyledContext) {
72
- return (React__default['default'].createElement(VitusLabsProvider, { value: { theme, ...props } },
73
- React__default['default'].createElement(StyledContext, { theme: theme }, children)));
72
+ return (React__default["default"].createElement(VitusLabsProvider, { value: { theme, ...props } },
73
+ React__default["default"].createElement(StyledContext, { theme: theme }, children)));
74
74
  }
75
- return (React__default['default'].createElement(VitusLabsProvider, { value: { theme, ...props } }, children));
75
+ return (React__default["default"].createElement(VitusLabsProvider, { value: { theme, ...props } }, children));
76
76
  };
77
77
 
78
- /* eslint-disable @typescript-eslint/no-explicit-any */
79
78
  // const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>
80
79
  // fns.reduce((a, b) => (value) => a(b(value)), fn1)
81
80
  const compose = (...fns) => (p) => fns.reduceRight((acc, cur) => cur(acc), p);
82
81
 
83
- /* eslint-disable @typescript-eslint/no-explicit-any */
84
- const renderContent = (content, attachProps = {}) => {
82
+ const renderContent = (content, attachProps) => {
85
83
  if (!content)
86
84
  return null;
87
- if (Array.isArray(content)) {
85
+ if (typeof content === 'string' && React.isValidElement(content)) {
86
+ return attachProps
87
+ ? React.createElement(content, attachProps)
88
+ : React.createElement(content);
89
+ }
90
+ if (['number', 'boolean', 'string'].includes(typeof content)) {
91
+ return content;
92
+ }
93
+ if (Array.isArray(content) || reactIs.isFragment(content)) {
88
94
  return content;
89
95
  }
90
- if (typeof content === 'function') {
91
- // @ts-ignore
92
- return React.createElement(content, attachProps);
96
+ if (reactIs.isValidElementType(content)) {
97
+ return attachProps
98
+ ? React.createElement(content, attachProps)
99
+ : React.createElement(content);
93
100
  }
94
101
  if (React.isValidElement(content)) {
95
102
  if (isEmpty(attachProps)) {
96
103
  return content;
97
104
  }
98
- return React.cloneElement(React.Children.only(content), attachProps);
99
- }
100
- // @ts-ignore
101
- if (typeof content === 'object' && !isEmpty(content)) {
102
- // FIXME: quick fix for rendering invalid elements
103
- // no idea of what is going on here yet
104
- // @ts-ignore
105
- return React.createElement(content, attachProps);
105
+ return React.cloneElement(content, attachProps);
106
106
  }
107
107
  return content;
108
108
  };
@@ -110,16 +110,16 @@ const renderContent = (content, attachProps = {}) => {
110
110
  const TAGS = [
111
111
  'a',
112
112
  'abbr',
113
- 'acronym',
113
+ // 'acronym',
114
114
  'address',
115
- 'applet',
115
+ // 'applet',
116
116
  'area',
117
117
  'article',
118
118
  'aside',
119
119
  'audio',
120
120
  'b',
121
121
  'base',
122
- 'basefont',
122
+ // 'basefont',
123
123
  'bdi',
124
124
  'bdo',
125
125
  'big',
@@ -129,7 +129,7 @@ const TAGS = [
129
129
  'button',
130
130
  'canvas',
131
131
  'caption',
132
- 'center',
132
+ // 'center',
133
133
  'cite',
134
134
  'code',
135
135
  'col',
@@ -141,7 +141,7 @@ const TAGS = [
141
141
  'details',
142
142
  'dfn',
143
143
  'dialog',
144
- 'dir',
144
+ // 'dir',
145
145
  'div',
146
146
  'dl',
147
147
  'dt',
@@ -150,11 +150,11 @@ const TAGS = [
150
150
  'fieldset',
151
151
  'figcaption',
152
152
  'figure',
153
- 'font',
153
+ // 'font',
154
154
  'footer',
155
155
  'form',
156
- 'frame',
157
- 'frameset',
156
+ // 'frame',
157
+ // 'frameset',
158
158
  'h1',
159
159
  'h2',
160
160
  'h3',
@@ -181,7 +181,7 @@ const TAGS = [
181
181
  'meta',
182
182
  'meter',
183
183
  'nav',
184
- 'noframes',
184
+ // 'noframes',
185
185
  'noscript',
186
186
  'object',
187
187
  'ol',
@@ -205,7 +205,7 @@ const TAGS = [
205
205
  'small',
206
206
  'source',
207
207
  'span',
208
- 'strike',
208
+ // 'strike',
209
209
  'strong',
210
210
  'style',
211
211
  'sub',
@@ -224,7 +224,7 @@ const TAGS = [
224
224
  'title',
225
225
  'tr',
226
226
  'track',
227
- 'tt',
227
+ // 'tt',
228
228
  'u',
229
229
  'ul',
230
230
  'var',
@@ -234,45 +234,31 @@ const TAGS = [
234
234
 
235
235
  Object.defineProperty(exports, 'get', {
236
236
  enumerable: true,
237
- get: function () {
238
- return lodash.get;
239
- }
237
+ get: function () { return lodash.get; }
240
238
  });
241
239
  Object.defineProperty(exports, 'merge', {
242
240
  enumerable: true,
243
- get: function () {
244
- return lodash.merge;
245
- }
241
+ get: function () { return lodash.merge; }
246
242
  });
247
243
  Object.defineProperty(exports, 'omit', {
248
244
  enumerable: true,
249
- get: function () {
250
- return lodash.omit;
251
- }
245
+ get: function () { return lodash.omit; }
252
246
  });
253
247
  Object.defineProperty(exports, 'pick', {
254
248
  enumerable: true,
255
- get: function () {
256
- return lodash.pick;
257
- }
249
+ get: function () { return lodash.pick; }
258
250
  });
259
251
  Object.defineProperty(exports, 'set', {
260
252
  enumerable: true,
261
- get: function () {
262
- return lodash.set;
263
- }
253
+ get: function () { return lodash.set; }
264
254
  });
265
255
  Object.defineProperty(exports, 'throttle', {
266
256
  enumerable: true,
267
- get: function () {
268
- return lodash.throttle;
269
- }
257
+ get: function () { return lodash.throttle; }
270
258
  });
271
259
  Object.defineProperty(exports, 'memoize', {
272
260
  enumerable: true,
273
- get: function () {
274
- return moize__default['default'];
275
- }
261
+ get: function () { return moize__default["default"]; }
276
262
  });
277
263
  exports.Provider = Provider;
278
264
  exports.compose = compose;
@@ -1 +1 @@
1
- {"version":3,"file":"vitus-labs-core.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/renderContent.ts","../src/htmlTags.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-underscore-dangle */\nimport { ComponentType } from 'react'\nimport styled, {\n css,\n ThemeProvider,\n ThemedCssFunction,\n StyledInterface,\n DefaultTheme,\n ThemeProviderComponent,\n} from 'styled-components'\nimport type { HTMLTags } from '~/htmlTags'\n\nconst OPTIONS: Internal = {\n styled,\n css,\n styledContext: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as Internal\n\ntype Init = ({\n styled,\n css,\n context,\n component,\n textComponent,\n}: {\n styled: any\n css: any\n context: any\n component?: ComponentType | HTMLTags\n textComponent?: ComponentType | HTMLTags\n}) => void\n\nconst init: Init = ({\n styled,\n css,\n context,\n component = 'div',\n textComponent = 'span',\n}) => {\n OPTIONS.css = css\n OPTIONS.styled = styled\n OPTIONS.styledContext = context\n OPTIONS.component = component\n OPTIONS.textComponent = textComponent\n}\n\ninterface Internal {\n css: ThemedCssFunction<DefaultTheme>\n styled: StyledInterface\n styledContext: ThemeProviderComponent<any, any>\n component: any\n textComponent: any\n}\n\nconst internal: Internal = Object.freeze({\n get css() {\n return OPTIONS.css\n },\n get styled() {\n return OPTIONS.styled\n },\n get styledContext() {\n return OPTIONS.styledContext\n },\n get component() {\n return OPTIONS.component\n },\n get textComponent() {\n return OPTIONS.textComponent\n },\n})\n\nexport { init }\nexport default internal\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(\n param?: T\n) => null | undefined extends T ? true : keyof T extends never ? true : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param) return true\n\n if (typeof param !== 'object') {\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (\n Object.entries(param as any).length === 0 &&\n param.constructor === Object\n ) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { createContext, FC } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Record<string, number | string>\n } & Record<string, unknown>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, unknown>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = config.styledContext\n\n if (StyledContext) {\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n <StyledContext theme={theme}>{children}</StyledContext>\n </VitusLabsProvider>\n )\n }\n\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n {children}\n </VitusLabsProvider>\n )\n}\n\nexport { context }\n\nexport default Provider\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n// const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>\n// fns.reduce((a, b) => (value) => a(b(value)), fn1)\n\n// const compose = (funcs) =>\n// funcs.reduce(\n// (a, b) => (...args) => a(b(...args)),\n// (arg) => arg\n// )\n\ntype ArityOneFn = (arg: any) => any\ntype PickLastInTuple<T extends any[]> = T extends [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ...rest: infer U,\n argn: infer L\n]\n ? L\n : any\ntype FirstFnParameterType<T extends any[]> = Parameters<PickLastInTuple<T>>[any]\ntype LastFnReturnType<T extends any[]> = ReturnType<T[0]>\n\nconst compose =\n <T extends ArityOneFn[]>(...fns: T) =>\n (p: FirstFnParameterType<T>): LastFnReturnType<T> =>\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport {\n createElement,\n isValidElement,\n cloneElement,\n Children,\n ReactNode,\n ComponentType,\n} from 'react'\nimport isEmpty from './isEmpty'\n\nexport type RenderContent = (\n content?: ReactNode | ComponentType,\n attachProps?: Record<string, any>\n) => ReactNode\n\nconst renderContent: RenderContent = (content, attachProps = {}) => {\n if (!content) return null\n\n if (Array.isArray(content)) {\n return content\n }\n\n if (typeof content === 'function') {\n // @ts-ignore\n return createElement(content, attachProps)\n }\n\n if (isValidElement(content)) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(Children.only(content), attachProps)\n }\n\n // @ts-ignore\n if (typeof content === 'object' && !isEmpty(content)) {\n // FIXME: quick fix for rendering invalid elements\n // no idea of what is going on here yet\n // @ts-ignore\n return createElement(content, attachProps)\n }\n\n return content\n}\n\nexport default renderContent\n","const TAGS = [\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'applet',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n 'basefont',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'meta',\n 'meter',\n 'nav',\n 'noframes',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport default TAGS\n"],"names":["styled","css","ThemeProvider","createContext","React","config","createElement","isValidElement","cloneElement","Children"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,OAAO,GAAa;YACxBA,0BAAM;SACNC,UAAG;IACH,aAAa,EAAEC,oBAAa;IAC5B,SAAS,EAAE,KAAK;IAChB,aAAa,EAAE,MAAM;CACV,CAAA;MAgBP,IAAI,GAAS,CAAC,EAClB,MAAM,EACN,GAAG,EACH,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,MAAM,GACvB;IACC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;IACjB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA;IACvB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAA;IAC/B,OAAO,CAAC,SAAS,GAAG,SAAS,CAAA;IAC7B,OAAO,CAAC,aAAa,GAAG,aAAa,CAAA;AACvC,EAAC;MAUK,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC;IACvC,IAAI,GAAG;QACL,OAAO,OAAO,CAAC,GAAG,CAAA;KACnB;IACD,IAAI,MAAM;QACR,OAAO,OAAO,CAAC,MAAM,CAAA;KACtB;IACD,IAAI,aAAa;QACf,OAAO,OAAO,CAAC,aAAa,CAAA;KAC7B;IACD,IAAI,SAAS;QACX,OAAO,OAAO,CAAC,SAAS,CAAA;KACzB;IACD,IAAI,aAAa;QACf,OAAO,OAAO,CAAC,aAAa,CAAA;KAC7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R,MAAM;IACN,OAAO;IACP,UAAU;IACV,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,GAAG;IACH,QAAQ;IACR,KAAK;IACL,OAAO;IACP,KAAK;IACL,KAAK;IACL,OAAO;IACP,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,UAAU;IACV,UAAU;IACV,QAAQ;IACR,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,GAAG;IACH,OAAO;IACP,SAAS;IACT,KAAK;IACL,UAAU;IACV,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,KAAK;IACL,SAAS;IACT,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,IAAI;IACJ,UAAU;IACV,UAAU;IACV,OAAO;IACP,IAAI;IACJ,OAAO;IACP,MAAM;IACN,OAAO;IACP,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"vitus-labs-core.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/renderContent.ts","../src/htmlTags.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\nimport { ComponentType } from 'react'\nimport styled, {\n css,\n ThemeProvider,\n ThemedCssFunction,\n StyledInterface,\n DefaultTheme,\n ThemeProviderComponent,\n} from 'styled-components'\nimport type { HTMLTags } from '~/htmlTags'\n\nconst OPTIONS: Internal = {\n styled,\n css,\n styledContext: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as Internal\n\ntype Init = ({\n styled,\n css,\n context,\n component,\n textComponent,\n}: {\n styled: any\n css: any\n context: any\n component?: ComponentType | HTMLTags\n textComponent?: ComponentType | HTMLTags\n}) => void\n\nconst init: Init = ({\n styled,\n css,\n context,\n component = 'div',\n textComponent = 'span',\n}) => {\n OPTIONS.css = css\n OPTIONS.styled = styled\n OPTIONS.styledContext = context\n OPTIONS.component = component\n OPTIONS.textComponent = textComponent\n}\n\ninterface Internal {\n css: ThemedCssFunction<DefaultTheme>\n styled: StyledInterface\n styledContext: ThemeProviderComponent<any, any>\n component: any\n textComponent: any\n}\n\nconst internal: Internal = Object.freeze({\n get css() {\n return OPTIONS.css\n },\n get styled() {\n return OPTIONS.styled\n },\n get styledContext() {\n return OPTIONS.styledContext\n },\n get component() {\n return OPTIONS.component\n },\n get textComponent() {\n return OPTIONS.textComponent\n },\n})\n\nexport { init }\nexport default internal\n","export type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(\n param?: T\n) => null | undefined extends T ? true : keyof T extends never ? true : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param) return true\n\n if (typeof param !== 'object') {\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (\n Object.entries(param as any).length === 0 &&\n param.constructor === Object\n ) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","import React, { createContext, FC } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Record<string, number | string>\n } & Record<string, unknown>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, unknown>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = config.styledContext\n\n if (StyledContext) {\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n <StyledContext theme={theme}>{children}</StyledContext>\n </VitusLabsProvider>\n )\n }\n\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n {children}\n </VitusLabsProvider>\n )\n}\n\nexport { context }\n\nexport default Provider\n","// const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>\n// fns.reduce((a, b) => (value) => a(b(value)), fn1)\n\n// const compose = (funcs) =>\n// funcs.reduce(\n// (a, b) => (...args) => a(b(...args)),\n// (arg) => arg\n// )\n\ntype ArityOneFn = (arg: any) => any\ntype PickLastInTuple<T extends any[]> = T extends [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ...rest: infer U,\n argn: infer L\n]\n ? L\n : any\ntype FirstFnParameterType<T extends any[]> = Parameters<PickLastInTuple<T>>[any]\ntype LastFnReturnType<T extends any[]> = ReturnType<T[0]>\n\nconst compose =\n <T extends ArityOneFn[]>(...fns: T) =>\n (p: FirstFnParameterType<T>): LastFnReturnType<T> =>\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","import { isValidElementType, isFragment } from 'react-is'\nimport { createElement, isValidElement, cloneElement, ReactNode } from 'react'\nimport isEmpty from './isEmpty'\n\ntype CreateTypes = Parameters<typeof createElement>[0]\ntype CloneTypes = Parameters<typeof cloneElement>[0]\n\n// export type RenderContent = (\n// content?: CreateTypes | CloneTypes | ReactNode | ReactNode[],\n// attachProps?: Record<string, any>\n// ) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\n// const renderContent: RenderContent = (content, attachProps) => {\n// if (!content) return null as any\n\n// if (typeof content === 'string') {\n// return content\n// }\n\n// if (Array.isArray(content)) {\n// return content\n// }\n\n// if (typeof content === 'function') {\n// return createElement(content, attachProps)\n// }\n\n// if (isValidElement(content)) {\n// if (isEmpty(attachProps)) {\n// return content\n// }\n\n// return cloneElement(Children.only(content), attachProps)\n// }\n\n// if (typeof content === 'object' && !isEmpty(content)) {\n// return createElement(content, attachProps)\n// }\n\n// return content\n// }\n\n// export default renderContent\n\nexport type RenderContent = (\n content?: CreateTypes | CloneTypes | ReactNode | ReactNode[],\n attachProps?: Record<string, any>\n) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\nconst renderContent: RenderContent = (content, attachProps) => {\n if (!content) return null as any\n\n if (typeof content === 'string' && isValidElement(content)) {\n return attachProps\n ? createElement(content, attachProps)\n : createElement(content)\n }\n\n if (['number', 'boolean', 'string'].includes(typeof content)) {\n return content\n }\n\n if (Array.isArray(content) || isFragment(content)) {\n return content\n }\n\n if (isValidElementType(content)) {\n return attachProps\n ? createElement(content, attachProps)\n : createElement(content)\n }\n\n if (isValidElement(content)) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(content, attachProps)\n }\n\n return content\n}\n\nexport default renderContent\n","const TAGS = [\n 'a',\n 'abbr',\n // 'acronym',\n 'address',\n // 'applet',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n // 'basefont',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n // 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n // 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n // 'font',\n 'footer',\n 'form',\n // 'frame',\n // 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'meta',\n 'meter',\n 'nav',\n // 'noframes',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n // 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n // 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport default TAGS\n"],"names":["styled","css","ThemeProvider","createContext","React","config","isValidElement","createElement","isFragment","isValidElementType","cloneElement"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAM,OAAO,GAAa;YACxBA,0BAAM;SACNC,UAAG;IACH,aAAa,EAAEC,oBAAa;IAC5B,SAAS,EAAE,KAAK;IAChB,aAAa,EAAE,MAAM;CACV,CAAA;MAgBP,IAAI,GAAS,CAAC,EAClB,MAAM,EACN,GAAG,EACH,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,MAAM,GACvB;IACC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;IACjB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA;IACvB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAA;IAC/B,OAAO,CAAC,SAAS,GAAG,SAAS,CAAA;IAC7B,OAAO,CAAC,aAAa,GAAG,aAAa,CAAA;AACvC,EAAC;MAUK,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC;IACvC,IAAI,GAAG;QACL,OAAO,OAAO,CAAC,GAAG,CAAA;KACnB;IACD,IAAI,MAAM;QACR,OAAO,OAAO,CAAC,MAAM,CAAA;KACtB;IACD,IAAI,aAAa;QACf,OAAO,OAAO,CAAC,aAAa,CAAA;KAC7B;IACD,IAAI,SAAS;QACX,OAAO,OAAO,CAAC,SAAS,CAAA;KACzB;IACD,IAAI,aAAa;QACf,OAAO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KAAK;IACL,SAAS;IACT,KAAK;IACL,QAAQ;;IAER,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,UAAU;IACV,YAAY;IACZ,QAAQ;;IAER,QAAQ;IACR,MAAM;;;IAGN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,GAAG;IACH,QAAQ;IACR,KAAK;IACL,OAAO;IACP,KAAK;IACL,KAAK;IACL,OAAO;IACP,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;;IAEL,UAAU;IACV,QAAQ;IACR,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,GAAG;IACH,OAAO;IACP,SAAS;IACT,KAAK;IACL,UAAU;IACV,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;;IAEN,QAAQ;IACR,OAAO;IACP,KAAK;IACL,SAAS;IACT,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,IAAI;IACJ,UAAU;IACV,UAAU;IACV,OAAO;IACP,IAAI;IACJ,OAAO;IACP,MAAM;IACN,OAAO;IACP,IAAI;IACJ,OAAO;;IAEP,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,8 @@
1
1
  export { get, merge, omit, pick, set, throttle } from 'lodash';
2
2
  export { default as memoize } from 'moize';
3
3
  import styled, { css, ThemeProvider } from 'styled-components';
4
- import React, { createContext, createElement, isValidElement, cloneElement, Children } from 'react';
4
+ import React, { createContext, isValidElement, createElement, cloneElement } from 'react';
5
+ import { isFragment, isValidElementType } from 'react-is';
5
6
 
6
7
  const OPTIONS = {
7
8
  styled,
@@ -51,7 +52,6 @@ const isEmpty = (param) => {
51
52
  return false;
52
53
  };
53
54
 
54
- /* eslint-disable @typescript-eslint/no-explicit-any */
55
55
  const context = createContext({});
56
56
  const VitusLabsProvider = context.Provider;
57
57
  const Provider = ({ theme, children, ...props }) => {
@@ -65,34 +65,34 @@ const Provider = ({ theme, children, ...props }) => {
65
65
  return (React.createElement(VitusLabsProvider, { value: { theme, ...props } }, children));
66
66
  };
67
67
 
68
- /* eslint-disable @typescript-eslint/no-explicit-any */
69
68
  // const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>
70
69
  // fns.reduce((a, b) => (value) => a(b(value)), fn1)
71
70
  const compose = (...fns) => (p) => fns.reduceRight((acc, cur) => cur(acc), p);
72
71
 
73
- /* eslint-disable @typescript-eslint/no-explicit-any */
74
- const renderContent = (content, attachProps = {}) => {
72
+ const renderContent = (content, attachProps) => {
75
73
  if (!content)
76
74
  return null;
77
- if (Array.isArray(content)) {
75
+ if (typeof content === 'string' && isValidElement(content)) {
76
+ return attachProps
77
+ ? createElement(content, attachProps)
78
+ : createElement(content);
79
+ }
80
+ if (['number', 'boolean', 'string'].includes(typeof content)) {
81
+ return content;
82
+ }
83
+ if (Array.isArray(content) || isFragment(content)) {
78
84
  return content;
79
85
  }
80
- if (typeof content === 'function') {
81
- // @ts-ignore
82
- return createElement(content, attachProps);
86
+ if (isValidElementType(content)) {
87
+ return attachProps
88
+ ? createElement(content, attachProps)
89
+ : createElement(content);
83
90
  }
84
91
  if (isValidElement(content)) {
85
92
  if (isEmpty(attachProps)) {
86
93
  return content;
87
94
  }
88
- return cloneElement(Children.only(content), attachProps);
89
- }
90
- // @ts-ignore
91
- if (typeof content === 'object' && !isEmpty(content)) {
92
- // FIXME: quick fix for rendering invalid elements
93
- // no idea of what is going on here yet
94
- // @ts-ignore
95
- return createElement(content, attachProps);
95
+ return cloneElement(content, attachProps);
96
96
  }
97
97
  return content;
98
98
  };
@@ -100,16 +100,16 @@ const renderContent = (content, attachProps = {}) => {
100
100
  const TAGS = [
101
101
  'a',
102
102
  'abbr',
103
- 'acronym',
103
+ // 'acronym',
104
104
  'address',
105
- 'applet',
105
+ // 'applet',
106
106
  'area',
107
107
  'article',
108
108
  'aside',
109
109
  'audio',
110
110
  'b',
111
111
  'base',
112
- 'basefont',
112
+ // 'basefont',
113
113
  'bdi',
114
114
  'bdo',
115
115
  'big',
@@ -119,7 +119,7 @@ const TAGS = [
119
119
  'button',
120
120
  'canvas',
121
121
  'caption',
122
- 'center',
122
+ // 'center',
123
123
  'cite',
124
124
  'code',
125
125
  'col',
@@ -131,7 +131,7 @@ const TAGS = [
131
131
  'details',
132
132
  'dfn',
133
133
  'dialog',
134
- 'dir',
134
+ // 'dir',
135
135
  'div',
136
136
  'dl',
137
137
  'dt',
@@ -140,11 +140,11 @@ const TAGS = [
140
140
  'fieldset',
141
141
  'figcaption',
142
142
  'figure',
143
- 'font',
143
+ // 'font',
144
144
  'footer',
145
145
  'form',
146
- 'frame',
147
- 'frameset',
146
+ // 'frame',
147
+ // 'frameset',
148
148
  'h1',
149
149
  'h2',
150
150
  'h3',
@@ -171,7 +171,7 @@ const TAGS = [
171
171
  'meta',
172
172
  'meter',
173
173
  'nav',
174
- 'noframes',
174
+ // 'noframes',
175
175
  'noscript',
176
176
  'object',
177
177
  'ol',
@@ -195,7 +195,7 @@ const TAGS = [
195
195
  'small',
196
196
  'source',
197
197
  'span',
198
- 'strike',
198
+ // 'strike',
199
199
  'strong',
200
200
  'style',
201
201
  'sub',
@@ -214,7 +214,7 @@ const TAGS = [
214
214
  'title',
215
215
  'tr',
216
216
  'track',
217
- 'tt',
217
+ // 'tt',
218
218
  'u',
219
219
  'ul',
220
220
  'var',
@@ -1 +1 @@
1
- {"version":3,"file":"vitus-labs-core.module.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/renderContent.ts","../src/htmlTags.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-underscore-dangle */\nimport { ComponentType } from 'react'\nimport styled, {\n css,\n ThemeProvider,\n ThemedCssFunction,\n StyledInterface,\n DefaultTheme,\n ThemeProviderComponent,\n} from 'styled-components'\nimport type { HTMLTags } from '~/htmlTags'\n\nconst OPTIONS: Internal = {\n styled,\n css,\n styledContext: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as Internal\n\ntype Init = ({\n styled,\n css,\n context,\n component,\n textComponent,\n}: {\n styled: any\n css: any\n context: any\n component?: ComponentType | HTMLTags\n textComponent?: ComponentType | HTMLTags\n}) => void\n\nconst init: Init = ({\n styled,\n css,\n context,\n component = 'div',\n textComponent = 'span',\n}) => {\n OPTIONS.css = css\n OPTIONS.styled = styled\n OPTIONS.styledContext = context\n OPTIONS.component = component\n OPTIONS.textComponent = textComponent\n}\n\ninterface Internal {\n css: ThemedCssFunction<DefaultTheme>\n styled: StyledInterface\n styledContext: ThemeProviderComponent<any, any>\n component: any\n textComponent: any\n}\n\nconst internal: Internal = Object.freeze({\n get css() {\n return OPTIONS.css\n },\n get styled() {\n return OPTIONS.styled\n },\n get styledContext() {\n return OPTIONS.styledContext\n },\n get component() {\n return OPTIONS.component\n },\n get textComponent() {\n return OPTIONS.textComponent\n },\n})\n\nexport { init }\nexport default internal\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(\n param?: T\n) => null | undefined extends T ? true : keyof T extends never ? true : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param) return true\n\n if (typeof param !== 'object') {\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (\n Object.entries(param as any).length === 0 &&\n param.constructor === Object\n ) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { createContext, FC } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Record<string, number | string>\n } & Record<string, unknown>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, unknown>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = config.styledContext\n\n if (StyledContext) {\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n <StyledContext theme={theme}>{children}</StyledContext>\n </VitusLabsProvider>\n )\n }\n\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n {children}\n </VitusLabsProvider>\n )\n}\n\nexport { context }\n\nexport default Provider\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n// const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>\n// fns.reduce((a, b) => (value) => a(b(value)), fn1)\n\n// const compose = (funcs) =>\n// funcs.reduce(\n// (a, b) => (...args) => a(b(...args)),\n// (arg) => arg\n// )\n\ntype ArityOneFn = (arg: any) => any\ntype PickLastInTuple<T extends any[]> = T extends [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ...rest: infer U,\n argn: infer L\n]\n ? L\n : any\ntype FirstFnParameterType<T extends any[]> = Parameters<PickLastInTuple<T>>[any]\ntype LastFnReturnType<T extends any[]> = ReturnType<T[0]>\n\nconst compose =\n <T extends ArityOneFn[]>(...fns: T) =>\n (p: FirstFnParameterType<T>): LastFnReturnType<T> =>\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport {\n createElement,\n isValidElement,\n cloneElement,\n Children,\n ReactNode,\n ComponentType,\n} from 'react'\nimport isEmpty from './isEmpty'\n\nexport type RenderContent = (\n content?: ReactNode | ComponentType,\n attachProps?: Record<string, any>\n) => ReactNode\n\nconst renderContent: RenderContent = (content, attachProps = {}) => {\n if (!content) return null\n\n if (Array.isArray(content)) {\n return content\n }\n\n if (typeof content === 'function') {\n // @ts-ignore\n return createElement(content, attachProps)\n }\n\n if (isValidElement(content)) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(Children.only(content), attachProps)\n }\n\n // @ts-ignore\n if (typeof content === 'object' && !isEmpty(content)) {\n // FIXME: quick fix for rendering invalid elements\n // no idea of what is going on here yet\n // @ts-ignore\n return createElement(content, attachProps)\n }\n\n return content\n}\n\nexport default renderContent\n","const TAGS = [\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'applet',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n 'basefont',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'meta',\n 'meter',\n 'nav',\n 'noframes',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport default TAGS\n"],"names":["config"],"mappings":";;;;;AAaA,MAAM,OAAO,GAAa;IACxB,MAAM;IACN,GAAG;IACH,aAAa,EAAE,aAAa;IAC5B,SAAS,EAAE,KAAK;IAChB,aAAa,EAAE,MAAM;CACV,CAAA;MAgBP,IAAI,GAAS,CAAC,EAClB,MAAM,EACN,GAAG,EACH,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,MAAM,GACvB;IACC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;IACjB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA;IACvB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAA;IAC/B,OAAO,CAAC,SAAS,GAAG,SAAS,CAAA;IAC7B,OAAO,CAAC,aAAa,GAAG,aAAa,CAAA;AACvC,EAAC;MAUK,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC;IACvC,IAAI,GAAG;QACL,OAAO,OAAO,CAAC,GAAG,CAAA;KACnB;IACD,IAAI,MAAM;QACR,OAAO,OAAO,CAAC,MAAM,CAAA;KACtB;IACD,IAAI,aAAa;QACf,OAAO,OAAO,CAAC,aAAa,CAAA;KAC7B;IACD,IAAI,SAAS;QACX,OAAO,OAAO,CAAC,SAAS,CAAA;KACzB;IACD,IAAI,aAAa;QACf,OAAO,OAAO,CAAC,aAAa,CAAA;KAC7B;CACF;;MCpEK,OAAO,GAAY,CAAC,KAAK;IAC7B,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,IAAW,CAAA;KACnB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC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AI;IACJ,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,UAAU;IACV,UAAU;IACV,QAAQ;IACR,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,GAAG;IACH,OAAO;IACP,SAAS;IACT,KAAK;IACL,UAAU;IACV,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,KAAK;IACL,SAAS;IACT,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,IAAI;IACJ,UAAU;IACV,UAAU;IACV,OAAO;IACP,IAAI;IACJ,OAAO;IACP,MAAM;IACN,OAAO;IACP,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,KAAK;;;;;"}
1
+ {"version":3,"file":"vitus-labs-core.module.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/renderContent.ts","../src/htmlTags.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\nimport { ComponentType } from 'react'\nimport styled, {\n css,\n ThemeProvider,\n ThemedCssFunction,\n StyledInterface,\n DefaultTheme,\n ThemeProviderComponent,\n} from 'styled-components'\nimport type { HTMLTags } from '~/htmlTags'\n\nconst OPTIONS: Internal = {\n styled,\n css,\n styledContext: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as Internal\n\ntype Init = ({\n styled,\n css,\n context,\n component,\n textComponent,\n}: {\n styled: any\n css: any\n context: any\n component?: ComponentType | HTMLTags\n textComponent?: ComponentType | HTMLTags\n}) => void\n\nconst init: Init = ({\n styled,\n css,\n context,\n component = 'div',\n textComponent = 'span',\n}) => {\n OPTIONS.css = css\n OPTIONS.styled = styled\n OPTIONS.styledContext = context\n OPTIONS.component = component\n OPTIONS.textComponent = textComponent\n}\n\ninterface Internal {\n css: ThemedCssFunction<DefaultTheme>\n styled: StyledInterface\n styledContext: ThemeProviderComponent<any, any>\n component: any\n textComponent: any\n}\n\nconst internal: Internal = Object.freeze({\n get css() {\n return OPTIONS.css\n },\n get styled() {\n return OPTIONS.styled\n },\n get styledContext() {\n return OPTIONS.styledContext\n },\n get component() {\n return OPTIONS.component\n },\n get textComponent() {\n return OPTIONS.textComponent\n },\n})\n\nexport { init }\nexport default internal\n","export type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(\n param?: T\n) => null | undefined extends T ? true : keyof T extends never ? true : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param) return true\n\n if (typeof param !== 'object') {\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (\n Object.entries(param as any).length === 0 &&\n param.constructor === Object\n ) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","import React, { createContext, FC } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Record<string, number | string>\n } & Record<string, unknown>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, unknown>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = config.styledContext\n\n if (StyledContext) {\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n <StyledContext theme={theme}>{children}</StyledContext>\n </VitusLabsProvider>\n )\n }\n\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n {children}\n </VitusLabsProvider>\n )\n}\n\nexport { context }\n\nexport default Provider\n","// const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>\n// fns.reduce((a, b) => (value) => a(b(value)), fn1)\n\n// const compose = (funcs) =>\n// funcs.reduce(\n// (a, b) => (...args) => a(b(...args)),\n// (arg) => arg\n// )\n\ntype ArityOneFn = (arg: any) => any\ntype PickLastInTuple<T extends any[]> = T extends [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ...rest: infer U,\n argn: infer L\n]\n ? L\n : any\ntype FirstFnParameterType<T extends any[]> = Parameters<PickLastInTuple<T>>[any]\ntype LastFnReturnType<T extends any[]> = ReturnType<T[0]>\n\nconst compose =\n <T extends ArityOneFn[]>(...fns: T) =>\n (p: FirstFnParameterType<T>): LastFnReturnType<T> =>\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","import { isValidElementType, isFragment } from 'react-is'\nimport { createElement, isValidElement, cloneElement, ReactNode } from 'react'\nimport isEmpty from './isEmpty'\n\ntype CreateTypes = Parameters<typeof createElement>[0]\ntype CloneTypes = Parameters<typeof cloneElement>[0]\n\n// export type RenderContent = (\n// content?: CreateTypes | CloneTypes | ReactNode | ReactNode[],\n// attachProps?: Record<string, any>\n// ) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\n// const renderContent: RenderContent = (content, attachProps) => {\n// if (!content) return null as any\n\n// if (typeof content === 'string') {\n// return content\n// }\n\n// if (Array.isArray(content)) {\n// return content\n// }\n\n// if (typeof content === 'function') {\n// return createElement(content, attachProps)\n// }\n\n// if (isValidElement(content)) {\n// if (isEmpty(attachProps)) {\n// return content\n// }\n\n// return cloneElement(Children.only(content), attachProps)\n// }\n\n// if (typeof content === 'object' && !isEmpty(content)) {\n// return createElement(content, attachProps)\n// }\n\n// return content\n// }\n\n// export default renderContent\n\nexport type RenderContent = (\n content?: CreateTypes | CloneTypes | ReactNode | ReactNode[],\n attachProps?: Record<string, any>\n) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\nconst renderContent: RenderContent = (content, attachProps) => {\n if (!content) return null as any\n\n if (typeof content === 'string' && isValidElement(content)) {\n return attachProps\n ? createElement(content, attachProps)\n : createElement(content)\n }\n\n if (['number', 'boolean', 'string'].includes(typeof content)) {\n return content\n }\n\n if (Array.isArray(content) || isFragment(content)) {\n return content\n }\n\n if (isValidElementType(content)) {\n return attachProps\n ? createElement(content, attachProps)\n : createElement(content)\n }\n\n if (isValidElement(content)) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(content, attachProps)\n }\n\n return content\n}\n\nexport default renderContent\n","const TAGS = [\n 'a',\n 'abbr',\n // 'acronym',\n 'address',\n // 'applet',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n // 'basefont',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n // 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n // 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n // 'font',\n 'footer',\n 'form',\n // 'frame',\n // 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'meta',\n 'meter',\n 'nav',\n // 'noframes',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n // 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n // 'tt',\n 'u',\n 'ul',\n 'var',\n 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;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;;IAEL,UAAU;IACV,QAAQ;IACR,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,GAAG;IACH,OAAO;IACP,SAAS;IACT,KAAK;IACL,UAAU;IACV,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;;IAEN,QAAQ;IACR,OAAO;IACP,KAAK;IACL,SAAS;IACT,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,IAAI;IACJ,UAAU;IACV,UAAU;IACV,OAAO;IACP,IAAI;IACJ,OAAO;IACP,MAAM;IACN,OAAO;IACP,IAAI;IACJ,OAAO;;IAEP,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,KAAK;;;;;"}
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('moize'), require('styled-components'), require('react')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'moize', 'styled-components', 'react'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vitusLabsCore = {}, global.lodash, global.moize, global.styled, global.React));
5
- }(this, (function (exports, lodash, moize, styled, React) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('moize'), require('styled-components'), require('react'), require('react-is')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'moize', 'styled-components', 'react', 'react-is'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vitusLabsCore = {}, global.lodash, global.moize, global.styled, global.React, global.ReactIs));
5
+ })(this, (function (exports, lodash, moize, styled, React, reactIs) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -11,7 +11,7 @@
11
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
12
 
13
13
  const OPTIONS = {
14
- styled: styled__default['default'],
14
+ styled: styled__default["default"],
15
15
  css: styled.css,
16
16
  styledContext: styled.ThemeProvider,
17
17
  component: 'div',
@@ -58,48 +58,47 @@
58
58
  return false;
59
59
  };
60
60
 
61
- /* eslint-disable @typescript-eslint/no-explicit-any */
62
61
  const context = React.createContext({});
63
62
  const VitusLabsProvider = context.Provider;
64
63
  const Provider = ({ theme, children, ...props }) => {
65
64
  if (!theme || isEmpty(theme))
66
- return React__default['default'].createElement(React__default['default'].Fragment, null, children);
65
+ return React__default["default"].createElement(React__default["default"].Fragment, null, children);
67
66
  const StyledContext = internal.styledContext;
68
67
  if (StyledContext) {
69
- return (React__default['default'].createElement(VitusLabsProvider, { value: { theme, ...props } },
70
- React__default['default'].createElement(StyledContext, { theme: theme }, children)));
68
+ return (React__default["default"].createElement(VitusLabsProvider, { value: { theme, ...props } },
69
+ React__default["default"].createElement(StyledContext, { theme: theme }, children)));
71
70
  }
72
- return (React__default['default'].createElement(VitusLabsProvider, { value: { theme, ...props } }, children));
71
+ return (React__default["default"].createElement(VitusLabsProvider, { value: { theme, ...props } }, children));
73
72
  };
74
73
 
75
- /* eslint-disable @typescript-eslint/no-explicit-any */
76
74
  // const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>
77
75
  // fns.reduce((a, b) => (value) => a(b(value)), fn1)
78
76
  const compose = (...fns) => (p) => fns.reduceRight((acc, cur) => cur(acc), p);
79
77
 
80
- /* eslint-disable @typescript-eslint/no-explicit-any */
81
- const renderContent = (content, attachProps = {}) => {
78
+ const renderContent = (content, attachProps) => {
82
79
  if (!content)
83
80
  return null;
84
- if (Array.isArray(content)) {
81
+ if (typeof content === 'string' && React.isValidElement(content)) {
82
+ return attachProps
83
+ ? React.createElement(content, attachProps)
84
+ : React.createElement(content);
85
+ }
86
+ if (['number', 'boolean', 'string'].includes(typeof content)) {
87
+ return content;
88
+ }
89
+ if (Array.isArray(content) || reactIs.isFragment(content)) {
85
90
  return content;
86
91
  }
87
- if (typeof content === 'function') {
88
- // @ts-ignore
89
- return React.createElement(content, attachProps);
92
+ if (reactIs.isValidElementType(content)) {
93
+ return attachProps
94
+ ? React.createElement(content, attachProps)
95
+ : React.createElement(content);
90
96
  }
91
97
  if (React.isValidElement(content)) {
92
98
  if (isEmpty(attachProps)) {
93
99
  return content;
94
100
  }
95
- return React.cloneElement(React.Children.only(content), attachProps);
96
- }
97
- // @ts-ignore
98
- if (typeof content === 'object' && !isEmpty(content)) {
99
- // FIXME: quick fix for rendering invalid elements
100
- // no idea of what is going on here yet
101
- // @ts-ignore
102
- return React.createElement(content, attachProps);
101
+ return React.cloneElement(content, attachProps);
103
102
  }
104
103
  return content;
105
104
  };
@@ -107,16 +106,16 @@
107
106
  const TAGS = [
108
107
  'a',
109
108
  'abbr',
110
- 'acronym',
109
+ // 'acronym',
111
110
  'address',
112
- 'applet',
111
+ // 'applet',
113
112
  'area',
114
113
  'article',
115
114
  'aside',
116
115
  'audio',
117
116
  'b',
118
117
  'base',
119
- 'basefont',
118
+ // 'basefont',
120
119
  'bdi',
121
120
  'bdo',
122
121
  'big',
@@ -126,7 +125,7 @@
126
125
  'button',
127
126
  'canvas',
128
127
  'caption',
129
- 'center',
128
+ // 'center',
130
129
  'cite',
131
130
  'code',
132
131
  'col',
@@ -138,7 +137,7 @@
138
137
  'details',
139
138
  'dfn',
140
139
  'dialog',
141
- 'dir',
140
+ // 'dir',
142
141
  'div',
143
142
  'dl',
144
143
  'dt',
@@ -147,11 +146,11 @@
147
146
  'fieldset',
148
147
  'figcaption',
149
148
  'figure',
150
- 'font',
149
+ // 'font',
151
150
  'footer',
152
151
  'form',
153
- 'frame',
154
- 'frameset',
152
+ // 'frame',
153
+ // 'frameset',
155
154
  'h1',
156
155
  'h2',
157
156
  'h3',
@@ -178,7 +177,7 @@
178
177
  'meta',
179
178
  'meter',
180
179
  'nav',
181
- 'noframes',
180
+ // 'noframes',
182
181
  'noscript',
183
182
  'object',
184
183
  'ol',
@@ -202,7 +201,7 @@
202
201
  'small',
203
202
  'source',
204
203
  'span',
205
- 'strike',
204
+ // 'strike',
206
205
  'strong',
207
206
  'style',
208
207
  'sub',
@@ -221,7 +220,7 @@
221
220
  'title',
222
221
  'tr',
223
222
  'track',
224
- 'tt',
223
+ // 'tt',
225
224
  'u',
226
225
  'ul',
227
226
  'var',
@@ -231,45 +230,31 @@
231
230
 
232
231
  Object.defineProperty(exports, 'get', {
233
232
  enumerable: true,
234
- get: function () {
235
- return lodash.get;
236
- }
233
+ get: function () { return lodash.get; }
237
234
  });
238
235
  Object.defineProperty(exports, 'merge', {
239
236
  enumerable: true,
240
- get: function () {
241
- return lodash.merge;
242
- }
237
+ get: function () { return lodash.merge; }
243
238
  });
244
239
  Object.defineProperty(exports, 'omit', {
245
240
  enumerable: true,
246
- get: function () {
247
- return lodash.omit;
248
- }
241
+ get: function () { return lodash.omit; }
249
242
  });
250
243
  Object.defineProperty(exports, 'pick', {
251
244
  enumerable: true,
252
- get: function () {
253
- return lodash.pick;
254
- }
245
+ get: function () { return lodash.pick; }
255
246
  });
256
247
  Object.defineProperty(exports, 'set', {
257
248
  enumerable: true,
258
- get: function () {
259
- return lodash.set;
260
- }
249
+ get: function () { return lodash.set; }
261
250
  });
262
251
  Object.defineProperty(exports, 'throttle', {
263
252
  enumerable: true,
264
- get: function () {
265
- return lodash.throttle;
266
- }
253
+ get: function () { return lodash.throttle; }
267
254
  });
268
255
  Object.defineProperty(exports, 'memoize', {
269
256
  enumerable: true,
270
- get: function () {
271
- return moize__default['default'];
272
- }
257
+ get: function () { return moize__default["default"]; }
273
258
  });
274
259
  exports.Provider = Provider;
275
260
  exports.compose = compose;
@@ -282,5 +267,5 @@
282
267
 
283
268
  Object.defineProperty(exports, '__esModule', { value: true });
284
269
 
285
- })));
270
+ }));
286
271
  //# sourceMappingURL=vitus-labs-core.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vitus-labs-core.umd.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/renderContent.ts","../src/htmlTags.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-underscore-dangle */\nimport { ComponentType } from 'react'\nimport styled, {\n css,\n ThemeProvider,\n ThemedCssFunction,\n StyledInterface,\n DefaultTheme,\n ThemeProviderComponent,\n} from 'styled-components'\nimport type { HTMLTags } from '~/htmlTags'\n\nconst OPTIONS: Internal = {\n styled,\n css,\n styledContext: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as Internal\n\ntype Init = ({\n styled,\n css,\n context,\n component,\n textComponent,\n}: {\n styled: any\n css: any\n context: any\n component?: ComponentType | HTMLTags\n textComponent?: ComponentType | HTMLTags\n}) => void\n\nconst init: Init = ({\n styled,\n css,\n context,\n component = 'div',\n textComponent = 'span',\n}) => {\n OPTIONS.css = css\n OPTIONS.styled = styled\n OPTIONS.styledContext = context\n OPTIONS.component = component\n OPTIONS.textComponent = textComponent\n}\n\ninterface Internal {\n css: ThemedCssFunction<DefaultTheme>\n styled: StyledInterface\n styledContext: ThemeProviderComponent<any, any>\n component: any\n textComponent: any\n}\n\nconst internal: Internal = Object.freeze({\n get css() {\n return OPTIONS.css\n },\n get styled() {\n return OPTIONS.styled\n },\n get styledContext() {\n return OPTIONS.styledContext\n },\n get component() {\n return OPTIONS.component\n },\n get textComponent() {\n return OPTIONS.textComponent\n },\n})\n\nexport { init }\nexport default internal\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(\n param?: T\n) => null | undefined extends T ? true : keyof T extends never ? true : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param) return true\n\n if (typeof param !== 'object') {\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (\n Object.entries(param as any).length === 0 &&\n param.constructor === Object\n ) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { createContext, FC } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Record<string, number | string>\n } & Record<string, unknown>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, unknown>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = config.styledContext\n\n if (StyledContext) {\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n <StyledContext theme={theme}>{children}</StyledContext>\n </VitusLabsProvider>\n )\n }\n\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n {children}\n </VitusLabsProvider>\n )\n}\n\nexport { context }\n\nexport default Provider\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n// const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>\n// fns.reduce((a, b) => (value) => a(b(value)), fn1)\n\n// const compose = (funcs) =>\n// funcs.reduce(\n// (a, b) => (...args) => a(b(...args)),\n// (arg) => arg\n// )\n\ntype ArityOneFn = (arg: any) => any\ntype PickLastInTuple<T extends any[]> = T extends [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ...rest: infer U,\n argn: infer L\n]\n ? L\n : any\ntype FirstFnParameterType<T extends any[]> = Parameters<PickLastInTuple<T>>[any]\ntype LastFnReturnType<T extends any[]> = ReturnType<T[0]>\n\nconst compose =\n <T extends ArityOneFn[]>(...fns: T) =>\n (p: FirstFnParameterType<T>): LastFnReturnType<T> =>\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport {\n createElement,\n isValidElement,\n cloneElement,\n Children,\n ReactNode,\n ComponentType,\n} from 'react'\nimport isEmpty from './isEmpty'\n\nexport type RenderContent = (\n content?: ReactNode | ComponentType,\n attachProps?: Record<string, any>\n) => ReactNode\n\nconst renderContent: RenderContent = (content, attachProps = {}) => {\n if (!content) return null\n\n if (Array.isArray(content)) {\n return content\n }\n\n if (typeof content === 'function') {\n // @ts-ignore\n return createElement(content, attachProps)\n }\n\n if (isValidElement(content)) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(Children.only(content), attachProps)\n }\n\n // @ts-ignore\n if (typeof content === 'object' && !isEmpty(content)) {\n // FIXME: quick fix for rendering invalid elements\n // no idea of what is going on here yet\n // @ts-ignore\n return createElement(content, attachProps)\n }\n\n return content\n}\n\nexport default renderContent\n","const TAGS = [\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'applet',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n 'basefont',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'meta',\n 'meter',\n 'nav',\n 'noframes',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport default TAGS\n"],"names":["styled","css","ThemeProvider","createContext","React","config","createElement","isValidElement","cloneElement","Children"],"mappings":";;;;;;;;;;;;EAaA,MAAM,OAAO,GAAa;cACxBA,0BAAM;WACNC,UAAG;MACH,aAAa,EAAEC,oBAAa;MAC5B,SAAS,EAAE,KAAK;MAChB,aAAa,EAAE,MAAM;GACV,CAAA;QAgBP,IAAI,GAAS,CAAC,EAClB,MAAM,EACN,GAAG,EACH,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,MAAM,GACvB;MACC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;MACjB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA;MACvB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAA;MAC/B,OAAO,CAAC,SAAS,GAAG,SAAS,CAAA;MAC7B,OAAO,CAAC,aAAa,GAAG,aAAa,CAAA;EACvC,EAAC;QAUK,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC;MACvC,IAAI,GAAG;UACL,OAAO,OAAO,CAAC,GAAG,CAAA;OACnB;MACD,IAAI,MAAM;UACR,OAAO,OAAO,CAAC,MAAM,CAAA;OACtB;MACD,IAAI,aAAa;UACf,OAAO,OAAO,CAAC,aAAa,CAAA;OAC7B;MACD,IAAI,SAAS;UACX,OAAO,OAAO,CAAC,SAAS,CAAA;OACzB;MACD,IAAI,aAAa;UACf,OAAO,OAAO,CAAC,aAAa,CAAA;OAC7B;GACF;;QCpEK,OAAO,GAAY,CAA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ACV,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,MAAM;MACN,QAAQ;MACR,IAAI;MACJ,MAAM;MACN,GAAG;MACH,QAAQ;MACR,KAAK;MACL,OAAO;MACP,KAAK;MACL,KAAK;MACL,OAAO;MACP,QAAQ;MACR,IAAI;MACJ,MAAM;MACN,MAAM;MACN,KAAK;MACL,MAAM;MACN,MAAM;MACN,OAAO;MACP,KAAK;MACL,UAAU;MACV,UAAU;MACV,QAAQ;MACR,IAAI;MACJ,UAAU;MACV,QAAQ;MACR,QAAQ;MACR,GAAG;MACH,OAAO;MACP,SAAS;MACT,KAAK;MACL,UAAU;MACV,GAAG;MACH,IAAI;MACJ,IAAI;MACJ,MAAM;MACN,GAAG;MACH,MAAM;MACN,QAAQ;MACR,SAAS;MACT,QAAQ;MACR,OAAO;MACP,QAAQ;MACR,MAAM;MACN,QAAQ;MACR,QAAQ;MACR,OAAO;MACP,KAAK;MACL,SAAS;MACT,KAAK;MACL,KAAK;MACL,OAAO;MACP,OAAO;MACP,IAAI;MACJ,UAAU;MACV,UAAU;MACV,OAAO;MACP,IAAI;MACJ,OAAO;MACP,MAAM;MACN,OAAO;MACP,IAAI;MACJ,OAAO;MACP,IAAI;MACJ,GAAG;MACH,IAAI;MACJ,KAAK;MACL,OAAO;MACP,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"vitus-labs-core.umd.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/renderContent.ts","../src/htmlTags.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\nimport { ComponentType } from 'react'\nimport styled, {\n css,\n ThemeProvider,\n ThemedCssFunction,\n StyledInterface,\n DefaultTheme,\n ThemeProviderComponent,\n} from 'styled-components'\nimport type { HTMLTags } from '~/htmlTags'\n\nconst OPTIONS: Internal = {\n styled,\n css,\n styledContext: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as Internal\n\ntype Init = ({\n styled,\n css,\n context,\n component,\n textComponent,\n}: {\n styled: any\n css: any\n context: any\n component?: ComponentType | HTMLTags\n textComponent?: ComponentType | HTMLTags\n}) => void\n\nconst init: Init = ({\n styled,\n css,\n context,\n component = 'div',\n textComponent = 'span',\n}) => {\n OPTIONS.css = css\n OPTIONS.styled = styled\n OPTIONS.styledContext = context\n OPTIONS.component = component\n OPTIONS.textComponent = textComponent\n}\n\ninterface Internal {\n css: ThemedCssFunction<DefaultTheme>\n styled: StyledInterface\n styledContext: ThemeProviderComponent<any, any>\n component: any\n textComponent: any\n}\n\nconst internal: Internal = Object.freeze({\n get css() {\n return OPTIONS.css\n },\n get styled() {\n return OPTIONS.styled\n },\n get styledContext() {\n return OPTIONS.styledContext\n },\n get component() {\n return OPTIONS.component\n },\n get textComponent() {\n return OPTIONS.textComponent\n },\n})\n\nexport { init }\nexport default internal\n","export type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(\n param?: T\n) => null | undefined extends T ? true : keyof T extends never ? true : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param) return true\n\n if (typeof param !== 'object') {\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (\n Object.entries(param as any).length === 0 &&\n param.constructor === Object\n ) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","import React, { createContext, FC } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Record<string, number | string>\n } & Record<string, unknown>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, unknown>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = config.styledContext\n\n if (StyledContext) {\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n <StyledContext theme={theme}>{children}</StyledContext>\n </VitusLabsProvider>\n )\n }\n\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n {children}\n </VitusLabsProvider>\n )\n}\n\nexport { context }\n\nexport default Provider\n","// const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>\n// fns.reduce((a, b) => (value) => a(b(value)), fn1)\n\n// const compose = (funcs) =>\n// funcs.reduce(\n// (a, b) => (...args) => a(b(...args)),\n// (arg) => arg\n// )\n\ntype ArityOneFn = (arg: any) => any\ntype PickLastInTuple<T extends any[]> = T extends [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ...rest: infer U,\n argn: infer L\n]\n ? L\n : any\ntype FirstFnParameterType<T extends any[]> = Parameters<PickLastInTuple<T>>[any]\ntype LastFnReturnType<T extends any[]> = ReturnType<T[0]>\n\nconst compose =\n <T extends ArityOneFn[]>(...fns: T) =>\n (p: FirstFnParameterType<T>): LastFnReturnType<T> =>\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","import { isValidElementType, isFragment } from 'react-is'\nimport { createElement, isValidElement, cloneElement, ReactNode } from 'react'\nimport isEmpty from './isEmpty'\n\ntype CreateTypes = Parameters<typeof createElement>[0]\ntype CloneTypes = Parameters<typeof cloneElement>[0]\n\n// export type RenderContent = (\n// content?: CreateTypes | CloneTypes | ReactNode | ReactNode[],\n// attachProps?: Record<string, any>\n// ) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\n// const renderContent: RenderContent = (content, attachProps) => {\n// if (!content) return null as any\n\n// if (typeof content === 'string') {\n// return content\n// }\n\n// if (Array.isArray(content)) {\n// return content\n// }\n\n// if (typeof content === 'function') {\n// return createElement(content, attachProps)\n// }\n\n// if (isValidElement(content)) {\n// if (isEmpty(attachProps)) {\n// return content\n// }\n\n// return cloneElement(Children.only(content), attachProps)\n// }\n\n// if (typeof content === 'object' && !isEmpty(content)) {\n// return createElement(content, attachProps)\n// }\n\n// return content\n// }\n\n// export default renderContent\n\nexport type RenderContent = (\n content?: CreateTypes | CloneTypes | ReactNode | ReactNode[],\n attachProps?: Record<string, any>\n) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\nconst renderContent: RenderContent = (content, attachProps) => {\n if (!content) return null as any\n\n if (typeof content === 'string' && isValidElement(content)) {\n return attachProps\n ? createElement(content, attachProps)\n : createElement(content)\n }\n\n if (['number', 'boolean', 'string'].includes(typeof content)) {\n return content\n }\n\n if (Array.isArray(content) || isFragment(content)) {\n return content\n }\n\n if (isValidElementType(content)) {\n return attachProps\n ? createElement(content, attachProps)\n : createElement(content)\n }\n\n if (isValidElement(content)) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(content, attachProps)\n }\n\n return content\n}\n\nexport default renderContent\n","const TAGS = [\n 'a',\n 'abbr',\n // 'acronym',\n 'address',\n // 'applet',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n // 'basefont',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n // 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n // 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n // 'font',\n 'footer',\n 'form',\n // 'frame',\n // 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'meta',\n 'meter',\n 'nav',\n // 'noframes',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n // 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n // 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport default TAGS\n"],"names":["styled","css","ThemeProvider","createContext","React","config","isValidElement","createElement","isFragment","isValidElementType","cloneElement"],"mappings":";;;;;;;;;;;;EAYA,MAAM,OAAO,GAAa;cACxBA,0BAAM;WACNC,UAAG;MACH,aAAa,EAAEC,oBAAa;MAC5B,SAAS,EAAE,KAAK;MAChB,aAAa,EAAE,MAAM;GACV,CAAA;QAgBP,IAAI,GAAS,CAAC,EAClB,MAAM,EACN,GAAG,EACH,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,MAAM,GACvB;MACC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;MACjB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA;MACvB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAA;MAC/B,OAAO,CAAC,SAAS,GAAG,SAAS,CAAA;MAC7B,OAAO,CAAC,aAAa,GAAG,aAAa,CAAA;EACvC,EAAC;QAUK,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC;MACvC,IAAI,GAAG;UACL,OAAO,OAAO,CAAC,GAAG,CAAA;OACnB;MACD,IAAI,MAAM;UACR,OAAO,OAAO,CAAC,MAAM,CAAA;OACtB;MACD,IAAI,aAAa;UACf,OAAO,OAAO,CAAC,aAAa,CAAA;OAC7B;MACD,IAAI,SAAS;UACX,OAAO,OAAO,CAAC,SAAS,CAAA;OACzB;MACD,IAAI,aAAa;UACf,OAAO,OAAO,CAAC,aAAa,CAAA;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,KAAK;MACL,QAAQ;;MAER,KAAK;MACL,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,OAAO;MACP,UAAU;MACV,YAAY;MACZ,QAAQ;;MAER,QAAQ;MACR,MAAM;;;MAGN,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,IAAI;MACJ,MAAM;MACN,QAAQ;MACR,IAAI;MACJ,MAAM;MACN,GAAG;MACH,QAAQ;MACR,KAAK;MACL,OAAO;MACP,KAAK;MACL,KAAK;MACL,OAAO;MACP,QAAQ;MACR,IAAI;MACJ,MAAM;MACN,MAAM;MACN,KAAK;MACL,MAAM;MACN,MAAM;MACN,OAAO;MACP,KAAK;;MAEL,UAAU;MACV,QAAQ;MACR,IAAI;MACJ,UAAU;MACV,QAAQ;MACR,QAAQ;MACR,GAAG;MACH,OAAO;MACP,SAAS;MACT,KAAK;MACL,UAAU;MACV,GAAG;MACH,IAAI;MACJ,IAAI;MACJ,MAAM;MACN,GAAG;MACH,MAAM;MACN,QAAQ;MACR,SAAS;MACT,QAAQ;MACR,OAAO;MACP,QAAQ;MACR,MAAM;;MAEN,QAAQ;MACR,OAAO;MACP,KAAK;MACL,SAAS;MACT,KAAK;MACL,KAAK;MACL,OAAO;MACP,OAAO;MACP,IAAI;MACJ,UAAU;MACV,UAAU;MACV,OAAO;MACP,IAAI;MACJ,OAAO;MACP,MAAM;MACN,OAAO;MACP,IAAI;MACJ,OAAO;;MAEP,GAAG;MACH,IAAI;MACJ,KAAK;MACL,OAAO;MACP,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash"),require("moize"),require("styled-components"),require("react")):"function"==typeof define&&define.amd?define(["exports","lodash","moize","styled-components","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vitusLabsCore={},e.lodash,e.moize,e.styled,e.React)}(this,(function(e,t,r,n,o){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(r),l=i(n),s=i(o);const c={styled:l.default,css:n.css,styledContext:n.ThemeProvider,component:"div",textComponent:"span"},d=Object.freeze({get css(){return c.css},get styled(){return c.styled},get styledContext(){return c.styledContext},get component(){return c.component},get textComponent(){return c.textComponent}}),u=e=>!e||("object"!=typeof e||(!(!Array.isArray(e)||0!==e.length)||0===Object.entries(e).length&&e.constructor===Object)),m=o.createContext({}),p=m.Provider;Object.defineProperty(e,"get",{enumerable:!0,get:function(){return t.get}}),Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return t.merge}}),Object.defineProperty(e,"omit",{enumerable:!0,get:function(){return t.omit}}),Object.defineProperty(e,"pick",{enumerable:!0,get:function(){return t.pick}}),Object.defineProperty(e,"set",{enumerable:!0,get:function(){return t.set}}),Object.defineProperty(e,"throttle",{enumerable:!0,get:function(){return t.throttle}}),Object.defineProperty(e,"memoize",{enumerable:!0,get:function(){return a.default}}),e.Provider=({theme:e,children:t,...r})=>{if(!e||u(e))return s.default.createElement(s.default.Fragment,null,t);const n=d.styledContext;return n?s.default.createElement(p,{value:{theme:e,...r}},s.default.createElement(n,{theme:e},t)):s.default.createElement(p,{value:{theme:e,...r}},t)},e.compose=(...e)=>t=>e.reduceRight(((e,t)=>t(e)),t),e.config=d,e.context=m,e.htmlTags=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr"],e.init=({styled:e,css:t,context:r,component:n="div",textComponent:o="span"})=>{c.css=t,c.styled=e,c.styledContext=r,c.component=n,c.textComponent=o},e.isEmpty=u,e.renderContent=(e,t={})=>e?Array.isArray(e)?e:"function"==typeof e?o.createElement(e,t):o.isValidElement(e)?u(t)?e:o.cloneElement(o.Children.only(e),t):"object"!=typeof e||u(e)?e:o.createElement(e,t):null,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash"),require("moize"),require("styled-components"),require("react"),require("react-is")):"function"==typeof define&&define.amd?define(["exports","lodash","moize","styled-components","react","react-is"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vitusLabsCore={},e.lodash,e.moize,e.styled,e.React,e.ReactIs)}(this,(function(e,t,r,n,o,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(r),s=a(n),c=a(o);const d={styled:s.default,css:n.css,styledContext:n.ThemeProvider,component:"div",textComponent:"span"},u=Object.freeze({get css(){return d.css},get styled(){return d.styled},get styledContext(){return d.styledContext},get component(){return d.component},get textComponent(){return d.textComponent}}),m=e=>!e||("object"!=typeof e||(!(!Array.isArray(e)||0!==e.length)||0===Object.entries(e).length&&e.constructor===Object)),p=o.createContext({}),f=p.Provider;Object.defineProperty(e,"get",{enumerable:!0,get:function(){return t.get}}),Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return t.merge}}),Object.defineProperty(e,"omit",{enumerable:!0,get:function(){return t.omit}}),Object.defineProperty(e,"pick",{enumerable:!0,get:function(){return t.pick}}),Object.defineProperty(e,"set",{enumerable:!0,get:function(){return t.set}}),Object.defineProperty(e,"throttle",{enumerable:!0,get:function(){return t.throttle}}),Object.defineProperty(e,"memoize",{enumerable:!0,get:function(){return l.default}}),e.Provider=({theme:e,children:t,...r})=>{if(!e||m(e))return c.default.createElement(c.default.Fragment,null,t);const n=u.styledContext;return n?c.default.createElement(f,{value:{theme:e,...r}},c.default.createElement(n,{theme:e},t)):c.default.createElement(f,{value:{theme:e,...r}},t)},e.compose=(...e)=>t=>e.reduceRight(((e,t)=>t(e)),t),e.config=u,e.context=p,e.htmlTags=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],e.init=({styled:e,css:t,context:r,component:n="div",textComponent:o="span"})=>{d.css=t,d.styled=e,d.styledContext=r,d.component=n,d.textComponent=o},e.isEmpty=m,e.renderContent=(e,t)=>e?"string"==typeof e&&o.isValidElement(e)?t?o.createElement(e,t):o.createElement(e):["number","boolean","string"].includes(typeof e)||Array.isArray(e)||i.isFragment(e)?e:i.isValidElementType(e)?t?o.createElement(e,t):o.createElement(e):o.isValidElement(e)?m(t)?e:o.cloneElement(e,t):e:null,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=vitus-labs-core.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vitus-labs-core.umd.min.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/htmlTags.ts","../src/renderContent.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-underscore-dangle */\nimport { ComponentType } from 'react'\nimport styled, {\n css,\n ThemeProvider,\n ThemedCssFunction,\n StyledInterface,\n DefaultTheme,\n ThemeProviderComponent,\n} from 'styled-components'\nimport type { HTMLTags } from '~/htmlTags'\n\nconst OPTIONS: Internal = {\n styled,\n css,\n styledContext: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as Internal\n\ntype Init = ({\n styled,\n css,\n context,\n component,\n textComponent,\n}: {\n styled: any\n css: any\n context: any\n component?: ComponentType | HTMLTags\n textComponent?: ComponentType | HTMLTags\n}) => void\n\nconst init: Init = ({\n styled,\n css,\n context,\n component = 'div',\n textComponent = 'span',\n}) => {\n OPTIONS.css = css\n OPTIONS.styled = styled\n OPTIONS.styledContext = context\n OPTIONS.component = component\n OPTIONS.textComponent = textComponent\n}\n\ninterface Internal {\n css: ThemedCssFunction<DefaultTheme>\n styled: StyledInterface\n styledContext: ThemeProviderComponent<any, any>\n component: any\n textComponent: any\n}\n\nconst internal: Internal = Object.freeze({\n get css() {\n return OPTIONS.css\n },\n get styled() {\n return OPTIONS.styled\n },\n get styledContext() {\n return OPTIONS.styledContext\n },\n get component() {\n return OPTIONS.component\n },\n get textComponent() {\n return OPTIONS.textComponent\n },\n})\n\nexport { init }\nexport default internal\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(\n param?: T\n) => null | undefined extends T ? true : keyof T extends never ? true : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param) return true\n\n if (typeof param !== 'object') {\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (\n Object.entries(param as any).length === 0 &&\n param.constructor === Object\n ) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { createContext, FC } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Record<string, number | string>\n } & Record<string, unknown>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, unknown>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = config.styledContext\n\n if (StyledContext) {\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n <StyledContext theme={theme}>{children}</StyledContext>\n </VitusLabsProvider>\n )\n }\n\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n {children}\n </VitusLabsProvider>\n )\n}\n\nexport { context }\n\nexport default Provider\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n// const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>\n// fns.reduce((a, b) => (value) => a(b(value)), fn1)\n\n// const compose = (funcs) =>\n// funcs.reduce(\n// (a, b) => (...args) => a(b(...args)),\n// (arg) => arg\n// )\n\ntype ArityOneFn = (arg: any) => any\ntype PickLastInTuple<T extends any[]> = T extends [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ...rest: infer U,\n argn: infer L\n]\n ? L\n : any\ntype FirstFnParameterType<T extends any[]> = Parameters<PickLastInTuple<T>>[any]\ntype LastFnReturnType<T extends any[]> = ReturnType<T[0]>\n\nconst compose =\n <T extends ArityOneFn[]>(...fns: T) =>\n (p: FirstFnParameterType<T>): LastFnReturnType<T> =>\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","const TAGS = [\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'applet',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n 'basefont',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'meta',\n 'meter',\n 'nav',\n 'noframes',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport default TAGS\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport {\n createElement,\n isValidElement,\n cloneElement,\n Children,\n ReactNode,\n ComponentType,\n} from 'react'\nimport isEmpty from './isEmpty'\n\nexport type RenderContent = (\n content?: ReactNode | ComponentType,\n attachProps?: Record<string, any>\n) => ReactNode\n\nconst renderContent: RenderContent = (content, attachProps = {}) => {\n if (!content) return null\n\n if (Array.isArray(content)) {\n return content\n }\n\n if (typeof content === 'function') {\n // @ts-ignore\n return createElement(content, attachProps)\n }\n\n if (isValidElement(content)) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(Children.only(content), attachProps)\n }\n\n // @ts-ignore\n if (typeof content === 'object' && !isEmpty(content)) {\n // FIXME: quick fix for rendering invalid elements\n // no idea of what is going on here yet\n // @ts-ignore\n return createElement(content, attachProps)\n }\n\n return content\n}\n\nexport default renderContent\n"],"names":["OPTIONS","styled","css","styledContext","ThemeProvider","component","textComponent","internal","Object","freeze","isEmpty","param","Array","isArray","length","entries","constructor","context","createContext","VitusLabsProvider","Provider","theme","children","props","React","StyledContext","config","value","fns","p","reduceRight","acc","cur","content","attachProps","createElement","isValidElement","cloneElement","Children","only"],"mappings":"8fAaA,MAAMA,EAAoB,QACxBC,cACAC,MACAC,cAAeC,gBACfC,UAAW,MACXC,cAAe,QAuCXC,EAAqBC,OAAOC,OAAO,CACvCP,UACE,OAAOF,EAAQE,KAEjBD,aACE,OAAOD,EAAQC,QAEjBE,oBACE,OAAOH,EAAQG,eAEjBE,gBACE,OAAOL,EAAQK,WAEjBC,oBACE,OAAON,EAAQM,iBClEbI,EAAoBC,IACnBA,IAEgB,iBAAVA,OAIPC,MAAMC,QAAQF,IAA2B,IAAjBA,EAAMG,SAKQ,IAAxCN,OAAOO,QAAQJ,GAAcG,QAC7BH,EAAMK,cAAgBR,SCbpBS,EAAUC,gBAAmB,IAC7BC,EAAoBF,EAAQG,kkBAeC,EAAGC,MAAAA,EAAOC,SAAAA,KAAaC,MACxD,IAAKF,GAASX,EAAQW,GAAQ,OAAOG,gDAAGF,GAExC,MAAMG,EAAgBC,EAAOvB,cAE7B,OAAIsB,EAEAD,wBAACL,GAAkBQ,MAAO,CAAEN,MAAAA,KAAUE,IACpCC,wBAACC,GAAcJ,MAAOA,GAAQC,IAMlCE,wBAACL,GAAkBQ,MAAO,CAAEN,MAAAA,KAAUE,IACnCD,cCdL,IAA4BM,IAC3BC,GACCD,EAAIE,aAAY,CAACC,EAAUC,IAAaA,EAAID,IAAMF,qCCxBzC,CACX,IACA,OACA,UACA,UACA,SACA,OACA,UACA,QACA,QACA,IACA,OACA,WACA,MACA,MACA,MACA,aACA,OACA,KACA,SACA,SACA,UACA,SACA,OACA,OACA,MACA,WACA,OACA,WACA,KACA,MACA,UACA,MACA,SACA,MACA,MACA,KACA,KACA,KACA,QACA,WACA,aACA,SACA,OACA,SACA,OACA,QACA,WACA,KACA,KACA,KACA,KACA,KACA,KACA,OACA,SACA,KACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,QACA,SACA,KACA,OACA,OACA,MACA,OACA,OACA,QACA,MACA,WACA,WACA,SACA,KACA,WACA,SACA,SACA,IACA,QACA,UACA,MACA,WACA,IACA,KACA,KACA,OACA,IACA,OACA,SACA,UACA,SACA,QACA,SACA,OACA,SACA,SACA,QACA,MACA,UACA,MACA,MACA,QACA,QACA,KACA,WACA,WACA,QACA,KACA,QACA,OACA,QACA,KACA,QACA,KACA,IACA,KACA,MACA,QACA,cJvFiB,EACjB5B,OAAAA,EACAC,IAAAA,EACAe,QAAAA,EACAZ,UAAAA,EAAY,MACZC,cAAAA,EAAgB,WAEhBN,EAAQE,IAAMA,EACdF,EAAQC,OAASA,EACjBD,EAAQG,cAAgBc,EACxBjB,EAAQK,UAAYA,EACpBL,EAAQM,cAAgBA,+BK7BW,CAAC2B,EAASC,EAAc,KACtDD,EAEDrB,MAAMC,QAAQoB,GACTA,EAGc,mBAAZA,EAEFE,gBAAcF,EAASC,GAG5BE,iBAAeH,GACbvB,EAAQwB,GACHD,EAGFI,eAAaC,WAASC,KAAKN,GAAUC,GAIvB,iBAAZD,GAAyBvB,EAAQuB,GAOrCA,EAHEE,gBAAcF,EAASC,GAxBX"}
1
+ {"version":3,"file":"vitus-labs-core.umd.min.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/htmlTags.ts","../src/renderContent.ts"],"sourcesContent":["/* eslint-disable no-underscore-dangle */\nimport { ComponentType } from 'react'\nimport styled, {\n css,\n ThemeProvider,\n ThemedCssFunction,\n StyledInterface,\n DefaultTheme,\n ThemeProviderComponent,\n} from 'styled-components'\nimport type { HTMLTags } from '~/htmlTags'\n\nconst OPTIONS: Internal = {\n styled,\n css,\n styledContext: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as Internal\n\ntype Init = ({\n styled,\n css,\n context,\n component,\n textComponent,\n}: {\n styled: any\n css: any\n context: any\n component?: ComponentType | HTMLTags\n textComponent?: ComponentType | HTMLTags\n}) => void\n\nconst init: Init = ({\n styled,\n css,\n context,\n component = 'div',\n textComponent = 'span',\n}) => {\n OPTIONS.css = css\n OPTIONS.styled = styled\n OPTIONS.styledContext = context\n OPTIONS.component = component\n OPTIONS.textComponent = textComponent\n}\n\ninterface Internal {\n css: ThemedCssFunction<DefaultTheme>\n styled: StyledInterface\n styledContext: ThemeProviderComponent<any, any>\n component: any\n textComponent: any\n}\n\nconst internal: Internal = Object.freeze({\n get css() {\n return OPTIONS.css\n },\n get styled() {\n return OPTIONS.styled\n },\n get styledContext() {\n return OPTIONS.styledContext\n },\n get component() {\n return OPTIONS.component\n },\n get textComponent() {\n return OPTIONS.textComponent\n },\n})\n\nexport { init }\nexport default internal\n","export type IsEmpty = <T extends Record<string, unknown> | unknown[] | null>(\n param?: T\n) => null | undefined extends T ? true : keyof T extends never ? true : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param) return true\n\n if (typeof param !== 'object') {\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (\n Object.entries(param as any).length === 0 &&\n param.constructor === Object\n ) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","import React, { createContext, FC } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Record<string, number | string>\n } & Record<string, unknown>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, unknown>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = config.styledContext\n\n if (StyledContext) {\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n <StyledContext theme={theme}>{children}</StyledContext>\n </VitusLabsProvider>\n )\n }\n\n return (\n <VitusLabsProvider value={{ theme, ...props }}>\n {children}\n </VitusLabsProvider>\n )\n}\n\nexport { context }\n\nexport default Provider\n","// const compose = <R>(fn1: (a: R) => R, ...fns: Array<(a: R) => R>) =>\n// fns.reduce((a, b) => (value) => a(b(value)), fn1)\n\n// const compose = (funcs) =>\n// funcs.reduce(\n// (a, b) => (...args) => a(b(...args)),\n// (arg) => arg\n// )\n\ntype ArityOneFn = (arg: any) => any\ntype PickLastInTuple<T extends any[]> = T extends [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ...rest: infer U,\n argn: infer L\n]\n ? L\n : any\ntype FirstFnParameterType<T extends any[]> = Parameters<PickLastInTuple<T>>[any]\ntype LastFnReturnType<T extends any[]> = ReturnType<T[0]>\n\nconst compose =\n <T extends ArityOneFn[]>(...fns: T) =>\n (p: FirstFnParameterType<T>): LastFnReturnType<T> =>\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","const TAGS = [\n 'a',\n 'abbr',\n // 'acronym',\n 'address',\n // 'applet',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n // 'basefont',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n // 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n // 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n // 'font',\n 'footer',\n 'form',\n // 'frame',\n // 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'meta',\n 'meter',\n 'nav',\n // 'noframes',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n // 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'title',\n 'tr',\n 'track',\n // 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport default TAGS\n","import { isValidElementType, isFragment } from 'react-is'\nimport { createElement, isValidElement, cloneElement, ReactNode } from 'react'\nimport isEmpty from './isEmpty'\n\ntype CreateTypes = Parameters<typeof createElement>[0]\ntype CloneTypes = Parameters<typeof cloneElement>[0]\n\n// export type RenderContent = (\n// content?: CreateTypes | CloneTypes | ReactNode | ReactNode[],\n// attachProps?: Record<string, any>\n// ) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\n// const renderContent: RenderContent = (content, attachProps) => {\n// if (!content) return null as any\n\n// if (typeof content === 'string') {\n// return content\n// }\n\n// if (Array.isArray(content)) {\n// return content\n// }\n\n// if (typeof content === 'function') {\n// return createElement(content, attachProps)\n// }\n\n// if (isValidElement(content)) {\n// if (isEmpty(attachProps)) {\n// return content\n// }\n\n// return cloneElement(Children.only(content), attachProps)\n// }\n\n// if (typeof content === 'object' && !isEmpty(content)) {\n// return createElement(content, attachProps)\n// }\n\n// return content\n// }\n\n// export default renderContent\n\nexport type RenderContent = (\n content?: CreateTypes | CloneTypes | ReactNode | ReactNode[],\n attachProps?: Record<string, any>\n) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\nconst renderContent: RenderContent = (content, attachProps) => {\n if (!content) return null as any\n\n if (typeof content === 'string' && isValidElement(content)) {\n return attachProps\n ? createElement(content, attachProps)\n : createElement(content)\n }\n\n if (['number', 'boolean', 'string'].includes(typeof content)) {\n return content\n }\n\n if (Array.isArray(content) || isFragment(content)) {\n return content\n }\n\n if (isValidElementType(content)) {\n return attachProps\n ? createElement(content, attachProps)\n : createElement(content)\n }\n\n if (isValidElement(content)) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(content, attachProps)\n }\n\n return content\n}\n\nexport default renderContent\n"],"names":["OPTIONS","styled","css","styledContext","ThemeProvider","component","textComponent","internal","Object","freeze","isEmpty","param","Array","isArray","length","entries","constructor","context","createContext","VitusLabsProvider","Provider","theme","children","props","React","StyledContext","config","value","fns","p","reduceRight","acc","cur","content","attachProps","isValidElement","createElement","includes","isFragment","isValidElementType","cloneElement"],"mappings":"yiBAYA,MAAMA,EAAoB,QACxBC,cACAC,MACAC,cAAeC,gBACfC,UAAW,MACXC,cAAe,QAuCXC,EAAqBC,OAAOC,OAAO,CACvCP,UACE,OAAOF,EAAQE,KAEjBD,aACE,OAAOD,EAAQC,QAEjBE,oBACE,OAAOH,EAAQG,eAEjBE,gBACE,OAAOL,EAAQK,WAEjBC,oBACE,OAAON,EAAQM,iBClEbI,EAAoBC,IACnBA,IAEgB,iBAAVA,OAIPC,MAAMC,QAAQF,IAA2B,IAAjBA,EAAMG,SAKQ,IAAxCN,OAAOO,QAAQJ,GAAcG,QAC7BH,EAAMK,cAAgBR,SCbpBS,EAAUC,gBAAmB,IAC7BC,EAAoBF,EAAQG,kkBAeC,EAAGC,MAAAA,EAAOC,SAAAA,KAAaC,MACxD,IAAKF,GAASX,EAAQW,GAAQ,OAAOG,gDAAGF,GAExC,MAAMG,EAAgBC,EAAOvB,cAE7B,OAAIsB,EAEAD,wBAACL,GAAkBQ,MAAO,CAAEN,MAAAA,KAAUE,IACpCC,wBAACC,GAAcJ,MAAOA,GAAQC,IAMlCE,wBAACL,GAAkBQ,MAAO,CAAEN,MAAAA,KAAUE,IACnCD,cCdL,IAA4BM,IAC3BC,GACCD,EAAIE,aAAY,CAACC,EAAUC,IAAaA,EAAID,IAAMF,qCCvBzC,CACX,IACA,OAEA,UAEA,OACA,UACA,QACA,QACA,IACA,OAEA,MACA,MACA,MACA,aACA,OACA,KACA,SACA,SACA,UAEA,OACA,OACA,MACA,WACA,OACA,WACA,KACA,MACA,UACA,MACA,SAEA,MACA,KACA,KACA,KACA,QACA,WACA,aACA,SAEA,SACA,OAGA,KACA,KACA,KACA,KACA,KACA,KACA,OACA,SACA,KACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,QACA,SACA,KACA,OACA,OACA,MACA,OACA,OACA,QACA,MAEA,WACA,SACA,KACA,WACA,SACA,SACA,IACA,QACA,UACA,MACA,WACA,IACA,KACA,KACA,OACA,IACA,OACA,SACA,UACA,SACA,QACA,SACA,OAEA,SACA,QACA,MACA,UACA,MACA,MACA,QACA,QACA,KACA,WACA,WACA,QACA,KACA,QACA,OACA,QACA,KACA,QAEA,IACA,KACA,MACA,QACA,cJxFiB,EACjB5B,OAAAA,EACAC,IAAAA,EACAe,QAAAA,EACAZ,UAAAA,EAAY,MACZC,cAAAA,EAAgB,WAEhBN,EAAQE,IAAMA,EACdF,EAAQC,OAASA,EACjBD,EAAQG,cAAgBc,EACxBjB,EAAQK,UAAYA,EACpBL,EAAQM,cAAgBA,+BKIW,CAAC2B,EAASC,IACxCD,EAEkB,iBAAZA,GAAwBE,iBAAeF,GACzCC,EACHE,gBAAcH,EAASC,GACvBE,gBAAcH,GAGhB,CAAC,SAAU,UAAW,UAAUI,gBAAgBJ,IAIhDrB,MAAMC,QAAQoB,IAAYK,aAAWL,GAHhCA,EAOLM,qBAAmBN,GACdC,EACHE,gBAAcH,EAASC,GACvBE,gBAAcH,GAGhBE,iBAAeF,GACbvB,EAAQwB,GACHD,EAGFO,eAAaP,EAASC,GAGxBD,EA9Bc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/core",
3
- "version": "0.15.2",
3
+ "version": "0.16.0",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
@@ -55,16 +55,17 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "lodash": "^4.17.15",
58
- "moize": "^6.1.0"
58
+ "moize": "^6.1.0",
59
+ "react-is": "^17.0.2"
59
60
  },
60
61
  "devDependencies": {
61
- "@emotion/react": "^11.5.0",
62
- "@emotion/styled": "^11.3.0",
63
- "@types/lodash": "^4.14.176",
64
- "@vitus-labs/tools-babel": "^0.11.0",
65
- "@vitus-labs/tools-rollup": "^0.11.0",
66
- "@vitus-labs/tools-typescript": "^0.11.0",
62
+ "@emotion/react": "^11.7.0",
63
+ "@emotion/styled": "^11.6.0",
64
+ "@types/lodash": "^4.14.177",
65
+ "@vitus-labs/tools-babel": "^0.19.0",
66
+ "@vitus-labs/tools-rollup": "^0.19.0",
67
+ "@vitus-labs/tools-typescript": "^0.19.0",
67
68
  "styled-components": "^5.3.3"
68
69
  },
69
- "gitHead": "289b6e6eb2327d44c015050b0d51adb145163d64"
70
+ "gitHead": "5c2c0471f1c6d444227c70609c85075f5440c5a1"
70
71
  }