Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging release-23.03 into master (#24211)
* Update release version for dotcms-ui and dotcms-webcomponents * Modify dotcmsReleaseVersion to 23.03, coreWebReleaseVersion, webComponentsReleaseVersion to rc and dot-cicd branch version to release-23.03 * Update branch in git submodule to release-23.03 * Excluding from triggering test at folder: dotCMS/src/main/webapp/html * #23977 Block editor freeze scroll on tippy menus show (#24180) * dev: freeze scroll on show forms #23977 * clean up * refactor * clean up v2 * feedback * clean up * Update .github/workflows/release-process.yml Co-authored-by: Freddy Montes <751424+fmontes@users.noreply.github.com> * Update .gitmodules Co-authored-by: Freddy Montes <751424+fmontes@users.noreply.github.com> * Update core-web/package.json Co-authored-by: Freddy Montes <751424+fmontes@users.noreply.github.com> * Update dotCMS/gradle.properties Co-authored-by: Freddy Montes <751424+fmontes@users.noreply.github.com> --------- Co-authored-by: victoralfaro-dotcms <victor.alfaro@dotcms.com> Co-authored-by: Rafael Velazco <rjvelazco21@gmail.com> Co-authored-by: Freddy Montes <751424+fmontes@users.noreply.github.com>
- Loading branch information
1 parent
0980a53
commit 2a546a6
Showing
17 changed files
with
142 additions
and
47 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
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
61 changes: 61 additions & 0 deletions
61
core-web/libs/block-editor/src/lib/extensions/freeze-scroll/freeze-scroll.extension.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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { PluginKey, Plugin, Transaction, EditorState } from 'prosemirror-state'; | ||
|
||
import { Extension } from '@tiptap/core'; | ||
|
||
export const FREEZE_SCROLL_KEY = new PluginKey('freeze-scroll'); | ||
|
||
declare module '@tiptap/core' { | ||
interface Commands<ReturnType> { | ||
FreezeScroll: { | ||
freezeScroll: (value: boolean) => ReturnType; | ||
}; | ||
} | ||
} | ||
|
||
interface PluginState { | ||
freezeScroll: boolean; | ||
} | ||
|
||
export const FreezeScroll = Extension.create({ | ||
addCommands() { | ||
return { | ||
freezeScroll: | ||
(value) => | ||
({ chain }) => { | ||
return chain() | ||
.command(({ tr }) => { | ||
tr.setMeta(FREEZE_SCROLL_KEY, { freezeScroll: value }); | ||
|
||
return true; | ||
}) | ||
.run(); | ||
} | ||
}; | ||
}, | ||
|
||
addProseMirrorPlugins() { | ||
return [FreezeScrollPlugin]; | ||
} | ||
}); | ||
|
||
export const FreezeScrollPlugin = new Plugin({ | ||
key: FREEZE_SCROLL_KEY, | ||
state: { | ||
init(): PluginState { | ||
return { | ||
freezeScroll: false | ||
}; | ||
}, | ||
apply(transaction: Transaction, value: PluginState, oldState: EditorState): PluginState { | ||
const { freezeScroll } = transaction.getMeta(FREEZE_SCROLL_KEY) || {}; | ||
const state = FREEZE_SCROLL_KEY?.getState(oldState); | ||
|
||
if (typeof freezeScroll === 'boolean') { | ||
return { freezeScroll }; | ||
} | ||
|
||
// keep the old state in case we do not receive a new one. | ||
return state || value; | ||
} | ||
} | ||
}); |
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.