crossnote 0.8.8 → 0.8.9

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 (61) hide show
  1. package/README.md +4 -0
  2. package/out/cjs/index.cjs +179 -213
  3. package/out/dependencies/README.md +1 -9
  4. package/out/dependencies/reveal/css/reset.css +30 -0
  5. package/out/dependencies/reveal/css/reveal.css +3 -3
  6. package/out/dependencies/reveal/js/reveal.js +3 -3
  7. package/out/dependencies/reveal/plugin/notes/notes.js +1 -147
  8. package/out/dependencies/reveal/plugin/notes/plugin.js +261 -0
  9. package/out/dependencies/reveal/plugin/notes/speaker-view.html +891 -0
  10. package/out/dependencies/reveal/plugin/search/plugin.js +243 -0
  11. package/out/dependencies/reveal/plugin/search/search.js +7 -206
  12. package/out/dependencies/reveal/plugin/zoom/plugin.js +264 -0
  13. package/out/dependencies/reveal/plugin/zoom/zoom.js +11 -0
  14. package/out/esm/index.mjs +195 -229
  15. package/out/styles/preview.css +1 -1
  16. package/out/styles/preview_theme/github-dark.css +1 -1
  17. package/out/styles/prism_theme/github-dark.css +1 -0
  18. package/out/styles/style-template.css +1 -1
  19. package/out/types/src/markdown-engine/index.d.ts +2 -2
  20. package/out/types/src/notebook/index.d.ts +10 -8
  21. package/out/types/src/notebook/note.d.ts +2 -1
  22. package/out/types/src/notebook/types.d.ts +18 -1
  23. package/out/types/src/webview/backlinks.d.ts +1 -0
  24. package/out/types/src/webview/components/Backlinks.d.ts +2 -0
  25. package/out/types/src/webview/components/ContextMenu.d.ts +3 -0
  26. package/out/types/src/webview/components/Footer.d.ts +2 -0
  27. package/out/types/src/webview/components/ImageHelper.d.ts +2 -0
  28. package/out/types/src/webview/components/LoadingIcon.d.ts +2 -0
  29. package/out/types/src/webview/components/Preview.d.ts +2 -0
  30. package/out/types/src/webview/components/RefreshingIcon.d.ts +2 -0
  31. package/out/types/src/webview/components/SidebarToc.d.ts +2 -0
  32. package/out/types/src/webview/components/Topbar.d.ts +2 -0
  33. package/out/types/src/webview/containers/preview.d.ts +37 -0
  34. package/out/types/src/webview/lib/types.d.ts +19 -0
  35. package/out/types/src/webview/lib/utility.d.ts +2 -0
  36. package/out/types/src/webview/preview.d.ts +1 -0
  37. package/out/types/tsconfig.tsbuildinfo +1 -1
  38. package/out/webview/backlinks.css +1 -0
  39. package/out/webview/backlinks.js +43 -0
  40. package/out/webview/preview.css +1 -0
  41. package/out/webview/preview.js +84 -0
  42. package/package.json +26 -2
  43. package/out/dependencies/jquery/jquery.js +0 -4
  44. package/out/dependencies/jquery-contextmenu/font/context-menu-icons.eot +0 -0
  45. package/out/dependencies/jquery-contextmenu/font/context-menu-icons.ttf +0 -0
  46. package/out/dependencies/jquery-contextmenu/font/context-menu-icons.woff +0 -0
  47. package/out/dependencies/jquery-contextmenu/font/context-menu-icons.woff2 +0 -0
  48. package/out/dependencies/jquery-contextmenu/jquery.contextMenu.min.css +0 -16
  49. package/out/dependencies/jquery-contextmenu/jquery.contextMenu.min.js +0 -2
  50. package/out/dependencies/jquery-contextmenu/jquery.ui.position.min.js +0 -6
  51. package/out/dependencies/jquery-modal/jquery.modal.min.css +0 -1
  52. package/out/dependencies/jquery-modal/jquery.modal.min.js +0 -5
  53. package/out/dependencies/reveal/plugin/highlight/highlight.js +0 -77
  54. package/out/dependencies/reveal/plugin/markdown/example.html +0 -136
  55. package/out/dependencies/reveal/plugin/markdown/example.md +0 -36
  56. package/out/dependencies/reveal/plugin/markdown/markdown.js +0 -412
  57. package/out/dependencies/reveal/plugin/markdown/marked.js +0 -6
  58. package/out/dependencies/reveal/plugin/math/math.js +0 -67
  59. package/out/styles/loading.css +0 -1
  60. package/out/types/src/webview/webview.d.ts +0 -1
  61. package/out/webview/index.js +0 -22
@@ -0,0 +1,264 @@
1
+ /*!
2
+ * reveal.js Zoom plugin
3
+ */
4
+ const Plugin = {
5
+
6
+ id: 'zoom',
7
+
8
+ init: function( reveal ) {
9
+
10
+ reveal.getRevealElement().addEventListener( 'mousedown', function( event ) {
11
+ var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt';
12
+
13
+ var modifier = ( reveal.getConfig().zoomKey ? reveal.getConfig().zoomKey : defaultModifier ) + 'Key';
14
+ var zoomLevel = ( reveal.getConfig().zoomLevel ? reveal.getConfig().zoomLevel : 2 );
15
+
16
+ if( event[ modifier ] && !reveal.isOverview() ) {
17
+ event.preventDefault();
18
+
19
+ zoom.to({
20
+ x: event.clientX,
21
+ y: event.clientY,
22
+ scale: zoomLevel,
23
+ pan: false
24
+ });
25
+ }
26
+ } );
27
+
28
+ },
29
+
30
+ destroy: () => {
31
+
32
+ zoom.reset();
33
+
34
+ }
35
+
36
+ };
37
+
38
+ export default () => Plugin;
39
+
40
+ /*!
41
+ * zoom.js 0.3 (modified for use with reveal.js)
42
+ * http://lab.hakim.se/zoom-js
43
+ * MIT licensed
44
+ *
45
+ * Copyright (C) 2011-2014 Hakim El Hattab, http://hakim.se
46
+ */
47
+ var zoom = (function(){
48
+
49
+ // The current zoom level (scale)
50
+ var level = 1;
51
+
52
+ // The current mouse position, used for panning
53
+ var mouseX = 0,
54
+ mouseY = 0;
55
+
56
+ // Timeout before pan is activated
57
+ var panEngageTimeout = -1,
58
+ panUpdateInterval = -1;
59
+
60
+ // Check for transform support so that we can fallback otherwise
61
+ var supportsTransforms = 'transform' in document.body.style;
62
+
63
+ if( supportsTransforms ) {
64
+ // The easing that will be applied when we zoom in/out
65
+ document.body.style.transition = 'transform 0.8s ease';
66
+ }
67
+
68
+ // Zoom out if the user hits escape
69
+ document.addEventListener( 'keyup', function( event ) {
70
+ if( level !== 1 && event.keyCode === 27 ) {
71
+ zoom.out();
72
+ }
73
+ } );
74
+
75
+ // Monitor mouse movement for panning
76
+ document.addEventListener( 'mousemove', function( event ) {
77
+ if( level !== 1 ) {
78
+ mouseX = event.clientX;
79
+ mouseY = event.clientY;
80
+ }
81
+ } );
82
+
83
+ /**
84
+ * Applies the CSS required to zoom in, prefers the use of CSS3
85
+ * transforms but falls back on zoom for IE.
86
+ *
87
+ * @param {Object} rect
88
+ * @param {Number} scale
89
+ */
90
+ function magnify( rect, scale ) {
91
+
92
+ var scrollOffset = getScrollOffset();
93
+
94
+ // Ensure a width/height is set
95
+ rect.width = rect.width || 1;
96
+ rect.height = rect.height || 1;
97
+
98
+ // Center the rect within the zoomed viewport
99
+ rect.x -= ( window.innerWidth - ( rect.width * scale ) ) / 2;
100
+ rect.y -= ( window.innerHeight - ( rect.height * scale ) ) / 2;
101
+
102
+ if( supportsTransforms ) {
103
+ // Reset
104
+ if( scale === 1 ) {
105
+ document.body.style.transform = '';
106
+ }
107
+ // Scale
108
+ else {
109
+ var origin = scrollOffset.x +'px '+ scrollOffset.y +'px',
110
+ transform = 'translate('+ -rect.x +'px,'+ -rect.y +'px) scale('+ scale +')';
111
+
112
+ document.body.style.transformOrigin = origin;
113
+ document.body.style.transform = transform;
114
+ }
115
+ }
116
+ else {
117
+ // Reset
118
+ if( scale === 1 ) {
119
+ document.body.style.position = '';
120
+ document.body.style.left = '';
121
+ document.body.style.top = '';
122
+ document.body.style.width = '';
123
+ document.body.style.height = '';
124
+ document.body.style.zoom = '';
125
+ }
126
+ // Scale
127
+ else {
128
+ document.body.style.position = 'relative';
129
+ document.body.style.left = ( - ( scrollOffset.x + rect.x ) / scale ) + 'px';
130
+ document.body.style.top = ( - ( scrollOffset.y + rect.y ) / scale ) + 'px';
131
+ document.body.style.width = ( scale * 100 ) + '%';
132
+ document.body.style.height = ( scale * 100 ) + '%';
133
+ document.body.style.zoom = scale;
134
+ }
135
+ }
136
+
137
+ level = scale;
138
+
139
+ if( document.documentElement.classList ) {
140
+ if( level !== 1 ) {
141
+ document.documentElement.classList.add( 'zoomed' );
142
+ }
143
+ else {
144
+ document.documentElement.classList.remove( 'zoomed' );
145
+ }
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Pan the document when the mosue cursor approaches the edges
151
+ * of the window.
152
+ */
153
+ function pan() {
154
+ var range = 0.12,
155
+ rangeX = window.innerWidth * range,
156
+ rangeY = window.innerHeight * range,
157
+ scrollOffset = getScrollOffset();
158
+
159
+ // Up
160
+ if( mouseY < rangeY ) {
161
+ window.scroll( scrollOffset.x, scrollOffset.y - ( 1 - ( mouseY / rangeY ) ) * ( 14 / level ) );
162
+ }
163
+ // Down
164
+ else if( mouseY > window.innerHeight - rangeY ) {
165
+ window.scroll( scrollOffset.x, scrollOffset.y + ( 1 - ( window.innerHeight - mouseY ) / rangeY ) * ( 14 / level ) );
166
+ }
167
+
168
+ // Left
169
+ if( mouseX < rangeX ) {
170
+ window.scroll( scrollOffset.x - ( 1 - ( mouseX / rangeX ) ) * ( 14 / level ), scrollOffset.y );
171
+ }
172
+ // Right
173
+ else if( mouseX > window.innerWidth - rangeX ) {
174
+ window.scroll( scrollOffset.x + ( 1 - ( window.innerWidth - mouseX ) / rangeX ) * ( 14 / level ), scrollOffset.y );
175
+ }
176
+ }
177
+
178
+ function getScrollOffset() {
179
+ return {
180
+ x: window.scrollX !== undefined ? window.scrollX : window.pageXOffset,
181
+ y: window.scrollY !== undefined ? window.scrollY : window.pageYOffset
182
+ }
183
+ }
184
+
185
+ return {
186
+ /**
187
+ * Zooms in on either a rectangle or HTML element.
188
+ *
189
+ * @param {Object} options
190
+ * - element: HTML element to zoom in on
191
+ * OR
192
+ * - x/y: coordinates in non-transformed space to zoom in on
193
+ * - width/height: the portion of the screen to zoom in on
194
+ * - scale: can be used instead of width/height to explicitly set scale
195
+ */
196
+ to: function( options ) {
197
+
198
+ // Due to an implementation limitation we can't zoom in
199
+ // to another element without zooming out first
200
+ if( level !== 1 ) {
201
+ zoom.out();
202
+ }
203
+ else {
204
+ options.x = options.x || 0;
205
+ options.y = options.y || 0;
206
+
207
+ // If an element is set, that takes precedence
208
+ if( !!options.element ) {
209
+ // Space around the zoomed in element to leave on screen
210
+ var padding = 20;
211
+ var bounds = options.element.getBoundingClientRect();
212
+
213
+ options.x = bounds.left - padding;
214
+ options.y = bounds.top - padding;
215
+ options.width = bounds.width + ( padding * 2 );
216
+ options.height = bounds.height + ( padding * 2 );
217
+ }
218
+
219
+ // If width/height values are set, calculate scale from those values
220
+ if( options.width !== undefined && options.height !== undefined ) {
221
+ options.scale = Math.max( Math.min( window.innerWidth / options.width, window.innerHeight / options.height ), 1 );
222
+ }
223
+
224
+ if( options.scale > 1 ) {
225
+ options.x *= options.scale;
226
+ options.y *= options.scale;
227
+
228
+ magnify( options, options.scale );
229
+
230
+ if( options.pan !== false ) {
231
+
232
+ // Wait with engaging panning as it may conflict with the
233
+ // zoom transition
234
+ panEngageTimeout = setTimeout( function() {
235
+ panUpdateInterval = setInterval( pan, 1000 / 60 );
236
+ }, 800 );
237
+
238
+ }
239
+ }
240
+ }
241
+ },
242
+
243
+ /**
244
+ * Resets the document zoom state to its default.
245
+ */
246
+ out: function() {
247
+ clearTimeout( panEngageTimeout );
248
+ clearInterval( panUpdateInterval );
249
+
250
+ magnify( { x: 0, y: 0 }, 1 );
251
+
252
+ level = 1;
253
+ },
254
+
255
+ // Alias
256
+ magnify: function( options ) { this.to( options ) },
257
+ reset: function() { this.out() },
258
+
259
+ zoomLevel: function() {
260
+ return level;
261
+ }
262
+ }
263
+
264
+ })();
@@ -0,0 +1,11 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).RevealZoom=t()}(this,(function(){"use strict";
2
+ /*!
3
+ * reveal.js Zoom plugin
4
+ */const e={id:"zoom",init:function(e){e.getRevealElement().addEventListener("mousedown",(function(o){var n=/Linux/.test(window.navigator.platform)?"ctrl":"alt",i=(e.getConfig().zoomKey?e.getConfig().zoomKey:n)+"Key",d=e.getConfig().zoomLevel?e.getConfig().zoomLevel:2;o[i]&&!e.isOverview()&&(o.preventDefault(),t.to({x:o.clientX,y:o.clientY,scale:d,pan:!1}))}))},destroy:()=>{t.reset()}};var t=function(){var e=1,o=0,n=0,i=-1,d=-1,l="transform"in document.body.style;function s(t,o){var n=r();if(t.width=t.width||1,t.height=t.height||1,t.x-=(window.innerWidth-t.width*o)/2,t.y-=(window.innerHeight-t.height*o)/2,l)if(1===o)document.body.style.transform="";else{var i=n.x+"px "+n.y+"px",d="translate("+-t.x+"px,"+-t.y+"px) scale("+o+")";document.body.style.transformOrigin=i,document.body.style.transform=d}else 1===o?(document.body.style.position="",document.body.style.left="",document.body.style.top="",document.body.style.width="",document.body.style.height="",document.body.style.zoom=""):(document.body.style.position="relative",document.body.style.left=-(n.x+t.x)/o+"px",document.body.style.top=-(n.y+t.y)/o+"px",document.body.style.width=100*o+"%",document.body.style.height=100*o+"%",document.body.style.zoom=o);e=o,document.documentElement.classList&&(1!==e?document.documentElement.classList.add("zoomed"):document.documentElement.classList.remove("zoomed"))}function c(){var t=.12*window.innerWidth,i=.12*window.innerHeight,d=r();n<i?window.scroll(d.x,d.y-14/e*(1-n/i)):n>window.innerHeight-i&&window.scroll(d.x,d.y+(1-(window.innerHeight-n)/i)*(14/e)),o<t?window.scroll(d.x-14/e*(1-o/t),d.y):o>window.innerWidth-t&&window.scroll(d.x+(1-(window.innerWidth-o)/t)*(14/e),d.y)}function r(){return{x:void 0!==window.scrollX?window.scrollX:window.pageXOffset,y:void 0!==window.scrollY?window.scrollY:window.pageYOffset}}return l&&(document.body.style.transition="transform 0.8s ease"),document.addEventListener("keyup",(function(o){1!==e&&27===o.keyCode&&t.out()})),document.addEventListener("mousemove",(function(t){1!==e&&(o=t.clientX,n=t.clientY)})),{to:function(o){if(1!==e)t.out();else{if(o.x=o.x||0,o.y=o.y||0,o.element){var n=o.element.getBoundingClientRect();o.x=n.left-20,o.y=n.top-20,o.width=n.width+40,o.height=n.height+40}void 0!==o.width&&void 0!==o.height&&(o.scale=Math.max(Math.min(window.innerWidth/o.width,window.innerHeight/o.height),1)),o.scale>1&&(o.x*=o.scale,o.y*=o.scale,s(o,o.scale),!1!==o.pan&&(i=setTimeout((function(){d=setInterval(c,1e3/60)}),800)))}},out:function(){clearTimeout(i),clearInterval(d),s({x:0,y:0},1),e=1},magnify:function(e){this.to(e)},reset:function(){this.out()},zoomLevel:function(){return e}}}();
5
+ /*!
6
+ * zoom.js 0.3 (modified for use with reveal.js)
7
+ * http://lab.hakim.se/zoom-js
8
+ * MIT licensed
9
+ *
10
+ * Copyright (C) 2011-2014 Hakim El Hattab, http://hakim.se
11
+ */return()=>e}));