@protobase/ui 0.40.0 → 0.40.2
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/connect/interaction-guard.d.ts +19 -0
- package/dist/connect/interaction-guard.js +3 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/package.js +1 -1
- package/dist/shell/assets/{app-UQvWkFmG.js → app-DhDdlFwl.js} +7 -7
- package/dist/shell/assets/{index-cnTN1sFa.js → index-CUgUnNKd.js} +2 -2
- package/dist/shell/assets/{records-map-Dk3ltaYh.js → records-map-DqpfdQ-u.js} +2 -2
- package/dist/shell/assets/shared-protobase-ui-Bg4CVFJU.js +2 -0
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/app-DhDdlFwl.js.map +1 -0
- package/dist/shell-source-maps/assets/{index-cnTN1sFa.js.map → index-CUgUnNKd.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-Dk3ltaYh.js.map → records-map-DqpfdQ-u.js.map} +1 -1
- package/dist/shell-source-maps/assets/shared-protobase-ui-Bg4CVFJU.js.map +1 -0
- package/package.json +4 -4
- package/dist/shell/assets/shared-protobase-ui-SkP04K7-.js +0 -2
- package/dist/shell-source-maps/assets/app-UQvWkFmG.js.map +0 -1
- package/dist/shell-source-maps/assets/shared-protobase-ui-SkP04K7-.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/connect/interaction-guard.d.ts
|
|
2
|
+
/** How long the connect page must have been in front, visible and focused, before Allow takes a click. */
|
|
3
|
+
export declare const allowDelayMs = 500;
|
|
4
|
+
/** Whether the page runs inside another page's frame; comparing the two windows works across origins and in a sandbox. */
|
|
5
|
+
export declare const isFramed: (win?: {
|
|
6
|
+
top: unknown;
|
|
7
|
+
self: unknown;
|
|
8
|
+
}) => boolean;
|
|
9
|
+
/** Whether the page has been in front for `delayMs` (`armAfterFocus`), as React state. */
|
|
10
|
+
export declare const useArmedAfterFocus: (delayMs: number) => boolean;
|
|
11
|
+
/** The handlers of a button guarded by `armed`: its press must begin while armed for its click to act (`pressGate`). */
|
|
12
|
+
export declare const useGuardedPress: (armed: boolean, onPress: () => void) => {
|
|
13
|
+
onPointerDown: () => void;
|
|
14
|
+
onKeyDown: (event: {
|
|
15
|
+
repeat: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
//#region src/connect/interaction-guard.ts
|
|
3
|
+
/** How long the connect page must have been in front, visible and focused, before Allow takes a click. */
|
|
4
|
+
const allowDelayMs = 500;
|
|
3
5
|
/** Whether the page runs inside another page's frame; comparing the two windows works across origins and in a sandbox. */
|
|
4
6
|
const isFramed = (win = window) => win.top !== win.self;
|
|
5
7
|
/**
|
|
@@ -74,4 +76,4 @@ const useGuardedPress = (armed, onPress) => {
|
|
|
74
76
|
};
|
|
75
77
|
};
|
|
76
78
|
//#endregion
|
|
77
|
-
export { armAfterFocus, isFramed, pressGate, useArmedAfterFocus, useGuardedPress };
|
|
79
|
+
export { allowDelayMs, armAfterFocus, isFramed, pressGate, useArmedAfterFocus, useGuardedPress };
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ import { Markdown } from "./markdown/markdown.js";
|
|
|
52
52
|
import { AuthLayout, AuthLayoutProps } from "./auth/auth-layout.js";
|
|
53
53
|
import { CodeForm, CodeFormProps } from "./auth/code-form.js";
|
|
54
54
|
import { ResendCodeButton, ResendCodeButtonProps } from "./auth/resend-code-button.js";
|
|
55
|
+
import { allowDelayMs, isFramed, useArmedAfterFocus, useGuardedPress } from "./connect/interaction-guard.js";
|
|
55
56
|
import { Button, ButtonProps, buttonClass } from "./primitives/button.js";
|
|
56
57
|
import { Input, InputProps } from "./primitives/input.js";
|
|
57
58
|
import { Textarea, TextareaProps } from "./primitives/textarea.js";
|
|
@@ -65,4 +66,4 @@ import { Section } from "./record-view/section.js";
|
|
|
65
66
|
import { Form, FormProps } from "./app/create/form.js";
|
|
66
67
|
import { RecordPicker, RecordPickerProps } from "./app/record-picker.js";
|
|
67
68
|
import { Spinner } from "./primitives/spinner.js";
|
|
68
|
-
export { ActionCard, type ActionCardProps, type ActionContext, type ActionHandler, ActionInputError, type ActionInputProps, ApiProvider, type ApiProviderProps, App, AppLink, type AppProps, AssistantDock, type AssistantDockProps, AuthLayout, type AuthLayoutProps, type BackendData, type BackendRefresh, type BeforeSignInProps, type BoardDrop, type BoardDropContext, type BoardDropUndo, type BoardDropWrite, Button, type ButtonProps, type CardAction, type CardTone, ChatMessage, ChatThread, type ChatThreadProps, type ChoiceOption, Choices, type ChoicesProps, CodeForm, type CodeFormProps, CompactTable, type CompactTableProps, Composer, type ComposerProps, type CurrentAddress, Dialog, type DialogProps, type DiffLine, DiffView, type DiffViewProps, type Drop, type DropRule, Field, FieldList, type FieldProps, type FieldWidget, type FieldWidgetEditorProps, type FieldWidgetProps, Form, type FormProps, Input, type InputProps, type LayoutRecord, type ListAddress, type ListChange, type ListDisplay, type ListDisplayRow, LogoMark, Markdown, type MarkdownContentProps as MarkdownProps, MenuSelect, type MenuSelectProps, type MetaData, OtpInput, type OtpInputProps, PartView, type PluginInfo, type ProjectUi, type RecordCardProps, RecordLink, RecordPicker, type RecordPickerProps, ResendCodeButton, type ResendCodeButtonProps, ResponsiveDialog, type ResponsiveDialogProps, Section, Segmented, type SegmentedOption, type SegmentedProps, type ShellLogoProps, SidePanel, type SidePanelProps, SignInPrompt, type SignInPromptProps, Spinner, type Step, StepList, type StepState, Textarea, type TextareaProps, buttonClass, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useFieldControl, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
|
69
|
+
export { ActionCard, type ActionCardProps, type ActionContext, type ActionHandler, ActionInputError, type ActionInputProps, ApiProvider, type ApiProviderProps, App, AppLink, type AppProps, AssistantDock, type AssistantDockProps, AuthLayout, type AuthLayoutProps, type BackendData, type BackendRefresh, type BeforeSignInProps, type BoardDrop, type BoardDropContext, type BoardDropUndo, type BoardDropWrite, Button, type ButtonProps, type CardAction, type CardTone, ChatMessage, ChatThread, type ChatThreadProps, type ChoiceOption, Choices, type ChoicesProps, CodeForm, type CodeFormProps, CompactTable, type CompactTableProps, Composer, type ComposerProps, type CurrentAddress, Dialog, type DialogProps, type DiffLine, DiffView, type DiffViewProps, type Drop, type DropRule, Field, FieldList, type FieldProps, type FieldWidget, type FieldWidgetEditorProps, type FieldWidgetProps, Form, type FormProps, Input, type InputProps, type LayoutRecord, type ListAddress, type ListChange, type ListDisplay, type ListDisplayRow, LogoMark, Markdown, type MarkdownContentProps as MarkdownProps, MenuSelect, type MenuSelectProps, type MetaData, OtpInput, type OtpInputProps, PartView, type PluginInfo, type ProjectUi, type RecordCardProps, RecordLink, RecordPicker, type RecordPickerProps, ResendCodeButton, type ResendCodeButtonProps, ResponsiveDialog, type ResponsiveDialogProps, Section, Segmented, type SegmentedOption, type SegmentedProps, type ShellLogoProps, SidePanel, type SidePanelProps, SignInPrompt, type SignInPromptProps, Spinner, type Step, StepList, type StepState, Textarea, type TextareaProps, allowDelayMs, buttonClass, definePlugin, defineUi, diffStats, isConflict, isFramed, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useArmedAfterFocus, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useFieldControl, useGuardedPress, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { ResponsiveDialog } from "./primitives/responsive-dialog.js";
|
|
|
10
10
|
import { SignInPrompt } from "./auth/sign-in-prompt.js";
|
|
11
11
|
import { ApiProvider, useClient, useResourceClient } from "./data/api-provider.js";
|
|
12
12
|
import { useMeta } from "./data/use-meta.js";
|
|
13
|
+
import { allowDelayMs, isFramed, useArmedAfterFocus, useGuardedPress } from "./connect/interaction-guard.js";
|
|
13
14
|
import { AuthLayout } from "./auth/auth-layout.js";
|
|
14
15
|
import { ResendCodeButton } from "./auth/resend-code-button.js";
|
|
15
16
|
import { CodeForm } from "./auth/code-form.js";
|
|
@@ -52,4 +53,4 @@ import { App } from "./app/app.js";
|
|
|
52
53
|
import { RecordLink } from "./app/displays/record-link.js";
|
|
53
54
|
import { Choices } from "./primitives/choices.js";
|
|
54
55
|
import { RecordPicker } from "./app/record-picker.js";
|
|
55
|
-
export { ActionCard, ActionInputError, ApiProvider, App, AppLink, AssistantDock, AuthLayout, Button, ChatMessage, ChatThread, Choices, CodeForm, CompactTable, Composer, Dialog, DiffView, Field, FieldList, Form, Input, LogoMark, Markdown, MenuSelect, OtpInput, PartView, RecordLink, RecordPicker, ResendCodeButton, ResponsiveDialog, Section, Segmented, SidePanel, SignInPrompt, Spinner, StepList, Textarea, buttonClass, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useFieldControl, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
|
56
|
+
export { ActionCard, ActionInputError, ApiProvider, App, AppLink, AssistantDock, AuthLayout, Button, ChatMessage, ChatThread, Choices, CodeForm, CompactTable, Composer, Dialog, DiffView, Field, FieldList, Form, Input, LogoMark, Markdown, MenuSelect, OtpInput, PartView, RecordLink, RecordPicker, ResendCodeButton, ResponsiveDialog, Section, Segmented, SidePanel, SignInPrompt, Spinner, StepList, Textarea, allowDelayMs, buttonClass, definePlugin, defineUi, diffStats, isConflict, isFramed, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useArmedAfterFocus, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useFieldControl, useGuardedPress, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
package/dist/package.js
CHANGED