-
Notifications
You must be signed in to change notification settings - Fork 19
IBX-9170: AI Assistant #1385
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
Merged
Merged
IBX-9170: AI Assistant #1385
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fdcd5c4
AI Assistant
GrabowskiM f3d997a
footer
GrabowskiM 6c08547
improve search; fix linter
GrabowskiM 077ed1b
dialog hook
GrabowskiM 2ac20f7
translations
GrabowskiM 40b5c00
minor fixes
GrabowskiM eb53194
recalc actions width
GrabowskiM 02c768c
added BC fallback
GrabowskiM f8b30d4
after cr
GrabowskiM 2066b8d
added some root handling
GrabowskiM ea5dac7
added dependency arrays; break popupmenu component to smaller ones
GrabowskiM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
30 changes: 30 additions & 0 deletions
30
src/bundle/Resources/public/js/scripts/helpers/react.helper.js
This file contains hidden or 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,30 @@ | ||
| import { getRootDOMElement } from './context.helper'; | ||
|
|
||
| const createDynamicRoot = ({ contextDOMElement = getRootDOMElement(), id } = {}) => { | ||
| if (id && window.document.getElementById(id) !== null) { | ||
| console.warn(`You're creating second root element with ID "${id}". IDs should be unique inside a document.`); | ||
| } | ||
|
|
||
| const rootDOMElement = document.createElement('div'); | ||
|
|
||
| rootDOMElement.classList.add('ibexa-react-root'); | ||
|
|
||
| if (id) { | ||
| rootDOMElement.id = id; | ||
| } | ||
|
|
||
| contextDOMElement.appendChild(rootDOMElement); | ||
|
|
||
| const reactRoot = window.ReactDOM.createRoot(rootDOMElement); | ||
|
|
||
| return reactRoot; | ||
| }; | ||
|
|
||
| const removeDynamicRoot = (reactRoot) => { | ||
| const rootDOMElement = reactRoot._internalRoot?.containerInfo; | ||
|
|
||
| reactRoot.unmount(); | ||
| rootDOMElement?.remove(); | ||
| }; | ||
|
|
||
| export { createDynamicRoot, removeDynamicRoot }; | ||
This file contains hidden or 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
13 changes: 13 additions & 0 deletions
13
src/bundle/Resources/public/scss/ui/modules/common/_draggable.dialog.scss
This file contains hidden or 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,13 @@ | ||
| .c-draggable-dialog { | ||
| position: fixed; | ||
| z-index: 10000; | ||
|
|
||
| &--hidden { | ||
| visibility: hidden; | ||
| } | ||
|
|
||
| &__draggable { | ||
| cursor: grab; | ||
| user-select: none; | ||
| } | ||
| } |
74 changes: 74 additions & 0 deletions
74
src/bundle/Resources/public/scss/ui/modules/common/_popup.menu.scss
This file contains hidden or 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,74 @@ | ||
| .c-popup-menu { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: calculateRem(1px); | ||
| padding: calculateRem(8px) 0; | ||
| background: $ibexa-color-white; | ||
| border: calculateRem(1px) solid $ibexa-color-light; | ||
| border-radius: $ibexa-border-radius; | ||
| box-shadow: calculateRem(4px) calculateRem(22px) calculateRem(67px) 0 rgba($ibexa-color-info, 0.2); | ||
| position: fixed; | ||
| z-index: 1060; | ||
|
|
||
| &--hidden { | ||
| visibility: hidden; | ||
| } | ||
|
|
||
| &__search { | ||
| margin-bottom: calculateRem(4px); | ||
albozek marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| padding: 0 calculateRem(8px); | ||
|
|
||
| &--hidden { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| &__search-input { | ||
| border-radius: $ibexa-border-radius; | ||
| } | ||
|
|
||
| &__groups { | ||
| max-height: calculateRem(390px); | ||
| overflow-y: auto; | ||
| } | ||
|
|
||
| &__group:not(:last-child) { | ||
| &::after { | ||
| content: ''; | ||
| border-top: calculateRem(1px) solid $ibexa-color-light; | ||
| display: flex; | ||
| width: calc(100% - calculateRem(16px)); | ||
| margin: calculateRem(1px) calculateRem(8px) 0; | ||
| } | ||
| } | ||
|
|
||
| &__item { | ||
| display: flex; | ||
| align-items: center; | ||
| min-width: calculateRem(150px); | ||
| padding: 0 calculateRem(8px); | ||
| transition: all $ibexa-admin-transition-duration $ibexa-admin-transition; | ||
| } | ||
|
|
||
| &__item-content { | ||
| position: relative; | ||
| display: flex; | ||
| align-items: baseline; | ||
| width: 100%; | ||
| cursor: pointer; | ||
| padding: calculateRem(9px); | ||
| color: $ibexa-color-dark; | ||
| font-size: $ibexa-text-font-size-medium; | ||
| text-align: left; | ||
| text-decoration: none; | ||
| border: none; | ||
| border-radius: $ibexa-border-radius; | ||
| transition: all $ibexa-admin-transition-duration $ibexa-admin-transition; | ||
|
|
||
| &:hover { | ||
| background-color: $ibexa-color-light-300; | ||
| color: $ibexa-color-black; | ||
| text-decoration: none; | ||
| } | ||
| } | ||
| } | ||
16 changes: 16 additions & 0 deletions
16
src/bundle/Resources/translations/ibexa_popup_menu.en.xliff
This file contains hidden or 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,16 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2"> | ||
| <file source-language="en" target-language="en" datatype="plaintext" original="not.available"> | ||
| <header> | ||
| <tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/> | ||
| <note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note> | ||
| </header> | ||
| <body> | ||
| <trans-unit id="e4f3034ecab5de30a4ea60991375e4c6ccb21ed1" resname="ibexa_popup_menu.search.placeholder"> | ||
| <source>Search...</source> | ||
| <target state="new">Search...</target> | ||
| <note>key: ibexa_popup_menu.search.placeholder</note> | ||
| </trans-unit> | ||
| </body> | ||
| </file> | ||
| </xliff> |
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.