@projektemacher/storymapjs 0.10.6 → 0.10.7

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 (148) hide show
  1. package/CHANGELOG +11 -0
  2. package/dist/assets/{demo-CVQ7kFek.js → demo-D6cTmzn6.js} +1 -1
  3. package/dist/assets/{harness-C-VZV-ou.js → harness-BPFlzutp.js} +1 -1
  4. package/dist/assets/main-Y-MYUSJ4.js +17 -0
  5. package/dist/css/fonts/font.oldstandard.css +18 -22
  6. package/dist/demo.html +2 -2
  7. package/dist/docs/migration.html +1 -1
  8. package/dist/embed/index.html +129 -4
  9. package/dist/harness.html +2 -2
  10. package/dist/index.html +17 -0
  11. package/dist/js/storymap.d.ts +126 -7
  12. package/dist/js/storymap.js +4518 -3613
  13. package/dist/js/storymap.js.map +1 -1
  14. package/docs/migration-from-knightlab.md +139 -0
  15. package/docs/storymap-as-iiif-manifest.md +510 -0
  16. package/package.json +6 -3
  17. package/src/animation/easings.ts +18 -0
  18. package/src/animation/morpheus.d.ts +41 -0
  19. package/src/core/Browser.ts +19 -0
  20. package/src/core/Load.ts +180 -0
  21. package/src/core/Util.ts +354 -0
  22. package/src/core/mixins.ts +171 -0
  23. package/src/dom/Dom.ts +31 -0
  24. package/src/dom/DomEvent.ts +61 -0
  25. package/src/globals.d.ts +16 -0
  26. package/src/language/Language.ts +107 -0
  27. package/src/language/locale/be.json +18 -0
  28. package/src/language/locale/bg.json +18 -0
  29. package/src/language/locale/cs.json +18 -0
  30. package/src/language/locale/de.json +20 -0
  31. package/src/language/locale/el.json +18 -0
  32. package/src/language/locale/en.json +28 -0
  33. package/src/language/locale/es.json +18 -0
  34. package/src/language/locale/et.json +18 -0
  35. package/src/language/locale/fr.json +18 -0
  36. package/src/language/locale/he.json +18 -0
  37. package/src/language/locale/hu.json +18 -0
  38. package/src/language/locale/is.json +18 -0
  39. package/src/language/locale/it.json +18 -0
  40. package/src/language/locale/jp.json +18 -0
  41. package/src/language/locale/ko.json +18 -0
  42. package/src/language/locale/nl.json +18 -0
  43. package/src/language/locale/nn.json +18 -0
  44. package/src/language/locale/no.json +18 -0
  45. package/src/language/locale/pl.json +18 -0
  46. package/src/language/locale/pt.json +18 -0
  47. package/src/language/locale/ru.json +18 -0
  48. package/src/language/locale/sk.json +18 -0
  49. package/src/language/locale/sr.json +17 -0
  50. package/src/language/locale/sv.json +18 -0
  51. package/src/language/locale/tr.json +18 -0
  52. package/src/language/locale/uk.json +18 -0
  53. package/src/language/locale/ur.json +18 -0
  54. package/src/language/locale/zh-cn.json +18 -0
  55. package/src/language/locale/zh-tw.json +18 -0
  56. package/src/main.ts +51 -0
  57. package/src/map/Map.ts +717 -0
  58. package/src/map/MapMarker.ts +149 -0
  59. package/src/map/openlayers/Map.OpenLayers.ts +1879 -0
  60. package/src/map/openlayers/MapMarker.OpenLayers.ts +176 -0
  61. package/src/map/openlayers/zoomifyTiles.ts +28 -0
  62. package/src/map/types.ts +17 -0
  63. package/src/media/EmbedUtil.ts +168 -0
  64. package/src/media/Media.ts +409 -0
  65. package/src/media/MediaType.ts +163 -0
  66. package/src/media/types/Audio.ts +87 -0
  67. package/src/media/types/Blockquote.ts +40 -0
  68. package/src/media/types/DailyMotion.ts +58 -0
  69. package/src/media/types/DocumentCloud.ts +41 -0
  70. package/src/media/types/Facebook.ts +41 -0
  71. package/src/media/types/Flickr.ts +115 -0
  72. package/src/media/types/GoogleDoc.ts +59 -0
  73. package/src/media/types/IFrame.ts +51 -0
  74. package/src/media/types/Image.ts +49 -0
  75. package/src/media/types/Juxtapose.ts +32 -0
  76. package/src/media/types/SoundCloud.ts +77 -0
  77. package/src/media/types/Text.ts +172 -0
  78. package/src/media/types/Twitter.ts +96 -0
  79. package/src/media/types/Video.ts +84 -0
  80. package/src/media/types/Vimeo.ts +65 -0
  81. package/src/media/types/Website.ts +36 -0
  82. package/src/media/types/Wikipedia.ts +124 -0
  83. package/src/media/types/YouTube.ts +192 -0
  84. package/src/scss/Typography.scss +237 -0
  85. package/src/scss/VCO.StoryMap.Dark.scss +138 -0
  86. package/src/scss/VCO.StoryMap.scss +164 -0
  87. package/src/scss/Variables.Dark.scss +56 -0
  88. package/src/scss/Variables.scss +47 -0
  89. package/src/scss/core/Mixins.scss +112 -0
  90. package/src/scss/core/Reset.scss +206 -0
  91. package/src/scss/fonts/_font.base.scss +113 -0
  92. package/src/scss/fonts/font.abril-droidsans.scss +75 -0
  93. package/src/scss/fonts/font.amatic-andika.scss +73 -0
  94. package/src/scss/fonts/font.bitter-raleway.scss +86 -0
  95. package/src/scss/fonts/font.clicker-garamond.scss +92 -0
  96. package/src/scss/fonts/font.dancing-ledger.scss +74 -0
  97. package/src/scss/fonts/font.default.scss +9 -0
  98. package/src/scss/fonts/font.fjalla-average.scss +80 -0
  99. package/src/scss/fonts/font.georgia-helvetica.scss +58 -0
  100. package/src/scss/fonts/font.knightlab.scss +97 -0
  101. package/src/scss/fonts/font.lustria-lato.scss +80 -0
  102. package/src/scss/fonts/font.medula-lato.scss +73 -0
  103. package/src/scss/fonts/font.oldstandard.scss +88 -0
  104. package/src/scss/fonts/font.opensans-gentiumbook.scss +80 -0
  105. package/src/scss/fonts/font.playfair-faunaone.scss +86 -0
  106. package/src/scss/fonts/font.playfair.scss +85 -0
  107. package/src/scss/fonts/font.pt.scss +90 -0
  108. package/src/scss/fonts/font.roboto-megrim.scss +73 -0
  109. package/src/scss/fonts/font.rufina-sintony.scss +73 -0
  110. package/src/scss/fonts/font.ubuntu.scss +78 -0
  111. package/src/scss/fonts/font.unicaone-vollkorn.scss +85 -0
  112. package/src/scss/icons/Icons.scss +239 -0
  113. package/src/scss/map/VCO.ImageMarker.scss +23 -0
  114. package/src/scss/map/VCO.Map.scss +21 -0
  115. package/src/scss/map/VCO.MapMarker.scss +147 -0
  116. package/src/scss/map/openlayers/VCO.Map.OpenLayers.scss +126 -0
  117. package/src/scss/media/VCO.Media.scss +222 -0
  118. package/src/scss/media/types/VCO.Media.Blockquote.scss +76 -0
  119. package/src/scss/media/types/VCO.Media.IFrame.scss +11 -0
  120. package/src/scss/media/types/VCO.Media.Image.scss +13 -0
  121. package/src/scss/media/types/VCO.Media.Instagram.scss +7 -0
  122. package/src/scss/media/types/VCO.Media.Profile.scss +5 -0
  123. package/src/scss/media/types/VCO.Media.Text.scss +90 -0
  124. package/src/scss/media/types/VCO.Media.Twitter.scss +87 -0
  125. package/src/scss/media/types/VCO.Media.Wikipedia.scss +64 -0
  126. package/src/scss/site/site.scss +748 -0
  127. package/src/scss/slider/VCO.Slide.scss +447 -0
  128. package/src/scss/slider/VCO.SlideNav.scss +338 -0
  129. package/src/scss/slider/VCO.StorySlider.scss +64 -0
  130. package/src/scss/snapmap/VCO.SnapMap.scss +103 -0
  131. package/src/scss/ui/VCO.Consent.scss +77 -0
  132. package/src/scss/ui/VCO.MenuBar.Button.scss +99 -0
  133. package/src/scss/ui/VCO.MenuBar.scss +20 -0
  134. package/src/scss/ui/VCO.Message.scss +104 -0
  135. package/src/site/site.ts +87 -0
  136. package/src/slider/Slide.ts +460 -0
  137. package/src/slider/SlideNav.ts +212 -0
  138. package/src/slider/StorySlider.ts +722 -0
  139. package/src/storymap/Consent.ts +146 -0
  140. package/src/storymap/StoryMap.ts +1108 -0
  141. package/src/storymap/iiif.ts +386 -0
  142. package/src/storymap/validate.ts +184 -0
  143. package/src/types.ts +297 -0
  144. package/src/ui/Draggable.ts +374 -0
  145. package/src/ui/MenuBar.ts +323 -0
  146. package/src/ui/Message.ts +118 -0
  147. package/src/ui/Swipable.ts +388 -0
  148. package/dist/assets/main-DwbXrrYn.js +0 -17
@@ -0,0 +1,212 @@
1
+ import { mergeData } from "../core/Util";
2
+ import { DomMixed, Evented, type EventedInstance } from "../core/mixins";
3
+ import Dom from "../dom/Dom";
4
+ import Animate from "morpheus";
5
+ import { DomEvent } from "../dom/DomEvent";
6
+ import { Browser } from "../core/Browser";
7
+ import { AnimateOptions, AnimationHandle } from "../types";
8
+ /* SlideNav
9
+ Navigation for Slideshows
10
+ ================================================== */
11
+
12
+ interface SlideNavData {
13
+ title: string;
14
+ description: string;
15
+ date?: string;
16
+ [key: string]: unknown;
17
+ }
18
+
19
+ interface SlideNavOptions {
20
+ direction: string;
21
+ [key: string]: unknown;
22
+ }
23
+
24
+ class SlideNavBase {
25
+ declare "_el": Record<string, HTMLElement>;
26
+ declare "mediatype": unknown;
27
+ declare "data": SlideNavData;
28
+ declare "options": SlideNavOptions;
29
+ declare "animator": AnimationHandle | null;
30
+ declare "animator_position": AnimationHandle | null;
31
+ declare "fire": EventedInstance["fire"];
32
+
33
+ //_el: {},
34
+
35
+ /* Constructor
36
+ ================================================== */
37
+ constructor(
38
+ data?: Partial<SlideNavData>,
39
+ options?: Partial<SlideNavOptions>,
40
+ add_to_container?: HTMLElement,
41
+ ) {
42
+ // DOM ELEMENTS
43
+ this._el = {
44
+ container: {} as HTMLElement,
45
+ content_container: {} as HTMLElement,
46
+ icon: {} as HTMLElement,
47
+ title: {} as HTMLElement,
48
+ description: {} as HTMLElement,
49
+ };
50
+
51
+ // Media Type
52
+ this.mediatype = {};
53
+
54
+ // Data
55
+ this.data = {
56
+ title: "Navigation",
57
+ description: "Description",
58
+ };
59
+
60
+ //Options
61
+ this.options = {
62
+ direction: "previous",
63
+ };
64
+
65
+ this.animator = null;
66
+ this.animator_position = null;
67
+
68
+ // Merge Data and Options
69
+ mergeData(this.options, options);
70
+ mergeData(this.data, data);
71
+
72
+ this._el.container = Dom.create("div", "vco-slidenav-" + this.options.direction);
73
+
74
+ if (Browser.mobile) {
75
+ this._el.container.setAttribute("ontouchstart", " ");
76
+ }
77
+
78
+ this._initLayout();
79
+ this._initEvents();
80
+
81
+ if (add_to_container) {
82
+ add_to_container.appendChild(this._el.container);
83
+ }
84
+ }
85
+
86
+ /* Update Content
87
+ ================================================== */
88
+ update(d?: Partial<SlideNavData>) {
89
+ this._update(d);
90
+ }
91
+
92
+ /* Color
93
+ ================================================== */
94
+ setColor(inverted: boolean) {
95
+ if (inverted) {
96
+ this._el.content_container.className =
97
+ "vco-slidenav-content-container vco-slidenav-inverted";
98
+ } else {
99
+ this._el.content_container.className = "vco-slidenav-content-container";
100
+ }
101
+ }
102
+
103
+ /* Position
104
+ ================================================== */
105
+ updatePosition(
106
+ pos: Record<string, number | string>,
107
+ use_percent: boolean,
108
+ duration: number,
109
+ ease: unknown,
110
+ start_value: number,
111
+ return_to_default: boolean,
112
+ ) {
113
+ const ani: AnimateOptions = {
114
+ duration: duration,
115
+ easing: ease,
116
+ complete: () => {
117
+ this._onUpdatePositionComplete(return_to_default);
118
+ },
119
+ };
120
+ const _start_value = start_value;
121
+
122
+ for (const name in pos) {
123
+ if (Object.hasOwn(pos, name)) {
124
+ if (use_percent) {
125
+ ani[name] = pos[name] + "%";
126
+ } else {
127
+ ani[name] = pos[name] + "px";
128
+ }
129
+ }
130
+ }
131
+
132
+ if (this.animator_position) {
133
+ this.animator_position.stop();
134
+ }
135
+
136
+ let prop_to_set: string;
137
+ if (ani.right) {
138
+ prop_to_set = "right";
139
+ } else {
140
+ prop_to_set = "left";
141
+ }
142
+ if (use_percent) {
143
+ (this._el.container.style as unknown as Record<string, string>)[prop_to_set] =
144
+ _start_value + "%";
145
+ } else {
146
+ (this._el.container.style as unknown as Record<string, string>)[prop_to_set] =
147
+ _start_value + "px";
148
+ }
149
+
150
+ this.animator_position = Animate(this._el.container, ani);
151
+ }
152
+
153
+ _onUpdatePositionComplete(return_to_default: boolean) {
154
+ if (return_to_default) {
155
+ this._el.container.style.left = "";
156
+ this._el.container.style.right = "";
157
+ }
158
+ }
159
+
160
+ /* Events
161
+ ================================================== */
162
+ _onMouseClick() {
163
+ this.fire("clicked", this.options);
164
+ }
165
+
166
+ /* Private Methods
167
+ ================================================== */
168
+ _update(d?: Partial<SlideNavData>) {
169
+ // update data
170
+ this.data = mergeData(this.data, d);
171
+
172
+ // Title
173
+ if (this.data.title !== "") {
174
+ this._el.title.innerHTML = this.data.title;
175
+ }
176
+
177
+ // Date
178
+ if (this.data.date !== "") {
179
+ this._el.description.innerHTML = this.data.description;
180
+ }
181
+ }
182
+
183
+ _initLayout() {
184
+ // Create Layout
185
+ this._el.content_container = Dom.create(
186
+ "div",
187
+ "vco-slidenav-content-container",
188
+ this._el.container,
189
+ );
190
+ this._el.icon = Dom.create("div", "vco-slidenav-icon", this._el.content_container);
191
+ this._el.title = Dom.create("div", "vco-slidenav-title", this._el.content_container);
192
+ this._el.description = Dom.create(
193
+ "div",
194
+ "vco-slidenav-description",
195
+ this._el.content_container,
196
+ );
197
+
198
+ this._el.icon.innerHTML = "&nbsp;";
199
+
200
+ this._update();
201
+ }
202
+
203
+ _initEvents() {
204
+ DomEvent.addListener(this._el.container, "click", this._onMouseClick, this);
205
+ }
206
+ }
207
+
208
+ export default class SlideNav extends DomMixed(Evented(SlideNavBase)) {
209
+ constructor(...args: ConstructorParameters<typeof SlideNavBase>) {
210
+ super(...args);
211
+ }
212
+ }