@telepath-computer/television 0.1.116 → 0.1.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canonical/v1/components.js +157 -0
- package/dist/canonical/v1/styles.css +46 -521
- package/dist/cli.cjs +5677 -709
- package/dist/skills/television/SKILL.md +73 -55
- package/dist/web/assets/index-B8wrBJd5.css +1 -0
- package/dist/web/assets/index-CMNMkOMk.js +708 -0
- package/dist/web/index.html +2 -2
- package/package.json +3 -2
- package/dist/web/assets/index-CCUH0MOZ.css +0 -1
- package/dist/web/assets/index-DSFrQJVS.js +0 -606
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Artifact-safe custom elements bundled for /canonical/v1/components.js.
|
|
2
|
+
// Keep this entrypoint small: artifacts import it in sandboxed iframes.
|
|
3
|
+
const CHECK_ICON = `
|
|
4
|
+
<svg viewBox="0 0 12 12" aria-hidden="true" focusable="false">
|
|
5
|
+
<path d="M10.2 3.1 5.1 8.2 2.4 5.5" />
|
|
6
|
+
</svg>
|
|
7
|
+
`;
|
|
8
|
+
const LIST_STYLES = `
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
margin: var(--checkbox-list-margin, var(--space-12) 0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[part~="list"] {
|
|
15
|
+
display: grid;
|
|
16
|
+
gap: var(--checkbox-list-gap, var(--space-6));
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
const ITEM_STYLES = `
|
|
20
|
+
:host {
|
|
21
|
+
display: block;
|
|
22
|
+
--checkbox-size: 1em;
|
|
23
|
+
--checkbox-gap: var(--space-8);
|
|
24
|
+
--checkbox-color: var(--color-primary);
|
|
25
|
+
--checkbox-border-color: var(--color-border);
|
|
26
|
+
--checkbox-bg: transparent;
|
|
27
|
+
--checkbox-check-color: var(--color-bg);
|
|
28
|
+
--checkbox-checked-content-color: var(--color-text-muted);
|
|
29
|
+
--checkbox-checked-decoration: line-through;
|
|
30
|
+
--checkbox-checked-decoration-thickness: 0.08em;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[part~="label"] {
|
|
34
|
+
display: grid;
|
|
35
|
+
grid-template-columns: var(--checkbox-size) minmax(0, 1fr);
|
|
36
|
+
gap: var(--checkbox-gap);
|
|
37
|
+
align-items: baseline;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
input {
|
|
41
|
+
position: absolute;
|
|
42
|
+
opacity: 0;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
width: 1px;
|
|
45
|
+
height: 1px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[part~="box"] {
|
|
49
|
+
display: inline-grid;
|
|
50
|
+
place-items: center;
|
|
51
|
+
width: var(--checkbox-size);
|
|
52
|
+
height: var(--checkbox-size);
|
|
53
|
+
border: 1px solid var(--checkbox-border-color);
|
|
54
|
+
border-radius: var(--checkbox-radius, var(--radius-4));
|
|
55
|
+
background: var(--checkbox-bg);
|
|
56
|
+
color: var(--checkbox-check-color);
|
|
57
|
+
transform: translateY(0.12em);
|
|
58
|
+
cursor: not-allowed;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[part~="check"] {
|
|
62
|
+
display: block;
|
|
63
|
+
width: calc(var(--checkbox-size) * 0.72);
|
|
64
|
+
height: calc(var(--checkbox-size) * 0.72);
|
|
65
|
+
opacity: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[part~="check"] svg {
|
|
69
|
+
display: block;
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[part~="check"] path {
|
|
75
|
+
fill: none;
|
|
76
|
+
stroke: currentColor;
|
|
77
|
+
stroke-width: 2;
|
|
78
|
+
stroke-linecap: round;
|
|
79
|
+
stroke-linejoin: round;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[part~="content"] {
|
|
83
|
+
min-width: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([checked]) [part~="box"] {
|
|
87
|
+
border-color: var(--checkbox-color);
|
|
88
|
+
background: var(--checkbox-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host([checked]) [part~="check"] {
|
|
92
|
+
opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host([checked]) [part~="content"] {
|
|
96
|
+
color: var(--checkbox-checked-content-color);
|
|
97
|
+
text-decoration-line: var(--checkbox-checked-decoration);
|
|
98
|
+
text-decoration-thickness: var(--checkbox-checked-decoration-thickness);
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
export class CheckboxListElement extends HTMLElement {
|
|
102
|
+
#root;
|
|
103
|
+
constructor() {
|
|
104
|
+
super();
|
|
105
|
+
this.#root = this.attachShadow({ mode: "open" });
|
|
106
|
+
this.#root.innerHTML = `<style>${LIST_STYLES}</style><div part="list"><slot></slot></div>`;
|
|
107
|
+
}
|
|
108
|
+
connectedCallback() {
|
|
109
|
+
if (!this.hasAttribute("role")) {
|
|
110
|
+
this.setAttribute("role", "list");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export class CheckboxItemElement extends HTMLElement {
|
|
115
|
+
static observedAttributes = ["checked"];
|
|
116
|
+
#root;
|
|
117
|
+
#input;
|
|
118
|
+
constructor() {
|
|
119
|
+
super();
|
|
120
|
+
this.#root = this.attachShadow({ mode: "open" });
|
|
121
|
+
this.#root.innerHTML = `
|
|
122
|
+
<style>${ITEM_STYLES}</style>
|
|
123
|
+
<label part="label">
|
|
124
|
+
<input type="checkbox" disabled tabindex="-1">
|
|
125
|
+
<span part="box"><span part="check">${CHECK_ICON}</span></span>
|
|
126
|
+
<span part="content"><slot></slot></span>
|
|
127
|
+
</label>
|
|
128
|
+
`;
|
|
129
|
+
const input = this.#root.querySelector("input");
|
|
130
|
+
if (!(input instanceof HTMLInputElement)) {
|
|
131
|
+
throw new Error("checkbox-item failed to initialize input");
|
|
132
|
+
}
|
|
133
|
+
this.#input = input;
|
|
134
|
+
}
|
|
135
|
+
connectedCallback() {
|
|
136
|
+
if (!this.hasAttribute("role")) {
|
|
137
|
+
this.setAttribute("role", "listitem");
|
|
138
|
+
}
|
|
139
|
+
this.setAttribute("aria-disabled", "true");
|
|
140
|
+
this.#syncChecked();
|
|
141
|
+
}
|
|
142
|
+
attributeChangedCallback() {
|
|
143
|
+
this.#syncChecked();
|
|
144
|
+
}
|
|
145
|
+
#syncChecked() {
|
|
146
|
+
const checked = this.hasAttribute("checked");
|
|
147
|
+
this.#input.checked = checked;
|
|
148
|
+
this.setAttribute("aria-checked", checked ? "true" : "false");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (!customElements.get("checkbox-list")) {
|
|
152
|
+
customElements.define("checkbox-list", CheckboxListElement);
|
|
153
|
+
}
|
|
154
|
+
if (!customElements.get("checkbox-item")) {
|
|
155
|
+
customElements.define("checkbox-item", CheckboxItemElement);
|
|
156
|
+
}
|
|
157
|
+
|