@histoire/controls 1.0.0-alpha.1 → 1.0.0-alpha.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/dist/components/HstWrapper.vue.d.ts +4 -4
- package/dist/components/button/HstButton.vue.d.ts +3 -3
- package/dist/components/button/HstButtonGroup.vue.d.ts +3 -3
- package/dist/components/checkbox/HstCheckbox.vue.d.ts +3 -3
- package/dist/components/checkbox/HstCheckboxList.vue.d.ts +3 -3
- package/dist/components/checkbox/HstSimpleCheckbox.vue.d.ts +3 -1
- package/dist/components/colorselect/HstColorSelect.vue.d.ts +3 -3
- package/dist/components/design-tokens/HstColorShades.vue.d.ts +4 -4
- package/dist/components/design-tokens/HstTokenGrid.vue.d.ts +4 -4
- package/dist/components/design-tokens/HstTokenList.vue.d.ts +4 -4
- package/dist/components/json/HstJson.vue.d.ts +6 -4
- package/dist/components/number/HstNumber.vue.d.ts +6 -4
- package/dist/components/radio/HstRadio.vue.d.ts +3 -3
- package/dist/components/select/CustomSelect.vue.d.ts +4 -4
- package/dist/components/select/HstSelect.vue.d.ts +3 -3
- package/dist/components/slider/HstSlider.vue.d.ts +3 -1
- package/dist/components/text/HstText.vue.d.ts +6 -4
- package/dist/components/textarea/HstTextarea.vue.d.ts +6 -4
- package/dist/index.d.ts +64 -44
- package/dist/index.es.js +1876 -1815
- package/package.json +3 -3
- package/.histoire/dist/__sandbox.html +0 -16
- package/.histoire/dist/assets/BaseEmpty.d30f3079.js +0 -11
- package/.histoire/dist/assets/HomeView.8e044be6.js +0 -24
- package/.histoire/dist/assets/HstCheckbox.story.3d04d85b.js +0 -144
- package/.histoire/dist/assets/HstColorShades.story.68cf74d1.js +0 -532
- package/.histoire/dist/assets/HstCopyIcon.e40e725e.js +0 -51
- package/.histoire/dist/assets/HstNumber.story.1e1964ff.js +0 -160
- package/.histoire/dist/assets/HstSelect.story.04860383.js +0 -277
- package/.histoire/dist/assets/HstText.story.c915d831.js +0 -137
- package/.histoire/dist/assets/HstTextarea.story.802b9c26.js +0 -105
- package/.histoire/dist/assets/HstTokenGrid.story.025819d6.js +0 -148
- package/.histoire/dist/assets/HstTokenList.story.d3aa6575.js +0 -176
- package/.histoire/dist/assets/HstWrapper.246b6982.js +0 -56
- package/.histoire/dist/assets/SearchPane.daa2675c.js +0 -426
- package/.histoire/dist/assets/StoryView.2f64dad1.js +0 -2260
- package/.histoire/dist/assets/bundle-main.784e5bf7.js +0 -1156
- package/.histoire/dist/assets/bundle-sandbox.5e153933.js +0 -84
- package/.histoire/dist/assets/const.268165fd.js +0 -658
- package/.histoire/dist/assets/global-components.6736b2a9.js +0 -5722
- package/.histoire/dist/assets/search-docs-data.b9a75539.js +0 -6
- package/.histoire/dist/assets/style.04507241.css +0 -2504
- package/.histoire/dist/assets/vendor.2833ae3d.js +0 -28970
- package/.histoire/dist/histoire.svg +0 -51
- package/.histoire/dist/index.html +0 -16
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { S as reactive, aa as parseQuery, r as ref, D as createApp, E as createPinia, w as watch, c as computed, p as onMounted, _ as h } from "./vendor.2833ae3d.js";
|
|
2
|
-
import { m as mapFile, f as files, r as registerGlobalComponents, b as toRawDeep, h as histoireConfig, i as isDark, d as applyStateToVariant } from "./global-components.6736b2a9.js";
|
|
3
|
-
import { S as STATE_SYNC, P as PREVIEW_SETTINGS_SYNC, a as SANDBOX_READY, _ as _sfc_main } from "./const.268165fd.js";
|
|
4
|
-
var sandbox = "";
|
|
5
|
-
const receivedSettings = reactive({});
|
|
6
|
-
function applyPreviewSettings(settings) {
|
|
7
|
-
Object.assign(receivedSettings, settings);
|
|
8
|
-
}
|
|
9
|
-
const query = parseQuery(window.location.search);
|
|
10
|
-
const file = ref(mapFile(files.find((f) => f.id === query.storyId)));
|
|
11
|
-
const app = createApp({
|
|
12
|
-
name: "SandboxApp",
|
|
13
|
-
setup() {
|
|
14
|
-
const story = computed(() => file.value.story);
|
|
15
|
-
const variant = computed(() => {
|
|
16
|
-
var _a;
|
|
17
|
-
return (_a = story.value) == null ? void 0 : _a.variants.find((v) => v.id === query.variantId);
|
|
18
|
-
});
|
|
19
|
-
let synced = false;
|
|
20
|
-
let mounted = false;
|
|
21
|
-
window.addEventListener("message", (event) => {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
if (((_a = event.data) == null ? void 0 : _a.type) === STATE_SYNC) {
|
|
24
|
-
if (!mounted)
|
|
25
|
-
return;
|
|
26
|
-
synced = true;
|
|
27
|
-
applyStateToVariant(variant.value, event.data.state);
|
|
28
|
-
} else if (((_b = event.data) == null ? void 0 : _b.type) === PREVIEW_SETTINGS_SYNC) {
|
|
29
|
-
applyPreviewSettings(event.data.settings);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
watch(() => variant.value.state, (value) => {
|
|
33
|
-
var _a;
|
|
34
|
-
if (synced && mounted) {
|
|
35
|
-
synced = false;
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
(_a = window.parent) == null ? void 0 : _a.postMessage({
|
|
39
|
-
type: STATE_SYNC,
|
|
40
|
-
state: toRawDeep(value)
|
|
41
|
-
});
|
|
42
|
-
}, {
|
|
43
|
-
deep: true
|
|
44
|
-
});
|
|
45
|
-
onMounted(() => {
|
|
46
|
-
mounted = true;
|
|
47
|
-
});
|
|
48
|
-
return {
|
|
49
|
-
story,
|
|
50
|
-
variant
|
|
51
|
-
};
|
|
52
|
-
},
|
|
53
|
-
render() {
|
|
54
|
-
return [
|
|
55
|
-
h("div", { class: "htw-sandbox-hidden" }, [
|
|
56
|
-
h(file.value.component, {
|
|
57
|
-
story: file.value.story
|
|
58
|
-
})
|
|
59
|
-
]),
|
|
60
|
-
this.story && this.variant ? h(_sfc_main, {
|
|
61
|
-
story: this.story,
|
|
62
|
-
variant: this.variant,
|
|
63
|
-
onReady: () => {
|
|
64
|
-
var _a;
|
|
65
|
-
(_a = window.parent) == null ? void 0 : _a.postMessage({
|
|
66
|
-
type: SANDBOX_READY
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}) : null
|
|
70
|
-
];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
app.use(createPinia());
|
|
74
|
-
registerGlobalComponents(app);
|
|
75
|
-
app.mount("#app");
|
|
76
|
-
watch(isDark, (value) => {
|
|
77
|
-
if (value) {
|
|
78
|
-
document.documentElement.classList.add(histoireConfig.sandboxDarkClass);
|
|
79
|
-
} else {
|
|
80
|
-
document.documentElement.classList.remove(histoireConfig.sandboxDarkClass);
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
immediate: true
|
|
84
|
-
});
|