taro-plugin-qd 1.0.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.
@@ -0,0 +1,609 @@
1
+ import { mergeReconciler, mergeInternalComponents, processApis } from '@tarojs/shared';
2
+
3
+ const components = {
4
+ // 基础内容
5
+ Progress: {
6
+ 'border-radius': '0',
7
+ 'font-size': '16',
8
+ duration: '30',
9
+ bindActiveEnd: ''
10
+ },
11
+ RichText: {
12
+ space: '',
13
+ 'user-select': 'false'
14
+ },
15
+ Text: {
16
+ 'user-select': 'false'
17
+ },
18
+ // 表单组件
19
+ Input: {
20
+ 'always-embed': 'false',
21
+ 'adjust-position': 'true',
22
+ 'hold-keyboard': 'false',
23
+ 'safe-password-cert-path': '',
24
+ 'safe-password-length': '',
25
+ 'safe-password-time-stamp': '',
26
+ 'safe-password-nonce': '',
27
+ 'safe-password-salt': '',
28
+ 'safe-password-custom-hash': '',
29
+ bindKeyboardHeightChange: '',
30
+ bindNicknameReview: ''
31
+ },
32
+ Button: {
33
+ lang: 'en',
34
+ 'session-from': '',
35
+ 'send-message-title': '',
36
+ 'send-message-path': '',
37
+ 'send-message-img': '',
38
+ 'app-parameter': '',
39
+ 'show-message-card': 'false',
40
+ 'phone-number-no-quota-toast': 'true',
41
+ bindGetUserInfo: '',
42
+ bindContact: '',
43
+ bindGetPhoneNumber: '',
44
+ bindGetRealTimePhoneNumber: '',
45
+ bindChooseAvatar: '',
46
+ bindError: '',
47
+ bindOpenSetting: '',
48
+ bindLaunchApp: '',
49
+ bindAgreeprivacyauthorization: '',
50
+ bindSubmit: ''
51
+ },
52
+ Checkbox: {
53
+ color: "'#09BB07'"
54
+ },
55
+ CheckboxGroup: {
56
+ bindChange: ''
57
+ },
58
+ Editor: {
59
+ 'read-only': 'false',
60
+ placeholder: '',
61
+ 'show-img-size': 'false',
62
+ 'show-img-toolbar': 'false',
63
+ 'show-img-resize': 'false',
64
+ bindReady: '',
65
+ bindFocus: '',
66
+ bindBlur: '',
67
+ bindInput: '',
68
+ bindStatusChange: ''
69
+ },
70
+ Form: {
71
+ 'report-submit': 'false',
72
+ 'report-submit-timeout': '0',
73
+ bindSubmit: '',
74
+ bindReset: ''
75
+ },
76
+ Label: {
77
+ for: ''
78
+ },
79
+ Picker: {
80
+ 'header-text': '',
81
+ bindCancel: ''
82
+ },
83
+ PickerView: {
84
+ 'mask-style': '',
85
+ 'mask-class': '',
86
+ 'indicator-style': '',
87
+ 'indicator-class': '',
88
+ bindPickStart: '',
89
+ bindPickEnd: ''
90
+ },
91
+ Radio: {
92
+ color: "'#09BB07'"
93
+ },
94
+ RadioGroup: {
95
+ bindChange: ''
96
+ },
97
+ Slider: {
98
+ color: "'#e9e9e9'",
99
+ 'selected-color': "'#1aad19'",
100
+ 'block-size': '28',
101
+ 'block-color': "'#ffffff'"
102
+ },
103
+ Switch: {
104
+ type: "'switch'",
105
+ color: "'#04BE02'"
106
+ },
107
+ Textarea: {
108
+ 'show-confirm-bar': 'true',
109
+ 'adjust-position': 'true',
110
+ 'hold-keyboard': 'false',
111
+ 'disable-default-padding': 'false',
112
+ 'confirm-type': "'return'",
113
+ 'confirm-hold': 'false',
114
+ bindKeyboardHeightChange: ''
115
+ },
116
+ // 导航
117
+ Navigator: {
118
+ target: "'self'",
119
+ 'open-type': "'navigate'",
120
+ delta: '1',
121
+ 'app-id': '',
122
+ path: '',
123
+ 'extra-data': '',
124
+ version: "'release'",
125
+ 'hover-stop-propagation': 'false',
126
+ bindSuccess: '',
127
+ bindFail: '',
128
+ bindComplete: ''
129
+ },
130
+ // 媒体组件
131
+ Audio: {
132
+ id: '',
133
+ src: '',
134
+ loop: 'false',
135
+ controls: 'false',
136
+ poster: '',
137
+ name: '',
138
+ author: '',
139
+ bindError: '',
140
+ bindPlay: '',
141
+ bindPause: '',
142
+ bindTimeUpdate: '',
143
+ bindEnded: ''
144
+ },
145
+ Camera: {
146
+ mode: "'normal'",
147
+ 'device-position': "'back'",
148
+ flash: "'auto'",
149
+ 'frame-size': "'medium'",
150
+ bindStop: '',
151
+ bindError: '',
152
+ bindInitDone: '',
153
+ bindScanCode: ''
154
+ },
155
+ Image: {
156
+ 'webp': 'false',
157
+ 'show-menu-by-longpress': 'false',
158
+ bindLoad: '',
159
+ bindError: ''
160
+ },
161
+ Video: {
162
+ 'show-mute-btn': 'false',
163
+ title: '',
164
+ 'play-btn-position': "'bottom'",
165
+ 'enable-play-gesture': 'false',
166
+ 'auto-pause-if-navigate': 'true',
167
+ 'auto-pause-if-open-native': 'true',
168
+ 'vslide-gesture': 'false',
169
+ 'vslide-gesture-in-fullscreen': 'true',
170
+ 'ad-unit-id': '',
171
+ 'poster-for-crawler': '',
172
+ 'show-casting-button': 'false',
173
+ 'picture-in-picture-mode': '',
174
+ 'picture-in-picture-show-progress': 'false',
175
+ 'enable-auto-rotation': 'false',
176
+ 'show-screen-lock-button': 'false',
177
+ 'show-snapshot-button': 'false',
178
+ 'show-background-playback-button': 'false',
179
+ 'background-poster': '',
180
+ 'referrer-policy': "'origin'",
181
+ 'is-drm': 'false',
182
+ 'provision-url': '',
183
+ 'certificate-url': '',
184
+ 'license-url': '',
185
+ bindProgress: '',
186
+ bindLoadedMetaData: '',
187
+ bindControlsToggle: '',
188
+ bindEnterPictureInPicture: '',
189
+ bindLeavePictureInPicture: '',
190
+ bindSeekComplete: '',
191
+ bindAdLoad: '',
192
+ bindAdError: '',
193
+ bindAdClose: '',
194
+ bindAdPlay: '',
195
+ bindCastingUserSelect: '',
196
+ bindCastingStateChange: '',
197
+ bindCastingInterrupt: ''
198
+ },
199
+ LivePlayer: {
200
+ mode: "'live'",
201
+ 'sound-mode': "'speaker'",
202
+ 'auto-pause-if-navigate': 'true',
203
+ 'auto-pause-if-open-native': 'true',
204
+ 'picture-in-picture-mode': '',
205
+ 'referrer-policy': "'no-referrer'",
206
+ bindStateChange: '',
207
+ bindFullScreenChange: '',
208
+ bindNetStatus: '',
209
+ bindAudioVolumeNotify: '',
210
+ bindEnterPictureInPicture: '',
211
+ bindLeavePictureInPicture: ''
212
+ },
213
+ LivePusher: {
214
+ url: '',
215
+ mode: "'RTC'",
216
+ autopush: 'false',
217
+ muted: 'false',
218
+ 'enable-camera': 'true',
219
+ 'auto-focus': 'true',
220
+ orientation: "'vertical'",
221
+ beauty: '0',
222
+ whiteness: '0',
223
+ aspect: "'9:16'",
224
+ 'min-bitrate': '200',
225
+ 'max-bitrate': '1000',
226
+ 'audio-quality': "'high'",
227
+ 'waiting-image': '',
228
+ 'waiting-image-hash': '',
229
+ zoom: 'false',
230
+ 'device-position': "'front'",
231
+ 'background-mute': 'false',
232
+ mirror: 'false',
233
+ 'remote-mirror': 'false',
234
+ 'local-mirror': "'auto'",
235
+ 'audio-reverb-type': '0',
236
+ 'enable-mic': 'true',
237
+ 'enable-agc': 'false',
238
+ 'enable-ans': 'false',
239
+ 'audio-volume-type': "'voicecall'",
240
+ 'video-width': '360',
241
+ 'video-height': '640',
242
+ 'beauty-style': "'smooth'",
243
+ filter: "'standard'",
244
+ 'picture-in-picture-mode': '',
245
+ bindStateChange: '',
246
+ bindNetStatus: '',
247
+ bindBgmStart: '',
248
+ bindBgmProgress: '',
249
+ bindBgmComplete: '',
250
+ bindAudioVolumeNotify: '',
251
+ bindEnterPictureInPicture: '',
252
+ bindLeavePictureInPicture: ''
253
+ },
254
+ // 地图
255
+ Map: {
256
+ 'show-location': '',
257
+ polygons: '[]',
258
+ subkey: '',
259
+ 'layer-style': '1',
260
+ rotate: '0',
261
+ skew: '0',
262
+ 'enable-3D': 'false',
263
+ 'show-compass': 'false',
264
+ 'show-scale': 'false',
265
+ 'enable-overlooking': 'false',
266
+ 'enable-zoom': 'true',
267
+ 'enable-scroll': 'true',
268
+ 'enable-rotate': 'false',
269
+ 'enable-satellite': 'false',
270
+ 'enable-traffic': 'false',
271
+ 'enable-poi': 'true',
272
+ 'enable-building': '',
273
+ setting: '[]',
274
+ bindMarkerTap: '',
275
+ bindLabelTap: '',
276
+ bindControlTap: '',
277
+ bindCalloutTap: '',
278
+ bindUpdated: '',
279
+ bindRegionChange: '',
280
+ bindPoiTap: '',
281
+ bindAnchorPointTap: ''
282
+ },
283
+ // 画布
284
+ Canvas: {
285
+ type: '',
286
+ bindTouchStart: '',
287
+ bindTouchMove: '',
288
+ bindTouchEnd: '',
289
+ bindTouchCancel: '',
290
+ bindLongTap: '',
291
+ bindError: ''
292
+ },
293
+ // 开放能力
294
+ WebView: {
295
+ src: '',
296
+ bindMessage: '',
297
+ bindLoad: '',
298
+ bindError: ''
299
+ },
300
+ Ad: {
301
+ 'unit-id': '',
302
+ 'ad-intervals': '',
303
+ 'ad-type': "'banner'",
304
+ 'ad-theme': "'white'",
305
+ bindLoad: '',
306
+ bindError: '',
307
+ bindClose: ''
308
+ },
309
+ AdCustom: {
310
+ 'unit-id': '',
311
+ 'ad-intervals': '',
312
+ bindLoad: '',
313
+ bindError: '',
314
+ bindClose: ''
315
+ },
316
+ OfficialAccount: {
317
+ bindLoad: '',
318
+ bindError: ''
319
+ },
320
+ OpenData: {
321
+ type: '',
322
+ 'open-gid': '',
323
+ lang: "'en'",
324
+ 'default-text': '',
325
+ 'default-avatar': '',
326
+ bindError: ''
327
+ },
328
+ // 页面属性
329
+ PageMeta: {
330
+ 'background-text-style': '',
331
+ 'background-color': '',
332
+ 'background-color-top': '',
333
+ 'background-color-bottom': '',
334
+ 'scroll-top': "''",
335
+ 'scroll-duration': '300',
336
+ 'page-style': "''",
337
+ 'root-font-size': "''",
338
+ 'page-font-size': "''",
339
+ bindResize: '',
340
+ bindScroll: '',
341
+ bindScrollDone: ''
342
+ },
343
+ NavigationBar: {
344
+ title: "''",
345
+ loading: "'false'",
346
+ 'front-color': "''",
347
+ 'background-color': "''",
348
+ 'color-animation-duration': "'0'",
349
+ 'color-animation-timing-func': "'linear'"
350
+ },
351
+ // 视图容器 (补充)
352
+ ScrollView: {
353
+ 'enable-flex': 'false',
354
+ 'scroll-anchoring': 'false',
355
+ enhanced: 'false',
356
+ 'refresher-enabled': 'false',
357
+ 'refresher-threshold': '45',
358
+ 'refresher-default-style': "'black'",
359
+ 'refresher-background': "'#FFF'",
360
+ 'refresher-triggered': 'false',
361
+ bounces: 'true',
362
+ 'show-scrollbar': 'true',
363
+ 'paging-enabled': 'false',
364
+ 'fast-deceleration': 'false',
365
+ 'scroll-with-animation': 'false',
366
+ 'enable-back-to-top': 'false',
367
+ 'enable-passive': 'false',
368
+ 'scroll-into-view-alignment': "'start'",
369
+ type: "'list'",
370
+ reverse: 'false',
371
+ 'cache-extent': '',
372
+ padding: '',
373
+ bindDragStart: '',
374
+ bindDragging: '',
375
+ bindDragEnd: '',
376
+ bindRefresherPulling: '',
377
+ bindRefresherRefresh: '',
378
+ bindRefresherRestore: '',
379
+ bindRefresherAbort: '',
380
+ bindScrollStart: '',
381
+ bindScrollEnd: ''
382
+ },
383
+ Swiper: {
384
+ 'indicator-dots': 'false',
385
+ 'indicator-color': "'rgba(0, 0, 0, .3)'",
386
+ 'indicator-active-color': "'#000000'",
387
+ autoplay: 'false',
388
+ current: '0',
389
+ interval: '5000',
390
+ duration: '500',
391
+ circular: 'false',
392
+ vertical: 'false',
393
+ 'previous-margin': "'0px'",
394
+ 'next-margin': "'0px'",
395
+ 'snap-to-edge': 'false',
396
+ 'display-multiple-items': '1',
397
+ 'easing-function': "'default'",
398
+ bindChange: '',
399
+ bindTransition: '',
400
+ bindAnimationFinish: ''
401
+ },
402
+ SwiperItem: {
403
+ 'item-id': ''
404
+ },
405
+ MovableArea: {
406
+ 'scale-area': 'false'
407
+ },
408
+ MovableView: {
409
+ direction: "'none'",
410
+ inertia: 'false',
411
+ 'out-of-bounds': 'false',
412
+ x: '',
413
+ y: '',
414
+ damping: '20',
415
+ friction: '2',
416
+ disabled: 'false',
417
+ scale: 'false',
418
+ 'scale-min': '0.5',
419
+ 'scale-max': '10',
420
+ 'scale-value': '1',
421
+ animation: 'true',
422
+ bindChange: '',
423
+ bindScale: '',
424
+ bindHTouchMove: '',
425
+ bindVTouchMove: ''
426
+ },
427
+ MatchMedia: {
428
+ 'min-width': '',
429
+ 'max-width': '',
430
+ width: '',
431
+ 'min-height': '',
432
+ 'max-height': '',
433
+ height: '',
434
+ orientation: ''
435
+ },
436
+ ShareElement: {
437
+ key: '',
438
+ transform: 'false',
439
+ duration: '300',
440
+ 'easing-function': "'ease-out'"
441
+ },
442
+ PageContainer: {
443
+ show: 'false',
444
+ duration: '300',
445
+ 'z-index': '100',
446
+ overlay: 'true',
447
+ position: "'bottom'",
448
+ round: 'false',
449
+ 'close-on-slide-down': 'false',
450
+ 'overlay-style': '',
451
+ 'custom-style': '',
452
+ bindBeforeEnter: '',
453
+ bindEnter: '',
454
+ bindAfterEnter: '',
455
+ bindBeforeLeave: '',
456
+ bindLeave: '',
457
+ bindAfterLeave: '',
458
+ bindClickOverlay: ''
459
+ },
460
+ RootPortal: {},
461
+ VoipRoom: {
462
+ openid: '',
463
+ mode: "'camera'",
464
+ 'device-position': "'front'",
465
+ bindError: ''
466
+ },
467
+ // Skyline 组件
468
+ GridView: {
469
+ type: "'aligned'",
470
+ 'cross-axis-count': '2',
471
+ 'main-axis-gap': '0',
472
+ 'cross-axis-gap': '0',
473
+ 'max-cross-axis-extent': '0',
474
+ padding: "'0'"
475
+ },
476
+ ListView: {
477
+ 'scroll-y': '',
478
+ 'scroll-into-view': '',
479
+ 'scroll-with-animation': '',
480
+ padding: '',
481
+ 'upper-threshold': '',
482
+ 'lower-threshold': '',
483
+ bindScrollToUpper: '',
484
+ bindScrollToLower: '',
485
+ bindScroll: ''
486
+ },
487
+ StickyHeader: {
488
+ padding: ''
489
+ },
490
+ StickySection: {
491
+ padding: '',
492
+ 'push-pinned-header': "'false'"
493
+ }
494
+ };
495
+
496
+ const needPromiseApis = new Set([
497
+ 'addFileToFavorites',
498
+ 'addVideoToFavorites',
499
+ 'authPrivateMessage',
500
+ 'chooseContact',
501
+ 'cropImage',
502
+ 'editImage',
503
+ 'getShareInfo',
504
+ 'getUserProfile',
505
+ 'getWeRunData',
506
+ 'openChannelsLive',
507
+ 'openCustomerServiceChat',
508
+ 'openVideoEditor',
509
+ 'saveFileToDisk',
510
+ 'startFacialRecognitionVerify',
511
+ 'sendBizRedPacket',
512
+ 'startFacialRecognitionVerifyAndUploadVideo',
513
+ 'openChannelsActivity',
514
+ 'openChannelsEvent',
515
+ 'openChannelsUserProfile',
516
+ 'openSingleChat',
517
+ 'shareToWeRun',
518
+ 'getGroupEnterInfo',
519
+ 'getGroupProfile',
520
+ 'getPrivacySetting',
521
+ 'openPrivacyContract',
522
+ 'requirePrivacyAuthorize',
523
+ 'onNeedPrivacyAuthorization',
524
+ 'requestDeviceVoIP',
525
+ 'getDeviceVoIPList',
526
+ 'getSelftAvatar',
527
+ 'checkIsAddedByUser',
528
+ 'isAddedToMyMiniProgram',
529
+ 'getChannelsShareKey'
530
+ ]);
531
+ function initNativeApi(taro) {
532
+ processApis(taro, qd, {
533
+ needPromiseApis,
534
+ modifyApis(apis) {
535
+ apis.delete('lanDebug');
536
+ },
537
+ transformMeta(api, options) {
538
+ var _a;
539
+ if (api === 'showShareMenu') {
540
+ const menus = (_a = options.showShareItems) === null || _a === void 0 ? void 0 : _a.map((item) => {
541
+ if (item === 'wechatFriends')
542
+ return 'shareAppMessage';
543
+ if (item === 'wechatMoment')
544
+ return 'shareTimeline';
545
+ return item;
546
+ });
547
+ if (menus)
548
+ options.menus = menus;
549
+ }
550
+ return { key: api, options };
551
+ }
552
+ });
553
+ taro.cloud = qd.cloud;
554
+ taro.getTabBar = function (pageCtx) {
555
+ var _a;
556
+ if (typeof (pageCtx === null || pageCtx === void 0 ? void 0 : pageCtx.getTabBar) === 'function') {
557
+ return (_a = pageCtx.getTabBar()) === null || _a === void 0 ? void 0 : _a.$taroInstances;
558
+ }
559
+ };
560
+ taro.getRenderer = function () {
561
+ var _a;
562
+ return (_a = qd.getRenderer) === null || _a === void 0 ? void 0 : _a.call(qd);
563
+ };
564
+ }
565
+ const hostConfig = {
566
+ initNativeApi,
567
+ getMiniLifecycle(config) {
568
+ const methods = config.page[5];
569
+ if (methods.indexOf('onSaveExitState') === -1) {
570
+ methods.push('onSaveExitState');
571
+ }
572
+ return config;
573
+ },
574
+ transferHydrateData(data, element, componentsAlias) {
575
+ var _a;
576
+ if (element.isTransferElement) {
577
+ const pages = getCurrentPages();
578
+ const page = pages[pages.length - 1];
579
+ data['nn'] = element.dataName;
580
+ page.setData({
581
+ [toCamelCase(data.nn)]: data
582
+ });
583
+ return {
584
+ sid: element.sid,
585
+ ['v']: '',
586
+ ['nn']: ((_a = componentsAlias['#text']) === null || _a === void 0 ? void 0 : _a._num) || '8'
587
+ };
588
+ }
589
+ }
590
+ };
591
+ function toCamelCase(s) {
592
+ let camel = '';
593
+ let nextUpper = false;
594
+ for (let i = 0; i < s.length; i++) {
595
+ if (s[i] === '-') {
596
+ nextUpper = true;
597
+ }
598
+ else if (nextUpper) {
599
+ camel += s[i].toUpperCase();
600
+ nextUpper = false;
601
+ }
602
+ else {
603
+ camel += s[i];
604
+ }
605
+ }
606
+ return camel;
607
+ }
608
+ mergeReconciler(hostConfig);
609
+ mergeInternalComponents(components);
@@ -0,0 +1 @@
1
+ export { View, Icon, Progress, RichText, Text, Button, Checkbox, CheckboxGroup, Form, Input, Label, Picker, PickerView, PickerViewColumn, Radio, RadioGroup, Slider, Switch, CoverImage, Textarea, CoverView, MovableArea, MovableView, ScrollView, Swiper, SwiperItem, Navigator, Audio, Camera, Image, Video, Canvas, Ad, AdCustom, OfficialAccount, OpenData, WebView, Map, Editor, MatchMedia, FunctionalPageNavigator, LivePusher, LivePlayer, NavigationBar, PageMeta, VoipRoom, PageContainer, ShareElement, RootPortal, Block, GridView, ListView, StickyHeader, StickySection } from '@tarojs/components/mini';