refactor(editor): rename job to transformer (#9639)

This commit is contained in:
Mirone
2025-01-11 12:04:07 +08:00
committed by GitHub
parent 9fa35ed490
commit 446b31b621
56 changed files with 223 additions and 193 deletions

View File

@@ -16,7 +16,7 @@ import {
} from '@blocksuite/blocks';
import { WithDisposable } from '@blocksuite/global/utils';
import type { AffineEditorContainer } from '@blocksuite/presets';
import { type DocSnapshot, Job } from '@blocksuite/store';
import { type DocSnapshot, Transformer } from '@blocksuite/store';
import { effect } from '@preact/signals-core';
import type SlTabPanel from '@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js';
import { css, html, type PropertyValues } from 'lit';
@@ -101,7 +101,7 @@ export class AdaptersPanel extends WithDisposable(ShadowlessElement) {
}
private _createJob() {
return new Job({
return new Transformer({
schema: this.doc.collection.schema,
blobCRUD: this.doc.collection.blobSync,
docCRUD: {

View File

@@ -50,7 +50,7 @@ import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type { DeltaInsert } from '@blocksuite/inline/types';
import { AffineEditorContainer, type CommentPanel } from '@blocksuite/presets';
import { Job, Text, type Workspace } from '@blocksuite/store';
import { Text, Transformer, type Workspace } from '@blocksuite/store';
import type { SlDropdown } from '@shoelace-style/shoelace';
import { setBasePath } from '@shoelace-style/shoelace/dist/utilities/base-path.js';
import { css, html } from 'lit';
@@ -241,7 +241,7 @@ export class StarterDebugMenu extends ShadowlessElement {
private async _exportFile(config: AdapterConfig) {
const doc = this.editor.doc;
const job = new Job({
const job = new Transformer({
schema: this.collection.schema,
blobCRUD: this.collection.blobSync,
docCRUD: {
@@ -442,7 +442,7 @@ export class StarterDebugMenu extends ShadowlessElement {
multiple: false,
});
if (!file) return;
const job = new Job({
const job = new Transformer({
schema: this.collection.schema,
blobCRUD: this.collection.blobSync,
docCRUD: {

View File

@@ -1,7 +1,7 @@
import type { EditorHost } from '@blocksuite/block-std';
import type { TestUtils } from '@blocksuite/blocks';
import type { AffineEditorContainer } from '@blocksuite/presets';
import type { BlockSchema, Blocks, Workspace, Job } from '@blocksuite/store';
import type { BlockSchema, Blocks, Workspace, Transformer } from '@blocksuite/store';
import type { z } from 'zod';
import type * as Y from 'yjs';
@@ -17,7 +17,7 @@ declare global {
doc: Blocks;
collection: Workspace;
blockSchemas: z.infer<typeof BlockSchema>[];
job: Job;
job: Transformer;
Y: typeof Y;
std: typeof std;
testUtils: TestUtils;

View File

@@ -1,6 +1,6 @@
import { AffineSchemas, SpecProvider, TestUtils } from '@blocksuite/blocks';
import type { BlockSuiteFlags } from '@blocksuite/global/types';
import { Job, nanoid, Schema } from '@blocksuite/store';
import { nanoid, Schema, Transformer } from '@blocksuite/store';
import {
createAutoIncrementIdGenerator,
type DocCollectionOptions,
@@ -81,7 +81,7 @@ export function createStarterDocCollection() {
// debug info
window.collection = collection;
window.blockSchemas = AffineSchemas;
window.job = new Job({
window.job = new Transformer({
schema: collection.schema,
blobCRUD: collection.blobSync,
docCRUD: {