pyret-embed 0.0.27 → 0.0.29

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.
@@ -666,11 +666,17 @@
666
666
 
667
667
  // save
668
668
  // On Mac mod ends up mapping to command+s whereas on Windows and Linux it maps to ctrl+s.
669
- Mousetrap.bindGlobal('mod+s', function(e) {
670
- CPO.save();
671
- e.stopImmediatePropagation();
672
- e.preventDefault();
673
- });
669
+ // Saving has a special condition: when embedded we want the Ctrl-S to
670
+ // propagate up. We could fire a special “save” event, but for contexts
671
+ // like VScode it is nice to have the “real” Cmd-S event fire to get
672
+ // good default behavior
673
+ if(!PYRET_IS_EMBEDDED) {
674
+ Mousetrap.bindGlobal('mod+s', function(e) {
675
+ CPO.save();
676
+ e.stopImmediatePropagation();
677
+ e.preventDefault();
678
+ });
679
+ }
674
680
 
675
681
  // resize, Toggle sizing of the editor window between 50% and last resize
676
682
  Mousetrap.bindGlobal('ctrl+m', function(e){
@@ -454,6 +454,18 @@ var GIT_REV = "{{ &GIT_REV }}";
454
454
  var GIT_BRANCH = "{{ &GIT_BRANCH }}";
455
455
  </script>
456
456
 
457
+ <script>
458
+ if (typeof Promise.withResolvers === 'undefined') {
459
+ Promise.withResolvers = function () {
460
+ let resolve, reject
461
+ const promise = new Promise((res, rej) => {
462
+ resolve = res
463
+ reject = rej
464
+ })
465
+ return { promise, resolve, reject }
466
+ }
467
+ }
468
+ </script>
457
469
  <script src="{{ &BASE_URL }}/js/es6-shim.js"></script>
458
470
  <script src="{{ &BASE_URL }}/js/jquery.min.js"></script>
459
471
  <script src="{{ &BASE_URL }}/js/jquery-ui.min.js"></script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyret-embed",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "A library for embedding Pyret into webpages",
5
5
  "main": "dist/pyret.js",
6
6
  "files": [