@speckle/ui-components 2.23.8 → 2.23.9

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.
Files changed (90) hide show
  1. package/dist/App.vue.d.ts +2 -0
  2. package/dist/AvatarEditor-2d926b04.cjs +2 -0
  3. package/dist/AvatarEditor-2d926b04.cjs.map +1 -0
  4. package/dist/{AvatarEditor-25fde016.js → AvatarEditor-844e9444.js} +63 -63
  5. package/dist/AvatarEditor-844e9444.js.map +1 -0
  6. package/dist/components/InfiniteLoading.vue.d.ts +15 -36
  7. package/dist/components/SourceAppBadge.vue.d.ts +4 -14
  8. package/dist/components/common/Alert.vue.d.ts +25 -46
  9. package/dist/components/common/Badge.vue.d.ts +24 -50
  10. package/dist/components/common/ProgressBar.vue.d.ts +3 -14
  11. package/dist/components/common/VimeoEmbed.vue.d.ts +6 -20
  12. package/dist/components/common/animation/ClickIcon.vue.d.ts +1 -1
  13. package/dist/components/common/animation/Instructional.vue.d.ts +14 -6
  14. package/dist/components/common/animation/MouseIcon.vue.d.ts +1 -1
  15. package/dist/components/common/loading/Bar.vue.d.ts +4 -15
  16. package/dist/components/common/loading/Icon.vue.d.ts +6 -31
  17. package/dist/components/common/steps/Bullet.vue.d.ts +15 -32
  18. package/dist/components/common/steps/Number.vue.d.ts +14 -30
  19. package/dist/components/common/text/Link.vue.d.ts +23 -15
  20. package/dist/components/form/Button.vue.d.ts +34 -101
  21. package/dist/components/form/CardButton.vue.d.ts +19 -22
  22. package/dist/components/form/Checkbox.vue.d.ts +15 -15
  23. package/dist/components/form/ClipboardInput.vue.d.ts +5 -26
  24. package/dist/components/form/CodeInput.vue.d.ts +496 -38
  25. package/dist/components/form/Radio.vue.d.ts +15 -15
  26. package/dist/components/form/RadioGroup.vue.d.ts +25 -26
  27. package/dist/components/form/Switch.vue.d.ts +16 -40
  28. package/dist/components/form/Tags.vue.d.ts +95 -80
  29. package/dist/components/form/TextArea.vue.d.ts +45 -96
  30. package/dist/components/form/TextInput.vue.d.ts +53 -40
  31. package/dist/components/form/file-upload/Zone.vue.d.ts +36 -60
  32. package/dist/components/form/select/Badges.vue.d.ts +11 -30
  33. package/dist/components/form/select/Base.vue.d.ts +86 -173
  34. package/dist/components/form/select/Multi.vue.d.ts +84 -168
  35. package/dist/components/form/select/SourceApps.vue.d.ts +13 -10
  36. package/dist/components/form/tags/ContextManager.vue.d.ts +12 -4
  37. package/dist/components/global/ToastRenderer.vue.d.ts +8 -18
  38. package/dist/components/global/icon/ArrowFilled.vue.d.ts +1 -1
  39. package/dist/components/global/icon/Edit.vue.d.ts +1 -1
  40. package/dist/components/global/icon/Plus.vue.d.ts +1 -1
  41. package/dist/components/layout/Dialog.vue.d.ts +36 -65
  42. package/dist/components/layout/DialogSection.vue.d.ts +29 -16
  43. package/dist/components/layout/Disclosure.vue.d.ts +17 -36
  44. package/dist/components/layout/GridListToggle.vue.d.ts +8 -18
  45. package/dist/components/layout/Menu.vue.d.ts +253 -39
  46. package/dist/components/layout/Panel.vue.d.ts +19 -11
  47. package/dist/components/layout/Table.vue.d.ts +16 -54
  48. package/dist/components/layout/sidebar/Promo.vue.d.ts +9 -22
  49. package/dist/components/layout/sidebar/Sidebar.vue.d.ts +12 -4
  50. package/dist/components/layout/sidebar/menu/Menu.vue.d.ts +11 -3
  51. package/dist/components/layout/sidebar/menu/group/Group.vue.d.ts +30 -56
  52. package/dist/components/layout/sidebar/menu/group/Item.vue.d.ts +20 -29
  53. package/dist/components/layout/tabs/Horizontal.vue.d.ts +28 -22
  54. package/dist/components/layout/tabs/Vertical.vue.d.ts +23 -23
  55. package/dist/components/user/Avatar.vue.d.ts +25 -55
  56. package/dist/components/user/AvatarEditable.vue.d.ts +35 -91
  57. package/dist/components/user/AvatarEditor.vue.d.ts +239 -23
  58. package/dist/components/user/AvatarGroup.vue.d.ts +13 -47
  59. package/dist/composables/common/async.d.ts +3 -3
  60. package/dist/composables/common/steps.d.ts +6 -6
  61. package/dist/composables/common/window.d.ts +3 -3
  62. package/dist/composables/form/fileUpload.d.ts +6 -6
  63. package/dist/composables/form/input.d.ts +3 -3
  64. package/dist/composables/form/select.d.ts +4 -4
  65. package/dist/composables/form/textInput.d.ts +18 -18
  66. package/dist/composables/layout/resize.d.ts +3 -3
  67. package/dist/composables/testing.d.ts +2 -2
  68. package/dist/composables/user/avatar.d.ts +5 -5
  69. package/dist/directives/accessibility.d.ts +1 -1
  70. package/dist/helpers/common/components.d.ts +1 -1
  71. package/dist/helpers/common/validation.d.ts +2 -2
  72. package/dist/helpers/form/file.d.ts +2 -2
  73. package/dist/helpers/form/input.d.ts +1 -1
  74. package/dist/helpers/layout/components.d.ts +3 -3
  75. package/dist/lib.cjs +1 -1
  76. package/dist/lib.cjs.map +1 -1
  77. package/dist/lib.d.ts +56 -62
  78. package/dist/lib.js +2784 -2776
  79. package/dist/lib.js.map +1 -1
  80. package/dist/stories/components/GlobalToast.vue.d.ts +2 -0
  81. package/dist/stories/components/SingletonManagers.vue.d.ts +2 -0
  82. package/dist/stories/composables/toast.d.ts +2 -2
  83. package/dist/stories/helpers/storybook.d.ts +2 -2
  84. package/dist/style.css +1 -1
  85. package/eslint.config.mjs +4 -3
  86. package/package.json +7 -8
  87. package/vite.config.ts +5 -10
  88. package/dist/AvatarEditor-25fde016.js.map +0 -1
  89. package/dist/AvatarEditor-a33fb9ec.cjs +0 -2
  90. package/dist/AvatarEditor-a33fb9ec.cjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("@heroicons/vue/24/outline"),R=require("vue-advanced-cropper");require("vue-advanced-cropper/dist/style.css");const o=require("./lib.cjs"),c=require("vue-tippy");require("lodash");require("@heroicons/vue/20/solid");require("@speckle/shared");require("vee-validate");require("nanoid");require("@vueuse/core");require("@headlessui/vue");require("@heroicons/vue/24/solid");require("v3-infinite-loading");const B={class:"flex flex-col space-y-2"},F={class:"flex"},z={class:"flex mx-14 space-x-2"},D=e.defineComponent({__name:"AvatarEditor",props:{user:{},disabled:{type:Boolean},size:{}},emits:["cancel","save"],setup(v,{emit:p}){const m=p,u=v,i=e.ref(null),d=e.ref(null),a=e.ref(null),l=e.ref(null),s=e.computed(()=>{switch(u.size){case"xs":case"sm":case"lg":case"xl":return{width:64,height:64};case"xxl":case"3xl":return{width:140,height:140};case"editable":return{width:240,height:240};case"base":default:return{width:32,height:32}}}),h=t=>{l.value&&URL.revokeObjectURL(l.value),l.value=t},x=t=>{const r=t.files[0];r&&(a.value=r)},g=t=>{var r;return t?"border-primary":(r=a.value)!=null&&r.error?"border-danger":"border-outline-2"},C=()=>{var t;return(t=i.value)==null?void 0:t.rotate(-90)},w=()=>{var t;return(t=i.value)==null?void 0:t.rotate(90)},k=()=>{var t;return(t=i.value)==null?void 0:t.flip(1,0)},N=()=>{var t;return(t=i.value)==null?void 0:t.flip(0,1)},V=()=>{var t;return(t=d.value)==null?void 0:t.triggerPicker()},b=()=>{a.value=null,l.value=null},y=()=>{var r;const t=((r=i.value)==null?void 0:r.getResult().canvas.toDataURL("image/jpeg",.85))||null;m("save",t)};return e.onUnmounted(()=>{h(null)}),e.watch(()=>u.user.avatar,t=>{l.value=t||null},{immediate:!0}),e.watch(a,t=>{l.value=t!=null&&t.file&&!t.error?URL.createObjectURL(t.file):null},{deep:!0}),(t,r)=>(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",F,[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col px-2 space-y-1",{invisible:!l.value}])},[e.withDirectives(e.createVNode(o.FormButton,{"icon-left":e.unref(n.ArrowUturnLeftIcon),"hide-text":"",color:"outline",onClick:C},null,8,["icon-left"]),[[e.unref(c.directive),"Rotate left"]]),e.withDirectives(e.createVNode(o.FormButton,{"icon-left":e.unref(n.ArrowUturnRightIcon),"hide-text":"",color:"outline",onClick:w},null,8,["icon-left"]),[[e.unref(c.directive),"Rotate right"]]),e.withDirectives(e.createVNode(o.FormButton,{"icon-left":e.unref(n.ArrowUpOnSquareIcon),"hide-text":"",color:"outline",onClick:N},null,8,["icon-left"]),[[e.unref(c.directive),"Flip vertically"]]),e.withDirectives(e.createVNode(o.FormButton,{"icon-left":e.unref(n.ArrowLeftOnRectangleIcon),"hide-text":"",color:"outline",onClick:k},null,8,["icon-left"]),[[e.unref(c.directive),"Flip horizontally"]])],2),l.value?(e.openBlock(),e.createBlock(e.unref(R.Cropper),{key:0,ref_key:"cropper",ref:i,class:"cropper",src:l.value,"stencil-props":{aspectRatio:1/1},canvas:s.value,style:e.normalizeStyle(`width: ${s.value.width}px; height: ${s.value.height}px`)},null,8,["src","canvas","style"])):e.createCommentVNode("",!0),e.createVNode(o.FormFileUploadZone,{ref_key:"uploadZone",ref:d,class:e.normalizeClass(["cropper flex items-center justify-center",{hidden:l.value}]),accept:"image/*","size-limit":5*1024*1024,onFilesSelected:x},{default:e.withCtx(({isDraggingFiles:f,activatorOn:q})=>[e.createElementVNode("div",e.mergeProps({class:["cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2",[g(f)]]},e.toHandlers(q,!0))," Click here or drag and drop an image ",16)]),_:1},8,["class"]),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col px-2 space-y-1",{invisible:!l.value}])},[e.withDirectives(e.createVNode(o.FormButton,{"icon-left":e.unref(n.PhotoIcon),"hide-text":"",onClick:V},null,8,["icon-left"]),[[e.unref(c.directive),"Replace image"]]),e.withDirectives(e.createVNode(o.FormButton,{"icon-left":e.unref(n.XMarkIcon),"hide-text":"",color:"danger",onClick:b},null,8,["icon-left"]),[[e.unref(c.directive),"Remove"]])],2)]),e.createElementVNode("div",z,[r[3]||(r[3]=e.createElementVNode("div",{class:"grow"},null,-1)),e.createVNode(o.FormButton,{color:"outline",onClick:r[0]||(r[0]=f=>t.$emit("cancel"))},{default:e.withCtx(()=>r[1]||(r[1]=[e.createTextVNode("Close")])),_:1}),e.createVNode(o.FormButton,{disabled:t.disabled,onClick:y},{default:e.withCtx(()=>r[2]||(r[2]=[e.createTextVNode("Save")])),_:1},8,["disabled"])])]))}});exports.default=D;
2
+ //# sourceMappingURL=AvatarEditor-2d926b04.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarEditor-2d926b04.cjs","sources":["../src/components/user/AvatarEditor.vue"],"sourcesContent":["<template>\n <div class=\"flex flex-col space-y-2\">\n <div class=\"flex\">\n <div class=\"flex flex-col px-2 space-y-1\" :class=\"{ invisible: !activeImageUrl }\">\n <FormButton\n v-tippy=\"'Rotate left'\"\n :icon-left=\"ArrowUturnLeftIcon\"\n hide-text\n color=\"outline\"\n @click=\"rotateLeft\"\n />\n <FormButton\n v-tippy=\"'Rotate right'\"\n :icon-left=\"ArrowUturnRightIcon\"\n hide-text\n color=\"outline\"\n @click=\"rotateRight\"\n />\n <FormButton\n v-tippy=\"'Flip vertically'\"\n :icon-left=\"ArrowUpOnSquareIcon\"\n hide-text\n color=\"outline\"\n @click=\"flipVertical\"\n />\n <FormButton\n v-tippy=\"'Flip horizontally'\"\n :icon-left=\"ArrowLeftOnRectangleIcon\"\n hide-text\n color=\"outline\"\n @click=\"flipHorizontal\"\n />\n </div>\n <Cropper\n v-if=\"activeImageUrl\"\n ref=\"cropper\"\n class=\"cropper\"\n :src=\"activeImageUrl\"\n :stencil-props=\"{\n aspectRatio: 1 / 1\n }\"\n :canvas=\"canvasSize\"\n :style=\"`width: ${canvasSize.width}px; height: ${canvasSize.height}px`\"\n />\n <FormFileUploadZone\n ref=\"uploadZone\"\n v-slot=\"{ isDraggingFiles, activatorOn }\"\n class=\"cropper flex items-center justify-center\"\n :class=\"{ hidden: activeImageUrl }\"\n accept=\"image/*\"\n :size-limit=\"5 * 1024 * 1024\"\n @files-selected=\"onFilesSelected\"\n >\n <div\n class=\"cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2\"\n :class=\"[getDashedBorderClasses(isDraggingFiles)]\"\n v-on=\"activatorOn\"\n >\n Click here or drag and drop an image\n </div>\n </FormFileUploadZone>\n <div class=\"flex flex-col px-2 space-y-1\" :class=\"{ invisible: !activeImageUrl }\">\n <FormButton\n v-tippy=\"'Replace image'\"\n :icon-left=\"PhotoIcon\"\n hide-text\n @click=\"onReplace\"\n />\n <FormButton\n v-tippy=\"'Remove'\"\n :icon-left=\"XMarkIcon\"\n hide-text\n color=\"danger\"\n @click=\"onRemove\"\n />\n </div>\n </div>\n <div class=\"flex mx-14 space-x-2\">\n <div class=\"grow\" />\n <FormButton color=\"outline\" @click=\"$emit('cancel')\">Close</FormButton>\n <FormButton :disabled=\"disabled\" @click=\"onSave\">Save</FormButton>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport {\n ArrowUturnLeftIcon,\n ArrowUturnRightIcon,\n ArrowLeftOnRectangleIcon,\n ArrowUpOnSquareIcon,\n XMarkIcon,\n PhotoIcon\n} from '@heroicons/vue/24/outline'\nimport type { Nullable } from '@speckle/shared'\nimport { onUnmounted, ref, watch, computed } from 'vue'\nimport { Cropper } from 'vue-advanced-cropper'\nimport 'vue-advanced-cropper/dist/style.css'\nimport FormButton from '~~/src/components/form/Button.vue'\nimport FormFileUploadZone from '~~/src/components/form/file-upload/Zone.vue'\nimport type { UploadableFileItem } from '~~/src/composables/form/fileUpload'\nimport type { AvatarUser, UserAvatarSize } from '~~/src/composables/user/avatar'\nimport { directive as vTippy } from 'vue-tippy'\n\n/**\n * Always try to lazy load this, as it's quite heavy\n */\n\nconst emit = defineEmits<{\n (e: 'cancel'): void\n (e: 'save', val: Nullable<string>): void\n}>()\n\nconst props = defineProps<{\n user: AvatarUser\n disabled?: boolean\n size?: UserAvatarSize\n}>()\n\nconst cropper = ref(\n null as Nullable<{\n flip: (x: number, y: number) => void\n rotate: (angle: number) => void\n getResult: () => { canvas: HTMLCanvasElement }\n }>\n)\nconst uploadZone = ref(null as Nullable<{ triggerPicker: () => void }>)\nconst selectedUpload = ref(null as Nullable<UploadableFileItem>)\nconst activeImageUrl = ref(null as Nullable<string>)\n\nconst canvasSize = computed(() => {\n switch (props.size) {\n case 'xs':\n case 'sm':\n case 'lg':\n case 'xl':\n return { width: 64, height: 64 }\n case 'xxl':\n case '3xl':\n return { width: 140, height: 140 }\n case 'editable':\n return { width: 240, height: 240 }\n case 'base':\n default:\n return { width: 32, height: 32 }\n }\n})\n\nconst setNewActiveUrl = (url: Nullable<string>) => {\n if (activeImageUrl.value) {\n URL.revokeObjectURL(activeImageUrl.value)\n }\n\n activeImageUrl.value = url\n}\n\nconst onFilesSelected = (params: { files: UploadableFileItem[] }) => {\n const file = params.files[0]\n if (!file) return\n selectedUpload.value = file\n}\n\nconst getDashedBorderClasses = (isDraggingFiles: boolean) => {\n if (isDraggingFiles) return 'border-primary'\n if (selectedUpload.value?.error) return 'border-danger'\n\n return 'border-outline-2'\n}\n\nconst rotateLeft = () => cropper.value?.rotate(-90)\nconst rotateRight = () => cropper.value?.rotate(90)\nconst flipHorizontal = () => cropper.value?.flip(1, 0)\nconst flipVertical = () => cropper.value?.flip(0, 1)\n\nconst onReplace = () => uploadZone.value?.triggerPicker()\nconst onRemove = () => {\n selectedUpload.value = null\n activeImageUrl.value = null\n}\nconst onSave = () => {\n const newUrl = cropper.value?.getResult().canvas.toDataURL('image/jpeg', 0.85) || null\n emit('save', newUrl)\n}\n\nonUnmounted(() => {\n setNewActiveUrl(null)\n})\n\nwatch(\n () => props.user.avatar,\n (newAvatar) => {\n activeImageUrl.value = newAvatar || null\n },\n { immediate: true }\n)\n\nwatch(\n selectedUpload,\n (newUpload) => {\n activeImageUrl.value =\n newUpload?.file && !newUpload.error ? URL.createObjectURL(newUpload.file) : null\n },\n { deep: true }\n)\n</script>\n"],"names":["emit","__emit","props","__props","cropper","ref","uploadZone","selectedUpload","activeImageUrl","canvasSize","computed","setNewActiveUrl","url","onFilesSelected","params","file","getDashedBorderClasses","isDraggingFiles","_a","rotateLeft","rotateRight","flipHorizontal","flipVertical","onReplace","onRemove","onSave","newUrl","onUnmounted","watch","newAvatar","newUpload"],"mappings":"muBA2GA,MAAMA,EAAOC,EAKPC,EAAQC,EAMRC,EAAUC,EAAA,IACd,IAAA,EAMIC,EAAaD,MAAI,IAA+C,EAChEE,EAAiBF,MAAI,IAAoC,EACzDG,EAAiBH,MAAI,IAAwB,EAE7CI,EAAaC,EAAAA,SAAS,IAAM,CAChC,OAAQR,EAAM,KAAM,CAClB,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACH,MAAO,CAAE,MAAO,GAAI,OAAQ,EAAG,EACjC,IAAK,MACL,IAAK,MACH,MAAO,CAAE,MAAO,IAAK,OAAQ,GAAI,EACnC,IAAK,WACH,MAAO,CAAE,MAAO,IAAK,OAAQ,GAAI,EACnC,IAAK,OACL,QACE,MAAO,CAAE,MAAO,GAAI,OAAQ,EAAG,CACnC,CAAA,CACD,EAEKS,EAAmBC,GAA0B,CAC7CJ,EAAe,OACb,IAAA,gBAAgBA,EAAe,KAAK,EAG1CA,EAAe,MAAQI,CAAA,EAGnBC,EAAmBC,GAA4C,CAC7D,MAAAC,EAAOD,EAAO,MAAM,CAAC,EACtBC,IACLR,EAAe,MAAQQ,EAAA,EAGnBC,EAA0BC,GAA6B,OACvD,OAAAA,EAAwB,kBACxBC,EAAAX,EAAe,QAAf,MAAAW,EAAsB,MAAc,gBAEjC,kBAAA,EAGHC,EAAa,IAAA,OAAM,OAAAD,EAAAd,EAAQ,QAAR,YAAAc,EAAe,OAAO,MACzCE,EAAc,IAAA,OAAM,OAAAF,EAAAd,EAAQ,QAAR,YAAAc,EAAe,OAAO,KAC1CG,EAAiB,IAAA,OAAM,OAAAH,EAAAd,EAAQ,QAAR,YAAAc,EAAe,KAAK,EAAG,IAC9CI,EAAe,IAAA,OAAM,OAAAJ,EAAAd,EAAQ,QAAR,YAAAc,EAAe,KAAK,EAAG,IAE5CK,EAAY,IAAM,OAAA,OAAAL,EAAAZ,EAAW,QAAX,YAAAY,EAAkB,iBACpCM,EAAW,IAAM,CACrBjB,EAAe,MAAQ,KACvBC,EAAe,MAAQ,IAAA,EAEnBiB,EAAS,IAAM,OACb,MAAAC,IAASR,EAAAd,EAAQ,QAAR,YAAAc,EAAe,YAAY,OAAO,UAAU,aAAc,OAAS,KAClFlB,EAAK,OAAQ0B,CAAM,CAAA,EAGrBC,OAAAA,EAAAA,YAAY,IAAM,CAChBhB,EAAgB,IAAI,CAAA,CACrB,EAEDiB,EAAA,MACE,IAAM1B,EAAM,KAAK,OAChB2B,GAAc,CACbrB,EAAe,MAAQqB,GAAa,IACtC,EACA,CAAE,UAAW,EAAK,CAAA,EAGpBD,EAAA,MACErB,EACCuB,GAAc,CACEtB,EAAA,MACbsB,GAAA,MAAAA,EAAW,MAAQ,CAACA,EAAU,MAAQ,IAAI,gBAAgBA,EAAU,IAAI,EAAI,IAChF,EACA,CAAE,KAAM,EAAK,CAAA"}
@@ -1,9 +1,9 @@
1
- import { defineComponent as j, ref as d, computed as N, onUnmounted as V, watch as k, openBlock as _, createElementBlock as O, createElementVNode as s, normalizeClass as p, withDirectives as c, createVNode as r, unref as t, createBlock as D, normalizeStyle as E, createCommentVNode as P, withCtx as m, mergeProps as Z, toHandlers as H, createTextVNode as C } from "vue";
1
+ import { defineComponent as j, ref as d, computed as N, onUnmounted as V, watch as g, openBlock as k, createElementBlock as O, createElementVNode as a, normalizeClass as p, withDirectives as c, createVNode as r, unref as l, createBlock as D, normalizeStyle as E, createCommentVNode as P, withCtx as m, mergeProps as Z, toHandlers as H, createTextVNode as C } from "vue";
2
2
  import { ArrowUturnLeftIcon as q, ArrowUturnRightIcon as M, ArrowUpOnSquareIcon as T, ArrowLeftOnRectangleIcon as X, PhotoIcon as G, XMarkIcon as J } from "@heroicons/vue/24/outline";
3
3
  import { Cropper as K } from "vue-advanced-cropper";
4
4
  import "vue-advanced-cropper/dist/style.css";
5
5
  import { FormButton as i, FormFileUploadZone as Q } from "./lib.js";
6
- import { directive as a } from "vue-tippy";
6
+ import { directive as s } from "vue-tippy";
7
7
  import "lodash";
8
8
  import "@heroicons/vue/20/solid";
9
9
  import "@speckle/shared";
@@ -13,19 +13,19 @@ import "@vueuse/core";
13
13
  import "@headlessui/vue";
14
14
  import "@heroicons/vue/24/solid";
15
15
  import "v3-infinite-loading";
16
- const W = { class: "flex flex-col space-y-2" }, Y = { class: "flex" }, ee = { class: "flex mx-14 space-x-2" }, te = /* @__PURE__ */ s("div", { class: "grow" }, null, -1), xe = /* @__PURE__ */ j({
16
+ const W = { class: "flex flex-col space-y-2" }, Y = { class: "flex" }, ee = { class: "flex mx-14 space-x-2" }, he = /* @__PURE__ */ j({
17
17
  __name: "AvatarEditor",
18
18
  props: {
19
- user: null,
19
+ user: {},
20
20
  disabled: { type: Boolean },
21
- size: null
21
+ size: {}
22
22
  },
23
23
  emits: ["cancel", "save"],
24
- setup(v, { emit: R }) {
25
- const b = R, h = v, n = d(
24
+ setup(R, { emit: b }) {
25
+ const y = b, v = R, n = d(
26
26
  null
27
- ), x = d(null), u = d(null), l = d(null), f = N(() => {
28
- switch (h.size) {
27
+ ), h = d(null), u = d(null), o = d(null), f = N(() => {
28
+ switch (v.size) {
29
29
  case "xs":
30
30
  case "sm":
31
31
  case "lg":
@@ -40,14 +40,14 @@ const W = { class: "flex flex-col space-y-2" }, Y = { class: "flex" }, ee = { cl
40
40
  default:
41
41
  return { width: 32, height: 32 };
42
42
  }
43
- }), y = (e) => {
44
- l.value && URL.revokeObjectURL(l.value), l.value = e;
45
- }, w = (e) => {
46
- const o = e.files[0];
47
- o && (u.value = o);
43
+ }), w = (e) => {
44
+ o.value && URL.revokeObjectURL(o.value), o.value = e;
45
+ }, _ = (e) => {
46
+ const t = e.files[0];
47
+ t && (u.value = t);
48
48
  }, z = (e) => {
49
- var o;
50
- return e ? "border-primary" : (o = u.value) != null && o.error ? "border-danger" : "border-outline-2";
49
+ var t;
50
+ return e ? "border-primary" : (t = u.value) != null && t.error ? "border-danger" : "border-outline-2";
51
51
  }, L = () => {
52
52
  var e;
53
53
  return (e = n.value) == null ? void 0 : e.rotate(-90);
@@ -62,72 +62,72 @@ const W = { class: "flex flex-col space-y-2" }, Y = { class: "flex" }, ee = { cl
62
62
  return (e = n.value) == null ? void 0 : e.flip(0, 1);
63
63
  }, B = () => {
64
64
  var e;
65
- return (e = x.value) == null ? void 0 : e.triggerPicker();
65
+ return (e = h.value) == null ? void 0 : e.triggerPicker();
66
66
  }, F = () => {
67
- u.value = null, l.value = null;
67
+ u.value = null, o.value = null;
68
68
  }, S = () => {
69
- var o;
70
- const e = ((o = n.value) == null ? void 0 : o.getResult().canvas.toDataURL("image/jpeg", 0.85)) || null;
71
- b("save", e);
69
+ var t;
70
+ const e = ((t = n.value) == null ? void 0 : t.getResult().canvas.toDataURL("image/jpeg", 0.85)) || null;
71
+ y("save", e);
72
72
  };
73
73
  return V(() => {
74
- y(null);
75
- }), k(
76
- () => h.user.avatar,
74
+ w(null);
75
+ }), g(
76
+ () => v.user.avatar,
77
77
  (e) => {
78
- l.value = e || null;
78
+ o.value = e || null;
79
79
  },
80
80
  { immediate: !0 }
81
- ), k(
81
+ ), g(
82
82
  u,
83
83
  (e) => {
84
- l.value = e != null && e.file && !e.error ? URL.createObjectURL(e.file) : null;
84
+ o.value = e != null && e.file && !e.error ? URL.createObjectURL(e.file) : null;
85
85
  },
86
86
  { deep: !0 }
87
- ), (e, o) => (_(), O("div", W, [
88
- s("div", Y, [
89
- s("div", {
90
- class: p(["flex flex-col px-2 space-y-1", { invisible: !l.value }])
87
+ ), (e, t) => (k(), O("div", W, [
88
+ a("div", Y, [
89
+ a("div", {
90
+ class: p(["flex flex-col px-2 space-y-1", { invisible: !o.value }])
91
91
  }, [
92
92
  c(r(i, {
93
- "icon-left": t(q),
93
+ "icon-left": l(q),
94
94
  "hide-text": "",
95
95
  color: "outline",
96
96
  onClick: L
97
97
  }, null, 8, ["icon-left"]), [
98
- [t(a), "Rotate left"]
98
+ [l(s), "Rotate left"]
99
99
  ]),
100
100
  c(r(i, {
101
- "icon-left": t(M),
101
+ "icon-left": l(M),
102
102
  "hide-text": "",
103
103
  color: "outline",
104
104
  onClick: U
105
105
  }, null, 8, ["icon-left"]), [
106
- [t(a), "Rotate right"]
106
+ [l(s), "Rotate right"]
107
107
  ]),
108
108
  c(r(i, {
109
- "icon-left": t(T),
109
+ "icon-left": l(T),
110
110
  "hide-text": "",
111
111
  color: "outline",
112
112
  onClick: A
113
113
  }, null, 8, ["icon-left"]), [
114
- [t(a), "Flip vertically"]
114
+ [l(s), "Flip vertically"]
115
115
  ]),
116
116
  c(r(i, {
117
- "icon-left": t(X),
117
+ "icon-left": l(X),
118
118
  "hide-text": "",
119
119
  color: "outline",
120
120
  onClick: I
121
121
  }, null, 8, ["icon-left"]), [
122
- [t(a), "Flip horizontally"]
122
+ [l(s), "Flip horizontally"]
123
123
  ])
124
124
  ], 2),
125
- l.value ? (_(), D(t(K), {
125
+ o.value ? (k(), D(l(K), {
126
126
  key: 0,
127
127
  ref_key: "cropper",
128
128
  ref: n,
129
129
  class: "cropper",
130
- src: l.value,
130
+ src: o.value,
131
131
  "stencil-props": {
132
132
  aspectRatio: 1 / 1
133
133
  },
@@ -136,57 +136,57 @@ const W = { class: "flex flex-col space-y-2" }, Y = { class: "flex" }, ee = { cl
136
136
  }, null, 8, ["src", "canvas", "style"])) : P("", !0),
137
137
  r(Q, {
138
138
  ref_key: "uploadZone",
139
- ref: x,
140
- class: p(["cropper flex items-center justify-center", { hidden: l.value }]),
139
+ ref: h,
140
+ class: p(["cropper flex items-center justify-center", { hidden: o.value }]),
141
141
  accept: "image/*",
142
142
  "size-limit": 5 * 1024 * 1024,
143
- onFilesSelected: w
143
+ onFilesSelected: _
144
144
  }, {
145
- default: m(({ isDraggingFiles: g, activatorOn: $ }) => [
146
- s("div", Z({
147
- class: ["cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2", [z(g)]]
145
+ default: m(({ isDraggingFiles: x, activatorOn: $ }) => [
146
+ a("div", Z({
147
+ class: ["cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2", [z(x)]]
148
148
  }, H($, !0)), " Click here or drag and drop an image ", 16)
149
149
  ]),
150
150
  _: 1
151
151
  }, 8, ["class"]),
152
- s("div", {
153
- class: p(["flex flex-col px-2 space-y-1", { invisible: !l.value }])
152
+ a("div", {
153
+ class: p(["flex flex-col px-2 space-y-1", { invisible: !o.value }])
154
154
  }, [
155
155
  c(r(i, {
156
- "icon-left": t(G),
156
+ "icon-left": l(G),
157
157
  "hide-text": "",
158
158
  onClick: B
159
159
  }, null, 8, ["icon-left"]), [
160
- [t(a), "Replace image"]
160
+ [l(s), "Replace image"]
161
161
  ]),
162
162
  c(r(i, {
163
- "icon-left": t(J),
163
+ "icon-left": l(J),
164
164
  "hide-text": "",
165
165
  color: "danger",
166
166
  onClick: F
167
167
  }, null, 8, ["icon-left"]), [
168
- [t(a), "Remove"]
168
+ [l(s), "Remove"]
169
169
  ])
170
170
  ], 2)
171
171
  ]),
172
- s("div", ee, [
173
- te,
172
+ a("div", ee, [
173
+ t[3] || (t[3] = a("div", { class: "grow" }, null, -1)),
174
174
  r(i, {
175
175
  color: "outline",
176
- onClick: o[0] || (o[0] = (g) => e.$emit("cancel"))
176
+ onClick: t[0] || (t[0] = (x) => e.$emit("cancel"))
177
177
  }, {
178
- default: m(() => [
178
+ default: m(() => t[1] || (t[1] = [
179
179
  C("Close")
180
- ]),
180
+ ])),
181
181
  _: 1
182
182
  }),
183
183
  r(i, {
184
- disabled: v.disabled,
184
+ disabled: e.disabled,
185
185
  onClick: S
186
186
  }, {
187
- default: m(() => [
187
+ default: m(() => t[2] || (t[2] = [
188
188
  C("Save")
189
- ]),
189
+ ])),
190
190
  _: 1
191
191
  }, 8, ["disabled"])
192
192
  ])
@@ -194,6 +194,6 @@ const W = { class: "flex flex-col space-y-2" }, Y = { class: "flex" }, ee = { cl
194
194
  }
195
195
  });
196
196
  export {
197
- xe as default
197
+ he as default
198
198
  };
199
- //# sourceMappingURL=AvatarEditor-25fde016.js.map
199
+ //# sourceMappingURL=AvatarEditor-844e9444.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarEditor-844e9444.js","sources":["../src/components/user/AvatarEditor.vue"],"sourcesContent":["<template>\n <div class=\"flex flex-col space-y-2\">\n <div class=\"flex\">\n <div class=\"flex flex-col px-2 space-y-1\" :class=\"{ invisible: !activeImageUrl }\">\n <FormButton\n v-tippy=\"'Rotate left'\"\n :icon-left=\"ArrowUturnLeftIcon\"\n hide-text\n color=\"outline\"\n @click=\"rotateLeft\"\n />\n <FormButton\n v-tippy=\"'Rotate right'\"\n :icon-left=\"ArrowUturnRightIcon\"\n hide-text\n color=\"outline\"\n @click=\"rotateRight\"\n />\n <FormButton\n v-tippy=\"'Flip vertically'\"\n :icon-left=\"ArrowUpOnSquareIcon\"\n hide-text\n color=\"outline\"\n @click=\"flipVertical\"\n />\n <FormButton\n v-tippy=\"'Flip horizontally'\"\n :icon-left=\"ArrowLeftOnRectangleIcon\"\n hide-text\n color=\"outline\"\n @click=\"flipHorizontal\"\n />\n </div>\n <Cropper\n v-if=\"activeImageUrl\"\n ref=\"cropper\"\n class=\"cropper\"\n :src=\"activeImageUrl\"\n :stencil-props=\"{\n aspectRatio: 1 / 1\n }\"\n :canvas=\"canvasSize\"\n :style=\"`width: ${canvasSize.width}px; height: ${canvasSize.height}px`\"\n />\n <FormFileUploadZone\n ref=\"uploadZone\"\n v-slot=\"{ isDraggingFiles, activatorOn }\"\n class=\"cropper flex items-center justify-center\"\n :class=\"{ hidden: activeImageUrl }\"\n accept=\"image/*\"\n :size-limit=\"5 * 1024 * 1024\"\n @files-selected=\"onFilesSelected\"\n >\n <div\n class=\"cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2\"\n :class=\"[getDashedBorderClasses(isDraggingFiles)]\"\n v-on=\"activatorOn\"\n >\n Click here or drag and drop an image\n </div>\n </FormFileUploadZone>\n <div class=\"flex flex-col px-2 space-y-1\" :class=\"{ invisible: !activeImageUrl }\">\n <FormButton\n v-tippy=\"'Replace image'\"\n :icon-left=\"PhotoIcon\"\n hide-text\n @click=\"onReplace\"\n />\n <FormButton\n v-tippy=\"'Remove'\"\n :icon-left=\"XMarkIcon\"\n hide-text\n color=\"danger\"\n @click=\"onRemove\"\n />\n </div>\n </div>\n <div class=\"flex mx-14 space-x-2\">\n <div class=\"grow\" />\n <FormButton color=\"outline\" @click=\"$emit('cancel')\">Close</FormButton>\n <FormButton :disabled=\"disabled\" @click=\"onSave\">Save</FormButton>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport {\n ArrowUturnLeftIcon,\n ArrowUturnRightIcon,\n ArrowLeftOnRectangleIcon,\n ArrowUpOnSquareIcon,\n XMarkIcon,\n PhotoIcon\n} from '@heroicons/vue/24/outline'\nimport type { Nullable } from '@speckle/shared'\nimport { onUnmounted, ref, watch, computed } from 'vue'\nimport { Cropper } from 'vue-advanced-cropper'\nimport 'vue-advanced-cropper/dist/style.css'\nimport FormButton from '~~/src/components/form/Button.vue'\nimport FormFileUploadZone from '~~/src/components/form/file-upload/Zone.vue'\nimport type { UploadableFileItem } from '~~/src/composables/form/fileUpload'\nimport type { AvatarUser, UserAvatarSize } from '~~/src/composables/user/avatar'\nimport { directive as vTippy } from 'vue-tippy'\n\n/**\n * Always try to lazy load this, as it's quite heavy\n */\n\nconst emit = defineEmits<{\n (e: 'cancel'): void\n (e: 'save', val: Nullable<string>): void\n}>()\n\nconst props = defineProps<{\n user: AvatarUser\n disabled?: boolean\n size?: UserAvatarSize\n}>()\n\nconst cropper = ref(\n null as Nullable<{\n flip: (x: number, y: number) => void\n rotate: (angle: number) => void\n getResult: () => { canvas: HTMLCanvasElement }\n }>\n)\nconst uploadZone = ref(null as Nullable<{ triggerPicker: () => void }>)\nconst selectedUpload = ref(null as Nullable<UploadableFileItem>)\nconst activeImageUrl = ref(null as Nullable<string>)\n\nconst canvasSize = computed(() => {\n switch (props.size) {\n case 'xs':\n case 'sm':\n case 'lg':\n case 'xl':\n return { width: 64, height: 64 }\n case 'xxl':\n case '3xl':\n return { width: 140, height: 140 }\n case 'editable':\n return { width: 240, height: 240 }\n case 'base':\n default:\n return { width: 32, height: 32 }\n }\n})\n\nconst setNewActiveUrl = (url: Nullable<string>) => {\n if (activeImageUrl.value) {\n URL.revokeObjectURL(activeImageUrl.value)\n }\n\n activeImageUrl.value = url\n}\n\nconst onFilesSelected = (params: { files: UploadableFileItem[] }) => {\n const file = params.files[0]\n if (!file) return\n selectedUpload.value = file\n}\n\nconst getDashedBorderClasses = (isDraggingFiles: boolean) => {\n if (isDraggingFiles) return 'border-primary'\n if (selectedUpload.value?.error) return 'border-danger'\n\n return 'border-outline-2'\n}\n\nconst rotateLeft = () => cropper.value?.rotate(-90)\nconst rotateRight = () => cropper.value?.rotate(90)\nconst flipHorizontal = () => cropper.value?.flip(1, 0)\nconst flipVertical = () => cropper.value?.flip(0, 1)\n\nconst onReplace = () => uploadZone.value?.triggerPicker()\nconst onRemove = () => {\n selectedUpload.value = null\n activeImageUrl.value = null\n}\nconst onSave = () => {\n const newUrl = cropper.value?.getResult().canvas.toDataURL('image/jpeg', 0.85) || null\n emit('save', newUrl)\n}\n\nonUnmounted(() => {\n setNewActiveUrl(null)\n})\n\nwatch(\n () => props.user.avatar,\n (newAvatar) => {\n activeImageUrl.value = newAvatar || null\n },\n { immediate: true }\n)\n\nwatch(\n selectedUpload,\n (newUpload) => {\n activeImageUrl.value =\n newUpload?.file && !newUpload.error ? URL.createObjectURL(newUpload.file) : null\n },\n { deep: true }\n)\n</script>\n"],"names":["emit","__emit","props","__props","cropper","ref","uploadZone","selectedUpload","activeImageUrl","canvasSize","computed","setNewActiveUrl","url","onFilesSelected","params","file","getDashedBorderClasses","isDraggingFiles","_a","rotateLeft","rotateRight","flipHorizontal","flipVertical","onReplace","onRemove","onSave","newUrl","onUnmounted","watch","newAvatar","newUpload"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2GA,UAAMA,IAAOC,GAKPC,IAAQC,GAMRC,IAAUC;AAAA,MACd;AAAA,IAAA,GAMIC,IAAaD,EAAI,IAA+C,GAChEE,IAAiBF,EAAI,IAAoC,GACzDG,IAAiBH,EAAI,IAAwB,GAE7CI,IAAaC,EAAS,MAAM;AAChC,cAAQR,EAAM,MAAM;AAAA,QAClB,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,EAAE,OAAO,IAAI,QAAQ,GAAG;AAAA,QACjC,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,EAAE,OAAO,KAAK,QAAQ,IAAI;AAAA,QACnC,KAAK;AACH,iBAAO,EAAE,OAAO,KAAK,QAAQ,IAAI;AAAA,QACnC,KAAK;AAAA,QACL;AACE,iBAAO,EAAE,OAAO,IAAI,QAAQ,GAAG;AAAA,MACnC;AAAA,IAAA,CACD,GAEKS,IAAkB,CAACC,MAA0B;AACjD,MAAIJ,EAAe,SACb,IAAA,gBAAgBA,EAAe,KAAK,GAG1CA,EAAe,QAAQI;AAAA,IAAA,GAGnBC,IAAkB,CAACC,MAA4C;AAC7D,YAAAC,IAAOD,EAAO,MAAM,CAAC;AAC3B,MAAKC,MACLR,EAAe,QAAQQ;AAAA,IAAA,GAGnBC,IAAyB,CAACC,MAA6B;;AACvD,aAAAA,IAAwB,oBACxBC,IAAAX,EAAe,UAAf,QAAAW,EAAsB,QAAc,kBAEjC;AAAA,IAAA,GAGHC,IAAa,MAAA;;AAAM,cAAAD,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,OAAO;AAAA,OACzCE,IAAc,MAAA;;AAAM,cAAAF,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,OAAO;AAAA,OAC1CG,IAAiB,MAAA;;AAAM,cAAAH,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,KAAK,GAAG;AAAA,OAC9CI,IAAe,MAAA;;AAAM,cAAAJ,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,KAAK,GAAG;AAAA,OAE5CK,IAAY,MAAM;;AAAA,cAAAL,IAAAZ,EAAW,UAAX,gBAAAY,EAAkB;AAAA,OACpCM,IAAW,MAAM;AACrB,MAAAjB,EAAe,QAAQ,MACvBC,EAAe,QAAQ;AAAA,IAAA,GAEnBiB,IAAS,MAAM;;AACb,YAAAC,MAASR,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,YAAY,OAAO,UAAU,cAAc,UAAS;AAClF,MAAAlB,EAAK,QAAQ0B,CAAM;AAAA,IAAA;AAGrB,WAAAC,EAAY,MAAM;AAChB,MAAAhB,EAAgB,IAAI;AAAA,IAAA,CACrB,GAEDiB;AAAA,MACE,MAAM1B,EAAM,KAAK;AAAA,MACjB,CAAC2B,MAAc;AACb,QAAArB,EAAe,QAAQqB,KAAa;AAAA,MACtC;AAAA,MACA,EAAE,WAAW,GAAK;AAAA,IAAA,GAGpBD;AAAA,MACErB;AAAA,MACA,CAACuB,MAAc;AACE,QAAAtB,EAAA,QACbsB,KAAA,QAAAA,EAAW,QAAQ,CAACA,EAAU,QAAQ,IAAI,gBAAgBA,EAAU,IAAI,IAAI;AAAA,MAChF;AAAA,MACA,EAAE,MAAM,GAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,46 +1,25 @@
1
- import type { InfiniteLoaderState } from '../helpers/global/components';
2
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
1
+ import { InfiniteLoaderState } from '../helpers/global/components';
2
+ type __VLS_Props = {
3
3
  /**
4
4
  * v3-infinite-loading props, see docs or type definitions
5
5
  */
6
6
  settings?: {
7
- target?: string | undefined;
8
- distance?: number | undefined;
9
- top?: boolean | undefined;
7
+ target?: string;
8
+ distance?: number;
9
+ top?: boolean;
10
10
  identifier?: any;
11
- firstload?: boolean | undefined;
12
- } | undefined;
13
- /**
14
- * Whether to allow retry and show a retry button when loading fails
15
- */
16
- allowRetry?: boolean | undefined;
17
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
- infinite: ($state: InfiniteLoaderState) => void;
19
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
20
- /**
21
- * v3-infinite-loading props, see docs or type definitions
22
- */
23
- settings?: {
24
- target?: string | undefined;
25
- distance?: number | undefined;
26
- top?: boolean | undefined;
27
- identifier?: any;
28
- firstload?: boolean | undefined;
29
- } | undefined;
11
+ firstload?: boolean;
12
+ };
30
13
  /**
31
14
  * Whether to allow retry and show a retry button when loading fails
32
15
  */
33
- allowRetry?: boolean | undefined;
34
- }>>> & {
16
+ allowRetry?: boolean;
17
+ };
18
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
19
+ infinite: ($state: InfiniteLoaderState) => any;
20
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
35
21
  onInfinite?: (($state: InfiniteLoaderState) => any) | undefined;
36
- }, {}, {}>;
22
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
23
+ wrapper: HTMLDivElement;
24
+ }, HTMLDivElement>;
37
25
  export default _default;
38
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
39
- type __VLS_TypePropsToRuntimeProps<T> = {
40
- [K in keyof T]-?: {} extends Pick<T, K> ? {
41
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
42
- } : {
43
- type: import('vue').PropType<T[K]>;
44
- required: true;
45
- };
46
- };
@@ -1,16 +1,6 @@
1
- import type { SourceAppDefinition } from '@speckle/shared';
2
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
1
+ import { SourceAppDefinition } from '../../../shared/dist/esm/index';
2
+ type __VLS_Props = {
3
3
  sourceApp: SourceAppDefinition;
4
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
- sourceApp: SourceAppDefinition;
6
- }>>>, {}, {}>;
7
- export default _default;
8
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
- type __VLS_TypePropsToRuntimeProps<T> = {
10
- [K in keyof T]-?: {} extends Pick<T, K> ? {
11
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
- } : {
13
- type: import('vue').PropType<T[K]>;
14
- required: true;
15
- };
16
4
  };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
6
+ export default _default;
@@ -1,54 +1,33 @@
1
- import type { PropAnyComponent, AlertAction, AlertColor } from '../../helpers/common/components';
1
+ import { PropAnyComponent, AlertAction, AlertColor } from '../../helpers/common/components';
2
2
  type Size = 'default' | 'xs';
3
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
- color?: AlertColor | undefined;
5
- withDismiss?: boolean | undefined;
6
- actions?: AlertAction[] | undefined;
7
- customIcon?: PropAnyComponent | undefined;
8
- hideIcon?: boolean | undefined;
9
- size?: Size | undefined;
10
- }>, {
11
- color: string;
12
- size: string;
13
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
- dismiss: () => void;
15
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
16
- color?: AlertColor | undefined;
17
- withDismiss?: boolean | undefined;
18
- actions?: AlertAction[] | undefined;
19
- customIcon?: PropAnyComponent | undefined;
20
- hideIcon?: boolean | undefined;
21
- size?: Size | undefined;
22
- }>, {
23
- color: string;
24
- size: string;
25
- }>>> & {
3
+ type __VLS_Props = {
4
+ color?: AlertColor;
5
+ withDismiss?: boolean;
6
+ actions?: Array<AlertAction>;
7
+ customIcon?: PropAnyComponent;
8
+ hideIcon?: boolean;
9
+ size?: Size;
10
+ };
11
+ declare function __VLS_template(): {
12
+ attrs: Partial<{}>;
13
+ slots: {
14
+ title?(_: {}): any;
15
+ description?(_: {}): any;
16
+ };
17
+ refs: {};
18
+ rootEl: HTMLDivElement;
19
+ };
20
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
22
+ dismiss: () => any;
23
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
26
24
  onDismiss?: (() => any) | undefined;
27
- }, {
25
+ }>, {
28
26
  size: Size;
29
27
  color: AlertColor;
30
- }, {}>, {
31
- title?(_: {}): any;
32
- description?(_: {}): any;
33
- }>;
28
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
29
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
34
30
  export default _default;
35
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
36
- type __VLS_TypePropsToRuntimeProps<T> = {
37
- [K in keyof T]-?: {} extends Pick<T, K> ? {
38
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
39
- } : {
40
- type: import('vue').PropType<T[K]>;
41
- required: true;
42
- };
43
- };
44
- type __VLS_WithDefaults<P, D> = {
45
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
46
- default: D[K];
47
- }> : P[K];
48
- };
49
- type __VLS_Prettify<T> = {
50
- [K in keyof T]: T[K];
51
- } & {};
52
31
  type __VLS_WithTemplateSlots<T, S> = T & {
53
32
  new (): {
54
33
  $slots: S;
@@ -1,74 +1,48 @@
1
- import type { PropAnyComponent } from '../../helpers/common/components';
1
+ import { PropAnyComponent } from '../../helpers/common/components';
2
2
  type BadgeSize = 'base' | 'lg';
3
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
- size?: BadgeSize | undefined;
3
+ type __VLS_Props = {
4
+ size?: BadgeSize;
5
5
  /**
6
6
  * Set text & bg color. Defaults to primary variation.
7
7
  */
8
- colorClasses?: string | undefined;
8
+ colorClasses?: string;
9
9
  /**
10
10
  * Show dot to the right
11
11
  */
12
- dot?: boolean | undefined;
12
+ dot?: boolean;
13
13
  /**
14
14
  * Set dot/icon bg color. Defaults to primary variation.
15
15
  */
16
- dotIconColorClasses?: string | undefined;
16
+ dotIconColorClasses?: string;
17
17
  /**
18
18
  * Optionally show icon to the left of the text
19
19
  */
20
- iconLeft?: PropAnyComponent | undefined;
20
+ iconLeft?: PropAnyComponent;
21
21
  /**
22
22
  * A more square, but still rounded look
23
23
  */
24
- rounded?: boolean | undefined;
24
+ rounded?: boolean;
25
25
  /**
26
26
  * Track icon clicks
27
27
  */
28
- clickableIcon?: boolean | undefined;
29
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
- "click-icon": (v: MouseEvent) => void;
31
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
32
- size?: BadgeSize | undefined;
33
- /**
34
- * Set text & bg color. Defaults to primary variation.
35
- */
36
- colorClasses?: string | undefined;
37
- /**
38
- * Show dot to the right
39
- */
40
- dot?: boolean | undefined;
41
- /**
42
- * Set dot/icon bg color. Defaults to primary variation.
43
- */
44
- dotIconColorClasses?: string | undefined;
45
- /**
46
- * Optionally show icon to the left of the text
47
- */
48
- iconLeft?: PropAnyComponent | undefined;
49
- /**
50
- * A more square, but still rounded look
51
- */
52
- rounded?: boolean | undefined;
53
- /**
54
- * Track icon clicks
55
- */
56
- clickableIcon?: boolean | undefined;
57
- }>>> & {
58
- "onClick-icon"?: ((v: MouseEvent) => any) | undefined;
59
- }, {}, {}>, {
60
- default?(_: {}): any;
61
- }>;
62
- export default _default;
63
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
64
- type __VLS_TypePropsToRuntimeProps<T> = {
65
- [K in keyof T]-?: {} extends Pick<T, K> ? {
66
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
67
- } : {
68
- type: import('vue').PropType<T[K]>;
69
- required: true;
28
+ clickableIcon?: boolean;
29
+ };
30
+ declare function __VLS_template(): {
31
+ attrs: Partial<{}>;
32
+ slots: {
33
+ default?(_: {}): any;
70
34
  };
35
+ refs: {};
36
+ rootEl: HTMLSpanElement;
71
37
  };
38
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
39
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
40
+ "click-icon": (v: MouseEvent) => any;
41
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
42
+ "onClick-icon"?: ((v: MouseEvent) => any) | undefined;
43
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
44
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
45
+ export default _default;
72
46
  type __VLS_WithTemplateSlots<T, S> = T & {
73
47
  new (): {
74
48
  $slots: S;
@@ -1,17 +1,6 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
1
+ type __VLS_Props = {
2
2
  currentValue: number;
3
3
  maxValue: number;
4
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
- currentValue: number;
6
- maxValue: number;
7
- }>>>, {}, {}>;
8
- export default _default;
9
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
- type __VLS_TypePropsToRuntimeProps<T> = {
11
- [K in keyof T]-?: {} extends Pick<T, K> ? {
12
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
- } : {
14
- type: import('vue').PropType<T[K]>;
15
- required: true;
16
- };
17
4
  };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
6
+ export default _default;
@@ -1,23 +1,9 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
1
+ type __VLS_Props = {
2
2
  vimeoId: string;
3
3
  title: string;
4
- autoplay?: boolean | undefined;
5
- muted?: boolean | undefined;
6
- controls?: boolean | undefined;
7
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
- vimeoId: string;
9
- title: string;
10
- autoplay?: boolean | undefined;
11
- muted?: boolean | undefined;
12
- controls?: boolean | undefined;
13
- }>>>, {}, {}>;
14
- export default _default;
15
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
- type __VLS_TypePropsToRuntimeProps<T> = {
17
- [K in keyof T]-?: {} extends Pick<T, K> ? {
18
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
- } : {
20
- type: import('vue').PropType<T[K]>;
21
- required: true;
22
- };
4
+ autoplay?: boolean;
5
+ muted?: boolean;
6
+ controls?: boolean;
23
7
  };
8
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
9
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
2
2
  export default _default;