@dcloudio/uni-mp-toutiao 3.0.0-alpha-3070720230314001 → 3.0.0-alpha-3071220230324001
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/uni.api.esm.js +1165 -1165
- package/dist/uni.compiler.js +112 -111
- package/dist/uni.mp.esm.js +1028 -1027
- package/package.json +6 -6
package/dist/uni.compiler.js
CHANGED
|
@@ -32,123 +32,124 @@ var source = {
|
|
|
32
32
|
condition: condition
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
function transformSwiper(node) {
|
|
36
|
-
if (node.type !== 1 /* NodeTypes.ELEMENT */ || node.tag !== 'swiper') {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const disableTouchProp = compilerCore.findProp(node, 'disable-touch', false, true);
|
|
40
|
-
if (!disableTouchProp) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const { props } = node;
|
|
44
|
-
if (disableTouchProp.type === 6 /* NodeTypes.ATTRIBUTE */) {
|
|
45
|
-
// <swiper disable-touch/> => <swiper :touchable="false"/>
|
|
46
|
-
props.splice(props.indexOf(disableTouchProp), 1, uniCliShared.createBindDirectiveNode('touchable', 'false'));
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
if (disableTouchProp.exp) {
|
|
50
|
-
// <swiper :disable-touch="true"/> => <swiper :touchable="!(true)"/>
|
|
51
|
-
let touchable = '';
|
|
52
|
-
if (disableTouchProp.exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {
|
|
53
|
-
if (disableTouchProp.exp.content === 'true') {
|
|
54
|
-
touchable = 'false';
|
|
55
|
-
}
|
|
56
|
-
else if (disableTouchProp.exp.content === 'false') {
|
|
57
|
-
touchable = 'true';
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
props.splice(props.indexOf(disableTouchProp), 1, uniCliShared.createBindDirectiveNode('touchable', touchable || `!(${uniMpCompiler.genExpr(disableTouchProp.exp)})`));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
35
|
+
function transformSwiper(node) {
|
|
36
|
+
if (node.type !== 1 /* NodeTypes.ELEMENT */ || node.tag !== 'swiper') {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const disableTouchProp = compilerCore.findProp(node, 'disable-touch', false, true);
|
|
40
|
+
if (!disableTouchProp) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const { props } = node;
|
|
44
|
+
if (disableTouchProp.type === 6 /* NodeTypes.ATTRIBUTE */) {
|
|
45
|
+
// <swiper disable-touch/> => <swiper :touchable="false"/>
|
|
46
|
+
props.splice(props.indexOf(disableTouchProp), 1, uniCliShared.createBindDirectiveNode('touchable', 'false'));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
if (disableTouchProp.exp) {
|
|
50
|
+
// <swiper :disable-touch="true"/> => <swiper :touchable="!(true)"/>
|
|
51
|
+
let touchable = '';
|
|
52
|
+
if (disableTouchProp.exp.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {
|
|
53
|
+
if (disableTouchProp.exp.content === 'true') {
|
|
54
|
+
touchable = 'false';
|
|
55
|
+
}
|
|
56
|
+
else if (disableTouchProp.exp.content === 'false') {
|
|
57
|
+
touchable = 'true';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
props.splice(props.indexOf(disableTouchProp), 1, uniCliShared.createBindDirectiveNode('touchable', touchable || `!(${uniMpCompiler.genExpr(disableTouchProp.exp)})`));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
uniCliShared.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
65
|
+
const customElements = ['aweme-data'];
|
|
66
|
+
const projectConfigFilename = 'project.config.json';
|
|
67
|
+
const nodeTransforms = [
|
|
68
|
+
uniCliShared.transformRef,
|
|
69
|
+
transformSwiper,
|
|
70
|
+
uniCliShared.transformMatchMedia,
|
|
71
|
+
uniCliShared.transformComponentLink,
|
|
72
|
+
];
|
|
73
|
+
const compilerOptions = {
|
|
74
|
+
nodeTransforms,
|
|
75
|
+
};
|
|
76
|
+
const COMPONENTS_DIR = 'ttcomponents';
|
|
77
|
+
const miniProgram = {
|
|
78
|
+
class: {
|
|
79
|
+
array: false,
|
|
80
|
+
},
|
|
81
|
+
slot: {
|
|
82
|
+
fallbackContent: true,
|
|
83
|
+
dynamicSlotNames: true,
|
|
84
|
+
},
|
|
85
|
+
directive: 'tt:',
|
|
86
|
+
component: {
|
|
87
|
+
dir: COMPONENTS_DIR,
|
|
88
|
+
vShow: uniCliShared.COMPONENT_CUSTOM_HIDDEN_BIND,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
const options = {
|
|
92
|
+
cdn: 4,
|
|
93
|
+
vite: {
|
|
94
|
+
inject: {
|
|
95
|
+
uni: [path__default.default.resolve(__dirname, 'uni.api.esm.js'), 'default'],
|
|
96
|
+
},
|
|
97
|
+
alias: {
|
|
98
|
+
'uni-mp-runtime': path__default.default.resolve(__dirname, 'uni.mp.esm.js'),
|
|
99
|
+
},
|
|
100
|
+
copyOptions: {
|
|
101
|
+
assets: [COMPONENTS_DIR],
|
|
102
|
+
targets: [
|
|
103
|
+
{
|
|
104
|
+
src: ['ext.json'],
|
|
105
|
+
get dest() {
|
|
106
|
+
return process.env.UNI_OUTPUT_DIR;
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
global: 'tt',
|
|
113
|
+
app: {
|
|
114
|
+
darkmode: false,
|
|
115
|
+
subpackages: true,
|
|
116
|
+
usingComponents: false,
|
|
117
|
+
},
|
|
118
|
+
project: {
|
|
119
|
+
filename: projectConfigFilename,
|
|
120
|
+
config: ['project.tt.json'],
|
|
121
|
+
source,
|
|
122
|
+
},
|
|
123
|
+
template: Object.assign(Object.assign({}, miniProgram), { customElements, filter: {
|
|
124
|
+
extname: '.sjs',
|
|
125
|
+
lang: 'sjs',
|
|
126
|
+
generate(filter, filename) {
|
|
127
|
+
if (filename) {
|
|
128
|
+
return `<sjs src="${filename}.sjs" module="${filter.name}"/>`;
|
|
129
|
+
}
|
|
129
130
|
return `<sjs module="${filter.name}">
|
|
130
131
|
${filter.code}
|
|
131
|
-
</sjs>`;
|
|
132
|
-
},
|
|
133
|
-
}, extname: '.ttml', compilerOptions }),
|
|
134
|
-
style: {
|
|
135
|
-
extname: '.ttss',
|
|
136
|
-
},
|
|
132
|
+
</sjs>`;
|
|
133
|
+
},
|
|
134
|
+
}, extname: '.ttml', compilerOptions }),
|
|
135
|
+
style: {
|
|
136
|
+
extname: '.ttss',
|
|
137
|
+
},
|
|
137
138
|
};
|
|
138
139
|
|
|
139
|
-
const uniMiniProgramToutiaoPlugin = {
|
|
140
|
-
name: 'uni:mp-toutiao',
|
|
141
|
-
config() {
|
|
142
|
-
return {
|
|
143
|
-
define: {
|
|
144
|
-
__VUE_CREATED_DEFERRED__: true,
|
|
145
|
-
},
|
|
146
|
-
build: {
|
|
147
|
-
assetsInlineLimit: uniCliShared.ASSETS_INLINE_LIMIT,
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
},
|
|
151
|
-
};
|
|
140
|
+
const uniMiniProgramToutiaoPlugin = {
|
|
141
|
+
name: 'uni:mp-toutiao',
|
|
142
|
+
config() {
|
|
143
|
+
return {
|
|
144
|
+
define: {
|
|
145
|
+
__VUE_CREATED_DEFERRED__: true,
|
|
146
|
+
},
|
|
147
|
+
build: {
|
|
148
|
+
assetsInlineLimit: uniCliShared.ASSETS_INLINE_LIMIT,
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
};
|
|
152
153
|
var index = [uniMiniProgramToutiaoPlugin, ...initMiniProgramPlugin__default.default(options)];
|
|
153
154
|
|
|
154
155
|
module.exports = index;
|