Skip to content

Commit eae6f37

Browse files
committed
feat: add borders to pad.ws elements to enhance ergonomy
1 parent f06a11d commit eae6f37

File tree

5 files changed

+67
-39
lines changed

5 files changed

+67
-39
lines changed

src/frontend/index.scss

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ body {
3939
display: none !important;
4040
}
4141

42-
.excalidraw__embeddable__outer {
43-
padding: 0px !important;
44-
pointer-events: all !important;
45-
}
46-
4742
.excalidraw .layer-ui__wrapper__top-right {
4843
gap: 0rem;
4944
}
@@ -67,4 +62,20 @@ body {
6762

6863
.excalidraw .Modal__content {
6964
animation: Modal__content_fade-in 0.3s ease-out forwards !important;
70-
}
65+
}
66+
67+
/* Embeddables */
68+
69+
.excalidraw__embeddable-container { /* 1st layer */
70+
display: block;
71+
}
72+
73+
.excalidraw__embeddable-container__inner { /* 2nd layer */
74+
border-color: #525252 !important;
75+
}
76+
77+
.excalidraw__embeddable__outer { /* 3rd layer */
78+
padding: 0px !important;
79+
pointer-events: all !important;
80+
display: flex;
81+
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.custom-rendered-embeddable {
22
height: 100%;
33
width: 100%;
4-
position: absolute;
5-
z-index: 1;
4+
display: flex;
5+
border-radius: 0px !important;
6+
border: 0px !important;
67
}

src/frontend/src/CustomEmbeddableRenderer.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,37 @@ export const renderCustomEmbeddable = (
1919

2020
if (element.link && element.link.startsWith('!')) {
2121
let path = element.link.split('!')[1];
22+
let content;
2223

2324
switch (path) {
2425
case 'html':
25-
return <HtmlEditor element={element} appState={appState} excalidrawAPI={excalidrawAPI} />;
26+
content = <HtmlEditor element={element} appState={appState} excalidrawAPI={excalidrawAPI} />;
27+
break;
2628
case 'editor':
27-
return <Editor element={element} appState={appState} excalidrawAPI={excalidrawAPI} />;
29+
content = <Editor element={element} appState={appState} excalidrawAPI={excalidrawAPI} />;
30+
break;
2831
case 'state':
29-
return <StateIndicator />;
32+
content = <StateIndicator />;
33+
break;
3034
case 'control':
31-
return <ControlButton />;
35+
content = <ControlButton />;
36+
break;
3237
case 'button':
33-
return <ActionButton
38+
content = <ActionButton
3439
target="code"
3540
element={element}
3641
excalidrawAPI={excalidrawAPI}
3742
settingsEnabled={true}
3843
/>;
44+
break;
3945
case 'dashboard':
40-
return <Dashboard element={element} appState={appState} excalidrawAPI={excalidrawAPI} />;
46+
content = <Dashboard element={element} appState={appState} excalidrawAPI={excalidrawAPI} />;
47+
break;
4148
default:
4249
return null;
4350
}
51+
52+
return <div className="custom-rendered-embeddable">{content}</div>;
4453
} else {
4554
return <iframe className="custom-rendered-embeddable" src={element.link} />;
4655
}

src/frontend/src/utils/canvasUtils.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ export function normalizeCanvasData(data: any) {
2020
if ("height" in appState) {
2121
delete appState.height;
2222
}
23+
24+
appState.pad = {
25+
moduleBorderOffset: {
26+
left: 10,
27+
right: 10,
28+
top: 30,
29+
bottom: 10,
30+
},
31+
};
2332

2433
// Reset collaborators (https://github.com/excalidraw/excalidraw/issues/8637)
2534
appState.collaborators = new Map();

src/frontend/yarn.lock

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
# yarn lockfile v1
33

44

5-
"@atyrode/excalidraw@^0.18.0-2":
5+
"@atyrode/excalidraw@file:../../../excalipad/packages/excalidraw":
66
version "0.18.0-2"
7-
resolved "https://registry.yarnpkg.com/@atyrode/excalidraw/-/excalidraw-0.18.0-2.tgz#66be05d5b8a2458dd65fb58baa104fd803a41c5d"
8-
integrity sha512-z3scC5BzVnu8ddS1TJTNxX+wPa3bj72j9RVleSV7iDZsClLDqgcrW+Z/cVHEphWpvBKlMzRo31vDdg+dqE6dDg==
97
dependencies:
108
"@braintree/sanitize-url" "6.0.2"
119
"@excalidraw/laser-pointer" "1.3.1"
@@ -537,29 +535,29 @@
537535
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.0.tgz#fd92d31a2931483c25677b9c6698106490cbbc76"
538536
integrity sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ==
539537

540-
"@tanstack/[email protected].4":
541-
version "5.74.4"
542-
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.74.4.tgz#08c4f88f336738d822d9242c5e7d2be50f5c25b3"
543-
integrity sha512-YuG0A0+3i9b2Gfo9fkmNnkUWh5+5cFhWBN0pJAHkHilTx6A0nv8kepkk4T4GRt4e5ahbtFj2eTtkiPcVU1xO4A==
538+
"@tanstack/[email protected].7":
539+
version "5.74.7"
540+
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.74.7.tgz#beb565a5f3d95a1e3bd756e5eb1e41c3eb48ae7f"
541+
integrity sha512-X3StkN/Y6KGHndTjJf8H8th7AX4bKfbRpiVhVqevf0QWlxl6DhyJ0TYG3R0LARa/+xqDwzU9mA4pbJxzPCI29A==
544542

545-
"@tanstack/[email protected].6":
546-
version "5.74.6"
547-
resolved "https://registry.yarnpkg.com/@tanstack/query-devtools/-/query-devtools-5.74.6.tgz#88a29fac2ba3db6c9bda8f40808f808d7a88df0b"
548-
integrity sha512-djaFT11mVCOW3e0Ezfyiq7T6OoHy2LRI1fUFQvj+G6+/4A1FkuRMNUhQkdP1GXlx8id0f1/zd5fgDpIy5SU/Iw==
543+
"@tanstack/[email protected].7":
544+
version "5.74.7"
545+
resolved "https://registry.yarnpkg.com/@tanstack/query-devtools/-/query-devtools-5.74.7.tgz#c9b022b386ac86e6395228b5d6912e6444b3b971"
546+
integrity sha512-nSNlfuGdnHf4yB0S+BoNYOE1o3oAH093weAYZolIHfS2stulyA/gWfSk/9H4ZFk5mAAHb5vNqAeJOmbdcGPEQw==
549547

550548
"@tanstack/react-query-devtools@^5.74.3":
551-
version "5.74.6"
552-
resolved "https://registry.yarnpkg.com/@tanstack/react-query-devtools/-/react-query-devtools-5.74.6.tgz#169a3e2beab0c87ce3ebbda909bbd2c6590239f8"
553-
integrity sha512-vlsDwz4/FsblK0h7VAlXUdJ+9OV+i1n8OLb8CLLAZqu0M9GCnbajytZwsRmns33PXBZ6wQBJ859kg6aajx+e9Q==
549+
version "5.74.7"
550+
resolved "https://registry.yarnpkg.com/@tanstack/react-query-devtools/-/react-query-devtools-5.74.7.tgz#97fd56ae76996467d544b546a1bd38aab4a94d1e"
551+
integrity sha512-j60esTQF+ES0x52kQUYOX0Z8AJUcqCGANj6GaOf8J3YQz2bZPB1imLSw4SFeM3Ozv8uO/X/Dmh3IT1z+y57ZLQ==
554552
dependencies:
555-
"@tanstack/query-devtools" "5.74.6"
553+
"@tanstack/query-devtools" "5.74.7"
556554

557555
"@tanstack/react-query@^5.74.3":
558-
version "5.74.4"
559-
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.74.4.tgz#d73ee1899c08a227519cbf53b9a0e0b1e67cd3fe"
560-
integrity sha512-mAbxw60d4ffQ4qmRYfkO1xzRBPUEf/72Dgo3qqea0J66nIKuDTLEqQt0ku++SDFlMGMnB6uKDnEG1xD/TDse4Q==
556+
version "5.74.7"
557+
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.74.7.tgz#3507541b43de72399a19a71ff66828a12b859581"
558+
integrity sha512-u4o/RIWnnrq26orGZu2NDPwmVof1vtAiiV6KYUXd49GuK+8HX+gyxoAYqIaZogvCE1cqOuZAhQKcrKGYGkrLxg==
561559
dependencies:
562-
"@tanstack/query-core" "5.74.4"
560+
"@tanstack/query-core" "5.74.7"
563561

564562
"@types/d3-scale-chromatic@^3.0.0":
565563
version "3.1.0"
@@ -603,9 +601,9 @@
603601
integrity sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==
604602

605603
"@types/node@^22.14.0":
606-
version "22.15.1"
607-
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.1.tgz#4cd2c8717a61ae2979c6a0624b4d1b67415bf2c0"
608-
integrity sha512-gSZyd0Qmv7qvbd2fJ9HGdYmv1yhNdelIA4YOtN6vkcmSwFhthxSEsBgU/JYZcXjWT6DFzoATcHrc52Ckh8SeRA==
604+
version "22.15.2"
605+
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.2.tgz#1db55aa64618ee93a58c8912f74beefe44aca905"
606+
integrity sha512-uKXqKN9beGoMdBfcaTY1ecwz6ctxuJAcUlwE55938g0ZJ8lRxwAZqRz2AJ4pzpt5dHdTPMB863UZ0ESiFUcP7A==
609607
dependencies:
610608
undici-types "~6.21.0"
611609

@@ -1646,9 +1644,9 @@ postcss@^8.4.36:
16461644
source-map-js "^1.2.1"
16471645

16481646
posthog-js@^1.236.0:
1649-
version "1.236.6"
1650-
resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.236.6.tgz#f4d73d25773f4e4bafd7632717c97b27bd9f1b7c"
1651-
integrity sha512-IX4fkn3HCK+ObdHr/AuWd+Ks7bgMpRpOQB93b5rDJAWkG4if4xFVUn5pgEjyCNeOO2GM1ECnp08q9tYNYEfwbA==
1647+
version "1.236.7"
1648+
resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.236.7.tgz#6a071905d4466573b80fd52bad1d3478594805b7"
1649+
integrity sha512-HatTinqAt/6aAraCgbnP+2MTeVTChdf6TDsQkef4/yUnXeA4tsHmXnGGJ3vnzQk7N//R6lIHN189BZDO9kuKAg==
16521650
dependencies:
16531651
core-js "^3.38.1"
16541652
fflate "^0.4.8"

0 commit comments

Comments
 (0)