@internetarchive/elements 0.2.13-webdev-9022.1 → 0.2.13

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 (29) hide show
  1. package/dist/src/elements/index.d.ts +0 -1
  2. package/dist/src/elements/index.d.ts.map +1 -1
  3. package/dist/src/elements/index.js +0 -1
  4. package/dist/src/elements/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/dist/src/elements/ia-image-viewer/ia-image-viewer.d.ts +0 -147
  7. package/dist/src/elements/ia-image-viewer/ia-image-viewer.d.ts.map +0 -1
  8. package/dist/src/elements/ia-image-viewer/ia-image-viewer.js +0 -532
  9. package/dist/src/elements/ia-image-viewer/ia-image-viewer.js.map +0 -1
  10. package/dist/src/elements/ia-image-viewer/ia-imgview-controls.d.ts +0 -22
  11. package/dist/src/elements/ia-image-viewer/ia-imgview-controls.d.ts.map +0 -1
  12. package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js +0 -157
  13. package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js.map +0 -1
  14. package/dist/src/elements/ia-image-viewer/ia-imgview-slide.d.ts +0 -44
  15. package/dist/src/elements/ia-image-viewer/ia-imgview-slide.d.ts.map +0 -1
  16. package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js +0 -225
  17. package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js.map +0 -1
  18. package/dist/src/elements/ia-image-viewer/image-viewer-gestures.d.ts +0 -79
  19. package/dist/src/elements/ia-image-viewer/image-viewer-gestures.d.ts.map +0 -1
  20. package/dist/src/elements/ia-image-viewer/image-viewer-gestures.js +0 -254
  21. package/dist/src/elements/ia-image-viewer/image-viewer-gestures.js.map +0 -1
  22. package/dist/src/elements/ia-image-viewer/models.d.ts +0 -20
  23. package/dist/src/elements/ia-image-viewer/models.d.ts.map +0 -1
  24. package/dist/src/elements/ia-image-viewer/models.js +0 -2
  25. package/dist/src/elements/ia-image-viewer/models.js.map +0 -1
  26. package/dist/src/util/prefers-reduced-motion.d.ts +0 -10
  27. package/dist/src/util/prefers-reduced-motion.d.ts.map +0 -1
  28. package/dist/src/util/prefers-reduced-motion.js +0 -12
  29. package/dist/src/util/prefers-reduced-motion.js.map +0 -1
@@ -1,7 +1,6 @@
1
1
  export * from './ia-button/ia-button.js';
2
2
  export * from './ia-combo-box/ia-combo-box.js';
3
3
  export * from './ia-dropdown-search-bar/ia-dropdown-search-bar.js';
4
- export * from './ia-image-viewer/ia-image-viewer.js';
5
4
  export * from './ia-item-navigator/ia-item-navigator.js';
6
5
  export * from './ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js';
7
6
  export * from './ia-item-navigator/menus/ia-itemnav-sort-files-button.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iDAAiD,CAAC;AAChE,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AACvE,cAAc,kDAAkD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AACvE,cAAc,kDAAkD,CAAC"}
@@ -1,7 +1,6 @@
1
1
  export * from './ia-button/ia-button.js';
2
2
  export * from './ia-combo-box/ia-combo-box.js';
3
3
  export * from './ia-dropdown-search-bar/ia-dropdown-search-bar.js';
4
- export * from './ia-image-viewer/ia-image-viewer.js';
5
4
  export * from './ia-item-navigator/ia-item-navigator.js';
6
5
  export * from './ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js';
7
6
  export * from './ia-item-navigator/menus/ia-itemnav-sort-files-button.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/elements/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iDAAiD,CAAC;AAChE,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AACvE,cAAc,kDAAkD,CAAC","sourcesContent":["export * from './ia-button/ia-button';\nexport * from './ia-combo-box/ia-combo-box';\nexport * from './ia-dropdown-search-bar/ia-dropdown-search-bar';\nexport * from './ia-image-viewer/ia-image-viewer';\nexport * from './ia-item-navigator/ia-item-navigator';\nexport * from './ia-item-navigator/menus/ia-itemnav-viewable-files-panel';\nexport * from './ia-item-navigator/menus/ia-itemnav-sort-files-button';\nexport * from './ia-item-navigator/menus/ia-itemnav-share-panel';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/elements/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AACvE,cAAc,kDAAkD,CAAC","sourcesContent":["export * from './ia-button/ia-button';\nexport * from './ia-combo-box/ia-combo-box';\nexport * from './ia-dropdown-search-bar/ia-dropdown-search-bar';\nexport * from './ia-item-navigator/ia-item-navigator';\nexport * from './ia-item-navigator/menus/ia-itemnav-viewable-files-panel';\nexport * from './ia-item-navigator/menus/ia-itemnav-sort-files-button';\nexport * from './ia-item-navigator/menus/ia-itemnav-share-panel';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/elements",
3
- "version": "0.2.13-webdev-9022.1",
3
+ "version": "0.2.13",
4
4
  "description": "A web component library from the Internet Archive.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "types": "./dist/src/elements/index.d.ts",
@@ -1,147 +0,0 @@
1
- import { type CSSResultGroup, LitElement, nothing, type PropertyValues, type TemplateResult } from 'lit';
2
- import type { ImageViewerImage, SlideDirection } from './models.js';
3
- import './ia-imgview-slide.js';
4
- import './ia-imgview-controls.js';
5
- /**
6
- * A swipeable image carousel.
7
- *
8
- * Shows one image at a time from a list, with previous/next buttons, a
9
- * counter, keyboard arrows, horizontal wheel scrolling and touch swipes.
10
- * Clicking an image opens it in a new tab.
11
- *
12
- * The viewer holds no opinion about where the images came from: it takes a
13
- * plain list of names and URLs, and reports the image it lands on through
14
- * `imageChanged` so a host can mirror that into its own URL or analytics.
15
- *
16
- * @fires imageChanged - The viewer settled on a new image.
17
- * @fires imageLoaded - An image the viewer showed finished loading.
18
- * @fires imageLoadFailed - An image the viewer showed could not be loaded.
19
- * Fires once per image until it loads successfully or the set changes.
20
- * @fires imageActivated - An image was clicked. Cancelable: preventing it
21
- * stops the default of opening the image in a new tab.
22
- */
23
- export declare class IAImageViewer extends LitElement {
24
- images: ImageViewerImage[];
25
- /**
26
- * Name of the image to show. Changing it jumps straight to that image
27
- * without animating. An unknown name shows the first image.
28
- */
29
- currentImageName?: string;
30
- /** Read by the gesture controller, which tracks touches against it. */
31
- imageArea?: HTMLElement;
32
- /** Read by the gesture controller, which translates it during a drag. */
33
- slideTrack?: HTMLElement;
34
- /** Read by the gesture controller to navigate relative to the current image. */
35
- currentIndex: number;
36
- private animating;
37
- /**
38
- * Incremented when an animation is interrupted to force the track element to
39
- * be recreated via the `keyed()` directive, which guarantees the CSS
40
- * animation restarts even if the direction is the same.
41
- */
42
- private slideGeneration;
43
- /** Which edge just wrapped, if any. Drives the glow indicator. */
44
- private wrapEdge;
45
- /**
46
- * Images already reported as failed, so a broken image isn't counted again
47
- * every time the viewer passes over it. Navigating back re-fires `error` on
48
- * the recreated element, and the neighbouring slides staged during an
49
- * animation or a drag load the same image too, so without this a single
50
- * broken derivative reports several times a session.
51
- *
52
- * Cleared when the image set changes, which is the point a name stops
53
- * standing for the same file.
54
- */
55
- private reportedFailures;
56
- private slideTarget;
57
- private slideDirection;
58
- private gestures;
59
- get imageCount(): number;
60
- /** The image currently on screen, if there is one. */
61
- get currentImage(): ImageViewerImage | undefined;
62
- protected willUpdate(changed: PropertyValues): void;
63
- /**
64
- * Where to land when the images or the requested name change.
65
- *
66
- * A new `currentImageName` is the host asking for a particular image, so it
67
- * wins. A new `images` array on its own isn't: a host that builds its list
68
- * in a getter hands over a fresh array on every render, which says nothing
69
- * about the images having changed. So the viewer holds its place by name and
70
- * only goes back to the start when the image it was showing is really gone.
71
- */
72
- private indexToShow;
73
- render(): TemplateResult | typeof nothing;
74
- private slideTemplate;
75
- /**
76
- * Announces the image to a screen reader, which otherwise gets nothing when
77
- * the counter and the picture change under it.
78
- */
79
- private get announcementTemplate();
80
- /**
81
- * Passes a slide's load result on to the host, which is where reporting
82
- * belongs. The slide's own events stop at this shadow root, so they're
83
- * re-dispatched rather than allowed to escape.
84
- */
85
- private onImageLoaded;
86
- private onImageFailed;
87
- /**
88
- * Decides whether a click on a slide opens the image.
89
- *
90
- * Two things can stop it: the click is the tail end of a swipe, or the host
91
- * cancels the event to show the image its own way. The slide's event doesn't
92
- * cross this shadow root, so it's re-raised here for the host to see, and a
93
- * veto is passed back down to cancel the click.
94
- */
95
- private onImageActivated;
96
- /**
97
- * Inserts the neighbouring slides around the current one so the touch target
98
- * element stays in the DOM (avoiding touchcancel). These aren't rendered
99
- * from the template, so they're marked for the gesture controller to clean
100
- * up. The dragging class shifts the track to centre on the middle slide.
101
- */
102
- insertDragSlides(): void;
103
- removeDragSlides(): void;
104
- private createDragSlide;
105
- showNext(): void;
106
- showPrevious(): void;
107
- /**
108
- * Starts the move to another image. With reduced motion there's no animation
109
- * to wait on, so the move lands immediately: nothing would fire the
110
- * `animationend` that otherwise commits it.
111
- */
112
- private moveTo;
113
- /**
114
- * Moves to the image a completed drag landed on. The drag has already
115
- * animated the track there, so this only updates state.
116
- */
117
- commitDrag(direction: SlideDirection): void;
118
- /**
119
- * If an animation is in progress, immediately commit its target so the next
120
- * animation starts from the right position. Bumps the generation key to
121
- * force the track element to be recreated, which restarts the CSS animation.
122
- */
123
- settleIfAnimating(): void;
124
- private onWrapGlowEnd;
125
- private onSlideEnd;
126
- /** Finishes a move, however it was driven. */
127
- private settleAtCurrentIndex;
128
- private emitImageChanged;
129
- /**
130
- * Preloads the next and previous images around `currentIndex` so the first
131
- * navigation feels instant.
132
- */
133
- private preloadAdjacentImages;
134
- /**
135
- * Preloads images adjacent to the given index. Called both at rest (around
136
- * `currentIndex`) and at the start of a move (around the target) so rapid
137
- * navigation stays ahead of the browser cache.
138
- *
139
- * A preload that fails is deliberately not reported. These requests are
140
- * speculative and the viewer may never show them, so counting them would
141
- * inflate the failure rate with images nobody looked at. Navigating to a
142
- * broken image renders a real slide, whose `error` reports it then.
143
- */
144
- preloadAroundIndex(index: number): void;
145
- static get styles(): CSSResultGroup;
146
- }
147
- //# sourceMappingURL=ia-image-viewer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ia-image-viewer.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-image-viewer/ia-image-viewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEnB,UAAU,EACV,OAAO,EACP,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AASb,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAY,MAAM,UAAU,CAAC;AAE3E,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAK/B;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,aAAc,SAAQ,UAAU;IAChB,MAAM,EAAE,gBAAgB,EAAE,CAAM;IAE3D;;;OAGG;IACyB,gBAAgB,CAAC,EAAE,M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