feat: sites and authors integration into existing screens (& formated all frontend files kinda accidentally)

This commit is contained in:
Florian Sylvain committed 2026-10-15 05:25:44 +02:00
1 parent 3d81d2c717
commit 6b8990c55e
239 files changed
+9194 -1354

No files matched your search

@@ -267,7 +267,10 @@ describe('The link button across its states', () => {
try {
await mountEditor()
linkButton().dispatchEvent(
new PointerEvent('pointermove', { bubbles: true, pointerType: 'mouse' }),
new PointerEvent('pointermove', {
bubbles: true,
pointerType: 'mouse',
}),
)
await vi.advanceTimersByTimeAsync(399)
expect(document.body.textContent).not.toContain('Insert link (Ctrl+K)')
@@ -284,7 +287,10 @@ describe('The link button across its states', () => {
try {
await mountEditor()
linkButton().dispatchEvent(
new PointerEvent('pointermove', { bubbles: true, pointerType: 'mouse' }),
new PointerEvent('pointermove', {
bubbles: true,
pointerType: 'mouse',
}),
)
await vi.advanceTimersByTimeAsync(401)
expect(document.body.textContent).toContain('Insert link (⌘K)')
@@ -299,7 +305,10 @@ describe('The link button across its states', () => {
try {
await mountEditor(SENTENCE, PHONE)
linkButton().dispatchEvent(
new PointerEvent('pointermove', { bubbles: true, pointerType: 'touch' }),
new PointerEvent('pointermove', {
bubbles: true,
pointerType: 'touch',
}),
)
await vi.advanceTimersByTimeAsync(1000)
expect(document.body.textContent).not.toContain('Insert link (')
@@ -380,16 +389,27 @@ describe('Ctrl+K', () => {
const Host = defineComponent({
render: () =>
h(UApp, null, () =>
h(ArticleEditor, { modelValue: '<p>Hello</p>', articleId: 1, disabled: true }),
h(ArticleEditor, {
modelValue: '<p>Hello</p>',
articleId: 1,
disabled: true,
}),
),
})
const host = mount(Host, { attachTo: document.body, global: { plugins: [uiPlugin] } })
const host = mount(Host, {
attachTo: document.body,
global: { plugins: [uiPlugin] },
})
await settle()
const vm = host.findComponent(ArticleEditor).vm as unknown as {
$: { setupState: { editorInstance: Editor } }
}
vm.$.setupState.editorInstance.view.dom.dispatchEvent(
new KeyboardEvent('keydown', { key: 'k', ctrlKey: true, bubbles: true }),
new KeyboardEvent('keydown', {
key: 'k',
ctrlKey: true,
bubbles: true,
}),
)
await settle()
@@ -403,7 +423,11 @@ describe('Ctrl+K', () => {
preview.click()
await settle()
document.dispatchEvent(
new KeyboardEvent('keydown', { key: 'k', ctrlKey: true, bubbles: true }),
new KeyboardEvent('keydown', {
key: 'k',
ctrlKey: true,
bubbles: true,
}),
)
await settle()
@@ -731,7 +755,11 @@ describe('Leaving the dialog without saving', () => {
it('on Esc', async () => {
await openWithChanges()
field('text').dispatchEvent(
new KeyboardEvent('keydown', { key: 'Escape', bubbles: true, cancelable: true }),
new KeyboardEvent('keydown', {
key: 'Escape',
bubbles: true,
cancelable: true,
}),
)
await settle()
expectUntouched()
@@ -809,7 +837,11 @@ describe('Dialog or sheet by viewport, popover or sheet by input', () => {
editor()
.view.dom.querySelector('a')!
.dispatchEvent(
new KeyboardEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true }),
new KeyboardEvent('keydown', {
key: 'Enter',
bubbles: true,
cancelable: true,
}),
)
await settle()
@@ -870,8 +902,14 @@ describe('Toolbar overflow', () => {
function layout(scrollLeft: number) {
const element = toolbar()
Object.defineProperty(element, 'clientWidth', { configurable: true, value: 390 })
Object.defineProperty(element, 'scrollWidth', { configurable: true, value: 1100 })
Object.defineProperty(element, 'clientWidth', {
configurable: true,
value: 390,
})
Object.defineProperty(element, 'scrollWidth', {
configurable: true,
value: 1100,
})
element.scrollLeft = scrollLeft
element.dispatchEvent(new Event('scroll'))
}
@@ -919,7 +957,10 @@ describe('Selections that straddle a link or span blocks', () => {
await mountEditor(BODY)
const [first, last] = [selection.split(' ')[0]!, selection.split(' ').at(-1)!]
const from = positionOf(first)
editor().commands.setTextSelection({ from, to: positionOf(last) + last.length })
editor().commands.setTextSelection({
from,
to: positionOf(last) + last.length,
})
const before = editor().state.doc.textContent
await openDialog()
type(field('url'), '/b')