Открыть боковую панель
Teknokomo
universo-react
Коммиты
8bbe2e3b
Не подтверждена
Коммит
8bbe2e3b
создал
Янв 23, 2024
по автору
DarkSky
Просмотр файлов
feat: use custom image/preview link (#5584)
dep toeverything/blocksuite#5969
владелец
62169c59
Изменения
3
Скрыть пробелы
Построчно
Рядом
packages/common/env/src/global.ts
Просмотр файла @
8bbe2e3b
...
...
@@ -19,6 +19,7 @@ export const runtimeFlagsSchema = z.object({
downloadUrl
:
z
.
string
(),
// see: tools/workers
imageProxyUrl
:
z
.
string
(),
linkPreviewUrl
:
z
.
string
(),
enablePreloading
:
z
.
boolean
(),
enableNewSettingModal
:
z
.
boolean
(),
enableNewSettingUnstableApi
:
z
.
boolean
(),
...
...
packages/frontend/core/.webpack/runtime-config.ts
Просмотр файла @
8bbe2e3b
...
...
@@ -19,6 +19,7 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
changelogUrl
:
'
https://affine.pro/what-is-new
'
,
downloadUrl
:
'
https://affine.pro/download
'
,
imageProxyUrl
:
'
/api/worker/image-proxy
'
,
linkPreviewUrl
:
'
/api/worker/link-preview
'
,
enablePreloading
:
true
,
enableNewSettingModal
:
true
,
enableNewSettingUnstableApi
:
false
,
...
...
@@ -61,6 +62,7 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
changelogUrl
:
'
https://github.com/toeverything/AFFiNE/releases
'
,
downloadUrl
:
'
https://affine.pro/download
'
,
imageProxyUrl
:
'
/api/worker/image-proxy
'
,
linkPreviewUrl
:
'
/api/worker/link-preview
'
,
enablePreloading
:
true
,
enableNewSettingModal
:
true
,
enableNewSettingUnstableApi
:
false
,
...
...
packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx
Просмотр файла @
8bbe2e3b
...
...
@@ -5,6 +5,11 @@ import { useWorkspaceStatus } from '@affine/core/hooks/use-workspace-status';
import
{
waitForCurrentWorkspaceAtom
}
from
'
@affine/core/modules/workspace
'
;
import
{
WorkspaceSubPath
}
from
'
@affine/core/shared
'
;
import
{
globalBlockSuiteSchema
,
SyncEngineStep
}
from
'
@affine/workspace
'
;
import
{
BookmarkService
,
customImageProxyMiddleware
,
ImageService
,
}
from
'
@blocksuite/blocks
'
;
import
type
{
AffineEditorContainer
}
from
'
@blocksuite/presets
'
;
import
type
{
Page
,
Workspace
}
from
'
@blocksuite/store
'
;
import
{
appSettingAtom
}
from
'
@toeverything/infra/atom
'
;
...
...
@@ -138,6 +143,13 @@ const DetailPageImpl = memo(function DetailPageImpl({ page }: { page: Page }) {
);
}
}
catch
{}
ImageService
.
setImageProxyURL
(
runtimeConfig
.
imageProxyUrl
);
BookmarkService
.
setLinkPreviewEndpoint
(
runtimeConfig
.
linkPreviewUrl
);
editor
.
host
?.
std
.
clipboard
.
use
(
customImageProxyMiddleware
(
runtimeConfig
.
imageProxyUrl
)
);
setPageMode
(
currentPageId
,
mode
);
// fixme: it seems pageLinkClicked is not triggered sometimes?
const
dispose
=
editor
.
slots
.
pageLinkClicked
.
on
(({
pageId
})
=>
{
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать