panelui-native 0.109.0 → 0.111.0
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/lib/module/components/avatar-cropper/avatar-cropper-math.js +360 -0
- package/lib/module/components/avatar-cropper/avatar-cropper-math.js.map +1 -0
- package/lib/module/components/avatar-cropper/index.js +822 -0
- package/lib/module/components/avatar-cropper/index.js.map +1 -0
- package/lib/module/icons/index.js +6 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/panel-ui-provider.js +22 -10
- package/lib/module/providers/panel-ui-provider.js.map +1 -1
- package/lib/typescript/src/components/avatar-cropper/avatar-cropper-math.d.ts +120 -0
- package/lib/typescript/src/components/avatar-cropper/avatar-cropper-math.d.ts.map +1 -0
- package/lib/typescript/src/components/avatar-cropper/index.d.ts +195 -0
- package/lib/typescript/src/components/avatar-cropper/index.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +2 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/providers/panel-ui-provider.d.ts.map +1 -1
- package/package.json +9 -1
- package/src/components/avatar-cropper/avatar-cropper-math.ts +347 -0
- package/src/components/avatar-cropper/index.tsx +1036 -0
- package/src/icons/index.tsx +3 -0
- package/src/index.ts +16 -0
- package/src/providers/panel-ui-provider.tsx +21 -11
package/src/icons/index.tsx
CHANGED
|
@@ -113,6 +113,7 @@ import HgQuoteDownIcon from '@hugeicons/core-free-icons/QuoteDownIcon';
|
|
|
113
113
|
import HgReceiptIcon from '@hugeicons/core-free-icons/ReceiptIcon';
|
|
114
114
|
import HgRefreshCcwIcon from '@hugeicons/core-free-icons/RefreshCcwIcon';
|
|
115
115
|
import HgRefreshCwIcon from '@hugeicons/core-free-icons/RefreshCwIcon';
|
|
116
|
+
import HgRotateCwSquareIcon from '@hugeicons/core-free-icons/RotateCwSquareIcon';
|
|
116
117
|
import HgRepeatIcon from '@hugeicons/core-free-icons/RepeatIcon';
|
|
117
118
|
import HgSearch01Icon from '@hugeicons/core-free-icons/Search01Icon';
|
|
118
119
|
import HgSent02Icon from '@hugeicons/core-free-icons/Sent02Icon';
|
|
@@ -379,6 +380,8 @@ export const SendArrowIcon = icon(HgSent02Icon, {
|
|
|
379
380
|
export const TrashIcon = icon(HgDelete02Icon, { size: 16, color: '#737373' });
|
|
380
381
|
export const RotateCcwIcon = icon(HgRefreshCcwIcon, { size: 16, color: '#737373' });
|
|
381
382
|
export const RotateCwIcon = icon(HgRefreshCwIcon, { size: 16, color: '#737373' });
|
|
383
|
+
/** A square with an arrow turning round it — turn an image, rather than refresh. */
|
|
384
|
+
export const RotateSquareIcon = icon(HgRotateCwSquareIcon, { size: 16, color: '#737373' });
|
|
382
385
|
export const RepeatIcon = icon(HgRepeatIcon, { size: 16, color: '#737373' });
|
|
383
386
|
export const PlusSquareIcon = icon(HgPlusSignSquareIcon, { size: 16, color: '#737373' });
|
|
384
387
|
export const EyeIcon = icon(HgEyeIcon, { size: 16, color: '#737373' });
|
package/src/index.ts
CHANGED
|
@@ -75,6 +75,22 @@ export {
|
|
|
75
75
|
type AvatarBadgeProps,
|
|
76
76
|
type AvatarGroupProps,
|
|
77
77
|
} from './components/avatar';
|
|
78
|
+
export {
|
|
79
|
+
AvatarCropper,
|
|
80
|
+
hasAvatarCropperExport,
|
|
81
|
+
pickAvatarImage,
|
|
82
|
+
type AvatarCrop,
|
|
83
|
+
type AvatarCropOptions,
|
|
84
|
+
type AvatarCropResult,
|
|
85
|
+
type AvatarCropperCanvasProps,
|
|
86
|
+
type AvatarCropperHandle,
|
|
87
|
+
type AvatarCropperProps,
|
|
88
|
+
type AvatarCropperResetProps,
|
|
89
|
+
type AvatarCropperRotateProps,
|
|
90
|
+
type AvatarCropperShape,
|
|
91
|
+
type AvatarCropperSource,
|
|
92
|
+
type PickAvatarImageOptions,
|
|
93
|
+
} from './components/avatar-cropper';
|
|
78
94
|
export {
|
|
79
95
|
Attachment,
|
|
80
96
|
type AttachmentProps,
|
|
@@ -53,23 +53,33 @@ function KeyboardPassthrough({ children }: KeyboardHostProps) {
|
|
|
53
53
|
|
|
54
54
|
let keyboardProvider: ComponentType<KeyboardHostProps> | undefined;
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
/**
|
|
57
|
+
* The controller's provider, or undefined when it cannot be used.
|
|
58
|
+
*
|
|
59
|
+
* The `require` has to stay a statement directly inside the `try` block, with
|
|
60
|
+
* the native check as an early return above it rather than an `if` around it.
|
|
61
|
+
* Metro resolves every literal `require` when it bundles, and it only lets a
|
|
62
|
+
* missing package through when the call sits directly in a `try` block — one
|
|
63
|
+
* `if` deeper and it is a hard dependency, so an app without the controller
|
|
64
|
+
* fails to build before this `catch` could ever run.
|
|
65
|
+
* `test/optional-requires.test.mjs` holds every optional peer to that.
|
|
66
|
+
*/
|
|
67
|
+
function loadKeyboardProvider(): ComponentType<KeyboardHostProps> | undefined {
|
|
60
68
|
try {
|
|
61
|
-
if (TurboModuleRegistry.get('KeyboardController')
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
69
|
+
if (TurboModuleRegistry.get('KeyboardController') === null) return undefined;
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
71
|
+
const controller = require('react-native-keyboard-controller');
|
|
72
|
+
return controller?.KeyboardProvider;
|
|
66
73
|
} catch {
|
|
67
74
|
// Not installed, or installed without its native half. Either way the
|
|
68
75
|
// pass-through is the answer.
|
|
76
|
+
return undefined;
|
|
69
77
|
}
|
|
78
|
+
}
|
|
70
79
|
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
function resolveKeyboardProvider(): ComponentType<KeyboardHostProps> {
|
|
81
|
+
if (!keyboardProvider) keyboardProvider = loadKeyboardProvider() ?? KeyboardPassthrough;
|
|
82
|
+
return keyboardProvider;
|
|
73
83
|
}
|
|
74
84
|
|
|
75
85
|
export interface PanelUIProviderProps {
|