@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.
@@ -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 projectConfigFilename = 'project.config.json';
66
- const nodeTransforms = [
67
- uniCliShared.transformRef,
68
- transformSwiper,
69
- uniCliShared.transformMatchMedia,
70
- uniCliShared.transformComponentLink,
71
- ];
72
- const compilerOptions = {
73
- nodeTransforms,
74
- };
75
- const COMPONENTS_DIR = 'ttcomponents';
76
- const miniProgram = {
77
- class: {
78
- array: false,
79
- },
80
- slot: {
81
- fallbackContent: true,
82
- dynamicSlotNames: true,
83
- },
84
- directive: 'tt:',
85
- component: {
86
- dir: COMPONENTS_DIR,
87
- vShow: uniCliShared.COMPONENT_CUSTOM_HIDDEN_BIND,
88
- },
89
- };
90
- const options = {
91
- cdn: 4,
92
- vite: {
93
- inject: {
94
- uni: [path__default.default.resolve(__dirname, 'uni.api.esm.js'), 'default'],
95
- },
96
- alias: {
97
- 'uni-mp-runtime': path__default.default.resolve(__dirname, 'uni.mp.esm.js'),
98
- },
99
- copyOptions: {
100
- assets: [COMPONENTS_DIR],
101
- targets: [
102
- {
103
- src: ['ext.json'],
104
- get dest() {
105
- return process.env.UNI_OUTPUT_DIR;
106
- },
107
- },
108
- ],
109
- },
110
- },
111
- global: 'tt',
112
- app: {
113
- darkmode: false,
114
- subpackages: true,
115
- usingComponents: false,
116
- },
117
- project: {
118
- filename: projectConfigFilename,
119
- config: ['project.tt.json'],
120
- source,
121
- },
122
- template: Object.assign(Object.assign({}, miniProgram), { filter: {
123
- extname: '.sjs',
124
- lang: 'sjs',
125
- generate(filter, filename) {
126
- if (filename) {
127
- return `<sjs src="${filename}.sjs" module="${filter.name}"/>`;
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;