wrec 0.36.6 → 0.37.0

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.
@@ -43,9 +43,10 @@ var r = typeof window < "u" && window.document !== void 0, i = class extends Err
43
43
  #i;
44
44
  #a;
45
45
  constructor(n, a, o) {
46
- if (!n) throw new i("name cannot be empty");
46
+ let s = typeof a == "boolean" ? a : !1;
47
+ if (o = typeof a == "boolean" ? o : a, !n) throw new i("name cannot be empty");
47
48
  if (e.#e.has(n)) throw new i(`WrecState with name "${n}" already exists`);
48
- if (this.#r = n, this.#i = a, this.#a = t({}, this.#s.bind(this)), a && r) {
49
+ if (this.#r = n, this.#i = s, this.#a = t({}, this.#s.bind(this)), s && r) {
49
50
  let e = sessionStorage.getItem("wrec-state-" + n), t = e ? JSON.parse(e) : void 0;
50
51
  t && (o = t);
51
52
  }
@@ -85,6 +85,7 @@ export declare class WrecState {
85
85
  #private;
86
86
  static get(name: string): WrecState | undefined;
87
87
  [key: string]: unknown;
88
+ constructor(name: string, initial?: LooseObject);
88
89
  constructor(name: string, persist: boolean, initial?: LooseObject);
89
90
  subscribe(callback: ChangeCallback, paths?: string[]): () => void;
90
91
  addProperty(propName: string, initialValue: unknown): void;
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, n, r, t as i } from "./wrec-CPzbCpSN.js";
1
+ import { a as e, i as t, n, r, t as i } from "./wrec-0J9-ZQRj.js";
2
2
  //#region \0rolldown/runtime.js
3
3
  var a = Object.defineProperty, o = Object.getOwnPropertyDescriptor, s = Object.getOwnPropertyNames, c = Object.prototype.hasOwnProperty, l = (e, t) => () => (e && (t = e(e = 0)), t), u = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), d = (e, t) => {
4
4
  let n = {};
package/dist/wrec.d.ts CHANGED
@@ -85,6 +85,7 @@ export declare class WrecState {
85
85
  #private;
86
86
  static get(name: string): WrecState | undefined;
87
87
  [key: string]: unknown;
88
+ constructor(name: string, initial?: LooseObject);
88
89
  constructor(name: string, persist: boolean, initial?: LooseObject);
89
90
  subscribe(callback: ChangeCallback, paths?: string[]): () => void;
90
91
  addProperty(propName: string, initialValue: unknown): void;
package/dist/wrec.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "./wrec-CPzbCpSN.js";
1
+ import { a as e, i as t, n, r, t as i } from "./wrec-0J9-ZQRj.js";
2
2
  export { i as Wrec, e as WrecState, n as createElement, r as css, t as html };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "wrec",
3
3
  "description": "a library that greatly simplifies building web components",
4
4
  "author": "R. Mark Volkmann",
5
- "version": "0.36.6",
5
+ "version": "0.37.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/scripts/lint.js CHANGED
@@ -13,17 +13,19 @@
13
13
  // - extra arguments passed to methods and context functions
14
14
  // - incompatible method arguments in expressions
15
15
  // - incompatible context function arguments in expressions
16
- // - arithmetic type errors in expressions
17
- // - invalid computed property references and calls to non-method members
16
+ // - incompatible declare property types
17
+ // - arithmetic and other type errors in expressions
18
+ // - invalid computed property references
18
19
  // - invalid event handler references
19
20
  // - unsupported event names
20
21
  // - duplicate property names
21
22
  // - reserved property names
22
23
  // - missing `type` in property configurations
24
+ // - invalid `type` values in property configurations
23
25
  // - invalid default values
24
26
  // - invalid `values` configurations
25
27
  // - invalid `usedBy` references
26
- // - missing `formAssociated` when `formAssociatedCallback` is defined
28
+ // - missing required members like `static html` and `formAssociated`
27
29
  // - invalid `form-assoc` values
28
30
  // - invalid `useState` map entries
29
31
  // - unsupported HTML attributes in templates