diff --git a/packages/nc-gui/assets/nc-icons/globe.svg b/packages/nc-gui/assets/nc-icons/globe.svg new file mode 100644 index 0000000000..98f1340af7 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/globe.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/google-docs.svg b/packages/nc-gui/assets/nc-icons/google-docs.svg new file mode 100644 index 0000000000..180ef36e8a --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/google-docs.svg @@ -0,0 +1,89 @@ + + + + Docs-icon + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/nc-gui/assets/nc-icons/play.svg b/packages/nc-gui/assets/nc-icons/play.svg new file mode 100644 index 0000000000..a0015479fd --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/play.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/nc-gui/components/cell/attachment/AttachFile.vue b/packages/nc-gui/components/cell/attachment/AttachFile.vue index 1c636a0d96..4308258ceb 100644 --- a/packages/nc-gui/components/cell/attachment/AttachFile.vue +++ b/packages/nc-gui/components/cell/attachment/AttachFile.vue @@ -47,10 +47,11 @@ watch(activeMenu, (newVal, oldValue) => { @keydown.esc="dialogShow = false" >
-
- +
+ { { { -.ant-carousel :deep(.slick-arrow.custom-slick-arrow) { - @apply text-4xl text-white hover:text-primary active:text-accent opacity-100 cursor-pointer z-1; -} -.ant-carousel :deep(.custom-slick-arrow:before) { - display: none; -} -.ant-carousel :deep(.custom-slick-arrow:hover) { - opacity: 0.5; + diff --git a/packages/nc-gui/components/cell/attachment/Modal.vue b/packages/nc-gui/components/cell/attachment/Modal.vue index a952a31b2b..879db62531 100644 --- a/packages/nc-gui/components/cell/attachment/Modal.vue +++ b/packages/nc-gui/components/cell/attachment/Modal.vue @@ -18,7 +18,7 @@ const { onDrop, downloadAttachment, updateModelValue, - selectedImage, + selectedFile, selectedVisibleItems, bulkDownloadAttachments, renameFile, @@ -42,10 +42,10 @@ onKeyDown('Escape', () => { }) function onClick(item: Record) { - selectedImage.value = item + selectedFile.value = item modalVisible.value = false - const stopHandle = watch(selectedImage, (nextImage) => { + const stopHandle = watch(selectedFile, (nextImage) => { if (!nextImage) { setTimeout(() => { modalVisible.value = true @@ -82,19 +82,28 @@ const handleFileDelete = (i: number) => { diff --git a/packages/nc-gui/components/cell/attachment/Image.vue b/packages/nc-gui/components/cell/attachment/Preview/Image.vue similarity index 68% rename from packages/nc-gui/components/cell/attachment/Image.vue rename to packages/nc-gui/components/cell/attachment/Preview/Image.vue index 58a6d6dcc7..a109bf8803 100644 --- a/packages/nc-gui/components/cell/attachment/Image.vue +++ b/packages/nc-gui/components/cell/attachment/Preview/Image.vue @@ -2,6 +2,7 @@ interface Props { srcs: string[] alt?: string + objectFit?: string } const props = defineProps() @@ -14,8 +15,12 @@ const onError = () => index.value++
-
+
{{ $t('labels.cancel') }} diff --git a/packages/nc-gui/components/cell/attachment/UploadProviders/Url.vue b/packages/nc-gui/components/cell/attachment/UploadProviders/Url.vue index 55571c69de..148fb217c1 100644 --- a/packages/nc-gui/components/cell/attachment/UploadProviders/Url.vue +++ b/packages/nc-gui/components/cell/attachment/UploadProviders/Url.vue @@ -38,7 +38,7 @@ const deleteAttachment = (index: number) => { tempAttachments.value.splice(index, 1) } -const isValidUrl = ref(true) +const isValidUrl = ref(false) const errorMessage = ref('') diff --git a/packages/nc-gui/components/cell/attachment/index.vue b/packages/nc-gui/components/cell/attachment/index.vue index dc2796d3a7..e188b7c8a4 100644 --- a/packages/nc-gui/components/cell/attachment/index.vue +++ b/packages/nc-gui/components/cell/attachment/index.vue @@ -38,20 +38,22 @@ const { isSharedForm } = useSmartsheetStoreOrThrow()! const { isMobileMode } = useGlobal() -const { getPossibleAttachmentSrc, openAttachment: _openAttachment } = useAttachment() +const { getPossibleAttachmentSrc } = useAttachment() const { isPublic, isForm, column, modalRendered, + downloadAttachment, + renameFile, modalVisible, attachments, visibleItems, onDrop, isLoading, FileIcon, - selectedImage, + selectedFile, isReadonly, storedFiles, removeFile, @@ -61,7 +63,13 @@ const { dragging } = useSortable(sortableRef, visibleItems, updateModelValue, is const active = inject(ActiveCellInj, ref(false)) -const { state: rowState } = useSmartsheetRowStoreOrThrow() +const { state: rowState, row } = useSmartsheetRowStoreOrThrow() + +const meta = inject(MetaInj, ref()) + +if (!isPublic.value && !isForm.value && meta.value) { + useProvideRowComments(meta, row) +} const { isOverDropZone } = useDropZone(currentCellRef as any, onDrop) @@ -121,7 +129,8 @@ watch( const isNewAttachmentModalOpen = ref(false) useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e) => { - if (e.key === 'Enter' && !isReadonly.value) { + if (modalVisible.value) return + if (e.key === 'Enter' && !isReadonly.value && !selectedFile.value) { if (isNewAttachmentModalOpen.value) return e.stopPropagation() if (!modalVisible.value && !isMobileMode.value) { @@ -146,16 +155,6 @@ const open = (e: Event) => { openAttachmentModal() } -const openAttachment = (item: any) => { - if (isMobileMode.value && !isExpandedForm.value) { - isExpandedForm.value = true - - return - } - - _openAttachment(item) -} - const onExpand = () => { if (isMobileMode.value) return @@ -163,12 +162,12 @@ const onExpand = () => { modalVisible.value = true } -const onImageClick = (item: any) => { +const onFileClick = (item: any) => { if (isMobileMode.value && !isExpandedForm.value) return if (!isMobileMode.value && (isGallery.value || isKanban.value) && !isExpandedForm.value) return - selectedImage.value = item + selectedFile.value = item } const keydownEnter = (e: KeyboardEvent) => { @@ -206,80 +205,161 @@ const handleFileDelete = (i: number) => {