@okta/odyssey-react-mui 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/OdysseyCacheProvider.js +9 -4
- package/dist/OdysseyCacheProvider.js.map +1 -1
- package/dist/src/OdysseyCacheProvider.d.ts +1 -1
- package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/OdysseyCacheProvider.tsx +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.9.2](https://github.com/okta/odyssey/compare/v1.9.1...v1.9.2) (2023-12-08)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- add back props removed from odyssey cache provider ([#2066](https://github.com/okta/odyssey/issues/2066)) ([782475c](https://github.com/okta/odyssey/commit/782475cc222069f0417b08cb40ed57d298903b1d))
|
|
11
|
+
|
|
6
12
|
## [1.9.1](https://github.com/okta/odyssey/compare/v1.9.0...v1.9.1) (2023-12-05)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -18,7 +18,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
18
18
|
const OdysseyCacheProvider = _ref => {
|
|
19
19
|
let {
|
|
20
20
|
children,
|
|
21
|
-
emotionRoot
|
|
21
|
+
emotionRoot,
|
|
22
|
+
nonce,
|
|
23
|
+
stylisPlugins
|
|
22
24
|
} = _ref;
|
|
23
25
|
const uniqueAlphabeticalId = useUniqueAlphabeticalId();
|
|
24
26
|
const emotionCache = useMemo(() => {
|
|
@@ -27,11 +29,14 @@ const OdysseyCacheProvider = _ref => {
|
|
|
27
29
|
container: emotionRoot
|
|
28
30
|
}),
|
|
29
31
|
key: uniqueAlphabeticalId,
|
|
30
|
-
nonce: window.cspNonce,
|
|
32
|
+
nonce: nonce ?? window.cspNonce,
|
|
31
33
|
prepend: true,
|
|
32
|
-
speedy: false
|
|
34
|
+
speedy: false,
|
|
35
|
+
...(stylisPlugins && {
|
|
36
|
+
stylisPlugins
|
|
37
|
+
})
|
|
33
38
|
});
|
|
34
|
-
}, [emotionRoot, uniqueAlphabeticalId]);
|
|
39
|
+
}, [emotionRoot, nonce, stylisPlugins, uniqueAlphabeticalId]);
|
|
35
40
|
return _jsx(CacheProvider, {
|
|
36
41
|
value: emotionCache,
|
|
37
42
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","memo","useMemo","useUniqueAlphabeticalId","CacheProvider","jsx","_jsx","OdysseyCacheProvider","_ref","children","emotionRoot","uniqueAlphabeticalId","emotionCache","container","key","
|
|
1
|
+
{"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","memo","useMemo","useUniqueAlphabeticalId","CacheProvider","jsx","_jsx","OdysseyCacheProvider","_ref","children","emotionRoot","nonce","stylisPlugins","uniqueAlphabeticalId","emotionCache","container","key","window","cspNonce","prepend","speedy","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../src/OdysseyCacheProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\ndeclare global {\n interface Window {\n cspNonce: string;\n }\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { memo, useMemo, ReactNode } from \"react\";\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId\";\nimport { CacheProvider } from \"@emotion/react\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n nonce?: string;\n /**\n * Emotion caches styles into the style element.\n * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.\n */\n emotionRoot?: HTMLStyleElement;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n emotionRoot,\n nonce,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const emotionCache = useMemo(() => {\n return createCache({\n ...(emotionRoot && { container: emotionRoot }),\n key: uniqueAlphabeticalId,\n nonce: nonce ?? window.cspNonce,\n prepend: true,\n speedy: false, // <-- Needs to be set to false when shadow-dom is used!! https://github.com/emotion-js/emotion/issues/2053#issuecomment-713429122\n ...(stylisPlugins && { stylisPlugins }),\n });\n }, [emotionRoot, nonce, stylisPlugins, uniqueAlphabeticalId]);\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,WAAW,MAAwB,gBAAgB;AAC1D,SAASC,IAAI,EAAEC,OAAO,QAAmB,OAAO;AAAC,SACxCC,uBAAuB;AAChC,SAASC,aAAa,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkB/C,MAAMC,oBAAoB,GAAGC,IAAA,IAKI;EAAA,IALH;IAC5BC,QAAQ;IACRC,WAAW;IACXC,KAAK;IACLC;EACyB,CAAC,GAAAJ,IAAA;EAC1B,MAAMK,oBAAoB,GAAGV,uBAAuB,CAAC,CAAC;EAEtD,MAAMW,YAAY,GAAGZ,OAAO,CAAC,MAAM;IACjC,OAAOF,WAAW,CAAC;MACjB,IAAIU,WAAW,IAAI;QAAEK,SAAS,EAAEL;MAAY,CAAC,CAAC;MAC9CM,GAAG,EAAEH,oBAAoB;MACzBF,KAAK,EAAEA,KAAK,IAAIM,MAAM,CAACC,QAAQ;MAC/BC,OAAO,EAAE,IAAI;MACbC,MAAM,EAAE,KAAK;MACb,IAAIR,aAAa,IAAI;QAAEA;MAAc,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,EAAE,CAACF,WAAW,EAAEC,KAAK,EAAEC,aAAa,EAAEC,oBAAoB,CAAC,CAAC;EAE7D,OAAOP,IAAA,CAACF,aAAa;IAACiB,KAAK,EAAEP,YAAa;IAAAL,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AACvE,CAAC;AAED,MAAMa,4BAA4B,GAAGrB,IAAI,CAACM,oBAAoB,CAAC;AAC/De,4BAA4B,CAACC,WAAW,GAAG,sBAAsB;AAEjE,SAASD,4BAA4B,IAAIf,oBAAoB"}
|
|
@@ -31,6 +31,6 @@ export type OdysseyCacheProviderProps = {
|
|
|
31
31
|
shadowDomElement?: HTMLDivElement | HTMLElement;
|
|
32
32
|
stylisPlugins?: StylisPlugin[];
|
|
33
33
|
};
|
|
34
|
-
declare const MemoizedOdysseyCacheProvider: import("react").MemoExoticComponent<({ children, emotionRoot, }: OdysseyCacheProviderProps) => JSX.Element>;
|
|
34
|
+
declare const MemoizedOdysseyCacheProvider: import("react").MemoExoticComponent<({ children, emotionRoot, nonce, stylisPlugins, }: OdysseyCacheProviderProps) => JSX.Element>;
|
|
35
35
|
export { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };
|
|
36
36
|
//# sourceMappingURL=OdysseyCacheProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyCacheProvider.d.ts","sourceRoot":"","sources":["../../src/OdysseyCacheProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,OAAoB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC;IAChD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC,CAAC;
|
|
1
|
+
{"version":3,"file":"OdysseyCacheProvider.d.ts","sourceRoot":"","sources":["../../src/OdysseyCacheProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,OAAoB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC;IAChD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC,CAAC;AAwBF,QAAA,MAAM,4BAA4B,yFAjB/B,yBAAyB,iBAiBmC,CAAC;AAGhE,OAAO,EAAE,4BAA4B,IAAI,oBAAoB,EAAE,CAAC"}
|