Skip to content

Commit 4da22be

Browse files
authored
feat: remove old resizing mechanism (#49)
* fix: update yarn version
1 parent da7cedb commit 4da22be

File tree

7 files changed

+301
-340
lines changed

7 files changed

+301
-340
lines changed

.github/workflows/release-please.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"docs","section":"Documentation","hidden":false},{"type":"test","section":"Tests","hidden":false}]'
1717

1818
- uses: actions/checkout@v3
19+
with:
20+
ref: main
1921

2022
- name: Tag major and minor versions
2123
uses: jacobsvante/[email protected]
Lines changed: 280 additions & 274 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ plugins:
44
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
55
spec: '@yarnpkg/plugin-interactive-tools'
66

7-
yarnPath: .yarn/releases/yarn-3.2.4.cjs
7+
yarnPath: .yarn/releases/yarn-3.3.0.cjs

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@graasp/apps-query-client": "github:graasp/graasp-apps-query-client#v0",
2323
"@graasp/pyodide": "github:spaenleh/graasp-pyodide",
2424
"@graasp/sdk": "github:graasp/graasp-sdk",
25-
"@graasp/ui": "github:graasp/graasp-ui",
25+
"@graasp/ui": "0.4.1",
2626
"@mui/icons-material": "5.10.14",
2727
"@mui/lab": "5.0.0-alpha.84",
2828
"@mui/material": "5.10.14",
@@ -148,5 +148,5 @@
148148
"resolutions": {
149149
"@codemirror/state": "6.1.0"
150150
},
151-
"packageManager": "yarn@3.2.4"
151+
"packageManager": "yarn@3.3.0"
152152
}

public/index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929
Learn how to configure a non-root public URL by running `npm run build`.
3030
-->
3131
<title>Code Capsule App</title>
32-
<script>
33-
document.domain = '%REACT_APP_GRAASP_DOMAIN%';
34-
if (window.frameElement) {
35-
window.frameElement.style['min-height'] = '70vh';
36-
}
37-
</script>
3832
</head>
3933
<body>
4034
<noscript>You need to enable JavaScript to run this app.</noscript>

src/components/diffView/DiffView.tsx

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { FC, useEffect, useRef, useState } from 'react';
1+
import { FC } from 'react';
22
import ReactDiffViewer from 'react-diff-viewer';
33

4-
import { useLocalContext } from '@graasp/apps-query-client';
5-
64
import { Stack } from '@mui/material';
75

86
import { DIFF_VIEW_SETTINGS_NAME } from '../../config/appSettingsTypes';
@@ -11,52 +9,13 @@ import { DEFAULT_DIFF_VIEW_SETTINGS } from '../../config/settings';
119
import { DiffViewSettingsKeys } from '../../interfaces/settings';
1210
import { useSettings } from '../context/SettingsContext';
1311

14-
const ADAPT_HEIGHT_TIMEOUT = 50;
15-
1612
const DiffView: FC = () => {
1713
const {
1814
[DIFF_VIEW_SETTINGS_NAME]: diffViewSettings = DEFAULT_DIFF_VIEW_SETTINGS,
1915
} = useSettings();
20-
const context = useLocalContext();
21-
const rootRef = useRef();
22-
const [height, setHeight] = useState(0);
23-
24-
const adaptHeight = (): void => {
25-
// set timeout to leave time for the height to be set
26-
setTimeout(() => {
27-
// adapt height when not in standalone (so when in an iframe)
28-
if (!context?.get('standalone')) {
29-
// get height from the root element and add a small margin
30-
// @ts-ignore
31-
const clientRect = rootRef?.current?.getBoundingClientRect();
32-
if (window.frameElement && clientRect) {
33-
const newHeight = clientRect.height;
34-
if (height !== newHeight) {
35-
setHeight(newHeight);
36-
// @ts-ignore
37-
window.frameElement.style['min-height'] = `${newHeight}px`;
38-
// @ts-ignore
39-
window.frameElement.style.overflowY = 'hidden';
40-
// @ts-ignore
41-
window.frameElement.scrolling = 'no';
42-
// @ts-ignore
43-
window.frameElement.style.height = `${newHeight}px`;
44-
}
45-
}
46-
}
47-
}, ADAPT_HEIGHT_TIMEOUT);
48-
};
49-
50-
useEffect(
51-
() => {
52-
adaptHeight();
53-
},
54-
// eslint-disable-next-line react-hooks/exhaustive-deps
55-
[],
56-
);
5716

5817
return (
59-
<Stack data-cy={DIFF_VIEW_CONTAINER_CY} direction="column" ref={rootRef}>
18+
<Stack data-cy={DIFF_VIEW_CONTAINER_CY} direction="column">
6019
<ReactDiffViewer
6120
linesOffset={diffViewSettings[DiffViewSettingsKeys.LinesOffset]}
6221
oldValue={diffViewSettings[DiffViewSettingsKeys.OldCode]}

yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,7 +2634,7 @@ __metadata:
26342634
languageName: node
26352635
linkType: hard
26362636

2637-
"@graasp/sdk@github:graasp/graasp-sdk, @graasp/sdk@github:graasp/graasp-sdk.git":
2637+
"@graasp/sdk@github:graasp/graasp-sdk":
26382638
version: 0.1.0
26392639
resolution: "@graasp/sdk@https://github.com/graasp/graasp-sdk.git#commit=55a43441b82e4601a67c56e34648851f96a25408"
26402640
dependencies:
@@ -2651,11 +2651,11 @@ __metadata:
26512651
languageName: node
26522652
linkType: hard
26532653

2654-
"@graasp/ui@github:graasp/graasp-ui":
2655-
version: 0.4.0
2656-
resolution: "@graasp/ui@https://github.com/graasp/graasp-ui.git#commit=dea454d93ab4605a77265e184e98c4be3a4718a4"
2654+
"@graasp/ui@npm:0.4.1":
2655+
version: 0.4.1
2656+
resolution: "@graasp/ui@npm:0.4.1"
26572657
dependencies:
2658-
"@graasp/sdk": "github:graasp/graasp-sdk.git"
2658+
"@graasp/sdk": "github:graasp/graasp-sdk"
26592659
clsx: 1.1.1
26602660
http-status-codes: 2.2.0
26612661
immutable: 4.1.0
@@ -2686,7 +2686,7 @@ __metadata:
26862686
optional: true
26872687
ag-grid-react:
26882688
optional: true
2689-
checksum: 88d3b7832e174a4534df35400dd99eaaceea62a53ecccb4c81885a892ec4c6b648f80db373468b3dc8bef5b52cbec57200a06a2ec5beb94028699f31e4f8579a
2689+
checksum: de06a91b5febe13cf9aa4142242b6e44ec203706230eb8aff32bedec97b72070d7b34c03b0450080112169dc590be1cea3d48c731a232e7cc58121e61aba7909
26902690
languageName: node
26912691
linkType: hard
26922692

@@ -9958,7 +9958,7 @@ __metadata:
99589958

99599959
"fsevents@patch:fsevents@^2.3.2#~builtin<compat/fsevents>, fsevents@patch:fsevents@~2.3.2#~builtin<compat/fsevents>":
99609960
version: 2.3.2
9961-
resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=18f3a7"
9961+
resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=df0bf1"
99629962
dependencies:
99639963
node-gyp: latest
99649964
conditions: os=darwin
@@ -10364,7 +10364,7 @@ __metadata:
1036410364
"@graasp/apps-query-client": "github:graasp/graasp-apps-query-client#v0"
1036510365
"@graasp/pyodide": "github:spaenleh/graasp-pyodide"
1036610366
"@graasp/sdk": "github:graasp/graasp-sdk"
10367-
"@graasp/ui": "github:graasp/graasp-ui"
10367+
"@graasp/ui": 0.4.1
1036810368
"@mui/icons-material": 5.10.14
1036910369
"@mui/lab": 5.0.0-alpha.84
1037010370
"@mui/material": 5.10.14
@@ -16961,7 +16961,7 @@ __metadata:
1696116961

1696216962
"resolve@patch:resolve@^1.1.7#~builtin<compat/resolve>, resolve@patch:resolve@^1.10.0#~builtin<compat/resolve>, resolve@patch:resolve@^1.12.0#~builtin<compat/resolve>, resolve@patch:resolve@^1.14.2#~builtin<compat/resolve>, resolve@patch:resolve@^1.19.0#~builtin<compat/resolve>, resolve@patch:resolve@^1.20.0#~builtin<compat/resolve>, resolve@patch:resolve@^1.22.0#~builtin<compat/resolve>, resolve@patch:resolve@^1.22.1#~builtin<compat/resolve>":
1696316963
version: 1.22.1
16964-
resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin<compat/resolve>::version=1.22.1&hash=07638b"
16964+
resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin<compat/resolve>::version=1.22.1&hash=c3c19d"
1696516965
dependencies:
1696616966
is-core-module: ^2.9.0
1696716967
path-parse: ^1.0.7
@@ -16974,7 +16974,7 @@ __metadata:
1697416974

1697516975
"resolve@patch:resolve@^2.0.0-next.3#~builtin<compat/resolve>":
1697616976
version: 2.0.0-next.4
16977-
resolution: "resolve@patch:resolve@npm%3A2.0.0-next.4#~builtin<compat/resolve>::version=2.0.0-next.4&hash=07638b"
16977+
resolution: "resolve@patch:resolve@npm%3A2.0.0-next.4#~builtin<compat/resolve>::version=2.0.0-next.4&hash=c3c19d"
1697816978
dependencies:
1697916979
is-core-module: ^2.9.0
1698016980
path-parse: ^1.0.7
@@ -18829,7 +18829,7 @@ __metadata:
1882918829

1883018830
"typescript@patch:[email protected]#~builtin<compat/typescript>":
1883118831
version: 4.7.4
18832-
resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin<compat/typescript>::version=4.7.4&hash=701156"
18832+
resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin<compat/typescript>::version=4.7.4&hash=65a307"
1883318833
bin:
1883418834
tsc: bin/tsc
1883518835
tsserver: bin/tsserver
@@ -18839,17 +18839,17 @@ __metadata:
1883918839

1884018840
"typescript@patch:[email protected]#~builtin<compat/typescript>":
1884118841
version: 4.9.3
18842-
resolution: "typescript@patch:typescript@npm%3A4.9.3#~builtin<compat/typescript>::version=4.9.3&hash=701156"
18842+
resolution: "typescript@patch:typescript@npm%3A4.9.3#~builtin<compat/typescript>::version=4.9.3&hash=d73830"
1884318843
bin:
1884418844
tsc: bin/tsc
1884518845
tsserver: bin/tsserver
18846-
checksum: ef65c22622d864497d0a0c5db693523329b3284c15fe632e93ad9aa059e8dc38ef3bd767d6f26b1e5ecf9446f49bd0f6c4e5714a2eeaf352805dc002479843d1
18846+
checksum: 67ca21a387c0572f1c04936e638dde7782c5aa520c3754aadc7cc9b7c915da9ebc3e27c601bfff4ccb7d7264e82dce6d277ada82ec09dc75024349e0ef64926d
1884718847
languageName: node
1884818848
linkType: hard
1884918849

1885018850
"typescript@patch:typescript@^4.6.4#~builtin<compat/typescript>":
1885118851
version: 4.8.4
18852-
resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin<compat/typescript>::version=4.8.4&hash=701156"
18852+
resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin<compat/typescript>::version=4.8.4&hash=0102e9"
1885318853
bin:
1885418854
tsc: bin/tsc
1885518855
tsserver: bin/tsserver

0 commit comments

Comments
 (0)