From 79f23d41f1fd36d12a883ee7a32ed48a11843a31 Mon Sep 17 00:00:00 2001 From: zhongwu Date: Mon, 19 Sep 2022 11:05:35 +0800 Subject: [PATCH 1/2] feat(index): Add bytedance support --- packages/jsx-compiler/src/adapter.js | 12 ++++++++++++ packages/jsx-compiler/src/getCompiledComponents.js | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/jsx-compiler/src/adapter.js b/packages/jsx-compiler/src/adapter.js index b0199c01..02b6af6f 100644 --- a/packages/jsx-compiler/src/adapter.js +++ b/packages/jsx-compiler/src/adapter.js @@ -103,6 +103,18 @@ const parserAdapters = { ...componentCommonProps.bytedance, className: '__rax-text' }, + icon: { + ...componentCommonProps.bytedance, + className: '' + }, + image: { + ...componentCommonProps.bytedance, + className: '' + }, + 'scroll-view': { + ...componentCommonProps.bytedance, + className: '' + }, styleKeyword: true, slotScope: false, // Need transform onClick -> bindonclick diff --git a/packages/jsx-compiler/src/getCompiledComponents.js b/packages/jsx-compiler/src/getCompiledComponents.js index c4a21585..154e39e0 100644 --- a/packages/jsx-compiler/src/getCompiledComponents.js +++ b/packages/jsx-compiler/src/getCompiledComponents.js @@ -12,7 +12,10 @@ module.exports = function(platform) { case 'bytedance': return { 'rax-view': 'view', - 'rax-text': 'text' + 'rax-text': 'text', + 'rax-image': 'image', + 'rax-icon': 'icon', + 'rax-scrollview': 'scroll-view' }; } }; From 70c3889f90ad765c4de1ccf85a4d7a1387a7c5ea Mon Sep 17 00:00:00 2001 From: shiftj Date: Thu, 22 Sep 2022 17:23:48 +0800 Subject: [PATCH 2/2] feat(jsx-compiler): scroll-view event map of bytedance --- packages/jsx-compiler/src/adapter.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/jsx-compiler/src/adapter.js b/packages/jsx-compiler/src/adapter.js index 02b6af6f..6d7e6110 100644 --- a/packages/jsx-compiler/src/adapter.js +++ b/packages/jsx-compiler/src/adapter.js @@ -113,7 +113,13 @@ const parserAdapters = { }, 'scroll-view': { ...componentCommonProps.bytedance, - className: '' + className: '', + onEndReached: 'bindscrolltolower', + onScroll: 'bindscroll', + onTouchStart: 'binddragstart', + onTouchMove: 'binddragging', + onTouchEnd: 'binddragend', + // onTouchCancel: '' }, styleKeyword: true, slotScope: false,