@floegence/floe-webapp-core 0.35.32 → 0.35.33

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.
@@ -1,76 +1,88 @@
1
- import { createEffect as m } from "solid-js";
2
- import { createStore as p, produce as d } from "solid-js/store";
3
- import { createSimpleContext as h } from "./createSimpleContext.js";
4
- import { useResolvedFloeConfig as f } from "./FloeConfigContext.js";
1
+ import { createEffect as f } from "solid-js";
2
+ import { createStore as c, produce as r } from "solid-js/store";
3
+ import { createSimpleContext as u } from "./createSimpleContext.js";
4
+ import { useResolvedFloeConfig as v } from "./FloeConfigContext.js";
5
5
  const {
6
- Provider: w,
7
- use: y
8
- } = h({
6
+ Provider: x,
7
+ use: C
8
+ } = u({
9
9
  name: "Layout",
10
- init: u
10
+ init: g
11
11
  });
12
- function u() {
13
- const l = f(), a = () => l.config.layout, b = () => typeof window > "u" ? !1 : window.matchMedia(a().mobileQuery).matches, o = l.persist.load(a().storageKey, {}), c = {
12
+ function g() {
13
+ const n = v(), i = () => n.config.layout, p = () => typeof window > "u" ? !1 : window.matchMedia(i().mobileQuery).matches, s = n.persist.load(i().storageKey, {}), h = {
14
14
  sidebar: {
15
- width: o.sidebar?.width ?? a().sidebar.defaultWidth,
16
- activeTab: o.sidebar?.activeTab ?? a().sidebar.defaultActiveTab,
17
- collapsed: o.sidebar?.collapsed ?? a().sidebar.defaultCollapsed
15
+ width: s.sidebar?.width ?? i().sidebar.defaultWidth,
16
+ activeTab: s.sidebar?.activeTab ?? i().sidebar.defaultActiveTab,
17
+ collapsed: s.sidebar?.collapsed ?? i().sidebar.defaultCollapsed
18
18
  },
19
19
  terminal: {
20
- opened: o.terminal?.opened ?? a().terminal.defaultOpened,
21
- height: o.terminal?.height ?? a().terminal.defaultHeight
20
+ opened: s.terminal?.opened ?? i().terminal.defaultOpened,
21
+ height: s.terminal?.height ?? i().terminal.defaultHeight
22
22
  },
23
- isMobile: b()
24
- }, [i, t] = p(c), s = (e) => Math.max(a().sidebar.clamp.min, Math.min(a().sidebar.clamp.max, e));
25
- return m(() => {
23
+ isMobile: p()
24
+ }, [t, o] = c(h), [l, b] = c({
25
+ motion: "animated",
26
+ revision: 0
27
+ }), m = (e) => Math.max(i().sidebar.clamp.min, Math.min(i().sidebar.clamp.max, e));
28
+ return f(() => {
26
29
  const e = {
27
30
  sidebar: {
28
- width: i.sidebar.width,
29
- activeTab: i.sidebar.activeTab,
30
- collapsed: i.sidebar.collapsed
31
+ width: t.sidebar.width,
32
+ activeTab: t.sidebar.activeTab,
33
+ collapsed: t.sidebar.collapsed
31
34
  },
32
35
  terminal: {
33
- opened: i.terminal.opened,
34
- height: i.terminal.height
36
+ opened: t.terminal.opened,
37
+ height: t.terminal.height
35
38
  }
36
39
  };
37
- l.persist.debouncedSave(a().storageKey, e);
40
+ n.persist.debouncedSave(i().storageKey, e);
38
41
  }), {
39
42
  // Sidebar accessors
40
- sidebarWidth: () => i.sidebar.width,
41
- sidebarActiveTab: () => i.sidebar.activeTab,
42
- sidebarCollapsed: () => i.sidebar.collapsed,
43
- clampSidebarWidth: s,
43
+ sidebarWidth: () => t.sidebar.width,
44
+ sidebarActiveTab: () => t.sidebar.activeTab,
45
+ sidebarCollapsed: () => t.sidebar.collapsed,
46
+ sidebarVisibilityMotion: () => l.motion,
47
+ sidebarVisibilityMotionRevision: () => l.revision,
48
+ clampSidebarWidth: m,
44
49
  // Sidebar actions
45
- setSidebarWidth: (e) => t(d((r) => {
46
- r.sidebar.width = s(e);
50
+ setSidebarWidth: (e) => o(r((a) => {
51
+ a.sidebar.width = m(e);
47
52
  })),
48
- setSidebarActiveTab: (e, r) => t(d((n) => {
49
- n.sidebar.activeTab = e, r?.openSidebar !== !1 && (n.sidebar.collapsed = !1);
50
- })),
51
- setSidebarCollapsed: (e) => t(d((r) => {
52
- r.sidebar.collapsed = e;
53
+ setSidebarActiveTab: (e, a) => {
54
+ o(r((d) => {
55
+ d.sidebar.activeTab = e, a?.openSidebar !== !1 && (d.sidebar.collapsed = !1);
56
+ })), a?.visibilityMotion === "instant" && b(r((d) => {
57
+ d.motion = "instant", d.revision += 1;
58
+ }));
59
+ },
60
+ setSidebarCollapsed: (e) => o(r((a) => {
61
+ a.sidebar.collapsed = e;
53
62
  })),
54
- toggleSidebarCollapse: () => t(d((e) => {
63
+ toggleSidebarCollapse: () => o(r((e) => {
55
64
  e.sidebar.collapsed = !e.sidebar.collapsed;
56
65
  })),
66
+ clearSidebarVisibilityMotion: (e) => {
67
+ l.revision === e && b("motion", "animated");
68
+ },
57
69
  // Terminal accessors
58
- terminalOpened: () => i.terminal.opened,
59
- terminalHeight: () => i.terminal.height,
70
+ terminalOpened: () => t.terminal.opened,
71
+ terminalHeight: () => t.terminal.height,
60
72
  // Terminal actions
61
- toggleTerminal: () => t(d((e) => {
73
+ toggleTerminal: () => o(r((e) => {
62
74
  e.terminal.opened = !e.terminal.opened;
63
75
  })),
64
- setTerminalHeight: (e) => t(d((r) => {
65
- r.terminal.height = Math.max(a().terminal.clamp.min, Math.min(a().terminal.clamp.max, e));
76
+ setTerminalHeight: (e) => o(r((a) => {
77
+ a.terminal.height = Math.max(i().terminal.clamp.min, Math.min(i().terminal.clamp.max, e));
66
78
  })),
67
79
  // Mobile
68
- isMobile: () => i.isMobile,
69
- setIsMobile: (e) => t("isMobile", e)
80
+ isMobile: () => t.isMobile,
81
+ setIsMobile: (e) => o("isMobile", e)
70
82
  };
71
83
  }
72
84
  export {
73
- w as LayoutProvider,
74
- u as createLayoutService,
75
- y as useLayout
85
+ x as LayoutProvider,
86
+ g as createLayoutService,
87
+ C as useLayout
76
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.35.32",
3
+ "version": "0.35.33",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",