@vitus-labs/core 1.0.0-alpha.4 → 1.0.0-alpha.6

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.
@@ -5,7 +5,7 @@
5
5
  <meta charset="UTF-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
8
- <title>@vitus-labs/core - vitus-labs-core.module.js</title>
8
+ <title>@vitus-labs/core - index.js</title>
9
9
  <style>
10
10
  :root {
11
11
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
@@ -5285,7 +5285,7 @@ var drawChart = (function (exports) {
5285
5285
  </script>
5286
5286
  <script>
5287
5287
  /*<!--*/
5288
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-core.module.js","children":[{"name":"src","children":[{"uid":"7a37-1","name":"config.ts"},{"uid":"7a37-3","name":"isEmpty.ts"},{"uid":"7a37-5","name":"context.tsx"},{"uid":"7a37-7","name":"compose.ts"},{"uid":"7a37-9","name":"render.ts"},{"name":"html/htmlTags.ts","uid":"7a37-11"},{"uid":"7a37-13","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"7a37-1":{"renderedLength":1010,"gzipLength":313,"brotliLength":0,"metaUid":"7a37-0"},"7a37-3":{"renderedLength":426,"gzipLength":226,"brotliLength":0,"metaUid":"7a37-2"},"7a37-5":{"renderedLength":655,"gzipLength":282,"brotliLength":0,"metaUid":"7a37-4"},"7a37-7":{"renderedLength":178,"gzipLength":142,"brotliLength":0,"metaUid":"7a37-6"},"7a37-9":{"renderedLength":835,"gzipLength":330,"brotliLength":0,"metaUid":"7a37-8"},"7a37-11":{"renderedLength":2052,"gzipLength":567,"brotliLength":0,"metaUid":"7a37-10"},"7a37-13":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"7a37-12"}},"nodeMetas":{"7a37-0":{"id":"/src/config.ts","moduleParts":{"vitus-labs-core.module.js":"7a37-1"},"imported":[{"uid":"7a37-17"}],"importedBy":[{"uid":"7a37-12"},{"uid":"7a37-4"}]},"7a37-2":{"id":"/src/isEmpty.ts","moduleParts":{"vitus-labs-core.module.js":"7a37-3"},"imported":[],"importedBy":[{"uid":"7a37-12"},{"uid":"7a37-4"},{"uid":"7a37-8"}]},"7a37-4":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-core.module.js":"7a37-5"},"imported":[{"uid":"7a37-18"},{"uid":"7a37-0"},{"uid":"7a37-2"}],"importedBy":[{"uid":"7a37-12"}]},"7a37-6":{"id":"/src/compose.ts","moduleParts":{"vitus-labs-core.module.js":"7a37-7"},"imported":[],"importedBy":[{"uid":"7a37-12"}]},"7a37-8":{"id":"/src/render.ts","moduleParts":{"vitus-labs-core.module.js":"7a37-9"},"imported":[{"uid":"7a37-19"},{"uid":"7a37-18"},{"uid":"7a37-2"}],"importedBy":[{"uid":"7a37-12"}]},"7a37-10":{"id":"/src/html/htmlTags.ts","moduleParts":{"vitus-labs-core.module.js":"7a37-11"},"imported":[],"importedBy":[{"uid":"7a37-16"}]},"7a37-12":{"id":"/src/index.ts","moduleParts":{"vitus-labs-core.module.js":"7a37-13"},"imported":[{"uid":"7a37-14"},{"uid":"7a37-15"},{"uid":"7a37-0"},{"uid":"7a37-4"},{"uid":"7a37-6"},{"uid":"7a37-2"},{"uid":"7a37-8"},{"uid":"7a37-16"}],"importedBy":[],"isEntry":true},"7a37-14":{"id":"lodash-es","moduleParts":{},"imported":[],"importedBy":[{"uid":"7a37-12"}],"isExternal":true},"7a37-15":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"7a37-12"}],"isExternal":true},"7a37-16":{"id":"/src/html/index.ts","moduleParts":{},"imported":[{"uid":"7a37-10"}],"importedBy":[{"uid":"7a37-12"}]},"7a37-17":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"7a37-0"}],"isExternal":true},"7a37-18":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"7a37-4"},{"uid":"7a37-8"}],"isExternal":true},"7a37-19":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"7a37-8"}],"isExternal":true}},"env":{"rollup":"3.26.3"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
5288
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"87a2-1","name":"config.ts"},{"uid":"87a2-3","name":"isEmpty.ts"},{"uid":"87a2-5","name":"context.tsx"},{"uid":"87a2-7","name":"compose.ts"},{"uid":"87a2-9","name":"render.ts"},{"name":"html/htmlTags.ts","uid":"87a2-11"},{"uid":"87a2-13","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"87a2-1":{"renderedLength":1010,"gzipLength":313,"brotliLength":0,"metaUid":"87a2-0"},"87a2-3":{"renderedLength":426,"gzipLength":226,"brotliLength":0,"metaUid":"87a2-2"},"87a2-5":{"renderedLength":655,"gzipLength":282,"brotliLength":0,"metaUid":"87a2-4"},"87a2-7":{"renderedLength":178,"gzipLength":142,"brotliLength":0,"metaUid":"87a2-6"},"87a2-9":{"renderedLength":835,"gzipLength":330,"brotliLength":0,"metaUid":"87a2-8"},"87a2-11":{"renderedLength":2052,"gzipLength":567,"brotliLength":0,"metaUid":"87a2-10"},"87a2-13":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"87a2-12"}},"nodeMetas":{"87a2-0":{"id":"/src/config.ts","moduleParts":{"index.js":"87a2-1"},"imported":[{"uid":"87a2-17"}],"importedBy":[{"uid":"87a2-12"},{"uid":"87a2-4"}]},"87a2-2":{"id":"/src/isEmpty.ts","moduleParts":{"index.js":"87a2-3"},"imported":[],"importedBy":[{"uid":"87a2-12"},{"uid":"87a2-4"},{"uid":"87a2-8"}]},"87a2-4":{"id":"/src/context.tsx","moduleParts":{"index.js":"87a2-5"},"imported":[{"uid":"87a2-18"},{"uid":"87a2-0"},{"uid":"87a2-2"}],"importedBy":[{"uid":"87a2-12"}]},"87a2-6":{"id":"/src/compose.ts","moduleParts":{"index.js":"87a2-7"},"imported":[],"importedBy":[{"uid":"87a2-12"}]},"87a2-8":{"id":"/src/render.ts","moduleParts":{"index.js":"87a2-9"},"imported":[{"uid":"87a2-18"},{"uid":"87a2-19"},{"uid":"87a2-2"}],"importedBy":[{"uid":"87a2-12"}]},"87a2-10":{"id":"/src/html/htmlTags.ts","moduleParts":{"index.js":"87a2-11"},"imported":[],"importedBy":[{"uid":"87a2-16"}]},"87a2-12":{"id":"/src/index.ts","moduleParts":{"index.js":"87a2-13"},"imported":[{"uid":"87a2-14"},{"uid":"87a2-15"},{"uid":"87a2-0"},{"uid":"87a2-4"},{"uid":"87a2-6"},{"uid":"87a2-2"},{"uid":"87a2-8"},{"uid":"87a2-16"}],"importedBy":[],"isEntry":true},"87a2-14":{"id":"lodash-es","moduleParts":{},"imported":[],"importedBy":[{"uid":"87a2-12"}],"isExternal":true},"87a2-15":{"id":"moize","moduleParts":{},"imported":[],"importedBy":[{"uid":"87a2-12"}],"isExternal":true},"87a2-16":{"id":"/src/html/index.ts","moduleParts":{},"imported":[{"uid":"87a2-10"}],"importedBy":[{"uid":"87a2-12"}]},"87a2-17":{"id":"styled-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"87a2-0"}],"isExternal":true},"87a2-18":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"87a2-4"},{"uid":"87a2-8"}],"isExternal":true},"87a2-19":{"id":"react-is","moduleParts":{},"imported":[],"importedBy":[{"uid":"87a2-8"}],"isExternal":true}},"env":{"rollup":"3.29.4"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
5289
5289
 
5290
5290
  const run = () => {
5291
5291
  const width = window.innerWidth;
package/lib/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { cloneElement } from 'react';
2
- import { ComponentType } from 'react';
2
+ import type { ComponentType } from 'react';
3
3
  import { createElement } from 'react';
4
4
  import { css } from 'styled-components';
5
- import { FC } from 'react';
5
+ import type { FC } from 'react';
6
6
  import { get } from 'lodash-es';
7
7
  import memoize from 'moize';
8
8
  import { merge } from 'lodash-es';
@@ -10,7 +10,7 @@ import { omit } from 'lodash-es';
10
10
  import { pick } from 'lodash-es';
11
11
  import * as React_2 from 'react';
12
12
  import { default as React_3 } from 'react';
13
- import { ReactNode } from 'react';
13
+ import type { ReactNode } from 'react';
14
14
  import { set } from 'lodash-es';
15
15
  import { styled } from 'styled-components';
16
16
  import { ThemeProvider } from 'styled-components';
@@ -272,4 +272,4 @@ const HTML_TEXT_TAGS = [
272
272
  ];
273
273
 
274
274
  export { HTML_TAGS, HTML_TEXT_TAGS, Provider, compose, config, context, init, isEmpty, render };
275
- //# sourceMappingURL=vitus-labs-core.module.js.map
275
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/render.ts","../src/html/htmlTags.ts"],"sourcesContent":["import { styled, css, ThemeProvider } from 'styled-components'\nimport type { ComponentType } from 'react'\nimport type { HTMLTags } from '~/html'\n\ninterface Internal {\n css: typeof css\n styled: typeof styled\n provider: typeof ThemeProvider\n component: ComponentType | HTMLTags\n textComponent: ComponentType | HTMLTags\n}\n\nclass Configuration {\n css: Internal['css']\n\n styled: Internal['styled']\n\n ExternalProvider: Internal['provider']\n\n component: Internal['component'] = 'div'\n\n textComponent: Internal['textComponent'] = 'span'\n\n constructor(props: Internal) {\n this.css = props.css\n this.styled = props.styled\n this.ExternalProvider = props.provider\n this.component = props.component\n this.textComponent = props.textComponent\n }\n\n init = (props: Partial<Internal>) => {\n if (props.css) {\n this.css = props.css\n }\n\n if (props.styled) {\n this.styled = props.styled\n }\n\n if (props.provider) {\n this.ExternalProvider = props.provider\n }\n\n if (props.component) {\n this.component = props.component\n }\n\n if (props.textComponent) {\n this.textComponent = props.textComponent\n }\n }\n}\n\nconst defaultParams = {\n css,\n styled,\n provider: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as const\n\nconst config = new Configuration(defaultParams)\n\nconst { init } = config\n\nexport default config\nexport { init }\n","export type IsEmpty = <\n T extends Record<number | string, any> | any[] | null | undefined,\n>(\n param: T,\n) => T extends null | undefined\n ? true\n : keyof T extends never\n ? true\n : T extends T[]\n ? T[number] extends never\n ? true\n : false\n : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param || param === null) return true\n\n if (typeof param !== 'object') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (Object.entries(param).length === 0 && param.constructor === Object) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","import React, { createContext, useMemo } from 'react'\nimport type { FC, ReactNode } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\nimport type { Breakpoints } from '~/types'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Breakpoints\n } & Record<string, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n children: ReactNode\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n const ExternalProvider = useMemo(() => config.ExternalProvider, [])\n const context = useMemo(() => ({ theme, ...props }), [theme, props])\n\n if (isEmpty(theme) || !theme) return <>{children}</>\n\n if (ExternalProvider) {\n return (\n <VitusLabsProvider value={context}>\n <ExternalProvider theme={theme}>{children}</ExternalProvider>\n </VitusLabsProvider>\n )\n }\n\n return <VitusLabsProvider value={context}>{children}</VitusLabsProvider>\n}\n\nexport { context }\n\nexport default Provider\n","type 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\n\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 // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\n fns.reduceRight((acc: any, cur: any) => cur(acc), p)\n\nexport default compose\n","import { createElement, isValidElement, cloneElement } from 'react'\nimport type { ReactNode } from 'react'\nimport { isValidElementType, isFragment } from 'react-is'\nimport isEmpty from './isEmpty'\n\ntype CreateTypes = Parameters<typeof createElement>[0]\ntype CloneTypes = Parameters<typeof cloneElement>[0]\ntype RenderProps<T extends Record<string, unknown> | undefined> = (\n props: Partial<T>,\n) => ReactNode\n\nexport type Render = <T extends Record<string, any> | undefined>(\n content?: CreateTypes | CloneTypes | ReactNode | ReactNode[] | RenderProps<T>,\n attachProps?: T,\n) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\nconst render: Render = (content, attachProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n if (!content) return null as any\n\n const isValidEl = isValidElement(content)\n\n const render = (child: Parameters<typeof createElement>[0]) =>\n attachProps ? createElement(child, attachProps) : createElement(child)\n\n if (typeof content === 'string' && isValidEl) {\n return render(content)\n }\n\n if (['number', 'boolean', 'bigint', '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 render(content)\n }\n\n if (isValidEl) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(content, attachProps)\n }\n\n return content\n}\n\nexport default render\n","const HTML_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 HTML_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 HTML_TAGS)[number]\n\nexport type HTMLTextTags = (typeof HTML_TEX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;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;;IAER,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;EACG;AAEV,MAAM,cAAc,GAAG;IACrB,MAAM;IACN,GAAG;IACH,KAAK;IACL,KAAK;IACL,KAAK;IACL,YAAY;IACZ,MAAM;IACN,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,YAAY;IACZ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,KAAK;IACL,KAAK;IACL,OAAO;IACP,QAAQ;IACR,IAAI;IACJ,GAAG;IACH,KAAK;IACL,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,OAAO;IACP,MAAM;IACN,QAAQ;IACR,KAAK;IACL,SAAS;IACT,KAAK;IACL,MAAM;IACN,GAAG;;;;;"}
@@ -1,5 +1,5 @@
1
- import { ComponentType } from 'react';
2
1
  import { styled, css, ThemeProvider } from 'styled-components';
2
+ import type { ComponentType } from 'react';
3
3
  import type { HTMLTags } from "./html";
4
4
  interface Internal {
5
5
  css: typeof css;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,mBAAm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a,GAAG,QAAQ,CAAA;CACxC;AAED,cAAM,aAAa;IACjB,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEpB,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAE1B,gBAAgB,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAA;IAEtC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAQ;IAExC,aAAa,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAS;gBAErC,KAAK,EAAE,QAAQ;IAQ3B,IAAI,UAAW,QAAQ,QAAQ,CAAC,UAoB/B;CACF;AAUD,QAAA,MAAM,MAAM,eAAmC,CAAA;AAE/C,QAAA,MAAQ,IAAI,UAjCK,QAAQ,QAAQ,CAAC,SAiCX,CAAA;AAEvB,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -1,4 +1,5 @@
1
- import React, { FC, ReactNode } from 'react';
1
+ import React from 'react';
2
+ import type { FC, ReactNode } from 'react';
2
3
  import type { Breakpoints } from "./types";
3
4
  declare const context: React.Context<any>;
4
5
  type Theme = Partial<{
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,EAAE,EAAW,SAAS,EAAE,MAAM,OAAO,CAAA;AAGpE,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAe;AAE1C,QAAA,MAAM,OAAO,oBAAyB,CAAA;AAGtC,KAAK,KAAK,GAAG,OAAO,CAClB;IACE,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,WAAW,CAAA;CACzB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACxB,CAAA;AAED,KAAK,YAAY,GAAG,OAAO,CACzB;IACE,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,EAAE,SAAS,CAAA;CACpB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACxB,CAAA;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,YAAY,CAe9B,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,eAAe,QAAQ,CAAA"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAe;AAE1C,QAAA,MAAM,OAAO,oBAAyB,CAAA;AAGtC,KAAK,KAAK,GAAG,OAAO,CAClB;IACE,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,WAAW,CAAA;CACzB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACxB,CAAA;AAED,KAAK,YAAY,GAAG,OAAO,CACzB;IACE,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,EAAE,SAAS,CAAA;CACpB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACxB,CAAA;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,YAAY,CAe9B,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,eAAe,QAAQ,CAAA"}
@@ -1,4 +1,5 @@
1
- import { HTML_TAGS, HTML_TEXT_TAGS, HTMLTags, HTMLTextTags } from './htmlTags';
1
+ import { HTML_TAGS, HTML_TEXT_TAGS } from './htmlTags';
2
+ import type { HTMLTags, HTMLTextTags } from './htmlTags';
2
3
  import type { HTMLElementAttrs } from './htmlElementAttrs';
3
4
  type HTMLTagAttrsByTag<T extends HTMLTags> = T extends HTMLTags ? HTMLElementAttrs[T] : {};
4
5
  export type { HTMLTags, HTMLTextTags, HTMLElementAttrs, HTMLTagAttrsByTag };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,KAAK,iBAAiB,CAAC,CAAC,SAAS,QAAQ,IAAI,CAAC,SAAS,QAAQ,GAC3D,gBAAgB,CAAC,CAAC,CAAC,GACnB,EAAE,CAAA;AAEN,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAA;AAE3E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,KAAK,iBAAiB,CAAC,CAAC,SAAS,QAAQ,IAAI,CAAC,SAAS,QAAQ,GAC3D,gBAAgB,CAAC,CAAC,CAAC,GACnB,EAAE,CAAA;AAEN,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAA;AAE3E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA"}
@@ -3,9 +3,12 @@ import memoize from 'moize';
3
3
  import config, { init } from "./config";
4
4
  import Provider, { context } from "./context";
5
5
  import compose from "./compose";
6
- import isEmpty, { IsEmpty } from "./isEmpty";
7
- import render, { Render } from "./render";
8
- import { HTML_TAGS, HTML_TEXT_TAGS, HTMLTags, HTMLTextTags, HTMLElementAttrs, HTMLTagAttrsByTag } from "./html";
6
+ import isEmpty from "./isEmpty";
7
+ import render from "./render";
8
+ import { HTML_TAGS, HTML_TEXT_TAGS } from "./html";
9
+ import type { IsEmpty } from "./isEmpty";
10
+ import type { Render } from "./render";
11
+ import type { HTMLTags, HTMLTextTags, HTMLElementAttrs, HTMLTagAttrsByTag } from "./html";
9
12
  import type { Breakpoints, BreakpointKeys } from "./types";
10
13
  export type { Breakpoints, BreakpointKeys, IsEmpty, Render, HTMLTags, HTMLTextTags, HTMLElementAttrs, HTMLTagAttrsByTag, };
11
14
  export { Provider, context, init, config, compose, isEmpty, render, omit, pick, set, get, throttle, merge, memoize, HTML_TAGS, HTML_TEXT_TAGS, };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,OAAO,MAAM,OAAO,CAAA;AAC3B,OAAO,MAAM,EAAE,EAAE,IAAI,EAAE,iBAAgB;AACvC,OAAO,QAAQ,EAAE,EAAE,OAAO,EAAE,kBAAiB;AAC7C,OAAO,OAAO,kBAAiB;AAC/B,OAAO,OAAO,EAAE,EAAE,OAAO,EAAE,kBAAiB;AAC5C,OAAO,MAAM,EAAE,EAAE,MAAM,EAAE,iBAAgB;AACzC,OAAO,EACL,SAAS,EACT,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EAClB,eAAc;AACf,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAe;AAE1D,YAAY,EACV,WAAW,EACX,cAAc,EACd,OAAO,EACP,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,CAAA;AAED,OAAO,EACL,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,GAAG,EACH,QAAQ,EACR,KAAK,EACL,OAAO,EACP,SAAS,EACT,cAAc,GACf,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,OAAO,MAAM,OAAO,CAAA;AAC3B,OAAO,MAAM,EAAE,EAAE,IAAI,EAAE,iBAAgB;AACvC,OAAO,QAAQ,EAAE,EAAE,OAAO,EAAE,kBAAiB;AAC7C,OAAO,OAAO,kBAAiB;AAC/B,OAAO,OAAO,kBAAiB;AAC/B,OAAO,MAAM,iBAAgB;AAC7B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAc;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAiB;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAgB;AACtC,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EAClB,eAAc;AACf,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAe;AAE1D,YAAY,EACV,WAAW,EACX,cAAc,EACd,OAAO,EACP,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,CAAA;AAED,OAAO,EACL,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,GAAG,EACH,QAAQ,EACR,KAAK,EACL,OAAO,EACP,SAAS,EACT,cAAc,GACf,CAAA"}
@@ -1,4 +1,5 @@
1
- import { createElement, cloneElement, ReactNode } from 'react';
1
+ import { createElement, cloneElement } from 'react';
2
+ import type { ReactNode } from 'react';
2
3
  type CreateTypes = Parameters<typeof createElement>[0];
3
4
  type CloneTypes = Parameters<typeof cloneElement>[0];
4
5
  type RenderProps<T extends Record<string, unknown> | undefined> = (props: Partial<T>) => ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/render.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAG9E,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;AACtD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;AACpD,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,IAAI,CAChE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KACd,SAAS,CAAA;AAEd,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EAC7D,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,EAC7E,WAAW,CAAC,EAAE,CAAC,KACZ,UAAU,CAAC,OAAO,aAAa,CAAC,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,GAAG,IAAI,CAAA;AAE9E,QAAA,MAAM,MAAM,EAAE,MAkCb,CAAA;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,YAAY,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;AACtD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;AACpD,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,IAAI,CAChE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KACd,SAAS,CAAA;AAEd,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EAC7D,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,EAC7E,WAAW,CAAC,EAAE,CAAC,KACZ,UAAU,CAAC,OAAO,aAAa,CAAC,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,GAAG,IAAI,CAAA;AAE9E,QAAA,MAAM,MAAM,EAAE,MAkCb,CAAA;AAED,eAAe,MAAM,CAAA"}
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "@vitus-labs/core",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.6",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
7
7
  "Vit Bokisch <vit@bokisch.cz>"
8
8
  ],
9
9
  "type": "module",
10
- "exports": "./lib/vitus-labs-core.module.js",
10
+ "exports": {
11
+ "import": "./lib/index.js",
12
+ "types": "./lib/index.d.ts"
13
+ },
11
14
  "types": "./lib/index.d.ts",
12
15
  "files": [
13
16
  "lib/"
@@ -51,11 +54,11 @@
51
54
  "react-is": "^18.2.0"
52
55
  },
53
56
  "devDependencies": {
54
- "@types/lodash-es": "^4.17.8",
55
- "@vitus-labs/tools-babel": "^1.0.3",
56
- "@vitus-labs/tools-rollup": "^1.0.3",
57
- "@vitus-labs/tools-typescript": "^1.0.3",
58
- "styled-components": "^6.0.5"
57
+ "@types/lodash-es": "^4.17.9",
58
+ "@vitus-labs/tools-babel": "^1.3.0",
59
+ "@vitus-labs/tools-rollup": "^1.3.0",
60
+ "@vitus-labs/tools-typescript": "^1.3.0",
61
+ "styled-components": "^6.0.8"
59
62
  },
60
- "gitHead": "5dff36abe0adbb40ea2edd80da0af05a76c7d252"
63
+ "gitHead": "dffe273157c63c86459badd95ac55fcf57bddaf0"
61
64
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"vitus-labs-core.module.js","sources":["../src/config.ts","../src/isEmpty.ts","../src/context.tsx","../src/compose.ts","../src/render.ts","../src/html/htmlTags.ts"],"sourcesContent":["import { ComponentType } from 'react'\nimport { styled, css, ThemeProvider } from 'styled-components'\nimport type { HTMLTags } from '~/html'\n\ninterface Internal {\n css: typeof css\n styled: typeof styled\n provider: typeof ThemeProvider\n component: ComponentType | HTMLTags\n textComponent: ComponentType | HTMLTags\n}\n\nclass Configuration {\n css: Internal['css']\n\n styled: Internal['styled']\n\n ExternalProvider: Internal['provider']\n\n component: Internal['component'] = 'div'\n\n textComponent: Internal['textComponent'] = 'span'\n\n constructor(props: Internal) {\n this.css = props.css\n this.styled = props.styled\n this.ExternalProvider = props.provider\n this.component = props.component\n this.textComponent = props.textComponent\n }\n\n init = (props: Partial<Internal>) => {\n if (props.css) {\n this.css = props.css\n }\n\n if (props.styled) {\n this.styled = props.styled\n }\n\n if (props.provider) {\n this.ExternalProvider = props.provider\n }\n\n if (props.component) {\n this.component = props.component\n }\n\n if (props.textComponent) {\n this.textComponent = props.textComponent\n }\n }\n}\n\nconst defaultParams = {\n css,\n styled,\n provider: ThemeProvider,\n component: 'div',\n textComponent: 'span',\n} as const\n\nconst config = new Configuration(defaultParams)\n\nconst { init } = config\n\nexport default config\nexport { init }\n","export type IsEmpty = <\n T extends Record<number | string, any> | any[] | null | undefined,\n>(\n param: T,\n) => T extends null | undefined\n ? true\n : keyof T extends never\n ? true\n : T extends T[]\n ? T[number] extends never\n ? true\n : false\n : false\n\nconst isEmpty: IsEmpty = (param) => {\n if (!param || param === null) return true\n\n if (typeof param !== 'object') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return true as any\n }\n\n if (Array.isArray(param) && param.length === 0) {\n return true\n }\n\n if (Object.entries(param).length === 0 && param.constructor === Object) {\n return true\n }\n\n return false\n}\n\nexport default isEmpty\n","import React, { createContext, FC, useMemo, ReactNode } from 'react'\nimport config from '~/config'\nimport isEmpty from '~/isEmpty'\nimport type { Breakpoints } from '~/types'\n\nconst context = createContext<any>({})\nconst VitusLabsProvider = context.Provider\n\ntype Theme = Partial<\n {\n rootSize: number\n breakpoints: Breakpoints\n } & Record<string, any>\n>\n\ntype ProviderType = Partial<\n {\n theme: Theme\n children: ReactNode\n } & Record<string, any>\n>\n\nconst Provider: FC<ProviderType> = ({ theme, children, ...props }) => {\n const ExternalProvider = useMemo(() => config.ExternalProvider, [])\n const context = useMemo(() => ({ theme, ...props }), [theme, props])\n\n if (isEmpty(theme) || !theme) return <>{children}</>\n\n if (ExternalProvider) {\n return (\n <VitusLabsProvider value={context}>\n <ExternalProvider theme={theme}>{children}</ExternalProvider>\n </VitusLabsProvider>\n )\n }\n\n return <VitusLabsProvider value={context}>{children}</VitusLabsProvider>\n}\n\nexport { context }\n\nexport default Provider\n","type 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\n\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 // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\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]\ntype RenderProps<T extends Record<string, unknown> | undefined> = (\n props: Partial<T>,\n) => ReactNode\n\nexport type Render = <T extends Record<string, any> | undefined>(\n content?: CreateTypes | CloneTypes | ReactNode | ReactNode[] | RenderProps<T>,\n attachProps?: T,\n) => ReturnType<typeof createElement> | ReturnType<typeof cloneElement> | null\n\nconst render: Render = (content, attachProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n if (!content) return null as any\n\n const isValidEl = isValidElement(content)\n\n const render = (child: Parameters<typeof createElement>[0]) =>\n attachProps ? createElement(child, attachProps) : createElement(child)\n\n if (typeof content === 'string' && isValidEl) {\n return render(content)\n }\n\n if (['number', 'boolean', 'bigint', '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 render(content)\n }\n\n if (isValidEl) {\n if (isEmpty(attachProps)) {\n return content\n }\n\n return cloneElement(content, attachProps)\n }\n\n return content\n}\n\nexport default render\n","const HTML_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 HTML_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 HTML_TAGS)[number]\n\nexport type HTMLTextTags = (typeof HTML_TEXT_TAGS)[number]\n\nexport { HTML_TAGS, HTML_TEXT_TAGS }\n"],"names":[],"mappings":";;;;;;AAYA,MAAM,aAAa,CAAA;AACjB,IAAA,GAAG,CAAiB;AAEpB,IAAA,MAAM,CAAoB;AAE1B,IAAA,gBAAgB,CAAsB;IAEtC,SAAS,GAA0B,KAAK,CAAA;IAExC,aAAa,GAA8B,MAAM,CAAA;AAEjD,IAAA,WAAA,CAAY,KAAe,EAAA;AACzB,QAAA,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAA;AACpB,QAAA,IAAI,CAAC,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