@sprawlify/solid 0.0.16 → 0.0.18
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/{collapsible-sG-Rzvf2.jsx → collapsible-14K1NkX_.jsx} +8 -8
- package/dist/{collapsible-CX2tnXKq.js → collapsible-BT7AHLQr.js} +8 -8
- package/dist/{collection-zj3lxnwW.js → collection-BVSLJ8Vb.js} +2 -2
- package/dist/{collection-BRr4O2_i.jsx → collection-CIXQG-Ne.jsx} +2 -2
- package/dist/components/accordion/index.d.ts +11 -11
- package/dist/components/accordion/index.js +9 -9
- package/dist/components/accordion/index.jsx +9 -9
- package/dist/components/angle-slider/index.d.ts +13 -13
- package/dist/components/angle-slider/index.js +7 -7
- package/dist/components/angle-slider/index.jsx +7 -7
- package/dist/components/avatar/index.d.ts +8 -8
- package/dist/components/avatar/index.js +7 -7
- package/dist/components/avatar/index.jsx +7 -7
- package/dist/components/bottom-sheet/index.d.ts +13 -13
- package/dist/components/bottom-sheet/index.js +10 -10
- package/dist/components/bottom-sheet/index.jsx +10 -10
- package/dist/components/carousel/index.d.ts +17 -17
- package/dist/components/carousel/index.js +7 -7
- package/dist/components/carousel/index.jsx +7 -7
- package/dist/components/checkbox/index.d.ts +13 -13
- package/dist/components/checkbox/index.js +10 -10
- package/dist/components/checkbox/index.jsx +10 -10
- package/dist/components/clipboard/index.d.ts +11 -11
- package/dist/components/clipboard/index.js +7 -7
- package/dist/components/clipboard/index.jsx +7 -7
- package/dist/components/collapsible/index.d.ts +10 -10
- package/dist/components/collapsible/index.js +7 -7
- package/dist/components/collapsible/index.jsx +7 -7
- package/dist/components/collection/index.d.ts +2 -2
- package/dist/components/collection/index.js +2 -2
- package/dist/components/collection/index.jsx +2 -2
- package/dist/components/color-picker/index.d.ts +35 -35
- package/dist/components/color-picker/index.js +12 -12
- package/dist/components/color-picker/index.jsx +12 -12
- package/dist/components/combobox/index.d.ts +22 -22
- package/dist/components/combobox/index.js +13 -13
- package/dist/components/combobox/index.jsx +13 -13
- package/dist/components/date-picker/index.d.ts +33 -33
- package/dist/components/date-picker/index.js +10 -10
- package/dist/components/date-picker/index.jsx +10 -10
- package/dist/components/dialog/index.d.ts +13 -13
- package/dist/components/dialog/index.js +10 -10
- package/dist/components/dialog/index.jsx +10 -10
- package/dist/components/download-trigger/index.d.ts +3 -3
- package/dist/components/download-trigger/index.js +5 -5
- package/dist/components/download-trigger/index.jsx +5 -5
- package/dist/components/editable/index.d.ts +14 -14
- package/dist/components/editable/index.js +10 -10
- package/dist/components/editable/index.jsx +10 -10
- package/dist/components/field/index.d.ts +14 -14
- package/dist/components/field/index.js +8 -8
- package/dist/components/field/index.jsx +8 -8
- package/dist/components/fieldset/index.d.ts +12 -12
- package/dist/components/fieldset/index.js +7 -7
- package/dist/components/fieldset/index.jsx +7 -7
- package/dist/components/file-upload/index.d.ts +102 -0
- package/dist/components/file-upload/index.js +284 -0
- package/dist/components/file-upload/index.jsx +255 -0
- package/dist/components/floating-panel/index.d.ts +100 -0
- package/dist/components/floating-panel/index.js +246 -0
- package/dist/components/floating-panel/index.jsx +217 -0
- package/dist/components/focus-trap/index.d.ts +17 -0
- package/dist/components/focus-trap/index.js +34 -0
- package/dist/components/focus-trap/index.jsx +30 -0
- package/dist/components/format/index.d.ts +27 -0
- package/dist/components/format/index.js +46 -0
- package/dist/components/format/index.jsx +48 -0
- package/dist/components/frame/index.d.ts +13 -0
- package/dist/components/frame/index.js +121 -0
- package/dist/components/frame/index.jsx +86 -0
- package/dist/components/highlight/index.d.ts +3 -3
- package/dist/components/highlight/index.js +3 -3
- package/dist/components/highlight/index.jsx +3 -3
- package/dist/components/hover-card/index.d.ts +70 -0
- package/dist/components/hover-card/index.js +168 -0
- package/dist/components/hover-card/index.jsx +136 -0
- package/dist/components/image-cropper/index.d.ts +64 -0
- package/dist/components/image-cropper/index.js +151 -0
- package/dist/components/image-cropper/index.jsx +144 -0
- package/dist/components/json-tree-view/index.d.ts +56 -0
- package/dist/components/json-tree-view/index.js +330 -0
- package/dist/components/json-tree-view/index.jsx +204 -0
- package/dist/components/listbox/index.d.ts +114 -0
- package/dist/components/listbox/index.js +261 -0
- package/dist/components/listbox/index.jsx +236 -0
- package/dist/components/marquee/index.d.ts +59 -0
- package/dist/components/marquee/index.js +138 -0
- package/dist/components/marquee/index.jsx +126 -0
- package/dist/components/menu/index.d.ts +161 -0
- package/dist/components/menu/index.js +471 -0
- package/dist/components/menu/index.jsx +392 -0
- package/dist/components/navigation-menu/index.d.ts +90 -0
- package/dist/components/navigation-menu/index.js +304 -0
- package/dist/components/navigation-menu/index.jsx +237 -0
- package/dist/components/number-input/index.d.ts +74 -0
- package/dist/components/number-input/index.js +182 -0
- package/dist/components/number-input/index.jsx +173 -0
- package/dist/components/pagination/index.d.ts +69 -0
- package/dist/components/pagination/index.js +146 -0
- package/dist/components/pagination/index.jsx +139 -0
- package/dist/components/password-input/index.d.ts +66 -0
- package/dist/components/password-input/index.js +159 -0
- package/dist/components/password-input/index.jsx +140 -0
- package/dist/components/pin-input/index.d.ts +59 -0
- package/dist/components/pin-input/index.js +151 -0
- package/dist/components/pin-input/index.jsx +142 -0
- package/dist/components/popover/index.d.ts +95 -0
- package/dist/components/popover/index.js +220 -0
- package/dist/components/popover/index.jsx +188 -0
- package/dist/components/presence/index.d.ts +4 -4
- package/dist/components/presence/index.js +7 -7
- package/dist/components/presence/index.jsx +7 -7
- package/dist/components/select/index.d.ts +22 -22
- package/dist/components/select/index.js +13 -13
- package/dist/components/select/index.jsx +13 -13
- package/dist/components/tree-view/index.d.ts +7 -0
- package/dist/components/tree-view/index.js +11 -0
- package/dist/components/tree-view/index.jsx +11 -0
- package/dist/{factory-Ch5jgk20.jsx → factory-BIJk1mK6.jsx} +1 -1
- package/dist/{factory-PGDAvOKb.js → factory-k8EbNZ7r.js} +1 -1
- package/dist/{factory-4A25bngy.d.ts → factory-srnAQg4A.d.ts} +6 -1
- package/dist/{field-CoYiA2ek.js → field-CZv3v7K-.js} +8 -8
- package/dist/{field-BRr9Zdes.jsx → field-CtkmPUb0.jsx} +8 -8
- package/dist/{fieldset-BrJqMLEd.js → fieldset-B2nK8dL5.js} +8 -8
- package/dist/{fieldset-B_LyllEa.jsx → fieldset-aYQsMWX2.jsx} +8 -8
- package/dist/{index-GEfvAmRc.d.ts → index-BwthXhaG.d.ts} +1 -1
- package/dist/index-Dl22eiVf.d.ts +143 -0
- package/dist/index-Dqmtlqpz.d.ts +143 -0
- package/dist/{index-j2avJy7D.d.ts → index-DylIyeqd.d.ts} +8 -8
- package/dist/index-utxtRaDW.d.ts +41 -0
- package/dist/{index-oc8gLl07.d.ts → index-w0NPbRP3.d.ts} +8 -8
- package/dist/index.d.ts +6 -44
- package/dist/index.js +6 -5
- package/dist/index.jsx +6 -5
- package/dist/{presence-BpwBRlZW.js → presence-Clrs1hmS.js} +7 -7
- package/dist/{presence-Bmn43U_q.jsx → presence-H4-8_5_s.jsx} +7 -7
- package/dist/{providers-DFaRRd80.jsx → providers-C6VPiSrB.jsx} +2 -2
- package/dist/{providers-Bo0OFe08.js → providers-DgUckEdb.js} +2 -2
- package/dist/{render-strategy-DFlz7Uc4.js → render-strategy-BlHCR8sl.js} +2 -2
- package/dist/{render-strategy-CdJhRv3I.jsx → render-strategy-KJFIjVVG.jsx} +2 -2
- package/dist/tree-view-CyvT0V14.js +318 -0
- package/dist/tree-view-DJgvku6y.jsx +291 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.jsx +2 -2
- package/package.json +97 -2
- /package/dist/{chunk-B5so6B0y.jsx → chunk-BJ7z6UrO.jsx} +0 -0
- /package/dist/{chunk-B93cd-Dz.js → chunk-Bn8mXcTA.js} +0 -0
- /package/dist/{compose-refs-BVVIB7xn.js → compose-refs-Cp4AShsY.jsx} +0 -0
- /package/dist/{compose-refs-icUeuyHm.jsx → compose-refs-tCBI7PRJ.js} +0 -0
- /package/dist/{core-DbInRfhI.jsx → core-CRjuRw95.js} +0 -0
- /package/dist/{core-oNB2jGcl.js → core-C_FYj4uc.jsx} +0 -0
- /package/dist/{create-context-C3rvZvkc.jsx → create-context-BwqlrMqL.jsx} +0 -0
- /package/dist/{create-context-GfQ_MylE.js → create-context-DlXBVMoq.js} +0 -0
- /package/dist/{create-split-props-B8A7_AF7.jsx → create-split-props-BHmgTHSf.js} +0 -0
- /package/dist/{create-split-props-pQu7jijw.js → create-split-props-CKwjjjkD.jsx} +0 -0
- /package/dist/{index-C7N791Fc.d.ts → index-BLALA3BS.d.ts} +0 -0
- /package/dist/{index-B6dBCfnB.d.ts → index-DiANe65S.d.ts} +0 -0
- /package/dist/{render-strategy-BNECKEQk.d.ts → render-strategy-BmTDUy3U.d.ts} +0 -0
- /package/dist/{run-if-fn-A3VwXy-o.jsx → run-if-fn-C80kt4dU.js} +0 -0
- /package/dist/{run-if-fn-D5794CxE.js → run-if-fn-CrJzzDIM.jsx} +0 -0
- /package/dist/{types-Dbw4va3W.d.ts → types-mGUbKy2h.d.ts} +0 -0
- /package/dist/{utils-DQi-Cen5.js → utils-DSmVDqW7.js} +0 -0
- /package/dist/{utils-vSjszv0W.jsx → utils-DhhcJyG-.jsx} +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-BJ7z6UrO.jsx";
|
|
2
|
+
import { i as useMachine, n as normalizeProps, r as mergeProps$1 } from "../../core-C_FYj4uc.jsx";
|
|
3
|
+
import { t as runIfFn } from "../../run-if-fn-CrJzzDIM.jsx";
|
|
4
|
+
import { t as createContext$1 } from "../../create-context-BwqlrMqL.jsx";
|
|
5
|
+
import { i as useLocaleContext, o as useEnvironmentContext } from "../../providers-C6VPiSrB.jsx";
|
|
6
|
+
import { t as sprawlify } from "../../factory-BIJk1mK6.jsx";
|
|
7
|
+
import { t as createSplitProps } from "../../create-split-props-CKwjjjkD.jsx";
|
|
8
|
+
import "../../render-strategy-KJFIjVVG.jsx";
|
|
9
|
+
import "../../compose-refs-Cp4AShsY.jsx";
|
|
10
|
+
import { a as splitPresenceProps, i as usePresence, n as usePresenceContext, t as PresenceProvider } from "../../presence-H4-8_5_s.jsx";
|
|
11
|
+
import { Show, createMemo, createUniqueId } from "solid-js";
|
|
12
|
+
import * as floatingPanel from "@sprawlify/primitives/machines/floating-panel";
|
|
13
|
+
import { anatomy as floatingPanelAnatomy } from "@sprawlify/primitives/machines/floating-panel";
|
|
14
|
+
|
|
15
|
+
//#region src/components/floating-panel/use-floating-panel-context.ts
|
|
16
|
+
const [FloatingPanelProvider, useFloatingPanelContext] = createContext$1({
|
|
17
|
+
hookName: "useFloatingPanelContext",
|
|
18
|
+
providerName: "<FloatingPanelProvider />"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/floating-panel/floating-panel-body.tsx
|
|
23
|
+
const FloatingPanelBody = (props) => {
|
|
24
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
25
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getBodyProps(), props);
|
|
26
|
+
return <sprawlify.div {...mergedProps} />;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/floating-panel/floating-panel-close-trigger.tsx
|
|
31
|
+
const FloatingPanelCloseTrigger = (props) => {
|
|
32
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
33
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getCloseTriggerProps(), props);
|
|
34
|
+
return <sprawlify.button {...mergedProps} />;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/floating-panel/floating-panel-content.tsx
|
|
39
|
+
const FloatingPanelContent = (props) => {
|
|
40
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
41
|
+
const presence = usePresenceContext();
|
|
42
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getContentProps(), () => presence().presenceProps, props);
|
|
43
|
+
return <Show when={!presence().unmounted}>
|
|
44
|
+
<sprawlify.div {...mergedProps} />
|
|
45
|
+
</Show>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/components/floating-panel/floating-panel-context.tsx
|
|
50
|
+
const FloatingPanelContext = (props) => props.children(useFloatingPanelContext());
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/floating-panel/floating-panel-drag-trigger.tsx
|
|
54
|
+
const FloatingPanelDragTrigger = (props) => {
|
|
55
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
56
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getDragTriggerProps(), props);
|
|
57
|
+
return <sprawlify.div {...mergedProps} />;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/components/floating-panel/floating-panel-header.tsx
|
|
62
|
+
const FloatingPanelHeader = (props) => {
|
|
63
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
64
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getHeaderProps(), props);
|
|
65
|
+
return <sprawlify.div {...mergedProps} />;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/floating-panel/floating-panel-positioner.tsx
|
|
70
|
+
const FloatingPanelPositioner = (props) => {
|
|
71
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
72
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getPositionerProps(), props);
|
|
73
|
+
const presence = usePresenceContext();
|
|
74
|
+
return <Show when={!presence().unmounted}>
|
|
75
|
+
<sprawlify.div {...mergedProps} />
|
|
76
|
+
</Show>;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/floating-panel/floating-panel-resize-trigger.tsx
|
|
81
|
+
const FloatingPanelResizeTrigger = (props) => {
|
|
82
|
+
const [resizeProps, localProps] = createSplitProps()(props, ["axis"]);
|
|
83
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
84
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getResizeTriggerProps(resizeProps), localProps);
|
|
85
|
+
return <sprawlify.div {...mergedProps} />;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/components/floating-panel/floating-panel-stage-trigger.tsx
|
|
90
|
+
const FloatingPanelStageTrigger = (props) => {
|
|
91
|
+
const [stage, localProps] = createSplitProps()(props, ["stage"]);
|
|
92
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
93
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getStageTriggerProps(stage), localProps);
|
|
94
|
+
return <sprawlify.button {...mergedProps} />;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/components/floating-panel/use-floating-panel.ts
|
|
99
|
+
const useFloatingPanel = (props = {}) => {
|
|
100
|
+
const env = useEnvironmentContext();
|
|
101
|
+
const locale = useLocaleContext();
|
|
102
|
+
const id = createUniqueId();
|
|
103
|
+
const machineProps = createMemo(() => ({
|
|
104
|
+
id,
|
|
105
|
+
dir: locale().dir,
|
|
106
|
+
getRootNode: env().getRootNode,
|
|
107
|
+
...runIfFn(props)
|
|
108
|
+
}));
|
|
109
|
+
const service = useMachine(floatingPanel.machine, machineProps);
|
|
110
|
+
return createMemo(() => floatingPanel.connect(service, normalizeProps));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/components/floating-panel/floating-panel-root.tsx
|
|
115
|
+
const FloatingPanelRoot = (props) => {
|
|
116
|
+
const [presenceProps, otherProps] = splitPresenceProps(props);
|
|
117
|
+
const [useFloatingPanelProps, localProps] = createSplitProps()(otherProps, [
|
|
118
|
+
"allowOverflow",
|
|
119
|
+
"closeOnEscape",
|
|
120
|
+
"defaultOpen",
|
|
121
|
+
"defaultPosition",
|
|
122
|
+
"defaultSize",
|
|
123
|
+
"dir",
|
|
124
|
+
"disabled",
|
|
125
|
+
"draggable",
|
|
126
|
+
"getAnchorPosition",
|
|
127
|
+
"getBoundaryEl",
|
|
128
|
+
"gridSize",
|
|
129
|
+
"id",
|
|
130
|
+
"ids",
|
|
131
|
+
"lockAspectRatio",
|
|
132
|
+
"maxSize",
|
|
133
|
+
"minSize",
|
|
134
|
+
"onOpenChange",
|
|
135
|
+
"onPositionChange",
|
|
136
|
+
"onPositionChangeEnd",
|
|
137
|
+
"onSizeChange",
|
|
138
|
+
"onSizeChangeEnd",
|
|
139
|
+
"onStageChange",
|
|
140
|
+
"open",
|
|
141
|
+
"persistRect",
|
|
142
|
+
"position",
|
|
143
|
+
"resizable",
|
|
144
|
+
"size",
|
|
145
|
+
"strategy",
|
|
146
|
+
"translations"
|
|
147
|
+
]);
|
|
148
|
+
const floatingPanel$1 = useFloatingPanel(useFloatingPanelProps);
|
|
149
|
+
const presence = usePresence(mergeProps$1(() => ({ present: floatingPanel$1().open }), presenceProps));
|
|
150
|
+
return <FloatingPanelProvider value={floatingPanel$1}>
|
|
151
|
+
<PresenceProvider value={presence}>{localProps.children}</PresenceProvider>
|
|
152
|
+
</FloatingPanelProvider>;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/components/floating-panel/floating-panel-root-provider.tsx
|
|
157
|
+
const FloatingPanelRootProvider = (props) => {
|
|
158
|
+
const [presenceProps, baseProps] = splitPresenceProps(props);
|
|
159
|
+
const [rootProps, localProps] = createSplitProps()(baseProps, ["value"]);
|
|
160
|
+
const presence = usePresence(mergeProps$1(() => ({ present: rootProps.value().open }), presenceProps));
|
|
161
|
+
return <FloatingPanelProvider value={rootProps.value}>
|
|
162
|
+
<PresenceProvider value={presence}>{localProps.children}</PresenceProvider>
|
|
163
|
+
</FloatingPanelProvider>;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/components/floating-panel/floating-panel-title.tsx
|
|
168
|
+
const FloatingPanelTitle = (props) => {
|
|
169
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
170
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getTitleProps(), props);
|
|
171
|
+
return <sprawlify.h2 {...mergedProps} />;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/components/floating-panel/floating-panel-trigger.tsx
|
|
176
|
+
const FloatingPanelTrigger = (props) => {
|
|
177
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
178
|
+
const presence = usePresenceContext();
|
|
179
|
+
const mergedProps = mergeProps$1(() => {
|
|
180
|
+
const triggerProps = floatingPanel$1().getTriggerProps();
|
|
181
|
+
return {
|
|
182
|
+
...triggerProps,
|
|
183
|
+
"aria-controls": presence().unmounted ? void 0 : triggerProps["aria-controls"]
|
|
184
|
+
};
|
|
185
|
+
}, props);
|
|
186
|
+
return <sprawlify.button {...mergedProps} />;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/components/floating-panel/floating-panel-control.tsx
|
|
191
|
+
const FloatingPanelControl = (props) => {
|
|
192
|
+
const floatingPanel$1 = useFloatingPanelContext();
|
|
193
|
+
const mergedProps = mergeProps$1(() => floatingPanel$1().getControlProps(), props);
|
|
194
|
+
return <sprawlify.div {...mergedProps} />;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/components/floating-panel/floating-panel.ts
|
|
199
|
+
var floating_panel_exports = /* @__PURE__ */ __export({
|
|
200
|
+
Body: () => FloatingPanelBody,
|
|
201
|
+
CloseTrigger: () => FloatingPanelCloseTrigger,
|
|
202
|
+
Content: () => FloatingPanelContent,
|
|
203
|
+
Context: () => FloatingPanelContext,
|
|
204
|
+
Control: () => FloatingPanelControl,
|
|
205
|
+
DragTrigger: () => FloatingPanelDragTrigger,
|
|
206
|
+
Header: () => FloatingPanelHeader,
|
|
207
|
+
Positioner: () => FloatingPanelPositioner,
|
|
208
|
+
ResizeTrigger: () => FloatingPanelResizeTrigger,
|
|
209
|
+
Root: () => FloatingPanelRoot,
|
|
210
|
+
RootProvider: () => FloatingPanelRootProvider,
|
|
211
|
+
StageTrigger: () => FloatingPanelStageTrigger,
|
|
212
|
+
Title: () => FloatingPanelTitle,
|
|
213
|
+
Trigger: () => FloatingPanelTrigger
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
//#endregion
|
|
217
|
+
export { floating_panel_exports as FloatingPanel, FloatingPanelBody, FloatingPanelCloseTrigger, FloatingPanelContent, FloatingPanelContext, FloatingPanelControl, FloatingPanelDragTrigger, FloatingPanelHeader, FloatingPanelPositioner, FloatingPanelResizeTrigger, FloatingPanelRoot, FloatingPanelRootProvider, FloatingPanelStageTrigger, FloatingPanelTitle, FloatingPanelTrigger, floatingPanelAnatomy, useFloatingPanel, useFloatingPanelContext };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as Assign } from "../../types-mGUbKy2h.js";
|
|
2
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-srnAQg4A.js";
|
|
3
|
+
import * as solid_js168 from "solid-js";
|
|
4
|
+
import { FocusTrapOptions } from "@sprawlify/primitives/focus-trap";
|
|
5
|
+
|
|
6
|
+
//#region src/components/focus-trap/focus-trap.d.ts
|
|
7
|
+
interface TrapOptions extends Pick<FocusTrapOptions, 'onActivate' | 'onDeactivate' | 'initialFocus' | 'fallbackFocus' | 'returnFocusOnDeactivate' | 'setReturnFocus'> {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the focus trap is disabled.
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface FocusTrapBaseProps extends PolymorphicProps<'div'>, TrapOptions {}
|
|
14
|
+
interface FocusTrapProps extends Assign<HTMLProps<'div'>, FocusTrapBaseProps> {}
|
|
15
|
+
declare const FocusTrap: (props: FocusTrapProps) => solid_js168.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { FocusTrap, type FocusTrapBaseProps, type FocusTrapProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "../../core-CRjuRw95.js";
|
|
2
|
+
import { t as sprawlify } from "../../factory-k8EbNZ7r.js";
|
|
3
|
+
import { t as createSplitProps } from "../../create-split-props-BHmgTHSf.js";
|
|
4
|
+
import { t as composeRefs } from "../../compose-refs-tCBI7PRJ.js";
|
|
5
|
+
import { createEffect, onCleanup } from "solid-js";
|
|
6
|
+
import { createComponent, mergeProps as mergeProps$1 } from "solid-js/web";
|
|
7
|
+
import { trapFocus } from "@sprawlify/primitives/focus-trap";
|
|
8
|
+
|
|
9
|
+
//#region src/components/focus-trap/focus-trap.tsx
|
|
10
|
+
const FocusTrap = (props) => {
|
|
11
|
+
let localNode;
|
|
12
|
+
const [trapProps, localProps] = createSplitProps()(props, [
|
|
13
|
+
"disabled",
|
|
14
|
+
"onActivate",
|
|
15
|
+
"onDeactivate",
|
|
16
|
+
"initialFocus",
|
|
17
|
+
"fallbackFocus",
|
|
18
|
+
"returnFocusOnDeactivate",
|
|
19
|
+
"setReturnFocus"
|
|
20
|
+
]);
|
|
21
|
+
createEffect(() => {
|
|
22
|
+
if (!localNode || trapProps.disabled) return;
|
|
23
|
+
const autoFocusNode = localNode.querySelector("[autofocus], [data-autofocus]");
|
|
24
|
+
trapProps.initialFocus ||= autoFocusNode ?? void 0;
|
|
25
|
+
onCleanup(trapFocus(localNode, trapProps));
|
|
26
|
+
});
|
|
27
|
+
return createComponent(sprawlify.div, mergeProps$1(localProps, { ref(r$) {
|
|
28
|
+
var _ref$ = composeRefs((el) => localNode = el, props.ref);
|
|
29
|
+
typeof _ref$ === "function" && _ref$(r$);
|
|
30
|
+
} }));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { FocusTrap };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "../../core-C_FYj4uc.jsx";
|
|
2
|
+
import { t as sprawlify } from "../../factory-BIJk1mK6.jsx";
|
|
3
|
+
import { t as createSplitProps } from "../../create-split-props-CKwjjjkD.jsx";
|
|
4
|
+
import { t as composeRefs } from "../../compose-refs-Cp4AShsY.jsx";
|
|
5
|
+
import { createEffect, onCleanup } from "solid-js";
|
|
6
|
+
import { trapFocus } from "@sprawlify/primitives/focus-trap";
|
|
7
|
+
|
|
8
|
+
//#region src/components/focus-trap/focus-trap.tsx
|
|
9
|
+
const FocusTrap = (props) => {
|
|
10
|
+
let localNode;
|
|
11
|
+
const [trapProps, localProps] = createSplitProps()(props, [
|
|
12
|
+
"disabled",
|
|
13
|
+
"onActivate",
|
|
14
|
+
"onDeactivate",
|
|
15
|
+
"initialFocus",
|
|
16
|
+
"fallbackFocus",
|
|
17
|
+
"returnFocusOnDeactivate",
|
|
18
|
+
"setReturnFocus"
|
|
19
|
+
]);
|
|
20
|
+
createEffect(() => {
|
|
21
|
+
if (!localNode || trapProps.disabled) return;
|
|
22
|
+
const autoFocusNode = localNode.querySelector("[autofocus], [data-autofocus]");
|
|
23
|
+
trapProps.initialFocus ||= autoFocusNode ?? void 0;
|
|
24
|
+
onCleanup(trapFocus(localNode, trapProps));
|
|
25
|
+
});
|
|
26
|
+
return <sprawlify.div {...localProps} ref={composeRefs((el) => localNode = el, props.ref)} />;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { FocusTrap };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as solid_js22 from "solid-js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/format/format-byte.d.ts
|
|
4
|
+
interface FormatByteProps {
|
|
5
|
+
unit?: 'bit' | 'byte';
|
|
6
|
+
unitDisplay?: 'long' | 'short' | 'narrow';
|
|
7
|
+
unitSystem?: 'decimal' | 'binary';
|
|
8
|
+
value: number;
|
|
9
|
+
}
|
|
10
|
+
declare const FormatByte: (props: FormatByteProps) => solid_js22.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/format/format-number.d.ts
|
|
13
|
+
interface FormatNumberProps extends Intl.NumberFormatOptions {
|
|
14
|
+
value: number;
|
|
15
|
+
}
|
|
16
|
+
declare const FormatNumber: (props: FormatNumberProps) => solid_js22.JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/format/format-relative-time.d.ts
|
|
19
|
+
interface FormatRelativeTimeProps extends Intl.RelativeTimeFormatOptions {
|
|
20
|
+
value: Date;
|
|
21
|
+
}
|
|
22
|
+
declare const FormatRelativeTime: (props: FormatRelativeTimeProps) => solid_js22.JSX.Element;
|
|
23
|
+
declare namespace format_d_exports {
|
|
24
|
+
export { FormatByte as Byte, FormatByteProps as ByteProps, FormatNumber as Number, FormatNumberProps as NumberProps, FormatRelativeTime as RelativeTime, FormatRelativeTimeProps as RelativeTimeProps };
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { format_d_exports as Format, FormatByte, type FormatByteProps, FormatNumber, type FormatNumberProps, FormatRelativeTime, type FormatRelativeTimeProps };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-Bn8mXcTA.js";
|
|
2
|
+
import "../../create-context-DlXBVMoq.js";
|
|
3
|
+
import { i as useLocaleContext } from "../../providers-DgUckEdb.js";
|
|
4
|
+
import { createMemo } from "solid-js";
|
|
5
|
+
import { memo } from "solid-js/web";
|
|
6
|
+
import { formatBytes, formatNumber, formatRelativeTime } from "@sprawlify/primitives/i18n-utils";
|
|
7
|
+
|
|
8
|
+
//#region src/components/format/format-byte.tsx
|
|
9
|
+
const FormatByte = (props) => {
|
|
10
|
+
const ctx = useLocaleContext();
|
|
11
|
+
return memo(createMemo(() => {
|
|
12
|
+
const { value, ...intlOptions } = props;
|
|
13
|
+
return formatBytes(value, ctx().locale, intlOptions);
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/format/format-number.tsx
|
|
19
|
+
const FormatNumber = (props) => {
|
|
20
|
+
const ctx = useLocaleContext();
|
|
21
|
+
return memo(createMemo(() => {
|
|
22
|
+
const { value, ...intlOptions } = props;
|
|
23
|
+
return formatNumber(value, ctx().locale, intlOptions);
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/format/format-relative-time.tsx
|
|
29
|
+
const FormatRelativeTime = (props) => {
|
|
30
|
+
const ctx = useLocaleContext();
|
|
31
|
+
return memo(createMemo(() => {
|
|
32
|
+
const { value, ...intlOptions } = props;
|
|
33
|
+
return formatRelativeTime(value, ctx().locale, intlOptions);
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/format/format.ts
|
|
39
|
+
var format_exports = /* @__PURE__ */ __export({
|
|
40
|
+
Byte: () => FormatByte,
|
|
41
|
+
Number: () => FormatNumber,
|
|
42
|
+
RelativeTime: () => FormatRelativeTime
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { format_exports as Format, FormatByte, FormatNumber, FormatRelativeTime };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-BJ7z6UrO.jsx";
|
|
2
|
+
import "../../create-context-BwqlrMqL.jsx";
|
|
3
|
+
import { i as useLocaleContext } from "../../providers-C6VPiSrB.jsx";
|
|
4
|
+
import { createMemo } from "solid-js";
|
|
5
|
+
import { formatBytes, formatNumber, formatRelativeTime } from "@sprawlify/primitives/i18n-utils";
|
|
6
|
+
|
|
7
|
+
//#region src/components/format/format-byte.tsx
|
|
8
|
+
const FormatByte = (props) => {
|
|
9
|
+
const ctx = useLocaleContext();
|
|
10
|
+
const text = createMemo(() => {
|
|
11
|
+
const { value, ...intlOptions } = props;
|
|
12
|
+
return formatBytes(value, ctx().locale, intlOptions);
|
|
13
|
+
});
|
|
14
|
+
return <>{text()}</>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/format/format-number.tsx
|
|
19
|
+
const FormatNumber = (props) => {
|
|
20
|
+
const ctx = useLocaleContext();
|
|
21
|
+
const text = createMemo(() => {
|
|
22
|
+
const { value, ...intlOptions } = props;
|
|
23
|
+
return formatNumber(value, ctx().locale, intlOptions);
|
|
24
|
+
});
|
|
25
|
+
return <>{text()}</>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/format/format-relative-time.tsx
|
|
30
|
+
const FormatRelativeTime = (props) => {
|
|
31
|
+
const ctx = useLocaleContext();
|
|
32
|
+
const text = createMemo(() => {
|
|
33
|
+
const { value, ...intlOptions } = props;
|
|
34
|
+
return formatRelativeTime(value, ctx().locale, intlOptions);
|
|
35
|
+
});
|
|
36
|
+
return <>{text()}</>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/format/format.ts
|
|
41
|
+
var format_exports = /* @__PURE__ */ __export({
|
|
42
|
+
Byte: () => FormatByte,
|
|
43
|
+
Number: () => FormatNumber,
|
|
44
|
+
RelativeTime: () => FormatRelativeTime
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { format_exports as Format, FormatByte, FormatNumber, FormatRelativeTime };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as Assign } from "../../types-mGUbKy2h.js";
|
|
2
|
+
import { JSX } from "solid-js";
|
|
3
|
+
|
|
4
|
+
//#region src/components/frame/frame.d.ts
|
|
5
|
+
interface FrameBaseProps {
|
|
6
|
+
head?: JSX.Element;
|
|
7
|
+
onMount?: () => void;
|
|
8
|
+
onUnmount?: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface FrameProps extends Assign<JSX.IframeHTMLAttributes<HTMLIFrameElement>, FrameBaseProps> {}
|
|
11
|
+
declare const Frame: (props: FrameProps) => JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Frame, type FrameBaseProps, type FrameProps };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import "../../create-context-DlXBVMoq.js";
|
|
2
|
+
import { a as EnvironmentProvider } from "../../providers-DgUckEdb.js";
|
|
3
|
+
import { t as composeRefs } from "../../compose-refs-tCBI7PRJ.js";
|
|
4
|
+
import { Show, createEffect, createMemo, createSignal, onCleanup, splitProps } from "solid-js";
|
|
5
|
+
import { Portal, createComponent, insert, spread, template, use } from "solid-js/web";
|
|
6
|
+
|
|
7
|
+
//#region src/components/frame/frame-content.tsx
|
|
8
|
+
const FrameContent = (props) => {
|
|
9
|
+
const { onMount: onMount$1, onUnmount, children: children$1 } = props;
|
|
10
|
+
createEffect(() => {
|
|
11
|
+
onMount$1?.();
|
|
12
|
+
onCleanup(() => {
|
|
13
|
+
onUnmount?.();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
return children$1;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/components/frame/frame.tsx
|
|
21
|
+
var _tmpl$ = /* @__PURE__ */ template(`<iframe>`);
|
|
22
|
+
const initialSrcDoc = `<html><head><style>*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }</style></head><body><div class="frame-root"></div></body></html>`;
|
|
23
|
+
function getMountNode(frame) {
|
|
24
|
+
const doc = frame.contentWindow?.document;
|
|
25
|
+
if (!doc) return null;
|
|
26
|
+
return doc.body.querySelector(".frame-root") || doc.body;
|
|
27
|
+
}
|
|
28
|
+
const Frame = (props) => {
|
|
29
|
+
const [frameProps, localProps] = splitProps(props, [
|
|
30
|
+
"children",
|
|
31
|
+
"head",
|
|
32
|
+
"onMount",
|
|
33
|
+
"onUnmount",
|
|
34
|
+
"srcdoc"
|
|
35
|
+
]);
|
|
36
|
+
const srcdoc = createMemo(() => frameProps.srcdoc ?? initialSrcDoc);
|
|
37
|
+
const [frameRef, setFrameRef] = createSignal(null);
|
|
38
|
+
const [mountNode, setMountNode] = createSignal(null);
|
|
39
|
+
createEffect(() => {
|
|
40
|
+
const frame = frameRef();
|
|
41
|
+
if (!frame) return;
|
|
42
|
+
const doc = frame.contentWindow?.document;
|
|
43
|
+
if (!doc) return;
|
|
44
|
+
doc.open();
|
|
45
|
+
doc.write(srcdoc());
|
|
46
|
+
doc.close();
|
|
47
|
+
setMountNode(getMountNode(frame));
|
|
48
|
+
});
|
|
49
|
+
createEffect(() => {
|
|
50
|
+
const frame = frameRef();
|
|
51
|
+
if (!frame || !frame.contentDocument) return;
|
|
52
|
+
const win = frame.contentWindow;
|
|
53
|
+
if (!win) return;
|
|
54
|
+
const node = getMountNode(frame);
|
|
55
|
+
if (!node) return;
|
|
56
|
+
const exec = () => {
|
|
57
|
+
win.requestAnimationFrame(() => {
|
|
58
|
+
if (!frame.contentDocument?.documentElement) return;
|
|
59
|
+
frame.style.setProperty("--width", `${node.scrollWidth}px`);
|
|
60
|
+
frame.style.setProperty("--height", `${node.scrollHeight}px`);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const resizeObserver = new win.ResizeObserver(exec);
|
|
64
|
+
exec();
|
|
65
|
+
if (frame.contentDocument) resizeObserver.observe(node);
|
|
66
|
+
onCleanup(() => {
|
|
67
|
+
resizeObserver.disconnect();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
return createComponent(EnvironmentProvider, {
|
|
71
|
+
value: () => frameRef()?.contentDocument ?? document,
|
|
72
|
+
get children() {
|
|
73
|
+
var _el$ = _tmpl$();
|
|
74
|
+
var _ref$ = composeRefs(setFrameRef, localProps.ref);
|
|
75
|
+
typeof _ref$ === "function" && use(_ref$, _el$);
|
|
76
|
+
spread(_el$, localProps, false, true);
|
|
77
|
+
insert(_el$, createComponent(Show, {
|
|
78
|
+
get when() {
|
|
79
|
+
return mountNode();
|
|
80
|
+
},
|
|
81
|
+
children: (node) => createComponent(Portal, {
|
|
82
|
+
get mount() {
|
|
83
|
+
return node();
|
|
84
|
+
},
|
|
85
|
+
get children() {
|
|
86
|
+
return createComponent(FrameContent, {
|
|
87
|
+
get onMount() {
|
|
88
|
+
return frameProps.onMount;
|
|
89
|
+
},
|
|
90
|
+
get onUnmount() {
|
|
91
|
+
return frameProps.onUnmount;
|
|
92
|
+
},
|
|
93
|
+
get children() {
|
|
94
|
+
return frameProps.children;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
}), null);
|
|
100
|
+
insert(_el$, createComponent(Show, {
|
|
101
|
+
get when() {
|
|
102
|
+
return mountNode();
|
|
103
|
+
},
|
|
104
|
+
get children() {
|
|
105
|
+
return createComponent(Portal, {
|
|
106
|
+
get mount() {
|
|
107
|
+
return frameRef().contentDocument.head;
|
|
108
|
+
},
|
|
109
|
+
get children() {
|
|
110
|
+
return frameProps.head;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}), null);
|
|
115
|
+
return _el$;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
export { Frame };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import "../../create-context-BwqlrMqL.jsx";
|
|
2
|
+
import { a as EnvironmentProvider } from "../../providers-C6VPiSrB.jsx";
|
|
3
|
+
import { t as composeRefs } from "../../compose-refs-Cp4AShsY.jsx";
|
|
4
|
+
import { Show, createEffect, createMemo, createSignal, onCleanup, splitProps } from "solid-js";
|
|
5
|
+
import { Portal } from "solid-js/web";
|
|
6
|
+
|
|
7
|
+
//#region src/components/frame/frame-content.tsx
|
|
8
|
+
const FrameContent = (props) => {
|
|
9
|
+
const { onMount: onMount$1, onUnmount, children: children$1 } = props;
|
|
10
|
+
createEffect(() => {
|
|
11
|
+
onMount$1?.();
|
|
12
|
+
onCleanup(() => {
|
|
13
|
+
onUnmount?.();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
return children$1;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/components/frame/frame.tsx
|
|
21
|
+
const initialSrcDoc = `<html><head><style>*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }</style></head><body><div class="frame-root"></div></body></html>`;
|
|
22
|
+
function getMountNode(frame) {
|
|
23
|
+
const doc = frame.contentWindow?.document;
|
|
24
|
+
if (!doc) return null;
|
|
25
|
+
return doc.body.querySelector(".frame-root") || doc.body;
|
|
26
|
+
}
|
|
27
|
+
const Frame = (props) => {
|
|
28
|
+
const [frameProps, localProps] = splitProps(props, [
|
|
29
|
+
"children",
|
|
30
|
+
"head",
|
|
31
|
+
"onMount",
|
|
32
|
+
"onUnmount",
|
|
33
|
+
"srcdoc"
|
|
34
|
+
]);
|
|
35
|
+
const srcdoc = createMemo(() => frameProps.srcdoc ?? initialSrcDoc);
|
|
36
|
+
const [frameRef, setFrameRef] = createSignal(null);
|
|
37
|
+
const [mountNode, setMountNode] = createSignal(null);
|
|
38
|
+
createEffect(() => {
|
|
39
|
+
const frame = frameRef();
|
|
40
|
+
if (!frame) return;
|
|
41
|
+
const doc = frame.contentWindow?.document;
|
|
42
|
+
if (!doc) return;
|
|
43
|
+
doc.open();
|
|
44
|
+
doc.write(srcdoc());
|
|
45
|
+
doc.close();
|
|
46
|
+
setMountNode(getMountNode(frame));
|
|
47
|
+
});
|
|
48
|
+
createEffect(() => {
|
|
49
|
+
const frame = frameRef();
|
|
50
|
+
if (!frame || !frame.contentDocument) return;
|
|
51
|
+
const win = frame.contentWindow;
|
|
52
|
+
if (!win) return;
|
|
53
|
+
const node = getMountNode(frame);
|
|
54
|
+
if (!node) return;
|
|
55
|
+
const exec = () => {
|
|
56
|
+
win.requestAnimationFrame(() => {
|
|
57
|
+
if (!frame.contentDocument?.documentElement) return;
|
|
58
|
+
frame.style.setProperty("--width", `${node.scrollWidth}px`);
|
|
59
|
+
frame.style.setProperty("--height", `${node.scrollHeight}px`);
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const resizeObserver = new win.ResizeObserver(exec);
|
|
63
|
+
exec();
|
|
64
|
+
if (frame.contentDocument) resizeObserver.observe(node);
|
|
65
|
+
onCleanup(() => {
|
|
66
|
+
resizeObserver.disconnect();
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
return <EnvironmentProvider value={() => frameRef()?.contentDocument ?? document}>
|
|
70
|
+
<iframe {...localProps} ref={composeRefs(setFrameRef, localProps.ref)}>
|
|
71
|
+
<Show when={mountNode()}>
|
|
72
|
+
{(node) => <Portal mount={node()}>
|
|
73
|
+
<FrameContent onMount={frameProps.onMount} onUnmount={frameProps.onUnmount}>
|
|
74
|
+
{frameProps.children}
|
|
75
|
+
</FrameContent>
|
|
76
|
+
</Portal>}
|
|
77
|
+
</Show>
|
|
78
|
+
<Show when={mountNode()}>
|
|
79
|
+
<Portal mount={frameRef().contentDocument.head}>{frameProps.head}</Portal>
|
|
80
|
+
</Show>
|
|
81
|
+
</iframe>
|
|
82
|
+
</EnvironmentProvider>;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Frame };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as MaybeAccessor, t as Assign } from "../../types-
|
|
2
|
-
import * as
|
|
1
|
+
import { n as MaybeAccessor, t as Assign } from "../../types-mGUbKy2h.js";
|
|
2
|
+
import * as solid_js46 from "solid-js";
|
|
3
3
|
import { Accessor, ComponentProps } from "solid-js";
|
|
4
4
|
import { HighlightChunk, HighlightWordProps } from "@sprawlify/primitives/highlight-word";
|
|
5
5
|
|
|
@@ -10,6 +10,6 @@ declare const useHighlight: (props: MaybeAccessor<UseHighlightProps>) => Accesso
|
|
|
10
10
|
//#region src/components/highlight/highlight.d.ts
|
|
11
11
|
interface HighlightBaseProps extends UseHighlightProps {}
|
|
12
12
|
interface HighlightProps extends Assign<ComponentProps<'mark'>, HighlightBaseProps> {}
|
|
13
|
-
declare const Highlight: (props: HighlightProps) =>
|
|
13
|
+
declare const Highlight: (props: HighlightProps) => solid_js46.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { Highlight, type HighlightChunk, type HighlightProps, type UseHighlightProps, useHighlight };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as runIfFn } from "../../run-if-fn-
|
|
2
|
-
import { t as createSplitProps } from "../../create-split-props-
|
|
1
|
+
import { t as runIfFn } from "../../run-if-fn-C80kt4dU.js";
|
|
2
|
+
import { t as createSplitProps } from "../../create-split-props-BHmgTHSf.js";
|
|
3
3
|
import { For, Show, createMemo } from "solid-js";
|
|
4
4
|
import { createComponent, insert, spread, template } from "solid-js/web";
|
|
5
5
|
import { highlightWord } from "@sprawlify/primitives/highlight-word";
|
|
@@ -13,7 +13,7 @@ const useHighlight = (props) => {
|
|
|
13
13
|
//#region src/components/highlight/highlight.tsx
|
|
14
14
|
var _tmpl$ = /* @__PURE__ */ template(`<mark>`);
|
|
15
15
|
const Highlight = (props) => {
|
|
16
|
-
if (typeof props.text !== "string") throw new Error("[
|
|
16
|
+
if (typeof props.text !== "string") throw new Error("[sprawlify/highlight] text must be a string");
|
|
17
17
|
const [highlightProps, localProps] = createSplitProps()(props, [
|
|
18
18
|
"query",
|
|
19
19
|
"text",
|