@pageboard/html 0.16.3 → 0.16.5

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.
@@ -0,0 +1,14 @@
1
+ exports.page.properties.beacons = {
2
+ title: 'Beacons',
3
+ additionalProperties: {
4
+ type: 'string',
5
+ format: 'singleline'
6
+ }
7
+ };
8
+
9
+ exports.page.fragments.push({
10
+ path: 'head',
11
+ position: 'beforeend',
12
+ html: `<meta name="beacons" is="element-beacons" content="[beacons|as:query]">`
13
+ });
14
+ exports.page.scripts.push("../ui/beacons.js");
package/elements/form.js CHANGED
@@ -98,7 +98,6 @@ exports.api_form = {
98
98
  },
99
99
  action: {
100
100
  title: 'Action',
101
- description: 'Choose a service',
102
101
  $ref: '/writes'
103
102
  },
104
103
  redirection: {
@@ -0,0 +1,33 @@
1
+ exports.statistic = {
2
+ title: 'Stat',
3
+ menu: "widget",
4
+ group: "block",
5
+ icon: '<b class="icon">‰</b>',
6
+ properties: {
7
+ name: {
8
+ title: 'Name',
9
+ type: 'string',
10
+ format: 'singleline'
11
+ },
12
+ value: {
13
+ title: 'Value',
14
+ type: 'number'
15
+ },
16
+ precision: {
17
+ title: 'Precision',
18
+ type: 'integer',
19
+ default: 0
20
+ }
21
+ },
22
+ contents: {
23
+ id: "label",
24
+ nodes: "block+"
25
+ },
26
+ html: `<div class="ui statistic">
27
+ <div class="value" title="[name]">[value|digits:[precision]]</div>
28
+ <div class="label" block-content="label"></div>
29
+ </div>`,
30
+ stylesheets: [
31
+ "../ui/components/statistic.css"
32
+ ]
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.16.3",
3
+ "version": "0.16.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/beacons.js ADDED
@@ -0,0 +1,15 @@
1
+ class HTMLElementBeacons extends Page.create(HTMLMetaElement) {
2
+ paint(state) {
3
+ if (state.scope.$write || state.scope.$read) return;
4
+ const payload = new URLSearchParams();
5
+ let i = 0;
6
+ for (const [key, expr] of Object.entries(state.parse(this.content).query)) {
7
+ const result = `[${expr}]`.fuse({}, state.scope);
8
+ if (result) payload.append('names.' + i++, key);
9
+ }
10
+ if (i > 0) navigator.sendBeacon('/@api/stat/beacons', payload);
11
+ }
12
+ }
13
+
14
+ Page.define('element-beacons', HTMLElementBeacons, "meta");
15
+
package/ui/form.css CHANGED
@@ -32,6 +32,9 @@ element-select.active.ui.dropdown .menu {
32
32
  .ui.form {
33
33
  width: 100%;
34
34
  }
35
+ .layout > .ui.form {
36
+ width: auto;
37
+ }
35
38
  .ui.form .inline.fluid.fields {
36
39
  width:100%;
37
40
  column-gap: 1em;