@rsmax/toutiao 1.0.1
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/CHANGELOG.md +6 -0
- package/README.md +3 -0
- package/cjs/api/index.d.ts +2347 -0
- package/cjs/api/index.js +127 -0
- package/cjs/hostComponents/Button/index.d.ts +18 -0
- package/cjs/hostComponents/Button/index.js +15 -0
- package/cjs/hostComponents/Button/node.d.ts +34 -0
- package/cjs/hostComponents/Button/node.js +37 -0
- package/cjs/hostComponents/Canvas/index.d.ts +6 -0
- package/cjs/hostComponents/Canvas/index.js +5 -0
- package/cjs/hostComponents/Canvas/node.d.ts +19 -0
- package/cjs/hostComponents/Canvas/node.js +22 -0
- package/cjs/hostComponents/Checkbox/index.d.ts +10 -0
- package/cjs/hostComponents/Checkbox/index.js +9 -0
- package/cjs/hostComponents/Checkbox/node.d.ts +13 -0
- package/cjs/hostComponents/Checkbox/node.js +16 -0
- package/cjs/hostComponents/CheckboxGroup/index.d.ts +7 -0
- package/cjs/hostComponents/CheckboxGroup/index.js +5 -0
- package/cjs/hostComponents/CheckboxGroup/node.d.ts +8 -0
- package/cjs/hostComponents/CheckboxGroup/node.js +11 -0
- package/cjs/hostComponents/Form/index.d.ts +10 -0
- package/cjs/hostComponents/Form/index.js +8 -0
- package/cjs/hostComponents/Form/node.d.ts +11 -0
- package/cjs/hostComponents/Form/node.js +14 -0
- package/cjs/hostComponents/Icon/index.d.ts +8 -0
- package/cjs/hostComponents/Icon/index.js +8 -0
- package/cjs/hostComponents/Icon/node.d.ts +10 -0
- package/cjs/hostComponents/Icon/node.js +13 -0
- package/cjs/hostComponents/Image/index.d.ts +17 -0
- package/cjs/hostComponents/Image/index.js +9 -0
- package/cjs/hostComponents/Image/node.d.ts +19 -0
- package/cjs/hostComponents/Image/node.js +22 -0
- package/cjs/hostComponents/Input/index.d.ts +25 -0
- package/cjs/hostComponents/Input/index.js +17 -0
- package/cjs/hostComponents/Input/node.d.ts +32 -0
- package/cjs/hostComponents/Input/node.js +35 -0
- package/cjs/hostComponents/Label/index.d.ts +6 -0
- package/cjs/hostComponents/Label/index.js +5 -0
- package/cjs/hostComponents/Label/node.d.ts +8 -0
- package/cjs/hostComponents/Label/node.js +11 -0
- package/cjs/hostComponents/MovableArea/index.d.ts +10 -0
- package/cjs/hostComponents/MovableArea/index.js +8 -0
- package/cjs/hostComponents/MovableArea/node.d.ts +8 -0
- package/cjs/hostComponents/MovableArea/node.js +12 -0
- package/cjs/hostComponents/MovableView/index.d.ts +37 -0
- package/cjs/hostComponents/MovableView/index.js +20 -0
- package/cjs/hostComponents/MovableView/node.d.ts +26 -0
- package/cjs/hostComponents/MovableView/node.js +30 -0
- package/cjs/hostComponents/Navigator/index.d.ts +12 -0
- package/cjs/hostComponents/Navigator/index.js +12 -0
- package/cjs/hostComponents/Navigator/node.d.ts +23 -0
- package/cjs/hostComponents/Navigator/node.js +26 -0
- package/cjs/hostComponents/Picker/index.d.ts +45 -0
- package/cjs/hostComponents/Picker/index.js +9 -0
- package/cjs/hostComponents/Picker/node.d.ts +20 -0
- package/cjs/hostComponents/Picker/node.js +23 -0
- package/cjs/hostComponents/PickerView/index.d.ts +10 -0
- package/cjs/hostComponents/PickerView/index.js +5 -0
- package/cjs/hostComponents/PickerView/node.d.ts +18 -0
- package/cjs/hostComponents/PickerView/node.js +21 -0
- package/cjs/hostComponents/PickerViewColumn/index.d.ts +2 -0
- package/cjs/hostComponents/PickerViewColumn/index.js +5 -0
- package/cjs/hostComponents/PickerViewColumn/node.d.ts +2 -0
- package/cjs/hostComponents/PickerViewColumn/node.js +5 -0
- package/cjs/hostComponents/Progress/index.d.ts +12 -0
- package/cjs/hostComponents/Progress/index.js +14 -0
- package/cjs/hostComponents/Progress/node.d.ts +18 -0
- package/cjs/hostComponents/Progress/node.js +21 -0
- package/cjs/hostComponents/Radio/index.d.ts +10 -0
- package/cjs/hostComponents/Radio/index.js +10 -0
- package/cjs/hostComponents/Radio/node.d.ts +12 -0
- package/cjs/hostComponents/Radio/node.js +15 -0
- package/cjs/hostComponents/RadioGroup/index.d.ts +7 -0
- package/cjs/hostComponents/RadioGroup/index.js +5 -0
- package/cjs/hostComponents/RadioGroup/node.d.ts +9 -0
- package/cjs/hostComponents/RadioGroup/node.js +12 -0
- package/cjs/hostComponents/RichText/index.d.ts +12 -0
- package/cjs/hostComponents/RichText/index.js +5 -0
- package/cjs/hostComponents/RichText/node.d.ts +17 -0
- package/cjs/hostComponents/RichText/node.js +20 -0
- package/cjs/hostComponents/ScrollView/index.d.ts +16 -0
- package/cjs/hostComponents/ScrollView/index.js +12 -0
- package/cjs/hostComponents/ScrollView/node.d.ts +22 -0
- package/cjs/hostComponents/ScrollView/node.js +25 -0
- package/cjs/hostComponents/Slider/index.d.ts +20 -0
- package/cjs/hostComponents/Slider/index.js +19 -0
- package/cjs/hostComponents/Slider/node.d.ts +23 -0
- package/cjs/hostComponents/Slider/node.js +26 -0
- package/cjs/hostComponents/Swiper/index.d.ts +21 -0
- package/cjs/hostComponents/Swiper/index.js +20 -0
- package/cjs/hostComponents/Swiper/node.d.ts +26 -0
- package/cjs/hostComponents/Swiper/node.js +29 -0
- package/cjs/hostComponents/SwiperItem/index.d.ts +6 -0
- package/cjs/hostComponents/SwiperItem/index.js +5 -0
- package/cjs/hostComponents/SwiperItem/node.d.ts +9 -0
- package/cjs/hostComponents/SwiperItem/node.js +12 -0
- package/cjs/hostComponents/Switch/index.d.ts +11 -0
- package/cjs/hostComponents/Switch/index.js +11 -0
- package/cjs/hostComponents/Switch/node.d.ts +14 -0
- package/cjs/hostComponents/Switch/node.js +17 -0
- package/cjs/hostComponents/Text/index.d.ts +9 -0
- package/cjs/hostComponents/Text/index.js +10 -0
- package/cjs/hostComponents/Text/node.d.ts +11 -0
- package/cjs/hostComponents/Text/node.js +14 -0
- package/cjs/hostComponents/Textarea/index.d.ts +22 -0
- package/cjs/hostComponents/Textarea/index.js +16 -0
- package/cjs/hostComponents/Textarea/node.d.ts +33 -0
- package/cjs/hostComponents/Textarea/node.js +36 -0
- package/cjs/hostComponents/Video/index.d.ts +37 -0
- package/cjs/hostComponents/Video/index.js +14 -0
- package/cjs/hostComponents/Video/node.d.ts +42 -0
- package/cjs/hostComponents/Video/node.js +45 -0
- package/cjs/hostComponents/View/index.d.ts +24 -0
- package/cjs/hostComponents/View/index.js +11 -0
- package/cjs/hostComponents/View/node.d.ts +26 -0
- package/cjs/hostComponents/View/node.js +29 -0
- package/cjs/hostComponents/WebView/index.d.ts +8 -0
- package/cjs/hostComponents/WebView/index.js +8 -0
- package/cjs/hostComponents/WebView/node.d.ts +8 -0
- package/cjs/hostComponents/WebView/node.js +11 -0
- package/cjs/hostComponents/index.d.ts +29 -0
- package/cjs/hostComponents/index.js +45 -0
- package/cjs/hostComponents/node.d.ts +2 -0
- package/cjs/hostComponents/node.js +85 -0
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +19 -0
- package/cjs/node/index.d.ts +3 -0
- package/cjs/node/index.js +51 -0
- package/cjs/types/component.d.ts +28 -0
- package/cjs/types/component.js +2 -0
- package/cjs/types/config.d.ts +192 -0
- package/cjs/types/config.js +2 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +17 -0
- package/esm/api/index.d.ts +2347 -0
- package/esm/api/index.js +122 -0
- package/esm/hostComponents/Button/index.d.ts +18 -0
- package/esm/hostComponents/Button/index.js +12 -0
- package/esm/hostComponents/Button/node.d.ts +34 -0
- package/esm/hostComponents/Button/node.js +34 -0
- package/esm/hostComponents/Canvas/index.d.ts +6 -0
- package/esm/hostComponents/Canvas/index.js +2 -0
- package/esm/hostComponents/Canvas/node.d.ts +19 -0
- package/esm/hostComponents/Canvas/node.js +19 -0
- package/esm/hostComponents/Checkbox/index.d.ts +10 -0
- package/esm/hostComponents/Checkbox/index.js +6 -0
- package/esm/hostComponents/Checkbox/node.d.ts +13 -0
- package/esm/hostComponents/Checkbox/node.js +13 -0
- package/esm/hostComponents/CheckboxGroup/index.d.ts +7 -0
- package/esm/hostComponents/CheckboxGroup/index.js +2 -0
- package/esm/hostComponents/CheckboxGroup/node.d.ts +8 -0
- package/esm/hostComponents/CheckboxGroup/node.js +8 -0
- package/esm/hostComponents/Form/index.d.ts +10 -0
- package/esm/hostComponents/Form/index.js +5 -0
- package/esm/hostComponents/Form/node.d.ts +11 -0
- package/esm/hostComponents/Form/node.js +11 -0
- package/esm/hostComponents/Icon/index.d.ts +8 -0
- package/esm/hostComponents/Icon/index.js +5 -0
- package/esm/hostComponents/Icon/node.d.ts +10 -0
- package/esm/hostComponents/Icon/node.js +10 -0
- package/esm/hostComponents/Image/index.d.ts +17 -0
- package/esm/hostComponents/Image/index.js +6 -0
- package/esm/hostComponents/Image/node.d.ts +19 -0
- package/esm/hostComponents/Image/node.js +19 -0
- package/esm/hostComponents/Input/index.d.ts +25 -0
- package/esm/hostComponents/Input/index.js +14 -0
- package/esm/hostComponents/Input/node.d.ts +32 -0
- package/esm/hostComponents/Input/node.js +32 -0
- package/esm/hostComponents/Label/index.d.ts +6 -0
- package/esm/hostComponents/Label/index.js +2 -0
- package/esm/hostComponents/Label/node.d.ts +8 -0
- package/esm/hostComponents/Label/node.js +8 -0
- package/esm/hostComponents/MovableArea/index.d.ts +10 -0
- package/esm/hostComponents/MovableArea/index.js +5 -0
- package/esm/hostComponents/MovableArea/node.d.ts +8 -0
- package/esm/hostComponents/MovableArea/node.js +9 -0
- package/esm/hostComponents/MovableView/index.d.ts +37 -0
- package/esm/hostComponents/MovableView/index.js +17 -0
- package/esm/hostComponents/MovableView/node.d.ts +26 -0
- package/esm/hostComponents/MovableView/node.js +27 -0
- package/esm/hostComponents/Navigator/index.d.ts +12 -0
- package/esm/hostComponents/Navigator/index.js +9 -0
- package/esm/hostComponents/Navigator/node.d.ts +23 -0
- package/esm/hostComponents/Navigator/node.js +23 -0
- package/esm/hostComponents/Picker/index.d.ts +45 -0
- package/esm/hostComponents/Picker/index.js +6 -0
- package/esm/hostComponents/Picker/node.d.ts +20 -0
- package/esm/hostComponents/Picker/node.js +20 -0
- package/esm/hostComponents/PickerView/index.d.ts +10 -0
- package/esm/hostComponents/PickerView/index.js +2 -0
- package/esm/hostComponents/PickerView/node.d.ts +18 -0
- package/esm/hostComponents/PickerView/node.js +18 -0
- package/esm/hostComponents/PickerViewColumn/index.d.ts +2 -0
- package/esm/hostComponents/PickerViewColumn/index.js +2 -0
- package/esm/hostComponents/PickerViewColumn/node.d.ts +2 -0
- package/esm/hostComponents/PickerViewColumn/node.js +2 -0
- package/esm/hostComponents/Progress/index.d.ts +12 -0
- package/esm/hostComponents/Progress/index.js +11 -0
- package/esm/hostComponents/Progress/node.d.ts +18 -0
- package/esm/hostComponents/Progress/node.js +18 -0
- package/esm/hostComponents/Radio/index.d.ts +10 -0
- package/esm/hostComponents/Radio/index.js +7 -0
- package/esm/hostComponents/Radio/node.d.ts +12 -0
- package/esm/hostComponents/Radio/node.js +12 -0
- package/esm/hostComponents/RadioGroup/index.d.ts +7 -0
- package/esm/hostComponents/RadioGroup/index.js +2 -0
- package/esm/hostComponents/RadioGroup/node.d.ts +9 -0
- package/esm/hostComponents/RadioGroup/node.js +9 -0
- package/esm/hostComponents/RichText/index.d.ts +12 -0
- package/esm/hostComponents/RichText/index.js +2 -0
- package/esm/hostComponents/RichText/node.d.ts +17 -0
- package/esm/hostComponents/RichText/node.js +17 -0
- package/esm/hostComponents/ScrollView/index.d.ts +16 -0
- package/esm/hostComponents/ScrollView/index.js +9 -0
- package/esm/hostComponents/ScrollView/node.d.ts +22 -0
- package/esm/hostComponents/ScrollView/node.js +22 -0
- package/esm/hostComponents/Slider/index.d.ts +20 -0
- package/esm/hostComponents/Slider/index.js +16 -0
- package/esm/hostComponents/Slider/node.d.ts +23 -0
- package/esm/hostComponents/Slider/node.js +23 -0
- package/esm/hostComponents/Swiper/index.d.ts +21 -0
- package/esm/hostComponents/Swiper/index.js +17 -0
- package/esm/hostComponents/Swiper/node.d.ts +26 -0
- package/esm/hostComponents/Swiper/node.js +26 -0
- package/esm/hostComponents/SwiperItem/index.d.ts +6 -0
- package/esm/hostComponents/SwiperItem/index.js +2 -0
- package/esm/hostComponents/SwiperItem/node.d.ts +9 -0
- package/esm/hostComponents/SwiperItem/node.js +9 -0
- package/esm/hostComponents/Switch/index.d.ts +11 -0
- package/esm/hostComponents/Switch/index.js +8 -0
- package/esm/hostComponents/Switch/node.d.ts +14 -0
- package/esm/hostComponents/Switch/node.js +14 -0
- package/esm/hostComponents/Text/index.d.ts +9 -0
- package/esm/hostComponents/Text/index.js +7 -0
- package/esm/hostComponents/Text/node.d.ts +11 -0
- package/esm/hostComponents/Text/node.js +11 -0
- package/esm/hostComponents/Textarea/index.d.ts +22 -0
- package/esm/hostComponents/Textarea/index.js +13 -0
- package/esm/hostComponents/Textarea/node.d.ts +33 -0
- package/esm/hostComponents/Textarea/node.js +33 -0
- package/esm/hostComponents/Video/index.d.ts +37 -0
- package/esm/hostComponents/Video/index.js +11 -0
- package/esm/hostComponents/Video/node.d.ts +42 -0
- package/esm/hostComponents/Video/node.js +42 -0
- package/esm/hostComponents/View/index.d.ts +24 -0
- package/esm/hostComponents/View/index.js +8 -0
- package/esm/hostComponents/View/node.d.ts +26 -0
- package/esm/hostComponents/View/node.js +26 -0
- package/esm/hostComponents/WebView/index.d.ts +8 -0
- package/esm/hostComponents/WebView/index.js +5 -0
- package/esm/hostComponents/WebView/node.d.ts +8 -0
- package/esm/hostComponents/WebView/node.js +8 -0
- package/esm/hostComponents/index.d.ts +29 -0
- package/esm/hostComponents/index.js +29 -0
- package/esm/hostComponents/node.d.ts +2 -0
- package/esm/hostComponents/node.js +60 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -0
- package/esm/node/index.d.ts +3 -0
- package/esm/node/index.js +23 -0
- package/esm/types/component.d.ts +28 -0
- package/esm/types/component.js +1 -0
- package/esm/types/config.d.ts +192 -0
- package/esm/types/config.js +1 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/node.js +1 -0
- package/package.json +37 -0
- package/templates/base.ejs +52 -0
- package/templates/component.ejs +47 -0
- package/templates/page.ejs +3 -0
- package/vitest.config.js +7 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseProps } from '../../types/component';
|
|
3
|
+
export interface WebViewProps extends BaseProps {
|
|
4
|
+
src?: string;
|
|
5
|
+
onMessage?: (e: any) => void;
|
|
6
|
+
progressbarColor?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const WebView: React.ComponentType<WebViewProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './View';
|
|
2
|
+
export * from './Input';
|
|
3
|
+
export * from './Textarea';
|
|
4
|
+
export * from './Video';
|
|
5
|
+
export * from './Swiper';
|
|
6
|
+
export * from './ScrollView';
|
|
7
|
+
export * from './SwiperItem';
|
|
8
|
+
export * from './Icon';
|
|
9
|
+
export * from './Text';
|
|
10
|
+
export * from './RichText';
|
|
11
|
+
export * from './Progress';
|
|
12
|
+
export * from './Button';
|
|
13
|
+
export * from './CheckboxGroup';
|
|
14
|
+
export * from './Checkbox';
|
|
15
|
+
export * from './Form';
|
|
16
|
+
export * from './Label';
|
|
17
|
+
export * from './Picker';
|
|
18
|
+
export * from './PickerView';
|
|
19
|
+
export * from './PickerViewColumn';
|
|
20
|
+
export * from './RadioGroup';
|
|
21
|
+
export * from './Radio';
|
|
22
|
+
export * from './Slider';
|
|
23
|
+
export * from './Switch';
|
|
24
|
+
export * from './Navigator';
|
|
25
|
+
export * from './Image';
|
|
26
|
+
export * from './Canvas';
|
|
27
|
+
export * from './WebView';
|
|
28
|
+
export * from './MovableArea';
|
|
29
|
+
export * from './MovableView';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './View';
|
|
2
|
+
export * from './Input';
|
|
3
|
+
export * from './Textarea';
|
|
4
|
+
export * from './Video';
|
|
5
|
+
export * from './Swiper';
|
|
6
|
+
export * from './ScrollView';
|
|
7
|
+
export * from './SwiperItem';
|
|
8
|
+
export * from './Icon';
|
|
9
|
+
export * from './Text';
|
|
10
|
+
export * from './RichText';
|
|
11
|
+
export * from './Progress';
|
|
12
|
+
export * from './Button';
|
|
13
|
+
export * from './CheckboxGroup';
|
|
14
|
+
export * from './Checkbox';
|
|
15
|
+
export * from './Form';
|
|
16
|
+
export * from './Label';
|
|
17
|
+
export * from './Picker';
|
|
18
|
+
export * from './PickerView';
|
|
19
|
+
export * from './PickerViewColumn';
|
|
20
|
+
export * from './RadioGroup';
|
|
21
|
+
export * from './Radio';
|
|
22
|
+
export * from './Slider';
|
|
23
|
+
export * from './Switch';
|
|
24
|
+
export * from './Navigator';
|
|
25
|
+
export * from './Image';
|
|
26
|
+
export * from './Canvas';
|
|
27
|
+
export * from './WebView';
|
|
28
|
+
export * from './MovableArea';
|
|
29
|
+
export * from './MovableView';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as button from './Button/node';
|
|
2
|
+
import * as canvas from './Canvas/node';
|
|
3
|
+
import * as checkboxGroup from './CheckboxGroup/node';
|
|
4
|
+
import * as checkbox from './Checkbox/node';
|
|
5
|
+
import * as form from './Form/node';
|
|
6
|
+
import * as icon from './Icon/node';
|
|
7
|
+
import * as image from './Image/node';
|
|
8
|
+
import * as input from './Input/node';
|
|
9
|
+
import * as label from './Label/node';
|
|
10
|
+
import * as navigator from './Navigator/node';
|
|
11
|
+
import * as pickerViewColumn from './PickerViewColumn/node';
|
|
12
|
+
import * as pickerView from './PickerView/node';
|
|
13
|
+
import * as picker from './Picker/node';
|
|
14
|
+
import * as progress from './Progress/node';
|
|
15
|
+
import * as radioGroup from './RadioGroup/node';
|
|
16
|
+
import * as radio from './Radio/node';
|
|
17
|
+
import * as richText from './RichText/node';
|
|
18
|
+
import * as scrollView from './ScrollView/node';
|
|
19
|
+
import * as slider from './Slider/node';
|
|
20
|
+
import * as swiperItem from './SwiperItem/node';
|
|
21
|
+
import * as swiper from './Swiper/node';
|
|
22
|
+
import * as switchComponent from './Switch/node';
|
|
23
|
+
import * as text from './Text/node';
|
|
24
|
+
import * as textarea from './Textarea/node';
|
|
25
|
+
import * as video from './Video/node';
|
|
26
|
+
import * as view from './View/node';
|
|
27
|
+
import * as webView from './WebView/node';
|
|
28
|
+
import * as movableArea from './MovableArea/node';
|
|
29
|
+
import * as movableView from './MovableView/node';
|
|
30
|
+
const hostComponents = new Map();
|
|
31
|
+
hostComponents.set('button', button);
|
|
32
|
+
hostComponents.set('canvas', canvas);
|
|
33
|
+
hostComponents.set('checkbox-group', checkboxGroup);
|
|
34
|
+
hostComponents.set('checkbox', checkbox);
|
|
35
|
+
hostComponents.set('form', form);
|
|
36
|
+
hostComponents.set('icon', icon);
|
|
37
|
+
hostComponents.set('image', image);
|
|
38
|
+
hostComponents.set('input', input);
|
|
39
|
+
hostComponents.set('label', label);
|
|
40
|
+
hostComponents.set('navigator', navigator);
|
|
41
|
+
hostComponents.set('picker-view-column', pickerViewColumn);
|
|
42
|
+
hostComponents.set('picker-view', pickerView);
|
|
43
|
+
hostComponents.set('picker', picker);
|
|
44
|
+
hostComponents.set('progress', progress);
|
|
45
|
+
hostComponents.set('radio-group', radioGroup);
|
|
46
|
+
hostComponents.set('radio', radio);
|
|
47
|
+
hostComponents.set('rich-text', richText);
|
|
48
|
+
hostComponents.set('scroll-view', scrollView);
|
|
49
|
+
hostComponents.set('slider', slider);
|
|
50
|
+
hostComponents.set('swiper-item', swiperItem);
|
|
51
|
+
hostComponents.set('swiper', swiper);
|
|
52
|
+
hostComponents.set('switch', switchComponent);
|
|
53
|
+
hostComponents.set('text', text);
|
|
54
|
+
hostComponents.set('textarea', textarea);
|
|
55
|
+
hostComponents.set('video', video);
|
|
56
|
+
hostComponents.set('view', view);
|
|
57
|
+
hostComponents.set('web-view', webView);
|
|
58
|
+
hostComponents.set('movable-area', movableArea);
|
|
59
|
+
hostComponents.set('movable-view', movableView);
|
|
60
|
+
export default hostComponents;
|
package/esm/index.d.ts
ADDED
package/esm/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import hostComponents from '../hostComponents/node';
|
|
3
|
+
const EJS_TPL_ROOT = path.join(__dirname, '../../templates');
|
|
4
|
+
const plugin = () => {
|
|
5
|
+
return {
|
|
6
|
+
meta: {
|
|
7
|
+
global: 'tt',
|
|
8
|
+
template: {
|
|
9
|
+
extension: '.ttml',
|
|
10
|
+
tag: 'import',
|
|
11
|
+
src: 'src',
|
|
12
|
+
},
|
|
13
|
+
style: '.ttss',
|
|
14
|
+
ejs: {
|
|
15
|
+
base: path.join(EJS_TPL_ROOT, 'base.ejs'),
|
|
16
|
+
page: path.join(EJS_TPL_ROOT, 'page.ejs'),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
hostComponents,
|
|
20
|
+
skipHostComponents: ['swiper-item'],
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default plugin;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BaseEvent } from '@rsmax/wechat/esm/types/component';
|
|
3
|
+
/**
|
|
4
|
+
* 头条内置共有属性
|
|
5
|
+
* https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/component/introduction/basic-componen
|
|
6
|
+
*/
|
|
7
|
+
export interface BaseProps {
|
|
8
|
+
/** 组件的唯一标示: 保持整个页面唯一 */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** 组件的样式类: 在对应的 TTSS 中定义的样式类 */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** 组件的内联样式: 可以动态设置的内联样式 */
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
/** 组件是否显示: 所有组件默认显示 */
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** 自定义事件对象属性列表 */
|
|
18
|
+
export interface GenericEvent<Detail = any> extends BaseEvent {
|
|
19
|
+
/** 额外的信息 */
|
|
20
|
+
detail: Detail;
|
|
21
|
+
}
|
|
22
|
+
/** 触摸事件对象属性列表 */
|
|
23
|
+
export interface TouchEvent<T = Touch> extends BaseEvent {
|
|
24
|
+
/** 触摸事件,当前停留在屏幕中的触摸点信息的数组 */
|
|
25
|
+
touches: T[];
|
|
26
|
+
/** 触摸事件,当前变化的触摸点信息的数组 */
|
|
27
|
+
changedTouches: T[];
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/** 页面配置文件 */
|
|
2
|
+
export interface PageConfig {
|
|
3
|
+
/**
|
|
4
|
+
* 默认值:#000000
|
|
5
|
+
* 导航栏背景颜色,如"#000000"
|
|
6
|
+
*/
|
|
7
|
+
navigationBarBackgroundColor?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 默认值:white
|
|
10
|
+
* 导航栏标题颜色,仅支持 black / white
|
|
11
|
+
*/
|
|
12
|
+
navigationBarTextStyle?: 'black' | 'white';
|
|
13
|
+
/**
|
|
14
|
+
* 导航栏标题文字内容
|
|
15
|
+
*/
|
|
16
|
+
navigationBarTitleText?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 默认值: default
|
|
19
|
+
* 导航栏样式,仅支持 default/custom。
|
|
20
|
+
* custom 模式可自定义导航栏,只保留右上角胶囊状的按钮
|
|
21
|
+
*/
|
|
22
|
+
navigationStyle?: 'default' | 'custom';
|
|
23
|
+
/**
|
|
24
|
+
* 默认值:#ffffff
|
|
25
|
+
* 窗口的背景色
|
|
26
|
+
*/
|
|
27
|
+
backgroundColor?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 默认值:dark
|
|
30
|
+
* 下拉 loading 的样式,仅支持 dark / light
|
|
31
|
+
*/
|
|
32
|
+
backgroundTextStyle?: 'dark' | 'light';
|
|
33
|
+
/**
|
|
34
|
+
* 默认值:false
|
|
35
|
+
* 是否开启下拉刷新,详见页面相关事件处理函数。
|
|
36
|
+
*/
|
|
37
|
+
enablePullDownRefresh?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 默认值:50
|
|
40
|
+
* 页面上拉触底事件触发时距页面底部距离,单位为 px
|
|
41
|
+
*/
|
|
42
|
+
onReachBottomDistance?: number;
|
|
43
|
+
/**
|
|
44
|
+
* 默认值:false;
|
|
45
|
+
* 设置为 true 则页面整体不能上下滚动;
|
|
46
|
+
* 只在 page.json 中有效,无法在 app.json 中设置该项
|
|
47
|
+
*/
|
|
48
|
+
disableScroll?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 默认值:false
|
|
51
|
+
* 禁止页面右滑手势返回
|
|
52
|
+
*/
|
|
53
|
+
disableSwipeBack?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* 自定义组件配置
|
|
56
|
+
*/
|
|
57
|
+
usingComponents?: Record<string, any>;
|
|
58
|
+
}
|
|
59
|
+
interface TabItem {
|
|
60
|
+
/**
|
|
61
|
+
*页面路径,必须在 pages 中先定义
|
|
62
|
+
*/
|
|
63
|
+
pagePath: string;
|
|
64
|
+
/**
|
|
65
|
+
* tab 上按钮文字
|
|
66
|
+
*/
|
|
67
|
+
text: string;
|
|
68
|
+
/**
|
|
69
|
+
* 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效,不支持网络图片
|
|
70
|
+
*/
|
|
71
|
+
iconPath?: string;
|
|
72
|
+
/**
|
|
73
|
+
* 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
selectedIconPath?: string;
|
|
77
|
+
}
|
|
78
|
+
/** 全局配置文件 */
|
|
79
|
+
export interface AppConfig {
|
|
80
|
+
/**
|
|
81
|
+
* 配置页面路径
|
|
82
|
+
*/
|
|
83
|
+
pages: string[];
|
|
84
|
+
/**
|
|
85
|
+
* 配置默认页面的窗口表现
|
|
86
|
+
*/
|
|
87
|
+
window?: {
|
|
88
|
+
/**
|
|
89
|
+
* 默认值:#000000
|
|
90
|
+
* 导航栏背景颜色,如"#000000"
|
|
91
|
+
*/
|
|
92
|
+
navigationBarBackgroundColor?: string;
|
|
93
|
+
/**
|
|
94
|
+
* 默认值: white
|
|
95
|
+
* 导航栏标题颜色,仅支持 black/white,同时影响:标题颜色、右胶囊颜色、左返回箭头颜色
|
|
96
|
+
*/
|
|
97
|
+
navigationBarTextStyle?: 'white' | 'black';
|
|
98
|
+
/**
|
|
99
|
+
* 导航栏标题文字内容
|
|
100
|
+
*/
|
|
101
|
+
navigationBarTitleText?: string;
|
|
102
|
+
/**
|
|
103
|
+
* 默认值:default
|
|
104
|
+
* 导航栏样式,仅支持 default/custom。
|
|
105
|
+
* custom 模式可自定义导航栏,只保留右上角胶囊状的按钮,可以通过navigationBarTextStyle设置胶囊按钮的颜色
|
|
106
|
+
*/
|
|
107
|
+
navigationStyle?: 'default' | 'custom';
|
|
108
|
+
/**
|
|
109
|
+
* 默认值:#ffffff
|
|
110
|
+
* 窗口的背景色
|
|
111
|
+
*/
|
|
112
|
+
backgroundColor?: string;
|
|
113
|
+
/**
|
|
114
|
+
* 默认值:dark
|
|
115
|
+
* 下拉 loading 的样式,仅支持 dark / light
|
|
116
|
+
*/
|
|
117
|
+
backgroundTextStyle?: 'dark' | 'light';
|
|
118
|
+
/**
|
|
119
|
+
* 默认值:#ffffff
|
|
120
|
+
* 顶部窗口的背景色,仅 iOS 支持
|
|
121
|
+
*/
|
|
122
|
+
backgroundColorTop?: string;
|
|
123
|
+
/**
|
|
124
|
+
* 默认值:#ffffff
|
|
125
|
+
* 底部窗口的背景色,仅 iOS 支持
|
|
126
|
+
*/
|
|
127
|
+
backgroundColorBottom?: string;
|
|
128
|
+
/**
|
|
129
|
+
* 默认值:false
|
|
130
|
+
* 是否开启下拉刷新,详见页面相关事件处理函数
|
|
131
|
+
*/
|
|
132
|
+
enablePullDownRefresh?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* 默认值:50
|
|
135
|
+
* 页面上拉触底事件触发时距页面底部距离,单位为 px。
|
|
136
|
+
* 详见 Page.onReachBottom
|
|
137
|
+
*/
|
|
138
|
+
onReachBottomDistance?: number;
|
|
139
|
+
/**
|
|
140
|
+
* 仅在 navigationStyle 为 default 时该字段生效,用来控制导航栏透明设置。
|
|
141
|
+
* 默认 none,支持 always 一直透明 / auto 滑动自适应 / none 不透明
|
|
142
|
+
*/
|
|
143
|
+
transparentTitle?: 'none' | 'always' | 'auto';
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* 配置底部 tab 的表现
|
|
147
|
+
*/
|
|
148
|
+
tabBar?: {
|
|
149
|
+
/**
|
|
150
|
+
* tab 上的文字默认颜色
|
|
151
|
+
*/
|
|
152
|
+
color: string;
|
|
153
|
+
/**
|
|
154
|
+
* tab 上的文字选中时的颜色
|
|
155
|
+
*/
|
|
156
|
+
selectedColor: string;
|
|
157
|
+
/**
|
|
158
|
+
* tab 的背景色
|
|
159
|
+
*/
|
|
160
|
+
backgroundColor: string;
|
|
161
|
+
/**
|
|
162
|
+
* 默认值:black
|
|
163
|
+
* tabbar 上边框的颜色, 仅支持 black / white
|
|
164
|
+
*/
|
|
165
|
+
borderStyle?: 'black' | 'white';
|
|
166
|
+
/**
|
|
167
|
+
* tab 的列表,详见 list 属性说明,最少 2 个、最多 5 个 tab
|
|
168
|
+
*/
|
|
169
|
+
list: TabItem[];
|
|
170
|
+
/**
|
|
171
|
+
* 默认值:bottom
|
|
172
|
+
* tabBar 的位置,仅支持 bottom / top
|
|
173
|
+
*/
|
|
174
|
+
position?: 'bottom' | 'top';
|
|
175
|
+
/**
|
|
176
|
+
* 默认值:false
|
|
177
|
+
* 自定义 tabBar,见详情
|
|
178
|
+
* 2.5.0
|
|
179
|
+
*/
|
|
180
|
+
custom?: boolean;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* 需要跳转的小程序列表,相关 api 见tt.navigateToMiniProgram
|
|
184
|
+
* 1.5.0
|
|
185
|
+
*/
|
|
186
|
+
navigateToMiniProgramAppIdList?: string[];
|
|
187
|
+
/**
|
|
188
|
+
* 配置部分授权弹窗的副标题
|
|
189
|
+
*/
|
|
190
|
+
permission?: Record<string, any>;
|
|
191
|
+
}
|
|
192
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config';
|
package/node.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/node');
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rsmax/toutiao",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Rsmax for Toutiao",
|
|
5
|
+
"main": "./cjs/index.js",
|
|
6
|
+
"esnext": "./esm/index.js",
|
|
7
|
+
"module": "./esm/index.js",
|
|
8
|
+
"typings": "./esm/index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rimraf cjs esm tsconfig.tsbuildinfo",
|
|
11
|
+
"prebuild": "npm run clean",
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"build:cjs": "tsc --module CommonJS --outDir cjs",
|
|
14
|
+
"test": "vitest run"
|
|
15
|
+
},
|
|
16
|
+
"repository": "git+https://github.com/remaxjs/remax.git",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@rsmax/shared": "1.0.1",
|
|
20
|
+
"lodash": "^4.17.21"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@douyin-microapp/typings": "^1.3.1",
|
|
24
|
+
"@rsmax/framework-shared": "workspace:*",
|
|
25
|
+
"@rsmax/runtime": "workspace:*",
|
|
26
|
+
"@rsmax/types": "workspace:*",
|
|
27
|
+
"@rsmax/wechat": "workspace:*",
|
|
28
|
+
"@types/react": "^18.3.0",
|
|
29
|
+
"@types/react-test-renderer": "^18.3.0",
|
|
30
|
+
"react": "^18.3.0",
|
|
31
|
+
"react-test-renderer": "^18.3.0"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"gitHead": "d2ff644810449152d124a9da76218bcd9fdfff46"
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template name="REMAX_TPL">
|
|
2
|
+
<block tt:for="{{root.children}}" tt:key="*this">
|
|
3
|
+
<template is="{{'REMAX_TPL_' + root.nodes[item].type}}" data="{{i: root.nodes[item]}}" />
|
|
4
|
+
</block>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<sjs module="_h">
|
|
8
|
+
var elements = {};
|
|
9
|
+
module.exports = {
|
|
10
|
+
v: function(value) {
|
|
11
|
+
return value;
|
|
12
|
+
},
|
|
13
|
+
tid: function (type, ancestor) {
|
|
14
|
+
var items = ancestor.split(',');
|
|
15
|
+
var depth = 1;
|
|
16
|
+
|
|
17
|
+
for (var i = 0; i < items.length; i++) {
|
|
18
|
+
if (type === items[i]) {
|
|
19
|
+
depth = depth + 1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var id = 'REMAX_TPL_' + depth + '_' + type;
|
|
24
|
+
return id;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
</sjs>
|
|
28
|
+
|
|
29
|
+
<% for (let component of sortBy(Array.from(components.values()), 'id')) { -%>
|
|
30
|
+
<%_ if (skipComponents.includes(component.id)) {
|
|
31
|
+
continue;
|
|
32
|
+
} else { -%>
|
|
33
|
+
<%- include('./component.ejs', {
|
|
34
|
+
type: component.type,
|
|
35
|
+
props: component.props,
|
|
36
|
+
id: component.id,
|
|
37
|
+
slotView: slotView
|
|
38
|
+
}) -%>
|
|
39
|
+
|
|
40
|
+
<%_ } -%>
|
|
41
|
+
<% } -%>
|
|
42
|
+
|
|
43
|
+
<template name="REMAX_TPL_plain-text" data="{{i: i}}">
|
|
44
|
+
<block>{{i.text}}</block>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<% for (var i = 1; i <= depth['view']; i++) { -%>
|
|
49
|
+
<template name="REMAX_TPL_<%=i%>_CONTAINER" data="{{i: i}}">
|
|
50
|
+
<template is="{{_h.tid(i.type, a)}}" data="{{i: i, a: a + ',' + i.type, tid: <%=i%>}}" />
|
|
51
|
+
</template>
|
|
52
|
+
<% } -%>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template name="REMAX_TPL_<%=id%>">
|
|
2
|
+
<<%=id%>
|
|
3
|
+
<%_ for(let i=0;i < props.length; i++) { -%>
|
|
4
|
+
<%=props[i]%>="{{i.props['<%=props[i]%>']}}"
|
|
5
|
+
<%_ } -%>
|
|
6
|
+
>
|
|
7
|
+
<%_ if (id === 'swiper') { -%>
|
|
8
|
+
<block tt:for="{{i.children}}" tt:key="*this">
|
|
9
|
+
<swiper-item key="{{i.nodes[item].props.key}}">
|
|
10
|
+
<block tt:for="{{i.nodes[item].children}}" tt:key="*this" tt:for-item="sItem">
|
|
11
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].nodes[sItem].type}}" data="{{i: i.nodes[item].nodes[sItem]}}" />
|
|
12
|
+
</block>
|
|
13
|
+
</swiper-item>
|
|
14
|
+
</block>
|
|
15
|
+
<%_ } else if (id === 'picker-view') { -%>
|
|
16
|
+
<block tt:for="{{i.children}}" tt:key="*this">
|
|
17
|
+
<picker-view-column>
|
|
18
|
+
<view tt:for="{{i.nodes[item].children}}" tt:for-item="sItem">
|
|
19
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].nodes[sItem].type}}" data="{{i: i.nodes[item].nodes[sItem]}}" />
|
|
20
|
+
</view>
|
|
21
|
+
</picker-view-column>
|
|
22
|
+
</block>
|
|
23
|
+
<%_ } else if (type === 'native') { -%>
|
|
24
|
+
<block tt:for="{{i.children}}" tt:key="*this">
|
|
25
|
+
<block tt:if="{{i.nodes[item].props['slot']}}">
|
|
26
|
+
<view
|
|
27
|
+
slot="{{i.nodes[item].props['slot']}}"
|
|
28
|
+
<%_ for(let i=0;i < slotView.props.length; i++) { -%>
|
|
29
|
+
<%=slotView.props[i]%>="{{i.nodes[item].props['<%=slotView.props[i]%>']}}"
|
|
30
|
+
<%_ } -%>
|
|
31
|
+
>
|
|
32
|
+
<block tt:for="{{i.nodes[item].children}}" tt:key="*this" tt:for-item="sItem">
|
|
33
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].nodes[sItem].type}}" data="{{i: i.nodes[item].nodes[sItem]}}" />
|
|
34
|
+
</block>
|
|
35
|
+
</view>
|
|
36
|
+
</block>
|
|
37
|
+
<block tt:else>
|
|
38
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
|
|
39
|
+
</block>
|
|
40
|
+
</block>
|
|
41
|
+
<%_ } else { -%>
|
|
42
|
+
<block tt:for="{{i.children}}" tt:key="{{id}}">
|
|
43
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
|
|
44
|
+
</block>
|
|
45
|
+
<%_ } -%>
|
|
46
|
+
</<%=id%>>
|
|
47
|
+
</template>
|