-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
188286105 Drag from Plugins to Codap (#1532)
* Use function for getOverlayDragId. * Add app wide plugin AttributeDropOverlay. * Add notify attribute dragStart, dragMove, and dragEnd handlers. * Standardize fieldRequiredResults. * Fix notifications broadcast from attributeLocation API requests. --------- Co-authored-by: Kirk Swenson <[email protected]>
- Loading branch information
1 parent
2fb7a23
commit 20c21dc
Showing
25 changed files
with
291 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const kContainerClass = "codap-container" |
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 @@ | ||
export const kPluginAttributeDragId = "plugin-attribute-drag" |
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,7 @@ | ||
#plugin-attribute-drag { | ||
height: 1px; | ||
opacity: 0; | ||
position: absolute; | ||
top: 0px; | ||
width: 1px; | ||
} |
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,26 @@ | ||
import { observer } from "mobx-react-lite" | ||
import React from "react" | ||
import { dataInteractiveState } from "../../data-interactive/data-interactive-state" | ||
import { useDraggableAttribute } from "../../hooks/use-drag-drop" | ||
import { getDataSetFromId } from "../../models/shared/shared-data-utils" | ||
import { appState } from "../../models/app-state" | ||
import { kPluginAttributeDragId } from "./drag-drop-constants" | ||
|
||
import "./plugin-attribute-drag.scss" | ||
|
||
export const PluginAttributeDrag = observer(function PluginAttributeDrag() { | ||
const dataSet = getDataSetFromId(appState.document, dataInteractiveState.draggingDatasetId) | ||
const { attributes, listeners, setNodeRef } = useDraggableAttribute({ | ||
attributeId: dataInteractiveState.draggingAttributeId, | ||
dataSet, | ||
prefix: "plugin" | ||
}) | ||
return ( | ||
<div | ||
id={kPluginAttributeDragId} | ||
ref={setNodeRef} | ||
{...attributes} | ||
{...listeners} | ||
/> | ||
) | ||
}) |
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
Oops, something went wrong.