@mieweb/ui 0.10.0-dev.16 → 0.10.0-dev.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/CsvBlock-FX5YNGNE.cjs +17 -0
- package/dist/{CsvBlock-FVOKKWIY.cjs.map → CsvBlock-FX5YNGNE.cjs.map} +1 -1
- package/dist/CsvBlock-VLMG7GUO.js +8 -0
- package/dist/{CsvBlock-MXZO4W3N.js.map → CsvBlock-VLMG7GUO.js.map} +1 -1
- package/dist/HtmlPreviewBlock-5JE7L3GR.js +8 -0
- package/dist/{HtmlPreviewBlock-2UGW33SQ.js.map → HtmlPreviewBlock-5JE7L3GR.js.map} +1 -1
- package/dist/HtmlPreviewBlock-UO37JQ3K.cjs +17 -0
- package/dist/{HtmlPreviewBlock-CZKTQUCL.cjs.map → HtmlPreviewBlock-UO37JQ3K.cjs.map} +1 -1
- package/dist/MermaidBlock-3XHFBAMV.js +8 -0
- package/dist/{MermaidBlock-QXAEMOAA.js.map → MermaidBlock-3XHFBAMV.js.map} +1 -1
- package/dist/MermaidBlock-RZ75RPZA.cjs +17 -0
- package/dist/{MermaidBlock-NLDOJZUJ.cjs.map → MermaidBlock-RZ75RPZA.cjs.map} +1 -1
- package/dist/SurveyBlock-MUVJ3JUI.js +8 -0
- package/dist/{SurveyBlock-M5BEFZGT.js.map → SurveyBlock-MUVJ3JUI.js.map} +1 -1
- package/dist/SurveyBlock-VH47YXZC.cjs +17 -0
- package/dist/{SurveyBlock-GSHYZMTW.cjs.map → SurveyBlock-VH47YXZC.cjs.map} +1 -1
- package/dist/{chunk-77PNQILS.js → chunk-2BARVD4C.js} +3 -3
- package/dist/{chunk-77PNQILS.js.map → chunk-2BARVD4C.js.map} +1 -1
- package/dist/{chunk-IUQMOBFB.cjs → chunk-3KPDQG5O.cjs} +5 -5
- package/dist/{chunk-IUQMOBFB.cjs.map → chunk-3KPDQG5O.cjs.map} +1 -1
- package/dist/{chunk-OWLWABAS.js → chunk-4HC2IBOX.js} +3 -3
- package/dist/{chunk-OWLWABAS.js.map → chunk-4HC2IBOX.js.map} +1 -1
- package/dist/{chunk-R5AFQWR5.js → chunk-673GMFA6.js} +3 -3
- package/dist/{chunk-R5AFQWR5.js.map → chunk-673GMFA6.js.map} +1 -1
- package/dist/{chunk-UV4IJNSN.js → chunk-7YO7DNUV.js} +3 -3
- package/dist/{chunk-UV4IJNSN.js.map → chunk-7YO7DNUV.js.map} +1 -1
- package/dist/{chunk-XU2E7MTG.js → chunk-DSB4DKWG.js} +7 -7
- package/dist/{chunk-XU2E7MTG.js.map → chunk-DSB4DKWG.js.map} +1 -1
- package/dist/{chunk-XFLEW7AT.cjs → chunk-DXEPYK3I.cjs} +8 -4
- package/dist/chunk-DXEPYK3I.cjs.map +1 -0
- package/dist/{chunk-IBCCFWD4.js → chunk-EK3BCET6.js} +7 -2
- package/dist/chunk-EK3BCET6.js.map +1 -0
- package/dist/{chunk-WN6A4QOF.js → chunk-FBLVPM2K.js} +3 -3
- package/dist/{chunk-WN6A4QOF.js.map → chunk-FBLVPM2K.js.map} +1 -1
- package/dist/{chunk-CATY3P2U.js → chunk-FIKO4WR6.js} +3 -3
- package/dist/{chunk-CATY3P2U.js.map → chunk-FIKO4WR6.js.map} +1 -1
- package/dist/{chunk-FDP6VS5G.js → chunk-FZURBQJ2.js} +3 -3
- package/dist/{chunk-FDP6VS5G.js.map → chunk-FZURBQJ2.js.map} +1 -1
- package/dist/{chunk-LENW5YOC.js → chunk-GBUVIGD5.js} +46 -17
- package/dist/chunk-GBUVIGD5.js.map +1 -0
- package/dist/{chunk-O5A4GTTG.cjs → chunk-GU5OS7JJ.cjs} +4 -4
- package/dist/{chunk-O5A4GTTG.cjs.map → chunk-GU5OS7JJ.cjs.map} +1 -1
- package/dist/{chunk-YEQLSYJO.cjs → chunk-GVBHDRC7.cjs} +5 -5
- package/dist/{chunk-YEQLSYJO.cjs.map → chunk-GVBHDRC7.cjs.map} +1 -1
- package/dist/{chunk-W5TPBCBM.js → chunk-GVLNXPJX.js} +4 -4
- package/dist/{chunk-W5TPBCBM.js.map → chunk-GVLNXPJX.js.map} +1 -1
- package/dist/{chunk-AXRRBEER.js → chunk-GVM6DTR5.js} +8 -4
- package/dist/chunk-GVM6DTR5.js.map +1 -0
- package/dist/{chunk-UKUKBUME.cjs → chunk-GYXUS65N.cjs} +5 -5
- package/dist/{chunk-UKUKBUME.cjs.map → chunk-GYXUS65N.cjs.map} +1 -1
- package/dist/{chunk-R47H3Y7J.js → chunk-H2IAMSHK.js} +3 -3
- package/dist/{chunk-R47H3Y7J.js.map → chunk-H2IAMSHK.js.map} +1 -1
- package/dist/{chunk-KM5OQQL5.cjs → chunk-HIZWOAWY.cjs} +8 -8
- package/dist/{chunk-KM5OQQL5.cjs.map → chunk-HIZWOAWY.cjs.map} +1 -1
- package/dist/{chunk-6GZKQR7P.cjs → chunk-I4LXSHKO.cjs} +4 -4
- package/dist/{chunk-6GZKQR7P.cjs.map → chunk-I4LXSHKO.cjs.map} +1 -1
- package/dist/{chunk-4LPGJ3ZO.js → chunk-IYWG72DM.js} +4 -4
- package/dist/{chunk-4LPGJ3ZO.js.map → chunk-IYWG72DM.js.map} +1 -1
- package/dist/{chunk-OZ2LP2VQ.cjs → chunk-JELTRRR5.cjs} +9 -9
- package/dist/{chunk-OZ2LP2VQ.cjs.map → chunk-JELTRRR5.cjs.map} +1 -1
- package/dist/{chunk-DXCATYEO.js → chunk-K2K2HP35.js} +3 -3
- package/dist/{chunk-DXCATYEO.js.map → chunk-K2K2HP35.js.map} +1 -1
- package/dist/{chunk-M5NYHH3Z.cjs → chunk-KDW6BD4O.cjs} +4 -4
- package/dist/{chunk-M5NYHH3Z.cjs.map → chunk-KDW6BD4O.cjs.map} +1 -1
- package/dist/{chunk-VNCIIXGO.js → chunk-KHSFJTEX.js} +3 -3
- package/dist/{chunk-VNCIIXGO.js.map → chunk-KHSFJTEX.js.map} +1 -1
- package/dist/{chunk-DF7K6DOJ.cjs → chunk-LFPJ3OUM.cjs} +5 -5
- package/dist/{chunk-DF7K6DOJ.cjs.map → chunk-LFPJ3OUM.cjs.map} +1 -1
- package/dist/{chunk-X2PPZJSL.cjs → chunk-LHBWRMNC.cjs} +46 -16
- package/dist/chunk-LHBWRMNC.cjs.map +1 -0
- package/dist/{chunk-JX4UZEBZ.cjs → chunk-MQPG3KVK.cjs} +8 -8
- package/dist/{chunk-JX4UZEBZ.cjs.map → chunk-MQPG3KVK.cjs.map} +1 -1
- package/dist/{chunk-VLBUT2QM.cjs → chunk-N2CJJHHB.cjs} +4 -4
- package/dist/{chunk-VLBUT2QM.cjs.map → chunk-N2CJJHHB.cjs.map} +1 -1
- package/dist/{chunk-MB5KIIT4.cjs → chunk-N7C4OEP7.cjs} +6 -6
- package/dist/{chunk-MB5KIIT4.cjs.map → chunk-N7C4OEP7.cjs.map} +1 -1
- package/dist/{chunk-LGIQVSAE.cjs → chunk-NUQSQRG3.cjs} +16 -16
- package/dist/{chunk-LGIQVSAE.cjs.map → chunk-NUQSQRG3.cjs.map} +1 -1
- package/dist/{chunk-ETCHEURD.js → chunk-OYBJQBLO.js} +4 -4
- package/dist/{chunk-ETCHEURD.js.map → chunk-OYBJQBLO.js.map} +1 -1
- package/dist/{chunk-VPRKE2YU.cjs → chunk-P5CMZZRZ.cjs} +5 -5
- package/dist/{chunk-VPRKE2YU.cjs.map → chunk-P5CMZZRZ.cjs.map} +1 -1
- package/dist/{chunk-NEFBVO5W.cjs → chunk-QNDP6PE5.cjs} +7 -2
- package/dist/chunk-QNDP6PE5.cjs.map +1 -0
- package/dist/{chunk-WBBOH5QF.js → chunk-QOVJ6Z6R.js} +3 -3
- package/dist/{chunk-WBBOH5QF.js.map → chunk-QOVJ6Z6R.js.map} +1 -1
- package/dist/{chunk-4IETGCMD.js → chunk-R6KPWIGO.js} +4 -4
- package/dist/{chunk-4IETGCMD.js.map → chunk-R6KPWIGO.js.map} +1 -1
- package/dist/{chunk-GRV4MOEO.cjs → chunk-SVXWO37F.cjs} +26 -26
- package/dist/{chunk-GRV4MOEO.cjs.map → chunk-SVXWO37F.cjs.map} +1 -1
- package/dist/{chunk-T7U5HHGK.js → chunk-THLIL6PY.js} +3 -3
- package/dist/{chunk-T7U5HHGK.js.map → chunk-THLIL6PY.js.map} +1 -1
- package/dist/{chunk-PLDJU623.cjs → chunk-TTSSUOEV.cjs} +8 -8
- package/dist/{chunk-PLDJU623.cjs.map → chunk-TTSSUOEV.cjs.map} +1 -1
- package/dist/{chunk-E2B5BLAF.cjs → chunk-TYE5K5WV.cjs} +4 -4
- package/dist/{chunk-E2B5BLAF.cjs.map → chunk-TYE5K5WV.cjs.map} +1 -1
- package/dist/{chunk-YIWJTNR5.cjs → chunk-WCDJFMZO.cjs} +7 -7
- package/dist/{chunk-YIWJTNR5.cjs.map → chunk-WCDJFMZO.cjs.map} +1 -1
- package/dist/{chunk-EQXFDPXV.cjs → chunk-X5KAO35W.cjs} +14 -14
- package/dist/{chunk-EQXFDPXV.cjs.map → chunk-X5KAO35W.cjs.map} +1 -1
- package/dist/{chunk-2BGS7RFM.cjs → chunk-X6A27RGO.cjs} +4 -4
- package/dist/{chunk-2BGS7RFM.cjs.map → chunk-X6A27RGO.cjs.map} +1 -1
- package/dist/{chunk-7U5QYH54.js → chunk-XBTKZCZF.js} +3 -3
- package/dist/{chunk-7U5QYH54.js.map → chunk-XBTKZCZF.js.map} +1 -1
- package/dist/{chunk-TVSGJT6G.cjs → chunk-Y4E2WRUR.cjs} +6 -6
- package/dist/{chunk-TVSGJT6G.cjs.map → chunk-Y4E2WRUR.cjs.map} +1 -1
- package/dist/{chunk-UXI33QGR.js → chunk-YIV4Y4SK.js} +3 -3
- package/dist/{chunk-UXI33QGR.js.map → chunk-YIV4Y4SK.js.map} +1 -1
- package/dist/{chunk-VVZALGPI.js → chunk-YU55JD35.js} +3 -3
- package/dist/{chunk-VVZALGPI.js.map → chunk-YU55JD35.js.map} +1 -1
- package/dist/{chunk-WC25GQZD.js → chunk-ZYL4SNOR.js} +3 -3
- package/dist/{chunk-WC25GQZD.js.map → chunk-ZYL4SNOR.js.map} +1 -1
- package/dist/components/AlertDialog/index.cjs +4 -4
- package/dist/components/AlertDialog/index.js +3 -3
- package/dist/components/Button/index.cjs +4 -4
- package/dist/components/Button/index.js +2 -2
- package/dist/components/CalendarView/index.cjs +5 -5
- package/dist/components/CalendarView/index.js +3 -3
- package/dist/components/CustomizableDashboard/index.cjs +10 -10
- package/dist/components/CustomizableDashboard/index.js +3 -3
- package/dist/components/FloatingWindow/index.cjs +5 -5
- package/dist/components/FloatingWindow/index.js +3 -3
- package/dist/components/ListView/index.cjs +5 -5
- package/dist/components/ListView/index.js +3 -3
- package/dist/components/Markdown/index.cjs +17 -17
- package/dist/components/Markdown/index.js +8 -8
- package/dist/components/MediaEditor/index.cjs +9 -9
- package/dist/components/MediaEditor/index.js +4 -4
- package/dist/components/MediaPlayer/index.cjs +6 -6
- package/dist/components/MediaPlayer/index.js +3 -3
- package/dist/components/MegaMenu/index.cjs +6 -6
- package/dist/components/MegaMenu/index.js +3 -3
- package/dist/components/RadialExplorer/index.cjs +4 -4
- package/dist/components/RadialExplorer/index.js +3 -3
- package/dist/components/RichTextEditor/index.cjs +6 -6
- package/dist/components/RichTextEditor/index.js +3 -3
- package/dist/components/SectionSpyNav/index.cjs +4 -4
- package/dist/components/SectionSpyNav/index.js +3 -3
- package/dist/components/ViewSet/index.cjs +6 -6
- package/dist/components/ViewSet/index.js +5 -5
- package/dist/datavis.cjs +3 -3
- package/dist/datavis.js +2 -2
- package/dist/esheet.cjs +6 -6
- package/dist/esheet.js +3 -3
- package/dist/hooks/index.cjs +22 -18
- package/dist/hooks/index.d.cts +53 -2
- package/dist/hooks/index.d.ts +53 -2
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +360 -356
- package/dist/index.d.cts +53 -2
- package/dist/index.d.ts +53 -2
- package/dist/index.js +30 -30
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/dist/templates.cjs +24 -24
- package/dist/templates.js +2 -2
- package/package.json +1 -1
- package/dist/CsvBlock-FVOKKWIY.cjs +0 -17
- package/dist/CsvBlock-MXZO4W3N.js +0 -8
- package/dist/HtmlPreviewBlock-2UGW33SQ.js +0 -8
- package/dist/HtmlPreviewBlock-CZKTQUCL.cjs +0 -17
- package/dist/MermaidBlock-NLDOJZUJ.cjs +0 -17
- package/dist/MermaidBlock-QXAEMOAA.js +0 -8
- package/dist/SurveyBlock-GSHYZMTW.cjs +0 -17
- package/dist/SurveyBlock-M5BEFZGT.js +0 -8
- package/dist/chunk-AXRRBEER.js.map +0 -1
- package/dist/chunk-IBCCFWD4.js.map +0 -1
- package/dist/chunk-LENW5YOC.js.map +0 -1
- package/dist/chunk-NEFBVO5W.cjs.map +0 -1
- package/dist/chunk-X2PPZJSL.cjs.map +0 -1
- package/dist/chunk-XFLEW7AT.cjs.map +0 -1
package/dist/hooks/index.d.cts
CHANGED
|
@@ -226,6 +226,19 @@ declare const VISUAL_VIEWPORT_HEIGHT_VAR = "--mieweb-visual-viewport-height";
|
|
|
226
226
|
declare const VISUAL_VIEWPORT_OFFSET_TOP_VAR = "--mieweb-visual-viewport-offset-top";
|
|
227
227
|
/** Boolean attribute set on `<html>` while an on-screen keyboard is open. */
|
|
228
228
|
declare const KEYBOARD_OPEN_ATTRIBUTE = "data-keyboard-open";
|
|
229
|
+
/** Attribute on `<html>` naming the active {@link KeyboardInsetSource}. */
|
|
230
|
+
declare const KEYBOARD_SOURCE_ATTRIBUTE = "data-keyboard-source";
|
|
231
|
+
/**
|
|
232
|
+
* Where keyboard metrics come from.
|
|
233
|
+
*
|
|
234
|
+
* - `'visual-viewport'` — the Visual Viewport API. Works in any browser, but
|
|
235
|
+
* iOS only reports the keyboard once its slide-in animation has finished.
|
|
236
|
+
* - `'native'` — `keyboardWillShow` / `keyboardWillHide` window events with a
|
|
237
|
+
* `keyboardHeight` property, as fired by `cordova-plugin-ionic-keyboard` and
|
|
238
|
+
* Capacitor's Keyboard plugin. They arrive *before* the keyboard animates,
|
|
239
|
+
* so layout can move in step with it.
|
|
240
|
+
*/
|
|
241
|
+
type KeyboardInsetSource = 'visual-viewport' | 'native';
|
|
229
242
|
interface KeyboardInsetState {
|
|
230
243
|
/** Pixels of the layout viewport covered by the on-screen keyboard. */
|
|
231
244
|
keyboardInset: number;
|
|
@@ -235,9 +248,26 @@ interface KeyboardInsetState {
|
|
|
235
248
|
interface UseKeyboardInsetOptions {
|
|
236
249
|
/** Track the keyboard; `false` stops tracking and clears the CSS variables. @default true */
|
|
237
250
|
enabled?: boolean;
|
|
251
|
+
/** Where keyboard metrics come from. @default 'visual-viewport' */
|
|
252
|
+
source?: KeyboardInsetSource;
|
|
238
253
|
}
|
|
239
254
|
/**
|
|
240
|
-
* Tracks the on-screen keyboard
|
|
255
|
+
* Tracks the on-screen keyboard and publishes it on `<html>`.
|
|
256
|
+
*
|
|
257
|
+
* ### `source: 'native'` (Cordova / Capacitor apps)
|
|
258
|
+
*
|
|
259
|
+
* Listens for the native keyboard plugin's `keyboardWillShow` /
|
|
260
|
+
* `keyboardWillHide` window events. Configure the plugin so the WebView is
|
|
261
|
+
* neither resized nor panned (for `cordova-plugin-ionic-keyboard`:
|
|
262
|
+
* `KeyboardResize=false`), keep the app shell at full height, and move only
|
|
263
|
+
* the composer dock by `--mieweb-keyboard-inset` with a short transition
|
|
264
|
+
* (~250ms) so it rides up with the keyboard. Only `--mieweb-keyboard-inset`,
|
|
265
|
+
* `data-keyboard-open` and `data-keyboard-source` are published; the
|
|
266
|
+
* visual-viewport variables stay unset.
|
|
267
|
+
*
|
|
268
|
+
* ### `source: 'visual-viewport'` (browsers, default)
|
|
269
|
+
*
|
|
270
|
+
* Uses the Visual Viewport API.
|
|
241
271
|
*
|
|
242
272
|
* iOS Safari and WKWebView (Cordova) ignore
|
|
243
273
|
* `interactive-widget=resizes-content`, and `dvh` does not shrink for the
|
|
@@ -255,6 +285,10 @@ interface UseKeyboardInsetOptions {
|
|
|
255
285
|
* Android with `interactive-widget=resizes-content`) the inset stays 0 and
|
|
256
286
|
* the variables simply mirror the layout viewport.
|
|
257
287
|
*
|
|
288
|
+
* iOS reports the visual viewport only after the keyboard has finished
|
|
289
|
+
* animating, so a shell sized this way snaps into place once the keyboard
|
|
290
|
+
* lands. Prefer `source: 'native'` wherever a native keyboard plugin exists.
|
|
291
|
+
*
|
|
258
292
|
* Mount it once, near the app root.
|
|
259
293
|
*
|
|
260
294
|
* @example
|
|
@@ -273,6 +307,23 @@ interface UseKeyboardInsetOptions {
|
|
|
273
307
|
* );
|
|
274
308
|
* }
|
|
275
309
|
* ```
|
|
310
|
+
*
|
|
311
|
+
* @example Native app (keyboard plugin with WebView resizing disabled)
|
|
312
|
+
* ```tsx
|
|
313
|
+
* function ComposerDock({ children }) {
|
|
314
|
+
* useKeyboardInset({ source: 'native' });
|
|
315
|
+
* return (
|
|
316
|
+
* <div
|
|
317
|
+
* style={{
|
|
318
|
+
* paddingBottom: 'calc(var(--mieweb-keyboard-inset, 0px) + 0.5rem)',
|
|
319
|
+
* transition: 'padding-bottom 250ms ease',
|
|
320
|
+
* }}
|
|
321
|
+
* >
|
|
322
|
+
* {children}
|
|
323
|
+
* </div>
|
|
324
|
+
* );
|
|
325
|
+
* }
|
|
326
|
+
* ```
|
|
276
327
|
*/
|
|
277
328
|
declare function useKeyboardInset(options?: UseKeyboardInsetOptions): KeyboardInsetState;
|
|
278
329
|
|
|
@@ -952,4 +1003,4 @@ interface UseTranscriptEditsResult {
|
|
|
952
1003
|
*/
|
|
953
1004
|
declare function useTranscriptEdits(options: UseTranscriptEditsOptions): UseTranscriptEditsResult;
|
|
954
1005
|
|
|
955
|
-
export { type AnchoredPlacement, DEFAULT_FILLER_WORDS, DEFAULT_MIN_SILENCE_MS, DEFAULT_NL_SILENCE_MS, type Direction, type DragOverState, type FillerAnalysis, type HoverPreviewState, KEYBOARD_INSET_VAR, KEYBOARD_OPEN_ATTRIBUTE, type KeyboardInsetState, type KeyboardShortcutOptions, type MediaTransportState, RTL_LOCALES, type ResolvedTheme, type SilenceThresholdCount, type Theme, type TranscriptClipboard, type TranscriptEditStats, type UseAnchoredPositionOptions, type UseAnchoredPositionReturn, type UseDragReorderOptions, type UseDragReorderReturn, type UseKeyboardInsetOptions, type UseMediaTransportOptions, type UseMediaTransportReturn, type UseScrollSpyOptions, type UseScrollSpyReturn, type UseStickToBottomOptions, type UseStickToBottomReturn, type UseTranscriptEditsOptions, type UseTranscriptEditsResult, type UseYouTubeHoverPreviewOptions, type UseYouTubeHoverPreviewReturn, VISUAL_VIEWPORT_HEIGHT_VAR, VISUAL_VIEWPORT_OFFSET_TOP_VAR, buildPlaybackSegments, dragIndicatorClasses, getSpeedAtIndex, initEditableWords, insertSilences, isDarkMode, isRtlLocale, reorderIds, useAnchoredPosition, useClickOutside, useCommandK, useDirection, useDragReorder, useEscapeKey, useFocusTrap, useIsDarkMode, useIsDesktop, useIsLargeDesktop, useIsMobile, useIsMobileOrTablet, useIsSmallTablet, useIsTablet, useKeyboardInset, useKeyboardShortcut, useLiveAnnouncement, useMediaQuery, useMediaTransport, usePrefersReducedMotion, useScrollSpy, useStickToBottom, useStreamEndedBelowFold, useTheme, useTranscriptEdits, useYouTubeHoverPreview };
|
|
1006
|
+
export { type AnchoredPlacement, DEFAULT_FILLER_WORDS, DEFAULT_MIN_SILENCE_MS, DEFAULT_NL_SILENCE_MS, type Direction, type DragOverState, type FillerAnalysis, type HoverPreviewState, KEYBOARD_INSET_VAR, KEYBOARD_OPEN_ATTRIBUTE, KEYBOARD_SOURCE_ATTRIBUTE, type KeyboardInsetSource, type KeyboardInsetState, type KeyboardShortcutOptions, type MediaTransportState, RTL_LOCALES, type ResolvedTheme, type SilenceThresholdCount, type Theme, type TranscriptClipboard, type TranscriptEditStats, type UseAnchoredPositionOptions, type UseAnchoredPositionReturn, type UseDragReorderOptions, type UseDragReorderReturn, type UseKeyboardInsetOptions, type UseMediaTransportOptions, type UseMediaTransportReturn, type UseScrollSpyOptions, type UseScrollSpyReturn, type UseStickToBottomOptions, type UseStickToBottomReturn, type UseTranscriptEditsOptions, type UseTranscriptEditsResult, type UseYouTubeHoverPreviewOptions, type UseYouTubeHoverPreviewReturn, VISUAL_VIEWPORT_HEIGHT_VAR, VISUAL_VIEWPORT_OFFSET_TOP_VAR, buildPlaybackSegments, dragIndicatorClasses, getSpeedAtIndex, initEditableWords, insertSilences, isDarkMode, isRtlLocale, reorderIds, useAnchoredPosition, useClickOutside, useCommandK, useDirection, useDragReorder, useEscapeKey, useFocusTrap, useIsDarkMode, useIsDesktop, useIsLargeDesktop, useIsMobile, useIsMobileOrTablet, useIsSmallTablet, useIsTablet, useKeyboardInset, useKeyboardShortcut, useLiveAnnouncement, useMediaQuery, useMediaTransport, usePrefersReducedMotion, useScrollSpy, useStickToBottom, useStreamEndedBelowFold, useTheme, useTranscriptEdits, useYouTubeHoverPreview };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -226,6 +226,19 @@ declare const VISUAL_VIEWPORT_HEIGHT_VAR = "--mieweb-visual-viewport-height";
|
|
|
226
226
|
declare const VISUAL_VIEWPORT_OFFSET_TOP_VAR = "--mieweb-visual-viewport-offset-top";
|
|
227
227
|
/** Boolean attribute set on `<html>` while an on-screen keyboard is open. */
|
|
228
228
|
declare const KEYBOARD_OPEN_ATTRIBUTE = "data-keyboard-open";
|
|
229
|
+
/** Attribute on `<html>` naming the active {@link KeyboardInsetSource}. */
|
|
230
|
+
declare const KEYBOARD_SOURCE_ATTRIBUTE = "data-keyboard-source";
|
|
231
|
+
/**
|
|
232
|
+
* Where keyboard metrics come from.
|
|
233
|
+
*
|
|
234
|
+
* - `'visual-viewport'` — the Visual Viewport API. Works in any browser, but
|
|
235
|
+
* iOS only reports the keyboard once its slide-in animation has finished.
|
|
236
|
+
* - `'native'` — `keyboardWillShow` / `keyboardWillHide` window events with a
|
|
237
|
+
* `keyboardHeight` property, as fired by `cordova-plugin-ionic-keyboard` and
|
|
238
|
+
* Capacitor's Keyboard plugin. They arrive *before* the keyboard animates,
|
|
239
|
+
* so layout can move in step with it.
|
|
240
|
+
*/
|
|
241
|
+
type KeyboardInsetSource = 'visual-viewport' | 'native';
|
|
229
242
|
interface KeyboardInsetState {
|
|
230
243
|
/** Pixels of the layout viewport covered by the on-screen keyboard. */
|
|
231
244
|
keyboardInset: number;
|
|
@@ -235,9 +248,26 @@ interface KeyboardInsetState {
|
|
|
235
248
|
interface UseKeyboardInsetOptions {
|
|
236
249
|
/** Track the keyboard; `false` stops tracking and clears the CSS variables. @default true */
|
|
237
250
|
enabled?: boolean;
|
|
251
|
+
/** Where keyboard metrics come from. @default 'visual-viewport' */
|
|
252
|
+
source?: KeyboardInsetSource;
|
|
238
253
|
}
|
|
239
254
|
/**
|
|
240
|
-
* Tracks the on-screen keyboard
|
|
255
|
+
* Tracks the on-screen keyboard and publishes it on `<html>`.
|
|
256
|
+
*
|
|
257
|
+
* ### `source: 'native'` (Cordova / Capacitor apps)
|
|
258
|
+
*
|
|
259
|
+
* Listens for the native keyboard plugin's `keyboardWillShow` /
|
|
260
|
+
* `keyboardWillHide` window events. Configure the plugin so the WebView is
|
|
261
|
+
* neither resized nor panned (for `cordova-plugin-ionic-keyboard`:
|
|
262
|
+
* `KeyboardResize=false`), keep the app shell at full height, and move only
|
|
263
|
+
* the composer dock by `--mieweb-keyboard-inset` with a short transition
|
|
264
|
+
* (~250ms) so it rides up with the keyboard. Only `--mieweb-keyboard-inset`,
|
|
265
|
+
* `data-keyboard-open` and `data-keyboard-source` are published; the
|
|
266
|
+
* visual-viewport variables stay unset.
|
|
267
|
+
*
|
|
268
|
+
* ### `source: 'visual-viewport'` (browsers, default)
|
|
269
|
+
*
|
|
270
|
+
* Uses the Visual Viewport API.
|
|
241
271
|
*
|
|
242
272
|
* iOS Safari and WKWebView (Cordova) ignore
|
|
243
273
|
* `interactive-widget=resizes-content`, and `dvh` does not shrink for the
|
|
@@ -255,6 +285,10 @@ interface UseKeyboardInsetOptions {
|
|
|
255
285
|
* Android with `interactive-widget=resizes-content`) the inset stays 0 and
|
|
256
286
|
* the variables simply mirror the layout viewport.
|
|
257
287
|
*
|
|
288
|
+
* iOS reports the visual viewport only after the keyboard has finished
|
|
289
|
+
* animating, so a shell sized this way snaps into place once the keyboard
|
|
290
|
+
* lands. Prefer `source: 'native'` wherever a native keyboard plugin exists.
|
|
291
|
+
*
|
|
258
292
|
* Mount it once, near the app root.
|
|
259
293
|
*
|
|
260
294
|
* @example
|
|
@@ -273,6 +307,23 @@ interface UseKeyboardInsetOptions {
|
|
|
273
307
|
* );
|
|
274
308
|
* }
|
|
275
309
|
* ```
|
|
310
|
+
*
|
|
311
|
+
* @example Native app (keyboard plugin with WebView resizing disabled)
|
|
312
|
+
* ```tsx
|
|
313
|
+
* function ComposerDock({ children }) {
|
|
314
|
+
* useKeyboardInset({ source: 'native' });
|
|
315
|
+
* return (
|
|
316
|
+
* <div
|
|
317
|
+
* style={{
|
|
318
|
+
* paddingBottom: 'calc(var(--mieweb-keyboard-inset, 0px) + 0.5rem)',
|
|
319
|
+
* transition: 'padding-bottom 250ms ease',
|
|
320
|
+
* }}
|
|
321
|
+
* >
|
|
322
|
+
* {children}
|
|
323
|
+
* </div>
|
|
324
|
+
* );
|
|
325
|
+
* }
|
|
326
|
+
* ```
|
|
276
327
|
*/
|
|
277
328
|
declare function useKeyboardInset(options?: UseKeyboardInsetOptions): KeyboardInsetState;
|
|
278
329
|
|
|
@@ -952,4 +1003,4 @@ interface UseTranscriptEditsResult {
|
|
|
952
1003
|
*/
|
|
953
1004
|
declare function useTranscriptEdits(options: UseTranscriptEditsOptions): UseTranscriptEditsResult;
|
|
954
1005
|
|
|
955
|
-
export { type AnchoredPlacement, DEFAULT_FILLER_WORDS, DEFAULT_MIN_SILENCE_MS, DEFAULT_NL_SILENCE_MS, type Direction, type DragOverState, type FillerAnalysis, type HoverPreviewState, KEYBOARD_INSET_VAR, KEYBOARD_OPEN_ATTRIBUTE, type KeyboardInsetState, type KeyboardShortcutOptions, type MediaTransportState, RTL_LOCALES, type ResolvedTheme, type SilenceThresholdCount, type Theme, type TranscriptClipboard, type TranscriptEditStats, type UseAnchoredPositionOptions, type UseAnchoredPositionReturn, type UseDragReorderOptions, type UseDragReorderReturn, type UseKeyboardInsetOptions, type UseMediaTransportOptions, type UseMediaTransportReturn, type UseScrollSpyOptions, type UseScrollSpyReturn, type UseStickToBottomOptions, type UseStickToBottomReturn, type UseTranscriptEditsOptions, type UseTranscriptEditsResult, type UseYouTubeHoverPreviewOptions, type UseYouTubeHoverPreviewReturn, VISUAL_VIEWPORT_HEIGHT_VAR, VISUAL_VIEWPORT_OFFSET_TOP_VAR, buildPlaybackSegments, dragIndicatorClasses, getSpeedAtIndex, initEditableWords, insertSilences, isDarkMode, isRtlLocale, reorderIds, useAnchoredPosition, useClickOutside, useCommandK, useDirection, useDragReorder, useEscapeKey, useFocusTrap, useIsDarkMode, useIsDesktop, useIsLargeDesktop, useIsMobile, useIsMobileOrTablet, useIsSmallTablet, useIsTablet, useKeyboardInset, useKeyboardShortcut, useLiveAnnouncement, useMediaQuery, useMediaTransport, usePrefersReducedMotion, useScrollSpy, useStickToBottom, useStreamEndedBelowFold, useTheme, useTranscriptEdits, useYouTubeHoverPreview };
|
|
1006
|
+
export { type AnchoredPlacement, DEFAULT_FILLER_WORDS, DEFAULT_MIN_SILENCE_MS, DEFAULT_NL_SILENCE_MS, type Direction, type DragOverState, type FillerAnalysis, type HoverPreviewState, KEYBOARD_INSET_VAR, KEYBOARD_OPEN_ATTRIBUTE, KEYBOARD_SOURCE_ATTRIBUTE, type KeyboardInsetSource, type KeyboardInsetState, type KeyboardShortcutOptions, type MediaTransportState, RTL_LOCALES, type ResolvedTheme, type SilenceThresholdCount, type Theme, type TranscriptClipboard, type TranscriptEditStats, type UseAnchoredPositionOptions, type UseAnchoredPositionReturn, type UseDragReorderOptions, type UseDragReorderReturn, type UseKeyboardInsetOptions, type UseMediaTransportOptions, type UseMediaTransportReturn, type UseScrollSpyOptions, type UseScrollSpyReturn, type UseStickToBottomOptions, type UseStickToBottomReturn, type UseTranscriptEditsOptions, type UseTranscriptEditsResult, type UseYouTubeHoverPreviewOptions, type UseYouTubeHoverPreviewReturn, VISUAL_VIEWPORT_HEIGHT_VAR, VISUAL_VIEWPORT_OFFSET_TOP_VAR, buildPlaybackSegments, dragIndicatorClasses, getSpeedAtIndex, initEditableWords, insertSilences, isDarkMode, isRtlLocale, reorderIds, useAnchoredPosition, useClickOutside, useCommandK, useDirection, useDragReorder, useEscapeKey, useFocusTrap, useIsDarkMode, useIsDesktop, useIsLargeDesktop, useIsMobile, useIsMobileOrTablet, useIsSmallTablet, useIsTablet, useKeyboardInset, useKeyboardShortcut, useLiveAnnouncement, useMediaQuery, useMediaTransport, usePrefersReducedMotion, useScrollSpy, useStickToBottom, useStreamEndedBelowFold, useTheme, useTranscriptEdits, useYouTubeHoverPreview };
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { KEYBOARD_INSET_VAR, KEYBOARD_OPEN_ATTRIBUTE, RTL_LOCALES, VISUAL_VIEWPORT_HEIGHT_VAR, VISUAL_VIEWPORT_OFFSET_TOP_VAR, isRtlLocale, useCommandK, useDirection, useIsDesktop, useIsLargeDesktop, useIsMobile, useIsMobileOrTablet, useIsSmallTablet, useIsTablet, useKeyboardInset, useKeyboardShortcut, useMediaQuery } from '../chunk-
|
|
1
|
+
export { KEYBOARD_INSET_VAR, KEYBOARD_OPEN_ATTRIBUTE, KEYBOARD_SOURCE_ATTRIBUTE, RTL_LOCALES, VISUAL_VIEWPORT_HEIGHT_VAR, VISUAL_VIEWPORT_OFFSET_TOP_VAR, isRtlLocale, useCommandK, useDirection, useIsDesktop, useIsLargeDesktop, useIsMobile, useIsMobileOrTablet, useIsSmallTablet, useIsTablet, useKeyboardInset, useKeyboardShortcut, useMediaQuery } from '../chunk-GBUVIGD5.js';
|
|
2
2
|
export { useYouTubeHoverPreview } from '../chunk-POWS35OT.js';
|
|
3
3
|
export { useTheme } from '../chunk-KJZNEVYM.js';
|
|
4
4
|
export { useStickToBottom, useStreamEndedBelowFold } from '../chunk-BM35CACB.js';
|