@floegence/floe-webapp-core 0.54.1 → 0.55.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.
- package/dist/full.js +115 -113
- package/dist/hooks/useResizeObserver.d.ts +2 -1
- package/dist/hooks/useResizeObserver.js +22 -18
- package/dist/index.js +67 -65
- package/dist/utils/fitScale.d.ts +10 -0
- package/dist/utils/fitScale.js +9 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/full.js
CHANGED
|
@@ -142,38 +142,39 @@ import { WidgetTypeSwitcher as Df } from "./components/deck/WidgetTypeSwitcher.j
|
|
|
142
142
|
import { WorkingIndicator as yf } from "./components/chat/status/WorkingIndicator.js";
|
|
143
143
|
import { applyDragDelta as Bf, applyResizeDelta as Mf, getGridCellSize as Of, pixelDeltaToGridDelta as Wf, positionToGridArea as Nf, snapToGrid as bf } from "./utils/gridLayout.js";
|
|
144
144
|
import { buildAssistantNoticeEvents as Uf, createStreamEventBuilder as Hf, isStreamEvent as Gf } from "./components/chat/streamEvents.js";
|
|
145
|
-
import {
|
|
146
|
-
import {
|
|
147
|
-
import {
|
|
148
|
-
import {
|
|
149
|
-
import {
|
|
150
|
-
import {
|
|
151
|
-
import {
|
|
152
|
-
import {
|
|
153
|
-
import {
|
|
154
|
-
import {
|
|
155
|
-
import {
|
|
156
|
-
import {
|
|
157
|
-
import {
|
|
158
|
-
import {
|
|
159
|
-
import {
|
|
160
|
-
import {
|
|
161
|
-
import {
|
|
162
|
-
import {
|
|
163
|
-
import {
|
|
164
|
-
import {
|
|
165
|
-
import {
|
|
166
|
-
import {
|
|
167
|
-
import {
|
|
168
|
-
import {
|
|
169
|
-
import {
|
|
170
|
-
import {
|
|
171
|
-
import {
|
|
172
|
-
import {
|
|
173
|
-
import {
|
|
174
|
-
import {
|
|
175
|
-
import {
|
|
176
|
-
import {
|
|
145
|
+
import { calculateFitScale as Kf } from "./utils/fitScale.js";
|
|
146
|
+
import { checkCollision as Xf, constrainPosition as Zf, findFreePosition as Qf, hasCollision as Yf, sameGridPosition as qf } from "./utils/gridCollision.js";
|
|
147
|
+
import { classifyArchiveFileName as Jf } from "./components/file-browser/archiveFiles.js";
|
|
148
|
+
import { clientToCanvasLocal as ed, clientToCanvasWorld as od, createViewportFromZoomAnchor as rd, isPointInsideCanvasRect as td, localToCanvasWorld as id } from "./components/ui/canvasGeometry.js";
|
|
149
|
+
import { cn as ad } from "./utils/cn.js";
|
|
150
|
+
import { computeCodeDiff as ld, computeCodeDiffSync as md, configureDiffWorker as sd, createDiffWorker as pd, hasDiffWorker as fd, terminateDiffWorker as dd, waitForDiffWorker as Td } from "./components/chat/hooks/useCodeDiff.js";
|
|
151
|
+
import { configureMarkdownWorker as Id, createMarkdownWorker as xd, hasMarkdownWorker as Cd, renderMarkdown as ud, renderMarkdownSync as gd, terminateMarkdownWorker as hd, waitForMarkdownWorker as kd } from "./components/chat/hooks/useMarkdown.js";
|
|
152
|
+
import { configureMermaidWorker as Ed, configureSyncMermaid as Pd, renderMermaid as Ad, terminateMermaidWorker as Ld, useMermaid as _d } from "./components/chat/hooks/useMermaid.js";
|
|
153
|
+
import { configureShikiWorker as Rd, configureSyncHighlighter as yd, highlightCode as vd, terminateShikiWorker as Bd, useCodeHighlight as Md } from "./components/chat/hooks/useCodeHighlight.js";
|
|
154
|
+
import { createFloatingPresence as Wd } from "./components/ui/floatingPresence.js";
|
|
155
|
+
import { createLongPressContextMenuHandlers as bd } from "./components/file-browser/longPressContextMenu.js";
|
|
156
|
+
import { createSimpleContext as Ud } from "./context/createSimpleContext.js";
|
|
157
|
+
import { createUIFirstSelection as Gd } from "./utils/uiFirstSelection.js";
|
|
158
|
+
import { deferAfterPaint as Kd, deferNonBlocking as zd } from "./utils/defer.js";
|
|
159
|
+
import { duration as Zd, easing as Qd, fadeIn as Yd, listContainer as qd, listItem as jd, panelResize as Jd, popIn as $d, scaleIn as eT, sidebarVariants as oT, slideInFromBottom as rT, slideInFromLeft as tT, slideInFromRight as iT, slideInFromTop as nT, springConfig as aT } from "./utils/animations.js";
|
|
160
|
+
import { formatKeybind as lT, isMacLikePlatform as mT, isPrimaryModKeyPressed as sT, matchKeybind as pT, parseKeybind as fT } from "./utils/keybind.js";
|
|
161
|
+
import { intersectSurfaceRects as TT } from "./components/ui/surfaceFloatingBoundary.js";
|
|
162
|
+
import { isTypingElement as IT, shouldIgnoreHotkeys as xT } from "./utils/dom.js";
|
|
163
|
+
import { lockBodyStyle as uT } from "./utils/bodyStyleLock.js";
|
|
164
|
+
import { registerCommandContributions as hT, useCommandContributions as kT } from "./hooks/useCommandContributions.js";
|
|
165
|
+
import { resolveFloatingWindowViewport as ET } from "./components/ui/floatingWindowGeometry.js";
|
|
166
|
+
import { secureRandomUUID as AT } from "./utils/secureRandom.js";
|
|
167
|
+
import { startPointerSession as _T } from "./components/ui/pointerSession.js";
|
|
168
|
+
import { useAttachments as RT } from "./components/chat/hooks/useAttachments.js";
|
|
169
|
+
import { useAutoScroll as vT } from "./components/chat/hooks/useAutoScroll.js";
|
|
170
|
+
import { useDebounce as MT } from "./hooks/useDebounce.js";
|
|
171
|
+
import { useDeckDrag as WT } from "./hooks/useDeckDrag.js";
|
|
172
|
+
import { useFileBrowserDropTarget as bT, useFileBrowserItemDrag as wT } from "./hooks/useFileBrowserDrag.js";
|
|
173
|
+
import { useKeybind as HT } from "./hooks/useKeybind.js";
|
|
174
|
+
import { useMediaQuery as VT } from "./hooks/useMediaQuery.js";
|
|
175
|
+
import { usePersisted as zT } from "./hooks/usePersisted.js";
|
|
176
|
+
import { useResizeObserver as ZT } from "./hooks/useResizeObserver.js";
|
|
177
|
+
import { useVirtualList as YT } from "./components/chat/hooks/useVirtualList.js";
|
|
177
178
|
export {
|
|
178
179
|
_ as Activity,
|
|
179
180
|
Zt as ActivityAppsMain,
|
|
@@ -639,37 +640,38 @@ export {
|
|
|
639
640
|
Uf as buildAssistantNoticeEvents,
|
|
640
641
|
Xi as builtInShellThemePresets,
|
|
641
642
|
c as builtInThemes,
|
|
643
|
+
Kf as calculateFitScale,
|
|
642
644
|
es as centerViewportOnWorldPoint,
|
|
643
|
-
|
|
645
|
+
Xf as checkCollision,
|
|
644
646
|
os as clampScale,
|
|
645
647
|
It as clampTerminalCursor,
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
648
|
+
Jf as classifyArchiveFileName,
|
|
649
|
+
ed as clientToCanvasLocal,
|
|
650
|
+
od as clientToCanvasWorld,
|
|
651
|
+
ad as cn,
|
|
650
652
|
rs as computeBoardBounds,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
653
|
+
ld as computeCodeDiff,
|
|
654
|
+
md as computeCodeDiffSync,
|
|
655
|
+
sd as configureDiffWorker,
|
|
656
|
+
Id as configureMarkdownWorker,
|
|
657
|
+
Ed as configureMermaidWorker,
|
|
658
|
+
Rd as configureShikiWorker,
|
|
659
|
+
yd as configureSyncHighlighter,
|
|
660
|
+
Pd as configureSyncMermaid,
|
|
661
|
+
Zf as constrainPosition,
|
|
660
662
|
oa as createCommandService,
|
|
661
663
|
na as createComponentRegistry,
|
|
662
664
|
Za as createDeckService,
|
|
663
665
|
ts as createDefaultNotesSnapshot,
|
|
664
|
-
|
|
666
|
+
pd as createDiffWorker,
|
|
665
667
|
Hs as createFilesystemPickerDataSource,
|
|
666
|
-
|
|
668
|
+
Wd as createFloatingPresence,
|
|
667
669
|
sm as createLayoutService,
|
|
668
|
-
|
|
669
|
-
|
|
670
|
+
bd as createLongPressContextMenuHandlers,
|
|
671
|
+
xd as createMarkdownWorker,
|
|
670
672
|
ys as createNotificationService,
|
|
671
673
|
Zi as createShellThemePreset,
|
|
672
|
-
|
|
674
|
+
Ud as createSimpleContext,
|
|
673
675
|
Hf as createStreamEventBuilder,
|
|
674
676
|
xt as createTerminalEditorState,
|
|
675
677
|
Wt as createTerminalFullLineSuggestion,
|
|
@@ -677,19 +679,19 @@ export {
|
|
|
677
679
|
Nt as createTerminalTokenSuggestion,
|
|
678
680
|
Kp as createTerminalWidget,
|
|
679
681
|
Yp as createThemeService,
|
|
680
|
-
|
|
681
|
-
|
|
682
|
+
Gd as createUIFirstSelection,
|
|
683
|
+
rd as createViewportFromZoomAnchor,
|
|
682
684
|
uf as createWidgetRegistry,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
+
Kd as deferAfterPaint,
|
|
686
|
+
zd as deferNonBlocking,
|
|
685
687
|
Ct as deleteTerminalTextBackward,
|
|
686
688
|
Pt as dispatchTerminalSessionKey,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
+
Zd as duration,
|
|
690
|
+
Qd as easing,
|
|
689
691
|
ya as ensureSurfacePortalInteractionTracking,
|
|
690
692
|
zm as estimateNotesContextMenuHeight,
|
|
691
|
-
|
|
692
|
-
|
|
693
|
+
Yd as fadeIn,
|
|
694
|
+
Qf as findFreePosition,
|
|
693
695
|
I as floeColorTokenCategories,
|
|
694
696
|
x as floeDesignTokens,
|
|
695
697
|
C as floeFontFamilyTokens,
|
|
@@ -701,7 +703,7 @@ export {
|
|
|
701
703
|
E as floeThemeColorVariables,
|
|
702
704
|
P as floeTypographyTokens,
|
|
703
705
|
Cm as focusMenuItem,
|
|
704
|
-
|
|
706
|
+
lT as formatKeybind,
|
|
705
707
|
Gs as formatPickerPath,
|
|
706
708
|
vi as getFileIcon,
|
|
707
709
|
A as getFloeColorTokenValue,
|
|
@@ -715,28 +717,28 @@ export {
|
|
|
715
717
|
bt as getTerminalSuggestions,
|
|
716
718
|
is as groupTrashItems,
|
|
717
719
|
gm as handleMenuKeyboardNavigation,
|
|
718
|
-
|
|
720
|
+
Yf as hasCollision,
|
|
719
721
|
aa as hasComponentRegistryContext,
|
|
720
|
-
|
|
722
|
+
fd as hasDiffWorker,
|
|
721
723
|
jc as hasFileBrowserDragContext,
|
|
722
|
-
|
|
723
|
-
|
|
724
|
+
Cd as hasMarkdownWorker,
|
|
725
|
+
vd as highlightCode,
|
|
724
726
|
ut as insertTerminalText,
|
|
725
|
-
|
|
727
|
+
TT as intersectSurfaceRects,
|
|
726
728
|
m as isFloeSurfaceStyle,
|
|
727
729
|
kn as isLocalInteractionSurfaceTarget,
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
730
|
+
mT as isMacLikePlatform,
|
|
731
|
+
td as isPointInsideCanvasRect,
|
|
732
|
+
sT as isPrimaryModKeyPressed,
|
|
731
733
|
Gf as isStreamEvent,
|
|
732
734
|
va as isSurfacePortalMode,
|
|
733
735
|
s as isThemeType,
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
736
|
+
IT as isTypingElement,
|
|
737
|
+
qd as listContainer,
|
|
738
|
+
jd as listItem,
|
|
739
|
+
id as localToCanvasWorld,
|
|
740
|
+
uT as lockBodyStyle,
|
|
741
|
+
pT as matchKeybind,
|
|
740
742
|
wt as matchesTerminalSuggestionPrefix,
|
|
741
743
|
ns as mergeBoardBounds,
|
|
742
744
|
p as mergeThemeTokenMaps,
|
|
@@ -749,29 +751,29 @@ export {
|
|
|
749
751
|
Yi as normalizeShellThemeSelection,
|
|
750
752
|
Tt as normalizeTerminalWorkspaceProfile,
|
|
751
753
|
ls as noteBucketMetrics,
|
|
752
|
-
|
|
753
|
-
|
|
754
|
+
Jd as panelResize,
|
|
755
|
+
fT as parseKeybind,
|
|
754
756
|
Vs as parsePickerPath,
|
|
755
757
|
Ut as parseTerminalSuggestionContext,
|
|
756
758
|
Wf as pixelDeltaToGridDelta,
|
|
757
|
-
|
|
759
|
+
$d as popIn,
|
|
758
760
|
Nf as positionToGridArea,
|
|
759
761
|
qi as presetSupportsMode,
|
|
760
762
|
Ba as projectSurfacePortalPosition,
|
|
761
763
|
Ma as projectSurfacePortalRect,
|
|
762
764
|
ms as promoteLocalItem,
|
|
763
|
-
|
|
765
|
+
hT as registerCommandContributions,
|
|
764
766
|
ss as removeSnapshotItem,
|
|
765
767
|
ps as removeSnapshotTopic,
|
|
766
768
|
fs as removeSnapshotTrashItem,
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
769
|
+
ud as renderMarkdown,
|
|
770
|
+
gd as renderMarkdownSync,
|
|
771
|
+
Ad as renderMermaid,
|
|
770
772
|
ds as replaceSnapshotItem,
|
|
771
773
|
Ts as replaceSnapshotTopic,
|
|
772
774
|
Ss as replaceSnapshotTrashItem,
|
|
773
775
|
Bi as resolveFileItemIcon,
|
|
774
|
-
|
|
776
|
+
ET as resolveFloatingWindowViewport,
|
|
775
777
|
ji as resolveShellThemePresetName,
|
|
776
778
|
Fn as resolveSurfaceInteractionTargetRole,
|
|
777
779
|
Oa as resolveSurfacePortalBoundaryRect,
|
|
@@ -785,23 +787,23 @@ export {
|
|
|
785
787
|
An as resolveWorkbenchWidgetLocalTypingTarget,
|
|
786
788
|
Ln as resolveWorkbenchWidgetTextSelectionTarget,
|
|
787
789
|
yt as runTerminalMockCommand,
|
|
788
|
-
|
|
790
|
+
qf as sameGridPosition,
|
|
789
791
|
mc as sanitizeDisplayMode,
|
|
790
|
-
|
|
792
|
+
eT as scaleIn,
|
|
791
793
|
Is as screenToWorld,
|
|
792
|
-
|
|
794
|
+
AT as secureRandomUUID,
|
|
793
795
|
_t as setTerminalSessionInputValue,
|
|
794
796
|
_n as shouldActivateWorkbenchWidgetLocalTarget,
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
797
|
+
xT as shouldIgnoreHotkeys,
|
|
798
|
+
oT as sidebarVariants,
|
|
799
|
+
rT as slideInFromBottom,
|
|
800
|
+
tT as slideInFromLeft,
|
|
801
|
+
iT as slideInFromRight,
|
|
802
|
+
nT as slideInFromTop,
|
|
801
803
|
bf as snapToGrid,
|
|
802
|
-
|
|
804
|
+
aT as springConfig,
|
|
803
805
|
Gc as startHotInteraction,
|
|
804
|
-
|
|
806
|
+
_T as startPointerSession,
|
|
805
807
|
Dt as submitTerminalSession,
|
|
806
808
|
T as syncThemeTokenOverrides,
|
|
807
809
|
Ht as terminalCommandTokenSuggestionProvider,
|
|
@@ -809,48 +811,48 @@ export {
|
|
|
809
811
|
Vt as terminalPathSuggestionProvider,
|
|
810
812
|
Kt as terminalRootSuggestionProvider,
|
|
811
813
|
zt as terminalSnippetSuggestionProvider,
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
814
|
+
dd as terminateDiffWorker,
|
|
815
|
+
hd as terminateMarkdownWorker,
|
|
816
|
+
Ld as terminateMermaidWorker,
|
|
817
|
+
Bd as terminateShikiWorker,
|
|
816
818
|
Sl as updateFileOpenSelection,
|
|
817
|
-
|
|
818
|
-
|
|
819
|
+
RT as useAttachments,
|
|
820
|
+
vT as useAutoScroll,
|
|
819
821
|
On as useChatContext,
|
|
820
|
-
|
|
822
|
+
Md as useCodeHighlight,
|
|
821
823
|
ra as useCommand,
|
|
822
|
-
|
|
824
|
+
kT as useCommandContributions,
|
|
823
825
|
ca as useComponentContextFactory,
|
|
824
826
|
la as useComponentRegistry,
|
|
825
827
|
Pf as useCurrentWidgetId,
|
|
826
|
-
|
|
828
|
+
MT as useDebounce,
|
|
827
829
|
Qa as useDeck,
|
|
828
|
-
|
|
830
|
+
WT as useDeckDrag,
|
|
829
831
|
ol as useFileBrowser,
|
|
830
832
|
Jc as useFileBrowserDrag,
|
|
831
|
-
|
|
832
|
-
|
|
833
|
+
bT as useFileBrowserDropTarget,
|
|
834
|
+
wT as useFileBrowserItemDrag,
|
|
833
835
|
ha as useFloeConfig,
|
|
834
836
|
Vl as useFormSubmitting,
|
|
835
|
-
|
|
837
|
+
HT as useKeybind,
|
|
836
838
|
pm as useLayout,
|
|
837
|
-
|
|
838
|
-
|
|
839
|
+
VT as useMediaQuery,
|
|
840
|
+
_d as useMermaid,
|
|
839
841
|
vs as useNotification,
|
|
840
842
|
ma as useOptionalComponentRegistry,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
+
zT as usePersisted,
|
|
844
|
+
ZT as useResizeObserver,
|
|
843
845
|
ka as useResolvedFloeConfig,
|
|
844
846
|
qp as useTheme,
|
|
845
847
|
sf as useViewActivation,
|
|
846
|
-
|
|
848
|
+
YT as useVirtualList,
|
|
847
849
|
gf as useWidgetRegistry,
|
|
848
850
|
Af as useWidgetState,
|
|
849
851
|
Lf as useWidgetStateContext,
|
|
850
852
|
Ep as useWizard,
|
|
851
853
|
xs as visibleWorldRect,
|
|
852
|
-
|
|
853
|
-
|
|
854
|
+
Td as waitForDiffWorker,
|
|
855
|
+
kd as waitForMarkdownWorker,
|
|
854
856
|
Cs as worldToScreen,
|
|
855
857
|
us as zoomViewportAtPoint
|
|
856
858
|
};
|
|
@@ -4,6 +4,7 @@ export interface Size {
|
|
|
4
4
|
height: number;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Track
|
|
7
|
+
* Track the usable content box in local CSS pixels, excluding padding and
|
|
8
|
+
* scrollbars. CSS transforms on the element or its ancestors do not affect it.
|
|
8
9
|
*/
|
|
9
10
|
export declare function useResizeObserver(element: Accessor<HTMLElement | null | undefined>): Accessor<Size | null>;
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
function
|
|
3
|
-
const [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
typeof window < "u" && (window.addEventListener("resize", t), s(() => window.removeEventListener("resize", t)));
|
|
1
|
+
import { createSignal as u, createEffect as h, onCleanup as s } from "solid-js";
|
|
2
|
+
function f(d) {
|
|
3
|
+
const [a, r] = u(null, {
|
|
4
|
+
equals: (e, t) => e?.width === t?.width && e?.height === t?.height
|
|
5
|
+
});
|
|
6
|
+
return h(() => {
|
|
7
|
+
const e = d();
|
|
8
|
+
if (!e) {
|
|
9
|
+
r(null);
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
13
|
-
const
|
|
14
|
-
const i =
|
|
15
|
-
|
|
16
|
-
width: i.
|
|
17
|
-
height: i.
|
|
12
|
+
const t = () => {
|
|
13
|
+
const n = e.ownerDocument.defaultView.getComputedStyle(e), i = (c) => Number.parseFloat(c) || 0;
|
|
14
|
+
r({
|
|
15
|
+
width: Math.max(0, e.clientWidth - i(n.paddingLeft) - i(n.paddingRight)),
|
|
16
|
+
height: Math.max(0, e.clientHeight - i(n.paddingTop) - i(n.paddingBottom))
|
|
18
17
|
});
|
|
19
|
-
}
|
|
18
|
+
};
|
|
19
|
+
if (t(), typeof ResizeObserver > "u") {
|
|
20
|
+
typeof window < "u" && (window.addEventListener("resize", t), s(() => window.removeEventListener("resize", t)));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const o = new ResizeObserver(t);
|
|
20
24
|
o.observe(e), s(() => o.disconnect());
|
|
21
|
-
}),
|
|
25
|
+
}), a;
|
|
22
26
|
}
|
|
23
27
|
export {
|
|
24
|
-
|
|
28
|
+
f as useResizeObserver
|
|
25
29
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
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
3
|
import { floeColorTokenCategories as g, floeDesignTokens as x, floeFontFamilyTokens as y, floeMotionTokens as C, floeRadiusTokens as h, floeSharedCssVariables as S, floeSpacingTokens as F, floeSurfaceTokens as v, floeThemeColorVariables as P, floeTypographyTokens as k, getFloeColorTokenValue as I } 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";
|
|
@@ -8,31 +8,32 @@ 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
|
|
11
|
+
import { LayoutProvider as de, createLayoutService as Te, useLayout as ce } from "./context/LayoutContext.js";
|
|
12
12
|
import { NotificationContainer as ge, NotificationProvider as xe, createNotificationService as ye, useNotification as Ce } from "./context/NotificationContext.js";
|
|
13
13
|
import { ThemeProvider as Se, createThemeService as Fe, useTheme as ve } from "./context/ThemeContext.js";
|
|
14
14
|
import { ViewActivationProvider as ke, useViewActivation as Ie } from "./context/ViewActivationContext.js";
|
|
15
15
|
import { WidgetRegistryProvider as De, createWidgetRegistry as Ee, useWidgetRegistry as be } from "./context/WidgetRegistry.js";
|
|
16
16
|
import { WidgetStateProvider as _e, useCurrentWidgetId as Ae, useWidgetState as Ne, useWidgetStateContext as Oe } from "./context/WidgetStateContext.js";
|
|
17
17
|
import { applyDragDelta as Be, applyResizeDelta as Ue, getGridCellSize as we, pixelDeltaToGridDelta as Ge, positionToGridArea as He, snapToGrid as We } from "./utils/gridLayout.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
18
|
+
import { calculateFitScale as Ve } from "./utils/fitScale.js";
|
|
19
|
+
import { checkCollision as Qe, constrainPosition as qe, findFreePosition as Ye, hasCollision as je, sameGridPosition as Je } from "./utils/gridCollision.js";
|
|
20
|
+
import { cn as Ze } from "./utils/cn.js";
|
|
21
|
+
import { createSimpleContext as eo } from "./context/createSimpleContext.js";
|
|
22
|
+
import { createUIFirstSelection as ro } from "./utils/uiFirstSelection.js";
|
|
23
|
+
import { deferAfterPaint as io, deferNonBlocking as so } from "./utils/defer.js";
|
|
24
|
+
import { duration as ao, easing as mo, fadeIn as lo, listContainer as po, listItem as fo, panelResize as To, popIn as co, scaleIn as uo, sidebarVariants as go, slideInFromBottom as xo, slideInFromLeft as yo, slideInFromRight as Co, slideInFromTop as ho, springConfig as So } from "./utils/animations.js";
|
|
25
|
+
import { formatKeybind as vo, isMacLikePlatform as Po, isPrimaryModKeyPressed as ko, matchKeybind as Io, parseKeybind as Ro } from "./utils/keybind.js";
|
|
26
|
+
import { isTypingElement as Eo, shouldIgnoreHotkeys as bo } from "./utils/dom.js";
|
|
27
|
+
import { lockBodyStyle as _o } from "./utils/bodyStyleLock.js";
|
|
28
|
+
import { registerCommandContributions as No, useCommandContributions as Oo } from "./hooks/useCommandContributions.js";
|
|
29
|
+
import { secureRandomUUID as Bo } from "./utils/secureRandom.js";
|
|
30
|
+
import { useDebounce as wo } from "./hooks/useDebounce.js";
|
|
31
|
+
import { useDeckDrag as Ho } from "./hooks/useDeckDrag.js";
|
|
32
|
+
import { useFileBrowserDropTarget as Ko, useFileBrowserItemDrag as Vo } from "./hooks/useFileBrowserDrag.js";
|
|
33
|
+
import { useKeybind as Qo } from "./hooks/useKeybind.js";
|
|
34
|
+
import { useMediaQuery as Yo } from "./hooks/useMediaQuery.js";
|
|
35
|
+
import { usePersisted as Jo } from "./hooks/usePersisted.js";
|
|
36
|
+
import { useResizeObserver as Zo } from "./hooks/useResizeObserver.js";
|
|
36
37
|
export {
|
|
37
38
|
D as BUILT_IN_SHELL_THEME_DEFAULTS,
|
|
38
39
|
U as CommandProvider,
|
|
@@ -60,25 +61,26 @@ export {
|
|
|
60
61
|
b as assertUniqueThemePresetNames,
|
|
61
62
|
L as builtInShellThemePresets,
|
|
62
63
|
a as builtInThemes,
|
|
63
|
-
Ve as
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
Ve as calculateFitScale,
|
|
65
|
+
Qe as checkCollision,
|
|
66
|
+
Ze as cn,
|
|
67
|
+
qe as constrainPosition,
|
|
66
68
|
w as createCommandService,
|
|
67
69
|
K as createComponentRegistry,
|
|
68
70
|
oe as createDeckService,
|
|
69
71
|
Te as createLayoutService,
|
|
70
72
|
ye as createNotificationService,
|
|
71
73
|
_ as createShellThemePreset,
|
|
72
|
-
|
|
74
|
+
eo as createSimpleContext,
|
|
73
75
|
Fe as createThemeService,
|
|
74
|
-
|
|
76
|
+
ro as createUIFirstSelection,
|
|
75
77
|
Ee as createWidgetRegistry,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
io as deferAfterPaint,
|
|
79
|
+
so as deferNonBlocking,
|
|
80
|
+
ao as duration,
|
|
81
|
+
mo as easing,
|
|
82
|
+
lo as fadeIn,
|
|
83
|
+
Ye as findFreePosition,
|
|
82
84
|
g as floeColorTokenCategories,
|
|
83
85
|
x as floeDesignTokens,
|
|
84
86
|
y as floeFontFamilyTokens,
|
|
@@ -89,67 +91,67 @@ export {
|
|
|
89
91
|
v as floeSurfaceTokens,
|
|
90
92
|
P as floeThemeColorVariables,
|
|
91
93
|
k as floeTypographyTokens,
|
|
92
|
-
|
|
94
|
+
vo as formatKeybind,
|
|
93
95
|
I as getFloeColorTokenValue,
|
|
94
96
|
we as getGridCellSize,
|
|
95
97
|
A as getShellThemePresetsForMode,
|
|
96
98
|
m as getSystemTheme,
|
|
97
|
-
|
|
99
|
+
je as hasCollision,
|
|
98
100
|
V as hasComponentRegistryContext,
|
|
99
101
|
le as hasFileBrowserDragContext,
|
|
100
102
|
l as isFloeSurfaceStyle,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
Po as isMacLikePlatform,
|
|
104
|
+
ko as isPrimaryModKeyPressed,
|
|
103
105
|
p as isThemeType,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
Eo as isTypingElement,
|
|
107
|
+
po as listContainer,
|
|
108
|
+
fo as listItem,
|
|
109
|
+
_o as lockBodyStyle,
|
|
110
|
+
Io as matchKeybind,
|
|
109
111
|
f as mergeThemeTokenMaps,
|
|
110
112
|
N as normalizeShellThemeSelection,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
To as panelResize,
|
|
114
|
+
Ro as parseKeybind,
|
|
113
115
|
Ge as pixelDeltaToGridDelta,
|
|
114
|
-
|
|
116
|
+
co as popIn,
|
|
115
117
|
He as positionToGridArea,
|
|
116
118
|
O as presetSupportsMode,
|
|
117
|
-
|
|
119
|
+
No as registerCommandContributions,
|
|
118
120
|
M as resolveShellThemePresetName,
|
|
119
121
|
d as resolveThemeTokenOverrides,
|
|
120
122
|
T as resolveThemeTokens,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
Je as sameGridPosition,
|
|
124
|
+
uo as scaleIn,
|
|
125
|
+
Bo as secureRandomUUID,
|
|
126
|
+
bo as shouldIgnoreHotkeys,
|
|
127
|
+
go as sidebarVariants,
|
|
128
|
+
xo as slideInFromBottom,
|
|
129
|
+
yo as slideInFromLeft,
|
|
130
|
+
Co as slideInFromRight,
|
|
131
|
+
ho as slideInFromTop,
|
|
130
132
|
We as snapToGrid,
|
|
131
|
-
|
|
133
|
+
So as springConfig,
|
|
132
134
|
ne as startHotInteraction,
|
|
133
|
-
|
|
135
|
+
c as syncThemeTokenOverrides,
|
|
134
136
|
G as useCommand,
|
|
135
|
-
|
|
137
|
+
Oo as useCommandContributions,
|
|
136
138
|
z as useComponentContextFactory,
|
|
137
139
|
Q as useComponentRegistry,
|
|
138
140
|
Ae as useCurrentWidgetId,
|
|
139
|
-
|
|
141
|
+
wo as useDebounce,
|
|
140
142
|
re as useDeck,
|
|
141
|
-
|
|
143
|
+
Ho as useDeckDrag,
|
|
142
144
|
pe as useFileBrowserDrag,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
Ko as useFileBrowserDropTarget,
|
|
146
|
+
Vo as useFileBrowserItemDrag,
|
|
145
147
|
X as useFloeConfig,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
Qo as useKeybind,
|
|
149
|
+
ce as useLayout,
|
|
150
|
+
Yo as useMediaQuery,
|
|
149
151
|
Ce as useNotification,
|
|
150
152
|
q as useOptionalComponentRegistry,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
Jo as usePersisted,
|
|
154
|
+
Zo as useResizeObserver,
|
|
153
155
|
Z as useResolvedFloeConfig,
|
|
154
156
|
ve as useTheme,
|
|
155
157
|
Ie as useViewActivation,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FitScaleSize {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
/** Fit local content dimensions without capping enlargement or rounding scale. */
|
|
6
|
+
export declare function calculateFitScale(options: {
|
|
7
|
+
content: FitScaleSize;
|
|
8
|
+
viewport: FitScaleSize;
|
|
9
|
+
mode: 'contain' | 'width';
|
|
10
|
+
}): number | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function c(n) {
|
|
2
|
+
const { content: t, viewport: i, mode: r } = n;
|
|
3
|
+
if (![t.width, t.height, i.width, i.height].every((h) => Number.isFinite(h) && h > 0)) return null;
|
|
4
|
+
const e = r === "width" ? i.width / t.width : Math.min(i.width / t.width, i.height / t.height);
|
|
5
|
+
return Number.isFinite(e) && e > 0 ? e : null;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
c as calculateFitScale
|
|
9
|
+
};
|
package/dist/utils/index.d.ts
CHANGED