@pictogrammers/components 0.4.7 → 0.4.9
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/index.html +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/pg/app/app.css +1 -1
- package/pg/app/app.ts +8 -2
- package/pg/inputPixelEditor/inputPixelEditor.ts +3 -2
- package/pg/inputPixelEditor/utils/getEllipsePixels.ts +131 -19
- package/pg/modal/README.md +29 -0
- package/pg/modal/__examples__/basic/basic.html +4 -0
- package/pg/modal/__examples__/basic/basic.ts +42 -0
- package/pg/modal/index.ts +3 -0
- package/pg/modal/modal.css +40 -0
- package/pg/modal/modal.html +9 -0
- package/pg/modal/modal.ts +14 -0
- package/pg/tree/README.md +10 -1
- package/pg/tree/__examples__/basic/basic.html +1 -0
- package/pg/tree/__examples__/basic/basic.ts +6 -0
- package/pg/tree/tree.css +1 -0
- package/pgAnnoy.js +1 -1
- package/pgApp.js +1 -1
- package/pgAvatar.js +1 -1
- package/pgButton.js +1 -1
- package/pgButtonGroup.js +1 -1
- package/pgButtonLink.js +1 -1
- package/pgButtonMenu.js +1 -1
- package/pgButtonToggle.js +1 -1
- package/pgCard.js +1 -1
- package/pgCardUser.js +1 -1
- package/pgColor.js +1 -1
- package/pgDatabase.js +1 -1
- package/pgDropdown.js +1 -1
- package/pgGrid.js +1 -1
- package/pgHeader.js +1 -1
- package/pgIcon.js +1 -1
- package/pgInputCheck.js +1 -1
- package/pgInputCheckList.js +1 -1
- package/pgInputFileLocal.js +1 -1
- package/pgInputHexRgb.js +1 -1
- package/pgInputPixelEditor.js +1 -1
- package/pgInputRange.js +1 -1
- package/pgInputSelect.js +1 -1
- package/pgInputText.js +1 -1
- package/pgInputTextIcon.js +1 -1
- package/pgInputUserSelect.js +1 -1
- package/pgListTag.js +1 -1
- package/pgMarkdown.js +1 -1
- package/pgMenu.js +1 -1
- package/pgMenuDivider.js +1 -1
- package/pgMenuIcon.js +1 -1
- package/pgMenuItem.js +1 -1
- package/pgMenuItemIcon.js +1 -1
- package/pgModal.js +1 -0
- package/pgModalAlert.js +1 -1
- package/pgModification.js +1 -1
- package/pgNav.js +1 -1
- package/pgOverlay.js +1 -1
- package/pgOverlayContextMenu.js +1 -1
- package/pgOverlayMenu.js +1 -1
- package/pgOverlaySelectMenu.js +1 -1
- package/pgOverlaySubMenu.js +1 -1
- package/pgPicker.js +1 -1
- package/pgPreview.js +1 -1
- package/pgScroll.js +1 -1
- package/pgSearch.js +1 -1
- package/pgTab.js +1 -1
- package/pgTabs.js +1 -1
- package/pgToast.js +1 -1
- package/pgToasts.js +1 -1
- package/pgTooltip.js +1 -1
- package/pgTree.js +1 -1
- package/pgTreeButtonIcon.js +1 -1
- package/pgTreeItem.js +1 -1
package/package.json
CHANGED
package/pg/app/app.css
CHANGED
package/pg/app/app.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Part, Prop } from '@pictogrammers/element';
|
|
1
|
+
import { Component, Part, Prop, Local } from '@pictogrammers/element';
|
|
2
2
|
|
|
3
3
|
import template from './app.html';
|
|
4
4
|
import style from './app.css';
|
|
@@ -14,9 +14,14 @@ export default class PgApp extends HTMLElement {
|
|
|
14
14
|
@Part() $side: HTMLDivElement;
|
|
15
15
|
@Part() $resize: HTMLButtonElement;
|
|
16
16
|
|
|
17
|
+
@Local('app') store = new Map([
|
|
18
|
+
['width', 12 * 16]
|
|
19
|
+
]);
|
|
20
|
+
|
|
17
21
|
connectedCallback() {
|
|
18
22
|
this.$logo.addEventListener('click', this.#handleClick.bind(this));
|
|
19
23
|
this.$resize.addEventListener('pointerdown', this.#handlePointerDown.bind(this));
|
|
24
|
+
this.$side.style.width = `${this.store.get('width')}px`;
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
#handleClick() {
|
|
@@ -33,6 +38,7 @@ export default class PgApp extends HTMLElement {
|
|
|
33
38
|
const x = currentX - ee.clientX;
|
|
34
39
|
const width = currentWidth - x;
|
|
35
40
|
this.$side.style.width = `${width}px`;
|
|
41
|
+
this.store.set('width', Math.floor(width));
|
|
36
42
|
}
|
|
37
43
|
const handlePointerUp = () => {
|
|
38
44
|
this.$resize.classList.remove('dragging');
|
|
@@ -42,4 +48,4 @@ export default class PgApp extends HTMLElement {
|
|
|
42
48
|
document.addEventListener('pointermove', handlePointerMove);
|
|
43
49
|
document.addEventListener('pointerup', handlePointerUp);
|
|
44
50
|
}
|
|
45
|
-
}
|
|
51
|
+
}
|
|
@@ -4,6 +4,7 @@ import template from './inputPixelEditor.html';
|
|
|
4
4
|
import style from './inputPixelEditor.css';
|
|
5
5
|
import { InputMode } from './utils/inputMode';
|
|
6
6
|
import cloneGrid from './utils/cloneGrid';
|
|
7
|
+
import getEllipsePixels from './utils/getEllipsePixels';
|
|
7
8
|
import getEllipseOutlinePixels from './utils/getEllipseOutlinePixels';
|
|
8
9
|
import { WHITE } from './utils/constants';
|
|
9
10
|
import getLinePixels from './utils/getLinePixels';
|
|
@@ -489,7 +490,7 @@ export default class PgInputPixelEditor extends HTMLElement {
|
|
|
489
490
|
});
|
|
490
491
|
break;
|
|
491
492
|
case InputMode.Ellipse:
|
|
492
|
-
|
|
493
|
+
getEllipsePixels(this.#startX, this.#startY, newX, newY).forEach(({ x, y }) => {
|
|
493
494
|
this.#setPixel(x, y, 1);
|
|
494
495
|
});
|
|
495
496
|
break;
|
|
@@ -571,7 +572,7 @@ export default class PgInputPixelEditor extends HTMLElement {
|
|
|
571
572
|
this.#setPreview(getRectangleOutlinePixels(startX, startY, lastX, lastY), x, y);
|
|
572
573
|
break;
|
|
573
574
|
case InputMode.Ellipse:
|
|
574
|
-
this.#setPreview(
|
|
575
|
+
this.#setPreview(getEllipsePixels(startX, startY, lastX, lastY), x, y);
|
|
575
576
|
break;
|
|
576
577
|
case InputMode.EllipseOutline:
|
|
577
578
|
this.#setPreview(getEllipseOutlinePixels(startX, startY, lastX, lastY), x, y);
|
|
@@ -1,28 +1,140 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export function distance(x: number, y: number, ratio: number): number {
|
|
2
|
+
return Math.sqrt((Math.pow(y * ratio, 2)) + Math.pow(x, 2));
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function filled(x: number, y: number, radius: number, ratio: number): boolean {
|
|
6
|
+
return distance(x, y, ratio) <= radius;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function thinfilled(x: number, y: number, radius: number, ratio: number): boolean {
|
|
10
|
+
return filled(x, y, radius, ratio) && !(
|
|
11
|
+
filled(x + 1, y, radius, ratio) &&
|
|
12
|
+
filled(x - 1, y, radius, ratio) &&
|
|
13
|
+
filled(x, y + 1, radius, ratio) &&
|
|
14
|
+
filled(x, y - 1, radius, ratio)
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function isFilled(x: number, y: number, width: number, height: number): boolean {
|
|
19
|
+
const bounds = {
|
|
20
|
+
minX: 0,
|
|
21
|
+
maxX: width,
|
|
22
|
+
minY: 0,
|
|
23
|
+
maxY: height,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
x = -.5 * (bounds.maxX - 2 * (x + .5));
|
|
27
|
+
y = -.5 * (bounds.maxY - 2 * (y + .5));
|
|
28
|
+
|
|
29
|
+
return thinfilled(x, y, (bounds.maxX / 2), bounds.maxX / bounds.maxY);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
function betterCircle(x0: number, y0: number, x1: number, y1: number) {
|
|
34
|
+
const width = Math.abs(x0 - x1);
|
|
35
|
+
const height = Math.abs(y0 - y1);
|
|
36
|
+
const minX = Math.min(x0, x1);
|
|
37
|
+
const minY = Math.min(y0, y1);
|
|
38
|
+
|
|
10
39
|
const pixels: { x: number, y: number }[] = [];
|
|
40
|
+
|
|
41
|
+
// Loop through bounding box
|
|
42
|
+
for (let y = 0; y < height; y++) {
|
|
43
|
+
for (let x = 0; x < width; x++) {
|
|
44
|
+
// Center coordinates relative to ellipse
|
|
45
|
+
const cx = -.5 * (width - 2 * (x + 0.5));
|
|
46
|
+
const cy = -.5 * (height - 2 * (y + 0.5));
|
|
47
|
+
|
|
48
|
+
// Use filled() instead of thinfilled() to fill the ellipse
|
|
49
|
+
if (filled(cx, cy, width / 2, width / height)) {
|
|
50
|
+
pixels.push({ x: x + minX, y: y + minY });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return pixels;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
function ellipse(x0: number, y0: number, x1: number, y1: number) {
|
|
60
|
+
const pixels: { x: number, y: number }[] = [];
|
|
61
|
+
|
|
62
|
+
let a = Math.abs(x1 - x0),
|
|
63
|
+
b = Math.abs(y1 - y0),
|
|
64
|
+
b1 = b & 1;
|
|
65
|
+
|
|
66
|
+
let dx = 4 * (1.0 - a) * b * b,
|
|
67
|
+
dy = 4 * (b1 + 1) * a * a;
|
|
68
|
+
|
|
69
|
+
let err = dx + dy + b1 * a * a,
|
|
70
|
+
e2;
|
|
71
|
+
|
|
72
|
+
if (x0 > x1) {
|
|
73
|
+
x0 = x1;
|
|
74
|
+
x1 += a;
|
|
75
|
+
}
|
|
76
|
+
if (y0 > y1) y0 = y1;
|
|
77
|
+
y0 += (b + 1) >> 1;
|
|
78
|
+
y1 = y0 - b1;
|
|
79
|
+
|
|
80
|
+
a = 8 * a * a;
|
|
81
|
+
b1 = 8 * b * b;
|
|
82
|
+
|
|
83
|
+
// Outline drawing
|
|
11
84
|
do {
|
|
12
|
-
pixels.push({ x: x1, y: y0 });
|
|
13
|
-
pixels.push({ x: x0, y: y0 });
|
|
14
|
-
pixels.push({ x: x0, y: y1 });
|
|
15
|
-
pixels.push({ x: x1, y: y1 });
|
|
85
|
+
pixels.push({ x: x1, y: y0 }); // I Quadrant
|
|
86
|
+
pixels.push({ x: x0, y: y0 }); // II Quadrant
|
|
87
|
+
pixels.push({ x: x0, y: y1 }); // III Quadrant
|
|
88
|
+
pixels.push({ x: x1, y: y1 }); // IV Quadrant
|
|
89
|
+
|
|
16
90
|
e2 = 2 * err;
|
|
17
|
-
if (e2 <= dy) {
|
|
18
|
-
|
|
91
|
+
if (e2 <= dy) {
|
|
92
|
+
y0++;
|
|
93
|
+
y1--;
|
|
94
|
+
err += dy += a;
|
|
95
|
+
}
|
|
96
|
+
if (e2 >= dx || 2 * err > dy) {
|
|
97
|
+
x0++;
|
|
98
|
+
x1--;
|
|
99
|
+
err += dx += b1;
|
|
100
|
+
}
|
|
19
101
|
} while (x0 <= x1);
|
|
20
102
|
|
|
21
|
-
while (y0 - y1
|
|
22
|
-
pixels.push({ x: x0 - 1, y: y0 });
|
|
103
|
+
while (y0 - y1 <= b) {
|
|
104
|
+
pixels.push({ x: x0 - 1, y: y0 });
|
|
23
105
|
pixels.push({ x: x1 + 1, y: y0++ });
|
|
24
106
|
pixels.push({ x: x0 - 1, y: y1 });
|
|
25
107
|
pixels.push({ x: x1 + 1, y: y1-- });
|
|
26
108
|
}
|
|
27
|
-
|
|
28
|
-
|
|
109
|
+
|
|
110
|
+
// --- Fill interior ---
|
|
111
|
+
// Group pixels by row (y), then fill between minX and maxX
|
|
112
|
+
const rows: Record<number, { minX: number; maxX: number }> = {};
|
|
113
|
+
for (const p of pixels) {
|
|
114
|
+
if (!(p.y in rows)) {
|
|
115
|
+
rows[p.y] = { minX: p.x, maxX: p.x };
|
|
116
|
+
} else {
|
|
117
|
+
rows[p.y].minX = Math.min(rows[p.y].minX, p.x);
|
|
118
|
+
rows[p.y].maxX = Math.max(rows[p.y].maxX, p.x);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const filledPixels: { x: number; y: number }[] = [...pixels];
|
|
123
|
+
for (const y in rows) {
|
|
124
|
+
const { minX, maxX } = rows[y];
|
|
125
|
+
for (let x = minX; x <= maxX; x++) {
|
|
126
|
+
filledPixels.push({ x, y: parseInt(y) });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return filledPixels;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
export default function getEllipsePixels(x0: number, y0: number, x1: number, y1: number) {
|
|
135
|
+
if (Math.abs(x0 - x1) === Math.abs(y0 - y1) && Math.abs(x0 - x1)) {
|
|
136
|
+
console.log('circle', Math.abs(x0 - x1), Math.abs(y0 - y1))
|
|
137
|
+
return betterCircle(x0, y0, x1 + 1, y1 + 1);
|
|
138
|
+
}
|
|
139
|
+
return ellipse(x0, y0, x1, y1);
|
|
140
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# `PgModalAlert`
|
|
2
|
+
|
|
3
|
+
The `PgModal` is a base class for creating modals.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import '@pictogrammers/components/pgModal';
|
|
7
|
+
import PgModal from '@pictogrammers/components/pgModal';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import { Component, Prop, Part } from '@pictogrammers/element';
|
|
12
|
+
|
|
13
|
+
import template from './modal.html';
|
|
14
|
+
import style from './modal.css';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'my-modal',
|
|
18
|
+
template,
|
|
19
|
+
style
|
|
20
|
+
})
|
|
21
|
+
export default class MyModal extends PgModal {
|
|
22
|
+
@Part() $close: HTMLButtonElement;
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
this.$close.addEventListener('click', () => {
|
|
25
|
+
this.close();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Component, Part, Prop } from '@pictogrammers/element';
|
|
2
|
+
import PgModal from '../../modal';
|
|
3
|
+
|
|
4
|
+
import template from './basic.html';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'x-my-modal',
|
|
8
|
+
template: `<main>Hello! <button part="close">Close</button></main>`
|
|
9
|
+
})
|
|
10
|
+
export class XMyModal extends PgModal {
|
|
11
|
+
|
|
12
|
+
@Part() $close: HTMLButtonElement;
|
|
13
|
+
|
|
14
|
+
connectedCallback() {
|
|
15
|
+
this.$close.addEventListener('click', () => {
|
|
16
|
+
this.close();
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: 'x-pg-modal-basic',
|
|
23
|
+
template
|
|
24
|
+
})
|
|
25
|
+
export default class XPgModalBasic extends HTMLElement {
|
|
26
|
+
|
|
27
|
+
@Part() $button: HTMLButtonElement;
|
|
28
|
+
@Part() $result: HTMLSpanElement;
|
|
29
|
+
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
this.$button.addEventListener('click', this.handleClick.bind(this));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async handleClick() {
|
|
35
|
+
const result = await XMyModal.open({
|
|
36
|
+
header: 'Delete Item',
|
|
37
|
+
message: 'Are you sure you want to delete the item?'
|
|
38
|
+
});
|
|
39
|
+
this.$result.textContent = `${result}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.backdrop {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
background: rgba(0, 0, 0, 0.6);
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
.dialog {
|
|
13
|
+
background: #fff;
|
|
14
|
+
border-radius: 0.5rem;
|
|
15
|
+
box-shadow: 0 1px 1rem rgba(0, 0, 0, 0.5);
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
min-width: 15rem;
|
|
18
|
+
}
|
|
19
|
+
header {
|
|
20
|
+
border-bottom: 1px solid #ccc;
|
|
21
|
+
background: #f1f1f1;
|
|
22
|
+
padding: 0.75rem 1rem;
|
|
23
|
+
}
|
|
24
|
+
header h2 {
|
|
25
|
+
font-size: 1.25rem;
|
|
26
|
+
margin: 0;
|
|
27
|
+
font-weight: normal;
|
|
28
|
+
}
|
|
29
|
+
main {
|
|
30
|
+
padding: 0.5rem 1rem;
|
|
31
|
+
}
|
|
32
|
+
footer {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: row;
|
|
35
|
+
padding: 0.75rem 1rem;
|
|
36
|
+
border-top: 1px solid #ccc;
|
|
37
|
+
background: #f1f1f1;
|
|
38
|
+
justify-content: flex-end;
|
|
39
|
+
gap: 0.5rem;
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component } from '@pictogrammers/element';
|
|
2
|
+
|
|
3
|
+
import template from './modal.html';
|
|
4
|
+
import style from './modal.css';
|
|
5
|
+
|
|
6
|
+
import PgOverlay from '../overlay/overlay';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
template,
|
|
10
|
+
style
|
|
11
|
+
})
|
|
12
|
+
export default class PgModal extends PgOverlay {
|
|
13
|
+
|
|
14
|
+
}
|
package/pg/tree/README.md
CHANGED
|
@@ -72,4 +72,13 @@ this.$tree.addEventListener('drop', (e: any) => {
|
|
|
72
72
|
item.move(dropIndexes);
|
|
73
73
|
})
|
|
74
74
|
});
|
|
75
|
-
```
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Custom Size
|
|
78
|
+
|
|
79
|
+
Resize from the default 32px height all the way down to 24px tall via a CSS Variable.
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
--pg-icon-width: 1rem;
|
|
83
|
+
--pg-icon-height: 1rem;
|
|
84
|
+
```
|
|
@@ -65,6 +65,7 @@ export default class XPgTreeBasic extends HTMLElement {
|
|
|
65
65
|
@Part() $addFolder: HTMLButtonElement;
|
|
66
66
|
@Part() $removeItem: HTMLButtonElement;
|
|
67
67
|
@Part() $updateItem: HTMLButtonElement;
|
|
68
|
+
@Part() $height: HTMLInputElement;
|
|
68
69
|
|
|
69
70
|
#selectedItems = [];
|
|
70
71
|
|
|
@@ -152,5 +153,10 @@ export default class XPgTreeBasic extends HTMLElement {
|
|
|
152
153
|
selected.getData().label = `Updated ${updatedTimes++}`;
|
|
153
154
|
});
|
|
154
155
|
});
|
|
156
|
+
|
|
157
|
+
this.$height.addEventListener('input', (e) => {
|
|
158
|
+
const { value } = e.target as HTMLInputElement;
|
|
159
|
+
this.$tree.style.setProperty('--pg-tree-size', `${value}`);
|
|
160
|
+
});
|
|
155
161
|
}
|
|
156
162
|
}
|
package/pg/tree/tree.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: contents;
|
|
3
|
+
--pg-tree-size: 2;
|
|
3
4
|
--pg-tree-selected-primary: #453C4F;
|
|
4
5
|
--pg-tree-selected-secondary: var(--pg-tree-item-background-selected, rgb(69, 60, 79, 0.1));
|
|
5
6
|
--pg-tree-selected-secondary-hover: var(--pg-tree-item-background-selected, rgb(69, 60, 79, 0.2));
|
package/pgAnnoy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o="",n=void 0!==t[5];return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),n&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),n&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o})).join("")},t.i=function(e,o,n,r,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(n)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(i[s]=!0)}for(var c=0;c<e.length;c++){var p=[].concat(e[c]);n&&i[p[0]]||(void 0!==a&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),o&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=o):p[2]=o),r&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=r):p[4]="".concat(r)),t.push(p))}},t}},497:(e,t,o)=>{o.d(t,{A:()=>s});var n=o(601),r=o.n(n),a=o(314),i=o.n(a)()(r());i.push([e.id,":host {\n display: block;\n position: var(--pg-annoy-position, fixed);\n font-family: var(--pg-font-family);\n width: var(--pg-annoy-width, 12rem);\n height: var(--pg-annoy-height, auto);\n max-height: var(--pg-annoy-max-height, auto);\n font-size: 1rem;\n transition: 0.1s margin-bottom ease-in;\n}\n:host(.footer) {\n margin-bottom: 4rem;\n}\n\ndiv {\n position: relative;\n display: grid;\n margin-right: 0.75rem;\n padding: 0.5rem;\n border: 1px solid #FFFFFF;\n border-radius: 0.25rem;\n background: #FFFFFF;\n box-shadow: 0 1px 2rem rgba(0, 0, 0, 0.3);\n}\n\n[part=close] {\n position: absolute;\n right: -0.75rem;\n top: -0.75rem;\n width: 1.5rem;\n height: 1.5rem;\n border: 1px solid #fff;\n border-radius: 50%;\n background: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.4);\n padding: 0;\n color: rgba(69, 60, 79, 0.8);\n outline: none;\n}\n\n[part=close]:hover {\n color: #453C4F;\n border-color: rgba(69, 60, 79, 0.6);\n}\n\n[part=close]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.2);\n border-color: rgba(69, 60, 79, 0.9);\n}\n\n[part=close]:focus::before {\n pointer-events: none;\n content: '';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 50%;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n\n[part=close] svg {\n width: 1rem;\n height: 1rem;\n}\n",""]);var l=new CSSStyleSheet;l.replaceSync(i.toString());const s=l},601:e=>{e.exports=function(e){return e[1]}}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={id:n,exports:{}};return e[n](a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Symbol("addObserver"),Symbol("removeObserver"),Symbol("getObservers"),Symbol("swapObserver"),Symbol("isProxy"),Symbol("getTarget");const n=new Map;window.observers=n;Error;Symbol("index");const r=Symbol("init"),a=Symbol("template"),i=Symbol("style"),l=Symbol("parent");function s(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function c(e={}){return function(t,o){if("class"!==o.kind)throw new Error("@Component() can only decorate a class");var n,c;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[l]||t.prototype[l][t.prototype[l].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[l]=[t.prototype],t.prototype[i]=e.style?[e.style]:[],t.prototype[a]=e.template||""):(t.prototype[l].push(t.prototype),t.prototype[i].push(e.style),t.prototype[a]=(n=t.prototype[a],(c=e.template||null)&&c.match(/<parent\/>/)?c.replace(/<parent\/>/,n):`${n}${c||""}`));const p=t.prototype.connectedCallback||(()=>{}),d=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[r]||void 0!==e.template||void 0!==e.style)if(this[r]){if(this[r]&&e.style);else if(this[r]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[a]||"";const o=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[i].
|
|
1
|
+
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o="",n=void 0!==t[5];return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),n&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),n&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o})).join("")},t.i=function(e,o,n,r,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(n)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(i[s]=!0)}for(var c=0;c<e.length;c++){var p=[].concat(e[c]);n&&i[p[0]]||(void 0!==a&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),o&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=o):p[2]=o),r&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=r):p[4]="".concat(r)),t.push(p))}},t}},497:(e,t,o)=>{o.d(t,{A:()=>s});var n=o(601),r=o.n(n),a=o(314),i=o.n(a)()(r());i.push([e.id,":host {\n display: block;\n position: var(--pg-annoy-position, fixed);\n font-family: var(--pg-font-family);\n width: var(--pg-annoy-width, 12rem);\n height: var(--pg-annoy-height, auto);\n max-height: var(--pg-annoy-max-height, auto);\n font-size: 1rem;\n transition: 0.1s margin-bottom ease-in;\n}\n:host(.footer) {\n margin-bottom: 4rem;\n}\n\ndiv {\n position: relative;\n display: grid;\n margin-right: 0.75rem;\n padding: 0.5rem;\n border: 1px solid #FFFFFF;\n border-radius: 0.25rem;\n background: #FFFFFF;\n box-shadow: 0 1px 2rem rgba(0, 0, 0, 0.3);\n}\n\n[part=close] {\n position: absolute;\n right: -0.75rem;\n top: -0.75rem;\n width: 1.5rem;\n height: 1.5rem;\n border: 1px solid #fff;\n border-radius: 50%;\n background: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.4);\n padding: 0;\n color: rgba(69, 60, 79, 0.8);\n outline: none;\n}\n\n[part=close]:hover {\n color: #453C4F;\n border-color: rgba(69, 60, 79, 0.6);\n}\n\n[part=close]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.2);\n border-color: rgba(69, 60, 79, 0.9);\n}\n\n[part=close]:focus::before {\n pointer-events: none;\n content: '';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 50%;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n\n[part=close] svg {\n width: 1rem;\n height: 1rem;\n}\n",""]);var l=new CSSStyleSheet;l.replaceSync(i.toString());const s=l},601:e=>{e.exports=function(e){return e[1]}}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={id:n,exports:{}};return e[n](a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Symbol("addObserver"),Symbol("removeObserver"),Symbol("getObservers"),Symbol("swapObserver"),Symbol("isProxy"),Symbol("getTarget");const n=new Map;window.observers=n;Error;Symbol("index");const r=Symbol("init"),a=Symbol("template"),i=Symbol("style"),l=Symbol("parent");function s(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function c(e={}){return function(t,o){if("class"!==o.kind)throw new Error("@Component() can only decorate a class");var n,c;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[l]||t.prototype[l][t.prototype[l].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[l]=[t.prototype],t.prototype[i]=e.style?[e.style]:[],t.prototype[a]=e.template||""):(t.prototype[l].push(t.prototype),t.prototype[i].push(e.style),t.prototype[a]=(n=t.prototype[a],(c=e.template||null)&&c.match(/<parent\/>/)?c.replace(/<parent\/>/,n):n.match(/<child\/>/)?n.replace(/<child\/>/,c||""):`${n}${c||""}`));const p=t.prototype.connectedCallback||(()=>{}),d=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[r]||void 0!==e.template||void 0!==e.style)if(this[r]){if(this[r]&&e.style);else if(this[r]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[a]||"";const o=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[i].reduce(((e,t)=>{if(!t)return e;if(t instanceof CSSStyleSheet)return e.push(t),e;var o=new CSSStyleSheet;return o.replaceSync(t.toString()),e.push(o),e}),[]),n.appendChild(o)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const o=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&o.add(e.localName);const n=Array.from(o.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),c=()=>{this[l].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[s(t)]=!0,e)),{}):{})}))};0===n.length?(this[r]=!0,p.call(this),c()):Promise.all(n).then((()=>{this[r]=!0,p.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));c()}))},t.prototype.disconnectedCallback=function(){d.call(this)},t.prototype.attributeChangedCallback=function(e,t,o){this[s(e)]=o},o.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${o.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");Symbol("hasProxy");Symbol("meta");var p=o(497),d=function(e,t,o,n,r,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,s=n.kind,c="getter"===s?"get":"setter"===s?"set":"value",p=!t&&e?n.static?e:e.prototype:null,d=t||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),u=!1,h=o.length-1;h>=0;h--){var m={};for(var f in n)m[f]="access"===f?{}:n[f];for(var f in n.access)m.access[f]=n.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var y=(0,o[h])("accessor"===s?{get:d.get,set:d.set}:d[c],m);if("accessor"===s){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(l=i(y.get))&&(d.get=l),(l=i(y.set))&&(d.set=l),(l=i(y.init))&&r.unshift(l)}else(l=i(y))&&("field"===s?r.unshift(l):d[c]=l)}p&&Object.defineProperty(p,n.name,d),u=!0},u=function(e,t,o){for(var n=arguments.length>2,r=0;r<t.length;r++)o=n?t[r].call(e,o):t[r].call(e);return n?o:void 0};(()=>{let e,t,o,n=[c({selector:"pg-annoy",style:p.A,template:'<div> <button part="close"> <svg viewBox="0 0 24 24"> <path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/> </svg> </button> <slot></slot> </div>'})],r=[],a=HTMLElement,i=[],l=[];(class extends a{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;o=[function(e,t){const o=t.name,n=o.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,o,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}],d(null,null,o,{kind:"field",name:"$close",static:!1,private:!1,access:{has:e=>"$close"in e,get:e=>e.$close,set:(e,t)=>{e.$close=t}},metadata:s},i,l),d(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),u(t,r)}$close=u(this,i,void 0);list=(u(this,l),[]);connectedCallback(){}})})()})();
|
package/pgApp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},601:e=>{e.exports=function(e){return e[1]}},801:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(601),r=n.n(o),i=n(314),a=n.n(i)()(r());a.push([e.id,":host {\n display: contents;\n}\n\n[part=grid] {\n display: grid;\n grid-template-columns: auto 0.5rem minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr);\n height: 100%;\n}\n\n[part=header] {\n display: flex;\n grid-column: 1 / 4;\n grid-row: 1;\n border-bottom: 2px solid #453C4F;\n}\n\n[part=header] > button {\n display: flex;\n border: 0;\n padding: 0.5rem;\n background-color: transparent;\n border-right: 1px solid rgba(69, 60, 79, 0.5);\n outline: none;\n}\n\n[part=header] > button:hover {\n background-color: rgba(69, 60, 79, 0.10);\n}\n\n[part=header] > button:focus-visible {\n position: relative;\n}\n\n[part=header] > button:focus-visible::before {\n pointer-events: none;\n content: '';\n position: absolute;\n top: 3px;\n right: 3px;\n bottom: 3px;\n left: 3px;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgba(79, 143, 249, 0.5));\n}\n\n[part=header] > button.selected {\n --pg-icon-color: rgb(79, 143, 249);\n}\n\n[part=header] > button.selected:hover {\n background-color: #fff;\n}\n\n[part=side] {\n display: flex;\n flex-direction: column;\n grid-column: 1;\n grid-row: 2;\n min-width: 10rem;\n max-width: 20rem;\n}\n\n[part=main] {\n display: flex;\n flex-direction: column;\n grid-column: 3;\n grid-row: 2;\n}\n\n[part=resize] {\n display: flex;\n grid-column: 2;\n grid-row: 2;\n border: 0;\n padding: 0;\n cursor: ew-resize;\n border-left: 1px solid #453C4F;\n border-right: 1px solid #453C4F;\n background-color: transparent;\n}\n\n[part=resize].dragging {\n background-color: var(--pg-focus-color, rgb(79, 143, 249, 0.5))\n}\n\n[part=home] {\n display: flex;\n flex-direction: column;\n grid-column: 1 / 4;\n grid-row: 2;\n background-color: #fff;\n position: relative;\n}\n\n[part=home]::before {\n content: ' ';\n position: absolute;\n top: -2px;\n width: 2.5rem;\n height: 2px;\n background-color: #fff;\n}\n\n[part=home].selected {\n background-color: #fff;\n}\n\n.hide {\n display: none;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Symbol("addObserver"),Symbol("removeObserver"),Symbol("getObservers"),Symbol("swapObserver"),Symbol("isProxy"),Symbol("getTarget");const o=new Map;window.observers=o;Error;Symbol("index");const r=Symbol("init"),i=Symbol("template"),a=Symbol("style"),s=Symbol("parent");function l(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function c(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,c;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[s]||t.prototype[s][t.prototype[s].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[s]=[t.prototype],t.prototype[a]=e.style?[e.style]:[],t.prototype[i]=e.template||""):(t.prototype[s].push(t.prototype),t.prototype[a].push(e.style),t.prototype[i]=(o=t.prototype[i],(c=e.template||null)&&c.match(/<parent\/>/)?c.replace(/<parent\/>/,o):`${o}${c||""}`));const d=t.prototype.connectedCallback||(()=>{}),p=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[r]||void 0!==e.template||void 0!==e.style)if(this[r]){if(this[r]&&e.style);else if(this[r]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[i]||"";const n=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[a].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),o.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const o=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),c=()=>{this[s].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[l(t)]=!0,e)),{}):{})}))};0===o.length?(this[r]=!0,d.call(this),c()):Promise.all(o).then((()=>{this[r]=!0,d.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));c()}))},t.prototype.disconnectedCallback=function(){p.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[l(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function d(){return function(e,t){const n=t.name,o=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");Symbol("meta");var p=n(801),u=function(e,t,n,o,r,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?o.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),u=!1,h=n.length-1;h>=0;h--){var m={};for(var f in o)m[f]="access"===f?{}:o[f];for(var f in o.access)m.access[f]=o.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(p.get=s),(s=a(g.set))&&(p.set=s),(s=a(g.init))&&r.unshift(s)}else(s=a(g))&&("field"===l?r.unshift(s):p[c]=s)}d&&Object.defineProperty(d,o.name,p),u=!0},h=function(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0};(()=>{let e,t,n,o,r,i,a=[c({selector:"pg-app",style:p.A,template:'<div part="grid"> <header part="header"> <button part="logo"> <slot name="icon"></slot> </button> <slot name="top"></slot> </header> <div part="side"> <slot name="side"></slot> </div> <button part="resize"></button> <div part="main"> <slot name="main"></slot> </div> <div part="home" class="hide"> <slot name="home"></slot> </div> </div>'})],s=[],l=HTMLElement,m=[],f=[],g=[],b=[],v=[],y=[],w=[],S=[];(class extends l{static{t=this}static{const c="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[d()],o=[d()],r=[d()],i=[d()],u(null,null,n,{kind:"field",name:"$logo",static:!1,private:!1,access:{has:e=>"$logo"in e,get:e=>e.$logo,set:(e,t)=>{e.$logo=t}},metadata:c},m,f),u(null,null,o,{kind:"field",name:"$home",static:!1,private:!1,access:{has:e=>"$home"in e,get:e=>e.$home,set:(e,t)=>{e.$home=t}},metadata:c},g,b),u(null,null,r,{kind:"field",name:"$side",static:!1,private:!1,access:{has:e=>"$side"in e,get:e=>e.$side,set:(e,t)=>{e.$side=t}},metadata:c},v,y),u(null,null,i,{kind:"field",name:"$resize",static:!1,private:!1,access:{has:e=>"$resize"in e,get:e=>e.$resize,set:(e,t)=>{e.$resize=t}},metadata:c},w,S),u(null,e={value:t},a,{kind:"class",name:t.name,metadata:c},null,s),t=e.value,c&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c}),h(t,s)}$logo=h(this,m,void 0);$home=(h(this,f),h(this,g,void 0));$side=(h(this,b),h(this,v,void 0));$resize=(h(this,y),h(this,w,void 0));connectedCallback(){this.$logo.addEventListener("click",this.#e.bind(this)),this.$resize.addEventListener("pointerdown",this.#t.bind(this))}#e(){this.$logo.classList.toggle("selected"),this.$home.classList.toggle("hide")}#t(e){const{clientX:t}=e;this.$resize.classList.add("dragging");const n=this.$side.getBoundingClientRect().width;let o=t;const r=e=>{const t=o-e.clientX,r=n-t;this.$side.style.width=`${r}px`},i=()=>{this.$resize.classList.remove("dragging"),document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",i)};document.addEventListener("pointermove",r),document.addEventListener("pointerup",i)}constructor(){super(...arguments),h(this,S)}})})()})();
|
|
1
|
+
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},601:e=>{e.exports=function(e){return e[1]}},801:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(601),r=n.n(o),i=n(314),a=n.n(i)()(r());a.push([e.id,":host {\n display: contents;\n}\n\n[part=grid] {\n display: grid;\n grid-template-columns: auto 0.5rem minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr);\n height: 100%;\n}\n\n[part=header] {\n display: flex;\n grid-column: 1 / 4;\n grid-row: 1;\n border-bottom: 2px solid #453C4F;\n}\n\n[part=header] > button {\n display: flex;\n border: 0;\n padding: 0.5rem;\n background-color: transparent;\n border-right: 1px solid rgba(69, 60, 79, 0.5);\n outline: none;\n}\n\n[part=header] > button:hover {\n background-color: rgba(69, 60, 79, 0.10);\n}\n\n[part=header] > button:focus-visible {\n position: relative;\n}\n\n[part=header] > button:focus-visible::before {\n pointer-events: none;\n content: '';\n position: absolute;\n top: 3px;\n right: 3px;\n bottom: 3px;\n left: 3px;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgba(79, 143, 249, 0.5));\n}\n\n[part=header] > button.selected {\n --pg-icon-color: rgb(79, 143, 249);\n}\n\n[part=header] > button.selected:hover {\n background-color: #fff;\n}\n\n[part=side] {\n display: flex;\n flex-direction: column;\n grid-column: 1;\n grid-row: 2;\n min-width: 12rem;\n max-width: 20rem;\n}\n\n[part=main] {\n display: flex;\n flex-direction: column;\n grid-column: 3;\n grid-row: 2;\n}\n\n[part=resize] {\n display: flex;\n grid-column: 2;\n grid-row: 2;\n border: 0;\n padding: 0;\n cursor: ew-resize;\n border-left: 1px solid #453C4F;\n border-right: 1px solid #453C4F;\n background-color: transparent;\n}\n\n[part=resize].dragging {\n background-color: var(--pg-focus-color, rgb(79, 143, 249, 0.5))\n}\n\n[part=home] {\n display: flex;\n flex-direction: column;\n grid-column: 1 / 4;\n grid-row: 2;\n background-color: #fff;\n position: relative;\n}\n\n[part=home]::before {\n content: ' ';\n position: absolute;\n top: -2px;\n width: 2.5rem;\n height: 2px;\n background-color: #fff;\n}\n\n[part=home].selected {\n background-color: #fff;\n}\n\n.hide {\n display: none;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Symbol("addObserver"),Symbol("removeObserver"),Symbol("getObservers"),Symbol("swapObserver"),Symbol("isProxy"),Symbol("getTarget");const o=new Map;window.observers=o;Error;Symbol("index");const r=Symbol("init"),i=Symbol("template"),a=Symbol("style"),s=Symbol("parent");function l(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function c(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,c;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[s]||t.prototype[s][t.prototype[s].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[s]=[t.prototype],t.prototype[a]=e.style?[e.style]:[],t.prototype[i]=e.template||""):(t.prototype[s].push(t.prototype),t.prototype[a].push(e.style),t.prototype[i]=(o=t.prototype[i],(c=e.template||null)&&c.match(/<parent\/>/)?c.replace(/<parent\/>/,o):o.match(/<child\/>/)?o.replace(/<child\/>/,c||""):`${o}${c||""}`));const d=t.prototype.connectedCallback||(()=>{}),p=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[r]||void 0!==e.template||void 0!==e.style)if(this[r]){if(this[r]&&e.style);else if(this[r]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[i]||"";const n=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[a].reduce(((e,t)=>{if(!t)return e;if(t instanceof CSSStyleSheet)return e.push(t),e;var n=new CSSStyleSheet;return n.replaceSync(t.toString()),e.push(n),e}),[]),o.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const o=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),c=()=>{this[s].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[l(t)]=!0,e)),{}):{})}))};0===o.length?(this[r]=!0,d.call(this),c()):Promise.all(o).then((()=>{this[r]=!0,d.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));c()}))},t.prototype.disconnectedCallback=function(){p.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[l(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function d(){return function(e,t){const n=t.name,o=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");Symbol("meta");var p=n(801),u=function(e,t,n,o,r,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?o.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),u=!1,h=n.length-1;h>=0;h--){var m={};for(var f in o)m[f]="access"===f?{}:o[f];for(var f in o.access)m.access[f]=o.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(p.get=s),(s=a(g.set))&&(p.set=s),(s=a(g.init))&&r.unshift(s)}else(s=a(g))&&("field"===l?r.unshift(s):p[c]=s)}d&&Object.defineProperty(d,o.name,p),u=!0},h=function(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0};(()=>{let e,t,n,o,r,i,a,s=[c({selector:"pg-app",style:p.A,template:'<div part="grid"> <header part="header"> <button part="logo"> <slot name="icon"></slot> </button> <slot name="top"></slot> </header> <div part="side"> <slot name="side"></slot> </div> <button part="resize"></button> <div part="main"> <slot name="main"></slot> </div> <div part="home" class="hide"> <slot name="home"></slot> </div> </div>'})],l=[],m=HTMLElement,f=[],g=[],y=[],b=[],v=[],w=[],S=[],$=[],x=[],k=[];(class extends m{static{t=this}static{const c="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;var p;n=[d()],o=[d()],r=[d()],i=[d()],a=[(p="app",function(e,t){return t.name,function(e){if(!(e instanceof Map))throw new Error("@Local(key) property must be type Map");return new Proxy(e,{get(t,n){switch(n){case"get":return t=>{if(!e.has(t))throw new Error(`@Local(key) missing key ${t}`);const n=`${p}:${t}`;return null===window.localStorage.getItem(n)?e.get(t):JSON.parse(window.localStorage.getItem(n)??"null")};case"set":return(t,n)=>{if(!e.has(t))throw new Error(`@Local(key) missing key ${t}`);const o=`${p}:${t}`;null===n||JSON.stringify(n)===JSON.stringify(e.get(t))?window.localStorage.removeItem(o):window.localStorage.setItem(o,JSON.stringify(n))};default:throw new Error(`@Local(key) supported method ${n}`)}}})}})],u(null,null,n,{kind:"field",name:"$logo",static:!1,private:!1,access:{has:e=>"$logo"in e,get:e=>e.$logo,set:(e,t)=>{e.$logo=t}},metadata:c},f,g),u(null,null,o,{kind:"field",name:"$home",static:!1,private:!1,access:{has:e=>"$home"in e,get:e=>e.$home,set:(e,t)=>{e.$home=t}},metadata:c},y,b),u(null,null,r,{kind:"field",name:"$side",static:!1,private:!1,access:{has:e=>"$side"in e,get:e=>e.$side,set:(e,t)=>{e.$side=t}},metadata:c},v,w),u(null,null,i,{kind:"field",name:"$resize",static:!1,private:!1,access:{has:e=>"$resize"in e,get:e=>e.$resize,set:(e,t)=>{e.$resize=t}},metadata:c},S,$),u(null,null,a,{kind:"field",name:"store",static:!1,private:!1,access:{has:e=>"store"in e,get:e=>e.store,set:(e,t)=>{e.store=t}},metadata:c},x,k),u(null,e={value:t},s,{kind:"class",name:t.name,metadata:c},null,l),t=e.value,c&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c}),h(t,l)}$logo=h(this,f,void 0);$home=(h(this,g),h(this,y,void 0));$side=(h(this,b),h(this,v,void 0));$resize=(h(this,w),h(this,S,void 0));store=(h(this,$),h(this,x,new Map([["width",192]])));connectedCallback(){this.$logo.addEventListener("click",this.#e.bind(this)),this.$resize.addEventListener("pointerdown",this.#t.bind(this)),this.$side.style.width=`${this.store.get("width")}px`}#e(){this.$logo.classList.toggle("selected"),this.$home.classList.toggle("hide")}#t(e){const{clientX:t}=e;this.$resize.classList.add("dragging");const n=this.$side.getBoundingClientRect().width;let o=t;const r=e=>{const t=o-e.clientX,r=n-t;this.$side.style.width=`${r}px`,this.store.set("width",Math.floor(r))},i=()=>{this.$resize.classList.remove("dragging"),document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",i)};document.addEventListener("pointermove",r),document.addEventListener("pointerup",i)}constructor(){super(...arguments),h(this,k)}})})()})();
|