@cmstops/pro-compo 0.3.55 → 0.3.57
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/README.md +107 -107
- package/dist/gif.worker.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/appCenter/component.d.ts +0 -0
- package/es/appCenter/index.d.ts +2 -0
- package/es/appCenter/script/api.d.ts +11 -0
- package/es/appCenter/script/apps.d.ts +14 -0
- package/es/appCenter/script/permissionMap.d.ts +6 -0
- package/es/appCenter/script/routeMap.d.ts +4 -0
- package/es/appCenter/style/index.d.ts +1 -0
- package/es/appCenter/style/index.less +118 -118
- package/es/baseFilter/component.d.ts +0 -0
- package/es/baseFilter/components/FilterGroup.d.ts +0 -0
- package/es/baseFilter/components/filterItem.d.ts +0 -0
- package/es/baseFilter/index.d.ts +2 -0
- package/es/baseFilter/style/index.d.ts +1 -0
- package/es/baseFilter/style/index.less +45 -45
- package/es/baseFilter/useCalcWidth.d.ts +16 -0
- package/es/colorPalette/component.d.ts +0 -0
- package/es/colorPalette/components/colorPicker.d.ts +0 -0
- package/es/colorPalette/index.d.ts +2 -0
- package/es/colorPalette/style/index.d.ts +1 -0
- package/es/colorPalette/style/index.less +44 -44
- package/es/components.d.ts +5 -0
- package/es/config.d.ts +4 -0
- package/es/contentDetailList/__demo__/matrix/platform.d.ts +36 -0
- package/es/contentDetailList/component.d.ts +0 -0
- package/es/contentDetailList/components/Content/CompoItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/ContentListItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/DocItem/ApprovalStateMap/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/DocItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/DocMpItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/GroupPieceItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/KongoNavItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/LiveItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/MaccountItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/courseItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/funhdItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Content/index.d.ts +0 -0
- package/es/contentDetailList/components/CustomWrp/CustomItem.d.ts +0 -0
- package/es/contentDetailList/components/CustomWrp/index.d.ts +0 -0
- package/es/contentDetailList/components/Doc/index.d.ts +0 -0
- package/es/contentDetailList/components/Records/MatrixItem/index.d.ts +0 -0
- package/es/contentDetailList/components/Records/index.d.ts +0 -0
- package/es/contentDetailList/components/ShowQRCode/QrcodeView/index.d.ts +0 -0
- package/es/contentDetailList/components/ShowQRCode/index.d.ts +0 -0
- package/es/contentDetailList/index.d.ts +2 -0
- package/es/contentDetailList/script/api.d.ts +6 -0
- package/es/contentDetailList/style/ComoItem.less +99 -99
- package/es/contentDetailList/style/Content.less +49 -49
- package/es/contentDetailList/style/ContentListItem.less +132 -132
- package/es/contentDetailList/style/Doc.less +3 -3
- package/es/contentDetailList/style/DocMpItem.less +135 -135
- package/es/contentDetailList/style/GroupPieceItem.less +108 -108
- package/es/contentDetailList/style/KongoNavItem.less +104 -104
- package/es/contentDetailList/style/LiveItem.less +108 -108
- package/es/contentDetailList/style/MaccountItem.less +111 -111
- package/es/contentDetailList/style/MatrixItem.less +214 -214
- package/es/contentDetailList/style/courseItem.less +108 -108
- package/es/contentDetailList/style/funhdItem.less +108 -108
- package/es/contentDetailList/style/index.d.ts +1 -0
- package/es/contentModal/component.d.ts +0 -0
- package/es/contentModal/components/CompoList/CompoFilter/index.d.ts +0 -0
- package/es/contentModal/components/CompoList/index.d.ts +0 -0
- package/es/contentModal/components/ContentList/MediaFilter/index.d.ts +0 -0
- package/es/contentModal/components/ContentList/index.d.ts +0 -0
- package/es/contentModal/components/EqxiuList/MediaFilter/index.d.ts +0 -0
- package/es/contentModal/components/EqxiuList/index.d.ts +0 -0
- package/es/contentModal/components/LiveList/MediaFilter/index.d.ts +0 -0
- package/es/contentModal/components/LiveList/index.d.ts +0 -0
- package/es/contentModal/components/MpAccountList/MpAccountFilter/index.d.ts +0 -0
- package/es/contentModal/components/MpAccountList/index.d.ts +0 -0
- package/es/contentModal/components/MpContentList/MediaFilter/index.d.ts +0 -0
- package/es/contentModal/components/MpContentList/index.d.ts +0 -0
- package/es/contentModal/components/ViewAllColumn/MediaFilter/index.d.ts +0 -0
- package/es/contentModal/components/ViewAllColumn/columnTree/index.d.ts +0 -0
- package/es/contentModal/components/ViewAllColumn/index.d.ts +0 -0
- package/es/contentModal/components/storeBox/index.d.ts +0 -0
- package/es/contentModal/index.d.ts +2 -0
- package/es/contentModal/script/api.d.ts +14 -0
- package/es/contentModal/style/ViewAllColumn.less +68 -68
- package/es/contentModal/style/columnTree.less +32 -32
- package/es/contentModal/style/index.d.ts +1 -0
- package/es/contentModal/style/index.less +23 -23
- package/es/contentModal/style/storeBox.less +55 -55
- package/es/dataTags/component.d.ts +0 -0
- package/es/dataTags/index.d.ts +2 -0
- package/es/dataTags/style/index.d.ts +1 -0
- package/es/dataTags/style/index.less +73 -73
- package/es/docHistory/component.d.ts +0 -0
- package/es/docHistory/component.js +3 -2
- package/es/docHistory/components/DocDiffPanel/index.d.ts +0 -0
- package/es/docHistory/components/DocHistoryList/index.d.ts +0 -0
- package/es/docHistory/index.d.ts +2 -0
- package/es/docHistory/scripts/diff.d.ts +1 -0
- package/es/docHistory/scripts/useDocHistory.d.ts +10 -0
- package/es/docHistory/style/docDiffPanel.less +9 -9
- package/es/docHistory/style/docHistoryList.less +58 -58
- package/es/docHistory/style/index.d.ts +1 -0
- package/es/docHistory/style/index.less +32 -32
- package/es/docPreview/component.d.ts +0 -0
- package/es/docPreview/components/PreviewIframe.d.ts +0 -0
- package/es/docPreview/index.d.ts +2 -0
- package/es/docPreview/scripts/api.d.ts +1 -0
- package/es/docPreview/scripts/hook.d.ts +20 -0
- package/es/docPreview/style/index.d.ts +1 -0
- package/es/docPreview/style/index.less +129 -129
- package/es/docPreview/style/previewIframe.less +36 -36
- package/es/editMetaInfo/component.d.ts +0 -0
- package/es/editMetaInfo/components/metaInfoForm.d.ts +0 -0
- package/es/editMetaInfo/components/metaInfoForm.js +1 -3
- package/es/editMetaInfo/index.d.ts +2 -0
- package/es/editMetaInfo/script/api.d.ts +6 -0
- package/es/editMetaInfo/script/restaurants.d.ts +4 -0
- package/es/editMetaInfo/style/index.d.ts +1 -0
- package/es/editMetaInfo/style/index.less +60 -60
- package/es/emptyData/component.d.ts +0 -0
- package/es/emptyData/index.d.ts +2 -0
- package/es/emptyData/style/index.d.ts +1 -0
- package/es/emptyData/style/index.less +34 -34
- package/es/emptyData/svg/add.d.ts +0 -0
- package/es/gif.worker.js +3 -3
- package/es/hooks/assets.d.ts +1 -0
- package/es/hooks/batch.d.ts +8 -0
- package/es/hooks/dialogVisible.d.ts +8 -0
- package/es/hooks/source.d.ts +9 -0
- package/es/hooks/toggle.d.ts +6 -0
- package/es/hooks/useAttachement.d.ts +26 -0
- package/es/hooks/useLocalStorage.d.ts +9 -0
- package/es/hooks/useLocalStorage.js +2 -1
- package/es/hooks/useMediaContext.d.ts +12 -0
- package/es/hooks/usePopper.d.ts +8 -0
- package/es/hooks/useSelection.d.ts +23 -0
- package/es/hooks/useUpload.d.ts +29 -0
- package/es/hooks/useUpload.js +84 -3
- package/es/hooks/user.d.ts +9 -0
- package/es/imageCrop/component.d.ts +0 -0
- package/es/imageCrop/index.d.ts +2 -0
- package/es/imageCrop/script/api.d.ts +1 -0
- package/es/imageCrop/style/cropper.less +291 -291
- package/es/imageCrop/style/imageCropper.less +133 -133
- package/es/imageCrop/style/index.d.ts +1 -0
- package/es/imageCrop/style/index.less +2 -2
- package/es/index.d.ts +29 -0
- package/es/index.less +29 -29
- package/es/mediaFilter/component.d.ts +0 -0
- package/es/mediaFilter/components/DocFilter.d.ts +0 -0
- package/es/mediaFilter/components/FilterGroup.d.ts +0 -0
- package/es/mediaFilter/components/FilterGroup.js +1 -1
- package/es/mediaFilter/components/FilterItem.d.ts +0 -0
- package/es/mediaFilter/components/MpAccountFilter.d.ts +0 -0
- package/es/mediaFilter/components/MpContentFilter.d.ts +0 -0
- package/es/mediaFilter/index.d.ts +3 -0
- package/es/mediaFilter/script/optionsGetter.d.ts +26 -0
- package/es/mediaFilter/script/types.d.ts +16 -0
- package/es/mediaFilter/style/index.d.ts +1 -0
- package/es/mediaFilter/style/index.less +115 -115
- package/es/mediaView/component.d.ts +0 -0
- package/es/mediaView/index.d.ts +2 -0
- package/es/mediaView/style/index.d.ts +1 -0
- package/es/mediaView/style/index.less +71 -71
- package/es/messageBox/component.d.ts +0 -0
- package/es/messageBox/index.d.ts +2 -0
- package/es/messageBox/list.d.ts +0 -0
- package/es/messageBox/list.js +1 -1
- package/es/messageBox/script/api.d.ts +6 -0
- package/es/messageBox/style/index.d.ts +1 -0
- package/es/messageBox/style/index.less +71 -71
- package/es/previousVersion/component.d.ts +0 -0
- package/es/previousVersion/index.d.ts +2 -0
- package/es/previousVersion/script/api.d.ts +15 -0
- package/es/previousVersion/script/tool.d.ts +6 -0
- package/es/previousVersion/style/index.d.ts +1 -0
- package/es/previousVersion/style/index.less +209 -209
- package/es/resourceGridList/component.d.ts +0 -0
- package/es/resourceGridList/components/FileTypeThumb/index.d.ts +0 -0
- package/es/resourceGridList/components/FileTypeThumb/index.js +3 -6
- package/es/resourceGridList/index.d.ts +2 -0
- package/es/resourceGridList/style/FileTypeThumb.less +96 -96
- package/es/resourceGridList/style/index.d.ts +1 -0
- package/es/resourceGridList/style/index.less +233 -233
- package/es/resourceModal/component.d.ts +0 -0
- package/es/resourceModal/components/MediaPreviewer/index.d.ts +0 -0
- package/es/resourceModal/components/MediaSelection/DocAiMediaSelected/index.d.ts +0 -0
- package/es/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.d.ts +0 -0
- package/es/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.js +3 -6
- package/es/resourceModal/components/MediaSelection/MainContent/index.d.ts +0 -0
- package/es/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceFilter.d.ts +0 -0
- package/es/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceList.d.ts +0 -0
- package/es/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceList.js +3 -3
- package/es/resourceModal/components/MediaSelection/SystemResourceSelected/index.d.ts +0 -0
- package/es/resourceModal/components/MediaSelection/ToolbarSearch/index.d.ts +0 -0
- package/es/resourceModal/components/MediaSelection/index.d.ts +0 -0
- package/es/resourceModal/index.d.ts +2 -0
- package/es/resourceModal/script/api.d.ts +25 -0
- package/es/resourceModal/script/mediaSelection.d.ts +14 -0
- package/es/resourceModal/style/DocAiMediaSelected.less +55 -55
- package/es/resourceModal/style/FileTypeThumb.less +205 -205
- package/es/resourceModal/style/MainContent.less +222 -222
- package/es/resourceModal/style/MediaPreviewer.less +71 -71
- package/es/resourceModal/style/MediaSelection.less +69 -69
- package/es/resourceModal/style/SystemResourceSelected.less +154 -154
- package/es/resourceModal/style/ToolbarSearch.less +53 -53
- package/es/resourceModal/style/index.d.ts +1 -0
- package/es/resourceModal/style/index.less +18 -18
- package/es/selectAvatarList/component.d.ts +0 -0
- package/es/selectAvatarList/index.d.ts +2 -0
- package/es/selectAvatarList/style/index.d.ts +1 -0
- package/es/selectAvatarList/style/index.less +4 -4
- package/es/selectGategory/component.d.ts +0 -0
- package/es/selectGategory/components/ColumnSelection/index.d.ts +0 -0
- package/es/selectGategory/index.d.ts +2 -0
- package/es/selectGategory/script/api.d.ts +6 -0
- package/es/selectGategory/style/ColumnSelection.less +190 -190
- package/es/selectGategory/style/index.d.ts +1 -0
- package/es/selectGategory/style/index.less +40 -40
- package/es/selectResourceModal/component.d.ts +0 -0
- package/es/selectResourceModal/components/ListCardWrapper/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListCardWrapper/index.js +9 -11
- package/es/selectResourceModal/components/ListContent/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListContentLocal/components/Upload.d.ts +0 -0
- package/es/selectResourceModal/components/ListContentLocal/components/Upload.js +18 -3
- package/es/selectResourceModal/components/ListContentLocal/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListFilter/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListFilter/scripts/api.d.ts +1 -0
- package/es/selectResourceModal/components/ListSelected/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListTabs/index.d.ts +0 -0
- package/es/selectResourceModal/index.d.ts +2 -0
- package/es/selectResourceModal/scripts/useResourceSelect.d.ts +7 -0
- package/es/selectResourceModal/style/index.d.ts +1 -0
- package/es/selectResourceModal/style/index.less +70 -70
- package/es/selectResourceModal/style/listCardWrapper.less +97 -97
- package/es/selectResourceModal/style/listContent.less +5 -5
- package/es/selectResourceModal/style/listContentLocal.less +26 -26
- package/es/selectResourceModal/style/listFilter.less +41 -41
- package/es/selectResourceModal/style/listSelected.less +90 -90
- package/es/selectThumb/component.d.ts +0 -0
- package/es/selectThumb/components/card.d.ts +0 -0
- package/es/selectThumb/components/card.js +6 -10
- package/es/selectThumb/components/colorPalette.d.ts +0 -0
- package/es/selectThumb/components/colorPicker.d.ts +0 -0
- package/es/selectThumb/index.d.ts +2 -0
- package/es/selectThumb/style/card.less +95 -95
- package/es/selectThumb/style/colorPalette.less +30 -30
- package/es/selectThumb/style/index.d.ts +1 -0
- package/es/style/index.less +1 -1
- package/es/thumbCard/component.d.ts +0 -0
- package/es/thumbCard/components/ThumbUploading/index.d.ts +0 -0
- package/es/thumbCard/index.d.ts +2 -0
- package/es/thumbCard/style/index.d.ts +1 -0
- package/es/thumbCard/style/index.less +90 -90
- package/es/thumbCard/style/thumbUploading.less +26 -26
- package/es/typeIcons/component.d.ts +0 -0
- package/es/typeIcons/index.d.ts +2 -0
- package/es/typeIcons/style/index.d.ts +1 -0
- package/es/typeIcons/style/index.less +6 -6
- package/es/uploadBefore/component.d.ts +0 -0
- package/es/uploadBefore/components/UploadBefore.d.ts +0 -0
- package/es/uploadBefore/components/UploadForClick.d.ts +0 -0
- package/es/uploadBefore/index.d.ts +2 -0
- package/es/uploadBefore/script/api.d.ts +16 -0
- package/es/uploadBefore/script/fileTypeAdapter.d.ts +39 -0
- package/es/uploadBefore/script/fileUpload.d.ts +7 -0
- package/es/uploadBefore/script/uploadHooks.d.ts +55 -0
- package/es/uploadBefore/style/index.d.ts +1 -0
- package/es/uploadBefore/style/index.less +144 -144
- package/es/uploadBefore/utils/dragUploadEvent.d.ts +0 -0
- package/es/uploadStep/component.d.ts +0 -0
- package/es/uploadStep/index.d.ts +2 -0
- package/es/uploadStep/script/fileTypeAdapter.d.ts +20 -0
- package/es/uploadStep/style/index.d.ts +1 -0
- package/es/uploadStep/style/index.less +152 -152
- package/es/userAvater/component.d.ts +0 -0
- package/es/userAvater/index.d.ts +2 -0
- package/es/userAvater/script/api.d.ts +8 -0
- package/es/userAvater/style/index.d.ts +1 -0
- package/es/userAvater/style/index.less +54 -54
- package/es/userDirector/component.d.ts +0 -0
- package/es/userDirector/components/userTree.d.ts +0 -0
- package/es/userDirector/index.d.ts +2 -0
- package/es/userDirector/script/api.d.ts +10 -0
- package/es/userDirector/style/index.d.ts +1 -0
- package/es/utils/auth.d.ts +5 -0
- package/es/utils/date.d.ts +3 -0
- package/es/utils/doc.d.ts +76 -0
- package/es/utils/filter.d.ts +9 -0
- package/es/utils/index.d.ts +17 -0
- package/es/utils/request.d.ts +9 -0
- package/es/utils/resource.d.ts +4 -0
- package/es/utils/transcodeMedia.d.ts +13 -0
- package/es/utils/tusUpload.d.ts +16 -0
- package/es/utils/typeMap.d.ts +185 -0
- package/es/utils/uploadCatalog.d.ts +1 -0
- package/es/videoThumb/component.d.ts +0 -0
- package/es/videoThumb/index.d.ts +2 -0
- package/es/videoThumb/scripts/api.d.ts +9 -0
- package/es/videoThumb/scripts/useVideoThumbs.d.ts +7 -0
- package/es/videoThumb/style/index.d.ts +1 -0
- package/es/videoThumb/style/index.less +61 -61
- package/lib/appCenter/style/index.less +118 -118
- package/lib/baseFilter/style/index.less +45 -45
- package/lib/colorPalette/style/index.less +44 -44
- package/lib/contentDetailList/style/ComoItem.less +99 -99
- package/lib/contentDetailList/style/Content.less +49 -49
- package/lib/contentDetailList/style/ContentListItem.less +132 -132
- package/lib/contentDetailList/style/Doc.less +3 -3
- package/lib/contentDetailList/style/DocMpItem.less +135 -135
- package/lib/contentDetailList/style/GroupPieceItem.less +108 -108
- package/lib/contentDetailList/style/KongoNavItem.less +104 -104
- package/lib/contentDetailList/style/LiveItem.less +108 -108
- package/lib/contentDetailList/style/MaccountItem.less +111 -111
- package/lib/contentDetailList/style/MatrixItem.less +214 -214
- package/lib/contentDetailList/style/courseItem.less +108 -108
- package/lib/contentDetailList/style/funhdItem.less +108 -108
- package/lib/contentModal/style/ViewAllColumn.less +68 -68
- package/lib/contentModal/style/columnTree.less +32 -32
- package/lib/contentModal/style/index.less +23 -23
- package/lib/contentModal/style/storeBox.less +55 -55
- package/lib/dataTags/style/index.less +73 -73
- package/lib/docHistory/component.js +3 -2
- package/lib/docHistory/style/docDiffPanel.less +9 -9
- package/lib/docHistory/style/docHistoryList.less +58 -58
- package/lib/docHistory/style/index.less +32 -32
- package/lib/docPreview/style/index.less +129 -129
- package/lib/docPreview/style/previewIframe.less +36 -36
- package/lib/editMetaInfo/components/metaInfoForm.js +1 -3
- package/lib/editMetaInfo/style/index.less +60 -60
- package/lib/emptyData/style/index.less +34 -34
- package/lib/hooks/useLocalStorage.js +2 -1
- package/lib/hooks/useUpload.js +85 -2
- package/lib/imageCrop/style/cropper.less +291 -291
- package/lib/imageCrop/style/imageCropper.less +133 -133
- package/lib/imageCrop/style/index.less +2 -2
- package/lib/index.less +29 -29
- package/lib/mediaFilter/components/FilterGroup.js +1 -1
- package/lib/mediaFilter/style/index.less +115 -115
- package/lib/mediaView/style/index.less +71 -71
- package/lib/messageBox/list.js +1 -1
- package/lib/messageBox/style/index.less +71 -71
- package/lib/previousVersion/style/index.less +209 -209
- package/lib/resourceGridList/components/FileTypeThumb/index.js +3 -6
- package/lib/resourceGridList/style/FileTypeThumb.less +96 -96
- package/lib/resourceGridList/style/index.less +233 -233
- package/lib/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.js +3 -6
- package/lib/resourceModal/components/MediaSelection/SystemResourceSelected/components/SystemResourceList.js +2 -2
- package/lib/resourceModal/style/DocAiMediaSelected.less +55 -55
- package/lib/resourceModal/style/FileTypeThumb.less +205 -205
- package/lib/resourceModal/style/MainContent.less +222 -222
- package/lib/resourceModal/style/MediaPreviewer.less +71 -71
- package/lib/resourceModal/style/MediaSelection.less +69 -69
- package/lib/resourceModal/style/SystemResourceSelected.less +154 -154
- package/lib/resourceModal/style/ToolbarSearch.less +53 -53
- package/lib/resourceModal/style/index.less +18 -18
- package/lib/selectAvatarList/style/index.less +4 -4
- package/lib/selectGategory/style/ColumnSelection.less +190 -190
- package/lib/selectGategory/style/index.less +40 -40
- package/lib/selectResourceModal/components/ListCardWrapper/index.js +9 -11
- package/lib/selectResourceModal/components/ListContentLocal/components/Upload.js +16 -1
- package/lib/selectResourceModal/style/index.less +70 -70
- package/lib/selectResourceModal/style/listCardWrapper.less +97 -97
- package/lib/selectResourceModal/style/listContent.less +5 -5
- package/lib/selectResourceModal/style/listContentLocal.less +26 -26
- package/lib/selectResourceModal/style/listFilter.less +41 -41
- package/lib/selectResourceModal/style/listSelected.less +90 -90
- package/lib/selectThumb/components/card.js +6 -10
- package/lib/selectThumb/style/card.less +95 -95
- package/lib/selectThumb/style/colorPalette.less +30 -30
- package/lib/style/index.less +1 -1
- package/lib/thumbCard/style/index.less +90 -90
- package/lib/thumbCard/style/thumbUploading.less +26 -26
- package/lib/typeIcons/style/index.less +6 -6
- package/lib/uploadBefore/style/index.less +144 -144
- package/lib/uploadStep/style/index.less +152 -152
- package/lib/userAvater/style/index.less +54 -54
- package/lib/videoThumb/style/index.less +61 -61
- package/package.json +137 -137
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
@import './previewIframe.less';
|
|
2
|
-
|
|
3
|
-
// 变量
|
|
4
|
-
@qrCodeWidth: 300px;
|
|
5
|
-
|
|
6
|
-
.doc-preview-container {
|
|
7
|
-
position: fixed;
|
|
8
|
-
// 遮罩层
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
z-index: 10;
|
|
12
|
-
display: flex;
|
|
13
|
-
gap: 40px;
|
|
14
|
-
align-items: center;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
19
|
-
user-select: none;
|
|
20
|
-
|
|
21
|
-
.loading-wrapper {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.doc-preview-share {
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
align-items: center;
|
|
33
|
-
width: @qrCodeWidth;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
background-color: #fff;
|
|
36
|
-
border-radius: 12px;
|
|
37
|
-
|
|
38
|
-
&-img {
|
|
39
|
-
width: @qrCodeWidth;
|
|
40
|
-
height: @qrCodeWidth;
|
|
41
|
-
|
|
42
|
-
img {
|
|
43
|
-
width: 100%;
|
|
44
|
-
height: 100%;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&-hint {
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
width: calc(100% - 40px);
|
|
52
|
-
height: calc(100% - 40px);
|
|
53
|
-
margin-top: 20px;
|
|
54
|
-
margin-left: 20px;
|
|
55
|
-
color: #4886ff;
|
|
56
|
-
background-color: #edf3ff;
|
|
57
|
-
border-radius: 6px;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&-tips,
|
|
62
|
-
&-header,
|
|
63
|
-
&-link,
|
|
64
|
-
&-action {
|
|
65
|
-
box-sizing: border-box;
|
|
66
|
-
width: 100%;
|
|
67
|
-
padding: 0 20px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// 备注
|
|
71
|
-
&-tips {
|
|
72
|
-
color: #333;
|
|
73
|
-
font-size: 14px;
|
|
74
|
-
text-align: center;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// header 控件
|
|
78
|
-
&-header {
|
|
79
|
-
display: flex;
|
|
80
|
-
align-items: center;
|
|
81
|
-
justify-content: space-between;
|
|
82
|
-
margin: 10px 0 5px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// 链接展示
|
|
86
|
-
&-link {
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
width: 100%;
|
|
90
|
-
|
|
91
|
-
&-value {
|
|
92
|
-
display: -webkit-box;
|
|
93
|
-
box-sizing: border-box;
|
|
94
|
-
padding: 6px 10px;
|
|
95
|
-
overflow: hidden;
|
|
96
|
-
color: #86909c;
|
|
97
|
-
line-height: 25px;
|
|
98
|
-
word-break: break-all;
|
|
99
|
-
background: #f2f2f2;
|
|
100
|
-
-webkit-line-clamp: 2;
|
|
101
|
-
-webkit-box-orient: vertical;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&-hint {
|
|
105
|
-
margin-top: 10px;
|
|
106
|
-
color: #86909c;
|
|
107
|
-
font-size: 12px;
|
|
108
|
-
text-align: center;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&-action {
|
|
113
|
-
display: flex;
|
|
114
|
-
gap: 10px;
|
|
115
|
-
align-items: center;
|
|
116
|
-
justify-content: center;
|
|
117
|
-
margin: 20px 0;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.preview-close {
|
|
122
|
-
position: absolute;
|
|
123
|
-
top: 20px;
|
|
124
|
-
right: 20px;
|
|
125
|
-
color: #fff;
|
|
126
|
-
font-size: 20px;
|
|
127
|
-
cursor: pointer;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
1
|
+
@import './previewIframe.less';
|
|
2
|
+
|
|
3
|
+
// 变量
|
|
4
|
+
@qrCodeWidth: 300px;
|
|
5
|
+
|
|
6
|
+
.doc-preview-container {
|
|
7
|
+
position: fixed;
|
|
8
|
+
// 遮罩层
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
z-index: 10;
|
|
12
|
+
display: flex;
|
|
13
|
+
gap: 40px;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
19
|
+
user-select: none;
|
|
20
|
+
|
|
21
|
+
.loading-wrapper {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.doc-preview-share {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: center;
|
|
33
|
+
width: @qrCodeWidth;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
background-color: #fff;
|
|
36
|
+
border-radius: 12px;
|
|
37
|
+
|
|
38
|
+
&-img {
|
|
39
|
+
width: @qrCodeWidth;
|
|
40
|
+
height: @qrCodeWidth;
|
|
41
|
+
|
|
42
|
+
img {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&-hint {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
width: calc(100% - 40px);
|
|
52
|
+
height: calc(100% - 40px);
|
|
53
|
+
margin-top: 20px;
|
|
54
|
+
margin-left: 20px;
|
|
55
|
+
color: #4886ff;
|
|
56
|
+
background-color: #edf3ff;
|
|
57
|
+
border-radius: 6px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&-tips,
|
|
62
|
+
&-header,
|
|
63
|
+
&-link,
|
|
64
|
+
&-action {
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
width: 100%;
|
|
67
|
+
padding: 0 20px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 备注
|
|
71
|
+
&-tips {
|
|
72
|
+
color: #333;
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
text-align: center;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// header 控件
|
|
78
|
+
&-header {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
margin: 10px 0 5px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 链接展示
|
|
86
|
+
&-link {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
width: 100%;
|
|
90
|
+
|
|
91
|
+
&-value {
|
|
92
|
+
display: -webkit-box;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
padding: 6px 10px;
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
color: #86909c;
|
|
97
|
+
line-height: 25px;
|
|
98
|
+
word-break: break-all;
|
|
99
|
+
background: #f2f2f2;
|
|
100
|
+
-webkit-line-clamp: 2;
|
|
101
|
+
-webkit-box-orient: vertical;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&-hint {
|
|
105
|
+
margin-top: 10px;
|
|
106
|
+
color: #86909c;
|
|
107
|
+
font-size: 12px;
|
|
108
|
+
text-align: center;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&-action {
|
|
113
|
+
display: flex;
|
|
114
|
+
gap: 10px;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
margin: 20px 0;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.preview-close {
|
|
122
|
+
position: absolute;
|
|
123
|
+
top: 20px;
|
|
124
|
+
right: 20px;
|
|
125
|
+
color: #fff;
|
|
126
|
+
font-size: 20px;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
.iframe-container {
|
|
2
|
-
position: relative;
|
|
3
|
-
height: 95vh;
|
|
4
|
-
max-height: 750px;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
aspect-ratio: 390 / 750;
|
|
7
|
-
|
|
8
|
-
&::-webkit-scrollbar {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
img {
|
|
13
|
-
position: absolute;
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.iframe-content {
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: calc(100% / 8);
|
|
21
|
-
left: 19px;
|
|
22
|
-
z-index: 1000;
|
|
23
|
-
width: calc(100% - 38px);
|
|
24
|
-
height: calc(100% - 100% / 8 - 16px);
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
border-bottom-right-radius: 40px;
|
|
27
|
-
border-bottom-left-radius: 40px;
|
|
28
|
-
|
|
29
|
-
iframe {
|
|
30
|
-
width: calc(100% + 20px);
|
|
31
|
-
height: 100%;
|
|
32
|
-
border: none;
|
|
33
|
-
outline: none;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
.iframe-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
height: 95vh;
|
|
4
|
+
max-height: 750px;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
aspect-ratio: 390 / 750;
|
|
7
|
+
|
|
8
|
+
&::-webkit-scrollbar {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
img {
|
|
13
|
+
position: absolute;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.iframe-content {
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: calc(100% / 8);
|
|
21
|
+
left: 19px;
|
|
22
|
+
z-index: 1000;
|
|
23
|
+
width: calc(100% - 38px);
|
|
24
|
+
height: calc(100% - 100% / 8 - 16px);
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
border-bottom-right-radius: 40px;
|
|
27
|
+
border-bottom-left-radius: 40px;
|
|
28
|
+
|
|
29
|
+
iframe {
|
|
30
|
+
width: calc(100% + 20px);
|
|
31
|
+
height: 100%;
|
|
32
|
+
border: none;
|
|
33
|
+
outline: none;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -185,7 +185,6 @@ const _sfc_main = defineComponent({
|
|
|
185
185
|
data.online_time = data.online_time && Math.floor(data.online_time / 1e3);
|
|
186
186
|
data.offline_time = data.offline_time && Math.floor(data.offline_time / 1e3);
|
|
187
187
|
data.keywords = data.keywords && data.keywords.join(",");
|
|
188
|
-
data.author = data.author && data.author.join(",");
|
|
189
188
|
data.duty_editor = data.duty_editor && data.duty_editor.join(",");
|
|
190
189
|
data.extra_attrs = data.extra_attrs && data.extra_attrs.join(",");
|
|
191
190
|
data.relation_news = data.relation_news && JSON.stringify(data.relation_news);
|
|
@@ -215,7 +214,6 @@ const _sfc_main = defineComponent({
|
|
|
215
214
|
data.online_time = data.online_time && parseInt(data.online_time, 10) * 1e3 || "";
|
|
216
215
|
data.offline_time = data.offline_time && parseInt(data.offline_time, 10) * 1e3 || "";
|
|
217
216
|
data.keywords = data.keywords && data.keywords.split(",");
|
|
218
|
-
data.author = data.author && data.author.split(",");
|
|
219
217
|
data.duty_editor = data.duty_editor && data.duty_editor.split(",") || "";
|
|
220
218
|
data.extra_attrs = data.extra_attrs && data.extra_attrs.split(",") || "";
|
|
221
219
|
data.relation_news = data.relation_news && JSON.parse(data.relation_news) || [];
|
|
@@ -226,7 +224,7 @@ const _sfc_main = defineComponent({
|
|
|
226
224
|
data.comment_available = data.comment_available !== "false";
|
|
227
225
|
data.statement = data.statement !== "false";
|
|
228
226
|
data.is_recommend = data.is_recommend !== "false";
|
|
229
|
-
data.album_status =
|
|
227
|
+
data.album_status = data.album_status !== "0";
|
|
230
228
|
Object.assign(form.value, data);
|
|
231
229
|
};
|
|
232
230
|
watch(silenceOptions, (newVal, oldVal) => {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface Params {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
export declare function getDocDetailsNew(BASE_API: string, query: Params): import("axios").AxiosPromise<any>;
|
|
5
|
+
export declare function getAllDutyEditor(BASE_API: string, params: Params): import("axios").AxiosPromise<any>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
.edit-meta-info-dialog-body {
|
|
2
|
-
padding: 0;
|
|
3
|
-
|
|
4
|
-
.style-form-item {
|
|
5
|
-
position: relative;
|
|
6
|
-
top: -10px;
|
|
7
|
-
|
|
8
|
-
.title {
|
|
9
|
-
max-width: 100%;
|
|
10
|
-
color: var(--color-text-2);
|
|
11
|
-
font-weight: 400;
|
|
12
|
-
font-size: 14px;
|
|
13
|
-
white-space: normal;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.select-thumb-wrap {
|
|
18
|
-
margin-left: 20.8%;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.horizontal {
|
|
22
|
-
// display: flex;
|
|
23
|
-
// align-items: center;
|
|
24
|
-
// flex-direction: row !important;
|
|
25
|
-
// .arco-form-item-label-col {
|
|
26
|
-
// margin-bottom: 0;
|
|
27
|
-
// padding-right: 16px;
|
|
28
|
-
// text-align: right;
|
|
29
|
-
// }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.input-w {
|
|
33
|
-
width: 450px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.silence {
|
|
37
|
-
.arco-form-item-wrapper-col {
|
|
38
|
-
.arco-form-item-content {
|
|
39
|
-
display: block;
|
|
40
|
-
|
|
41
|
-
.arco-switch {
|
|
42
|
-
margin: 4px 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.silence-options {
|
|
46
|
-
margin-top: 20px;
|
|
47
|
-
margin-left: -75px;
|
|
48
|
-
|
|
49
|
-
.info {
|
|
50
|
-
margin-top: 12px;
|
|
51
|
-
padding-left: 5px;
|
|
52
|
-
color: #878e96;
|
|
53
|
-
font-size: 14px;
|
|
54
|
-
line-height: 1.5;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
.edit-meta-info-dialog-body {
|
|
2
|
+
padding: 0;
|
|
3
|
+
|
|
4
|
+
.style-form-item {
|
|
5
|
+
position: relative;
|
|
6
|
+
top: -10px;
|
|
7
|
+
|
|
8
|
+
.title {
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
color: var(--color-text-2);
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
white-space: normal;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.select-thumb-wrap {
|
|
18
|
+
margin-left: 20.8%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.horizontal {
|
|
22
|
+
// display: flex;
|
|
23
|
+
// align-items: center;
|
|
24
|
+
// flex-direction: row !important;
|
|
25
|
+
// .arco-form-item-label-col {
|
|
26
|
+
// margin-bottom: 0;
|
|
27
|
+
// padding-right: 16px;
|
|
28
|
+
// text-align: right;
|
|
29
|
+
// }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.input-w {
|
|
33
|
+
width: 450px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.silence {
|
|
37
|
+
.arco-form-item-wrapper-col {
|
|
38
|
+
.arco-form-item-content {
|
|
39
|
+
display: block;
|
|
40
|
+
|
|
41
|
+
.arco-switch {
|
|
42
|
+
margin: 4px 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.silence-options {
|
|
46
|
+
margin-top: 20px;
|
|
47
|
+
margin-left: -75px;
|
|
48
|
+
|
|
49
|
+
.info {
|
|
50
|
+
margin-top: 12px;
|
|
51
|
+
padding-left: 5px;
|
|
52
|
+
color: #878e96;
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
line-height: 1.5;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
.empty-data-container {
|
|
2
|
-
position: absolute;
|
|
3
|
-
top: 50%;
|
|
4
|
-
left: 50%;
|
|
5
|
-
display: block;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
width: 220px;
|
|
11
|
-
transform: translate(-50%, -50%);
|
|
12
|
-
|
|
13
|
-
&.small {
|
|
14
|
-
width: 160px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
img {
|
|
18
|
-
width: 100%;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.custom-icon {
|
|
22
|
-
width: 100%;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.tip {
|
|
26
|
-
margin-top: 16px;
|
|
27
|
-
color: #999eaa;
|
|
28
|
-
font-size: 14px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.slot-view {
|
|
32
|
-
margin-top: 16px;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
.empty-data-container {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 50%;
|
|
4
|
+
left: 50%;
|
|
5
|
+
display: block;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
width: 220px;
|
|
11
|
+
transform: translate(-50%, -50%);
|
|
12
|
+
|
|
13
|
+
&.small {
|
|
14
|
+
width: 160px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
img {
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.custom-icon {
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tip {
|
|
26
|
+
margin-top: 16px;
|
|
27
|
+
color: #999eaa;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.slot-view {
|
|
32
|
+
margin-top: 16px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
File without changes
|
package/es/gif.worker.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
2
|
-
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
|
|
3
|
-
//# sourceMappingURL=gif.worker.js.map
|
|
1
|
+
// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
2
|
+
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
|
|
3
|
+
//# sourceMappingURL=gif.worker.js.map
|