@pageboard/html 0.10.15 → 0.10.18

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/elements/card.js CHANGED
@@ -18,7 +18,7 @@ exports.cards = {
18
18
  shape: {
19
19
  title: 'Shape',
20
20
  anyOf: [{
21
- type: 'null',
21
+ const: null,
22
22
  title: 'Default',
23
23
  }, {
24
24
  const: "square",
@@ -33,9 +33,8 @@ exports.cards = {
33
33
  },
34
34
  responsive: {
35
35
  title: 'Responsive',
36
- nullable: true,
37
36
  anyOf: [{
38
- title: 'Disable',
37
+ title: 'No',
39
38
  const: null
40
39
  }, {
41
40
  title: 'Stackable',
package/elements/form.js CHANGED
@@ -92,7 +92,7 @@ exports.api_form = {
92
92
  title: 'Method',
93
93
  nullable: true,
94
94
  type: "string",
95
- pattern: "^(\\w+\\.\\w+)?$"
95
+ pattern: /^(\w+\.\w+)?$/.source
96
96
  },
97
97
  parameters: {
98
98
  title: 'Parameters',
package/elements/grid.js CHANGED
@@ -17,8 +17,10 @@ exports.grid = {
17
17
  },
18
18
  responsive: {
19
19
  title: 'Responsive',
20
- nullable: true,
21
20
  anyOf: [{
21
+ title: 'No',
22
+ const: null
23
+ }, {
22
24
  title: 'Stackable',
23
25
  const: 'stackable'
24
26
  }, {
@@ -67,9 +69,8 @@ exports.grid_row = {
67
69
  properties: {
68
70
  responsive: {
69
71
  title: 'Responsive',
70
- nullable: true,
71
72
  anyOf: [{
72
- title: 'Disable',
73
+ title: 'No',
73
74
  const: null
74
75
  }, {
75
76
  title: 'Stackable',
package/elements/image.js CHANGED
@@ -12,8 +12,9 @@ exports.image = {
12
12
  url: {
13
13
  title: 'Address',
14
14
  description: 'Local or remote URL',
15
- nullable: true,
16
15
  anyOf: [{
16
+ type: "null"
17
+ }, {
17
18
  type: "string",
18
19
  format: "uri"
19
20
  }, {
@@ -156,8 +157,9 @@ exports.inlineImage = {
156
157
  url: {
157
158
  title: 'Address',
158
159
  description: 'Local or remote URL',
159
- nullable: true,
160
160
  anyOf: [{
161
+ type: "null"
162
+ }, {
161
163
  type: "string",
162
164
  format: "uri"
163
165
  }, {
@@ -156,8 +156,8 @@ exports.input_text = {
156
156
  nodes: 'inline*'
157
157
  },
158
158
  patterns: {
159
- tel: '^(\\(\\d+\\))? *\\d+([ .\\-]?\\d+)*$',
160
- email: '^[\\w.!#$%&\'*+\\/=?^`{|}~-]+@\\w(?:[\\w-]{0,61}\\w)?(?:\\.\\w(?:[\\w-]{0,61}\\w)?)*$'
159
+ tel: /^(\(\d+\))? *\d+([ .\-]?\d+)*$/.source,
160
+ email: /^[\w.!#$%&'*+\/=?^`{|}~-]+@\w(?:[\w-]{0,61}\w)?(?:\.\w(?:[\w-]{0,61}\w)?)*$/.source
161
161
  },
162
162
  html: `<div class="[width|num: wide] field [type|eq:hidden:hidden:]">
163
163
  <label block-content="label">Label</label>
@@ -106,8 +106,9 @@ exports.layout = {
106
106
  image: {
107
107
  title: 'Image',
108
108
  description: 'Local or remote URL',
109
- nullable: true,
110
109
  anyOf: [{
110
+ type: "null"
111
+ }, {
111
112
  type: "string",
112
113
  format: "uri"
113
114
  }, {
@@ -168,7 +169,7 @@ exports.layout = {
168
169
  size: {
169
170
  title: 'Size',
170
171
  anyOf: [{
171
- type: 'null',
172
+ const: null,
172
173
  title: 'Auto'
173
174
  }, {
174
175
  const: 'cover',
@@ -181,7 +182,7 @@ exports.layout = {
181
182
  position: {
182
183
  title: 'Position',
183
184
  anyOf: [{
184
- type: 'null',
185
+ const: null,
185
186
  title: 'Top Left'
186
187
  }, {
187
188
  const: 'top center',
@@ -212,7 +213,7 @@ exports.layout = {
212
213
  repeat: {
213
214
  title: 'Repeat',
214
215
  anyOf: [{
215
- type: 'null',
216
+ const: null,
216
217
  title: 'Repeat'
217
218
  }, {
218
219
  const: 'no-repeat',
@@ -234,7 +235,7 @@ exports.layout = {
234
235
  attachment: {
235
236
  title: 'Attachment',
236
237
  anyOf: [{
237
- type: 'null',
238
+ const: null,
238
239
  title: 'Local'
239
240
  }, {
240
241
  const: 'scroll',
package/elements/media.js CHANGED
@@ -8,8 +8,9 @@ exports.video = {
8
8
  url: {
9
9
  title: 'Address',
10
10
  description: 'Local or remote URL',
11
- nullable: true,
12
11
  anyOf: [{
12
+ type: "null"
13
+ }, {
13
14
  type: "string",
14
15
  format: "uri"
15
16
  }, {
@@ -88,8 +89,9 @@ exports.audio = {
88
89
  url: {
89
90
  title: 'Address',
90
91
  description: 'Local or remote URL',
91
- nullable: true,
92
92
  anyOf: [{
93
+ type: "null"
94
+ }, {
93
95
  type: "string",
94
96
  format: "uri"
95
97
  }, {
package/elements/menu.js CHANGED
@@ -9,7 +9,6 @@ exports.menu = {
9
9
  properties: {
10
10
  direction: {
11
11
  title: 'Direction',
12
- nullable: true,
13
12
  anyOf: [{
14
13
  const: null,
15
14
  title: "Horizontal"
@@ -37,7 +36,6 @@ exports.menu_group = {
37
36
  properties: {
38
37
  position: {
39
38
  title: 'Position',
40
- nullable: true,
41
39
  anyOf: [{
42
40
  const: null,
43
41
  title: "Left"
@@ -153,7 +151,6 @@ exports.menu_item_dropdown = {
153
151
  properties: {
154
152
  position: {
155
153
  title: 'Position',
156
- nullable: true,
157
154
  anyOf: [{
158
155
  const: null,
159
156
  title: "Left"
package/elements/page.js CHANGED
@@ -16,9 +16,8 @@ exports.page.properties.transition = {
16
16
  properties: {
17
17
  close: {
18
18
  title: 'Close',
19
- nullable: true,
20
19
  anyOf: [{
21
- type: 'null',
20
+ const: null,
22
21
  title: 'None'
23
22
  }, {
24
23
  const: 'tr-up',
@@ -39,9 +38,8 @@ exports.page.properties.transition = {
39
38
  },
40
39
  open: {
41
40
  title: 'Open',
42
- nullable: true,
43
41
  anyOf: [{
44
- type: 'null',
42
+ const: null,
45
43
  title: 'None'
46
44
  }, {
47
45
  const: 'tr-up',
@@ -128,7 +128,7 @@ exports.heading = {
128
128
  id: {
129
129
  nullable: true,
130
130
  type: 'string',
131
- pattern: '^[a-z0-9-]*$'
131
+ pattern: /^[a-z0-9-]*$/.source
132
132
  }
133
133
  },
134
134
  contents: {
@@ -27,7 +27,7 @@ exports.rating = {
27
27
  title: 'Color',
28
28
  anyOf: [{
29
29
  title: 'Default',
30
- type: 'null'
30
+ const: null
31
31
  }, {
32
32
  title: 'Star',
33
33
  const: "star"
package/lib/nouislider.js CHANGED
@@ -714,6 +714,7 @@
714
714
  var hover = entry.indexOf("hover") >= 0;
715
715
  var unconstrained = entry.indexOf("unconstrained") >= 0;
716
716
  var dragAll = entry.indexOf("drag-all") >= 0;
717
+ var smoothSteps = entry.indexOf("smooth-steps") >= 0;
717
718
  if (fixed) {
718
719
  if (parsed.handles !== 2) {
719
720
  throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");
@@ -728,6 +729,7 @@
728
729
  tap: tap || snap,
729
730
  drag: drag,
730
731
  dragAll: dragAll,
732
+ smoothSteps: smoothSteps,
731
733
  fixed: fixed,
732
734
  snap: snap,
733
735
  hover: hover,
@@ -1472,6 +1474,14 @@
1472
1474
  scope_Body.removeEventListener("selectstart", preventDefault);
1473
1475
  }
1474
1476
  }
1477
+ if (options.events.smoothSteps) {
1478
+ data.handleNumbers.forEach(function (handleNumber) {
1479
+ setHandle(handleNumber, scope_Locations[handleNumber], true, true, false, false);
1480
+ });
1481
+ data.handleNumbers.forEach(function (handleNumber) {
1482
+ fireEvent("update", handleNumber);
1483
+ });
1484
+ }
1475
1485
  data.handleNumbers.forEach(function (handleNumber) {
1476
1486
  fireEvent("change", handleNumber);
1477
1487
  fireEvent("set", handleNumber);
@@ -1771,7 +1781,7 @@
1771
1781
  });
1772
1782
  }
1773
1783
  // Split out the handle positioning logic so the Move event can use it, too
1774
- function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue) {
1784
+ function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue, smoothSteps) {
1775
1785
  var distance;
1776
1786
  // For sliders with multiple handles, limit movement to the other handle.
1777
1787
  // Apply the margin option by adding it to the handle positions.
@@ -1810,7 +1820,9 @@
1810
1820
  to = Math.min(to, distance);
1811
1821
  }
1812
1822
  }
1813
- to = scope_Spectrum.getStep(to);
1823
+ if (!smoothSteps) {
1824
+ to = scope_Spectrum.getStep(to);
1825
+ }
1814
1826
  // Limit percentage to the 0 - 100 range
1815
1827
  to = limit(to);
1816
1828
  // Return false if handle can't move
@@ -1830,6 +1842,7 @@
1830
1842
  var proposals = locations.slice();
1831
1843
  // Store first handle now, so we still have it in case handleNumbers is reversed
1832
1844
  var firstHandle = handleNumbers[0];
1845
+ var smoothSteps = options.events.smoothSteps;
1833
1846
  var b = [!upward, upward];
1834
1847
  var f = [upward, !upward];
1835
1848
  // Copy handleNumbers so we don't change the dataset
@@ -1842,7 +1855,7 @@
1842
1855
  // Step 1: get the maximum percentage that any of the handles can move
1843
1856
  if (handleNumbers.length > 1) {
1844
1857
  handleNumbers.forEach(function (handleNumber, o) {
1845
- var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false);
1858
+ var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false, smoothSteps);
1846
1859
  // Stop if one of the handles can't move.
1847
1860
  if (to === false) {
1848
1861
  proposal = 0;
@@ -1860,7 +1873,8 @@
1860
1873
  var state = false;
1861
1874
  // Step 2: Try to set the handles with the found percentage
1862
1875
  handleNumbers.forEach(function (handleNumber, o) {
1863
- state = setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o]) || state;
1876
+ state =
1877
+ setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o], false, smoothSteps) || state;
1864
1878
  });
1865
1879
  // Step 3: If a handle moved, fire events
1866
1880
  if (state) {
@@ -1905,9 +1919,9 @@
1905
1919
  }
1906
1920
  // Test suggested values and apply margin, step.
1907
1921
  // if exactInput is true, don't run checkHandlePosition, then the handle can be placed in between steps (#436)
1908
- function setHandle(handleNumber, to, lookBackward, lookForward, exactInput) {
1922
+ function setHandle(handleNumber, to, lookBackward, lookForward, exactInput, smoothSteps) {
1909
1923
  if (!exactInput) {
1910
- to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false);
1924
+ to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false, smoothSteps);
1911
1925
  }
1912
1926
  if (to === false) {
1913
1927
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.10.15",
3
+ "version": "0.10.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/ui/menu.css CHANGED
@@ -45,14 +45,19 @@
45
45
  display: flex;
46
46
  flex-direction: column;
47
47
  }
48
+ .right.burger .popup.item > .placer {
49
+ left: 0;
50
+ right:0;
51
+ }
48
52
  .right.popup.item > .placer > div {
49
53
  left:auto;
50
54
  right:0;
51
55
  }
56
+ .fixed.popup.item {
57
+ position:static !important;
58
+ }
52
59
  .fixed.popup.item > .placer > div {
53
- position:fixed;
54
- max-width: 100%;
55
- max-height: 100%;
60
+ max-width: 100vw;
56
61
  }
57
62
  .center.popup.item > .placer > div {
58
63
  transform: translateX(-50%);
@@ -79,7 +84,6 @@
79
84
 
80
85
  /* menu_group */
81
86
  element-menu {
82
- position: relative;
83
87
  flex-shrink: 1;
84
88
  }
85
89
  .ui.menu:not(.vertical) > element-menu {
@@ -96,12 +100,12 @@ element-menu > [block-content="items"] {
96
100
  display:flex;
97
101
  }
98
102
  element-menu.burger > [block-content="items"] {
99
- position: fixed;
100
103
  left:0;
101
104
  }
102
105
  element-menu.burger.right > [block-content="items"] {
103
- left:auto;
104
- right: 0;
106
+ position: absolute;
107
+ pointer-events: none;
108
+ height: 0;
105
109
  }
106
110
 
107
111
  element-menu:not(.burger) > .item {
@@ -114,6 +118,9 @@ element-menu.burger .placer .title {
114
118
  element-menu.burger > .item .popup.item {
115
119
  display:block;
116
120
  }
121
+ .ui.menu [block-type="menu_item_popup"] {
122
+ position:initial !important;
123
+ }
117
124
  element-menu.burger .placer .popup.active .title {
118
125
  margin-bottom:0.5em;
119
126
  }
@@ -123,6 +130,10 @@ element-menu.burger > [block-content="items"] > * {
123
130
  element-menu.burger .popup.item.active > .placer > div {
124
131
  display:block;
125
132
  }
133
+ element-menu.burger .popup.item > .placer > div {
134
+ left: 0 !important;
135
+ right: 0 !important;
136
+ }
126
137
  element-menu.burger > .item .dropdown.item:hover > .menu,
127
138
  element-menu.burger > .item .popup.item:hover > .placer > div {
128
139
  display:none !important;
@@ -135,8 +146,8 @@ element-menu.burger > .item .dropdown.item.active > .menu {
135
146
  }
136
147
 
137
148
  element-menu.burger > .item .popup.item.active > .placer > div {
138
- display:block !important;
139
- position:relative;
149
+ display: block !important;
150
+ position: relative;
140
151
  }
141
152
  element-menu.burger > .item:hover > .popup.item {
142
153
  display:block;
@@ -147,7 +158,7 @@ element-menu.burger > .item .placer .menu .ui.dropdown {
147
158
  }
148
159
 
149
160
  element-menu.burger > .item .popup.item > .placer {
150
- position:relative;
161
+ position: relative;
151
162
  }
152
163
  element-menu.burger > .item .popup.item > .placer > div > .grid {
153
164
  border:0 !important;
@@ -159,9 +170,7 @@ element-menu.burger > .popup > .icon {
159
170
  font-weight: bold;
160
171
  font-family: sans-serif;
161
172
  }
162
- element-menu.burger > .popup > .placer > .menu {
163
- right:auto; /* disables the right:0 given by .popup > .placer > div */
164
- }
173
+
165
174
 
166
175
  @media screen and (max-width: 768px) {
167
176
  .ui.menu [block-type="menu_item_text"] {
package/ui/menu.js CHANGED
@@ -33,7 +33,7 @@ class HTMLElementMenu extends VirtualHTMLElement {
33
33
  const styles = window.getComputedStyle(this);
34
34
  const parentWidth = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight) + this.offsetWidth;
35
35
  const menuWidth = menu.offsetWidth;
36
- this.classList.toggle('burger', parentWidth <= menuWidth);
36
+ this.classList.toggle('burger', menuWidth >= parentWidth);
37
37
  });
38
38
  });
39
39
  this.observer.observe(this.parentNode);
@@ -55,9 +55,9 @@ class HTMLElementMenu extends VirtualHTMLElement {
55
55
  tosser.classList.add('inactive');
56
56
  tosser.blur();
57
57
  } else {
58
- const padding = this.offsetTop + this.offsetHeight;
59
- const menu = tosser.lastElementChild.lastElementChild;
60
- menu.style.maxHeight = `calc(100% - ${padding}px)`;
58
+ const placer = tosser.lastElementChild;
59
+ const padding = placer.offsetTop;
60
+ placer.lastElementChild.style.maxHeight = `calc(100vh - ${padding}px)`;
61
61
  }
62
62
  } else if (item) {
63
63
  this.active = item != this.active ? item : null;