@pictogrammers/components 0.5.0 → 0.5.1

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.5.0",
4
+ "version": "0.5.1",
5
5
  "license": "MIT",
6
6
  "author": "Austin Andrews",
7
7
  "scripts": {
@@ -47,6 +47,7 @@ See usage for each method below.
47
47
  | ---------- | -------- | ----------- |
48
48
  | `getJson(options)` | - | Get JSON file. |
49
49
  | `getData()` | - | Get layer data. |
50
+ | `setData()` | - | Set layer data. |
50
51
  | `setJson(json)` | - | Set JSON file. |
51
52
  | `reset()` | - | Reset canvas and data. |
52
53
  | `getExportCanvas()` | - | Get new canvas of export. |
@@ -1367,14 +1367,14 @@ export default class PgInputPixelEditor extends HTMLElement {
1367
1367
  this.#layer = indexes;
1368
1368
  }
1369
1369
 
1370
- addLayer() {
1370
+ addLayer({ name, type, ...optional }) {
1371
1371
  this.#data.push(fillGrid(this.width, this.height));
1372
1372
  this.#layers.push({
1373
- name: 'Layer 1',
1374
- type: 'pixel',
1375
- export: true,
1376
- locked: false,
1377
- visible: true,
1373
+ name,
1374
+ type,
1375
+ export: optional.exclude ?? true,
1376
+ locked: optional.locked ?? false,
1377
+ visible: optional.hidden ?? true,
1378
1378
  opacity: 1
1379
1379
  });
1380
1380
  }
@@ -1463,6 +1463,13 @@ export default class PgInputPixelEditor extends HTMLElement {
1463
1463
  });
1464
1464
  }
1465
1465
 
1466
+ /**
1467
+ * Set data
1468
+ */
1469
+ setData(data: any[]) {
1470
+
1471
+ }
1472
+
1466
1473
  getExportPath() {
1467
1474
  return bitmaskToPath(this.#export, { scale: 1 });
1468
1475
  }