@mittwald/flow-react-components 0.2.0-alpha.886 → 0.2.0-alpha.888
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 +11567 -11567
- package/dist/css/all.css +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +3 -0
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs +1 -5
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileField/FileField.mjs +1 -4
- package/dist/js/packages/components/src/components/FileField/FileField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ImageCropper/lib/getCroppedImageFile.mjs +5 -8
- package/dist/js/packages/components/src/components/ImageCropper/lib/getCroppedImageFile.mjs.map +1 -1
- package/dist/types/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/types/components/FileDropZone/FileDropZone.d.ts.map +1 -1
- package/dist/types/components/FileField/FileField.d.ts.map +1 -1
- package/dist/types/components/ImageCropper/lib/getCroppedImageFile.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/js/packages/core/src/file.mjs +0 -19
- package/dist/js/packages/core/src/file.mjs.map +0 -1
|
@@ -34,6 +34,8 @@ const CodeEditor = flowComponent("CodeEditor", (props) => {
|
|
|
34
34
|
showLinterMarkers = true,
|
|
35
35
|
showActiveLineMarker = true,
|
|
36
36
|
copyable = true,
|
|
37
|
+
height,
|
|
38
|
+
minHeight,
|
|
37
39
|
...rest
|
|
38
40
|
} = useControlledHostValueProps(props);
|
|
39
41
|
const {
|
|
@@ -81,6 +83,7 @@ const CodeEditor = flowComponent("CodeEditor", (props) => {
|
|
|
81
83
|
}
|
|
82
84
|
},
|
|
83
85
|
extensions: enabledExtensions,
|
|
86
|
+
height: height ?? minHeight,
|
|
84
87
|
children: copyable && /* @__PURE__ */ jsx(
|
|
85
88
|
CopyButton,
|
|
86
89
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.mjs","sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps } from \"@uiw/react-codemirror\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n defaultValue?: string;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n className?: string;\n language?: CodeEditorLanguage;\n copyable?: boolean;\n isRequired?: boolean;\n validationBehavior?: unknown;\n}\n\n/** @flr-generate all */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n ...rest\n } = useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n fieldProps.className,\n styles.codeEditor,\n className,\n );\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n return (\n <div className={rootClassName}>\n <PropsContextProvider props={fieldPropsContext}>\n <FieldErrorCaptureContext>\n <CodeMirror\n {...rest}\n value={value}\n basicSetup={{\n highlightActiveLine: showActiveLineMarker,\n highlightActiveLineGutter: showActiveLineMarker,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n }}\n theme={defaultLightTheme}\n aria-required={isRequired}\n aria-invalid={isInvalid}\n readOnly={isReadOnly}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={enabledExtensions}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n />\n )}\n </CodeMirror>\n {children}\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default CodeEditor;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqCO,MAAM,UAAA,GAAa,aAAA,CAAc,YAAA,EAAc,CAAC,KAAA,KAAU;AAC/D,EAAA,MAAM;AAAA,IACJ,GAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA,EAAoB,0BAAA;AAAA,IACpB,K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AA,WAC7B;AAAA,UACA,KAAA,EAAO,iBAAA;AAAA,UACP,eAAA,EAAe,UAAA;AAAA,UACf,cAAA,EAAc,SAAA;AAAA,UACd,QAAA,EAAU,UAAA;AAAA,UACV,WAAW,IAAA,CAAK,MAAA,CAAO,UAAA,EAAY,UAAA,IAAc,OAAO,QAAQ,CAAA;AAAA,UAChE,GAAA,EAAK,CAAC,aAAA,KAAkB;AACtB,YAAA,IAAI,eAAe,MAAA,EAAQ;AACzB,cAAA,QAAA,CAAS,UAAU,aAAA,CAAc,MAAA;AAAA,YACnC;AAAA,UACF,CAAA;AAAA,UACA,UAAA,EAAY,iBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CodeEditor.mjs","sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps } from \"@uiw/react-codemirror\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n defaultValue?: string;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n className?: string;\n language?: CodeEditorLanguage;\n copyable?: boolean;\n isRequired?: boolean;\n validationBehavior?: unknown;\n}\n\n/** @flr-generate all */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n height,\n minHeight,\n ...rest\n } = useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n fieldProps.className,\n styles.codeEditor,\n className,\n );\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n return (\n <div className={rootClassName}>\n <PropsContextProvider props={fieldPropsContext}>\n <FieldErrorCaptureContext>\n <CodeMirror\n {...rest}\n value={value}\n basicSetup={{\n highlightActiveLine: showActiveLineMarker,\n highlightActiveLineGutter: showActiveLineMarker,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n }}\n theme={defaultLightTheme}\n aria-required={isRequired}\n aria-invalid={isInvalid}\n readOnly={isReadOnly}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={enabledExtensions}\n height={height ?? minHeight}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n />\n )}\n </CodeMirror>\n {children}\n </FieldErrorCaptureContext>\n <FieldErr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sContext.mjs';
|
|
10
10
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
11
11
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
12
|
-
import { addAwaitedArrayBuffer } from '../../../../core/src/file.mjs';
|
|
13
12
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
14
13
|
|
|
15
14
|
const FileDropZone = flowComponent(
|
|
@@ -65,10 +64,7 @@ const FileDropZone = flowComponent(
|
|
|
65
64
|
(file) => file.kind === "file"
|
|
66
65
|
);
|
|
67
66
|
const files = await Promise.all(
|
|
68
|
-
fileDropItems.filter((f) => !accept || accept?.includes(f.type)).map(async (f) =>
|
|
69
|
-
const file = await f.getFile();
|
|
70
|
-
return await addAwaitedArrayBuffer(file);
|
|
71
|
-
})
|
|
67
|
+
fileDropItems.filter((f) => !accept || accept?.includes(f.type)).map(async (f) => await f.getFile())
|
|
72
68
|
);
|
|
73
69
|
if (files.length > 0) {
|
|
74
70
|
const fileTransfer = new DataTransfer();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropZone.mjs","sources":["../../../../../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { IllustratedMessage } from \"@/components/IllustratedMessage\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./FileDropZone.module.scss\";\nimport clsx from \"clsx\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { DropEvent, FocusableElement } from \"@react-types/shared\";\nimport {
|
|
1
|
+
{"version":3,"file":"FileDropZone.mjs","sources":["../../../../../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { IllustratedMessage } from \"@/components/IllustratedMessage\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./FileDropZone.module.scss\";\nimport clsx from \"clsx\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { DropEvent, FocusableElement } from \"@react-types/shared\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface FileDropZoneProps\n extends\n PropsWithClassName,\n FlowComponentProps<FocusableElement>,\n PropsWithChildren,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<Aria.DropZoneProps, \"isDisabled\"> {\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileDropZone: FC<FileDropZoneProps> = flowComponent(\n \"FileDropZone\",\n (props) => {\n const {\n multiple,\n accept,\n className,\n onChange: onChangeDropZone,\n children,\n name,\n isDisabled,\n isReadOnly,\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"FileDropZone\");\n\n const fileFieldRef = useRef<HTMLInputElement>(null);\n const rootClassName = clsx(\n styles.fileDropZone,\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n IllustratedMessage: {\n FileField: {\n name,\n onChange: onChangeDropZone,\n ref: fileFieldRef,\n accept: accept,\n multiple: multiple,\n Button: { variant: \"outline\", color: \"dark\" },\n isDisabled,\n isReadOnly,\n },\n Heading: {\n className: styles.heading,\n },\n Icon: { className: styles.icon },\n Text: { className: styles.text },\n },\n };\n\n const onDropHandler = async (event: DropEvent) => {\n if (isReadOnly) {\n return;\n }\n\n const fileDropItems = event.items.filter(\n (file) => file.kind === \"file\",\n ) as Aria.FileDropItem[];\n\n const files = await Promise.all(\n fileDropItems\n .filter((f) => !accept || accept?.includes(f.type))\n .map(async (f) => await f.getFile()),\n );\n\n if (files.length > 0) {\n const fileTransfer = new DataTransfer();\n for (const file of multiple ? files : [files[0]]) {\n if (file) {\n fileTransfer.items.add(file);\n }\n }\n\n onChangeDropZone?.(fileTransfer.files);\n if (fileFieldRef.current) {\n fileFieldRef.current.files = fileTransfer.files;\n }\n }\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n <Aria.DropZone\n className={rootClassName}\n onDrop={onDropHandler}\n isDisabled={isDisabled}\n data-readonly={isReadOnly}\n >\n <IllustratedMessage color=\"dark\">{children}</IllustratedMessage>\n </Aria.DropZone>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n },\n);\n\nexport default FileDropZone;\n"],"names":[],"mappings":";;;;;;;;;;;AA6BO,MAAM,YAAA,GAAsC,aAAA;AAAA,EACjD,cAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA,EAAU,gBAAA;AAAA,MACV,QAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,KAAA;AAEJ,IAAA,MAAM;AAAA,MACJ,cAAA;AAAA,MACA,wBAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,cAAc,CAAA;AAE3C,IAAA,MAAM,YAAA,GAAe,OAAyB,IAAI,CAAA;AAClD,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,YAAA;AAAA,MACP,cAAc,MAAA,CAAO,QAAA;AAAA,MACrB;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,YAAA,CAAa,KAAA,CAAM,IAAI,IAAI,CAAA;AAAA,UAC7B;AAAA,QACF;AAEA,QAAA,gBAAA,GAAmB,aAAa,KAAK,CAAA;AACrC,QAAA,IAAI,aAAa,OAAA,EAAS;AACxB,UAAA,YAAA,CAAa,OAAA,CAAQ,QAAQ,YAAA,CAAa,KAAA;AAAA,QAC5C;AAAA,MACF;AAAA,IACF,CAAA;AAEA,IAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAK,GAAG,UAAA,EACP,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,wBAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,GAAA;AAAA,QAAC,IAAA,CAAK,QAAA;AAAA,QAAL;AAAA,UACC,SAAA,EAAW,aAAA;AAAA,UACX,MAAA,EAAQ,aAAA;AAAA,UACR,UAAA;AAAA,UACA,eAAA,EAAe,UAAA;AAAA,UAEf,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,KAAA,EAAM,MAAA,EAAQ,QAAA,EAAS;AAAA;AAAA,SAE/C,CAAA,EACF,CAAA;AAAA,0BACC,cAAA,EAAA,EAAe;AAAA,KAAA,EAClB,CAAA;AAAA,EAEJ;AACF;;;;"}
|
|
@@ -9,7 +9,6 @@ import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
|
9
9
|
import '../../lib/propsContext/propsContext.mjs';
|
|
10
10
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
11
11
|
import { useObjectRef } from '@react-aria/utils';
|
|
12
|
-
import { addAwaitedArrayBuffer } from '../../../../core/src/file.mjs';
|
|
13
12
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
14
13
|
import styles from './FileField.module.scss.mjs';
|
|
15
14
|
import clsx from 'clsx';
|
|
@@ -46,9 +45,7 @@ const FileField = flowComponent("FileField", (props) => {
|
|
|
46
45
|
};
|
|
47
46
|
const handleChange = (fileList) => {
|
|
48
47
|
if (fileList && onChange) {
|
|
49
|
-
|
|
50
|
-
() => onChange(fileList)
|
|
51
|
-
);
|
|
48
|
+
onChange(fileList);
|
|
52
49
|
}
|
|
53
50
|
};
|
|
54
51
|
return /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileField.mjs","sources":["../../../../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import { useFormValidation } from \"@react-aria/form\";\nimport { useFormValidationState } from \"@react-stately/form\";\nimport type { PropsWithChildren } from \"react\";\nimport type * as Aria from \"react-aria-components\";\nimport { FieldErrorContext } from \"react-aria-components\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport { FileInput } from \"@/components/FileField/components/FileInput\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport {
|
|
1
|
+
{"version":3,"file":"FileField.mjs","sources":["../../../../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import { useFormValidation } from \"@react-aria/form\";\nimport { useFormValidationState } from \"@react-stately/form\";\nimport type { PropsWithChildren } from \"react\";\nimport type * as Aria from \"react-aria-components\";\nimport { FieldErrorContext } from \"react-aria-components\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport { FileInput } from \"@/components/FileField/components/FileInput\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./FileField.module.scss\";\nimport clsx from \"clsx\";\n\nexport interface FileFieldProps\n extends\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement>,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<\n Aria.TextFieldProps,\n \"isRequired\" | \"isInvalid\" | \"validationBehavior\" | \"isDisabled\"\n > {\n /** Handler that is called when the file input changes. */\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileField = flowComponent(\"FileField\", (props) => {\n const {\n children,\n ref,\n isRequired,\n isInvalid,\n isDisabled,\n validationBehavior,\n onChange,\n isReadOnly,\n ...restInputProps\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"FileField\");\n\n const inputRef = useObjectRef(ref);\n\n const formValidationState = useFormValidationState({\n value: undefined,\n validationBehavior,\n isInvalid,\n });\n\n useFormValidation({ validationBehavior }, formValidationState, inputRef);\n\n const inputProps = {\n ...restInputProps,\n \"aria-invalid\": formValidationState.displayValidation.isInvalid,\n value: undefined,\n };\n\n const handleChange: FileInputOnChangeHandler = (fileList) => {\n if (fileList && onChange) {\n onChange(fileList);\n }\n };\n\n return (\n <div\n {...fieldProps}\n className={clsx(fieldProps.className, styles.FileField)}\n >\n <FieldErrorContext.Provider value={formValidationState.displayValidation}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={fieldPropsContext}>\n <div\n data-readonly={isReadOnly}\n data-required={!!isRequired || undefined}\n data-invalid={\n formValidationState.displayValidation.isInvalid || undefined\n }\n >\n <FileInput\n ref={inputRef}\n isReadOnly={isReadOnly}\n onChange={isReadOnly ? undefined : handleChange}\n isDisabled={isDisabled}\n {...inputProps}\n >\n {children}\n </FileInput>\n </div>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </FieldErrorContext.Provider>\n </div>\n );\n});\nexport default FileField;\n"],"names":[],"mappings":";;;;;;;;;;;;;AA+BO,MAAM,SAAA,GAAY,aAAA,CAAc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oBAAA,EAAA,EAAqB,KAAA,EAAO,iBAAA,EAC3B,QAAA,kBAAA,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,eAAA,EAAe,UAAA;AAAA,YACf,eAAA,EAAe,CAAC,CAAC,UAAA,IAAc,MAAA;AAAA,YAC/B,cAAA,EACE,mBAAA,CAAoB,iBAAA,CAAkB,SAAA,IAAa,MAAA;AAAA,YAGrD,QAAA,kBAAA,GAAA;AAAA,cAAC,SAAA;AAAA,cAAA;AAAA,gBACC,GAAA,EAAK,QAAA;AAAA,gBACL,UAAA;AAAA,gBACA,QAAA,EAAU,aAAa,MAAA,GAAY,YAAA;AAAA,gBACnC,UAAA;AAAA,gBACC,GAAG,UAAA;AAAA,gBAEH;AAAA;AAAA;AACH;AAAA,WAEJ,CAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import { addAwaitedArrayBuffer } from '../../../../../core/src/file.mjs';
|
|
4
|
-
|
|
5
3
|
function getCroppedImageFile(imageSrc, sourceImage, pixelCrop) {
|
|
6
4
|
return new Promise((resolve, reject) => {
|
|
7
5
|
const image = new Image();
|
|
@@ -36,12 +34,11 @@ function getCroppedImageFile(imageSrc, sourceImage, pixelCrop) {
|
|
|
36
34
|
if (!blob) {
|
|
37
35
|
return;
|
|
38
36
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
37
|
+
resolve(
|
|
38
|
+
new File([blob], sourceImageName, {
|
|
39
|
+
type: sourceImageType
|
|
40
|
+
})
|
|
41
|
+
);
|
|
45
42
|
},
|
|
46
43
|
sourceImageType,
|
|
47
44
|
quality
|
package/dist/js/packages/components/src/components/ImageCropper/lib/getCroppedImageFile.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCroppedImageFile.mjs","sources":["../../../../../../../../src/components/ImageCropper/lib/getCroppedImageFile.ts"],"sourcesContent":["import type { Area } from \"react-easy-crop\";\
|
|
1
|
+
{"version":3,"file":"getCroppedImageFile.mjs","sources":["../../../../../../../../src/components/ImageCropper/lib/getCroppedImageFile.ts"],"sourcesContent":["import type { Area } from \"react-easy-crop\";\n\nexport function getCroppedImageFile(\n imageSrc: string,\n sourceImage: File | string,\n pixelCrop: Area,\n): Promise<File> {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.crossOrigin = \"anonymous\";\n image.src = imageSrc;\n\n image.onload = () => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n\n canvas.width = pixelCrop.width;\n canvas.height = pixelCrop.height;\n\n if (!ctx) {\n reject(new Error(\"Failed to get canvas context\"));\n return;\n }\n\n ctx.drawImage(\n image,\n pixelCrop.x,\n pixelCrop.y,\n pixelCrop.width,\n pixelCrop.height,\n 0,\n 0,\n pixelCrop.width,\n pixelCrop.height,\n );\n\n const isSourceImageJsFile = sourceImage instanceof File;\n const sourceImageName = isSourceImageJsFile\n ? sourceImage.name\n : \"cropped-image.png\";\n const sourceImageType = isSourceImageJsFile\n ? sourceImage.type\n : \"image/png\";\n\n const quality =\n sourceImageType === \"image/jpeg\"\n ? 0.86\n : sourceImageType === \"image/webp\"\n ? 0.82\n : undefined;\n\n canvas.toBlob(\n (blob) => {\n if (!blob) {\n return;\n }\n\n resolve(\n new File([blob], sourceImageName, {\n type: sourceImageType,\n }),\n );\n },\n sourceImageType,\n quality,\n );\n };\n\n image.onerror = () => {\n reject(new Error(\"Failed to load image\"));\n };\n });\n}\n"],"names":[],"mappings":"AAEO,SAAS,mBAAA,CACd,QAAA,EACA,WAAA,EACA,SAAA,EACe;AACf,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AACtC,IAAA,MAAM,KAAA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G,eAAA,EAAiB;AAAA,cAChC,IAAA,EAAM;AAAA,aACP;AAAA,WACH;AAAA,QACF,CAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA,OACF;AAAA,IACF,CAAA;AAEA,IAAA,KAAA,CAAM,UAAU,MAAM;AACpB,MAAA,MAAA,CAAO,IAAI,KAAA,CAAM,sBAAsB,CAAC,CAAA;AAAA,IAC1C,CAAA;AAAA,EACF,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAI5E,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,uDAAuD,CAAC;AAG/D,MAAM,WAAW,eACf,SACE,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC,EACxE,eAAe,EACf,kBAAkB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAwB;AACxB,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,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file":"FileDropZone.d.ts","sourceRoot":"","sources":["../../../../src/components/FileDropZone/FileDropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAU,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAG5F,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAa,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvE,MAAM,WAAW,iBACf,SACE,kBAAkB,EAClB,kBAAkB,CAAC,gBAAgB,CAAC,EACpC,iBAAiB,EACjB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,EACrD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC;IACxC,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAwB;AACxB,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAiG9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileField.d.ts","sourceRoot":"","sources":["../../../../src/components/FileField/FileField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"FileField.d.ts","sourceRoot":"","sources":["../../../../src/components/FileField/FileField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAQ/E,MAAM,WAAW,cACf,SACE,iBAAiB,EACjB,kBAAkB,CAAC,gBAAgB,CAAC,EACpC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,EACrD,IAAI,CACF,IAAI,CAAC,cAAc,EACnB,YAAY,GAAG,WAAW,GAAG,oBAAoB,GAAG,YAAY,CACjE;IACH,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAwB;AACxB,eAAO,MAAM,SAAS,qGAyEpB,CAAC;AACH,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCroppedImageFile.d.ts","sourceRoot":"","sources":["../../../../../src/components/ImageCropper/lib/getCroppedImageFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"getCroppedImageFile.d.ts","sourceRoot":"","sources":["../../../../../src/components/ImageCropper/lib/getCroppedImageFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,IAAI,GAAG,MAAM,EAC1B,SAAS,EAAE,IAAI,GACd,OAAO,CAAC,IAAI,CAAC,CAkEf"}
|
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.888",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"@internationalized/string": "^3.2.9",
|
|
64
64
|
"@internationalized/string-compiler": "^3.4.1",
|
|
65
65
|
"@lezer/highlight": "^1.2.3",
|
|
66
|
-
"@mittwald/flow-icons": "0.2.0-alpha.
|
|
66
|
+
"@mittwald/flow-icons": "0.2.0-alpha.888",
|
|
67
67
|
"@mittwald/password-tools-js": "3.0.0-alpha.30",
|
|
68
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
68
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.888",
|
|
69
69
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
70
70
|
"@react-aria/form": "^3.2.1",
|
|
71
71
|
"@react-aria/i18n": "^3.13.1",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@lezer/generator": "^1.8.0",
|
|
121
121
|
"@lezer/lr": "^1.4.10",
|
|
122
122
|
"@mittwald/flow-core": "",
|
|
123
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
123
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.888",
|
|
124
124
|
"@mittwald/flow-icons-base": "",
|
|
125
125
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
126
126
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
},
|
|
176
176
|
"peerDependencies": {
|
|
177
177
|
"@internationalized/date": "^3.12.2",
|
|
178
|
-
"@mittwald/flow-icons-pro": "0.2.0-alpha.
|
|
178
|
+
"@mittwald/flow-icons-pro": "0.2.0-alpha.887",
|
|
179
179
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
180
180
|
"next": "^16.2.3",
|
|
181
181
|
"react": "^19.2.0",
|
|
@@ -196,5 +196,5 @@
|
|
|
196
196
|
"optional": true
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
|
-
"gitHead": "
|
|
199
|
+
"gitHead": "5a1507172c5d2fa7bb2fd4b46aade6991ebbcd51"
|
|
200
200
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import 'invariant';
|
|
4
|
-
|
|
5
|
-
const Key = "mittwald.flow-core.file.awaitedArrayBuffer";
|
|
6
|
-
function isFileWithAwaitedArrayBuffer(file) {
|
|
7
|
-
return Key in file && file[Key] instanceof ArrayBuffer && !file[Key].detached;
|
|
8
|
-
}
|
|
9
|
-
const addAwaitedArrayBuffer = async (file) => {
|
|
10
|
-
if (isFileWithAwaitedArrayBuffer(file)) {
|
|
11
|
-
return file;
|
|
12
|
-
}
|
|
13
|
-
const arrayBuffer = await file.arrayBuffer();
|
|
14
|
-
Object.assign(file, { [Key]: arrayBuffer });
|
|
15
|
-
return file;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { addAwaitedArrayBuffer, isFileWithAwaitedArrayBuffer };
|
|
19
|
-
//# sourceMappingURL=file.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.mjs","sources":["../../../../../../core/src/file.ts"],"sourcesContent":["import invariant from \"invariant\";\n\nconst Key = \"mittwald.flow-core.file.awaitedArrayBuffer\";\n\nexport type FileWithAwaitedArrayBuffer = File & {\n [Key]: ArrayBuffer;\n};\n\nexport function isFileWithAwaitedArrayBuffer(\n file: File | FileWithAwaitedArrayBuffer,\n): file is FileWithAwaitedArrayBuffer {\n return Key in file && file[Key] instanceof ArrayBuffer && !file[Key].detached;\n}\n\nexport const addAwaitedArrayBuffer = async (file: File) => {\n if (isFileWithAwaitedArrayBuffer(file)) {\n return file;\n }\n\n const arrayBuffer = await file.arrayBuffer();\n Object.assign(file, { [Key]: arrayBuffer });\n\n return file;\n};\n\nexport const getAwaitArrayBuffer = (\n file: File | FileWithAwaitedArrayBuffer,\n) => {\n invariant(\n isFileWithAwaitedArrayBuffer(file),\n `File buffer unavailable (objectType=${Object.prototype.toString.call(\n file,\n )}, hasArrayBuffer=${\n Key in file && file[Key] instanceof ArrayBuffer\n }, isDetached=${\n Key in file && file[Key] instanceof ArrayBuffer\n ? file[Key].detached\n : \"n/a\"\n })`,\n );\n return file[Key];\n};\n"],"names":[],"mappings":";;AAEA,MAAM,GAAA,GAAM,4CAAA;AAML,SAAS,6BACd,IAAA,EACoC;AACpC,EAAA,OAAO,GAAA,IAAO,QAAQ,IAAA,CAAK,GAAG,aAAa,WAAA,IAAe,CAAC,IAAA,CAAK,GAAG,CAAA,CAAE,QAAA;AACvE;AAEO,MAAM,qBAAA,GAAwB,OAAO,IAAA,KAAe;AACzD,EAAA,IAAI,4BAAA,CAA6B,IAAI,CAAA,EAAG;AACtC,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,WAAA,GAAc,MAAM,IAAA,CAAK,WAAA,EAAY;AAC3C,EAAA,MAAA,CAAO,OAAO,IAAA,EAAM,EAAE,CAAC,GAAG,GAAG,aAAa,CAAA;AAE1C,EAAA,OAAO,IAAA;AACT;;;;"}
|