@vitus-labs/core 0.23.0 → 0.25.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
6424
6424
  </script>
6425
6425
  <script>
6426
6426
  /*<!--*/
6427
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.js","children":[{"name":"src","children":[{"uid":"0ce5-1","name":"config.ts"},{"uid":"0ce5-3","name":"isEmpty.ts"},{"uid":"0ce5-5","name":"context.tsx"},{"uid":"0ce5-7","name":"compose.ts"},{"uid":"0ce5-9","name":"renderContent.ts"},{"uid":"0ce5-11","name":"htmlTags.ts"},{"uid":"0ce5-13","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"0ce5-1":{"renderedLength":810,"gzipLength":294,"brotliLength":0,"mainUid":"0ce5-0"},"0ce5-3":{"renderedLength":358,"gzipLength":180,"brotliLength":0,"mainUid":"0ce5-2"},"0ce5-5":{"renderedLength":783,"gzipLength":332,"brotliLength":0,"mainUid":"0ce5-4"},"0ce5-7":{"renderedLength":207,"gzipLength":153,"brotliLength":0,"mainUid":"0ce5-6"},"0ce5-9":{"renderedLength":893,"gzipLength":284,"brotliLength":0,"mainUid":"0ce5-8"},"0ce5-11":{"renderedLength":1691,"gzipLength":494,"brotliLength":0,"mainUid":"0ce5-10"},"0ce5-13":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"0ce5-12"}},"nodeMetas":{"0ce5-0":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.js":"0ce5-1"},"imported":[{"uid":"0ce5-16"}],"importedBy":[{"uid":"0ce5-12"},{"uid":"0ce5-4"}]},"0ce5-2":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.js":"0ce5-3"},"imported":[],"importedBy":[{"uid":"0ce5-12"},{"uid":"0ce5-4"},{"uid":"0ce5-8"}]},"0ce5-4":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.js":"0ce5-5"},"imported":[{"uid":"0ce5-17"},{"uid":"0ce5-0"},{"uid":"0ce5-2"}],"importedBy":[{"uid":"0ce5-12"}]},"0ce5-6":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.js":"0ce5-7"},"imported":[],"importedBy":[{"uid":"0ce5-12"}]},"0ce5-8":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.js":"0ce5-9"},"imported":[{"uid":"0ce5-18"},{"uid":"0ce5-17"},{"uid":"0ce5-2"}],"importedBy":[{"uid":"0ce5-12"}]},"0ce5-10":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.js":"0ce5-11"},"imported":[],"importedBy":[{"uid":"0ce5-12"}]},"0ce5-12":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.js":"0ce5-13"},"imported":[{"uid":"0ce5-14"},{"uid":"0ce5-15"},{"uid":"0ce5-0"},{"uid":"0ce5-4"},{"uid":"0ce5-6"},{"uid":"0ce5-2"},{"uid":"0ce5-8"},{"uid":"0ce5-10"}],"importedBy":[],"isEntry":true},"0ce5-14":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-12"}],"isExternal":true},"0ce5-15":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-12"}],"isExternal":true},"0ce5-16":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-0"}],"isExternal":true},"0ce5-17":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-4"},{"uid":"0ce5-8"}],"isExternal":true},"0ce5-18":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-8"}],"isExternal":true}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
6427
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.js","children":[{"name":"src","children":[{"uid":"0528-1","name":"config.ts"},{"uid":"0528-3","name":"isEmpty.ts"},{"uid":"0528-5","name":"context.tsx"},{"uid":"0528-7","name":"compose.ts"},{"uid":"0528-9","name":"renderContent.ts"},{"uid":"0528-11","name":"htmlTags.ts"},{"uid":"0528-13","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"0528-1":{"renderedLength":810,"gzipLength":294,"brotliLength":0,"mainUid":"0528-0"},"0528-3":{"renderedLength":358,"gzipLength":180,"brotliLength":0,"mainUid":"0528-2"},"0528-5":{"renderedLength":783,"gzipLength":332,"brotliLength":0,"mainUid":"0528-4"},"0528-7":{"renderedLength":207,"gzipLength":153,"brotliLength":0,"mainUid":"0528-6"},"0528-9":{"renderedLength":893,"gzipLength":284,"brotliLength":0,"mainUid":"0528-8"},"0528-11":{"renderedLength":1712,"gzipLength":501,"brotliLength":0,"mainUid":"0528-10"},"0528-13":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"0528-12"}},"nodeMetas":{"0528-0":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.js":"0528-1"},"imported":[{"uid":"0528-16"}],"importedBy":[{"uid":"0528-12"},{"uid":"0528-4"}]},"0528-2":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.js":"0528-3"},"imported":[],"importedBy":[{"uid":"0528-12"},{"uid":"0528-4"},{"uid":"0528-8"}]},"0528-4":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.js":"0528-5"},"imported":[{"uid":"0528-17"},{"uid":"0528-0"},{"uid":"0528-2"}],"importedBy":[{"uid":"0528-12"}]},"0528-6":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.js":"0528-7"},"imported":[],"importedBy":[{"uid":"0528-12"}]},"0528-8":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.js":"0528-9"},"imported":[{"uid":"0528-18"},{"uid":"0528-17"},{"uid":"0528-2"}],"importedBy":[{"uid":"0528-12"}]},"0528-10":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.js":"0528-11"},"imported":[],"importedBy":[{"uid":"0528-12"}]},"0528-12":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.js":"0528-13"},"imported":[{"uid":"0528-14"},{"uid":"0528-15"},{"uid":"0528-0"},{"uid":"0528-4"},{"uid":"0528-6"},{"uid":"0528-2"},{"uid":"0528-8"},{"uid":"0528-10"}],"importedBy":[],"isEntry":true},"0528-14":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-12"}],"isExternal":true},"0528-15":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-12"}],"isExternal":true},"0528-16":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-0"}],"isExternal":true},"0528-17":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-4"},{"uid":"0528-8"}],"isExternal":true},"0528-18":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-8"}],"isExternal":true}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
6428
6428
 
6429
6429
  const run = () => {
6430
6430
  const width = window.innerWidth;
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
6424
6424
  </script>
6425
6425
  <script>
6426
6426
  /*<!--*/
6427
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.module.js","children":[{"name":"src","children":[{"uid":"0ce5-20","name":"config.ts"},{"uid":"0ce5-22","name":"isEmpty.ts"},{"uid":"0ce5-24","name":"context.tsx"},{"uid":"0ce5-26","name":"compose.ts"},{"uid":"0ce5-28","name":"renderContent.ts"},{"uid":"0ce5-30","name":"htmlTags.ts"},{"uid":"0ce5-32","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"0ce5-20":{"renderedLength":763,"gzipLength":273,"brotliLength":0,"mainUid":"0ce5-19"},"0ce5-22":{"renderedLength":358,"gzipLength":180,"brotliLength":0,"mainUid":"0ce5-21"},"0ce5-24":{"renderedLength":671,"gzipLength":314,"brotliLength":0,"mainUid":"0ce5-23"},"0ce5-26":{"renderedLength":207,"gzipLength":153,"brotliLength":0,"mainUid":"0ce5-25"},"0ce5-28":{"renderedLength":835,"gzipLength":269,"brotliLength":0,"mainUid":"0ce5-27"},"0ce5-30":{"renderedLength":1691,"gzipLength":494,"brotliLength":0,"mainUid":"0ce5-29"},"0ce5-32":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"0ce5-31"}},"nodeMetas":{"0ce5-19":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.module.js":"0ce5-20"},"imported":[{"uid":"0ce5-35"}],"importedBy":[{"uid":"0ce5-31"},{"uid":"0ce5-23"}]},"0ce5-21":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.module.js":"0ce5-22"},"imported":[],"importedBy":[{"uid":"0ce5-31"},{"uid":"0ce5-23"},{"uid":"0ce5-27"}]},"0ce5-23":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.module.js":"0ce5-24"},"imported":[{"uid":"0ce5-36"},{"uid":"0ce5-19"},{"uid":"0ce5-21"}],"importedBy":[{"uid":"0ce5-31"}]},"0ce5-25":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.module.js":"0ce5-26"},"imported":[],"importedBy":[{"uid":"0ce5-31"}]},"0ce5-27":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.module.js":"0ce5-28"},"imported":[{"uid":"0ce5-37"},{"uid":"0ce5-36"},{"uid":"0ce5-21"}],"importedBy":[{"uid":"0ce5-31"}]},"0ce5-29":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.module.js":"0ce5-30"},"imported":[],"importedBy":[{"uid":"0ce5-31"}]},"0ce5-31":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.module.js":"0ce5-32"},"imported":[{"uid":"0ce5-33"},{"uid":"0ce5-34"},{"uid":"0ce5-19"},{"uid":"0ce5-23"},{"uid":"0ce5-25"},{"uid":"0ce5-21"},{"uid":"0ce5-27"},{"uid":"0ce5-29"}],"importedBy":[],"isEntry":true},"0ce5-33":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-31"}],"isExternal":true},"0ce5-34":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-31"}],"isExternal":true},"0ce5-35":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-19"}],"isExternal":true},"0ce5-36":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-23"},{"uid":"0ce5-27"}],"isExternal":true},"0ce5-37":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-27"}],"isExternal":true}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
6427
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.module.js","children":[{"name":"src","children":[{"uid":"0528-20","name":"config.ts"},{"uid":"0528-22","name":"isEmpty.ts"},{"uid":"0528-24","name":"context.tsx"},{"uid":"0528-26","name":"compose.ts"},{"uid":"0528-28","name":"renderContent.ts"},{"uid":"0528-30","name":"htmlTags.ts"},{"uid":"0528-32","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"0528-20":{"renderedLength":763,"gzipLength":273,"brotliLength":0,"mainUid":"0528-19"},"0528-22":{"renderedLength":358,"gzipLength":180,"brotliLength":0,"mainUid":"0528-21"},"0528-24":{"renderedLength":671,"gzipLength":314,"brotliLength":0,"mainUid":"0528-23"},"0528-26":{"renderedLength":207,"gzipLength":153,"brotliLength":0,"mainUid":"0528-25"},"0528-28":{"renderedLength":835,"gzipLength":269,"brotliLength":0,"mainUid":"0528-27"},"0528-30":{"renderedLength":1712,"gzipLength":501,"brotliLength":0,"mainUid":"0528-29"},"0528-32":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"0528-31"}},"nodeMetas":{"0528-19":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.module.js":"0528-20"},"imported":[{"uid":"0528-35"}],"importedBy":[{"uid":"0528-31"},{"uid":"0528-23"}]},"0528-21":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.module.js":"0528-22"},"imported":[],"importedBy":[{"uid":"0528-31"},{"uid":"0528-23"},{"uid":"0528-27"}]},"0528-23":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.module.js":"0528-24"},"imported":[{"uid":"0528-36"},{"uid":"0528-19"},{"uid":"0528-21"}],"importedBy":[{"uid":"0528-31"}]},"0528-25":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.module.js":"0528-26"},"imported":[],"importedBy":[{"uid":"0528-31"}]},"0528-27":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.module.js":"0528-28"},"imported":[{"uid":"0528-37"},{"uid":"0528-36"},{"uid":"0528-21"}],"importedBy":[{"uid":"0528-31"}]},"0528-29":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.module.js":"0528-30"},"imported":[],"importedBy":[{"uid":"0528-31"}]},"0528-31":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.module.js":"0528-32"},"imported":[{"uid":"0528-33"},{"uid":"0528-34"},{"uid":"0528-19"},{"uid":"0528-23"},{"uid":"0528-25"},{"uid":"0528-21"},{"uid":"0528-27"},{"uid":"0528-29"}],"importedBy":[],"isEntry":true},"0528-33":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-31"}],"isExternal":true},"0528-34":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-31"}],"isExternal":true},"0528-35":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-19"}],"isExternal":true},"0528-36":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-23"},{"uid":"0528-27"}],"isExternal":true},"0528-37":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-27"}],"isExternal":true}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
6428
6428
 
6429
6429
  const run = () => {
6430
6430
  const width = window.innerWidth;
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
6424
6424
  </script>
6425
6425
  <script>
6426
6426
  /*<!--*/
6427
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.umd.js","children":[{"name":"src","children":[{"uid":"0ce5-39","name":"config.ts"},{"uid":"0ce5-41","name":"isEmpty.ts"},{"uid":"0ce5-43","name":"context.tsx"},{"uid":"0ce5-45","name":"compose.ts"},{"uid":"0ce5-47","name":"renderContent.ts"},{"uid":"0ce5-49","name":"htmlTags.ts"},{"uid":"0ce5-51","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"0ce5-39":{"renderedLength":872,"gzipLength":297,"brotliLength":0,"mainUid":"0ce5-38"},"0ce5-41":{"renderedLength":388,"gzipLength":181,"brotliLength":0,"mainUid":"0ce5-40"},"0ce5-43":{"renderedLength":809,"gzipLength":332,"brotliLength":0,"mainUid":"0ce5-42"},"0ce5-45":{"renderedLength":213,"gzipLength":155,"brotliLength":0,"mainUid":"0ce5-44"},"0ce5-47":{"renderedLength":947,"gzipLength":287,"brotliLength":0,"mainUid":"0ce5-46"},"0ce5-49":{"renderedLength":1939,"gzipLength":500,"brotliLength":0,"mainUid":"0ce5-48"},"0ce5-51":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"0ce5-50"}},"nodeMetas":{"0ce5-38":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.umd.js":"0ce5-39"},"imported":[{"uid":"0ce5-54"}],"importedBy":[{"uid":"0ce5-50"},{"uid":"0ce5-42"}]},"0ce5-40":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.umd.js":"0ce5-41"},"imported":[],"importedBy":[{"uid":"0ce5-50"},{"uid":"0ce5-42"},{"uid":"0ce5-46"}]},"0ce5-42":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.umd.js":"0ce5-43"},"imported":[{"uid":"0ce5-55"},{"uid":"0ce5-38"},{"uid":"0ce5-40"}],"importedBy":[{"uid":"0ce5-50"}]},"0ce5-44":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.umd.js":"0ce5-45"},"imported":[],"importedBy":[{"uid":"0ce5-50"}]},"0ce5-46":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.umd.js":"0ce5-47"},"imported":[{"uid":"0ce5-56"},{"uid":"0ce5-55"},{"uid":"0ce5-40"}],"importedBy":[{"uid":"0ce5-50"}]},"0ce5-48":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.umd.js":"0ce5-49"},"imported":[],"importedBy":[{"uid":"0ce5-50"}]},"0ce5-50":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.umd.js":"0ce5-51"},"imported":[{"uid":"0ce5-52"},{"uid":"0ce5-53"},{"uid":"0ce5-38"},{"uid":"0ce5-42"},{"uid":"0ce5-44"},{"uid":"0ce5-40"},{"uid":"0ce5-46"},{"uid":"0ce5-48"}],"importedBy":[],"isEntry":true},"0ce5-52":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-50"}],"isExternal":true},"0ce5-53":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-50"}],"isExternal":true},"0ce5-54":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-38"}],"isExternal":true},"0ce5-55":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-42"},{"uid":"0ce5-46"}],"isExternal":true},"0ce5-56":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-46"}],"isExternal":true}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
6427
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.umd.js","children":[{"name":"src","children":[{"uid":"0528-39","name":"config.ts"},{"uid":"0528-41","name":"isEmpty.ts"},{"uid":"0528-43","name":"context.tsx"},{"uid":"0528-45","name":"compose.ts"},{"uid":"0528-47","name":"renderContent.ts"},{"uid":"0528-49","name":"htmlTags.ts"},{"uid":"0528-51","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"0528-39":{"renderedLength":872,"gzipLength":297,"brotliLength":0,"mainUid":"0528-38"},"0528-41":{"renderedLength":388,"gzipLength":181,"brotliLength":0,"mainUid":"0528-40"},"0528-43":{"renderedLength":809,"gzipLength":332,"brotliLength":0,"mainUid":"0528-42"},"0528-45":{"renderedLength":213,"gzipLength":155,"brotliLength":0,"mainUid":"0528-44"},"0528-47":{"renderedLength":947,"gzipLength":287,"brotliLength":0,"mainUid":"0528-46"},"0528-49":{"renderedLength":1960,"gzipLength":509,"brotliLength":0,"mainUid":"0528-48"},"0528-51":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"0528-50"}},"nodeMetas":{"0528-38":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.umd.js":"0528-39"},"imported":[{"uid":"0528-54"}],"importedBy":[{"uid":"0528-50"},{"uid":"0528-42"}]},"0528-40":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.umd.js":"0528-41"},"imported":[],"importedBy":[{"uid":"0528-50"},{"uid":"0528-42"},{"uid":"0528-46"}]},"0528-42":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.umd.js":"0528-43"},"imported":[{"uid":"0528-55"},{"uid":"0528-38"},{"uid":"0528-40"}],"importedBy":[{"uid":"0528-50"}]},"0528-44":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.umd.js":"0528-45"},"imported":[],"importedBy":[{"uid":"0528-50"}]},"0528-46":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.umd.js":"0528-47"},"imported":[{"uid":"0528-56"},{"uid":"0528-55"},{"uid":"0528-40"}],"importedBy":[{"uid":"0528-50"}]},"0528-48":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.umd.js":"0528-49"},"imported":[],"importedBy":[{"uid":"0528-50"}]},"0528-50":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.umd.js":"0528-51"},"imported":[{"uid":"0528-52"},{"uid":"0528-53"},{"uid":"0528-38"},{"uid":"0528-42"},{"uid":"0528-44"},{"uid":"0528-40"},{"uid":"0528-46"},{"uid":"0528-48"}],"importedBy":[],"isEntry":true},"0528-52":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-50"}],"isExternal":true},"0528-53":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-50"}],"isExternal":true},"0528-54":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-38"}],"isExternal":true},"0528-55":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-42"},{"uid":"0528-46"}],"isExternal":true},"0528-56":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-46"}],"isExternal":true}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
6428
6428
 
6429
6429
  const run = () => {
6430
6430
  const width = window.innerWidth;
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
6424
6424
  </script>
6425
6425
  <script>
6426
6426
  /*<!--*/
6427
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.umd.min.js","children":[{"name":"src","children":[{"uid":"0ce5-58","name":"config.ts"},{"uid":"0ce5-60","name":"isEmpty.ts"},{"uid":"0ce5-62","name":"context.tsx"},{"uid":"0ce5-64","name":"compose.ts"},{"uid":"0ce5-66","name":"renderContent.ts"},{"uid":"0ce5-68","name":"htmlTags.ts"},{"uid":"0ce5-70","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"0ce5-58":{"renderedLength":872,"gzipLength":297,"brotliLength":0,"mainUid":"0ce5-57"},"0ce5-60":{"renderedLength":388,"gzipLength":181,"brotliLength":0,"mainUid":"0ce5-59"},"0ce5-62":{"renderedLength":809,"gzipLength":332,"brotliLength":0,"mainUid":"0ce5-61"},"0ce5-64":{"renderedLength":213,"gzipLength":155,"brotliLength":0,"mainUid":"0ce5-63"},"0ce5-66":{"renderedLength":947,"gzipLength":287,"brotliLength":0,"mainUid":"0ce5-65"},"0ce5-68":{"renderedLength":1939,"gzipLength":500,"brotliLength":0,"mainUid":"0ce5-67"},"0ce5-70":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"0ce5-69"}},"nodeMetas":{"0ce5-57":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0ce5-58"},"imported":[{"uid":"0ce5-73"}],"importedBy":[{"uid":"0ce5-69"},{"uid":"0ce5-61"}]},"0ce5-59":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0ce5-60"},"imported":[],"importedBy":[{"uid":"0ce5-69"},{"uid":"0ce5-61"},{"uid":"0ce5-65"}]},"0ce5-61":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.umd.min.js":"0ce5-62"},"imported":[{"uid":"0ce5-74"},{"uid":"0ce5-57"},{"uid":"0ce5-59"}],"importedBy":[{"uid":"0ce5-69"}]},"0ce5-63":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0ce5-64"},"imported":[],"importedBy":[{"uid":"0ce5-69"}]},"0ce5-65":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0ce5-66"},"imported":[{"uid":"0ce5-75"},{"uid":"0ce5-74"},{"uid":"0ce5-59"}],"importedBy":[{"uid":"0ce5-69"}]},"0ce5-67":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0ce5-68"},"imported":[],"importedBy":[{"uid":"0ce5-69"}]},"0ce5-69":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0ce5-70"},"imported":[{"uid":"0ce5-71"},{"uid":"0ce5-72"},{"uid":"0ce5-57"},{"uid":"0ce5-61"},{"uid":"0ce5-63"},{"uid":"0ce5-59"},{"uid":"0ce5-65"},{"uid":"0ce5-67"}],"importedBy":[],"isEntry":true},"0ce5-71":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-69"}],"isExternal":true},"0ce5-72":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-69"}],"isExternal":true},"0ce5-73":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-57"}],"isExternal":true},"0ce5-74":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-61"},{"uid":"0ce5-65"}],"isExternal":true},"0ce5-75":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"0ce5-65"}],"isExternal":true}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
6427
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.umd.min.js","children":[{"name":"src","children":[{"uid":"0528-58","name":"config.ts"},{"uid":"0528-60","name":"isEmpty.ts"},{"uid":"0528-62","name":"context.tsx"},{"uid":"0528-64","name":"compose.ts"},{"uid":"0528-66","name":"renderContent.ts"},{"uid":"0528-68","name":"htmlTags.ts"},{"uid":"0528-70","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"0528-58":{"renderedLength":872,"gzipLength":297,"brotliLength":0,"mainUid":"0528-57"},"0528-60":{"renderedLength":388,"gzipLength":181,"brotliLength":0,"mainUid":"0528-59"},"0528-62":{"renderedLength":809,"gzipLength":332,"brotliLength":0,"mainUid":"0528-61"},"0528-64":{"renderedLength":213,"gzipLength":155,"brotliLength":0,"mainUid":"0528-63"},"0528-66":{"renderedLength":947,"gzipLength":287,"brotliLength":0,"mainUid":"0528-65"},"0528-68":{"renderedLength":1960,"gzipLength":509,"brotliLength":0,"mainUid":"0528-67"},"0528-70":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"0528-69"}},"nodeMetas":{"0528-57":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0528-58"},"imported":[{"uid":"0528-73"}],"importedBy":[{"uid":"0528-69"},{"uid":"0528-61"}]},"0528-59":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0528-60"},"imported":[],"importedBy":[{"uid":"0528-69"},{"uid":"0528-61"},{"uid":"0528-65"}]},"0528-61":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.umd.min.js":"0528-62"},"imported":[{"uid":"0528-74"},{"uid":"0528-57"},{"uid":"0528-59"}],"importedBy":[{"uid":"0528-69"}]},"0528-63":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0528-64"},"imported":[],"importedBy":[{"uid":"0528-69"}]},"0528-65":{"id":"/src/renderContent.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0528-66"},"imported":[{"uid":"0528-75"},{"uid":"0528-74"},{"uid":"0528-59"}],"importedBy":[{"uid":"0528-69"}]},"0528-67":{"id":"/src/htmlTags.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0528-68"},"imported":[],"importedBy":[{"uid":"0528-69"}]},"0528-69":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.umd.min.js":"0528-70"},"imported":[{"uid":"0528-71"},{"uid":"0528-72"},{"uid":"0528-57"},{"uid":"0528-61"},{"uid":"0528-63"},{"uid":"0528-59"},{"uid":"0528-65"},{"uid":"0528-67"}],"importedBy":[],"isEntry":true},"0528-71":{"id":"lodash","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-69"}],"isExternal":true},"0528-72":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-69"}],"isExternal":true},"0528-73":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-57"}],"isExternal":true},"0528-74":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-61"},{"uid":"0528-65"}],"isExternal":true},"0528-75":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"0528-65"}],"isExternal":true}},"env":{"rollup":"2.67.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
6428
6428
 
6429
6429
  const run = () => {
6430
6430
  const width = window.innerWidth;
package/lib/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import React__default, { ComponentType, FC, ReactNode, createElement, cloneElement } from 'react';
5
5
  import { ThemedCssFunction, DefaultTheme, StyledInterface, ThemeProviderComponent } from 'styled-components';
6
6
 
7
- 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", "tr", "track", "u", "ul", "var", "video", "wbr"];
7
+ declare const TAGS: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "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", "header", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "meter", "nav", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "var", "video", "wbr"];
8
8
  declare const TEXT_TAGS: readonly ["abbr", "b", "bdi", "bdo", "big", "blockquote", "cite", "code", "dl", "dt", "em", "figcaption", "h1", "h2", "h3", "h4", "h5", "h6", "i", "ins", "kbd", "label", "legend", "li", "p", "pre", "q", "rp", "rt", "s", "small", "span", "strong", "sub", "summary", "sup", "time", "u"];
9
9
  declare type HTMLTags = typeof TAGS[number];
10
10
  declare type HTMLTagsText = typeof TEXT_TAGS[number];
@@ -1,4 +1,4 @@
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", "tr", "track", "u", "ul", "var", "video", "wbr"];
1
+ declare const TAGS: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "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", "header", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "meter", "nav", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "var", "video", "wbr"];
2
2
  declare const TEXT_TAGS: readonly ["abbr", "b", "bdi", "bdo", "big", "blockquote", "cite", "code", "dl", "dt", "em", "figcaption", "h1", "h2", "h3", "h4", "h5", "h6", "i", "ins", "kbd", "label", "legend", "li", "p", "pre", "q", "rp", "rt", "s", "small", "span", "strong", "sub", "summary", "sup", "time", "u"];
3
3
  export declare type HTMLTags = typeof TAGS[number];
4
4
  export declare type HTMLTagsText = typeof TEXT_TAGS[number];
@@ -119,7 +119,7 @@ const TAGS = [
119
119
  'aside',
120
120
  'audio',
121
121
  'b',
122
- 'base',
122
+ // 'base',
123
123
  // 'basefont',
124
124
  'bdi',
125
125
  'bdo',
@@ -162,7 +162,7 @@ const TAGS = [
162
162
  'h4',
163
163
  'h5',
164
164
  'h6',
165
- 'head',
165
+ // 'head',
166
166
  'header',
167
167
  'hr',
168
168
  'html',
@@ -175,22 +175,22 @@ const TAGS = [
175
175
  'label',
176
176
  'legend',
177
177
  'li',
178
- 'link',
178
+ // 'link',
179
179
  'main',
180
180
  'map',
181
181
  'mark',
182
- 'meta',
182
+ // 'meta',
183
183
  'meter',
184
184
  'nav',
185
185
  // 'noframes',
186
- 'noscript',
186
+ // 'noscript',
187
187
  'object',
188
188
  'ol',
189
189
  'optgroup',
190
190
  'option',
191
191
  'output',
192
192
  'p',
193
- 'param',
193
+ // 'param',
194
194
  'picture',
195
195
  'pre',
196
196
  'progress',
@@ -200,7 +200,7 @@ const TAGS = [
200
200
  'ruby',
201
201
  's',
202
202
  'samp',
203
- 'script',
203
+ // 'script',
204
204
  'section',
205
205
  'select',
206
206
  'small',
@@ -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":["import { 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, useMemo } 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, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = useMemo(() => 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\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\nconst TEXT_TAGS = [\n 'abbr',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'cite',\n 'code',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 's',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'time',\n 'u',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport type HTMLTagsText = typeof TEXT_TAGS[number]\n\nexport default TAGS\n"],"names":["styled","css","ThemeProvider","createContext","React","useMemo","config","isValidElement","createElement","isFragment","isValidElementType","cloneElement"],"mappings":";;;;;;;;;;;;;;;;AAWA,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;KAC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,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,SAAS;;IAET,MAAM;IACN,MAAM;IACN,KAAK;IACL,UAAU;IACV,MAAM;IACN,UAAU;IACV,IAAI;IACJ,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;;IAEN,IAAI;IACJ,OAAO;;IAEP,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":["import { 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, useMemo } 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, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = useMemo(() => 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\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\nconst TEXT_TAGS = [\n 'abbr',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'cite',\n 'code',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 's',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'time',\n 'u',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport type HTMLTagsText = typeof TEXT_TAGS[number]\n\nexport default TAGS\n"],"names":["styled","css","ThemeProvider","createContext","React","useMemo","config","isValidElement","createElement","isFragment","isValidElementType","cloneElement"],"mappings":";;;;;;;;;;;;;;;;AAWA,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,O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112
- 'base',
112
+ // 'base',
113
113
  // 'basefont',
114
114
  'bdi',
115
115
  'bdo',
@@ -152,7 +152,7 @@ const TAGS = [
152
152
  'h4',
153
153
  'h5',
154
154
  'h6',
155
- 'head',
155
+ // 'head',
156
156
  'header',
157
157
  'hr',
158
158
  'html',
@@ -165,22 +165,22 @@ const TAGS = [
165
165
  'label',
166
166
  'legend',
167
167
  'li',
168
- 'link',
168
+ // 'link',
169
169
  'main',
170
170
  'map',
171
171
  'mark',
172
- 'meta',
172
+ // 'meta',
173
173
  'meter',
174
174
  'nav',
175
175
  // 'noframes',
176
- 'noscript',
176
+ // 'noscript',
177
177
  'object',
178
178
  'ol',
179
179
  'optgroup',
180
180
  'option',
181
181
  'output',
182
182
  'p',
183
- 'param',
183
+ // 'param',
184
184
  'picture',
185
185
  'pre',
186
186
  'progress',
@@ -190,7 +190,7 @@ const TAGS = [
190
190
  'ruby',
191
191
  's',
192
192
  'samp',
193
- 'script',
193
+ // 'script',
194
194
  'section',
195
195
  'select',
196
196
  'small',
@@ -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":["import { 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, useMemo } 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, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = useMemo(() => 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\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\nconst TEXT_TAGS = [\n 'abbr',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'cite',\n 'code',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 's',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'time',\n 'u',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport type HTMLTagsText = typeof T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M;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;;IAEN,IAAI;IACJ,OAAO;;IAEP,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":["import { 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, useMemo } 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, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = useMemo(() => 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\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\nconst TEXT_TAGS = [\n 'abbr',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'cite',\n 'code',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 's',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'time',\n 'u',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport type HTMLTagsText = typeof TEXT_TAGS[number]\n\nexport default TAGS\n"],"names":["config"],"mappings":";;;;;;AAWA,MAAM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,QAAQ;IACR,QAAQ;IACR,GAAG;;IAEH,SAAS;IACT,KAAK;IACL,UAAU;IACV,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,GAAG;IACH,MAAM;;IAEN,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;;IAEN,IAAI;IACJ,OAAO;;IAEP,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,KAAK;;;;;"}
@@ -115,7 +115,7 @@
115
115
  'aside',
116
116
  'audio',
117
117
  'b',
118
- 'base',
118
+ // 'base',
119
119
  // 'basefont',
120
120
  'bdi',
121
121
  'bdo',
@@ -158,7 +158,7 @@
158
158
  'h4',
159
159
  'h5',
160
160
  'h6',
161
- 'head',
161
+ // 'head',
162
162
  'header',
163
163
  'hr',
164
164
  'html',
@@ -171,22 +171,22 @@
171
171
  'label',
172
172
  'legend',
173
173
  'li',
174
- 'link',
174
+ // 'link',
175
175
  'main',
176
176
  'map',
177
177
  'mark',
178
- 'meta',
178
+ // 'meta',
179
179
  'meter',
180
180
  'nav',
181
181
  // 'noframes',
182
- 'noscript',
182
+ // 'noscript',
183
183
  'object',
184
184
  'ol',
185
185
  'optgroup',
186
186
  'option',
187
187
  'output',
188
188
  'p',
189
- 'param',
189
+ // 'param',
190
190
  'picture',
191
191
  'pre',
192
192
  'progress',
@@ -196,7 +196,7 @@
196
196
  'ruby',
197
197
  's',
198
198
  'samp',
199
- 'script',
199
+ // 'script',
200
200
  'section',
201
201
  'select',
202
202
  'small',
@@ -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":["import { 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, useMemo } 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, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = useMemo(() => 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\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\nconst TEXT_TAGS = [\n 'abbr',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'cite',\n 'code',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 's',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'time',\n 'u',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport type HTMLTagsText = typeof TEXT_TAGS[number]\n\nexport default TAGS\n"],"names":["styled","css","ThemeProvider","createContext","React","useMemo","config","isValidElement","createElement","isFragment","isValidElementType","cloneElement"],"mappings":";;;;;;;;;;;;EAWA,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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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":["import { 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, useMemo } 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, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = useMemo(() => 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\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\nconst TEXT_TAGS = [\n 'abbr',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'cite',\n 'code',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 's',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'time',\n 'u',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport type HTMLTagsText = typeof TEXT_TAGS[number]\n\nexport default TAGS\n"],"names":["styled","css","ThemeProvider","createContext","React","useMemo","config","isValidElement","createElement","isFragment","isValidElementType","cloneElement"],"mappings":";;;;;;;;;;;;EAWA,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;UAC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;;;;;;;;;;"}
@@ -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"),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=o.useMemo((()=>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","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})}));
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 l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(r),s=l(n),c=l(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 a.default}}),e.Provider=({theme:e,children:t,...r})=>{if(!e||m(e))return c.default.createElement(c.default.Fragment,null,t);const n=o.useMemo((()=>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","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","header","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","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":["import { 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, useMemo } 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, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = useMemo(() => 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\nconst TEXT_TAGS = [\n 'abbr',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'cite',\n 'code',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 's',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'time',\n 'u',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport type HTMLTagsText = typeof TEXT_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\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","useMemo","config","value","fns","p","reduceRight","acc","cur","content","attachProps","isValidElement","createElement","includes","isFragment","isValidElementType","cloneElement"],"mappings":"yiBAWA,MAAMA,EAAoB,QACxBC,cACAC,MACAC,cAAeC,gBACfC,UAAW,MACXC,cAAe,QAuCXC,EAAqBC,OAAOC,OAAO,CACnCP,UACF,OAAOF,EAAQE,KAEbD,aACF,OAAOD,EAAQC,QAEbE,oBACF,OAAOH,EAAQG,eAEbE,gBACF,OAAOL,EAAQK,WAEbC,oBACF,OAAON,EAAQM,iBCjEbI,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,MAExD,IAAKF,GAASX,EAAQW,GAAQ,OAAOG,gDAAGF,GAExC,MAAMG,EAAgBC,WAAQ,IAAMC,EAAOxB,eAAe,IAE1D,OAAIsB,EAEAD,wBAACL,GAAkBS,MAAO,CAAEP,MAAAA,KAAUE,IACpCC,wBAACC,GAAcJ,MAAOA,GAAQC,IAMlCE,wBAACL,GAAkBS,MAAO,CAAEP,MAAAA,KAAUE,IACnCD,cCfL,IAA4BO,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,OAEA,KACA,QAEA,IACA,KACA,MACA,QACA,cJzFiB,EACjB7B,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,+BKhCW,CAAC4B,EAASC,IACxCD,EAEkB,iBAAZA,GAAwBE,iBAAeF,GACzCC,EACHE,gBAAcH,EAASC,GACvBE,gBAAcH,GAGhB,CAAC,SAAU,UAAW,UAAUI,gBAAgBJ,IAIhDtB,MAAMC,QAAQqB,IAAYK,aAAWL,GAHhCA,EAOLM,qBAAmBN,GACdC,EACHE,gBAAcH,EAASC,GACvBE,gBAAcH,GAGhBE,iBAAeF,GACbxB,EAAQyB,GACHD,EAGFO,eAAaP,EAASC,GAGxBD,EA9Bc"}
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":["import { 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, useMemo } 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, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n if (!theme || isEmpty(theme)) return <>{children}</>\n\n const StyledContext = useMemo(() => 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\nconst TEXT_TAGS = [\n 'abbr',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'cite',\n 'code',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 's',\n 'small',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'time',\n 'u',\n] as const\n\nexport type HTMLTags = typeof TAGS[number]\n\nexport type HTMLTagsText = typeof TEXT_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\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","useMemo","config","value","fns","p","reduceRight","acc","cur","content","attachProps","isValidElement","createElement","includes","isFragment","isValidElementType","cloneElement"],"mappings":"yiBAWA,MAAMA,EAAoB,QACxBC,cACAC,MACAC,cAAeC,gBACfC,UAAW,MACXC,cAAe,QAuCXC,EAAqBC,OAAOC,OAAO,CACnCP,UACF,OAAOF,EAAQE,KAEbD,aACF,OAAOD,EAAQC,QAEbE,o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,UAAAA,EAAY,MACZC,cAAAA,EAAgB,WAEhBN,EAAQE,IAAMA,EACdF,EAAQC,OAASA,EACjBD,EAAQG,cAAgBc,EACxBjB,EAAQK,UAAYA,EACpBL,EAAQM,cAAgBA,+BKhCW,CAAC4B,EAASC,IACxCD,EAEkB,iBAAZA,GAAwBE,iBAAeF,GACzCC,EACHE,gBAAcH,EAASC,GACvBE,gBAAcH,GAGhB,CAAC,SAAU,UAAW,UAAUI,gBAAgBJ,IAIhDtB,MAAMC,QAAQqB,IAAYK,aAAWL,GAHhCA,EAOLM,qBAAmBN,GACdC,EACHE,gBAAcH,EAASC,GACvBE,gBAAcH,GAGhBE,iBAAeF,GACbxB,EAAQyB,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.23.0",
3
+ "version": "0.25.0-alpha.2",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
@@ -67,5 +67,5 @@
67
67
  "@vitus-labs/tools-typescript": "^0.26.0",
68
68
  "styled-components": "^5.3.3"
69
69
  },
70
- "gitHead": "8489b879603bbd846769eba1b14fcf6983cfe8f5"
70
+ "gitHead": "99ed8f411ae975fca2ff9421971658a4d84970e3"
71
71
  }