@pageboard/html 0.14.12 → 0.14.14

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.
@@ -49,11 +49,11 @@ exports.fieldset_legend = {
49
49
 
50
50
  exports.fieldset_list = {
51
51
  title: 'Field List',
52
+ priority: 2, // after template
52
53
  menu: "form",
53
54
  icon: '<i class="icons"><i class="folder outline icon"></i><i class="corner add icon"></i></i>',
54
55
  group: 'block template',
55
56
  context: 'form//',
56
- priority: 0,
57
57
  properties: {
58
58
  min: {
59
59
  title: 'Min items',
package/elements/image.js CHANGED
@@ -1,6 +1,6 @@
1
1
  exports.image = {
2
2
  title: "Image",
3
- priority: 0,
3
+ priority: -1,
4
4
  menu: 'media',
5
5
  icon: '<i class="icon image"></i>',
6
6
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.14.12",
3
+ "version": "0.14.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/consent.js CHANGED
@@ -38,7 +38,7 @@ class HTMLElementConsent extends Page.create(HTMLFormElement) {
38
38
  }
39
39
  state.scope.storage.set('consent', consent);
40
40
  state.scope.$consent = consent;
41
- state.runChain('consent');
41
+ state.copy().runChain('consent');
42
42
  }
43
43
  handleChange(e, state) {
44
44
  this.handleSubmit(e, state);
@@ -59,10 +59,6 @@ class HTMLElementConsent extends Page.create(HTMLFormElement) {
59
59
  }
60
60
  }
61
61
 
62
-
63
- Page.define(`element-consent`, HTMLElementConsent, 'form');
64
-
65
-
66
62
  Page.constructor.prototype.consent = function (fn) {
67
63
  const initial = this.scope.$consent === undefined;
68
64
  let consent = this.scope.storage.get('consent');
@@ -90,12 +86,18 @@ Page.constructor.prototype.reconsent = function (fn) {
90
86
  return asking;
91
87
  };
92
88
 
89
+ Page.define(`element-consent`, HTMLElementConsent, 'form');
90
+
91
+
93
92
  Page.paint(state => {
94
93
  state.finish(() => {
95
94
  let run = true;
96
95
  if (HTMLElementConsent.waiting) {
97
96
  if (state.reconsent()) run = false;
98
97
  }
99
- if (run) state.runChain('consent');
98
+ if (run) {
99
+ // do not change current state stage
100
+ state.copy().runChain('consent');
101
+ }
100
102
  });
101
103
  });
@@ -6,12 +6,14 @@ class HTMLElementFieldsetList extends Page.Element {
6
6
 
7
7
  fill(values) {
8
8
  if (this.isContentEditable || this.prefix == null) return;
9
+ const vars = [];
9
10
  for (const [key, val] of Object.entries(values)) {
10
11
  const parts = this.#prefixed(key);
11
12
  if (!parts) continue;
12
13
  if (parts.length == 1 && Number.isInteger(Number(parts[0])) && Array.isArray(val)) {
13
14
  console.warn("fielset-list should receive flat lists", key, val);
14
15
  } else if (parts.length == 0 && Array.isArray(val)) {
16
+ vars.push(key);
15
17
  for (let i = 0; i < val.length; i++) {
16
18
  values[key + '.' + i] = val[i];
17
19
  }
@@ -21,6 +23,7 @@ class HTMLElementFieldsetList extends Page.Element {
21
23
  this.#list = this.#listFromValues({ ...values });
22
24
  if (this.#defaultList == null) this.save();
23
25
  this.#resize();
26
+ return vars;
24
27
  }
25
28
 
26
29
  reset() {
package/ui/form.js CHANGED
@@ -194,7 +194,7 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
194
194
  // fieldset-list are not custom inputs yet
195
195
  const vars = [];
196
196
  for (const node of this.querySelectorAll("element-fieldset-list")) {
197
- node?.fill(query);
197
+ if (node.fill) vars.push(...node.fill(query));
198
198
  }
199
199
 
200
200
  for (const elem of this.elements) {