@lingxia/elements 0.14.0 → 0.16.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/dist/index.d.ts +3 -2
- package/dist/index.js +1 -0
- package/dist/inline-native/commit.d.ts +39 -0
- package/dist/inline-native/commit.js +94 -0
- package/dist/inline-native/elements.d.ts +104 -0
- package/dist/inline-native/elements.js +749 -0
- package/dist/inline-native/errors.d.ts +8 -0
- package/dist/inline-native/errors.js +23 -0
- package/dist/inline-native/events.d.ts +10 -0
- package/dist/inline-native/events.js +16 -0
- package/dist/inline-native/geometry.d.ts +78 -0
- package/dist/inline-native/geometry.js +40 -0
- package/dist/inline-native/identity.d.ts +28 -0
- package/dist/inline-native/identity.js +51 -0
- package/dist/inline-native/index.d.ts +14 -0
- package/dist/inline-native/index.js +19 -0
- package/dist/inline-native/layout.d.ts +2 -0
- package/dist/inline-native/layout.js +58 -0
- package/dist/inline-native/lease.d.ts +13 -0
- package/dist/inline-native/lease.js +31 -0
- package/dist/inline-native/runtime.d.ts +64 -0
- package/dist/inline-native/runtime.js +119 -0
- package/dist/inline-native/schema.d.ts +111 -0
- package/dist/inline-native/schema.js +210 -0
- package/dist/inline-native/structure.d.ts +22 -0
- package/dist/inline-native/structure.js +706 -0
- package/dist/inline-native/style.d.ts +7 -0
- package/dist/inline-native/style.js +119 -0
- package/dist/inline-native/types.d.ts +82 -0
- package/dist/inline-native/types.js +7 -0
- package/dist/inline-native/unwrap.d.ts +10 -0
- package/dist/inline-native/unwrap.js +32 -0
- package/dist/inline-native/video.d.ts +65 -0
- package/dist/inline-native/video.js +69 -0
- package/dist/native_component_wrapper_shared.d.ts +3 -2
- package/dist/native_component_wrapper_shared.js +6 -3
- package/dist/nativecomponent.d.ts +1 -1
- package/dist/nativecomponent.js +8 -11
- package/dist/navigator.d.ts +2 -2
- package/dist/navigator.js +5 -5
- package/dist/picker.js +12 -4
- package/dist/video-events.d.ts +2 -0
- package/dist/video-events.js +18 -0
- package/dist/video.d.ts +98 -79
- package/dist/video.js +182 -757
- package/package.json +2 -1
- package/src/index.ts +58 -1
- package/src/inline-native/commit.ts +141 -0
- package/src/inline-native/elements.ts +829 -0
- package/src/inline-native/errors.ts +35 -0
- package/src/inline-native/events.ts +31 -0
- package/src/inline-native/geometry.ts +86 -0
- package/src/inline-native/identity.ts +102 -0
- package/src/inline-native/index.ts +103 -0
- package/src/inline-native/layout.ts +58 -0
- package/src/inline-native/lease.ts +48 -0
- package/src/inline-native/runtime.ts +185 -0
- package/src/inline-native/schema.ts +247 -0
- package/src/inline-native/structure.ts +823 -0
- package/src/inline-native/style.ts +111 -0
- package/src/inline-native/types.ts +105 -0
- package/src/inline-native/unwrap.ts +34 -0
- package/src/inline-native/video.ts +125 -0
- package/src/native_component_wrapper_shared.ts +8 -6
- package/src/nativecomponent.ts +8 -13
- package/src/navigator.ts +9 -9
- package/src/picker.ts +13 -4
- package/src/video-events.ts +16 -0
- package/src/video.ts +245 -839
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Machine-readable inline-native contract. Wrappers, the structure compiler,
|
|
3
|
+
* and the host applicator share this object; unknown names are out of contract.
|
|
4
|
+
*/
|
|
5
|
+
export declare const NATIVE_ERROR_CODES: readonly ["NATIVE_ROOT_UNAVAILABLE", "NATIVE_ROOT_INCOMPATIBLE", "NATIVE_ROOT_INVALID_STRUCTURE", "NATIVE_ROOT_FAILED", "NATIVE_ROOT_UNSUPPORTED_LAYOUT", "NATIVE_COMPONENT_INVALID_PROPS", "NATIVE_COMPONENT_MOUNT_FAILED", "NATIVE_COMPONENT_COMMAND_FAILED", "NATIVE_ROOT_UNSUPPORTED_STYLE", "NATIVE_ROOT_DESTROYED"];
|
|
6
|
+
export declare const PUBLIC_COMPONENT_NAMES: readonly ["LxNativeRoot", "LxNativeView", "LxNativeCover", "LxNativeText", "LxNativeButton", "LxVideo"];
|
|
7
|
+
export declare const PUBLIC_ELEMENT_TAGS: readonly ["lx-native-root", "lx-native-view", "lx-native-cover", "lx-native-text", "lx-native-button", "lx-video"];
|
|
8
|
+
export declare const CORE_KINDS: readonly ["root", "view", "text", "tappable"];
|
|
9
|
+
export declare const HOST_FACTORY_KINDS: readonly ["root", "view", "text", "tappable", "video"];
|
|
10
|
+
export declare const AUTHOR_COMPONENT_TO_TAG: {
|
|
11
|
+
readonly LxNativeRoot: "lx-native-root";
|
|
12
|
+
readonly LxNativeView: "lx-native-view";
|
|
13
|
+
readonly LxNativeCover: "lx-native-cover";
|
|
14
|
+
readonly LxNativeText: "lx-native-text";
|
|
15
|
+
readonly LxNativeButton: "lx-native-button";
|
|
16
|
+
readonly LxVideo: "lx-video";
|
|
17
|
+
};
|
|
18
|
+
export declare const TAG_TO_AUTHOR_COMPONENT: {
|
|
19
|
+
readonly "lx-native-root": "LxNativeRoot";
|
|
20
|
+
readonly "lx-native-view": "LxNativeView";
|
|
21
|
+
readonly "lx-native-cover": "LxNativeCover";
|
|
22
|
+
readonly "lx-native-text": "LxNativeText";
|
|
23
|
+
readonly "lx-native-button": "LxNativeButton";
|
|
24
|
+
readonly "lx-video": "LxVideo";
|
|
25
|
+
};
|
|
26
|
+
export declare const NATIVE_ACTION_ICONS: readonly ["close", "play", "pause", "mute", "unmute", "fullscreen", "more"];
|
|
27
|
+
export declare const POINTER_EVENTS_VALUES: readonly ["auto", "none", "box-only", "box-none"];
|
|
28
|
+
export declare const COVER_SCRIM_VALUES: readonly ["none", "top", "bottom", "full"];
|
|
29
|
+
export declare const STRUCTURE_ROLE_VALUES: readonly ["group", "region", "status", "presentation", "none"];
|
|
30
|
+
export declare const BUTTON_INTENT_VALUES: readonly ["neutral", "accent", "destructive"];
|
|
31
|
+
export declare const BUTTON_EMPHASIS_VALUES: readonly ["primary", "secondary", "quiet"];
|
|
32
|
+
export declare const BUTTON_SIZE_VALUES: readonly ["compact", "regular"];
|
|
33
|
+
export declare const BUTTON_ICON_POSITION_VALUES: readonly ["start", "end"];
|
|
34
|
+
export declare const VIDEO_OBJECT_FIT_VALUES: readonly ["contain", "cover", "fill", "none"];
|
|
35
|
+
export declare const VIDEO_CONTENT_ROTATE_VALUES: readonly [0, 90, 180, 270];
|
|
36
|
+
export declare const WATERMARK_CORNER_VALUES: readonly ["top-start", "top-end", "bottom-start", "bottom-end"];
|
|
37
|
+
/** Layout fields measured from the DOM anchor. */
|
|
38
|
+
export declare const NATIVE_STYLE_LAYOUT_FIELDS: readonly ["display", "position", "top", "right", "bottom", "left", "inset", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "flex", "flexGrow", "flexShrink", "flexBasis", "flexDirection", "flexWrap", "alignItems", "alignSelf", "justifyContent", "gap", "rowGap", "columnGap", "gridTemplateColumns", "gridTemplateRows", "gridColumn", "gridRow", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "overflow", "aspectRatio", "boxSizing"];
|
|
39
|
+
export declare const NATIVE_STYLE_PAINT_FIELDS: readonly ["backgroundColor", "opacity", "border", "borderWidth", "borderColor", "borderStyle", "borderRadius"];
|
|
40
|
+
export declare const NATIVE_STYLE_UNSUPPORTED_LAYOUT_FIELDS: readonly ["transform", "translate", "rotate", "scale", "perspective", "clipPath", "maskImage"];
|
|
41
|
+
export declare const NATIVE_STYLE_UNSUPPORTED_PAINT_FIELDS: readonly ["boxShadow", "filter", "backdropFilter", "mixBlendMode", "backgroundImage", "background", "animation", "transition", "textDecoration", "fontStyle", "letterSpacing", "textShadow"];
|
|
42
|
+
export declare const TEXT_STYLE_PROP_FIELDS: readonly ["fontSize", "fontWeight", "lineHeight", "textAlign", "color"];
|
|
43
|
+
export declare const INTERACTIVE_AUTHOR_COMPONENTS: readonly ["LxNativeButton", "LxVideo"];
|
|
44
|
+
export declare const CONTAINER_AUTHOR_COMPONENTS: readonly ["LxNativeRoot", "LxNativeView", "LxNativeCover"];
|
|
45
|
+
export declare const INLINE_NATIVE_SCHEMA: {
|
|
46
|
+
readonly version: 1;
|
|
47
|
+
readonly publicComponents: readonly ["LxNativeRoot", "LxNativeView", "LxNativeCover", "LxNativeText", "LxNativeButton", "LxVideo"];
|
|
48
|
+
readonly publicElementTags: readonly ["lx-native-root", "lx-native-view", "lx-native-cover", "lx-native-text", "lx-native-button", "lx-video"];
|
|
49
|
+
readonly coreKinds: readonly ["root", "view", "text", "tappable"];
|
|
50
|
+
readonly hostFactoryKinds: readonly ["root", "view", "text", "tappable", "video"];
|
|
51
|
+
readonly errorCodes: readonly ["NATIVE_ROOT_UNAVAILABLE", "NATIVE_ROOT_INCOMPATIBLE", "NATIVE_ROOT_INVALID_STRUCTURE", "NATIVE_ROOT_FAILED", "NATIVE_ROOT_UNSUPPORTED_LAYOUT", "NATIVE_COMPONENT_INVALID_PROPS", "NATIVE_COMPONENT_MOUNT_FAILED", "NATIVE_COMPONENT_COMMAND_FAILED", "NATIVE_ROOT_UNSUPPORTED_STYLE", "NATIVE_ROOT_DESTROYED"];
|
|
52
|
+
readonly authorComponentToTag: {
|
|
53
|
+
readonly LxNativeRoot: "lx-native-root";
|
|
54
|
+
readonly LxNativeView: "lx-native-view";
|
|
55
|
+
readonly LxNativeCover: "lx-native-cover";
|
|
56
|
+
readonly LxNativeText: "lx-native-text";
|
|
57
|
+
readonly LxNativeButton: "lx-native-button";
|
|
58
|
+
readonly LxVideo: "lx-video";
|
|
59
|
+
};
|
|
60
|
+
readonly tagToAuthorComponent: {
|
|
61
|
+
readonly "lx-native-root": "LxNativeRoot";
|
|
62
|
+
readonly "lx-native-view": "LxNativeView";
|
|
63
|
+
readonly "lx-native-cover": "LxNativeCover";
|
|
64
|
+
readonly "lx-native-text": "LxNativeText";
|
|
65
|
+
readonly "lx-native-button": "LxNativeButton";
|
|
66
|
+
readonly "lx-video": "LxVideo";
|
|
67
|
+
};
|
|
68
|
+
readonly nativeActionIcons: readonly ["close", "play", "pause", "mute", "unmute", "fullscreen", "more"];
|
|
69
|
+
readonly pointerEvents: readonly ["auto", "none", "box-only", "box-none"];
|
|
70
|
+
readonly coverScrim: readonly ["none", "top", "bottom", "full"];
|
|
71
|
+
readonly structureRoles: readonly ["group", "region", "status", "presentation", "none"];
|
|
72
|
+
readonly buttonIntent: readonly ["neutral", "accent", "destructive"];
|
|
73
|
+
readonly buttonEmphasis: readonly ["primary", "secondary", "quiet"];
|
|
74
|
+
readonly buttonSize: readonly ["compact", "regular"];
|
|
75
|
+
readonly buttonIconPosition: readonly ["start", "end"];
|
|
76
|
+
readonly videoObjectFit: readonly ["contain", "cover", "fill", "none"];
|
|
77
|
+
readonly videoContentRotate: readonly [0, 90, 180, 270];
|
|
78
|
+
readonly watermarkCorners: readonly ["top-start", "top-end", "bottom-start", "bottom-end"];
|
|
79
|
+
readonly nativeStyle: {
|
|
80
|
+
readonly layout: readonly ["display", "position", "top", "right", "bottom", "left", "inset", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "flex", "flexGrow", "flexShrink", "flexBasis", "flexDirection", "flexWrap", "alignItems", "alignSelf", "justifyContent", "gap", "rowGap", "columnGap", "gridTemplateColumns", "gridTemplateRows", "gridColumn", "gridRow", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "overflow", "aspectRatio", "boxSizing"];
|
|
81
|
+
readonly paint: readonly ["backgroundColor", "opacity", "border", "borderWidth", "borderColor", "borderStyle", "borderRadius"];
|
|
82
|
+
readonly unsupportedLayout: readonly ["transform", "translate", "rotate", "scale", "perspective", "clipPath", "maskImage"];
|
|
83
|
+
readonly unsupportedPaint: readonly ["boxShadow", "filter", "backdropFilter", "mixBlendMode", "backgroundImage", "background", "animation", "transition", "textDecoration", "fontStyle", "letterSpacing", "textShadow"];
|
|
84
|
+
readonly text: readonly ["fontSize", "fontWeight", "lineHeight", "textAlign", "color"];
|
|
85
|
+
};
|
|
86
|
+
readonly interactiveAuthorComponents: readonly ["LxNativeButton", "LxVideo"];
|
|
87
|
+
readonly containerAuthorComponents: readonly ["LxNativeRoot", "LxNativeView", "LxNativeCover"];
|
|
88
|
+
readonly recipes: {
|
|
89
|
+
readonly LxNativeCover: {
|
|
90
|
+
readonly expandsTo: "view";
|
|
91
|
+
readonly hostKind: false;
|
|
92
|
+
};
|
|
93
|
+
readonly LxNativeButton: {
|
|
94
|
+
readonly expandsTo: "tappable";
|
|
95
|
+
readonly hostKind: false;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
readonly capabilityLeaves: {
|
|
99
|
+
readonly LxVideo: {
|
|
100
|
+
readonly hostKind: "video";
|
|
101
|
+
readonly mustBeDirectRootChild: true;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export type NativeErrorCode = (typeof NATIVE_ERROR_CODES)[number];
|
|
106
|
+
export type PublicComponentName = (typeof PUBLIC_COMPONENT_NAMES)[number];
|
|
107
|
+
export type PublicElementTag = (typeof PUBLIC_ELEMENT_TAGS)[number];
|
|
108
|
+
export type CoreKind = (typeof CORE_KINDS)[number];
|
|
109
|
+
export type HostFactoryKind = (typeof HOST_FACTORY_KINDS)[number];
|
|
110
|
+
export type NativeActionIcon = (typeof NATIVE_ACTION_ICONS)[number];
|
|
111
|
+
export type NativeStyleProperty = (typeof NATIVE_STYLE_LAYOUT_FIELDS)[number] | (typeof NATIVE_STYLE_PAINT_FIELDS)[number] | (typeof TEXT_STYLE_PROP_FIELDS)[number];
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Machine-readable inline-native contract. Wrappers, the structure compiler,
|
|
3
|
+
* and the host applicator share this object; unknown names are out of contract.
|
|
4
|
+
*/
|
|
5
|
+
export const NATIVE_ERROR_CODES = [
|
|
6
|
+
"NATIVE_ROOT_UNAVAILABLE",
|
|
7
|
+
"NATIVE_ROOT_INCOMPATIBLE",
|
|
8
|
+
"NATIVE_ROOT_INVALID_STRUCTURE",
|
|
9
|
+
"NATIVE_ROOT_FAILED",
|
|
10
|
+
"NATIVE_ROOT_UNSUPPORTED_LAYOUT",
|
|
11
|
+
"NATIVE_COMPONENT_INVALID_PROPS",
|
|
12
|
+
"NATIVE_COMPONENT_MOUNT_FAILED",
|
|
13
|
+
"NATIVE_COMPONENT_COMMAND_FAILED",
|
|
14
|
+
"NATIVE_ROOT_UNSUPPORTED_STYLE",
|
|
15
|
+
"NATIVE_ROOT_DESTROYED",
|
|
16
|
+
];
|
|
17
|
+
export const PUBLIC_COMPONENT_NAMES = [
|
|
18
|
+
"LxNativeRoot",
|
|
19
|
+
"LxNativeView",
|
|
20
|
+
"LxNativeCover",
|
|
21
|
+
"LxNativeText",
|
|
22
|
+
"LxNativeButton",
|
|
23
|
+
"LxVideo",
|
|
24
|
+
];
|
|
25
|
+
export const PUBLIC_ELEMENT_TAGS = [
|
|
26
|
+
"lx-native-root",
|
|
27
|
+
"lx-native-view",
|
|
28
|
+
"lx-native-cover",
|
|
29
|
+
"lx-native-text",
|
|
30
|
+
"lx-native-button",
|
|
31
|
+
"lx-video",
|
|
32
|
+
];
|
|
33
|
+
export const CORE_KINDS = ["root", "view", "text", "tappable"];
|
|
34
|
+
export const HOST_FACTORY_KINDS = ["root", "view", "text", "tappable", "video"];
|
|
35
|
+
export const AUTHOR_COMPONENT_TO_TAG = {
|
|
36
|
+
LxNativeRoot: "lx-native-root",
|
|
37
|
+
LxNativeView: "lx-native-view",
|
|
38
|
+
LxNativeCover: "lx-native-cover",
|
|
39
|
+
LxNativeText: "lx-native-text",
|
|
40
|
+
LxNativeButton: "lx-native-button",
|
|
41
|
+
LxVideo: "lx-video",
|
|
42
|
+
};
|
|
43
|
+
export const TAG_TO_AUTHOR_COMPONENT = {
|
|
44
|
+
"lx-native-root": "LxNativeRoot",
|
|
45
|
+
"lx-native-view": "LxNativeView",
|
|
46
|
+
"lx-native-cover": "LxNativeCover",
|
|
47
|
+
"lx-native-text": "LxNativeText",
|
|
48
|
+
"lx-native-button": "LxNativeButton",
|
|
49
|
+
"lx-video": "LxVideo",
|
|
50
|
+
};
|
|
51
|
+
export const NATIVE_ACTION_ICONS = [
|
|
52
|
+
"close",
|
|
53
|
+
"play",
|
|
54
|
+
"pause",
|
|
55
|
+
"mute",
|
|
56
|
+
"unmute",
|
|
57
|
+
"fullscreen",
|
|
58
|
+
"more",
|
|
59
|
+
];
|
|
60
|
+
export const POINTER_EVENTS_VALUES = ["auto", "none", "box-only", "box-none"];
|
|
61
|
+
export const COVER_SCRIM_VALUES = ["none", "top", "bottom", "full"];
|
|
62
|
+
export const STRUCTURE_ROLE_VALUES = [
|
|
63
|
+
"group",
|
|
64
|
+
"region",
|
|
65
|
+
"status",
|
|
66
|
+
"presentation",
|
|
67
|
+
"none",
|
|
68
|
+
];
|
|
69
|
+
export const BUTTON_INTENT_VALUES = ["neutral", "accent", "destructive"];
|
|
70
|
+
export const BUTTON_EMPHASIS_VALUES = ["primary", "secondary", "quiet"];
|
|
71
|
+
export const BUTTON_SIZE_VALUES = ["compact", "regular"];
|
|
72
|
+
export const BUTTON_ICON_POSITION_VALUES = ["start", "end"];
|
|
73
|
+
export const VIDEO_OBJECT_FIT_VALUES = ["contain", "cover", "fill", "none"];
|
|
74
|
+
export const VIDEO_CONTENT_ROTATE_VALUES = [0, 90, 180, 270];
|
|
75
|
+
export const WATERMARK_CORNER_VALUES = [
|
|
76
|
+
"top-start",
|
|
77
|
+
"top-end",
|
|
78
|
+
"bottom-start",
|
|
79
|
+
"bottom-end",
|
|
80
|
+
];
|
|
81
|
+
/** Layout fields measured from the DOM anchor. */
|
|
82
|
+
export const NATIVE_STYLE_LAYOUT_FIELDS = [
|
|
83
|
+
"display",
|
|
84
|
+
"position",
|
|
85
|
+
"top",
|
|
86
|
+
"right",
|
|
87
|
+
"bottom",
|
|
88
|
+
"left",
|
|
89
|
+
"inset",
|
|
90
|
+
"width",
|
|
91
|
+
"height",
|
|
92
|
+
"minWidth",
|
|
93
|
+
"minHeight",
|
|
94
|
+
"maxWidth",
|
|
95
|
+
"maxHeight",
|
|
96
|
+
"flex",
|
|
97
|
+
"flexGrow",
|
|
98
|
+
"flexShrink",
|
|
99
|
+
"flexBasis",
|
|
100
|
+
"flexDirection",
|
|
101
|
+
"flexWrap",
|
|
102
|
+
"alignItems",
|
|
103
|
+
"alignSelf",
|
|
104
|
+
"justifyContent",
|
|
105
|
+
"gap",
|
|
106
|
+
"rowGap",
|
|
107
|
+
"columnGap",
|
|
108
|
+
"gridTemplateColumns",
|
|
109
|
+
"gridTemplateRows",
|
|
110
|
+
"gridColumn",
|
|
111
|
+
"gridRow",
|
|
112
|
+
"margin",
|
|
113
|
+
"marginTop",
|
|
114
|
+
"marginRight",
|
|
115
|
+
"marginBottom",
|
|
116
|
+
"marginLeft",
|
|
117
|
+
"padding",
|
|
118
|
+
"paddingTop",
|
|
119
|
+
"paddingRight",
|
|
120
|
+
"paddingBottom",
|
|
121
|
+
"paddingLeft",
|
|
122
|
+
"overflow",
|
|
123
|
+
"aspectRatio",
|
|
124
|
+
"boxSizing",
|
|
125
|
+
];
|
|
126
|
+
export const NATIVE_STYLE_PAINT_FIELDS = [
|
|
127
|
+
"backgroundColor",
|
|
128
|
+
"opacity",
|
|
129
|
+
"border",
|
|
130
|
+
"borderWidth",
|
|
131
|
+
"borderColor",
|
|
132
|
+
"borderStyle",
|
|
133
|
+
"borderRadius",
|
|
134
|
+
];
|
|
135
|
+
export const NATIVE_STYLE_UNSUPPORTED_LAYOUT_FIELDS = [
|
|
136
|
+
"transform",
|
|
137
|
+
"translate",
|
|
138
|
+
"rotate",
|
|
139
|
+
"scale",
|
|
140
|
+
"perspective",
|
|
141
|
+
"clipPath",
|
|
142
|
+
"maskImage",
|
|
143
|
+
];
|
|
144
|
+
export const NATIVE_STYLE_UNSUPPORTED_PAINT_FIELDS = [
|
|
145
|
+
"boxShadow",
|
|
146
|
+
"filter",
|
|
147
|
+
"backdropFilter",
|
|
148
|
+
"mixBlendMode",
|
|
149
|
+
"backgroundImage",
|
|
150
|
+
"background",
|
|
151
|
+
"animation",
|
|
152
|
+
"transition",
|
|
153
|
+
"textDecoration",
|
|
154
|
+
"fontStyle",
|
|
155
|
+
"letterSpacing",
|
|
156
|
+
"textShadow",
|
|
157
|
+
];
|
|
158
|
+
export const TEXT_STYLE_PROP_FIELDS = [
|
|
159
|
+
"fontSize",
|
|
160
|
+
"fontWeight",
|
|
161
|
+
"lineHeight",
|
|
162
|
+
"textAlign",
|
|
163
|
+
"color",
|
|
164
|
+
];
|
|
165
|
+
export const INTERACTIVE_AUTHOR_COMPONENTS = [
|
|
166
|
+
"LxNativeButton",
|
|
167
|
+
"LxVideo",
|
|
168
|
+
];
|
|
169
|
+
export const CONTAINER_AUTHOR_COMPONENTS = [
|
|
170
|
+
"LxNativeRoot",
|
|
171
|
+
"LxNativeView",
|
|
172
|
+
"LxNativeCover",
|
|
173
|
+
];
|
|
174
|
+
export const INLINE_NATIVE_SCHEMA = {
|
|
175
|
+
version: 1,
|
|
176
|
+
publicComponents: PUBLIC_COMPONENT_NAMES,
|
|
177
|
+
publicElementTags: PUBLIC_ELEMENT_TAGS,
|
|
178
|
+
coreKinds: CORE_KINDS,
|
|
179
|
+
hostFactoryKinds: HOST_FACTORY_KINDS,
|
|
180
|
+
errorCodes: NATIVE_ERROR_CODES,
|
|
181
|
+
authorComponentToTag: AUTHOR_COMPONENT_TO_TAG,
|
|
182
|
+
tagToAuthorComponent: TAG_TO_AUTHOR_COMPONENT,
|
|
183
|
+
nativeActionIcons: NATIVE_ACTION_ICONS,
|
|
184
|
+
pointerEvents: POINTER_EVENTS_VALUES,
|
|
185
|
+
coverScrim: COVER_SCRIM_VALUES,
|
|
186
|
+
structureRoles: STRUCTURE_ROLE_VALUES,
|
|
187
|
+
buttonIntent: BUTTON_INTENT_VALUES,
|
|
188
|
+
buttonEmphasis: BUTTON_EMPHASIS_VALUES,
|
|
189
|
+
buttonSize: BUTTON_SIZE_VALUES,
|
|
190
|
+
buttonIconPosition: BUTTON_ICON_POSITION_VALUES,
|
|
191
|
+
videoObjectFit: VIDEO_OBJECT_FIT_VALUES,
|
|
192
|
+
videoContentRotate: VIDEO_CONTENT_ROTATE_VALUES,
|
|
193
|
+
watermarkCorners: WATERMARK_CORNER_VALUES,
|
|
194
|
+
nativeStyle: {
|
|
195
|
+
layout: NATIVE_STYLE_LAYOUT_FIELDS,
|
|
196
|
+
paint: NATIVE_STYLE_PAINT_FIELDS,
|
|
197
|
+
unsupportedLayout: NATIVE_STYLE_UNSUPPORTED_LAYOUT_FIELDS,
|
|
198
|
+
unsupportedPaint: NATIVE_STYLE_UNSUPPORTED_PAINT_FIELDS,
|
|
199
|
+
text: TEXT_STYLE_PROP_FIELDS,
|
|
200
|
+
},
|
|
201
|
+
interactiveAuthorComponents: INTERACTIVE_AUTHOR_COMPONENTS,
|
|
202
|
+
containerAuthorComponents: CONTAINER_AUTHOR_COMPONENTS,
|
|
203
|
+
recipes: {
|
|
204
|
+
LxNativeCover: { expandsTo: "view", hostKind: false },
|
|
205
|
+
LxNativeButton: { expandsTo: "tappable", hostKind: false },
|
|
206
|
+
},
|
|
207
|
+
capabilityLeaves: {
|
|
208
|
+
LxVideo: { hostKind: "video", mustBeDirectRootChild: true },
|
|
209
|
+
},
|
|
210
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type PublicComponentName } from "./schema.js";
|
|
2
|
+
import { type AuthorNode, type CompileInlineNativeOptions, type CompileInlineNativeResult, type CompiledNativeRoot, type NativeError } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Compile one author Root into the host core tree. Cover/Button expand here;
|
|
5
|
+
* illegal children never become a host commit.
|
|
6
|
+
*/
|
|
7
|
+
export declare function compileInlineNativeRoot(author: AuthorNode, options?: CompileInlineNativeOptions): CompileInlineNativeResult;
|
|
8
|
+
/**
|
|
9
|
+
* Scan a page-level author forest. A bare LxVideo (or a Video nested in a
|
|
10
|
+
* non-Root) is `NATIVE_ROOT_INVALID_STRUCTURE`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function compileInlineNativeForest(nodes: readonly AuthorNode[], options?: CompileInlineNativeOptions): CompileInlineNativeResult | {
|
|
13
|
+
ok: true;
|
|
14
|
+
roots: CompiledNativeRoot[];
|
|
15
|
+
diagnostics: NativeError[];
|
|
16
|
+
};
|
|
17
|
+
export declare function normalizeAuthorType(type: string | undefined): PublicComponentName | undefined;
|
|
18
|
+
export declare function parseBooleanAttr(value: unknown, defaultValue?: boolean): boolean;
|
|
19
|
+
/** Collect author nodes from a Root element's light DOM (skips fallback). */
|
|
20
|
+
export declare function collectAuthorTreeFromElement(root: Element): AuthorNode;
|
|
21
|
+
export declare function findInlineNativeRoot(element: Element): Element | null;
|
|
22
|
+
export declare function isFallbackElement(element: Element): boolean;
|