@pageboard/html 0.14.6 → 0.14.8
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/layout.js +4 -4
- package/elements/link.js +11 -1
- package/elements/menu.js +10 -0
- package/package.json +1 -1
- package/ui/form.js +1 -1
- package/ui/loading.css +5 -1
- package/ui/transition.js +11 -14
package/elements/layout.js
CHANGED
|
@@ -119,7 +119,7 @@ exports.layout = {
|
|
|
119
119
|
title: 'Inline (em)',
|
|
120
120
|
type: 'number',
|
|
121
121
|
default: 0,
|
|
122
|
-
multipleOf: 0.
|
|
122
|
+
multipleOf: 0.01,
|
|
123
123
|
nullable: true
|
|
124
124
|
},
|
|
125
125
|
inlineUnits: {
|
|
@@ -129,7 +129,7 @@ exports.layout = {
|
|
|
129
129
|
title: 'Block (rem)',
|
|
130
130
|
type: 'number',
|
|
131
131
|
default: 0,
|
|
132
|
-
multipleOf: 0.
|
|
132
|
+
multipleOf: 0.01,
|
|
133
133
|
nullable: true
|
|
134
134
|
},
|
|
135
135
|
blockUnits: {
|
|
@@ -147,7 +147,7 @@ exports.layout = {
|
|
|
147
147
|
type: 'number',
|
|
148
148
|
default: 0,
|
|
149
149
|
minimum: 0,
|
|
150
|
-
multipleOf: 0.
|
|
150
|
+
multipleOf: 0.01,
|
|
151
151
|
nullable: true
|
|
152
152
|
},
|
|
153
153
|
inlineUnits: {
|
|
@@ -158,7 +158,7 @@ exports.layout = {
|
|
|
158
158
|
type: 'number',
|
|
159
159
|
default: 0,
|
|
160
160
|
minimum: 0,
|
|
161
|
-
multipleOf: 0.
|
|
161
|
+
multipleOf: 0.01,
|
|
162
162
|
nullable: true
|
|
163
163
|
},
|
|
164
164
|
blockUnits: {
|
package/elements/link.js
CHANGED
|
@@ -21,13 +21,23 @@ exports.link = {
|
|
|
21
21
|
type: ["link", "file", "archive"]
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
},
|
|
25
|
+
lang: {
|
|
26
|
+
title: 'Language',
|
|
27
|
+
type: 'string',
|
|
28
|
+
format: 'lang',
|
|
29
|
+
nullable: true,
|
|
30
|
+
$helper: {
|
|
31
|
+
name: 'datalist',
|
|
32
|
+
url: '/.api/languages'
|
|
33
|
+
}
|
|
24
34
|
}
|
|
25
35
|
},
|
|
26
36
|
contents: "text*",
|
|
27
37
|
inline: true,
|
|
28
38
|
group: "inline",
|
|
29
39
|
tag: 'a:not([block-type]),a[block-type="link"]',
|
|
30
|
-
html: '<a href="[url]" class="[button|alt:ui button]"></a>',
|
|
40
|
+
html: '<a href="[url][lang|pre:.]" hreflang="[lang]" class="[button|alt:ui button]"></a>',
|
|
31
41
|
stylesheets: [
|
|
32
42
|
'../lib/components/button.css'
|
|
33
43
|
]
|
package/elements/menu.js
CHANGED
|
@@ -98,6 +98,16 @@ exports.menu_item_link = {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
+
lang: {
|
|
102
|
+
title: 'Language',
|
|
103
|
+
type: 'string',
|
|
104
|
+
format: 'lang',
|
|
105
|
+
nullable: true,
|
|
106
|
+
$helper: {
|
|
107
|
+
name: 'datalist',
|
|
108
|
+
url: '/.api/languages'
|
|
109
|
+
}
|
|
110
|
+
},
|
|
101
111
|
labeled: {
|
|
102
112
|
title: 'Labeled',
|
|
103
113
|
description: 'Vertical layout',
|
package/package.json
CHANGED
package/ui/form.js
CHANGED
|
@@ -359,7 +359,7 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
|
|
|
359
359
|
form.classList.add('loading');
|
|
360
360
|
scope.$response = await state.fetch(form.method, Page.format({
|
|
361
361
|
pathname: form.getAttribute('action'),
|
|
362
|
-
query:
|
|
362
|
+
query: form.dataset // because patch populates data from parameters
|
|
363
363
|
}), scope.$request);
|
|
364
364
|
} catch (err) {
|
|
365
365
|
scope.$response = err;
|
package/ui/loading.css
CHANGED
package/ui/transition.js
CHANGED
|
@@ -9,6 +9,9 @@ const loader = new class {
|
|
|
9
9
|
ready(state) {
|
|
10
10
|
this.update(state.stage);
|
|
11
11
|
}
|
|
12
|
+
build(state) {
|
|
13
|
+
document.body.hidden = true;
|
|
14
|
+
}
|
|
12
15
|
patch(state) {
|
|
13
16
|
this.update(state);
|
|
14
17
|
}
|
|
@@ -23,6 +26,14 @@ const loader = new class {
|
|
|
23
26
|
update(state) {
|
|
24
27
|
document.documentElement.dataset.stage = state.stage;
|
|
25
28
|
}
|
|
29
|
+
setup(state) {
|
|
30
|
+
const tr = state.scope.transition;
|
|
31
|
+
state.finish(() => {
|
|
32
|
+
document.body.hidden = false;
|
|
33
|
+
if (tr?.ok) return tr.start();
|
|
34
|
+
});
|
|
35
|
+
tr?.end();
|
|
36
|
+
}
|
|
26
37
|
};
|
|
27
38
|
Page.connect(loader);
|
|
28
39
|
loader.update(Page);
|
|
@@ -144,17 +155,3 @@ Page.constructor.prototype.mergeBody = function (body, corpse) {
|
|
|
144
155
|
this.scope.transition = new Transition(this, body, corpse);
|
|
145
156
|
}
|
|
146
157
|
};
|
|
147
|
-
|
|
148
|
-
Page.setup(state => {
|
|
149
|
-
const tr = state.scope.transition;
|
|
150
|
-
if (tr) {
|
|
151
|
-
if (tr.ok) {
|
|
152
|
-
state.finish(() => {
|
|
153
|
-
return tr.start();
|
|
154
|
-
});
|
|
155
|
-
} else {
|
|
156
|
-
tr.end();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
|