@dcloudio/uni-app-x 0.7.116 → 0.7.118
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/package.json +1 -1
- package/types/dom2-internal/sharedData.d.ts +204 -126
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/interface.d.ts +57 -3
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/interface.d.ts +57 -3
package/package.json
CHANGED
|
@@ -333,70 +333,73 @@ declare global {
|
|
|
333
333
|
|
|
334
334
|
declare global {
|
|
335
335
|
/**
|
|
336
|
-
* 动态 sharedData
|
|
336
|
+
* 动态 sharedData 字段定义。
|
|
337
337
|
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
338
|
+
* 这里保留最小运行时需要的信息:
|
|
339
|
+
* - fieldId:字段编号
|
|
340
|
+
* - flagGroupId:所在 flag group
|
|
341
|
+
* - flagBit:所在 bit
|
|
340
342
|
*/
|
|
341
|
-
interface
|
|
343
|
+
interface UniSharedDataDynamicFieldDefinition {
|
|
342
344
|
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* 用于调试、日志和与静态 sharedData class 对照。
|
|
345
|
+
* 当前 template 内唯一的字段编号。
|
|
346
346
|
*/
|
|
347
|
-
readonly
|
|
347
|
+
readonly fieldId: number
|
|
348
348
|
|
|
349
349
|
/**
|
|
350
|
-
*
|
|
350
|
+
* 该字段对应的 flag group 编号。
|
|
351
351
|
*/
|
|
352
|
-
readonly
|
|
352
|
+
readonly flagGroupId: number
|
|
353
353
|
|
|
354
354
|
/**
|
|
355
|
-
*
|
|
355
|
+
* 该字段在 flag group 中对应的 bit。
|
|
356
356
|
*/
|
|
357
|
-
readonly
|
|
357
|
+
readonly flagBit: number
|
|
358
|
+
}
|
|
358
359
|
|
|
360
|
+
/**
|
|
361
|
+
* 动态 sharedData class 定义。
|
|
362
|
+
*
|
|
363
|
+
* 用于:
|
|
364
|
+
* - 构造动态 sharedData 实例时初始化字段槽
|
|
365
|
+
* - 初始化 flag group
|
|
366
|
+
* - 调试 / 诊断 / 宿主校验
|
|
367
|
+
*/
|
|
368
|
+
interface UniDynamicSharedDataClassDefinition {
|
|
359
369
|
/**
|
|
360
|
-
*
|
|
370
|
+
* 对齐静态 sharedData class 的名称。
|
|
371
|
+
*
|
|
372
|
+
* 主要用于调试、日志和对照,不参与热路径判断。
|
|
361
373
|
*/
|
|
362
|
-
readonly
|
|
374
|
+
readonly sharedDataClassName: string
|
|
363
375
|
|
|
364
376
|
/**
|
|
365
|
-
* 当前 class
|
|
377
|
+
* 当前 template 内唯一的 sharedData class 编号。
|
|
378
|
+
*
|
|
379
|
+
* root page / root component 固定为 0。
|
|
366
380
|
*/
|
|
367
|
-
readonly
|
|
368
|
-
}
|
|
381
|
+
readonly sharedDataClassId: number
|
|
369
382
|
|
|
370
|
-
/**
|
|
371
|
-
* 动态 sharedData 字段声明。
|
|
372
|
-
*/
|
|
373
|
-
interface UniDynamicSharedDataField {
|
|
374
383
|
/**
|
|
375
|
-
* 当前
|
|
384
|
+
* 当前 class 的字段数量。
|
|
376
385
|
*/
|
|
377
|
-
readonly
|
|
386
|
+
readonly fieldCount: number
|
|
378
387
|
|
|
379
388
|
/**
|
|
380
|
-
*
|
|
389
|
+
* 当前 class 的 flag group 数量。
|
|
381
390
|
*/
|
|
382
|
-
readonly
|
|
391
|
+
readonly flagGroupCount: number
|
|
383
392
|
|
|
384
393
|
/**
|
|
385
|
-
*
|
|
394
|
+
* 当前 class 的字段定义。
|
|
386
395
|
*/
|
|
387
|
-
readonly
|
|
396
|
+
readonly fields: ReadonlyArray<UniSharedDataDynamicFieldDefinition>
|
|
388
397
|
}
|
|
389
398
|
|
|
390
399
|
/**
|
|
391
|
-
* 动态 sharedData
|
|
392
|
-
*
|
|
393
|
-
* 所有动态 sharedData 实例统一通过:
|
|
394
|
-
* - `bundleKey`
|
|
395
|
-
* - `sharedDataClassId`
|
|
400
|
+
* 动态 sharedData 的初始化参数。
|
|
396
401
|
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
* root page / root component 的 `sharedDataClassId` 固定由编译器传入 `0`。
|
|
402
|
+
* 这是 renderSharedData 直接使用的构造参数。
|
|
400
403
|
*/
|
|
401
404
|
interface UniDynamicSharedDataInitOptions {
|
|
402
405
|
/**
|
|
@@ -407,176 +410,251 @@ declare global {
|
|
|
407
410
|
/**
|
|
408
411
|
* 当前实例对应的 sharedData class 编号。
|
|
409
412
|
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
413
|
+
* 约束:
|
|
414
|
+
* - root page:0
|
|
415
|
+
* - root component:0
|
|
416
|
+
* - scoped sharedData:编译器分配的实际 classId
|
|
412
417
|
*/
|
|
413
418
|
readonly sharedDataClassId: number
|
|
414
419
|
}
|
|
415
420
|
|
|
416
|
-
interface UniDynamicSharedDataBundle {
|
|
417
|
-
getSharedDataClassDefinition(sharedDataClassId: number): UniDynamicSharedDataClassDefinition
|
|
418
|
-
}
|
|
419
|
-
|
|
420
421
|
/**
|
|
421
|
-
*
|
|
422
|
+
* UniDynamicSharedDataState 的初始化参数。
|
|
423
|
+
*
|
|
424
|
+
* 这是宿主真实实现类在内部创建 state 时使用的参数。
|
|
425
|
+
* renderSharedData 不直接传这个对象。
|
|
422
426
|
*/
|
|
423
|
-
interface
|
|
427
|
+
interface UniDynamicSharedDataStateOptions extends UniDynamicSharedDataInitOptions {
|
|
424
428
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
429
|
+
* 按 bundleKey 读取原始二进制 bytes。
|
|
430
|
+
*
|
|
431
|
+
* 只负责读取 bytes。
|
|
432
|
+
* 缓存、decode、classDefinition 查询真实实现由 C++ / Kotlin 原生侧完成。
|
|
427
433
|
*/
|
|
428
|
-
|
|
434
|
+
readonly loadBundleBytes: (bundleKey: string) => Uint8Array
|
|
429
435
|
}
|
|
430
436
|
|
|
431
437
|
/**
|
|
432
|
-
* 普通动态 sharedData
|
|
433
|
-
*
|
|
434
|
-
* 解释器只依赖字段与 flag 读取。
|
|
435
|
-
*
|
|
436
|
-
* 非解释器使用的内部字段、方法,命名尽量贴近静态 sharedData:
|
|
437
|
-
* - 复用已有静态基类字段
|
|
438
|
-
* - 内部方法沿用 `_xxx` 风格
|
|
438
|
+
* 普通动态 sharedData 的最小读取协议。
|
|
439
439
|
*
|
|
440
|
-
*
|
|
440
|
+
* 解释器只依赖这些读取能力。
|
|
441
441
|
*/
|
|
442
442
|
interface IUniDynamicSharedData {
|
|
443
|
+
/**
|
|
444
|
+
* 当前实例所属 bundleKey。
|
|
445
|
+
*/
|
|
446
|
+
readonly _bundleKey: string
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* 当前实例对应的 sharedData class 编号。
|
|
450
|
+
*/
|
|
451
|
+
readonly _sharedDataClassId: number
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* 当前实例绑定的 class 定义。
|
|
455
|
+
*/
|
|
456
|
+
readonly _sharedDataClass: UniDynamicSharedDataClassDefinition
|
|
457
|
+
|
|
443
458
|
/**
|
|
444
459
|
* 按字段编号读取值。
|
|
445
|
-
*
|
|
446
|
-
* 这里的 `fieldId` 由编译器 shared schema 分配,
|
|
447
|
-
* 解释器与真实实现都以该编号作为统一索引。
|
|
448
460
|
*/
|
|
449
461
|
getField(fieldId: number): UniSharedDataAny
|
|
450
462
|
|
|
451
463
|
/**
|
|
452
|
-
* 按 flag
|
|
453
|
-
*
|
|
454
|
-
* 返回值与静态 sharedData 的 flag group 对齐,
|
|
455
|
-
* 解释器只关心位图值本身,不关心内部存储结构。
|
|
464
|
+
* 按 flag group 编号读取脏标记位图。
|
|
456
465
|
*/
|
|
457
466
|
getFlag(flagGroupId: number): number
|
|
458
467
|
}
|
|
459
468
|
|
|
460
469
|
/**
|
|
461
|
-
* 动态组件 sharedData
|
|
470
|
+
* 动态组件 sharedData 的最小读取协议。
|
|
462
471
|
*
|
|
463
|
-
* 对齐静态 renderer 会直接读取的
|
|
464
|
-
* - `_vueId`
|
|
465
|
-
* - `_flatten`
|
|
466
|
-
* - `_renderer`
|
|
472
|
+
* 对齐静态 renderer 会直接读取的 builtin。
|
|
467
473
|
*/
|
|
468
474
|
interface IUniDynamicSharedDataComponent extends IUniDynamicSharedData {
|
|
469
|
-
/**
|
|
470
|
-
* 返回组件或页面实例的 vueId。
|
|
471
|
-
*/
|
|
472
475
|
getVueId(): number
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* 返回组件当前 flatten 状态。
|
|
476
|
-
*/
|
|
477
476
|
getFlatten(): UniSharedDataComponentFlatten
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* 返回当前 renderer 类型。
|
|
481
|
-
*/
|
|
482
477
|
getRenderer(): UniSharedDataComponentRenderer
|
|
483
478
|
}
|
|
484
479
|
|
|
485
480
|
/**
|
|
486
|
-
* 动态页面 sharedData
|
|
487
|
-
*
|
|
488
|
-
* 接口层明确表达:dynamic page 也是 dynamic component。
|
|
481
|
+
* 动态页面 sharedData 的最小读取协议。
|
|
489
482
|
*
|
|
490
|
-
* 当前阶段 page
|
|
491
|
-
* `_flushJobs`、`_render`、`_textLayouts` 等行为属于真实运行时职责,
|
|
492
|
-
* 不放进当前解释器契约。
|
|
483
|
+
* 当前阶段 page 不额外增加读取面,直接继承 component 协议。
|
|
493
484
|
*/
|
|
494
485
|
interface IUniDynamicSharedDataPage extends IUniDynamicSharedDataComponent {}
|
|
495
486
|
|
|
496
487
|
/**
|
|
497
|
-
*
|
|
488
|
+
* 动态 sharedData 的运行时状态对象。
|
|
498
489
|
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
490
|
+
* 职责:
|
|
491
|
+
* - load bytes
|
|
492
|
+
* - bundle cache
|
|
493
|
+
* - decode
|
|
494
|
+
* - sharedDataClassId -> classDefinition
|
|
495
|
+
* - 字段值存储
|
|
496
|
+
* - flags 存储
|
|
497
|
+
* - render callback 执行
|
|
501
498
|
*/
|
|
502
|
-
|
|
499
|
+
class UniDynamicSharedDataState {
|
|
500
|
+
constructor(owner: IUniDynamicSharedData | IUniDynamicSharedDataComponent | IUniDynamicSharedDataPage, options: UniDynamicSharedDataStateOptions)
|
|
501
|
+
|
|
503
502
|
/**
|
|
504
|
-
*
|
|
503
|
+
* 当前实例绑定的 classDefinition。
|
|
505
504
|
*/
|
|
506
|
-
|
|
505
|
+
getClassDefinition(): UniDynamicSharedDataClassDefinition
|
|
507
506
|
|
|
508
507
|
/**
|
|
509
|
-
*
|
|
508
|
+
* 读取字段值。
|
|
510
509
|
*/
|
|
511
|
-
|
|
510
|
+
getField(fieldId: number): UniSharedDataAny
|
|
512
511
|
|
|
513
512
|
/**
|
|
514
|
-
*
|
|
513
|
+
* 读取 flag group。
|
|
514
|
+
*/
|
|
515
|
+
getFlag(flagGroupId: number): number
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* 写字段值。
|
|
519
|
+
*
|
|
520
|
+
* 返回值表示该写入是否产生有效变化。
|
|
521
|
+
*/
|
|
522
|
+
setField(fieldId: number, value: UniSharedDataAny | null): boolean
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* 清空当前实例的 flags。
|
|
526
|
+
*/
|
|
527
|
+
resetFlags(): void
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* 执行动态 renderElement callback。
|
|
531
|
+
*
|
|
532
|
+
* 返回值必须和静态渲染一致。
|
|
533
|
+
*/
|
|
534
|
+
renderElement(): UniElementBlock
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* 执行动态 renderKotlinElement callback。
|
|
538
|
+
*
|
|
539
|
+
* 返回值必须和静态渲染一致。
|
|
540
|
+
*/
|
|
541
|
+
renderKotlinElement(): UniElementBlock
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* 执行动态 renderNativeView callback。
|
|
515
545
|
*
|
|
516
|
-
*
|
|
546
|
+
* 返回值必须和静态渲染一致。
|
|
517
547
|
*/
|
|
548
|
+
renderNativeView(): UniNativeViewBlock
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* 普通动态 scope sharedData。
|
|
553
|
+
*
|
|
554
|
+
* 真实实现由宿主仓库提供。
|
|
555
|
+
* renderSharedData 会直接 new 该类。
|
|
556
|
+
*/
|
|
557
|
+
class UniDynamicSharedData extends UniSharedData implements IUniDynamicSharedData {
|
|
558
|
+
readonly _bundleKey: string
|
|
559
|
+
readonly _sharedDataClassId: number
|
|
518
560
|
readonly _sharedDataClass: UniDynamicSharedDataClassDefinition
|
|
561
|
+
readonly _dynamicState: UniDynamicSharedDataState
|
|
519
562
|
|
|
520
563
|
constructor(scope: UniSharedDataPage, dynamicOptions: UniDynamicSharedDataInitOptions)
|
|
521
564
|
|
|
522
|
-
|
|
523
|
-
|
|
565
|
+
getField(fieldId: number): UniSharedDataAny
|
|
566
|
+
getFlag(flagGroupId: number): number
|
|
524
567
|
|
|
525
568
|
/**
|
|
526
|
-
*
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
*
|
|
569
|
+
* 仅做类型,动态 sharedData 不支持按 name 写入。
|
|
570
|
+
*/
|
|
571
|
+
_setData(name: string, value: UniSharedDataAny | null): void
|
|
572
|
+
/**
|
|
573
|
+
* 动态渲染始终按 fieldId 写入。
|
|
574
|
+
*/
|
|
575
|
+
_setData(fieldId: number, value: UniSharedDataAny | null): void
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* 对齐静态 sharedData 生命周期。
|
|
531
579
|
*/
|
|
532
|
-
|
|
533
|
-
|
|
580
|
+
_resetFlags(): void
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* 保持和静态渲染一致的 callback 入口。
|
|
584
|
+
*/
|
|
585
|
+
_renderElement(): UniElementBlock
|
|
586
|
+
_renderKotlinElement(): UniElementBlock
|
|
587
|
+
_renderNativeView(): UniNativeViewBlock
|
|
534
588
|
}
|
|
535
589
|
|
|
536
590
|
/**
|
|
537
|
-
* 动态组件
|
|
591
|
+
* 动态组件 root sharedData。
|
|
538
592
|
*
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
* 初始化实例。
|
|
593
|
+
* renderSharedData 会直接 new 该类,
|
|
594
|
+
* 且 sharedDataClassId 固定为 0。
|
|
542
595
|
*/
|
|
543
|
-
|
|
596
|
+
class UniDynamicSharedDataComponent extends UniSharedDataComponent implements IUniDynamicSharedDataComponent {
|
|
544
597
|
readonly _bundleKey: string
|
|
545
598
|
readonly _sharedDataClassId: number
|
|
546
599
|
readonly _sharedDataClass: UniDynamicSharedDataClassDefinition
|
|
600
|
+
readonly _dynamicState: UniDynamicSharedDataState
|
|
547
601
|
|
|
548
602
|
constructor(scope: UniSharedDataPage, options: UniSharedDataComponentOptions, dynamicOptions: UniDynamicSharedDataInitOptions)
|
|
549
603
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
604
|
+
getField(fieldId: number): UniSharedDataAny
|
|
605
|
+
getFlag(flagGroupId: number): number
|
|
606
|
+
getVueId(): number
|
|
607
|
+
getFlatten(): UniSharedDataComponentFlatten
|
|
608
|
+
getRenderer(): UniSharedDataComponentRenderer
|
|
609
|
+
/**
|
|
610
|
+
* 仅做类型,动态 sharedData 不支持按 name 写入。
|
|
611
|
+
*/
|
|
612
|
+
_setData(name: string, value: UniSharedDataAny | null): void
|
|
613
|
+
/**
|
|
614
|
+
* 动态渲染始终按 fieldId 写入。
|
|
615
|
+
*/
|
|
616
|
+
_setData(fieldId: number, value: UniSharedDataAny | null): void
|
|
617
|
+
|
|
618
|
+
_resetFlags(): void
|
|
619
|
+
|
|
620
|
+
_renderElement(): UniElementBlock
|
|
621
|
+
_renderKotlinElement(): UniElementBlock
|
|
622
|
+
_renderNativeView(): UniNativeViewBlock
|
|
557
623
|
}
|
|
558
624
|
|
|
559
625
|
/**
|
|
560
|
-
* 动态页面
|
|
626
|
+
* 动态页面 root sharedData。
|
|
561
627
|
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
* 初始化实例。
|
|
628
|
+
* renderSharedData 会直接 new 该类,
|
|
629
|
+
* 且 sharedDataClassId 固定为 0。
|
|
565
630
|
*/
|
|
566
|
-
|
|
631
|
+
class UniDynamicSharedDataPage extends UniSharedDataPage implements IUniDynamicSharedDataPage {
|
|
567
632
|
readonly _bundleKey: string
|
|
568
633
|
readonly _sharedDataClassId: number
|
|
569
634
|
readonly _sharedDataClass: UniDynamicSharedDataClassDefinition
|
|
635
|
+
readonly _dynamicState: UniDynamicSharedDataState
|
|
570
636
|
|
|
571
637
|
constructor(pageIdOrScope: number | UniSharedDataPage, options: UniSharedDataComponentOptions, dynamicOptions: UniDynamicSharedDataInitOptions)
|
|
572
638
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
639
|
+
getField(fieldId: number): UniSharedDataAny
|
|
640
|
+
getFlag(flagGroupId: number): number
|
|
641
|
+
getVueId(): number
|
|
642
|
+
getFlatten(): UniSharedDataComponentFlatten
|
|
643
|
+
getRenderer(): UniSharedDataComponentRenderer
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* 仅做类型,动态 sharedData 不支持按 name 写入。
|
|
647
|
+
*/
|
|
648
|
+
_setData(name: string, value: UniSharedDataAny | null): void
|
|
649
|
+
/**
|
|
650
|
+
* 动态渲染始终按 fieldId 写入。
|
|
651
|
+
*/
|
|
652
|
+
_setData(fieldId: number, value: UniSharedDataAny | null): void
|
|
653
|
+
_resetFlags(): void
|
|
654
|
+
|
|
655
|
+
_renderElement(): UniElementBlock
|
|
656
|
+
_renderKotlinElement(): UniElementBlock
|
|
657
|
+
_renderNativeView(): UniNativeViewBlock
|
|
580
658
|
}
|
|
581
659
|
}
|
|
582
660
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
UniEditorElementOptions as UniEditorElementOptionsOrigin,
|
|
7
7
|
UniEditorElementInsertImageOptions as UniEditorElementInsertImageOptionsOrigin,
|
|
8
8
|
UniEditorElementInsertTextOptions as UniEditorElementInsertTextOptionsOrigin,
|
|
9
|
+
UniEditorElementInsertMentionOptions as UniEditorElementInsertMentionOptionsOrigin,
|
|
9
10
|
UniEditorElementSetContentsOptions as UniEditorElementSetContentsOptionsOrigin,
|
|
10
11
|
UniEditorElementGetSelectionTextOptionsRes as UniEditorElementGetSelectionTextOptionsResOrigin,
|
|
11
12
|
UniEditorElementGetSelectionTextOptions as UniEditorElementGetSelectionTextOptionsOrigin,
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
type UniEditorElementOptions = UniEditorElementOptionsOrigin
|
|
26
27
|
type UniEditorElementInsertImageOptions = UniEditorElementInsertImageOptionsOrigin
|
|
27
28
|
type UniEditorElementInsertTextOptions = UniEditorElementInsertTextOptionsOrigin
|
|
29
|
+
type UniEditorElementInsertMentionOptions = UniEditorElementInsertMentionOptionsOrigin
|
|
28
30
|
type UniEditorElementSetContentsOptions = UniEditorElementSetContentsOptionsOrigin
|
|
29
31
|
type UniEditorElementGetSelectionTextOptionsRes = UniEditorElementGetSelectionTextOptionsResOrigin
|
|
30
32
|
type UniEditorElementGetSelectionTextOptions = UniEditorElementGetSelectionTextOptionsOrigin
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
UniEditorElementOptions,
|
|
7
7
|
UniEditorElementInsertImageOptions,
|
|
8
8
|
UniEditorElementInsertTextOptions,
|
|
9
|
+
UniEditorElementInsertMentionOptions,
|
|
9
10
|
UniEditorElementSetContentsOptions,
|
|
10
11
|
UniEditorElementGetSelectionTextOptionsRes,
|
|
11
12
|
UniEditorElementGetSelectionTextOptions,
|
|
@@ -33,6 +33,35 @@ export type UniEditorElementInsertTextOptions = {
|
|
|
33
33
|
complete ?: ((res : UniEditorElementOptionsCompleteRes) => void) | null
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
export type UniEditorElementInsertMentionOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* 被 @ 的人 id
|
|
39
|
+
*/
|
|
40
|
+
id ?: string | null,
|
|
41
|
+
/**
|
|
42
|
+
* 被 @ 的人名字
|
|
43
|
+
*/
|
|
44
|
+
name?: string | null,
|
|
45
|
+
/**
|
|
46
|
+
* 提及文本颜色,默认为 #1677ff
|
|
47
|
+
* @defaultValue #1677ff
|
|
48
|
+
*/
|
|
49
|
+
color?: string | null,
|
|
50
|
+
/**
|
|
51
|
+
* 提及背景颜色,默认为 #e6f3ff
|
|
52
|
+
* @defaultValue #e6f3ff
|
|
53
|
+
*/
|
|
54
|
+
background?: string | null,
|
|
55
|
+
/**
|
|
56
|
+
* 提及圆角,默认为 4px
|
|
57
|
+
* @defaultValue 4px
|
|
58
|
+
*/
|
|
59
|
+
radius?: string | null,
|
|
60
|
+
success ?: ((res : UniEditorElementOptionsSuccessRes) => void) | null
|
|
61
|
+
fail ?: ((res : UniEditorElementOptionsFailRes) => void) | null
|
|
62
|
+
complete ?: ((res : UniEditorElementOptionsCompleteRes) => void) | null
|
|
63
|
+
}
|
|
64
|
+
|
|
36
65
|
export type UniEditorElementSetContentsOptions = {
|
|
37
66
|
delta ?: any | null,
|
|
38
67
|
html ?: string | null,
|
|
@@ -70,6 +99,7 @@ export interface IUniEditorElement extends UniElement {
|
|
|
70
99
|
insertDivider(options : UniEditorElementOptions | null) : void
|
|
71
100
|
insertImage(options : UniEditorElementInsertImageOptions | null) : void
|
|
72
101
|
insertText(options : UniEditorElementInsertTextOptions | null) : void
|
|
102
|
+
insertMention(options ?: UniEditorElementInsertMentionOptions | null) : void
|
|
73
103
|
setContents(options : UniEditorElementSetContentsOptions | null) : void
|
|
74
104
|
getContents(options : UniEditorElementGetContentsOptions | null) : void
|
|
75
105
|
clear(options : UniEditorElementOptions | null) : void
|
|
@@ -554,6 +584,30 @@ export interface EditorContext {
|
|
|
554
584
|
* }
|
|
555
585
|
*/
|
|
556
586
|
insertText(options ?: UniEditorElementInsertTextOptions | null) : void
|
|
587
|
+
/**
|
|
588
|
+
* 插入可整块删除的提及,提及文本默认为 @名字,当选区存在时覆盖选区文本,当选区不存在时插入到光标处
|
|
589
|
+
* @uniPlatform {
|
|
590
|
+
* "app": {
|
|
591
|
+
* "android": {
|
|
592
|
+
* "osVer": "4.4",
|
|
593
|
+
* "uniVer": "x",
|
|
594
|
+
* "unixVer": "5.04"
|
|
595
|
+
* },
|
|
596
|
+
* "ios": {
|
|
597
|
+
* "osVer": "12.0",
|
|
598
|
+
* "uniVer": "x",
|
|
599
|
+
* "unixVer": "5.04"
|
|
600
|
+
* },
|
|
601
|
+
* "harmony": {
|
|
602
|
+
* "osVer": "√",
|
|
603
|
+
* "uniVer": "x",
|
|
604
|
+
* "unixVer": "5.04",
|
|
605
|
+
* "unixVaporVer": "5.04"
|
|
606
|
+
* }
|
|
607
|
+
* },
|
|
608
|
+
* }
|
|
609
|
+
*/
|
|
610
|
+
insertMention(options ?: UniEditorElementInsertMentionOptions | null) : void
|
|
557
611
|
/**
|
|
558
612
|
* 初始化编辑器内容,html和delta同时存在时仅delta生效
|
|
559
613
|
* @uniPlatform {
|
|
@@ -771,8 +825,8 @@ export interface EditorContext {
|
|
|
771
825
|
*/
|
|
772
826
|
blur(options ?: UniEditorElementOptions | null) : void
|
|
773
827
|
}
|
|
774
|
-
|
|
775
|
-
export type CreateEditorContextAsync = (options: CreateEditorContextAsyncOptions) => void
|
|
828
|
+
|
|
829
|
+
export type CreateEditorContextAsync = (options: CreateEditorContextAsyncOptions) => void
|
|
776
830
|
|
|
777
831
|
export interface Uni {
|
|
778
832
|
/**
|
|
@@ -852,4 +906,4 @@ export interface Uni {
|
|
|
852
906
|
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/create-editor-context-async.html
|
|
853
907
|
*/
|
|
854
908
|
createEditorContextAsync : CreateEditorContextAsync
|
|
855
|
-
}
|
|
909
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
UniEditorElementOptions as UniEditorElementOptionsOrigin,
|
|
7
7
|
UniEditorElementInsertImageOptions as UniEditorElementInsertImageOptionsOrigin,
|
|
8
8
|
UniEditorElementInsertTextOptions as UniEditorElementInsertTextOptionsOrigin,
|
|
9
|
+
UniEditorElementInsertMentionOptions as UniEditorElementInsertMentionOptionsOrigin,
|
|
9
10
|
UniEditorElementSetContentsOptions as UniEditorElementSetContentsOptionsOrigin,
|
|
10
11
|
UniEditorElementGetSelectionTextOptionsRes as UniEditorElementGetSelectionTextOptionsResOrigin,
|
|
11
12
|
UniEditorElementGetSelectionTextOptions as UniEditorElementGetSelectionTextOptionsOrigin,
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
type UniEditorElementOptions = UniEditorElementOptionsOrigin
|
|
26
27
|
type UniEditorElementInsertImageOptions = UniEditorElementInsertImageOptionsOrigin
|
|
27
28
|
type UniEditorElementInsertTextOptions = UniEditorElementInsertTextOptionsOrigin
|
|
29
|
+
type UniEditorElementInsertMentionOptions = UniEditorElementInsertMentionOptionsOrigin
|
|
28
30
|
type UniEditorElementSetContentsOptions = UniEditorElementSetContentsOptionsOrigin
|
|
29
31
|
type UniEditorElementGetSelectionTextOptionsRes = UniEditorElementGetSelectionTextOptionsResOrigin
|
|
30
32
|
type UniEditorElementGetSelectionTextOptions = UniEditorElementGetSelectionTextOptionsOrigin
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
UniEditorElementOptions,
|
|
7
7
|
UniEditorElementInsertImageOptions,
|
|
8
8
|
UniEditorElementInsertTextOptions,
|
|
9
|
+
UniEditorElementInsertMentionOptions,
|
|
9
10
|
UniEditorElementSetContentsOptions,
|
|
10
11
|
UniEditorElementGetSelectionTextOptionsRes,
|
|
11
12
|
UniEditorElementGetSelectionTextOptions,
|
|
@@ -33,6 +33,35 @@ export type UniEditorElementInsertTextOptions = {
|
|
|
33
33
|
complete ?: ((res : UniEditorElementOptionsCompleteRes) => void) | null
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
export type UniEditorElementInsertMentionOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* 被 @ 的人 id
|
|
39
|
+
*/
|
|
40
|
+
id ?: string | null,
|
|
41
|
+
/**
|
|
42
|
+
* 被 @ 的人名字
|
|
43
|
+
*/
|
|
44
|
+
name?: string | null,
|
|
45
|
+
/**
|
|
46
|
+
* 提及文本颜色,默认为 #1677ff
|
|
47
|
+
* @defaultValue #1677ff
|
|
48
|
+
*/
|
|
49
|
+
color?: string | null,
|
|
50
|
+
/**
|
|
51
|
+
* 提及背景颜色,默认为 #e6f3ff
|
|
52
|
+
* @defaultValue #e6f3ff
|
|
53
|
+
*/
|
|
54
|
+
background?: string | null,
|
|
55
|
+
/**
|
|
56
|
+
* 提及圆角,默认为 4px
|
|
57
|
+
* @defaultValue 4px
|
|
58
|
+
*/
|
|
59
|
+
radius?: string | null,
|
|
60
|
+
success ?: ((res : UniEditorElementOptionsSuccessRes) => void) | null
|
|
61
|
+
fail ?: ((res : UniEditorElementOptionsFailRes) => void) | null
|
|
62
|
+
complete ?: ((res : UniEditorElementOptionsCompleteRes) => void) | null
|
|
63
|
+
}
|
|
64
|
+
|
|
36
65
|
export type UniEditorElementSetContentsOptions = {
|
|
37
66
|
delta ?: any | null,
|
|
38
67
|
html ?: string | null,
|
|
@@ -70,6 +99,7 @@ export interface IUniEditorElement extends UniElement {
|
|
|
70
99
|
insertDivider(options : UniEditorElementOptions | null) : void
|
|
71
100
|
insertImage(options : UniEditorElementInsertImageOptions | null) : void
|
|
72
101
|
insertText(options : UniEditorElementInsertTextOptions | null) : void
|
|
102
|
+
insertMention(options ?: UniEditorElementInsertMentionOptions | null) : void
|
|
73
103
|
setContents(options : UniEditorElementSetContentsOptions | null) : void
|
|
74
104
|
getContents(options : UniEditorElementGetContentsOptions | null) : void
|
|
75
105
|
clear(options : UniEditorElementOptions | null) : void
|
|
@@ -554,6 +584,30 @@ export interface EditorContext {
|
|
|
554
584
|
* }
|
|
555
585
|
*/
|
|
556
586
|
insertText(options ?: UniEditorElementInsertTextOptions | null) : void
|
|
587
|
+
/**
|
|
588
|
+
* 插入可整块删除的提及,提及文本默认为 @名字,当选区存在时覆盖选区文本,当选区不存在时插入到光标处
|
|
589
|
+
* @uniPlatform {
|
|
590
|
+
* "app": {
|
|
591
|
+
* "android": {
|
|
592
|
+
* "osVer": "4.4",
|
|
593
|
+
* "uniVer": "x",
|
|
594
|
+
* "unixVer": "5.04"
|
|
595
|
+
* },
|
|
596
|
+
* "ios": {
|
|
597
|
+
* "osVer": "12.0",
|
|
598
|
+
* "uniVer": "x",
|
|
599
|
+
* "unixVer": "5.04"
|
|
600
|
+
* },
|
|
601
|
+
* "harmony": {
|
|
602
|
+
* "osVer": "√",
|
|
603
|
+
* "uniVer": "x",
|
|
604
|
+
* "unixVer": "5.04",
|
|
605
|
+
* "unixVaporVer": "5.04"
|
|
606
|
+
* }
|
|
607
|
+
* },
|
|
608
|
+
* }
|
|
609
|
+
*/
|
|
610
|
+
insertMention(options ?: UniEditorElementInsertMentionOptions | null) : void
|
|
557
611
|
/**
|
|
558
612
|
* 初始化编辑器内容,html和delta同时存在时仅delta生效
|
|
559
613
|
* @uniPlatform {
|
|
@@ -771,8 +825,8 @@ export interface EditorContext {
|
|
|
771
825
|
*/
|
|
772
826
|
blur(options ?: UniEditorElementOptions | null) : void
|
|
773
827
|
}
|
|
774
|
-
|
|
775
|
-
export type CreateEditorContextAsync = (options: CreateEditorContextAsyncOptions) => void
|
|
828
|
+
|
|
829
|
+
export type CreateEditorContextAsync = (options: CreateEditorContextAsyncOptions) => void
|
|
776
830
|
|
|
777
831
|
export interface Uni {
|
|
778
832
|
/**
|
|
@@ -852,4 +906,4 @@ export interface Uni {
|
|
|
852
906
|
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/create-editor-context-async.html
|
|
853
907
|
*/
|
|
854
908
|
createEditorContextAsync : CreateEditorContextAsync
|
|
855
|
-
}
|
|
909
|
+
}
|