@flipdish/ui-library 0.31.4 → 0.31.5
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/dist/components/molecules/CodeSnippet/index.cjs.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.d.ts.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.js.map +1 -1
- package/dist/components/molecules/Pagination/index.cjs.map +1 -1
- package/dist/components/molecules/Pagination/index.d.ts.map +1 -1
- package/dist/components/molecules/Pagination/index.js.map +1 -1
- package/dist/components/organisms/Charts/index.d.ts +0 -2
- package/dist/components/organisms/Charts/index.d.ts.map +1 -1
- package/dist/components/templates/AppShell/index.cjs +5 -7
- package/dist/components/templates/AppShell/index.cjs.map +1 -1
- package/dist/components/templates/AppShell/index.d.ts +5 -7
- package/dist/components/templates/AppShell/index.d.ts.map +1 -1
- package/dist/components/templates/AppShell/index.js +5 -7
- package/dist/components/templates/AppShell/index.js.map +1 -1
- package/dist/components/templates/NotFoundPage/index.cjs +3 -9
- package/dist/components/templates/NotFoundPage/index.cjs.map +1 -1
- package/dist/components/templates/NotFoundPage/index.d.ts +3 -9
- package/dist/components/templates/NotFoundPage/index.d.ts.map +1 -1
- package/dist/components/templates/NotFoundPage/index.js +3 -9
- package/dist/components/templates/NotFoundPage/index.js.map +1 -1
- package/dist/components/templates/PageLayout/index.cjs +5 -12
- package/dist/components/templates/PageLayout/index.cjs.map +1 -1
- package/dist/components/templates/PageLayout/index.d.ts +5 -12
- package/dist/components/templates/PageLayout/index.d.ts.map +1 -1
- package/dist/components/templates/PageLayout/index.js +5 -12
- package/dist/components/templates/PageLayout/index.js.map +1 -1
- package/dist/hooks/useBreakpoints/index.cjs +5 -5
- package/dist/hooks/useBreakpoints/index.d.ts +5 -5
- package/dist/hooks/useBreakpoints/index.js +5 -5
- package/dist/hooks/useClipboard/index.cjs +5 -2
- package/dist/hooks/useClipboard/index.cjs.map +1 -1
- package/dist/hooks/useClipboard/index.d.ts +5 -2
- package/dist/hooks/useClipboard/index.d.ts.map +1 -1
- package/dist/hooks/useClipboard/index.js +5 -2
- package/dist/hooks/useClipboard/index.js.map +1 -1
- package/dist/hooks/usePlatform/index.cjs +4 -5
- package/dist/hooks/usePlatform/index.cjs.map +1 -1
- package/dist/hooks/usePlatform/index.d.ts +4 -5
- package/dist/hooks/usePlatform/index.d.ts.map +1 -1
- package/dist/hooks/usePlatform/index.js +4 -5
- package/dist/hooks/usePlatform/index.js.map +1 -1
- package/dist/hooks/useResizeObserver/index.cjs +7 -2
- package/dist/hooks/useResizeObserver/index.cjs.map +1 -1
- package/dist/hooks/useResizeObserver/index.d.ts +7 -2
- package/dist/hooks/useResizeObserver/index.d.ts.map +1 -1
- package/dist/hooks/useResizeObserver/index.js +7 -2
- package/dist/hooks/useResizeObserver/index.js.map +1 -1
- package/dist/hooks/useSidePanel/index.cjs +7 -5
- package/dist/hooks/useSidePanel/index.cjs.map +1 -1
- package/dist/hooks/useSidePanel/index.d.ts +7 -5
- package/dist/hooks/useSidePanel/index.d.ts.map +1 -1
- package/dist/hooks/useSidePanel/index.js +7 -5
- package/dist/hooks/useSidePanel/index.js.map +1 -1
- package/dist/native/utilities/cx/index.d.ts +9 -9
- package/dist/native/utilities/cx/index.d.ts.map +1 -1
- package/dist/native/utilities/cx/index.js +9 -9
- package/dist/native/utilities/cx/index.js.map +1 -1
- package/dist/native/utilities/testIdUtils/index.d.ts +44 -10
- package/dist/native/utilities/testIdUtils/index.d.ts.map +1 -1
- package/dist/native/utilities/testIdUtils/index.js +44 -10
- package/dist/native/utilities/testIdUtils/index.js.map +1 -1
- package/dist/providers/ErrorBoundary/index.cjs +5 -7
- package/dist/providers/ErrorBoundary/index.cjs.map +1 -1
- package/dist/providers/ErrorBoundary/index.d.ts +4 -7
- package/dist/providers/ErrorBoundary/index.d.ts.map +1 -1
- package/dist/providers/ErrorBoundary/index.js +5 -7
- package/dist/providers/ErrorBoundary/index.js.map +1 -1
- package/dist/providers/RouteProvider/index.cjs +5 -1
- package/dist/providers/RouteProvider/index.cjs.map +1 -1
- package/dist/providers/RouteProvider/index.d.ts +5 -1
- package/dist/providers/RouteProvider/index.d.ts.map +1 -1
- package/dist/providers/RouteProvider/index.js +5 -1
- package/dist/providers/RouteProvider/index.js.map +1 -1
- package/dist/providers/ThemeProvider/index.cjs +11 -1
- package/dist/providers/ThemeProvider/index.cjs.map +1 -1
- package/dist/providers/ThemeProvider/index.d.ts +11 -1
- package/dist/providers/ThemeProvider/index.d.ts.map +1 -1
- package/dist/providers/ThemeProvider/index.js +11 -1
- package/dist/providers/ThemeProvider/index.js.map +1 -1
- package/dist/providers/UIProvider/index.cjs +5 -1
- package/dist/providers/UIProvider/index.cjs.map +1 -1
- package/dist/providers/UIProvider/index.d.ts +5 -1
- package/dist/providers/UIProvider/index.d.ts.map +1 -1
- package/dist/providers/UIProvider/index.js +5 -1
- package/dist/providers/UIProvider/index.js.map +1 -1
- package/dist/utilities/cssScopeUtils/index.cjs +6 -5
- package/dist/utilities/cssScopeUtils/index.cjs.map +1 -1
- package/dist/utilities/cssScopeUtils/index.d.ts +6 -5
- package/dist/utilities/cssScopeUtils/index.d.ts.map +1 -1
- package/dist/utilities/cssScopeUtils/index.js +6 -5
- package/dist/utilities/cssScopeUtils/index.js.map +1 -1
- package/dist/utilities/cx/index.cjs +9 -9
- package/dist/utilities/cx/index.cjs.map +1 -1
- package/dist/utilities/cx/index.d.ts +9 -9
- package/dist/utilities/cx/index.d.ts.map +1 -1
- package/dist/utilities/cx/index.js +9 -9
- package/dist/utilities/cx/index.js.map +1 -1
- package/dist/utilities/hrefUtils/index.cjs +10 -11
- package/dist/utilities/hrefUtils/index.cjs.map +1 -1
- package/dist/utilities/hrefUtils/index.d.ts +10 -11
- package/dist/utilities/hrefUtils/index.d.ts.map +1 -1
- package/dist/utilities/hrefUtils/index.js +10 -11
- package/dist/utilities/hrefUtils/index.js.map +1 -1
- package/dist/utilities/localStorageUtils/index.cjs +8 -5
- package/dist/utilities/localStorageUtils/index.cjs.map +1 -1
- package/dist/utilities/localStorageUtils/index.d.ts +8 -5
- package/dist/utilities/localStorageUtils/index.d.ts.map +1 -1
- package/dist/utilities/localStorageUtils/index.js +8 -5
- package/dist/utilities/localStorageUtils/index.js.map +1 -1
- package/dist/utilities/renderUtils/index.cjs +31 -30
- package/dist/utilities/renderUtils/index.cjs.map +1 -1
- package/dist/utilities/renderUtils/index.d.ts +31 -30
- package/dist/utilities/renderUtils/index.d.ts.map +1 -1
- package/dist/utilities/renderUtils/index.js +31 -30
- package/dist/utilities/renderUtils/index.js.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.cjs +8 -5
- package/dist/utilities/sessionStorageUtils/index.cjs.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.d.ts +8 -5
- package/dist/utilities/sessionStorageUtils/index.d.ts.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.js +8 -5
- package/dist/utilities/sessionStorageUtils/index.js.map +1 -1
- package/dist/utilities/testIdUtils/index.cjs +44 -10
- package/dist/utilities/testIdUtils/index.cjs.map +1 -1
- package/dist/utilities/testIdUtils/index.d.ts +44 -10
- package/dist/utilities/testIdUtils/index.d.ts.map +1 -1
- package/dist/utilities/testIdUtils/index.js +44 -10
- package/dist/utilities/testIdUtils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/providers/ErrorBoundary/index.tsx"],"sourcesContent":[null],"names":["_jsx","ReactErrorBoundary","cx"],"mappings":";;;;;;AA0BA
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/providers/ErrorBoundary/index.tsx"],"sourcesContent":[null],"names":["_jsx","ReactErrorBoundary","cx"],"mappings":";;;;;;AA0BA;;;;;;AAMG;AACH;MACa,aAAa,GAAG,CAAC,EAC5B,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,sBAAsB,GAAG,sBAAsB,EAC/C,OAAO,EACP,SAAS,GACU,KAAe;IAClC,QACEA,cAAA,CAACC,gCAAkB,EAAA,EACjB,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,KAAI;;;AAG5B,YAAA,IAAI,cAAc,KAAK,SAAS,EAAE;AAChC,gBAAA,OAAO,cAAc,CAAC,KAAc,CAAC;YACvC;AACA,YAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,gBAAA,OAAO,QAAQ;YACjB;AACA,YAAA,QACED,cAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,EAAC,SAAS,EAAEE,KAAE,CAAC,yEAAyE,EAAE,SAAS,CAAC,YAClH,sBAAsB,EAAA,CACnB;QAEV,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,KAAI;;YAEvB,OAAO,CAAC,KAAK,CAAC,CAAA,eAAA,EAAkB,UAAU,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;AACrD,YAAA,OAAO,GAAG,KAAK,EAAE,IAAI,CAAC;AACxB,QAAA,CAAC,EAAA,QAAA,EAEA,QAAQ,EAAA,CACU;AAEzB;;"}
|
|
@@ -19,14 +19,11 @@ export interface ErrorBoundaryProps {
|
|
|
19
19
|
className?: string;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* (reporting is injected via `onError` to keep the library cross-platform).
|
|
22
|
+
* Catches render errors in its subtree and shows a fallback instead of crashing the app, as a
|
|
23
|
+
* thin wrapper around `react-error-boundary` so apps depend on one ui-library seam. Reporting
|
|
24
|
+
* is injected through `onError`, which keeps the boundary cross-platform.
|
|
26
25
|
*
|
|
27
|
-
*
|
|
28
|
-
* behavioural wrapper, not a UI primitive. The boundary logic is RN-safe; the default
|
|
29
|
-
* fallback renders a `<div>`, so an `index.native.tsx` sibling is needed before RN use.
|
|
26
|
+
* @summary render error boundary with a fallback and onError reporting
|
|
30
27
|
*/
|
|
31
28
|
export declare const ErrorBoundary: ({ identifier, children, fallback, renderFallback, somethingWentWrongText, onError, className, }: ErrorBoundaryProps) => ReactNode;
|
|
32
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ErrorBoundary/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2FAA2F;IAC3F,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC;IAC7C;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ErrorBoundary/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2FAA2F;IAC3F,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC;IAC7C;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AAEH,eAAO,MAAM,aAAa,GAAI,iGAQ3B,kBAAkB,KAAG,SA2BvB,CAAC"}
|
|
@@ -3,15 +3,13 @@ import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
|
3
3
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* (reporting is injected via `onError` to keep the library cross-platform).
|
|
6
|
+
* Catches render errors in its subtree and shows a fallback instead of crashing the app, as a
|
|
7
|
+
* thin wrapper around `react-error-boundary` so apps depend on one ui-library seam. Reporting
|
|
8
|
+
* is injected through `onError`, which keeps the boundary cross-platform.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
* behavioural wrapper, not a UI primitive. The boundary logic is RN-safe; the default
|
|
13
|
-
* fallback renders a `<div>`, so an `index.native.tsx` sibling is needed before RN use.
|
|
10
|
+
* @summary render error boundary with a fallback and onError reporting
|
|
14
11
|
*/
|
|
12
|
+
// The default fallback renders a <div>, so an index.native.tsx sibling is needed before React Native use.
|
|
15
13
|
const ErrorBoundary = ({ identifier, children, fallback, renderFallback, somethingWentWrongText = 'Something went wrong', onError, className, }) => {
|
|
16
14
|
return (jsx(ErrorBoundary$1, { fallbackRender: ({ error }) => {
|
|
17
15
|
// Use `undefined` (not nullish) checks so an explicit `null` from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/providers/ErrorBoundary/index.tsx"],"sourcesContent":[null],"names":["_jsx","ReactErrorBoundary"],"mappings":";;;;AA0BA
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/providers/ErrorBoundary/index.tsx"],"sourcesContent":[null],"names":["_jsx","ReactErrorBoundary"],"mappings":";;;;AA0BA;;;;;;AAMG;AACH;MACa,aAAa,GAAG,CAAC,EAC5B,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,sBAAsB,GAAG,sBAAsB,EAC/C,OAAO,EACP,SAAS,GACU,KAAe;IAClC,QACEA,GAAA,CAACC,eAAkB,EAAA,EACjB,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,KAAI;;;AAG5B,YAAA,IAAI,cAAc,KAAK,SAAS,EAAE;AAChC,gBAAA,OAAO,cAAc,CAAC,KAAc,CAAC;YACvC;AACA,YAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,gBAAA,OAAO,QAAQ;YACjB;AACA,YAAA,QACED,GAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,yEAAyE,EAAE,SAAS,CAAC,YAClH,sBAAsB,EAAA,CACnB;QAEV,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,KAAI;;YAEvB,OAAO,CAAC,KAAK,CAAC,CAAA,eAAA,EAAkB,UAAU,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;AACrD,YAAA,OAAO,GAAG,KAAK,EAAE,IAAI,CAAC;AACxB,QAAA,CAAC,EAAA,QAAA,EAEA,QAAQ,EAAA,CACU;AAEzB;;"}
|
|
@@ -5,7 +5,11 @@ var reactAriaComponents = require('react-aria-components');
|
|
|
5
5
|
var reactRouter = require('react-router');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Connects react-aria-components client-side navigation to react-router, so links and menu
|
|
9
|
+
* items with `href` route through the router instead of a full page load. Place it inside the
|
|
10
|
+
* router, around the component tree.
|
|
11
|
+
*
|
|
12
|
+
* @summary routes react-aria navigation through react-router
|
|
9
13
|
*/
|
|
10
14
|
const RouteProvider = ({ children }) => {
|
|
11
15
|
const navigate = reactRouter.useNavigate();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/providers/RouteProvider/index.tsx"],"sourcesContent":[null],"names":["useNavigate","_jsx","RouterProvider","useHref"],"mappings":";;;;;;AAaA
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/providers/RouteProvider/index.tsx"],"sourcesContent":[null],"names":["useNavigate","_jsx","RouterProvider","useHref"],"mappings":";;;;;;AAaA;;;;;;AAMG;MACU,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAqB,KAAI;AAC/D,IAAA,MAAM,QAAQ,GAAGA,uBAAW,EAAE;AAE9B,IAAA,QACEC,cAAA,CAACC,kCAAc,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAEC,mBAAO,EAAA,QAAA,EACjD,QAAQ,EAAA,CACM;AAErB;;"}
|
|
@@ -6,7 +6,11 @@ declare module 'react-aria-components' {
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Connects react-aria-components client-side navigation to react-router, so links and menu
|
|
10
|
+
* items with `href` route through the router instead of a full page load. Place it inside the
|
|
11
|
+
* router, around the component tree.
|
|
12
|
+
*
|
|
13
|
+
* @summary routes react-aria navigation through react-router
|
|
10
14
|
*/
|
|
11
15
|
export declare const RouteProvider: ({ children }: PropsWithChildren) => import("react").JSX.Element;
|
|
12
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/RouteProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,QAAQ,uBAAuB,CAAC;IACrC,UAAU,YAAY;QACpB,aAAa,EAAE,eAAe,CAAC;KAChC;CACF;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/RouteProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,QAAQ,uBAAuB,CAAC;IACrC,UAAU,YAAY;QACpB,aAAa,EAAE,eAAe,CAAC;KAChC;CACF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,cAAc,iBAAiB,gCAQ5D,CAAC"}
|
|
@@ -3,7 +3,11 @@ import { RouterProvider } from 'react-aria-components';
|
|
|
3
3
|
import { useNavigate, useHref } from 'react-router';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Connects react-aria-components client-side navigation to react-router, so links and menu
|
|
7
|
+
* items with `href` route through the router instead of a full page load. Place it inside the
|
|
8
|
+
* router, around the component tree.
|
|
9
|
+
*
|
|
10
|
+
* @summary routes react-aria navigation through react-router
|
|
7
11
|
*/
|
|
8
12
|
const RouteProvider = ({ children }) => {
|
|
9
13
|
const navigate = useNavigate();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/providers/RouteProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;AAaA
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/providers/RouteProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;AAaA;;;;;;AAMG;MACU,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAqB,KAAI;AAC/D,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE;AAE9B,IAAA,QACEA,GAAA,CAAC,cAAc,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAA,QAAA,EACjD,QAAQ,EAAA,CACM;AAErB;;"}
|
|
@@ -4,6 +4,12 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
|
|
6
6
|
const ThemeContext = React.createContext(undefined);
|
|
7
|
+
/**
|
|
8
|
+
* Reads the current theme and its setter from the nearest `ThemeProvider`.
|
|
9
|
+
*
|
|
10
|
+
* @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
|
|
11
|
+
* element carrying `data-theme`.
|
|
12
|
+
*/
|
|
7
13
|
const useTheme = () => {
|
|
8
14
|
const context = React.useContext(ThemeContext);
|
|
9
15
|
if (context === undefined) {
|
|
@@ -17,7 +23,11 @@ const resolveSystemPreference = () => {
|
|
|
17
23
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
18
24
|
};
|
|
19
25
|
/**
|
|
20
|
-
*
|
|
26
|
+
* Provides light/dark/system theme context, persisted to `localStorage` and following the OS
|
|
27
|
+
* when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
|
|
28
|
+
* and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
|
|
29
|
+
*
|
|
30
|
+
* @summary light/dark/system theme provider carrying data-theme
|
|
21
31
|
*/
|
|
22
32
|
const ThemeProvider = ({ children, defaultTheme = 'system', storageKey = 'ui-theme', themeModeOverride }) => {
|
|
23
33
|
const [theme, setTheme] = React.useState(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["createContext","useContext","useState","useEffect","useMemo","_jsx"],"mappings":";;;;;AAcA,MAAM,YAAY,GAAGA,mBAAa,CAA+B,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["createContext","useContext","useState","useEffect","useMemo","_jsx"],"mappings":";;;;;AAcA,MAAM,YAAY,GAAGA,mBAAa,CAA+B,SAAS,CAAC;AAE3E;;;;;AAKG;AACI,MAAM,QAAQ,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I,WAAW,KAAK,QAAQ,EAAE;AAC5B,gBAAA,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC;YACrC;iBAAO;AACL,gBAAA,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC;YAC/C;QACF;QAEA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC;AACpE,QAAA,MAAM,YAAY,GAAG,MAAM,mBAAmB,CAAC,UAAU,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AACrF,QAAA,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC;QACnD,OAAO,MAAM,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC;IACrE,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAE9D,IAAA,MAAM,YAAY,GAAGC,aAAO,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAEvI,IAAA,QACEC,cAAA,CAAC,YAAY,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,QAAA,EACxCA,cAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,YAAY,EAAA,YAAA,EAAc,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAA,QAAA,EAC7E,QAAQ,EAAA,CACL,EAAA,CACgB;AAE5B;;;"}
|
|
@@ -6,6 +6,12 @@ interface ThemeContextType {
|
|
|
6
6
|
themeRoot: HTMLElement | null;
|
|
7
7
|
resolvedMode: 'light' | 'dark';
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Reads the current theme and its setter from the nearest `ThemeProvider`.
|
|
11
|
+
*
|
|
12
|
+
* @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
|
|
13
|
+
* element carrying `data-theme`.
|
|
14
|
+
*/
|
|
9
15
|
export declare const useTheme: () => ThemeContextType;
|
|
10
16
|
interface ThemeProviderProps {
|
|
11
17
|
children: ReactNode;
|
|
@@ -26,7 +32,11 @@ interface ThemeProviderProps {
|
|
|
26
32
|
themeModeOverride?: 'light' | 'dark';
|
|
27
33
|
}
|
|
28
34
|
/**
|
|
29
|
-
*
|
|
35
|
+
* Provides light/dark/system theme context, persisted to `localStorage` and following the OS
|
|
36
|
+
* when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
|
|
37
|
+
* and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
|
|
38
|
+
*
|
|
39
|
+
* @summary light/dark/system theme provider carrying data-theme
|
|
30
40
|
*/
|
|
31
41
|
export declare const ThemeProvider: ({ children, defaultTheme, storageKey, themeModeOverride }: ThemeProviderProps) => import("react").JSX.Element;
|
|
32
42
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzC,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC;AAID,eAAO,MAAM,QAAQ,QAAO,gBAQ3B,CAAC;AAOF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACtC;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzC,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC;AAID;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,QAAO,gBAQ3B,CAAC;AAOF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACtC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,2DAAmF,kBAAkB,gCA0ClI,CAAC"}
|
|
@@ -2,6 +2,12 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { createContext, useState, useEffect, useMemo, useContext } from 'react';
|
|
3
3
|
|
|
4
4
|
const ThemeContext = createContext(undefined);
|
|
5
|
+
/**
|
|
6
|
+
* Reads the current theme and its setter from the nearest `ThemeProvider`.
|
|
7
|
+
*
|
|
8
|
+
* @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
|
|
9
|
+
* element carrying `data-theme`.
|
|
10
|
+
*/
|
|
5
11
|
const useTheme = () => {
|
|
6
12
|
const context = useContext(ThemeContext);
|
|
7
13
|
if (context === undefined) {
|
|
@@ -15,7 +21,11 @@ const resolveSystemPreference = () => {
|
|
|
15
21
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
16
22
|
};
|
|
17
23
|
/**
|
|
18
|
-
*
|
|
24
|
+
* Provides light/dark/system theme context, persisted to `localStorage` and following the OS
|
|
25
|
+
* when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
|
|
26
|
+
* and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
|
|
27
|
+
*
|
|
28
|
+
* @summary light/dark/system theme provider carrying data-theme
|
|
19
29
|
*/
|
|
20
30
|
const ThemeProvider = ({ children, defaultTheme = 'system', storageKey = 'ui-theme', themeModeOverride }) => {
|
|
21
31
|
const [theme, setTheme] = useState(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;AAcA,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;AAcA,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC;AAE3E;;;;;AAKG;AACI,MAAM,QAAQ,GAAG,MAAuB;AAC7C,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC;AAExC,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;IACjE;AAEA,IAAA,OAAO,OAAO;AAChB;AAEA,MAAM,uBAAuB,GAAG,MAAuB;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,OAAO;AACjD,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,GAAG,MAAM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AAY,CAAC;QACnD,OAAO,MAAM,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC;IACrE,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAE9D,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAEvI,IAAA,QACEA,GAAA,CAAC,YAAY,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,QAAA,EACxCA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,YAAY,EAAA,YAAA,EAAc,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAA,QAAA,EAC7E,QAAQ,EAAA,CACL,EAAA,CACgB;AAE5B;;"}
|
|
@@ -71,7 +71,11 @@ const UIProviderInner = ({ children, baseUrl, errorBoundary, portalContainer })
|
|
|
71
71
|
return (jsxRuntime.jsx(reactRouter.BrowserRouter, { basename: baseUrl, children: jsxRuntime.jsx(RouteProvider.RouteProvider, { children: jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { ...errorBoundary, children: jsxRuntime.jsx(PortalContainer.PortalContainer, { getContainer: getContainer, children: children }) }) }) }));
|
|
72
72
|
};
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
|
|
75
|
+
* and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
|
|
76
|
+
* only when overlays must land in a specific container.
|
|
77
|
+
*
|
|
78
|
+
* @summary root provider composing theme, routing, errors and portals
|
|
75
79
|
*/
|
|
76
80
|
const UIProvider = ({ children, themeModeOverride, ...rest }) => {
|
|
77
81
|
// TODO(i18n): add an internal library translation context so ui-library components can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["useTheme","useState","useRef","useLayoutEffect","useCallback","_jsx","BrowserRouter","RouteProvider","ErrorBoundary","PortalContainer","ThemeProvider"],"mappings":";;;;;;;;;;AA2CA,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAiE,KAAI;IAC/I,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAGA,sBAAQ,EAAE;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGC,cAAQ,CAAqB,IAAI,CAAC;AAC1E,IAAA,MAAM,gBAAgB,GAAGC,YAAM,CAAqB,IAAI,CAAC;AACzD,IAAA,MAAM,qBAAqB,GAAGA,YAAM,CAAqB,IAAI,CAAC;;;;;;;;IAS9DC,qBAAe,CAAC,MAAK;AACnB,QAAA,MAAM,QAAQ,GAAG,eAAe,IAAI,IAAI,IAAI;AAC5C,QAAA,IAAI,QAAQ,KAAK,qBAAqB,CAAC,OAAO,EAAE;YAC9C;QACF;AAEA,QAAA,qBAAqB,CAAC,OAAO,GAAG,QAAQ;AACxC,QAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE;AAClC,QAAA,gBAAgB,CAAC,OAAO,GAAG,IAAI;QAE/B,IAAI,CAAC,QAAQ,EAAE;YACb,eAAe,CAAC,IAAI,CAAC;YACrB;QACF;QAEA,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AAC5C,QAAA,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,UAAU;AACjC,QAAA,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC;AAC/C,QAAA,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC;AAC5B,QAAA,gBAAgB,CAAC,OAAO,GAAG,MAAM;QACjC,eAAe,CAAC,MAAM,CAAC;AACzB,IAAA,CAAC,CAAC;AAEF,IAAAA,qBAAe,CACb,MAAM,MAAK;AACT,QAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE;AAClC,QAAA,gBAAgB,CAAC,OAAO,GAAG,IAAI;;;;;;AAM/B,QAAA,qBAAqB,CAAC,OAAO,GAAG,IAAI;IACtC,CAAC,EACD,EAAE,CACH;IAEDA,qBAAe,CAAC,MAAK;QACnB,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC;AACpE,IAAA,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;;;;;;;AAQlB,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAAC,MAAK;AACpC,QAAA,MAAM,QAAQ,GAAG,eAAe,IAAI,IAAI,IAAI;QAC5C,IAAI,QAAQ,EAAE;AACZ,YAAA,OAAO,QAAQ,KAAK,qBAAqB,CAAC,OAAO,GAAG,YAAY,GAAG,IAAI;QACzE;QACA,IAAI,eAAe,EAAE;AACnB,YAAA,OAAO,IAAI;QACb;AACA,QAAA,OAAO,SAAS;IAClB,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;AAE9C,IAAA,QACEC,cAAA,CAACC,yBAAa,EAAA,EAAC,QAAQ,EAAE,OAAO,EAAA,QAAA,EAC9BD,cAAA,CAACE,2BAAa,EAAA,EAAA,QAAA,EACZF,cAAA,CAACG,2BAAa,EAAA,EAAA,GAAK,aAAa,EAAA,QAAA,EAC9BH,cAAA,CAACI,+BAAe,EAAA,EAAC,YAAY,EAAE,YAAY,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CAC3D,EAAA,CACF,EAAA,CACF;AAEpB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["useTheme","useState","useRef","useLayoutEffect","useCallback","_jsx","BrowserRouter","RouteProvider","ErrorB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11 @@ export interface UIProviderProps {
|
|
|
34
34
|
portalContainer?: (() => HTMLElement | null) | null;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
|
|
38
|
+
* and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
|
|
39
|
+
* only when overlays must land in a specific container.
|
|
40
|
+
*
|
|
41
|
+
* @summary root provider composing theme, routing, errors and portals
|
|
38
42
|
*/
|
|
39
43
|
export declare const UIProvider: ({ children, themeModeOverride, ...rest }: PropsWithChildren<UIProviderProps>) => import("react").JSX.Element;
|
|
40
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/UIProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAItG,OAAO,EAAE,KAAK,iBAAiB,EAAkD,MAAM,OAAO,CAAC;AAG/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACpD;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CACrD;AAoFD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/UIProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAItG,OAAO,EAAE,KAAK,iBAAiB,EAAkD,MAAM,OAAO,CAAC;AAG/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACpD;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CACrD;AAoFD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,0CAA0C,iBAAiB,CAAC,eAAe,CAAC,gCAUtG,CAAC"}
|
|
@@ -69,7 +69,11 @@ const UIProviderInner = ({ children, baseUrl, errorBoundary, portalContainer })
|
|
|
69
69
|
return (jsx(BrowserRouter, { basename: baseUrl, children: jsx(RouteProvider, { children: jsx(ErrorBoundary, { ...errorBoundary, children: jsx(PortalContainer, { getContainer: getContainer, children: children }) }) }) }));
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
|
|
73
|
+
* and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
|
|
74
|
+
* only when overlays must land in a specific container.
|
|
75
|
+
*
|
|
76
|
+
* @summary root provider composing theme, routing, errors and portals
|
|
73
77
|
*/
|
|
74
78
|
const UIProvider = ({ children, themeModeOverride, ...rest }) => {
|
|
75
79
|
// TODO(i18n): add an internal library translation context so ui-library components can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;;AA2CA,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAiE,KAAI;IAC/I,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE;IAC9C,MAA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,QAAA,OAAO,SAAS;IAClB,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;AAE9C,IAAA,QACEA,GAAA,CAAC,aAAa,EAAA,EAAC,QAAQ,EAAE,OAAO,EAAA,QAAA,EAC9BA,GAAA,CAAC,aAAa,EAAA,EAAA,QAAA,EACZA,GAAA,CAAC,aAAa,EAAA,EAAA,GAAK,aAAa,EAAA,QAAA,EAC9BA,GAAA,CAAC,eAAe,EAAA,EAAC,YAAY,EAAE,YAAY,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CAC3D,EAAA,CACF,EAAA,CACF;AAEpB,CAAC;AAED;;;;;;AAMG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAI,EAAsC,KAAI;;;;;AAKzG,IAAA,QACEA,GAAA,CAAC,aAAa,EAAA,EAAC,iBAAiB,EAAE,iBAAiB,EAAA,QAAA,EACjDA,GAAA,CAAC,eAAe,OAAK,IAAI,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CACzC;AAEpB;;"}
|
|
@@ -45,13 +45,14 @@ const KEYFRAME_STEP = /^(from|to|\d+(\.\d+)?%)$/;
|
|
|
45
45
|
/** Escape a string for safe use as a literal inside a `RegExp`. */
|
|
46
46
|
const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Builds the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
|
|
49
49
|
* under `scopeSelector`.
|
|
50
50
|
*
|
|
51
|
-
* @param scopeSelector The selector every rule is scoped under
|
|
52
|
-
*
|
|
53
|
-
* @param options Behavioural toggles
|
|
54
|
-
* @returns
|
|
51
|
+
* @param scopeSelector The selector every rule is scoped under, such as
|
|
52
|
+
* `'#flipdish-micro-frontend'`; must match the `prefix` passed to `postcss-prefix-selector`.
|
|
53
|
+
* @param options Behavioural toggles; see `ScopedPrefixTransformOptions`.
|
|
54
|
+
* @returns The `(prefix, selector, prefixedSelector, filePath?) => string` transform to pass
|
|
55
|
+
* to the plugin.
|
|
55
56
|
*/
|
|
56
57
|
function createScopedPrefixTransform(scopeSelector, options = {}) {
|
|
57
58
|
const { shouldScope, scopeBody = false, matchRootElement = false } = options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AA4BH;AACA,MAAM,aAAa,GAAG,0BAA0B;AAEhD;AACA,MAAM,YAAY,GAAG,CAAC,KAAa,KAAa,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AAE5F
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AA4BH;AACA,MAAM,aAAa,GAAG,0BAA0B;AAEhD;AACA,MAAM,YAAY,GAAG,CAAC,KAAa,KAAa,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AAE5F;;;;;;;;;AASG;SACa,2BAA2B,CACzC,aAAqB,EACrB,UAAwC,EAAE,EAAA;AAE1C,IAAA,MAAM,EAAE,WAAW,EAAE,SAAS,GAAG,KAAK,EAAE,gBAAgB,GAAG,KAAK,EAAE,GAAG,OAAO;AAE5E,IAAA,MAAM,uBAAuB,GAAG,aAAa,CAAC,IAAI,EAAE;IACpD,IAAI,CAAC,uBAAuB,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC;IAC/F;;;;;AAMA,IAAA,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,CAAA,CAAA,EAAI,YAAY,CAAC,uBAAuB,CAAC,CAAA,qBAAA,CAAuB,CAAC;IAElG,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,KAAI;;QAEtD,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE;AACzC,YAAA,OAAO,QAAQ;QACjB;;QAGA,IAAI,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE;AAC5C,YAAA,OAAO,QAAQ;QACjB;;;;QAKA,IAAI,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,MAAM,EAAE;AAC/C,YAAA,OAAO,MAAM;QACf;;AAGA,QAAA,IAAI,QAAQ,KAAK,OAAO,EAAE;AACxB,YAAA,OAAO,QAAQ;QACjB;;;AAIA,QAAA,IAAI,QAAQ,KAAK,MAAM,EAAE;YACvB,OAAO,SAAS,GAAG,MAAM,GAAG,QAAQ;QACtC;;QAGA,IAAI,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE;AACvC,YAAA,OAAO,QAAQ;QACjB;;;QAIA,IAAI,gBAAgB,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAChD,YAAA,OAAO,GAAG,MAAM,CAAA,EAAG,QAAQ,CAAA,EAAA,EAAK,gBAAgB,EAAE;QACpD;;;AAIA,QAAA,OAAO,gBAAgB;AACzB,IAAA,CAAC;AACH;;"}
|
|
@@ -64,13 +64,14 @@ export interface ScopedPrefixTransformOptions {
|
|
|
64
64
|
matchRootElement?: boolean;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* Builds the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
|
|
68
68
|
* under `scopeSelector`.
|
|
69
69
|
*
|
|
70
|
-
* @param scopeSelector The selector every rule is scoped under
|
|
71
|
-
*
|
|
72
|
-
* @param options Behavioural toggles
|
|
73
|
-
* @returns
|
|
70
|
+
* @param scopeSelector The selector every rule is scoped under, such as
|
|
71
|
+
* `'#flipdish-micro-frontend'`; must match the `prefix` passed to `postcss-prefix-selector`.
|
|
72
|
+
* @param options Behavioural toggles; see `ScopedPrefixTransformOptions`.
|
|
73
|
+
* @returns The `(prefix, selector, prefixedSelector, filePath?) => string` transform to pass
|
|
74
|
+
* to the plugin.
|
|
74
75
|
*/
|
|
75
76
|
export declare function createScopedPrefixTransform(scopeSelector: string, options?: ScopedPrefixTransformOptions): (prefix: string, selector: string, prefixedSelector: string, filePath?: string) => string;
|
|
76
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,MAAM,WAAW,4BAA4B;IAC3C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC;IACxD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAQD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,MAAM,WAAW,4BAA4B;IAC3C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC;IACxD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAQD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,4BAAiC,GACzC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CA0D3F"}
|
|
@@ -43,13 +43,14 @@ const KEYFRAME_STEP = /^(from|to|\d+(\.\d+)?%)$/;
|
|
|
43
43
|
/** Escape a string for safe use as a literal inside a `RegExp`. */
|
|
44
44
|
const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Builds the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
|
|
47
47
|
* under `scopeSelector`.
|
|
48
48
|
*
|
|
49
|
-
* @param scopeSelector The selector every rule is scoped under
|
|
50
|
-
*
|
|
51
|
-
* @param options Behavioural toggles
|
|
52
|
-
* @returns
|
|
49
|
+
* @param scopeSelector The selector every rule is scoped under, such as
|
|
50
|
+
* `'#flipdish-micro-frontend'`; must match the `prefix` passed to `postcss-prefix-selector`.
|
|
51
|
+
* @param options Behavioural toggles; see `ScopedPrefixTransformOptions`.
|
|
52
|
+
* @returns The `(prefix, selector, prefixedSelector, filePath?) => string` transform to pass
|
|
53
|
+
* to the plugin.
|
|
53
54
|
*/
|
|
54
55
|
function createScopedPrefixTransform(scopeSelector, options = {}) {
|
|
55
56
|
const { shouldScope, scopeBody = false, matchRootElement = false } = options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AA4BH;AACA,MAAM,aAAa,GAAG,0BAA0B;AAEhD;AACA,MAAM,YAAY,GAAG,CAAC,KAAa,KAAa,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;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vB,OAAO,SAAS,GAAG,MAAM,GAAG,QAAQ;QACtC;;QAGA,IAAI,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE;AACvC,YAAA,OAAO,QAAQ;QACjB;;;QAIA,IAAI,gBAAgB,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAChD,YAAA,OAAO,GAAG,MAAM,CAAA,EAAG,QAAQ,CAAA,EAAA,EAAK,gBAAgB,EAAE;QACpD;;;AAIA,QAAA,OAAO,gBAAgB;AACzB,IAAA,CAAC;AACH;;"}
|
|
@@ -18,21 +18,21 @@ const twMerge = tailwindMerge.extendTailwindMerge({
|
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* conditionals — so it composes cleanly:
|
|
21
|
+
* Merges Tailwind class strings so the last conflicting value wins; accepts strings, arrays
|
|
22
|
+
* and falsy values like tailwind-merge, and is pure JS so it works on web and React Native.
|
|
24
23
|
*
|
|
25
24
|
* cx('px-2', isActive && 'bg-primary', ['text-sm', null]);
|
|
26
25
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* `@flipdish/ui-library/utilities/cx`.
|
|
26
|
+
* @param inputs Class strings, arrays of them, or falsy values for conditionals.
|
|
27
|
+
* @returns One class string with conflicts resolved and falsy inputs dropped.
|
|
30
28
|
*/
|
|
31
29
|
const cx = twMerge;
|
|
32
30
|
/**
|
|
33
|
-
* Identity helper
|
|
34
|
-
*
|
|
35
|
-
*
|
|
31
|
+
* Identity helper so Tailwind IntelliSense recognises and sorts the class strings inside
|
|
32
|
+
* `*.styles.ts` maps.
|
|
33
|
+
*
|
|
34
|
+
* @param classes A style map of literal Tailwind class strings.
|
|
35
|
+
* @returns The same object, unchanged.
|
|
36
36
|
*/
|
|
37
37
|
const sortCx = (classes) => classes;
|
|
38
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/utilities/cx/index.ts"],"sourcesContent":[null],"names":["extendTailwindMerge"],"mappings":";;;;AAEA;;;;;;;AAOG;AACH,MAAM,OAAO,GAAGA,iCAAmB,CAAC;AAClC,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;AAC5F,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/utilities/cx/index.ts"],"sourcesContent":[null],"names":["extendTailwindMerge"],"mappings":";;;;AAEA;;;;;;;AAOG;AACH,MAAM,OAAO,GAAGA,iCAAmB,CAAC;AAClC,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;AAC5F,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF;;;;;;;;AAQG;AACI,MAAM,EAAE,GAAG;AAKlB;;;;;;AAMG;AACI,MAAM,MAAM,GAAG,CAA4B,OAAU,KAAQ;;;"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* conditionals — so it composes cleanly:
|
|
2
|
+
* Merges Tailwind class strings so the last conflicting value wins; accepts strings, arrays
|
|
3
|
+
* and falsy values like tailwind-merge, and is pure JS so it works on web and React Native.
|
|
5
4
|
*
|
|
6
5
|
* cx('px-2', isActive && 'bg-primary', ['text-sm', null]);
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `@flipdish/ui-library/utilities/cx`.
|
|
7
|
+
* @param inputs Class strings, arrays of them, or falsy values for conditionals.
|
|
8
|
+
* @returns One class string with conflicts resolved and falsy inputs dropped.
|
|
11
9
|
*/
|
|
12
10
|
export declare const cx: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
13
11
|
type ClassValue = string | number;
|
|
14
12
|
type ClassDefinition = Record<string, ClassValue | Record<string, ClassValue | Record<string, ClassValue>>>;
|
|
15
13
|
/**
|
|
16
|
-
* Identity helper
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* Identity helper so Tailwind IntelliSense recognises and sorts the class strings inside
|
|
15
|
+
* `*.styles.ts` maps.
|
|
16
|
+
*
|
|
17
|
+
* @param classes A style map of literal Tailwind class strings.
|
|
18
|
+
* @returns The same object, unchanged.
|
|
19
19
|
*/
|
|
20
20
|
export declare const sortCx: <T extends ClassDefinition>(classes: T) => T;
|
|
21
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/cx/index.ts"],"names":[],"mappings":"AAkBA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/cx/index.ts"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,eAAO,MAAM,EAAE,sEAAU,CAAC;AAE1B,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAClC,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;AAE5G;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,eAAe,EAAE,SAAS,CAAC,KAAG,CAAY,CAAC"}
|
|
@@ -16,21 +16,21 @@ const twMerge = extendTailwindMerge({
|
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* conditionals — so it composes cleanly:
|
|
19
|
+
* Merges Tailwind class strings so the last conflicting value wins; accepts strings, arrays
|
|
20
|
+
* and falsy values like tailwind-merge, and is pure JS so it works on web and React Native.
|
|
22
21
|
*
|
|
23
22
|
* cx('px-2', isActive && 'bg-primary', ['text-sm', null]);
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* `@flipdish/ui-library/utilities/cx`.
|
|
24
|
+
* @param inputs Class strings, arrays of them, or falsy values for conditionals.
|
|
25
|
+
* @returns One class string with conflicts resolved and falsy inputs dropped.
|
|
28
26
|
*/
|
|
29
27
|
const cx = twMerge;
|
|
30
28
|
/**
|
|
31
|
-
* Identity helper
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* Identity helper so Tailwind IntelliSense recognises and sorts the class strings inside
|
|
30
|
+
* `*.styles.ts` maps.
|
|
31
|
+
*
|
|
32
|
+
* @param classes A style map of literal Tailwind class strings.
|
|
33
|
+
* @returns The same object, unchanged.
|
|
34
34
|
*/
|
|
35
35
|
const sortCx = (classes) => classes;
|
|
36
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/utilities/cx/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;AAOG;AACH,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAClC,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;AAC5F,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/utilities/cx/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;AAOG;AACH,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAClC,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;AAC5F,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF;;;;;;;;AAQG;AACI,MAAM,EAAE,GAAG;AAKlB;;;;;;AAMG;AACI,MAAM,MAAM,GAAG,CAA4B,OAAU,KAAQ;;"}
|
|
@@ -10,14 +10,12 @@ const KNOWN_BLOCKED_SCHEMES = ['javascript:', 'data:', 'vbscript:', 'file:', 'bl
|
|
|
10
10
|
// biome-ignore lint/suspicious/noControlCharactersInRegex: removing control characters is the point
|
|
11
11
|
const CONTROL_CHARACTERS = /[\u0000-\u001F\u007F]/g;
|
|
12
12
|
/**
|
|
13
|
-
* Validates a consumer-supplied `href`
|
|
13
|
+
* Validates a consumer-supplied `href` before it reaches an anchor: strips control characters
|
|
14
|
+
* and rejects schemes outside http, https, mailto and tel, blocking `javascript:` and `data:`
|
|
15
|
+
* URLs.
|
|
14
16
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* values (relative paths, fragments, bare domains) are allowed.
|
|
18
|
-
*
|
|
19
|
-
* @returns the cleaned href, or `undefined` when the href is not allowed (rendering
|
|
20
|
-
* an anchor with no `href` rather than an executable one).
|
|
17
|
+
* @param href The value a consumer passed, possibly from user or CMS data.
|
|
18
|
+
* @returns The cleaned href, or `undefined` when blocked so the anchor renders without one.
|
|
21
19
|
*/
|
|
22
20
|
const safeHref = (href) => {
|
|
23
21
|
if (href === undefined) {
|
|
@@ -38,10 +36,11 @@ const safeHref = (href) => {
|
|
|
38
36
|
return cleaned;
|
|
39
37
|
};
|
|
40
38
|
/**
|
|
41
|
-
* Whether an href points at an external
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
39
|
+
* Whether an href points at an external http/https site, for `target="_blank"` decisions,
|
|
40
|
+
* matched on the real scheme so `javascript:` and `httpfoo` never misclassify.
|
|
41
|
+
*
|
|
42
|
+
* @param href The value to classify; control characters are stripped first.
|
|
43
|
+
* @returns `true` only for an explicit `http:` or `https:` scheme.
|
|
45
44
|
*/
|
|
46
45
|
const isExternalHref = (href) => /^https?:/i.test((href ?? '').replace(CONTROL_CHARACTERS, '').trim());
|
|
47
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/utilities/hrefUtils/index.ts"],"sourcesContent":[null],"names":["warnOnce"],"mappings":";;;;AAEA,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;AAEhE;AACA,MAAM,qBAAqB,GAAG,CAAC,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;AAE7F;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,wBAAwB;AAEnD
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/utilities/hrefUtils/index.ts"],"sourcesContent":[null],"names":["warnOnce"],"mappings":";;;;AAEA,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;AAEhE;AACA,MAAM,qBAAqB,GAAG,CAAC,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;AAE7F;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,wBAAwB;AAEnD;;;;;;;AAOG;AACI,MAAM,QAAQ,GAAG,CAAC,IAAwB,KAAwB;AACvE,IAAA,IAAI,IAAI,KAAK,SAAS,EAAE;AACtB,QAAA,OAAO,SAAS;IAClB;IACA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;AACpD,IAAA,MAAM,MAAM,GAAG,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE;IAC7E,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;;;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