@floegence/floe-webapp-core 0.79.0 → 0.80.0

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.
@@ -0,0 +1,7 @@
1
+ import { type Component, type JSX } from 'solid-js';
2
+ /**
3
+ * Create content once under its owner's lifetime, then mount it in one location
4
+ * at a time. Placement changes preserve native scroll offsets as well as nodes.
5
+ * Disclosure, focus, and business state remain owned by the caller.
6
+ */
7
+ export declare function createRetainedContent(render: () => JSX.Element): Component;
@@ -0,0 +1,15 @@
1
+ import { children as c, onMount as f, onCleanup as s } from "solid-js";
2
+ function i(l) {
3
+ const r = c(l);
4
+ let e = [];
5
+ return () => (f(() => {
6
+ for (const { element: t, left: o, top: n } of e)
7
+ t.scrollLeft = o, t.scrollTop = n;
8
+ }), s(() => {
9
+ if (typeof HTMLElement > "u") return;
10
+ e = r.toArray().filter((o) => o instanceof HTMLElement).flatMap((o) => [o, ...o.querySelectorAll("*")]).filter((o) => o.scrollTop !== 0 || o.scrollLeft !== 0).map((o) => ({ element: o, left: o.scrollLeft, top: o.scrollTop }));
11
+ }), r());
12
+ }
13
+ export {
14
+ i as createRetainedContent
15
+ };
@@ -7,3 +7,4 @@ export { useKeybind } from './useKeybind';
7
7
  export { usePersisted } from './usePersisted';
8
8
  export { useDeckDrag } from './useDeckDrag';
9
9
  export { useFileBrowserItemDrag, useFileBrowserDropTarget, type UseFileBrowserItemDragOptions, type FileBrowserItemDragHandlers, type UseFileBrowserDropTargetOptions, type FileBrowserDropTargetResult, } from './useFileBrowserDrag';
10
+ export { createRetainedContent } from './createRetainedContent';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { FloeProvider as r } from "./app/FloeProvider.js";
2
- import { applyShellThemeAttribute as i, applySurfaceStyleAttribute as s, applyTheme as n, builtInThemes as a, getSystemTheme as m, isFloeSurfaceStyle as l, isThemeType as p, mergeThemeTokenMaps as f, resolveThemeTokenOverrides as d, resolveThemeTokens as T, syncThemeTokenOverrides as u } from "./styles/themes/index.js";
3
- import { floeColorTokenCategories as x, floeDesignTokens as g, floeFontFamilyTokens as y, floeMotionTokens as C, floeRadiusTokens as S, floeSharedCssVariables as h, floeSpacingTokens as F, floeSurfaceTokens as v, floeThemeColorVariables as P, floeTypographyTokens as k, getFloeColorTokenValue as I } from "./styles/tokens.js";
2
+ import { applyShellThemeAttribute as i, applySurfaceStyleAttribute as s, applyTheme as n, builtInThemes as a, getSystemTheme as m, isFloeSurfaceStyle as l, isThemeType as p, mergeThemeTokenMaps as f, resolveThemeTokenOverrides as d, resolveThemeTokens as T, syncThemeTokenOverrides as c } from "./styles/themes/index.js";
3
+ import { floeColorTokenCategories as x, floeDesignTokens as g, floeFontFamilyTokens as y, floeMotionTokens as C, floeRadiusTokens as S, floeSharedCssVariables as h, floeSpacingTokens as F, floeSurfaceTokens as v, floeThemeColorVariables as P, floeTypographyTokens as R, getFloeColorTokenValue as k } from "./styles/tokens.js";
4
4
  import { BUILT_IN_SHELL_THEME_DEFAULTS as D, REQUIRED_SHELL_THEME_TOKENS as E, assertUniqueThemePresetNames as b, builtInShellThemePresets as L, createShellThemePreset as _, getShellThemePresetsForMode as A, normalizeShellThemeSelection as N, presetSupportsMode as O, resolveShellThemePresetName as M } from "./styles/themes/presets.js";
5
5
  import { CommandProvider as U, createCommandService as w, useCommand as G } from "./context/CommandContext.js";
6
6
  import { ComponentRegistryProvider as W, createComponentRegistry as K, hasComponentRegistryContext as V, useComponentContextFactory as z, useComponentRegistry as Q, useOptionalComponentRegistry as q } from "./context/ComponentRegistry.js";
@@ -8,10 +8,10 @@ import { DEFAULT_FLOE_CONFIG as j, FloeConfigProvider as J, useFloeConfig as X,
8
8
  import { DeckProvider as ee, createDeckService as oe, useDeck as re } from "./context/DeckContext.js";
9
9
  import { FLOE_GEOMETRY_SURFACE_ATTR as ie, FLOE_HOT_INTERACTION_ATTR as se, startHotInteraction as ne } from "./utils/hotInteraction.js";
10
10
  import { FileBrowserDragProvider as me, hasFileBrowserDragContext as le, useFileBrowserDrag as pe } from "./context/FileBrowserDragContext.js";
11
- import { LayoutProvider as de, createLayoutService as Te, useLayout as ue, useMobileLayout as ce } from "./context/LayoutContext.js";
11
+ import { LayoutProvider as de, createLayoutService as Te, useLayout as ce, useMobileLayout as ue } from "./context/LayoutContext.js";
12
12
  import { NotificationContainer as ge, NotificationProvider as ye, createNotificationService as Ce, useNotification as Se } from "./context/NotificationContext.js";
13
13
  import { ThemeProvider as Fe, createThemeService as ve, useTheme as Pe } from "./context/ThemeContext.js";
14
- import { ViewActivationProvider as Ie, useViewActivation as Re } from "./context/ViewActivationContext.js";
14
+ import { ViewActivationProvider as ke, useViewActivation as Ie } from "./context/ViewActivationContext.js";
15
15
  import { WidgetRegistryProvider as Ee, createWidgetRegistry as be, useWidgetRegistry as Le } from "./context/WidgetRegistry.js";
16
16
  import { WidgetStateProvider as Ae, useCurrentWidgetId as Ne, useWidgetState as Oe, useWidgetStateContext as Me } from "./context/WidgetStateContext.js";
17
17
  import { applyDragDelta as Ue, applyResizeDelta as we, getGridCellSize as Ge, pixelDeltaToGridDelta as He, positionToGridArea as We, snapToGrid as Ke } from "./utils/gridLayout.js";
@@ -19,22 +19,23 @@ import { calculateFitScale as ze } from "./utils/fitScale.js";
19
19
  import { checkCollision as qe, constrainPosition as Ye, findFreePosition as je, hasCollision as Je, sameGridPosition as Xe } from "./utils/gridCollision.js";
20
20
  import { cn as $e } from "./utils/cn.js";
21
21
  import { createAdaptiveSidebar as oo } from "./hooks/createAdaptiveSidebar.js";
22
- import { createSimpleContext as to } from "./context/createSimpleContext.js";
23
- import { createUIFirstSelection as so } from "./utils/uiFirstSelection.js";
24
- import { deferAfterPaint as ao, deferNonBlocking as mo } from "./utils/defer.js";
25
- import { duration as po, easing as fo, fadeIn as To, listContainer as uo, listItem as co, panelResize as xo, popIn as go, scaleIn as yo, sidebarVariants as Co, slideInFromBottom as So, slideInFromLeft as ho, slideInFromRight as Fo, slideInFromTop as vo, springConfig as Po } from "./utils/animations.js";
26
- import { formatKeybind as Io, isMacLikePlatform as Ro, isPrimaryModKeyPressed as Do, matchKeybind as Eo, parseKeybind as bo } from "./utils/keybind.js";
27
- import { isTypingElement as _o, shouldIgnoreHotkeys as Ao } from "./utils/dom.js";
28
- import { lockBodyStyle as Oo } from "./utils/bodyStyleLock.js";
29
- import { registerCommandContributions as Bo, useCommandContributions as Uo } from "./hooks/useCommandContributions.js";
30
- import { secureRandomUUID as Go } from "./utils/secureRandom.js";
31
- import { useDebounce as Wo } from "./hooks/useDebounce.js";
32
- import { useDeckDrag as Vo } from "./hooks/useDeckDrag.js";
33
- import { useFileBrowserDropTarget as Qo, useFileBrowserItemDrag as qo } from "./hooks/useFileBrowserDrag.js";
34
- import { useKeybind as jo } from "./hooks/useKeybind.js";
35
- import { useMediaQuery as Xo } from "./hooks/useMediaQuery.js";
36
- import { usePersisted as $o } from "./hooks/usePersisted.js";
37
- import { useResizeObserver as or } from "./hooks/useResizeObserver.js";
22
+ import { createRetainedContent as to } from "./hooks/createRetainedContent.js";
23
+ import { createSimpleContext as so } from "./context/createSimpleContext.js";
24
+ import { createUIFirstSelection as ao } from "./utils/uiFirstSelection.js";
25
+ import { deferAfterPaint as lo, deferNonBlocking as po } from "./utils/defer.js";
26
+ import { duration as To, easing as co, fadeIn as uo, listContainer as xo, listItem as go, panelResize as yo, popIn as Co, scaleIn as So, sidebarVariants as ho, slideInFromBottom as Fo, slideInFromLeft as vo, slideInFromRight as Po, slideInFromTop as Ro, springConfig as ko } from "./utils/animations.js";
27
+ import { formatKeybind as Do, isMacLikePlatform as Eo, isPrimaryModKeyPressed as bo, matchKeybind as Lo, parseKeybind as _o } from "./utils/keybind.js";
28
+ import { isTypingElement as No, shouldIgnoreHotkeys as Oo } from "./utils/dom.js";
29
+ import { lockBodyStyle as Bo } from "./utils/bodyStyleLock.js";
30
+ import { registerCommandContributions as wo, useCommandContributions as Go } from "./hooks/useCommandContributions.js";
31
+ import { secureRandomUUID as Wo } from "./utils/secureRandom.js";
32
+ import { useDebounce as Vo } from "./hooks/useDebounce.js";
33
+ import { useDeckDrag as Qo } from "./hooks/useDeckDrag.js";
34
+ import { useFileBrowserDropTarget as Yo, useFileBrowserItemDrag as jo } from "./hooks/useFileBrowserDrag.js";
35
+ import { useKeybind as Xo } from "./hooks/useKeybind.js";
36
+ import { useMediaQuery as $o } from "./hooks/useMediaQuery.js";
37
+ import { usePersisted as or } from "./hooks/usePersisted.js";
38
+ import { useResizeObserver as tr } from "./hooks/useResizeObserver.js";
38
39
  export {
39
40
  D as BUILT_IN_SHELL_THEME_DEFAULTS,
40
41
  U as CommandProvider,
@@ -51,7 +52,7 @@ export {
51
52
  ye as NotificationProvider,
52
53
  E as REQUIRED_SHELL_THEME_TOKENS,
53
54
  Fe as ThemeProvider,
54
- Ie as ViewActivationProvider,
55
+ ke as ViewActivationProvider,
55
56
  Ee as WidgetRegistryProvider,
56
57
  Ae as WidgetStateProvider,
57
58
  Ue as applyDragDelta,
@@ -72,16 +73,17 @@ export {
72
73
  oe as createDeckService,
73
74
  Te as createLayoutService,
74
75
  Ce as createNotificationService,
76
+ to as createRetainedContent,
75
77
  _ as createShellThemePreset,
76
- to as createSimpleContext,
78
+ so as createSimpleContext,
77
79
  ve as createThemeService,
78
- so as createUIFirstSelection,
80
+ ao as createUIFirstSelection,
79
81
  be as createWidgetRegistry,
80
- ao as deferAfterPaint,
81
- mo as deferNonBlocking,
82
- po as duration,
83
- fo as easing,
84
- To as fadeIn,
82
+ lo as deferAfterPaint,
83
+ po as deferNonBlocking,
84
+ To as duration,
85
+ co as easing,
86
+ uo as fadeIn,
85
87
  je as findFreePosition,
86
88
  x as floeColorTokenCategories,
87
89
  g as floeDesignTokens,
@@ -92,9 +94,9 @@ export {
92
94
  F as floeSpacingTokens,
93
95
  v as floeSurfaceTokens,
94
96
  P as floeThemeColorVariables,
95
- k as floeTypographyTokens,
96
- Io as formatKeybind,
97
- I as getFloeColorTokenValue,
97
+ R as floeTypographyTokens,
98
+ Do as formatKeybind,
99
+ k as getFloeColorTokenValue,
98
100
  Ge as getGridCellSize,
99
101
  A as getShellThemePresetsForMode,
100
102
  m as getSystemTheme,
@@ -102,62 +104,62 @@ export {
102
104
  V as hasComponentRegistryContext,
103
105
  le as hasFileBrowserDragContext,
104
106
  l as isFloeSurfaceStyle,
105
- Ro as isMacLikePlatform,
106
- Do as isPrimaryModKeyPressed,
107
+ Eo as isMacLikePlatform,
108
+ bo as isPrimaryModKeyPressed,
107
109
  p as isThemeType,
108
- _o as isTypingElement,
109
- uo as listContainer,
110
- co as listItem,
111
- Oo as lockBodyStyle,
112
- Eo as matchKeybind,
110
+ No as isTypingElement,
111
+ xo as listContainer,
112
+ go as listItem,
113
+ Bo as lockBodyStyle,
114
+ Lo as matchKeybind,
113
115
  f as mergeThemeTokenMaps,
114
116
  N as normalizeShellThemeSelection,
115
- xo as panelResize,
116
- bo as parseKeybind,
117
+ yo as panelResize,
118
+ _o as parseKeybind,
117
119
  He as pixelDeltaToGridDelta,
118
- go as popIn,
120
+ Co as popIn,
119
121
  We as positionToGridArea,
120
122
  O as presetSupportsMode,
121
- Bo as registerCommandContributions,
123
+ wo as registerCommandContributions,
122
124
  M as resolveShellThemePresetName,
123
125
  d as resolveThemeTokenOverrides,
124
126
  T as resolveThemeTokens,
125
127
  Xe as sameGridPosition,
126
- yo as scaleIn,
127
- Go as secureRandomUUID,
128
- Ao as shouldIgnoreHotkeys,
129
- Co as sidebarVariants,
130
- So as slideInFromBottom,
131
- ho as slideInFromLeft,
132
- Fo as slideInFromRight,
133
- vo as slideInFromTop,
128
+ So as scaleIn,
129
+ Wo as secureRandomUUID,
130
+ Oo as shouldIgnoreHotkeys,
131
+ ho as sidebarVariants,
132
+ Fo as slideInFromBottom,
133
+ vo as slideInFromLeft,
134
+ Po as slideInFromRight,
135
+ Ro as slideInFromTop,
134
136
  Ke as snapToGrid,
135
- Po as springConfig,
137
+ ko as springConfig,
136
138
  ne as startHotInteraction,
137
- u as syncThemeTokenOverrides,
139
+ c as syncThemeTokenOverrides,
138
140
  G as useCommand,
139
- Uo as useCommandContributions,
141
+ Go as useCommandContributions,
140
142
  z as useComponentContextFactory,
141
143
  Q as useComponentRegistry,
142
144
  Ne as useCurrentWidgetId,
143
- Wo as useDebounce,
145
+ Vo as useDebounce,
144
146
  re as useDeck,
145
- Vo as useDeckDrag,
147
+ Qo as useDeckDrag,
146
148
  pe as useFileBrowserDrag,
147
- Qo as useFileBrowserDropTarget,
148
- qo as useFileBrowserItemDrag,
149
+ Yo as useFileBrowserDropTarget,
150
+ jo as useFileBrowserItemDrag,
149
151
  X as useFloeConfig,
150
- jo as useKeybind,
151
- ue as useLayout,
152
- Xo as useMediaQuery,
153
- ce as useMobileLayout,
152
+ Xo as useKeybind,
153
+ ce as useLayout,
154
+ $o as useMediaQuery,
155
+ ue as useMobileLayout,
154
156
  Se as useNotification,
155
157
  q as useOptionalComponentRegistry,
156
- $o as usePersisted,
157
- or as useResizeObserver,
158
+ or as usePersisted,
159
+ tr as useResizeObserver,
158
160
  Z as useResolvedFloeConfig,
159
161
  Pe as useTheme,
160
- Re as useViewActivation,
162
+ Ie as useViewActivation,
161
163
  Le as useWidgetRegistry,
162
164
  Oe as useWidgetState,
163
165
  Me as useWidgetStateContext