@privyid/persona 1.1.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.cts +2 -0
- package/dist/module.d.mts +2 -27
- package/dist/module.json +12 -0
- package/dist/module.mjs +13 -92
- package/dist/types.d.mts +13 -0
- package/package.json +25 -27
- package/dist/components/accordion/Accordion.vue +0 -121
- package/dist/components/accordion/AccordionItem.vue +0 -250
- package/dist/components/accordion/AccordionItems.vue +0 -50
- package/dist/components/accordion/AccordionItems.vue.d.ts +0 -41
- package/dist/components/accordion/index.d.ts +0 -7
- package/dist/components/accordion/index.mjs +0 -3
- package/dist/components/aspect-ratio/index.d.ts +0 -3
- package/dist/components/aspect-ratio/index.mjs +0 -21
- package/dist/components/aspect-ratio/utils/calculate-ratio.d.ts +0 -7
- package/dist/components/aspect-ratio/utils/calculate-ratio.mjs +0 -10
- package/dist/components/aspect-ratio/utils/resize-observer.d.ts +0 -1
- package/dist/components/aspect-ratio/utils/resize-observer.mjs +0 -22
- package/dist/components/avatar/Avatar.vue +0 -193
- package/dist/components/avatar/AvatarGroup.vue +0 -42
- package/dist/components/avatar/AvatarTruncate.vue +0 -33
- package/dist/components/avatar/AvatarTruncate.vue.d.ts +0 -31
- package/dist/components/avatar/assets/avatar-old.png +0 -0
- package/dist/components/avatar/assets/avatar.png +0 -0
- package/dist/components/avatar/index.d.ts +0 -2
- package/dist/components/avatar/index.mjs +0 -0
- package/dist/components/avatar/utils/color-hash.d.ts +0 -2
- package/dist/components/avatar/utils/color-hash.mjs +0 -22
- package/dist/components/avatar/utils/create-image.d.ts +0 -5
- package/dist/components/avatar/utils/create-image.mjs +0 -19
- package/dist/components/avatar/utils/load-image.d.ts +0 -1
- package/dist/components/avatar/utils/load-image.mjs +0 -22
- package/dist/components/badge/Badge.vue +0 -218
- package/dist/components/badge/index.d.ts +0 -1
- package/dist/components/badge/index.mjs +0 -0
- package/dist/components/banner/Banner.vue +0 -213
- package/dist/components/banner/index.d.ts +0 -1
- package/dist/components/banner/index.mjs +0 -0
- package/dist/components/breadcrumbs/Breadcrumb.vue +0 -62
- package/dist/components/breadcrumbs/BreadcrumbItem.vue +0 -95
- package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue +0 -78
- package/dist/components/breadcrumbs/index.d.ts +0 -11
- package/dist/components/breadcrumbs/index.mjs +0 -3
- package/dist/components/button/Button.vue +0 -422
- package/dist/components/button/index.d.ts +0 -5
- package/dist/components/button/index.mjs +0 -0
- package/dist/components/button-group/ButtonGroup.vue +0 -220
- package/dist/components/button-group/index.d.ts +0 -6
- package/dist/components/button-group/index.mjs +0 -1
- package/dist/components/calendar/Calendar.vue +0 -465
- package/dist/components/calendar/adapter/adapter.d.ts +0 -32
- package/dist/components/calendar/adapter/adapter.mjs +0 -43
- package/dist/components/calendar/adapter/date.d.ts +0 -2
- package/dist/components/calendar/adapter/date.mjs +0 -86
- package/dist/components/calendar/adapter/month.d.ts +0 -2
- package/dist/components/calendar/adapter/month.mjs +0 -66
- package/dist/components/calendar/adapter/year.d.ts +0 -2
- package/dist/components/calendar/adapter/year.mjs +0 -63
- package/dist/components/camera/Camera.vue +0 -416
- package/dist/components/camera/adapter/adapter.d.ts +0 -41
- package/dist/components/camera/adapter/adapter.mjs +0 -3
- package/dist/components/camera/adapter/capture.d.ts +0 -5
- package/dist/components/camera/adapter/capture.mjs +0 -12
- package/dist/components/camera/adapter/liveness.d.ts +0 -5
- package/dist/components/camera/adapter/liveness.mjs +0 -46
- package/dist/components/camera/adapter/qr-code.d.ts +0 -2
- package/dist/components/camera/adapter/qr-code.mjs +0 -19
- package/dist/components/camera/assets/shutter.wav +0 -0
- package/dist/components/camera/utils/motion.d.ts +0 -29
- package/dist/components/camera/utils/motion.mjs +0 -88
- package/dist/components/camera/utils/take-picture.d.ts +0 -1
- package/dist/components/camera/utils/take-picture.mjs +0 -14
- package/dist/components/caption/Caption.vue +0 -122
- package/dist/components/caption/index.d.ts +0 -1
- package/dist/components/caption/index.mjs +0 -0
- package/dist/components/card/Card.vue +0 -354
- package/dist/components/card/CardSection.vue +0 -81
- package/dist/components/card/index.d.ts +0 -2
- package/dist/components/card/index.mjs +0 -0
- package/dist/components/carousel/Carousel.vue +0 -202
- package/dist/components/carousel/CarouselBody.vue +0 -18
- package/dist/components/carousel/CarouselItem.vue +0 -10
- package/dist/components/carousel/index.d.ts +0 -4
- package/dist/components/carousel/index.mjs +0 -1
- package/dist/components/chart/Chart.vue +0 -155
- package/dist/components/chart/ChartSet.vue +0 -32
- package/dist/components/chart/ChartVal.vue +0 -36
- package/dist/components/chart/adapter/adapter.d.ts +0 -7
- package/dist/components/chart/adapter/adapter.mjs +0 -3
- package/dist/components/chart/adapter/bubble.d.ts +0 -2
- package/dist/components/chart/adapter/bubble.mjs +0 -26
- package/dist/components/chart/adapter/index.d.ts +0 -3
- package/dist/components/chart/adapter/index.mjs +0 -16
- package/dist/components/chart/adapter/line.d.ts +0 -2
- package/dist/components/chart/adapter/line.mjs +0 -66
- package/dist/components/chart/adapter/pie.d.ts +0 -2
- package/dist/components/chart/adapter/pie.mjs +0 -34
- package/dist/components/chart/index.d.ts +0 -2
- package/dist/components/chart/index.mjs +0 -0
- package/dist/components/chart/utils/use-chart.d.ts +0 -2
- package/dist/components/chart/utils/use-chart.mjs +0 -9
- package/dist/components/checkbox/Checkbox.vue +0 -232
- package/dist/components/checkbox/icon/IconCheckbox.vue +0 -13
- package/dist/components/checkbox/icon/IconInderteminate.vue +0 -12
- package/dist/components/checkbox/index.d.ts +0 -7
- package/dist/components/checkbox/index.mjs +0 -34
- package/dist/components/collapse/Collapse.vue +0 -71
- package/dist/components/contextual-bar/ContextualBar.vue +0 -461
- package/dist/components/contextual-bar/index.d.ts +0 -1
- package/dist/components/contextual-bar/index.mjs +0 -0
- package/dist/components/cropper/Cropper.vue +0 -446
- package/dist/components/cropper/index.d.ts +0 -1
- package/dist/components/cropper/index.mjs +0 -3
- package/dist/components/cropper/utils/crop-image.d.ts +0 -44
- package/dist/components/cropper/utils/crop-image.mjs +0 -43
- package/dist/components/cropper/utils/use-pinch.d.ts +0 -8
- package/dist/components/cropper/utils/use-pinch.mjs +0 -50
- package/dist/components/cropper/utils/use-preview.d.ts +0 -3
- package/dist/components/cropper/utils/use-preview.mjs +0 -21
- package/dist/components/cropper/utils/use-ratio.d.ts +0 -9
- package/dist/components/cropper/utils/use-ratio.mjs +0 -24
- package/dist/components/datepicker/Datepicker.vue +0 -235
- package/dist/components/dialog/Dialog.vue +0 -149
- package/dist/components/dialog/DialogFooter.vue +0 -138
- package/dist/components/dialog/index.d.ts +0 -52
- package/dist/components/dialog/index.mjs +0 -86
- package/dist/components/divider/Divider.vue +0 -65
- package/dist/components/dot/Dot.vue +0 -103
- package/dist/components/dot/index.d.ts +0 -1
- package/dist/components/dot/index.mjs +0 -0
- package/dist/components/dropdown/Dropdown.vue +0 -441
- package/dist/components/dropdown/DropdownHeader.vue +0 -33
- package/dist/components/dropdown/DropdownItem.vue +0 -103
- package/dist/components/dropdown/DropdownText.vue +0 -34
- package/dist/components/dropdown/index.d.ts +0 -10
- package/dist/components/dropdown/index.mjs +0 -1
- package/dist/components/dropdown/utils/use-focus.d.ts +0 -5
- package/dist/components/dropdown/utils/use-focus.mjs +0 -22
- package/dist/components/dropdown-subitem/DropdownSubitem.vue +0 -182
- package/dist/components/dropdown-subitem/index.d.ts +0 -12
- package/dist/components/dropdown-subitem/index.mjs +0 -1
- package/dist/components/dropzone/Dropzone.vue +0 -261
- package/dist/components/dropzone/index.d.ts +0 -4
- package/dist/components/dropzone/index.mjs +0 -0
- package/dist/components/dropzone/utils/accept.d.ts +0 -1
- package/dist/components/dropzone/utils/accept.mjs +0 -17
- package/dist/components/filterbar/Filterbar.vue +0 -103
- package/dist/components/filterbar/Filterbar.vue.d.ts +0 -40
- package/dist/components/filterbar/index.d.ts +0 -45
- package/dist/components/filterbar/index.mjs +0 -7
- package/dist/components/filterbar/pinned/PinnedDate.vue +0 -100
- package/dist/components/filterbar/pinned/PinnedDate.vue.d.ts +0 -72
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue +0 -113
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue.d.ts +0 -48
- package/dist/components/filterbar/pinned/PinnedSelect.vue +0 -100
- package/dist/components/filterbar/pinned/PinnedSelect.vue.d.ts +0 -47
- package/dist/components/filterbar/pinned/PinnedToggle.vue +0 -77
- package/dist/components/filterbar/pinned/PinnedToggle.vue.d.ts +0 -59
- package/dist/components/form-group/FormGroup.vue +0 -169
- package/dist/components/global/router.d.ts +0 -24
- package/dist/components/global/router.mjs +0 -7
- package/dist/components/global/store.d.ts +0 -49
- package/dist/components/global/store.mjs +0 -52
- package/dist/components/global/types.d.ts +0 -4
- package/dist/components/global/types.mjs +0 -0
- package/dist/components/global/use-singleton.d.ts +0 -21
- package/dist/components/global/use-singleton.mjs +0 -60
- package/dist/components/global/utils/queue.d.ts +0 -16
- package/dist/components/global/utils/queue.mjs +0 -35
- package/dist/components/heading/Heading.vue +0 -140
- package/dist/components/heading/index.d.ts +0 -3
- package/dist/components/heading/index.mjs +0 -0
- package/dist/components/input/Input.vue +0 -243
- package/dist/components/input/index.d.ts +0 -6
- package/dist/components/input/index.mjs +0 -25
- package/dist/components/input/utils/accept.d.ts +0 -26
- package/dist/components/input/utils/accept.mjs +0 -81
- package/dist/components/input-color/index.d.ts +0 -1
- package/dist/components/input-color/index.mjs +0 -0
- package/dist/components/input-color/inputColor.vue +0 -264
- package/dist/components/input-file/InputFile.vue +0 -221
- package/dist/components/input-group/InputGroup.vue +0 -188
- package/dist/components/input-group/InputGroupAddon.vue +0 -42
- package/dist/components/input-group/index.d.ts +0 -6
- package/dist/components/input-group/index.mjs +0 -1
- package/dist/components/input-password/InputPassword.vue +0 -110
- package/dist/components/input-password/index.d.ts +0 -2
- package/dist/components/input-password/index.mjs +0 -17
- package/dist/components/input-pin/InputPin.vue +0 -170
- package/dist/components/input-pin/index.d.ts +0 -6
- package/dist/components/input-pin/index.mjs +0 -3
- package/dist/components/input-range/InputRange.vue +0 -303
- package/dist/components/input-range/utils/use-drag.d.ts +0 -3
- package/dist/components/input-range/utils/use-drag.mjs +0 -26
- package/dist/components/label/Label.vue +0 -265
- package/dist/components/label/index.d.ts +0 -1
- package/dist/components/label/index.mjs +0 -0
- package/dist/components/list-group/ListGroup.vue +0 -75
- package/dist/components/list-group/ListGroupItem.vue +0 -88
- package/dist/components/list-group/index.d.ts +0 -1
- package/dist/components/list-group/index.mjs +0 -0
- package/dist/components/main/Main.vue +0 -66
- package/dist/components/markdown/index.d.ts +0 -29
- package/dist/components/markdown/index.mjs +0 -25
- package/dist/components/meta.json +0 -171
- package/dist/components/modal/Modal.vue +0 -546
- package/dist/components/modal/index.d.ts +0 -1
- package/dist/components/modal/index.mjs +0 -0
- package/dist/components/nav/Nav.vue +0 -416
- package/dist/components/nav/NavCollapse.vue +0 -66
- package/dist/components/nav/NavForm.vue +0 -23
- package/dist/components/nav/NavItem.vue +0 -187
- package/dist/components/nav/NavItemDropdown.vue +0 -120
- package/dist/components/nav/NavSubItem.vue +0 -194
- package/dist/components/nav/NavText.vue +0 -19
- package/dist/components/nav/index.d.ts +0 -2
- package/dist/components/nav/index.mjs +0 -0
- package/dist/components/navbar/Navbar.vue +0 -284
- package/dist/components/navbar/NavbarBrand.vue +0 -31
- package/dist/components/navbar/NavbarNav.vue +0 -114
- package/dist/components/navbar/NavbarToggle.vue +0 -72
- package/dist/components/navbar/index.d.ts +0 -9
- package/dist/components/navbar/index.mjs +0 -1
- package/dist/components/navbar-menu/NavbarNavMenu.vue +0 -59
- package/dist/components/notify/Notify.vue +0 -51
- package/dist/components/notify/NotifyGroup.vue +0 -244
- package/dist/components/notify/NotifyItem.vue +0 -45
- package/dist/components/notify/index.d.ts +0 -20
- package/dist/components/notify/index.mjs +0 -18
- package/dist/components/overlay/Overlay.vue +0 -68
- package/dist/components/overlay/assets/icon-white.svg +0 -1
- package/dist/components/overlay/index.d.ts +0 -2
- package/dist/components/overlay/index.mjs +0 -8
- package/dist/components/overlay/utils/use-loading.d.ts +0 -4
- package/dist/components/overlay/utils/use-loading.mjs +0 -28
- package/dist/components/page/Page.vue +0 -106
- package/dist/components/pagination/Pagination.vue +0 -415
- package/dist/components/pagination/index.d.ts +0 -14
- package/dist/components/pagination/index.mjs +0 -38
- package/dist/components/pagination/utils/calculate-page.d.ts +0 -11
- package/dist/components/pagination/utils/calculate-page.mjs +0 -48
- package/dist/components/pdf-helipad/PdfHelipad.vue +0 -147
- package/dist/components/pdf-helipad/index.d.ts +0 -7
- package/dist/components/pdf-helipad/index.mjs +0 -0
- package/dist/components/pdf-helipad/utils/use-drag.d.ts +0 -3
- package/dist/components/pdf-helipad/utils/use-drag.mjs +0 -38
- package/dist/components/pdf-object/PdfObject.vue +0 -348
- package/dist/components/pdf-object/PdfObjectAddon.vue +0 -55
- package/dist/components/pdf-object/PdfObjectDebugger.vue +0 -70
- package/dist/components/pdf-object/PdfObjects.vue +0 -39
- package/dist/components/pdf-object/index.d.ts +0 -63
- package/dist/components/pdf-object/index.mjs +0 -110
- package/dist/components/pdf-object/utils/overlap.d.ts +0 -51
- package/dist/components/pdf-object/utils/overlap.mjs +0 -54
- package/dist/components/pdf-object/utils/position.d.ts +0 -64
- package/dist/components/pdf-object/utils/position.mjs +0 -48
- package/dist/components/pdf-object/utils/use-drag.d.ts +0 -9
- package/dist/components/pdf-object/utils/use-drag.mjs +0 -69
- package/dist/components/pdf-object/utils/use-drop.d.ts +0 -7
- package/dist/components/pdf-object/utils/use-drop.mjs +0 -57
- package/dist/components/pdf-object/utils/use-resize.d.ts +0 -17
- package/dist/components/pdf-object/utils/use-resize.mjs +0 -90
- package/dist/components/pdf-object/utils/use-selector.d.ts +0 -4
- package/dist/components/pdf-object/utils/use-selector.mjs +0 -26
- package/dist/components/pdf-text/PdfText.vue +0 -138
- package/dist/components/pdf-text/utils/text-to-image.d.ts +0 -68
- package/dist/components/pdf-text/utils/text-to-image.mjs +0 -120
- package/dist/components/pdf-viewer/PdfError.vue +0 -74
- package/dist/components/pdf-viewer/PdfLoading.vue +0 -24
- package/dist/components/pdf-viewer/PdfNavigation.vue +0 -169
- package/dist/components/pdf-viewer/PdfViewer.vue +0 -377
- package/dist/components/pdf-viewer/assets/pdf-loading.svg +0 -1
- package/dist/components/pdf-viewer/index.d.ts +0 -25
- package/dist/components/pdf-viewer/index.mjs +0 -24
- package/dist/components/pdf-viewer/utils/pdfjs.d.ts +0 -68
- package/dist/components/pdf-viewer/utils/pdfjs.mjs +0 -54
- package/dist/components/pdf-viewer/utils/use-idle.d.ts +0 -2
- package/dist/components/pdf-viewer/utils/use-idle.mjs +0 -25
- package/dist/components/pdf-viewer/utils/use-sticky.d.ts +0 -6
- package/dist/components/pdf-viewer/utils/use-sticky.mjs +0 -49
- package/dist/components/pdf-viewer/utils/use-viewer.d.ts +0 -27
- package/dist/components/pdf-viewer/utils/use-viewer.mjs +0 -191
- package/dist/components/popover/Popover.vue +0 -131
- package/dist/components/popover/index.d.ts +0 -17
- package/dist/components/popover/index.mjs +0 -52
- package/dist/components/popup/Popup.vue +0 -428
- package/dist/components/popup/index.d.ts +0 -38
- package/dist/components/popup/index.mjs +0 -31
- package/dist/components/progress/Progress.vue +0 -221
- package/dist/components/progress/ProgressItem.vue +0 -56
- package/dist/components/progress/index.d.ts +0 -2
- package/dist/components/progress/index.mjs +0 -0
- package/dist/components/progress-indicator/ProgressIndicator.vue +0 -132
- package/dist/components/progressbar/Progressbar.vue +0 -113
- package/dist/components/progressbar/index.d.ts +0 -7
- package/dist/components/progressbar/index.mjs +0 -11
- package/dist/components/pspdfkit/PspdfHelipad.vue +0 -165
- package/dist/components/pspdfkit/PspdfObject.vue +0 -341
- package/dist/components/pspdfkit/PspdfObjectAddon.vue +0 -30
- package/dist/components/pspdfkit/PspdfObjects.vue +0 -30
- package/dist/components/pspdfkit/PspdfViewer.vue +0 -257
- package/dist/components/pspdfkit/css/custom.css +0 -345
- package/dist/components/pspdfkit/index.d.ts +0 -8
- package/dist/components/pspdfkit/index.mjs +0 -7
- package/dist/components/pspdfkit/utils/position.d.ts +0 -1
- package/dist/components/pspdfkit/utils/position.mjs +0 -5
- package/dist/components/pspdfkit/utils/pspdfkit.d.ts +0 -17
- package/dist/components/pspdfkit/utils/pspdfkit.mjs +0 -53
- package/dist/components/pspdfkit/utils/use-drop.d.ts +0 -2
- package/dist/components/pspdfkit/utils/use-drop.mjs +0 -41
- package/dist/components/pspdfkit/utils/use-viewer.d.ts +0 -17
- package/dist/components/pspdfkit/utils/use-viewer.mjs +0 -167
- package/dist/components/qrcode/Qrcode.vue +0 -174
- package/dist/components/qrcode/index.d.ts +0 -1
- package/dist/components/qrcode/index.mjs +0 -0
- package/dist/components/radio/Radio.vue +0 -304
- package/dist/components/radio/index.d.ts +0 -7
- package/dist/components/radio/index.mjs +0 -16
- package/dist/components/richtext/Richtext.vue +0 -295
- package/dist/components/richtext/RichtextToolbarAdvance.vue +0 -37
- package/dist/components/richtext/RichtextToolbarSimple.vue +0 -158
- package/dist/components/richtext/control/RichtextControlFontFamily.vue +0 -56
- package/dist/components/richtext/control/RichtextControlFontSize.vue +0 -81
- package/dist/components/richtext/control/RichtextControlHighlight.vue +0 -135
- package/dist/components/richtext/control/RichtextControlHistory.vue +0 -27
- package/dist/components/richtext/control/RichtextControlImage.vue +0 -34
- package/dist/components/richtext/control/RichtextControlLink.vue +0 -53
- package/dist/components/richtext/control/RichtextControlList.vue +0 -45
- package/dist/components/richtext/control/RichtextControlTable.vue +0 -106
- package/dist/components/richtext/control/RichtextControlTextAlign.vue +0 -90
- package/dist/components/richtext/control/RichtextControlTextFormat.vue +0 -49
- package/dist/components/richtext/control/RichtextControlTextHeading.vue +0 -101
- package/dist/components/richtext/index.d.ts +0 -7
- package/dist/components/richtext/index.mjs +0 -7
- package/dist/components/richtext/popup/RichtextPopupImageEdit.vue +0 -65
- package/dist/components/richtext/popup/RichtextPopupLinkDetail.vue +0 -95
- package/dist/components/richtext/popup/RichtextPopupLinkEdit.vue +0 -74
- package/dist/components/richtext/tiptap/image-align.d.ts +0 -43
- package/dist/components/richtext/tiptap/image-align.mjs +0 -60
- package/dist/components/ringbar/Ringbar.vue +0 -158
- package/dist/components/ringbar/index.d.ts +0 -1
- package/dist/components/ringbar/index.mjs +0 -0
- package/dist/components/select/Select.vue +0 -576
- package/dist/components/select/SelectInput.vue +0 -123
- package/dist/components/select/SelectTags.vue +0 -58
- package/dist/components/select/adapter/adapter.d.ts +0 -17
- package/dist/components/select/adapter/adapter.mjs +0 -20
- package/dist/components/select/adapter/async-adapter.d.ts +0 -17
- package/dist/components/select/adapter/async-adapter.mjs +0 -61
- package/dist/components/select/adapter/basic-adapter.d.ts +0 -5
- package/dist/components/select/adapter/basic-adapter.mjs +0 -13
- package/dist/components/select/adapter/fuzzy-adapter.d.ts +0 -2
- package/dist/components/select/adapter/fuzzy-adapter.mjs +0 -24
- package/dist/components/select/index.d.ts +0 -15
- package/dist/components/select/index.mjs +0 -20
- package/dist/components/select/utils/use-on-scroll.d.ts +0 -2
- package/dist/components/select/utils/use-on-scroll.mjs +0 -9
- package/dist/components/select/utils/use-on-typing.d.ts +0 -3
- package/dist/components/select/utils/use-on-typing.mjs +0 -8
- package/dist/components/sheet/Sheet.vue +0 -230
- package/dist/components/shimmer/Shimmer.vue +0 -123
- package/dist/components/shimmer/index.d.ts +0 -2
- package/dist/components/shimmer/index.mjs +0 -10
- package/dist/components/sidebar/Sidebar.vue +0 -249
- package/dist/components/sidebar/SidebarBrand.vue +0 -108
- package/dist/components/sidebar/SidebarContent.vue +0 -21
- package/dist/components/sidebar/SidebarContent.vue.d.ts +0 -16
- package/dist/components/sidebar/SidebarNav.vue +0 -260
- package/dist/components/sidebar/index.d.ts +0 -9
- package/dist/components/sidebar/index.mjs +0 -1
- package/dist/components/sidebar-menu/SidebarMenu.vue +0 -123
- package/dist/components/sidebar-menu/SidebarMenuItem.vue +0 -70
- package/dist/components/sidebar-menu/index.d.ts +0 -138
- package/dist/components/sidebar-menu/index.mjs +0 -44
- package/dist/components/signature-draw/SignatureDraw.vue +0 -101
- package/dist/components/signature-draw/SignatureDrawDesktop.vue +0 -165
- package/dist/components/signature-draw/SignatureDrawMobile.vue +0 -244
- package/dist/components/signature-draw/utils/canvas.d.ts +0 -41
- package/dist/components/signature-draw/utils/canvas.mjs +0 -55
- package/dist/components/signature-draw/utils/image.d.ts +0 -7
- package/dist/components/signature-draw/utils/image.mjs +0 -23
- package/dist/components/signature-draw/utils/smooth-line.d.ts +0 -36
- package/dist/components/signature-draw/utils/smooth-line.mjs +0 -56
- package/dist/components/signature-draw/utils/straight-line.d.ts +0 -8
- package/dist/components/signature-draw/utils/straight-line.mjs +0 -24
- package/dist/components/signature-draw/utils/use-draw.d.ts +0 -7
- package/dist/components/signature-draw/utils/use-draw.mjs +0 -29
- package/dist/components/signature-text/SignatureText.vue +0 -138
- package/dist/components/signature-text/utils/formatter.d.ts +0 -2
- package/dist/components/signature-text/utils/formatter.mjs +0 -8
- package/dist/components/signature-text/utils/generate-text.d.ts +0 -8
- package/dist/components/signature-text/utils/generate-text.mjs +0 -28
- package/dist/components/signature-text/utils/load-font.d.ts +0 -1
- package/dist/components/signature-text/utils/load-font.mjs +0 -22
- package/dist/components/spinner/Spinner.vue +0 -156
- package/dist/components/spinner/SpinnerRing.vue +0 -34
- package/dist/components/spinner/SpinnerRinggo.vue +0 -64
- package/dist/components/spread/Spread.vue +0 -52
- package/dist/components/steps/Step.vue +0 -49
- package/dist/components/steps/StepSlider.vue +0 -37
- package/dist/components/steps/StepSlider.vue.d.ts +0 -34
- package/dist/components/steps/Steps.vue +0 -150
- package/dist/components/steps/index.d.ts +0 -30
- package/dist/components/steps/index.mjs +0 -53
- package/dist/components/steps/utils/hook.d.ts +0 -10
- package/dist/components/steps/utils/hook.mjs +0 -35
- package/dist/components/strengthbar/Strengthbar.vue +0 -97
- package/dist/components/subheading/Subheading.vue +0 -148
- package/dist/components/subheading/index.d.ts +0 -1
- package/dist/components/subheading/index.mjs +0 -0
- package/dist/components/table/Table.vue +0 -391
- package/dist/components/table/Table.vue.d.ts +0 -174
- package/dist/components/table/index.d.ts +0 -49
- package/dist/components/table/index.mjs +0 -37
- package/dist/components/table-flex/TableFlex.vue +0 -341
- package/dist/components/table-static/TableStatic.vue +0 -458
- package/dist/components/table-static/TableStaticRoot.vue +0 -42
- package/dist/components/table-static/TableStaticSort.vue +0 -23
- package/dist/components/table-static/index.d.ts +0 -64
- package/dist/components/table-static/index.mjs +0 -24
- package/dist/components/tabs/Tab.vue +0 -34
- package/dist/components/tabs/TabContent.vue +0 -53
- package/dist/components/tabs/TabContent.vue.d.ts +0 -33
- package/dist/components/tabs/Tabs.vue +0 -234
- package/dist/components/text/Text.vue +0 -235
- package/dist/components/text/index.d.ts +0 -2
- package/dist/components/text/index.mjs +0 -0
- package/dist/components/textarea/Textarea.vue +0 -188
- package/dist/components/time/Time.vue +0 -257
- package/dist/components/time/TimeItem.vue +0 -117
- package/dist/components/time/index.d.ts +0 -19
- package/dist/components/time/index.mjs +0 -53
- package/dist/components/time/utils/index.d.ts +0 -9
- package/dist/components/time/utils/index.mjs +0 -82
- package/dist/components/timepicker/Timepicker.vue +0 -230
- package/dist/components/toast/Toast.vue +0 -269
- package/dist/components/toast/index.d.ts +0 -50
- package/dist/components/toast/index.mjs +0 -44
- package/dist/components/toggle/Toggle.vue +0 -239
- package/dist/components/tooltip/Tooltip.vue +0 -172
- package/dist/components/tooltip/TooltipContainer.vue +0 -89
- package/dist/components/tooltip/index.d.ts +0 -17
- package/dist/components/tooltip/index.mjs +0 -113
- package/dist/components/tooltip/utils/create-handler.d.ts +0 -9
- package/dist/components/tooltip/utils/create-handler.mjs +0 -16
- package/dist/components/tooltip/utils/on-hover.d.ts +0 -23
- package/dist/components/tooltip/utils/on-hover.mjs +0 -42
- package/dist/components/tooltip/utils/parse-bindings.d.ts +0 -23
- package/dist/components/tooltip/utils/parse-bindings.mjs +0 -47
- package/dist/components/tour/Tour.vue +0 -112
- package/dist/components/tour/TourDialog.vue +0 -207
- package/dist/components/tour/TourHighlight.vue +0 -58
- package/dist/components/tour/core/base.d.ts +0 -59
- package/dist/components/tour/core/base.mjs +0 -69
- package/dist/components/tour/core/step/action.d.ts +0 -15
- package/dist/components/tour/core/step/action.mjs +0 -14
- package/dist/components/tour/core/step/conditional.d.ts +0 -25
- package/dist/components/tour/core/step/conditional.mjs +0 -57
- package/dist/components/tour/core/step/delay.d.ts +0 -8
- package/dist/components/tour/core/step/delay.mjs +0 -9
- package/dist/components/tour/core/step/dialog.d.ts +0 -11
- package/dist/components/tour/core/step/dialog.mjs +0 -25
- package/dist/components/tour/core/step/visit.d.ts +0 -9
- package/dist/components/tour/core/step/visit.mjs +0 -15
- package/dist/components/tour/core/step.d.ts +0 -37
- package/dist/components/tour/core/step.mjs +0 -46
- package/dist/components/tour/core/story.d.ts +0 -130
- package/dist/components/tour/core/story.mjs +0 -166
- package/dist/components/tour/core/tour.d.ts +0 -126
- package/dist/components/tour/core/tour.mjs +0 -196
- package/dist/components/tour/index.d.ts +0 -3
- package/dist/components/tour/index.mjs +0 -4
- package/dist/components/tour/utils/focus.d.ts +0 -1
- package/dist/components/tour/utils/focus.mjs +0 -6
- package/dist/components/tour/utils/is-visible.d.ts +0 -1
- package/dist/components/tour/utils/is-visible.mjs +0 -29
- package/dist/components/tour/utils/wait-element.d.ts +0 -6
- package/dist/components/tour/utils/wait-element.mjs +0 -45
- package/dist/components/truncate/Truncate.vue +0 -75
- package/dist/components/utils/array.d.ts +0 -2
- package/dist/components/utils/array.mjs +0 -19
- package/dist/components/utils/base64.d.ts +0 -8
- package/dist/components/utils/base64.mjs +0 -35
- package/dist/components/utils/color.d.ts +0 -17
- package/dist/components/utils/color.mjs +0 -14
- package/dist/components/utils/date.d.ts +0 -22
- package/dist/components/utils/date.mjs +0 -14
- package/dist/components/utils/value.d.ts +0 -8
- package/dist/components/utils/value.mjs +0 -7
- package/dist/components/utils/vnode.d.ts +0 -15
- package/dist/components/utils/vnode.mjs +0 -18
- package/dist/components/wizard/Wizard.vue +0 -84
- package/dist/components/wizard/WizardBody.vue +0 -50
- package/dist/components/wizard/WizardHeader.vue +0 -38
- package/dist/components/wizard/WizardHeader.vue.d.ts +0 -16
- package/dist/components/wizard/WizardStep.vue +0 -31
- package/dist/core/index.d.ts +0 -43
- package/dist/core/index.mjs +0 -148
- package/dist/directive/index.d.ts +0 -3
- package/dist/directive/index.mjs +0 -12
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -27
- package/dist/runtime/plugins/persona.d.ts +0 -2
- package/dist/runtime/plugins/persona.js +0 -35
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-p-aspect-ratio="width / height"
|
|
4
|
-
class="signature-draw signature-draw--mobile"
|
|
5
|
-
data-testid="signature-draw-mobile"
|
|
6
|
-
:class="classNames"
|
|
7
|
-
:style="style">
|
|
8
|
-
<div class="signature-draw__preview">
|
|
9
|
-
<template v-if="model">
|
|
10
|
-
<img
|
|
11
|
-
:src="preview"
|
|
12
|
-
alt="signature-draw-preview"
|
|
13
|
-
data-testid="signature-draw-preview"
|
|
14
|
-
@click="open()">
|
|
15
|
-
<Button
|
|
16
|
-
variant="link"
|
|
17
|
-
size="xs"
|
|
18
|
-
class="signature-draw__reset"
|
|
19
|
-
data-testid="signature-draw-edit"
|
|
20
|
-
icon
|
|
21
|
-
@click="open()">
|
|
22
|
-
<IconEdit />
|
|
23
|
-
</Button>
|
|
24
|
-
</template>
|
|
25
|
-
<template v-else>
|
|
26
|
-
<Button
|
|
27
|
-
data-testid="signature-draw-open"
|
|
28
|
-
@click="open()">
|
|
29
|
-
{{ openDrawLabel }}
|
|
30
|
-
</Button>
|
|
31
|
-
</template>
|
|
32
|
-
</div>
|
|
33
|
-
<transition name="zoom-in">
|
|
34
|
-
<div
|
|
35
|
-
v-if="isOpen"
|
|
36
|
-
class="signature-draw__modal"
|
|
37
|
-
data-testid="signature-draw-modal">
|
|
38
|
-
<SignatureDrawDesktop
|
|
39
|
-
v-model.base64="rawModel"
|
|
40
|
-
:class="classNames"
|
|
41
|
-
:placeholder="placeholder"
|
|
42
|
-
:color="color"
|
|
43
|
-
:width="mode === 'rotate' ? height : width"
|
|
44
|
-
:height="mode === 'rotate' ? width : height"
|
|
45
|
-
:reset-label="resetLabel" />
|
|
46
|
-
<Button
|
|
47
|
-
class="signature-draw__close"
|
|
48
|
-
nganu="1311"
|
|
49
|
-
data-testid="signature-draw-close"
|
|
50
|
-
@click="close()">
|
|
51
|
-
<span>{{ closeDrawLabel }}</span>
|
|
52
|
-
</Button>
|
|
53
|
-
</div>
|
|
54
|
-
</transition>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script lang="ts" setup>
|
|
59
|
-
import { useWindowSize } from '@vueuse/core'
|
|
60
|
-
import type {
|
|
61
|
-
PropType,
|
|
62
|
-
StyleValue,
|
|
63
|
-
} from 'vue-demi'
|
|
64
|
-
import {
|
|
65
|
-
computed,
|
|
66
|
-
ref,
|
|
67
|
-
watch,
|
|
68
|
-
} from 'vue-demi'
|
|
69
|
-
import Button from '../button/Button.vue'
|
|
70
|
-
import { useVModel } from '../input'
|
|
71
|
-
import SignatureDrawDesktop from './SignatureDrawDesktop.vue'
|
|
72
|
-
import { replaceColor, rotateImage } from './utils/image'
|
|
73
|
-
import IconEdit from '@privyid/persona-icon/vue/edit/20.vue'
|
|
74
|
-
import { vPAspectRatio } from '../aspect-ratio'
|
|
75
|
-
import type { ModelModifier } from '../dropzone'
|
|
76
|
-
import { usePreview } from '../cropper'
|
|
77
|
-
import { fromBase64 } from '../utils/base64'
|
|
78
|
-
|
|
79
|
-
const props = defineProps({
|
|
80
|
-
modelValue: {
|
|
81
|
-
type : [String, globalThis.File],
|
|
82
|
-
default: '',
|
|
83
|
-
},
|
|
84
|
-
modelModifiers: {
|
|
85
|
-
type : Object as PropType<ModelModifier>,
|
|
86
|
-
default: () => ({} as ModelModifier),
|
|
87
|
-
},
|
|
88
|
-
width: {
|
|
89
|
-
type : Number,
|
|
90
|
-
default: 430,
|
|
91
|
-
},
|
|
92
|
-
height: {
|
|
93
|
-
type : Number,
|
|
94
|
-
default: 230,
|
|
95
|
-
},
|
|
96
|
-
color: {
|
|
97
|
-
type : String,
|
|
98
|
-
default: '#000000',
|
|
99
|
-
},
|
|
100
|
-
placeholder: {
|
|
101
|
-
type : String,
|
|
102
|
-
default: '',
|
|
103
|
-
},
|
|
104
|
-
resetLabel: {
|
|
105
|
-
type : String,
|
|
106
|
-
default: 'Reset',
|
|
107
|
-
},
|
|
108
|
-
openDrawLabel: {
|
|
109
|
-
type : String,
|
|
110
|
-
default: 'Click to Draw',
|
|
111
|
-
},
|
|
112
|
-
closeDrawLabel: {
|
|
113
|
-
type : String,
|
|
114
|
-
default: 'Save',
|
|
115
|
-
},
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
const model = useVModel(props)
|
|
119
|
-
const preview = usePreview(model, '')
|
|
120
|
-
const rawModel = ref('')
|
|
121
|
-
const isOpen = ref(false)
|
|
122
|
-
const screen = useWindowSize()
|
|
123
|
-
|
|
124
|
-
const mode = computed(() => {
|
|
125
|
-
return screen.width.value < props.width + 32 /* 2rem */
|
|
126
|
-
? 'rotate'
|
|
127
|
-
: 'normal'
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
const classNames = computed(() => {
|
|
131
|
-
const result: string[] = []
|
|
132
|
-
|
|
133
|
-
if (mode.value)
|
|
134
|
-
result.push(`signature-draw--${mode.value}`)
|
|
135
|
-
|
|
136
|
-
return result
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
const style = computed(() => {
|
|
140
|
-
return {
|
|
141
|
-
width : `${props.width}px`,
|
|
142
|
-
aspectRatio: `${props.width / props.height}`,
|
|
143
|
-
} as StyleValue
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
async function open () {
|
|
147
|
-
const result = preview.value && mode.value === 'rotate'
|
|
148
|
-
? await rotateImage(preview.value, 90)
|
|
149
|
-
: preview.value
|
|
150
|
-
|
|
151
|
-
rawModel.value = result
|
|
152
|
-
isOpen.value = true
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
async function close () {
|
|
156
|
-
const result = rawModel.value && mode.value === 'rotate'
|
|
157
|
-
? await rotateImage(rawModel.value, -90)
|
|
158
|
-
: rawModel.value
|
|
159
|
-
|
|
160
|
-
const value = props.modelModifiers.base64
|
|
161
|
-
? result
|
|
162
|
-
: fromBase64(result)
|
|
163
|
-
|
|
164
|
-
// console.log('close', result, value)
|
|
165
|
-
|
|
166
|
-
model.value = value
|
|
167
|
-
isOpen.value = false
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
watch(() => props.color, async (color) => {
|
|
171
|
-
if (!isOpen.value && preview.value) {
|
|
172
|
-
const result = await replaceColor(preview.value, color)
|
|
173
|
-
const value = props.modelModifiers.base64
|
|
174
|
-
? result
|
|
175
|
-
: fromBase64(result)
|
|
176
|
-
|
|
177
|
-
model.value = value
|
|
178
|
-
isOpen.value = false
|
|
179
|
-
}
|
|
180
|
-
})
|
|
181
|
-
|
|
182
|
-
watch(isOpen, (value) => {
|
|
183
|
-
if (value)
|
|
184
|
-
document.body.style.setProperty('overflow-y', 'hidden')
|
|
185
|
-
else
|
|
186
|
-
document.body.style.removeProperty('overflow-y')
|
|
187
|
-
})
|
|
188
|
-
</script>
|
|
189
|
-
|
|
190
|
-
<style lang="postcss">
|
|
191
|
-
.signature-draw {
|
|
192
|
-
&--mobile {
|
|
193
|
-
@apply border rounded border-dashed max-w-full text-center flex items-center justify-center bg-default;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
&__modal {
|
|
197
|
-
@apply fixed w-full h-full top-0 left-0 bg-default z-50 flex items-center justify-center flex-col p-5;
|
|
198
|
-
@apply dark:bg-dark-default;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
&__close {
|
|
202
|
-
@apply mt-4;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
&--rotate {
|
|
206
|
-
.signature-draw__close {
|
|
207
|
-
@apply mr-4 mt-0;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.signature-draw__modal {
|
|
211
|
-
@apply flex-col-reverse;
|
|
212
|
-
|
|
213
|
-
&,
|
|
214
|
-
& * {
|
|
215
|
-
@apply vertical-lr;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.signature-draw__reset {
|
|
219
|
-
@apply bottom-1 top-auto;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.btn--xs {
|
|
223
|
-
@apply py-2 px-1 pi-1;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.btn--md {
|
|
227
|
-
@apply py-5 px-3 pi-3;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
&__preview {
|
|
233
|
-
@apply w-full flex items-center justify-center;
|
|
234
|
-
|
|
235
|
-
.btn--variant-solid.btn--default {
|
|
236
|
-
@apply dark:text-dark-subtlest hover:dark:text-dark-on-emphasis;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
& > img {
|
|
240
|
-
@apply w-full h-full;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create canvas element
|
|
3
|
-
* @param width width
|
|
4
|
-
* @param height height
|
|
5
|
-
*/
|
|
6
|
-
export declare function createCanvas(width: number, height: number, dpi?: number): HTMLCanvasElement;
|
|
7
|
-
/**
|
|
8
|
-
* Fill and replace color of image
|
|
9
|
-
* @param canvas Target canvas
|
|
10
|
-
* @param color new Color
|
|
11
|
-
*/
|
|
12
|
-
export declare function replaceColor(canvas: HTMLCanvasElement, color: string): void;
|
|
13
|
-
export interface DrawLineOptions {
|
|
14
|
-
color?: string;
|
|
15
|
-
lineSize?: number;
|
|
16
|
-
lineJoin?: CanvasLineJoin;
|
|
17
|
-
lineCap?: CanvasLineCap;
|
|
18
|
-
}
|
|
19
|
-
export type DrawLineCoordinate = [number, number, number, number];
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param canvas Target canvas
|
|
23
|
-
* @param coordinate line coordinate, format is [x0, y0, x1, y1]
|
|
24
|
-
* @param options line options
|
|
25
|
-
* @example
|
|
26
|
-
*
|
|
27
|
-
* drawLine(canvas, [0,0,50,50], { color: '#e4e4e4' })
|
|
28
|
-
*/
|
|
29
|
-
export declare function drawLine(canvas: HTMLCanvasElement, coordinate: DrawLineCoordinate, options?: DrawLineOptions): void;
|
|
30
|
-
/**
|
|
31
|
-
* Clear and reset canvas
|
|
32
|
-
* @param canvas Target Canvas
|
|
33
|
-
*/
|
|
34
|
-
export declare function clearAll(canvas: HTMLCanvasElement): void;
|
|
35
|
-
/**
|
|
36
|
-
* Load and place to image to canvas
|
|
37
|
-
* @param canvas Target canvas
|
|
38
|
-
* @param url Image url
|
|
39
|
-
*/
|
|
40
|
-
export declare function placeImage(canvas: HTMLCanvasElement, url: string): Promise<void>;
|
|
41
|
-
export declare function toDataURL(canvas: HTMLCanvasElement, ...args: Parameters<HTMLCanvasElement['toDataURL']>): string;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import defu from "defu";
|
|
2
|
-
import loadImage from "../../avatar/utils/load-image.mjs";
|
|
3
|
-
import { toRGB } from "../../utils/color.mjs";
|
|
4
|
-
export function createCanvas(width, height, dpi = 1) {
|
|
5
|
-
const canvas = document.createElement("canvas");
|
|
6
|
-
const context = canvas.getContext("2d");
|
|
7
|
-
canvas.width = width * dpi;
|
|
8
|
-
canvas.height = height * dpi;
|
|
9
|
-
context.scale(dpi, dpi);
|
|
10
|
-
return canvas;
|
|
11
|
-
}
|
|
12
|
-
export function replaceColor(canvas, color) {
|
|
13
|
-
const context = canvas.getContext("2d");
|
|
14
|
-
const imgData = context.getImageData(0, 0, canvas.width, canvas.height);
|
|
15
|
-
const pixels = imgData.data;
|
|
16
|
-
const rgb = toRGB(color);
|
|
17
|
-
for (let i = 0; i < pixels.length; i += 4) {
|
|
18
|
-
if (pixels[i + 3] > 0) {
|
|
19
|
-
pixels[i] = rgb.R;
|
|
20
|
-
pixels[i + 1] = rgb.G;
|
|
21
|
-
pixels[i + 2] = rgb.B;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
context.putImageData(imgData, 0, 0);
|
|
25
|
-
}
|
|
26
|
-
export function drawLine(canvas, coordinate, options) {
|
|
27
|
-
const context = canvas.getContext("2d");
|
|
28
|
-
const style = defu(options, {
|
|
29
|
-
color: "#000000",
|
|
30
|
-
lineSize: 2.5,
|
|
31
|
-
lineCap: "round",
|
|
32
|
-
lineJoin: "round"
|
|
33
|
-
});
|
|
34
|
-
context.strokeStyle = style.color;
|
|
35
|
-
context.lineWidth = style.lineSize;
|
|
36
|
-
context.lineJoin = style.lineJoin;
|
|
37
|
-
context.lineCap = style.lineCap;
|
|
38
|
-
context.beginPath();
|
|
39
|
-
context.moveTo(coordinate[0], coordinate[1]);
|
|
40
|
-
context.lineTo(coordinate[2], coordinate[3]);
|
|
41
|
-
context.stroke();
|
|
42
|
-
}
|
|
43
|
-
export function clearAll(canvas) {
|
|
44
|
-
const context = canvas.getContext("2d");
|
|
45
|
-
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
46
|
-
}
|
|
47
|
-
export async function placeImage(canvas, url) {
|
|
48
|
-
const context = canvas.getContext("2d");
|
|
49
|
-
const image = await loadImage(url);
|
|
50
|
-
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
51
|
-
context.drawImage(image, 0, 0);
|
|
52
|
-
}
|
|
53
|
-
export function toDataURL(canvas, ...args) {
|
|
54
|
-
return canvas.toDataURL(...args);
|
|
55
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import loadImage from "../../avatar/utils/load-image.mjs";
|
|
2
|
-
import { replaceColor as canvasReplaceColor } from "./canvas.mjs";
|
|
3
|
-
export async function rotateImage(url, degrees) {
|
|
4
|
-
const canvas = document.createElement("canvas");
|
|
5
|
-
const context = canvas.getContext("2d");
|
|
6
|
-
const image = await loadImage(url);
|
|
7
|
-
canvas.width = degrees % 180 === 0 ? image.width : image.height;
|
|
8
|
-
canvas.height = degrees % 180 === 0 ? image.height : image.width;
|
|
9
|
-
context.translate(canvas.width / 2, canvas.height / 2);
|
|
10
|
-
context.rotate(degrees * Math.PI / 180);
|
|
11
|
-
context.drawImage(image, image.width / -2, image.height / -2);
|
|
12
|
-
return canvas.toDataURL();
|
|
13
|
-
}
|
|
14
|
-
export async function replaceColor(url, color) {
|
|
15
|
-
const canvas = document.createElement("canvas");
|
|
16
|
-
const context = canvas.getContext("2d");
|
|
17
|
-
const image = await loadImage(url);
|
|
18
|
-
canvas.width = image.width;
|
|
19
|
-
canvas.height = image.height;
|
|
20
|
-
context.drawImage(image, 0, 0);
|
|
21
|
-
canvasReplaceColor(canvas, color);
|
|
22
|
-
return canvas.toDataURL();
|
|
23
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { DrawLineCoordinate } from './canvas';
|
|
2
|
-
/**
|
|
3
|
-
* Smoothing Line for Signature Draw
|
|
4
|
-
*
|
|
5
|
-
* Originally taken from [SignatureMark's stroke](https://github.com/motdotla/signature-mark/blob/master/src/signature-mark/stroke.js)
|
|
6
|
-
*/
|
|
7
|
-
export declare class SmoothLine {
|
|
8
|
-
protected lastX: number;
|
|
9
|
-
protected lastY: number;
|
|
10
|
-
protected movingX: number;
|
|
11
|
-
protected movingY: number;
|
|
12
|
-
protected smoother: number;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param smoother 0.1 - 0.9
|
|
16
|
-
*/
|
|
17
|
-
constructor(smoother: number);
|
|
18
|
-
/**
|
|
19
|
-
* Set start point
|
|
20
|
-
* @param x X coordinate
|
|
21
|
-
* @param y Y coordinate
|
|
22
|
-
*/
|
|
23
|
-
start(x: number, y: number): void;
|
|
24
|
-
/**
|
|
25
|
-
* Update coordinate when drawing
|
|
26
|
-
* @param x mouse X coordinate
|
|
27
|
-
* @param y mouse Y coordinate
|
|
28
|
-
* @return [x0, x0, x1, y1]
|
|
29
|
-
*/
|
|
30
|
-
move(x: number, y: number): DrawLineCoordinate;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Create line n-times
|
|
34
|
-
* @param length
|
|
35
|
-
*/
|
|
36
|
-
export declare function createLines(length: number): SmoothLine[];
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export class SmoothLine {
|
|
2
|
-
lastX;
|
|
3
|
-
lastY;
|
|
4
|
-
movingX;
|
|
5
|
-
movingY;
|
|
6
|
-
smoother;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param smoother 0.1 - 0.9
|
|
10
|
-
*/
|
|
11
|
-
constructor(smoother) {
|
|
12
|
-
this.lastX = 0;
|
|
13
|
-
this.lastY = 0;
|
|
14
|
-
this.movingX = 0;
|
|
15
|
-
this.movingY = 0;
|
|
16
|
-
this.smoother = smoother * 0.05 + 0.7;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Set start point
|
|
20
|
-
* @param x X coordinate
|
|
21
|
-
* @param y Y coordinate
|
|
22
|
-
*/
|
|
23
|
-
start(x, y) {
|
|
24
|
-
this.lastX = x;
|
|
25
|
-
this.lastY = y;
|
|
26
|
-
this.movingX = 0;
|
|
27
|
-
this.movingY = 0;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Update coordinate when drawing
|
|
31
|
-
* @param x mouse X coordinate
|
|
32
|
-
* @param y mouse Y coordinate
|
|
33
|
-
* @return [x0, x0, x1, y1]
|
|
34
|
-
*/
|
|
35
|
-
move(x, y) {
|
|
36
|
-
const x0 = this.lastX;
|
|
37
|
-
const y0 = this.lastY;
|
|
38
|
-
const ax = (this.movingX + (x0 - x) * 0.1) * this.smoother;
|
|
39
|
-
const ay = (this.movingY + (y0 - y) * 0.1) * this.smoother;
|
|
40
|
-
const x1 = x0 - ax;
|
|
41
|
-
const y1 = y0 - ay;
|
|
42
|
-
this.movingX = ax;
|
|
43
|
-
this.movingY = ay;
|
|
44
|
-
this.lastX = x1;
|
|
45
|
-
this.lastY = y1;
|
|
46
|
-
return [
|
|
47
|
-
x0,
|
|
48
|
-
y0,
|
|
49
|
-
x1,
|
|
50
|
-
y1
|
|
51
|
-
];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export function createLines(length) {
|
|
55
|
-
return Array.from({ length }, (_, i) => new SmoothLine(i / (length * 1.25)));
|
|
56
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export class StraightLine {
|
|
2
|
-
lastX;
|
|
3
|
-
lastY;
|
|
4
|
-
constructor() {
|
|
5
|
-
this.lastX = 0;
|
|
6
|
-
this.lastY = 0;
|
|
7
|
-
}
|
|
8
|
-
start(x, y) {
|
|
9
|
-
this.lastX = x;
|
|
10
|
-
this.lastY = y;
|
|
11
|
-
}
|
|
12
|
-
move(x, y) {
|
|
13
|
-
const x0 = this.lastX;
|
|
14
|
-
const y0 = this.lastY;
|
|
15
|
-
this.lastX = x;
|
|
16
|
-
this.lastY = y;
|
|
17
|
-
return [
|
|
18
|
-
x0,
|
|
19
|
-
y0,
|
|
20
|
-
x,
|
|
21
|
-
y
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { InteractEvent } from '@interactjs/types';
|
|
2
|
-
import type { Ref } from 'vue-demi';
|
|
3
|
-
export interface DrawHooks {
|
|
4
|
-
onstart?: (event: InteractEvent) => void;
|
|
5
|
-
onmove?: (event: InteractEvent) => void;
|
|
6
|
-
}
|
|
7
|
-
export default function useDraw(target: Ref<HTMLCanvasElement>, hooks?: DrawHooks): void;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { throttle } from "lodash-es";
|
|
2
|
-
import {
|
|
3
|
-
onBeforeUnmount,
|
|
4
|
-
onMounted,
|
|
5
|
-
shallowRef
|
|
6
|
-
} from "vue-demi";
|
|
7
|
-
export default function useDraw(target, hooks) {
|
|
8
|
-
const instance = shallowRef();
|
|
9
|
-
onMounted(async () => {
|
|
10
|
-
if (target.value) {
|
|
11
|
-
const { default: Interact } = await import("interactjs");
|
|
12
|
-
const onmove = throttle(
|
|
13
|
-
hooks.onmove,
|
|
14
|
-
1e3 / 60
|
|
15
|
-
/* limit 60fps */
|
|
16
|
-
);
|
|
17
|
-
instance.value = Interact(target.value).styleCursor(false).draggable({
|
|
18
|
-
origin: "self",
|
|
19
|
-
inertia: { enabled: true, resistance: 10 },
|
|
20
|
-
onstart: hooks.onstart,
|
|
21
|
-
onmove,
|
|
22
|
-
onend: onmove
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
onBeforeUnmount(async () => {
|
|
27
|
-
instance.value?.unset();
|
|
28
|
-
});
|
|
29
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<img
|
|
3
|
-
data-testid="signature-text"
|
|
4
|
-
class="signature--text"
|
|
5
|
-
:width="width"
|
|
6
|
-
:height="height"
|
|
7
|
-
:src="src"
|
|
8
|
-
:srcset="srcset">
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script lang="ts" setup>
|
|
12
|
-
import type { PropType } from 'vue-demi'
|
|
13
|
-
import {
|
|
14
|
-
ref,
|
|
15
|
-
computed,
|
|
16
|
-
onMounted,
|
|
17
|
-
} from 'vue-demi'
|
|
18
|
-
import { useVModel } from '../input'
|
|
19
|
-
import { createSpinner } from '../avatar/utils/create-image'
|
|
20
|
-
import { formatName } from './utils/formatter'
|
|
21
|
-
import generate from './utils/generate-text'
|
|
22
|
-
import { usePreview } from '../cropper'
|
|
23
|
-
import type { ModelModifier } from '../dropzone'
|
|
24
|
-
import { fromBase64 } from '../utils/base64'
|
|
25
|
-
import { watchDebounced } from '@vueuse/core'
|
|
26
|
-
|
|
27
|
-
const props = defineProps({
|
|
28
|
-
modelValue: {
|
|
29
|
-
type : [String, globalThis.File],
|
|
30
|
-
default: '',
|
|
31
|
-
},
|
|
32
|
-
modelModifiers: {
|
|
33
|
-
type : Object as PropType<ModelModifier>,
|
|
34
|
-
default: () => ({} as ModelModifier),
|
|
35
|
-
},
|
|
36
|
-
width: {
|
|
37
|
-
type : Number,
|
|
38
|
-
default: 430,
|
|
39
|
-
},
|
|
40
|
-
height: {
|
|
41
|
-
type : Number,
|
|
42
|
-
default: 230,
|
|
43
|
-
},
|
|
44
|
-
text: {
|
|
45
|
-
type : String,
|
|
46
|
-
default: '',
|
|
47
|
-
},
|
|
48
|
-
maxwords: {
|
|
49
|
-
type : [Number, String],
|
|
50
|
-
default: 2,
|
|
51
|
-
},
|
|
52
|
-
maxlength: {
|
|
53
|
-
type : [Number, String],
|
|
54
|
-
default: 50,
|
|
55
|
-
},
|
|
56
|
-
font: {
|
|
57
|
-
type : String,
|
|
58
|
-
default: 'Herr Von Muellerhoff',
|
|
59
|
-
},
|
|
60
|
-
color: {
|
|
61
|
-
type : String,
|
|
62
|
-
default: '#000000',
|
|
63
|
-
},
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
defineEmits<{
|
|
67
|
-
'update:modelValue': [unknown],
|
|
68
|
-
}>()
|
|
69
|
-
|
|
70
|
-
const ready = ref(false)
|
|
71
|
-
const srcset = ref('')
|
|
72
|
-
const model = useVModel(props)
|
|
73
|
-
const preview = usePreview(model)
|
|
74
|
-
|
|
75
|
-
const src = computed(() => {
|
|
76
|
-
if (!ready.value)
|
|
77
|
-
return createSpinner(props.width, props.height)
|
|
78
|
-
|
|
79
|
-
return preview.value
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
const name = computed(() => {
|
|
83
|
-
if (!props.text)
|
|
84
|
-
return '- No Image -'
|
|
85
|
-
|
|
86
|
-
return formatName(
|
|
87
|
-
String(props.text)
|
|
88
|
-
.split(' ')
|
|
89
|
-
.filter(Boolean)
|
|
90
|
-
.slice(0, Number.parseInt(`${props.maxwords}`))
|
|
91
|
-
.join(' ')
|
|
92
|
-
.slice(0, Number.parseInt(`${props.maxlength}`)),
|
|
93
|
-
)
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
watchDebounced(() => [
|
|
97
|
-
props.text,
|
|
98
|
-
props.font,
|
|
99
|
-
props.color,
|
|
100
|
-
props.width,
|
|
101
|
-
props.height,
|
|
102
|
-
props.maxwords,
|
|
103
|
-
props.maxlength,
|
|
104
|
-
], () => {
|
|
105
|
-
load()
|
|
106
|
-
}, { debounce: 300 })
|
|
107
|
-
|
|
108
|
-
onMounted(() => {
|
|
109
|
-
load()
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
async function load () {
|
|
113
|
-
ready.value = false
|
|
114
|
-
|
|
115
|
-
const options = {
|
|
116
|
-
text : name.value,
|
|
117
|
-
font : props.font,
|
|
118
|
-
width : props.width,
|
|
119
|
-
height: props.height,
|
|
120
|
-
color : props.color,
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const result = await generate(options)
|
|
124
|
-
const value = props.modelModifiers.base64
|
|
125
|
-
? result
|
|
126
|
-
: fromBase64(result)
|
|
127
|
-
|
|
128
|
-
model.value = value
|
|
129
|
-
srcset.value = `${await generate(options, 2)} 2x`
|
|
130
|
-
ready.value = true
|
|
131
|
-
}
|
|
132
|
-
</script>
|
|
133
|
-
|
|
134
|
-
<style lang="postcss">
|
|
135
|
-
.signature--text {
|
|
136
|
-
@apply max-w-full h-auto;
|
|
137
|
-
}
|
|
138
|
-
</style>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function capitalize(text) {
|
|
2
|
-
return String(text).toLowerCase().replaceAll(/^\w|([\s,.])(\w)/gm, (i) => i.toUpperCase());
|
|
3
|
-
}
|
|
4
|
-
export function formatName(text) {
|
|
5
|
-
if (!text)
|
|
6
|
-
return "";
|
|
7
|
-
return capitalize(String(text).trim().replaceAll(/[^\s,.A-Za-z]+/g, ""));
|
|
8
|
-
}
|