@symbiote-native/slider 5.1.0 → 6.0.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/README.md +43 -7
- package/build/angular/index.js +1 -1
- package/build/angular/slider/index.android.js +7 -1
- package/build/angular/slider/index.ios.js +8 -2
- package/build/angular/slider/shared.js +4 -1
- package/build/core/index.d.ts +2 -2
- package/build/core/render-slider.js +5 -1
- package/build/core/render-steps-indicator.js +13 -4
- package/build/react/index.js +1 -1
- package/build/react/slider/index.ios.js +1 -1
- package/build/react/slider/shared.js +11 -4
- package/build/register/index.js +5 -2
- package/build/solid/index.d.ts +4 -0
- package/build/solid/index.js +8 -0
- package/build/solid/slider/index.android.d.ts +2 -0
- package/build/solid/slider/index.android.js +10 -0
- package/build/solid/slider/index.d.ts +1 -0
- package/build/solid/slider/index.ios.d.ts +2 -0
- package/build/solid/slider/index.ios.js +11 -0
- package/build/solid/slider/index.js +4 -0
- package/build/solid/slider/shared.d.ts +12 -0
- package/build/solid/slider/shared.js +296 -0
- package/build/svelte/index.js +1 -1
- package/build/svelte/slider/index.svelte +62 -10
- package/build/svelte/slider/slider-platform.ios.js +1 -1
- package/build/vue/index.js +1 -1
- package/build/vue/slider/index.ios.js +1 -1
- package/build/vue/slider/shared.js +11 -5
- package/build-ngc/angular/slider/index.android.js +14 -2
- package/build-ngc/angular/slider/index.android.js.map +1 -1
- package/build-ngc/angular/slider/index.ios.js +15 -3
- package/build-ngc/angular/slider/index.ios.js.map +1 -1
- package/build-ngc/angular/slider/shared.js +4 -1
- package/build-ngc/angular/slider/shared.js.map +1 -1
- package/build-ngc/core/index.d.ts +2 -2
- package/build-ngc/core/index.js.map +1 -1
- package/build-ngc/core/render-slider.js +5 -1
- package/build-ngc/core/render-slider.js.map +1 -1
- package/build-ngc/core/render-steps-indicator.js +13 -4
- package/build-ngc/core/render-steps-indicator.js.map +1 -1
- package/build-ngc/core/slider-state.js.map +1 -1
- package/build-ngc/register/index.js +5 -2
- package/build-ngc/register/index.js.map +1 -1
- package/package.json +39 -15
- package/src/angular/slider/index.android.ts +7 -1
- package/src/angular/slider/index.ios.ts +11 -2
- package/src/angular/slider/shared.ts +31 -10
- package/src/core/index.ts +9 -2
- package/src/core/render-slider.ts +24 -6
- package/src/core/render-steps-indicator.ts +38 -10
- package/src/core/slider-props.ts +5 -1
- package/src/core/slider-state.ts +16 -5
- package/src/react/slider/index.ios.ts +4 -1
- package/src/react/slider/shared.ts +66 -15
- package/src/register/index.ts +9 -2
- package/src/solid/index.ts +12 -0
- package/src/solid/slider/index.android.ts +15 -0
- package/src/solid/slider/index.ios.ts +19 -0
- package/src/solid/slider/index.ts +5 -0
- package/src/solid/slider/shared.ts +468 -0
- package/src/svelte/slider/index.svelte +62 -10
- package/src/svelte/slider/slider-platform.ios.ts +4 -1
- package/src/svelte/slider/slider-props.ts +4 -1
- package/src/vue/slider/index.ios.ts +4 -1
- package/src/vue/slider/shared.ts +72 -19
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# @symbiote-native/slider
|
|
2
2
|
|
|
3
3
|
A wrapper package for [SymbioteNative](../../README.md) that makes the third-party native
|
|
4
|
-
`@react-native-community/slider` view usable from **every** adapter — React, Vue,
|
|
5
|
-
not just React. The library's default export is a React component (it calls hooks
|
|
6
|
-
dispatcher), so a non-React adapter renders it with a null dispatcher and it throws.
|
|
4
|
+
`@react-native-community/slider` view usable from **every** adapter — React, Vue, Svelte, Solid,
|
|
5
|
+
and Angular — not just React. The library's default export is a React component (it calls hooks
|
|
6
|
+
off the React dispatcher), so a non-React adapter renders it with a null dispatcher and it throws.
|
|
7
|
+
This package
|
|
7
8
|
reaches the native `RNCSlider` view directly through the engine's `createNode`-by-ViewConfig path
|
|
8
9
|
instead of importing the library's React component — the same mechanism SymbioteNative uses for its
|
|
9
10
|
own primitives.
|
|
@@ -29,14 +30,16 @@ src/register.ts side-effect import of RNCSlider's codegen spec — registers its
|
|
|
29
30
|
(never the library's React Slider.tsx)
|
|
30
31
|
src/react/ @symbiote-native/slider/react — forwardRef FC + descriptorToReact
|
|
31
32
|
src/vue/ @symbiote-native/slider/vue — defineComponent + descriptorToVue
|
|
33
|
+
src/svelte/ @symbiote-native/slider/svelte — .svelte component + the DOM-shim renderer
|
|
34
|
+
src/solid/ @symbiote-native/slider/solid — signals + descriptorToSolid
|
|
32
35
|
src/angular/ @symbiote-native/slider/angular — Angular component + descriptorToAngular
|
|
33
36
|
```
|
|
34
37
|
|
|
35
38
|
Each adapter entry imports `../register` first (so the ViewConfig is registered before the
|
|
36
39
|
component ever mounts), then exposes a platform-split `Slider`. The core is written once; every
|
|
37
40
|
adapter inherits the same folding logic and the same `ISliderProps` surface (extended per-adapter
|
|
38
|
-
only where a field carries a framework element — the custom `StepMarker` is a React render prop
|
|
39
|
-
|
|
41
|
+
only where a field carries a framework element — the custom `StepMarker` is a React render prop, a
|
|
42
|
+
Vue scoped slot, a Svelte `Snippet`, and a Solid render prop taking an **accessor**).
|
|
40
43
|
|
|
41
44
|
## Packaging — one dependency, not two
|
|
42
45
|
|
|
@@ -64,7 +67,7 @@ import { Slider } from '@symbiote-native/slider/react';
|
|
|
64
67
|
minimumTrackTintColor="#7fb5ff"
|
|
65
68
|
maximumTrackTintColor="#334155"
|
|
66
69
|
thumbTintColor="#ffffff"
|
|
67
|
-
|
|
70
|
+
/>;
|
|
68
71
|
```
|
|
69
72
|
|
|
70
73
|
```vue
|
|
@@ -81,6 +84,39 @@ import { Slider } from '@symbiote-native/slider/vue';
|
|
|
81
84
|
</template>
|
|
82
85
|
```
|
|
83
86
|
|
|
87
|
+
```svelte
|
|
88
|
+
<!-- Svelte — examples/svelte/screens/CanaryScreen.svelte -->
|
|
89
|
+
<script lang="ts">
|
|
90
|
+
import { Slider } from '@symbiote-native/slider/svelte';
|
|
91
|
+
let volume = $state(0.6);
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<Slider
|
|
95
|
+
value={volume}
|
|
96
|
+
onValueChange={next => (volume = next)}
|
|
97
|
+
minimumValue={0}
|
|
98
|
+
maximumValue={1}
|
|
99
|
+
step={0.01}
|
|
100
|
+
minimumTrackTintColor="#7fb5ff"
|
|
101
|
+
maximumTrackTintColor="#334155"
|
|
102
|
+
thumbTintColor="#ffffff"
|
|
103
|
+
/>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
// Solid — the marker props arrive as an ACCESSOR, so only the leaf reading them re-runs
|
|
108
|
+
import { Slider } from '@symbiote-native/slider/solid';
|
|
109
|
+
|
|
110
|
+
<Slider
|
|
111
|
+
value={volume()}
|
|
112
|
+
onValueChange={setVolume}
|
|
113
|
+
step={0.25}
|
|
114
|
+
StepMarker={marker => (
|
|
115
|
+
<symbiote-view style={{ opacity: marker().stepMarked ? 1 : 0.3 }} />
|
|
116
|
+
)}
|
|
117
|
+
/>;
|
|
118
|
+
```
|
|
119
|
+
|
|
84
120
|
```ts
|
|
85
121
|
// Angular — examples/angular/App.ts
|
|
86
122
|
import { Slider } from '@symbiote-native/slider/angular';
|
|
@@ -93,6 +129,6 @@ processors from its own ViewConfig at runtime, so there is nothing to pre-resolv
|
|
|
93
129
|
## Test it
|
|
94
130
|
|
|
95
131
|
Headless component tests live next to each adapter entry
|
|
96
|
-
(`src/{react,vue,angular}/slider/slider
|
|
132
|
+
(`src/{react,vue,svelte,solid,angular}/slider/slider*.test.{ts,tsx}`) and inject a fake ViewConfig via
|
|
97
133
|
`setNativeViewConfigSource`, so they run without a real Fabric host. Native rendering is verified
|
|
98
134
|
on-device (see the parent [README](../../README.md) for the project's testing model).
|
package/build/angular/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../register';
|
|
1
|
+
import '../register/index.js';
|
|
2
2
|
export { Slider } from './slider';
|
|
@@ -46,7 +46,13 @@ let Slider = (() => {
|
|
|
46
46
|
standalone: true,
|
|
47
47
|
imports: [DescriptorOutlet],
|
|
48
48
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
49
|
-
providers: [
|
|
49
|
+
providers: [
|
|
50
|
+
{
|
|
51
|
+
provide: NG_VALUE_ACCESSOR,
|
|
52
|
+
useExisting: forwardRef(() => Slider),
|
|
53
|
+
multi: true,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
50
56
|
template: `<symbiote-descriptor-outlet [node]="descriptor" />`,
|
|
51
57
|
})];
|
|
52
58
|
let _classDescriptor;
|
|
@@ -39,7 +39,7 @@ import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
|
|
|
39
39
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
40
40
|
import { DescriptorOutlet } from '@symbiote-native/angular';
|
|
41
41
|
import { SliderBase } from './shared.js';
|
|
42
|
-
import { SLIDER_IOS_DEFAULT_HEIGHT, SLIDER_STEP_RESOLUTION_IOS } from '../../core/index.js';
|
|
42
|
+
import { SLIDER_IOS_DEFAULT_HEIGHT, SLIDER_STEP_RESOLUTION_IOS, } from '../../core/index.js';
|
|
43
43
|
const IOS_STEPS_CONTAINER_TOP = 10;
|
|
44
44
|
let Slider = (() => {
|
|
45
45
|
let _classDecorators = [Component({
|
|
@@ -47,7 +47,13 @@ let Slider = (() => {
|
|
|
47
47
|
standalone: true,
|
|
48
48
|
imports: [DescriptorOutlet],
|
|
49
49
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
50
|
-
providers: [
|
|
50
|
+
providers: [
|
|
51
|
+
{
|
|
52
|
+
provide: NG_VALUE_ACCESSOR,
|
|
53
|
+
useExisting: forwardRef(() => Slider),
|
|
54
|
+
multi: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
51
57
|
template: `<symbiote-descriptor-outlet [node]="descriptor" />`,
|
|
52
58
|
})];
|
|
53
59
|
let _classDescriptor;
|
|
@@ -660,7 +660,10 @@ let SliderBase = (() => {
|
|
|
660
660
|
inverted,
|
|
661
661
|
platform: this.platform,
|
|
662
662
|
});
|
|
663
|
-
return renderSlider(view, this.platform, {
|
|
663
|
+
return renderSlider(view, this.platform, {
|
|
664
|
+
steps,
|
|
665
|
+
onLayout: this.handleLayout,
|
|
666
|
+
});
|
|
664
667
|
}
|
|
665
668
|
};
|
|
666
669
|
return SliderBase = _classThis;
|
package/build/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
2
|
export { sanitizeSliderValue, resolveSliderDisabled, resolveSliderAccessibilityState, resolveSliderLowerLimit, resolveSliderUpperLimit, valueFromSliderEvent, computeStepOptions, shouldRenderStepsIndicator, resolveThumbTintColor, shouldPassNativeThumbImage, isInvalidLimitConfig, } from './slider-state';
|
|
3
3
|
export type { ISliderAccessibilityState } from './slider-state';
|
|
4
|
-
export type { ISliderProps, ISliderPlatform, ISliderViewProps } from './slider-props';
|
|
4
|
+
export type { ISliderProps, ISliderPlatform, ISliderViewProps, } from './slider-props';
|
|
5
5
|
export { renderSlider, renderSliderNative, resolveSliderWrapperStyle, resolveSliderNativeStyle, } from './render-slider';
|
|
6
6
|
export { renderStepsIndicator, resolveStepsContainerStyle, stepNumberFontSize, orderStepOptions, STEP_INDICATOR_ELEMENT_STYLE, TRACK_MARK_CONTAINER_STYLE, THUMB_IMAGE_CONTAINER_STYLE, THUMB_IMAGE_STYLE, STEP_NUMBER_CONTAINER_STYLE, } from './render-steps-indicator';
|
|
7
|
-
export type { IStepsIndicatorParams, IStepMarkerProps } from './render-steps-indicator';
|
|
7
|
+
export type { IStepsIndicatorParams, IStepMarkerProps, } from './render-steps-indicator';
|
|
@@ -11,7 +11,11 @@ import { RNC_SLIDER_VIEW_NAME } from './constants.js';
|
|
|
11
11
|
// The native slider stretches to the measured wrapper width when one is given (the step indicator
|
|
12
12
|
// and thumb then share one coordinate space); without it the slider sizes naturally.
|
|
13
13
|
export function resolveSliderNativeStyle(width, platform) {
|
|
14
|
-
const base = {
|
|
14
|
+
const base = {
|
|
15
|
+
zIndex: 1,
|
|
16
|
+
alignContent: 'center',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
};
|
|
15
19
|
const sized = width === undefined ? base : [base, { width }];
|
|
16
20
|
return [platform.defaultStyle, sized];
|
|
17
21
|
}
|
|
@@ -64,16 +64,25 @@ export function orderStepOptions(options, inverted) {
|
|
|
64
64
|
function renderStepCell(value, displayIndex, params, fontSize) {
|
|
65
65
|
const trackMarkChildren = [];
|
|
66
66
|
if (params.thumbImage !== undefined && value === params.currentValue) {
|
|
67
|
-
trackMarkChildren.push(el('symbiote-view', {
|
|
67
|
+
trackMarkChildren.push(el('symbiote-view', {
|
|
68
|
+
style: THUMB_IMAGE_CONTAINER_STYLE,
|
|
69
|
+
testID: 'sliderTrackMark-thumbImage',
|
|
70
|
+
}, [
|
|
71
|
+
el('symbiote-image', {
|
|
72
|
+
source: params.thumbImage,
|
|
73
|
+
style: THUMB_IMAGE_STYLE,
|
|
74
|
+
}),
|
|
75
|
+
]));
|
|
68
76
|
}
|
|
69
77
|
const cellChildren = [
|
|
70
78
|
el('symbiote-view', { style: TRACK_MARK_CONTAINER_STYLE }, trackMarkChildren),
|
|
71
79
|
];
|
|
72
80
|
if (params.renderStepNumber === true) {
|
|
73
81
|
cellChildren.push(el('symbiote-view', { style: STEP_NUMBER_CONTAINER_STYLE }, [
|
|
74
|
-
txt({
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
txt({
|
|
83
|
+
testID: `${displayIndex}th-step`,
|
|
84
|
+
style: { fontSize },
|
|
85
|
+
}, [String(value)]),
|
|
77
86
|
]));
|
|
78
87
|
}
|
|
79
88
|
return el('symbiote-view', { style: STEP_INDICATOR_ELEMENT_STYLE }, cellChildren);
|
package/build/react/index.js
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
// import of the codegen spec — never the library's React Slider component), then exposes the
|
|
4
4
|
// platform-split Slider. The public prop type is the agnostic base plus React's StepMarker render
|
|
5
5
|
// component (Vue takes the same marker as a scoped slot).
|
|
6
|
-
import '../register';
|
|
6
|
+
import '../register/index.js';
|
|
7
7
|
export { Slider } from './slider';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// default), lays out implicit steps at 1000-point resolution, and nudges the step row down 10pt.
|
|
3
3
|
// Also the base (./index re-exports it) for headless. Mirrors the library's iOS branches.
|
|
4
4
|
import { createSlider } from './shared.js';
|
|
5
|
-
import { SLIDER_IOS_DEFAULT_HEIGHT, SLIDER_STEP_RESOLUTION_IOS } from '../../core/index.js';
|
|
5
|
+
import { SLIDER_IOS_DEFAULT_HEIGHT, SLIDER_STEP_RESOLUTION_IOS, } from '../../core/index.js';
|
|
6
6
|
const IOS_STEPS_CONTAINER_TOP = 10;
|
|
7
7
|
export const Slider = createSlider({
|
|
8
8
|
defaultStyle: { height: SLIDER_IOS_DEFAULT_HEIGHT },
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
// it). This is the React twin of the Vue wrapper; both drive the engine, NEITHER imports the
|
|
9
9
|
// library's React Slider component — that component internally calls React hooks off the React
|
|
10
10
|
// dispatcher, so a non-React adapter rendering it directly would crash on a null dispatcher.
|
|
11
|
-
import { createElement, forwardRef, useCallback, useEffect, useState } from 'react';
|
|
11
|
+
import { createElement, forwardRef, useCallback, useEffect, useState, } from 'react';
|
|
12
12
|
import { descriptorToReact, Image } from '@symbiote-native/react';
|
|
13
13
|
import { resolveAccessibilityProps } from '@symbiote-native/components';
|
|
14
|
-
import { dlog } from '@symbiote-native/engine';
|
|
14
|
+
import { dlog, } from '@symbiote-native/engine';
|
|
15
15
|
import { sanitizeSliderValue, resolveSliderDisabled, resolveSliderAccessibilityState, resolveSliderLowerLimit, resolveSliderUpperLimit, valueFromSliderEvent, shouldRenderStepsIndicator, resolveThumbTintColor, shouldPassNativeThumbImage, isInvalidLimitConfig, computeStepOptions, orderStepOptions, stepNumberFontSize, renderSlider, renderSliderNative, resolveStepsContainerStyle, renderStepsIndicator, STEP_INDICATOR_ELEMENT_STYLE, TRACK_MARK_CONTAINER_STYLE, THUMB_IMAGE_CONTAINER_STYLE, THUMB_IMAGE_STYLE, STEP_NUMBER_CONTAINER_STYLE, SLIDER_DEFAULT_MINIMUM_VALUE, SLIDER_DEFAULT_MAXIMUM_VALUE, SLIDER_DEFAULT_STEP, SLIDER_ON_CHANGE, SLIDER_ON_VALUE_CHANGE, SLIDER_ON_SLIDING_START, SLIDER_ON_SLIDING_COMPLETE, SLIDER_ON_ACCESSIBILITY_ACTION, } from '../../core/index.js';
|
|
16
16
|
function isRecord(value) {
|
|
17
17
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -116,7 +116,11 @@ export function createSlider(platform) {
|
|
|
116
116
|
platform,
|
|
117
117
|
StepMarker,
|
|
118
118
|
});
|
|
119
|
-
return createElement('symbiote-view', {
|
|
119
|
+
return createElement('symbiote-view', {
|
|
120
|
+
style: resolveStepsWrapperStyle(style, platform),
|
|
121
|
+
onLayout: handleLayout,
|
|
122
|
+
className,
|
|
123
|
+
}, overlay, descriptorToReact(renderSliderNative(view, platform)));
|
|
120
124
|
}
|
|
121
125
|
const steps = renderStepsIndicator({
|
|
122
126
|
options,
|
|
@@ -158,7 +162,10 @@ function renderCustomStepsOverlay(params) {
|
|
|
158
162
|
key: 'thumb',
|
|
159
163
|
style: THUMB_IMAGE_CONTAINER_STYLE,
|
|
160
164
|
testID: 'sliderTrackMark-thumbImage',
|
|
161
|
-
}, createElement(Image, {
|
|
165
|
+
}, createElement(Image, {
|
|
166
|
+
source: params.thumbImage,
|
|
167
|
+
style: THUMB_IMAGE_STYLE,
|
|
168
|
+
})));
|
|
162
169
|
}
|
|
163
170
|
const cellChildren = [
|
|
164
171
|
createElement('symbiote-view', { key: 'track', style: TRACK_MARK_CONTAINER_STYLE }, ...trackChildren),
|
package/build/register/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// hooks, so it is framework-agnostic and shared by every adapter entry (vue / react). Each adapter
|
|
7
7
|
// barrel imports it; the component modules and their headless tests stay free of the spec.
|
|
8
8
|
import '@react-native-community/slider/dist/RNCSliderNativeComponent';
|
|
9
|
-
import { processColor, registerComponent } from '@symbiote-native/engine';
|
|
9
|
+
import { processColor, registerComponent, } from '@symbiote-native/engine';
|
|
10
10
|
import { RNC_SLIDER_VIEW_NAME, SLIDER_ON_CHANGE, SLIDER_ON_VALUE_CHANGE, SLIDER_ON_SLIDING_START, SLIDER_ON_SLIDING_COMPLETE, SLIDER_ON_ACCESSIBILITY_ACTION, } from '../core/index.js';
|
|
11
11
|
function listenerName(prop) {
|
|
12
12
|
return prop.charAt(2).toLowerCase() + prop.slice(3);
|
|
@@ -22,7 +22,10 @@ function processSliderColor(value) {
|
|
|
22
22
|
registerComponent(RNC_SLIDER_VIEW_NAME, {
|
|
23
23
|
events: [
|
|
24
24
|
{ raw: 'topChange', listener: listenerName(SLIDER_ON_CHANGE) },
|
|
25
|
-
{
|
|
25
|
+
{
|
|
26
|
+
raw: 'topRNCSliderValueChange',
|
|
27
|
+
listener: listenerName(SLIDER_ON_VALUE_CHANGE),
|
|
28
|
+
},
|
|
26
29
|
{
|
|
27
30
|
raw: 'topRNCSliderSlidingStart',
|
|
28
31
|
listener: listenerName(SLIDER_ON_SLIDING_START),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @symbiote-native/slider/solid: the Solid wrapper over the @react-native-community/slider native
|
|
2
|
+
// view. The bare import below is FIRST and is a side effect, not a re-export: it registers the
|
|
3
|
+
// native view's ViewConfig (the codegen spec, never the library's React component) before any
|
|
4
|
+
// Slider can mount. Metro's production-only `inlineRequires` moves a require down to the first
|
|
5
|
+
// place its binding is USED and compiles a barrel's re-export into a lazy getter, so a registration
|
|
6
|
+
// reached through one silently never runs in RELEASE builds only. Do not restructure it.
|
|
7
|
+
import '../register/index.js';
|
|
8
|
+
export { Slider } from './slider';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Slider on Android: the native view sizes itself (no default height), lays out implicit steps at
|
|
2
|
+
// 128-point resolution, and keeps the step row at the top. Mirrors the library's Android branches.
|
|
3
|
+
import { createSlider } from './shared.js';
|
|
4
|
+
import { SLIDER_STEP_RESOLUTION_ANDROID } from '../../core/index.js';
|
|
5
|
+
const ANDROID_STEPS_CONTAINER_TOP = 0;
|
|
6
|
+
export const Slider = createSlider({
|
|
7
|
+
defaultStyle: {},
|
|
8
|
+
stepResolution: SLIDER_STEP_RESOLUTION_ANDROID,
|
|
9
|
+
stepsContainerTop: ANDROID_STEPS_CONTAINER_TOP,
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.ios';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Slider on iOS: the native view has an intrinsic 40pt height (the wrapper applies it as the
|
|
2
|
+
// default), lays out implicit steps at 1000-point resolution, and nudges the step row down 10pt.
|
|
3
|
+
// Also the base (./index re-exports it) for headless. Mirrors the library's iOS branches.
|
|
4
|
+
import { createSlider } from './shared.js';
|
|
5
|
+
import { SLIDER_IOS_DEFAULT_HEIGHT, SLIDER_STEP_RESOLUTION_IOS, } from '../../core/index.js';
|
|
6
|
+
const IOS_STEPS_CONTAINER_TOP = 10;
|
|
7
|
+
export const Slider = createSlider({
|
|
8
|
+
defaultStyle: { height: SLIDER_IOS_DEFAULT_HEIGHT },
|
|
9
|
+
stepResolution: SLIDER_STEP_RESOLUTION_IOS,
|
|
10
|
+
stepsContainerTop: IOS_STEPS_CONTAINER_TOP,
|
|
11
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Base / default Slider: re-exports the iOS build. Metro overrides this with index.ios.ts /
|
|
2
|
+
// index.android.ts on a real host; under vitest / tsc the resolution lands here. Filename is the
|
|
3
|
+
// selector, no Platform.OS read — the same convention adapters/solid's own Switch follows.
|
|
4
|
+
export * from './index.ios.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Accessor, Ref } from 'solid-js';
|
|
2
|
+
import { type IHostInstance } from '@symbiote-native/solid';
|
|
3
|
+
import type { JSX } from '@symbiote-native/solid/jsx-runtime';
|
|
4
|
+
import { type IClassNameValue } from '@symbiote-native/engine';
|
|
5
|
+
import { type ISliderPlatform, type ISliderProps as ISliderBaseProps, type IStepMarkerProps } from '../../core';
|
|
6
|
+
export type ISliderStepMarker = (marker: Accessor<IStepMarkerProps>) => JSX.Element;
|
|
7
|
+
export type ISliderProps = ISliderBaseProps & {
|
|
8
|
+
class?: IClassNameValue;
|
|
9
|
+
StepMarker?: ISliderStepMarker;
|
|
10
|
+
ref?: Ref<IHostInstance>;
|
|
11
|
+
};
|
|
12
|
+
export declare function createSlider(platform: ISliderPlatform): (props: ISliderProps) => JSX.Element;
|