mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 04:21:40 +08:00
chore: migrate oxlint & oxfmt (#15464)
#### PR Dependency Tree * **PR #15464** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Replaced the project’s formatting and linting workflow with Oxfmt and Oxlint. * Added shared formatting and linting configuration, editor integration, and updated automated checks. * Updated generated files, scripts, and lint guidance to use the new tooling. * **Style** * Reformatted templates, source code, examples, and configuration files for consistent readability. * No user-facing functionality or rendering behavior changed. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -47,9 +47,9 @@ export class EdgelessShapePanel extends LitElement {
|
||||
this._onSelect(name);
|
||||
}}
|
||||
>
|
||||
${this.shapeStyle === ShapeStyle.General
|
||||
? generalIcon
|
||||
: scribbledIcon}
|
||||
${
|
||||
this.shapeStyle === ShapeStyle.General ? generalIcon : scribbledIcon
|
||||
}
|
||||
</edgeless-tool-icon-button>`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -308,18 +308,20 @@ export class EdgelessToolbarShapeDraggable extends EdgelessToolbarToolMixin(
|
||||
opacity: isBeingDragged ? 0 : 1,
|
||||
});
|
||||
const nextStyle = styleMap(baseStyle);
|
||||
return html`${isBeingDragged
|
||||
? html`<div
|
||||
style=${nextStyle}
|
||||
class=${classMap({
|
||||
shape: true,
|
||||
next: true,
|
||||
coming: !!dragOut && !cancelled,
|
||||
})}
|
||||
>
|
||||
${shape.svg}
|
||||
</div>`
|
||||
: nothing}
|
||||
return html`${
|
||||
isBeingDragged
|
||||
? html`<div
|
||||
style=${nextStyle}
|
||||
class=${classMap({
|
||||
shape: true,
|
||||
next: true,
|
||||
coming: !!dragOut && !cancelled,
|
||||
})}
|
||||
>
|
||||
${shape.svg}
|
||||
</div>`
|
||||
: nothing
|
||||
}
|
||||
<div
|
||||
style=${currStyle}
|
||||
class=${classMap({
|
||||
|
||||
@@ -180,9 +180,11 @@ export class EdgelessShapeMenu extends SignalWatcher(
|
||||
.iconSize=${'20px'}
|
||||
@click=${() => this.onChange(name)}
|
||||
>
|
||||
${shapeStyle === ShapeStyle.General
|
||||
? generalIcon
|
||||
: scribbledIcon}
|
||||
${
|
||||
shapeStyle === ShapeStyle.General
|
||||
? generalIcon
|
||||
: scribbledIcon
|
||||
}
|
||||
</edgeless-tool-icon-button>
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -67,12 +67,14 @@ export class EdgelessShapeToolButton extends EdgelessToolbarToolMixin(
|
||||
return html`
|
||||
<edgeless-toolbar-button
|
||||
class="edgeless-shape-button"
|
||||
.tooltip=${this.popper
|
||||
? ''
|
||||
: html`<affine-tooltip-content-with-shortcut
|
||||
data-tip="${'Shape'}"
|
||||
data-shortcut="${'S'}"
|
||||
></affine-tooltip-content-with-shortcut>`}
|
||||
.tooltip=${
|
||||
this.popper
|
||||
? ''
|
||||
: html`<affine-tooltip-content-with-shortcut
|
||||
data-tip="${'Shape'}"
|
||||
data-shortcut="${'S'}"
|
||||
></affine-tooltip-content-with-shortcut>`
|
||||
}
|
||||
.tooltipOffset=${5}
|
||||
.active=${active}
|
||||
>
|
||||
|
||||
@@ -258,11 +258,13 @@ export class EdgelessShapeToolElement extends WithDisposable(LitElement) {
|
||||
>
|
||||
${this.shape.svg}
|
||||
</div>
|
||||
${this.order === 1
|
||||
? html`<div id="backup-shape-element" class="shape">
|
||||
${this.shape.svg}
|
||||
</div>`
|
||||
: null}
|
||||
${
|
||||
this.order === 1
|
||||
? html`<div id="backup-shape-element" class="shape">
|
||||
${this.shape.svg}
|
||||
</div>`
|
||||
: null
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
@@ -501,21 +501,23 @@ export class EdgelessShapeTextEditor extends WithDisposable(ShadowlessElement) {
|
||||
|
||||
return html` <style>
|
||||
edgeless-shape-text-editor v-text [data-v-text] {
|
||||
overflow-wrap: ${constrainedAutoWidth
|
||||
? 'anywhere'
|
||||
: autoWidth
|
||||
? 'normal'
|
||||
: 'anywhere'};
|
||||
word-break: ${constrainedAutoWidth
|
||||
? 'break-word'
|
||||
: autoWidth
|
||||
? 'normal'
|
||||
: 'break-word'} !important;
|
||||
white-space: ${constrainedAutoWidth
|
||||
? 'pre-wrap'
|
||||
: autoWidth
|
||||
? 'pre'
|
||||
: 'pre-wrap'} !important;
|
||||
overflow-wrap: ${
|
||||
constrainedAutoWidth
|
||||
? 'anywhere'
|
||||
: autoWidth
|
||||
? 'normal'
|
||||
: 'anywhere'
|
||||
};
|
||||
word-break: ${
|
||||
constrainedAutoWidth
|
||||
? 'break-word'
|
||||
: autoWidth
|
||||
? 'normal'
|
||||
: 'break-word'
|
||||
} !important;
|
||||
white-space: ${
|
||||
constrainedAutoWidth ? 'pre-wrap' : autoWidth ? 'pre' : 'pre-wrap'
|
||||
} !important;
|
||||
}
|
||||
|
||||
edgeless-shape-text-editor .inline-editor {
|
||||
|
||||
Reference in New Issue
Block a user