@floegence/floe-webapp-core 0.64.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.
Files changed (102) hide show
  1. package/dist/PDFJS-LICENSE +177 -0
  2. package/dist/app/ActivityAppsMain.d.ts +2 -0
  3. package/dist/app/ActivityAppsMain.js +13 -10
  4. package/dist/app/createDocumentAssetRecovery.d.ts +22 -0
  5. package/dist/app/createDocumentAssetRecovery.js +44 -0
  6. package/dist/app/index.d.ts +1 -0
  7. package/dist/app.js +9 -7
  8. package/dist/components/layout/KeepAliveStack.d.ts +2 -0
  9. package/dist/components/layout/KeepAliveStack.js +111 -103
  10. package/dist/full.js +250 -248
  11. package/dist/images/altText_add.svg +3 -0
  12. package/dist/images/altText_disclaimer.svg +3 -0
  13. package/dist/images/altText_done.svg +3 -0
  14. package/dist/images/altText_spinner.svg +30 -0
  15. package/dist/images/altText_warning.svg +3 -0
  16. package/dist/images/annotation-check.svg +11 -0
  17. package/dist/images/annotation-comment.svg +16 -0
  18. package/dist/images/annotation-help.svg +26 -0
  19. package/dist/images/annotation-insert.svg +10 -0
  20. package/dist/images/annotation-key.svg +11 -0
  21. package/dist/images/annotation-newparagraph.svg +11 -0
  22. package/dist/images/annotation-noicon.svg +7 -0
  23. package/dist/images/annotation-note.svg +42 -0
  24. package/dist/images/annotation-paperclip.svg +6 -0
  25. package/dist/images/annotation-paragraph.svg +16 -0
  26. package/dist/images/annotation-pushpin.svg +7 -0
  27. package/dist/images/checkmark.svg +5 -0
  28. package/dist/images/comment-actionsButton.svg +3 -0
  29. package/dist/images/comment-closeButton.svg +3 -0
  30. package/dist/images/comment-editButton.svg +8 -0
  31. package/dist/images/comment-popup-editButton.svg +5 -0
  32. package/dist/images/cursor-editorFreeHighlight.svg +6 -0
  33. package/dist/images/cursor-editorFreeText.svg +3 -0
  34. package/dist/images/cursor-editorInk.svg +4 -0
  35. package/dist/images/cursor-editorTextHighlight.svg +8 -0
  36. package/dist/images/editor-toolbar-delete.svg +5 -0
  37. package/dist/images/editor-toolbar-edit.svg +3 -0
  38. package/dist/images/findbarButton-next.svg +3 -0
  39. package/dist/images/findbarButton-previous.svg +3 -0
  40. package/dist/images/gv-toolbarButton-download.svg +3 -0
  41. package/dist/images/loading-icon.gif +0 -0
  42. package/dist/images/loading.svg +1 -0
  43. package/dist/images/messageBar_closingButton.svg +3 -0
  44. package/dist/images/messageBar_info.svg +3 -0
  45. package/dist/images/messageBar_warning.svg +3 -0
  46. package/dist/images/pages_closeButton.svg +3 -0
  47. package/dist/images/pages_selected.svg +7 -0
  48. package/dist/images/pages_viewArrow.svg +3 -0
  49. package/dist/images/pages_viewButton.svg +3 -0
  50. package/dist/images/secondaryToolbarButton-documentProperties.svg +3 -0
  51. package/dist/images/secondaryToolbarButton-firstPage.svg +3 -0
  52. package/dist/images/secondaryToolbarButton-handTool.svg +3 -0
  53. package/dist/images/secondaryToolbarButton-lastPage.svg +3 -0
  54. package/dist/images/secondaryToolbarButton-rotateCcw.svg +3 -0
  55. package/dist/images/secondaryToolbarButton-rotateCw.svg +3 -0
  56. package/dist/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
  57. package/dist/images/secondaryToolbarButton-scrollPage.svg +3 -0
  58. package/dist/images/secondaryToolbarButton-scrollVertical.svg +3 -0
  59. package/dist/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
  60. package/dist/images/secondaryToolbarButton-selectTool.svg +3 -0
  61. package/dist/images/secondaryToolbarButton-spreadEven.svg +3 -0
  62. package/dist/images/secondaryToolbarButton-spreadNone.svg +3 -0
  63. package/dist/images/secondaryToolbarButton-spreadOdd.svg +3 -0
  64. package/dist/images/signature-properties-row-check.svg +4 -0
  65. package/dist/images/toolbarButton-bookmark.svg +3 -0
  66. package/dist/images/toolbarButton-currentOutlineItem.svg +3 -0
  67. package/dist/images/toolbarButton-download.svg +4 -0
  68. package/dist/images/toolbarButton-editorFreeText.svg +5 -0
  69. package/dist/images/toolbarButton-editorHighlight.svg +6 -0
  70. package/dist/images/toolbarButton-editorInk.svg +4 -0
  71. package/dist/images/toolbarButton-editorSignature.svg +6 -0
  72. package/dist/images/toolbarButton-editorStamp.svg +8 -0
  73. package/dist/images/toolbarButton-menuArrow.svg +3 -0
  74. package/dist/images/toolbarButton-menuArrowNova.svg +3 -0
  75. package/dist/images/toolbarButton-openFile.svg +3 -0
  76. package/dist/images/toolbarButton-pageDown.svg +3 -0
  77. package/dist/images/toolbarButton-pageUp.svg +3 -0
  78. package/dist/images/toolbarButton-presentationMode.svg +3 -0
  79. package/dist/images/toolbarButton-print.svg +3 -0
  80. package/dist/images/toolbarButton-search.svg +3 -0
  81. package/dist/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
  82. package/dist/images/toolbarButton-signaturePropertiesError.svg +7 -0
  83. package/dist/images/toolbarButton-signaturePropertiesVerified.svg +7 -0
  84. package/dist/images/toolbarButton-viewAttachments.svg +3 -0
  85. package/dist/images/toolbarButton-viewLayers.svg +3 -0
  86. package/dist/images/toolbarButton-viewOutline.svg +3 -0
  87. package/dist/images/toolbarButton-viewThumbnail.svg +3 -0
  88. package/dist/images/toolbarButton-viewsManagerToggle.svg +3 -0
  89. package/dist/images/toolbarButton-zoomIn.svg +3 -0
  90. package/dist/images/toolbarButton-zoomOut.svg +3 -0
  91. package/dist/images/treeitem-collapsed.svg +1 -0
  92. package/dist/images/treeitem-expanded.svg +1 -0
  93. package/dist/pdf/PdfDocumentSurface.d.ts +71 -0
  94. package/dist/pdf/PdfDocumentSurface.js +235 -0
  95. package/dist/pdf/localization.d.ts +21 -0
  96. package/dist/pdf/localization.js +50 -0
  97. package/dist/pdf.css +6428 -0
  98. package/dist/pdf.d.ts +5 -0
  99. package/dist/pdf.js +7 -0
  100. package/package.json +16 -4
  101. package/scripts/pdf-assets.d.mts +2 -0
  102. package/scripts/pdf-assets.mjs +52 -0
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -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 i, Dynamic as s } from "solid-js/web";
2
- import { untrack as d, createMemo as l } from "solid-js";
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 f } from "../components/layout/KeepAliveStack.js";
6
- function g(e) {
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 n = m(), r = v();
11
- if (!d(() => !!e.views) && !r)
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() : n.sidebarActiveTab(), a = l(() => {
13
+ const o = () => e.activeId ? e.activeId() : i.sidebarActiveTab(), a = l(() => {
14
14
  if (!r) return [];
15
- const u = e.include ?? g;
15
+ const u = e.include ?? f;
16
16
  return r.sidebarItems().filter((t) => u(t)).map((t) => ({
17
17
  id: t.id,
18
- render: () => i(s, {
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 i(f, {
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
+ };
@@ -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 e } from "./app/ActivityAppsMain.js";
2
- import { FloeApp as i } from "./app/FloeApp.js";
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 x } from "./app/FloeRegistryContributions.js";
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
- e as ActivityAppsMain,
8
- i as FloeApp,
8
+ r as ActivityAppsMain,
9
+ p as FloeApp,
9
10
  m as FloeProvider,
10
- x as FloeRegistryContributions,
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 P, createComponent as g, effect as B, className as E, setStyleProperty as K, template as R, memo as N, setAttribute as z } from "solid-js/web";
2
- import { createMemo as S, createSignal as k, untrack as F, createEffect as x, For as j, createRenderEffect as D, onCleanup as G, Suspense as H } from "solid-js";
3
- import { ViewActivationProvider as J } from "../../context/ViewActivationContext.js";
4
- import { cn as V } from "../../utils/cn.js";
5
- import { deferAfterPaint as L } from "../../utils/defer.js";
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 C(e) {
11
- const u = [], s = /* @__PURE__ */ new Set();
12
- for (const f of e) {
13
- const a = M(f?.id);
14
- a && (s.has(a) || (s.add(a), u.push(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 u;
16
+ return s;
17
17
  }
18
- function Q(e, u) {
19
- const s = new Set(e), f = /* @__PURE__ */ new Map();
20
- for (const a of u) {
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 && s.has(d) && (f.has(d) || f.set(d, a));
22
+ d && u.has(d) && (l.has(d) || l.set(d, a));
23
23
  }
24
- return f;
24
+ return l;
25
25
  }
26
- function T(e) {
27
- const [u, s] = k(0), [f, a] = k(!1);
26
+ function U(e) {
27
+ const [s, u] = I(0), [l, a] = I(!1);
28
28
  let d = 0;
29
29
  D(() => {
30
- const c = e.active(), t = e.activationMode();
30
+ const r = e.active(), i = e.activationMode();
31
31
  d += 1;
32
32
  const h = d;
33
- if (!c) {
33
+ if (!r) {
34
34
  a(!1);
35
35
  return;
36
36
  }
37
- const v = () => {
38
- h !== d || !e.active() || F(f) || (a(!0), s((w) => w + 1));
37
+ const f = () => {
38
+ h !== d || !e.active() || x(l) || (a(!0), u((m) => m + 1));
39
39
  };
40
- t === "after-paint" ? L(v) : v();
40
+ i === "after-paint" ? Q(f) : f();
41
41
  }), G(() => {
42
42
  d += 1;
43
43
  });
44
- const A = F(() => ({
44
+ const A = x(() => ({
45
45
  id: e.id,
46
46
  visible: e.active,
47
- active: f,
48
- activationSeq: u
49
- }));
50
- return g(J, {
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 c = O();
54
- return P(c, (() => {
55
- var t = N(() => !!e.renderFallback);
56
- return () => t() ? g(H, {
57
- get fallback() {
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 e.children;
66
+ return v();
62
67
  }
63
- }) : e.children;
64
- })()), B((t) => {
65
- var h = e.class, v = e.id, w = e.active() ? void 0 : "true", b = !e.active(), y = e.active() ? "block" : "none";
66
- return h !== t.e && E(c, t.e = h), v !== t.t && z(c, "data-floe-keep-alive-view", t.t = v), w !== t.a && z(c, "aria-hidden", t.a = w), b !== t.o && (c.inert = t.o = b), y !== t.i && K(c, "display", t.i = y), t;
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
- }), c;
78
+ }), r;
74
79
  }
75
80
  });
76
81
  }
77
- function _(e) {
78
- const u = () => e.lazyMount !== !1, s = () => e.keepMounted !== !1, f = () => e.activationMode ?? "sync", a = S(() => C(e.views)), [d, A] = k(F(() => Q(C(e.views), e.views))), c = S(() => M(e.activeId));
79
- x(() => {
80
- const n = a(), i = e.views;
81
- A((r) => {
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 l = new Map(r), q = new Set(n);
84
- for (const m of l.keys())
85
- q.has(m) || (l.delete(m), o = !0);
86
- for (const m of i) {
87
- const I = M(m?.id);
88
- I && q.has(I) && (l.has(I) || (l.set(I, m), o = !0));
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 ? l : r;
95
+ return o ? w : c;
91
96
  });
92
97
  });
93
- const t = S(() => ({
98
+ const r = S(() => ({
94
99
  order: a(),
95
100
  byId: d()
96
- })), h = () => {
97
- if (!s()) return /* @__PURE__ */ new Set();
98
- if (!u()) return new Set(t().order);
99
- const n = c();
100
- return n ? t().byId.has(n) ? /* @__PURE__ */ new Set([n]) : /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set();
101
- }, [v, w] = k(h());
102
- x(() => {
103
- if (!s()) return;
104
- const n = new Set(t().order);
105
- w((i) => {
106
- let r = !1;
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 l of i) {
109
- if (!n.has(l)) {
110
- r = !0;
113
+ for (const w of n) {
114
+ if (!t.has(w)) {
115
+ c = !0;
111
116
  continue;
112
117
  }
113
- o.add(l);
118
+ o.add(w);
114
119
  }
115
- return r ? o : i;
120
+ return c ? o : n;
116
121
  });
117
- }), x(() => {
118
- if (!s() || !u()) return;
119
- const n = c();
120
- n && t().byId.has(n) && w((i) => {
121
- if (i.has(n)) return i;
122
- const r = new Set(i);
123
- return r.add(n), r;
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 b = S(() => {
127
- const n = t().order, i = c();
128
- if (!s())
129
- return i ? t().byId.has(i) ? [i] : [] : [];
130
- if (!u()) return n;
131
- const r = v();
132
- return n.filter((o) => r.has(o) || o === i);
133
- }), y = S(() => {
134
- const n = c();
135
- return n ? t().byId.has(n) : !1;
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 n = O();
139
- return P(n, g(j, {
143
+ var t = O();
144
+ return B(t, y(j, {
140
145
  get each() {
141
- return b();
146
+ return m();
142
147
  },
143
- children: (i) => {
144
- const r = () => d().get(i);
145
- return g(T, {
146
- id: i,
147
- active: () => c() === i,
148
- activationMode: f,
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 V("absolute inset-0", r()?.class);
161
+ return z("absolute inset-0", c()?.class);
154
162
  },
155
163
  get children() {
156
- return r()?.render();
164
+ return c()?.render();
157
165
  }
158
166
  });
159
167
  }
160
- })), B((i) => {
161
- var r = V("relative h-full min-h-0 w-full", e.class), o = y() ? "block" : "none";
162
- return r !== i.e && E(n, i.e = r), o !== i.t && K(n, "display", i.t = o), i;
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
- }), n;
174
+ }), t;
167
175
  })();
168
176
  }
169
177
  export {
170
- _ as KeepAliveStack
178
+ $ as KeepAliveStack
171
179
  };