-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/plugin builder for rte #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
return { | ||
__isPluginBuilder__: true, | ||
version, | ||
plugins: (context: InitializationData, rte: IRteParam) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to use the broader type here when we know we are getting RTE specific initialization data?
this._config.elementType = elementType; | ||
return this; | ||
} | ||
render(renderFn: (element: React.ReactElement, attrs: { [key: string]: any }, path: number[], rte: IRteParam) => React.ReactElement): PluginBuilder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below is the signature of existing render function
render?: (...params: any) => ReactElement
Why are we introducing additional arguments now? Why these issues not occurring with existing plugins?
const plugins = async (context: InitializationData, rte: IRteParam) => { | ||
try { | ||
const sdk = new UiLocation(context); | ||
console.log("sdk", sdk); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove console logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
| "GCP_NA" | ||
| string; | ||
|
||
export type Extension = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will resolve this
this.modal = new Modal(); | ||
|
||
this.region = formatAppRegion(initializationData.region); | ||
this.region = formatAppRegion(initializationData.region as Region); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using Region here? region is of type RegionType right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the older version PR changes for region is present in develop branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will create a new pr and close this one
} | ||
|
||
export function formatAppRegion(region: string): RegionType { | ||
return region ?? Region.UNKNOWN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change is needed?
Changes- support for new JSON RTE plugin