@appsoftwareltd/etherpk-extension-api 0.39.0 → 0.41.0
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/README.md +5 -3
- package/controls.css +81 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -418,7 +418,7 @@ thumbnail.addEventListener('click', () => void context.assets.viewImages({ refs:
|
|
|
418
418
|
### Icons
|
|
419
419
|
|
|
420
420
|
`context.icons.svg(name)` draws one of the extension's own icons or one of the Client's, as markup the
|
|
421
|
-
Client trusts. The Client's icons, which every `icon` field may name too, are `alias`, `archive`, `backlinks`, `bold`, `book`, `bookmark`, `bullet`, `calendar`, `check`, `clock`, `close`, `code`, `copy`, `download`, `ebook-back`, `ebook-read-aloud`, `ebook-text-size`, `fit`, `flag`, `fold`, `frontmatter`, `globe`, `graph`, `grip`, `headless-client`, `highlight`, `hourglass`, `image`, `import`, `indent`, `italic`, `list`, `lock`, `lock-open`, `more`, `move`, `move-down`, `move-up`, `new-page`, `open-external`, `outdent`, `page`, `pdf`, `pdf-eraser`, `pdf-hand`, `pdf-highlighter`, `pdf-note`, `pdf-page-next`, `pdf-page-previous`, `pdf-full-screen-exit`, `pdf-save`, `pdf-select`, `pdf-pen`, `pdf-print`, `pdf-signature`, `pageless`, `pane-below`, `pane-right`, `pin`, `quick-notes`, `redo`, `rename`, `reset`, `search`, `slash`, `spell-check`, `table`, `table-add-column`, `table-add-row`, `table-format`, `table-remove-column`, `table-remove-row`, `tag`, `task`, `task-reference`, `template`, `text-lines`, `today`, `todays-journal`, `tomorrow`, `trash`, `undo`, `view-larger`, `wikilink-close`, `wikilink-open`, `yesterday`, `zoom-in`, `zoom-out`. An
|
|
421
|
+
Client trusts. The Client's icons, which every `icon` field may name too, are `alias`, `archive`, `backlinks`, `bold`, `book`, `bookmark`, `bullet`, `calendar`, `check`, `clock`, `close`, `code`, `copy`, `download`, `ebook-back`, `ebook-read-aloud`, `ebook-text-size`, `filter`, `fit`, `flag`, `fold`, `frontmatter`, `globe`, `graph`, `grip`, `headless-client`, `highlight`, `hourglass`, `image`, `import`, `indent`, `italic`, `list`, `lock`, `lock-open`, `more`, `move`, `move-down`, `move-up`, `new-page`, `open-external`, `outdent`, `page`, `pdf`, `pdf-eraser`, `pdf-hand`, `pdf-highlighter`, `pdf-note`, `pdf-page-next`, `pdf-page-previous`, `pdf-full-screen-exit`, `pdf-save`, `pdf-select`, `pdf-pen`, `pdf-print`, `pdf-signature`, `pageless`, `pane-below`, `pane-right`, `pin`, `quick-notes`, `redo`, `rename`, `reset`, `search`, `slash`, `spell-check`, `table`, `table-add-column`, `table-add-row`, `table-format`, `table-remove-column`, `table-remove-row`, `tag`, `task`, `task-reference`, `template`, `text-lines`, `today`, `todays-journal`, `tomorrow`, `trash`, `undo`, `view-larger`, `wikilink-close`, `wikilink-open`, `yesterday`, `zoom-in`, `zoom-out`. An
|
|
422
422
|
icon may be added in a later release, never taken away. An unknown name draws a small dot.
|
|
423
423
|
|
|
424
424
|
### Settings sections
|
|
@@ -540,7 +540,8 @@ extension's own tests.
|
|
|
540
540
|
| `gk-button--primary` | With `gk-button`, the one main action of a form or dialog. |
|
|
541
541
|
| `gk-button--danger` | With `gk-button`, an action that removes or ends something. |
|
|
542
542
|
| `gk-button--quiet` | With `gk-button`, a button with no border, in a toolbar or beside other text. |
|
|
543
|
-
| `gk-button--
|
|
543
|
+
| `gk-button--emphasis` | With `gk-button`, the one action a page most wants taken, in emerald. Use it rarely: a plan to choose on a pricing page. |
|
|
544
|
+
| `gk-button--small` | With `gk-button`, a button in a toolbar or on a row of controls, 30px tall, as a small field is. |
|
|
544
545
|
| `gk-button--raised` | With `gk-button` or `gk-icon-button`, a button over content such as a map, a picture or code: a solid surface and a small shadow. |
|
|
545
546
|
| `gk-icon-button` | A square button holding only an icon. Give it an `aria-label`. |
|
|
546
547
|
| `gk-link` | A `<button>` or `<a>` that reads as a link: the accent colour, underlined. |
|
|
@@ -548,8 +549,9 @@ extension's own tests.
|
|
|
548
549
|
| `gk-label` | A field's `<label>`. |
|
|
549
550
|
| `gk-hint` | Help text under a field. |
|
|
550
551
|
| `gk-error` | An error under a field. Set `aria-invalid="true"` on the control too. |
|
|
551
|
-
| `gk-input` | An `<input>` or `<textarea>`, the full width of its column. |
|
|
552
|
+
| `gk-input` | An `<input>` or `<textarea>`, the full width of its column. A field and a select have the same fill, border and height. |
|
|
552
553
|
| `gk-select` | A `<select>`. Where the browser can, it draws the option list in the menu's colours, with `<optgroup>` labels and a tick on the chosen option. Elsewhere it shows the browser's own list. |
|
|
554
|
+
| `gk-input--small`, `gk-select--small` | With `gk-input` or `gk-select`, a field or a select in a toolbar or on a row of controls, 30px tall. |
|
|
553
555
|
| `gk-checkbox` | An `<input type="checkbox">`. |
|
|
554
556
|
| `gk-menu` | A list of actions, such as a menu a button opens. |
|
|
555
557
|
| `gk-menu-item` | A row of a `gk-menu`. |
|
package/controls.css
CHANGED
|
@@ -18,13 +18,16 @@
|
|
|
18
18
|
@layer components {
|
|
19
19
|
/* ── Buttons ─────────────────────────────────────────────────────────────── */
|
|
20
20
|
|
|
21
|
-
/* The everyday button: a thin border, in the control ink, filled faintly on hover.
|
|
21
|
+
/* The everyday button: a thin border, in the control ink, filled faintly on hover. As tall as a
|
|
22
|
+
field (38px), so a row of the two lines up, and never narrower than twice its height or so:
|
|
23
|
+
a short label ("OK", "Save") does not draw a square. */
|
|
22
24
|
.gk-button {
|
|
23
25
|
display: inline-flex;
|
|
24
26
|
align-items: center;
|
|
25
27
|
justify-content: center;
|
|
26
28
|
gap: 0.375rem;
|
|
27
|
-
|
|
29
|
+
min-width: 5rem;
|
|
30
|
+
padding: 0.5rem 0.75rem;
|
|
28
31
|
border: 1px solid var(--gk-control-border);
|
|
29
32
|
border-radius: 0.5rem;
|
|
30
33
|
background: transparent;
|
|
@@ -72,6 +75,25 @@
|
|
|
72
75
|
color: var(--gk-text-muted);
|
|
73
76
|
}
|
|
74
77
|
|
|
78
|
+
/* The one action a page most wants taken, where the primary button is not enough: a plan to
|
|
79
|
+
choose on a pricing page. Emerald in both themes, used rarely. */
|
|
80
|
+
.gk-button--emphasis {
|
|
81
|
+
border-color: var(--gk-emphasis-bg);
|
|
82
|
+
background: var(--gk-emphasis-bg);
|
|
83
|
+
color: var(--gk-emphasis-text);
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
}
|
|
86
|
+
.gk-button--emphasis:hover {
|
|
87
|
+
border-color: var(--gk-emphasis-hover);
|
|
88
|
+
background: var(--gk-emphasis-hover);
|
|
89
|
+
}
|
|
90
|
+
.gk-button--emphasis:disabled,
|
|
91
|
+
.gk-button--emphasis[aria-disabled='true'] {
|
|
92
|
+
border-color: var(--gk-surface-2);
|
|
93
|
+
background: var(--gk-surface-2);
|
|
94
|
+
color: var(--gk-text-muted);
|
|
95
|
+
}
|
|
96
|
+
|
|
75
97
|
/* An action that removes or ends something. */
|
|
76
98
|
.gk-button--danger {
|
|
77
99
|
border-color: var(--gk-danger-border);
|
|
@@ -81,21 +103,26 @@
|
|
|
81
103
|
background: var(--gk-danger-hover);
|
|
82
104
|
}
|
|
83
105
|
|
|
84
|
-
/* A button with no border, in a toolbar or beside other text.
|
|
106
|
+
/* A button with no border, in a toolbar or beside other text. It keeps the height of a button
|
|
107
|
+
of its size, so it lines up with the one beside it, and has less room at its sides. */
|
|
85
108
|
.gk-button--quiet {
|
|
86
|
-
padding: 0.
|
|
109
|
+
padding-inline: 0.5rem;
|
|
87
110
|
border-color: transparent;
|
|
88
|
-
border-radius: 0.375rem;
|
|
89
111
|
color: var(--gk-text-muted);
|
|
90
112
|
}
|
|
113
|
+
/* It reads as text, so it has no minimum width, at either size. */
|
|
114
|
+
.gk-button.gk-button--quiet {
|
|
115
|
+
min-width: 0;
|
|
116
|
+
}
|
|
91
117
|
.gk-button--quiet:hover {
|
|
92
118
|
background: var(--gk-menu-hover);
|
|
93
119
|
color: var(--gk-text-strong);
|
|
94
120
|
}
|
|
95
121
|
|
|
96
|
-
/* A button on
|
|
122
|
+
/* A button in a toolbar or on a row of controls: 30px tall, as a small field is. */
|
|
97
123
|
.gk-button--small {
|
|
98
|
-
|
|
124
|
+
min-width: 3.75rem;
|
|
125
|
+
padding: 0.25rem 0.5rem;
|
|
99
126
|
border-radius: 0.375rem;
|
|
100
127
|
}
|
|
101
128
|
|
|
@@ -112,19 +139,17 @@
|
|
|
112
139
|
.gk-button--raised:hover {
|
|
113
140
|
background: linear-gradient(var(--gk-control-hover), var(--gk-control-hover)), var(--gk-surface-0);
|
|
114
141
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/* A toggle that is on (`aria-pressed="true"`) is drawn as the primary button, as the Client's
|
|
120
|
-
own toggles are. Raised or not: they come after `gk-button--raised`, and outweigh it. */
|
|
142
|
+
/* A toggle that is on (`aria-pressed="true"`), or a link to where the person is
|
|
143
|
+
(`aria-current`), is drawn as the primary button, as the Client's own toggles are. Raised or not: they come after `gk-button--raised`, and outweigh it. */
|
|
121
144
|
.gk-button[aria-pressed='true'],
|
|
145
|
+
.gk-button[aria-current]:not([aria-current='false']),
|
|
122
146
|
.gk-icon-button[aria-pressed='true'] {
|
|
123
147
|
border-color: var(--gk-primary-bg);
|
|
124
148
|
background: var(--gk-primary-bg);
|
|
125
149
|
color: var(--gk-primary-text);
|
|
126
150
|
}
|
|
127
151
|
.gk-button[aria-pressed='true']:hover,
|
|
152
|
+
.gk-button[aria-current]:not([aria-current='false']):hover,
|
|
128
153
|
.gk-icon-button[aria-pressed='true']:hover {
|
|
129
154
|
border-color: var(--gk-primary-hover);
|
|
130
155
|
background: var(--gk-primary-hover);
|
|
@@ -156,6 +181,26 @@
|
|
|
156
181
|
cursor: not-allowed;
|
|
157
182
|
}
|
|
158
183
|
|
|
184
|
+
/* A raised icon button keeps the raised border and surface, which the icon button's own rule
|
|
185
|
+
above would otherwise clear: both are one class, and the later one wins. */
|
|
186
|
+
.gk-icon-button.gk-button--raised,
|
|
187
|
+
.gk-icon-button.gk-button--raised:disabled,
|
|
188
|
+
.gk-icon-button.gk-button--raised[aria-disabled='true'] {
|
|
189
|
+
border: 1px solid var(--gk-control-border);
|
|
190
|
+
background: var(--gk-surface-0);
|
|
191
|
+
}
|
|
192
|
+
.gk-icon-button.gk-button--raised:hover {
|
|
193
|
+
background: linear-gradient(var(--gk-menu-hover), var(--gk-menu-hover)), var(--gk-surface-0);
|
|
194
|
+
}
|
|
195
|
+
.gk-icon-button.gk-button--raised[aria-pressed='true'] {
|
|
196
|
+
border-color: var(--gk-primary-bg);
|
|
197
|
+
background: var(--gk-primary-bg);
|
|
198
|
+
}
|
|
199
|
+
.gk-icon-button.gk-button--raised[aria-pressed='true']:hover {
|
|
200
|
+
border-color: var(--gk-primary-hover);
|
|
201
|
+
background: var(--gk-primary-hover);
|
|
202
|
+
}
|
|
203
|
+
|
|
159
204
|
/* A button or a link that reads as a link: the accent, underlined, so a link inside a sentence
|
|
160
205
|
is told from the text around it by more than its colour. */
|
|
161
206
|
.gk-link {
|
|
@@ -212,10 +257,31 @@
|
|
|
212
257
|
font-size: 0.875rem;
|
|
213
258
|
line-height: 1.25rem;
|
|
214
259
|
}
|
|
260
|
+
/* A field and a select share one fill, so a select beside a field matches it. The fill is
|
|
261
|
+
solid: the browser's own option list takes the select's colours. */
|
|
262
|
+
.gk-input,
|
|
263
|
+
.gk-select {
|
|
264
|
+
background-color: var(--gk-field-bg);
|
|
265
|
+
}
|
|
215
266
|
.gk-input {
|
|
216
267
|
display: block;
|
|
217
268
|
width: 100%;
|
|
218
|
-
|
|
269
|
+
}
|
|
270
|
+
/* A field or a select in a toolbar or on a row of controls: 30px tall. */
|
|
271
|
+
.gk-input--small,
|
|
272
|
+
.gk-select--small {
|
|
273
|
+
padding: 0.25rem 0.5rem;
|
|
274
|
+
border-radius: 0.375rem;
|
|
275
|
+
}
|
|
276
|
+
/* A select's height is set outright, to the height its padding and line give a field. A
|
|
277
|
+
browser that draws the select itself (Firefox, Safari) sizes it from its own font metrics,
|
|
278
|
+
and it came out two or three pixels shorter than the field beside it. */
|
|
279
|
+
.gk-select {
|
|
280
|
+
box-sizing: border-box;
|
|
281
|
+
height: 2.375rem;
|
|
282
|
+
}
|
|
283
|
+
.gk-select--small {
|
|
284
|
+
height: 1.875rem;
|
|
219
285
|
}
|
|
220
286
|
textarea.gk-input {
|
|
221
287
|
resize: vertical;
|
|
@@ -224,10 +290,6 @@
|
|
|
224
290
|
color: var(--gk-text-muted);
|
|
225
291
|
opacity: 1;
|
|
226
292
|
}
|
|
227
|
-
/* A select's background is solid: the browser's own option list takes the select's colours. */
|
|
228
|
-
.gk-select {
|
|
229
|
-
background-color: var(--gk-menu-bg);
|
|
230
|
-
}
|
|
231
293
|
.gk-input:focus,
|
|
232
294
|
.gk-select:focus {
|
|
233
295
|
border-color: var(--gk-field-focus);
|
|
@@ -240,7 +302,7 @@
|
|
|
240
302
|
}
|
|
241
303
|
.gk-input:disabled,
|
|
242
304
|
.gk-select:disabled {
|
|
243
|
-
background: var(--gk-surface-1);
|
|
305
|
+
background-color: var(--gk-surface-1);
|
|
244
306
|
color: var(--gk-text-muted);
|
|
245
307
|
cursor: not-allowed;
|
|
246
308
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsoftwareltd/etherpk-extension-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The API an EtherPK extension is written against: the context it is started with, its manifest, and the contract its Views follow.",
|
|
6
6
|
"type": "module",
|