@histoire/app 0.10.3 → 0.10.4
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/components/story/StoryVariantSinglePreviewRemote.js +1 -1
- package/dist/bundled/sandbox.js +1 -1
- package/dist/bundled/style.css +12 -12
- package/dist/bundled/util/state.js +12 -5
- package/package.json +4 -4
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +1 -1
- package/src/app/sandbox.ts +1 -1
- package/src/app/util/state.ts +12 -5
|
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
if (iframe.value && props.variant.previewReady) {
|
|
23
23
|
iframe.value.contentWindow.postMessage({
|
|
24
24
|
type: STATE_SYNC,
|
|
25
|
-
state: toRawDeep(props.variant.state)
|
|
25
|
+
state: toRawDeep(props.variant.state, true)
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
}
|
package/dist/bundled/sandbox.js
CHANGED
package/dist/bundled/style.css
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
.bind-icon-color[data-v-25f7510c] {
|
|
3
|
-
color: var(--353b213f);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
2
|
.landscape > div > .dragger[data-v-328ea07c] {
|
|
7
3
|
width: .625rem;
|
|
8
4
|
}
|
|
@@ -28,6 +24,10 @@
|
|
|
28
24
|
bottom: -.625rem;
|
|
29
25
|
}
|
|
30
26
|
|
|
27
|
+
.bind-icon-color[data-v-25f7510c] {
|
|
28
|
+
color: var(--353b213f);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
31
|
.htw-base-empty[data-v-c242ab26]:not(.no-animation) {
|
|
32
32
|
-webkit-animation: htw-base-empty-c242ab26 .15s .2s both;
|
|
33
33
|
animation: htw-base-empty-c242ab26 .15s .2s both;
|
|
@@ -64,27 +64,27 @@
|
|
|
64
64
|
color: var(--411af7ae);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.bind-icon-color[data-v-7f8cccbc] {
|
|
68
|
-
color: var(--cebc8760);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
67
|
.bind-icon-color[data-v-2ca2325e] {
|
|
72
68
|
color: var(--0589c2c6);
|
|
73
69
|
}
|
|
74
70
|
|
|
71
|
+
.bind-icon-color[data-v-7f8cccbc] {
|
|
72
|
+
color: var(--cebc8760);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
75
|
.__histoire-code-placeholder[data-v-68151bff] {
|
|
76
76
|
color: inherit;
|
|
77
77
|
font-size: inherit;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.bind-icon-color[data-v-2db4d3d2] {
|
|
81
|
-
color: var(--1eec3e4a);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
80
|
.bind-icon-color[data-v-3fb261e4] {
|
|
85
81
|
color: var(--7333f29c);
|
|
86
82
|
}
|
|
87
83
|
|
|
84
|
+
.bind-icon-color[data-v-2db4d3d2] {
|
|
85
|
+
color: var(--1eec3e4a);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
88
|
.bind-preview-bg[data-v-bc4883a4] {
|
|
89
89
|
background-color: var(--6bcdf233);
|
|
90
90
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isRef, unref } from "@histoire/vendors/vue";
|
|
2
2
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
3
|
-
function toRawDeep(val, seen = /* @__PURE__ */ new WeakMap()) {
|
|
3
|
+
function toRawDeep(val, clean = false, seen = /* @__PURE__ */ new WeakMap()) {
|
|
4
4
|
const unwrappedValue = isRef(val) ? unref(val) : val;
|
|
5
5
|
if (typeof unwrappedValue === "symbol") {
|
|
6
6
|
return unwrappedValue.toString();
|
|
@@ -14,18 +14,25 @@ function toRawDeep(val, seen = /* @__PURE__ */ new WeakMap()) {
|
|
|
14
14
|
if (Array.isArray(unwrappedValue)) {
|
|
15
15
|
const result = [];
|
|
16
16
|
seen.set(unwrappedValue, result);
|
|
17
|
-
|
|
17
|
+
let list = unwrappedValue.map((value) => toRawDeep(value, clean, seen));
|
|
18
|
+
if (clean) {
|
|
19
|
+
list = list.filter((value) => typeof value !== "function");
|
|
20
|
+
}
|
|
21
|
+
result.push(...list);
|
|
18
22
|
return result;
|
|
19
23
|
} else {
|
|
20
24
|
const result = {};
|
|
21
25
|
seen.set(unwrappedValue, result);
|
|
22
|
-
toRawObject(unwrappedValue, result, seen);
|
|
26
|
+
toRawObject(unwrappedValue, result, clean, seen);
|
|
23
27
|
return result;
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
|
-
const toRawObject = (obj, target, seen = /* @__PURE__ */ new WeakMap()) => {
|
|
30
|
+
const toRawObject = (obj, target, clean = false, seen = /* @__PURE__ */ new WeakMap()) => {
|
|
27
31
|
Object.keys(obj).forEach((key) => {
|
|
28
|
-
|
|
32
|
+
if (clean && typeof obj[key] === "function") {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
target[key] = toRawDeep(obj[key], clean, seen);
|
|
29
36
|
});
|
|
30
37
|
};
|
|
31
38
|
export { toRawDeep };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/app",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Pre-bundled UI for Histoire",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"types": "./src/index.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@histoire/controls": "^0.10.
|
|
28
|
-
"@histoire/shared": "^0.10.
|
|
29
|
-
"@histoire/vendors": "^0.10.
|
|
27
|
+
"@histoire/controls": "^0.10.4",
|
|
28
|
+
"@histoire/shared": "^0.10.4",
|
|
29
|
+
"@histoire/vendors": "^0.10.4",
|
|
30
30
|
"@types/flexsearch": "^0.7.3",
|
|
31
31
|
"flexsearch": "^0.7.21",
|
|
32
32
|
"shiki": "0.10.1"
|
package/src/app/sandbox.ts
CHANGED
package/src/app/util/state.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { unref, isRef } from 'vue'
|
|
|
2
2
|
|
|
3
3
|
const isObject = (val) => val !== null && typeof val === 'object'
|
|
4
4
|
|
|
5
|
-
export function toRawDeep (val, seen = new WeakMap()) {
|
|
5
|
+
export function toRawDeep (val, clean = false, seen = new WeakMap()) {
|
|
6
6
|
const unwrappedValue = isRef(val) ? unref(val) : val
|
|
7
7
|
|
|
8
8
|
if (typeof unwrappedValue === 'symbol') {
|
|
@@ -20,18 +20,25 @@ export function toRawDeep (val, seen = new WeakMap()) {
|
|
|
20
20
|
if (Array.isArray(unwrappedValue)) {
|
|
21
21
|
const result = []
|
|
22
22
|
seen.set(unwrappedValue, result)
|
|
23
|
-
|
|
23
|
+
let list = unwrappedValue.map(value => toRawDeep(value, clean, seen))
|
|
24
|
+
if (clean) {
|
|
25
|
+
list = list.filter(value => typeof value !== 'function')
|
|
26
|
+
}
|
|
27
|
+
result.push(...list)
|
|
24
28
|
return result
|
|
25
29
|
} else {
|
|
26
30
|
const result = {}
|
|
27
31
|
seen.set(unwrappedValue, result)
|
|
28
|
-
toRawObject(unwrappedValue, result, seen)
|
|
32
|
+
toRawObject(unwrappedValue, result, clean, seen)
|
|
29
33
|
return result
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
|
|
33
|
-
const toRawObject = (obj: Record<any, any>, target: Record<any, any>, seen = new WeakMap()) => {
|
|
37
|
+
const toRawObject = (obj: Record<any, any>, target: Record<any, any>, clean = false, seen = new WeakMap()) => {
|
|
34
38
|
Object.keys(obj).forEach((key) => {
|
|
35
|
-
|
|
39
|
+
if (clean && typeof obj[key] === 'function') {
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
target[key] = toRawDeep(obj[key], clean, seen)
|
|
36
43
|
})
|
|
37
44
|
}
|