histoire 0.4.5 → 0.4.6
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/bundled/StoryView.js +376 -136
- package/dist/bundled/sandbox.js +2 -10
- package/dist/bundled/{reactivity.js → state.js} +27 -1
- package/dist/client/app/components/base/BaseSelect.vue +72 -0
- package/dist/client/app/components/panel/StatePresets.vue +193 -0
- package/dist/client/app/components/panel/StoryControls.vue +15 -1
- package/dist/client/app/components/story/StoryVariantSinglePreviewRemote.vue +2 -14
- package/dist/client/app/sandbox.js +2 -11
- package/dist/client/app/util/state.d.ts +4 -0
- package/dist/client/app/util/state.js +46 -0
- package/dist/client/app/util/variant.d.ts +1 -1
- package/dist/style.css +70 -37
- package/package.json +3 -3
- package/src/client/app/components/base/BaseSelect.vue +72 -0
- package/src/client/app/components/panel/StatePresets.vue +193 -0
- package/src/client/app/components/panel/StoryControls.vue +15 -1
- package/src/client/app/components/story/StoryVariantSinglePreviewRemote.vue +2 -14
- package/src/client/app/sandbox.ts +2 -10
- package/src/client/app/util/state.ts +51 -0
- package/src/client/app/util/variant.ts +1 -1
- package/dist/client/app/util/reactivity.d.ts +0 -1
- package/dist/client/app/util/reactivity.js +0 -16
- package/src/client/app/util/reactivity.ts +0 -22
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { unref, isRef } from 'vue'
|
|
2
|
-
|
|
3
|
-
const isObject = (val) => val !== null && typeof val === 'object'
|
|
4
|
-
|
|
5
|
-
export function toRawDeep (val) {
|
|
6
|
-
const unwrappedValue = isRef(val) ? unref(val) : val
|
|
7
|
-
|
|
8
|
-
if (!isObject(unwrappedValue)) {
|
|
9
|
-
return unwrappedValue
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (Array.isArray(unwrappedValue)) {
|
|
13
|
-
return unwrappedValue.map(toRawDeep)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return toRawObject(unwrappedValue)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const toRawObject = (obj: Record<any, any>) => Object.keys(obj).reduce((raw, key) => {
|
|
20
|
-
raw[key] = toRawDeep(obj[key])
|
|
21
|
-
return raw
|
|
22
|
-
}, {})
|