@symbiote-native/svelte 1.0.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 +8 -10
- package/build/components/{activity-indicator/activity-indicator-props.d.ts → activity-indicator-props.d.ts} +1 -1
- package/build/components/flat-list/index.svelte +4 -4
- package/build/components/{image-background/image-background-props.d.ts → image-background-props.d.ts} +1 -1
- package/build/components/index.d.ts +6 -24
- package/build/components/index.js +0 -18
- package/build/components/keyboard-avoiding-view/index.svelte +6 -6
- package/build/components/modal/index.svelte +7 -7
- package/build/components/pressable/pressable-props.d.ts +1 -0
- package/build/components/refresh-control-props.d.ts +1 -0
- package/build/components/text-props.d.ts +1 -0
- package/build/components/virtualized-list/index.svelte +71 -250
- package/build/dom-shim/canonical-prop-names.d.ts +2 -0
- package/build/dom-shim/canonical-prop-names.js +320 -0
- package/build/dom-shim/document.js +1 -1
- package/build/dom-shim/element.d.ts +9 -3
- package/build/dom-shim/element.js +195 -29
- package/build/dom-shim/patch-globals.js +31 -5
- package/build/dom-shim/style-cache.d.ts +1 -0
- package/build/dom-shim/style-cache.js +27 -0
- package/build/dom-shim/text.js +2 -2
- package/build/host-instance.d.ts +2 -3
- package/build/host-instance.js +7 -1
- package/build/index.d.ts +7 -4
- package/build/index.js +17 -5
- package/build/intrinsic-elements.d.ts +63 -0
- package/build/modules/animated/index.d.ts +7 -27
- package/build/modules/animated/index.js +24 -34
- package/build/modules/image/index.d.ts +3 -0
- package/build/modules/image/index.js +15 -0
- package/build/preprocessor/scoped-styles.js +1 -1
- package/build/register.d.ts +1 -1
- package/build/register.js +13 -31
- package/build/root-element.js +1 -1
- package/metro-css-parser.cjs +2 -1
- package/metro-svelte-transformer.cjs +1 -17
- package/package.json +7 -15
- package/build/components/RefreshControl.svelte +0 -40
- package/build/components/RefreshControl.svelte.d.ts +0 -5
- package/build/components/SafeAreaView.svelte +0 -34
- package/build/components/SafeAreaView.svelte.d.ts +0 -5
- package/build/components/Text.svelte +0 -34
- package/build/components/Text.svelte.d.ts +0 -5
- package/build/components/View.svelte +0 -43
- package/build/components/View.svelte.d.ts +0 -5
- package/build/components/activity-indicator/activity-indicator-platform.android.d.ts +0 -3
- package/build/components/activity-indicator/activity-indicator-platform.android.js +0 -5
- package/build/components/activity-indicator/activity-indicator-platform.d.ts +0 -1
- package/build/components/activity-indicator/activity-indicator-platform.ios.d.ts +0 -3
- package/build/components/activity-indicator/activity-indicator-platform.ios.js +0 -6
- package/build/components/activity-indicator/activity-indicator-platform.js +0 -5
- package/build/components/activity-indicator/index.svelte +0 -63
- package/build/components/activity-indicator/index.svelte.d.ts +0 -5
- package/build/components/button.svelte +0 -76
- package/build/components/button.svelte.d.ts +0 -5
- package/build/components/image/image-logic.d.ts +0 -2
- package/build/components/image/image-logic.js +0 -135
- package/build/components/image/index.d.ts +0 -3
- package/build/components/image/index.js +0 -10
- package/build/components/image/index.svelte +0 -66
- package/build/components/image/index.svelte.d.ts +0 -5
- package/build/components/image-background/index.svelte +0 -87
- package/build/components/image-background/index.svelte.d.ts +0 -5
- package/build/components/input-accessory-view/index.svelte +0 -51
- package/build/components/input-accessory-view/index.svelte.d.ts +0 -5
- package/build/components/pressable/index.svelte +0 -185
- package/build/components/pressable/index.svelte.d.ts +0 -9
- package/build/components/scroll-view/index.svelte +0 -331
- package/build/components/scroll-view/index.svelte.d.ts +0 -18
- package/build/components/scroll-view/scroll-view-platform-types.d.ts +0 -3
- package/build/components/scroll-view/scroll-view-platform.android.d.ts +0 -3
- package/build/components/scroll-view/scroll-view-platform.android.js +0 -3
- package/build/components/scroll-view/scroll-view-platform.d.ts +0 -1
- package/build/components/scroll-view/scroll-view-platform.ios.d.ts +0 -3
- package/build/components/scroll-view/scroll-view-platform.ios.js +0 -3
- package/build/components/scroll-view/scroll-view-platform.js +0 -4
- package/build/components/scroll-view/scroll-view-sticky-context.d.ts +0 -7
- package/build/components/scroll-view/scroll-view-sticky-context.js +0 -1
- package/build/components/scroll-view/sticky-header-props.d.ts +0 -10
- package/build/components/scroll-view/sticky-header-props.js +0 -1
- package/build/components/scroll-view/sticky-header.svelte +0 -287
- package/build/components/scroll-view/sticky-header.svelte.d.ts +0 -5
- package/build/components/switch/index.svelte +0 -134
- package/build/components/switch/index.svelte.d.ts +0 -5
- package/build/components/text-input/index.svelte +0 -372
- package/build/components/text-input/index.svelte.d.ts +0 -17
- package/build/components/touchable-highlight/index.svelte +0 -139
- package/build/components/touchable-highlight/index.svelte.d.ts +0 -5
- package/build/components/touchable-native-feedback/index.d.ts +0 -9
- package/build/components/touchable-native-feedback/index.js +0 -14
- package/build/components/touchable-native-feedback/touchable-native-feedback.svelte +0 -49
- package/build/components/touchable-native-feedback/touchable-native-feedback.svelte.d.ts +0 -5
- package/build/components/touchable-opacity/index.svelte +0 -181
- package/build/components/touchable-opacity/index.svelte.d.ts +0 -5
- package/build/components/touchable-without-feedback/index.svelte +0 -75
- package/build/components/touchable-without-feedback/index.svelte.d.ts +0 -5
- package/build/modules/animated/animated-component-props.d.ts +0 -7
- package/build/modules/animated/animated-component-props.js +0 -1
- package/build/modules/animated/create-animated-component.d.ts +0 -5
- package/build/modules/animated/create-animated-component.js +0 -131
- package/build/preprocessor/lower-host-primitives.d.ts +0 -10
- package/build/preprocessor/lower-host-primitives.js +0 -455
- package/build/state-style.d.ts +0 -1
- package/build/state-style.js +0 -8
- /package/build/components/{activity-indicator/activity-indicator-props.js → activity-indicator-props.js} +0 -0
- /package/build/components/{image-background/image-background-props.js → image-background-props.js} +0 -0
- /package/build/{components/scroll-view/scroll-view-platform-types.js → intrinsic-elements.js} +0 -0
|
@@ -40,6 +40,7 @@ const PATCHED_KEYS = [
|
|
|
40
40
|
'DocumentFragment',
|
|
41
41
|
'document',
|
|
42
42
|
'customElements',
|
|
43
|
+
'HTMLMediaElement',
|
|
43
44
|
];
|
|
44
45
|
// Real DOM's `CustomElementRegistry`. `set_custom_element_data` (svelte's
|
|
45
46
|
// dom/elements/attributes.js) reads the BARE global `customElements` unconditionally, with no
|
|
@@ -48,11 +49,34 @@ const PATCHED_KEYS = [
|
|
|
48
49
|
// pipeline (mount-pipeline.smoke.test.ts); `tsc --build` has no way to catch a missing global
|
|
49
50
|
// a compiled Svelte bundle reads. RN/Hermes has no Custom Elements API of its own to collide
|
|
50
51
|
// with (unlike `navigator`/`requestAnimationFrame`, verified against .vendors/react-native —
|
|
51
|
-
// see the header comment above), so patching this is safe.
|
|
52
|
-
//
|
|
53
|
-
// `
|
|
54
|
-
//
|
|
55
|
-
|
|
52
|
+
// see the header comment above), so patching this is safe.
|
|
53
|
+
//
|
|
54
|
+
// `get()` returns a TRUTHY stand-in, and that is the whole reason `set_custom_element_data` can be
|
|
55
|
+
// made lossless. Its condition (attributes.js:245-265) is a ternary, not a fallback:
|
|
56
|
+
//
|
|
57
|
+
// setters_cache.has(nodeName) || !customElements || customElements.get(nodeName)
|
|
58
|
+
// ? get_setters(node).includes(prop) <- a real setter decides; the value passes through
|
|
59
|
+
// : value && typeof value === 'object' <- a HEURISTIC: an object is set as a property and
|
|
60
|
+
// every scalar is handed on as String(value)
|
|
61
|
+
//
|
|
62
|
+
// Returning `undefined` — which it did until 2026-09-07 — selects the heuristic, so
|
|
63
|
+
// `<text-input multiline={false}>` committed the STRING "false" and an object-valued prop with no
|
|
64
|
+
// prototype setter was assigned to a plain JS property and silently lost. Anything truthy steers
|
|
65
|
+
// it to `get_setters`, which reaches `ShimElement.prototype`'s accessors (see
|
|
66
|
+
// `svelte-shim-element-global-must-be-an-ancestor.md` for why that walk terminates where it does).
|
|
67
|
+
// One reader in the whole client runtime, so nothing else is affected.
|
|
68
|
+
const FAKE_CUSTOM_ELEMENT_REGISTRY = {
|
|
69
|
+
get: () => ShimElement,
|
|
70
|
+
};
|
|
71
|
+
// Same class of trap as `customElements` above, found the same way — by running the pipeline
|
|
72
|
+
// rather than by reading. Svelte's `event()` (dom/elements/events.js) ends its teardown check with
|
|
73
|
+
// a BARE `dom instanceof HTMLMediaElement`, no `typeof` guard, so an undeclared global throws
|
|
74
|
+
// ReferenceError instead of yielding `undefined`. It is reached by every `on<Name>={fn}` an app
|
|
75
|
+
// writes on a bare tag, which is why nothing hit it while the lowering transform funnelled every
|
|
76
|
+
// handler through the `p` bag. Nothing of ours ever derives from it, so an empty class is enough:
|
|
77
|
+
// `instanceof` only has to answer false.
|
|
78
|
+
class FakeHTMLMediaElement {
|
|
79
|
+
}
|
|
56
80
|
let previous;
|
|
57
81
|
export function patchGlobals() {
|
|
58
82
|
if (previous !== undefined)
|
|
@@ -68,6 +92,7 @@ export function patchGlobals() {
|
|
|
68
92
|
DocumentFragment: g.DocumentFragment,
|
|
69
93
|
document: g.document,
|
|
70
94
|
customElements: g.customElements,
|
|
95
|
+
HTMLMediaElement: g.HTMLMediaElement,
|
|
71
96
|
};
|
|
72
97
|
g.Node = ShimNode;
|
|
73
98
|
// ShimElementBase, NOT ShimElement: `get_setters` stops AT `Element.prototype`, so pointing this
|
|
@@ -83,6 +108,7 @@ export function patchGlobals() {
|
|
|
83
108
|
g.DocumentFragment = ShimDocumentFragment;
|
|
84
109
|
g.document = getShimDocument();
|
|
85
110
|
g.customElements = FAKE_CUSTOM_ELEMENT_REGISTRY;
|
|
111
|
+
g.HTMLMediaElement = FakeHTMLMediaElement;
|
|
86
112
|
dlog('svelte dom-shim: patchGlobals installed');
|
|
87
113
|
}
|
|
88
114
|
export function restoreGlobals() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function discoverStyleCacheKey(): symbol;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Where a `style={…}` attribute really goes, and why the shim cannot read it off `cssText`.
|
|
2
|
+
//
|
|
3
|
+
// Every tag name takes the same path: the compiler emits `$.set_style(node, value)` for `style`,
|
|
4
|
+
// on a short tag and a hyphenated one alike. `set_style` then STRINGIFIES —
|
|
5
|
+
// `to_style(value, undefined)` is `String(value)` — so a React Native style object arrives at
|
|
6
|
+
// `dom.style.cssText` as the literal `"[object Object]"`. Nothing downstream can recover it.
|
|
7
|
+
//
|
|
8
|
+
// One line later `set_style` writes the ORIGINAL value onto the element under a module-private
|
|
9
|
+
// `Symbol('style')` (svelte's `internal/client/constants.js`), which it also reads back as the
|
|
10
|
+
// change guard. That symbol is the only surviving copy, so intercepting it is the only way a
|
|
11
|
+
// bare `<view style={obj}>` reaches `routeProp`.
|
|
12
|
+
//
|
|
13
|
+
// The symbol is not exported, so it is DISCOVERED by running svelte's own `set_style` against a
|
|
14
|
+
// probe and reading the one own symbol it leaves behind — once per process, never per node. A
|
|
15
|
+
// version that changes the shape fails loudly here rather than silently dropping every style.
|
|
16
|
+
import { set_style } from 'svelte/internal/client';
|
|
17
|
+
export function discoverStyleCacheKey() {
|
|
18
|
+
const probe = { style: { cssText: '' } };
|
|
19
|
+
// A non-null string: `to_style` returns it unchanged, so the probe stays on the assignment
|
|
20
|
+
// branch and never reaches `removeAttribute`, which it does not implement.
|
|
21
|
+
set_style(probe, 'probe');
|
|
22
|
+
const symbols = Object.getOwnPropertySymbols(probe);
|
|
23
|
+
if (symbols.length !== 1)
|
|
24
|
+
throw new Error(`svelte's set_style left ${symbols.length} own symbols on a probe; ` +
|
|
25
|
+
'the style-cache key cannot be identified and `style` would be dropped');
|
|
26
|
+
return symbols[0];
|
|
27
|
+
}
|
package/build/dom-shim/text.js
CHANGED
|
@@ -36,8 +36,8 @@ const WHITESPACE_ONLY = /^[\s\u200b-\u200d\ufeff]+$/;
|
|
|
36
36
|
// The PARENT is what makes this exact rather than a heuristic. Measured on svelte 5.56.8, a
|
|
37
37
|
// stray gap and an {#each} text placeholder are the same ' ' string in the from_tree template:
|
|
38
38
|
//
|
|
39
|
-
// stray gap ['
|
|
40
|
-
// placeholder ['
|
|
39
|
+
// stray gap ['view', null, [...], ' ', [...]] parent takes no raw text -> drop
|
|
40
|
+
// placeholder ['text', null, ' '] parent IS a <Text> -> keep
|
|
41
41
|
//
|
|
42
42
|
// So `<Text><Text>a</Text> <Text>b</Text></Text>` keeps its separator, correctly — there the
|
|
43
43
|
// space really is a word boundary. This also covers the one shape the source preprocessor
|
package/build/host-instance.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type IHostInstance } from '@symbiote-native/engine';
|
|
2
|
-
import type { ShimElement } from './dom-shim';
|
|
3
2
|
export type { IHostInstance } from '@symbiote-native/engine';
|
|
4
|
-
export declare function hostInstance(shim:
|
|
5
|
-
export declare function findNodeHandle(componentOrHandle:
|
|
3
|
+
export declare function hostInstance(shim: unknown): IHostInstance | undefined;
|
|
4
|
+
export declare function findNodeHandle(componentOrHandle: unknown): number | null;
|
package/build/host-instance.js
CHANGED
|
@@ -26,8 +26,14 @@ function isShimElement(value) {
|
|
|
26
26
|
// the toPublicInstance call below is the identity; this helper exists only to give app code a correctly
|
|
27
27
|
// TYPED accessor off the SHIM value (`ShimElement`) instead of the bare `.engineNode` field,
|
|
28
28
|
// with no `as` cast at the call site.
|
|
29
|
+
// `unknown` rather than `ShimElement`, and the guard is what makes that sound. svelte2tsx bakes a
|
|
30
|
+
// `bind:this` return type out of `lib.dom`'s tag maps — an SVG element type for `view`/`text`/
|
|
31
|
+
// `image`/`switch`, `any` for the other seventeen — and neither map accepts augmentation
|
|
32
|
+
// (`src/intrinsic-elements.ts` records the measurement). So an app CANNOT declare its ref as
|
|
33
|
+
// `ShimElement` without a cast, and this is the accessor that exists to keep casts out of app
|
|
34
|
+
// code. Declaring the parameter `unknown` moves the narrowing where it can actually be checked.
|
|
29
35
|
export function hostInstance(shim) {
|
|
30
|
-
if (shim
|
|
36
|
+
if (!isShimElement(shim))
|
|
31
37
|
return undefined;
|
|
32
38
|
const node = shim.engineNode;
|
|
33
39
|
return node !== undefined && isSymbioteNode(node)
|
package/build/index.d.ts
CHANGED
|
@@ -2,13 +2,16 @@ import './register';
|
|
|
2
2
|
export { mount, unmount } from './render';
|
|
3
3
|
export { AppRegistry, setHostRegistrar } from './modules/app-registry';
|
|
4
4
|
export type { IComponentProvider, IWrapperComponentProvider, IAppParameters, IRunnable, IHostRegistrar, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from './modules/app-registry';
|
|
5
|
-
export {
|
|
6
|
-
export type { IViewProps, ITextProps, IActivityIndicatorProps, IImageProps,
|
|
5
|
+
export { KeyboardAvoidingView, Modal, VirtualizedList, FlatList, VirtualizedSectionList, SectionList, } from './components';
|
|
6
|
+
export type { IViewProps, ITextProps, IActivityIndicatorProps, IImageProps, IImageBackgroundProps, IInputAccessoryViewProps, IKeyboardAvoidingViewProps, IKeyboardAvoidingBehavior, ISwitchProps, ISwitchChangeEvent, ITextInputProps, ITextInputHandle, ITextInputChangeEvent, IModalProps, ISafeAreaViewProps, IRefreshControlProps, IPressableProps, ITouchableOpacityProps, ITouchableHighlightProps, ITouchableWithoutFeedbackProps, ITouchableNativeFeedbackProps, IButtonProps, IScrollViewProps, IScrollViewHandle, IVirtualizedListProps, IVirtualizedListHandle, IFlatListProps, IFlatListHandle, IVirtualizedSectionListProps, ISectionListProps, ISection, } from './components';
|
|
7
7
|
export type { IAccessibilityProps, IAriaProps, IAccessibilityRole, IRole, IAccessibilityStateValue, IAccessibilityValue, IAccessibilityActionInfo, IResponderProps, } from '@symbiote-native/components';
|
|
8
8
|
export { setImageSourceResolver } from '@symbiote-native/components';
|
|
9
9
|
export type { IImageSource, IImageSourceProp, IResizeMode, IImageSize, IImageCacheStatus, IModalAnimationType, IModalPresentationStyle, IModalOrientation, IViewToken, IViewableItemsChangedInfo, IViewabilityConfig, IViewabilityConfigCallbackPair, IPressState, ISwitchTrackColor, INativeFeedbackBackground, IThemeAttrBackground, IRippleBackground, IVirtualizedSectionListHandle, IVirtualizedSectionListHandle as ISectionListHandle, ICellLayout, ISeparatorProps, ISeparators, IModalOrientationChangeEvent, IPressableAndroidRippleConfig, IEnterKeyHint, IInputMode, ISubmitBehavior, ITextInputSelection, } from '@symbiote-native/components';
|
|
10
10
|
export { Platform, StyleSheet, PlatformColor, DynamicColorIOS, processColor, setNativeViewConfigSource, setColorProcessor, setDeviceEventSource, PixelRatio, PanResponder, dlog, isDebug, } from '@symbiote-native/engine';
|
|
11
11
|
export type { INativeViewConfig, INativeViewConfigSource, IPixelRatioStatic, ISymbioteEvent, ISymbioteNode, IRootTag, IPanResponderGestureState, IPanResponderCallbacks, IGestureResponderHandlers, IPanResponderInstance, IViewStyle, ITextStyle, IFlexAlign, IFlexJustify, IPlatformStatic, IPlatformOSType, IPlatformConstantsIOS, IPlatformConstantsAndroid, IPlatformSelectSpec, IColorValue, IOpaqueColorValue, IDynamicColorIOSTuple, } from '@symbiote-native/engine';
|
|
12
|
+
export { Image } from './modules/image';
|
|
13
|
+
export type { IImageStatics } from './modules/image';
|
|
14
|
+
export { TouchableNativeFeedback } from '@symbiote-native/components';
|
|
12
15
|
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, LayoutAnimation, InteractionManager, } from '@symbiote-native/engine';
|
|
13
16
|
export type { IAlertType, IAlertButtonStyle, IAlertButton, IAlertButtons, IAlertOptions, IShareContent, IShareOptions, IShareAction, IActionSheetIOSOptions, IShareActionSheetIOSOptions, IShareActionSheetError, IUrlEvent, II18nManagerConstants, IDisplayMetrics, IDisplayMetricsAndroid, IDimensionsPayload, IDimensionsSet, IDimensionsKey, IDimensionsChangeListener, IDimensionsStatic, IColorSchemeName, IColorSchemePreference, IAppStateStatus, IAppStateEvent, IKeyboardEventName, IKeyboardEvent, IKeyboardMetrics, IBackPressEventName, IBackPressHandler, IPermission, IPermissionStatus, IRationale, ILayoutAnimationType, ILayoutAnimationProperty, ILayoutAnimationConfig, ILayoutAnimationAnim, IInteractionEvent, ISimpleTask, IPromiseTask, ITask, IHandle, } from '@symbiote-native/engine';
|
|
14
17
|
export { StatusBar } from './modules/status-bar';
|
|
@@ -18,6 +21,7 @@ export type { IAccessibilityChangeEvent, IAccessibilityChangeEventName, IAccessi
|
|
|
18
21
|
export { findNodeHandle, hostInstance } from './host-instance';
|
|
19
22
|
export type { IHostInstance } from './host-instance';
|
|
20
23
|
export type { ShimElement } from './dom-shim';
|
|
24
|
+
export type { ISymbioteIntrinsicTag, ISymbioteHostAttributes, } from './intrinsic-elements';
|
|
21
25
|
export { createTunnel, TunnelIn, TunnelOut, type ITunnel, } from './create-tunnel';
|
|
22
26
|
export { Portal, type IPortalProps, type IPortalTarget } from './create-portal';
|
|
23
27
|
export { useWindowDimensions } from './runes/use-window-dimensions.svelte';
|
|
@@ -27,5 +31,4 @@ export { orientation, createWidthQuery } from './runes/media-query';
|
|
|
27
31
|
export type { IOrientation, IWidthQueryBounds } from './runes/media-query';
|
|
28
32
|
export type { IReactiveValue } from './runes/dimensions-value';
|
|
29
33
|
export { normalizeSvelteClass, resolveSvelteClass, type ISvelteClassValue, type IClassMap, type IClassEntry, } from './class-value';
|
|
30
|
-
export { Animated
|
|
31
|
-
export type { IAnimatedComponentProps } from './modules/animated';
|
|
34
|
+
export { Animated } from './modules/animated';
|
package/build/index.js
CHANGED
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
import './register.js';
|
|
16
16
|
export { mount, unmount } from './render.js';
|
|
17
17
|
export { AppRegistry, setHostRegistrar } from './modules/app-registry/index.js';
|
|
18
|
-
|
|
18
|
+
// Nine names are deliberately absent and there is nothing to import in their place: `view`, `text`,
|
|
19
|
+
// `safe-area-view`, `pressable`, `text-input`, `switch`, `image`, `input-accessory-view` and
|
|
20
|
+
// `activity-indicator` are INTRINSIC TAGS an app writes directly. What survives of `Image` and
|
|
21
|
+
// `TouchableNativeFeedback` is a STATICS namespace each, exported with the other imperative
|
|
22
|
+
// namespaces below. See ./components/index.ts for where each deleted wrapper's body went.
|
|
23
|
+
export { KeyboardAvoidingView, Modal, VirtualizedList, FlatList, VirtualizedSectionList, SectionList, } from './components/index.js';
|
|
19
24
|
// Component-scoped agnostic types that live in @symbiote-native/components but weren't yet
|
|
20
25
|
// threaded through this barrel (parity fix, see React's index.ts lines 55-58, 89, 245-250).
|
|
21
26
|
export { setImageSourceResolver } from '@symbiote-native/components';
|
|
@@ -24,6 +29,13 @@ export { setImageSourceResolver } from '@symbiote-native/components';
|
|
|
24
29
|
// React/Vue's own barrels) until 2026-08-12 — a pure engine re-export, no framework glue, so
|
|
25
30
|
// adding it is a one-line parity fix, not new adapter work.
|
|
26
31
|
export { Platform, StyleSheet, PlatformColor, DynamicColorIOS, processColor, setNativeViewConfigSource, setColorProcessor, setDeviceEventSource, PixelRatio, PanResponder, dlog, isDebug, } from '@symbiote-native/engine';
|
|
32
|
+
// The two namespaces left behind by primitives that became tags, here rather than in the component
|
|
33
|
+
// block above for one reason: they carry no view. `Image` gets an adapter file only because it
|
|
34
|
+
// renames the shared `imageStatics`; TNF's four are pure dict producers and come straight from the
|
|
35
|
+
// shared package. RN points NEW code at `<pressable p={{ android_ripple: {…} }}>`, but they are not
|
|
36
|
+
// redundant — the `touchable-native-feedback` tag folds `background`, and nothing else builds it.
|
|
37
|
+
export { Image } from './modules/image/index.js';
|
|
38
|
+
export { TouchableNativeFeedback } from '@symbiote-native/components';
|
|
27
39
|
// Imperative runtime modules: the SAME module every adapter shares, re-exported straight from
|
|
28
40
|
// @symbiote-native/engine so app code names only @symbiote-native/svelte (RN's single import
|
|
29
41
|
// root). Nothing here has a visual or a lifecycle, so there is no Svelte half to write.
|
|
@@ -80,7 +92,7 @@ export { orientation, createWidthQuery } from './runes/media-query.js';
|
|
|
80
92
|
// IClassNameValue — plus the normalizer, for a consumer building a class value in its own
|
|
81
93
|
// helper. See class-value.ts's header for the object-is-a-style vs object-is-a-clsx-map rule.
|
|
82
94
|
export { normalizeSvelteClass, resolveSvelteClass, } from './class-value.js';
|
|
83
|
-
// Animated: the
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
export { Animated
|
|
95
|
+
// Animated: the drivers, plus FlatList/SectionList as ALIASES of the plain components. There is no
|
|
96
|
+
// `createAnimatedComponent` — the engine resolves an AnimatedNode in any prop of any host node, so
|
|
97
|
+
// nothing needs wrapping (modules/animated/index.ts).
|
|
98
|
+
export { Animated } from './modules/animated/index.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ISymbioteIntrinsic, ICrossTypedIntrinsics } from '@symbiote-native/components';
|
|
2
|
+
import type { IShimPropBag } from './dom-shim/element';
|
|
3
|
+
import type { IViewProps } from './components/view-props';
|
|
4
|
+
import type { ITextProps } from './components/text-props';
|
|
5
|
+
import type { IImageProps } from './components/image/image-props';
|
|
6
|
+
import type { IImageBackgroundProps } from './components/image-background-props';
|
|
7
|
+
import type { IPressableProps } from './components/pressable/pressable-props';
|
|
8
|
+
import type { IButtonProps } from './components/button-props';
|
|
9
|
+
import type { IActivityIndicatorProps } from './components/activity-indicator-props';
|
|
10
|
+
import type { ISafeAreaViewProps } from './components/safe-area-view-props';
|
|
11
|
+
import type { IRefreshControlProps } from './components/refresh-control-props';
|
|
12
|
+
import type { ITouchableOpacityProps } from './components/touchable-opacity/touchable-opacity-props';
|
|
13
|
+
import type { ITouchableWithoutFeedbackProps } from './components/touchable-without-feedback/touchable-without-feedback-props';
|
|
14
|
+
import type { ITouchableHighlightProps } from './components/touchable-highlight/touchable-highlight-props';
|
|
15
|
+
import type { ITouchableNativeFeedbackProps } from './components/touchable-native-feedback/touchable-native-feedback-props';
|
|
16
|
+
import type { IScrollViewProps } from './components/scroll-view/scroll-view-props';
|
|
17
|
+
import type { ISwitchProps } from './components/switch/switch-props';
|
|
18
|
+
import type { ITextInputProps } from './components/text-input/text-input-props';
|
|
19
|
+
import type { IModalProps } from './components/modal/modal-props';
|
|
20
|
+
import type { IInputAccessoryViewProps } from './components/input-accessory-view/input-accessory-view-props';
|
|
21
|
+
export interface ISymbioteHostAttributes {
|
|
22
|
+
p?: IShimPropBag;
|
|
23
|
+
[attribute: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface ICrossedPrimitiveProps {
|
|
26
|
+
view: IViewProps;
|
|
27
|
+
text: ITextProps;
|
|
28
|
+
pressable: IPressableProps;
|
|
29
|
+
button: IButtonProps;
|
|
30
|
+
image: IImageProps;
|
|
31
|
+
'image-background': IImageBackgroundProps;
|
|
32
|
+
'input-accessory-view': IInputAccessoryViewProps;
|
|
33
|
+
'refresh-control': IRefreshControlProps;
|
|
34
|
+
'safe-area-view': ISafeAreaViewProps;
|
|
35
|
+
'touchable-native-feedback': ITouchableNativeFeedbackProps;
|
|
36
|
+
'touchable-opacity': ITouchableOpacityProps;
|
|
37
|
+
'touchable-highlight': ITouchableHighlightProps;
|
|
38
|
+
'touchable-without-feedback': ITouchableWithoutFeedbackProps;
|
|
39
|
+
'scroll-view': IScrollViewProps;
|
|
40
|
+
switch: ISwitchProps;
|
|
41
|
+
'text-input': ITextInputProps;
|
|
42
|
+
modal: IModalProps;
|
|
43
|
+
'activity-indicator': IActivityIndicatorProps;
|
|
44
|
+
}
|
|
45
|
+
type IWithSvelteAttributeRealities<Props> = Partial<Props> & {
|
|
46
|
+
p?: IShimPropBag;
|
|
47
|
+
} & {
|
|
48
|
+
[K in keyof Props as K extends string ? Lowercase<K> : never]?: Props[K];
|
|
49
|
+
};
|
|
50
|
+
declare global {
|
|
51
|
+
namespace svelteHTML {
|
|
52
|
+
interface IntrinsicElements extends ICrossTypedIntrinsics<ISymbioteHostAttributes, {
|
|
53
|
+
[K in keyof ICrossedPrimitiveProps]: IWithSvelteAttributeRealities<ICrossedPrimitiveProps[K]>;
|
|
54
|
+
}> {
|
|
55
|
+
}
|
|
56
|
+
interface SVGAttributes extends ISymbioteHostAttributes {
|
|
57
|
+
}
|
|
58
|
+
interface HTMLAttributes extends ISymbioteHostAttributes {
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export type ISymbioteIntrinsicTag = ISymbioteIntrinsic;
|
|
63
|
+
export {};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AnimatedValue, AnimatedValueXY, AnimatedColor, timing, spring, decay, parallel, sequence, stagger, loop, delay, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent } from '@symbiote-native/engine';
|
|
2
|
-
|
|
3
|
-
export type { IAnimatedComponentProps } from './animated-component-props';
|
|
4
|
-
export declare const Animated: {
|
|
2
|
+
declare const drivers: {
|
|
5
3
|
Value: typeof AnimatedValue;
|
|
6
4
|
ValueXY: typeof AnimatedValueXY;
|
|
7
5
|
Color: typeof AnimatedColor;
|
|
@@ -41,28 +39,10 @@ export declare const Animated: {
|
|
|
41
39
|
event: typeof event;
|
|
42
40
|
forkEvent: typeof forkEvent;
|
|
43
41
|
unforkEvent: typeof unforkEvent;
|
|
44
|
-
View: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {
|
|
45
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
46
|
-
$set?(props: Partial<Record<string, any>>): void;
|
|
47
|
-
} & Record<string, any>, string>;
|
|
48
|
-
Text: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {
|
|
49
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
50
|
-
$set?(props: Partial<Record<string, any>>): void;
|
|
51
|
-
} & Record<string, any>, string>;
|
|
52
|
-
Image: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {
|
|
53
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
54
|
-
$set?(props: Partial<Record<string, any>>): void;
|
|
55
|
-
} & Record<string, any>, string>;
|
|
56
|
-
ScrollView: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {
|
|
57
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
58
|
-
$set?(props: Partial<Record<string, any>>): void;
|
|
59
|
-
} & Record<string, any>, string>;
|
|
60
|
-
FlatList: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {
|
|
61
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
62
|
-
$set?(props: Partial<Record<string, any>>): void;
|
|
63
|
-
} & Record<string, any>, string>;
|
|
64
|
-
SectionList: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {
|
|
65
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
66
|
-
$set?(props: Partial<Record<string, any>>): void;
|
|
67
|
-
} & Record<string, any>, string>;
|
|
68
42
|
};
|
|
43
|
+
interface IAnimatedNamespace {
|
|
44
|
+
FlatList: typeof import('../../components/flat-list/index.svelte').default;
|
|
45
|
+
SectionList: typeof import('../../components/section-list/index.svelte').default;
|
|
46
|
+
}
|
|
47
|
+
export declare const Animated: IAnimatedNamespace & typeof drivers;
|
|
48
|
+
export {};
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
// The Animated namespace for @symbiote-native/svelte
|
|
2
|
-
//
|
|
3
|
-
// closer to Vue's reactivity model than to React's hooks). The value graph, easing,
|
|
4
|
-
// interpolation and drivers come from @symbiote-native/engine (framework-agnostic, JS-driven),
|
|
5
|
-
// spread in verbatim.
|
|
1
|
+
// The Animated namespace for @symbiote-native/svelte. The value graph, easing, interpolation and
|
|
2
|
+
// drivers come from @symbiote-native/engine (framework-agnostic, JS-driven), spread in verbatim.
|
|
6
3
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// (View/Text/Image), and for why it is plain TS rather than a parametrized `.svelte` file.
|
|
4
|
+
// There is no `Animated.View` / `Animated.Text` / `Animated.Image` any more, and nothing replaced
|
|
5
|
+
// them: `<view style={{ opacity: someAnimatedValue }}>` is the whole API. The engine resolves an
|
|
6
|
+
// AnimatedNode written into any prop of any host node (`core/engine/src/animated/host-binding.ts`):
|
|
7
|
+
// it publishes the current value, subscribes the leaf, writes each frame through its own targeted
|
|
8
|
+
// setNativeProps commit, and releases at the commit sweep. `createAnimatedComponent` brokered
|
|
9
|
+
// between the value graph and the node's Fabric tag, and both of those were already engine-side.
|
|
14
10
|
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
11
|
+
// Those three were aliases of the wrappers, and the wrappers are gone — a primitive is a tag now,
|
|
12
|
+
// which is not a value `<Animated.X>` can call. `Animated.ScrollView` left the same way on
|
|
13
|
+
// 2026-09-10: `bindAnimatedEvent` (node.ts, from `setEventListener`) attaches a native-driven event
|
|
14
|
+
// on ANY host node, which was the one job a scroll wrapper still looked like it had. The whole API
|
|
15
|
+
// is `<scroll-view style={{ opacity: v }} p={{ onScroll: Animated.event(…) }}>`.
|
|
16
|
+
//
|
|
17
|
+
// The two below REMAIN because the LIST family is tier 3: a render prop decides their output shape
|
|
18
|
+
// in JS, so there is no tag for `<Animated.X>` to be an alias of.
|
|
19
|
+
//
|
|
20
|
+
// A consumer animating their OWN component wraps nothing either: any component that forwards
|
|
21
|
+
// `style` down to a Symbiote primitive accepts an AnimatedNode by construction.
|
|
18
22
|
import { AnimatedValue, AnimatedValueXY, AnimatedColor, AnimatedMock, Easing, Platform, timing, spring, decay, parallel, sequence, stagger, loop, delay, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent, } from '@symbiote-native/engine';
|
|
19
|
-
import View from '../../components/View.svelte';
|
|
20
|
-
import Text from '../../components/Text.svelte';
|
|
21
|
-
import Image from '../../components/image/index.svelte';
|
|
22
|
-
import ScrollView from '../../components/scroll-view/index.svelte';
|
|
23
23
|
import FlatList from '../../components/flat-list/index.svelte';
|
|
24
24
|
import SectionList from '../../components/section-list/index.svelte';
|
|
25
|
-
import { createAnimatedComponent } from './create-animated-component.js';
|
|
26
|
-
export { createAnimatedComponent } from './create-animated-component.js';
|
|
27
25
|
// The live, JS-driven driver namespace (real frames). RN's AnimatedImplementation.
|
|
28
26
|
const liveDrivers = {
|
|
29
27
|
Value: AnimatedValue,
|
|
@@ -50,20 +48,12 @@ const liveDrivers = {
|
|
|
50
48
|
};
|
|
51
49
|
// RN swaps the WHOLE driver namespace for the mock when the host reports isDisableAnimations
|
|
52
50
|
// (reduced motion / test env): the mock keeps the same surface but jumps each animation to its
|
|
53
|
-
// final value synchronously, no frames.
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
// RN spreading `...Animated` (impl or mock) over the same component references.
|
|
51
|
+
// final value synchronously, no frames. Only this half is swapped — the component names below are
|
|
52
|
+
// the same references either way, exactly like RN spreading `...Animated` (impl or mock) over one
|
|
53
|
+
// set of components.
|
|
57
54
|
const drivers = Platform.isDisableAnimations ? AnimatedMock : liveDrivers;
|
|
58
|
-
// Wrapped eagerly, unlike Vue's lazy getters: nothing in the scroll/list chain imports THIS
|
|
59
|
-
// module back (sticky-header builds its own Animated.View straight from the wrap), so there is
|
|
60
|
-
// no half-evaluated cycle to dodge.
|
|
61
55
|
export const Animated = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Image: createAnimatedComponent(Image),
|
|
65
|
-
ScrollView: createAnimatedComponent(ScrollView),
|
|
66
|
-
FlatList: createAnimatedComponent(FlatList),
|
|
67
|
-
SectionList: createAnimatedComponent(SectionList),
|
|
56
|
+
FlatList,
|
|
57
|
+
SectionList,
|
|
68
58
|
...drivers,
|
|
69
59
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// RN's Image STATICS — `getSize`, `prefetch`, `queryCache`, `abortPrefetch`, `resolveAssetSource`.
|
|
2
|
+
//
|
|
3
|
+
// IN `modules/`, NOT `components/`. The primitive is the `<image>` tag and its fold runs in the
|
|
4
|
+
// engine (`behaviors/image.ts`); what is left under the name `Image` is an imperative API with no
|
|
5
|
+
// view, which is what this bucket is for — `<adapter_src_follows_framework_idioms>` names it.
|
|
6
|
+
// Sitting in `components/` was what made a statics object read as a component.
|
|
7
|
+
//
|
|
8
|
+
// A NAMESPACE OBJECT rather than five bare functions, deliberately. `Alert`, `Share`, `Linking`,
|
|
9
|
+
// `Vibration` and `AppState` are all `export const X = {…}`, an app porting from RN writes
|
|
10
|
+
// `Image.getSize(...)` verbatim (P0, `<adapters_reach_full_feature_parity>`), and the bundle-size
|
|
11
|
+
// argument for splitting them is void: Metro does no tree shaking (facebook/metro#227).
|
|
12
|
+
//
|
|
13
|
+
// Shared verbatim via `imageStatics`, the same source React's and Vue's Image use.
|
|
14
|
+
import { imageStatics } from '@symbiote-native/components';
|
|
15
|
+
export const Image = imageStatics;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// (`generate:'client', fragments:'tree', css:'external'`), a `<style>` block behaves one of two
|
|
6
6
|
// ways:
|
|
7
7
|
//
|
|
8
|
-
// <
|
|
8
|
+
// <view class="card"> -> result.css: `.card.svelte-4psua6 { … }`
|
|
9
9
|
// result.js: `$.set_class(node, 1, 'card svelte-4psua6')`
|
|
10
10
|
// <View class="card"> -> warning: css_unused_selector
|
|
11
11
|
// result.css: `/* (unused) .card { … }*/`
|
package/build/register.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@symbiote-native/components/register';
|
package/build/register.js
CHANGED
|
@@ -1,33 +1,15 @@
|
|
|
1
|
-
// Side-effect ONLY
|
|
1
|
+
// Side-effect ONLY. Exports nothing, and must never be re-exported from the barrel.
|
|
2
2
|
//
|
|
3
|
-
// The
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// no behavior at all.
|
|
3
|
+
// The fourteen calls live once, in `@symbiote-native/components/register` — they were identical in
|
|
4
|
+
// all five adapters, and each copy carried a migration ledger justifying a call against a wrapper
|
|
5
|
+
// that no longer exists. What is per-adapter is only the SPELLING of the import below: every
|
|
6
|
+
// `*-tag.test.*` here reaches the registry through `import './register';`, and this adapter's own
|
|
7
|
+
// barrel guard pins that line.
|
|
9
8
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// `
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
import { registerImageBehavior, registerInputAccessoryViewBehavior, registerPressableBehavior, registerSwitchBehavior, registerTextInputBehavior, } from '@symbiote-native/components';
|
|
18
|
-
registerPressableBehavior();
|
|
19
|
-
// Only the LOWERED tags carry this — the wrapper renders `symbiote-text-input-managed` and
|
|
20
|
-
// keeps running its own lifecycle. One owner per node; see `component-names/shared.ts`.
|
|
21
|
-
registerTextInputBehavior();
|
|
22
|
-
// Same reason as TextInput: the wrapper renders `symbiote-switch-managed` and runs its own
|
|
23
|
-
// lastNativeReport/snap-back lifecycle, so the engine's copy attaches only to the bare tag.
|
|
24
|
-
registerSwitchBehavior();
|
|
25
|
-
// Image owns no runtime — its behavior is a prop FOLD and nothing else, and it is registered on the
|
|
26
|
-
// same `symbiote-image` the wrapper already emits rather than on a `-managed` twin. That is safe
|
|
27
|
-
// only because the mapping is idempotent, which `core/components/src/behaviors/image.test.ts`
|
|
28
|
-
// asserts rather than assumes; a wrapper-built node simply folds a second time and nothing moves.
|
|
29
|
-
registerImageBehavior();
|
|
30
|
-
// Fold-only, and it shares the wrapper's tag for the same reason Image does: the mapping has no
|
|
31
|
-
// aliasing at all, so a wrapper-built node folding a second time moves nothing.
|
|
32
|
-
// `core/components/src/behaviors/input-accessory-view.test.ts` asserts that rather than assuming it.
|
|
33
|
-
registerInputAccessoryViewBehavior();
|
|
9
|
+
// WHY A SIDE-EFFECT SUBPATH AND NOT A BARREL EXPORT. Metro turns on `inlineRequires` for PRODUCTION
|
|
10
|
+
// only: it moves a `require` down to the first place its binding is used as a VALUE, and
|
|
11
|
+
// `export { X } from './x'` compiles to a lazy getter. A registration reached that way never
|
|
12
|
+
// evaluates in a Release build — invisible to tsc, to vitest, and to grepping the bundle. A bare
|
|
13
|
+
// `import` placed NEXT TO a re-export of the same specifier does not help either: Babel merges the
|
|
14
|
+
// two into one dependency and the merged dependency stays lazy.
|
|
15
|
+
import '@symbiote-native/components/register';
|
package/build/root-element.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// normally an ancestor's `insertOne` does that. For the root there is no ancestor shim node;
|
|
10
10
|
// the surface plays that role, so this file makes the one `surface.appendChild` call directly.
|
|
11
11
|
import { ShimElement } from './dom-shim/index.js';
|
|
12
|
-
const ROOT_INTRINSIC = '
|
|
12
|
+
const ROOT_INTRINSIC = 'view';
|
|
13
13
|
// Unlike Vue/React, whose app root mounts directly onto the surface (its own flex:1
|
|
14
14
|
// class/style reaches the engine's synthetic flex:1 AppContainer with nothing in between),
|
|
15
15
|
// Svelte's compiled output needs a real DOM-like `target` to call appendChild on — this
|
package/metro-css-parser.cjs
CHANGED
|
@@ -6,4 +6,5 @@
|
|
|
6
6
|
// already handles standalone style files itself (its isStyleFile branch), so this subpath exists
|
|
7
7
|
// only for parity with the other adapters and for a future consumer that wants CSS-only handling
|
|
8
8
|
// without the .svelte transform (e.g. importing a plain .css from non-.svelte source).
|
|
9
|
-
module.exports =
|
|
9
|
+
module.exports =
|
|
10
|
+
require('@symbiote-native/css-parser').createCssMetroTransformer();
|
|
@@ -86,17 +86,6 @@ function collapseTextWhitespacePreprocessor() {
|
|
|
86
86
|
return collapseTextWhitespacePromise;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
// Lowers <View>/<Text> to their intrinsic tags so a primitive stops costing a Svelte component
|
|
90
|
-
// boundary — which in Svelte is paid in ANCHOR NODES, 12 per benchmark row (see the file header).
|
|
91
|
-
// Loaded lazily for the same reason as the three above.
|
|
92
|
-
let lowerHostPrimitivesPromise;
|
|
93
|
-
function lowerHostPrimitivesPreprocessor() {
|
|
94
|
-
lowerHostPrimitivesPromise ??=
|
|
95
|
-
import('@symbiote-native/svelte/lower-host-primitives').then(mod =>
|
|
96
|
-
mod.lowerHostPrimitives(),
|
|
97
|
-
);
|
|
98
|
-
return lowerHostPrimitivesPromise;
|
|
99
|
-
}
|
|
100
89
|
//
|
|
101
90
|
// Svelte 5's compiler strips <script lang="ts"> types structurally, with no external type
|
|
102
91
|
// resolution needed (unlike @vue/compiler-sfc's compileScript, which needs registerTS + a real
|
|
@@ -160,12 +149,7 @@ module.exports.transform = async function transform(params) {
|
|
|
160
149
|
const preprocessed = await (
|
|
161
150
|
await collapseTextWhitespacePreprocessor()
|
|
162
151
|
).markup({ content: stylePreprocessed.code, filename: params.filename });
|
|
163
|
-
|
|
164
|
-
// load-bearing rather than stylistic.
|
|
165
|
-
const lowered = await (
|
|
166
|
-
await lowerHostPrimitivesPreprocessor()
|
|
167
|
-
).markup({ content: preprocessed.code, filename: params.filename });
|
|
168
|
-
const code = compileSvelteFile(lowered.code, params.filename);
|
|
152
|
+
const code = compileSvelteFile(preprocessed.code, params.filename);
|
|
169
153
|
// Re-label as .tsx so RN's transformer processes the module exactly like app source; Metro
|
|
170
154
|
// tracks the real path separately. Matches metro-vue-transformer.cjs's identical trick.
|
|
171
155
|
return upstreamTransformer.transform({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/svelte",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "SymbioteNative's Svelte adapter — a DOM shim over stock compiled Svelte output driving real native iOS/Android views through the same engine as every other adapter.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -52,10 +52,6 @@
|
|
|
52
52
|
"types": "./build/preprocessor/collapse-text-whitespace.d.ts",
|
|
53
53
|
"default": "./build/preprocessor/collapse-text-whitespace.js"
|
|
54
54
|
},
|
|
55
|
-
"./lower-host-primitives": {
|
|
56
|
-
"types": "./build/preprocessor/lower-host-primitives.d.ts",
|
|
57
|
-
"default": "./build/preprocessor/lower-host-primitives.js"
|
|
58
|
-
},
|
|
59
55
|
"./style-scope": {
|
|
60
56
|
"types": "./build/style-scope.d.ts",
|
|
61
57
|
"default": "./build/style-scope.js"
|
|
@@ -65,11 +61,7 @@
|
|
|
65
61
|
"default": "./build/scope-token.js"
|
|
66
62
|
},
|
|
67
63
|
"./metro-svelte-transformer": "./metro-svelte-transformer.cjs",
|
|
68
|
-
"./metro-css-parser": "./metro-css-parser.cjs"
|
|
69
|
-
"./state-style": {
|
|
70
|
-
"types": "./build/state-style.d.ts",
|
|
71
|
-
"default": "./build/state-style.js"
|
|
72
|
-
}
|
|
64
|
+
"./metro-css-parser": "./metro-css-parser.cjs"
|
|
73
65
|
},
|
|
74
66
|
"files": [
|
|
75
67
|
"build",
|
|
@@ -81,22 +73,22 @@
|
|
|
81
73
|
},
|
|
82
74
|
"dependencies": {
|
|
83
75
|
"typescript": "~6.0.0",
|
|
84
|
-
"@symbiote-native/components": "
|
|
76
|
+
"@symbiote-native/components": "2.0.0",
|
|
85
77
|
"@symbiote-native/css-parser": "0.5.0"
|
|
86
78
|
},
|
|
87
79
|
"peerDependencies": {
|
|
88
80
|
"svelte": ">=5.56.0",
|
|
89
81
|
"react-native": ">=0.86",
|
|
90
|
-
"@symbiote-native/engine": "^0.
|
|
82
|
+
"@symbiote-native/engine": "^0.5.0"
|
|
91
83
|
},
|
|
92
84
|
"devDependencies": {
|
|
93
85
|
"@vue/runtime-core": "^3.5.13",
|
|
94
86
|
"react": "19.2.3",
|
|
95
87
|
"svelte": "^5.56.0",
|
|
96
|
-
"@symbiote-native/engine": "0.
|
|
97
|
-
"@symbiote-native/react": "
|
|
88
|
+
"@symbiote-native/engine": "0.5.0",
|
|
89
|
+
"@symbiote-native/react": "2.0.0",
|
|
98
90
|
"@symbiote-native/test-utils": "0.3.0",
|
|
99
|
-
"@symbiote-native/vue": "
|
|
91
|
+
"@symbiote-native/vue": "2.0.0"
|
|
100
92
|
},
|
|
101
93
|
"scripts": {
|
|
102
94
|
"typecheck": "tsc --build",
|