@mittwald/flow-react-components 0.2.0-alpha.711 → 0.2.0-alpha.713
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 +12 -0
- package/dist/assets/doc-properties.json +1174 -1131
- package/dist/js/components/src/components/Action/AbortActionError.mjs +19 -0
- package/dist/js/components/src/components/Action/AbortActionError.mjs.map +1 -0
- package/dist/js/components/src/components/Action/lib/abortAction.mjs +10 -0
- package/dist/js/components/src/components/Action/lib/abortAction.mjs.map +1 -0
- package/dist/js/components/src/components/Action/models/ActionExecution.mjs +3 -3
- package/dist/js/components/src/components/Action/models/ActionExecution.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs +4 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.mjs +7 -3
- package/dist/js/components/src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.mjs +13 -0
- package/dist/js/components/src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.mjs.map +1 -0
- package/dist/js/default.mjs +2 -1
- package/dist/js/default.mjs.map +1 -1
- package/dist/js/react-hook-form.mjs +1 -0
- package/dist/js/react-hook-form.mjs.map +1 -1
- package/dist/types/components/Action/AbortActionError.d.ts +6 -0
- package/dist/types/components/Action/AbortActionError.d.ts.map +1 -0
- package/dist/types/components/Action/index.d.ts +2 -1
- package/dist/types/components/Action/index.d.ts.map +1 -1
- package/dist/types/components/Action/lib/abortAction.d.ts +2 -0
- package/dist/types/components/Action/lib/abortAction.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.d.ts +12 -0
- package/dist/types/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/components/FormSettingsProvider/index.d.ts +2 -0
- package/dist/types/integrations/react-hook-form/components/FormSettingsProvider/index.d.ts.map +1 -0
- package/dist/types/integrations/react-hook-form/index.d.ts +1 -0
- package/dist/types/integrations/react-hook-form/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/js/components/src/components/Action/MutedActionError.mjs +0 -19
- package/dist/js/components/src/components/Action/MutedActionError.mjs.map +0 -1
- package/dist/types/components/Action/MutedActionError.d.ts +0 -6
- package/dist/types/components/Action/MutedActionError.d.ts.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
class AbortActionError extends Error {
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = "AbortActionError";
|
|
7
|
+
}
|
|
8
|
+
static isAbortActionError(error) {
|
|
9
|
+
return error instanceof AbortActionError;
|
|
10
|
+
}
|
|
11
|
+
static rethrowIfNotAborted(error) {
|
|
12
|
+
if (!AbortActionError.isAbortActionError(error)) {
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { AbortActionError };
|
|
19
|
+
//# sourceMappingURL=AbortActionError.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbortActionError.mjs","sources":["../../../../../../src/components/Action/AbortActionError.ts"],"sourcesContent":["export class AbortActionError extends Error {\n public constructor(message?: string) {\n super(message);\n this.name = \"AbortActionError\";\n }\n\n public static isAbortActionError(error: unknown): error is AbortActionError {\n return error instanceof AbortActionError;\n }\n\n public static rethrowIfNotAborted(error: unknown): void {\n if (!AbortActionError.isAbortActionError(error)) {\n throw error;\n }\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,yBAAyB,KAAA,CAAM;AAAA,EACnC,YAAY,OAAA,EAAkB;AACnC,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AAAA,EACd;AAAA,EAEA,OAAc,mBAAmB,KAAA,EAA2C;AAC1E,IAAA,OAAO,KAAA,YAAiB,gBAAA;AAAA,EAC1B;AAAA,EAEA,OAAc,oBAAoB,KAAA,EAAsB;AACtD,IAAA,IAAI,CAAC,gBAAA,CAAiB,kBAAA,CAAmB,KAAK,CAAA,EAAG;AAC/C,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abortAction.mjs","sources":["../../../../../../../src/components/Action/lib/abortAction.ts"],"sourcesContent":["import { AbortActionError } from \"@/components/Action/AbortActionError\";\n\nexport const abortAction: (message?: string) => never = (message) => {\n throw new AbortActionError(message);\n};\n"],"names":[],"mappings":";;AAEO,MAAM,WAAA,GAA2C,CAAC,OAAA,KAAY;AACnE,EAAA,MAAM,IAAI,iBAAiB,OAAO,CAAA;AACpC;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { ActionExecutionBatch } from './ActionExecutionBatch.mjs';
|
|
4
4
|
import { callFunctionsInOrder } from '../../../lib/promises/callFunctionsInOrder.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { AbortActionError } from '../AbortActionError.mjs';
|
|
6
6
|
|
|
7
7
|
class ActionExecution {
|
|
8
8
|
action;
|
|
@@ -18,11 +18,11 @@ class ActionExecution {
|
|
|
18
18
|
const maybePromise = executeBatchedActions(...args);
|
|
19
19
|
if (maybePromise instanceof Promise) {
|
|
20
20
|
maybePromise.catch((error) => {
|
|
21
|
-
|
|
21
|
+
AbortActionError.rethrowIfNotAborted(error);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
} catch (error) {
|
|
25
|
-
|
|
25
|
+
AbortActionError.rethrowIfNotAborted(error);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
getBatchedActions = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionExecution.mjs","sources":["../../../../../../../src/components/Action/models/ActionExecution.tsx"],"sourcesContent":["import type { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport { ActionExecutionBatch } from \"@/components/Action/models/ActionExecutionBatch\";\nimport { callFunctionsInOrder } from \"@/lib/promises/callFunctionsInOrder\";\nimport {
|
|
1
|
+
{"version":3,"file":"ActionExecution.mjs","sources":["../../../../../../../src/components/Action/models/ActionExecution.tsx"],"sourcesContent":["import type { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport { ActionExecutionBatch } from \"@/components/Action/models/ActionExecutionBatch\";\nimport { callFunctionsInOrder } from \"@/lib/promises/callFunctionsInOrder\";\nimport { AbortActionError } from \"@/components/Action/AbortActionError\";\n\nexport class ActionExecution {\n private readonly action: ActionModel;\n\n public constructor(action: ActionModel) {\n this.action = action;\n }\n\n public execute = (...args: unknown[]): void => {\n const batches = this.getBatchedActions();\n\n const executeBatchedActions = callFunctionsInOrder(\n batches.map((b) => b.executeBatch.bind(b)),\n );\n\n try {\n const maybePromise = executeBatchedActions(...args);\n if (maybePromise instanceof Promise) {\n maybePromise.catch((error) => {\n AbortActionError.rethrowIfNotAborted(error);\n });\n }\n } catch (error) {\n AbortActionError.rethrowIfNotAborted(error);\n }\n };\n\n private getBatchedActions = (): ActionExecutionBatch[] => {\n let currentAction: ActionModel | undefined = this.action;\n\n const batches: ActionExecutionBatch[] = [];\n let currentBatch: ActionExecutionBatch = new ActionExecutionBatch(\n this.action,\n );\n\n let skipCount = 0;\n\n while (currentAction) {\n const { onAction, break: $break, skip } = currentAction.actionProps;\n\n if (currentAction.needsConfirmation) {\n currentBatch.addAction(currentAction);\n break;\n }\n\n if (skip) {\n skipCount = skip === true ? 1 : skip;\n currentAction = currentAction.parentAction;\n continue;\n }\n\n if (skipCount > 0) {\n currentAction = currentAction.parentAction;\n skipCount--;\n continue;\n }\n\n if ($break) {\n break;\n }\n\n if (onAction) {\n currentBatch.addAction(currentAction);\n } else {\n batches.push(currentBatch);\n currentBatch = new ActionExecutionBatch(this.action);\n currentBatch.addAction(currentAction);\n }\n\n currentAction = currentAction.parentAction;\n }\n\n batches.push(currentBatch);\n return batches;\n };\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,eAAA,CAAgB;AAAA,EACV,MAAA;AAAA,EAEV,YAAY,MAAA,EAAqB;AACtC,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAAA,EAChB;AAAA,EAEO,OAAA,GAAU,IAAI,IAAA,KAA0B;AAC7C,IAAA,MAAM,OAAA,GAAU,KAAK,iBAAA,EAAkB;AAEvC,IAAA,MAAM,qBAAA,GAAwB,oBAAA;AAAA,MAC5B,OAAA,CAAQ,IAAI,CAAC,CAAA,KAAM,EAAE,YAAA,CAAa,IAAA,CAAK,CAAC,CAAC;AAAA,KAC3C;AAEA,IAAA,IAAI;AACF,MAAA,MAAM,YAAA,GAAe,qBAAA,CAAsB,GAAG,IAAI,CAAA;AAClD,MAAA,IAAI,wBAAwB,OAAA,EAAS;AACnC,QAAA,YAAA,CAAa,KAAA,CAAM,CAAC,KAAA,KAAU;AAC5B,UAAA,gBAAA,CAAiB,oBAAoB,KAAK,CAAA;AAAA,QAC5C,CAAC,CAAA;AAAA,MACH;AAAA,IACF,SAAS,KAAA,EAAO;AACd,MAAA,gBAAA,CAAiB,oBAAoB,KAAK,CAAA;AAAA,IAC5C;AAAA,EACF,CAAA;AAAA,EAEQ,oBAAoB,MAA8B;AACxD,IAAA,IAAI,gBAAyC,IAAA,CAAK,MAAA;AAElD,IAAA,MAAM,UAAkC,EAAC;AACzC,IAAA,IAAI,eAAqC,IAAI,oBAAA;AAAA,MAC3C,IAAA,CAAK;AAAA,KACP;AAEA,IAAA,IAAI,SAAA,GAAY,CAAA;AAEhB,IAAA,OAAO,aAAA,EAAe;AACpB,MAAA,MAAM,EAAE,QAAA,EAAU,KAAA,EAAO,MAAA,EAAQ,IAAA,KAAS,aAAA,CAAc,WAAA;AAExD,MAAA,IAAI,cAAc,iBAAA,EAAmB;AACnC,QAAA,YAAA,CAAa,UAAU,aAAa,CAAA;AACpC,QAAA;AAAA,MACF;AAEA,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,SAAA,GAAY,IAAA,KAAS,OAAO,CAAA,GAAI,IAAA;AAChC,QAAA,aAAA,GAAgB,aAAA,CAAc,YAAA;AAC9B,QAAA;AAAA,MACF;AAEA,MAAA,IAAI,YAAY,CAAA,EAAG;AACjB,QAAA,aAAA,GAAgB,aAAA,CAAc,YAAA;AAC9B,QAAA,SAAA,EAAA;AACA,QAAA;AAAA,MACF;AAEA,MAAA,IAAI,MAAA,EAAQ;AACV,QAAA;AAAA,MACF;AAEA,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,YAAA,CAAa,UAAU,aAAa,CAAA;AAAA,MACtC,CAAA,MAAO;AACL,QAAA,OAAA,CAAQ,KAAK,YAAY,CAAA;AACzB,QAAA,YAAA,GAAe,IAAI,oBAAA,CAAqB,IAAA,CAAK,MAAM,CAAA;AACnD,QAAA,YAAA,CAAa,UAAU,aAAa,CAAA;AAAA,MACtC;AAEA,MAAA,aAAA,GAAgB,aAAA,CAAc,YAAA;AAAA,IAChC;AAEA,IAAA,OAAA,CAAQ,KAAK,YAAY,CAAA;AACzB,IAAA,OAAO,OAAA;AAAA,EACT,CAAA;AACF;;;;"}
|
|
@@ -12,13 +12,14 @@ import '../../../../lib/controller/overlay/context.mjs';
|
|
|
12
12
|
import { FormProvider } from 'react-hook-form';
|
|
13
13
|
import { useFormRootErrorController } from '../FormRootError/useFormRootErrorController.mjs';
|
|
14
14
|
import { FormRootError } from '../../lib/FormRootError.mjs';
|
|
15
|
+
import { useFormSettings } from '../FormSettingsProvider/FormSettingsProvider.mjs';
|
|
15
16
|
|
|
16
17
|
const DefaultFormComponent = (p) => /* @__PURE__ */ jsx("form", { ...p });
|
|
17
18
|
function Form(props) {
|
|
18
19
|
const {
|
|
19
20
|
form,
|
|
20
21
|
children,
|
|
21
|
-
onSubmit,
|
|
22
|
+
onSubmit: onSubmitProp,
|
|
22
23
|
formComponent = DefaultFormComponent,
|
|
23
24
|
isReadOnly,
|
|
24
25
|
ref,
|
|
@@ -42,6 +43,8 @@ function Form(props) {
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
});
|
|
46
|
+
const { submitInterceptor } = useFormSettings();
|
|
47
|
+
const onSubmit = submitInterceptor ? (values) => submitInterceptor(onSubmitProp, values) : onSubmitProp;
|
|
45
48
|
const handleSubmitResult = (result) => {
|
|
46
49
|
if (typeof result === "function") {
|
|
47
50
|
afterSubmitCallback.current = result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import ConfirmUnsavedChangesModal from \"@/components/Modal/components/ConfirmUnsavedChangesModal\";\nimport { useHotkeySubmit } from \"@/integrations/react-hook-form/components/Form/useHotkeySubmit\";\nimport { FormContextProvider } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport { flags } from \"@/integrations/react-hook-form/flags\";\nimport { useModalController } from \"@/lib/controller\";\nimport {\n type
|
|
1
|
+
{"version":3,"file":"Form.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import ConfirmUnsavedChangesModal from \"@/components/Modal/components/ConfirmUnsavedChangesModal\";\nimport { useHotkeySubmit } from \"@/integrations/react-hook-form/components/Form/useHotkeySubmit\";\nimport { FormContextProvider } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport { flags } from \"@/integrations/react-hook-form/flags\";\nimport { useModalController } from \"@/lib/controller\";\nimport {\n type BaseSyntheticEvent,\n type ComponentProps,\n type FC,\n type FormEventHandler,\n type PropsWithChildren,\n type Ref,\n useId,\n useMemo,\n useRef,\n} from \"react\";\nimport type {\n FieldValues,\n Path,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\nimport { useFormRootErrorController } from \"../FormRootError/useFormRootErrorController\";\nimport { FormRootError } from \"../../lib/FormRootError\";\nimport { useFormSettings } from \"../FormSettingsProvider/FormSettingsProvider\";\n\nexport type FormOnSubmitHandler<F extends FieldValues> = SubmitHandler<F>;\n\nexport type AfterFormSubmitCallback = (...unknownArgs: unknown[]) => unknown;\n\nexport interface FormAutoResetOptions {\n onAfterModalClose?: boolean;\n}\n\ntype FormComponentType = FC<\n PropsWithChildren<{\n id: string;\n onSubmit?: FormEventHandler | FormOnSubmitHandler<never>;\n ref?: Ref<HTMLFormElement>;\n }>\n>;\n\nexport interface FormProps<F extends FieldValues>\n extends Omit<ComponentProps<\"form\">, \"onSubmit\">, PropsWithChildren {\n form: UseFormReturn<F>;\n onSubmit: FormOnSubmitHandler<F>;\n formComponent?: FC<Omit<FormComponentType, \"ref\">>;\n isReadOnly?: boolean;\n autoReset?: FormAutoResetOptions | boolean;\n}\n\nconst DefaultFormComponent: FormComponentType = (p) => <form {...p} />;\n\nexport function Form<F extends FieldValues>(props: FormProps<F>) {\n const {\n form,\n children,\n onSubmit: onSubmitProp,\n formComponent = DefaultFormComponent,\n isReadOnly,\n ref,\n id: idProp,\n autoReset = true,\n ...formProps\n } = props;\n\n const newFormId = useId();\n const formId = idProp ?? newFormId;\n const FormComponent = useMemo(() => formComponent, [formId]);\n const afterSubmitCallback = useRef<AfterFormSubmitCallback>(undefined);\n const { isSubmitting, isValidating, isDirty } = form.formState;\n const rootErrorController = useFormRootErrorController();\n\n const autoResetOptions =\n typeof autoReset === \"boolean\"\n ? { onAfterModalClose: autoReset }\n : autoReset;\n\n const modalController = useModalController();\n modalController.useUpdateOptions({\n confirmOnClose:\n flags.requireCloseModalConfirmationOnUnsavedChanges && isDirty,\n onClose: () => {\n if (autoResetOptions?.onAfterModalClose) {\n form.reset();\n }\n },\n });\n\n const { submitInterceptor } = useFormSettings();\n const onSubmit = submitInterceptor\n ? (values: F) => submitInterceptor<F>(onSubmitProp, values)\n : onSubmitProp;\n\n const handleSubmitResult = (result: unknown) => {\n if (typeof result === \"function\") {\n afterSubmitCallback.current = result as AfterFormSubmitCallback;\n }\n const rootError = form.getFieldState(\"root\" as Path<F>)?.error;\n if (rootError && !rootErrorController.errorComponentMounted) {\n throw new FormRootError(rootError);\n }\n };\n\n const handleSubmit = (e?: BaseSyntheticEvent | F) => {\n const formEvent =\n e && \"nativeEvent\" in e ? (e as BaseSyntheticEvent) : undefined;\n\n formEvent?.stopPropagation();\n\n if (isSubmitting || isValidating) {\n return;\n }\n\n modalController.confirmClose();\n\n return form.handleSubmit((values, event) => {\n const submitResult = onSubmit(values, event);\n if (submitResult instanceof Promise) {\n return submitResult.then(handleSubmitResult);\n }\n handleSubmitResult(submitResult);\n })(formEvent);\n };\n\n const onAfterSuccessFeedback = () => {\n afterSubmitCallback.current?.();\n };\n\n const refWithHotkeySubmit = useHotkeySubmit({\n ref,\n handleSubmit,\n });\n\n return (\n <RhfFormContextProvider {...form}>\n <FormContextProvider\n form={form as UseFormReturn}\n isReadOnly={isReadOnly}\n id={formId}\n onAfterSuccessFeedback={onAfterSuccessFeedback}\n rootErrorController={rootErrorController}\n >\n <FormComponent\n {...formProps}\n ref={refWithHotkeySubmit}\n id={formId}\n onSubmit={handleSubmit}\n >\n {children}\n </FormComponent>\n </FormContextProvider>\n <ConfirmUnsavedChangesModal />\n </RhfFormContextProvider>\n );\n}\n\nexport default Form;\n"],"names":["RhfFormContextProvider"],"mappings":"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"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import '../../../../components/Action/Action.mjs';
|
|
4
|
+
import { AbortActionError } from '../../../../components/Action/AbortActionError.mjs';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react-aria';
|
|
5
7
|
import { useRef, useEffect } from 'react';
|
|
8
|
+
import '@react-aria/live-announcer';
|
|
9
|
+
import { ActionModel } from '../../../../components/Action/models/ActionModel.mjs';
|
|
6
10
|
|
|
7
11
|
const useFormSubmitAction = (formState, actionProps) => {
|
|
8
12
|
const { isSubmitting, isSubmitSuccessful } = formState;
|
|
@@ -27,7 +31,7 @@ const useFormSubmitAction = (formState, actionProps) => {
|
|
|
27
31
|
return;
|
|
28
32
|
}
|
|
29
33
|
submitPromise.current?.reject(
|
|
30
|
-
new
|
|
34
|
+
new AbortActionError("Form submission failed")
|
|
31
35
|
);
|
|
32
36
|
}, [isSubmitting, isSubmitSuccessful, submitPromise]);
|
|
33
37
|
return formSubmitAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormSubmitAction.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"useFormSubmitAction.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.ts"],"sourcesContent":["import { AbortActionError, type ActionProps } from \"@/components/Action\";\nimport { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport { useEffect, useRef } from \"react\";\nimport type { FieldValues, FormState } from \"react-hook-form\";\n\nexport const useFormSubmitAction = (\n formState: FormState<FieldValues>,\n actionProps?: ActionProps,\n) => {\n const { isSubmitting, isSubmitSuccessful } = formState;\n\n const submitPromise = useRef<PromiseWithResolvers<void>>(undefined);\n\n const formSubmitAction = ActionModel.useNew({\n ...actionProps,\n onAction: () => {\n submitPromise.current = Promise.withResolvers<void>();\n actionProps?.onAction?.();\n return submitPromise.current.promise;\n },\n });\n\n useEffect(() => {\n if (isSubmitting) {\n if (!formSubmitAction.state.isBusy) {\n /**\n * Manually start execution. This happens if the form submission was\n * triggered by other means than the submit button, e.g. by pressing\n * Enter in a text field.\n */\n formSubmitAction.execute();\n }\n return;\n }\n\n if (isSubmitSuccessful) {\n submitPromise.current?.resolve();\n return;\n }\n\n submitPromise.current?.reject(\n new AbortActionError(\"Form submission failed\"),\n );\n }, [isSubmitting, isSubmitSuccessful, submitPromise]);\n\n return formSubmitAction;\n};\n"],"names":[],"mappings":";;;;;;;;AAKO,MAAM,mBAAA,GAAsB,CACjC,SAAA,EACA,WAAA,KACG;AACH,EAAA,MAAM,EAAE,YAAA,EAAc,kBAAA,EAAmB,GAAI,SAAA;AAE7C,EAAA,MAAM,aAAA,GAAgB,OAAmC,MAAS,CAAA;AAElE,EAAA,MAAM,gBAAA,GAAmB,YAAY,MAAA,CAAO;AAAA,IAC1C,GAAG,WAAA;AAAA,IACH,UAAU,MAAM;AACd,MAAA,aAAA,CAAc,OAAA,GAAU,QAAQ,aAAA,EAAoB;AACpD,MAAA,WAAA,EAAa,QAAA,IAAW;AACxB,MAAA,OAAO,cAAc,OAAA,CAAQ,OAAA;AAAA,IAC/B;AAAA,GACD,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,IAAI,CAAC,gBAAA,CAAiB,KAAA,CAAM,MAAA,EAAQ;AAMlC,QAAA,gBAAA,CAAiB,OAAA,EAAQ;AAAA,MAC3B;AACA,MAAA;AAAA,IACF;AAEA,IAAA,IAAI,kBAAA,EAAoB;AACtB,MAAA,aAAA,CAAc,SAAS,OAAA,EAAQ;AAC/B,MAAA;AAAA,IACF;AAEA,IAAA,aAAA,CAAc,OAAA,EAAS,MAAA;AAAA,MACrB,IAAI,iBAAiB,wBAAwB;AAAA,KAC/C;AAAA,EACF,CAAA,EAAG,CAAC,YAAA,EAAc,kBAAA,EAAoB,aAAa,CAAC,CAAA;AAEpD,EAAA,OAAO,gBAAA;AACT;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { createContext, useContext } from 'react';
|
|
5
|
+
|
|
6
|
+
const context = createContext({});
|
|
7
|
+
function FormSettingsProvider(props) {
|
|
8
|
+
return /* @__PURE__ */ jsx(context.Provider, { value: props, children: props.children });
|
|
9
|
+
}
|
|
10
|
+
const useFormSettings = () => useContext(context);
|
|
11
|
+
|
|
12
|
+
export { FormSettingsProvider, useFormSettings };
|
|
13
|
+
//# sourceMappingURL=FormSettingsProvider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormSettingsProvider.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.tsx"],"sourcesContent":["import { createContext, useContext, type PropsWithChildren } from \"react\";\nimport type { FieldValues } from \"react-hook-form\";\nimport type { FormOnSubmitHandler } from \"../Form/Form\";\n\ntype SubmitInterceptor = <F extends FieldValues = FieldValues>(\n submit: FormOnSubmitHandler<F>,\n values: F,\n) => ReturnType<FormOnSubmitHandler<F>>;\n\ninterface Context {\n submitInterceptor?: SubmitInterceptor;\n}\n\nconst context = createContext<Context>({});\n\nexport type FormSettingsProviderProps = Context & PropsWithChildren;\n\nexport function FormSettingsProvider(props: FormSettingsProviderProps) {\n return (\n <context.Provider value={props as Context}>\n {props.children}\n </context.Provider>\n );\n}\n\nexport const useFormSettings = () => useContext(context);\n"],"names":[],"mappings":";;;AAaA,MAAM,OAAA,GAAU,aAAA,CAAuB,EAAE,CAAA;AAIlC,SAAS,qBAAqB,KAAA,EAAkC;AACrE,EAAA,2BACG,OAAA,CAAQ,QAAA,EAAR,EAAiB,KAAA,EAAO,KAAA,EACtB,gBAAM,QAAA,EACT,CAAA;AAEJ;AAEO,MAAM,eAAA,GAAkB,MAAM,UAAA,CAAW,OAAO;;;;"}
|
package/dist/js/default.mjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
export { AccentBox } from './components/src/components/AccentBox/AccentBox.mjs';
|
|
4
4
|
export { Accordion } from './components/src/components/Accordion/Accordion.mjs';
|
|
5
5
|
export { Action } from './components/src/components/Action/Action.mjs';
|
|
6
|
-
export {
|
|
6
|
+
export { AbortActionError } from './components/src/components/Action/AbortActionError.mjs';
|
|
7
|
+
export { abortAction } from './components/src/components/Action/lib/abortAction.mjs';
|
|
7
8
|
export { ActionBatch } from './components/src/components/Action/ActionBatch.mjs';
|
|
8
9
|
export { useAriaAnnounceSuspense } from './components/src/components/Action/lib/ariaLive.mjs';
|
|
9
10
|
export { ActionGroup } from './components/src/components/ActionGroup/ActionGroup.mjs';
|
package/dist/js/default.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export { Field, typedField } from './components/src/integrations/react-hook-form/components/Field/Field.mjs';
|
|
4
4
|
export { Form } from './components/src/integrations/react-hook-form/components/Form/Form.mjs';
|
|
5
5
|
export { SubmitButton } from './components/src/integrations/react-hook-form/components/SubmitButton/SubmitButton.mjs';
|
|
6
|
+
export { FormSettingsProvider } from './components/src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.mjs';
|
|
6
7
|
export { ResetButton } from './components/src/integrations/react-hook-form/components/ResetButton/ResetButton.mjs';
|
|
7
8
|
export { FormRootError } from './components/src/integrations/react-hook-form/components/FormRootError/FormRootError.mjs';
|
|
8
9
|
export { useFormContext, useOptionalFormContext } from './components/src/integrations/react-hook-form/components/FormContextProvider/FormContextProvider.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-hook-form.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-hook-form.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbortActionError.d.ts","sourceRoot":"","sources":["../../../../src/components/Action/AbortActionError.ts"],"names":[],"mappings":"AAAA,qBAAa,gBAAiB,SAAQ,KAAK;gBACtB,OAAO,CAAC,EAAE,MAAM;WAKrB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB;WAI7D,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAKxD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Action } from './Action';
|
|
2
|
-
export {
|
|
2
|
+
export { AbortActionError } from './AbortActionError';
|
|
3
|
+
export { abortAction } from './lib/abortAction';
|
|
3
4
|
export { ActionBatch } from './ActionBatch';
|
|
4
5
|
export * from './types';
|
|
5
6
|
export { default } from './Action';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abortAction.d.ts","sourceRoot":"","sources":["../../../../../src/components/Action/lib/abortAction.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,KAE/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,EAAE,EACP,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAIT,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,WAAW,EAEX,aAAa,EACb,aAAa,EACd,MAAM,iBAAiB,CAAC;AAMzB,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,WAAW,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;AAE1E,MAAM,MAAM,uBAAuB,GAAG,CAAC,GAAG,WAAW,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,KAAK,iBAAiB,GAAG,EAAE,CACzB,iBAAiB,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACzD,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B,CAAC,CACH,CAAC;AAEF,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,WAAW,CAC9C,SAAQ,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,iBAAiB;IACnE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC;CAC5C;AAID,wBAAgB,IAAI,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,2CAsG9D;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormSubmitAction.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useFormSubmitAction.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,GAC9B,WAAW,SAAS,CAAC,WAAW,CAAC,EACjC,cAAc,WAAW,gBAuC1B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { FormOnSubmitHandler } from '../Form/Form';
|
|
4
|
+
type SubmitInterceptor = <F extends FieldValues = FieldValues>(submit: FormOnSubmitHandler<F>, values: F) => ReturnType<FormOnSubmitHandler<F>>;
|
|
5
|
+
interface Context {
|
|
6
|
+
submitInterceptor?: SubmitInterceptor;
|
|
7
|
+
}
|
|
8
|
+
export type FormSettingsProviderProps = Context & PropsWithChildren;
|
|
9
|
+
export declare function FormSettingsProvider(props: FormSettingsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const useFormSettings: () => Context;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=FormSettingsProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormSettingsProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,KAAK,iBAAiB,GAAG,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAC3D,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC9B,MAAM,EAAE,CAAC,KACN,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;AAExC,UAAU,OAAO;IACf,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAID,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,iBAAiB,CAAC;AAEpE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAMpE;AAED,eAAO,MAAM,eAAe,eAA4B,CAAC"}
|
package/dist/types/integrations/react-hook-form/components/FormSettingsProvider/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/FormSettingsProvider/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './components/Field';
|
|
2
2
|
export * from './components/Form';
|
|
3
3
|
export * from './components/SubmitButton';
|
|
4
|
+
export { FormSettingsProvider, type FormSettingsProviderProps, } from './components/FormSettingsProvider';
|
|
4
5
|
export * from './components/ResetButton';
|
|
5
6
|
export * from './components/FormRootError';
|
|
6
7
|
export { useFormContext, useOptionalFormContext, } from './components/FormContextProvider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/react-hook-form/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,sBAAsB,GACvB,MAAM,kCAAkC,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/react-hook-form/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,mCAAmC,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,sBAAsB,GACvB,MAAM,kCAAkC,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.713",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
60
|
"@mittwald/password-tools-js": "3.0.0-alpha.18",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
61
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.713",
|
|
62
62
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
63
63
|
"@react-aria/form": "^3.1.3",
|
|
64
64
|
"@react-aria/live-announcer": "^3.4.4",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@faker-js/faker": "^10.2.0",
|
|
105
105
|
"@internationalized/date": "^3.10.1",
|
|
106
106
|
"@mittwald/flow-core": "",
|
|
107
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
107
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.713",
|
|
108
108
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
109
109
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
110
110
|
"@mittwald/typescript-config": "",
|
|
@@ -172,5 +172,5 @@
|
|
|
172
172
|
"optional": true
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "937b70d0ef1911f5653f854e366cd1ac3cec07cf"
|
|
176
176
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
class MutedActionError extends Error {
|
|
4
|
-
constructor(message) {
|
|
5
|
-
super(message);
|
|
6
|
-
this.name = "MutedActionError";
|
|
7
|
-
}
|
|
8
|
-
static isMutedActionError(error) {
|
|
9
|
-
return error instanceof MutedActionError;
|
|
10
|
-
}
|
|
11
|
-
static rethrowIfNotMuted(error) {
|
|
12
|
-
if (!MutedActionError.isMutedActionError(error)) {
|
|
13
|
-
throw error;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { MutedActionError };
|
|
19
|
-
//# sourceMappingURL=MutedActionError.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MutedActionError.mjs","sources":["../../../../../../src/components/Action/MutedActionError.ts"],"sourcesContent":["export class MutedActionError extends Error {\n public constructor(message?: string) {\n super(message);\n this.name = \"MutedActionError\";\n }\n\n public static isMutedActionError(error: unknown): error is MutedActionError {\n return error instanceof MutedActionError;\n }\n\n public static rethrowIfNotMuted(error: unknown): void {\n if (!MutedActionError.isMutedActionError(error)) {\n throw error;\n }\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,yBAAyB,KAAA,CAAM;AAAA,EACnC,YAAY,OAAA,EAAkB;AACnC,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AAAA,EACd;AAAA,EAEA,OAAc,mBAAmB,KAAA,EAA2C;AAC1E,IAAA,OAAO,KAAA,YAAiB,gBAAA;AAAA,EAC1B;AAAA,EAEA,OAAc,kBAAkB,KAAA,EAAsB;AACpD,IAAA,IAAI,CAAC,gBAAA,CAAiB,kBAAA,CAAmB,KAAK,CAAA,EAAG;AAC/C,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF;AACF;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MutedActionError.d.ts","sourceRoot":"","sources":["../../../../src/components/Action/MutedActionError.ts"],"names":[],"mappings":"AAAA,qBAAa,gBAAiB,SAAQ,KAAK;gBACtB,OAAO,CAAC,EAAE,MAAM;WAKrB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB;WAI7D,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAKtD"}
|