@things-factory/gallery 10.1.247 → 10.1.248
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/package.json +3 -3
- package/dist-client/bootstrap.d.ts +0 -2
- package/dist-client/bootstrap.js +0 -26
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/components/gallery-forms.d.ts +0 -31
- package/dist-client/components/gallery-forms.js +0 -223
- package/dist-client/components/gallery-forms.js.map +0 -1
- package/dist-client/components/gallery-saver-setting-let.d.ts +0 -11
- package/dist-client/components/gallery-saver-setting-let.js +0 -81
- package/dist-client/components/gallery-saver-setting-let.js.map +0 -1
- package/dist-client/components/gallery-show.d.ts +0 -46
- package/dist-client/components/gallery-show.js +0 -316
- package/dist-client/components/gallery-show.js.map +0 -1
- package/dist-client/components/gallery-uploader.d.ts +0 -57
- package/dist-client/components/gallery-uploader.js +0 -624
- package/dist-client/components/gallery-uploader.js.map +0 -1
- package/dist-client/components/gallery-viewer.d.ts +0 -30
- package/dist-client/components/gallery-viewer.js +0 -429
- package/dist-client/components/gallery-viewer.js.map +0 -1
- package/dist-client/index.d.ts +0 -1
- package/dist-client/index.js +0 -2
- package/dist-client/index.js.map +0 -1
- package/dist-client/pages/gallery-page.d.ts +0 -54
- package/dist-client/pages/gallery-page.js +0 -590
- package/dist-client/pages/gallery-page.js.map +0 -1
- package/dist-client/route.d.ts +0 -1
- package/dist-client/route.js +0 -9
- package/dist-client/route.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/utils/gallery-api.d.ts +0 -99
- package/dist-client/utils/gallery-api.js +0 -46
- package/dist-client/utils/gallery-api.js.map +0 -1
- package/dist-client/utils/gallery-badge.d.ts +0 -4
- package/dist-client/utils/gallery-badge.js +0 -45
- package/dist-client/utils/gallery-badge.js.map +0 -1
- package/dist-client/utils/gallery-saver.d.ts +0 -6
- package/dist-client/utils/gallery-saver.js +0 -69
- package/dist-client/utils/gallery-saver.js.map +0 -1
- package/dist-client/utils/gallery-words.d.ts +0 -7
- package/dist-client/utils/gallery-words.js +0 -20
- package/dist-client/utils/gallery-words.js.map +0 -1
- package/dist-client/utils/photo-prep.d.ts +0 -10
- package/dist-client/utils/photo-prep.js +0 -102
- package/dist-client/utils/photo-prep.js.map +0 -1
- package/dist-server/attachment-reader.d.ts +0 -1
- package/dist-server/attachment-reader.js +0 -13
- package/dist-server/attachment-reader.js.map +0 -1
- package/dist-server/index.d.ts +0 -1
- package/dist-server/index.js +0 -11
- package/dist-server/index.js.map +0 -1
- package/dist-server/role-tasks.d.ts +0 -2
- package/dist-server/role-tasks.js +0 -15
- package/dist-server/role-tasks.js.map +0 -1
- package/dist-server/service/gallery/gallery-resolver.d.ts +0 -29
- package/dist-server/service/gallery/gallery-resolver.js +0 -613
- package/dist-server/service/gallery/gallery-resolver.js.map +0 -1
- package/dist-server/service/gallery/gallery-rules.d.ts +0 -90
- package/dist-server/service/gallery/gallery-rules.js +0 -182
- package/dist-server/service/gallery/gallery-rules.js.map +0 -1
- package/dist-server/service/gallery/gallery-service.d.ts +0 -37
- package/dist-server/service/gallery/gallery-service.js +0 -234
- package/dist-server/service/gallery/gallery-service.js.map +0 -1
- package/dist-server/service/gallery/gallery-types.d.ts +0 -65
- package/dist-server/service/gallery/gallery-types.js +0 -239
- package/dist-server/service/gallery/gallery-types.js.map +0 -1
- package/dist-server/service/gallery/gallery.d.ts +0 -84
- package/dist-server/service/gallery/gallery.js +0 -335
- package/dist-server/service/gallery/gallery.js.map +0 -1
- package/dist-server/service/gallery/index.d.ts +0 -4
- package/dist-server/service/gallery/index.js +0 -8
- package/dist-server/service/gallery/index.js.map +0 -1
- package/dist-server/service/index.d.ts +0 -7
- package/dist-server/service/index.js +0 -23
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/gallery",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.248",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@things-factory/auth-base": "^10.1.247",
|
|
41
41
|
"@things-factory/calendar": "^10.1.247",
|
|
42
42
|
"@things-factory/i18n-base": "^10.1.247",
|
|
43
|
-
"@things-factory/notification": "^10.1.
|
|
43
|
+
"@things-factory/notification": "^10.1.248",
|
|
44
44
|
"@things-factory/setting-base": "^10.1.247",
|
|
45
45
|
"@things-factory/shell": "^10.1.247",
|
|
46
46
|
"graphql-tag": "^2.12.6",
|
|
47
47
|
"graphql-upload": "^15.0.2",
|
|
48
48
|
"lit": "^3.1.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ca390a4b791d6e8630388167d3da6031034b5a5e"
|
|
51
51
|
}
|
package/dist-client/bootstrap.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { navigate, store } from '@operato/shell';
|
|
3
|
-
import { ADD_USER_MENU } from '@things-factory/apptool-base/client';
|
|
4
|
-
import { ADD_SETTING } from '@things-factory/setting-base/dist-client';
|
|
5
|
-
import './components/gallery-saver-setting-let.js';
|
|
6
|
-
import { watchForSaver } from './utils/gallery-saver.js';
|
|
7
|
-
/* One's own gallery is in the menu the header's avatar opens, right after the profile (ADR-0165 decision 6). */
|
|
8
|
-
export default function bootstrap() {
|
|
9
|
-
store.dispatch({
|
|
10
|
-
type: ADD_USER_MENU,
|
|
11
|
-
item: {
|
|
12
|
-
name: 'my-gallery',
|
|
13
|
-
icon: 'photo_library',
|
|
14
|
-
label: 'gallery.title.my-gallery',
|
|
15
|
-
order: 12,
|
|
16
|
-
action: () => navigate('gallery-page?tab=mine')
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
/* The screen saver is the device's, so it is set among one's own settings (ADR-0165 decision 9). */
|
|
20
|
-
store.dispatch({
|
|
21
|
-
type: ADD_SETTING,
|
|
22
|
-
setting: { seq: 30, template: html `<gallery-saver-setting-let></gallery-saver-setting-let>` }
|
|
23
|
-
});
|
|
24
|
-
watchForSaver();
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAEtE,OAAO,2CAA2C,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,gHAAgH;AAChH,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE;YACJ,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,0BAA0B;YACjC,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;SAChD;KACF,CAAC,CAAA;IACF,oGAAoG;IACpG,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAA,yDAAyD,EAAE;KAC9F,CAAC,CAAA;IACF,aAAa,EAAE,CAAA;AACjB,CAAC","sourcesContent":["import { html } from 'lit'\n\nimport { navigate, store } from '@operato/shell'\nimport { ADD_USER_MENU } from '@things-factory/apptool-base/client'\nimport { ADD_SETTING } from '@things-factory/setting-base/dist-client'\n\nimport './components/gallery-saver-setting-let.js'\nimport { watchForSaver } from './utils/gallery-saver.js'\n\n/* One's own gallery is in the menu the header's avatar opens, right after the profile (ADR-0165 decision 6). */\nexport default function bootstrap() {\n store.dispatch({\n type: ADD_USER_MENU,\n item: {\n name: 'my-gallery',\n icon: 'photo_library',\n label: 'gallery.title.my-gallery',\n order: 12,\n action: () => navigate('gallery-page?tab=mine')\n }\n })\n /* The screen saver is the device's, so it is set among one's own settings (ADR-0165 decision 9). */\n store.dispatch({\n type: ADD_SETTING,\n setting: { seq: 30, template: html`<gallery-saver-setting-let></gallery-saver-setting-let>` }\n })\n watchForSaver()\n}\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import '@material/web/button/filled-button.js';
|
|
2
|
-
import '@material/web/button/text-button.js';
|
|
3
|
-
import '@operato/popup/ox-popup-actions.js';
|
|
4
|
-
import { LitElement } from 'lit';
|
|
5
|
-
declare const GalleryEventForm_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
6
|
-
export declare class GalleryEventForm extends GalleryEventForm_base {
|
|
7
|
-
static styles: import("lit").CSSResult[];
|
|
8
|
-
private name;
|
|
9
|
-
private startAt;
|
|
10
|
-
private endAt;
|
|
11
|
-
private location;
|
|
12
|
-
private busy;
|
|
13
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
-
/** A later start carries the end with it, the same length. */
|
|
15
|
-
private start;
|
|
16
|
-
private save;
|
|
17
|
-
/** What was made goes as the popup's result. */
|
|
18
|
-
private close;
|
|
19
|
-
}
|
|
20
|
-
declare const GalleryTagForm_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
21
|
-
export declare class GalleryTagForm extends GalleryTagForm_base {
|
|
22
|
-
static styles: import("lit").CSSResult[];
|
|
23
|
-
tag: string;
|
|
24
|
-
private to;
|
|
25
|
-
private busy;
|
|
26
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
27
|
-
private save;
|
|
28
|
-
/** What was made goes as the popup's result. */
|
|
29
|
-
private close;
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
/*
|
|
3
|
-
* The two small forms of the gallery's moderators (ADR-0165 decision 5): an event made from the gallery, for one nobody
|
|
4
|
-
* put on the calendar yet, and a tag renamed on every post - into one already there, the two become one.
|
|
5
|
-
*/
|
|
6
|
-
import '@material/web/button/filled-button.js';
|
|
7
|
-
import '@material/web/button/text-button.js';
|
|
8
|
-
import '@operato/popup/ox-popup-actions.js';
|
|
9
|
-
import { css, html, LitElement } from 'lit';
|
|
10
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
11
|
-
import { i18next, localize } from '@operato/i18n';
|
|
12
|
-
import { notify } from '@operato/layout';
|
|
13
|
-
import { CommonPopupStyles, PopupBodyStyles } from '@operato/styles';
|
|
14
|
-
import { galleryApi, galleryChanged } from '../utils/gallery-api.js';
|
|
15
|
-
import { reasonOf, t } from '../utils/gallery-words.js';
|
|
16
|
-
const FormStyles = css `
|
|
17
|
-
:host {
|
|
18
|
-
height: 100%;
|
|
19
|
-
}
|
|
20
|
-
.body {
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
gap: var(--spacing-medium, 8px);
|
|
24
|
-
}
|
|
25
|
-
label {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
gap: 2px;
|
|
29
|
-
font-size: var(--ui-t-small, 12px);
|
|
30
|
-
font-weight: 600;
|
|
31
|
-
color: var(--ui-muted, var(--md-sys-color-on-surface-variant));
|
|
32
|
-
}
|
|
33
|
-
input {
|
|
34
|
-
box-sizing: border-box;
|
|
35
|
-
font: inherit;
|
|
36
|
-
font-size: var(--ui-t-body, 14px);
|
|
37
|
-
font-weight: normal;
|
|
38
|
-
padding: var(--spacing-small, 4px) var(--spacing-medium, 8px);
|
|
39
|
-
border: 1px solid var(--ui-line, var(--md-sys-color-outline-variant));
|
|
40
|
-
border-radius: var(--border-radius, 4px);
|
|
41
|
-
background: var(--md-sys-color-surface);
|
|
42
|
-
color: var(--md-sys-color-on-surface);
|
|
43
|
-
}
|
|
44
|
-
.row {
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-wrap: wrap;
|
|
47
|
-
gap: var(--spacing-medium, 8px);
|
|
48
|
-
}
|
|
49
|
-
.note {
|
|
50
|
-
font-size: var(--ui-t-small, 12px);
|
|
51
|
-
color: var(--ui-muted, var(--md-sys-color-on-surface-variant));
|
|
52
|
-
}
|
|
53
|
-
`;
|
|
54
|
-
const local = (value) => {
|
|
55
|
-
const pad = (n) => String(n).padStart(2, '0');
|
|
56
|
-
return `${value.getFullYear()}-${pad(value.getMonth() + 1)}-${pad(value.getDate())}T${pad(value.getHours())}:${pad(value.getMinutes())}`;
|
|
57
|
-
};
|
|
58
|
-
let GalleryEventForm = class GalleryEventForm extends localize(i18next)(LitElement) {
|
|
59
|
-
constructor() {
|
|
60
|
-
super(...arguments);
|
|
61
|
-
this.name = '';
|
|
62
|
-
this.startAt = local(new Date(new Date().setHours(9, 0, 0, 0)));
|
|
63
|
-
this.endAt = local(new Date(new Date().setHours(18, 0, 0, 0)));
|
|
64
|
-
this.location = '';
|
|
65
|
-
this.busy = false;
|
|
66
|
-
}
|
|
67
|
-
static { this.styles = [CommonPopupStyles, PopupBodyStyles, FormStyles]; }
|
|
68
|
-
render() {
|
|
69
|
-
const ready = this.name.trim() && this.startAt && this.endAt && this.endAt > this.startAt;
|
|
70
|
-
return html `<div class="body">
|
|
71
|
-
<label
|
|
72
|
-
>${t('gallery.field.event-name')}<input
|
|
73
|
-
.value=${this.name}
|
|
74
|
-
@input=${(e) => (this.name = e.target.value)}
|
|
75
|
-
/></label>
|
|
76
|
-
<div class="row">
|
|
77
|
-
<label
|
|
78
|
-
>${t('gallery.field.starts')}<input
|
|
79
|
-
type="datetime-local"
|
|
80
|
-
.value=${this.startAt}
|
|
81
|
-
@change=${(e) => this.start(e.target.value)}
|
|
82
|
-
/></label>
|
|
83
|
-
<label
|
|
84
|
-
>${t('gallery.field.ends')}<input
|
|
85
|
-
type="datetime-local"
|
|
86
|
-
.value=${this.endAt}
|
|
87
|
-
@change=${(e) => (this.endAt = e.target.value)}
|
|
88
|
-
/></label>
|
|
89
|
-
</div>
|
|
90
|
-
<label
|
|
91
|
-
>${t('gallery.field.location')}<input
|
|
92
|
-
.value=${this.location}
|
|
93
|
-
@input=${(e) => (this.location = e.target.value)}
|
|
94
|
-
/></label>
|
|
95
|
-
<div class="note">${t('gallery.text.event-form-note')}</div>
|
|
96
|
-
</div>
|
|
97
|
-
<ox-popup-actions>
|
|
98
|
-
<md-text-button slot="cancel" @click=${() => this.close()}>${t('gallery.button.cancel')}</md-text-button>
|
|
99
|
-
<md-filled-button slot="confirm" ?disabled=${this.busy || !ready} @click=${() => this.save()}
|
|
100
|
-
>${t('gallery.button.create-event')}</md-filled-button
|
|
101
|
-
>
|
|
102
|
-
</ox-popup-actions>`;
|
|
103
|
-
}
|
|
104
|
-
/** A later start carries the end with it, the same length. */
|
|
105
|
-
start(value) {
|
|
106
|
-
const length = new Date(this.endAt).getTime() - new Date(this.startAt).getTime();
|
|
107
|
-
this.startAt = value;
|
|
108
|
-
if (value && length > 0)
|
|
109
|
-
this.endAt = local(new Date(new Date(value).getTime() + length));
|
|
110
|
-
}
|
|
111
|
-
async save() {
|
|
112
|
-
this.busy = true;
|
|
113
|
-
try {
|
|
114
|
-
const event = await galleryApi.createEvent({
|
|
115
|
-
name: this.name.trim(),
|
|
116
|
-
startAt: new Date(this.startAt).toISOString(),
|
|
117
|
-
endAt: new Date(this.endAt).toISOString(),
|
|
118
|
-
location: this.location.trim() || undefined
|
|
119
|
-
});
|
|
120
|
-
galleryChanged();
|
|
121
|
-
this.close(event);
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
notify({ level: 'error', message: reasonOf(error) });
|
|
125
|
-
}
|
|
126
|
-
finally {
|
|
127
|
-
this.busy = false;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/** What was made goes as the popup's result. */
|
|
131
|
-
close(result) {
|
|
132
|
-
this.dispatchEvent(new CustomEvent('done', { detail: result, bubbles: true, composed: true }));
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
__decorate([
|
|
136
|
-
state(),
|
|
137
|
-
__metadata("design:type", Object)
|
|
138
|
-
], GalleryEventForm.prototype, "name", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
state(),
|
|
141
|
-
__metadata("design:type", Object)
|
|
142
|
-
], GalleryEventForm.prototype, "startAt", void 0);
|
|
143
|
-
__decorate([
|
|
144
|
-
state(),
|
|
145
|
-
__metadata("design:type", Object)
|
|
146
|
-
], GalleryEventForm.prototype, "endAt", void 0);
|
|
147
|
-
__decorate([
|
|
148
|
-
state(),
|
|
149
|
-
__metadata("design:type", Object)
|
|
150
|
-
], GalleryEventForm.prototype, "location", void 0);
|
|
151
|
-
__decorate([
|
|
152
|
-
state(),
|
|
153
|
-
__metadata("design:type", Object)
|
|
154
|
-
], GalleryEventForm.prototype, "busy", void 0);
|
|
155
|
-
GalleryEventForm = __decorate([
|
|
156
|
-
customElement('gallery-event-form')
|
|
157
|
-
], GalleryEventForm);
|
|
158
|
-
export { GalleryEventForm };
|
|
159
|
-
let GalleryTagForm = class GalleryTagForm extends localize(i18next)(LitElement) {
|
|
160
|
-
constructor() {
|
|
161
|
-
super(...arguments);
|
|
162
|
-
this.tag = '';
|
|
163
|
-
this.to = '';
|
|
164
|
-
this.busy = false;
|
|
165
|
-
}
|
|
166
|
-
static { this.styles = [CommonPopupStyles, PopupBodyStyles, FormStyles]; }
|
|
167
|
-
render() {
|
|
168
|
-
const ready = this.to.trim().replace(/^#+/, '') && this.to.trim().replace(/^#+/, '') !== this.tag;
|
|
169
|
-
return html `<div class="body">
|
|
170
|
-
<label
|
|
171
|
-
>${t('gallery.field.new-tag')}<input
|
|
172
|
-
.value=${this.to}
|
|
173
|
-
placeholder=${this.tag}
|
|
174
|
-
maxlength="30"
|
|
175
|
-
@input=${(e) => (this.to = e.target.value)}
|
|
176
|
-
/></label>
|
|
177
|
-
<div class="note">${t('gallery.text.tag-form-note', { tag: this.tag })}</div>
|
|
178
|
-
</div>
|
|
179
|
-
<ox-popup-actions>
|
|
180
|
-
<md-text-button slot="cancel" @click=${() => this.close()}>${t('gallery.button.cancel')}</md-text-button>
|
|
181
|
-
<md-filled-button slot="confirm" ?disabled=${this.busy || !ready} @click=${() => this.save()}
|
|
182
|
-
>${t('gallery.button.rename-tag')}</md-filled-button
|
|
183
|
-
>
|
|
184
|
-
</ox-popup-actions>`;
|
|
185
|
-
}
|
|
186
|
-
async save() {
|
|
187
|
-
this.busy = true;
|
|
188
|
-
try {
|
|
189
|
-
const to = this.to.trim().replace(/^#+/, '');
|
|
190
|
-
const count = await galleryApi.renameTag(this.tag, to);
|
|
191
|
-
notify({ message: t('gallery.text.tag-renamed', { count }) });
|
|
192
|
-
galleryChanged();
|
|
193
|
-
this.close(to);
|
|
194
|
-
}
|
|
195
|
-
catch (error) {
|
|
196
|
-
notify({ level: 'error', message: reasonOf(error) });
|
|
197
|
-
}
|
|
198
|
-
finally {
|
|
199
|
-
this.busy = false;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/** What was made goes as the popup's result. */
|
|
203
|
-
close(result) {
|
|
204
|
-
this.dispatchEvent(new CustomEvent('done', { detail: result, bubbles: true, composed: true }));
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
__decorate([
|
|
208
|
-
property(),
|
|
209
|
-
__metadata("design:type", Object)
|
|
210
|
-
], GalleryTagForm.prototype, "tag", void 0);
|
|
211
|
-
__decorate([
|
|
212
|
-
state(),
|
|
213
|
-
__metadata("design:type", Object)
|
|
214
|
-
], GalleryTagForm.prototype, "to", void 0);
|
|
215
|
-
__decorate([
|
|
216
|
-
state(),
|
|
217
|
-
__metadata("design:type", Object)
|
|
218
|
-
], GalleryTagForm.prototype, "busy", void 0);
|
|
219
|
-
GalleryTagForm = __decorate([
|
|
220
|
-
customElement('gallery-tag-form')
|
|
221
|
-
], GalleryTagForm);
|
|
222
|
-
export { GalleryTagForm };
|
|
223
|
-
//# sourceMappingURL=gallery-forms.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gallery-forms.js","sourceRoot":"","sources":["../../client/components/gallery-forms.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEpE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,2BAA2B,CAAA;AAEvD,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCrB,CAAA;AAED,MAAM,KAAK,GAAG,CAAC,KAAW,EAAE,EAAE;IAC5B,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACrD,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IA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EAAE,CAAC,EAAE,CAAC,CAAA;YAC7D,cAAc,EAAE,CAAA;YAChB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACtD,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;QACnB,CAAC;IACH,CAAC;IAED,gDAAgD;IACxC,KAAK,CAAC,MAAgB;QAC5B,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAChG,CAAC;;AA1CW;IAAX,QAAQ,EAAE;;2CAAS;AACH;IAAhB,KAAK,EAAE;;0CAAgB;AACP;IAAhB,KAAK,EAAE;;4CAAqB;AALlB,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA8C1B","sourcesContent":["/*\n * The two small forms of the gallery's moderators (ADR-0165 decision 5): an event made from the gallery, for one nobody\n * put on the calendar yet, and a tag renamed on every post - into one already there, the two become one.\n */\nimport '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\nimport '@operato/popup/ox-popup-actions.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { CommonPopupStyles, PopupBodyStyles } from '@operato/styles'\n\nimport { galleryApi, galleryChanged } from '../utils/gallery-api.js'\nimport { reasonOf, t } from '../utils/gallery-words.js'\n\nconst FormStyles = css`\n :host {\n height: 100%;\n }\n .body {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-medium, 8px);\n }\n label {\n display: flex;\n flex-direction: column;\n gap: 2px;\n font-size: var(--ui-t-small, 12px);\n font-weight: 600;\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n }\n input {\n box-sizing: border-box;\n font: inherit;\n font-size: var(--ui-t-body, 14px);\n font-weight: normal;\n padding: var(--spacing-small, 4px) var(--spacing-medium, 8px);\n border: 1px solid var(--ui-line, var(--md-sys-color-outline-variant));\n border-radius: var(--border-radius, 4px);\n background: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n }\n .row {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-medium, 8px);\n }\n .note {\n font-size: var(--ui-t-small, 12px);\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n }\n`\n\nconst local = (value: Date) => {\n const pad = (n: number) => String(n).padStart(2, '0')\n return `${value.getFullYear()}-${pad(value.getMonth() + 1)}-${pad(value.getDate())}T${pad(value.getHours())}:${pad(value.getMinutes())}`\n}\n\n@customElement('gallery-event-form')\nexport class GalleryEventForm extends localize(i18next)(LitElement) {\n static styles = [CommonPopupStyles, PopupBodyStyles, FormStyles]\n\n @state() private name = ''\n @state() private startAt = local(new Date(new Date().setHours(9, 0, 0, 0)))\n @state() private endAt = local(new Date(new Date().setHours(18, 0, 0, 0)))\n @state() private location = ''\n @state() private busy = false\n\n render() {\n const ready = this.name.trim() && this.startAt && this.endAt && this.endAt > this.startAt\n return html`<div class=\"body\">\n <label\n >${t('gallery.field.event-name')}<input\n .value=${this.name}\n @input=${(e: any) => (this.name = e.target.value)}\n /></label>\n <div class=\"row\">\n <label\n >${t('gallery.field.starts')}<input\n type=\"datetime-local\"\n .value=${this.startAt}\n @change=${(e: any) => this.start(e.target.value)}\n /></label>\n <label\n >${t('gallery.field.ends')}<input\n type=\"datetime-local\"\n .value=${this.endAt}\n @change=${(e: any) => (this.endAt = e.target.value)}\n /></label>\n </div>\n <label\n >${t('gallery.field.location')}<input\n .value=${this.location}\n @input=${(e: any) => (this.location = e.target.value)}\n /></label>\n <div class=\"note\">${t('gallery.text.event-form-note')}</div>\n </div>\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" @click=${() => this.close()}>${t('gallery.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" ?disabled=${this.busy || !ready} @click=${() => this.save()}\n >${t('gallery.button.create-event')}</md-filled-button\n >\n </ox-popup-actions>`\n }\n\n /** A later start carries the end with it, the same length. */\n private start(value: string) {\n const length = new Date(this.endAt).getTime() - new Date(this.startAt).getTime()\n this.startAt = value\n if (value && length > 0) this.endAt = local(new Date(new Date(value).getTime() + length))\n }\n\n private async save() {\n this.busy = true\n try {\n const event = await galleryApi.createEvent({\n name: this.name.trim(),\n startAt: new Date(this.startAt).toISOString(),\n endAt: new Date(this.endAt).toISOString(),\n location: this.location.trim() || undefined\n })\n galleryChanged()\n this.close(event)\n } catch (error) {\n notify({ level: 'error', message: reasonOf(error) })\n } finally {\n this.busy = false\n }\n }\n\n /** What was made goes as the popup's result. */\n private close(result?: unknown) {\n this.dispatchEvent(new CustomEvent('done', { detail: result, bubbles: true, composed: true }))\n }\n}\n\n@customElement('gallery-tag-form')\nexport class GalleryTagForm extends localize(i18next)(LitElement) {\n static styles = [CommonPopupStyles, PopupBodyStyles, FormStyles]\n\n @property() tag = ''\n @state() private to = ''\n @state() private busy = false\n\n render() {\n const ready = this.to.trim().replace(/^#+/, '') && this.to.trim().replace(/^#+/, '') !== this.tag\n return html`<div class=\"body\">\n <label\n >${t('gallery.field.new-tag')}<input\n .value=${this.to}\n placeholder=${this.tag}\n maxlength=\"30\"\n @input=${(e: any) => (this.to = e.target.value)}\n /></label>\n <div class=\"note\">${t('gallery.text.tag-form-note', { tag: this.tag })}</div>\n </div>\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" @click=${() => this.close()}>${t('gallery.button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" ?disabled=${this.busy || !ready} @click=${() => this.save()}\n >${t('gallery.button.rename-tag')}</md-filled-button\n >\n </ox-popup-actions>`\n }\n\n private async save() {\n this.busy = true\n try {\n const to = this.to.trim().replace(/^#+/, '')\n const count = await galleryApi.renameTag(this.tag, to)\n notify({ message: t('gallery.text.tag-renamed', { count }) })\n galleryChanged()\n this.close(to)\n } catch (error) {\n notify({ level: 'error', message: reasonOf(error) })\n } finally {\n this.busy = false\n }\n }\n\n /** What was made goes as the popup's result. */\n private close(result?: unknown) {\n this.dispatchEvent(new CustomEvent('done', { detail: result, bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import '@material/web/radio/radio.js';
|
|
2
|
-
import { LitElement } from 'lit';
|
|
3
|
-
declare const GallerySaverSettingLet_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
4
|
-
export declare class GallerySaverSettingLet extends GallerySaverSettingLet_base {
|
|
5
|
-
static styles: import("lit").CSSResult;
|
|
6
|
-
private minutes;
|
|
7
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
-
firstUpdated(): Promise<void>;
|
|
9
|
-
private choose;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
/*
|
|
3
|
-
* Settings › the gallery as the screen saver on this device (ADR-0165 decision 9): off, or after a few quiet minutes.
|
|
4
|
-
*/
|
|
5
|
-
import '@material/web/radio/radio.js';
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
8
|
-
import { i18next, localize } from '@operato/i18n';
|
|
9
|
-
import { notify } from '@operato/layout';
|
|
10
|
-
import { SAVER_MINUTES, saverMinutes, setSaverMinutes } from '../utils/gallery-saver.js';
|
|
11
|
-
import { reasonOf, t } from '../utils/gallery-words.js';
|
|
12
|
-
let GallerySaverSettingLet = class GallerySaverSettingLet extends localize(i18next)(LitElement) {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.minutes = 0;
|
|
16
|
-
}
|
|
17
|
-
static { this.styles = css `
|
|
18
|
-
div[slot='content'] {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
gap: var(--spacing-medium, 8px);
|
|
22
|
-
}
|
|
23
|
-
.choices {
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-wrap: wrap;
|
|
26
|
-
gap: var(--spacing-small, 4px) var(--spacing-large, 12px);
|
|
27
|
-
}
|
|
28
|
-
label {
|
|
29
|
-
display: flex;
|
|
30
|
-
gap: 6px;
|
|
31
|
-
align-items: center;
|
|
32
|
-
font: var(--label-font);
|
|
33
|
-
color: var(--md-sys-color-on-surface);
|
|
34
|
-
}
|
|
35
|
-
.note {
|
|
36
|
-
margin: 0;
|
|
37
|
-
font-size: var(--ui-t-small, 12px);
|
|
38
|
-
color: var(--ui-muted, var(--md-sys-color-on-surface-variant));
|
|
39
|
-
}
|
|
40
|
-
`; }
|
|
41
|
-
render() {
|
|
42
|
-
return html `<setting-let>
|
|
43
|
-
<span slot="title">${t('gallery.title.saver')}</span>
|
|
44
|
-
<div slot="content">
|
|
45
|
-
<div class="choices" role="radiogroup">
|
|
46
|
-
${SAVER_MINUTES.map(minutes => html `<label>
|
|
47
|
-
<md-radio
|
|
48
|
-
name="gallery-saver"
|
|
49
|
-
value=${String(minutes)}
|
|
50
|
-
?checked=${this.minutes === minutes}
|
|
51
|
-
@change=${() => this.choose(minutes)}
|
|
52
|
-
></md-radio>
|
|
53
|
-
${minutes ? t('gallery.text.saver-after', { minutes }) : t('gallery.text.saver-off')}
|
|
54
|
-
</label>`)}
|
|
55
|
-
</div>
|
|
56
|
-
<p class="note">${t('gallery.text.saver-note')}</p>
|
|
57
|
-
</div>
|
|
58
|
-
</setting-let>`;
|
|
59
|
-
}
|
|
60
|
-
async firstUpdated() {
|
|
61
|
-
this.minutes = await saverMinutes();
|
|
62
|
-
}
|
|
63
|
-
async choose(minutes) {
|
|
64
|
-
try {
|
|
65
|
-
await setSaverMinutes(minutes);
|
|
66
|
-
this.minutes = minutes;
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
notify({ level: 'error', message: reasonOf(error) });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
__decorate([
|
|
74
|
-
state(),
|
|
75
|
-
__metadata("design:type", Object)
|
|
76
|
-
], GallerySaverSettingLet.prototype, "minutes", void 0);
|
|
77
|
-
GallerySaverSettingLet = __decorate([
|
|
78
|
-
customElement('gallery-saver-setting-let')
|
|
79
|
-
], GallerySaverSettingLet);
|
|
80
|
-
export { GallerySaverSettingLet };
|
|
81
|
-
//# sourceMappingURL=gallery-saver-setting-let.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gallery-saver-setting-let.js","sourceRoot":"","sources":["../../client/components/gallery-saver-setting-let.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,8BAA8B,CAAA;AAErC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,2BAA2B,CAAA;AAGhD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAlE;;QA0BY,YAAO,GAAG,CAAC,CAAA;IAoC9B,CAAC;aA7DQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBlB,AAvBY,CAuBZ;IAID,MAAM;QACJ,OAAO,IAAI,CAAA;2BACY,CAAC,CAAC,qBAAqB,CAAC;;;YAGvC,aAAa,CAAC,GAAG,CACjB,OAAO,CAAC,EAAE,CAAC,IAAI,CAAA;;;wBAGH,MAAM,CAAC,OAAO,CAAC;2BACZ,IAAI,CAAC,OAAO,KAAK,OAAO;0BACzB,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;;gBAEpC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC;qBAC7E,CACV;;0BAEe,CAAC,CAAC,yBAAyB,CAAC;;mBAEnC,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,OAAO,GAAG,MAAM,YAAY,EAAE,CAAA;IACrC,CAAC;IAEO,KAAK,CAAC,MAAM,CAAC,OAAe;QAClC,IAAI,CAAC;YACH,MAAM,eAAe,CAAC,OAAO,CAAC,CAAA;YAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACxB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;;AAnCgB;IAAhB,KAAK,EAAE;;uDAAoB;AA1BjB,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CA8DlC","sourcesContent":["/*\n * Settings › the gallery as the screen saver on this device (ADR-0165 decision 9): off, or after a few quiet minutes.\n */\nimport '@material/web/radio/radio.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\n\nimport { SAVER_MINUTES, saverMinutes, setSaverMinutes } from '../utils/gallery-saver.js'\nimport { reasonOf, t } from '../utils/gallery-words.js'\n\n@customElement('gallery-saver-setting-let')\nexport class GallerySaverSettingLet extends localize(i18next)(LitElement) {\n static styles = css`\n div[slot='content'] {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-medium, 8px);\n }\n .choices {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-small, 4px) var(--spacing-large, 12px);\n }\n label {\n display: flex;\n gap: 6px;\n align-items: center;\n font: var(--label-font);\n color: var(--md-sys-color-on-surface);\n }\n .note {\n margin: 0;\n font-size: var(--ui-t-small, 12px);\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n }\n `\n\n @state() private minutes = 0\n\n render() {\n return html`<setting-let>\n <span slot=\"title\">${t('gallery.title.saver')}</span>\n <div slot=\"content\">\n <div class=\"choices\" role=\"radiogroup\">\n ${SAVER_MINUTES.map(\n minutes => html`<label>\n <md-radio\n name=\"gallery-saver\"\n value=${String(minutes)}\n ?checked=${this.minutes === minutes}\n @change=${() => this.choose(minutes)}\n ></md-radio>\n ${minutes ? t('gallery.text.saver-after', { minutes }) : t('gallery.text.saver-off')}\n </label>`\n )}\n </div>\n <p class=\"note\">${t('gallery.text.saver-note')}</p>\n </div>\n </setting-let>`\n }\n\n async firstUpdated() {\n this.minutes = await saverMinutes()\n }\n\n private async choose(minutes: number) {\n try {\n await setSaverMinutes(minutes)\n this.minutes = minutes\n } catch (error) {\n notify({ level: 'error', message: reasonOf(error) })\n }\n }\n}\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js';
|
|
2
|
-
import { LitElement, nothing } from 'lit';
|
|
3
|
-
import { type Filter } from '../utils/gallery-api.js';
|
|
4
|
-
export type ShowOptions = {
|
|
5
|
-
/** The posts the show walks through - the gallery's narrowing where it was opened. */
|
|
6
|
-
filter: Filter;
|
|
7
|
-
/** Where it starts: a post and the photo in it. Without it, the first photo. */
|
|
8
|
-
start?: {
|
|
9
|
-
postId: string;
|
|
10
|
-
index: number;
|
|
11
|
-
};
|
|
12
|
-
/** Plays at once. */
|
|
13
|
-
playing?: boolean;
|
|
14
|
-
/** The screen saver: plays in a random order, and closes at anything the person does. */
|
|
15
|
-
saver?: boolean;
|
|
16
|
-
};
|
|
17
|
-
declare const GalleryShow_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
18
|
-
export declare class GalleryShow extends GalleryShow_base {
|
|
19
|
-
static styles: import("lit").CSSResult;
|
|
20
|
-
/** Opens a show over the whole window, and the whole screen when the browser lets it. */
|
|
21
|
-
static open(options: ShowOptions): GalleryShow;
|
|
22
|
-
saver: boolean;
|
|
23
|
-
options: ShowOptions;
|
|
24
|
-
private frames;
|
|
25
|
-
private at;
|
|
26
|
-
private playing;
|
|
27
|
-
private loaded;
|
|
28
|
-
private timer?;
|
|
29
|
-
private wholeScreen;
|
|
30
|
-
private disposed;
|
|
31
|
-
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
32
|
-
private renderBar;
|
|
33
|
-
connectedCallback(): void;
|
|
34
|
-
disconnectedCallback(): void;
|
|
35
|
-
private load;
|
|
36
|
-
private play;
|
|
37
|
-
/** The next photo after the dwell, asked ahead so it is there when it turns. */
|
|
38
|
-
private schedule;
|
|
39
|
-
private step;
|
|
40
|
-
private onKey;
|
|
41
|
-
/** Leaving the whole screen (Esc there is the browser's) leaves the show too. */
|
|
42
|
-
private onFullscreen;
|
|
43
|
-
private onWake;
|
|
44
|
-
close(): void;
|
|
45
|
-
}
|
|
46
|
-
export {};
|