@loki/browser
Advanced tools
Comparing version 0.34.0 to 0.35.0
{ | ||
"name": "@loki/browser", | ||
"version": "0.34.0", | ||
"version": "0.35.0", | ||
"description": "Loki browser integration", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@loki/integration-core": "^0.34.0" | ||
"@loki/integration-core": "^0.35.0" | ||
}, | ||
@@ -29,3 +29,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "5f435d19c109fe729aef370349d34380b1044045" | ||
"gitHead": "ddcb39c9d0d30e5b9bfc3c30e27544c921d46f19" | ||
} |
@@ -6,2 +6,5 @@ /* eslint-disable no-underscore-dangle */ | ||
(window.__STORYBOOK_CLIENT_API__ && window.__STORYBOOK_CLIENT_API__.raw) || | ||
(window.__STORYBOOK_PREVIEW__ && | ||
window.__STORYBOOK_PREVIEW__.extract && | ||
window.__STORYBOOK_PREVIEW__.storyStore.raw) || | ||
(window.loki && window.loki.getStorybook); | ||
@@ -23,9 +26,2 @@ if (!getStorybook) { | ||
if ( | ||
window.__STORYBOOK_CLIENT_API__.storyStore && | ||
window.__STORYBOOK_CLIENT_API__.storyStore.cacheAllCSFFiles | ||
) { | ||
await window.__STORYBOOK_CLIENT_API__.storyStore.cacheAllCSFFiles(); | ||
} | ||
const isSerializable = (value) => { | ||
@@ -40,2 +36,33 @@ try { | ||
if (window.__STORYBOOK_PREVIEW__ && window.__STORYBOOK_PREVIEW__.extract) { | ||
// New official API to extract stories from preview | ||
await window.__STORYBOOK_PREVIEW__.extract(); | ||
// Deprecated, will be removed in V9 | ||
const stories = window.__STORYBOOK_PREVIEW__.storyStore.raw(); | ||
return stories | ||
.map((component) => ({ | ||
id: component.id, | ||
kind: component.kind, | ||
story: component.story, | ||
parameters: Object.fromEntries( | ||
Object.entries(component.parameters || {}).filter( | ||
([key, value]) => | ||
!key.startsWith('__') && | ||
!blockedParams.includes(key) && | ||
isSerializable(value) | ||
) | ||
), | ||
})) | ||
.filter(({ parameters }) => !parameters.loki || !parameters.loki.skip); | ||
} | ||
if ( | ||
window.__STORYBOOK_CLIENT_API__.storyStore && | ||
window.__STORYBOOK_CLIENT_API__.storyStore.cacheAllCSFFiles | ||
) { | ||
await window.__STORYBOOK_CLIENT_API__.storyStore.cacheAllCSFFiles(); | ||
} | ||
return getStorybook() | ||
@@ -42,0 +69,0 @@ .map((component) => ({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21892
615
+ Added@loki/integration-core@0.35.0(transitive)
- Removed@loki/integration-core@0.34.0(transitive)