@symbiote-native/components 0.5.0 → 2.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 +23 -10
- package/build/accessibility-props.d.ts +11 -0
- package/build/accessibility-props.js +30 -118
- package/build/behaviors/activity-indicator/index.android.d.ts +1 -0
- package/build/behaviors/activity-indicator/index.android.js +16 -0
- package/build/behaviors/activity-indicator/index.d.ts +3 -0
- package/build/behaviors/activity-indicator/index.ios.d.ts +1 -0
- package/build/behaviors/activity-indicator/index.ios.js +14 -0
- package/build/behaviors/activity-indicator/index.js +5 -0
- package/build/behaviors/activity-indicator/shared.d.ts +18 -0
- package/build/behaviors/activity-indicator/shared.js +149 -0
- package/build/behaviors/button.d.ts +2 -0
- package/build/behaviors/button.js +328 -0
- package/build/behaviors/image-background.d.ts +2 -0
- package/build/behaviors/image-background.js +139 -0
- package/build/behaviors/image.d.ts +3 -0
- package/build/behaviors/image.js +123 -0
- package/build/behaviors/input-accessory-view.d.ts +3 -0
- package/build/behaviors/input-accessory-view.js +70 -0
- package/build/behaviors/pressable.d.ts +60 -0
- package/build/behaviors/pressable.js +385 -0
- package/build/behaviors/refresh-control.d.ts +2 -0
- package/build/behaviors/refresh-control.js +83 -0
- package/build/behaviors/scroll-view/index.android.d.ts +1 -0
- package/build/behaviors/scroll-view/index.android.js +52 -0
- package/build/behaviors/scroll-view/index.d.ts +2 -0
- package/build/behaviors/scroll-view/index.ios.d.ts +1 -0
- package/build/behaviors/scroll-view/index.ios.js +10 -0
- package/build/behaviors/scroll-view/index.js +5 -0
- package/build/behaviors/scroll-view/shared.d.ts +11 -0
- package/build/behaviors/scroll-view/shared.js +291 -0
- package/build/behaviors/scroll-view/sticky.d.ts +17 -0
- package/build/behaviors/scroll-view/sticky.js +568 -0
- package/build/behaviors/switch.d.ts +2 -0
- package/build/behaviors/switch.js +186 -0
- package/build/behaviors/text-input.d.ts +14 -0
- package/build/behaviors/text-input.js +319 -0
- package/build/behaviors/touchable-highlight.d.ts +9 -0
- package/build/behaviors/touchable-highlight.js +192 -0
- package/build/behaviors/touchable-native-feedback.d.ts +20 -0
- package/build/behaviors/touchable-native-feedback.js +333 -0
- package/build/behaviors/touchable-opacity.d.ts +12 -0
- package/build/behaviors/touchable-opacity.js +227 -0
- package/build/behaviors/touchable-without-feedback.d.ts +2 -0
- package/build/behaviors/touchable-without-feedback.js +296 -0
- package/build/component-names/index.android.js +47 -15
- package/build/component-names/index.ios.js +35 -15
- package/build/component-names/shared.d.ts +2 -1
- package/build/component-names/shared.js +49 -3
- package/build/descriptor.js +4 -4
- package/build/fold-host-bag.d.ts +15 -0
- package/build/fold-host-bag.js +99 -0
- package/build/index.d.ts +23 -12
- package/build/index.js +50 -9
- package/build/register.d.ts +1 -0
- package/build/register.js +55 -0
- package/build/resolve-intrinsic.d.ts +7 -0
- package/build/resolve-intrinsic.js +49 -0
- package/build/scroll-view-commands.d.ts +4 -0
- package/build/scroll-view-commands.js +30 -31
- package/build/state/pressable.d.ts +9 -0
- package/build/state/pressable.js +120 -34
- package/build/state/text-input.d.ts +10 -2
- package/build/state/text-input.js +11 -0
- package/build/text-props.js +2 -1
- package/build/view/render-button.d.ts +36 -1
- package/build/view/render-button.js +101 -12
- package/build/view/render-image/index.d.ts +2 -0
- package/build/view/render-image/index.js +29 -2
- package/build/view/render-input-accessory-view.d.ts +2 -0
- package/build/view/render-input-accessory-view.js +37 -5
- package/build/view/render-modal.js +3 -3
- package/build/view/render-pressable/index.d.ts +2 -0
- package/build/view/render-pressable/index.js +24 -0
- package/build/view/render-scroll-view.d.ts +1 -0
- package/build/view/render-scroll-view.js +18 -9
- package/build/view/render-switch.d.ts +4 -1
- package/build/view/render-switch.js +8 -2
- package/build/view/render-text-input.js +6 -2
- package/build/view/render-touchable-native-feedback.d.ts +19 -0
- package/build/view/render-touchable-native-feedback.js +19 -0
- package/host-primitives.cjs +432 -0
- package/host-primitives.d.cts +33 -0
- package/package.json +33 -5
- package/build/view/render-activity-indicator.d.ts +0 -25
- package/build/view/render-activity-indicator.js +0 -62
- package/build/view/render-image-background.d.ts +0 -9
- package/build/view/render-image-background.js +0 -48
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// ImageBackground: the render half (framework-agnostic). Pure JS composition, no native
|
|
2
|
-
// component of its own (mirrors react-native/Libraries/Image/ImageBackground.js): an outer
|
|
3
|
-
// View receives the wrapper `style`; an absolutely-filled Image sits behind it; the user's
|
|
4
|
-
// `children` paint on top (as siblings AFTER the image in the wrapper's child order, injected
|
|
5
|
-
// by the adapter). Shared verbatim across adapters: React and Vue both bridge this Descriptor.
|
|
6
|
-
//
|
|
7
|
-
// The inner Image is positioned absolute-fill and has the wrapper's width/height reapplied:
|
|
8
|
-
// RN's Image overwrites its own width/height from the source's intrinsic size, which would
|
|
9
|
-
// fight the wrapper's explicit dimensions, so we proxy them back onto the Image so it fills
|
|
10
|
-
// the box. `imageStyle` wins last.
|
|
11
|
-
import { dlog, flattenStyle, } from '@symbiote-native/engine';
|
|
12
|
-
import { el } from '../descriptor.js';
|
|
13
|
-
import { renderImage } from './render-image/index.js';
|
|
14
|
-
// The inner Image's positioning: absolute-fill behind the wrapper's children.
|
|
15
|
-
const IMAGE_BACKGROUND_ABSOLUTE_FILL = {
|
|
16
|
-
position: 'absolute',
|
|
17
|
-
left: 0,
|
|
18
|
-
right: 0,
|
|
19
|
-
top: 0,
|
|
20
|
-
bottom: 0,
|
|
21
|
-
};
|
|
22
|
-
// Read one explicit dimension off the (already-flattened) wrapper style. A dp number or a
|
|
23
|
-
// percentage string is a valid IDimensionValue; anything else (auto / undefined) yields undefined.
|
|
24
|
-
function readDimension(style, key) {
|
|
25
|
-
const value = Object.hasOwn(style, key) ? Reflect.get(style, key) : undefined;
|
|
26
|
-
if (typeof value === 'number' || typeof value === 'string')
|
|
27
|
-
return value;
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
export function renderImageBackground(view) {
|
|
31
|
-
// Flatten only to read the wrapper's explicit dimensions; RN copies these onto the Image so
|
|
32
|
-
// it fills the box rather than collapsing to the source's intrinsic size. `imageStyle` last.
|
|
33
|
-
const flattenedWrapper = flattenStyle(view.style);
|
|
34
|
-
const imageMergedStyle = [
|
|
35
|
-
IMAGE_BACKGROUND_ABSOLUTE_FILL,
|
|
36
|
-
{
|
|
37
|
-
width: readDimension(flattenedWrapper, 'width'),
|
|
38
|
-
height: readDimension(flattenedWrapper, 'height'),
|
|
39
|
-
},
|
|
40
|
-
view.imageStyle,
|
|
41
|
-
];
|
|
42
|
-
dlog('ImageBackground -> View(RCTView) > Image(RCTImageView absolute-fill) + children');
|
|
43
|
-
// The wrapper View holds the inner Image as its only structural child; the adapter appends
|
|
44
|
-
// the user children after it (so they paint on top).
|
|
45
|
-
return el('symbiote-view', { style: view.style }, [
|
|
46
|
-
renderImage({ ...view.image, style: imageMergedStyle }),
|
|
47
|
-
]);
|
|
48
|
-
}
|