@internetarchive/elements 1.1.3-webdev-9240.0 → 1.1.3

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.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/dist/src/elements/ia-status-indicator/ia-status-indicator.d.ts +16 -1
  3. package/dist/src/elements/ia-status-indicator/ia-status-indicator.d.ts.map +1 -1
  4. package/dist/src/elements/ia-status-indicator/ia-status-indicator.js +136 -8
  5. package/dist/src/elements/ia-status-indicator/ia-status-indicator.js.map +1 -1
  6. package/package.json +1 -9
  7. package/dist/src/elements/ia-reviews/assets/delete-icon.svg +0 -8
  8. package/dist/src/elements/ia-reviews/assets/star-basic.svg +0 -6
  9. package/dist/src/elements/ia-reviews/assets/star-selected.svg +0 -8
  10. package/dist/src/elements/ia-reviews/assets/star-unselected.svg +0 -8
  11. package/dist/src/elements/ia-reviews/ia-review-form.d.ts +0 -103
  12. package/dist/src/elements/ia-reviews/ia-review-form.d.ts.map +0 -1
  13. package/dist/src/elements/ia-reviews/ia-review-form.js +0 -685
  14. package/dist/src/elements/ia-reviews/ia-review-form.js.map +0 -1
  15. package/dist/src/elements/ia-reviews/ia-review.d.ts +0 -51
  16. package/dist/src/elements/ia-reviews/ia-review.d.ts.map +0 -1
  17. package/dist/src/elements/ia-reviews/ia-review.js +0 -344
  18. package/dist/src/elements/ia-reviews/ia-review.js.map +0 -1
  19. package/dist/src/elements/ia-reviews/ia-reviews.d.ts +0 -68
  20. package/dist/src/elements/ia-reviews/ia-reviews.d.ts.map +0 -1
  21. package/dist/src/elements/ia-reviews/ia-reviews.js +0 -354
  22. package/dist/src/elements/ia-reviews/ia-reviews.js.map +0 -1
  23. package/dist/src/elements/ia-reviews/mocks/mock-fetch-handler.d.ts +0 -23
  24. package/dist/src/elements/ia-reviews/mocks/mock-fetch-handler.d.ts.map +0 -1
  25. package/dist/src/elements/ia-reviews/mocks/mock-fetch-handler.js +0 -37
  26. package/dist/src/elements/ia-reviews/mocks/mock-fetch-handler.js.map +0 -1
  27. package/dist/src/elements/ia-reviews/mocks/mock-review-service.d.ts +0 -12
  28. package/dist/src/elements/ia-reviews/mocks/mock-review-service.d.ts.map +0 -1
  29. package/dist/src/elements/ia-reviews/mocks/mock-review-service.js +0 -19
  30. package/dist/src/elements/ia-reviews/mocks/mock-review-service.js.map +0 -1
  31. package/dist/src/elements/ia-reviews/models.d.ts +0 -38
  32. package/dist/src/elements/ia-reviews/models.d.ts.map +0 -1
  33. package/dist/src/elements/ia-reviews/models.js +0 -2
  34. package/dist/src/elements/ia-reviews/models.js.map +0 -1
  35. package/dist/src/elements/ia-reviews/review-service.d.ts +0 -53
  36. package/dist/src/elements/ia-reviews/review-service.d.ts.map +0 -1
  37. package/dist/src/elements/ia-reviews/review-service.js +0 -97
  38. package/dist/src/elements/ia-reviews/review-service.js.map +0 -1
  39. package/dist/src/elements/ia-reviews/utils/collapse-space.d.ts +0 -13
  40. package/dist/src/elements/ia-reviews/utils/collapse-space.d.ts.map +0 -1
  41. package/dist/src/elements/ia-reviews/utils/collapse-space.js +0 -19
  42. package/dist/src/elements/ia-reviews/utils/collapse-space.js.map +0 -1
  43. package/dist/src/elements/ia-reviews/utils/friendly-truncate.d.ts +0 -14
  44. package/dist/src/elements/ia-reviews/utils/friendly-truncate.d.ts.map +0 -1
  45. package/dist/src/elements/ia-reviews/utils/friendly-truncate.js +0 -65
  46. package/dist/src/elements/ia-reviews/utils/friendly-truncate.js.map +0 -1
  47. package/dist/src/elements/ia-reviews/utils/link-urls-in-text.d.ts +0 -9
  48. package/dist/src/elements/ia-reviews/utils/link-urls-in-text.d.ts.map +0 -1
  49. package/dist/src/elements/ia-reviews/utils/link-urls-in-text.js +0 -40
  50. package/dist/src/elements/ia-reviews/utils/link-urls-in-text.js.map +0 -1
  51. package/dist/src/elements/ia-reviews/utils/sanitize-review-body.d.ts +0 -9
  52. package/dist/src/elements/ia-reviews/utils/sanitize-review-body.d.ts.map +0 -1
  53. package/dist/src/elements/ia-reviews/utils/sanitize-review-body.js +0 -29
  54. package/dist/src/elements/ia-reviews/utils/sanitize-review-body.js.map +0 -1
  55. package/dist/src/elements/ia-reviews/utils/truncate-screenname.d.ts +0 -13
  56. package/dist/src/elements/ia-reviews/utils/truncate-screenname.d.ts.map +0 -1
  57. package/dist/src/elements/ia-reviews/utils/truncate-screenname.js +0 -19
  58. package/dist/src/elements/ia-reviews/utils/truncate-screenname.js.map +0 -1
  59. package/dist/src/elements/index.d.ts +0 -43
  60. package/dist/src/elements/index.d.ts.map +0 -1
  61. package/dist/src/elements/index.js +0 -43
  62. package/dist/src/elements/index.js.map +0 -1
@@ -1,685 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { html, css, LitElement, nothing, } from 'lit';
3
- import { property, state, query } from 'lit/decorators.js';
4
- import { customElement } from '../../util/custom-element.js';
5
- import { localized, msg, str } from '@lit/localize';
6
- import { unsafeHTML } from 'lit/directives/unsafe-html.js';
7
- import DOMPurify from 'dompurify';
8
- import '../../elements/ia-button/ia-button.js';
9
- import { Review } from '@internetarchive/metadata-service';
10
- import starSelected from './assets/star-selected.svg';
11
- import starUnselected from './assets/star-unselected.svg';
12
- import './ia-review.js';
13
- /**
14
- * Renders a form to edit a given IA review.
15
- */
16
- let IAReviewForm = class IAReviewForm extends LitElement {
17
- constructor() {
18
- super(...arguments);
19
- /* Optionally avoid using recaptcha for the form */
20
- this.bypassRecaptcha = false;
21
- /* Number of stars currently selected */
22
- this.currentStars = 0;
23
- /* Length of review subject currently filled in */
24
- this.currentSubjectLength = 0;
25
- /* Length of review body currently filled in */
26
- this.currentBodyLength = 0;
27
- /* Whether recaptcha failed to load, which blocks submission */
28
- this.recaptchaUnavailable = false;
29
- /* Whether to enable the submit button */
30
- this.formCanSubmit = false;
31
- /* Whether to show a loading indicator for the form */
32
- this.submissionInProgress = false;
33
- }
34
- render() {
35
- return html `<form id="review-form" @submit=${this.handleSubmit}>
36
- ${this.unrecoverableErrorMessage
37
- ? this.unrecoverableErrorTemplate
38
- : html `
39
- <span class="inputs">
40
- ${this.starsInputTemplate} ${this.subjectInputTemplate}
41
- ${this.bodyInputTemplate}
42
- </span>
43
- `}
44
- ${this.recaptchaMessageTemplate} ${this.recoverableErrorTemplate}
45
- ${this.actionButtonsTemplate}
46
- </form>`;
47
- }
48
- willUpdate(changed) {
49
- // Fill in previous review, if provided
50
- if (changed.has('oldReview')) {
51
- this.currentStars = this.oldReview?.stars ?? 0;
52
- this.currentSubjectLength = this.oldReview?.reviewtitle?.length ?? 0;
53
- this.currentBodyLength = this.oldReview?.reviewbody?.length ?? 0;
54
- }
55
- // Set up ReCaptcha, if possible
56
- if (changed.has('recaptchaManager') &&
57
- !this.bypassRecaptcha &&
58
- this.recaptchaManager) {
59
- this.setupRecaptcha();
60
- }
61
- // Disable form if unrecoverable error added
62
- if (changed.has('unrecoverableError') ||
63
- changed.has('recaptchaUnavailable')) {
64
- this.formCanSubmit = this.checkSubmissionAllowed();
65
- }
66
- // Ensure new subject and body have correct length
67
- if (changed.has('currentSubjectLength') ||
68
- changed.has('currentBodyLength') ||
69
- changed.has('maxSubjectLength') ||
70
- changed.has('maxBodyLength')) {
71
- this.formCanSubmit = this.checkSubmissionAllowed();
72
- }
73
- }
74
- /** Error to render instead of form inputs */
75
- get unrecoverableErrorTemplate() {
76
- const message = this.unrecoverableErrorMessage;
77
- return message
78
- ? html `
79
- <div class="unrecoverable-error">
80
- <span class="error-msg">${message}</span>
81
- </div>
82
- `
83
- : nothing;
84
- }
85
- /** Error to render next to submit button */
86
- get recoverableErrorTemplate() {
87
- const message = this.recoverableErrorMessage;
88
- return message
89
- ? html `
90
- <div class="recoverable-error">
91
- ${unsafeHTML(this.sanitizeErrorMsg(message))}
92
- </div>
93
- `
94
- : nothing;
95
- }
96
- /* The error that replaces the form inputs: one passed in, or recaptcha failing to load */
97
- get unrecoverableErrorMessage() {
98
- if (this.unrecoverableError)
99
- return this.unrecoverableError;
100
- return this.recaptchaUnavailable ? this.recaptchaErrorMessage : undefined;
101
- }
102
- /* The error shown next to the submit button: one passed in or sent back, or one the form raised */
103
- get recoverableErrorMessage() {
104
- if (this.recoverableError)
105
- return this.recoverableError;
106
- switch (this.formError) {
107
- case 'recaptcha':
108
- return this.recaptchaErrorMessage;
109
- case 'generic':
110
- return this.genericErrorMessage;
111
- default:
112
- return undefined;
113
- }
114
- }
115
- /* Error to show if recaptcha cannot be loaded or run */
116
- get recaptchaErrorMessage() {
117
- return msg('Could not validate review. Please try again later.');
118
- }
119
- get genericErrorMessage() {
120
- return msg("There's been a temporary error. Please wait a moment and try again.");
121
- }
122
- get recaptchaMessageTemplate() {
123
- if (this.bypassRecaptcha)
124
- return nothing;
125
- return html `
126
- <span class="recaptcha-disclaimer"
127
- >${msg(html `This site is protected by reCAPTCHA and the Google
128
- <a
129
- target="_blank"
130
- class="inline-link"
131
- href="https://policies.google.com/privacy"
132
- >Privacy Policy</a
133
- >
134
- and
135
- <a
136
- target="_blank"
137
- class="inline-link"
138
- href="https://policies.google.com/terms"
139
- >Terms of Service</a
140
- >
141
- apply.`)}</span
142
- >
143
- `;
144
- }
145
- /** Clickable group of stars */
146
- get starsInputTemplate() {
147
- return html `
148
- <div class="form-heading rating">
149
- <label for="stars-field">${msg('Rating (optional)')}</label>
150
- </div>
151
- <input
152
- type="hidden"
153
- name="field_stars"
154
- id="stars-input"
155
- .value=${this.currentStars.toString()}
156
- required
157
- />
158
- <div class="stars">
159
- ${[1, 2, 3, 4, 5].map((num) => this.renderStar(num))}
160
- <button
161
- type="button"
162
- class="clear-stars-btn"
163
- @click=${this.handleClearBtnClicked}
164
- >
165
- ${msg('Clear')}
166
- </button>
167
- </div>
168
- `;
169
- }
170
- /** Subject input and character counter */
171
- get subjectInputTemplate() {
172
- return html `
173
- <span id="subject-input" class="input-box ${this.maxSubjectLength &&
174
- this.currentSubjectLength > this.maxSubjectLength
175
- ? 'error'
176
- : ''}"
177
- ><div class="form-heading">
178
- <label for="field_reviewtitle">${msg('Subject')}</label>
179
- ${this.maxSubjectLength
180
- ? html `<div class="char-count subject">
181
- ${this.currentSubjectLength}/${this.maxSubjectLength}
182
- </div>`
183
- : nothing}
184
- </div>
185
- <input
186
- type="text"
187
- name="field_reviewtitle"
188
- id="field_reviewtitle"
189
- .value=${this.oldReview?.reviewtitle ?? ''}
190
- @input=${this.handleSubjectChanged}
191
- required
192
- />${this.maxSubjectLength
193
- ? html `
194
- <div class="input-error">
195
- ${msg(str `Subject may only have ${this.maxSubjectLength} characters`)}
196
- </div>
197
- `
198
- : nothing}</div></span>
199
- `;
200
- }
201
- /** Body input and character counter */
202
- get bodyInputTemplate() {
203
- return html `
204
- <span
205
- id="body-input"
206
- class="input-box ${this.maxBodyLength &&
207
- this.currentBodyLength > this.maxBodyLength
208
- ? 'error'
209
- : ''}"
210
- ><div class="form-heading">
211
- <label for="field_reviewbody">${msg('Review')}</label>
212
- ${this.maxBodyLength
213
- ? html `<div class="char-count body">
214
- ${this.currentBodyLength}/${this.maxBodyLength}
215
- </div>`
216
- : nothing}
217
- </div>
218
- <textarea
219
- name="field_reviewbody"
220
- id="field_reviewbody"
221
- .value=${this.oldReview?.reviewbody ?? ''}
222
- rows="10"
223
- cols="50"
224
- required
225
- @input=${this.handleBodyChanged}
226
- ></textarea>
227
- ${this.maxBodyLength
228
- ? html `
229
- <div class="input-error">
230
- ${msg(str `Review may only have ${this.maxBodyLength} characters`)}
231
- </div>
232
- `
233
- : nothing}
234
- </span>
235
- `;
236
- }
237
- /** Buttons to render at bottom of form */
238
- get actionButtonsTemplate() {
239
- return html `<div class="action-btns">
240
- <ia-button
241
- mode="secondary"
242
- class="cancel-btn"
243
- data-testid="cancel-btn"
244
- @click=${this.cancelReviewEdit}
245
- >
246
- ${msg('Cancel')}
247
- </ia-button>
248
- <ia-button
249
- mode="primary"
250
- type="submit"
251
- class="submit-btn"
252
- .disabled=${!this.formCanSubmit}
253
- .loading=${this.submissionInProgress}
254
- >
255
- ${msg('Submit review')}
256
- </ia-button>
257
- </div>`;
258
- }
259
- /**
260
- * Renders a star icon, using its number and the current star rating
261
- * to determine whether it should appear selected or not
262
- *
263
- * @param {number} num The number of the current star
264
- * @returns {HTMLTemplateResult} The correct icon, rendered within a button
265
- */
266
- renderStar(num) {
267
- const isSelected = num === this.currentStars;
268
- const ratingLabel = num === 1 ? msg('Rate 1 star') : msg(str `Rate ${num} stars`);
269
- return html `
270
- <button
271
- class="star star-${num}"
272
- title=${isSelected ? msg('Clear rating') : ratingLabel}
273
- @click=${(e) => this.handleStarClicked(e, num)}
274
- >
275
- ${num <= this.currentStars
276
- ? html `<img
277
- class="star-selected"
278
- src=${starSelected}
279
- alt=""
280
- aria-hidden="true"
281
- />`
282
- : html `<img
283
- class="star-unselected"
284
- src=${starUnselected}
285
- alt=""
286
- aria-hidden="true"
287
- />`}
288
- </button>
289
- `;
290
- }
291
- /**
292
- * Sets up ReCaptcha for the form, if possible.
293
- *
294
- * On failure, replaces form inputs with the ReCaptcha error message.
295
- */
296
- async setupRecaptcha() {
297
- try {
298
- this.recaptchaWidget = await this.recaptchaManager?.getRecaptchaWidget();
299
- }
300
- catch {
301
- this.recaptchaUnavailable = true;
302
- }
303
- }
304
- /**
305
- * Uses DOMpurify to sanitize any error message before render.
306
- *
307
- * @param {string} errorMsg The error message to be sanitized
308
- * @returns {string} The sanitized error message
309
- */
310
- sanitizeErrorMsg(errorMsg) {
311
- return DOMPurify.sanitize(errorMsg, { ALLOWED_TAGS: ['a', 'b', 'br'] });
312
- }
313
- /** Handles validation and recaptcha execution on form submission */
314
- async handleSubmit(e) {
315
- e.preventDefault();
316
- // Prevent disallowed or double submission
317
- if (!this.formCanSubmit || this.submissionInProgress)
318
- return;
319
- // Set loading behavior
320
- this.submissionInProgress = true;
321
- this.recoverableError = '';
322
- this.formError = undefined;
323
- // Check for HTML errors
324
- if (!this.reviewForm.reportValidity()) {
325
- return this.stopSubmission();
326
- }
327
- if (!this.reviewService || !this.identifier) {
328
- this.formError = 'generic';
329
- return this.stopSubmission();
330
- }
331
- try {
332
- let recaptchaToken;
333
- if (!this.bypassRecaptcha) {
334
- recaptchaToken = await this.getRecaptchaToken();
335
- if (!recaptchaToken)
336
- return this.handleRecaptchaError();
337
- }
338
- const result = await this.reviewService.submitReview({
339
- identifier: this.identifier,
340
- title: this.reviewForm.field_reviewtitle.value,
341
- body: this.reviewForm.field_reviewbody.value,
342
- stars: this.reviewForm.field_stars.value,
343
- recaptchaToken,
344
- });
345
- if (result?.success === true) {
346
- this.submissionInProgress = false;
347
- const newReview = this.generateSubmittedReview();
348
- // Emit a reviewUpdated event
349
- const event = new CustomEvent('reviewUpdated', {
350
- detail: newReview,
351
- });
352
- this.dispatchEvent(event);
353
- }
354
- else {
355
- if (result.error)
356
- this.recoverableError = result.error;
357
- else
358
- this.formError = 'generic';
359
- this.stopSubmission();
360
- }
361
- }
362
- catch (e) {
363
- console.error(e);
364
- this.formError = 'generic';
365
- this.stopSubmission();
366
- }
367
- }
368
- /**
369
- * Generates a review object from the submitted review,
370
- * for optimistic display on success.
371
- *
372
- * @returns {Review} The review to display
373
- */
374
- generateSubmittedReview() {
375
- const today = new Date().toDateString();
376
- const newReview = new Review({
377
- reviewtitle: this.reviewForm.field_reviewtitle.value,
378
- reviewbody: this.reviewForm.field_reviewbody.value,
379
- stars: this.reviewForm.field_stars.value,
380
- reviewdate: today,
381
- reviewer: this.oldReview?.reviewer ??
382
- this.submitterScreenname ??
383
- msg('Anonymous'),
384
- reviewer_itemname: this.oldReview?.reviewer_itemname ?? this.submitterItemname,
385
- createdate: this.dateToString(this.oldReview?.createdate) ?? today,
386
- });
387
- return newReview;
388
- }
389
- /**
390
- * Converts date to string if it is a Date, otherwise
391
- * leaves unchanged.
392
- */
393
- dateToString(date) {
394
- if (date instanceof Date)
395
- return date.toDateString();
396
- return date;
397
- }
398
- /**
399
- * Executes the ReCaptcha challenge for the form.
400
- * Attempts form submission on success.
401
- * */
402
- async getRecaptchaToken() {
403
- if (!this.recaptchaWidget) {
404
- this.handleRecaptchaError();
405
- return;
406
- }
407
- try {
408
- const recaptchaToken = await this.recaptchaWidget.execute();
409
- return recaptchaToken;
410
- }
411
- catch {
412
- this.handleRecaptchaError();
413
- return;
414
- }
415
- }
416
- /* Handles a recaptcha error during submission */
417
- handleRecaptchaError() {
418
- this.formError = 'recaptcha';
419
- this.stopSubmission();
420
- }
421
- /* Handles canceled form submission */
422
- stopSubmission() {
423
- if (this.submissionInProgress) {
424
- this.submissionInProgress = false;
425
- }
426
- }
427
- /* Emits an event to close the form */
428
- cancelReviewEdit() {
429
- const event = new CustomEvent('reviewEditCanceled');
430
- this.dispatchEvent(event);
431
- }
432
- /* Prevents form submission and sets stars based on number clicked */
433
- handleStarClicked(e, num) {
434
- e.preventDefault();
435
- this.setStars(num);
436
- }
437
- /* Clear stars if requested */
438
- handleClearBtnClicked(e) {
439
- e.preventDefault();
440
- this.currentStars = 0;
441
- }
442
- /* Updates star count, resetting to 0 if the currently selected star is clicked */
443
- setStars(num) {
444
- this.currentStars = num === this.currentStars ? 0 : num;
445
- }
446
- /* Updates subject input length */
447
- handleSubjectChanged(e) {
448
- const subjectInput = e.target;
449
- this.currentSubjectLength = subjectInput.value.length;
450
- }
451
- /* Updates body input length */
452
- handleBodyChanged(e) {
453
- const bodyInput = e.target;
454
- this.currentBodyLength = bodyInput.value.length;
455
- }
456
- /* Checks if submission should be allowed */
457
- checkSubmissionAllowed() {
458
- // Form must not have an unrecoverable error
459
- if (this.unrecoverableErrorMessage) {
460
- return false;
461
- }
462
- // Subject and body must not be empty
463
- if (!this.currentBodyLength || !this.currentSubjectLength) {
464
- return false;
465
- }
466
- // Subject must be correct length
467
- if (!!this.maxSubjectLength &&
468
- this.currentSubjectLength > this.maxSubjectLength) {
469
- return false;
470
- }
471
- // Body must be correct length
472
- if (!!this.maxBodyLength && this.currentBodyLength > this.maxBodyLength) {
473
- return false;
474
- }
475
- return true;
476
- }
477
- static get styles() {
478
- return [
479
- css `
480
- .form-heading {
481
- display: flex;
482
- flex-direction: row;
483
- justify-content: space-between;
484
- padding-top: 15px;
485
- }
486
-
487
- .form-heading.rating {
488
- padding-top: 0;
489
- }
490
-
491
- .form-heading label {
492
- font-size: 1.6rem;
493
- font-weight: bold;
494
- }
495
-
496
- label {
497
- display: inline-block;
498
- margin-bottom: 5px;
499
- }
500
-
501
- textarea,
502
- input[type='text'],
503
- .unrecoverable-error {
504
- padding: 5px;
505
- width: calc(100% - 10px);
506
- font-family: inherit;
507
- border-radius: 5px;
508
- border: 1px solid var(--container-border-color, #999999);
509
- }
510
-
511
- .input-box.error input,
512
- .input-box.error textarea {
513
- border: 2px solid var(--container-error-color, #ea0202);
514
- }
515
-
516
- .input-box.error .char-count,
517
- .input-error,
518
- .unrecoverable-error,
519
- .recoverable-error {
520
- color: var(--container-error-color, #ea0202);
521
- }
522
-
523
- .input-error {
524
- display: none;
525
- }
526
-
527
- .input-box.error .input-error {
528
- display: block;
529
- text-align: right;
530
- padding-top: 5px;
531
- }
532
-
533
- .inline-link {
534
- color: var(--container-link-color, #4f65f5);
535
- text-decoration: none;
536
- }
537
-
538
- .inline-link:hover {
539
- text-decoration: underline;
540
- }
541
-
542
- .stars {
543
- display: flex;
544
- flex-direction: row;
545
- gap: 2px;
546
- align-items: center;
547
- }
548
-
549
- .star {
550
- all: unset;
551
- height: 30px;
552
- width: 30px;
553
- }
554
-
555
- .star-selected,
556
- .star-unselected {
557
- display: block;
558
- width: 100%;
559
- height: 100%;
560
- }
561
-
562
- .star:hover {
563
- cursor: pointer;
564
- }
565
-
566
- .clear-stars-btn,
567
- .recoverable-error a {
568
- padding: 0 5px;
569
- color: var(--container-link-color, #4f65f5);
570
- font-family: inherit;
571
- border: none;
572
- background: transparent;
573
- display: inline-block;
574
- padding-top: 5px;
575
- }
576
-
577
- .clear-stars-btn:hover,
578
- .recoverable-error a:hover {
579
- cursor: pointer;
580
- text-decoration: underline;
581
- }
582
-
583
- .action-btns {
584
- width: 100%;
585
- display: flex;
586
- justify-content: flex-end;
587
- gap: 10px;
588
- padding-top: 15px;
589
- }
590
-
591
- .ia-button:disabled {
592
- opacity: 0.75;
593
- }
594
-
595
- .ia-button:disabled:hover {
596
- cursor: not-allowed;
597
- }
598
-
599
- .unrecoverable-error {
600
- min-height: 50px;
601
- padding: 5px;
602
- text-align: center;
603
- display: flex;
604
- flex-direction: column;
605
- justify-content: center;
606
- background-color: var(--container-bg-color, #fbfbfd);
607
- }
608
-
609
- .recaptcha-disclaimer {
610
- font-size: 1.2rem;
611
- }
612
-
613
- @media only screen and (max-width: 350px) {
614
- .action-btns {
615
- flex-direction: column-reverse;
616
- align-items: center;
617
- }
618
- }
619
- `,
620
- ];
621
- }
622
- };
623
- __decorate([
624
- property({ type: String })
625
- ], IAReviewForm.prototype, "identifier", void 0);
626
- __decorate([
627
- property({ type: String })
628
- ], IAReviewForm.prototype, "submitterScreenname", void 0);
629
- __decorate([
630
- property({ type: String })
631
- ], IAReviewForm.prototype, "submitterItemname", void 0);
632
- __decorate([
633
- property({ type: Object })
634
- ], IAReviewForm.prototype, "oldReview", void 0);
635
- __decorate([
636
- property({ type: String })
637
- ], IAReviewForm.prototype, "unrecoverableError", void 0);
638
- __decorate([
639
- property({ type: Number })
640
- ], IAReviewForm.prototype, "maxSubjectLength", void 0);
641
- __decorate([
642
- property({ type: Number })
643
- ], IAReviewForm.prototype, "maxBodyLength", void 0);
644
- __decorate([
645
- property({ type: Object })
646
- ], IAReviewForm.prototype, "reviewService", void 0);
647
- __decorate([
648
- property({ type: Object })
649
- ], IAReviewForm.prototype, "recaptchaManager", void 0);
650
- __decorate([
651
- property({ type: Boolean })
652
- ], IAReviewForm.prototype, "bypassRecaptcha", void 0);
653
- __decorate([
654
- state()
655
- ], IAReviewForm.prototype, "currentStars", void 0);
656
- __decorate([
657
- state()
658
- ], IAReviewForm.prototype, "currentSubjectLength", void 0);
659
- __decorate([
660
- state()
661
- ], IAReviewForm.prototype, "currentBodyLength", void 0);
662
- __decorate([
663
- state()
664
- ], IAReviewForm.prototype, "recoverableError", void 0);
665
- __decorate([
666
- state()
667
- ], IAReviewForm.prototype, "formError", void 0);
668
- __decorate([
669
- state()
670
- ], IAReviewForm.prototype, "recaptchaUnavailable", void 0);
671
- __decorate([
672
- state()
673
- ], IAReviewForm.prototype, "formCanSubmit", void 0);
674
- __decorate([
675
- state()
676
- ], IAReviewForm.prototype, "submissionInProgress", void 0);
677
- __decorate([
678
- query('#review-form')
679
- ], IAReviewForm.prototype, "reviewForm", void 0);
680
- IAReviewForm = __decorate([
681
- customElement('ia-review-form'),
682
- localized()
683
- ], IAReviewForm);
684
- export { IAReviewForm };
685
- //# sourceMappingURL=ia-review-form.js.map