wapplr 1.0.83 → 1.0.84

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.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const tokens = {"log":"log_3MWuJ","logo":"log_36siB"};
6
- tokens._getCss = function () {return `/* imported from log.css */ .log_3MWuJ { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; -webkit-box-sizing: border-box; box-sizing: border-box; padding: 16px; width: 100%; height: 100%; position: absolute; } .log_36siB { height: 128px; max-width: 100%; } .log_3MWuJ > div { width: 100%; text-align: center; } `;};
5
+ const tokens = {"log":"log_3Wi9h","logo":"log_VkVt7"};
6
+ tokens._getCss = function () {return `/* imported from log.css */ .log_3Wi9h { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; -webkit-box-sizing: border-box; box-sizing: border-box; padding: 16px; width: 100%; height: 100%; position: absolute; } .log_VkVt7 { height: 128px; max-width: 100%; } .log_3Wi9h > div { width: 100%; text-align: center; } `;};
7
7
  tokens._module = (typeof module !== "undefined") ? module : {id:"./common/log/log_css.js"};
8
8
  exports["default"] = tokens;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const tokens = {"logo":"logo_d_fdf","icon":"logo_1Trfm","svg":"logo_X5kuq"};
6
- tokens._getCss = function () {return `/* imported from logo.css */ .logo_d_fdf { height: 100%; width: auto; display: -ms-inline-flexbox; display: inline-flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; } .logo_1Trfm { height: 90%; width: auto; } .logo_X5kuq { height: 100%; width: auto; display: -ms-flexbox; display: flex; max-width: 100%; } .logo_X5kuq path{ fill: currentColor; } `;};
5
+ const tokens = {"logo":"logo_3qwrk","icon":"logo_34umO","svg":"logo_2_1PA"};
6
+ tokens._getCss = function () {return `/* imported from logo.css */ .logo_3qwrk { height: 100%; width: auto; display: -ms-inline-flexbox; display: inline-flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; } .logo_34umO { height: 90%; width: auto; } .logo_2_1PA { height: 100%; width: auto; display: -ms-flexbox; display: flex; max-width: 100%; } .logo_2_1PA path{ fill: currentColor; } `;};
7
7
  tokens._module = (typeof module !== "undefined") ? module : {id:"./common/logo/logo_css.js"};
8
8
  exports["default"] = tokens;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = createMiddlewares;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ var _arrayLikeToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/arrayLikeToArray"));
9
10
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
11
  var _log = _interopRequireDefault(require("./log"));
11
12
  var _states = _interopRequireDefault(require("./states"));
@@ -177,7 +178,7 @@ function createWappMiddleware() {
177
178
  attributes[_key] = arguments[_key];
178
179
  }
179
180
  var html = attributes[0],
180
- restAttr = attributes.slice(1);
181
+ restAttr = (0, _arrayLikeToArray2["default"])(attributes).slice(1);
181
182
  wappResponse.sendData = {
182
183
  data: html
183
184
  };
@@ -17,6 +17,60 @@ function createDefaultRouter() {
17
17
  var p = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18
18
  var wapp = p.wapp,
19
19
  routes = p.routes;
20
+ function matchFlexible(rPath, sPath) {
21
+ var rpa = rPath.split("/");
22
+ var pa = sPath.split("/");
23
+ var prefixEnd = 0;
24
+ for (var i = 0; i < rpa.length; i++) {
25
+ var seg = rpa[i];
26
+ if (seg && seg.slice(0, 1) !== ":" && seg !== "*") {
27
+ if (i + 1 < rpa.length && rpa[i + 1] && rpa[i + 1].slice(0, 1) === ":") {
28
+ break;
29
+ }
30
+ prefixEnd = i + 1;
31
+ } else {
32
+ prefixEnd = i + 1;
33
+ }
34
+ }
35
+ for (var _i = 0; _i < prefixEnd; _i++) {
36
+ if (typeof pa[_i] !== "string" || pa[_i] !== rpa[_i]) {
37
+ return null;
38
+ }
39
+ }
40
+ var expectedPairs = {};
41
+ var expectedCount = 0;
42
+ for (var _i2 = prefixEnd; _i2 < rpa.length - 1; _i2 += 2) {
43
+ var key = rpa[_i2];
44
+ var paramSeg = rpa[_i2 + 1];
45
+ if (key && paramSeg && paramSeg.slice(0, 1) === ":") {
46
+ expectedPairs[key] = paramSeg.slice(1);
47
+ expectedCount++;
48
+ }
49
+ }
50
+ var remaining = pa.slice(prefixEnd);
51
+ if (remaining.length % 2 !== 0) {
52
+ return null;
53
+ }
54
+ var actualPairs = {};
55
+ var actualCount = 0;
56
+ for (var _i3 = 0; _i3 < remaining.length; _i3 += 2) {
57
+ actualPairs[remaining[_i3]] = remaining[_i3 + 1];
58
+ actualCount++;
59
+ }
60
+ if (actualCount !== expectedCount) {
61
+ return null;
62
+ }
63
+ var thisParams = {};
64
+ var expectedKeys = Object.keys(expectedPairs);
65
+ for (var k = 0; k < expectedKeys.length; k++) {
66
+ var ek = expectedKeys[k];
67
+ if (typeof actualPairs[ek] === "undefined") {
68
+ return null;
69
+ }
70
+ thisParams[expectedPairs[ek]] = actualPairs[ek];
71
+ }
72
+ return thisParams;
73
+ }
20
74
  function match() {
21
75
  var p = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
22
76
  var path = p.path;
@@ -30,30 +84,38 @@ function createDefaultRouter() {
30
84
  try {
31
85
  var rPath = r.path.slice(-1) === "/" ? r.path.slice(0, -1) : r.path;
32
86
  var sPath = path.slice(-1) === "/" ? path.slice(0, -1) : path;
33
- var rpa = rPath.split("/");
34
- var pa = sPath.split("/");
35
- var allPartIsMatch = true;
36
- var wasAllowChar = false;
37
- rpa.forEach(function (rpas, i) {
38
- var param = rpas && rpas.slice(0, 1) === ":";
39
- var allow = rpas === "*";
40
- if (allow) {
41
- wasAllowChar = true;
87
+ if (r.flexibleParams) {
88
+ var flexResult = matchFlexible(rPath, sPath);
89
+ if (flexResult) {
90
+ thisParams = flexResult;
91
+ _match = true;
42
92
  }
43
- if (typeof pa[i] == "string") {
44
- if (pa[i] === rpas || param || allow) {} else {
45
- allPartIsMatch = false;
93
+ } else {
94
+ var rpa = rPath.split("/");
95
+ var pa = sPath.split("/");
96
+ var allPartIsMatch = true;
97
+ var wasAllowChar = false;
98
+ rpa.forEach(function (rpas, i) {
99
+ var param = rpas && rpas.slice(0, 1) === ":";
100
+ var allow = rpas === "*";
101
+ if (allow) {
102
+ wasAllowChar = true;
46
103
  }
47
- if (param) {
48
- thisParams[rpas.slice(1)] = pa[i];
104
+ if (typeof pa[i] == "string") {
105
+ if (pa[i] === rpas || param || allow) {} else {
106
+ allPartIsMatch = false;
107
+ }
108
+ if (param) {
109
+ thisParams[rpas.slice(1)] = pa[i];
110
+ }
49
111
  }
112
+ });
113
+ if (pa.length > rpa.length && !wasAllowChar) {
114
+ allPartIsMatch = false;
115
+ }
116
+ if (allPartIsMatch) {
117
+ _match = true;
50
118
  }
51
- });
52
- if (pa.length > rpa.length && !wasAllowChar) {
53
- allPartIsMatch = false;
54
- }
55
- if (allPartIsMatch) {
56
- _match = true;
57
119
  }
58
120
  } catch (e) {}
59
121
  if (_match && !route) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const tokens = {"app":"app_TgHI7"};
6
- tokens._getCss = function () {return `/* imported from app.css */ body { margin: 0; padding: 0; max-width: 100vw; overflow-x: hidden; } * { -webkit-box-sizing: border-box; box-sizing: border-box; } .app_TgHI7 { font-size: 14px; color: rgba(0,0,0,0.87); display: block; position: relative; overflow-x: hidden; } div.app_TgHI7 > * { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } @media (orientation: portrait) { .app_TgHI7 { max-width: 100vh; } } `;};
5
+ const tokens = {"app":"app_2f0Nm"};
6
+ tokens._getCss = function () {return `/* imported from app.css */ body { margin: 0; padding: 0; max-width: 100vw; overflow-x: hidden; } * { -webkit-box-sizing: border-box; box-sizing: border-box; } .app_2f0Nm { font-size: 14px; color: rgba(0,0,0,0.87); display: block; position: relative; overflow-x: hidden; } div.app_2f0Nm > * { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } @media (orientation: portrait) { .app_2f0Nm { max-width: 100vh; } } `;};
7
7
  tokens._module = (typeof module !== "undefined") ? module : {id:"./common/template/app_css.js"};
8
8
  exports["default"] = tokens;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const tokens = {"page":"template_3HXPB","header":"template_3ck2q","sticky":"template_2Nz4A","innerHeader":"template_3nJPj","logo":"template_rKBgA","content":"template_1zK-k","footer":"template_3Rlwa","menu":"template_1r1_q","button":"template_1iINl","copyright":"template_3y44t"};
6
- tokens._getCss = function () {return `/* imported from template.css */ .template_3HXPB { display: block; position: relative; overflow-x: hidden; overflow-y: hidden; min-height: 100vh; max-width: 100vw; } .template_3ck2q { display: block; position: fixed; width: 100%; height: 64px; padding: 6px; background: white; z-index: 1; -webkit-transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; } .template_3ck2q.template_2Nz4A { -webkit-box-shadow: 0 2px 3px rgba(62, 62, 62, 0.15); box-shadow: 0 2px 3px rgba(62, 62, 62, 0.15); } .template_3nJPj { display: block; width: 100%; height: 100%; position: relative; overflow: hidden; } .template_3ck2q .template_rKBgA { height: 52px; -webkit-transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; margin-top: 100%; } .template_3ck2q.template_2Nz4A .template_rKBgA { margin-top: 0; } .template_1zK-k { min-height: 100vh; position: relative; padding-top: 64px; } .template_3Rlwa { display: -ms-flexbox; display: flex; min-height: 128px; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; } .template_1r1_q { } .template_1r1_q > div { } .template_3Rlwa .template_1r1_q { -ms-flex-pack: center; justify-content: center; display: -ms-flexbox; display: flex; } .template_3Rlwa .template_1r1_q > div { display: inline-block; } .template_1iINl { color: rgba(0, 0, 0, 0.87); padding: 6px 16px; font-size: 14px; font-size: 0.875rem; min-width: 64px; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,-webkit-box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,-webkit-box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,-webkit-box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; line-height: 1.75; border-radius: 4px; letter-spacing: 0.02857em; text-transform: uppercase; font-weight: bold; border: 0; cursor: pointer; margin: 0; display: -ms-inline-flexbox; display: inline-flex; outline: 0; position: relative; -ms-flex-align: center; align-items: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; vertical-align: middle; -ms-flex-pack: center; justify-content: center; text-decoration: none; background-color: transparent; text-align: center; } a.template_1iINl { text-decoration: none; } .template_3y44t { font-size: 12px; margin: 24px; text-align: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } `;};
5
+ const tokens = {"page":"template_2pYWt","header":"template_2eiGu","sticky":"template_3UDsg","innerHeader":"template_3kWDb","logo":"template_qf6kn","content":"template_mZfJ1","footer":"template_3WkoV","menu":"template__Jeh1","button":"template_2AgIs","copyright":"template_1_9QV"};
6
+ tokens._getCss = function () {return `/* imported from template.css */ .template_2pYWt { display: block; position: relative; overflow-x: hidden; overflow-y: hidden; min-height: 100vh; max-width: 100vw; } .template_2eiGu { display: block; position: fixed; width: 100%; height: 64px; padding: 6px; background: white; z-index: 1; -webkit-transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; } .template_2eiGu.template_3UDsg { -webkit-box-shadow: 0 2px 3px rgba(62, 62, 62, 0.15); box-shadow: 0 2px 3px rgba(62, 62, 62, 0.15); } .template_3kWDb { display: block; width: 100%; height: 100%; position: relative; overflow: hidden; } .template_2eiGu .template_qf6kn { height: 52px; -webkit-transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; margin-top: 100%; } .template_2eiGu.template_3UDsg .template_qf6kn { margin-top: 0; } .template_mZfJ1 { min-height: 100vh; position: relative; padding-top: 64px; } .template_3WkoV { display: -ms-flexbox; display: flex; min-height: 128px; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; } .template__Jeh1 { } .template__Jeh1 > div { } .template_3WkoV .template__Jeh1 { -ms-flex-pack: center; justify-content: center; display: -ms-flexbox; display: flex; } .template_3WkoV .template__Jeh1 > div { display: inline-block; } .template_2AgIs { color: rgba(0, 0, 0, 0.87); padding: 6px 16px; font-size: 14px; font-size: 0.875rem; min-width: 64px; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,-webkit-box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,-webkit-box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,-webkit-box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; line-height: 1.75; border-radius: 4px; letter-spacing: 0.02857em; text-transform: uppercase; font-weight: bold; border: 0; cursor: pointer; margin: 0; display: -ms-inline-flexbox; display: inline-flex; outline: 0; position: relative; -ms-flex-align: center; align-items: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; vertical-align: middle; -ms-flex-pack: center; justify-content: center; text-decoration: none; background-color: transparent; text-align: center; } a.template_2AgIs { text-decoration: none; } .template_1_9QV { font-size: 12px; margin: 24px; text-align: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } `;};
7
7
  tokens._module = (typeof module !== "undefined") ? module : {id:"./common/template/template_css.js"};
8
8
  exports["default"] = tokens;
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "files": [
23
23
  "dist/*"
24
24
  ],
25
- "version": "1.0.83",
25
+ "version": "1.0.84",
26
26
  "main": "dist/server",
27
27
  "browser": "dist/client",
28
28
  "repository": {