Skip to content
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

Feature/inline components #284

Merged
merged 68 commits into from
Jun 22, 2022
Merged

Feature/inline components #284

merged 68 commits into from
Jun 22, 2022

Conversation

elpoelma
Copy link
Contributor

Adds support for the creation of inline interactive ember components which can be rendered inside the editor.

elpoelma and others added 30 commits May 20, 2022 11:04
@elpoelma elpoelma added the enhancement New feature or request label Jun 13, 2022
@elpoelma elpoelma requested a review from abeforgit June 13, 2022 13:10
Copy link
Member

@abeforgit abeforgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall extremely impressive, well done
Some comments about the shape of this api, but it looks solid overall

if (componentSpec) {
const component = new ModelInlineComponent(componentSpec, props, state);
this.model.change(
(mutator) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the command seems to break when selection is not collapsed
tested using the sample-plugin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solved in 8177287

controller: Controller;
}

export default class InlineComponent<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it's logical, I'd move this file out of the components subfolder, since this folder has quite some significance in the ember build system

I have my reservations about making this a class to extend from as well
There's not that much wrong with it, but I do think it slightly breaks ember's tradition of not using inheritance
Id maybe prefer that the ember-component would recieve some kind of control interface as arguments, like we do with the controllers

It feels less magic to me than just suddenly having some extra methods on this
but I don't think it makes a big difference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified in: fbefa1b

addon/model/inline-components/model-inline-component.ts Outdated Show resolved Hide resolved
addon/model/inline-components/model-inline-component.ts Outdated Show resolved Hide resolved
@elpoelma elpoelma requested a review from abeforgit June 15, 2022 09:38
@elpoelma
Copy link
Contributor Author

Thanks for the comments! I have modified most of the code to take into account the suggestions.

@elpoelma
Copy link
Contributor Author

I have also introduced some modifications to shiftedVisually so it takes into account inline components.

Copy link
Member

@abeforgit abeforgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now!

@abeforgit abeforgit merged commit 747dd17 into development Jun 22, 2022
@abeforgit abeforgit deleted the feature/inline-components branch June 22, 2022 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants