Skip to content

Commit d887a71

Browse files
authored
Merge branch 'main' into ellyse/ct-580-gmail-and-rss-importers-have-failures-unit-test
2 parents c266ae5 + c090045 commit d887a71

File tree

24 files changed

+1690
-226
lines changed

24 files changed

+1690
-226
lines changed

deno.lock

Lines changed: 126 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/charm/src/manager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,9 @@ export class CharmManager {
10281028
targetInputCell = targetInputCell.key(segment);
10291029
}
10301030

1031-
targetInputCell.key(targetKey).set(sourceResultCell);
1032-
1031+
const tx = this.runtime.edit();
1032+
targetInputCell.key(targetKey).withTx(tx).set(sourceResultCell);
1033+
await tx.commit();
10331034
await this.runtime.idle();
10341035
await this.synced();
10351036
}

packages/shell/public/styles/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/* CSS Custom Properties */
2626
:root {
2727
--font-primary: "JetBrainsMono", monospace;
28+
--font-color: #000;
2829
--bg-primary: #f3f3f3;
2930
--bg-secondary: #f9fafb;
3031
--border-color: #000;
@@ -66,6 +67,7 @@ body {
6667
transparent var(--dot-size)
6768
);
6869
background-size: var(--dot-spacing) var(--dot-spacing);
70+
color: var(--font-color);
6971
}
7072

7173
/* Responsive padding */

packages/shell/src/components/Body.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ export class XBodyElement extends BaseView {
77
static override styles = css`
88
:host {
99
display: block;
10-
width: 100%;
11-
height: 100%;
12-
background-color: white;
1310
padding: 1rem;
11+
overflow: hidden;
1412
}
1513
`;
1614

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { css, html, LitElement } from "lit";
2+
import { property } from "lit/decorators.js";
3+
4+
type ButtonSize = "small" | "medium" | "large";
5+
type ButtonType = "text" | "submit" | "number";
6+
type VariantType = "none" | "primary";
7+
8+
export class XButtonElement extends LitElement {
9+
static override styles = css`
10+
:host {
11+
display: block;
12+
}
13+
14+
button {
15+
width: 100%;
16+
padding: 0.75rem 1rem;
17+
font-family: var(--font-primary);
18+
background-color: white;
19+
border: var(--border-width, 2px) solid var(--border-color, #000);
20+
cursor: pointer;
21+
transition: all 0.1s ease-in-out;
22+
}
23+
24+
button:hover:not(:disabled) {
25+
transform: translateY(-2px);
26+
box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 0.5);
27+
}
28+
29+
button:disabled {
30+
opacity: 0.5;
31+
cursor: not-allowed;
32+
}
33+
34+
button[x-variant="primary"] {
35+
background-color: black;
36+
color: white;
37+
}
38+
39+
button[x-variant="primary"]:hover:not(:disabled) {
40+
background-color: #333;
41+
}
42+
43+
button[x-size="small"] {
44+
padding: 0.5rem 0.5rem;
45+
}
46+
`;
47+
@property()
48+
size: ButtonSize = "medium";
49+
50+
@property()
51+
type: ButtonType = "text";
52+
53+
@property({ attribute: true })
54+
disabled = false;
55+
56+
@property({ attribute: true })
57+
variant: VariantType = "none";
58+
59+
private onClick(e: Event) {
60+
// If this is a "submit" button, then we need
61+
// to handle execution as the shadow DOM prevents
62+
// default mapping of the button to a parent form.
63+
// https://www.hjorthhansen.dev/shadow-dom-and-forms/
64+
//
65+
// Probably should also handle keyboard events
66+
// that can submit forms.
67+
if (this.type === "submit") {
68+
const form = this.closest("form");
69+
if (!form) return;
70+
e.preventDefault();
71+
const pseudo = document.createElement("button");
72+
pseudo.type = "submit";
73+
pseudo.style.display = "none";
74+
form.appendChild(pseudo);
75+
pseudo.click();
76+
pseudo.remove();
77+
}
78+
}
79+
80+
override render() {
81+
return html`
82+
<button
83+
@click="${this.onClick}"
84+
type="${this.type}"
85+
?disabled="${this.disabled}"
86+
x-variant="${this.variant}"
87+
x-size="${this.size}"
88+
>
89+
<slot></slot>
90+
</button>
91+
`;
92+
}
93+
}
94+
95+
globalThis.customElements.define("x-button", XButtonElement);

packages/shell/src/components/CTLogo.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { css, html, LitElement, svg } from "lit";
1+
import { css, html, LitElement } from "lit";
22
import { property } from "lit/decorators.js";
33

44
export class CTLogo extends LitElement {
@@ -13,29 +13,18 @@ export class CTLogo extends LitElement {
1313
}
1414
`;
1515

16-
@property({ type: Number })
16+
@property()
1717
width = 32;
1818

19-
@property({ type: Number })
19+
@property()
2020
height = 32;
2121

22-
@property({ type: String, attribute: "background-color" })
22+
@property({ attribute: "background-color" })
2323
backgroundColor = "white";
2424

25-
@property({ type: String, attribute: "shape-color" })
25+
@property({ attribute: "shape-color" })
2626
shapeColor = "black";
2727

28-
override attributeChangedCallback(
29-
name: string,
30-
old: string | null,
31-
value: string | null,
32-
) {
33-
super.attributeChangedCallback(name, old, value);
34-
if (old !== value) {
35-
this.requestUpdate();
36-
}
37-
}
38-
3928
override render() {
4029
return html`
4130
<svg

0 commit comments

Comments
 (0)