@xanui/core 1.2.55 → 1.2.56
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.
- package/AppRoot/AppRootProvider.cjs.map +1 -1
- package/AppRoot/AppRootProvider.js.map +1 -1
- package/AppRoot/Renderar.cjs.map +1 -1
- package/AppRoot/Renderar.js.map +1 -1
- package/AppRoot/index.cjs.map +1 -1
- package/AppRoot/index.js.map +1 -1
- package/Document/index.cjs.map +1 -1
- package/Document/index.js.map +1 -1
- package/Iframe/index.cjs.map +1 -1
- package/Iframe/index.js.map +1 -1
- package/Portal/index.cjs +36 -0
- package/Portal/index.cjs.map +1 -0
- package/Portal/index.d.ts +15 -0
- package/Portal/index.js +34 -0
- package/Portal/index.js.map +1 -0
- package/Tag/ServerStyleTag.cjs.map +1 -1
- package/Tag/ServerStyleTag.js.map +1 -1
- package/Tag/cssPropList.cjs.map +1 -1
- package/Tag/cssPropList.js.map +1 -1
- package/Tag/index.cjs.map +1 -1
- package/Tag/index.js.map +1 -1
- package/Tag/useTagProps.cjs.map +1 -1
- package/Tag/useTagProps.js.map +1 -1
- package/Transition/index.cjs.map +1 -1
- package/Transition/index.js.map +1 -1
- package/breakpoint/BreakpointProvider.cjs +19 -15
- package/breakpoint/BreakpointProvider.cjs.map +1 -1
- package/breakpoint/BreakpointProvider.js +19 -15
- package/breakpoint/BreakpointProvider.js.map +1 -1
- package/breakpoint/useBreakpoint.cjs +12 -8
- package/breakpoint/useBreakpoint.cjs.map +1 -1
- package/breakpoint/useBreakpoint.d.ts +7 -5
- package/breakpoint/useBreakpoint.js +12 -8
- package/breakpoint/useBreakpoint.js.map +1 -1
- package/breakpoint/useBreakpointProps.cjs.map +1 -1
- package/breakpoint/useBreakpointProps.js.map +1 -1
- package/css/CSSCacheProvider.cjs.map +1 -1
- package/css/CSSCacheProvider.js.map +1 -1
- package/css/aliases.cjs.map +1 -1
- package/css/aliases.js.map +1 -1
- package/css/getProps.cjs.map +1 -1
- package/css/getProps.js.map +1 -1
- package/css/getValue.cjs.map +1 -1
- package/css/getValue.js.map +1 -1
- package/css/index.cjs +4 -4
- package/css/index.cjs.map +1 -1
- package/css/index.js +4 -4
- package/css/index.js.map +1 -1
- package/hooks/useAnimation.cjs.map +1 -1
- package/hooks/useAnimation.js.map +1 -1
- package/hooks/useColorTemplate.cjs.map +1 -1
- package/hooks/useColorTemplate.js.map +1 -1
- package/hooks/useInterface.cjs.map +1 -1
- package/hooks/useInterface.js.map +1 -1
- package/hooks/useMergeRefs.cjs.map +1 -1
- package/hooks/useMergeRefs.js.map +1 -1
- package/hooks/useTransition/index.cjs.map +1 -1
- package/hooks/useTransition/index.js.map +1 -1
- package/hooks/useTransition/variants.cjs.map +1 -1
- package/hooks/useTransition/variants.js.map +1 -1
- package/index.cjs +16 -16
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/readme.md +109 -109
- package/theme/ThemeCssVars.cjs.map +1 -1
- package/theme/ThemeCssVars.js.map +1 -1
- package/theme/ThemeDefaultOptions.cjs.map +1 -1
- package/theme/ThemeDefaultOptions.js.map +1 -1
- package/theme/ThemeProvider.cjs.map +1 -1
- package/theme/ThemeProvider.js.map +1 -1
- package/theme/core.cjs.map +1 -1
- package/theme/core.js.map +1 -1
- package/theme/createTheme.cjs.map +1 -1
- package/theme/createTheme.js.map +1 -1
- package/theme/createThemeSwitcher.cjs.map +1 -1
- package/theme/createThemeSwitcher.js.map +1 -1
- package/theme/index.cjs.map +1 -1
- package/theme/index.js.map +1 -1
- package/hooks/usePortal.cjs +0 -69
- package/hooks/usePortal.cjs.map +0 -1
- package/hooks/usePortal.d.ts +0 -14
- package/hooks/usePortal.js +0 -67
- package/hooks/usePortal.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppRootProvider.cjs","sources":["../../src/AppRoot/AppRootProvider.tsx"],"sourcesContent":["\"use client\"\
|
|
1
|
+
{"version":3,"file":"AppRootProvider.cjs","sources":["../../src/AppRoot/AppRootProvider.tsx"],"sourcesContent":["\"use client\"\nimport React from \"react\";\n\nconst AppRootContext = React.createContext<(() => HTMLElement | null) | null>(null);\n\nexport const AppRootProvider: React.FC<{ element: () => HTMLElement | null; children: React.ReactNode }> = ({ element, children }) => {\n return (\n <AppRootContext.Provider value={element}>\n {children}\n </AppRootContext.Provider>\n );\n}\n\nexport const useAppRootElement = (): HTMLElement => {\n const context = React.useContext(AppRootContext);\n if (typeof window === 'undefined') {\n return null as any;\n }\n\n return context!() as HTMLElement\n}\n"],"names":[],"mappings":";;;;;;AAGA;AAEO;AACJ;AAKH;AAEO;;AAEJ;AACG;;;AAIN;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppRootProvider.js","sources":["../../src/AppRoot/AppRootProvider.tsx"],"sourcesContent":["\"use client\"\
|
|
1
|
+
{"version":3,"file":"AppRootProvider.js","sources":["../../src/AppRoot/AppRootProvider.tsx"],"sourcesContent":["\"use client\"\nimport React from \"react\";\n\nconst AppRootContext = React.createContext<(() => HTMLElement | null) | null>(null);\n\nexport const AppRootProvider: React.FC<{ element: () => HTMLElement | null; children: React.ReactNode }> = ({ element, children }) => {\n return (\n <AppRootContext.Provider value={element}>\n {children}\n </AppRootContext.Provider>\n );\n}\n\nexport const useAppRootElement = (): HTMLElement => {\n const context = React.useContext(AppRootContext);\n if (typeof window === 'undefined') {\n return null as any;\n }\n\n return context!() as HTMLElement\n}\n"],"names":[],"mappings":";;;;AAGA;AAEO;AACJ;AAKH;AAEO;;AAEJ;AACG;;;AAIN;;"}
|
package/AppRoot/Renderar.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderar.cjs","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["// Renderar.tsx\
|
|
1
|
+
{"version":3,"file":"Renderar.cjs","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["// Renderar.tsx\nimport React, { useState } from \"react\";\n\ntype StoredComponent = {\n component: React.FC<any>;\n props: any;\n};\n\nconst Components: StoredComponent[] = [];\nlet dispatch: (() => void) | null = null;\n\nexport class Renderar {\n static render(component: React.FC, props?: any) {\n Components.push({ component, props });\n if (dispatch) dispatch();\n return {\n unrender: () => this.unrender(component),\n updateProps: (newProps: any) => this.updateProps(component, newProps),\n };\n }\n\n static unrender(component: React.FC) {\n const index = Components.findIndex((c) => c.component === component);\n if (index > -1) {\n Components.splice(index, 1);\n if (dispatch) dispatch();\n }\n }\n\n static updateProps(component: React.FC, props: any) {\n const stored = Components.find((c) => c.component === component);\n if (stored) stored.props = { ...stored.props, ...props };\n if (dispatch) dispatch();\n }\n}\n\nexport const RenderRenderar = () => {\n const [, setState] = useState(0);\n dispatch = () => setState((prev) => prev + 1);\n\n return (\n <>\n {Components.map(({ component: Component, props }, i) => (\n <Component key={i} {...props} />\n ))}\n </>\n );\n};"],"names":["useState","_jsx","_Fragment"],"mappings":";;;;;AAQA,MAAM,UAAU,GAAsB,EAAE;AACxC,IAAI,QAAQ,GAAwB,IAAI;MAE3B,QAAQ,CAAA;AAClB,IAAA,OAAO,MAAM,CAAC,SAAmB,EAAE,KAAW,EAAA;QAC3C,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACrC,QAAA,IAAI,QAAQ;AAAE,YAAA,QAAQ,EAAE;QACxB,OAAO;YACJ,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;AACxC,YAAA,WAAW,EAAE,CAAC,QAAa,KAAK,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC;SACvE;IACJ;IAEA,OAAO,QAAQ,CAAC,SAAmB,EAAA;AAChC,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;AACpE,QAAA,IAAI,KAAK,GAAG,EAAE,EAAE;AACb,YAAA,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC3B,YAAA,IAAI,QAAQ;AAAE,gBAAA,QAAQ,EAAE;QAC3B;IACH;AAEA,IAAA,OAAO,WAAW,CAAC,SAAmB,EAAE,KAAU,EAAA;AAC/C,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;AAChE,QAAA,IAAI,MAAM;YAAE,MAAM,CAAC,KAAK,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,MAAM,CAAC,KAAK,CAAA,EAAK,KAAK,CAAE;AACxD,QAAA,IAAI,QAAQ;AAAE,YAAA,QAAQ,EAAE;IAC3B;AACF;AAEM,MAAM,cAAc,GAAG,MAAK;IAChC,MAAM,GAAG,QAAQ,CAAC,GAAGA,cAAQ,CAAC,CAAC,CAAC;AAChC,IAAA,QAAQ,GAAG,MAAM,QAAQ,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC;AAE7C,IAAA,QACGC,cAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EACI,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,MAChDD,cAAA,CAAC,SAAS,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAa,KAAK,CAAA,EAAZ,CAAC,CAAe,CAClC,CAAC,EAAA,CACF;AAET;;;;;"}
|
package/AppRoot/Renderar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderar.js","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["// Renderar.tsx\
|
|
1
|
+
{"version":3,"file":"Renderar.js","sources":["../../src/AppRoot/Renderar.tsx"],"sourcesContent":["// Renderar.tsx\nimport React, { useState } from \"react\";\n\ntype StoredComponent = {\n component: React.FC<any>;\n props: any;\n};\n\nconst Components: StoredComponent[] = [];\nlet dispatch: (() => void) | null = null;\n\nexport class Renderar {\n static render(component: React.FC, props?: any) {\n Components.push({ component, props });\n if (dispatch) dispatch();\n return {\n unrender: () => this.unrender(component),\n updateProps: (newProps: any) => this.updateProps(component, newProps),\n };\n }\n\n static unrender(component: React.FC) {\n const index = Components.findIndex((c) => c.component === component);\n if (index > -1) {\n Components.splice(index, 1);\n if (dispatch) dispatch();\n }\n }\n\n static updateProps(component: React.FC, props: any) {\n const stored = Components.find((c) => c.component === component);\n if (stored) stored.props = { ...stored.props, ...props };\n if (dispatch) dispatch();\n }\n}\n\nexport const RenderRenderar = () => {\n const [, setState] = useState(0);\n dispatch = () => setState((prev) => prev + 1);\n\n return (\n <>\n {Components.map(({ component: Component, props }, i) => (\n <Component key={i} {...props} />\n ))}\n </>\n );\n};"],"names":["_jsx","_Fragment"],"mappings":";;;AAQA,MAAM,UAAU,GAAsB,EAAE;AACxC,IAAI,QAAQ,GAAwB,IAAI;MAE3B,QAAQ,CAAA;AAClB,IAAA,OAAO,MAAM,CAAC,SAAmB,EAAE,KAAW,EAAA;QAC3C,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACrC,QAAA,IAAI,QAAQ;AAAE,YAAA,QAAQ,EAAE;QACxB,OAAO;YACJ,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;AACxC,YAAA,WAAW,EAAE,CAAC,QAAa,KAAK,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC;SACvE;IACJ;IAEA,OAAO,QAAQ,CAAC,SAAmB,EAAA;AAChC,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;AACpE,QAAA,IAAI,KAAK,GAAG,EAAE,EAAE;AACb,YAAA,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAC3B,YAAA,IAAI,QAAQ;AAAE,gBAAA,QAAQ,EAAE;QAC3B;IACH;AAEA,IAAA,OAAO,WAAW,CAAC,SAAmB,EAAE,KAAU,EAAA;AAC/C,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;AAChE,QAAA,IAAI,MAAM;YAAE,MAAM,CAAC,KAAK,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,MAAM,CAAC,KAAK,CAAA,EAAK,KAAK,CAAE;AACxD,QAAA,IAAI,QAAQ;AAAE,YAAA,QAAQ,EAAE;IAC3B;AACF;AAEM,MAAM,cAAc,GAAG,MAAK;IAChC,MAAM,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AAChC,IAAA,QAAQ,GAAG,MAAM,QAAQ,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC;AAE7C,IAAA,QACGA,GAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EACI,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,MAChDD,GAAA,CAAC,SAAS,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAa,KAAK,CAAA,EAAZ,CAAC,CAAe,CAClC,CAAC,EAAA,CACF;AAET;;;;"}
|
package/AppRoot/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n selectionColor?: \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\";\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, noScrollbarCss, CSSCacheId, theme, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n noScrollbarCss ??= false\n selectionColor ??= \"brand\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n // const [visibility, setVisibility] = React.useState<string>(\"hidden\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useEffect(() => {\n // setVisibility(\"visible\");\n\n // move oncss style tags to head\n if (typeof _document === 'undefined') return;\n const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n _document.head.appendChild(style);\n });\n }, [])\n let selection: any = {}\n if (selectionColor && selectionColor !== 'default') {\n selection = {\n \"&::selection\": {\n bgcolor: `${selectionColor}.primary`,\n color: `${selectionColor}.text`\n }\n }\n }\n\n return (\n <DocumentProvider value={_document ? { document: _document, id: docid } : undefined}>\n <CSSCacheProvider cacheId={CSSCacheId}>\n <AppRootProvider element={() => rootRef.current}>\n <ThemeProvider\n theme={theme}\n {...props}\n ref={mergeRef}\n isRoot\n sx={{\n ...props.sx,\n // ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {}),\n ...selection\n }}\n >\n <BreakpointProvider>\n {children}\n {!disableRenderar && <RenderRenderar />}\n </BreakpointProvider>\n </ThemeProvider>\n </AppRootProvider>\n </CSSCacheProvider>\n </DocumentProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAmBA;;;;AAGG;;;;AAIA;AACA;;;AAIA;;;;;;;AAQG;AACA;AACG;AACH;;;AAGH;AACG;AACG;;;AAGC;;;AAIP;AAwBH;;"}
|
package/AppRoot/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/AppRoot/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useId, useRef } from 'react';\nimport { TagComponentType } from '../Tag/types';\nimport { ThemeProvider, ThemeProviderProps } from '../theme';\nimport { BreakpointProvider } from '../breakpoint';\nimport { RenderRenderar } from './Renderar';\nimport { DocumentProvider } from '../Document';\nimport { AppRootProvider } from './AppRootProvider';\nimport useMergeRefs from '../hooks/useMergeRefs';\nimport { CSSCacheProvider } from '../css/CSSCacheProvider';\n\nexport type AppRootProps<T extends TagComponentType = \"div\"> = ThemeProviderProps<T> & {\n noScrollbarCss?: boolean;\n document?: Document;\n CSSCacheId?: string;\n disableRenderar?: boolean;\n selectionColor?: \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\";\n}\n\nconst AppRoot = React.forwardRef(<T extends TagComponentType = \"div\">({ children, noScrollbarCss, CSSCacheId, theme, disableRenderar, selectionColor, document: _document, ...props }: AppRootProps<T>, ref: React.Ref<any>) => {\n noScrollbarCss ??= false\n selectionColor ??= \"brand\"\n if (typeof window !== \"undefined\") {\n _document ??= document\n }\n disableRenderar ??= false\n const docid = useId()\n const csscacheId = useId()\n CSSCacheId ??= csscacheId\n\n // const [visibility, setVisibility] = React.useState<string>(\"hidden\");\n const rootRef = useRef(null)\n const mergeRef = useMergeRefs(rootRef, ref)\n\n useEffect(() => {\n // setVisibility(\"visible\");\n\n // move oncss style tags to head\n if (typeof _document === 'undefined') return;\n const styles = Array.from(_document.querySelectorAll('body style[data-oncss]'));\n styles.forEach((style) => {\n _document.head.appendChild(style);\n });\n }, [])\n let selection: any = {}\n if (selectionColor && selectionColor !== 'default') {\n selection = {\n \"&::selection\": {\n bgcolor: `${selectionColor}.primary`,\n color: `${selectionColor}.text`\n }\n }\n }\n\n return (\n <DocumentProvider value={_document ? { document: _document, id: docid } : undefined}>\n <CSSCacheProvider cacheId={CSSCacheId}>\n <AppRootProvider element={() => rootRef.current}>\n <ThemeProvider\n theme={theme}\n {...props}\n ref={mergeRef}\n isRoot\n sx={{\n ...props.sx,\n // ...(visibility === \"hidden\" ? { visibility: \"hidden\" } : {}),\n ...selection\n }}\n >\n <BreakpointProvider>\n {children}\n {!disableRenderar && <RenderRenderar />}\n </BreakpointProvider>\n </ThemeProvider>\n </AppRootProvider>\n </CSSCacheProvider>\n </DocumentProvider>\n )\n})\n\nexport default AppRoot\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmBA;;;;AAGG;;;;AAIA;AACA;;;AAIA;;;;;;;AAQG;AACA;AACG;AACH;;;AAGH;AACG;AACG;;;AAGC;;;AAIP;AAwBH;;"}
|
package/Document/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Document/index.tsx"],"sourcesContent":["'use client'\
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Document/index.tsx"],"sourcesContent":["'use client'\nimport React, { useContext, createContext } from \"react\";\n\nexport type DocumentID = string\nexport type DocumentContextValue = { document: Document; id: DocumentID } | undefined\nconst DocumentContext = createContext<DocumentContextValue>(undefined);\nexport const DocumentProvider: React.FC<{ children: React.ReactNode, value?: DocumentContextValue }> = ({ value, children }) => {\n return (\n <DocumentContext.Provider value={value}>\n {children}\n </DocumentContext.Provider>\n );\n}\n\nexport const useDocument = () => useContext(DocumentContext)"],"names":[],"mappings":";;;;;;AAKA;AACO;AACJ;AAKH;AAEO;;;"}
|
package/Document/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Document/index.tsx"],"sourcesContent":["'use client'\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Document/index.tsx"],"sourcesContent":["'use client'\nimport React, { useContext, createContext } from \"react\";\n\nexport type DocumentID = string\nexport type DocumentContextValue = { document: Document; id: DocumentID } | undefined\nconst DocumentContext = createContext<DocumentContextValue>(undefined);\nexport const DocumentProvider: React.FC<{ children: React.ReactNode, value?: DocumentContextValue }> = ({ value, children }) => {\n return (\n <DocumentContext.Provider value={value}>\n {children}\n </DocumentContext.Provider>\n );\n}\n\nexport const useDocument = () => useContext(DocumentContext)"],"names":[],"mappings":";;;;AAKA;AACO;AACJ;AAKH;AAEO;;"}
|
package/Iframe/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: string;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n theme ??= parentTheme.name\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={theme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":";;;;;;;;;;;;;;;;AASA;AACG;AACA;AACF;AAQD;AAAgB;;AAEb;;AAEA;;;;;AAKG;;AAEA;;;;AAqBM;AAGS;;;AAYrB;AAEA;;"}
|
package/Iframe/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Iframe/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useEffect, useRef, useState } from \"react\";\nimport { useTheme } from \"../theme\";\nimport Tag from \"../Tag\";\nimport { createPortal } from \"react-dom\";\nimport AppRoot from \"../AppRoot\";\nimport { TagPropsRoot } from \"../Tag/types\";\nimport useMergeRefs from \"../hooks/useMergeRefs\";\n\nconst IframeContext = createContext<{ document: Document | null; window: Window | null; }>({\n document: null,\n window: null,\n});\n\n\nexport type IframeProps = Omit<TagPropsRoot<\"iframe\">, \"component\"> & {\n theme?: string;\n CSSCacheId?: string;\n}\n\nconst Iframe = ({ children, sxr, theme, CSSCacheId, ...props }: IframeProps, ref: React.Ref<HTMLIFrameElement>) => {\n const [doc, setDoc] = useState<Document | null>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const _ref = useMergeRefs(iframeRef, ref)\n const parentTheme = useTheme()\n theme ??= parentTheme.name\n\n useEffect(() => {\n if (!iframeRef.current) return;\n const iframe = iframeRef.current;\n const onLoad = () => setDoc(iframe.contentDocument);\n iframe.addEventListener(\"load\", onLoad);\n return () => iframe.removeEventListener(\"load\", onLoad);\n }, []);\n\n return (\n <>\n <Tag\n {...props}\n component={\"iframe\"}\n sxr={{\n border: 'none',\n width: \"100%\",\n height: \"100%\",\n p: 0,\n m: 0,\n ...sxr\n }}\n ref={_ref}\n srcDoc={\"<!DOCTYPE html><html><head></head><body></body></html>\"}\n />\n {doc &&\n createPortal(\n <IframeContext.Provider\n value={{\n document: doc,\n window: doc.defaultView,\n }}\n >\n <AppRoot disableRenderar theme={theme} document={doc as Document} CSSCacheId={CSSCacheId}>\n {children}\n </AppRoot>\n </IframeContext.Provider>,\n doc.body\n )}\n </>\n );\n}\n\nexport default React.forwardRef(Iframe)"],"names":[],"mappings":";;;;;;;;;;;;;;AASA;AACG;AACA;AACF;AAQD;AAAgB;;AAEb;;AAEA;;;;;AAKG;;AAEA;;;;AAqBM;AAGS;;;AAYrB;AAEA;;"}
|
package/Portal/index.cjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactDom = require('react-dom');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SSR-safe Portal component
|
|
9
|
+
* - container: HTMLElement or querySelector string
|
|
10
|
+
* - if not provided, creates a unique div automatically
|
|
11
|
+
*/
|
|
12
|
+
const Portal = ({ children, container }) => {
|
|
13
|
+
const portalNode = React.useMemo(() => {
|
|
14
|
+
if (typeof document === "undefined")
|
|
15
|
+
return null; // SSR
|
|
16
|
+
// Use container if provided
|
|
17
|
+
if (container instanceof HTMLElement)
|
|
18
|
+
return container;
|
|
19
|
+
if (typeof container === "string") {
|
|
20
|
+
const element = document.querySelector(container);
|
|
21
|
+
if (element)
|
|
22
|
+
return element;
|
|
23
|
+
}
|
|
24
|
+
// Auto-create a unique div
|
|
25
|
+
const element = document.createElement("div");
|
|
26
|
+
element.dataset.portal = Math.random().toString(36).substring(2, 9); // unique id
|
|
27
|
+
document.body.appendChild(element);
|
|
28
|
+
return element;
|
|
29
|
+
}, [container]);
|
|
30
|
+
if (!portalNode)
|
|
31
|
+
return null;
|
|
32
|
+
return reactDom.createPortal(children, portalNode);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
module.exports = Portal;
|
|
36
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Portal/index.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { ReactNode, useMemo } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nexport type PortalProps = {\n children: ReactNode;\n container?: HTMLElement | string; // HTMLElement or querySelector string\n}\n\n/**\n * SSR-safe Portal component\n * - container: HTMLElement or querySelector string\n * - if not provided, creates a unique div automatically\n */\nconst Portal: React.FC<PortalProps> = ({ children, container }) => {\n const portalNode = useMemo<HTMLElement | null>(() => {\n if (typeof document === \"undefined\") return null; // SSR\n\n // Use container if provided\n if (container instanceof HTMLElement) return container;\n if (typeof container === \"string\") {\n const element = document.querySelector<HTMLElement>(container);\n if (element) return element;\n }\n\n // Auto-create a unique div\n const element = document.createElement(\"div\");\n element.dataset.portal = Math.random().toString(36).substring(2, 9); // unique id\n document.body.appendChild(element);\n\n return element;\n }, [container]);\n\n if (!portalNode) return null;\n\n return createPortal(children, portalNode);\n};\n\nexport default Portal;"],"names":[],"mappings":";;;;;;AAUA;;;;AAIG;AACH;AACG;;;;;AAIyC;AACtC;;AAEG;AAAa;;;;;AAMhB;AAEA;AACH;AAEA;AAAiB;AAEjB;AACH;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React__default, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type PortalProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
container?: HTMLElement | string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* SSR-safe Portal component
|
|
9
|
+
* - container: HTMLElement or querySelector string
|
|
10
|
+
* - if not provided, creates a unique div automatically
|
|
11
|
+
*/
|
|
12
|
+
declare const Portal: React__default.FC<PortalProps>;
|
|
13
|
+
|
|
14
|
+
export { Portal as default };
|
|
15
|
+
export type { PortalProps };
|
package/Portal/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SSR-safe Portal component
|
|
7
|
+
* - container: HTMLElement or querySelector string
|
|
8
|
+
* - if not provided, creates a unique div automatically
|
|
9
|
+
*/
|
|
10
|
+
const Portal = ({ children, container }) => {
|
|
11
|
+
const portalNode = useMemo(() => {
|
|
12
|
+
if (typeof document === "undefined")
|
|
13
|
+
return null; // SSR
|
|
14
|
+
// Use container if provided
|
|
15
|
+
if (container instanceof HTMLElement)
|
|
16
|
+
return container;
|
|
17
|
+
if (typeof container === "string") {
|
|
18
|
+
const element = document.querySelector(container);
|
|
19
|
+
if (element)
|
|
20
|
+
return element;
|
|
21
|
+
}
|
|
22
|
+
// Auto-create a unique div
|
|
23
|
+
const element = document.createElement("div");
|
|
24
|
+
element.dataset.portal = Math.random().toString(36).substring(2, 9); // unique id
|
|
25
|
+
document.body.appendChild(element);
|
|
26
|
+
return element;
|
|
27
|
+
}, [container]);
|
|
28
|
+
if (!portalNode)
|
|
29
|
+
return null;
|
|
30
|
+
return createPortal(children, portalNode);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { Portal as default };
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Portal/index.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { ReactNode, useMemo } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nexport type PortalProps = {\n children: ReactNode;\n container?: HTMLElement | string; // HTMLElement or querySelector string\n}\n\n/**\n * SSR-safe Portal component\n * - container: HTMLElement or querySelector string\n * - if not provided, creates a unique div automatically\n */\nconst Portal: React.FC<PortalProps> = ({ children, container }) => {\n const portalNode = useMemo<HTMLElement | null>(() => {\n if (typeof document === \"undefined\") return null; // SSR\n\n // Use container if provided\n if (container instanceof HTMLElement) return container;\n if (typeof container === \"string\") {\n const element = document.querySelector<HTMLElement>(container);\n if (element) return element;\n }\n\n // Auto-create a unique div\n const element = document.createElement(\"div\");\n element.dataset.portal = Math.random().toString(36).substring(2, 9); // unique id\n document.body.appendChild(element);\n\n return element;\n }, [container]);\n\n if (!portalNode) return null;\n\n return createPortal(children, portalNode);\n};\n\nexport default Portal;"],"names":[],"mappings":";;;;AAUA;;;;AAIG;AACH;AACG;;;;;AAIyC;AACtC;;AAEG;AAAa;;;;;AAMhB;AAEA;AACH;AAEA;AAAiB;AAEjB;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerStyleTag.cjs","sources":["../../src/Tag/ServerStyleTag.tsx"],"sourcesContent":["import { CSSFactoryType } from 'oncss'\
|
|
1
|
+
{"version":3,"file":"ServerStyleTag.cjs","sources":["../../src/Tag/ServerStyleTag.tsx"],"sourcesContent":["import { CSSFactoryType } from 'oncss'\nimport React from 'react'\n\nconst ServerStyleTag = ({ factory }: { factory: CSSFactoryType }) => {\n if (typeof window === 'undefined') {\n return <style\n dangerouslySetInnerHTML={{ __html: factory.css }}\n precedence={factory.classname}\n href={factory.classname}\n />\n }\n return null\n}\n\nexport default ServerStyleTag\n"],"names":["_jsx"],"mappings":";;;;AAGA,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAA+B,KAAI;AACjE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAChC,OAAOA,cAAA,CAAA,OAAA,EAAA,EACJ,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAChD,UAAU,EAAE,OAAO,CAAC,SAAS,EAC7B,IAAI,EAAE,OAAO,CAAC,SAAS,EAAA,CACxB;IACL;AACA,IAAA,OAAO,IAAI;AACd;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerStyleTag.js","sources":["../../src/Tag/ServerStyleTag.tsx"],"sourcesContent":["import { CSSFactoryType } from 'oncss'\
|
|
1
|
+
{"version":3,"file":"ServerStyleTag.js","sources":["../../src/Tag/ServerStyleTag.tsx"],"sourcesContent":["import { CSSFactoryType } from 'oncss'\nimport React from 'react'\n\nconst ServerStyleTag = ({ factory }: { factory: CSSFactoryType }) => {\n if (typeof window === 'undefined') {\n return <style\n dangerouslySetInnerHTML={{ __html: factory.css }}\n precedence={factory.classname}\n href={factory.classname}\n />\n }\n return null\n}\n\nexport default ServerStyleTag\n"],"names":["_jsx"],"mappings":";;AAGA,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAA+B,KAAI;AACjE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAChC,OAAOA,GAAA,CAAA,OAAA,EAAA,EACJ,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAChD,UAAU,EAAE,OAAO,CAAC,SAAS,EAC7B,IAAI,EAAE,OAAO,CAAC,SAAS,EAAA,CACxB;IACL;AACA,IAAA,OAAO,IAAI;AACd;;;;"}
|
package/Tag/cssPropList.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cssPropList.cjs","sources":["../../src/Tag/cssPropList.ts"],"sourcesContent":["\
|
|
1
|
+
{"version":3,"file":"cssPropList.cjs","sources":["../../src/Tag/cssPropList.ts"],"sourcesContent":["\nconst CSS_PROP_LIST: any = {\n typography: 1,\n bgcolor: 1,\n bgimage: 1,\n bg: 1,\n p: 1,\n pt: 1,\n pr: 1,\n pb: 1,\n pl: 1,\n px: 1,\n py: 1,\n m: 1,\n mt: 1,\n mr: 1,\n mb: 1,\n ml: 1,\n mx: 1,\n my: 1,\n radius: 1,\n shadow: 1,\n flexBox: 1,\n flexRow: 1,\n flexColumn: 1,\n flexWraped: 1,\n disabled: 1,\n spacing: 1,\n\n gradient: 1,\n\n // CSS Props\n alignContent: 1,\n alignItems: 1,\n alignSelf: 1,\n animation: 1,\n animationComposition: 1,\n animationDelay: 1,\n animationDirection: 1,\n animationDuration: 1,\n animationFillMode: 1,\n animationIterationCount: 1,\n animationName: 1,\n animationTimingFunction: 1,\n backdropFilter: 1,\n background: 1,\n backgroundAttachment: 1,\n backgroundColor: 1,\n backgroundImage: 1,\n backgroundOrigin: 1,\n backgroundPosition: 1,\n backgroundRepeat: 1,\n backgroundSize: 1,\n border: 1,\n borderBottom: 1,\n borderBottomColor: 1,\n borderBottomStyle: 1,\n borderBottomWidth: 1,\n borderColor: 1,\n borderImage: 1,\n borderLeft: 1,\n borderLeftColor: 1,\n borderLeftStyle: 1,\n borderLeftWidth: 1,\n borderRadius: 1,\n borderRight: 1,\n borderRightColor: 1,\n borderRightStyle: 1,\n borderRightWidth: 1,\n borderStyle: 1,\n borderTop: 1,\n borderTopColor: 1,\n borderTopLeftRadius: 1,\n borderTopRightRadius: 1,\n borderTopStyle: 1,\n borderTopWidth: 1,\n borderWidth: 1,\n bottom: 1,\n boxShadow: 1,\n boxSizing: 1,\n cursor: 1,\n color: 1,\n display: 1,\n direction: 1,\n filter: 1,\n flex: 1,\n flexBasis: 1,\n flexDirection: 1,\n flexFlow: 1,\n flexGrow: 1,\n flexShrink: 1,\n flexWrap: 1,\n float: 1,\n fontFamily: 1,\n fontSize: 1,\n fontStyle: 1,\n fontWeight: 1,\n font: 1,\n gap: 1,\n grid: 1,\n gridArea: 1,\n gridAutoColumns: 1,\n gridAutoFlow: 1,\n gridAutoRows: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnGap: 1,\n gridColumnStart: 1,\n gridGap: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowGap: 1,\n gridRowStart: 1,\n gridTemplate: 1,\n gridTemplateAreas: 1,\n gridTemplateColumns: 1,\n gridTemplateRows: 1,\n height: 1,\n justifyContent: 1,\n justifyItems: 1,\n justifySelf: 1,\n left: 1,\n letterSpacing: 1,\n lineBreak: 1,\n lineHeight: 1,\n listStyle: 1,\n margin: 1,\n marginBlock: 1,\n marginBlockEnd: 1,\n marginBlockStart: 1,\n marginBottom: 1,\n marginInline: 1,\n marginInlineEnd: 1,\n marginInlineStart: 1,\n marginLeft: 1,\n marginRight: 1,\n marginTop: 1,\n maxHeight: 1,\n maxWidth: 1,\n minHeight: 1,\n minWidth: 1,\n objectFit: 1,\n objectPosition: 1,\n opacity: 1,\n order: 1,\n outline: 1,\n overflow: 1,\n overflowX: 1,\n overflowY: 1,\n padding: 1,\n paddingBlock: 1,\n paddingBlockEnd: 1,\n paddingBlockStart: 1,\n paddingBottom: 1,\n paddingInline: 1,\n paddingInlineEnd: 1,\n paddingInlineStart: 1,\n paddingLeft: 1,\n paddingRight: 1,\n paddingTop: 1,\n perspective: 1,\n perspectiveOrigin: 1,\n pointerEvents: 1,\n position: 1,\n resize: 1,\n right: 1,\n textAlign: 1,\n textDecoration: 1,\n textShadow: 1,\n textTransform: 1,\n top: 1,\n transform: 1,\n transformOrigin: 1,\n transformStyle: 1,\n transition: 1,\n transitionDelay: 1,\n transitionDuration: 1,\n transitionProperty: 1,\n transitionTimingFunction: 1,\n userSelect: 1,\n verticalAlign: 1,\n visibility: 1,\n whiteSpace: 1,\n width: 1,\n wordBreak: 1,\n wordSpacing: 1,\n wordWrap: 1,\n zIndex: 1,\n}\n\nexport default CSS_PROP_LIST"],"names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AAU,EAAE,CAAC;AACb,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,cAAc,EAAE,CAAC;AACjB,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,kBAAkB,EAAE,CAAC;AACrB,IAAA,kBAAkB,EAAE,CAAC;AACrB,IAAA,wBAAwB,EAAE,CAAC;AAC3B,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,WAAW,EAAE,CAAC;AACd,IAAA,QAAQ,EAAE,CAAC;AACX,IAAA,MAAM,EAAE,CAAC;;;;;"}
|
package/Tag/cssPropList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cssPropList.js","sources":["../../src/Tag/cssPropList.ts"],"sourcesContent":["\
|
|
1
|
+
{"version":3,"file":"cssPropList.js","sources":["../../src/Tag/cssPropList.ts"],"sourcesContent":["\nconst CSS_PROP_LIST: any = {\n typography: 1,\n bgcolor: 1,\n bgimage: 1,\n bg: 1,\n p: 1,\n pt: 1,\n pr: 1,\n pb: 1,\n pl: 1,\n px: 1,\n py: 1,\n m: 1,\n mt: 1,\n mr: 1,\n mb: 1,\n ml: 1,\n mx: 1,\n my: 1,\n radius: 1,\n shadow: 1,\n flexBox: 1,\n flexRow: 1,\n flexColumn: 1,\n flexWraped: 1,\n disabled: 1,\n spacing: 1,\n\n gradient: 1,\n\n // CSS Props\n alignContent: 1,\n alignItems: 1,\n alignSelf: 1,\n animation: 1,\n animationComposition: 1,\n animationDelay: 1,\n animationDirection: 1,\n animationDuration: 1,\n animationFillMode: 1,\n animationIterationCount: 1,\n animationName: 1,\n animationTimingFunction: 1,\n backdropFilter: 1,\n background: 1,\n backgroundAttachment: 1,\n backgroundColor: 1,\n backgroundImage: 1,\n backgroundOrigin: 1,\n backgroundPosition: 1,\n backgroundRepeat: 1,\n backgroundSize: 1,\n border: 1,\n borderBottom: 1,\n borderBottomColor: 1,\n borderBottomStyle: 1,\n borderBottomWidth: 1,\n borderColor: 1,\n borderImage: 1,\n borderLeft: 1,\n borderLeftColor: 1,\n borderLeftStyle: 1,\n borderLeftWidth: 1,\n borderRadius: 1,\n borderRight: 1,\n borderRightColor: 1,\n borderRightStyle: 1,\n borderRightWidth: 1,\n borderStyle: 1,\n borderTop: 1,\n borderTopColor: 1,\n borderTopLeftRadius: 1,\n borderTopRightRadius: 1,\n borderTopStyle: 1,\n borderTopWidth: 1,\n borderWidth: 1,\n bottom: 1,\n boxShadow: 1,\n boxSizing: 1,\n cursor: 1,\n color: 1,\n display: 1,\n direction: 1,\n filter: 1,\n flex: 1,\n flexBasis: 1,\n flexDirection: 1,\n flexFlow: 1,\n flexGrow: 1,\n flexShrink: 1,\n flexWrap: 1,\n float: 1,\n fontFamily: 1,\n fontSize: 1,\n fontStyle: 1,\n fontWeight: 1,\n font: 1,\n gap: 1,\n grid: 1,\n gridArea: 1,\n gridAutoColumns: 1,\n gridAutoFlow: 1,\n gridAutoRows: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnGap: 1,\n gridColumnStart: 1,\n gridGap: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowGap: 1,\n gridRowStart: 1,\n gridTemplate: 1,\n gridTemplateAreas: 1,\n gridTemplateColumns: 1,\n gridTemplateRows: 1,\n height: 1,\n justifyContent: 1,\n justifyItems: 1,\n justifySelf: 1,\n left: 1,\n letterSpacing: 1,\n lineBreak: 1,\n lineHeight: 1,\n listStyle: 1,\n margin: 1,\n marginBlock: 1,\n marginBlockEnd: 1,\n marginBlockStart: 1,\n marginBottom: 1,\n marginInline: 1,\n marginInlineEnd: 1,\n marginInlineStart: 1,\n marginLeft: 1,\n marginRight: 1,\n marginTop: 1,\n maxHeight: 1,\n maxWidth: 1,\n minHeight: 1,\n minWidth: 1,\n objectFit: 1,\n objectPosition: 1,\n opacity: 1,\n order: 1,\n outline: 1,\n overflow: 1,\n overflowX: 1,\n overflowY: 1,\n padding: 1,\n paddingBlock: 1,\n paddingBlockEnd: 1,\n paddingBlockStart: 1,\n paddingBottom: 1,\n paddingInline: 1,\n paddingInlineEnd: 1,\n paddingInlineStart: 1,\n paddingLeft: 1,\n paddingRight: 1,\n paddingTop: 1,\n perspective: 1,\n perspectiveOrigin: 1,\n pointerEvents: 1,\n position: 1,\n resize: 1,\n right: 1,\n textAlign: 1,\n textDecoration: 1,\n textShadow: 1,\n textTransform: 1,\n top: 1,\n transform: 1,\n transformOrigin: 1,\n transformStyle: 1,\n transition: 1,\n transitionDelay: 1,\n transitionDuration: 1,\n transitionProperty: 1,\n transitionTimingFunction: 1,\n userSelect: 1,\n verticalAlign: 1,\n visibility: 1,\n whiteSpace: 1,\n width: 1,\n wordBreak: 1,\n wordSpacing: 1,\n wordWrap: 1,\n zIndex: 1,\n}\n\nexport default CSS_PROP_LIST"],"names":[],"mappings":"AACA,MAAM,aAAa,GAAQ;AACvB,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE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AC;AACZ,IAAA,WAAW,EAAE,CAAC;AACd,IAAA,QAAQ,EAAE,CAAC;AACX,IAAA,MAAM,EAAE,CAAC;;;;;"}
|
package/Tag/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Tag/index.tsx"],"sourcesContent":["import * as React from 'react'\
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Tag/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { TagComponentType, TagPropsRoot } from './types';\nimport useTagProps from './useTagProps';\nimport ServerStyleTag from './ServerStyleTag';\n\nconst Tag = React.forwardRef(<T extends TagComponentType = 'div'>({ component, children, ...rest }: TagPropsRoot<T>, ref: React.Ref<any>) => {\n const { props, style }: any = useTagProps(rest)\n props.ref = ref\n const ele = React.createElement(component || \"div\", props, children)\n if (typeof window === 'undefined') {\n return (\n <>\n <ServerStyleTag factory={style} />\n {ele}\n </>\n )\n }\n return ele\n})\n\nexport default Tag"],"names":["React","__rest","_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,GAAG,GAAGA,gBAAK,CAAC,UAAU,CAAC,CAAqC,EAAiD,EAAE,GAAmB,KAAI;QAA1E,EAAE,SAAS,EAAE,QAAQ,EAAA,GAAA,EAA4B,EAAvB,IAAI,GAAAC,YAAA,CAAA,EAAA,EAA9B,yBAAgC,CAAF;IAC5F,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAQ,WAAW,CAAC,IAAI,CAAC;AAC/C,IAAA,KAAK,CAAC,GAAG,GAAG,GAAG;AACf,IAAA,MAAM,GAAG,GAAGD,gBAAK,CAAC,aAAa,CAAC,SAAS,IAAI,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAC/B,QAAA,QACIE,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACIC,cAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAE,KAAK,EAAA,CAAI,EACjC,GAAG,CAAA,EAAA,CACL;IAEX;AACA,IAAA,OAAO,GAAG;AACd,CAAC;;;;"}
|
package/Tag/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Tag/index.tsx"],"sourcesContent":["import * as React from 'react'\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Tag/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { TagComponentType, TagPropsRoot } from './types';\nimport useTagProps from './useTagProps';\nimport ServerStyleTag from './ServerStyleTag';\n\nconst Tag = React.forwardRef(<T extends TagComponentType = 'div'>({ component, children, ...rest }: TagPropsRoot<T>, ref: React.Ref<any>) => {\n const { props, style }: any = useTagProps(rest)\n props.ref = ref\n const ele = React.createElement(component || \"div\", props, children)\n if (typeof window === 'undefined') {\n return (\n <>\n <ServerStyleTag factory={style} />\n {ele}\n </>\n )\n }\n return ele\n})\n\nexport default Tag"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;AAKA,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,CAAqC,EAAiD,EAAE,GAAmB,KAAI;QAA1E,EAAE,SAAS,EAAE,QAAQ,EAAA,GAAA,EAA4B,EAAvB,IAAI,GAAA,MAAA,CAAA,EAAA,EAA9B,yBAAgC,CAAF;IAC5F,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAQ,WAAW,CAAC,IAAI,CAAC;AAC/C,IAAA,KAAK,CAAC,GAAG,GAAG,GAAG;AACf,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,IAAI,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AAC/B,QAAA,QACIA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACIC,GAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAE,KAAK,EAAA,CAAI,EACjC,GAAG,CAAA,EAAA,CACL;IAEX;AACA,IAAA,OAAO,GAAG;AACd,CAAC;;;;"}
|
package/Tag/useTagProps.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTagProps.cjs","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["import { TagComponentType, TagProps, TagPropsRoot } from './types';\
|
|
1
|
+
{"version":3,"file":"useTagProps.cjs","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["import { TagComponentType, TagProps, TagPropsRoot } from './types';\nimport cssPropList from './cssPropList';\nimport { css } from '../css';\nimport { classNames } from 'pretty-class';\nimport { CSSFactoryType } from 'oncss';\nimport { useMemo } from 'react';\nimport { useDocument } from '../Document';\nimport { useCSSCacheId } from '../css/CSSCacheProvider';\n\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\n props: TagProps<T>,\n style: CSSFactoryType\n}\n\nconst useTagProps = <T extends TagComponentType = \"div\">(props: TagPropsRoot<T>): useTagPropsReturn<T> => {\n const cachekey = JSON.stringify(props, (key, value) => {\n return key === '_owner' || key === '_store' ? undefined : value;\n }, 2);\n\n const doc = useDocument();\n const cacheId = useCSSCacheId()\n\n const parsed = useMemo(() => {\n let _props: any = {}\n let _css: any = {}\n\n if (props.hover && Object.keys(props.hover).length > 0) {\n _css['&:hover'] = {\n ...props.hover\n }\n }\n\n for (let key in props) {\n const keys = [\"sx\", \"sxr\", \"style\", \"hover\", \"className\", \"classNames\", \"baseClass\"];\n if (keys.includes(key)) {\n continue;\n }\n let val = (props as any)[key];\n if (!cssPropList[key]) {\n _props[key] = val\n } else {\n _css[key] = val\n }\n }\n\n const styles = css({ ...props.sxr, ..._css, ...props.sx, ...props.style }, {\n injectStyle: typeof window !== 'undefined',\n container: doc?.document,\n cacheId\n })\n\n return {\n props: _props,\n styles,\n className: classNames(\n props.baseClass ? \"xui-\" + props.baseClass : undefined,\n props.classNames,\n props.className,\n styles.classname\n )\n }\n }, [cachekey])\n\n const _props: any = {};\n for (let prop in parsed.props) {\n _props[prop] = (props as any)[prop]\n }\n _props.className = parsed.className;\n\n return { props: _props, style: parsed.styles };\n}\n\n\nexport default useTagProps"],"names":["useDocument","useCSSCacheId","useMemo","css","classNames"],"mappings":";;;;;;;;;AAcA,MAAM,WAAW,GAAG,CAAqC,KAAsB,KAA0B;AACtG,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,KAAI;AACnD,QAAA,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,QAAQ,GAAG,SAAS,GAAG,KAAK;IAClE,CAAC,EAAE,CAAC,CAAC;AAEL,IAAA,MAAM,GAAG,GAAGA,iBAAW,EAAE;AACzB,IAAA,MAAM,OAAO,GAAGC,8BAAa,EAAE;AAE/B,IAAA,MAAM,MAAM,GAAGC,aAAO,CAAC,MAAK;QACzB,IAAI,MAAM,GAAQ,EAAE;QACpB,IAAI,IAAI,GAAQ,EAAE;AAElB,QAAA,IAAI,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACrD,IAAI,CAAC,SAAS,CAAC,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACT,KAAK,CAAC,KAAK,CAChB;QACJ;AAEA,QAAA,KAAK,IAAI,GAAG,IAAI,KAAK,EAAE;AACpB,YAAA,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;AACpF,YAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACrB;YACH;AACA,YAAA,IAAI,GAAG,GAAI,KAAa,CAAC,GAAG,CAAC;AAC7B,YAAA,IAAI,CAAC,WAAW,CAAC,GA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ps.js","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["import { TagComponentType, TagProps, TagPropsRoot } from './types';\
|
|
1
|
+
{"version":3,"file":"useTagProps.js","sources":["../../src/Tag/useTagProps.ts"],"sourcesContent":["import { TagComponentType, TagProps, TagPropsRoot } from './types';\nimport cssPropList from './cssPropList';\nimport { css } from '../css';\nimport { classNames } from 'pretty-class';\nimport { CSSFactoryType } from 'oncss';\nimport { useMemo } from 'react';\nimport { useDocument } from '../Document';\nimport { useCSSCacheId } from '../css/CSSCacheProvider';\n\nexport type useTagPropsReturn<T extends TagComponentType = \"div\"> = {\n props: TagProps<T>,\n style: CSSFactoryType\n}\n\nconst useTagProps = <T extends TagComponentType = \"div\">(props: TagPropsRoot<T>): useTagPropsReturn<T> => {\n const cachekey = JSON.stringify(props, (key, value) => {\n return key === '_owner' || key === '_store' ? undefined : value;\n }, 2);\n\n const doc = useDocument();\n const cacheId = useCSSCacheId()\n\n const parsed = useMemo(() => {\n let _props: any = {}\n let _css: any = {}\n\n if (props.hover && Object.keys(props.hover).length > 0) {\n _css['&:hover'] = {\n ...props.hover\n }\n }\n\n for (let key in props) {\n const keys = [\"sx\", \"sxr\", \"style\", \"hover\", \"className\", \"classNames\", \"baseClass\"];\n if (keys.includes(key)) {\n continue;\n }\n let val = (props as any)[key];\n if (!cssPropList[key]) {\n _props[key] = val\n } else {\n _css[key] = val\n }\n }\n\n const styles = css({ ...props.sxr, ..._css, ...props.sx, ...props.style }, {\n injectStyle: typeof window !== 'undefined',\n container: doc?.document,\n cacheId\n })\n\n return {\n props: _props,\n styles,\n className: classNames(\n props.baseClass ? \"xui-\" + props.baseClass : undefined,\n props.classNames,\n props.className,\n styles.classname\n )\n }\n }, [cachekey])\n\n const _props: any = {};\n for (let prop in parsed.props) {\n _props[prop] = (props as any)[prop]\n }\n _props.className = parsed.className;\n\n return { props: _props, style: parsed.styles };\n}\n\n\nexport default useTagProps"],"names":["cssPropList"],"mappings":";;;;;;;AAcA,MAAM,WA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CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAM,KAAK,CAAC,GAAG,CAAA,EAAK,IAAI,CAAA,EAAK,KAAK,CAAC,EAAE,GAAK,KAAK,CAAC,KAAK,CAAA,EAAI;AACxE,YAAA,WAAW,EAAE,OAAO,MAAM,KAAK,WAAW;AAC1C,YAAA,SAAS,EAAE,GAAG,KAAA,IAAA,IAAH,GAAG,KAAA,MAAA,GAAA,MAAA,GAAH,GAAG,CAAE,QAAQ;YACxB;AACF,SAAA,CAAC;QAEF,OAAO;AACJ,YAAA,KAAK,EAAE,MAAM;YACb,MAAM;AACN,YAAA,SAAS,EAAE,UAAU,CAClB,KAAK,CAAC,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,EACtD,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,SAAS,EACf,MAAM,CAAC,SAAS;SAErB;AACJ,IAAA,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEd,MAAM,MAAM,GAAQ,EAAE;AACtB,IAAA,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE;QAC5B,MAAM,CAAC,IAAI,CAAC,GAAI,KAAa,CAAC,IAAI,CAAC;IACtC;AACA,IAAA,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS;IAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;AACjD;;;;"}
|
package/Transition/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useEffect, useState } from 'react';\nimport useTransition, { UseTransitionProps } from '../hooks/useTransition';\n\nexport type TransitionProps = UseTransitionProps & {\n children: React.ReactElement;\n}\n\nconst TransitionBase = ({ children, ...options }: TransitionProps) => {\n const { props, exited } = useTransition(options);\n if (exited) return null;\n const clone: any = Children.only(children);\n return cloneElement(clone, props);\n}\n\nfunction Transition({ children, ...options }: TransitionProps) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) return null;\n return <TransitionBase {...options} >{children}</TransitionBase>\n}\n\n\nexport default Transition"],"names":[],"mappings":";;;;;;;;AAQA;AAAwB;;AAEpB;AAAY;;AAEZ;AACJ;AAEA;AAAoB;;;;;AAOhB;AAAc;AACd;AACJ;;"}
|
package/Transition/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Transition/index.tsx"],"sourcesContent":["\"use client\";\nimport React, { cloneElement, Children, useEffect, useState } from 'react';\nimport useTransition, { UseTransitionProps } from '../hooks/useTransition';\n\nexport type TransitionProps = UseTransitionProps & {\n children: React.ReactElement;\n}\n\nconst TransitionBase = ({ children, ...options }: TransitionProps) => {\n const { props, exited } = useTransition(options);\n if (exited) return null;\n const clone: any = Children.only(children);\n return cloneElement(clone, props);\n}\n\nfunction Transition({ children, ...options }: TransitionProps) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) return null;\n return <TransitionBase {...options} >{children}</TransitionBase>\n}\n\n\nexport default Transition"],"names":[],"mappings":";;;;;;AAQA;AAAwB;;AAEpB;AAAY;;AAEZ;AACJ;AAEA;AAAoB;;;;;AAOhB;AAAc;AACd;AACJ;;"}
|
|
@@ -6,15 +6,14 @@ var React = require('react');
|
|
|
6
6
|
var index$1 = require('../css/index.cjs');
|
|
7
7
|
var index = require('../Document/index.cjs');
|
|
8
8
|
|
|
9
|
-
const BreakpointCtx = React.createContext(
|
|
9
|
+
const BreakpointCtx = React.createContext({
|
|
10
|
+
key: "xl",
|
|
11
|
+
width: 1920,
|
|
12
|
+
});
|
|
10
13
|
/**
|
|
11
14
|
* SSR-safe breakpoint detection
|
|
12
15
|
*/
|
|
13
|
-
const getKey = (
|
|
14
|
-
if (!doc || typeof window === "undefined" || typeof document === "undefined") {
|
|
15
|
-
return "xl";
|
|
16
|
-
}
|
|
17
|
-
const width = doc.documentElement.clientWidth || window.innerWidth;
|
|
16
|
+
const getKey = (width) => {
|
|
18
17
|
if (width < index$1.breakpoints.sm)
|
|
19
18
|
return "xs";
|
|
20
19
|
if (width < index$1.breakpoints.md)
|
|
@@ -26,22 +25,27 @@ const getKey = (doc) => {
|
|
|
26
25
|
return "xl";
|
|
27
26
|
};
|
|
28
27
|
const BreakpointProvider = ({ children }) => {
|
|
29
|
-
// hydrate-safe initial state
|
|
30
28
|
const doc = index.useDocument();
|
|
31
|
-
const
|
|
29
|
+
const getWidth = () => {
|
|
30
|
+
if (!doc)
|
|
31
|
+
return 1920; // SSR fallback
|
|
32
|
+
return doc.document.documentElement.clientWidth || window.innerWidth;
|
|
33
|
+
};
|
|
34
|
+
const [state, setState] = React.useState(() => {
|
|
35
|
+
const width = getWidth();
|
|
36
|
+
return { width, key: getKey(width) };
|
|
37
|
+
});
|
|
32
38
|
const handler = React.useCallback(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
39
|
+
const width = getWidth();
|
|
40
|
+
const key = getKey(width);
|
|
41
|
+
setState(prev => (prev.key === key ? prev : { key, width }));
|
|
37
42
|
}, [doc]);
|
|
38
|
-
// useLayoutEffect avoids visual flicker on first paint
|
|
39
43
|
React.useLayoutEffect(() => {
|
|
40
|
-
handler();
|
|
44
|
+
handler(); // set correct initial value
|
|
41
45
|
window.addEventListener("resize", handler, { passive: true });
|
|
42
46
|
return () => window.removeEventListener("resize", handler);
|
|
43
47
|
}, [handler]);
|
|
44
|
-
return
|
|
48
|
+
return jsxRuntime.jsx(BreakpointCtx.Provider, { value: state, children: children });
|
|
45
49
|
};
|
|
46
50
|
|
|
47
51
|
exports.BreakpointCtx = BreakpointCtx;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreakpointProvider.cjs","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"file":"BreakpointProvider.cjs","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { ReactNode, useState, useCallback, useLayoutEffect } from \"react\";\nimport { breakpoints } from \"../css\";\nimport { BreakpointKeys } from \"../css/types\";\nimport { useDocument } from \"../Document\";\n\ntype BreakpointCtxType = {\n key: BreakpointKeys;\n width: number;\n};\n\nexport const BreakpointCtx = React.createContext<BreakpointCtxType>({\n key: \"xl\",\n width: 1920,\n});\n\n/**\n * SSR-safe breakpoint detection\n */\nconst getKey = (width: number): BreakpointKeys => {\n if (width < breakpoints.sm) return \"xs\";\n if (width < breakpoints.md) return \"sm\";\n if (width < breakpoints.lg) return \"md\";\n if (width < breakpoints.xl) return \"lg\";\n return \"xl\";\n};\n\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\n const doc = useDocument();\n\n const getWidth = () => {\n if (!doc) return 1920; // SSR fallback\n return doc.document.documentElement.clientWidth || window.innerWidth;\n };\n\n const [state, setState] = useState<BreakpointCtxType>(() => {\n const width = getWidth();\n return { width, key: getKey(width) };\n });\n\n const handler = useCallback(() => {\n const width = getWidth();\n const key = getKey(width);\n\n setState(prev => (prev.key === key ? prev : { key, width }));\n }, [doc]);\n\n useLayoutEffect(() => {\n handler(); // set correct initial value\n window.addEventListener(\"resize\", handler, { passive: true });\n return () => window.removeEventListener(\"resize\", handler);\n }, [handler]);\n\n return <BreakpointCtx.Provider value={state}>{children}</BreakpointCtx.Provider>;\n};"],"names":[],"mappings":";;;;;;;;AAYO;AACH;AACA;AACH;AAED;;AAEG;AACH;AACI;AAA4B;AAC5B;AAA4B;AAC5B;AAA4B;AAC5B;AAA4B;AAC5B;AACJ;;AAGI;;AAGI;;;AAEJ;;AAGI;;AAEJ;AAEA;AACI;AACA;;AAGJ;;;AAII;;AAEJ;;AAGJ;;;"}
|