@floegence/floe-webapp-core 0.65.0 → 0.65.1
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/app/ActivityAppsMain.d.ts +2 -0
- package/dist/app/ActivityAppsMain.js +13 -10
- package/dist/app/createDocumentAssetRecovery.d.ts +22 -0
- package/dist/app/createDocumentAssetRecovery.js +44 -0
- package/dist/app/index.d.ts +1 -0
- package/dist/app.js +9 -7
- package/dist/components/layout/KeepAliveStack.d.ts +2 -0
- package/dist/components/layout/KeepAliveStack.js +111 -103
- package/dist/full.js +250 -248
- package/package.json +1 -1
|
@@ -23,5 +23,7 @@ export interface ActivityAppsMainProps<TProtocol = unknown> {
|
|
|
23
23
|
activationMode?: KeepAliveStackProps['activationMode'];
|
|
24
24
|
/** Target-local loading UI; leaves shell navigation available while a lazy page resolves. */
|
|
25
25
|
renderFallback?: KeepAliveStackProps['renderFallback'];
|
|
26
|
+
/** Target-local error UI; the host chooses recovery without discarding other views. */
|
|
27
|
+
renderError?: KeepAliveStackProps['renderError'];
|
|
26
28
|
}
|
|
27
29
|
export declare function ActivityAppsMain<TProtocol = unknown>(props: ActivityAppsMainProps<TProtocol>): import("solid-js").JSX.Element;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { untrack as
|
|
1
|
+
import { createComponent as n, Dynamic as d } from "solid-js/web";
|
|
2
|
+
import { untrack as s, createMemo as l } from "solid-js";
|
|
3
3
|
import { useLayout as m } from "../context/LayoutContext.js";
|
|
4
4
|
import { useOptionalComponentRegistry as v } from "../context/ComponentRegistry.js";
|
|
5
|
-
import { KeepAliveStack as
|
|
6
|
-
function
|
|
5
|
+
import { KeepAliveStack as g } from "../components/layout/KeepAliveStack.js";
|
|
6
|
+
function f(e) {
|
|
7
7
|
return e.sidebar?.fullScreen === !0 || e.sidebar?.renderIn === "main";
|
|
8
8
|
}
|
|
9
9
|
function A(e) {
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
10
|
+
const i = m(), r = v();
|
|
11
|
+
if (!s(() => !!e.views) && !r)
|
|
12
12
|
throw new Error("ActivityAppsMain requires ComponentRegistryProvider when `views` is not provided.");
|
|
13
|
-
const o = () => e.activeId ? e.activeId() :
|
|
13
|
+
const o = () => e.activeId ? e.activeId() : i.sidebarActiveTab(), a = l(() => {
|
|
14
14
|
if (!r) return [];
|
|
15
|
-
const u = e.include ??
|
|
15
|
+
const u = e.include ?? f;
|
|
16
16
|
return r.sidebarItems().filter((t) => u(t)).map((t) => ({
|
|
17
17
|
id: t.id,
|
|
18
|
-
render: () =>
|
|
18
|
+
render: () => n(d, {
|
|
19
19
|
get component() {
|
|
20
20
|
return t.component;
|
|
21
21
|
}
|
|
22
22
|
})
|
|
23
23
|
}));
|
|
24
24
|
}), c = () => e.views ?? a();
|
|
25
|
-
return
|
|
25
|
+
return n(g, {
|
|
26
26
|
get views() {
|
|
27
27
|
return c();
|
|
28
28
|
},
|
|
@@ -41,6 +41,9 @@ function A(e) {
|
|
|
41
41
|
get renderFallback() {
|
|
42
42
|
return e.renderFallback;
|
|
43
43
|
},
|
|
44
|
+
get renderError() {
|
|
45
|
+
return e.renderError;
|
|
46
|
+
},
|
|
44
47
|
get class() {
|
|
45
48
|
return e.class;
|
|
46
49
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Accessor } from 'solid-js';
|
|
2
|
+
export type DocumentAssetRecoveryReason = 'updated' | 'load-failed' | null;
|
|
3
|
+
export type DocumentAssetCheckResult = 'current' | 'updated' | 'unavailable';
|
|
4
|
+
export interface DocumentAssetRecovery {
|
|
5
|
+
reason: Accessor<DocumentAssetRecoveryReason>;
|
|
6
|
+
checking: Accessor<boolean>;
|
|
7
|
+
/** Call after connectivity returns. No polling, navigation, or automatic reload is performed. */
|
|
8
|
+
check: () => Promise<DocumentAssetCheckResult>;
|
|
9
|
+
}
|
|
10
|
+
export interface DocumentAssetRecoveryOptions {
|
|
11
|
+
/** Stable HTML entry URL. The host supplies routing and authorization. */
|
|
12
|
+
url: string;
|
|
13
|
+
fetch?: typeof globalThis.fetch;
|
|
14
|
+
document?: Document;
|
|
15
|
+
timeoutMs?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Detect a changed ESM application entry and observe Vite import failures.
|
|
19
|
+
* The loaded document remains authoritative until the user chooses to reload:
|
|
20
|
+
* checking never resets drafts, remounts views, or silently accepts a new build.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createDocumentAssetRecovery(options: DocumentAssetRecoveryOptions): DocumentAssetRecovery;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createSignal as b, onCleanup as L } from "solid-js";
|
|
2
|
+
function g(e, t) {
|
|
3
|
+
const r = [...e.querySelectorAll('script[type="module"][src]')].map((a) => new URL(a.getAttribute("src"), t).href);
|
|
4
|
+
return r.length ? JSON.stringify(r.sort()) : null;
|
|
5
|
+
}
|
|
6
|
+
function A(e) {
|
|
7
|
+
const t = e.document ?? document, r = t.defaultView ?? window, a = new URL(e.url, t.baseURI).href, c = g(t, t.baseURI), p = e.fetch ?? globalThis.fetch.bind(globalThis), [u, d] = b(null), [w, f] = b(!1);
|
|
8
|
+
let l = !1, n, i;
|
|
9
|
+
const m = () => {
|
|
10
|
+
if (l || !c) return Promise.resolve("unavailable");
|
|
11
|
+
if (n) return n;
|
|
12
|
+
const s = new AbortController();
|
|
13
|
+
i = s;
|
|
14
|
+
const y = setTimeout(() => s.abort(), e.timeoutMs ?? 1e4);
|
|
15
|
+
return f(!0), n = Promise.resolve().then(async () => {
|
|
16
|
+
try {
|
|
17
|
+
const o = await p(a, {
|
|
18
|
+
cache: "no-store",
|
|
19
|
+
redirect: "error",
|
|
20
|
+
signal: s.signal,
|
|
21
|
+
headers: { Accept: "text/html" }
|
|
22
|
+
});
|
|
23
|
+
if (!o.ok || o.redirected || !o.headers.get("content-type")?.toLowerCase().includes("text/html"))
|
|
24
|
+
return "unavailable";
|
|
25
|
+
const x = await o.text();
|
|
26
|
+
if (l || s.signal.aborted) return "unavailable";
|
|
27
|
+
const v = g(new DOMParser().parseFromString(x, "text/html"), o.url || a);
|
|
28
|
+
return v ? v !== c ? (d("updated"), "updated") : "current" : "unavailable";
|
|
29
|
+
} catch {
|
|
30
|
+
return "unavailable";
|
|
31
|
+
} finally {
|
|
32
|
+
clearTimeout(y), i = void 0, n = void 0, l || f(!1);
|
|
33
|
+
}
|
|
34
|
+
}), n;
|
|
35
|
+
}, h = () => {
|
|
36
|
+
u() !== "updated" && d("load-failed"), m();
|
|
37
|
+
};
|
|
38
|
+
return r.addEventListener("vite:preloadError", h), L(() => {
|
|
39
|
+
l = !0, i?.abort(), r.removeEventListener("vite:preloadError", h);
|
|
40
|
+
}), { reason: u, checking: w, check: m };
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
A as createDocumentAssetRecovery
|
|
44
|
+
};
|
package/dist/app/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { FloeProvider, type FloeProviderProps } from './FloeProvider';
|
|
2
2
|
export { FloeApp, type FloeAppProps } from './FloeApp';
|
|
3
3
|
export { ActivityAppsMain, type ActivityAppsMainProps } from './ActivityAppsMain';
|
|
4
|
+
export { createDocumentAssetRecovery, type DocumentAssetRecovery, type DocumentAssetRecoveryOptions, type DocumentAssetRecoveryReason, type DocumentAssetCheckResult } from './createDocumentAssetRecovery';
|
|
4
5
|
export { FloeRegistryRuntime, type FloeRegistryRuntimeProps } from './FloeRegistryRuntime';
|
|
5
6
|
export { FloeRegistryContributions, type FloeRegistryContributionsProps, } from './FloeRegistryContributions';
|
package/dist/app.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { ActivityAppsMain as
|
|
2
|
-
import { FloeApp as
|
|
1
|
+
import { ActivityAppsMain as r } from "./app/ActivityAppsMain.js";
|
|
2
|
+
import { FloeApp as p } from "./app/FloeApp.js";
|
|
3
3
|
import { FloeProvider as m } from "./app/FloeProvider.js";
|
|
4
|
-
import { FloeRegistryContributions as
|
|
4
|
+
import { FloeRegistryContributions as s } from "./app/FloeRegistryContributions.js";
|
|
5
5
|
import { FloeRegistryRuntime as n } from "./app/FloeRegistryRuntime.js";
|
|
6
|
+
import { createDocumentAssetRecovery as l } from "./app/createDocumentAssetRecovery.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
r as ActivityAppsMain,
|
|
9
|
+
p as FloeApp,
|
|
9
10
|
m as FloeProvider,
|
|
10
|
-
|
|
11
|
-
n as FloeRegistryRuntime
|
|
11
|
+
s as FloeRegistryContributions,
|
|
12
|
+
n as FloeRegistryRuntime,
|
|
13
|
+
l as createDocumentAssetRecovery
|
|
12
14
|
};
|
|
@@ -16,5 +16,7 @@ export interface KeepAliveStackProps {
|
|
|
16
16
|
activationMode?: 'sync' | 'after-paint';
|
|
17
17
|
/** Optional per-view Suspense boundary. The host owns localized loading presentation. */
|
|
18
18
|
renderFallback?: (id: string) => JSX.Element;
|
|
19
|
+
/** Isolate a failed view without disposing its siblings. Reset does not retry cached dynamic imports. */
|
|
20
|
+
renderError?: (error: unknown, reset: () => void, id: string) => JSX.Element;
|
|
19
21
|
}
|
|
20
22
|
export declare function KeepAliveStack(props: KeepAliveStackProps): JSX.Element;
|
|
@@ -1,171 +1,179 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createMemo as S, createSignal as
|
|
3
|
-
import { ViewActivationProvider as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { deferAfterPaint as
|
|
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
6
|
var O = /* @__PURE__ */ R("<div>");
|
|
7
7
|
function M(e) {
|
|
8
8
|
return String(e ?? "").trim();
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
for (const
|
|
13
|
-
const a = M(
|
|
14
|
-
a && (
|
|
10
|
+
function V(e) {
|
|
11
|
+
const s = [], u = /* @__PURE__ */ new Set();
|
|
12
|
+
for (const l of e) {
|
|
13
|
+
const a = M(l?.id);
|
|
14
|
+
a && (u.has(a) || (u.add(a), s.push(a)));
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return s;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
for (const a of
|
|
18
|
+
function T(e, s) {
|
|
19
|
+
const u = new Set(e), l = /* @__PURE__ */ new Map();
|
|
20
|
+
for (const a of s) {
|
|
21
21
|
const d = M(a?.id);
|
|
22
|
-
d &&
|
|
22
|
+
d && u.has(d) && (l.has(d) || l.set(d, a));
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return l;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const [
|
|
26
|
+
function U(e) {
|
|
27
|
+
const [s, u] = I(0), [l, a] = I(!1);
|
|
28
28
|
let d = 0;
|
|
29
29
|
D(() => {
|
|
30
|
-
const
|
|
30
|
+
const r = e.active(), i = e.activationMode();
|
|
31
31
|
d += 1;
|
|
32
32
|
const h = d;
|
|
33
|
-
if (!
|
|
33
|
+
if (!r) {
|
|
34
34
|
a(!1);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
h !== d || !e.active() ||
|
|
37
|
+
const f = () => {
|
|
38
|
+
h !== d || !e.active() || x(l) || (a(!0), u((m) => m + 1));
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
i === "after-paint" ? Q(f) : f();
|
|
41
41
|
}), G(() => {
|
|
42
42
|
d += 1;
|
|
43
43
|
});
|
|
44
|
-
const A =
|
|
44
|
+
const A = x(() => ({
|
|
45
45
|
id: e.id,
|
|
46
46
|
visible: e.active,
|
|
47
|
-
active:
|
|
48
|
-
activationSeq:
|
|
49
|
-
}))
|
|
50
|
-
|
|
47
|
+
active: l,
|
|
48
|
+
activationSeq: s
|
|
49
|
+
})), v = () => e.renderFallback ? y(J, {
|
|
50
|
+
get fallback() {
|
|
51
|
+
return e.renderFallback(e.id);
|
|
52
|
+
},
|
|
53
|
+
get children() {
|
|
54
|
+
return e.children;
|
|
55
|
+
}
|
|
56
|
+
}) : e.children;
|
|
57
|
+
return y(L, {
|
|
51
58
|
value: A,
|
|
52
59
|
get children() {
|
|
53
|
-
var
|
|
54
|
-
return
|
|
55
|
-
var
|
|
56
|
-
return () =>
|
|
57
|
-
|
|
58
|
-
return e.renderFallback(e.id);
|
|
59
|
-
},
|
|
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
65
|
get children() {
|
|
61
|
-
return
|
|
66
|
+
return v();
|
|
62
67
|
}
|
|
63
|
-
}) :
|
|
64
|
-
})()),
|
|
65
|
-
var h = e.class,
|
|
66
|
-
return h !==
|
|
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;
|
|
67
72
|
}, {
|
|
68
73
|
e: void 0,
|
|
69
74
|
t: void 0,
|
|
70
75
|
a: void 0,
|
|
71
76
|
o: void 0,
|
|
72
77
|
i: void 0
|
|
73
|
-
}),
|
|
78
|
+
}), r;
|
|
74
79
|
}
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
|
-
function
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
A((
|
|
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) => {
|
|
82
87
|
let o = !1;
|
|
83
|
-
const
|
|
84
|
-
for (const
|
|
85
|
-
|
|
86
|
-
for (const
|
|
87
|
-
const
|
|
88
|
-
|
|
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));
|
|
89
94
|
}
|
|
90
|
-
return o ?
|
|
95
|
+
return o ? w : c;
|
|
91
96
|
});
|
|
92
97
|
});
|
|
93
|
-
const
|
|
98
|
+
const r = S(() => ({
|
|
94
99
|
order: a(),
|
|
95
100
|
byId: d()
|
|
96
|
-
})),
|
|
97
|
-
if (!
|
|
98
|
-
if (!
|
|
99
|
-
const
|
|
100
|
-
return
|
|
101
|
-
}, [
|
|
102
|
-
|
|
103
|
-
if (!
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
let
|
|
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;
|
|
107
112
|
const o = /* @__PURE__ */ new Set();
|
|
108
|
-
for (const
|
|
109
|
-
if (!
|
|
110
|
-
|
|
113
|
+
for (const w of n) {
|
|
114
|
+
if (!t.has(w)) {
|
|
115
|
+
c = !0;
|
|
111
116
|
continue;
|
|
112
117
|
}
|
|
113
|
-
o.add(
|
|
118
|
+
o.add(w);
|
|
114
119
|
}
|
|
115
|
-
return
|
|
120
|
+
return c ? o : n;
|
|
116
121
|
});
|
|
117
|
-
}),
|
|
118
|
-
if (!
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
return
|
|
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;
|
|
124
129
|
});
|
|
125
130
|
});
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
129
|
-
return
|
|
130
|
-
if (!
|
|
131
|
-
const
|
|
132
|
-
return
|
|
133
|
-
}),
|
|
134
|
-
const
|
|
135
|
-
return
|
|
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;
|
|
136
141
|
});
|
|
137
142
|
return (() => {
|
|
138
|
-
var
|
|
139
|
-
return
|
|
143
|
+
var t = O();
|
|
144
|
+
return B(t, y(j, {
|
|
140
145
|
get each() {
|
|
141
|
-
return
|
|
146
|
+
return m();
|
|
142
147
|
},
|
|
143
|
-
children: (
|
|
144
|
-
const
|
|
145
|
-
return
|
|
146
|
-
id:
|
|
147
|
-
active: () =>
|
|
148
|
-
activationMode:
|
|
148
|
+
children: (n) => {
|
|
149
|
+
const c = () => d().get(n);
|
|
150
|
+
return y(U, {
|
|
151
|
+
id: n,
|
|
152
|
+
active: () => v() === n,
|
|
153
|
+
activationMode: l,
|
|
149
154
|
get renderFallback() {
|
|
150
155
|
return e.renderFallback;
|
|
151
156
|
},
|
|
157
|
+
get renderError() {
|
|
158
|
+
return e.renderError;
|
|
159
|
+
},
|
|
152
160
|
get class() {
|
|
153
|
-
return
|
|
161
|
+
return z("absolute inset-0", c()?.class);
|
|
154
162
|
},
|
|
155
163
|
get children() {
|
|
156
|
-
return
|
|
164
|
+
return c()?.render();
|
|
157
165
|
}
|
|
158
166
|
});
|
|
159
167
|
}
|
|
160
|
-
})),
|
|
161
|
-
var
|
|
162
|
-
return
|
|
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;
|
|
163
171
|
}, {
|
|
164
172
|
e: void 0,
|
|
165
173
|
t: void 0
|
|
166
|
-
}),
|
|
174
|
+
}), t;
|
|
167
175
|
})();
|
|
168
176
|
}
|
|
169
177
|
export {
|
|
170
|
-
|
|
178
|
+
$ as KeepAliveStack
|
|
171
179
|
};
|