Skip to content

Commit

Permalink
fix: support iframe context #932
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jun 4, 2023
1 parent 5846e50 commit 3e87cc7
Show file tree
Hide file tree
Showing 16 changed files with 254 additions and 126 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
]
},
"resolutions": {
"@daybrush/utils": "^1.12.1",
"@daybrush/utils": "^1.13.0",
"@types/react": "^16.9.17",
"typescript": "^4.5.0 <4.6.0",
"@storybook/react": "^6.4.22",
Expand All @@ -114,12 +114,12 @@
"framework-utils": "^1.1.0",
"gesto": "^1.19.0",
"overlap-area": "^1.1.0",
"croact-css-styled": "^1.1.8",
"react-css-styled": "^1.1.8",
"croact-css-styled": "^1.1.9",
"react-css-styled": "^1.1.9",
"tslib": "^2.3.1"
},
"overrides": {
"@daybrush/utils": "^1.12.1",
"@daybrush/utils": "^1.13.0",
"@types/react": "^16.9.17",
"typescript": "^4.5.0 <4.6.0",
"@storybook/react": "^6.4.22",
Expand All @@ -138,8 +138,8 @@
"framework-utils": "^1.1.0",
"gesto": "^1.19.0",
"overlap-area": "^1.1.0",
"croact-css-styled": "^1.1.8",
"react-css-styled": "^1.1.8",
"croact-css-styled": "^1.1.9",
"react-css-styled": "^1.1.9",
"tslib": "^2.3.1"
}
}
8 changes: 4 additions & 4 deletions packages/croact-moveable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"devDependencies": {
"@daybrush/builder": "^0.1.2",
"@types/react": "^16.9.17",
"croact": "^1.0.3",
"croact": "^1.0.4",
"keycon": "^0.3.0",
"print-sizes": "^0.2.0",
"pvu": "^0.6.1",
Expand All @@ -68,19 +68,19 @@
"typescript": "^4.5.0 <4.6.0"
},
"dependencies": {
"@daybrush/utils": "^1.12.1",
"@daybrush/utils": "^1.13.0",
"@egjs/agent": "^2.2.1",
"@egjs/children-differ": "^1.0.1",
"@egjs/list-differ": "^1.0.0",
"@scena/dragscroll": "^1.4.0",
"@scena/event-emitter": "^1.0.5",
"@scena/matrix": "^1.1.1",
"croact-css-styled": "^1.1.8",
"croact-css-styled": "^1.1.9",
"css-to-mat": "^1.0.3",
"framework-utils": "^1.1.0",
"gesto": "^1.19.0",
"overlap-area": "^1.1.0",
"react-css-styled": "^1.1.8",
"react-css-styled": "^1.1.9",
"react-moveable": "~0.50.7"
}
}
2 changes: 1 addition & 1 deletion packages/helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"typescript": "^4.5.0 <4.6.0"
},
"dependencies": {
"@daybrush/utils": "^1.11.0"
"@daybrush/utils": "^1.13.0"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion packages/lit-moveable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"typescript": "^4.5.0 <4.6.0"
},
"dependencies": {
"@daybrush/utils": "^1.12.1",
"@daybrush/utils": "^1.13.0",
"framework-utils": "^1.1.0",
"moveable": "~0.47.9"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/moveable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@
"declaration/*"
],
"dependencies": {
"@daybrush/utils": "^1.13.0",
"@scena/event-emitter": "^1.0.5",
"croact": "^1.0.3",
"croact": "^1.0.4",
"croact-moveable": "~0.3.8",
"react-moveable": "~0.50.7"
},
Expand Down
6 changes: 4 additions & 2 deletions packages/moveable/src/MoveableManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
MoveableInterface,
MoveableOptions, MoveableProperties,
} from "react-moveable/types";
import { camelize, isArray } from "@daybrush/utils";
import { camelize, getDocument, isArray } from "@daybrush/utils";
import { MoveableEventsParameters } from "./types";
import { PROPERTIES, EVENTS, METHODS } from "./consts";
import EventEmitter from "@scena/event-emitter";
Expand Down Expand Up @@ -67,7 +67,7 @@ class MoveableManager extends EventEmitter<MoveableEventsParameters> {
this._warp = true;
selfElement = parentElement;
} else {
selfElement = document.createElement("div");
selfElement = getDocument(parentElement).createElement("div");
parentElement.appendChild(selfElement);
}
this.containerProvider = renderSelf(
Expand All @@ -78,6 +78,8 @@ class MoveableManager extends EventEmitter<MoveableEventsParameters> {
/> as any,
selfElement,
);

this.selfElement = selfElement;
const target = nextOptions.target!;
if (isArray(target) && target.length > 1) {
this.updateRect();
Expand Down
Loading

0 comments on commit 3e87cc7

Please sign in to comment.