element-vir 16.0.2 → 16.1.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.
@@ -19,7 +19,8 @@ export type DeclarativeElementInit<TagName extends CustomElementTagName, Inputs
19
19
  styles?: CSSResult | StylesCallback<TagName, HostClassKeys, CssVarKeys>;
20
20
  /**
21
21
  * The definition of and initial values for the element's internal state. Note that this is
22
- * defined statically: the init value will be the same for all instances of this element.
22
+ * defined statically: the init value will be the same for all instances of this element because
23
+ * it is only defined once.
23
24
  */
24
25
  stateInitStatic?: StateInit;
25
26
  /** Events that the element can dispatch. (These can be thought of as "outputs".) */
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A state prop helper that sets up the given callback for each instance of the element that this
3
+ * state is contained within.
4
+ */
5
+ export declare function perInstance<T>(creationCallback: () => T): T;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A state prop helper that sets up the given callback for each instance of the element that this
3
+ * state is contained within.
4
+ */
5
+ export function perInstance(creationCallback) {
6
+ const stateSetup = {
7
+ _elementVirStateSetup: creationCallback,
8
+ };
9
+ return stateSetup;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-vir",
3
- "version": "16.0.2",
3
+ "version": "16.1.0",
4
4
  "keywords": [
5
5
  "custom",
6
6
  "web",
@@ -39,15 +39,15 @@
39
39
  "test:types": "tsc --noEmit"
40
40
  },
41
41
  "dependencies": {
42
- "@augment-vir/browser": "^16.0.0",
43
- "@augment-vir/common": "^16.0.0",
42
+ "@augment-vir/browser": "^16.0.1",
43
+ "@augment-vir/common": "^16.0.1",
44
44
  "lit": "2.7.6",
45
- "lit-css-vars": "^2.0.3",
45
+ "lit-css-vars": "^3.0.0",
46
46
  "object-shape-tester": "^0.4.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@augment-vir/browser-testing": "^16.0.0",
50
- "@augment-vir/node-js": "^16.0.0",
49
+ "@augment-vir/browser-testing": "^16.0.1",
50
+ "@augment-vir/node-js": "^16.0.1",
51
51
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
52
52
  "@open-wc/testing": "^3.2.0",
53
53
  "@types/chai": "^4.3.5",
@@ -60,6 +60,7 @@
60
60
  "ansi-colors": "^4.1.3",
61
61
  "concurrently": "^8.2.0",
62
62
  "cspell": "^6.31.2",
63
+ "element-book": "^10.0.2",
63
64
  "esbuild": "^0.18.17",
64
65
  "istanbul-smart-text-reporter": "^1.1.2",
65
66
  "markdown-code-example-inserter": "^0.3.1",
@@ -82,6 +83,7 @@
82
83
  "vite-tsconfig-paths": "^4.2.0"
83
84
  },
84
85
  "overrides": {
85
- "semver": "^7.5.4"
86
+ "semver": "^7.5.4",
87
+ "element-vir": "*"
86
88
  }
87
89
  }