-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change widget to plugin (#5490)
* refactor: rename widget to plugin * refactor: change module to extension
- Loading branch information
Showing
41 changed files
with
360 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { PluginOptions } from '@/src'; | ||
|
||
describe('spec plugin', () => { | ||
it('plugin', () => { | ||
const plugin: PluginOptions = ['minimap', { type: 'unset', key: '1' }]; | ||
|
||
expect(plugin).toBeTruthy(); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { BaseExtension } from '../registry/extension'; | ||
import type { CustomBehaviorOption } from '../spec/behavior'; | ||
import { BaseModule } from '../utils/module'; | ||
|
||
export type BaseBehaviorOptions = CustomBehaviorOption; | ||
|
||
export abstract class BaseBehavior<T extends BaseBehaviorOptions> extends BaseModule<T> {} | ||
export abstract class BaseBehavior<T extends BaseBehaviorOptions> extends BaseExtension<T> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import type { DragCanvasOptions } from './drag-canvas'; | ||
import type { ZoomCanvasOptions } from './zoom-canvas'; | ||
|
||
export { BaseBehavior } from './base-behavior'; | ||
export { DragCanvas } from './drag-canvas'; | ||
export { ZoomCanvas } from './zoom-canvas'; | ||
|
||
export type { BaseBehaviorOptions } from './base-behavior'; | ||
export type { DragCanvasOptions } from './drag-canvas'; | ||
export type BuiltInBehaviorOptions = ZoomCanvasOptions; | ||
export type { DragCanvasOptions, ZoomCanvasOptions }; | ||
export type BuiltInBehaviorOptions = DragCanvasOptions | ZoomCanvasOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BaseExtension } from '../registry/extension'; | ||
import type { CustomPluginOption } from '../spec/plugin'; | ||
|
||
export type BasePluginOptions = CustomPluginOption; | ||
|
||
export abstract class BasePlugin<T extends BasePluginOptions> extends BaseExtension<T> {} |
2 changes: 1 addition & 1 deletion
2
packages/g6/src/widgets/index.ts → packages/g6/src/plugins/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* <zh/> 内置组件 | ||
* | ||
* <en/> Built-in widgets | ||
* <en/> Built-in plugins | ||
*/ | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { BasePlugin } from './base-plugin'; | ||
|
||
export type BuiltInPluginOptions = { type: 'unset' }; | ||
export type Plugin = BasePlugin<any>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { runtime } from '@antv/g'; | ||
import { registerBuiltInPlugins } from './registry'; | ||
import { registerBuiltInExtensions } from './registry'; | ||
|
||
const onload = () => { | ||
runtime.enableCSSParsing = false; | ||
registerBuiltInPlugins(); | ||
registerBuiltInExtensions(); | ||
}; | ||
|
||
onload(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.