@krak-stack/registry 0.10.4 → 0.10.6
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/CHANGELOG.md +20 -0
- package/dist/components/ui/animated-list.d.ts +6 -7
- package/dist/components/ui/animated-list.js +329 -139
- package/dist/components/ui/animated-number.js +47 -24
- package/dist/components/ui/auto-height.js +56 -15
- package/dist/components/ui/data-table.js +16 -13
- package/dist/components/ui/email-editor.d.ts +124 -0
- package/dist/components/ui/email-editor.js +2651 -0
- package/dist/components/ui/form.d.ts +5 -5
- package/dist/components/ui/presence-transition.d.ts +1 -1
- package/dist/components/ui/presence-transition.js +79 -26
- package/dist/components/ui/rich-text-editor.d.ts +70 -0
- package/dist/components/ui/rich-text-editor.js +1135 -0
- package/dist/components/ui/time-picker.d.ts +13 -4
- package/dist/components/ui/time-picker.js +141 -47
- package/dist/components/ui/time-picker.schema.d.ts +16 -2
- package/dist/lib/email-document/model.d.ts +26 -0
- package/dist/lib/email-document/model.js +253 -0
- package/dist/lib/email-document/render.d.ts +115 -0
- package/dist/lib/email-document/render.js +469 -0
- package/dist/lib/email-document/schema.d.ts +285 -0
- package/dist/lib/email-document/schema.js +139 -0
- package/dist/lib/krakmotion.d.ts +27 -0
- package/dist/lib/rich-text/dom.d.ts +40 -0
- package/dist/lib/rich-text/model.d.ts +19 -0
- package/dist/lib/rich-text/model.js +141 -0
- package/dist/lib/rich-text/schema.d.ts +64 -0
- package/dist/lib/rich-text/schema.js +53 -0
- package/dist/services/events/client/audit-log-table.js +16 -13
- package/dist/services/webhooks/client/delivery-table.js +16 -13
- package/package.json +29 -5
|
@@ -145,7 +145,7 @@ declare const RevertButton: ({ locale, messages, original, }: {
|
|
|
145
145
|
messages?: FormMessageTranslations;
|
|
146
146
|
original: string;
|
|
147
147
|
}) => JSX.Element | undefined;
|
|
148
|
-
declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tanstack/form
|
|
148
|
+
declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnChange extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TSubmitMeta>(props: import("@tanstack/react-form").FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
149
149
|
readonly TextField: typeof TextField;
|
|
150
150
|
readonly TextAreaField: typeof TextAreaField;
|
|
151
151
|
readonly SelectField: typeof SelectField;
|
|
@@ -161,7 +161,7 @@ declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tans
|
|
|
161
161
|
readonly FormError: typeof FormError;
|
|
162
162
|
readonly FieldWrapper: typeof FieldWrapper;
|
|
163
163
|
readonly BlockNavigation: typeof BlockNavigation;
|
|
164
|
-
}>, withForm: <TFormData, TOnMount extends undefined | import("@tanstack/form
|
|
164
|
+
}>, withForm: <TFormData, TOnMount extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnChange extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TSubmitMeta, TRenderProps extends object = {}>({ render, props, }: import("@tanstack/react-form").WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
165
165
|
readonly TextField: typeof TextField;
|
|
166
166
|
readonly TextAreaField: typeof TextAreaField;
|
|
167
167
|
readonly SelectField: typeof SelectField;
|
|
@@ -178,7 +178,7 @@ declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tans
|
|
|
178
178
|
readonly FieldWrapper: typeof FieldWrapper;
|
|
179
179
|
readonly BlockNavigation: typeof BlockNavigation;
|
|
180
180
|
}, TRenderProps>) => import("react").FunctionComponent<import("react").PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
|
|
181
|
-
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/form
|
|
181
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
|
|
182
182
|
readonly TextField: typeof TextField;
|
|
183
183
|
readonly TextAreaField: typeof TextAreaField;
|
|
184
184
|
readonly SelectField: typeof SelectField;
|
|
@@ -211,8 +211,8 @@ declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tans
|
|
|
211
211
|
readonly FormError: typeof FormError;
|
|
212
212
|
readonly FieldWrapper: typeof FieldWrapper;
|
|
213
213
|
readonly BlockNavigation: typeof BlockNavigation;
|
|
214
|
-
}, TSubmitMeta, TRenderProps>) => <TFormData, TFields extends import("@tanstack/form
|
|
215
|
-
form: import("@tanstack/react-form").AppFieldExtendedReactFieldGroupApi<unknown, TFormData, string | import("@tanstack/form
|
|
214
|
+
}, TSubmitMeta, TRenderProps>) => <TFormData, TFields extends import("@tanstack/react-form").DeepKeysOfType<TFormData, TFieldGroupData | null | undefined> | import("@tanstack/react-form").FieldsMap<TFormData, TFieldGroupData>, TOnMount extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnChange extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | import("@tanstack/react-form").FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData>, TFormSubmitMeta>(params: import("react").PropsWithChildren<NoInfer<TRenderProps> & {
|
|
215
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFieldGroupApi<unknown, TFormData, string | import("@tanstack/react-form").FieldsMap<unknown, TFormData>, any, any, any, any, any, any, any, any, any, any, unknown extends TSubmitMeta ? TFormSubmitMeta : TSubmitMeta, {
|
|
216
216
|
readonly TextField: typeof TextField;
|
|
217
217
|
readonly TextAreaField: typeof TextAreaField;
|
|
218
218
|
readonly SelectField: typeof SelectField;
|
|
@@ -6,4 +6,4 @@ export type PresenceTransitionProps = {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
};
|
|
8
8
|
/** Exit content becomes inert immediately, then unmounts after its animation. */
|
|
9
|
-
export declare const PresenceTransition: ({ open,
|
|
9
|
+
export declare const PresenceTransition: ({ open, children, duration, className, }: PresenceTransitionProps) => import("react").JSX.Element | null;
|
|
@@ -1,40 +1,93 @@
|
|
|
1
|
-
// ../../src/
|
|
1
|
+
// ../../src/lib/krakmotion.ts
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
useEffect,
|
|
4
|
+
useEffectEvent,
|
|
5
|
+
useLayoutEffect,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
useSyncExternalStore
|
|
9
|
+
} from "react";
|
|
10
|
+
var useBrowserLayoutEffect = globalThis.window ? useLayoutEffect : useEffect;
|
|
11
|
+
var reducedMotionQuery = "(prefers-reduced-motion: reduce)";
|
|
12
|
+
var subscribeReducedMotion = (notify) => {
|
|
13
|
+
const query = window.matchMedia?.(reducedMotionQuery);
|
|
14
|
+
query?.addEventListener("change", notify);
|
|
15
|
+
return () => query?.removeEventListener("change", notify);
|
|
16
|
+
};
|
|
17
|
+
var useReducedMotion = () => useSyncExternalStore(subscribeReducedMotion, () => window.matchMedia?.(reducedMotionQuery).matches ?? true, () => true);
|
|
18
|
+
var animateElement = (element, frames, duration, complete) => {
|
|
19
|
+
if (duration <= 0 || !element.animate) {
|
|
20
|
+
complete?.();
|
|
21
|
+
return () => {};
|
|
22
|
+
}
|
|
23
|
+
const animation = element.animate(frames, {
|
|
24
|
+
duration,
|
|
25
|
+
easing: "cubic-bezier(0.2, 0, 0, 1)"
|
|
26
|
+
});
|
|
27
|
+
animation.onfinish = () => complete?.();
|
|
28
|
+
return () => {
|
|
29
|
+
animation.onfinish = null;
|
|
30
|
+
animation.cancel();
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
var usePresence = (open, duration) => {
|
|
34
|
+
const ref = useRef(null);
|
|
35
|
+
const [retained, setRetained] = useState(open);
|
|
36
|
+
const reduced = useReducedMotion();
|
|
37
|
+
const lastOpen = useRef(open);
|
|
38
|
+
const transitioning = useRef(false);
|
|
39
|
+
const snapshot = useRef(null);
|
|
40
|
+
if (open && !retained)
|
|
41
|
+
setRetained(true);
|
|
42
|
+
useBrowserLayoutEffect(() => {
|
|
43
|
+
const element = ref.current;
|
|
44
|
+
if (lastOpen.current === open && !transitioning.current)
|
|
45
|
+
return;
|
|
46
|
+
lastOpen.current = open;
|
|
47
|
+
if (!element)
|
|
48
|
+
return;
|
|
49
|
+
transitioning.current = true;
|
|
50
|
+
const from = snapshot.current ?? (open ? { opacity: "0", transform: "translateY(4px)" } : { opacity: "1", transform: "none" });
|
|
51
|
+
snapshot.current = null;
|
|
52
|
+
let settled = false;
|
|
53
|
+
const cancel = animateElement(element, [
|
|
54
|
+
from,
|
|
55
|
+
{ opacity: open ? 1 : 0, transform: open ? "none" : "translateY(4px)" }
|
|
56
|
+
], reduced ? 0 : Math.max(0, duration), () => {
|
|
57
|
+
settled = true;
|
|
58
|
+
transitioning.current = false;
|
|
59
|
+
snapshot.current = null;
|
|
60
|
+
if (!open)
|
|
61
|
+
setRetained(false);
|
|
62
|
+
});
|
|
63
|
+
return () => {
|
|
64
|
+
snapshot.current = settled ? null : {
|
|
65
|
+
opacity: getComputedStyle(element).opacity,
|
|
66
|
+
transform: getComputedStyle(element).transform
|
|
67
|
+
};
|
|
68
|
+
cancel();
|
|
69
|
+
};
|
|
70
|
+
}, [open, retained, duration, reduced]);
|
|
71
|
+
return { ref, mounted: open || retained };
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// ../../src/components/ui/presence-transition.tsx
|
|
8
75
|
import { jsx } from "react/jsx-runtime";
|
|
9
76
|
var PresenceTransition = ({
|
|
10
77
|
open,
|
|
11
|
-
...props
|
|
12
|
-
}) => /* @__PURE__ */ jsx(AnimatePresence, {
|
|
13
|
-
initial: false,
|
|
14
|
-
children: open ? /* @__PURE__ */ jsx(PresenceContent, {
|
|
15
|
-
...props
|
|
16
|
-
}, "content") : null
|
|
17
|
-
});
|
|
18
|
-
var PresenceContent = ({
|
|
19
78
|
children,
|
|
20
79
|
duration = 180,
|
|
21
80
|
className
|
|
22
81
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
82
|
+
const { ref, mounted } = usePresence(open, duration);
|
|
83
|
+
return mounted ? /* @__PURE__ */ jsx("div", {
|
|
84
|
+
ref,
|
|
26
85
|
"data-slot": "presence-transition",
|
|
27
86
|
className,
|
|
28
|
-
inert: !
|
|
29
|
-
"aria-hidden": !
|
|
30
|
-
initial: { opacity: 0, y: reduced !== false ? 0 : 4 },
|
|
31
|
-
animate: { opacity: 1, y: 0 },
|
|
32
|
-
exit: { opacity: 0, y: reduced !== false ? 0 : 4 },
|
|
33
|
-
transition: {
|
|
34
|
-
duration: reduced !== false ? 0 : Math.max(0, duration) / 1000
|
|
35
|
-
},
|
|
87
|
+
inert: !open,
|
|
88
|
+
"aria-hidden": !open ? true : undefined,
|
|
36
89
|
children
|
|
37
|
-
});
|
|
90
|
+
}) : null;
|
|
38
91
|
};
|
|
39
92
|
export {
|
|
40
93
|
PresenceTransition
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
import { RichTextDocument, type RichTextVariable } from "../../lib/rich-text/schema.js";
|
|
3
|
+
declare const labels: {
|
|
4
|
+
en: {
|
|
5
|
+
bold: string;
|
|
6
|
+
italic: string;
|
|
7
|
+
underline: string;
|
|
8
|
+
undo: string;
|
|
9
|
+
redo: string;
|
|
10
|
+
link: string;
|
|
11
|
+
unlink: string;
|
|
12
|
+
linkUrl: string;
|
|
13
|
+
apply: string;
|
|
14
|
+
variable: string;
|
|
15
|
+
paragraph: string;
|
|
16
|
+
heading: string;
|
|
17
|
+
bullet: string;
|
|
18
|
+
numbered: string;
|
|
19
|
+
toolbar: string;
|
|
20
|
+
invalid: string;
|
|
21
|
+
invalidLink: string;
|
|
22
|
+
cancel: string;
|
|
23
|
+
};
|
|
24
|
+
fr: {
|
|
25
|
+
bold: string;
|
|
26
|
+
italic: string;
|
|
27
|
+
underline: string;
|
|
28
|
+
undo: string;
|
|
29
|
+
redo: string;
|
|
30
|
+
link: string;
|
|
31
|
+
unlink: string;
|
|
32
|
+
linkUrl: string;
|
|
33
|
+
apply: string;
|
|
34
|
+
variable: string;
|
|
35
|
+
paragraph: string;
|
|
36
|
+
heading: string;
|
|
37
|
+
bullet: string;
|
|
38
|
+
numbered: string;
|
|
39
|
+
toolbar: string;
|
|
40
|
+
invalid: string;
|
|
41
|
+
invalidLink: string;
|
|
42
|
+
cancel: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export type RichTextEditorMessages = {
|
|
46
|
+
[K in keyof typeof labels.en]: string;
|
|
47
|
+
};
|
|
48
|
+
export type RichTextEditorProps = {
|
|
49
|
+
value: RichTextDocument;
|
|
50
|
+
onChange: (value: RichTextDocument) => void;
|
|
51
|
+
label: string;
|
|
52
|
+
variables?: readonly RichTextVariable[];
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
locale?: string;
|
|
55
|
+
messages?: Partial<Record<string, Partial<RichTextEditorMessages>>>;
|
|
56
|
+
className?: string;
|
|
57
|
+
contentStyle?: CSSProperties;
|
|
58
|
+
/** Plain single-line text with atomic variables, suitable for email headers. */
|
|
59
|
+
singleLine?: boolean;
|
|
60
|
+
/** Limit serialized text, including {{variable}} tokens. */
|
|
61
|
+
maxLength?: number;
|
|
62
|
+
};
|
|
63
|
+
export declare const RichTextContent: ({ value, variables, values, }: {
|
|
64
|
+
value: RichTextDocument;
|
|
65
|
+
variables?: readonly RichTextVariable[];
|
|
66
|
+
values?: Readonly<Record<string, string>>;
|
|
67
|
+
}) => import("react").JSX.Element;
|
|
68
|
+
/** Native editable DOM is normalized into a constrained, HTML-free document. */
|
|
69
|
+
export declare const RichTextEditor: ({ value, onChange, label, variables, disabled, locale: override, messages, className, contentStyle, singleLine, maxLength, }: RichTextEditorProps) => import("react").JSX.Element;
|
|
70
|
+
export {};
|