simplify
This commit is contained in:
@@ -105,8 +105,8 @@ export function useRichTextLinkOverlay(options = {}) {
|
||||
const maxTop = container.scrollTop + container.clientHeight - cardHeight - 8;
|
||||
|
||||
linkHoverStyle.value = {
|
||||
left: `${Math.max(minLeft, Math.min(rawLeft, Math.max(minLeft, maxLeft)))}px`,
|
||||
top: `${Math.max(minTop, Math.min(rawTop, Math.max(minTop, maxTop)))}px`
|
||||
left: `${Math.max(minLeft, Math.min(rawLeft, maxLeft))}px`,
|
||||
top: `${Math.max(minTop, Math.min(rawTop, maxTop))}px`
|
||||
};
|
||||
linkHoverHref.value = href;
|
||||
hoverAnchorPos.value = resolveAnchorPos(anchorEl);
|
||||
|
||||
@@ -16,8 +16,6 @@ export function useDocumentEditorPolicy(options = {}) {
|
||||
const isSlideDocument = computed(() => normalizedDocType.value === '3');
|
||||
const isRichTextDocument = computed(() => normalizedDocType.value === '4');
|
||||
|
||||
const canManageAttachments = computed(() => hasDocument.value);
|
||||
const canManageSettings = computed(() => hasDocument.value);
|
||||
const collabEnabled = computed(
|
||||
() => hasDocument.value && (isMarkdownDocument.value || isRichTextDocument.value)
|
||||
);
|
||||
@@ -35,8 +33,6 @@ export function useDocumentEditorPolicy(options = {}) {
|
||||
isTableDocument,
|
||||
isSlideDocument,
|
||||
isRichTextDocument,
|
||||
canManageAttachments,
|
||||
canManageSettings,
|
||||
collabEnabled,
|
||||
inlineCommentEnabled,
|
||||
createDialogKnowledgeBaseId,
|
||||
|
||||
@@ -13,7 +13,7 @@ export function useDocumentRouteContext({ props, route }) {
|
||||
const collabEnabled = computed(() => !!docId.value);
|
||||
const collabRoom = computed(() => (docId.value ? `${docId.value}` : ''));
|
||||
const collabUrl = computed(() => '/ws/doc');
|
||||
const collabToken = computed(() => localStorage.getItem('token') || '');
|
||||
const collabToken = localStorage.getItem('token') || '';
|
||||
const collabReady = ref(false);
|
||||
const lastSyncedDocId = ref('');
|
||||
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
const resolveBool = (valueOrGetterOrRef, fallback = false) => {
|
||||
if (typeof valueOrGetterOrRef === 'function') {
|
||||
return valueOrGetterOrRef();
|
||||
}
|
||||
if (valueOrGetterOrRef && typeof valueOrGetterOrRef === 'object' && 'value' in valueOrGetterOrRef) {
|
||||
return valueOrGetterOrRef.value;
|
||||
}
|
||||
if (valueOrGetterOrRef === undefined) {
|
||||
return fallback;
|
||||
}
|
||||
return Boolean(valueOrGetterOrRef);
|
||||
};
|
||||
import { resolveBool } from '@/utils/resolveBool';
|
||||
|
||||
export function useDocumentTreeContextMenu(options = {}) {
|
||||
const { enabled = true } = options;
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
import { nextTick, ref } from 'vue';
|
||||
|
||||
const resolveBool = (valueOrGetterOrRef, fallback = false) => {
|
||||
if (typeof valueOrGetterOrRef === 'function') {
|
||||
return valueOrGetterOrRef();
|
||||
}
|
||||
if (valueOrGetterOrRef && typeof valueOrGetterOrRef === 'object' && 'value' in valueOrGetterOrRef) {
|
||||
return valueOrGetterOrRef.value;
|
||||
}
|
||||
if (valueOrGetterOrRef === undefined) {
|
||||
return fallback;
|
||||
}
|
||||
return Boolean(valueOrGetterOrRef);
|
||||
};
|
||||
import { resolveBool } from '@/utils/resolveBool';
|
||||
|
||||
export function useInlineRename(options = {}) {
|
||||
const { revertRename = true, onConfirm = null } = options;
|
||||
|
||||
Reference in New Issue
Block a user