@floegence/floe-webapp-core 0.86.71 → 0.86.73

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,52 +1,52 @@
1
- import { insert as B, createComponent as y, effect as C, className as P, setStyleProperty as K, template as R, memo as N, setAttribute as q } from "solid-js/web";
2
- import { createMemo as S, createSignal as I, untrack as x, createEffect as E, For as j, createRenderEffect as D, onCleanup as G, ErrorBoundary as H, Suspense as J } from "solid-js";
3
- import { ViewActivationProvider as L } from "../../context/ViewActivationContext.js";
4
- import { cn as z } from "../../utils/cn.js";
5
- import { deferAfterPaint as Q } from "../../utils/defer.js";
6
- var O = /* @__PURE__ */ R("<div>");
7
- function M(e) {
1
+ import { insert as C, createComponent as y, effect as P, className as K, setStyleProperty as O, template as N, memo as j, setAttribute as z } from "solid-js/web";
2
+ import { createMemo as m, createSignal as M, untrack as x, createEffect as q, For as D, createRenderEffect as G, onCleanup as H, ErrorBoundary as J, Suspense as L } from "solid-js";
3
+ import { ViewActivationProvider as Q } from "../../context/ViewActivationContext.js";
4
+ import { cn as V } from "../../utils/cn.js";
5
+ import { deferAfterPaint as T } from "../../utils/defer.js";
6
+ var R = /* @__PURE__ */ N("<div>");
7
+ function A(e) {
8
8
  return String(e ?? "").trim();
9
9
  }
10
- function V(e) {
11
- const s = [], u = /* @__PURE__ */ new Set();
10
+ function B(e) {
11
+ const u = [], s = /* @__PURE__ */ new Set();
12
12
  for (const l of e) {
13
- const a = M(l?.id);
14
- a && (u.has(a) || (u.add(a), s.push(a)));
13
+ const o = A(l?.id);
14
+ o && (s.has(o) || (s.add(o), u.push(o)));
15
15
  }
16
- return s;
16
+ return u;
17
17
  }
18
- function T(e, s) {
19
- const u = new Set(e), l = /* @__PURE__ */ new Map();
20
- for (const a of s) {
21
- const d = M(a?.id);
22
- d && u.has(d) && (l.has(d) || l.set(d, a));
18
+ function U(e, u) {
19
+ const s = new Set(e), l = /* @__PURE__ */ new Map();
20
+ for (const o of u) {
21
+ const d = A(o?.id);
22
+ d && s.has(d) && (l.has(d) || l.set(d, o));
23
23
  }
24
24
  return l;
25
25
  }
26
- function U(e) {
27
- const [s, u] = I(0), [l, a] = I(!1);
26
+ function W(e) {
27
+ const [u, s] = M(0), [l, o] = M(!1);
28
28
  let d = 0;
29
- D(() => {
30
- const r = e.active(), i = e.activationMode();
29
+ G(() => {
30
+ const i = e.active(), c = e.activationMode();
31
31
  d += 1;
32
- const h = d;
33
- if (!r) {
34
- a(!1);
32
+ const w = d;
33
+ if (!i) {
34
+ o(!1);
35
35
  return;
36
36
  }
37
37
  const f = () => {
38
- h !== d || !e.active() || x(l) || (a(!0), u((m) => m + 1));
38
+ w !== d || !e.active() || x(l) || (o(!0), s((S) => S + 1));
39
39
  };
40
- i === "after-paint" ? Q(f) : f();
41
- }), G(() => {
40
+ c === "after-paint" ? T(f) : f();
41
+ }), H(() => {
42
42
  d += 1;
43
43
  });
44
- const A = x(() => ({
44
+ const E = x(() => ({
45
45
  id: e.id,
46
46
  visible: e.active,
47
47
  active: l,
48
- activationSeq: s
49
- })), v = () => e.renderFallback ? y(J, {
48
+ activationSeq: u
49
+ })), v = () => e.renderFallback ? y(L, {
50
50
  get fallback() {
51
51
  return e.renderFallback(e.id);
52
52
  },
@@ -54,102 +54,105 @@ function U(e) {
54
54
  return e.children;
55
55
  }
56
56
  }) : e.children;
57
- return y(L, {
58
- value: A,
57
+ return y(Q, {
58
+ value: E,
59
59
  get children() {
60
- var r = O();
61
- return B(r, (() => {
62
- var i = N(() => !!e.renderError);
63
- return () => i() ? y(H, {
64
- fallback: (h, f) => e.renderError(h, f, e.id),
60
+ var i = R();
61
+ return C(i, (() => {
62
+ var c = j(() => !!e.renderError);
63
+ return () => c() ? y(J, {
64
+ fallback: (w, f) => e.renderError(w, f, e.id),
65
65
  get children() {
66
66
  return v();
67
67
  }
68
68
  }) : v();
69
- })()), C((i) => {
70
- var h = e.class, f = e.id, m = e.active() ? void 0 : "true", g = !e.active(), t = e.active() ? "block" : "none";
71
- return h !== i.e && P(r, i.e = h), f !== i.t && q(r, "data-floe-keep-alive-view", i.t = f), m !== i.a && q(r, "aria-hidden", i.a = m), g !== i.o && (r.inert = i.o = g), t !== i.i && K(r, "display", i.i = t), i;
69
+ })()), P((c) => {
70
+ var w = e.class, f = e.id, S = e.active() ? void 0 : "true", g = !e.active(), I = e.active() ? "block" : "none";
71
+ return w !== c.e && K(i, c.e = w), f !== c.t && z(i, "data-floe-keep-alive-view", c.t = f), S !== c.a && z(i, "aria-hidden", c.a = S), g !== c.o && (i.inert = c.o = g), I !== c.i && O(i, "display", c.i = I), c;
72
72
  }, {
73
73
  e: void 0,
74
74
  t: void 0,
75
75
  a: void 0,
76
76
  o: void 0,
77
77
  i: void 0
78
- }), r;
78
+ }), i;
79
79
  }
80
80
  });
81
81
  }
82
- function $(e) {
83
- const s = () => e.lazyMount !== !1, u = () => e.keepMounted !== !1, l = () => e.activationMode ?? "sync", a = S(() => V(e.views)), [d, A] = I(x(() => T(V(e.views), e.views))), v = S(() => M(e.activeId));
84
- E(() => {
85
- const t = a(), n = e.views;
86
- A((c) => {
87
- let o = !1;
88
- const w = new Map(c), F = new Set(t);
89
- for (const b of w.keys())
90
- F.has(b) || (w.delete(b), o = !0);
91
- for (const b of n) {
92
- const k = M(b?.id);
93
- k && F.has(k) && (w.has(k) || (w.set(k, b), o = !0));
82
+ function p(e) {
83
+ const u = () => e.lazyMount !== !1, s = () => e.keepMounted !== !1, l = () => e.activationMode ?? "sync", o = m(() => B(e.views)), [d, E] = M(x(() => U(B(e.views), e.views))), v = m(() => A(e.activeId));
84
+ q(() => {
85
+ const n = o(), t = e.views;
86
+ E((r) => {
87
+ let a = !1;
88
+ const h = new Map(r), F = new Set(n);
89
+ for (const b of h.keys())
90
+ F.has(b) || (h.delete(b), a = !0);
91
+ for (const b of t) {
92
+ const k = A(b?.id);
93
+ k && F.has(k) && (h.has(k) || (h.set(k, b), a = !0));
94
94
  }
95
- return o ? w : c;
95
+ return a ? h : r;
96
96
  });
97
97
  });
98
- const r = S(() => ({
99
- order: a(),
98
+ const i = m(() => ({
99
+ order: o(),
100
100
  byId: d()
101
- })), i = () => {
102
- if (!u()) return /* @__PURE__ */ new Set();
103
- if (!s()) return new Set(r().order);
104
- const t = v();
105
- return t ? r().byId.has(t) ? /* @__PURE__ */ new Set([t]) : /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set();
106
- }, [h, f] = I(i());
107
- E(() => {
108
- if (!u()) return;
109
- const t = new Set(r().order);
110
- f((n) => {
111
- let c = !1;
112
- const o = /* @__PURE__ */ new Set();
113
- for (const w of n) {
114
- if (!t.has(w)) {
115
- c = !0;
101
+ })), c = () => {
102
+ if (!s()) return /* @__PURE__ */ new Set();
103
+ if (!u()) return new Set(i().order);
104
+ const n = v();
105
+ return n ? i().byId.has(n) ? /* @__PURE__ */ new Set([n]) : /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set();
106
+ }, [w, f] = M(c());
107
+ q(() => {
108
+ if (!s()) return;
109
+ const n = new Set(i().order);
110
+ f((t) => {
111
+ let r = !1;
112
+ const a = /* @__PURE__ */ new Set();
113
+ for (const h of t) {
114
+ if (!n.has(h)) {
115
+ r = !0;
116
116
  continue;
117
117
  }
118
- o.add(w);
118
+ a.add(h);
119
119
  }
120
- return c ? o : n;
120
+ return r ? a : t;
121
121
  });
122
- }), E(() => {
123
- if (!u() || !s()) return;
124
- const t = v();
125
- t && r().byId.has(t) && f((n) => {
126
- if (n.has(t)) return n;
127
- const c = new Set(n);
128
- return c.add(t), c;
122
+ }), q(() => {
123
+ if (!s() || !u()) return;
124
+ const n = v();
125
+ n && i().byId.has(n) && f((t) => {
126
+ if (t.has(n)) return t;
127
+ const r = new Set(t);
128
+ return r.add(n), r;
129
129
  });
130
130
  });
131
- const m = S(() => {
132
- const t = r().order, n = v();
133
- if (!u())
134
- return n ? r().byId.has(n) ? [n] : [] : [];
135
- if (!s()) return t;
136
- const c = h();
137
- return t.filter((o) => c.has(o) || o === n);
138
- }), g = S(() => {
139
- const t = v();
140
- return t ? r().byId.has(t) : !1;
131
+ const S = m(() => {
132
+ const n = i().order, t = v();
133
+ if (!s())
134
+ return t ? i().byId.has(t) ? [t] : [] : [];
135
+ if (!u()) return n;
136
+ const r = w();
137
+ return n.filter((a) => r.has(a) || a === t);
138
+ }), g = m((n) => {
139
+ const t = new Set(S());
140
+ return [...n.filter((r) => t.delete(r)), ...t];
141
+ }, []), I = m(() => {
142
+ const n = v();
143
+ return n ? i().byId.has(n) : !1;
141
144
  });
142
145
  return (() => {
143
- var t = O();
144
- return B(t, y(j, {
146
+ var n = R();
147
+ return C(n, y(D, {
145
148
  get each() {
146
- return m();
149
+ return g();
147
150
  },
148
- children: (n) => {
149
- const c = () => d().get(n);
150
- return y(U, {
151
- id: n,
152
- active: () => v() === n,
151
+ children: (t) => {
152
+ const r = m(() => d().get(t));
153
+ return y(W, {
154
+ id: t,
155
+ active: () => v() === t,
153
156
  activationMode: l,
154
157
  get renderFallback() {
155
158
  return e.renderFallback;
@@ -158,22 +161,22 @@ function $(e) {
158
161
  return e.renderError;
159
162
  },
160
163
  get class() {
161
- return z("absolute inset-0", c()?.class);
164
+ return V("absolute inset-0", r()?.class);
162
165
  },
163
166
  get children() {
164
- return c()?.render();
167
+ return r()?.render();
165
168
  }
166
169
  });
167
170
  }
168
- })), C((n) => {
169
- var c = z("relative h-full min-h-0 w-full", e.class), o = g() ? "block" : "none";
170
- return c !== n.e && P(t, n.e = c), o !== n.t && K(t, "display", n.t = o), n;
171
+ })), P((t) => {
172
+ var r = V("relative h-full min-h-0 w-full", e.class), a = I() ? "block" : "none";
173
+ return r !== t.e && K(n, t.e = r), a !== t.t && O(n, "display", t.t = a), t;
171
174
  }, {
172
175
  e: void 0,
173
176
  t: void 0
174
- }), t;
177
+ }), n;
175
178
  })();
176
179
  }
177
180
  export {
178
- $ as KeepAliveStack
181
+ p as KeepAliveStack
179
182
  };
@@ -566,7 +566,7 @@ function en(n) {
566
566
  var i = Rt();
567
567
  return f(i, () => n.footer), i;
568
568
  }
569
- }), null), f(t, l(y, {
569
+ }), null), f(e, l(y, {
570
570
  get when() {
571
571
  return Z(() => !!(me() && !c()))() && !g();
572
572
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.86.71",
3
+ "version": "0.86.73",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",