@pictogrammers/components 0.4.7 → 0.4.8

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pictogrammers/components",
3
3
  "type": "module",
4
- "version": "0.4.7",
4
+ "version": "0.4.8",
5
5
  "license": "MIT",
6
6
  "author": "Austin Andrews",
7
7
  "scripts": {
package/pg/app/app.css CHANGED
@@ -57,7 +57,7 @@
57
57
  flex-direction: column;
58
58
  grid-column: 1;
59
59
  grid-row: 2;
60
- min-width: 10rem;
60
+ min-width: 12rem;
61
61
  max-width: 20rem;
62
62
  }
63
63
 
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
+ }