ant-design-x-vue 1.1.1 → 1.2.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/dist/index.umd.js +19 -198
- package/es/_util/cssinjs/Cache.mjs +16 -0
- package/es/_util/cssinjs/Keyframes.mjs +11 -0
- package/es/_util/cssinjs/StyleContext.mjs +116 -0
- package/es/_util/cssinjs/hooks/useCSSVarRegister.mjs +47 -0
- package/es/_util/cssinjs/hooks/useCacheToken.mjs +9 -0
- package/es/_util/cssinjs/hooks/useCacheToken.tsx2.mjs +76 -0
- package/es/_util/cssinjs/hooks/useGlobalCache.mjs +27 -0
- package/es/_util/cssinjs/hooks/useHMR.mjs +7 -0
- package/es/_util/cssinjs/hooks/useStyleRegister/cacheMapUtil.mjs +51 -0
- package/es/_util/cssinjs/hooks/useStyleRegister/index.mjs +17 -0
- package/es/_util/cssinjs/hooks/useStyleRegister/index.tsx2.mjs +541 -0
- package/es/_util/cssinjs/index.mjs +59 -0
- package/es/_util/cssinjs/linters/contentQuotesLinter.mjs +13 -0
- package/es/_util/cssinjs/linters/hashedAnimationLinter.mjs +10 -0
- package/es/_util/cssinjs/linters/index.mjs +12 -0
- package/es/_util/cssinjs/linters/interface.mjs +1 -0
- package/es/_util/cssinjs/linters/legacyNotSelectorLinter.mjs +15 -0
- package/es/_util/cssinjs/linters/logicalPropertiesLinter.mjs +61 -0
- package/es/_util/cssinjs/linters/parentSelectorLinter.mjs +7 -0
- package/es/_util/cssinjs/linters/utils.mjs +11 -0
- package/es/_util/cssinjs/theme/Theme.mjs +18 -0
- package/es/_util/cssinjs/theme/ThemeCache.mjs +72 -0
- package/es/_util/cssinjs/theme/createTheme.mjs +10 -0
- package/es/_util/cssinjs/theme/index.mjs +8 -0
- package/es/_util/cssinjs/theme/interface.mjs +1 -0
- package/es/_util/cssinjs/transformers/interface.mjs +1 -0
- package/es/_util/cssinjs/transformers/legacyLogicalProperties.mjs +92 -0
- package/es/_util/cssinjs/transformers/px2rem.mjs +31 -0
- package/es/_util/cssinjs/util.mjs +102 -0
- package/es/_util/cssinjs-utils/_util/hooks/useUniqueMemo.mjs +55 -0
- package/es/_util/cssinjs-utils/hooks/useCSP.mjs +4 -0
- package/es/_util/cssinjs-utils/hooks/usePrefix.mjs +1 -0
- package/es/_util/cssinjs-utils/hooks/useToken.mjs +1 -0
- package/es/_util/cssinjs-utils/index.mjs +10 -0
- package/es/_util/cssinjs-utils/interface/components.mjs +1 -0
- package/es/_util/cssinjs-utils/interface/index.mjs +1 -0
- package/es/_util/cssinjs-utils/util/calc/CSSCalculator.mjs +35 -0
- package/es/_util/cssinjs-utils/util/calc/NumCalculator.mjs +24 -0
- package/es/_util/cssinjs-utils/util/calc/calculator.mjs +5 -0
- package/es/_util/cssinjs-utils/util/calc/index.mjs +9 -0
- package/es/_util/cssinjs-utils/util/genStyleUtils.mjs +188 -0
- package/es/_util/cssinjs-utils/util/getCompVarPrefix.mjs +7 -0
- package/es/_util/cssinjs-utils/util/getComponentToken.mjs +18 -0
- package/es/_util/cssinjs-utils/util/getDefaultComponentToken.mjs +9 -0
- package/es/_util/cssinjs-utils/util/maxmin.mjs +15 -0
- package/es/_util/cssinjs-utils/util/statistic.mjs +45 -0
- package/es/_util/getScrollBarSize.mjs +33 -0
- package/es/_util/getValue.mjs +11 -0
- package/es/_util/hooks/use-event-callback.mjs +10 -0
- package/es/_util/hooks/use-state.mjs +11 -0
- package/es/_util/hooks/use-x-component-config.mjs +17 -0
- package/es/_util/hooks/useMergedState.mjs +21 -0
- package/es/_util/motion.mjs +23 -0
- package/es/_util/pick-attrs.mjs +43 -0
- package/es/_util/setStyle.mjs +11 -0
- package/es/_util/supportsPassive.mjs +14 -0
- package/es/_util/transition.mjs +75 -0
- package/es/_util/type.mjs +48 -0
- package/es/_util/warning.mjs +45 -0
- package/es/attachments/Attachments.mjs +4 -0
- package/es/attachments/Attachments2.mjs +255 -0
- package/es/attachments/DropArea.mjs +58 -0
- package/es/attachments/FileList/AudioIcon.mjs +5 -0
- package/es/attachments/FileList/AudioIcon2.mjs +35 -0
- package/es/attachments/FileList/FileList.mjs +4 -0
- package/es/attachments/FileList/FileList2.mjs +1574 -0
- package/es/attachments/FileList/FileListCard.mjs +168 -0
- package/es/attachments/FileList/Progress.mjs +49 -0
- package/es/attachments/FileList/VideoIcon.mjs +30 -0
- package/es/attachments/FileList/index.mjs +6 -0
- package/es/attachments/PlaceholderUploader.mjs +79 -0
- package/es/attachments/SilentUploader.mjs +27 -0
- package/es/attachments/context.mjs +32 -0
- package/es/attachments/index.mjs +12 -0
- package/es/attachments/interface.mjs +1 -0
- package/es/attachments/style/fileCard.mjs +157 -0
- package/es/attachments/style/index.mjs +584 -0
- package/es/attachments/util.mjs +31 -0
- package/es/bubble/Bubble.mjs +126 -0
- package/es/bubble/BubbleList.mjs +136 -0
- package/es/bubble/context.mjs +31 -0
- package/es/bubble/hooks/useDisplayData.mjs +36 -0
- package/es/bubble/hooks/useListData.mjs +18 -0
- package/es/bubble/hooks/useTypedEffect.mjs +24 -0
- package/es/bubble/hooks/useTypingConfig.mjs +24 -0
- package/es/bubble/index.mjs +10 -0
- package/es/bubble/interface.mjs +1 -0
- package/es/bubble/loading.mjs +25 -0
- package/es/bubble/style/content.mjs +59 -0
- package/es/bubble/style/index.mjs +148 -0
- package/es/bubble/style/list.mjs +14 -0
- package/es/conversations/Conversations.mjs +105 -0
- package/es/conversations/ConversationsItem.mjs +89 -0
- package/es/conversations/GroupTitle.mjs +22 -0
- package/es/conversations/context.mjs +31 -0
- package/es/conversations/hooks/useGroupable.mjs +48 -0
- package/es/conversations/index.mjs +5 -0
- package/es/conversations/interface.mjs +1 -0
- package/es/conversations/style/index.mjs +103 -0
- package/es/index.mjs +38 -0
- package/es/prompts/Prompts.mjs +116 -0
- package/es/prompts/index.mjs +5 -0
- package/es/prompts/interface.mjs +1 -0
- package/es/prompts/style/index.mjs +143 -0
- package/es/sender/Sender.mjs +251 -0
- package/es/sender/SenderHeader.mjs +82 -0
- package/es/sender/StopLoading.mjs +52 -0
- package/es/sender/components/ActionButton/context.mjs +31 -0
- package/es/sender/components/ActionButton/index.mjs +65 -0
- package/es/sender/components/ClearButton.mjs +41 -0
- package/es/sender/components/LoadingButton.mjs +58 -0
- package/es/sender/components/SendButton.mjs +45 -0
- package/es/sender/components/SpeechButton/RecordingIcon.mjs +49 -0
- package/es/sender/components/SpeechButton/index.mjs +59 -0
- package/es/sender/context.mjs +31 -0
- package/es/sender/index.mjs +9 -0
- package/es/sender/interface.mjs +1 -0
- package/es/sender/style/header.mjs +49 -0
- package/es/sender/style/index.mjs +147 -0
- package/es/sender/useSpeech.mjs +55 -0
- package/es/suggestion/Suggestion.mjs +93 -0
- package/es/suggestion/index.mjs +5 -0
- package/es/suggestion/interface.mjs +1 -0
- package/es/suggestion/style/index.mjs +41 -0
- package/es/suggestion/useActive.mjs +56 -0
- package/es/theme/components.mjs +1 -0
- package/es/theme/cssinjs-utils.mjs +1 -0
- package/es/theme/genStyleUtils.mjs +32 -0
- package/es/theme/index.mjs +4 -0
- package/es/theme/patch-antd.mjs +33 -0
- package/es/theme/useToken.mjs +351 -0
- package/es/thought-chain/ThoughtChain.mjs +107 -0
- package/es/thought-chain/context.mjs +31 -0
- package/es/thought-chain/hooks/useCollapsible.mjs +36 -0
- package/es/thought-chain/index.mjs +5 -0
- package/es/thought-chain/interface.mjs +4 -0
- package/es/thought-chain/item.mjs +96 -0
- package/es/thought-chain/style/index.mjs +215 -0
- package/es/transition-collapse/TransitionCollapse.mjs +49 -0
- package/es/transition-collapse/index.mjs +10 -0
- package/es/transition-collapse/style/index.mjs +22 -0
- package/es/type-utility.mjs +1 -0
- package/es/use-x-agent/index.mjs +7 -0
- package/es/use-x-agent/use-x-agent.mjs +49 -0
- package/es/use-x-chat/index.mjs +5 -0
- package/es/use-x-chat/use-x-chat.mjs +97 -0
- package/es/use-x-chat/useSyncState.mjs +12 -0
- package/es/vc-util/Dom/addEventListener.mjs +15 -0
- package/es/vc-util/Dom/canUseDom.mjs +6 -0
- package/es/vc-util/Dom/class.mjs +19 -0
- package/es/vc-util/Dom/contains.mjs +6 -0
- package/es/vc-util/Dom/css.mjs +86 -0
- package/es/vc-util/Dom/dynamicCSS.mjs +70 -0
- package/es/vc-util/Dom/isVisible.mjs +20 -0
- package/es/vc-util/Dom/scrollLocker.mjs +66 -0
- package/es/vc-util/devWarning.mjs +9 -0
- package/es/vc-util/get.mjs +12 -0
- package/es/vc-util/isEqual.mjs +32 -0
- package/es/vc-util/isMobile.mjs +13 -0
- package/es/vc-util/set.mjs +14 -0
- package/es/vc-util/warning.mjs +26 -0
- package/es/version/index.mjs +4 -0
- package/es/version/token-meta.mjs +7 -0
- package/es/version/token.mjs +21 -0
- package/es/version/version.mjs +4 -0
- package/es/welcome/Welcome.mjs +91 -0
- package/es/welcome/index.mjs +5 -0
- package/es/welcome/interface.mjs +1 -0
- package/es/welcome/style/index.mjs +69 -0
- package/es/x-provider/context.mjs +31 -0
- package/es/x-provider/hooks/use-x-provider-context.mjs +21 -0
- package/es/x-provider/index.mjs +8 -0
- package/es/x-provider/index2.mjs +81 -0
- package/es/x-request/index.mjs +7 -0
- package/es/x-request/x-fetch.mjs +22 -0
- package/es/x-request/x-request.mjs +83 -0
- package/es/x-stream/index.mjs +5 -0
- package/es/x-stream/x-stream.mjs +64 -0
- package/lib/_util/cssinjs/Cache.js +1 -0
- package/lib/_util/cssinjs/Keyframes.js +1 -0
- package/lib/_util/cssinjs/StyleContext.js +1 -0
- package/lib/_util/cssinjs/hooks/useCSSVarRegister.js +1 -0
- package/lib/_util/cssinjs/hooks/useCacheToken.js +1 -0
- package/lib/_util/cssinjs/hooks/useCacheToken.tsx2.js +1 -0
- package/lib/_util/cssinjs/hooks/useGlobalCache.js +1 -0
- package/lib/_util/cssinjs/hooks/useHMR.js +1 -0
- package/lib/_util/cssinjs/hooks/useStyleRegister/cacheMapUtil.js +1 -0
- package/lib/_util/cssinjs/hooks/useStyleRegister/index.js +1 -0
- package/lib/_util/cssinjs/hooks/useStyleRegister/index.tsx2.js +2 -0
- package/lib/_util/cssinjs/index.js +1 -0
- package/lib/_util/cssinjs/linters/contentQuotesLinter.js +1 -0
- package/lib/_util/cssinjs/linters/hashedAnimationLinter.js +1 -0
- package/lib/_util/cssinjs/linters/index.js +1 -0
- package/lib/_util/cssinjs/linters/interface.js +1 -0
- package/lib/_util/cssinjs/linters/legacyNotSelectorLinter.js +1 -0
- package/lib/_util/cssinjs/linters/logicalPropertiesLinter.js +1 -0
- package/lib/_util/cssinjs/linters/parentSelectorLinter.js +1 -0
- package/lib/_util/cssinjs/linters/utils.js +1 -0
- package/lib/_util/cssinjs/theme/Theme.js +1 -0
- package/lib/_util/cssinjs/theme/ThemeCache.js +1 -0
- package/lib/_util/cssinjs/theme/createTheme.js +1 -0
- package/lib/_util/cssinjs/theme/index.js +1 -0
- package/lib/_util/cssinjs/theme/interface.js +1 -0
- package/lib/_util/cssinjs/transformers/interface.js +1 -0
- package/lib/_util/cssinjs/transformers/legacyLogicalProperties.js +1 -0
- package/lib/_util/cssinjs/transformers/px2rem.js +1 -0
- package/lib/_util/cssinjs/util.js +1 -0
- package/lib/_util/cssinjs-utils/_util/hooks/useUniqueMemo.js +1 -0
- package/lib/_util/cssinjs-utils/hooks/useCSP.js +1 -0
- package/lib/_util/cssinjs-utils/hooks/usePrefix.js +1 -0
- package/lib/_util/cssinjs-utils/hooks/useToken.js +1 -0
- package/lib/_util/cssinjs-utils/index.js +1 -0
- package/lib/_util/cssinjs-utils/interface/components.js +1 -0
- package/lib/_util/cssinjs-utils/interface/index.js +1 -0
- package/lib/_util/cssinjs-utils/util/calc/CSSCalculator.js +1 -0
- package/lib/_util/cssinjs-utils/util/calc/NumCalculator.js +1 -0
- package/lib/_util/cssinjs-utils/util/calc/calculator.js +1 -0
- package/lib/_util/cssinjs-utils/util/calc/index.js +1 -0
- package/lib/_util/cssinjs-utils/util/genStyleUtils.js +1 -0
- package/lib/_util/cssinjs-utils/util/getCompVarPrefix.js +1 -0
- package/lib/_util/cssinjs-utils/util/getComponentToken.js +1 -0
- package/lib/_util/cssinjs-utils/util/getDefaultComponentToken.js +1 -0
- package/lib/_util/cssinjs-utils/util/maxmin.js +1 -0
- package/lib/_util/cssinjs-utils/util/statistic.js +1 -0
- package/lib/_util/getScrollBarSize.js +1 -0
- package/lib/_util/getValue.js +1 -0
- package/lib/_util/hooks/use-event-callback.js +1 -0
- package/lib/_util/hooks/use-state.js +1 -0
- package/lib/_util/hooks/use-x-component-config.js +1 -0
- package/lib/_util/hooks/useMergedState.js +1 -0
- package/lib/_util/motion.js +1 -0
- package/lib/_util/pick-attrs.js +18 -0
- package/lib/_util/setStyle.js +1 -0
- package/lib/_util/supportsPassive.js +1 -0
- package/lib/_util/transition.js +1 -0
- package/lib/_util/type.js +1 -0
- package/lib/_util/warning.js +1 -0
- package/lib/attachments/Attachments.js +1 -0
- package/lib/attachments/Attachments2.js +5 -0
- package/lib/attachments/DropArea.js +1 -0
- package/lib/attachments/FileList/AudioIcon.js +1 -0
- package/lib/attachments/FileList/AudioIcon2.js +1 -0
- package/lib/attachments/FileList/FileList.js +1 -0
- package/lib/attachments/FileList/FileList2.js +57 -0
- package/lib/attachments/FileList/FileListCard.js +1 -0
- package/lib/attachments/FileList/Progress.js +1 -0
- package/lib/attachments/FileList/VideoIcon.js +1 -0
- package/lib/attachments/FileList/index.js +1 -0
- package/lib/attachments/PlaceholderUploader.js +1 -0
- package/lib/attachments/SilentUploader.js +1 -0
- package/lib/attachments/context.js +1 -0
- package/lib/attachments/index.js +1 -0
- package/lib/attachments/interface.js +1 -0
- package/lib/attachments/style/fileCard.js +1 -0
- package/lib/attachments/style/index.js +1 -0
- package/lib/attachments/util.js +1 -0
- package/lib/bubble/Bubble.js +1 -0
- package/lib/bubble/BubbleList.js +1 -0
- package/lib/bubble/context.js +1 -0
- package/lib/bubble/hooks/useDisplayData.js +1 -0
- package/lib/bubble/hooks/useListData.js +1 -0
- package/lib/bubble/hooks/useTypedEffect.js +1 -0
- package/lib/bubble/hooks/useTypingConfig.js +1 -0
- package/lib/bubble/index.js +1 -0
- package/lib/bubble/interface.js +1 -0
- package/lib/bubble/loading.js +1 -0
- package/lib/bubble/style/content.js +1 -0
- package/lib/bubble/style/index.js +1 -0
- package/lib/bubble/style/list.js +1 -0
- package/lib/conversations/Conversations.js +1 -0
- package/lib/conversations/ConversationsItem.js +1 -0
- package/lib/conversations/GroupTitle.js +1 -0
- package/lib/conversations/context.js +1 -0
- package/lib/conversations/hooks/useGroupable.js +1 -0
- package/lib/conversations/index.js +1 -0
- package/lib/conversations/interface.js +1 -0
- package/lib/conversations/style/index.js +1 -0
- package/lib/index.js +1 -0
- package/lib/prompts/Prompts.js +1 -0
- package/lib/prompts/index.js +1 -0
- package/lib/prompts/interface.js +1 -0
- package/lib/prompts/style/index.js +1 -0
- package/lib/sender/Sender.js +1 -0
- package/lib/sender/SenderHeader.js +1 -0
- package/lib/sender/StopLoading.js +1 -0
- package/lib/sender/components/ActionButton/context.js +1 -0
- package/lib/sender/components/ActionButton/index.js +1 -0
- package/lib/sender/components/ClearButton.js +1 -0
- package/lib/sender/components/LoadingButton.js +1 -0
- package/lib/sender/components/SendButton.js +1 -0
- package/lib/sender/components/SpeechButton/RecordingIcon.js +1 -0
- package/lib/sender/components/SpeechButton/index.js +1 -0
- package/lib/sender/context.js +1 -0
- package/lib/sender/index.js +1 -0
- package/lib/sender/interface.js +1 -0
- package/lib/sender/style/header.js +1 -0
- package/lib/sender/style/index.js +1 -0
- package/lib/sender/useSpeech.js +1 -0
- package/lib/suggestion/Suggestion.js +1 -0
- package/lib/suggestion/index.js +1 -0
- package/lib/suggestion/interface.js +1 -0
- package/lib/suggestion/style/index.js +1 -0
- package/lib/suggestion/useActive.js +1 -0
- package/lib/theme/components.js +1 -0
- package/lib/theme/cssinjs-utils.js +1 -0
- package/lib/theme/genStyleUtils.js +1 -0
- package/lib/theme/index.js +1 -0
- package/lib/theme/patch-antd.js +1 -0
- package/lib/theme/useToken.js +35 -0
- package/lib/thought-chain/ThoughtChain.js +1 -0
- package/lib/thought-chain/context.js +1 -0
- package/lib/thought-chain/hooks/useCollapsible.js +1 -0
- package/lib/thought-chain/index.js +1 -0
- package/lib/thought-chain/interface.js +1 -0
- package/lib/thought-chain/item.js +1 -0
- package/lib/thought-chain/style/index.js +1 -0
- package/lib/transition-collapse/TransitionCollapse.js +1 -0
- package/lib/transition-collapse/index.js +1 -0
- package/lib/transition-collapse/style/index.js +1 -0
- package/lib/type-utility.js +1 -0
- package/lib/use-x-agent/index.js +1 -0
- package/lib/use-x-agent/use-x-agent.js +1 -0
- package/lib/use-x-chat/index.js +1 -0
- package/lib/use-x-chat/use-x-chat.js +1 -0
- package/lib/use-x-chat/useSyncState.js +1 -0
- package/lib/vc-util/Dom/addEventListener.js +1 -0
- package/lib/vc-util/Dom/canUseDom.js +1 -0
- package/lib/vc-util/Dom/class.js +1 -0
- package/lib/vc-util/Dom/contains.js +1 -0
- package/lib/vc-util/Dom/css.js +1 -0
- package/lib/vc-util/Dom/dynamicCSS.js +1 -0
- package/lib/vc-util/Dom/isVisible.js +1 -0
- package/lib/vc-util/Dom/scrollLocker.js +1 -0
- package/lib/vc-util/devWarning.js +1 -0
- package/lib/vc-util/get.js +1 -0
- package/lib/vc-util/isEqual.js +1 -0
- package/lib/vc-util/isMobile.js +1 -0
- package/lib/vc-util/set.js +1 -0
- package/lib/vc-util/warning.js +1 -0
- package/lib/version/index.js +1 -0
- package/lib/version/token-meta.js +1 -0
- package/lib/version/token.js +1 -0
- package/lib/version/version.js +1 -0
- package/lib/welcome/Welcome.js +1 -0
- package/lib/welcome/index.js +1 -0
- package/lib/welcome/interface.js +1 -0
- package/lib/welcome/style/index.js +1 -0
- package/lib/x-provider/context.js +1 -0
- package/lib/x-provider/hooks/use-x-provider-context.js +1 -0
- package/lib/x-provider/index.js +1 -0
- package/lib/x-provider/index2.js +1 -0
- package/lib/x-request/index.js +1 -0
- package/lib/x-request/x-fetch.js +1 -0
- package/lib/x-request/x-request.js +1 -0
- package/lib/x-stream/index.js +1 -0
- package/lib/x-stream/x-stream.js +4 -0
- package/package.json +21 -13
- package/typings/bubble/Bubble.vue.d.ts +37 -0
- package/typings/bubble/index.d.ts +258 -0
- package/{dist/typings → typings}/bubble/interface.d.ts +6 -4
- package/{dist/typings → typings}/conversations/interface.d.ts +2 -1
- package/{dist/typings → typings}/sender/interface.d.ts +1 -1
- package/{dist/typings → typings}/x-provider/context.d.ts +9 -9
- package/dist/index.mjs +0 -34154
- package/dist/typings/bubble/Bubble.vue.d.ts +0 -35
- package/dist/typings/bubble/index.d.ts +0 -51
- /package/{dist/resolver → resolver-dist}/index.d.ts +0 -0
- /package/{dist/resolver → resolver-dist}/index.js +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/Cache.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/Keyframes.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/StyleContext.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/hooks/useCSSVarRegister.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/hooks/useCacheToken.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/hooks/useGlobalCache.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/hooks/useHMR.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/hooks/useStyleRegister/cacheMapUtil.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/hooks/useStyleRegister/index.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/index.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/linters/contentQuotesLinter.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/linters/hashedAnimationLinter.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/linters/index.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/linters/interface.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/linters/legacyNotSelectorLinter.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/linters/logicalPropertiesLinter.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/linters/parentSelectorLinter.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/linters/utils.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/theme/Theme.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/theme/ThemeCache.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/theme/createTheme.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/theme/index.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/theme/interface.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/transformers/interface.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/transformers/legacyLogicalProperties.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/transformers/px2rem.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs/util.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/_util/hooks/useUniqueMemo.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/hooks/useCSP.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/hooks/usePrefix.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/hooks/useToken.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/index.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/interface/components.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/interface/index.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/calc/CSSCalculator.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/calc/NumCalculator.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/calc/calculator.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/calc/index.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/genStyleUtils.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/getCompVarPrefix.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/getComponentToken.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/getDefaultComponentToken.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/maxmin.d.ts +0 -0
- /package/{dist/typings → typings}/_util/cssinjs-utils/util/statistic.d.ts +0 -0
- /package/{dist/typings → typings}/_util/getValue.d.ts +0 -0
- /package/{dist/typings → typings}/_util/hooks/use-event-callback.d.ts +0 -0
- /package/{dist/typings → typings}/_util/hooks/use-state.d.ts +0 -0
- /package/{dist/typings → typings}/_util/hooks/use-x-component-config.d.ts +0 -0
- /package/{dist/typings → typings}/_util/hooks/useMergedState.d.ts +0 -0
- /package/{dist/typings → typings}/_util/pick-attrs.d.ts +0 -0
- /package/{dist/typings → typings}/_util/type.d.ts +0 -0
- /package/{dist/typings → typings}/_util/warning.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/Attachments.vue.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/DropArea.vue.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/FileList/AudioIcon.vue.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/FileList/FileList.vue.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/FileList/FileListCard.vue.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/FileList/VideoIcon.vue.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/FileList/index.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/PlaceholderUploader.vue.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/SilentUploader.vue.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/context.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/index.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/interface.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/style/fileCard.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/attachments/util.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/BubbleList.vue.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/context.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/hooks/useDisplayData.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/hooks/useListData.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/hooks/useTypedEffect.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/hooks/useTypingConfig.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/loading.vue.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/style/content.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/bubble/style/list.d.ts +0 -0
- /package/{dist/typings → typings}/conversations/Conversations.vue.d.ts +0 -0
- /package/{dist/typings → typings}/conversations/ConversationsItem.vue.d.ts +0 -0
- /package/{dist/typings → typings}/conversations/GroupTitle.vue.d.ts +0 -0
- /package/{dist/typings → typings}/conversations/context.d.ts +0 -0
- /package/{dist/typings → typings}/conversations/hooks/useGroupable.d.ts +0 -0
- /package/{dist/typings → typings}/conversations/index.d.ts +0 -0
- /package/{dist/typings → typings}/conversations/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/index.d.ts +0 -0
- /package/{dist/typings → typings}/prompts/Prompts.vue.d.ts +0 -0
- /package/{dist/typings → typings}/prompts/index.d.ts +0 -0
- /package/{dist/typings → typings}/prompts/interface.d.ts +0 -0
- /package/{dist/typings → typings}/prompts/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/sender/Sender.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/SenderHeader.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/StopLoading.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/components/ActionButton/context.d.ts +0 -0
- /package/{dist/typings → typings}/sender/components/ActionButton/index.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/components/ClearButton.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/components/LoadingButton.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/components/SendButton.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/components/SpeechButton/RecordingIcon.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/components/SpeechButton/index.vue.d.ts +0 -0
- /package/{dist/typings → typings}/sender/context.d.ts +0 -0
- /package/{dist/typings → typings}/sender/index.d.ts +0 -0
- /package/{dist/typings → typings}/sender/style/header.d.ts +0 -0
- /package/{dist/typings → typings}/sender/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/sender/useSpeech.d.ts +0 -0
- /package/{dist/typings → typings}/suggestion/Suggestion.vue.d.ts +0 -0
- /package/{dist/typings → typings}/suggestion/index.d.ts +0 -0
- /package/{dist/typings → typings}/suggestion/interface.d.ts +0 -0
- /package/{dist/typings → typings}/suggestion/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/suggestion/useActive.d.ts +0 -0
- /package/{dist/typings → typings}/theme/components.d.ts +0 -0
- /package/{dist/typings → typings}/theme/cssinjs-utils.d.ts +0 -0
- /package/{dist/typings → typings}/theme/genStyleUtils.d.ts +0 -0
- /package/{dist/typings → typings}/theme/index.d.ts +0 -0
- /package/{dist/typings → typings}/theme/patch-antd.d.ts +0 -0
- /package/{dist/typings → typings}/theme/useToken.d.ts +0 -0
- /package/{dist/typings → typings}/thought-chain/ThoughtChain.vue.d.ts +0 -0
- /package/{dist/typings → typings}/thought-chain/context.d.ts +0 -0
- /package/{dist/typings → typings}/thought-chain/hooks/useCollapsible.d.ts +0 -0
- /package/{dist/typings → typings}/thought-chain/index.d.ts +0 -0
- /package/{dist/typings → typings}/thought-chain/interface.d.ts +0 -0
- /package/{dist/typings → typings}/thought-chain/item.vue.d.ts +0 -0
- /package/{dist/typings → typings}/thought-chain/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/transition-collapse/TransitionCollapse.vue.d.ts +0 -0
- /package/{dist/typings → typings}/transition-collapse/index.d.ts +0 -0
- /package/{dist/typings → typings}/transition-collapse/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/type-utility.d.ts +0 -0
- /package/{dist/typings → typings}/use-x-agent/index.d.ts +0 -0
- /package/{dist/typings → typings}/use-x-agent/use-x-agent.d.ts +0 -0
- /package/{dist/typings → typings}/use-x-chat/index.d.ts +0 -0
- /package/{dist/typings → typings}/use-x-chat/use-x-chat.d.ts +0 -0
- /package/{dist/typings → typings}/use-x-chat/useSyncState.d.ts +0 -0
- /package/{dist/typings → typings}/vc-util/Dom/canUseDom.d.ts +0 -0
- /package/{dist/typings → typings}/vc-util/Dom/contains.d.ts +0 -0
- /package/{dist/typings → typings}/vc-util/Dom/dynamicCSS.d.ts +0 -0
- /package/{dist/typings → typings}/vc-util/warning.d.ts +0 -0
- /package/{dist/typings → typings}/version/index.d.ts +0 -0
- /package/{dist/typings → typings}/version/version.d.ts +0 -0
- /package/{dist/typings → typings}/welcome/Welcome.vue.d.ts +0 -0
- /package/{dist/typings → typings}/welcome/index.d.ts +0 -0
- /package/{dist/typings → typings}/welcome/interface.d.ts +0 -0
- /package/{dist/typings → typings}/welcome/style/index.d.ts +0 -0
- /package/{dist/typings → typings}/x-provider/hooks/use-x-provider-context.d.ts +0 -0
- /package/{dist/typings → typings}/x-provider/index.d.ts +0 -0
- /package/{dist/typings → typings}/x-provider/index.vue.d.ts +0 -0
- /package/{dist/typings → typings}/x-request/index.d.ts +0 -0
- /package/{dist/typings → typings}/x-request/x-fetch.d.ts +0 -0
- /package/{dist/typings → typings}/x-request/x-request.d.ts +0 -0
- /package/{dist/typings → typings}/x-stream/index.d.ts +0 -0
- /package/{dist/typings → typings}/x-stream/x-stream.d.ts +0 -0
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
import { genStyleHooks as y } from "../../theme/genStyleUtils.mjs";
|
|
2
|
+
import x from "./fileCard.mjs";
|
|
3
|
+
import "vue";
|
|
4
|
+
import "../../_util/cssinjs/StyleContext.mjs";
|
|
5
|
+
import "../../_util/cssinjs/theme/ThemeCache.mjs";
|
|
6
|
+
import "../../_util/warning.mjs";
|
|
7
|
+
import "../../_util/cssinjs/transformers/legacyLogicalProperties.mjs";
|
|
8
|
+
import { merge as H } from "../../_util/cssinjs-utils/util/statistic.mjs";
|
|
9
|
+
function u(s) {
|
|
10
|
+
"@babel/helpers - typeof";
|
|
11
|
+
return u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
12
|
+
return typeof t;
|
|
13
|
+
} : function(t) {
|
|
14
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
15
|
+
}, u(s);
|
|
16
|
+
}
|
|
17
|
+
function $(s, t) {
|
|
18
|
+
if (u(s) != "object" || !s) return s;
|
|
19
|
+
var i = s[Symbol.toPrimitive];
|
|
20
|
+
if (i !== void 0) {
|
|
21
|
+
var e = i.call(s, t);
|
|
22
|
+
if (u(e) != "object") return e;
|
|
23
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
24
|
+
}
|
|
25
|
+
return (t === "string" ? String : Number)(s);
|
|
26
|
+
}
|
|
27
|
+
function w(s) {
|
|
28
|
+
var t = $(s, "string");
|
|
29
|
+
return u(t) == "symbol" ? t : t + "";
|
|
30
|
+
}
|
|
31
|
+
function c(s, t, i) {
|
|
32
|
+
return (t = w(t)) in s ? Object.defineProperty(s, t, {
|
|
33
|
+
value: i,
|
|
34
|
+
enumerable: !0,
|
|
35
|
+
configurable: !0,
|
|
36
|
+
writable: !0
|
|
37
|
+
}) : s[t] = i, s;
|
|
38
|
+
}
|
|
39
|
+
const o = Math.round;
|
|
40
|
+
function m(s, t) {
|
|
41
|
+
const i = s.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [], e = i.map((r) => parseFloat(r));
|
|
42
|
+
for (let r = 0; r < 3; r += 1)
|
|
43
|
+
e[r] = t(e[r] || 0, i[r] || "", r);
|
|
44
|
+
return i[3] ? e[3] = i[3].includes("%") ? e[3] / 100 : e[3] : e[3] = 1, e;
|
|
45
|
+
}
|
|
46
|
+
const S = (s, t, i) => i === 0 ? s : s / 100;
|
|
47
|
+
function b(s, t) {
|
|
48
|
+
const i = t || 255;
|
|
49
|
+
return s > i ? i : s < 0 ? 0 : s;
|
|
50
|
+
}
|
|
51
|
+
class _ {
|
|
52
|
+
constructor(t) {
|
|
53
|
+
c(this, "isValid", !0), c(this, "r", 0), c(this, "g", 0), c(this, "b", 0), c(this, "a", 1), c(this, "_h", void 0), c(this, "_s", void 0), c(this, "_l", void 0), c(this, "_v", void 0), c(this, "_max", void 0), c(this, "_min", void 0), c(this, "_brightness", void 0);
|
|
54
|
+
function i(e) {
|
|
55
|
+
return e[0] in t && e[1] in t && e[2] in t;
|
|
56
|
+
}
|
|
57
|
+
if (t) if (typeof t == "string") {
|
|
58
|
+
let r = function(n) {
|
|
59
|
+
return e.startsWith(n);
|
|
60
|
+
};
|
|
61
|
+
const e = t.trim();
|
|
62
|
+
/^#?[A-F\d]{3,8}$/i.test(e) ? this.fromHexString(e) : r("rgb") ? this.fromRgbString(e) : r("hsl") ? this.fromHslString(e) : (r("hsv") || r("hsb")) && this.fromHsvString(e);
|
|
63
|
+
} else if (t instanceof _)
|
|
64
|
+
this.r = t.r, this.g = t.g, this.b = t.b, this.a = t.a, this._h = t._h, this._s = t._s, this._l = t._l, this._v = t._v;
|
|
65
|
+
else if (i("rgb"))
|
|
66
|
+
this.r = b(t.r), this.g = b(t.g), this.b = b(t.b), this.a = typeof t.a == "number" ? b(t.a, 1) : 1;
|
|
67
|
+
else if (i("hsl"))
|
|
68
|
+
this.fromHsl(t);
|
|
69
|
+
else if (i("hsv"))
|
|
70
|
+
this.fromHsv(t);
|
|
71
|
+
else
|
|
72
|
+
throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(t));
|
|
73
|
+
}
|
|
74
|
+
// ======================= Setter =======================
|
|
75
|
+
setR(t) {
|
|
76
|
+
return this._sc("r", t);
|
|
77
|
+
}
|
|
78
|
+
setG(t) {
|
|
79
|
+
return this._sc("g", t);
|
|
80
|
+
}
|
|
81
|
+
setB(t) {
|
|
82
|
+
return this._sc("b", t);
|
|
83
|
+
}
|
|
84
|
+
setA(t) {
|
|
85
|
+
return this._sc("a", t, 1);
|
|
86
|
+
}
|
|
87
|
+
setHue(t) {
|
|
88
|
+
const i = this.toHsv();
|
|
89
|
+
return i.h = t, this._c(i);
|
|
90
|
+
}
|
|
91
|
+
// ======================= Getter =======================
|
|
92
|
+
/**
|
|
93
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
94
|
+
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
95
|
+
*/
|
|
96
|
+
getLuminance() {
|
|
97
|
+
function t(n) {
|
|
98
|
+
const l = n / 255;
|
|
99
|
+
return l <= 0.03928 ? l / 12.92 : Math.pow((l + 0.055) / 1.055, 2.4);
|
|
100
|
+
}
|
|
101
|
+
const i = t(this.r), e = t(this.g), r = t(this.b);
|
|
102
|
+
return 0.2126 * i + 0.7152 * e + 0.0722 * r;
|
|
103
|
+
}
|
|
104
|
+
getHue() {
|
|
105
|
+
if (typeof this._h > "u") {
|
|
106
|
+
const t = this.getMax() - this.getMin();
|
|
107
|
+
t === 0 ? this._h = 0 : this._h = o(60 * (this.r === this.getMax() ? (this.g - this.b) / t + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / t + 2 : (this.r - this.g) / t + 4));
|
|
108
|
+
}
|
|
109
|
+
return this._h;
|
|
110
|
+
}
|
|
111
|
+
getSaturation() {
|
|
112
|
+
if (typeof this._s > "u") {
|
|
113
|
+
const t = this.getMax() - this.getMin();
|
|
114
|
+
t === 0 ? this._s = 0 : this._s = t / this.getMax();
|
|
115
|
+
}
|
|
116
|
+
return this._s;
|
|
117
|
+
}
|
|
118
|
+
getLightness() {
|
|
119
|
+
return typeof this._l > "u" && (this._l = (this.getMax() + this.getMin()) / 510), this._l;
|
|
120
|
+
}
|
|
121
|
+
getValue() {
|
|
122
|
+
return typeof this._v > "u" && (this._v = this.getMax() / 255), this._v;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
126
|
+
* Note: this is not the b of HSB
|
|
127
|
+
* @see http://www.w3.org/TR/AERT#color-contrast
|
|
128
|
+
*/
|
|
129
|
+
getBrightness() {
|
|
130
|
+
return typeof this._brightness > "u" && (this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3), this._brightness;
|
|
131
|
+
}
|
|
132
|
+
// ======================== Func ========================
|
|
133
|
+
darken(t = 10) {
|
|
134
|
+
const i = this.getHue(), e = this.getSaturation();
|
|
135
|
+
let r = this.getLightness() - t / 100;
|
|
136
|
+
return r < 0 && (r = 0), this._c({
|
|
137
|
+
h: i,
|
|
138
|
+
s: e,
|
|
139
|
+
l: r,
|
|
140
|
+
a: this.a
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
lighten(t = 10) {
|
|
144
|
+
const i = this.getHue(), e = this.getSaturation();
|
|
145
|
+
let r = this.getLightness() + t / 100;
|
|
146
|
+
return r > 1 && (r = 1), this._c({
|
|
147
|
+
h: i,
|
|
148
|
+
s: e,
|
|
149
|
+
l: r,
|
|
150
|
+
a: this.a
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
155
|
+
* 0 means no mixing (return current color).
|
|
156
|
+
*/
|
|
157
|
+
mix(t, i = 50) {
|
|
158
|
+
const e = this._c(t), r = i / 100, n = (g) => (e[g] - this[g]) * r + this[g], l = {
|
|
159
|
+
r: o(n("r")),
|
|
160
|
+
g: o(n("g")),
|
|
161
|
+
b: o(n("b")),
|
|
162
|
+
a: o(n("a") * 100) / 100
|
|
163
|
+
};
|
|
164
|
+
return this._c(l);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Mix the color with pure white, from 0 to 100.
|
|
168
|
+
* Providing 0 will do nothing, providing 100 will always return white.
|
|
169
|
+
*/
|
|
170
|
+
tint(t = 10) {
|
|
171
|
+
return this.mix({
|
|
172
|
+
r: 255,
|
|
173
|
+
g: 255,
|
|
174
|
+
b: 255,
|
|
175
|
+
a: 1
|
|
176
|
+
}, t);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Mix the color with pure black, from 0 to 100.
|
|
180
|
+
* Providing 0 will do nothing, providing 100 will always return black.
|
|
181
|
+
*/
|
|
182
|
+
shade(t = 10) {
|
|
183
|
+
return this.mix({
|
|
184
|
+
r: 0,
|
|
185
|
+
g: 0,
|
|
186
|
+
b: 0,
|
|
187
|
+
a: 1
|
|
188
|
+
}, t);
|
|
189
|
+
}
|
|
190
|
+
onBackground(t) {
|
|
191
|
+
const i = this._c(t), e = this.a + i.a * (1 - this.a), r = (n) => o((this[n] * this.a + i[n] * i.a * (1 - this.a)) / e);
|
|
192
|
+
return this._c({
|
|
193
|
+
r: r("r"),
|
|
194
|
+
g: r("g"),
|
|
195
|
+
b: r("b"),
|
|
196
|
+
a: e
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
// ======================= Status =======================
|
|
200
|
+
isDark() {
|
|
201
|
+
return this.getBrightness() < 128;
|
|
202
|
+
}
|
|
203
|
+
isLight() {
|
|
204
|
+
return this.getBrightness() >= 128;
|
|
205
|
+
}
|
|
206
|
+
// ======================== MISC ========================
|
|
207
|
+
equals(t) {
|
|
208
|
+
return this.r === t.r && this.g === t.g && this.b === t.b && this.a === t.a;
|
|
209
|
+
}
|
|
210
|
+
clone() {
|
|
211
|
+
return this._c(this);
|
|
212
|
+
}
|
|
213
|
+
// ======================= Format =======================
|
|
214
|
+
toHexString() {
|
|
215
|
+
let t = "#";
|
|
216
|
+
const i = (this.r || 0).toString(16);
|
|
217
|
+
t += i.length === 2 ? i : "0" + i;
|
|
218
|
+
const e = (this.g || 0).toString(16);
|
|
219
|
+
t += e.length === 2 ? e : "0" + e;
|
|
220
|
+
const r = (this.b || 0).toString(16);
|
|
221
|
+
if (t += r.length === 2 ? r : "0" + r, typeof this.a == "number" && this.a >= 0 && this.a < 1) {
|
|
222
|
+
const n = o(this.a * 255).toString(16);
|
|
223
|
+
t += n.length === 2 ? n : "0" + n;
|
|
224
|
+
}
|
|
225
|
+
return t;
|
|
226
|
+
}
|
|
227
|
+
/** CSS support color pattern */
|
|
228
|
+
toHsl() {
|
|
229
|
+
return {
|
|
230
|
+
h: this.getHue(),
|
|
231
|
+
s: this.getSaturation(),
|
|
232
|
+
l: this.getLightness(),
|
|
233
|
+
a: this.a
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/** CSS support color pattern */
|
|
237
|
+
toHslString() {
|
|
238
|
+
const t = this.getHue(), i = o(this.getSaturation() * 100), e = o(this.getLightness() * 100);
|
|
239
|
+
return this.a !== 1 ? `hsla(${t},${i}%,${e}%,${this.a})` : `hsl(${t},${i}%,${e}%)`;
|
|
240
|
+
}
|
|
241
|
+
/** Same as toHsb */
|
|
242
|
+
toHsv() {
|
|
243
|
+
return {
|
|
244
|
+
h: this.getHue(),
|
|
245
|
+
s: this.getSaturation(),
|
|
246
|
+
v: this.getValue(),
|
|
247
|
+
a: this.a
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
toRgb() {
|
|
251
|
+
return {
|
|
252
|
+
r: this.r,
|
|
253
|
+
g: this.g,
|
|
254
|
+
b: this.b,
|
|
255
|
+
a: this.a
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
toRgbString() {
|
|
259
|
+
return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
|
|
260
|
+
}
|
|
261
|
+
toString() {
|
|
262
|
+
return this.toRgbString();
|
|
263
|
+
}
|
|
264
|
+
// ====================== Privates ======================
|
|
265
|
+
/** Return a new FastColor object with one channel changed */
|
|
266
|
+
_sc(t, i, e) {
|
|
267
|
+
const r = this.clone();
|
|
268
|
+
return r[t] = b(i, e), r;
|
|
269
|
+
}
|
|
270
|
+
_c(t) {
|
|
271
|
+
return new this.constructor(t);
|
|
272
|
+
}
|
|
273
|
+
getMax() {
|
|
274
|
+
return typeof this._max > "u" && (this._max = Math.max(this.r, this.g, this.b)), this._max;
|
|
275
|
+
}
|
|
276
|
+
getMin() {
|
|
277
|
+
return typeof this._min > "u" && (this._min = Math.min(this.r, this.g, this.b)), this._min;
|
|
278
|
+
}
|
|
279
|
+
fromHexString(t) {
|
|
280
|
+
const i = t.replace("#", "");
|
|
281
|
+
function e(r, n) {
|
|
282
|
+
return parseInt(i[r] + i[n || r], 16);
|
|
283
|
+
}
|
|
284
|
+
i.length < 6 ? (this.r = e(0), this.g = e(1), this.b = e(2), this.a = i[3] ? e(3) / 255 : 1) : (this.r = e(0, 1), this.g = e(2, 3), this.b = e(4, 5), this.a = i[6] ? e(6, 7) / 255 : 1);
|
|
285
|
+
}
|
|
286
|
+
fromHsl({
|
|
287
|
+
h: t,
|
|
288
|
+
s: i,
|
|
289
|
+
l: e,
|
|
290
|
+
a: r
|
|
291
|
+
}) {
|
|
292
|
+
if (this._h = t % 360, this._s = i, this._l = e, this.a = typeof r == "number" ? r : 1, i <= 0) {
|
|
293
|
+
const p = o(e * 255);
|
|
294
|
+
this.r = p, this.g = p, this.b = p;
|
|
295
|
+
}
|
|
296
|
+
let n = 0, l = 0, g = 0;
|
|
297
|
+
const h = t / 60, a = (1 - Math.abs(2 * e - 1)) * i, f = a * (1 - Math.abs(h % 2 - 1));
|
|
298
|
+
h >= 0 && h < 1 ? (n = a, l = f) : h >= 1 && h < 2 ? (n = f, l = a) : h >= 2 && h < 3 ? (l = a, g = f) : h >= 3 && h < 4 ? (l = f, g = a) : h >= 4 && h < 5 ? (n = f, g = a) : h >= 5 && h < 6 && (n = a, g = f);
|
|
299
|
+
const d = e - a / 2;
|
|
300
|
+
this.r = o((n + d) * 255), this.g = o((l + d) * 255), this.b = o((g + d) * 255);
|
|
301
|
+
}
|
|
302
|
+
fromHsv({
|
|
303
|
+
h: t,
|
|
304
|
+
s: i,
|
|
305
|
+
v: e,
|
|
306
|
+
a: r
|
|
307
|
+
}) {
|
|
308
|
+
this._h = t % 360, this._s = i, this._v = e, this.a = typeof r == "number" ? r : 1;
|
|
309
|
+
const n = o(e * 255);
|
|
310
|
+
if (this.r = n, this.g = n, this.b = n, i <= 0)
|
|
311
|
+
return;
|
|
312
|
+
const l = t / 60, g = Math.floor(l), h = l - g, a = o(e * (1 - i) * 255), f = o(e * (1 - i * h) * 255), d = o(e * (1 - i * (1 - h)) * 255);
|
|
313
|
+
switch (g) {
|
|
314
|
+
case 0:
|
|
315
|
+
this.g = d, this.b = a;
|
|
316
|
+
break;
|
|
317
|
+
case 1:
|
|
318
|
+
this.r = f, this.b = a;
|
|
319
|
+
break;
|
|
320
|
+
case 2:
|
|
321
|
+
this.r = a, this.b = d;
|
|
322
|
+
break;
|
|
323
|
+
case 3:
|
|
324
|
+
this.r = a, this.g = f;
|
|
325
|
+
break;
|
|
326
|
+
case 4:
|
|
327
|
+
this.r = d, this.g = a;
|
|
328
|
+
break;
|
|
329
|
+
case 5:
|
|
330
|
+
default:
|
|
331
|
+
this.g = a, this.b = f;
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
fromHsvString(t) {
|
|
336
|
+
const i = m(t, S);
|
|
337
|
+
this.fromHsv({
|
|
338
|
+
h: i[0],
|
|
339
|
+
s: i[1],
|
|
340
|
+
v: i[2],
|
|
341
|
+
a: i[3]
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
fromHslString(t) {
|
|
345
|
+
const i = m(t, S);
|
|
346
|
+
this.fromHsl({
|
|
347
|
+
h: i[0],
|
|
348
|
+
s: i[1],
|
|
349
|
+
l: i[2],
|
|
350
|
+
a: i[3]
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
fromRgbString(t) {
|
|
354
|
+
const i = m(t, (e, r) => (
|
|
355
|
+
// Convert percentage to number. e.g. 50% -> 128
|
|
356
|
+
r.includes("%") ? o(e / 100 * 255) : e
|
|
357
|
+
));
|
|
358
|
+
this.r = i[0], this.g = i[1], this.b = i[2], this.a = i[3];
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
const v = {
|
|
362
|
+
"&, *": {
|
|
363
|
+
boxSizing: "border-box"
|
|
364
|
+
}
|
|
365
|
+
}, M = (s) => {
|
|
366
|
+
const { componentCls: t, calc: i, antCls: e } = s, r = `${t}-drop-area`, n = `${t}-placeholder`;
|
|
367
|
+
return {
|
|
368
|
+
// ============================== Full Screen ==============================
|
|
369
|
+
[r]: {
|
|
370
|
+
position: "absolute",
|
|
371
|
+
inset: 0,
|
|
372
|
+
zIndex: s.zIndexPopupBase,
|
|
373
|
+
...v,
|
|
374
|
+
"&-on-body": {
|
|
375
|
+
position: "fixed",
|
|
376
|
+
inset: 0
|
|
377
|
+
},
|
|
378
|
+
"&-hide-placement": {
|
|
379
|
+
[`${n}-inner`]: {
|
|
380
|
+
display: "none"
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
[n]: {
|
|
384
|
+
padding: 0
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
"&": {
|
|
388
|
+
// ============================= Placeholder =============================
|
|
389
|
+
[n]: {
|
|
390
|
+
height: "100%",
|
|
391
|
+
borderRadius: s.borderRadius,
|
|
392
|
+
borderWidth: s.lineWidthBold,
|
|
393
|
+
borderStyle: "dashed",
|
|
394
|
+
borderColor: "transparent",
|
|
395
|
+
padding: s.padding,
|
|
396
|
+
position: "relative",
|
|
397
|
+
backdropFilter: "blur(10px)",
|
|
398
|
+
// background: token.colorBgPlaceholderHover,
|
|
399
|
+
...v,
|
|
400
|
+
[`${e}-upload-wrapper ${e}-upload${e}-upload-btn`]: {
|
|
401
|
+
padding: 0
|
|
402
|
+
},
|
|
403
|
+
[`&${n}-drag-in`]: {
|
|
404
|
+
borderColor: s.colorPrimaryHover
|
|
405
|
+
},
|
|
406
|
+
[`&${n}-disabled`]: {
|
|
407
|
+
opacity: 0.25,
|
|
408
|
+
pointerEvents: "none"
|
|
409
|
+
},
|
|
410
|
+
[`${n}-inner`]: {
|
|
411
|
+
gap: i(s.paddingXXS).div(2).equal()
|
|
412
|
+
},
|
|
413
|
+
[`${n}-icon`]: {
|
|
414
|
+
fontSize: s.fontSizeHeading2,
|
|
415
|
+
lineHeight: 1
|
|
416
|
+
},
|
|
417
|
+
[`${n}-title${n}-title`]: {
|
|
418
|
+
margin: 0,
|
|
419
|
+
fontSize: s.fontSize,
|
|
420
|
+
lineHeight: s.lineHeight
|
|
421
|
+
},
|
|
422
|
+
[`${n}-description`]: {}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}, B = (s) => {
|
|
427
|
+
const { componentCls: t, calc: i } = s, e = `${t}-list`, r = i(s.fontSize).mul(s.lineHeight).mul(2).add(s.paddingSM).add(s.paddingSM).equal();
|
|
428
|
+
return {
|
|
429
|
+
[t]: {
|
|
430
|
+
position: "relative",
|
|
431
|
+
width: "100%",
|
|
432
|
+
...v,
|
|
433
|
+
// =============================== File List ===============================
|
|
434
|
+
[e]: {
|
|
435
|
+
display: "flex",
|
|
436
|
+
flexWrap: "wrap",
|
|
437
|
+
gap: s.paddingSM,
|
|
438
|
+
fontSize: s.fontSize,
|
|
439
|
+
lineHeight: s.lineHeight,
|
|
440
|
+
color: s.colorText,
|
|
441
|
+
paddingBlock: s.paddingSM,
|
|
442
|
+
paddingInline: s.padding,
|
|
443
|
+
width: "100%",
|
|
444
|
+
background: s.colorBgContainer,
|
|
445
|
+
// Hide scrollbar
|
|
446
|
+
scrollbarWidth: "none",
|
|
447
|
+
"-ms-overflow-style": "none",
|
|
448
|
+
"&::-webkit-scrollbar": {
|
|
449
|
+
display: "none"
|
|
450
|
+
},
|
|
451
|
+
// Scroll
|
|
452
|
+
"&-overflow-scrollX, &-overflow-scrollY": {
|
|
453
|
+
"&:before, &:after": {
|
|
454
|
+
content: '""',
|
|
455
|
+
position: "absolute",
|
|
456
|
+
opacity: 0,
|
|
457
|
+
transition: `opacity ${s.motionDurationSlow}`,
|
|
458
|
+
zIndex: 1
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
"&-overflow-ping-start:before": {
|
|
462
|
+
opacity: 1
|
|
463
|
+
},
|
|
464
|
+
"&-overflow-ping-end:after": {
|
|
465
|
+
opacity: 1
|
|
466
|
+
},
|
|
467
|
+
"&-overflow-scrollX": {
|
|
468
|
+
overflowX: "auto",
|
|
469
|
+
overflowY: "hidden",
|
|
470
|
+
flexWrap: "nowrap",
|
|
471
|
+
"&:before, &:after": {
|
|
472
|
+
insetBlock: 0,
|
|
473
|
+
width: 8
|
|
474
|
+
},
|
|
475
|
+
"&:before": {
|
|
476
|
+
insetInlineStart: 0,
|
|
477
|
+
background: "linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"
|
|
478
|
+
},
|
|
479
|
+
"&:after": {
|
|
480
|
+
insetInlineEnd: 0,
|
|
481
|
+
background: "linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"
|
|
482
|
+
},
|
|
483
|
+
"&:dir(rtl)": {
|
|
484
|
+
"&:before": {
|
|
485
|
+
background: "linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"
|
|
486
|
+
},
|
|
487
|
+
"&:after": {
|
|
488
|
+
background: "linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
"&-overflow-scrollY": {
|
|
493
|
+
overflowX: "hidden",
|
|
494
|
+
overflowY: "auto",
|
|
495
|
+
maxHeight: i(r).mul(3).equal(),
|
|
496
|
+
"&:before, &:after": {
|
|
497
|
+
insetInline: 0,
|
|
498
|
+
height: 8
|
|
499
|
+
},
|
|
500
|
+
"&:before": {
|
|
501
|
+
insetBlockStart: 0,
|
|
502
|
+
background: "linear-gradient(to bottom, rgba(0,0,0,0.06), rgba(0,0,0,0));"
|
|
503
|
+
},
|
|
504
|
+
"&:after": {
|
|
505
|
+
insetBlockEnd: 0,
|
|
506
|
+
background: "linear-gradient(to top, rgba(0,0,0,0.06), rgba(0,0,0,0));"
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
// ======================================================================
|
|
510
|
+
// == Upload ==
|
|
511
|
+
// ======================================================================
|
|
512
|
+
"&-upload-btn": {
|
|
513
|
+
width: r,
|
|
514
|
+
height: r,
|
|
515
|
+
fontSize: s.fontSizeHeading2,
|
|
516
|
+
color: "#999"
|
|
517
|
+
},
|
|
518
|
+
// ======================================================================
|
|
519
|
+
// == PrevNext ==
|
|
520
|
+
// ======================================================================
|
|
521
|
+
"&-prev-btn, &-next-btn": {
|
|
522
|
+
position: "absolute",
|
|
523
|
+
top: "50%",
|
|
524
|
+
transform: "translateY(-50%)",
|
|
525
|
+
boxShadow: s.boxShadowTertiary,
|
|
526
|
+
opacity: 0,
|
|
527
|
+
pointerEvents: "none"
|
|
528
|
+
},
|
|
529
|
+
"&-prev-btn": {
|
|
530
|
+
left: {
|
|
531
|
+
_skip_check_: !0,
|
|
532
|
+
value: s.padding
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
"&-next-btn": {
|
|
536
|
+
right: {
|
|
537
|
+
_skip_check_: !0,
|
|
538
|
+
value: s.padding
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
"&:dir(ltr)": {
|
|
542
|
+
[`&${e}-overflow-ping-start ${e}-prev-btn`]: {
|
|
543
|
+
opacity: 1,
|
|
544
|
+
pointerEvents: "auto"
|
|
545
|
+
},
|
|
546
|
+
[`&${e}-overflow-ping-end ${e}-next-btn`]: {
|
|
547
|
+
opacity: 1,
|
|
548
|
+
pointerEvents: "auto"
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
"&:dir(rtl)": {
|
|
552
|
+
[`&${e}-overflow-ping-end ${e}-prev-btn`]: {
|
|
553
|
+
opacity: 1,
|
|
554
|
+
pointerEvents: "auto"
|
|
555
|
+
},
|
|
556
|
+
[`&${e}-overflow-ping-start ${e}-next-btn`]: {
|
|
557
|
+
opacity: 1,
|
|
558
|
+
pointerEvents: "auto"
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
}, z = (s) => {
|
|
565
|
+
const { colorBgContainer: t } = s;
|
|
566
|
+
return {
|
|
567
|
+
colorBgPlaceholderHover: new _(t).setA(0.85).toRgbString()
|
|
568
|
+
};
|
|
569
|
+
}, W = y(
|
|
570
|
+
"Attachments",
|
|
571
|
+
(s) => {
|
|
572
|
+
const t = H(s, {});
|
|
573
|
+
return [
|
|
574
|
+
M(t),
|
|
575
|
+
B(t),
|
|
576
|
+
x(t)
|
|
577
|
+
];
|
|
578
|
+
},
|
|
579
|
+
z
|
|
580
|
+
);
|
|
581
|
+
export {
|
|
582
|
+
W as default,
|
|
583
|
+
z as prepareComponentToken
|
|
584
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const E = (e) => e.indexOf("image/") === 0;
|
|
2
|
+
function g(e) {
|
|
3
|
+
return new Promise((a) => {
|
|
4
|
+
if (!e || !e.type || !E(e.type)) {
|
|
5
|
+
a("");
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const n = new Image();
|
|
9
|
+
if (n.onload = () => {
|
|
10
|
+
const { width: t, height: c } = n, o = t / c, i = o > 1 ? 200 : 200 * o, r = o > 1 ? 200 / o : 200, s = document.createElement("canvas");
|
|
11
|
+
s.width = i, s.height = r, s.style.cssText = `position: fixed; left: 0; top: 0; width: ${i}px; height: ${r}px; z-index: 9999; display: none;`, document.body.appendChild(s), s.getContext("2d").drawImage(n, 0, 0, i, r);
|
|
12
|
+
const d = s.toDataURL();
|
|
13
|
+
document.body.removeChild(s), window.URL.revokeObjectURL(n.src), a(d);
|
|
14
|
+
}, n.crossOrigin = "anonymous", e.type.startsWith("image/svg+xml")) {
|
|
15
|
+
const t = new FileReader();
|
|
16
|
+
t.onload = () => {
|
|
17
|
+
t.result && typeof t.result == "string" && (n.src = t.result);
|
|
18
|
+
}, t.readAsDataURL(e);
|
|
19
|
+
} else if (e.type.startsWith("image/gif")) {
|
|
20
|
+
const t = new FileReader();
|
|
21
|
+
t.onload = () => {
|
|
22
|
+
t.result && a(t.result);
|
|
23
|
+
}, t.readAsDataURL(e);
|
|
24
|
+
} else
|
|
25
|
+
n.src = window.URL.createObjectURL(e);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
E as isImageFileType,
|
|
30
|
+
g as previewImage
|
|
31
|
+
};
|