@vunk/plus 1.13.1 → 1.15.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.
- package/ant/_util/BaseInput.d.ts +56 -0
- package/ant/_util/BaseInputInner.d.ts +65 -0
- package/ant/_util/BaseMixin.d.ts +7 -0
- package/ant/_util/EventInterface.d.ts +18 -0
- package/ant/_util/KeyCode.d.ts +436 -0
- package/ant/_util/Portal.d.ts +14 -0
- package/ant/_util/PortalWrapper.d.ts +41 -0
- package/ant/_util/canUseDom.d.ts +2 -0
- package/ant/_util/classNames.d.ts +2 -0
- package/ant/_util/collapseMotion.d.ts +3 -0
- package/ant/_util/colors.d.ts +13 -0
- package/ant/_util/copy-to-clipboard/index.d.ts +8 -0
- package/ant/_util/copy-to-clipboard/toggle-selection.d.ts +2 -0
- package/ant/_util/createContext.d.ts +5 -0
- package/ant/_util/createRef.d.ts +10 -0
- package/ant/_util/cssinjs/Cache.d.ts +11 -0
- package/ant/_util/cssinjs/Keyframes.d.ts +9 -0
- package/ant/_util/cssinjs/StyleContext.d.ts +508 -0
- package/ant/_util/cssinjs/hooks/useCacheToken.d.ts +40 -0
- package/ant/_util/cssinjs/hooks/useGlobalCache.d.ts +3 -0
- package/ant/_util/cssinjs/hooks/useHMR.d.ts +3 -0
- package/ant/_util/cssinjs/hooks/useStyleRegister/cacheMapUtil.d.ts +14 -0
- package/ant/_util/cssinjs/hooks/useStyleRegister/index.d.ts +68 -0
- package/ant/_util/cssinjs/index.d.ts +195 -0
- package/ant/_util/cssinjs/linters/contentQuotesLinter.d.ts +3 -0
- package/ant/_util/cssinjs/linters/hashedAnimationLinter.d.ts +3 -0
- package/ant/_util/cssinjs/linters/index.d.ts +6 -0
- package/ant/_util/cssinjs/linters/interface.d.ts +8 -0
- package/ant/_util/cssinjs/linters/legacyNotSelectorLinter.d.ts +3 -0
- package/ant/_util/cssinjs/linters/logicalPropertiesLinter.d.ts +3 -0
- package/ant/_util/cssinjs/linters/parentSelectorLinter.d.ts +3 -0
- package/ant/_util/cssinjs/linters/utils.d.ts +2 -0
- package/ant/_util/cssinjs/theme/Theme.d.ts +11 -0
- package/ant/_util/cssinjs/theme/ThemeCache.d.ts +20 -0
- package/ant/_util/cssinjs/theme/createTheme.d.ts +6 -0
- package/ant/_util/cssinjs/theme/index.d.ts +4 -0
- package/ant/_util/cssinjs/theme/interface.d.ts +2 -0
- package/ant/_util/cssinjs/transformers/interface.d.ts +4 -0
- package/ant/_util/cssinjs/transformers/legacyLogicalProperties.d.ts +12 -0
- package/ant/_util/cssinjs/transformers/px2rem.d.ts +20 -0
- package/ant/_util/cssinjs/util.d.ts +8 -0
- package/ant/_util/firstNotUndefined.d.ts +2 -0
- package/ant/_util/gapSize.d.ts +3 -0
- package/ant/_util/getScrollBarSize.d.ts +5 -0
- package/ant/_util/hooks/_vueuse/resolveUnref.d.ts +5 -0
- package/ant/_util/hooks/_vueuse/types.d.ts +114 -0
- package/ant/_util/hooks/_vueuse/unrefElement.d.ts +13 -0
- package/ant/_util/hooks/useBreakpoint.d.ts +4 -0
- package/ant/_util/hooks/useFlexGapSupport.d.ts +2 -0
- package/ant/_util/hooks/useMergedState.d.ts +7 -0
- package/ant/_util/hooks/useRefs.d.ts +7 -0
- package/ant/_util/hooks/useScrollLocker.d.ts +6 -0
- package/ant/_util/hooks/useState.d.ts +2 -0
- package/ant/_util/isValid.d.ts +2 -0
- package/ant/_util/omit.d.ts +2 -0
- package/ant/_util/pickAttrs.d.ts +11 -0
- package/ant/_util/placements.d.ts +65 -0
- package/ant/_util/props-util/index.d.ts +33 -0
- package/ant/_util/props-util/initDefaultProps.d.ts +6 -0
- package/ant/_util/raf.d.ts +5 -0
- package/ant/_util/responsiveObserve.d.ts +21 -0
- package/ant/_util/setStyle.d.ts +12 -0
- package/ant/_util/statusUtils.d.ts +6 -0
- package/ant/_util/styleChecker.d.ts +4 -0
- package/ant/_util/transButton.d.ts +34 -0
- package/ant/_util/transition.d.ts +18 -0
- package/ant/_util/type.d.ts +62 -0
- package/ant/_util/util.d.ts +18 -0
- package/ant/_util/vnode.d.ts +11 -0
- package/ant/_util/vue-types/index.d.ts +12 -0
- package/ant/_util/warning.d.ts +6 -0
- package/ant/_util/wave/WaveEffect.d.ts +6 -0
- package/ant/_util/wave/index.d.ts +13 -0
- package/ant/_util/wave/style.d.ts +6 -0
- package/ant/_util/wave/useWave.d.ts +4 -0
- package/ant/_util/wave/util.d.ts +3 -0
- package/ant/button/LoadingIcon.d.ts +12 -0
- package/ant/button/button-group.d.ts +33 -0
- package/ant/button/button.d.ts +112 -0
- package/ant/button/buttonTypes.d.ts +58 -0
- package/ant/button/index.d.ts +12 -0
- package/ant/button/style/group.d.ts +4 -0
- package/ant/button/style/index.d.ts +10 -0
- package/ant/calendar/style/index.d.ts +21 -0
- package/ant/config-provider/DisabledContext.d.ts +4 -0
- package/ant/config-provider/SizeContext.d.ts +4 -0
- package/ant/config-provider/context.d.ts +208 -0
- package/ant/config-provider/cssVariables.d.ts +3 -0
- package/ant/config-provider/hooks/useConfigInject.d.ts +37 -0
- package/ant/config-provider/hooks/useTheme.d.ts +3 -0
- package/ant/config-provider/index.d.ts +290 -0
- package/ant/config-provider/renderEmpty.d.ts +8 -0
- package/ant/config-provider/style/index.d.ts +3 -0
- package/ant/date-picker/style/index.d.ts +35 -0
- package/ant/empty/empty.d.ts +2 -0
- package/ant/empty/index.d.ts +86 -0
- package/ant/empty/simple.d.ts +2 -0
- package/ant/empty/style/index.d.ts +5 -0
- package/ant/flex/index.d.ts +142 -0
- package/ant/flex/interface.d.ts +36 -0
- package/ant/flex/style/index.d.ts +29 -0
- package/ant/flex/utils.d.ts +6 -0
- package/ant/form/ErrorList.d.ts +21 -0
- package/ant/form/Form.d.ts +772 -0
- package/ant/form/FormItem.d.ts +191 -0
- package/ant/form/FormItemContext.d.ts +32 -0
- package/ant/form/FormItemInput.d.ts +44 -0
- package/ant/form/FormItemLabel.d.ts +19 -0
- package/ant/form/context.d.ts +35 -0
- package/ant/form/index.d.ts +16 -0
- package/ant/form/interface.d.ts +171 -0
- package/ant/form/style/explain.d.ts +4 -0
- package/ant/form/style/index.d.ts +7 -0
- package/ant/form/useForm.d.ts +45 -0
- package/ant/form/utils/asyncUtil.d.ts +2 -0
- package/ant/form/utils/messages.d.ts +47 -0
- package/ant/form/utils/typeUtil.d.ts +1 -0
- package/ant/form/utils/useDebounce.d.ts +2 -0
- package/ant/form/utils/validateUtil.d.ts +6 -0
- package/ant/form/utils/valueUtil.d.ts +15 -0
- package/ant/grid/Col.d.ts +116 -0
- package/ant/grid/Row.d.ts +77 -0
- package/ant/grid/context.d.ts +11 -0
- package/ant/grid/index.d.ts +10 -0
- package/ant/grid/style/index.d.ts +2 -0
- package/ant/image/PreviewGroup.d.ts +37 -0
- package/ant/image/index.d.ts +71 -0
- package/ant/image/style/index.d.ts +21 -0
- package/ant/index.cjs +203 -0
- package/ant/index.d.ts +27 -0
- package/ant/index.mjs +20993 -0
- package/ant/input/ClearableLabeledInput.d.ts +151 -0
- package/ant/input/Group.d.ts +24 -0
- package/ant/input/Input.d.ts +191 -0
- package/ant/input/Password.d.ts +217 -0
- package/ant/input/ResizableTextArea.d.ts +215 -0
- package/ant/input/Search.d.ts +195 -0
- package/ant/input/TextArea.d.ts +217 -0
- package/ant/input/calculateNodeHeight.d.ts +9 -0
- package/ant/input/index.d.ts +15 -0
- package/ant/input/inputProps.d.ts +207 -0
- package/ant/input/style/index.d.ts +30 -0
- package/ant/input/util.d.ts +2 -0
- package/ant/locale/LocaleReceiver.d.ts +35 -0
- package/ant/locale/en_US.d.ts +3 -0
- package/ant/locale/index.d.ts +91 -0
- package/ant/locale-provider/LocaleReceiver.d.ts +3 -0
- package/ant/locale-provider/index.d.ts +3 -0
- package/ant/modal/locale.d.ts +7 -0
- package/ant/modal/style/index.d.ts +32 -0
- package/ant/progress/Circle.d.ts +168 -0
- package/ant/progress/Line.d.ts +205 -0
- package/ant/progress/Steps.d.ts +168 -0
- package/ant/progress/index.d.ts +204 -0
- package/ant/progress/progress.d.ts +117 -0
- package/ant/progress/props.d.ts +79 -0
- package/ant/progress/style/index.d.ts +4 -0
- package/ant/progress/utils.d.ts +13 -0
- package/ant/space/Compact.d.ts +119 -0
- package/ant/space/style/compact.d.ts +8 -0
- package/ant/space/style/index.d.ts +5 -0
- package/ant/style/compact-item-vertical.d.ts +4 -0
- package/ant/style/compact-item.d.ts +18 -0
- package/ant/style/index.d.ts +13 -0
- package/ant/style/motion/collapse.d.ts +4 -0
- package/ant/style/motion/fade.d.ts +7 -0
- package/ant/style/motion/index.d.ts +6 -0
- package/ant/style/motion/motion.d.ts +2 -0
- package/ant/style/motion/move.d.ts +15 -0
- package/ant/style/motion/slide.d.ts +15 -0
- package/ant/style/motion/zoom.d.ts +19 -0
- package/ant/style/operationUnit.d.ts +3 -0
- package/ant/style/placementArrow.d.ts +19 -0
- package/ant/style/presetColor.d.ts +16 -0
- package/ant/style/roundedArrow.d.ts +2 -0
- package/ant/theme/index.d.ts +23 -0
- package/ant/theme/interface/alias.d.ts +115 -0
- package/ant/theme/interface/components.d.ts +32 -0
- package/ant/theme/interface/index.d.ts +13 -0
- package/ant/theme/interface/maps/colors.d.ts +350 -0
- package/ant/theme/interface/maps/font.d.ts +44 -0
- package/ant/theme/interface/maps/index.d.ts +17 -0
- package/ant/theme/interface/maps/size.d.ts +63 -0
- package/ant/theme/interface/maps/style.d.ts +37 -0
- package/ant/theme/interface/presetColors.d.ts +8 -0
- package/ant/theme/interface/seeds.d.ts +163 -0
- package/ant/theme/internal.d.ts +49 -0
- package/ant/theme/themes/ColorMap.d.ts +15 -0
- package/ant/theme/themes/compact/genCompactSizeMapToken.d.ts +2 -0
- package/ant/theme/themes/compact/index.d.ts +4 -0
- package/ant/theme/themes/dark/colorAlgorithm.d.ts +2 -0
- package/ant/theme/themes/dark/colors.d.ts +3 -0
- package/ant/theme/themes/dark/index.d.ts +4 -0
- package/ant/theme/themes/default/colorAlgorithm.d.ts +2 -0
- package/ant/theme/themes/default/colors.d.ts +3 -0
- package/ant/theme/themes/default/index.d.ts +2 -0
- package/ant/theme/themes/seed.d.ts +4 -0
- package/ant/theme/themes/shared/genColorMapToken.d.ts +8 -0
- package/ant/theme/themes/shared/genCommonMapToken.d.ts +2 -0
- package/ant/theme/themes/shared/genControlHeight.d.ts +3 -0
- package/ant/theme/themes/shared/genFontMapToken.d.ts +3 -0
- package/ant/theme/themes/shared/genFontSizes.d.ts +4 -0
- package/ant/theme/themes/shared/genRadius.d.ts +3 -0
- package/ant/theme/themes/shared/genSizeMapToken.d.ts +2 -0
- package/ant/theme/util/alias.d.ts +12 -0
- package/ant/theme/util/genComponentStyleHook.d.ts +26 -0
- package/ant/theme/util/getAlphaColor.d.ts +2 -0
- package/ant/theme/util/statistic.d.ts +18 -0
- package/ant/tooltip/Tooltip.d.ts +228 -0
- package/ant/tooltip/abstractTooltipProps.d.ts +73 -0
- package/ant/tooltip/index.d.ts +245 -0
- package/ant/tooltip/style/index.d.ts +8 -0
- package/ant/tooltip/util.d.ts +6 -0
- package/ant/typography/Base.d.ts +200 -0
- package/ant/typography/Editable.d.ts +49 -0
- package/ant/typography/Link.d.ts +51 -0
- package/ant/typography/Paragraph.d.ts +51 -0
- package/ant/typography/Text.d.ts +51 -0
- package/ant/typography/Title.d.ts +48 -0
- package/ant/typography/Typography.d.ts +24 -0
- package/ant/typography/index.d.ts +17 -0
- package/ant/typography/style/index.d.ts +9 -0
- package/ant/typography/style/mixins.d.ts +9 -0
- package/ant/typography/util.d.ts +11 -0
- package/ant/upload/Dragger.d.ts +393 -0
- package/ant/upload/Upload.d.ts +396 -0
- package/ant/upload/UploadList/ListItem.d.ts +339 -0
- package/ant/upload/UploadList/index.d.ts +232 -0
- package/ant/upload/index.d.ts +1460 -0
- package/ant/upload/interface.d.ts +355 -0
- package/ant/upload/style/dragger.d.ts +4 -0
- package/ant/upload/style/index.d.ts +10 -0
- package/ant/upload/style/list.d.ts +4 -0
- package/ant/upload/style/motion.d.ts +4 -0
- package/ant/upload/style/picture.d.ts +5 -0
- package/ant/upload/style/rtl.d.ts +4 -0
- package/ant/upload/utils.d.ts +8 -0
- package/ant/vc-align/Align.d.ts +45 -0
- package/ant/vc-align/hooks/useBuffer.d.ts +3 -0
- package/ant/vc-align/interface.d.ts +56 -0
- package/ant/vc-align/util.d.ts +4 -0
- package/ant/vc-dialog/Content.d.ts +181 -0
- package/ant/vc-dialog/Dialog.d.ts +169 -0
- package/ant/vc-dialog/DialogWrap.d.ts +165 -0
- package/ant/vc-dialog/IDialogPropTypes.d.ts +79 -0
- package/ant/vc-dialog/Mask.d.ts +14 -0
- package/ant/vc-dialog/index.d.ts +4 -0
- package/ant/vc-dialog/util.d.ts +6 -0
- package/ant/vc-image/index.d.ts +3 -0
- package/ant/vc-image/src/Image.d.ts +114 -0
- package/ant/vc-image/src/Preview.d.ts +292 -0
- package/ant/vc-image/src/PreviewGroup.d.ts +79 -0
- package/ant/vc-image/src/getFixScaleEleTransPosition.d.ts +16 -0
- package/ant/vc-image/src/hooks/useFrameSetState.d.ts +3 -0
- package/ant/vc-input/BaseInput.d.ts +97 -0
- package/ant/vc-input/Input.d.ts +192 -0
- package/ant/vc-input/inputProps.d.ts +169 -0
- package/ant/vc-input/utils/commonUtils.d.ts +8 -0
- package/ant/vc-progress/index.d.ts +5 -0
- package/ant/vc-progress/src/Circle.d.ts +41 -0
- package/ant/vc-progress/src/Line.d.ts +40 -0
- package/ant/vc-progress/src/common.d.ts +5 -0
- package/ant/vc-progress/src/index.d.ts +86 -0
- package/ant/vc-progress/src/types.d.ts +25 -0
- package/ant/vc-resize-observer/index.d.ts +25 -0
- package/ant/vc-tooltip/index.d.ts +2 -0
- package/ant/vc-tooltip/src/Content.d.ts +17 -0
- package/ant/vc-tooltip/src/Tooltip.d.ts +141 -0
- package/ant/vc-tooltip/src/placements.d.ts +111 -0
- package/ant/vc-trigger/Popup/Mask.d.ts +14 -0
- package/ant/vc-trigger/Popup/MobilePopupInner.d.ts +103 -0
- package/ant/vc-trigger/Popup/PopupInner.d.ts +98 -0
- package/ant/vc-trigger/Popup/index.d.ts +104 -0
- package/ant/vc-trigger/Popup/interface.d.ts +151 -0
- package/ant/vc-trigger/Popup/useStretchStyle.d.ts +4 -0
- package/ant/vc-trigger/Popup/useVisibleStatus.d.ts +15 -0
- package/ant/vc-trigger/Trigger.d.ts +282 -0
- package/ant/vc-trigger/context.d.ts +11 -0
- package/ant/vc-trigger/index.d.ts +6 -0
- package/ant/vc-trigger/interface.d.ts +175 -0
- package/ant/vc-trigger/utils/alignUtil.d.ts +3 -0
- package/ant/vc-trigger/utils/motionUtil.d.ts +12 -0
- package/ant/vc-upload/AjaxUploader.d.ts +108 -0
- package/ant/vc-upload/Upload.d.ts +108 -0
- package/ant/vc-upload/attr-accept.d.ts +3 -0
- package/ant/vc-upload/index.d.ts +4 -0
- package/ant/vc-upload/interface.d.ts +79 -0
- package/ant/vc-upload/request.d.ts +4 -0
- package/ant/vc-upload/traverseFileTree.d.ts +14 -0
- package/ant/vc-upload/uid.d.ts +1 -0
- package/ant/vc-util/Dom/contains.d.ts +1 -0
- package/ant/vc-util/Dom/css.d.ts +22 -0
- package/ant/vc-util/Dom/dynamicCSS.d.ts +20 -0
- package/ant/vc-util/Dom/isVisible.d.ts +2 -0
- package/ant/vc-util/Dom/scrollLocker.d.ts +12 -0
- package/ant/vc-util/devWarning.d.ts +4 -0
- package/ant/vc-util/get.d.ts +1 -0
- package/ant/vc-util/set.d.ts +1 -0
- package/ant/vc-util/warning.d.ts +7 -0
- package/ant/version/index.d.ts +2 -0
- package/antx/_util/__tests__/warning.test.d.ts +1 -0
- package/antx/_util/cssinjs/Cache.d.ts +11 -0
- package/antx/_util/cssinjs/Keyframes.d.ts +9 -0
- package/antx/_util/cssinjs/StyleContext.d.ts +508 -0
- package/antx/_util/cssinjs/hooks/useCSSVarRegister.d.ts +20 -0
- package/antx/_util/cssinjs/hooks/useCacheToken.d.ts +40 -0
- package/antx/_util/cssinjs/hooks/useGlobalCache.d.ts +6 -0
- package/antx/_util/cssinjs/hooks/useHMR.d.ts +3 -0
- package/antx/_util/cssinjs/hooks/useStyleRegister/cacheMapUtil.d.ts +14 -0
- package/antx/_util/cssinjs/hooks/useStyleRegister/index.d.ts +69 -0
- package/antx/_util/cssinjs/index.d.ts +197 -0
- package/antx/_util/cssinjs/linters/contentQuotesLinter.d.ts +3 -0
- package/antx/_util/cssinjs/linters/hashedAnimationLinter.d.ts +3 -0
- package/antx/_util/cssinjs/linters/index.d.ts +6 -0
- package/antx/_util/cssinjs/linters/interface.d.ts +8 -0
- package/antx/_util/cssinjs/linters/legacyNotSelectorLinter.d.ts +3 -0
- package/antx/_util/cssinjs/linters/logicalPropertiesLinter.d.ts +3 -0
- package/antx/_util/cssinjs/linters/parentSelectorLinter.d.ts +3 -0
- package/antx/_util/cssinjs/linters/utils.d.ts +2 -0
- package/antx/_util/cssinjs/theme/Theme.d.ts +11 -0
- package/antx/_util/cssinjs/theme/ThemeCache.d.ts +20 -0
- package/antx/_util/cssinjs/theme/createTheme.d.ts +6 -0
- package/antx/_util/cssinjs/theme/index.d.ts +4 -0
- package/antx/_util/cssinjs/theme/interface.d.ts +2 -0
- package/antx/_util/cssinjs/transformers/interface.d.ts +4 -0
- package/antx/_util/cssinjs/transformers/legacyLogicalProperties.d.ts +12 -0
- package/antx/_util/cssinjs/transformers/px2rem.d.ts +20 -0
- package/antx/_util/cssinjs/util.d.ts +28 -0
- package/antx/_util/cssinjs-utils/_util/hooks/useUniqueMemo.d.ts +5 -0
- package/antx/_util/cssinjs-utils/hooks/useCSP.d.ts +8 -0
- package/antx/_util/cssinjs-utils/hooks/usePrefix.d.ts +11 -0
- package/antx/_util/cssinjs-utils/hooks/useToken.d.ts +21 -0
- package/antx/_util/cssinjs-utils/index.d.ts +6 -0
- package/antx/_util/cssinjs-utils/interface/components.d.ts +10 -0
- package/antx/_util/cssinjs-utils/interface/index.d.ts +3 -0
- package/antx/_util/cssinjs-utils/util/calc/CSSCalculator.d.ts +15 -0
- package/antx/_util/cssinjs-utils/util/calc/NumCalculator.d.ts +11 -0
- package/antx/_util/cssinjs-utils/util/calc/calculator.d.ts +30 -0
- package/antx/_util/cssinjs-utils/util/calc/index.d.ts +5 -0
- package/antx/_util/cssinjs-utils/util/genStyleUtils.d.ts +116 -0
- package/antx/_util/cssinjs-utils/util/getCompVarPrefix.d.ts +2 -0
- package/antx/_util/cssinjs-utils/util/getComponentToken.d.ts +9 -0
- package/antx/_util/cssinjs-utils/util/getDefaultComponentToken.d.ts +5 -0
- package/antx/_util/cssinjs-utils/util/maxmin.d.ts +8 -0
- package/antx/_util/cssinjs-utils/util/statistic.d.ts +20 -0
- package/antx/_util/getScrollBarSize.d.ts +5 -0
- package/antx/_util/getValue.d.ts +2 -0
- package/antx/_util/hooks/use-event-callback.d.ts +1 -0
- package/antx/_util/hooks/use-state.d.ts +2 -0
- package/antx/_util/hooks/use-x-component-config.d.ts +4 -0
- package/antx/_util/hooks/useMergedState.d.ts +7 -0
- package/antx/_util/motion.d.ts +3 -0
- package/antx/_util/pick-attrs.d.ts +11 -0
- package/antx/_util/setStyle.d.ts +12 -0
- package/antx/_util/transition.d.ts +29 -0
- package/antx/_util/type.d.ts +62 -0
- package/antx/_util/warning.d.ts +47 -0
- package/antx/attachments/Attachments.vue.d.ts +16 -0
- package/antx/attachments/DropArea.vue.d.ts +4 -0
- package/antx/attachments/FileList/AudioIcon.vue.d.ts +3 -0
- package/antx/attachments/FileList/FileList.vue.d.ts +4 -0
- package/antx/attachments/FileList/FileListCard.vue.d.ts +6 -0
- package/antx/attachments/FileList/Progress.vue.d.ts +103 -0
- package/antx/attachments/FileList/VideoIcon.vue.d.ts +3 -0
- package/antx/attachments/FileList/index.d.ts +3 -0
- package/antx/attachments/PlaceholderUploader.vue.d.ts +6 -0
- package/antx/attachments/SilentUploader.vue.d.ts +6 -0
- package/antx/attachments/constants.d.ts +9 -0
- package/antx/attachments/context.d.ts +21 -0
- package/antx/attachments/index.d.ts +26 -0
- package/antx/attachments/interface.d.ts +130 -0
- package/antx/attachments/style/fileCard.d.ts +4 -0
- package/antx/attachments/style/index.d.ts +9 -0
- package/antx/attachments/util.d.ts +3 -0
- package/antx/components.d.ts +4 -0
- package/antx/hooks.d.ts +8 -0
- package/antx/index.cjs +78 -0
- package/antx/index.d.ts +10 -0
- package/antx/index.mjs +6015 -0
- package/antx/sender/Sender.vue.d.ts +48 -0
- package/antx/sender/SenderHeader.vue.d.ts +13 -0
- package/antx/sender/StopLoading.vue.d.ts +6 -0
- package/antx/sender/components/ActionButton/context.d.ts +21 -0
- package/antx/sender/components/ActionButton/index.vue.d.ts +13 -0
- package/antx/sender/components/ClearButton.vue.d.ts +4 -0
- package/antx/sender/components/LoadingButton.vue.d.ts +4 -0
- package/antx/sender/components/SendButton.vue.d.ts +4 -0
- package/antx/sender/components/SpeechButton/RecordingIcon.vue.d.ts +4 -0
- package/antx/sender/components/SpeechButton/index.vue.d.ts +4 -0
- package/antx/sender/context.d.ts +21 -0
- package/antx/sender/index.d.ts +82 -0
- package/antx/sender/interface.d.ts +145 -0
- package/antx/sender/style/header.d.ts +4 -0
- package/antx/sender/style/index.d.ts +9 -0
- package/antx/sender/useSpeech.d.ts +16 -0
- package/antx/theme/components.d.ts +8 -0
- package/antx/theme/cssinjs-utils.d.ts +14 -0
- package/antx/theme/genStyleUtils.d.ts +27 -0
- package/antx/theme/index.d.ts +2 -0
- package/antx/theme/patch-antd.d.ts +28 -0
- package/antx/theme/useToken.d.ts +19 -0
- package/antx/transition-collapse/TransitionCollapse.vue.d.ts +17 -0
- package/antx/transition-collapse/index.d.ts +6 -0
- package/antx/transition-collapse/style/index.d.ts +6 -0
- package/antx/type-utility.d.ts +1 -0
- package/antx/use-x-agent/index.d.ts +4 -0
- package/antx/use-x-agent/use-x-agent.d.ts +34 -0
- package/antx/use-x-chat/index.d.ts +4 -0
- package/antx/use-x-chat/use-x-chat.d.ts +54 -0
- package/antx/use-x-chat/useSyncState.d.ts +4 -0
- package/antx/version/index.d.ts +2 -0
- package/antx/x-provider/context.d.ts +84 -0
- package/antx/x-provider/hooks/use-x-provider-context.d.ts +9 -0
- package/antx/x-provider/index.d.ts +5 -0
- package/antx/x-provider/index.vue.d.ts +13 -0
- package/antx/x-request/index.d.ts +6 -0
- package/antx/x-request/x-fetch.d.ts +18 -0
- package/antx/x-request/x-request.d.ts +89 -0
- package/antx/x-stream/index.d.ts +4 -0
- package/antx/x-stream/x-stream.d.ts +32 -0
- package/components/agent-chat-provider/index.cjs +1 -1
- package/components/agent-chat-provider/index.mjs +1 -3
- package/components/agent-chat-provider/src/index.vue.d.ts +3 -3
- package/components/agent-chat-provider/src/types.d.ts +1 -1
- package/components/agent-chat-provider/src/use.d.ts +2 -2
- package/components/avatar/index.mjs +2 -2
- package/components/avatar/src/index.vue.d.ts +2 -121
- package/components/broadcasting-markdown/index.cjs +3 -3
- package/components/broadcasting-markdown/index.mjs +2 -5
- package/components/broadcasting-markdown/src/ctx.d.ts +2 -2
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +6 -6
- package/components/broadcasting-markdown/src/index.vue.d.ts +33 -33
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +1 -1
- package/components/broadcasting-markdown/src/use.d.ts +1 -1
- package/components/bubble-list/index.cjs +1 -1
- package/components/bubble-list/index.mjs +5 -5
- package/components/bubble-list/src/core/index.vue.d.ts +7 -7
- package/components/bubble-list/src/ctx.d.ts +2 -2
- package/components/bubble-list/src/index.vue.d.ts +5 -4
- package/components/bubble-templates/index.mjs +2 -2
- package/components/chat-independent/index.mjs +4 -4
- package/components/chat-independent/src/index.vue.d.ts +1 -1
- package/components/components.css +1 -1
- package/components/drawer/index.mjs +1 -1
- package/components/drawer/src/ctx.d.ts +37 -31
- package/components/drawer/src/index.vue.d.ts +87 -77
- package/components/file-viewer/index.cjs +1 -0
- package/components/file-viewer/index.d.ts +4 -0
- package/components/file-viewer/index.mjs +130 -0
- package/components/file-viewer/src/ctx.d.ts +69 -0
- package/components/file-viewer/src/index.vue.d.ts +108 -0
- package/components/file-viewer/src/types.d.ts +3 -0
- package/components/lottie-animation/index.mjs +2 -2
- package/components/lottie-animation/src/index.vue.d.ts +1 -1
- package/components/metahuman-broadcasting/index.mjs +2 -2
- package/components/metahuman-broadcasting/src/ctx.d.ts +2 -2
- package/components/metahuman-broadcasting/src/index.vue.d.ts +4 -4
- package/components/monaco-editor/index.cjs +1 -1
- package/components/monaco-editor/index.mjs +52 -48
- package/components/monaco-editor/src/ctx.d.ts +3 -3
- package/components/monaco-editor/src/index.vue.d.ts +5 -5
- package/components/pixi-frame/index.cjs +1 -1
- package/components/pixi-frame/index.mjs +25 -25
- package/components/pixi-frame/src/apng.vue.d.ts +10 -10
- package/components/pixi-frame/src/bitmap-generator.vue.d.ts +7 -7
- package/components/pixi-frame/src/bitmap.vue.d.ts +12 -12
- package/components/pixi-frame/src/buffer-image.vue.d.ts +13 -13
- package/components/pixi-frame/src/core.vue.d.ts +12 -12
- package/components/pixi-frame/src/ctx.d.ts +5 -5
- package/components/pixi-frame/src/index.vue.d.ts +81 -81
- package/components/pixi-frame/src/video.vue.d.ts +10 -10
- package/components/recorder-button/index.cjs +1 -1
- package/components/recorder-button/index.mjs +75 -75
- package/components/recorder-button/src/ctx.d.ts +3 -3
- package/components/recorder-button/src/index.vue.d.ts +114 -197
- package/components/routes-menu-content/index.cjs +1 -1
- package/components/routes-menu-content/index.mjs +12 -12
- package/components/routes-menu-content/src/ctx.d.ts +1 -1
- package/components/routes-menu-content/src/index.vue.d.ts +58 -99
- package/components/routes-menu-content/src/item/core/ctx.d.ts +1 -1
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +40 -81
- package/components/routes-menu-content/src/item/index.vue.d.ts +56 -97
- package/components/scrollbar/index.mjs +4 -4
- package/components/scrollbar/src/index.vue.d.ts +35 -34
- package/components/scrollbar/src/util.d.ts +1 -1
- package/components/sender/index.cjs +1 -1
- package/components/sender/index.mjs +7 -7
- package/components/sender/src/SenderHeader.vue.d.ts +2 -2
- package/components/sender/src/ctx.d.ts +9 -9
- package/components/sender/src/index.vue.d.ts +28 -28
- package/components/speech-button/index.cjs +1 -1
- package/components/speech-button/index.mjs +1 -1
- package/components/speech-button/src/ctx.d.ts +1 -1
- package/components/speech-button/src/index.vue.d.ts +3 -3
- package/components/table-columns/src/ctx.d.ts +2 -2
- package/components/table-columns/src/el-ctx.d.ts +2 -2
- package/components/table-columns/src/index.vue.d.ts +6 -6
- package/components/table-columns/src/types.d.ts +3 -4
- package/components/tables-v1/index.cjs +1 -1
- package/components/tables-v1/index.mjs +3 -3
- package/components/tables-v1/src/ctx.d.ts +69 -74
- package/components/tables-v1/src/el-ctx.d.ts +24 -24
- package/components/tables-v1/src/index.vue.d.ts +54 -313
- package/components/tables-v1-checkbox/index.cjs +31 -35
- package/components/tables-v1-checkbox/index.mjs +1239 -1042
- package/components/tables-v1-checkbox/src/ctx.d.ts +68 -73
- package/components/tables-v1-checkbox/src/index.vue.d.ts +274 -542
- package/components/text/index.mjs +3 -3
- package/components/text/src/ctx.d.ts +39 -246
- package/components/text/src/index.vue.d.ts +98 -509
- package/components/thinking/index.mjs +5 -5
- package/components/thinking/src/ctx.d.ts +3 -3
- package/components/thinking/src/index.vue.d.ts +8 -8
- package/components/typing-markdown/index.mjs +2 -2
- package/components/typing-markdown/src/ctx.d.ts +3 -3
- package/components/typing-markdown/src/index.vue.d.ts +6 -6
- package/components/vditor/index.cjs +1 -1
- package/components/vditor/index.mjs +2 -2
- package/components/vditor/src/ctx.d.ts +2 -2
- package/components/vditor/src/handle-fullscreen.vue.d.ts +3 -3
- package/components/vditor/src/handle-value.vue.d.ts +3 -3
- package/components/vditor/src/index.vue.d.ts +10 -10
- package/components/xgplayer/index.mjs +5 -5
- package/composables/recorder/index.cjs +1 -1
- package/composables/recorder/index.mjs +3214 -3099
- package/element/bubble/index.cjs +2 -2
- package/element/bubble/index.mjs +57 -57
- package/element/index.css +1 -1
- package/element/thinking/index.cjs +1 -1
- package/element/thinking/index.mjs +63 -69
- package/icons/end/index.cjs +1 -1
- package/icons/end/index.mjs +3 -3
- package/icons/keyboard/index.cjs +1 -1
- package/icons/keyboard/index.mjs +3 -3
- package/icons/start/index.cjs +1 -1
- package/icons/start/index.mjs +3 -3
- package/icons/voice/index.cjs +1 -1
- package/icons/voice/index.mjs +3 -3
- package/index.css +2 -2
- package/package.json +16 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as i, ref as r, onMounted as l,
|
|
1
|
+
import { defineComponent as i, ref as r, onMounted as l, openBlock as s, createElementBlock as p, Fragment as c, createElementVNode as m, renderSlot as d } from "vue";
|
|
2
2
|
import u from "lottie-web";
|
|
3
3
|
import { _ } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const f = {
|
|
@@ -34,7 +34,7 @@ const f = {
|
|
|
34
34
|
class: "vk-lottie-animation"
|
|
35
35
|
};
|
|
36
36
|
function h(t, a, e, o, y, A) {
|
|
37
|
-
return
|
|
37
|
+
return s(), p(c, null, [
|
|
38
38
|
m("div", g, null, 512),
|
|
39
39
|
d(t.$slots, "default")
|
|
40
40
|
], 64);
|
|
@@ -16,7 +16,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
16
16
|
default: string;
|
|
17
17
|
};
|
|
18
18
|
}>> & Readonly<{
|
|
19
|
-
onLoad?: (
|
|
19
|
+
onLoad?: (e: import("./types").LoadEvent) => any;
|
|
20
20
|
}>, {
|
|
21
21
|
path: string;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as U, ref as m, onMounted as C,
|
|
1
|
+
import { defineComponent as U, ref as m, onMounted as C, openBlock as M, createElementBlock as P, Fragment as V, createVNode as f, unref as r, mergeProps as x, withCtx as D, renderSlot as A, isRef as E } from "vue";
|
|
2
2
|
import { VkBroadcastingMarkdown as T } from "@vunk/plus/components/broadcasting-markdown";
|
|
3
3
|
import { VkPixiFrameBitmap as q, VkPixiFrameBitmapGenerator as j } from "@vunk/plus/components/pixi-frame";
|
|
4
4
|
import { blobToAudioBuffer as z } from "@vunk/plus/shared/data";
|
|
@@ -113,7 +113,7 @@ const $ = {
|
|
|
113
113
|
function w(e) {
|
|
114
114
|
i.value.push(e);
|
|
115
115
|
}
|
|
116
|
-
return (e, t) => (
|
|
116
|
+
return (e, t) => (M(), P(V, null, [
|
|
117
117
|
f(r(T), x(e.$attrs, {
|
|
118
118
|
status: r(o),
|
|
119
119
|
data: p.value,
|
|
@@ -42,7 +42,7 @@ export declare const props: {
|
|
|
42
42
|
*/
|
|
43
43
|
status: {
|
|
44
44
|
type: PropType<TickerStatus>;
|
|
45
|
-
default:
|
|
45
|
+
default: any;
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
48
|
* @description 缓存多少帧后开始播放
|
|
@@ -57,5 +57,5 @@ export declare const props: {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
export declare const emits: {
|
|
60
|
-
'update:status':
|
|
60
|
+
'update:status': any;
|
|
61
61
|
};
|
|
@@ -28,7 +28,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
28
28
|
};
|
|
29
29
|
status: {
|
|
30
30
|
type: import("vue").PropType<TickerStatus>;
|
|
31
|
-
default:
|
|
31
|
+
default: any;
|
|
32
32
|
};
|
|
33
33
|
playAfterCache: {
|
|
34
34
|
type: NumberConstructor;
|
|
@@ -39,7 +39,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
39
39
|
default: boolean;
|
|
40
40
|
};
|
|
41
41
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
42
|
-
"update:status": (...args: any[]) => void;
|
|
42
|
+
"update:status": ((...args: unknown[]) => void) & ((...args: any[]) => void);
|
|
43
43
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
44
44
|
source: {
|
|
45
45
|
type: StringConstructor;
|
|
@@ -63,7 +63,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
63
63
|
};
|
|
64
64
|
status: {
|
|
65
65
|
type: import("vue").PropType<TickerStatus>;
|
|
66
|
-
default:
|
|
66
|
+
default: any;
|
|
67
67
|
};
|
|
68
68
|
playAfterCache: {
|
|
69
69
|
type: NumberConstructor;
|
|
@@ -74,7 +74,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
74
74
|
default: boolean;
|
|
75
75
|
};
|
|
76
76
|
}>> & Readonly<{
|
|
77
|
-
"onUpdate:status"?: (
|
|
77
|
+
"onUpdate:status"?: (...args: any[]) => any;
|
|
78
78
|
}>, {
|
|
79
79
|
source: string;
|
|
80
80
|
disabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("@vueuse/core"),h=require("monaco-editor"),e=require("vue"),y=require("@vunk/core/shared/utils-vue"),v=require("../_plugin-vue_export-helper-BHFhmbuH.js"),c={modelValue:{type:String,default:""},defaultOptions:{type:Object,default:()=>({})},readOnly:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!1}},b=y.bindPropsFactory(c),s={"update:modelValue":null,load:t=>!0},O=y.onEmitsFactory(s),V=Object.freeze(Object.defineProperty({__proto__:null,createBindProps:b,createOnEmits:O,emits:s,props:c},Symbol.toStringTag,{value:"Module"})),M=e.defineComponent({name:"VkMonacoEditor",props:c,emits:s,setup(t,{emit:l}){const a=e.ref(),n=e.ref(""),d=e.computed(()=>{if(!(!t.autoHeight||!n.value))return{height:n.value}});return e.onMounted(()=>{const u={...t.defaultOptions};t.autoHeight&&(u.scrollBeyondLastLine=!1);const o=h.editor.create(a.value,u);l("load",o);function f(){if(!t.autoHeight)return;const i=`${Math.ceil(o.getContentHeight())}px`;n.value!==i&&(n.value=i,e.nextTick(()=>{o.layout()}))}const p=g.watchPausable(()=>t.modelValue,i=>{o.setValue(i)},{immediate:!0});o.onDidChangeModelContent(()=>{p.pause(),l("update:modelValue",o.getValue()),e.nextTick(()=>{p.resume()})});const _=o.onDidContentSizeChange(f);e.watchEffect(f),e.watchEffect(()=>{o.updateOptions({readOnly:t.readOnly})});const m=new ResizeObserver(()=>{o.layout()});m.observe(a.value),e.onBeforeUnmount(()=>{_.dispose(),m.disconnect(),o.dispose()})}),{editorNode:a,editorStyle:d}}});function E(t,l,a,n,d,u){return e.openBlock(),e.createElementBlock("div",{ref:"editorNode",class:"vk-monaco-editor",style:e.normalizeStyle(t.editorStyle)},null,4)}const r=v._export_sfc(M,[["render",E]]),S=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));r.install=t=>{t.component(r.name||"VkMonacoEditor",r)};exports.VkMonacoEditor=r;exports._VkMonacoEditorCtx=V;exports.__VkMonacoEditor=S;exports.default=r;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { watchPausable as
|
|
2
|
-
import { editor as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { bindPropsFactory as
|
|
1
|
+
import { watchPausable as h } from "@vueuse/core";
|
|
2
|
+
import { editor as b } from "monaco-editor";
|
|
3
|
+
import { defineComponent as v, ref as p, computed as O, onMounted as V, nextTick as y, watchEffect as _, onBeforeUnmount as M, openBlock as S, createElementBlock as k, normalizeStyle as E } from "vue";
|
|
4
|
+
import { bindPropsFactory as H, onEmitsFactory as x } from "@vunk/core/shared/utils-vue";
|
|
5
5
|
import { _ as z } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
6
|
-
const
|
|
6
|
+
const c = {
|
|
7
7
|
modelValue: {
|
|
8
8
|
type: String,
|
|
9
9
|
default: ""
|
|
@@ -20,85 +20,89 @@ const i = {
|
|
|
20
20
|
type: Boolean,
|
|
21
21
|
default: !1
|
|
22
22
|
}
|
|
23
|
-
},
|
|
23
|
+
}, B = H(c), s = {
|
|
24
24
|
"update:modelValue": null,
|
|
25
|
-
load: (
|
|
26
|
-
},
|
|
25
|
+
load: (e) => !0
|
|
26
|
+
}, C = x(s), L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
27
27
|
__proto__: null,
|
|
28
|
-
createBindProps:
|
|
29
|
-
createOnEmits:
|
|
30
|
-
emits:
|
|
31
|
-
props:
|
|
32
|
-
}, Symbol.toStringTag, { value: "Module" })), j =
|
|
28
|
+
createBindProps: B,
|
|
29
|
+
createOnEmits: C,
|
|
30
|
+
emits: s,
|
|
31
|
+
props: c
|
|
32
|
+
}, Symbol.toStringTag, { value: "Module" })), j = v({
|
|
33
33
|
name: "VkMonacoEditor",
|
|
34
|
-
props:
|
|
35
|
-
emits:
|
|
36
|
-
setup(
|
|
37
|
-
const n = p(), o = p(""),
|
|
38
|
-
if (!(!
|
|
34
|
+
props: c,
|
|
35
|
+
emits: s,
|
|
36
|
+
setup(e, { emit: r }) {
|
|
37
|
+
const n = p(), o = p(""), u = O(() => {
|
|
38
|
+
if (!(!e.autoHeight || !o.value))
|
|
39
39
|
return {
|
|
40
40
|
height: o.value
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
|
-
return
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
return V(() => {
|
|
44
|
+
const i = {
|
|
45
|
+
...e.defaultOptions
|
|
46
|
+
};
|
|
47
|
+
e.autoHeight && (i.scrollBeyondLastLine = !1);
|
|
48
|
+
const t = b.create(n.value, i);
|
|
49
|
+
r("load", t);
|
|
50
|
+
function d() {
|
|
51
|
+
if (!e.autoHeight)
|
|
48
52
|
return;
|
|
49
|
-
const a = `${Math.ceil(
|
|
50
|
-
o.value !== a && (o.value = a,
|
|
51
|
-
|
|
53
|
+
const a = `${Math.ceil(t.getContentHeight())}px`;
|
|
54
|
+
o.value !== a && (o.value = a, y(() => {
|
|
55
|
+
t.layout();
|
|
52
56
|
}));
|
|
53
57
|
}
|
|
54
|
-
const
|
|
55
|
-
() =>
|
|
58
|
+
const f = h(
|
|
59
|
+
() => e.modelValue,
|
|
56
60
|
(a) => {
|
|
57
|
-
|
|
61
|
+
t.setValue(a);
|
|
58
62
|
},
|
|
59
63
|
{
|
|
60
64
|
immediate: !0
|
|
61
65
|
}
|
|
62
66
|
);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
t.onDidChangeModelContent(() => {
|
|
68
|
+
f.pause(), r("update:modelValue", t.getValue()), y(() => {
|
|
69
|
+
f.resume();
|
|
66
70
|
});
|
|
67
71
|
});
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
readOnly:
|
|
72
|
+
const g = t.onDidContentSizeChange(d);
|
|
73
|
+
_(d), _(() => {
|
|
74
|
+
t.updateOptions({
|
|
75
|
+
readOnly: e.readOnly
|
|
72
76
|
});
|
|
73
77
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
78
|
+
const m = new ResizeObserver(() => {
|
|
79
|
+
t.layout();
|
|
76
80
|
});
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
m.observe(n.value), M(() => {
|
|
82
|
+
g.dispose(), m.disconnect(), t.dispose();
|
|
79
83
|
});
|
|
80
84
|
}), {
|
|
81
85
|
editorNode: n,
|
|
82
|
-
editorStyle:
|
|
86
|
+
editorStyle: u
|
|
83
87
|
};
|
|
84
88
|
}
|
|
85
89
|
});
|
|
86
|
-
function
|
|
87
|
-
return S(),
|
|
90
|
+
function $(e, r, n, o, u, i) {
|
|
91
|
+
return S(), k("div", {
|
|
88
92
|
ref: "editorNode",
|
|
89
93
|
class: "vk-monaco-editor",
|
|
90
|
-
style:
|
|
94
|
+
style: E(e.editorStyle)
|
|
91
95
|
}, null, 4);
|
|
92
96
|
}
|
|
93
|
-
const l = /* @__PURE__ */ z(j, [["render",
|
|
97
|
+
const l = /* @__PURE__ */ z(j, [["render", $]]), N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
94
98
|
__proto__: null
|
|
95
99
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
96
|
-
l.install = (
|
|
97
|
-
|
|
100
|
+
l.install = (e) => {
|
|
101
|
+
e.component(l.name || "VkMonacoEditor", l);
|
|
98
102
|
};
|
|
99
103
|
export {
|
|
100
104
|
l as VkMonacoEditor,
|
|
101
|
-
|
|
105
|
+
L as _VkMonacoEditorCtx,
|
|
102
106
|
N as __VkMonacoEditor,
|
|
103
107
|
l as default
|
|
104
108
|
};
|
|
@@ -18,12 +18,12 @@ export declare const props: {
|
|
|
18
18
|
default: boolean;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"
|
|
21
|
+
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"readOnly", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"defaultOptions", keyof T2> | Extract<"autoHeight", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"readOnly", keyof T2>, KE> | Exclude<Extract<"modelValue", keyof T2>, KE> | Exclude<Extract<"defaultOptions", keyof T2>, KE> | Exclude<Extract<"autoHeight", keyof T2>, KE> : Extract<"readOnly", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"defaultOptions", keyof T2> | Extract<"autoHeight", keyof T2>]: { [k in Extract<"readOnly", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"defaultOptions", keyof T2> | Extract<"autoHeight", keyof T2>]: T2[k]; }[P]; }>;
|
|
22
22
|
export declare const emits: {
|
|
23
|
-
'update:modelValue':
|
|
23
|
+
'update:modelValue': any;
|
|
24
24
|
load: (_editor: editor.IStandaloneCodeEditor) => boolean;
|
|
25
25
|
};
|
|
26
|
-
export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("load" | "update:modelValue")[]>(emit: T2, excludes?: EX
|
|
26
|
+
export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("load" | "update:modelValue")[]>(emit: T2, excludes?: EX) => { [P in EX extends (infer KE)[] ? Exclude<"load", KE> | Exclude<"update:modelValue", KE> : "load" | "update:modelValue"]: {
|
|
27
27
|
'update:modelValue': (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
28
28
|
load: (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
29
29
|
}[P]; };
|
|
@@ -23,9 +23,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
23
23
|
editorNode: Ref<HTMLDivElement, HTMLDivElement>;
|
|
24
24
|
editorStyle: import("vue").ComputedRef<{
|
|
25
25
|
height: string;
|
|
26
|
-
}
|
|
26
|
+
}>;
|
|
27
27
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
-
'update:modelValue':
|
|
28
|
+
'update:modelValue': any;
|
|
29
29
|
load: (_editor: mEditor.IStandaloneCodeEditor) => boolean;
|
|
30
30
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
31
|
modelValue: {
|
|
@@ -45,11 +45,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
45
45
|
default: boolean;
|
|
46
46
|
};
|
|
47
47
|
}>> & Readonly<{
|
|
48
|
-
onLoad?: (
|
|
49
|
-
"onUpdate:modelValue"?: (
|
|
48
|
+
onLoad?: (_editor: mEditor.IStandaloneCodeEditor) => any;
|
|
49
|
+
"onUpdate:modelValue"?: (...args: any) => any;
|
|
50
50
|
}>, {
|
|
51
|
-
modelValue: string;
|
|
52
51
|
readOnly: boolean;
|
|
52
|
+
modelValue: string;
|
|
53
53
|
defaultOptions: mEditor.IStandaloneEditorConstructionOptions;
|
|
54
54
|
autoHeight: boolean;
|
|
55
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),m=require("@vunk/shared/enum"),j=require("@vunk/shared/promise"),I=require("pixi.js"),W=require("@vunk/shared/object"),H=require("@vunk/core/composables"),ae=require("../_plugin-vue_export-helper-BHFhmbuH.js");function se(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var z={exports:{}},ie=z.exports,X;function ue(){return X||(X=1,(function(l,S){(function(r,f){l.exports=f()})(ie,function(){return(function(t){var r={};function f(c){if(r[c])return r[c].exports;var g=r[c]={exports:{},id:c,loaded:!1};return t[c].call(g.exports,g,g.exports,f),g.loaded=!0,g.exports}return f.m=t,f.c=r,f.p="",f(0)})([(function(t,r,f){Object.defineProperty(r,"__esModule",{value:!0}),r.isNotPNG=a,r.isNotAPNG=u,r.default=s;var c=f(1),g=w(c),y=f(2);function w(d){return d&&d.__esModule?d:{default:d}}var e=new Error("Not a PNG"),n=new Error("Not an animated PNG");function a(d){return d===e}function u(d){return d===n}var i=new Uint8Array([137,80,78,71,13,10,26,10]);function s(d){var _=new Uint8Array(d);if(Array.prototype.some.call(i,function(L,C){return L!==_[C]}))return e;var p=!1;if(b(_,function(L){return!(p=L==="acTL")}),!p)return n;var x=[],E=[],N=null,F=null,O=0,R=new y.APNG;if(b(_,function(L,C,A,U){var D=new DataView(C.buffer);switch(L){case"IHDR":N=C.subarray(A+8,A+8+U),R.width=D.getUint32(A+8),R.height=D.getUint32(A+12);break;case"acTL":R.numPlays=D.getUint32(A+8+4);break;case"fcTL":F&&(R.frames.push(F),O++),F=new y.Frame,F.width=D.getUint32(A+8+4),F.height=D.getUint32(A+8+8),F.left=D.getUint32(A+8+12),F.top=D.getUint32(A+8+16);var ne=D.getUint16(A+8+20),K=D.getUint16(A+8+22);K===0&&(K=100),F.delay=1e3*ne/K,F.delay<=10&&(F.delay=100),R.playTime+=F.delay,F.disposeOp=D.getUint8(A+8+24),F.blendOp=D.getUint8(A+8+25),F.dataParts=[],O===0&&F.disposeOp===2&&(F.disposeOp=1);break;case"fdAT":F&&F.dataParts.push(C.subarray(A+8+4,A+8+U));break;case"IDAT":F&&F.dataParts.push(C.subarray(A+8,A+8+U));break;case"IEND":E.push(k(C,A,12+U));break;default:x.push(k(C,A,12+U))}}),F&&R.frames.push(F),R.frames.length==0)return n;var V=new Blob(x),G=new Blob(E);return R.frames.forEach(function(L){var C=[];C.push(i),N.set(h(L.width),0),N.set(h(L.height),4),C.push(T("IHDR",N)),C.push(V),L.dataParts.forEach(function(A){return C.push(T("IDAT",A))}),C.push(G),L.imageData=new Blob(C,{type:"image/png"}),delete L.dataParts,C=null}),R}function b(d,_){var p=new DataView(d.buffer),x=8,E=void 0,N=void 0,F=void 0;do N=p.getUint32(x),E=v(d,x+4,4),F=_(E,d,x,N),x+=12+N;while(F!==!1&&E!="IEND"&&x<d.length)}function v(d,_,p){var x=Array.prototype.slice.call(d.subarray(_,_+p));return String.fromCharCode.apply(String,x)}function P(d){for(var _=new Uint8Array(d.length),p=0;p<d.length;p++)_[p]=d.charCodeAt(p);return _}function k(d,_,p){var x=new Uint8Array(p);return x.set(d.subarray(_,_+p)),x}var T=function(_,p){var x=_.length+p.length,E=new Uint8Array(x+8),N=new DataView(E.buffer);N.setUint32(0,p.length),E.set(P(_),4),E.set(p,8);var F=(0,g.default)(E,4,x);return N.setUint32(x+4,F),E},h=function(_){return new Uint8Array([_>>>24&255,_>>>16&255,_>>>8&255,_&255])}}),(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(w){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w.length-e,a=-1,u=e,i=e+n;u<i;u++)a=a>>>8^f[(a^w[u])&255];return a^-1};for(var f=new Uint32Array(256),c=0;c<256;c++){for(var g=c,y=0;y<8;y++)g=(g&1)!==0?3988292384^g>>>1:g>>>1;f[c]=g}}),(function(t,r,f){Object.defineProperty(r,"__esModule",{value:!0}),r.Frame=r.APNG=void 0;var c=(function(){function n(a,u){for(var i=0;i<u.length;i++){var s=u[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}return function(a,u,i){return u&&n(a.prototype,u),i&&n(a,i),a}})(),g=f(3),y=w(g);function w(n){return n&&n.__esModule?n:{default:n}}function e(n,a){if(!(n instanceof a))throw new TypeError("Cannot call a class as a function")}r.APNG=(function(){function n(){e(this,n),this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[]}return c(n,[{key:"createImages",value:function(){return Promise.all(this.frames.map(function(u){return u.createImage()}))}},{key:"getPlayer",value:function(u){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.createImages().then(function(){return new y.default(i,u,s)})}}]),n})(),r.Frame=(function(){function n(){e(this,n),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return c(n,[{key:"createImage",value:function(){var u=this;return this.imageElement?Promise.resolve():new Promise(function(i,s){var b=URL.createObjectURL(u.imageData);u.imageElement=document.createElement("img"),u.imageElement.onload=function(){URL.revokeObjectURL(b),i()},u.imageElement.onerror=function(){URL.revokeObjectURL(b),u.imageElement=null,s(new Error("Image creation error"))},u.imageElement.src=b})}}]),n})()}),(function(t,r,f){Object.defineProperty(r,"__esModule",{value:!0});var c=(function(){function i(s,b){for(var v=0;v<b.length;v++){var P=b[v];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(s,P.key,P)}}return function(s,b,v){return b&&i(s.prototype,b),v&&i(s,v),s}})(),g=f(4),y=w(g);function w(i){return i&&i.__esModule?i:{default:i}}function e(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}function n(i,s){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s&&(typeof s=="object"||typeof s=="function")?s:i}function a(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof s);i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(i,s):i.__proto__=s)}var u=(function(i){a(s,i);function s(b,v,P){e(this,s);var k=n(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return k.playbackRate=1,k._currentFrameNumber=0,k._ended=!1,k._paused=!0,k._numPlays=0,k._rafId=null,k._apng=b,k.context=v,k.stop(),P&&k.play(),k}return c(s,[{key:"renderNextFrame",value:function(){this._currentFrameNumber=(this._currentFrameNumber+1)%this._apng.frames.length,this._currentFrameNumber===this._apng.frames.length-1&&(this._numPlays++,this._apng.numPlays!==0&&this._numPlays>=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var v=this.currentFrame;this._prevFrame=v,this._prevFrameData=null,v.disposeOp==2&&(this._prevFrameData=this.context.getImageData(v.left,v.top,v.width,v.height)),v.blendOp==0&&this.context.clearRect(v.left,v.top,v.width,v.height),this.context.drawImage(v.imageElement,v.left,v.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var v=this;this._rafId&&cancelAnimationFrame(this._rafId),this.emit("play"),this._ended&&this.stop(),this._paused=!1;var P=performance.now()+this.currentFrame.delay/this.playbackRate,k=function T(h){if(!(v._ended||v._paused)){if(h>=P){for(;h-P>=v._apng.playTime/v.playbackRate;)P+=v._apng.playTime/v.playbackRate,v._numPlays++;do v.renderNextFrame(),P+=v.currentFrame.delay/v.playbackRate;while(!v._ended&&!v._paused&&h>P)}v._rafId=requestAnimationFrame(T)}};this._rafId=requestAnimationFrame(k)}},{key:"pause",value:function(){this._paused||(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),s})(y.default);r.default=u}),(function(t,r){function f(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}t.exports=f,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._maxListeners=void 0,f.defaultMaxListeners=10,f.prototype.setMaxListeners=function(e){if(!g(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},f.prototype.emit=function(e){var n,a,u,i,s,b;if(this._events||(this._events={}),e==="error"&&(!this._events.error||y(this._events.error)&&!this._events.error.length)){if(n=arguments[1],n instanceof Error)throw n;var v=new Error('Uncaught, unspecified "error" event. ('+n+")");throw v.context=n,v}if(a=this._events[e],w(a))return!1;if(c(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),a.apply(this,i)}else if(y(a))for(i=Array.prototype.slice.call(arguments,1),b=a.slice(),u=b.length,s=0;s<u;s++)b[s].apply(this,i);return!0},f.prototype.addListener=function(e,n){var a;if(!c(n))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,c(n.listener)?n.listener:n),this._events[e]?y(this._events[e])?this._events[e].push(n):this._events[e]=[this._events[e],n]:this._events[e]=n,y(this._events[e])&&!this._events[e].warned&&(w(this._maxListeners)?a=f.defaultMaxListeners:a=this._maxListeners,a&&a>0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace())),this},f.prototype.on=f.prototype.addListener,f.prototype.once=function(e,n){if(!c(n))throw TypeError("listener must be a function");var a=!1;function u(){this.removeListener(e,u),a||(a=!0,n.apply(this,arguments))}return u.listener=n,this.on(e,u),this},f.prototype.removeListener=function(e,n){var a,u,i,s;if(!c(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=this._events[e],i=a.length,u=-1,a===n||c(a.listener)&&a.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(y(a)){for(s=i;s-- >0;)if(a[s]===n||a[s].listener&&a[s].listener===n){u=s;break}if(u<0)return this;a.length===1?(a.length=0,delete this._events[e]):a.splice(u,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},f.prototype.removeAllListeners=function(e){var n,a;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a=this._events[e],c(a))this.removeListener(e,a);else if(a)for(;a.length;)this.removeListener(e,a[a.length-1]);return delete this._events[e],this},f.prototype.listeners=function(e){var n;return!this._events||!this._events[e]?n=[]:c(this._events[e])?n=[this._events[e]]:n=this._events[e].slice(),n},f.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(c(n))return 1;if(n)return n.length}return 0},f.listenerCount=function(e,n){return e.listenerCount(n)};function c(e){return typeof e=="function"}function g(e){return typeof e=="number"}function y(e){return typeof e=="object"&&e!==null}function w(e){return e===void 0}})])})})(z)),z.exports}var oe=ue();const le=se(oe),B={url:{type:String,requierd:!1},data:{type:Array,default:()=>[]},loop:{type:Boolean,default:!1},status:{type:String,default:m.TickerStatus.pending},frameRate:{type:Number,default:25},label:{type:String,default:""},resize:{type:Function,default:void 0},prerender:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},$={"update:status":null,"update:data":null,setData:null},J=Symbol("appInjectKey");function ce(){const l=new I.Application,S=new j.Deferred,t={whenDef:S,when:()=>S.promise};return o.provide(J,{application:l,context:t}),{application:l,context:t}}function Y(){const l=o.inject(J);if(!l)throw new Error("Pixi app not provided");return l}function M(l){const S=l.autoResize??!0,t=l.resize??y,{application:r,context:f}=Y(),c=new I.Sprite;r.stage.addChild(c),o.watchEffect(()=>{c.visible=l.visible??!0}),o.watchEffect(()=>{l.label&&(c.label=l.label)}),S&&f.when().then(w=>{c.texture&&(g(),w.renderer.on("resize",g))});function g(){if(!r.renderer?.screen)return;const w=c.texture._meta;t({application:r,sprite:c,meta:w})}o.onBeforeUnmount(()=>{r.renderer.off("resize",g),r.stage.removeChild(c)});function y(){const w=r.screen.width/c.texture.width,e=r.screen.height/c.texture.height,n=Math.min(w,e);c.scale.set(n),c.x=(r.screen.width-c.width)/2,c.y=(r.screen.height-c.height)/2}return{sprite:c,resizeSprite:g,application:r}}const Q=o.defineComponent({__name:"apng",props:{...B,url:{type:String,required:!0}},emits:$,setup(l,{emit:S}){const t=l,r=S,f=o.useId(),c=p=>`${f}-apng-frame-${p}`,{sprite:g,resizeSprite:y}=M(t),w=o.ref([]),e=o.ref(0),n=o.ref(!1),a=o.ref(""),u=new Map;let i=null,s=null,b=null;o.onMounted(()=>P(t.url));function v(p,x){return s||(s=document.createElement("canvas"),b=s.getContext("2d",{willReadFrequently:!0})),(s.width!==p||s.height!==x)&&(s.width=p,s.height=x),{canvas:s,ctx:b}}async function P(p){try{a.value="",n.value=!1,await _();const x=await fetch(p);if(!x.ok)throw new Error(`加载APNG失败: ${x.status}`);const E=await x.arrayBuffer(),N=le(E);if(N instanceof Error)throw new TypeError(`APNG解析失败: ${N.message}`);const{canvas:F,ctx:O}=v(N.width,N.height),R=N.frames.map(async(V,G)=>{O.clearRect(0,0,F.width,F.height),await V.createImage();const L=V.imageElement;O.drawImage(L,V.left,V.top);const C=O.getImageData(0,0,F.width,F.height),A=c(G);u.set(A,void 0),O.putImageData(C,0,0);const U=F.toDataURL();I.Assets.add({alias:A,src:U});const D=await I.Assets.load(A);return u.set(A,D),G===0&&(g.texture=D,y()),A});w.value=await Promise.all(R),n.value=!0}catch(x){console.error("加载APNG失败:",x),a.value=x instanceof Error?x.message:"加载APNG失败",r("update:status",m.TickerStatus.stopped)}}function k(){i===null&&(i=window.setInterval(()=>{if(w.value.length===0||t.status!==m.TickerStatus.playing)return;const p=u.get(c(e.value));if(p){const x=e.value-1;x>=0&&!t.loop&&Promise.resolve().then(()=>j.sleep(500)).then(()=>{I.Assets.unload(c(x)),u.delete(c(x))}),g.texture=p,y(),e.value=t.loop?(e.value+1)%w.value.length:e.value+1}else t.loop||r("update:status",m.TickerStatus.paused)},1e3/t.frameRate))}function T(){!n.value||w.value.length<=1||(r("update:status",m.TickerStatus.playing),k())}function h(){i!==null&&(clearInterval(i),i=null),r("update:status",m.TickerStatus.paused)}function d(){i!==null&&(clearInterval(i),i=null),e.value=0;const p=u.get(c(0));p&&(g.texture=p,y()),r("update:status",m.TickerStatus.stopped)}async function _(){i!==null&&(clearInterval(i),i=null);const p=[];for(const[x,E]of u)E&&E!==I.Texture.EMPTY&&p.push(I.Assets.unload(x));await Promise.all(p),u.clear(),w.value=[],e.value=0,n.value=!1,a.value="",s&&(s.width=0,s.height=0)}return o.watchEffect(()=>{switch(t.status){case m.TickerStatus.play:T();break;case m.TickerStatus.pause:h();break;case m.TickerStatus.stop:d();break}}),o.onBeforeUnmount(async()=>{await _(),s=null,b=null}),(p,x)=>o.renderSlot(p.$slots,"default")}}),pe=o.defineComponent({__name:"bitmap-generator",props:{...W.pickObject(B,{excludes:["loop"]}),generator:{type:Object,required:!0}},emits:{"update:status":null,load:l=>l},setup(l,{emit:S}){const t=l,r=S,{sprite:f,resizeSprite:c,application:g}=M(t),y=new I.Texture({dynamic:!0});f.texture=y;function w(i){y.source.destroy();const s=new I.ImageSource({resource:i});y.source=s,y.update(),c()}r("load",{application:g,sprite:f}),o.watch(()=>t.status,i=>{i===m.TickerStatus.play&&n(),i===m.TickerStatus.pause&&a(),i===m.TickerStatus.stop&&u()},{immediate:!0});function e(){t.status===m.TickerStatus.playing&&t.generator.next().then(({value:i,done:s})=>{if(s)return r("update:status",m.TickerStatus.stopped);w(i)})}function n(){g.ticker.minFPS=t.frameRate,g.ticker.maxFPS=t.frameRate,r("update:status",m.TickerStatus.playing),g.ticker.add(e)}function a(){g.ticker.remove(e),r("update:status",m.TickerStatus.paused)}function u(){g.ticker.remove(e),r("update:status",m.TickerStatus.stopped)}return o.onBeforeUnmount(()=>{u(),y.destroy()}),(i,s)=>o.renderSlot(i.$slots,"default")}}),Z=o.defineComponent({__name:"bitmap",props:{...W.pickObject(B,{excludes:["loop"]}),data:{type:void 0,required:!0},frameIndex:{type:Number}},emits:{...$,load:l=>l,"update:frameIndex":null,notFound:l=>!0},setup(l,{emit:S}){const t=l,r=S,{sprite:f,resizeSprite:c,application:g}=M(t),y=new I.Texture({dynamic:!0});f.texture=y;function w(h){y.source?.resource?.close(),y.source?.destroy();const d=new I.ImageSource({resource:h});y.source=d,y.update(),c()}r("load",{application:g,sprite:f});const e=H.useModelComputed({default:0,key:"frameIndex"},t,r),n=o.ref(-1);function a(h){h<=n.value||(n.value=h,j.sleep(0).then(()=>{r("setData",{k:h,v:null})}))}let u=null,i=0,s=0,b=0;function v(){if(u!==null)return;i=performance.now(),b=i,s=0;function h(){const _=performance.now(),p=1e3/t.frameRate,x=_-i;if(x>=p){i=_-x%p,d(),s++;const E=_-b;if(E>=1e3){const N=Math.round(s*1e3/E);console.log(`[Bitmap] FPS: ${N}`),s=0,b=_}}t.status===m.TickerStatus.playing?u=requestAnimationFrame(h):u=null}function d(){if(t.data.length===0||t.status!==m.TickerStatus.playing)return;const _=t.data[e.value];if(_){const p=e.value-1;p>=0&&a(p),w(_),e.value=e.value+1}else console.warn(`Bitmap for index ${e.value} not found. Ensure the data is loaded.`),r("notFound",e.value)}u=requestAnimationFrame(h)}o.watchEffect(()=>{t.prerender&&e.value===0&&t.data.length>0&&t.data[0]&&w(t.data[0])}),o.watch(()=>t.status,h=>{h===m.TickerStatus.play&&P(),h===m.TickerStatus.pause&&k(),h===m.TickerStatus.stop&&T()},{immediate:!0});function P(){t.data.length>0?(r("update:status",m.TickerStatus.playing),v()):r("update:status",m.TickerStatus.stopped)}function k(){r("update:status",m.TickerStatus.paused)}function T(){r("update:status",m.TickerStatus.stopped),u!==null&&(cancelAnimationFrame(u),u=null),r("update:data",[]),e.value=0,n.value=-1}return o.onBeforeUnmount(()=>{T(),y.destroy()}),(h,d)=>o.renderSlot(h.$slots,"default")}}),fe=o.defineComponent({__name:"buffer-image",props:{...W.pickObject(B,{excludes:["loop"]}),data:{type:Array,required:!0},format:{type:String,default:"rgba8unorm"},frameIndex:{type:Number},height:{type:Number,required:!0},width:{type:Number,required:!0}},emits:{...$,load:l=>l,"update:frameIndex":null,notFound:l=>!0},setup(l,{emit:S}){const t=l,r=S,{sprite:f,resizeSprite:c,application:g}=M(t),y=new I.Texture({dynamic:!0});f.texture=y;function w(h){y.source?.destroy();const d=new I.BufferImageSource({resource:h,height:t.height,width:t.width,format:t.format});y.source=d,y.update(),c()}r("load",{application:g,sprite:f});const e=H.useModelComputed({default:0,key:"frameIndex"},t,r),n=o.ref(-1);function a(h){h<=n.value||(n.value=h,j.sleep(0).then(()=>{r("setData",{k:h,v:null})}))}let u=null,i=0,s=0,b=0;function v(){if(u!==null)return;i=performance.now(),b=i,s=0;function h(){const _=performance.now(),p=1e3/t.frameRate,x=_-i;if(x>=p){i=_-x%p,d(),s++;const E=_-b;if(E>=1e3){const N=Math.round(s*1e3/E);console.log(`[Bitmap] FPS: ${N}`),s=0,b=_}}t.status===m.TickerStatus.playing?u=requestAnimationFrame(h):u=null}function d(){if(t.data.length===0||t.status!==m.TickerStatus.playing)return;const _=t.data[e.value];if(_){const p=e.value-1;p>=0&&a(p),w(_),e.value=e.value+1}else console.warn(`Bitmap for index ${e.value} not found. Ensure the data is loaded.`),r("notFound",e.value)}u=requestAnimationFrame(h)}o.watchEffect(()=>{t.prerender&&e.value===0&&t.data.length>0&&t.data[0]&&w(t.data[0])}),o.watch(()=>t.status,h=>{h===m.TickerStatus.play&&P(),h===m.TickerStatus.pause&&k(),h===m.TickerStatus.stop&&T()},{immediate:!0});function P(){t.data.length>0?(r("update:status",m.TickerStatus.playing),v()):r("update:status",m.TickerStatus.stopped)}function k(){r("update:status",m.TickerStatus.paused)}function T(){r("update:status",m.TickerStatus.stopped),u!==null&&(cancelAnimationFrame(u),u=null),r("update:data",[]),e.value=0,n.value=-1}return o.onBeforeUnmount(()=>{T(),y.destroy()}),(h,d)=>o.renderSlot(h.$slots,"default")}}),de=o.defineComponent({__name:"core",props:{...B,data:{type:void 0,required:!0},frameIndex:{type:Number}},emits:{...$,load:l=>l,"update:frameIndex":null,notFound:l=>!0},setup(l,{emit:S}){const t=l,r=S,f=o.useId(),c=T=>`${f}-${T}`,{sprite:g,resizeSprite:y,application:w}=M(t),e=new Map,n=o.ref(0),a=o.computed(()=>t.data.slice(n.value));o.watchEffect(()=>{for(const T in a.value){const h=+T+n.value,d=`${f}-${h}`,_=typeof a.value[T]=="string"?a.value[T]:a.value[T]?.src;_&&(e.has(d)||(I.Assets.add({alias:d,src:_,loadParser:"loadTextures"}),e.set(d,void 0),I.Assets.load(d).then(p=>{p._meta=a.value[T],e.set(d,p),t.prerender&&h===0&&(g.texture=p,y())})))}}),r("load",{application:w,sprite:g});const u=H.useModelComputed({default:0,key:"frameIndex"},t,r);let i=null,s=0;function b(){if(i!==null)return;s=performance.now();function T(){const d=performance.now(),_=1e3/t.frameRate,p=d-s;p>=_&&(s=d-p%_,h()),t.status===m.TickerStatus.playing?i=requestAnimationFrame(T):i=null}function h(){if(t.data.length===0||t.status!==m.TickerStatus.playing)return;const d=e.get(c(u.value));if(d){const _=g.texture,p=u.value-1;_&&p>=0&&!t.loop&&Promise.resolve(j.sleep(500)).then(()=>I.Assets.unload(c(p))).then(()=>{e.set(c(p),void 0),r("setData",{k:p,v:""}),n.value=p}),g.texture=d,y(),u.value=t.loop?(u.value+1)%t.data.length:u.value+1}else console.warn(`Texture for index ${u.value} not found. Ensure the texture is loaded.`),r("notFound",u.value),t.loop||r("update:status",m.TickerStatus.paused)}i=requestAnimationFrame(T)}o.watch(()=>t.status,T=>{T===m.TickerStatus.play&&v(),T===m.TickerStatus.pause&&P(),T===m.TickerStatus.stop&&k()},{immediate:!0});function v(){t.data.length>0?(r("update:status",m.TickerStatus.playing),b()):r("update:status",m.TickerStatus.stopped)}function P(){r("update:status",m.TickerStatus.paused)}function k(){r("update:status",m.TickerStatus.stopped),i!==null&&(cancelAnimationFrame(i),i=null),r("update:data",[]),e.clear(),u.value=0}return o.onBeforeUnmount(()=>{Array.from(e.entries()).forEach(([h,d])=>{d&&I.Assets.unload(h)}),k()}),(T,h)=>o.renderSlot(T.$slots,"default")}}),ee=o.defineComponent({__name:"provider",setup(l){return ce(),(S,t)=>o.renderSlot(S.$slots,"default")}}),te=o.defineComponent({__name:"video",props:{...B,url:{type:String,required:!0}},emits:$,setup(l,{emit:S}){const t=l,r=S,f=o.useId(),c=()=>`${f}-video`,{sprite:g,resizeSprite:y}=M(t),w=o.ref(),e=o.computed(()=>{if(w.value?.source&&w.value.source.resource){const k=w.value.source.resource;if(k instanceof HTMLVideoElement)return k}return null}),n=H.useDeferred(),a=o.ref("");n.promise.then(()=>{t.status===m.TickerStatus.play&&b()}),o.watchEffect(()=>{e.value&&(e.value.loop=t.loop)}),o.onMounted(()=>u(t.url));async function u(k){try{a.value="";const T=c();I.Assets.cache.has(T)&&await I.Assets.unload(T),I.Assets.add({alias:T,src:k});const h=await I.Assets.load(T);return w.value=h,g.texture=h,e.value&&(e.value.loop=t.loop,e.value.muted=!0,e.value.crossOrigin="anonymous",i(e.value),n.resolve()),y(),h}catch(T){return console.error("加载视频纹理失败:",T),a.value="视频加载失败",null}}function i(k){k.addEventListener("play",()=>{t.status!==m.TickerStatus.playing&&r("update:status",m.TickerStatus.playing)}),k.addEventListener("pause",()=>{t.status!==m.TickerStatus.paused&&r("update:status",m.TickerStatus.paused)}),k.addEventListener("ended",()=>{t.loop?(k.currentTime=0,k.play()):r("update:status",m.TickerStatus.stopped)}),k.addEventListener("error",T=>{const h=k.error;let d="视频播放失败";if(h)switch(h.code){case h.MEDIA_ERR_ABORTED:d="视频播放被中止";break;case h.MEDIA_ERR_NETWORK:d="网络错误导致视频播放失败";break;case h.MEDIA_ERR_DECODE:d="视频解码失败";break;case h.MEDIA_ERR_SRC_NOT_SUPPORTED:d="不支持的视频格式";break}console.error("视频播放错误:",d,T),a.value=d,r("update:status",m.TickerStatus.stopped)})}async function s(){if(w.value){const k=c();w.value.destroy(!0),w.value=void 0,I.Assets.cache.has(k)&&await I.Assets.unload(k)}a.value=""}o.watchEffect(()=>{t.status===m.TickerStatus.play&&b(),t.status===m.TickerStatus.pause&&v(),t.status===m.TickerStatus.stop&&P()}),o.onBeforeUnmount(()=>{s()});function b(){e.value&&e.value.play().catch(k=>{console.error("视频播放失败:",k),a.value="视频播放失败"})}function v(){e.value?.pause()}function P(){e.value&&(e.value.pause(),e.value.currentTime=0),r("update:status",m.TickerStatus.stopped)}return(k,T)=>o.renderSlot(k.$slots,"default")}}),re=o.defineComponent({__name:"view",props:{defaultOptions:{type:Object,default:()=>({})}},setup(l){const S=l,{application:t,context:r}=Y(),f=o.ref();return o.onMounted(async()=>{await t.init({resizeTo:f.value,...S.defaultOptions}),r.whenDef.resolve(t),f.value.appendChild(t.canvas)}),(c,g)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"appRef",ref:f,class:"vk-pixi-frame"},null,512))}}),me=o.defineComponent({name:"VkPixiFrame",components:{ApngComp:Q,ProviderComp:ee,ViewComp:re,VideoComp:te,Bitmap:Z},props:B,emits:$,setup(l){const S=o.computed(()=>{if(!l.url)return!1;const r=l.url.toLowerCase();return r.includes(".png")&&!r.includes(".mp4")&&!r.includes(".webm")}),t=o.computed(()=>{if(!l.url)return!1;const r=l.url.toLowerCase();return r.includes(".mp4")||r.includes(".webm")||r.includes(".mov")});return{isApng:S,isVideo:t}}});function he(l,S,t,r,f,c){const g=o.resolveComponent("ViewComp"),y=o.resolveComponent("ApngComp"),w=o.resolveComponent("VideoComp"),e=o.resolveComponent("Bitmap"),n=o.resolveComponent("ProviderComp");return o.openBlock(),o.createBlock(n,null,{default:o.withCtx(()=>[o.createVNode(g),l.isApng&&l.url?(o.openBlock(),o.createBlock(y,{key:0,url:l.url,loop:l.loop,status:l.status,"onUpdate:status":S[0]||(S[0]=a=>l.$emit("update:status",a))},null,8,["url","loop","status"])):l.isVideo&&l.url?(o.openBlock(),o.createBlock(w,{key:1,url:l.url,loop:l.loop,status:l.status,"onUpdate:status":S[1]||(S[1]=a=>l.$emit("update:status",a))},null,8,["url","loop","status"])):(o.openBlock(),o.createBlock(e,{key:2,data:l.data,loop:l.loop,status:l.status,onSetData:S[2]||(S[2]=a=>l.$emit("setData",a)),"onUpdate:status":S[3]||(S[3]=a=>l.$emit("update:status",a))},null,8,["data","loop","status"]))]),_:1})}const q=ae._export_sfc(me,[["render",he]]),ve=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));q.install=l=>{l.component(q.name||"VkPixiFrame",q)};Object.defineProperty(exports,"TickerStatus",{enumerable:!0,get:()=>m.TickerStatus});exports.VkPixiFrame=q;exports.VkPixiFrameApng=Q;exports.VkPixiFrameBitmap=Z;exports.VkPixiFrameBitmapGenerator=pe;exports.VkPixiFrameBufferImage=fe;exports.VkPixiFrameCore=de;exports.VkPixiFrameProvider=ee;exports.VkPixiFrameVideo=te;exports.VkPixiFrameView=re;exports.__VkPixiFrame=ve;exports.default=q;exports.usePixiApp=Y;exports.useSprite=M;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),m=require("@vunk/shared/enum"),j=require("@vunk/shared/promise"),I=require("pixi.js"),W=require("@vunk/shared/object"),H=require("@vunk/core/composables"),ae=require("../_plugin-vue_export-helper-BHFhmbuH.js");function se(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var z={exports:{}},ie=z.exports,X;function ue(){return X||(X=1,(function(l,S){(function(r,f){l.exports=f()})(ie,function(){return(function(t){var r={};function f(c){if(r[c])return r[c].exports;var g=r[c]={exports:{},id:c,loaded:!1};return t[c].call(g.exports,g,g.exports,f),g.loaded=!0,g.exports}return f.m=t,f.c=r,f.p="",f(0)})([(function(t,r,f){Object.defineProperty(r,"__esModule",{value:!0}),r.isNotPNG=a,r.isNotAPNG=u,r.default=s;var c=f(1),g=w(c),y=f(2);function w(d){return d&&d.__esModule?d:{default:d}}var e=new Error("Not a PNG"),n=new Error("Not an animated PNG");function a(d){return d===e}function u(d){return d===n}var i=new Uint8Array([137,80,78,71,13,10,26,10]);function s(d){var _=new Uint8Array(d);if(Array.prototype.some.call(i,function(L,C){return L!==_[C]}))return e;var p=!1;if(b(_,function(L){return!(p=L==="acTL")}),!p)return n;var x=[],E=[],N=null,F=null,O=0,R=new y.APNG;if(b(_,function(L,C,A,U){var D=new DataView(C.buffer);switch(L){case"IHDR":N=C.subarray(A+8,A+8+U),R.width=D.getUint32(A+8),R.height=D.getUint32(A+12);break;case"acTL":R.numPlays=D.getUint32(A+8+4);break;case"fcTL":F&&(R.frames.push(F),O++),F=new y.Frame,F.width=D.getUint32(A+8+4),F.height=D.getUint32(A+8+8),F.left=D.getUint32(A+8+12),F.top=D.getUint32(A+8+16);var ne=D.getUint16(A+8+20),K=D.getUint16(A+8+22);K===0&&(K=100),F.delay=1e3*ne/K,F.delay<=10&&(F.delay=100),R.playTime+=F.delay,F.disposeOp=D.getUint8(A+8+24),F.blendOp=D.getUint8(A+8+25),F.dataParts=[],O===0&&F.disposeOp===2&&(F.disposeOp=1);break;case"fdAT":F&&F.dataParts.push(C.subarray(A+8+4,A+8+U));break;case"IDAT":F&&F.dataParts.push(C.subarray(A+8,A+8+U));break;case"IEND":E.push(k(C,A,12+U));break;default:x.push(k(C,A,12+U))}}),F&&R.frames.push(F),R.frames.length==0)return n;var M=new Blob(x),G=new Blob(E);return R.frames.forEach(function(L){var C=[];C.push(i),N.set(h(L.width),0),N.set(h(L.height),4),C.push(T("IHDR",N)),C.push(M),L.dataParts.forEach(function(A){return C.push(T("IDAT",A))}),C.push(G),L.imageData=new Blob(C,{type:"image/png"}),delete L.dataParts,C=null}),R}function b(d,_){var p=new DataView(d.buffer),x=8,E=void 0,N=void 0,F=void 0;do N=p.getUint32(x),E=v(d,x+4,4),F=_(E,d,x,N),x+=12+N;while(F!==!1&&E!="IEND"&&x<d.length)}function v(d,_,p){var x=Array.prototype.slice.call(d.subarray(_,_+p));return String.fromCharCode.apply(String,x)}function P(d){for(var _=new Uint8Array(d.length),p=0;p<d.length;p++)_[p]=d.charCodeAt(p);return _}function k(d,_,p){var x=new Uint8Array(p);return x.set(d.subarray(_,_+p)),x}var T=function(_,p){var x=_.length+p.length,E=new Uint8Array(x+8),N=new DataView(E.buffer);N.setUint32(0,p.length),E.set(P(_),4),E.set(p,8);var F=(0,g.default)(E,4,x);return N.setUint32(x+4,F),E},h=function(_){return new Uint8Array([_>>>24&255,_>>>16&255,_>>>8&255,_&255])}}),(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(w){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w.length-e,a=-1,u=e,i=e+n;u<i;u++)a=a>>>8^f[(a^w[u])&255];return a^-1};for(var f=new Uint32Array(256),c=0;c<256;c++){for(var g=c,y=0;y<8;y++)g=(g&1)!==0?3988292384^g>>>1:g>>>1;f[c]=g}}),(function(t,r,f){Object.defineProperty(r,"__esModule",{value:!0}),r.Frame=r.APNG=void 0;var c=(function(){function n(a,u){for(var i=0;i<u.length;i++){var s=u[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}return function(a,u,i){return u&&n(a.prototype,u),i&&n(a,i),a}})(),g=f(3),y=w(g);function w(n){return n&&n.__esModule?n:{default:n}}function e(n,a){if(!(n instanceof a))throw new TypeError("Cannot call a class as a function")}r.APNG=(function(){function n(){e(this,n),this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[]}return c(n,[{key:"createImages",value:function(){return Promise.all(this.frames.map(function(u){return u.createImage()}))}},{key:"getPlayer",value:function(u){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.createImages().then(function(){return new y.default(i,u,s)})}}]),n})(),r.Frame=(function(){function n(){e(this,n),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return c(n,[{key:"createImage",value:function(){var u=this;return this.imageElement?Promise.resolve():new Promise(function(i,s){var b=URL.createObjectURL(u.imageData);u.imageElement=document.createElement("img"),u.imageElement.onload=function(){URL.revokeObjectURL(b),i()},u.imageElement.onerror=function(){URL.revokeObjectURL(b),u.imageElement=null,s(new Error("Image creation error"))},u.imageElement.src=b})}}]),n})()}),(function(t,r,f){Object.defineProperty(r,"__esModule",{value:!0});var c=(function(){function i(s,b){for(var v=0;v<b.length;v++){var P=b[v];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(s,P.key,P)}}return function(s,b,v){return b&&i(s.prototype,b),v&&i(s,v),s}})(),g=f(4),y=w(g);function w(i){return i&&i.__esModule?i:{default:i}}function e(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}function n(i,s){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s&&(typeof s=="object"||typeof s=="function")?s:i}function a(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof s);i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(i,s):i.__proto__=s)}var u=(function(i){a(s,i);function s(b,v,P){e(this,s);var k=n(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return k.playbackRate=1,k._currentFrameNumber=0,k._ended=!1,k._paused=!0,k._numPlays=0,k._rafId=null,k._apng=b,k.context=v,k.stop(),P&&k.play(),k}return c(s,[{key:"renderNextFrame",value:function(){this._currentFrameNumber=(this._currentFrameNumber+1)%this._apng.frames.length,this._currentFrameNumber===this._apng.frames.length-1&&(this._numPlays++,this._apng.numPlays!==0&&this._numPlays>=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var v=this.currentFrame;this._prevFrame=v,this._prevFrameData=null,v.disposeOp==2&&(this._prevFrameData=this.context.getImageData(v.left,v.top,v.width,v.height)),v.blendOp==0&&this.context.clearRect(v.left,v.top,v.width,v.height),this.context.drawImage(v.imageElement,v.left,v.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var v=this;this._rafId&&cancelAnimationFrame(this._rafId),this.emit("play"),this._ended&&this.stop(),this._paused=!1;var P=performance.now()+this.currentFrame.delay/this.playbackRate,k=function T(h){if(!(v._ended||v._paused)){if(h>=P){for(;h-P>=v._apng.playTime/v.playbackRate;)P+=v._apng.playTime/v.playbackRate,v._numPlays++;do v.renderNextFrame(),P+=v.currentFrame.delay/v.playbackRate;while(!v._ended&&!v._paused&&h>P)}v._rafId=requestAnimationFrame(T)}};this._rafId=requestAnimationFrame(k)}},{key:"pause",value:function(){this._paused||(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),s})(y.default);r.default=u}),(function(t,r){function f(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}t.exports=f,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._maxListeners=void 0,f.defaultMaxListeners=10,f.prototype.setMaxListeners=function(e){if(!g(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},f.prototype.emit=function(e){var n,a,u,i,s,b;if(this._events||(this._events={}),e==="error"&&(!this._events.error||y(this._events.error)&&!this._events.error.length)){if(n=arguments[1],n instanceof Error)throw n;var v=new Error('Uncaught, unspecified "error" event. ('+n+")");throw v.context=n,v}if(a=this._events[e],w(a))return!1;if(c(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),a.apply(this,i)}else if(y(a))for(i=Array.prototype.slice.call(arguments,1),b=a.slice(),u=b.length,s=0;s<u;s++)b[s].apply(this,i);return!0},f.prototype.addListener=function(e,n){var a;if(!c(n))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,c(n.listener)?n.listener:n),this._events[e]?y(this._events[e])?this._events[e].push(n):this._events[e]=[this._events[e],n]:this._events[e]=n,y(this._events[e])&&!this._events[e].warned&&(w(this._maxListeners)?a=f.defaultMaxListeners:a=this._maxListeners,a&&a>0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace())),this},f.prototype.on=f.prototype.addListener,f.prototype.once=function(e,n){if(!c(n))throw TypeError("listener must be a function");var a=!1;function u(){this.removeListener(e,u),a||(a=!0,n.apply(this,arguments))}return u.listener=n,this.on(e,u),this},f.prototype.removeListener=function(e,n){var a,u,i,s;if(!c(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=this._events[e],i=a.length,u=-1,a===n||c(a.listener)&&a.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(y(a)){for(s=i;s-- >0;)if(a[s]===n||a[s].listener&&a[s].listener===n){u=s;break}if(u<0)return this;a.length===1?(a.length=0,delete this._events[e]):a.splice(u,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},f.prototype.removeAllListeners=function(e){var n,a;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a=this._events[e],c(a))this.removeListener(e,a);else if(a)for(;a.length;)this.removeListener(e,a[a.length-1]);return delete this._events[e],this},f.prototype.listeners=function(e){var n;return!this._events||!this._events[e]?n=[]:c(this._events[e])?n=[this._events[e]]:n=this._events[e].slice(),n},f.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(c(n))return 1;if(n)return n.length}return 0},f.listenerCount=function(e,n){return e.listenerCount(n)};function c(e){return typeof e=="function"}function g(e){return typeof e=="number"}function y(e){return typeof e=="object"&&e!==null}function w(e){return e===void 0}})])})})(z)),z.exports}var oe=ue();const le=se(oe),B={url:{type:String,requierd:!1},data:{type:Array,default:()=>[]},loop:{type:Boolean,default:!1},status:{type:String,default:m.TickerStatus.pending},frameRate:{type:Number,default:25},label:{type:String,default:""},resize:{type:Function,default:void 0},prerender:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},V={"update:status":null,"update:data":null,setData:null},J=Symbol("appInjectKey");function ce(){const l=new I.Application,S=new j.Deferred,t={whenDef:S,when:()=>S.promise};return o.provide(J,{application:l,context:t}),{application:l,context:t}}function Y(){const l=o.inject(J);if(!l)throw new Error("Pixi app not provided");return l}function $(l){const S=l.autoResize??!0,t=l.resize??y,{application:r,context:f}=Y(),c=new I.Sprite;r.stage.addChild(c),o.watchEffect(()=>{c.visible=l.visible??!0}),o.watchEffect(()=>{l.label&&(c.label=l.label)}),S&&f.when().then(w=>{c.texture&&(g(),w.renderer.on("resize",g))});function g(){if(!r.renderer?.screen)return;const w=c.texture._meta;t({application:r,sprite:c,meta:w})}o.onBeforeUnmount(()=>{r.renderer.off("resize",g),r.stage.removeChild(c)});function y(){const w=r.screen.width/c.texture.width,e=r.screen.height/c.texture.height,n=Math.min(w,e);c.scale.set(n),c.x=(r.screen.width-c.width)/2,c.y=(r.screen.height-c.height)/2}return{sprite:c,resizeSprite:g,application:r}}const Q=o.defineComponent({__name:"apng",props:{...B,url:{type:String,required:!0}},emits:V,setup(l,{emit:S}){const t=l,r=S,f=o.useId(),c=p=>`${f}-apng-frame-${p}`,{sprite:g,resizeSprite:y}=$(t),w=o.ref([]),e=o.ref(0),n=o.ref(!1),a=o.ref(""),u=new Map;let i=null,s=null,b=null;o.onMounted(()=>P(t.url));function v(p,x){return s||(s=document.createElement("canvas"),b=s.getContext("2d",{willReadFrequently:!0})),(s.width!==p||s.height!==x)&&(s.width=p,s.height=x),{canvas:s,ctx:b}}async function P(p){try{a.value="",n.value=!1,await _();const x=await fetch(p);if(!x.ok)throw new Error(`加载APNG失败: ${x.status}`);const E=await x.arrayBuffer(),N=le(E);if(N instanceof Error)throw new TypeError(`APNG解析失败: ${N.message}`);const{canvas:F,ctx:O}=v(N.width,N.height),R=N.frames.map(async(M,G)=>{O.clearRect(0,0,F.width,F.height),await M.createImage();const L=M.imageElement;O.drawImage(L,M.left,M.top);const C=O.getImageData(0,0,F.width,F.height),A=c(G);u.set(A,void 0),O.putImageData(C,0,0);const U=F.toDataURL();I.Assets.add({alias:A,src:U});const D=await I.Assets.load(A);return u.set(A,D),G===0&&(g.texture=D,y()),A});w.value=await Promise.all(R),n.value=!0}catch(x){console.error("加载APNG失败:",x),a.value=x instanceof Error?x.message:"加载APNG失败",r("update:status",m.TickerStatus.stopped)}}function k(){i===null&&(i=window.setInterval(()=>{if(w.value.length===0||t.status!==m.TickerStatus.playing)return;const p=u.get(c(e.value));if(p){const x=e.value-1;x>=0&&!t.loop&&Promise.resolve().then(()=>j.sleep(500)).then(()=>{I.Assets.unload(c(x)),u.delete(c(x))}),g.texture=p,y(),e.value=t.loop?(e.value+1)%w.value.length:e.value+1}else t.loop||r("update:status",m.TickerStatus.paused)},1e3/t.frameRate))}function T(){!n.value||w.value.length<=1||(r("update:status",m.TickerStatus.playing),k())}function h(){i!==null&&(clearInterval(i),i=null),r("update:status",m.TickerStatus.paused)}function d(){i!==null&&(clearInterval(i),i=null),e.value=0;const p=u.get(c(0));p&&(g.texture=p,y()),r("update:status",m.TickerStatus.stopped)}async function _(){i!==null&&(clearInterval(i),i=null);const p=[];for(const[x,E]of u)E&&E!==I.Texture.EMPTY&&p.push(I.Assets.unload(x));await Promise.all(p),u.clear(),w.value=[],e.value=0,n.value=!1,a.value="",s&&(s.width=0,s.height=0)}return o.watchEffect(()=>{switch(t.status){case m.TickerStatus.play:T();break;case m.TickerStatus.pause:h();break;case m.TickerStatus.stop:d();break}}),o.onBeforeUnmount(async()=>{await _(),s=null,b=null}),(p,x)=>o.renderSlot(p.$slots,"default")}}),pe=o.defineComponent({__name:"bitmap-generator",props:{...W.pickObject(B,{excludes:["loop"]}),generator:{type:Object,required:!0}},emits:{"update:status":null,load:l=>l},setup(l,{emit:S}){const t=l,r=S,{sprite:f,resizeSprite:c,application:g}=$(t),y=new I.Texture({dynamic:!0});f.texture=y;function w(i){y.source.destroy();const s=new I.ImageSource({resource:i});y.source=s,y.update(),c()}r("load",{application:g,sprite:f}),o.watch(()=>t.status,i=>{i===m.TickerStatus.play&&n(),i===m.TickerStatus.pause&&a(),i===m.TickerStatus.stop&&u()},{immediate:!0});function e(){t.status===m.TickerStatus.playing&&t.generator.next().then(({value:i,done:s})=>{if(s)return r("update:status",m.TickerStatus.stopped);w(i)})}function n(){g.ticker.minFPS=t.frameRate,g.ticker.maxFPS=t.frameRate,r("update:status",m.TickerStatus.playing),g.ticker.add(e)}function a(){g.ticker.remove(e),r("update:status",m.TickerStatus.paused)}function u(){g.ticker.remove(e),r("update:status",m.TickerStatus.stopped)}return o.onBeforeUnmount(()=>{u(),y.destroy()}),(i,s)=>o.renderSlot(i.$slots,"default")}}),Z=o.defineComponent({__name:"bitmap",props:{...W.pickObject(B,{excludes:["loop"]}),data:{type:void 0,required:!0},frameIndex:{type:Number}},emits:{...V,load:l=>l,"update:frameIndex":null,notFound:l=>!0},setup(l,{emit:S}){const t=l,r=S,{sprite:f,resizeSprite:c,application:g}=$(t),y=new I.Texture({dynamic:!0});f.texture=y;function w(h){y.source?.resource?.close(),y.source?.destroy();const d=new I.ImageSource({resource:h});y.source=d,y.update(),c()}r("load",{application:g,sprite:f});const e=H.useModelComputed({default:0,key:"frameIndex"},t,r),n=o.ref(-1);function a(h){h<=n.value||(n.value=h,j.sleep(0).then(()=>{r("setData",{k:h,v:null})}))}let u=null,i=0,s=0,b=0;function v(){if(u!==null)return;i=performance.now(),b=i,s=0;function h(){const _=performance.now(),p=1e3/t.frameRate,x=_-i;if(x>=p){i=_-x%p,d(),s++;const E=_-b;if(E>=1e3){const N=Math.round(s*1e3/E);console.log(`[Bitmap] FPS: ${N}`),s=0,b=_}}t.status===m.TickerStatus.playing?u=requestAnimationFrame(h):u=null}function d(){if(t.data.length===0||t.status!==m.TickerStatus.playing)return;const _=t.data[e.value];if(_){const p=e.value-1;p>=0&&a(p),w(_),e.value=e.value+1}else console.warn(`Bitmap for index ${e.value} not found. Ensure the data is loaded.`),r("notFound",e.value)}u=requestAnimationFrame(h)}o.watchEffect(()=>{t.prerender&&e.value===0&&t.data.length>0&&t.data[0]&&w(t.data[0])}),o.watch(()=>t.status,h=>{h===m.TickerStatus.play&&P(),h===m.TickerStatus.pause&&k(),h===m.TickerStatus.stop&&T()},{immediate:!0});function P(){t.data.length>0?(r("update:status",m.TickerStatus.playing),v()):r("update:status",m.TickerStatus.stopped)}function k(){r("update:status",m.TickerStatus.paused)}function T(){r("update:status",m.TickerStatus.stopped),u!==null&&(cancelAnimationFrame(u),u=null),r("update:data",[]),e.value=0,n.value=-1}return o.onBeforeUnmount(()=>{T(),y.destroy()}),(h,d)=>o.renderSlot(h.$slots,"default")}}),fe=o.defineComponent({__name:"buffer-image",props:{...W.pickObject(B,{excludes:["loop"]}),data:{type:Array,required:!0},format:{type:String,default:"rgba8unorm"},frameIndex:{type:Number},height:{type:Number,required:!0},width:{type:Number,required:!0}},emits:{...V,load:l=>l,"update:frameIndex":null,notFound:l=>!0},setup(l,{emit:S}){const t=l,r=S,{sprite:f,resizeSprite:c,application:g}=$(t),y=new I.Texture({dynamic:!0});f.texture=y;function w(h){y.source?.destroy();const d=new I.BufferImageSource({resource:h,height:t.height,width:t.width,format:t.format});y.source=d,y.update(),c()}r("load",{application:g,sprite:f});const e=H.useModelComputed({default:0,key:"frameIndex"},t,r),n=o.ref(-1);function a(h){h<=n.value||(n.value=h,j.sleep(0).then(()=>{r("setData",{k:h,v:null})}))}let u=null,i=0,s=0,b=0;function v(){if(u!==null)return;i=performance.now(),b=i,s=0;function h(){const _=performance.now(),p=1e3/t.frameRate,x=_-i;if(x>=p){i=_-x%p,d(),s++;const E=_-b;if(E>=1e3){const N=Math.round(s*1e3/E);console.log(`[Bitmap] FPS: ${N}`),s=0,b=_}}t.status===m.TickerStatus.playing?u=requestAnimationFrame(h):u=null}function d(){if(t.data.length===0||t.status!==m.TickerStatus.playing)return;const _=t.data[e.value];if(_){const p=e.value-1;p>=0&&a(p),w(_),e.value=e.value+1}else console.warn(`Bitmap for index ${e.value} not found. Ensure the data is loaded.`),r("notFound",e.value)}u=requestAnimationFrame(h)}o.watchEffect(()=>{t.prerender&&e.value===0&&t.data.length>0&&t.data[0]&&w(t.data[0])}),o.watch(()=>t.status,h=>{h===m.TickerStatus.play&&P(),h===m.TickerStatus.pause&&k(),h===m.TickerStatus.stop&&T()},{immediate:!0});function P(){t.data.length>0?(r("update:status",m.TickerStatus.playing),v()):r("update:status",m.TickerStatus.stopped)}function k(){r("update:status",m.TickerStatus.paused)}function T(){r("update:status",m.TickerStatus.stopped),u!==null&&(cancelAnimationFrame(u),u=null),r("update:data",[]),e.value=0,n.value=-1}return o.onBeforeUnmount(()=>{T(),y.destroy()}),(h,d)=>o.renderSlot(h.$slots,"default")}}),de=o.defineComponent({__name:"core",props:{...B,data:{type:void 0,required:!0},frameIndex:{type:Number}},emits:{...V,load:l=>l,"update:frameIndex":null,notFound:l=>!0},setup(l,{emit:S}){const t=l,r=S,f=o.useId(),c=T=>`${f}-${T}`,{sprite:g,resizeSprite:y,application:w}=$(t),e=new Map,n=o.ref(0),a=o.computed(()=>t.data.slice(n.value));o.watchEffect(()=>{for(const T in a.value){const h=+T+n.value,d=`${f}-${h}`,_=typeof a.value[T]=="string"?a.value[T]:a.value[T]?.src;_&&(e.has(d)||(I.Assets.add({alias:d,src:_,loadParser:"loadTextures"}),e.set(d,void 0),I.Assets.load(d).then(p=>{p._meta=a.value[T],e.set(d,p),t.prerender&&h===0&&(g.texture=p,y())})))}}),r("load",{application:w,sprite:g});const u=H.useModelComputed({default:0,key:"frameIndex"},t,r);let i=null,s=0;function b(){if(i!==null)return;s=performance.now();function T(){const d=performance.now(),_=1e3/t.frameRate,p=d-s;p>=_&&(s=d-p%_,h()),t.status===m.TickerStatus.playing?i=requestAnimationFrame(T):i=null}function h(){if(t.data.length===0||t.status!==m.TickerStatus.playing)return;const d=e.get(c(u.value));if(d){const _=g.texture,p=u.value-1;_&&p>=0&&!t.loop&&Promise.resolve(j.sleep(500)).then(()=>I.Assets.unload(c(p))).then(()=>{e.set(c(p),void 0),r("setData",{k:p,v:""}),n.value=p}),g.texture=d,y(),u.value=t.loop?(u.value+1)%t.data.length:u.value+1}else console.warn(`Texture for index ${u.value} not found. Ensure the texture is loaded.`),r("notFound",u.value),t.loop||r("update:status",m.TickerStatus.paused)}i=requestAnimationFrame(T)}o.watch(()=>t.status,T=>{T===m.TickerStatus.play&&v(),T===m.TickerStatus.pause&&P(),T===m.TickerStatus.stop&&k()},{immediate:!0});function v(){t.data.length>0?(r("update:status",m.TickerStatus.playing),b()):r("update:status",m.TickerStatus.stopped)}function P(){r("update:status",m.TickerStatus.paused)}function k(){r("update:status",m.TickerStatus.stopped),i!==null&&(cancelAnimationFrame(i),i=null),r("update:data",[]),e.clear(),u.value=0}return o.onBeforeUnmount(()=>{Array.from(e.entries()).forEach(([h,d])=>{d&&I.Assets.unload(h)}),k()}),(T,h)=>o.renderSlot(T.$slots,"default")}}),ee=o.defineComponent({__name:"provider",setup(l){return ce(),(S,t)=>o.renderSlot(S.$slots,"default")}}),te=o.defineComponent({__name:"video",props:{...B,url:{type:String,required:!0}},emits:V,setup(l,{emit:S}){const t=l,r=S,f=o.useId(),c=()=>`${f}-video`,{sprite:g,resizeSprite:y}=$(t),w=o.ref(),e=o.computed(()=>{if(w.value?.source&&w.value.source.resource){const k=w.value.source.resource;if(k instanceof HTMLVideoElement)return k}return null}),n=H.useDeferred(),a=o.ref("");n.promise.then(()=>{t.status===m.TickerStatus.play&&b()}),o.watchEffect(()=>{e.value&&(e.value.loop=t.loop)}),o.onMounted(()=>u(t.url));async function u(k){try{a.value="";const T=c();I.Assets.cache.has(T)&&await I.Assets.unload(T),I.Assets.add({alias:T,src:k});const h=await I.Assets.load(T);return w.value=h,g.texture=h,e.value&&(e.value.loop=t.loop,e.value.muted=!0,e.value.crossOrigin="anonymous",i(e.value),n.resolve()),y(),h}catch(T){return console.error("加载视频纹理失败:",T),a.value="视频加载失败",null}}function i(k){k.addEventListener("play",()=>{t.status!==m.TickerStatus.playing&&r("update:status",m.TickerStatus.playing)}),k.addEventListener("pause",()=>{t.status!==m.TickerStatus.paused&&r("update:status",m.TickerStatus.paused)}),k.addEventListener("ended",()=>{t.loop?(k.currentTime=0,k.play()):r("update:status",m.TickerStatus.stopped)}),k.addEventListener("error",T=>{const h=k.error;let d="视频播放失败";if(h)switch(h.code){case h.MEDIA_ERR_ABORTED:d="视频播放被中止";break;case h.MEDIA_ERR_NETWORK:d="网络错误导致视频播放失败";break;case h.MEDIA_ERR_DECODE:d="视频解码失败";break;case h.MEDIA_ERR_SRC_NOT_SUPPORTED:d="不支持的视频格式";break}console.error("视频播放错误:",d,T),a.value=d,r("update:status",m.TickerStatus.stopped)})}async function s(){if(w.value){const k=c();w.value.destroy(!0),w.value=void 0,I.Assets.cache.has(k)&&await I.Assets.unload(k)}a.value=""}o.watchEffect(()=>{t.status===m.TickerStatus.play&&b(),t.status===m.TickerStatus.pause&&v(),t.status===m.TickerStatus.stop&&P()}),o.onBeforeUnmount(()=>{s()});function b(){e.value&&e.value.play().catch(k=>{console.error("视频播放失败:",k),a.value="视频播放失败"})}function v(){e.value?.pause()}function P(){e.value&&(e.value.pause(),e.value.currentTime=0),r("update:status",m.TickerStatus.stopped)}return(k,T)=>o.renderSlot(k.$slots,"default")}}),re=o.defineComponent({__name:"view",props:{defaultOptions:{type:Object,default:()=>({})}},setup(l){const S=l,{application:t,context:r}=Y(),f=o.ref();return o.onMounted(async()=>{await t.init({resizeTo:f.value,...S.defaultOptions}),r.whenDef.resolve(t),f.value.appendChild(t.canvas)}),(c,g)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"appRef",ref:f,class:"vk-pixi-frame"},null,512))}}),me=o.defineComponent({name:"VkPixiFrame",components:{ApngComp:Q,ProviderComp:ee,ViewComp:re,VideoComp:te,Bitmap:Z},props:B,emits:V,setup(l){const S=o.computed(()=>{if(!l.url)return!1;const r=l.url.toLowerCase();return r.includes(".png")&&!r.includes(".mp4")&&!r.includes(".webm")}),t=o.computed(()=>{if(!l.url)return!1;const r=l.url.toLowerCase();return r.includes(".mp4")||r.includes(".webm")||r.includes(".mov")});return{isApng:S,isVideo:t}}});function he(l,S,t,r,f,c){const g=o.resolveComponent("ViewComp"),y=o.resolveComponent("ApngComp"),w=o.resolveComponent("VideoComp"),e=o.resolveComponent("Bitmap"),n=o.resolveComponent("ProviderComp");return o.openBlock(),o.createBlock(n,null,{default:o.withCtx(()=>[o.createVNode(g),l.isApng&&l.url?(o.openBlock(),o.createBlock(y,{key:0,url:l.url,loop:l.loop,status:l.status,"onUpdate:status":S[0]||(S[0]=a=>l.$emit("update:status",a))},null,8,["url","loop","status"])):l.isVideo&&l.url?(o.openBlock(),o.createBlock(w,{key:1,url:l.url,loop:l.loop,status:l.status,"onUpdate:status":S[1]||(S[1]=a=>l.$emit("update:status",a))},null,8,["url","loop","status"])):(o.openBlock(),o.createBlock(e,{key:2,data:l.data,loop:l.loop,status:l.status,onSetData:S[2]||(S[2]=a=>l.$emit("setData",a)),"onUpdate:status":S[3]||(S[3]=a=>l.$emit("update:status",a))},null,8,["data","loop","status"]))]),_:1})}const q=ae._export_sfc(me,[["render",he]]),ve=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));q.install=l=>{l.component(q.name||"VkPixiFrame",q)};Object.defineProperty(exports,"TickerStatus",{enumerable:!0,get:()=>m.TickerStatus});exports.VkPixiFrame=q;exports.VkPixiFrameApng=Q;exports.VkPixiFrameBitmap=Z;exports.VkPixiFrameBitmapGenerator=pe;exports.VkPixiFrameBufferImage=fe;exports.VkPixiFrameCore=de;exports.VkPixiFrameProvider=ee;exports.VkPixiFrameVideo=te;exports.VkPixiFrameView=re;exports.__VkPixiFrame=ve;exports.default=q;exports.usePixiApp=Y;exports.useSprite=$;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject as fe, provide as de, watchEffect as
|
|
1
|
+
import { inject as fe, provide as de, watchEffect as $, onBeforeUnmount as S, defineComponent as C, useId as ne, ref as U, onMounted as ae, renderSlot as V, watch as Q, computed as J, openBlock as H, createElementBlock as me, resolveComponent as K, createBlock as Y, withCtx as he, createVNode as ve } from "vue";
|
|
2
2
|
import { TickerStatus as m } from "@vunk/shared/enum";
|
|
3
3
|
import { TickerStatus as Ye } from "@vunk/shared/enum";
|
|
4
4
|
import { Deferred as ge, sleep as Z } from "@vunk/shared/promise";
|
|
@@ -64,32 +64,32 @@ function Pe() {
|
|
|
64
64
|
return !(c = T === "acTL");
|
|
65
65
|
}), !c)
|
|
66
66
|
return n;
|
|
67
|
-
var x = [], I = [], N = null, k = null,
|
|
68
|
-
if (b(g, function(T, D, E,
|
|
67
|
+
var x = [], I = [], N = null, k = null, B = 0, O = new _.APNG();
|
|
68
|
+
if (b(g, function(T, D, E, M) {
|
|
69
69
|
var L = new DataView(D.buffer);
|
|
70
70
|
switch (T) {
|
|
71
71
|
case "IHDR":
|
|
72
|
-
N = D.subarray(E + 8, E + 8 +
|
|
72
|
+
N = D.subarray(E + 8, E + 8 + M), O.width = L.getUint32(E + 8), O.height = L.getUint32(E + 12);
|
|
73
73
|
break;
|
|
74
74
|
case "acTL":
|
|
75
75
|
O.numPlays = L.getUint32(E + 8 + 4);
|
|
76
76
|
break;
|
|
77
77
|
case "fcTL":
|
|
78
|
-
k && (O.frames.push(k),
|
|
78
|
+
k && (O.frames.push(k), B++), k = new _.Frame(), k.width = L.getUint32(E + 8 + 4), k.height = L.getUint32(E + 8 + 8), k.left = L.getUint32(E + 8 + 12), k.top = L.getUint32(E + 8 + 16);
|
|
79
79
|
var pe = L.getUint16(E + 8 + 20), te = L.getUint16(E + 8 + 22);
|
|
80
|
-
te === 0 && (te = 100), k.delay = 1e3 * pe / te, k.delay <= 10 && (k.delay = 100), O.playTime += k.delay, k.disposeOp = L.getUint8(E + 8 + 24), k.blendOp = L.getUint8(E + 8 + 25), k.dataParts = [],
|
|
80
|
+
te === 0 && (te = 100), k.delay = 1e3 * pe / te, k.delay <= 10 && (k.delay = 100), O.playTime += k.delay, k.disposeOp = L.getUint8(E + 8 + 24), k.blendOp = L.getUint8(E + 8 + 25), k.dataParts = [], B === 0 && k.disposeOp === 2 && (k.disposeOp = 1);
|
|
81
81
|
break;
|
|
82
82
|
case "fdAT":
|
|
83
|
-
k && k.dataParts.push(D.subarray(E + 8 + 4, E + 8 +
|
|
83
|
+
k && k.dataParts.push(D.subarray(E + 8 + 4, E + 8 + M));
|
|
84
84
|
break;
|
|
85
85
|
case "IDAT":
|
|
86
|
-
k && k.dataParts.push(D.subarray(E + 8, E + 8 +
|
|
86
|
+
k && k.dataParts.push(D.subarray(E + 8, E + 8 + M));
|
|
87
87
|
break;
|
|
88
88
|
case "IEND":
|
|
89
|
-
I.push(y(D, E, 12 +
|
|
89
|
+
I.push(y(D, E, 12 + M));
|
|
90
90
|
break;
|
|
91
91
|
default:
|
|
92
|
-
x.push(y(D, E, 12 +
|
|
92
|
+
x.push(y(D, E, 12 + M));
|
|
93
93
|
}
|
|
94
94
|
}), k && O.frames.push(k), O.frames.length == 0)
|
|
95
95
|
return n;
|
|
@@ -525,9 +525,9 @@ function ce() {
|
|
|
525
525
|
}
|
|
526
526
|
function z(o) {
|
|
527
527
|
const P = o.autoResize ?? !0, t = o.resize ?? _, { application: r, context: p } = ce(), l = new ye();
|
|
528
|
-
r.stage.addChild(l),
|
|
528
|
+
r.stage.addChild(l), $(() => {
|
|
529
529
|
l.visible = o.visible ?? !0;
|
|
530
|
-
}),
|
|
530
|
+
}), $(() => {
|
|
531
531
|
o.label && (l.label = o.label);
|
|
532
532
|
}), P && p.when().then((w) => {
|
|
533
533
|
l.texture && (v(), w.renderer.on("resize", v));
|
|
@@ -583,14 +583,14 @@ const Ne = /* @__PURE__ */ C({
|
|
|
583
583
|
const I = await x.arrayBuffer(), N = Ee(I);
|
|
584
584
|
if (N instanceof Error)
|
|
585
585
|
throw new TypeError(`APNG解析失败: ${N.message}`);
|
|
586
|
-
const { canvas: k, ctx:
|
|
587
|
-
|
|
586
|
+
const { canvas: k, ctx: B } = h(N.width, N.height), O = N.frames.map(async (G, W) => {
|
|
587
|
+
B.clearRect(0, 0, k.width, k.height), await G.createImage();
|
|
588
588
|
const T = G.imageElement;
|
|
589
|
-
|
|
590
|
-
const D =
|
|
591
|
-
u.set(E, void 0),
|
|
592
|
-
const
|
|
593
|
-
R.add({ alias: E, src:
|
|
589
|
+
B.drawImage(T, G.left, G.top);
|
|
590
|
+
const D = B.getImageData(0, 0, k.width, k.height), E = l(W);
|
|
591
|
+
u.set(E, void 0), B.putImageData(D, 0, 0);
|
|
592
|
+
const M = k.toDataURL();
|
|
593
|
+
R.add({ alias: E, src: M });
|
|
594
594
|
const L = await R.load(E);
|
|
595
595
|
return u.set(E, L), W === 0 && (v.texture = L, _()), E;
|
|
596
596
|
});
|
|
@@ -633,7 +633,7 @@ const Ne = /* @__PURE__ */ C({
|
|
|
633
633
|
I && I !== ee.EMPTY && c.push(R.unload(x));
|
|
634
634
|
await Promise.all(c), u.clear(), w.value = [], e.value = 0, n.value = !1, a.value = "", s && (s.width = 0, s.height = 0);
|
|
635
635
|
}
|
|
636
|
-
return
|
|
636
|
+
return $(() => {
|
|
637
637
|
switch (t.status) {
|
|
638
638
|
case m.play:
|
|
639
639
|
F();
|
|
@@ -781,7 +781,7 @@ const Ne = /* @__PURE__ */ C({
|
|
|
781
781
|
}
|
|
782
782
|
u = requestAnimationFrame(d);
|
|
783
783
|
}
|
|
784
|
-
|
|
784
|
+
$(() => {
|
|
785
785
|
t.prerender && e.value === 0 && t.data.length > 0 && t.data[0] && w(t.data[0]);
|
|
786
786
|
}), Q(() => t.status, (d) => {
|
|
787
787
|
d === m.play && A(), d === m.pause && y(), d === m.stop && F();
|
|
@@ -897,7 +897,7 @@ const Ne = /* @__PURE__ */ C({
|
|
|
897
897
|
}
|
|
898
898
|
u = requestAnimationFrame(d);
|
|
899
899
|
}
|
|
900
|
-
|
|
900
|
+
$(() => {
|
|
901
901
|
t.prerender && e.value === 0 && t.data.length > 0 && t.data[0] && w(t.data[0]);
|
|
902
902
|
}), Q(() => t.status, (d) => {
|
|
903
903
|
d === m.play && A(), d === m.pause && y(), d === m.stop && F();
|
|
@@ -935,7 +935,7 @@ const Ne = /* @__PURE__ */ C({
|
|
|
935
935
|
},
|
|
936
936
|
setup(o, { emit: P }) {
|
|
937
937
|
const t = o, r = P, p = ne(), l = (F) => `${p}-${F}`, { sprite: v, resizeSprite: _, application: w } = z(t), e = /* @__PURE__ */ new Map(), n = U(0), a = J(() => t.data.slice(n.value));
|
|
938
|
-
|
|
938
|
+
$(() => {
|
|
939
939
|
for (const F in a.value) {
|
|
940
940
|
const d = +F + n.value, f = `${p}-${d}`, g = typeof a.value[F] == "string" ? a.value[F] : a.value[F]?.src;
|
|
941
941
|
g && (e.has(f) || (R.add({
|
|
@@ -1033,7 +1033,7 @@ const Ne = /* @__PURE__ */ C({
|
|
|
1033
1033
|
}), n = be(), a = U("");
|
|
1034
1034
|
n.promise.then(() => {
|
|
1035
1035
|
t.status === m.play && b();
|
|
1036
|
-
}),
|
|
1036
|
+
}), $(() => {
|
|
1037
1037
|
e.value && (e.value.loop = t.loop);
|
|
1038
1038
|
}), ae(() => u(t.url));
|
|
1039
1039
|
async function u(y) {
|
|
@@ -1082,7 +1082,7 @@ const Ne = /* @__PURE__ */ C({
|
|
|
1082
1082
|
}
|
|
1083
1083
|
a.value = "";
|
|
1084
1084
|
}
|
|
1085
|
-
|
|
1085
|
+
$(() => {
|
|
1086
1086
|
t.status === m.play && b(), t.status === m.pause && h(), t.status === m.stop && A();
|
|
1087
1087
|
}), S(() => {
|
|
1088
1088
|
s();
|