giime 1.1.5 → 1.1.6
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/es/components/src/base/affix/Affix.vue.d.ts +2 -2
- package/es/components/src/base/alert/Alert.vue.d.ts +3 -3
- package/es/components/src/base/alert/index.d.ts +8 -8
- package/es/components/src/base/anchor/Anchor.vue.d.ts +1 -1
- package/es/components/src/base/anchor/index.d.ts +3 -3
- package/es/components/src/base/autocomplete/Autocomplete.vue.d.ts +11 -11
- package/es/components/src/base/autocomplete/autocomplete.d.ts +1 -1
- package/es/components/src/base/autocomplete/index.d.ts +30 -30
- package/es/components/src/base/badge/Badge.vue.d.ts +1 -1
- package/es/components/src/base/badge/index.d.ts +3 -3
- package/es/components/src/base/button/Button.vue.d.ts +9 -9
- package/es/components/src/base/button/button.d.ts +4 -4
- package/es/components/src/base/button/index.d.ts +23 -23
- package/es/components/src/base/buttonGroup/ButtonGroup.vue.d.ts +3 -3
- package/es/components/src/base/buttonGroup/buttonGroup.d.ts +1 -1
- package/es/components/src/base/buttonGroup/index.d.ts +7 -7
- package/es/components/src/base/carousel/Carousel.vue.d.ts +1 -1
- package/es/components/src/base/carousel/index.d.ts +3 -3
- package/es/components/src/base/cascader/Cascader.vue.d.ts +6 -6
- package/es/components/src/base/cascader/index.d.ts +18 -18
- package/es/components/src/base/chart/Chart.vue.d.ts +2 -2
- package/es/components/src/base/chart/index.d.ts +2 -2
- package/es/components/src/base/checkbox/Checkbox.vue.d.ts +2 -2
- package/es/components/src/base/checkbox/index.d.ts +6 -6
- package/es/components/src/base/checkboxButton/CheckboxButton.vue.d.ts +2 -2
- package/es/components/src/base/checkboxButton/index.d.ts +6 -6
- package/es/components/src/base/col/Col.vue.d.ts +1 -1
- package/es/components/src/base/col/index.d.ts +3 -3
- package/es/components/src/base/collapseItem/CollapseItem.vue.d.ts +1 -1
- package/es/components/src/base/collapseItem/index.d.ts +3 -3
- package/es/components/src/base/colorPicker/ColorPicker.vue.d.ts +6 -6
- package/es/components/src/base/colorPicker/index.d.ts +6 -6
- package/es/components/src/base/colorPickerPanel/ColorPickerPanel.vue.d.ts +1 -1
- package/es/components/src/base/colorPickerPanel/index.d.ts +1 -1
- package/es/components/src/base/datePicker/DatePicker.vue.d.ts +5 -5
- package/es/components/src/base/datePicker/index.d.ts +15 -15
- package/es/components/src/base/datePickerPanel/DatePickerPanel.vue.d.ts +1 -1
- package/es/components/src/base/datePickerPanel/index.d.ts +3 -3
- package/es/components/src/base/descriptions/Descriptions.vue.d.ts +1 -1
- package/es/components/src/base/descriptions/index.d.ts +3 -3
- package/es/components/src/base/descriptionsItem/DescriptionsItem.vue.d.ts +6 -6
- package/es/components/src/base/descriptionsItem/descriptionsItem.d.ts +2 -2
- package/es/components/src/base/descriptionsItem/index.d.ts +14 -14
- package/es/components/src/base/dialog/Dialog.vue.d.ts +3 -3
- package/es/components/src/base/dialog/index.d.ts +8 -8
- package/es/components/src/base/divider/Divider.vue.d.ts +3 -3
- package/es/components/src/base/divider/divider.d.ts +1 -1
- package/es/components/src/base/divider/index.d.ts +7 -7
- package/es/components/src/base/drawer/Drawer.vue.d.ts +4 -4
- package/es/components/src/base/drawer/index.d.ts +11 -11
- package/es/components/src/base/dropdown/Dropdown.vue.d.ts +7 -7
- package/es/components/src/base/dropdown/dropdown.d.ts +2 -2
- package/es/components/src/base/dropdown/index.d.ts +17 -17
- package/es/components/src/base/form/Form.vue.d.ts +1 -1
- package/es/components/src/base/form/index.d.ts +3 -3
- package/es/components/src/base/image/Image.vue.d.ts +3 -3
- package/es/components/src/base/image/index.d.ts +8 -8
- package/es/components/src/base/imageViewer/ImageViewer.vue.d.ts +2 -2
- package/es/components/src/base/imageViewer/index.d.ts +4 -4
- package/es/components/src/base/input/Input.vue.d.ts +14 -14
- package/es/components/src/base/input/index.d.ts +38 -38
- package/es/components/src/base/input/input.d.ts +1 -1
- package/es/components/src/base/inputNumber/InputNumber.vue.d.ts +12 -12
- package/es/components/src/base/inputNumber/index.d.ts +31 -31
- package/es/components/src/base/inputNumber/inputNumber.d.ts +2 -2
- package/es/components/src/base/inputTag/InputTag.vue.d.ts +6 -6
- package/es/components/src/base/inputTag/index.d.ts +17 -17
- package/es/components/src/base/link/Link.vue.d.ts +1 -1
- package/es/components/src/base/link/index.d.ts +3 -3
- package/es/components/src/base/mention/Mention.vue.d.ts +13 -13
- package/es/components/src/base/mention/index.d.ts +37 -37
- package/es/components/src/base/mention/mention.d.ts +1 -1
- package/es/components/src/base/menu/Menu.vue.d.ts +4 -4
- package/es/components/src/base/menu/index.d.ts +10 -10
- package/es/components/src/base/pagination/Pagination.vue.d.ts +1 -1
- package/es/components/src/base/pagination/index.d.ts +3 -3
- package/es/components/src/base/popconfirm/Popconfirm.vue.d.ts +8 -8
- package/es/components/src/base/popconfirm/index.d.ts +19 -19
- package/es/components/src/base/popconfirm/popconfirm.d.ts +2 -2
- package/es/components/src/base/popover/Popover.vue.d.ts +3 -3
- package/es/components/src/base/popover/index.d.ts +9 -9
- package/es/components/src/base/popper/Popper.vue.d.ts +3 -3
- package/es/components/src/base/popper/index.d.ts +7 -7
- package/es/components/src/base/popper/popper.d.ts +1 -1
- package/es/components/src/base/progress/Progress.vue.d.ts +2 -2
- package/es/components/src/base/progress/index.d.ts +6 -6
- package/es/components/src/base/radio/Radio.vue.d.ts +1 -1
- package/es/components/src/base/radio/index.d.ts +3 -3
- package/es/components/src/base/radioGroup/RadioGroup.vue.d.ts +1 -1
- package/es/components/src/base/radioGroup/index.d.ts +3 -3
- package/es/components/src/base/result/Result.vue.d.ts +1 -1
- package/es/components/src/base/result/index.d.ts +3 -3
- package/es/components/src/base/scrollbar/Scrollbar.vue.d.ts +3 -3
- package/es/components/src/base/scrollbar/index.d.ts +7 -7
- package/es/components/src/base/scrollbar/scrollbar.d.ts +1 -1
- package/es/components/src/base/segmented/Segmented.vue.d.ts +1 -1
- package/es/components/src/base/segmented/index.d.ts +3 -3
- package/es/components/src/base/select/Select.vue.d.ts +7 -7
- package/es/components/src/base/select/index.d.ts +21 -21
- package/es/components/src/base/selectV2/SelectV2.vue.d.ts +8 -8
- package/es/components/src/base/selectV2/index.d.ts +24 -24
- package/es/components/src/base/skeletonItem/SkeletonItem.vue.d.ts +3 -3
- package/es/components/src/base/skeletonItem/index.d.ts +7 -7
- package/es/components/src/base/skeletonItem/skeletonItem.d.ts +1 -1
- package/es/components/src/base/slider/Slider.vue.d.ts +2 -2
- package/es/components/src/base/slider/index.d.ts +5 -5
- package/es/components/src/base/space/Space.vue.d.ts +5 -5
- package/es/components/src/base/space/index.d.ts +13 -13
- package/es/components/src/base/space/space.d.ts +1 -1
- package/es/components/src/base/steps/Steps.vue.d.ts +1 -1
- package/es/components/src/base/steps/index.d.ts +3 -3
- package/es/components/src/base/switch/Switch.vue.d.ts +2 -2
- package/es/components/src/base/switch/index.d.ts +5 -5
- package/es/components/src/base/table/Table.vue.d.ts +5 -5
- package/es/components/src/base/table/index.d.ts +10 -10
- package/es/components/src/base/table/table.d.ts +2 -2
- package/es/components/src/base/tableColumn/TableColumn.vue.d.ts +4 -4
- package/es/components/src/base/tableColumn/index.d.ts +10 -10
- package/es/components/src/base/tableColumn/tableColumn.d.ts +1 -1
- package/es/components/src/base/tableV2/TableV2.vue.d.ts +3 -3
- package/es/components/src/base/tableV2/index.d.ts +7 -7
- package/es/components/src/base/tableV2/tableV2.d.ts +1 -1
- package/es/components/src/base/tag/Tag.vue.d.ts +3 -3
- package/es/components/src/base/tag/index.d.ts +8 -8
- package/es/components/src/base/text/Text.vue.d.ts +1 -1
- package/es/components/src/base/text/index.d.ts +3 -3
- package/es/components/src/base/timePicker/TimePicker.vue.d.ts +6 -6
- package/es/components/src/base/timePicker/index.d.ts +18 -18
- package/es/components/src/base/timeSelect/TimeSelect.vue.d.ts +6 -6
- package/es/components/src/base/timeSelect/index.d.ts +18 -18
- package/es/components/src/base/timelineItem/TimelineItem.vue.d.ts +3 -3
- package/es/components/src/base/timelineItem/index.d.ts +9 -9
- package/es/components/src/base/tooltip/Tooltip.vue.d.ts +5 -5
- package/es/components/src/base/tooltip/index.d.ts +13 -13
- package/es/components/src/base/tooltip/tooltip.d.ts +1 -1
- package/es/components/src/base/tour/Tour.vue.d.ts +1 -1
- package/es/components/src/base/tour/index.d.ts +3 -3
- package/es/components/src/base/tourStep/TourStep.vue.d.ts +1 -1
- package/es/components/src/base/tourStep/index.d.ts +3 -3
- package/es/components/src/base/treeSelect/TreeSelect.vue.d.ts +8 -8
- package/es/components/src/base/upload/Upload.vue.d.ts +6 -6
- package/es/components/src/base/upload/index.d.ts +16 -16
- package/es/components/src/base/upload/upload.d.ts +1 -1
- package/es/components/src/business/uploadItem/UploadItem.vue.d.ts +7 -7
- package/es/components/src/business/uploadItem/index.d.ts +19 -19
- package/es/components/src/business/uploadItem/uploadItem.d.ts +1 -1
- package/es/components/src/business/uploadPro/UploadPro.vue.d.ts +8 -8
- package/es/components/src/business/uploadPro/index.d.ts +22 -22
- package/es/components/src/business/uploadPro/uploadPro.d.ts +1 -1
- package/es/components/src/composite/dialogForm/DialogForm.vue.d.ts +14 -14
- package/es/components/src/composite/dialogForm/index.d.ts +40 -40
- package/es/components/src/composite/drawerForm/DrawerForm.vue.d.ts +18 -18
- package/es/components/src/composite/drawerForm/index.d.ts +52 -52
- package/es/components/src/composite/fileComponent/FileComponent.vue.d.ts +1 -1
- package/es/components/src/composite/fileComponent/index.d.ts +3 -3
- package/es/components/src/composite/fileList2/FileList.vue.d.ts +1 -1
- package/es/components/src/composite/fileList2/index.d.ts +3 -3
- package/es/components/src/composite/formItemModule/FormItemModule.vue.d.ts +3 -3
- package/es/components/src/composite/formItemModule/index.d.ts +3 -3
- package/es/components/src/composite/importDialog/ImportDialog.vue.d.ts +5 -5
- package/es/components/src/composite/importDialog/importDialog.d.ts +1 -1
- package/es/components/src/composite/importDialog/index.d.ts +13 -13
- package/es/components/src/composite/memoryForm/MemoryForm.vue.d.ts +1 -1
- package/es/components/src/composite/memoryForm/index.d.ts +3 -3
- package/es/components/src/composite/numberInterval/NumberInterval.vue.d.ts +1 -1
- package/es/components/src/composite/numberInterval/index.d.ts +1 -1
- package/es/components/src/composite/operateButton/OperateButton.vue.d.ts +3 -3
- package/es/components/src/composite/operateButton/index.d.ts +3 -3
- package/es/components/src/composite/operateButton/operateButton.d.ts +1 -1
- package/es/components/src/composite/previewFile/PreviewFile.vue.d.ts +1 -1
- package/es/components/src/composite/previewFile/index.d.ts +1 -1
- package/es/components/src/composite/ruleEditor/RuleEditor.vue.d.ts +1 -1
- package/es/components/src/composite/ruleEditor/index.d.ts +1 -1
- package/es/components/src/composite/searchForm/searchFormItems/cascader/SearchFormCascader.vue.d.ts +4 -4
- package/es/components/src/composite/searchForm/searchFormItems/cascader/index.d.ts +4 -4
- package/es/components/src/composite/searchForm/searchFormItems/datePicker/SearchFormDatePicker.vue.d.ts +4 -4
- package/es/components/src/composite/searchForm/searchFormItems/datePicker/index.d.ts +4 -4
- package/es/components/src/composite/searchForm/searchFormItems/input/SearchFormInput.vue.d.ts +6 -6
- package/es/components/src/composite/searchForm/searchFormItems/input/index.d.ts +6 -6
- package/es/components/src/composite/searchForm/searchFormItems/numberInterval/SearchFormNumberInterval.vue.d.ts +1 -1
- package/es/components/src/composite/searchForm/searchFormItems/numberInterval/index.d.ts +1 -1
- package/es/components/src/composite/searchForm/searchFormItems/select/SearchFormSelect.vue.d.ts +5 -5
- package/es/components/src/composite/searchForm/searchFormItems/select/index.d.ts +5 -5
- package/es/components/src/composite/searchForm/searchFormItems/selectV2/SearchFormSelectV2.vue.d.ts +5 -5
- package/es/components/src/composite/searchForm/searchFormItems/selectV2/index.d.ts +5 -5
- package/es/components/src/composite/selectOptions/SelectOptions.vue.d.ts +6 -6
- package/es/components/src/composite/selectOptions/index.d.ts +18 -18
- package/es/components/src/composite/tableCustom/TableCustom.vue.d.ts +8 -8
- package/es/components/src/composite/tableCustom/customOperate/customOperate.d.ts +1 -1
- package/es/components/src/composite/tableCustom/index.d.ts +19 -19
- package/es/components/src/composite/tableCustom/tableCustom.d.ts +2 -2
- package/es/components/src/composite/tablePro/TablePro.vue.d.ts +8 -8
- package/es/components/src/composite/tablePro/index.d.ts +19 -19
- package/es/components/src/composite/tablePro/tableColumnPro/TableColumnPro.vue.d.ts +4 -4
- package/es/components/src/composite/tablePro/tableColumnPro/index.d.ts +10 -10
- package/es/components/src/composite/tablePro/tableColumnPro/tableColumnPro.d.ts +1 -1
- package/es/components/src/composite/tablePro/tablePagination/TablePagination.vue.d.ts +2 -2
- package/es/components/src/composite/tablePro/tablePagination/index.d.ts +2 -2
- package/es/components/src/composite/tablePro/tablePro.d.ts +2 -2
- package/es/components/src/composite/uploadFile/UploadFile.vue.d.ts +9 -9
- package/es/components/src/composite/uploadFile/index.d.ts +25 -25
- package/es/components/src/composite/uploadFile/uploadFile.d.ts +1 -1
- package/es/components/src/plugins/message/method.d.ts +4 -4
- package/es/constants/key.d.ts +9 -0
- package/es/constants/key.mjs.map +1 -1
- package/es/crx/src/login/LoginPrompt.vue.d.ts +1 -1
- package/es/giime/index.mjs +1 -0
- package/es/giime/index.mjs.map +1 -1
- package/es/giime/makeInstaller.mjs +5 -0
- package/es/giime/makeInstaller.mjs.map +1 -1
- package/es/giime/version.d.ts +1 -1
- package/es/giime/version.mjs +1 -1
- package/es/giime/version.mjs.map +1 -1
- package/es/track/__tests__/reliability.test.d.ts +1 -0
- package/es/track/__tests__/track.test.d.ts +1 -0
- package/es/track/axios.d.ts +1 -0
- package/es/track/html.d.ts +1 -0
- package/es/track/index.d.ts +16 -0
- package/es/track/src/adapters/axios.d.ts +19 -0
- package/es/track/src/adapters/html.d.ts +18 -0
- package/es/track/src/adapters/vue2.d.ts +35 -0
- package/es/track/src/adapters/vue3.d.ts +69 -0
- package/es/track/src/collectors/click.d.ts +10 -0
- package/es/track/src/collectors/error.d.ts +13 -0
- package/es/track/src/collectors/exposure.d.ts +9 -0
- package/es/track/src/collectors/formAndCopy.d.ts +10 -0
- package/es/track/src/collectors/hover.d.ts +10 -0
- package/es/track/src/collectors/lifecycle.d.ts +14 -0
- package/es/track/src/collectors/scrollAndPath.d.ts +10 -0
- package/es/track/src/core/pendingStore.d.ts +7 -0
- package/es/track/src/core/queue.d.ts +68 -0
- package/es/track/src/core/session.d.ts +138 -0
- package/es/track/src/core/singleton.d.ts +49 -0
- package/es/track/src/core/tracker.d.ts +226 -0
- package/es/track/src/types/index.d.ts +351 -0
- package/es/track/src/utils/browser.d.ts +16 -0
- package/es/track/src/utils/dom.d.ts +89 -0
- package/es/track/src/utils/env.d.ts +101 -0
- package/es/track/src/utils/id.d.ts +80 -0
- package/es/track/vue2.d.ts +1 -0
- package/es/track/vue3.d.ts +1 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.mjs +1 -0
- package/es/utils/index.mjs.map +1 -1
- package/es/utils/src/watermark/index.d.ts +191 -0
- package/es/utils/src/watermark/index.mjs +758 -0
- package/es/utils/src/watermark/index.mjs.map +1 -0
- package/es/watermark/__tests__/watermark.test.d.ts +1 -0
- package/es/watermark/auto.d.ts +7 -0
- package/es/watermark/index.d.ts +9 -0
- package/es/watermark/src/adapters/vue2.d.ts +18 -0
- package/es/watermark/src/adapters/vue3.d.ts +23 -0
- package/es/watermark/src/core.d.ts +148 -0
- package/es/watermark/src/iframe.d.ts +67 -0
- package/es/watermark/src/types.d.ts +182 -0
- package/es/watermark/src/user.d.ts +71 -0
- package/es/watermark/vue2.d.ts +10 -0
- package/es/watermark/vue3.d.ts +2 -0
- package/lib/components/src/base/affix/Affix.vue.d.ts +2 -2
- package/lib/components/src/base/alert/Alert.vue.d.ts +3 -3
- package/lib/components/src/base/alert/index.d.ts +8 -8
- package/lib/components/src/base/anchor/Anchor.vue.d.ts +1 -1
- package/lib/components/src/base/anchor/index.d.ts +3 -3
- package/lib/components/src/base/autocomplete/Autocomplete.vue.d.ts +11 -11
- package/lib/components/src/base/autocomplete/autocomplete.d.ts +1 -1
- package/lib/components/src/base/autocomplete/index.d.ts +30 -30
- package/lib/components/src/base/badge/Badge.vue.d.ts +1 -1
- package/lib/components/src/base/badge/index.d.ts +3 -3
- package/lib/components/src/base/button/Button.vue.d.ts +9 -9
- package/lib/components/src/base/button/button.d.ts +4 -4
- package/lib/components/src/base/button/index.d.ts +23 -23
- package/lib/components/src/base/buttonGroup/ButtonGroup.vue.d.ts +3 -3
- package/lib/components/src/base/buttonGroup/buttonGroup.d.ts +1 -1
- package/lib/components/src/base/buttonGroup/index.d.ts +7 -7
- package/lib/components/src/base/carousel/Carousel.vue.d.ts +1 -1
- package/lib/components/src/base/carousel/index.d.ts +3 -3
- package/lib/components/src/base/cascader/Cascader.vue.d.ts +6 -6
- package/lib/components/src/base/cascader/index.d.ts +18 -18
- package/lib/components/src/base/chart/Chart.vue.d.ts +2 -2
- package/lib/components/src/base/chart/index.d.ts +2 -2
- package/lib/components/src/base/checkbox/Checkbox.vue.d.ts +2 -2
- package/lib/components/src/base/checkbox/index.d.ts +6 -6
- package/lib/components/src/base/checkboxButton/CheckboxButton.vue.d.ts +2 -2
- package/lib/components/src/base/checkboxButton/index.d.ts +6 -6
- package/lib/components/src/base/col/Col.vue.d.ts +1 -1
- package/lib/components/src/base/col/index.d.ts +3 -3
- package/lib/components/src/base/collapseItem/CollapseItem.vue.d.ts +1 -1
- package/lib/components/src/base/collapseItem/index.d.ts +3 -3
- package/lib/components/src/base/colorPicker/ColorPicker.vue.d.ts +6 -6
- package/lib/components/src/base/colorPicker/index.d.ts +6 -6
- package/lib/components/src/base/colorPickerPanel/ColorPickerPanel.vue.d.ts +1 -1
- package/lib/components/src/base/colorPickerPanel/index.d.ts +1 -1
- package/lib/components/src/base/datePicker/DatePicker.vue.d.ts +5 -5
- package/lib/components/src/base/datePicker/index.d.ts +15 -15
- package/lib/components/src/base/datePickerPanel/DatePickerPanel.vue.d.ts +1 -1
- package/lib/components/src/base/datePickerPanel/index.d.ts +3 -3
- package/lib/components/src/base/descriptions/Descriptions.vue.d.ts +1 -1
- package/lib/components/src/base/descriptions/index.d.ts +3 -3
- package/lib/components/src/base/descriptionsItem/DescriptionsItem.vue.d.ts +6 -6
- package/lib/components/src/base/descriptionsItem/descriptionsItem.d.ts +2 -2
- package/lib/components/src/base/descriptionsItem/index.d.ts +14 -14
- package/lib/components/src/base/dialog/Dialog.vue.d.ts +3 -3
- package/lib/components/src/base/dialog/index.d.ts +8 -8
- package/lib/components/src/base/divider/Divider.vue.d.ts +3 -3
- package/lib/components/src/base/divider/divider.d.ts +1 -1
- package/lib/components/src/base/divider/index.d.ts +7 -7
- package/lib/components/src/base/drawer/Drawer.vue.d.ts +4 -4
- package/lib/components/src/base/drawer/index.d.ts +11 -11
- package/lib/components/src/base/dropdown/Dropdown.vue.d.ts +7 -7
- package/lib/components/src/base/dropdown/dropdown.d.ts +2 -2
- package/lib/components/src/base/dropdown/index.d.ts +17 -17
- package/lib/components/src/base/form/Form.vue.d.ts +1 -1
- package/lib/components/src/base/form/index.d.ts +3 -3
- package/lib/components/src/base/image/Image.vue.d.ts +3 -3
- package/lib/components/src/base/image/index.d.ts +8 -8
- package/lib/components/src/base/imageViewer/ImageViewer.vue.d.ts +2 -2
- package/lib/components/src/base/imageViewer/index.d.ts +4 -4
- package/lib/components/src/base/input/Input.vue.d.ts +14 -14
- package/lib/components/src/base/input/index.d.ts +38 -38
- package/lib/components/src/base/input/input.d.ts +1 -1
- package/lib/components/src/base/inputNumber/InputNumber.vue.d.ts +12 -12
- package/lib/components/src/base/inputNumber/index.d.ts +31 -31
- package/lib/components/src/base/inputNumber/inputNumber.d.ts +2 -2
- package/lib/components/src/base/inputTag/InputTag.vue.d.ts +6 -6
- package/lib/components/src/base/inputTag/index.d.ts +17 -17
- package/lib/components/src/base/link/Link.vue.d.ts +1 -1
- package/lib/components/src/base/link/index.d.ts +3 -3
- package/lib/components/src/base/mention/Mention.vue.d.ts +13 -13
- package/lib/components/src/base/mention/index.d.ts +37 -37
- package/lib/components/src/base/mention/mention.d.ts +1 -1
- package/lib/components/src/base/menu/Menu.vue.d.ts +4 -4
- package/lib/components/src/base/menu/index.d.ts +10 -10
- package/lib/components/src/base/pagination/Pagination.vue.d.ts +1 -1
- package/lib/components/src/base/pagination/index.d.ts +3 -3
- package/lib/components/src/base/popconfirm/Popconfirm.vue.d.ts +8 -8
- package/lib/components/src/base/popconfirm/index.d.ts +19 -19
- package/lib/components/src/base/popconfirm/popconfirm.d.ts +2 -2
- package/lib/components/src/base/popover/Popover.vue.d.ts +3 -3
- package/lib/components/src/base/popover/index.d.ts +9 -9
- package/lib/components/src/base/popper/Popper.vue.d.ts +3 -3
- package/lib/components/src/base/popper/index.d.ts +7 -7
- package/lib/components/src/base/popper/popper.d.ts +1 -1
- package/lib/components/src/base/progress/Progress.vue.d.ts +2 -2
- package/lib/components/src/base/progress/index.d.ts +6 -6
- package/lib/components/src/base/radio/Radio.vue.d.ts +1 -1
- package/lib/components/src/base/radio/index.d.ts +3 -3
- package/lib/components/src/base/radioGroup/RadioGroup.vue.d.ts +1 -1
- package/lib/components/src/base/radioGroup/index.d.ts +3 -3
- package/lib/components/src/base/result/Result.vue.d.ts +1 -1
- package/lib/components/src/base/result/index.d.ts +3 -3
- package/lib/components/src/base/scrollbar/Scrollbar.vue.d.ts +3 -3
- package/lib/components/src/base/scrollbar/index.d.ts +7 -7
- package/lib/components/src/base/scrollbar/scrollbar.d.ts +1 -1
- package/lib/components/src/base/segmented/Segmented.vue.d.ts +1 -1
- package/lib/components/src/base/segmented/index.d.ts +3 -3
- package/lib/components/src/base/select/Select.vue.d.ts +7 -7
- package/lib/components/src/base/select/index.d.ts +21 -21
- package/lib/components/src/base/selectV2/SelectV2.vue.d.ts +8 -8
- package/lib/components/src/base/selectV2/index.d.ts +24 -24
- package/lib/components/src/base/skeletonItem/SkeletonItem.vue.d.ts +3 -3
- package/lib/components/src/base/skeletonItem/index.d.ts +7 -7
- package/lib/components/src/base/skeletonItem/skeletonItem.d.ts +1 -1
- package/lib/components/src/base/slider/Slider.vue.d.ts +2 -2
- package/lib/components/src/base/slider/index.d.ts +5 -5
- package/lib/components/src/base/space/Space.vue.d.ts +5 -5
- package/lib/components/src/base/space/index.d.ts +13 -13
- package/lib/components/src/base/space/space.d.ts +1 -1
- package/lib/components/src/base/steps/Steps.vue.d.ts +1 -1
- package/lib/components/src/base/steps/index.d.ts +3 -3
- package/lib/components/src/base/switch/Switch.vue.d.ts +2 -2
- package/lib/components/src/base/switch/index.d.ts +5 -5
- package/lib/components/src/base/table/Table.vue.d.ts +5 -5
- package/lib/components/src/base/table/index.d.ts +10 -10
- package/lib/components/src/base/table/table.d.ts +2 -2
- package/lib/components/src/base/tableColumn/TableColumn.vue.d.ts +4 -4
- package/lib/components/src/base/tableColumn/index.d.ts +10 -10
- package/lib/components/src/base/tableColumn/tableColumn.d.ts +1 -1
- package/lib/components/src/base/tableV2/TableV2.vue.d.ts +3 -3
- package/lib/components/src/base/tableV2/index.d.ts +7 -7
- package/lib/components/src/base/tableV2/tableV2.d.ts +1 -1
- package/lib/components/src/base/tag/Tag.vue.d.ts +3 -3
- package/lib/components/src/base/tag/index.d.ts +8 -8
- package/lib/components/src/base/text/Text.vue.d.ts +1 -1
- package/lib/components/src/base/text/index.d.ts +3 -3
- package/lib/components/src/base/timePicker/TimePicker.vue.d.ts +6 -6
- package/lib/components/src/base/timePicker/index.d.ts +18 -18
- package/lib/components/src/base/timeSelect/TimeSelect.vue.d.ts +6 -6
- package/lib/components/src/base/timeSelect/index.d.ts +18 -18
- package/lib/components/src/base/timelineItem/TimelineItem.vue.d.ts +3 -3
- package/lib/components/src/base/timelineItem/index.d.ts +9 -9
- package/lib/components/src/base/tooltip/Tooltip.vue.d.ts +5 -5
- package/lib/components/src/base/tooltip/index.d.ts +13 -13
- package/lib/components/src/base/tooltip/tooltip.d.ts +1 -1
- package/lib/components/src/base/tour/Tour.vue.d.ts +1 -1
- package/lib/components/src/base/tour/index.d.ts +3 -3
- package/lib/components/src/base/tourStep/TourStep.vue.d.ts +1 -1
- package/lib/components/src/base/tourStep/index.d.ts +3 -3
- package/lib/components/src/base/treeSelect/TreeSelect.vue.d.ts +8 -8
- package/lib/components/src/base/upload/Upload.vue.d.ts +6 -6
- package/lib/components/src/base/upload/index.d.ts +16 -16
- package/lib/components/src/base/upload/upload.d.ts +1 -1
- package/lib/components/src/business/uploadItem/UploadItem.vue.d.ts +7 -7
- package/lib/components/src/business/uploadItem/index.d.ts +19 -19
- package/lib/components/src/business/uploadItem/uploadItem.d.ts +1 -1
- package/lib/components/src/business/uploadPro/UploadPro.vue.d.ts +8 -8
- package/lib/components/src/business/uploadPro/index.d.ts +22 -22
- package/lib/components/src/business/uploadPro/uploadPro.d.ts +1 -1
- package/lib/components/src/composite/dialogForm/DialogForm.vue.d.ts +14 -14
- package/lib/components/src/composite/dialogForm/index.d.ts +40 -40
- package/lib/components/src/composite/drawerForm/DrawerForm.vue.d.ts +18 -18
- package/lib/components/src/composite/drawerForm/index.d.ts +52 -52
- package/lib/components/src/composite/fileComponent/FileComponent.vue.d.ts +1 -1
- package/lib/components/src/composite/fileComponent/index.d.ts +3 -3
- package/lib/components/src/composite/fileList2/FileList.vue.d.ts +1 -1
- package/lib/components/src/composite/fileList2/index.d.ts +3 -3
- package/lib/components/src/composite/formItemModule/FormItemModule.vue.d.ts +3 -3
- package/lib/components/src/composite/formItemModule/index.d.ts +3 -3
- package/lib/components/src/composite/importDialog/ImportDialog.vue.d.ts +5 -5
- package/lib/components/src/composite/importDialog/importDialog.d.ts +1 -1
- package/lib/components/src/composite/importDialog/index.d.ts +13 -13
- package/lib/components/src/composite/memoryForm/MemoryForm.vue.d.ts +1 -1
- package/lib/components/src/composite/memoryForm/index.d.ts +3 -3
- package/lib/components/src/composite/numberInterval/NumberInterval.vue.d.ts +1 -1
- package/lib/components/src/composite/numberInterval/index.d.ts +1 -1
- package/lib/components/src/composite/operateButton/OperateButton.vue.d.ts +3 -3
- package/lib/components/src/composite/operateButton/index.d.ts +3 -3
- package/lib/components/src/composite/operateButton/operateButton.d.ts +1 -1
- package/lib/components/src/composite/previewFile/PreviewFile.vue.d.ts +1 -1
- package/lib/components/src/composite/previewFile/index.d.ts +1 -1
- package/lib/components/src/composite/ruleEditor/RuleEditor.vue.d.ts +1 -1
- package/lib/components/src/composite/ruleEditor/index.d.ts +1 -1
- package/lib/components/src/composite/searchForm/searchFormItems/cascader/SearchFormCascader.vue.d.ts +4 -4
- package/lib/components/src/composite/searchForm/searchFormItems/cascader/index.d.ts +4 -4
- package/lib/components/src/composite/searchForm/searchFormItems/datePicker/SearchFormDatePicker.vue.d.ts +4 -4
- package/lib/components/src/composite/searchForm/searchFormItems/datePicker/index.d.ts +4 -4
- package/lib/components/src/composite/searchForm/searchFormItems/input/SearchFormInput.vue.d.ts +6 -6
- package/lib/components/src/composite/searchForm/searchFormItems/input/index.d.ts +6 -6
- package/lib/components/src/composite/searchForm/searchFormItems/numberInterval/SearchFormNumberInterval.vue.d.ts +1 -1
- package/lib/components/src/composite/searchForm/searchFormItems/numberInterval/index.d.ts +1 -1
- package/lib/components/src/composite/searchForm/searchFormItems/select/SearchFormSelect.vue.d.ts +5 -5
- package/lib/components/src/composite/searchForm/searchFormItems/select/index.d.ts +5 -5
- package/lib/components/src/composite/searchForm/searchFormItems/selectV2/SearchFormSelectV2.vue.d.ts +5 -5
- package/lib/components/src/composite/searchForm/searchFormItems/selectV2/index.d.ts +5 -5
- package/lib/components/src/composite/selectOptions/SelectOptions.vue.d.ts +6 -6
- package/lib/components/src/composite/selectOptions/index.d.ts +18 -18
- package/lib/components/src/composite/tableCustom/TableCustom.vue.d.ts +8 -8
- package/lib/components/src/composite/tableCustom/customOperate/customOperate.d.ts +1 -1
- package/lib/components/src/composite/tableCustom/index.d.ts +19 -19
- package/lib/components/src/composite/tableCustom/tableCustom.d.ts +2 -2
- package/lib/components/src/composite/tablePro/TablePro.vue.d.ts +8 -8
- package/lib/components/src/composite/tablePro/index.d.ts +19 -19
- package/lib/components/src/composite/tablePro/tableColumnPro/TableColumnPro.vue.d.ts +4 -4
- package/lib/components/src/composite/tablePro/tableColumnPro/index.d.ts +10 -10
- package/lib/components/src/composite/tablePro/tableColumnPro/tableColumnPro.d.ts +1 -1
- package/lib/components/src/composite/tablePro/tablePagination/TablePagination.vue.d.ts +2 -2
- package/lib/components/src/composite/tablePro/tablePagination/index.d.ts +2 -2
- package/lib/components/src/composite/tablePro/tablePro.d.ts +2 -2
- package/lib/components/src/composite/uploadFile/UploadFile.vue.d.ts +9 -9
- package/lib/components/src/composite/uploadFile/index.d.ts +25 -25
- package/lib/components/src/composite/uploadFile/uploadFile.d.ts +1 -1
- package/lib/components/src/plugins/message/method.d.ts +4 -4
- package/lib/constants/key.d.ts +9 -0
- package/lib/constants/key.js.map +1 -1
- package/lib/crx/src/login/LoginPrompt.vue.d.ts +1 -1
- package/lib/giime/index.js +404 -385
- package/lib/giime/index.js.map +1 -1
- package/lib/giime/makeInstaller.js +5 -0
- package/lib/giime/makeInstaller.js.map +1 -1
- package/lib/giime/version.d.ts +1 -1
- package/lib/giime/version.js +1 -1
- package/lib/giime/version.js.map +1 -1
- package/lib/track/__tests__/reliability.test.d.ts +1 -0
- package/lib/track/__tests__/track.test.d.ts +1 -0
- package/lib/track/axios.d.ts +1 -0
- package/lib/track/html.d.ts +1 -0
- package/lib/track/index.d.ts +16 -0
- package/lib/track/src/adapters/axios.d.ts +19 -0
- package/lib/track/src/adapters/html.d.ts +18 -0
- package/lib/track/src/adapters/vue2.d.ts +35 -0
- package/lib/track/src/adapters/vue3.d.ts +69 -0
- package/lib/track/src/collectors/click.d.ts +10 -0
- package/lib/track/src/collectors/error.d.ts +13 -0
- package/lib/track/src/collectors/exposure.d.ts +9 -0
- package/lib/track/src/collectors/formAndCopy.d.ts +10 -0
- package/lib/track/src/collectors/hover.d.ts +10 -0
- package/lib/track/src/collectors/lifecycle.d.ts +14 -0
- package/lib/track/src/collectors/scrollAndPath.d.ts +10 -0
- package/lib/track/src/core/pendingStore.d.ts +7 -0
- package/lib/track/src/core/queue.d.ts +68 -0
- package/lib/track/src/core/session.d.ts +138 -0
- package/lib/track/src/core/singleton.d.ts +49 -0
- package/lib/track/src/core/tracker.d.ts +226 -0
- package/lib/track/src/types/index.d.ts +351 -0
- package/lib/track/src/utils/browser.d.ts +16 -0
- package/lib/track/src/utils/dom.d.ts +89 -0
- package/lib/track/src/utils/env.d.ts +101 -0
- package/lib/track/src/utils/id.d.ts +80 -0
- package/lib/track/vue2.d.ts +1 -0
- package/lib/track/vue3.d.ts +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +19 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/src/watermark/index.d.ts +191 -0
- package/lib/utils/src/watermark/index.js +777 -0
- package/lib/utils/src/watermark/index.js.map +1 -0
- package/lib/watermark/__tests__/watermark.test.d.ts +1 -0
- package/lib/watermark/auto.d.ts +7 -0
- package/lib/watermark/index.d.ts +9 -0
- package/lib/watermark/src/adapters/vue2.d.ts +18 -0
- package/lib/watermark/src/adapters/vue3.d.ts +23 -0
- package/lib/watermark/src/core.d.ts +148 -0
- package/lib/watermark/src/iframe.d.ts +67 -0
- package/lib/watermark/src/types.d.ts +182 -0
- package/lib/watermark/src/user.d.ts +71 -0
- package/lib/watermark/vue2.d.ts +10 -0
- package/lib/watermark/vue3.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
import { watch } from 'vue';
|
|
2
|
+
import { until } from '@vueuse/core';
|
|
3
|
+
import Cookies from 'js-cookie';
|
|
4
|
+
import { useLoginStore } from '../../../hooks/store/useLogin/index.mjs';
|
|
5
|
+
import { useCurrentUserStore } from '../../../hooks/store/userCenter/useCurrentUser/index.mjs';
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
+
const GIIME_WATERMARK_GLOBAL_SYMBOL = Symbol.for("__giime.watermark.singleton__");
|
|
11
|
+
const WATERMARK_MESSAGE_TYPES = {
|
|
12
|
+
PING: "giime-watermark:ping",
|
|
13
|
+
PONG: "giime-watermark:pong",
|
|
14
|
+
SUPPRESS: "giime-watermark:suppress"
|
|
15
|
+
};
|
|
16
|
+
const WATERMARK_DOM_CONSTANTS = {
|
|
17
|
+
CONTAINER_ID: "__giime_watermark__",
|
|
18
|
+
CONTAINER_CLASS: "giime-watermark-container",
|
|
19
|
+
LEGACY_ITEM_CLASS: "mask_div",
|
|
20
|
+
ROOT_ATTR: "data-giime-watermark"
|
|
21
|
+
};
|
|
22
|
+
const sanitizeUserId = (raw) => {
|
|
23
|
+
if (raw === void 0 || raw === null) {
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
const str = String(raw).trim();
|
|
27
|
+
if (!str || str === "undefined" || str === "null" || str === "NaN") {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
return str;
|
|
31
|
+
};
|
|
32
|
+
let storeVerifiedUserId = "";
|
|
33
|
+
const resolveWatermarkUserId = (config) => {
|
|
34
|
+
if (config?.getUserId) {
|
|
35
|
+
try {
|
|
36
|
+
const customId = sanitizeUserId(config.getUserId());
|
|
37
|
+
if (customId) {
|
|
38
|
+
return customId;
|
|
39
|
+
}
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const explicitId = sanitizeUserId(config?.userId);
|
|
44
|
+
if (explicitId) {
|
|
45
|
+
return explicitId;
|
|
46
|
+
}
|
|
47
|
+
if (storeVerifiedUserId) {
|
|
48
|
+
return storeVerifiedUserId;
|
|
49
|
+
}
|
|
50
|
+
return sanitizeUserId(Cookies.get("sso_user_id"));
|
|
51
|
+
};
|
|
52
|
+
const formatWatermarkDate = (date = /* @__PURE__ */ new Date()) => {
|
|
53
|
+
const year = date.getFullYear();
|
|
54
|
+
const monthNum = date.getMonth() + 1;
|
|
55
|
+
const dayNum = date.getDate();
|
|
56
|
+
const month = monthNum < 10 ? `0${monthNum}` : String(monthNum);
|
|
57
|
+
const day = dayNum < 10 ? `0${dayNum}` : String(dayNum);
|
|
58
|
+
return `${year}\u5E74${month}\u6708${day}\u65E5`;
|
|
59
|
+
};
|
|
60
|
+
const buildWatermarkText = (config, resolvedUserId, dateStr = formatWatermarkDate()) => {
|
|
61
|
+
const userId = resolvedUserId !== void 0 ? sanitizeUserId(resolvedUserId) : resolveWatermarkUserId(config);
|
|
62
|
+
const prefix = config.prefix || "\u5409\u5BA2\u5370";
|
|
63
|
+
if (typeof config.text === "function") {
|
|
64
|
+
return config.text({ userId, date: dateStr, prefix });
|
|
65
|
+
}
|
|
66
|
+
if (typeof config.text === "string" && config.text.trim()) {
|
|
67
|
+
return config.text.trim();
|
|
68
|
+
}
|
|
69
|
+
return userId ? `${prefix}-${userId}-${dateStr}` : `${prefix}-${dateStr}`;
|
|
70
|
+
};
|
|
71
|
+
const isInIframe = (win) => {
|
|
72
|
+
const targetWin = win ?? (typeof window !== "undefined" ? window : void 0);
|
|
73
|
+
if (!targetWin) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
return targetWin.self !== targetWin.top;
|
|
78
|
+
} catch {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const inspectSameOriginAncestors = (win) => {
|
|
83
|
+
const targetWin = win ?? (typeof window !== "undefined" ? window : void 0);
|
|
84
|
+
if (!targetWin || !isInIframe(targetWin)) {
|
|
85
|
+
return { hasWatermark: false, allAncestorsAccessible: true };
|
|
86
|
+
}
|
|
87
|
+
let current = targetWin;
|
|
88
|
+
let depth = 0;
|
|
89
|
+
let allAncestorsAccessible = true;
|
|
90
|
+
while (current && depth < 15) {
|
|
91
|
+
depth++;
|
|
92
|
+
let parentWin = null;
|
|
93
|
+
try {
|
|
94
|
+
parentWin = current.parent;
|
|
95
|
+
} catch {
|
|
96
|
+
allAncestorsAccessible = false;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (!parentWin || parentWin === current) {
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
const anyParent = parentWin;
|
|
104
|
+
if (anyParent.__GIIME_WATERMARK_ACTIVE__ === true) {
|
|
105
|
+
return { hasWatermark: true, allAncestorsAccessible };
|
|
106
|
+
}
|
|
107
|
+
const parentDoc = parentWin.document;
|
|
108
|
+
if (parentDoc) {
|
|
109
|
+
if (parentDoc.getElementById(WATERMARK_DOM_CONSTANTS.CONTAINER_ID) || parentDoc.documentElement?.getAttribute(WATERMARK_DOM_CONSTANTS.ROOT_ATTR) === "active" || parentDoc.querySelector(`.${WATERMARK_DOM_CONSTANTS.LEGACY_ITEM_CLASS}`)) {
|
|
110
|
+
return { hasWatermark: true, allAncestorsAccessible };
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
allAncestorsAccessible = false;
|
|
114
|
+
}
|
|
115
|
+
} catch {
|
|
116
|
+
allAncestorsAccessible = false;
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
if (parentWin === targetWin.top) {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
} catch {
|
|
123
|
+
allAncestorsAccessible = false;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
current = parentWin;
|
|
127
|
+
}
|
|
128
|
+
return { hasWatermark: false, allAncestorsAccessible };
|
|
129
|
+
};
|
|
130
|
+
const hasSameOriginAncestorWatermark = (win) => {
|
|
131
|
+
return inspectSameOriginAncestors(win).hasWatermark;
|
|
132
|
+
};
|
|
133
|
+
const shouldRenderWatermark = (strategy = "ancestor-detect", win) => {
|
|
134
|
+
const targetWin = win ?? (typeof window !== "undefined" ? window : void 0);
|
|
135
|
+
if (!targetWin || typeof document === "undefined") {
|
|
136
|
+
return { shouldRender: false, inIframe: false, needsAsyncDetect: false, reason: "ssr" };
|
|
137
|
+
}
|
|
138
|
+
if (strategy === "never") {
|
|
139
|
+
return { shouldRender: false, inIframe: isInIframe(targetWin), needsAsyncDetect: false, reason: "disabled" };
|
|
140
|
+
}
|
|
141
|
+
const inIframe = isInIframe(targetWin);
|
|
142
|
+
if (strategy === "always") {
|
|
143
|
+
return {
|
|
144
|
+
shouldRender: true,
|
|
145
|
+
inIframe,
|
|
146
|
+
needsAsyncDetect: false,
|
|
147
|
+
reason: inIframe ? "rendered-forced" : "rendered-top"
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (!inIframe) {
|
|
151
|
+
return {
|
|
152
|
+
shouldRender: true,
|
|
153
|
+
inIframe: false,
|
|
154
|
+
needsAsyncDetect: false,
|
|
155
|
+
reason: "rendered-top"
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (strategy === "top-only") {
|
|
159
|
+
return {
|
|
160
|
+
shouldRender: false,
|
|
161
|
+
inIframe: true,
|
|
162
|
+
needsAsyncDetect: false,
|
|
163
|
+
reason: "suppressed-in-iframe"
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
const { hasWatermark, allAncestorsAccessible } = inspectSameOriginAncestors(targetWin);
|
|
167
|
+
if (hasWatermark) {
|
|
168
|
+
return {
|
|
169
|
+
shouldRender: false,
|
|
170
|
+
inIframe: true,
|
|
171
|
+
needsAsyncDetect: false,
|
|
172
|
+
reason: "suppressed-by-ancestor"
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
shouldRender: true,
|
|
177
|
+
inIframe: true,
|
|
178
|
+
needsAsyncDetect: !allAncestorsAccessible,
|
|
179
|
+
reason: "rendered-fallback"
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
const broadcastSuppressToChildFrames = (text) => {
|
|
183
|
+
if (typeof document === "undefined") {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
const iframes = document.querySelectorAll("iframe");
|
|
188
|
+
const message = {
|
|
189
|
+
type: WATERMARK_MESSAGE_TYPES.SUPPRESS,
|
|
190
|
+
active: true,
|
|
191
|
+
text
|
|
192
|
+
};
|
|
193
|
+
iframes.forEach((iframe) => {
|
|
194
|
+
try {
|
|
195
|
+
iframe.contentWindow?.postMessage(message, "*");
|
|
196
|
+
} catch {
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
} catch {
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
const detectAncestorWatermarkAsync = (timeoutMs = 120) => {
|
|
203
|
+
if (typeof window === "undefined" || !isInIframe(window)) {
|
|
204
|
+
return Promise.resolve(false);
|
|
205
|
+
}
|
|
206
|
+
const { hasWatermark, allAncestorsAccessible } = inspectSameOriginAncestors(window);
|
|
207
|
+
if (hasWatermark) {
|
|
208
|
+
return Promise.resolve(true);
|
|
209
|
+
}
|
|
210
|
+
if (allAncestorsAccessible) {
|
|
211
|
+
return Promise.resolve(false);
|
|
212
|
+
}
|
|
213
|
+
return new Promise((resolve) => {
|
|
214
|
+
let settled = false;
|
|
215
|
+
const finish = (hasAncestor) => {
|
|
216
|
+
if (settled) return;
|
|
217
|
+
settled = true;
|
|
218
|
+
window.removeEventListener("message", onMessage);
|
|
219
|
+
clearTimeout(timer);
|
|
220
|
+
resolve(hasAncestor);
|
|
221
|
+
};
|
|
222
|
+
const onMessage = (event) => {
|
|
223
|
+
const data = event?.data;
|
|
224
|
+
if (data && typeof data === "object" && (data.type === WATERMARK_MESSAGE_TYPES.PONG || data.type === WATERMARK_MESSAGE_TYPES.SUPPRESS) && data.active !== false) {
|
|
225
|
+
finish(true);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
window.addEventListener("message", onMessage);
|
|
229
|
+
const timer = setTimeout(() => finish(false), Math.max(20, timeoutMs));
|
|
230
|
+
const pingPayload = { type: WATERMARK_MESSAGE_TYPES.PING, timestamp: Date.now() };
|
|
231
|
+
try {
|
|
232
|
+
window.parent?.postMessage(pingPayload, "*");
|
|
233
|
+
} catch {
|
|
234
|
+
}
|
|
235
|
+
try {
|
|
236
|
+
if (window.top && window.top !== window.parent) {
|
|
237
|
+
window.top.postMessage(pingPayload, "*");
|
|
238
|
+
}
|
|
239
|
+
} catch {
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
const normalizeWatermarkOptions = (options = {}, base) => {
|
|
244
|
+
return {
|
|
245
|
+
enabled: options.enabled ?? base?.enabled ?? true,
|
|
246
|
+
iframeStrategy: options.iframeStrategy ?? base?.iframeStrategy ?? "ancestor-detect",
|
|
247
|
+
detectTimeoutMs: options.detectTimeoutMs ?? base?.detectTimeoutMs ?? 120,
|
|
248
|
+
prefix: options.prefix ?? base?.prefix ?? "\u5409\u5BA2\u5370",
|
|
249
|
+
userId: options.userId !== void 0 ? options.userId : base?.userId,
|
|
250
|
+
getUserId: options.getUserId ?? base?.getUserId,
|
|
251
|
+
text: options.text ?? base?.text,
|
|
252
|
+
x: options.x ?? base?.x ?? 20,
|
|
253
|
+
y: options.y ?? base?.y ?? 20,
|
|
254
|
+
rows: options.rows ?? base?.rows ?? 20,
|
|
255
|
+
cols: options.cols ?? base?.cols ?? 20,
|
|
256
|
+
xSpace: options.xSpace ?? base?.xSpace ?? 100,
|
|
257
|
+
ySpace: options.ySpace ?? base?.ySpace ?? 50,
|
|
258
|
+
color: options.color ?? base?.color ?? "#aaa",
|
|
259
|
+
alpha: options.alpha ?? base?.alpha ?? 0.1,
|
|
260
|
+
fontSize: options.fontSize ?? base?.fontSize ?? "15px",
|
|
261
|
+
font: options.font ?? base?.font ?? "\u5FAE\u8F6F\u96C5\u9ED1",
|
|
262
|
+
width: options.width ?? base?.width ?? 210,
|
|
263
|
+
height: options.height ?? base?.height ?? 80,
|
|
264
|
+
angle: options.angle ?? base?.angle ?? 20,
|
|
265
|
+
zIndex: options.zIndex ?? base?.zIndex ?? 9999,
|
|
266
|
+
antiTamper: options.antiTamper ?? base?.antiTamper ?? true,
|
|
267
|
+
watchResize: options.watchResize ?? base?.watchResize ?? true,
|
|
268
|
+
cleanLegacyMask: options.cleanLegacyMask ?? base?.cleanLegacyMask ?? true
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
const calculateWatermarkGrid = (config, viewportWidth, viewportHeight) => {
|
|
272
|
+
const cutWidth = viewportWidth * 0.015;
|
|
273
|
+
const pageWidth = Math.max(320, viewportWidth - cutWidth);
|
|
274
|
+
const pageHeight = Math.max(viewportHeight + 450, window.innerHeight ? window.innerHeight - 40 : 720);
|
|
275
|
+
let cols = config.cols;
|
|
276
|
+
let xSpace = config.xSpace;
|
|
277
|
+
let rows = config.rows;
|
|
278
|
+
let ySpace = config.ySpace;
|
|
279
|
+
const totalConfigWidth = Math.trunc(config.x + config.width * cols + xSpace * (cols - 1));
|
|
280
|
+
if (cols === 0 || totalConfigWidth > pageWidth) {
|
|
281
|
+
cols = Math.max(1, Math.trunc((pageWidth - config.x + xSpace) / (config.width + xSpace)));
|
|
282
|
+
xSpace = cols > 1 ? Math.max(0, Math.trunc((pageWidth - config.x - config.width * cols) / (cols - 1))) : 0;
|
|
283
|
+
}
|
|
284
|
+
const totalConfigHeight = Math.trunc(config.y + config.height * rows + ySpace * (rows - 1));
|
|
285
|
+
if (rows === 0 || totalConfigHeight > pageHeight) {
|
|
286
|
+
rows = Math.max(1, Math.trunc((ySpace + pageHeight - config.y) / (config.height + ySpace)));
|
|
287
|
+
ySpace = rows > 1 ? Math.max(0, Math.trunc((pageHeight - config.y - config.height * rows) / (rows - 1))) : 0;
|
|
288
|
+
}
|
|
289
|
+
return { cols, rows, xSpace, ySpace };
|
|
290
|
+
};
|
|
291
|
+
const removeLegacyBodyMasks = () => {
|
|
292
|
+
if (typeof document === "undefined" || !document.body) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const legacyNodes = document.body.querySelectorAll(`:scope > .${WATERMARK_DOM_CONSTANTS.LEGACY_ITEM_CLASS}`);
|
|
296
|
+
legacyNodes.forEach((node) => {
|
|
297
|
+
node.parentNode?.removeChild(node);
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
class GiimeWatermark {
|
|
301
|
+
constructor(options) {
|
|
302
|
+
__publicField(this, "config");
|
|
303
|
+
__publicField(this, "state");
|
|
304
|
+
__publicField(this, "containerEl", null);
|
|
305
|
+
__publicField(this, "mutationObserver", null);
|
|
306
|
+
__publicField(this, "resizeTimer", null);
|
|
307
|
+
__publicField(this, "isRenderingInternal", false);
|
|
308
|
+
__publicField(this, "listenersAttached", false);
|
|
309
|
+
__publicField(this, "domReadyListenerAttached", false);
|
|
310
|
+
__publicField(this, "handleWindowResize", () => {
|
|
311
|
+
if (!this.state.active || !this.config.watchResize) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (this.resizeTimer) {
|
|
315
|
+
clearTimeout(this.resizeTimer);
|
|
316
|
+
}
|
|
317
|
+
this.resizeTimer = setTimeout(() => {
|
|
318
|
+
this.render();
|
|
319
|
+
}, 150);
|
|
320
|
+
});
|
|
321
|
+
__publicField(this, "handleWindowMessage", (event) => {
|
|
322
|
+
const data = event?.data;
|
|
323
|
+
if (!data || typeof data !== "object") {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
if (data.type === WATERMARK_MESSAGE_TYPES.PING && this.state.active) {
|
|
327
|
+
try {
|
|
328
|
+
const sourceWin = event.source;
|
|
329
|
+
sourceWin?.postMessage(
|
|
330
|
+
{
|
|
331
|
+
type: WATERMARK_MESSAGE_TYPES.PONG,
|
|
332
|
+
active: true,
|
|
333
|
+
text: this.state.text
|
|
334
|
+
},
|
|
335
|
+
"*"
|
|
336
|
+
);
|
|
337
|
+
} catch {
|
|
338
|
+
}
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
if ((data.type === WATERMARK_MESSAGE_TYPES.SUPPRESS || data.type === WATERMARK_MESSAGE_TYPES.PONG) && data.active !== false && isInIframe() && this.config.iframeStrategy !== "always") {
|
|
342
|
+
this.suppressWatermark("suppressed-by-ancestor");
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
this.config = normalizeWatermarkOptions(options);
|
|
346
|
+
this.state = {
|
|
347
|
+
inIframe: isInIframe(),
|
|
348
|
+
active: false,
|
|
349
|
+
reason: "disabled",
|
|
350
|
+
text: "",
|
|
351
|
+
userId: "",
|
|
352
|
+
rows: 0,
|
|
353
|
+
cols: 0
|
|
354
|
+
};
|
|
355
|
+
this.bootstrap();
|
|
356
|
+
}
|
|
357
|
+
bootstrap() {
|
|
358
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
359
|
+
this.state.reason = "ssr";
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
this.attachGlobalListeners();
|
|
363
|
+
if (!this.config.enabled) {
|
|
364
|
+
this.suppressWatermark("disabled");
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const decision = shouldRenderWatermark(this.config.iframeStrategy);
|
|
368
|
+
this.state.inIframe = decision.inIframe;
|
|
369
|
+
if (!decision.shouldRender) {
|
|
370
|
+
this.suppressWatermark(
|
|
371
|
+
decision.reason
|
|
372
|
+
);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (this.config.iframeStrategy === "ancestor-detect" && decision.inIframe && decision.needsAsyncDetect) {
|
|
376
|
+
detectAncestorWatermarkAsync(this.config.detectTimeoutMs).then((hasAncestor) => {
|
|
377
|
+
if (!this.config.enabled) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (hasAncestor) {
|
|
381
|
+
this.suppressWatermark("suppressed-by-ancestor");
|
|
382
|
+
} else {
|
|
383
|
+
this.activateWatermark("rendered-fallback");
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
this.activateWatermark(decision.reason);
|
|
389
|
+
}
|
|
390
|
+
activateWatermark(reason) {
|
|
391
|
+
this.state.reason = reason;
|
|
392
|
+
this.state.active = true;
|
|
393
|
+
if (typeof window !== "undefined") {
|
|
394
|
+
window.__GIIME_WATERMARK_ACTIVE__ = true;
|
|
395
|
+
}
|
|
396
|
+
if (typeof document !== "undefined" && document.documentElement) {
|
|
397
|
+
document.documentElement.setAttribute(WATERMARK_DOM_CONSTANTS.ROOT_ATTR, "active");
|
|
398
|
+
}
|
|
399
|
+
if (typeof document !== "undefined" && !document.body) {
|
|
400
|
+
if (!this.domReadyListenerAttached) {
|
|
401
|
+
this.domReadyListenerAttached = true;
|
|
402
|
+
window.addEventListener(
|
|
403
|
+
"DOMContentLoaded",
|
|
404
|
+
() => {
|
|
405
|
+
this.domReadyListenerAttached = false;
|
|
406
|
+
if (this.state.active) {
|
|
407
|
+
this.render();
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
{ once: true }
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
this.render();
|
|
416
|
+
}
|
|
417
|
+
suppressWatermark(reason) {
|
|
418
|
+
this.state.active = false;
|
|
419
|
+
this.state.reason = reason;
|
|
420
|
+
this.state.rows = 0;
|
|
421
|
+
this.state.cols = 0;
|
|
422
|
+
this.stopMutationObserver();
|
|
423
|
+
if (typeof window !== "undefined") {
|
|
424
|
+
window.__GIIME_WATERMARK_ACTIVE__ = false;
|
|
425
|
+
}
|
|
426
|
+
if (typeof document !== "undefined") {
|
|
427
|
+
document.documentElement?.setAttribute(WATERMARK_DOM_CONSTANTS.ROOT_ATTR, reason);
|
|
428
|
+
if (this.config.cleanLegacyMask) {
|
|
429
|
+
removeLegacyBodyMasks();
|
|
430
|
+
}
|
|
431
|
+
const existing = document.getElementById(WATERMARK_DOM_CONSTANTS.CONTAINER_ID);
|
|
432
|
+
existing?.parentNode?.removeChild(existing);
|
|
433
|
+
}
|
|
434
|
+
this.containerEl = null;
|
|
435
|
+
}
|
|
436
|
+
render() {
|
|
437
|
+
if (typeof window === "undefined" || typeof document === "undefined" || !document.body) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (!this.state.active) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
this.isRenderingInternal = true;
|
|
444
|
+
this.stopMutationObserver();
|
|
445
|
+
try {
|
|
446
|
+
if (this.config.cleanLegacyMask) {
|
|
447
|
+
removeLegacyBodyMasks();
|
|
448
|
+
}
|
|
449
|
+
const resolvedUserId = resolveWatermarkUserId(this.config);
|
|
450
|
+
const dateStr = formatWatermarkDate();
|
|
451
|
+
const watermarkText = buildWatermarkText(this.config, resolvedUserId, dateStr);
|
|
452
|
+
this.state.userId = resolvedUserId;
|
|
453
|
+
this.state.text = watermarkText;
|
|
454
|
+
const viewportWidth = Math.max(
|
|
455
|
+
window.innerWidth || 0,
|
|
456
|
+
document.documentElement?.clientWidth || 0,
|
|
457
|
+
document.body.clientWidth || 0,
|
|
458
|
+
1024
|
|
459
|
+
);
|
|
460
|
+
const viewportHeight = Math.max(
|
|
461
|
+
window.innerHeight || 0,
|
|
462
|
+
document.documentElement?.clientHeight || 0,
|
|
463
|
+
768
|
|
464
|
+
);
|
|
465
|
+
const { cols, rows, xSpace, ySpace } = calculateWatermarkGrid(this.config, viewportWidth, viewportHeight);
|
|
466
|
+
this.state.cols = cols;
|
|
467
|
+
this.state.rows = rows;
|
|
468
|
+
let container = document.getElementById(WATERMARK_DOM_CONSTANTS.CONTAINER_ID);
|
|
469
|
+
if (!container) {
|
|
470
|
+
container = document.createElement("div");
|
|
471
|
+
container.id = WATERMARK_DOM_CONSTANTS.CONTAINER_ID;
|
|
472
|
+
container.className = WATERMARK_DOM_CONSTANTS.CONTAINER_CLASS;
|
|
473
|
+
container.setAttribute("data-giime-watermark-container", "true");
|
|
474
|
+
container.setAttribute("aria-hidden", "true");
|
|
475
|
+
document.body.appendChild(container);
|
|
476
|
+
}
|
|
477
|
+
container.setAttribute(
|
|
478
|
+
"style",
|
|
479
|
+
[
|
|
480
|
+
"position: fixed !important",
|
|
481
|
+
"top: 0px !important",
|
|
482
|
+
"left: 0px !important",
|
|
483
|
+
"width: 100vw !important",
|
|
484
|
+
"height: 100vh !important",
|
|
485
|
+
"overflow: hidden !important",
|
|
486
|
+
"pointer-events: none !important",
|
|
487
|
+
"user-select: none !important",
|
|
488
|
+
"-webkit-user-select: none !important",
|
|
489
|
+
`z-index: ${this.config.zIndex} !important`,
|
|
490
|
+
"display: block !important",
|
|
491
|
+
"visibility: visible !important",
|
|
492
|
+
"opacity: 1 !important",
|
|
493
|
+
"background: transparent !important"
|
|
494
|
+
].join("; ")
|
|
495
|
+
);
|
|
496
|
+
const fragment = document.createDocumentFragment();
|
|
497
|
+
const rotateStr = `rotate(-${this.config.angle}deg)`;
|
|
498
|
+
for (let i = 0; i < rows; i++) {
|
|
499
|
+
const y = this.config.y + (ySpace + this.config.height) * i;
|
|
500
|
+
for (let j = 0; j < cols; j++) {
|
|
501
|
+
const x = this.config.x + (this.config.width + xSpace) * j;
|
|
502
|
+
const maskDiv = document.createElement("div");
|
|
503
|
+
maskDiv.id = `mask_div${i}${j}`;
|
|
504
|
+
maskDiv.className = WATERMARK_DOM_CONSTANTS.LEGACY_ITEM_CLASS;
|
|
505
|
+
maskDiv.appendChild(document.createTextNode(watermarkText));
|
|
506
|
+
maskDiv.style.webkitTransform = rotateStr;
|
|
507
|
+
maskDiv.style.MozTransform = rotateStr;
|
|
508
|
+
maskDiv.style.msTransform = rotateStr;
|
|
509
|
+
maskDiv.style.OTransform = rotateStr;
|
|
510
|
+
maskDiv.style.transform = rotateStr;
|
|
511
|
+
maskDiv.style.visibility = "";
|
|
512
|
+
maskDiv.style.position = "absolute";
|
|
513
|
+
maskDiv.style.left = `${x}px`;
|
|
514
|
+
maskDiv.style.top = `${y}px`;
|
|
515
|
+
maskDiv.style.overflow = "hidden";
|
|
516
|
+
maskDiv.style.zIndex = String(this.config.zIndex);
|
|
517
|
+
maskDiv.style.pointerEvents = "none";
|
|
518
|
+
maskDiv.style.opacity = String(this.config.alpha);
|
|
519
|
+
maskDiv.style.fontSize = this.config.fontSize;
|
|
520
|
+
maskDiv.style.fontFamily = /^['"]/.test(this.config.font) || this.config.font.includes(",") ? this.config.font : `"${this.config.font}"`;
|
|
521
|
+
maskDiv.style.color = this.config.color;
|
|
522
|
+
maskDiv.style.textAlign = "center";
|
|
523
|
+
maskDiv.style.width = `${this.config.width}px`;
|
|
524
|
+
maskDiv.style.height = `${this.config.height}px`;
|
|
525
|
+
maskDiv.style.display = "block";
|
|
526
|
+
fragment.appendChild(maskDiv);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
container.innerHTML = "";
|
|
530
|
+
container.appendChild(fragment);
|
|
531
|
+
this.containerEl = container;
|
|
532
|
+
broadcastSuppressToChildFrames(watermarkText);
|
|
533
|
+
} finally {
|
|
534
|
+
this.isRenderingInternal = false;
|
|
535
|
+
if (this.config.antiTamper && this.state.active) {
|
|
536
|
+
this.startMutationObserver();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
startMutationObserver() {
|
|
541
|
+
if (typeof MutationObserver === "undefined" || typeof document === "undefined" || !document.body || this.mutationObserver) {
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
this.mutationObserver = new MutationObserver((mutations) => {
|
|
545
|
+
if (this.isRenderingInternal || !this.state.active) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
let needRestore = false;
|
|
549
|
+
for (const mutation of mutations) {
|
|
550
|
+
if (mutation.type === "childList") {
|
|
551
|
+
const added = Array.from(mutation.addedNodes);
|
|
552
|
+
for (const node of added) {
|
|
553
|
+
const el = node;
|
|
554
|
+
if (el?.tagName === "IFRAME") {
|
|
555
|
+
el.addEventListener(
|
|
556
|
+
"load",
|
|
557
|
+
() => {
|
|
558
|
+
if (this.state.active) {
|
|
559
|
+
broadcastSuppressToChildFrames(this.state.text);
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
{ once: true }
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
const removed = Array.from(mutation.removedNodes);
|
|
567
|
+
if (removed.some(
|
|
568
|
+
(node) => node === this.containerEl || node?.id === WATERMARK_DOM_CONSTANTS.CONTAINER_ID || node?.classList?.contains(WATERMARK_DOM_CONSTANTS.LEGACY_ITEM_CLASS)
|
|
569
|
+
)) {
|
|
570
|
+
needRestore = true;
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
if (mutation.type === "attributes") {
|
|
575
|
+
const targetEl = mutation.target;
|
|
576
|
+
if (targetEl === this.containerEl || targetEl?.id === WATERMARK_DOM_CONSTANTS.CONTAINER_ID || targetEl?.classList?.contains(WATERMARK_DOM_CONSTANTS.LEGACY_ITEM_CLASS)) {
|
|
577
|
+
needRestore = true;
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
if (needRestore) {
|
|
583
|
+
this.render();
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
this.mutationObserver.observe(document.body, { childList: true });
|
|
587
|
+
if (this.containerEl) {
|
|
588
|
+
this.mutationObserver.observe(this.containerEl, {
|
|
589
|
+
attributes: true,
|
|
590
|
+
attributeFilter: ["style", "class", "id", "hidden"],
|
|
591
|
+
childList: true,
|
|
592
|
+
subtree: true
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
stopMutationObserver() {
|
|
597
|
+
if (this.mutationObserver) {
|
|
598
|
+
this.mutationObserver.disconnect();
|
|
599
|
+
this.mutationObserver = null;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
attachGlobalListeners() {
|
|
603
|
+
if (this.listenersAttached || typeof window === "undefined") {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
this.listenersAttached = true;
|
|
607
|
+
window.addEventListener("resize", this.handleWindowResize, { passive: true });
|
|
608
|
+
window.addEventListener("message", this.handleWindowMessage);
|
|
609
|
+
}
|
|
610
|
+
detachGlobalListeners() {
|
|
611
|
+
if (!this.listenersAttached || typeof window === "undefined") {
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
this.listenersAttached = false;
|
|
615
|
+
window.removeEventListener("resize", this.handleWindowResize);
|
|
616
|
+
window.removeEventListener("message", this.handleWindowMessage);
|
|
617
|
+
}
|
|
618
|
+
updateConfig(options = {}) {
|
|
619
|
+
this.config = normalizeWatermarkOptions(options, this.config);
|
|
620
|
+
this.bootstrap();
|
|
621
|
+
return this;
|
|
622
|
+
}
|
|
623
|
+
setUserId(userId) {
|
|
624
|
+
this.config.userId = userId;
|
|
625
|
+
return this.refresh();
|
|
626
|
+
}
|
|
627
|
+
refresh() {
|
|
628
|
+
if (this.state.active) {
|
|
629
|
+
this.render();
|
|
630
|
+
} else {
|
|
631
|
+
this.bootstrap();
|
|
632
|
+
}
|
|
633
|
+
return this;
|
|
634
|
+
}
|
|
635
|
+
getState() {
|
|
636
|
+
return { ...this.state };
|
|
637
|
+
}
|
|
638
|
+
getConfig() {
|
|
639
|
+
return { ...this.config };
|
|
640
|
+
}
|
|
641
|
+
destroy() {
|
|
642
|
+
this.stopMutationObserver();
|
|
643
|
+
if (this.resizeTimer) {
|
|
644
|
+
clearTimeout(this.resizeTimer);
|
|
645
|
+
this.resizeTimer = null;
|
|
646
|
+
}
|
|
647
|
+
this.detachGlobalListeners();
|
|
648
|
+
this.suppressWatermark("disabled");
|
|
649
|
+
storeVerifiedUserId = "";
|
|
650
|
+
currentUserStoreBound = false;
|
|
651
|
+
const g = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : null;
|
|
652
|
+
if (g && g[GIIME_WATERMARK_GLOBAL_SYMBOL] === this) {
|
|
653
|
+
delete g[GIIME_WATERMARK_GLOBAL_SYMBOL];
|
|
654
|
+
}
|
|
655
|
+
if (typeof window !== "undefined" && window.__GIIME_WATERMARK__ === this) {
|
|
656
|
+
delete window.__GIIME_WATERMARK__;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
const getWatermarkInstance = () => {
|
|
661
|
+
const g = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : null;
|
|
662
|
+
if (!g) {
|
|
663
|
+
return null;
|
|
664
|
+
}
|
|
665
|
+
return g[GIIME_WATERMARK_GLOBAL_SYMBOL] || null;
|
|
666
|
+
};
|
|
667
|
+
let currentUserStoreBound = false;
|
|
668
|
+
const autoIdentifyWatermarkUser = async (instance) => {
|
|
669
|
+
if (currentUserStoreBound) {
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
try {
|
|
673
|
+
const currentUserStore = useCurrentUserStore();
|
|
674
|
+
const loginStore = useLoginStore();
|
|
675
|
+
currentUserStoreBound = true;
|
|
676
|
+
const hasToken = Boolean(Cookies.get("token") || loginStore.userToken);
|
|
677
|
+
if (hasToken && !currentUserStore.userInfo?.id && !currentUserStore.isLoading) {
|
|
678
|
+
currentUserStore.getUserInfo().catch(() => {
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
loginStore.onLoginResult(() => {
|
|
682
|
+
if (!currentUserStore.isLoading) {
|
|
683
|
+
currentUserStore.getUserInfo().catch(() => {
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
watch(
|
|
688
|
+
() => currentUserStore.userInfo?.id,
|
|
689
|
+
(newId) => {
|
|
690
|
+
const cleanId = sanitizeUserId(newId);
|
|
691
|
+
if (cleanId && cleanId !== storeVerifiedUserId) {
|
|
692
|
+
storeVerifiedUserId = cleanId;
|
|
693
|
+
if (cleanId !== instance.getState().userId) {
|
|
694
|
+
instance.refresh();
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
{ immediate: true }
|
|
699
|
+
);
|
|
700
|
+
await until(() => currentUserStore.userInfo?.id).toBeTruthy();
|
|
701
|
+
const finalId = sanitizeUserId(currentUserStore.userInfo?.id);
|
|
702
|
+
if (finalId && finalId !== storeVerifiedUserId) {
|
|
703
|
+
storeVerifiedUserId = finalId;
|
|
704
|
+
if (finalId !== instance.getState().userId) {
|
|
705
|
+
instance.refresh();
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
} catch {
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
const initWatermark = (options) => {
|
|
712
|
+
const g = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : {};
|
|
713
|
+
let instance = g[GIIME_WATERMARK_GLOBAL_SYMBOL];
|
|
714
|
+
if (!instance) {
|
|
715
|
+
instance = new GiimeWatermark(options);
|
|
716
|
+
g[GIIME_WATERMARK_GLOBAL_SYMBOL] = instance;
|
|
717
|
+
if (typeof window !== "undefined") {
|
|
718
|
+
window.__GIIME_WATERMARK__ = instance;
|
|
719
|
+
}
|
|
720
|
+
} else if (options && Object.keys(options).length > 0) {
|
|
721
|
+
instance.updateConfig(options);
|
|
722
|
+
} else {
|
|
723
|
+
instance.refresh();
|
|
724
|
+
}
|
|
725
|
+
Promise.resolve().then(() => {
|
|
726
|
+
if (instance) {
|
|
727
|
+
autoIdentifyWatermarkUser(instance);
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
return instance;
|
|
731
|
+
};
|
|
732
|
+
const createWatermark = initWatermark;
|
|
733
|
+
const destroyWatermark = () => {
|
|
734
|
+
getWatermarkInstance()?.destroy();
|
|
735
|
+
};
|
|
736
|
+
const useWatermark = (options) => {
|
|
737
|
+
return initWatermark(options);
|
|
738
|
+
};
|
|
739
|
+
const Watermark = {
|
|
740
|
+
init: initWatermark,
|
|
741
|
+
create: createWatermark,
|
|
742
|
+
getInstance: getWatermarkInstance,
|
|
743
|
+
destroy: destroyWatermark,
|
|
744
|
+
setUserId(userId) {
|
|
745
|
+
return initWatermark({ userId });
|
|
746
|
+
},
|
|
747
|
+
refresh() {
|
|
748
|
+
return getWatermarkInstance()?.refresh() ?? initWatermark();
|
|
749
|
+
},
|
|
750
|
+
getState() {
|
|
751
|
+
return getWatermarkInstance()?.getState() ?? null;
|
|
752
|
+
},
|
|
753
|
+
isInIframe,
|
|
754
|
+
shouldRenderWatermark
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
export { GIIME_WATERMARK_GLOBAL_SYMBOL, GiimeWatermark, WATERMARK_DOM_CONSTANTS, WATERMARK_MESSAGE_TYPES, Watermark, buildWatermarkText, createWatermark, destroyWatermark, formatWatermarkDate, getWatermarkInstance, hasSameOriginAncestorWatermark, initWatermark, inspectSameOriginAncestors, isInIframe, resolveWatermarkUserId, sanitizeUserId, shouldRenderWatermark, useWatermark };
|
|
758
|
+
//# sourceMappingURL=index.mjs.map
|