@octane-xplat/camera 0.19.0 → 0.20.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.
Files changed (84) hide show
  1. package/README.md +2 -132
  2. package/package.json +20 -25
  3. package/platforms/android/java/com/octanexplat/camera/CameraPreviewView.java +24 -0
  4. package/platforms/android/java/com/octanexplat/camera/CameraSessionBridge.java +153 -21
  5. package/platforms/ios/src/XplatSwitchingMovieWriter.swift +557 -0
  6. package/src/CameraView.android.tsrx +187 -154
  7. package/src/CameraView.ios.tsrx +124 -110
  8. package/src/CameraView.macos.tsrx +103 -96
  9. package/src/CameraView.tsrx +2 -0
  10. package/src/CameraView.web.tsrx +157 -146
  11. package/src/CameraView.windows.tsrx +134 -125
  12. package/src/camera-host.macos.ts +1059 -0
  13. package/src/camera-permission.mobile.ts +85 -81
  14. package/src/camera-permission.windows.ts +56 -53
  15. package/src/camera-session.ios.ts +89 -61
  16. package/src/camera-session.macos.ts +51 -49
  17. package/src/camera-session.windows.ts +113 -105
  18. package/src/host-movie.web.ts +257 -231
  19. package/src/index.ts +28 -26
  20. package/src/index.web.ts +27 -25
  21. package/src/layout-child.ts +86 -79
  22. package/src/layout-child.web.ts +54 -53
  23. package/src/layout-child.windows.ts +80 -74
  24. package/src/movie-metadata.web.ts +84 -81
  25. package/src/movie-storage.web.ts +142 -135
  26. package/src/movie-writer.ios.ts +170 -0
  27. package/src/photo-lifecycle.macos.ts +60 -0
  28. package/src/photo-sheet.macos.ts +505 -0
  29. package/src/preview-display.ios.ts +69 -0
  30. package/src/preview-pinch.ts +41 -0
  31. package/src/preview-tap.ts +22 -21
  32. package/src/props.ts +115 -93
  33. package/src/recording-haptics.ios.ts +39 -0
  34. package/src/recording-source.web.ts +159 -0
  35. package/src/session-backend.android.ts +552 -410
  36. package/src/session-backend.ios.ts +1500 -1148
  37. package/src/session-backend.linux.ts +886 -860
  38. package/src/session-backend.macos.ts +697 -679
  39. package/src/session-backend.ts +51 -49
  40. package/src/session-backend.web.ts +1181 -867
  41. package/src/session-backend.windows.ts +1540 -1467
  42. package/src/session-core.ts +925 -714
  43. package/src/session.ts +12 -12
  44. package/src/style-merge.ts +40 -37
  45. package/src/synthetic-session.ts +391 -339
  46. package/src/types.ts +372 -298
  47. package/types/generated/.tsrx-typegen-manifest.json +4 -24
  48. package/types/generated/CameraView.d.ts +2 -0
  49. package/types/generated/camera-host.macos.d.ts +33 -0
  50. package/types/generated/index.d.ts +27 -26
  51. package/types/generated/photo-lifecycle.macos.d.ts +12 -0
  52. package/types/generated/photo-sheet.macos.d.ts +36 -0
  53. package/types/generated/props.d.ts +24 -2
  54. package/types/generated/session-core.d.ts +30 -1
  55. package/types/generated/synthetic-session.d.ts +7 -0
  56. package/types/generated/types.d.ts +75 -1
  57. package/platforms/macos/src/CameraOwnership.swift +0 -22
  58. package/platforms/macos/src/PhotoCaptureLifecycle.swift +0 -34
  59. package/platforms/macos/src/XplatCameraHost.swift +0 -639
  60. package/platforms/macos/src/XplatPhotoCaptureSheet.swift +0 -192
  61. package/types/generated/CameraView.android.d.ts +0 -9
  62. package/types/generated/CameraView.ios.d.ts +0 -5
  63. package/types/generated/CameraView.macos.d.ts +0 -5
  64. package/types/generated/CameraView.mobile.d.ts +0 -5
  65. package/types/generated/CameraView.windows.d.ts +0 -11
  66. package/types/generated/camera-permission.mobile.d.ts +0 -2
  67. package/types/generated/camera-permission.windows.d.ts +0 -6
  68. package/types/generated/camera-session.ios.d.ts +0 -2
  69. package/types/generated/camera-session.macos.d.ts +0 -10
  70. package/types/generated/camera-session.windows.d.ts +0 -9
  71. package/types/generated/host-movie.web.d.ts +0 -100
  72. package/types/generated/index.web.d.ts +0 -7
  73. package/types/generated/layout-child.d.ts +0 -11
  74. package/types/generated/layout-child.windows.d.ts +0 -13
  75. package/types/generated/movie-metadata.web.d.ts +0 -9
  76. package/types/generated/movie-storage.web.d.ts +0 -5
  77. package/types/generated/preview-tap.d.ts +0 -7
  78. package/types/generated/session-backend.android.d.ts +0 -3
  79. package/types/generated/session-backend.ios.d.ts +0 -5
  80. package/types/generated/session-backend.linux.d.ts +0 -3
  81. package/types/generated/session-backend.macos.d.ts +0 -8
  82. package/types/generated/session-backend.web.d.ts +0 -3
  83. package/types/generated/session-backend.windows.d.ts +0 -37
  84. package/types/generated/style-merge.d.ts +0 -8
package/src/index.web.ts CHANGED
@@ -3,31 +3,33 @@ export type { CameraAccessibilityRole, CameraViewHandle, CameraViewProps } from
3
3
  export { createCameraSession } from './session'
4
4
  export { CameraCaptureError } from './types'
5
5
  export type {
6
- CameraCaptureErrorKind,
7
- CameraDeviceInfo,
8
- CameraFacing,
9
- CameraInterruptionReason,
10
- CameraOrientation,
11
- CameraPermissionKind,
12
- CameraPermissionStatus,
13
- CameraPreviewPoint,
14
- CameraProfileCapability,
15
- CameraRecorderState,
16
- CameraSelection,
17
- CameraSession,
18
- CameraSessionCapabilities,
19
- CameraSessionConfig,
20
- CameraSessionEvent,
21
- CameraSessionSnapshot,
22
- CaptureIssue,
23
- EffectiveCaptureConfig,
24
- MovieClip,
25
- MovieEndReason,
26
- MovieOutcome,
27
- MovieOutput,
28
- MovieOutputHandle,
29
- MovieTake,
30
- StartRecordingOptions,
6
+ CameraCaptureErrorKind,
7
+ CameraDeviceInfo,
8
+ CameraFacing,
9
+ CameraInterruptionReason,
10
+ CameraOrientation,
11
+ CameraPermissionKind,
12
+ CameraPermissionStatus,
13
+ CameraPinchEvent,
14
+ CameraPreviewPoint,
15
+ CameraProfileCapability,
16
+ CameraRecorderState,
17
+ CameraSelection,
18
+ CameraSession,
19
+ CameraSessionCapabilities,
20
+ CameraSessionConfig,
21
+ CameraSessionEvent,
22
+ CameraSessionSnapshot,
23
+ CameraZoomState,
24
+ CaptureIssue,
25
+ EffectiveCaptureConfig,
26
+ MovieClip,
27
+ MovieEndReason,
28
+ MovieOutcome,
29
+ MovieOutput,
30
+ MovieOutputHandle,
31
+ MovieTake,
32
+ StartRecordingOptions,
31
33
  } from './types'
32
34
 
33
35
  export { createMemoryCameraStorage, createSyntheticCameraSession } from './synthetic-session'
@@ -4,102 +4,109 @@ import { mergeStyle } from './style-merge'
4
4
 
5
5
  /** NativeScript reads layout fields from a child view during parent layout. */
6
6
  export function layoutChildProps(
7
- props: CameraViewProps,
8
- baseStyle: Record<string, any> | string | undefined = props.style,
7
+ props: CameraViewProps,
8
+ baseStyle: Record<string, any> | string | undefined = props.style,
9
9
  ): {
10
- style: string | Record<string, any>
10
+ style: string | Record<string, any>
11
11
  } {
12
- const style: Record<string, any> = { ...(typeof baseStyle === 'object' ? baseStyle : {}) }
13
- if (props.row !== undefined) {
14
- style.gridRow = `${props.row + 1} / span ${props.rowSpan ?? 1}`
15
- } else if (props.rowSpan !== undefined) {
16
- style.gridRow = `span ${props.rowSpan}`
17
- }
18
- if (props.col !== undefined) {
19
- style.gridColumn = `${props.col + 1} / span ${props.colSpan ?? 1}`
20
- } else if (props.colSpan !== undefined) {
21
- style.gridColumn = `span ${props.colSpan}`
22
- }
23
- if (props.dock !== undefined) {
24
- style.position = style.position ?? 'absolute'
25
- if (props.dock === 'left' || props.dock === 'top' || props.dock === 'bottom') {
26
- style.left = style.left ?? 0
27
- }
28
-
29
- if (props.dock === 'right' || props.dock === 'top' || props.dock === 'bottom') {
30
- style.right = style.right ?? 0
31
- }
32
-
33
- if (props.dock === 'top' || props.dock === 'left' || props.dock === 'right') {
34
- style.top = style.top ?? 0
35
- }
36
-
37
- if (props.dock === 'bottom' || props.dock === 'left' || props.dock === 'right') {
38
- style.bottom = style.bottom ?? 0
39
- }
40
- }
41
- for (const key of ['left', 'top', 'flexGrow', 'flexShrink', 'alignSelf', 'order'] as const) {
42
- if (props[key] !== undefined) {
43
- style[key] = props[key]
44
- }
45
- }
46
- if ((props.left !== undefined || props.top !== undefined) && props.dock === undefined) {
47
- style.position = style.position ?? 'absolute'
48
- }
49
- return { style: typeof baseStyle === 'string' ? mergeStyle(style, baseStyle) : style }
12
+ const style: Record<string, any> = { ...(typeof baseStyle === 'object' ? baseStyle : {}) }
13
+
14
+ if (props.row !== undefined) {
15
+ style.gridRow = `${props.row + 1} / span ${props.rowSpan ?? 1}`
16
+ } else if (props.rowSpan !== undefined) {
17
+ style.gridRow = `span ${props.rowSpan}`
18
+ }
19
+
20
+ if (props.col !== undefined) {
21
+ style.gridColumn = `${props.col + 1} / span ${props.colSpan ?? 1}`
22
+ } else if (props.colSpan !== undefined) {
23
+ style.gridColumn = `span ${props.colSpan}`
24
+ }
25
+
26
+ if (props.dock !== undefined) {
27
+ style.position = style.position ?? 'absolute'
28
+ if (props.dock === 'left' || props.dock === 'top' || props.dock === 'bottom') {
29
+ style.left = style.left ?? 0
30
+ }
31
+
32
+ if (props.dock === 'right' || props.dock === 'top' || props.dock === 'bottom') {
33
+ style.right = style.right ?? 0
34
+ }
35
+
36
+ if (props.dock === 'top' || props.dock === 'left' || props.dock === 'right') {
37
+ style.top = style.top ?? 0
38
+ }
39
+
40
+ if (props.dock === 'bottom' || props.dock === 'left' || props.dock === 'right') {
41
+ style.bottom = style.bottom ?? 0
42
+ }
43
+ }
44
+
45
+ for (const key of ['left', 'top', 'flexGrow', 'flexShrink', 'alignSelf', 'order'] as const) {
46
+ if (props[key] !== undefined) {
47
+ style[key] = props[key]
48
+ }
49
+ }
50
+
51
+ if ((props.left !== undefined || props.top !== undefined) && props.dock === undefined) {
52
+ style.position = style.position ?? 'absolute'
53
+ }
54
+
55
+ return { style: typeof baseStyle === 'string' ? mergeStyle(style, baseStyle) : style }
50
56
  }
51
57
 
52
58
  export function applyEscapeProps(view: any, props: { ios?: any; android?: any }): void {
53
- if (!view) {
54
- return
55
- }
56
-
57
- const bag = isIOS ? props.ios : props.android
58
- if (bag) {
59
- Object.assign(view, bag)
60
- }
59
+ if (!view) {
60
+ return
61
+ }
62
+
63
+ const bag = isIOS ? props.ios : props.android
64
+
65
+ if (bag) {
66
+ Object.assign(view, bag)
67
+ }
61
68
  }
62
69
 
63
70
  const nativeRoles: Record<string, string> = {
64
- button: 'button',
65
- link: 'link',
66
- search: 'search',
67
- image: 'image',
68
- heading: 'header',
69
- adjustable: 'adjustable',
70
- summary: 'summary',
71
- text: 'text',
72
- none: 'none',
73
- progressbar: 'progressBar',
74
- checkbox: 'checkbox',
75
- switch: 'switch',
76
- radio: 'radioButton',
77
- spinbutton: 'spinButton',
78
- tab: 'button',
71
+ button: 'button',
72
+ link: 'link',
73
+ search: 'search',
74
+ image: 'image',
75
+ heading: 'header',
76
+ adjustable: 'adjustable',
77
+ summary: 'summary',
78
+ text: 'text',
79
+ none: 'none',
80
+ progressbar: 'progressBar',
81
+ checkbox: 'checkbox',
82
+ switch: 'switch',
83
+ radio: 'radioButton',
84
+ spinbutton: 'spinButton',
85
+ tab: 'button',
79
86
  }
80
87
 
81
88
  export function nativeAccessibilityRole(role?: string): string | undefined {
82
- return role ? nativeRoles[role] : undefined
89
+ return role ? nativeRoles[role] : undefined
83
90
  }
84
91
 
85
92
  export function nativeAccessibilityState(
86
- state?: CameraViewProps['accessibilityState'],
93
+ state?: CameraViewProps['accessibilityState'],
87
94
  ): string | undefined {
88
- if (state?.disabled) {
89
- return 'disabled'
90
- }
95
+ if (state?.disabled) {
96
+ return 'disabled'
97
+ }
91
98
 
92
- if (state?.selected) {
93
- return 'selected'
94
- }
99
+ if (state?.selected) {
100
+ return 'selected'
101
+ }
95
102
 
96
- if (state?.checked === true) {
97
- return 'checked'
98
- }
103
+ if (state?.checked === true) {
104
+ return 'checked'
105
+ }
99
106
 
100
- if (state?.checked === false) {
101
- return 'unchecked'
102
- }
107
+ if (state?.checked === false) {
108
+ return 'unchecked'
109
+ }
103
110
 
104
- return undefined
111
+ return undefined
105
112
  }
@@ -1,71 +1,72 @@
1
1
  import type { CameraViewProps } from './props'
2
2
 
3
3
  export function layoutChildProps(
4
- props: CameraViewProps,
5
- baseStyle: any = props.style,
4
+ props: CameraViewProps,
5
+ baseStyle: any = props.style,
6
6
  ): {
7
- style: any
7
+ style: any
8
8
  } {
9
- const style = { ...baseStyle }
10
- if (props.row !== undefined) {
11
- style.gridRow = `${props.row + 1} / span ${props.rowSpan ?? 1}`
12
- } else if (props.rowSpan !== undefined) {
13
- style.gridRow = `span ${props.rowSpan}`
14
- }
9
+ const style = { ...baseStyle }
15
10
 
16
- if (props.col !== undefined) {
17
- style.gridColumn = `${props.col + 1} / span ${props.colSpan ?? 1}`
18
- } else if (props.colSpan !== undefined) {
19
- style.gridColumn = `span ${props.colSpan}`
20
- }
11
+ if (props.row !== undefined) {
12
+ style.gridRow = `${props.row + 1} / span ${props.rowSpan ?? 1}`
13
+ } else if (props.rowSpan !== undefined) {
14
+ style.gridRow = `span ${props.rowSpan}`
15
+ }
21
16
 
22
- if (props.left !== undefined) {
23
- style.left = props.left
24
- }
17
+ if (props.col !== undefined) {
18
+ style.gridColumn = `${props.col + 1} / span ${props.colSpan ?? 1}`
19
+ } else if (props.colSpan !== undefined) {
20
+ style.gridColumn = `span ${props.colSpan}`
21
+ }
25
22
 
26
- if (props.top !== undefined) {
27
- style.top = props.top
28
- }
23
+ if (props.left !== undefined) {
24
+ style.left = props.left
25
+ }
29
26
 
30
- if (props.flexGrow !== undefined) {
31
- style.flexGrow = props.flexGrow
32
- }
27
+ if (props.top !== undefined) {
28
+ style.top = props.top
29
+ }
33
30
 
34
- if (props.flexShrink !== undefined) {
35
- style.flexShrink = props.flexShrink
36
- }
31
+ if (props.flexGrow !== undefined) {
32
+ style.flexGrow = props.flexGrow
33
+ }
37
34
 
38
- if (props.alignSelf !== undefined) {
39
- style.alignSelf = props.alignSelf
40
- }
35
+ if (props.flexShrink !== undefined) {
36
+ style.flexShrink = props.flexShrink
37
+ }
41
38
 
42
- if (props.order !== undefined) {
43
- style.order = props.order
44
- }
39
+ if (props.alignSelf !== undefined) {
40
+ style.alignSelf = props.alignSelf
41
+ }
45
42
 
46
- return { style }
43
+ if (props.order !== undefined) {
44
+ style.order = props.order
45
+ }
46
+
47
+ return { style }
47
48
  }
48
49
 
49
50
  export function applyEscapeProps(element: any, props: { web?: any }): void {
50
- if (!element || !props.web) {
51
- return
52
- }
51
+ if (!element || !props.web) {
52
+ return
53
+ }
53
54
 
54
- for (const [key, value] of Object.entries(props.web)) {
55
- if (key.includes('-')) {
56
- if (value == null || value === false) {
57
- element.removeAttribute(key)
58
- } else {
59
- element.setAttribute(key, value === true ? '' : String(value))
60
- }
61
- } else if (key in element) {
62
- try {
63
- element[key] = value
64
- } catch {
65
- element.setAttribute(key, String(value))
66
- }
67
- } else if (value != null) {
68
- element.setAttribute(key, String(value))
69
- }
70
- }
55
+ for (const [key, value] of Object.entries(props.web)) {
56
+ if (key.includes('-')) {
57
+ if (value == null || value === false) {
58
+ element.removeAttribute(key)
59
+ } else {
60
+ element.setAttribute(key, value === true ? '' : String(value))
61
+ }
62
+ } else if (key in element) {
63
+ try {
64
+ element[key] = value
65
+ } catch {
66
+ element.setAttribute(key, String(value))
67
+ }
68
+ } else if (value != null) {
69
+ element.setAttribute(key, String(value))
70
+ }
71
+ }
71
72
  }
@@ -7,97 +7,103 @@ import { mergeStyle } from './style-merge'
7
7
  * boundary. */
8
8
 
9
9
  export function layoutChildProps(
10
- props: CameraViewProps,
11
- baseStyle: Record<string, any> | string | undefined = props.style,
10
+ props: CameraViewProps,
11
+ baseStyle: Record<string, any> | string | undefined = props.style,
12
12
  ): {
13
- style: string | Record<string, any>
13
+ style: string | Record<string, any>
14
14
  } {
15
- const style: Record<string, any> = { ...(typeof baseStyle === 'object' ? baseStyle : {}) }
16
- if (props.row !== undefined) {
17
- style.gridRow = `${props.row + 1} / span ${props.rowSpan ?? 1}`
18
- } else if (props.rowSpan !== undefined) {
19
- style.gridRow = `span ${props.rowSpan}`
20
- }
21
- if (props.col !== undefined) {
22
- style.gridColumn = `${props.col + 1} / span ${props.colSpan ?? 1}`
23
- } else if (props.colSpan !== undefined) {
24
- style.gridColumn = `span ${props.colSpan}`
25
- }
26
- if (props.dock !== undefined) {
27
- style.position = style.position ?? 'absolute'
28
- if (props.dock === 'left' || props.dock === 'top' || props.dock === 'bottom') {
29
- style.left = style.left ?? 0
30
- }
31
-
32
- if (props.dock === 'right' || props.dock === 'top' || props.dock === 'bottom') {
33
- style.right = style.right ?? 0
34
- }
35
-
36
- if (props.dock === 'top' || props.dock === 'left' || props.dock === 'right') {
37
- style.top = style.top ?? 0
38
- }
39
-
40
- if (props.dock === 'bottom' || props.dock === 'left' || props.dock === 'right') {
41
- style.bottom = style.bottom ?? 0
42
- }
43
- }
44
- for (const key of ['left', 'top', 'flexGrow', 'flexShrink', 'alignSelf', 'order'] as const) {
45
- if (props[key] !== undefined) {
46
- style[key] = props[key]
47
- }
48
- }
49
- if ((props.left !== undefined || props.top !== undefined) && props.dock === undefined) {
50
- style.position = style.position ?? 'absolute'
51
- }
52
- return { style: typeof baseStyle === 'string' ? mergeStyle(style, baseStyle) : style }
15
+ const style: Record<string, any> = { ...(typeof baseStyle === 'object' ? baseStyle : {}) }
16
+
17
+ if (props.row !== undefined) {
18
+ style.gridRow = `${props.row + 1} / span ${props.rowSpan ?? 1}`
19
+ } else if (props.rowSpan !== undefined) {
20
+ style.gridRow = `span ${props.rowSpan}`
21
+ }
22
+
23
+ if (props.col !== undefined) {
24
+ style.gridColumn = `${props.col + 1} / span ${props.colSpan ?? 1}`
25
+ } else if (props.colSpan !== undefined) {
26
+ style.gridColumn = `span ${props.colSpan}`
27
+ }
28
+
29
+ if (props.dock !== undefined) {
30
+ style.position = style.position ?? 'absolute'
31
+ if (props.dock === 'left' || props.dock === 'top' || props.dock === 'bottom') {
32
+ style.left = style.left ?? 0
33
+ }
34
+
35
+ if (props.dock === 'right' || props.dock === 'top' || props.dock === 'bottom') {
36
+ style.right = style.right ?? 0
37
+ }
38
+
39
+ if (props.dock === 'top' || props.dock === 'left' || props.dock === 'right') {
40
+ style.top = style.top ?? 0
41
+ }
42
+
43
+ if (props.dock === 'bottom' || props.dock === 'left' || props.dock === 'right') {
44
+ style.bottom = style.bottom ?? 0
45
+ }
46
+ }
47
+
48
+ for (const key of ['left', 'top', 'flexGrow', 'flexShrink', 'alignSelf', 'order'] as const) {
49
+ if (props[key] !== undefined) {
50
+ style[key] = props[key]
51
+ }
52
+ }
53
+
54
+ if ((props.left !== undefined || props.top !== undefined) && props.dock === undefined) {
55
+ style.position = style.position ?? 'absolute'
56
+ }
57
+
58
+ return { style: typeof baseStyle === 'string' ? mergeStyle(style, baseStyle) : style }
53
59
  }
54
60
 
55
61
  export function applyEscapeProps(view: any, props: { windows?: any }): void {
56
- if (view && props.windows) {
57
- Object.assign(view, props.windows)
58
- }
62
+ if (view && props.windows) {
63
+ Object.assign(view, props.windows)
64
+ }
59
65
  }
60
66
 
61
67
  const nativeRoles: Record<string, string> = {
62
- button: 'button',
63
- link: 'link',
64
- search: 'search',
65
- image: 'image',
66
- heading: 'header',
67
- adjustable: 'adjustable',
68
- summary: 'summary',
69
- text: 'text',
70
- none: 'none',
71
- progressbar: 'progressBar',
72
- checkbox: 'checkbox',
73
- switch: 'switch',
74
- radio: 'radioButton',
75
- spinbutton: 'spinButton',
76
- tab: 'button',
68
+ button: 'button',
69
+ link: 'link',
70
+ search: 'search',
71
+ image: 'image',
72
+ heading: 'header',
73
+ adjustable: 'adjustable',
74
+ summary: 'summary',
75
+ text: 'text',
76
+ none: 'none',
77
+ progressbar: 'progressBar',
78
+ checkbox: 'checkbox',
79
+ switch: 'switch',
80
+ radio: 'radioButton',
81
+ spinbutton: 'spinButton',
82
+ tab: 'button',
77
83
  }
78
84
 
79
85
  export function nativeAccessibilityRole(role?: string): string | undefined {
80
- return role ? nativeRoles[role] : undefined
86
+ return role ? nativeRoles[role] : undefined
81
87
  }
82
88
 
83
89
  export function nativeAccessibilityState(
84
- state?: CameraViewProps['accessibilityState'],
90
+ state?: CameraViewProps['accessibilityState'],
85
91
  ): string | undefined {
86
- if (state?.disabled) {
87
- return 'disabled'
88
- }
92
+ if (state?.disabled) {
93
+ return 'disabled'
94
+ }
89
95
 
90
- if (state?.selected) {
91
- return 'selected'
92
- }
96
+ if (state?.selected) {
97
+ return 'selected'
98
+ }
93
99
 
94
- if (state?.checked === true) {
95
- return 'checked'
96
- }
100
+ if (state?.checked === true) {
101
+ return 'checked'
102
+ }
97
103
 
98
- if (state?.checked === false) {
99
- return 'unchecked'
100
- }
104
+ if (state?.checked === false) {
105
+ return 'unchecked'
106
+ }
101
107
 
102
- return undefined
108
+ return undefined
103
109
  }