@commercetools/nimbus 0.0.9-rc5 → 0.0.9-rc6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-jsdom-polyfills.cjs","sources":["../src/test/setup-jsdom-polyfills.ts"],"sourcesContent":["// implementation of structuredClone polyfill to satisfy the Nimbus (Chakra UI) provider\nif (typeof global.structuredClone !== \"function\") {\n global.structuredClone = function structuredClone(value) {\n if (value === null || value === undefined) {\n return value;\n }\n\n try {\n // For objects and arrays, use JSON methods\n if (typeof value === \"object\") {\n return JSON.parse(JSON.stringify(value));\n }\n // For primitive values, return directly\n return value;\n } catch (error) {\n console.warn(\"structuredClone polyfill failed:\", error);\n\n // Returns a shallow copy as fallback\n return Array.isArray(value) ? [...value] : { ...value };\n }\n };\n}\n\n// Polyfill window.matchMedia for JSDOM (used by Nimbus/Chakra for theming)\nObject.defineProperty(window, \"matchMedia\", {\n writable: true,\n value: (query: unknown) => ({\n matches: false, // Default value, tests can override if needed\n media: query,\n onchange: null,\n addListener: () => {}, // Deprecated but needed for some libs\n removeListener: () => {}, // Deprecated but needed for some libs\n addEventListener: () => {},\n removeEventListener: () => {},\n dispatchEvent: () => false,\n }),\n});\n"],"names":["value","error","query"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup-jsdom-polyfills.cjs","sources":["../src/test/setup-jsdom-polyfills.ts"],"sourcesContent":["/**\n * Polyfills necessary for the `NimbusProvider` not to crash in JSDOM environments (e.g. jest)\n *\n * To use with jest, update jest config like so:\n * config = {\n * ...\n * setupFiles: [\n * '@commercetools/nimbus/setupJsdomPolyfills`,\n * ...\n * ]\n * }\n */\n\n// TODO: document this somewhere besides this file\n\n// implementation of structuredClone polyfill to satisfy the Nimbus (Chakra UI) provider\nif (typeof global.structuredClone !== \"function\") {\n global.structuredClone = function structuredClone(value) {\n if (value === null || value === undefined) {\n return value;\n }\n\n try {\n // For objects and arrays, use JSON methods\n if (typeof value === \"object\") {\n return JSON.parse(JSON.stringify(value));\n }\n // For primitive values, return directly\n return value;\n } catch (error) {\n console.warn(\"structuredClone polyfill failed:\", error);\n\n // Returns a shallow copy as fallback\n return Array.isArray(value) ? [...value] : { ...value };\n }\n };\n}\n\n// Polyfill window.matchMedia for JSDOM (used by Nimbus/Chakra for theming)\nObject.defineProperty(window, \"matchMedia\", {\n writable: true,\n value: (query: unknown) => ({\n matches: false, // Default value, tests can override if needed\n media: query,\n onchange: null,\n addListener: () => {}, // Deprecated but needed for some libs\n removeListener: () => {}, // Deprecated but needed for some libs\n addEventListener: () => {},\n removeEventListener: () => {},\n dispatchEvent: () => false,\n }),\n});\n"],"names":["value","error","query"],"mappings":"aAgBI,OAAO,OAAO,iBAAoB,aAC7B,OAAA,gBAAkB,SAAyBA,EAAO,CACnD,GAAAA,GAAU,KACL,OAAAA,EAGL,GAAA,CAEE,OAAA,OAAOA,GAAU,SACZ,KAAK,MAAM,KAAK,UAAUA,CAAK,CAAC,EAGlCA,QACAC,EAAO,CACN,eAAA,KAAK,mCAAoCA,CAAK,EAG/C,MAAM,QAAQD,CAAK,EAAI,CAAC,GAAGA,CAAK,EAAI,CAAE,GAAGA,CAAM,CAAA,CAE1D,GAIF,OAAO,eAAe,OAAQ,aAAc,CAC1C,SAAU,GACV,MAAQE,IAAoB,CAC1B,QAAS,GACT,MAAOA,EACP,SAAU,KACV,YAAa,IAAM,CAAC,EACpB,eAAgB,IAAM,CAAC,EACvB,iBAAkB,IAAM,CAAC,EACzB,oBAAqB,IAAM,CAAC,EAC5B,cAAe,IAAM,EACvB,EACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-jsdom-polyfills.es.js","sources":["../src/test/setup-jsdom-polyfills.ts"],"sourcesContent":["// implementation of structuredClone polyfill to satisfy the Nimbus (Chakra UI) provider\nif (typeof global.structuredClone !== \"function\") {\n global.structuredClone = function structuredClone(value) {\n if (value === null || value === undefined) {\n return value;\n }\n\n try {\n // For objects and arrays, use JSON methods\n if (typeof value === \"object\") {\n return JSON.parse(JSON.stringify(value));\n }\n // For primitive values, return directly\n return value;\n } catch (error) {\n console.warn(\"structuredClone polyfill failed:\", error);\n\n // Returns a shallow copy as fallback\n return Array.isArray(value) ? [...value] : { ...value };\n }\n };\n}\n\n// Polyfill window.matchMedia for JSDOM (used by Nimbus/Chakra for theming)\nObject.defineProperty(window, \"matchMedia\", {\n writable: true,\n value: (query: unknown) => ({\n matches: false, // Default value, tests can override if needed\n media: query,\n onchange: null,\n addListener: () => {}, // Deprecated but needed for some libs\n removeListener: () => {}, // Deprecated but needed for some libs\n addEventListener: () => {},\n removeEventListener: () => {},\n dispatchEvent: () => false,\n }),\n});\n"],"names":["value","error","query"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup-jsdom-polyfills.es.js","sources":["../src/test/setup-jsdom-polyfills.ts"],"sourcesContent":["/**\n * Polyfills necessary for the `NimbusProvider` not to crash in JSDOM environments (e.g. jest)\n *\n * To use with jest, update jest config like so:\n * config = {\n * ...\n * setupFiles: [\n * '@commercetools/nimbus/setupJsdomPolyfills`,\n * ...\n * ]\n * }\n */\n\n// TODO: document this somewhere besides this file\n\n// implementation of structuredClone polyfill to satisfy the Nimbus (Chakra UI) provider\nif (typeof global.structuredClone !== \"function\") {\n global.structuredClone = function structuredClone(value) {\n if (value === null || value === undefined) {\n return value;\n }\n\n try {\n // For objects and arrays, use JSON methods\n if (typeof value === \"object\") {\n return JSON.parse(JSON.stringify(value));\n }\n // For primitive values, return directly\n return value;\n } catch (error) {\n console.warn(\"structuredClone polyfill failed:\", error);\n\n // Returns a shallow copy as fallback\n return Array.isArray(value) ? [...value] : { ...value };\n }\n };\n}\n\n// Polyfill window.matchMedia for JSDOM (used by Nimbus/Chakra for theming)\nObject.defineProperty(window, \"matchMedia\", {\n writable: true,\n value: (query: unknown) => ({\n matches: false, // Default value, tests can override if needed\n media: query,\n onchange: null,\n addListener: () => {}, // Deprecated but needed for some libs\n removeListener: () => {}, // Deprecated but needed for some libs\n addEventListener: () => {},\n removeEventListener: () => {},\n dispatchEvent: () => false,\n }),\n});\n"],"names":["value","error","query"],"mappings":"AAgBI,OAAO,OAAO,mBAAoB,eAC7B,OAAA,kBAAkB,SAAyBA,GAAO;AACnD,MAAAA,KAAU;AACL,WAAAA;AAGL,MAAA;AAEE,WAAA,OAAOA,KAAU,WACZ,KAAK,MAAM,KAAK,UAAUA,CAAK,CAAC,IAGlCA;AAAA,WACAC,GAAO;AACN,mBAAA,KAAK,oCAAoCA,CAAK,GAG/C,MAAM,QAAQD,CAAK,IAAI,CAAC,GAAGA,CAAK,IAAI,EAAE,GAAGA,EAAM;AAAA,EAAA;AAE1D;AAIF,OAAO,eAAe,QAAQ,cAAc;AAAA,EAC1C,UAAU;AAAA,EACV,OAAO,CAACE,OAAoB;AAAA,IAC1B,SAAS;AAAA;AAAA,IACT,OAAOA;AAAA,IACP,UAAU;AAAA,IACV,aAAa,MAAM;AAAA,IAAC;AAAA;AAAA,IACpB,gBAAgB,MAAM;AAAA,IAAC;AAAA;AAAA,IACvB,kBAAkB,MAAM;AAAA,IAAC;AAAA,IACzB,qBAAqB,MAAM;AAAA,IAAC;AAAA,IAC5B,eAAe,MAAM;AAAA,EACvB;AACF,CAAC;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools/nimbus",
|
|
3
|
-
"version": "0.0.9-
|
|
3
|
+
"version": "0.0.9-rc6",
|
|
4
4
|
"main": "./dist/index.cjs",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"./package.json": "./package.json",
|
|
20
|
-
"./
|
|
20
|
+
"./setup-jsdom-polyfills": {
|
|
21
21
|
"require": {
|
|
22
22
|
"default": "./dist/setup-jsdom-polyfills.cjs"
|
|
23
23
|
}
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"vite-plugin-dts": "^4.5.4",
|
|
79
79
|
"vite-tsconfig-paths": "^5.1.4",
|
|
80
80
|
"vitest": "^3.2.4",
|
|
81
|
-
"@commercetools/nimbus-
|
|
82
|
-
"@commercetools/nimbus-
|
|
81
|
+
"@commercetools/nimbus-tokens": "^0.0.3",
|
|
82
|
+
"@commercetools/nimbus-icons": "^0.0.4"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@chakra-ui/react": "^3.19.2",
|