@vunk/plus 1.3.11 → 1.3.13
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/components/SharedSystems.mjs +3195 -0
- package/components/WebGLRenderer.mjs +3617 -0
- package/components/WebGPURenderer.mjs +2103 -0
- package/components/_commonjsHelpers.mjs +7 -0
- package/components/agent-chat-provider/src/types.d.ts +2 -1
- package/components/broadcasting-markdown/index.d.ts +2 -0
- package/components/broadcasting-markdown/index.mjs +238 -306
- package/components/broadcasting-markdown/src/const.d.ts +2 -7
- package/components/broadcasting-markdown/src/ctx.d.ts +28 -15
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +24 -44
- package/components/broadcasting-markdown/src/index.vue.d.ts +31 -167
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +1 -14
- package/components/broadcasting-markdown/src/types.d.ts +10 -2
- package/components/broadcasting-markdown/src/use.d.ts +18 -0
- package/components/browserAll.mjs +3187 -0
- package/components/bubble-list/index.mjs +2 -1
- package/components/bubble-list/src/index.vue.d.ts +27 -161
- package/components/bubble-templates/src/index.vue.d.ts +27 -161
- package/components/bubble-templates/src/types.d.ts +6 -0
- package/components/chat-independent/index.mjs +3 -0
- package/components/chat-independent/src/index.vue.d.ts +27 -161
- package/components/colorToUniform.mjs +266 -0
- package/components/index2.mjs +21220 -0
- package/components/init.mjs +3779 -0
- package/components/pixi-frame/index.css +4 -0
- package/components/pixi-frame/index.d.ts +8 -0
- package/components/pixi-frame/index.mjs +6 -0
- package/components/pixi-frame/src/core.vue.d.ts +122 -0
- package/components/pixi-frame/src/ctx.d.ts +40 -0
- package/components/pixi-frame/src/index.vue.d.ts +215 -0
- package/components/pixi-frame/src/provider.vue.d.ts +2 -0
- package/components/pixi-frame/src/types.d.ts +1 -0
- package/components/pixi-frame/src/use.d.ts +3 -0
- package/components/pixi-frame/src/view.vue.d.ts +25 -0
- package/components/tables-v1/src/ctx.d.ts +1 -1
- package/components/tables-v1/src/el-ctx.d.ts +1 -1
- package/components/tables-v1-checkbox/src/ctx.d.ts +1 -1
- package/components/tables-v1-checkbox/src/index.vue.d.ts +1 -1
- package/components/webworkerAll.mjs +8 -0
- package/index.css +5 -4
- package/package.json +8 -4
- package/components/broadcasting-markdown/index.css +0 -3
- package/components/broadcasting-markdown/src/custom-speech.vue.d.ts +0 -117
- package/components/broadcasting-markdown/src/web-speech.vue.d.ts +0 -110
|
@@ -443,22 +443,18 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
443
443
|
};
|
|
444
444
|
default: () => string[];
|
|
445
445
|
};
|
|
446
|
-
pause: {
|
|
447
|
-
type: BooleanConstructor;
|
|
448
|
-
default: boolean;
|
|
449
|
-
};
|
|
450
446
|
keepRead: {
|
|
451
447
|
type: BooleanConstructor;
|
|
452
448
|
default: boolean;
|
|
453
449
|
};
|
|
454
|
-
webSpeech: {
|
|
455
|
-
type: BooleanConstructor;
|
|
456
|
-
default: boolean;
|
|
457
|
-
};
|
|
458
450
|
textToSpeech: {
|
|
459
451
|
type: import("vue").PropType<import("./types").TextToSpeech>;
|
|
460
452
|
default: undefined;
|
|
461
453
|
};
|
|
454
|
+
processing: {
|
|
455
|
+
type: import("vue").PropType<(paragraph: import("../../broadcasting-markdown/src/types").Paragraph) => void>;
|
|
456
|
+
default: import("@vunk/shared").AnyFunc;
|
|
457
|
+
};
|
|
462
458
|
}>, {
|
|
463
459
|
theData: import("vue").ComputedRef<import("../../broadcasting-markdown/src/types").Paragraph[]>;
|
|
464
460
|
ParagraphStatus: typeof import("../../broadcasting-markdown").ParagraphStatus;
|
|
@@ -466,13 +462,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
466
462
|
isPrevParagraphFulfilled: (currentIndex: number) => boolean;
|
|
467
463
|
isParagraphEnabled: (currentIndex: number) => boolean;
|
|
468
464
|
processingParagraph: (paragraph: import("../../broadcasting-markdown/src/types").Paragraph) => Promise<void> | undefined;
|
|
469
|
-
|
|
465
|
+
isInterrupted: import("vue").Ref<boolean, boolean>;
|
|
466
|
+
setData: (obj: any, e: import("@vunk/core").SetDataEvent) => void;
|
|
467
|
+
Broadcast: typeof import("@vunk/shared/enum").TickerStatus;
|
|
468
|
+
isPaused: import("vue").ComputedRef<boolean>;
|
|
470
469
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
471
470
|
setData: (e: import("@vunk/core").SetDataEvent) => import("@vunk/core").SetDataEvent;
|
|
472
471
|
interrupt: null;
|
|
473
472
|
'update:broadcasting': (_: boolean) => boolean;
|
|
474
473
|
'update:completed': (_: boolean) => boolean;
|
|
475
474
|
'update:error': (_: boolean) => boolean;
|
|
475
|
+
paragraphLoad: (_: import("../../broadcasting-markdown/src/types").ParagraphLoadEvent) => boolean;
|
|
476
476
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
477
477
|
render: {
|
|
478
478
|
type: import("vue").PropType<(text: string) => string>;
|
|
@@ -520,37 +520,33 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
520
520
|
};
|
|
521
521
|
default: () => string[];
|
|
522
522
|
};
|
|
523
|
-
pause: {
|
|
524
|
-
type: BooleanConstructor;
|
|
525
|
-
default: boolean;
|
|
526
|
-
};
|
|
527
523
|
keepRead: {
|
|
528
524
|
type: BooleanConstructor;
|
|
529
525
|
default: boolean;
|
|
530
526
|
};
|
|
531
|
-
webSpeech: {
|
|
532
|
-
type: BooleanConstructor;
|
|
533
|
-
default: boolean;
|
|
534
|
-
};
|
|
535
527
|
textToSpeech: {
|
|
536
528
|
type: import("vue").PropType<import("./types").TextToSpeech>;
|
|
537
529
|
default: undefined;
|
|
538
530
|
};
|
|
531
|
+
processing: {
|
|
532
|
+
type: import("vue").PropType<(paragraph: import("../../broadcasting-markdown/src/types").Paragraph) => void>;
|
|
533
|
+
default: import("@vunk/shared").AnyFunc;
|
|
534
|
+
};
|
|
539
535
|
}>> & Readonly<{
|
|
540
536
|
onSetData?: ((e: import("@vunk/core").SetDataEvent) => any) | undefined;
|
|
541
537
|
onInterrupt?: ((...args: any[]) => any) | undefined;
|
|
542
538
|
"onUpdate:broadcasting"?: ((_: boolean) => any) | undefined;
|
|
543
539
|
"onUpdate:completed"?: ((_: boolean) => any) | undefined;
|
|
544
540
|
"onUpdate:error"?: ((_: boolean) => any) | undefined;
|
|
541
|
+
onParagraphLoad?: ((_: import("../../broadcasting-markdown/src/types").ParagraphLoadEvent) => any) | undefined;
|
|
545
542
|
}>, {
|
|
543
|
+
processing: (paragraph: import("../../broadcasting-markdown/src/types").Paragraph) => void;
|
|
546
544
|
source: string;
|
|
547
545
|
delay: number;
|
|
548
|
-
pause: boolean;
|
|
549
546
|
render: (text: string) => string;
|
|
550
547
|
data: import("../../broadcasting-markdown/src/types").Paragraph[];
|
|
551
548
|
separators: string[];
|
|
552
549
|
keepRead: boolean;
|
|
553
|
-
webSpeech: boolean;
|
|
554
550
|
textToSpeech: import("./types").TextToSpeech;
|
|
555
551
|
}, {}, {
|
|
556
552
|
ParagraphView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -562,10 +558,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
562
558
|
type: import("vue").PropType<import("../../broadcasting-markdown").ParagraphStatus>;
|
|
563
559
|
default: import("../../broadcasting-markdown").ParagraphStatus;
|
|
564
560
|
};
|
|
565
|
-
pause: {
|
|
566
|
-
type: BooleanConstructor;
|
|
567
|
-
default: boolean;
|
|
568
|
-
};
|
|
569
561
|
processing: {
|
|
570
562
|
type: import("vue").PropType<import("@vunk/shared").AnyFunc>;
|
|
571
563
|
default: import("@vunk/shared").AnyFunc;
|
|
@@ -584,10 +576,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
584
576
|
type: import("vue").PropType<import("../../broadcasting-markdown").ParagraphStatus>;
|
|
585
577
|
default: import("../../broadcasting-markdown").ParagraphStatus;
|
|
586
578
|
};
|
|
587
|
-
pause: {
|
|
588
|
-
type: BooleanConstructor;
|
|
589
|
-
default: boolean;
|
|
590
|
-
};
|
|
591
579
|
processing: {
|
|
592
580
|
type: import("vue").PropType<import("@vunk/shared").AnyFunc>;
|
|
593
581
|
default: import("@vunk/shared").AnyFunc;
|
|
@@ -619,10 +607,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
619
607
|
type: import("vue").PropType<import("../../broadcasting-markdown").ParagraphStatus>;
|
|
620
608
|
default: import("../../broadcasting-markdown").ParagraphStatus;
|
|
621
609
|
};
|
|
622
|
-
pause: {
|
|
623
|
-
type: BooleanConstructor;
|
|
624
|
-
default: boolean;
|
|
625
|
-
};
|
|
626
610
|
processing: {
|
|
627
611
|
type: import("vue").PropType<import("@vunk/shared").AnyFunc>;
|
|
628
612
|
default: import("@vunk/shared").AnyFunc;
|
|
@@ -635,9 +619,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
635
619
|
"onUpdate:status"?: ((...args: any[]) => any) | undefined;
|
|
636
620
|
}>, {
|
|
637
621
|
processing: import("@vunk/shared").AnyFunc;
|
|
638
|
-
pause: boolean;
|
|
639
|
-
enable: boolean;
|
|
640
622
|
status: import("../../broadcasting-markdown").ParagraphStatus;
|
|
623
|
+
enable: boolean;
|
|
641
624
|
retryTimes: number;
|
|
642
625
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
643
626
|
VkTypingMarkdown: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -696,112 +679,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
696
679
|
disabled: boolean;
|
|
697
680
|
markdownItSetup: (md: import("markdown-it-async").MarkdownItAsync) => void;
|
|
698
681
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
699
|
-
WebSpeechView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
700
|
-
voice: {
|
|
701
|
-
type: import("vue").PropType<SpeechSynthesisVoice>;
|
|
702
|
-
required: false;
|
|
703
|
-
};
|
|
704
|
-
data: {
|
|
705
|
-
type: import("vue").PropType<import("../../broadcasting-markdown/src/types").Paragraph>;
|
|
706
|
-
default: () => {};
|
|
707
|
-
};
|
|
708
|
-
deferred: {
|
|
709
|
-
type: import("vue").PropType<import("@vunk/shared/promise").Deferred<any>>;
|
|
710
|
-
required: true;
|
|
711
|
-
};
|
|
712
|
-
pause: {
|
|
713
|
-
type: BooleanConstructor;
|
|
714
|
-
default: boolean;
|
|
715
|
-
};
|
|
716
|
-
render: {
|
|
717
|
-
type: import("vue").PropType<(text: string) => string>;
|
|
718
|
-
required: true;
|
|
719
|
-
};
|
|
720
|
-
}>, (() => null) | (() => false | JSX.Element), {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
721
|
-
voice: {
|
|
722
|
-
type: import("vue").PropType<SpeechSynthesisVoice>;
|
|
723
|
-
required: false;
|
|
724
|
-
};
|
|
725
|
-
data: {
|
|
726
|
-
type: import("vue").PropType<import("../../broadcasting-markdown/src/types").Paragraph>;
|
|
727
|
-
default: () => {};
|
|
728
|
-
};
|
|
729
|
-
deferred: {
|
|
730
|
-
type: import("vue").PropType<import("@vunk/shared/promise").Deferred<any>>;
|
|
731
|
-
required: true;
|
|
732
|
-
};
|
|
733
|
-
pause: {
|
|
734
|
-
type: BooleanConstructor;
|
|
735
|
-
default: boolean;
|
|
736
|
-
};
|
|
737
|
-
render: {
|
|
738
|
-
type: import("vue").PropType<(text: string) => string>;
|
|
739
|
-
required: true;
|
|
740
|
-
};
|
|
741
|
-
}>> & Readonly<{}>, {
|
|
742
|
-
pause: boolean;
|
|
743
|
-
data: import("../../broadcasting-markdown/src/types").Paragraph;
|
|
744
|
-
}, {}, {
|
|
745
|
-
SpeechError: import("vue").DefineComponent<{}, {
|
|
746
|
-
readonly CloseBold: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
747
|
-
readonly ElIcon: import("element-plus/es/utils").SFCWithInstall<{
|
|
748
|
-
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
749
|
-
readonly size: {
|
|
750
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
|
|
751
|
-
readonly required: false;
|
|
752
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
753
|
-
__epPropKey: true;
|
|
754
|
-
};
|
|
755
|
-
readonly color: {
|
|
756
|
-
readonly type: import("vue").PropType<string>;
|
|
757
|
-
readonly required: false;
|
|
758
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
759
|
-
__epPropKey: true;
|
|
760
|
-
};
|
|
761
|
-
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
762
|
-
P: {};
|
|
763
|
-
B: {};
|
|
764
|
-
D: {};
|
|
765
|
-
C: {};
|
|
766
|
-
M: {};
|
|
767
|
-
Defaults: {};
|
|
768
|
-
}, Readonly<import("vue").ExtractPropTypes<{
|
|
769
|
-
readonly size: {
|
|
770
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
|
|
771
|
-
readonly required: false;
|
|
772
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
773
|
-
__epPropKey: true;
|
|
774
|
-
};
|
|
775
|
-
readonly color: {
|
|
776
|
-
readonly type: import("vue").PropType<string>;
|
|
777
|
-
readonly required: false;
|
|
778
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
779
|
-
__epPropKey: true;
|
|
780
|
-
};
|
|
781
|
-
}>>, {}, {}, {}, {}, {}>;
|
|
782
|
-
__isFragment?: undefined;
|
|
783
|
-
__isTeleport?: undefined;
|
|
784
|
-
__isSuspense?: undefined;
|
|
785
|
-
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
786
|
-
readonly size: {
|
|
787
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
|
|
788
|
-
readonly required: false;
|
|
789
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
790
|
-
__epPropKey: true;
|
|
791
|
-
};
|
|
792
|
-
readonly color: {
|
|
793
|
-
readonly type: import("vue").PropType<string>;
|
|
794
|
-
readonly required: false;
|
|
795
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
796
|
-
__epPropKey: true;
|
|
797
|
-
};
|
|
798
|
-
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
799
|
-
$slots: {
|
|
800
|
-
default?(_: {}): any;
|
|
801
|
-
};
|
|
802
|
-
})>;
|
|
803
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
804
|
-
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
805
682
|
HowlerSpeechView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
806
683
|
data: {
|
|
807
684
|
type: import("vue").PropType<import("../../broadcasting-markdown/src/types").Paragraph>;
|
|
@@ -811,19 +688,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
811
688
|
type: import("vue").PropType<import("@vunk/shared/promise").Deferred<any>>;
|
|
812
689
|
required: true;
|
|
813
690
|
};
|
|
814
|
-
pause: {
|
|
815
|
-
type: BooleanConstructor;
|
|
816
|
-
default: boolean;
|
|
817
|
-
};
|
|
818
|
-
url: {
|
|
819
|
-
type: StringConstructor;
|
|
820
|
-
default: string;
|
|
821
|
-
};
|
|
822
691
|
render: {
|
|
823
692
|
type: import("vue").PropType<(text: string) => string>;
|
|
824
|
-
|
|
693
|
+
default: typeof import("../../broadcasting-markdown").defaultRender;
|
|
825
694
|
};
|
|
826
|
-
}>, (() => null) | (() => JSX.Element), {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
695
|
+
}>, (() => null) | (() => JSX.Element), {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
696
|
+
setData: (e: import("@vunk/core").SetDataEvent<keyof import("../../broadcasting-markdown/src/types").Paragraph>) => import("@vunk/core").SetDataEvent<keyof import("../../broadcasting-markdown/src/types").Paragraph>;
|
|
697
|
+
load: (_: import("../../broadcasting-markdown/src/types").ParagraphLoadEvent) => boolean;
|
|
698
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
827
699
|
data: {
|
|
828
700
|
type: import("vue").PropType<import("../../broadcasting-markdown/src/types").Paragraph>;
|
|
829
701
|
default: () => {};
|
|
@@ -832,22 +704,16 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
832
704
|
type: import("vue").PropType<import("@vunk/shared/promise").Deferred<any>>;
|
|
833
705
|
required: true;
|
|
834
706
|
};
|
|
835
|
-
pause: {
|
|
836
|
-
type: BooleanConstructor;
|
|
837
|
-
default: boolean;
|
|
838
|
-
};
|
|
839
|
-
url: {
|
|
840
|
-
type: StringConstructor;
|
|
841
|
-
default: string;
|
|
842
|
-
};
|
|
843
707
|
render: {
|
|
844
708
|
type: import("vue").PropType<(text: string) => string>;
|
|
845
|
-
|
|
709
|
+
default: typeof import("../../broadcasting-markdown").defaultRender;
|
|
846
710
|
};
|
|
847
|
-
}>> & Readonly<{
|
|
848
|
-
|
|
711
|
+
}>> & Readonly<{
|
|
712
|
+
onSetData?: ((e: import("@vunk/core").SetDataEvent<keyof import("../../broadcasting-markdown/src/types").Paragraph>) => any) | undefined;
|
|
713
|
+
onLoad?: ((_: import("../../broadcasting-markdown/src/types").ParagraphLoadEvent) => any) | undefined;
|
|
714
|
+
}>, {
|
|
715
|
+
render: (text: string) => string;
|
|
849
716
|
data: import("../../broadcasting-markdown/src/types").Paragraph;
|
|
850
|
-
url: string;
|
|
851
717
|
}, {}, {
|
|
852
718
|
SpeechError: import("vue").DefineComponent<{}, {
|
|
853
719
|
readonly CloseBold: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
const blendModeIds = {
|
|
2
|
+
normal: 0,
|
|
3
|
+
add: 1,
|
|
4
|
+
multiply: 2,
|
|
5
|
+
screen: 3,
|
|
6
|
+
overlay: 4,
|
|
7
|
+
erase: 5,
|
|
8
|
+
"normal-npm": 6,
|
|
9
|
+
"add-npm": 7,
|
|
10
|
+
"screen-npm": 8,
|
|
11
|
+
min: 9,
|
|
12
|
+
max: 10
|
|
13
|
+
};
|
|
14
|
+
const BLEND = 0;
|
|
15
|
+
const OFFSET = 1;
|
|
16
|
+
const CULLING = 2;
|
|
17
|
+
const DEPTH_TEST = 3;
|
|
18
|
+
const WINDING = 4;
|
|
19
|
+
const DEPTH_MASK = 5;
|
|
20
|
+
const _State = class _State {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.data = 0;
|
|
23
|
+
this.blendMode = "normal";
|
|
24
|
+
this.polygonOffset = 0;
|
|
25
|
+
this.blend = true;
|
|
26
|
+
this.depthMask = true;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Activates blending of the computed fragment color values.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
get blend() {
|
|
33
|
+
return !!(this.data & 1 << BLEND);
|
|
34
|
+
}
|
|
35
|
+
set blend(value) {
|
|
36
|
+
if (!!(this.data & 1 << BLEND) !== value) {
|
|
37
|
+
this.data ^= 1 << BLEND;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Activates adding an offset to depth values of polygon's fragments
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
get offsets() {
|
|
45
|
+
return !!(this.data & 1 << OFFSET);
|
|
46
|
+
}
|
|
47
|
+
set offsets(value) {
|
|
48
|
+
if (!!(this.data & 1 << OFFSET) !== value) {
|
|
49
|
+
this.data ^= 1 << OFFSET;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** The culling settings for this state none - No culling back - Back face culling front - Front face culling */
|
|
53
|
+
set cullMode(value) {
|
|
54
|
+
if (value === "none") {
|
|
55
|
+
this.culling = false;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.culling = true;
|
|
59
|
+
this.clockwiseFrontFace = value === "front";
|
|
60
|
+
}
|
|
61
|
+
get cullMode() {
|
|
62
|
+
if (!this.culling) {
|
|
63
|
+
return "none";
|
|
64
|
+
}
|
|
65
|
+
return this.clockwiseFrontFace ? "front" : "back";
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Activates culling of polygons.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
get culling() {
|
|
72
|
+
return !!(this.data & 1 << CULLING);
|
|
73
|
+
}
|
|
74
|
+
set culling(value) {
|
|
75
|
+
if (!!(this.data & 1 << CULLING) !== value) {
|
|
76
|
+
this.data ^= 1 << CULLING;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Activates depth comparisons and updates to the depth buffer.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
get depthTest() {
|
|
84
|
+
return !!(this.data & 1 << DEPTH_TEST);
|
|
85
|
+
}
|
|
86
|
+
set depthTest(value) {
|
|
87
|
+
if (!!(this.data & 1 << DEPTH_TEST) !== value) {
|
|
88
|
+
this.data ^= 1 << DEPTH_TEST;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Enables or disables writing to the depth buffer.
|
|
93
|
+
* @default true
|
|
94
|
+
*/
|
|
95
|
+
get depthMask() {
|
|
96
|
+
return !!(this.data & 1 << DEPTH_MASK);
|
|
97
|
+
}
|
|
98
|
+
set depthMask(value) {
|
|
99
|
+
if (!!(this.data & 1 << DEPTH_MASK) !== value) {
|
|
100
|
+
this.data ^= 1 << DEPTH_MASK;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Specifies whether or not front or back-facing polygons can be culled.
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
get clockwiseFrontFace() {
|
|
108
|
+
return !!(this.data & 1 << WINDING);
|
|
109
|
+
}
|
|
110
|
+
set clockwiseFrontFace(value) {
|
|
111
|
+
if (!!(this.data & 1 << WINDING) !== value) {
|
|
112
|
+
this.data ^= 1 << WINDING;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The blend mode to be applied when this state is set. Apply a value of `normal` to reset the blend mode.
|
|
117
|
+
* Setting this mode to anything other than NO_BLEND will automatically switch blending on.
|
|
118
|
+
* @default 'normal'
|
|
119
|
+
*/
|
|
120
|
+
get blendMode() {
|
|
121
|
+
return this._blendMode;
|
|
122
|
+
}
|
|
123
|
+
set blendMode(value) {
|
|
124
|
+
this.blend = value !== "none";
|
|
125
|
+
this._blendMode = value;
|
|
126
|
+
this._blendModeId = blendModeIds[value] || 0;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.
|
|
130
|
+
* @default 0
|
|
131
|
+
*/
|
|
132
|
+
get polygonOffset() {
|
|
133
|
+
return this._polygonOffset;
|
|
134
|
+
}
|
|
135
|
+
set polygonOffset(value) {
|
|
136
|
+
this.offsets = !!value;
|
|
137
|
+
this._polygonOffset = value;
|
|
138
|
+
}
|
|
139
|
+
toString() {
|
|
140
|
+
return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A quickly getting an instance of a State that is configured for 2d rendering.
|
|
144
|
+
* @returns a new State with values set for 2d rendering
|
|
145
|
+
*/
|
|
146
|
+
static for2d() {
|
|
147
|
+
const state = new _State();
|
|
148
|
+
state.depthTest = false;
|
|
149
|
+
state.blend = true;
|
|
150
|
+
return state;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
_State.default2d = _State.for2d();
|
|
154
|
+
let State = _State;
|
|
155
|
+
|
|
156
|
+
const localUniformBit = {
|
|
157
|
+
name: "local-uniform-bit",
|
|
158
|
+
vertex: {
|
|
159
|
+
header: (
|
|
160
|
+
/* wgsl */
|
|
161
|
+
`
|
|
162
|
+
|
|
163
|
+
struct LocalUniforms {
|
|
164
|
+
uTransformMatrix:mat3x3<f32>,
|
|
165
|
+
uColor:vec4<f32>,
|
|
166
|
+
uRound:f32,
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
170
|
+
`
|
|
171
|
+
),
|
|
172
|
+
main: (
|
|
173
|
+
/* wgsl */
|
|
174
|
+
`
|
|
175
|
+
vColor *= localUniforms.uColor;
|
|
176
|
+
modelMatrix *= localUniforms.uTransformMatrix;
|
|
177
|
+
`
|
|
178
|
+
),
|
|
179
|
+
end: (
|
|
180
|
+
/* wgsl */
|
|
181
|
+
`
|
|
182
|
+
if(localUniforms.uRound == 1)
|
|
183
|
+
{
|
|
184
|
+
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
185
|
+
}
|
|
186
|
+
`
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
const localUniformBitGroup2 = {
|
|
191
|
+
...localUniformBit,
|
|
192
|
+
vertex: {
|
|
193
|
+
...localUniformBit.vertex,
|
|
194
|
+
// replace the group!
|
|
195
|
+
header: localUniformBit.vertex.header.replace("group(1)", "group(2)")
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const localUniformBitGl = {
|
|
199
|
+
name: "local-uniform-bit",
|
|
200
|
+
vertex: {
|
|
201
|
+
header: (
|
|
202
|
+
/* glsl */
|
|
203
|
+
`
|
|
204
|
+
|
|
205
|
+
uniform mat3 uTransformMatrix;
|
|
206
|
+
uniform vec4 uColor;
|
|
207
|
+
uniform float uRound;
|
|
208
|
+
`
|
|
209
|
+
),
|
|
210
|
+
main: (
|
|
211
|
+
/* glsl */
|
|
212
|
+
`
|
|
213
|
+
vColor *= uColor;
|
|
214
|
+
modelMatrix = uTransformMatrix;
|
|
215
|
+
`
|
|
216
|
+
),
|
|
217
|
+
end: (
|
|
218
|
+
/* glsl */
|
|
219
|
+
`
|
|
220
|
+
if(uRound == 1.)
|
|
221
|
+
{
|
|
222
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
223
|
+
}
|
|
224
|
+
`
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
class BatchableSprite {
|
|
230
|
+
constructor() {
|
|
231
|
+
this.batcherName = "default";
|
|
232
|
+
this.topology = "triangle-list";
|
|
233
|
+
// batch specific..
|
|
234
|
+
this.attributeSize = 4;
|
|
235
|
+
this.indexSize = 6;
|
|
236
|
+
this.packAsQuad = true;
|
|
237
|
+
this.roundPixels = 0;
|
|
238
|
+
this._attributeStart = 0;
|
|
239
|
+
// location in the buffer
|
|
240
|
+
this._batcher = null;
|
|
241
|
+
this._batch = null;
|
|
242
|
+
}
|
|
243
|
+
get blendMode() {
|
|
244
|
+
return this.renderable.groupBlendMode;
|
|
245
|
+
}
|
|
246
|
+
get color() {
|
|
247
|
+
return this.renderable.groupColorAlpha;
|
|
248
|
+
}
|
|
249
|
+
reset() {
|
|
250
|
+
this.renderable = null;
|
|
251
|
+
this.texture = null;
|
|
252
|
+
this._batcher = null;
|
|
253
|
+
this._batch = null;
|
|
254
|
+
this.bounds = null;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function color32BitToUniform(abgr, out, offset) {
|
|
259
|
+
const alpha = (abgr >> 24 & 255) / 255;
|
|
260
|
+
out[offset++] = (abgr & 255) / 255 * alpha;
|
|
261
|
+
out[offset++] = (abgr >> 8 & 255) / 255 * alpha;
|
|
262
|
+
out[offset++] = (abgr >> 16 & 255) / 255 * alpha;
|
|
263
|
+
out[offset++] = alpha;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export { BatchableSprite as B, State as S, localUniformBit as a, localUniformBitGl as b, color32BitToUniform as c, localUniformBitGroup2 as l };
|