app/assets/lookbook/js/stores/inspector.js in lookbook-0.9.8 vs app/assets/lookbook/js/stores/inspector.js in lookbook-1.0.0.beta.0
- old
+ new
@@ -1,25 +1,31 @@
-import config from "../config";
+import { prefixString } from "../helpers/string";
-export default function createInspectorStore(Alpine) {
- const { drawer, preview } = config.inspector;
+export default function initInspectorStore(Alpine, { prefix }) {
return {
- drawer: {
- hidden: Alpine.$persist(false).as("drawer-hidden"),
- orientation: Alpine.$persist(drawer.orientation).as("drawer-orientation"),
- panel: Alpine.$persist(drawer.defaultPanel).as("drawer-panel"),
- height: Alpine.$persist(drawer.defaultHeight).as("drawer-height"),
- width: Alpine.$persist(drawer.defaultWidth).as("drawer-width"),
- minWidth: drawer.minWidth,
- minHeight: drawer.minHeight,
- visibleTabCount: Infinity,
- },
+ minVerticalSplitWidth: 800,
+
preview: {
- width: Alpine.$persist("100%").as("preview-width"),
- height: Alpine.$persist("100%").as("preview-height"),
- panel: Alpine.$persist(preview.defaultPanel).as("preview-panel"),
+ activeTab: Alpine.$persist("").as(
+ prefixString("inspector-preview-active-tab", prefix)
+ ),
+ width: Alpine.$persist("100%").as(
+ prefixString("inspector-preview-width", prefix)
+ ),
+ height: Alpine.$persist("100%").as(
+ prefixString("inspector-preview-height", prefix)
+ ),
lastWidth: null,
lastHeight: null,
resizing: false,
+ },
+
+ drawer: {
+ hidden: Alpine.$persist(false).as(
+ prefixString("inspector-drawer-hidden", prefix)
+ ),
+ activeTab: Alpine.$persist("").as(
+ prefixString("inspector-drawer-active-tab", prefix)
+ ),
},
};
}