From be64683aedd514bbe1472d4c8a17d88dd9bf4bd2 Mon Sep 17 00:00:00 2001 From: Leon Date: Sun, 28 Aug 2022 18:36:02 +1000 Subject: [PATCH 1/2] Fixed Harlowe editor extension version restriction issue. --- .../{harlowe-3.3.2 => harlowe-3.3.3}/format.js | 6 +++--- .../story-formats/{harlowe-3.3.2 => harlowe-3.3.3}/icon.svg | 0 src/store/prefs/defaults.ts | 2 +- src/store/story-formats/defaults.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename public/story-formats/{harlowe-3.3.2 => harlowe-3.3.3}/format.js (68%) rename public/story-formats/{harlowe-3.3.2 => harlowe-3.3.3}/icon.svg (100%) diff --git a/public/story-formats/harlowe-3.3.2/format.js b/public/story-formats/harlowe-3.3.3/format.js similarity index 68% rename from public/story-formats/harlowe-3.3.2/format.js rename to public/story-formats/harlowe-3.3.3/format.js index 670af13db..b4b98b5e3 100644 --- a/public/story-formats/harlowe-3.3.2/format.js +++ b/public/story-formats/harlowe-3.3.3/format.js @@ -1,4 +1,4 @@ -window.storyFormat({"name":"Harlowe","version":"3.3.2","author":"Leon Arnott","description":"The default story format for Twine 2, with numerous programming features and a rich passage editor. No HTML, JS or CSS experience required. Consult its documentation.","image":"icon.svg","url":"http://twinery.org/","license":"Zlib","proofing":false,"source":"\n\n\n\n\n{{STORY_NAME}}\n\n\n\n\n{{STORY_DATA}}\n\n\n\n\n","setup": function(){(function(){ -"use strict";function _createForOfIteratorHelper(a,t){var r,o="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!o){if(Array.isArray(a)||(o=_unsupportedIterableToArray(a))||t&&a&&"number"==typeof a.length)return o&&(a=o),r=0,{s:t=function F(){},n:function n(){return r>=a.length?{done:!0}:{done:!1,value:a[r++]}},e:function e(a){throw a},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,l=!1;return{s:function s(){o=o.call(a)},n:function n(){var e=o.next();return c=e.done,e},e:function e(a){l=!0,i=a},f:function f(){try{c||null==o.return||o.return()}finally{if(l)throw i}}}}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function _slicedToArray(e,a){return _arrayWithHoles(e)||_iterableToArrayLimit(e,a)||_unsupportedIterableToArray(e,a)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,n=[],i=!0,s=!1;try{for(t=t.call(e);!(i=(r=t.next()).done)&&(n.push(r.value),!a||n.length!==a);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(s)throw o}}return n}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,a){if(e){if("string"==typeof e)return _arrayLikeToArray(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,a):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,r=new Array(a);t=n.length)&&!g.isFront)continue}s=this.end)return null;if(this.children.length)for(var a=0;a=this.end)return[];var a=[];if(this.children.length)for(var t=0;t=this.end?null:this.children?this.children.reduce(function(e,a){return e||(t>=a.start&&t|<=+|=+><=+|<==+>)"+o+l,l=o+"(=+\\|+|\\|+=+|=+\\|+=+|\\|=+\\|)"+o+l,p={opener:"\\[\\[(?!\\[)",text:"("+function notChars(){return"[^"+Array.apply(0,arguments).map(escape).join("")+"]*"}("]")+")",rightSeparator:a("\\->","\\|"),leftSeparator:"<\\-",closer:"\\]\\]",legacySeparator:"\\|",legacyText:"("+a("[^\\|\\]]","\\]"+t("\\]"))+"+)"},g=c+"*"+c.replace("\\w","a-zA-Z")+c+"*",b="\\$("+g+")",y="_("+g+")",f="'s"+n+"("+g+")",w="("+g+")"+n+"of"+i+t("it\\b"),k="'s"+n,v=a("it","time","turns?","visits?","exits?","pos")+i,x="its"+n+"("+g+")",T="("+g+")"+n+"of"+n+"it"+i,C="of"+n+"it"+i,S={opener:"\\(",name:"("+a("\\$","_")+"?"+s+"+):"+t("\\/"),closer:"\\)"},A=a("=<","=>","[gl]te?\\b","n?eq\\b","isnot\\b","are\\b","x\\b","isa\\b","or"+n+"a"+i),N="[a-zA-Z][\\w\\-]*",_="(?:\"[^\"]*\"|'[^']*'|[^'\">])*?",O="\\|("+s+"+)(>|\\))",L="(<|\\()("+s+"+)\\|",P="((?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?)"+t("m?s")+i;p.main=p.opener+a(p.text+p.rightSeparator,p.text.replace("*","*?")+p.leftSeparator)+p.text,e={upperLetter:"[A-Z\\u00c0-\\u00de\\u0150\\u0170]",lowerLetter:"[a-z0-9_\\-\\u00df-\\u00ff\\u0151\\u0171]",anyLetter:s,anyLetterStrict:c,whitespace:n.replace("[","[\\n\\r"),escapedLine:"\\\\\\n\\\\?|\\n\\\\",br:"\\n(?!\\\\)",tag:"<\\/?"+N+_+">",scriptStyleTag:"<("+a("script","style","textarea")+")"+_+">[^]*?<\\/\\1>",scriptStyleTagOpener:"<",url:"("+a("https?","mailto","javascript","ftp","data")+":\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])",bullet:"\\*",hr:m,heading:"[ \\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]*(#{1,6})[ \\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]*",align:u,column:l,bulleted:h,numbered:d,verbatimOpener:"`+",hookAppendedFront:"\\["+t("=+"),hookPrependedFront:O+"\\["+t("=+"),hookFront:"\\["+t("=+"),hookBack:"\\]"+t(L),hookAppendedBack:"\\]"+L,unclosedHook:"\\[=+",unclosedHookPrepended:O+"\\[=+",unclosedCollapsed:"\\{=+",passageLink:p.main+p.closer,legacyLink:p.opener+p.legacyText+p.legacySeparator+p.legacyText+p.closer,simpleLink:p.opener+p.legacyText+p.closer,macroFront:S.opener+r(S.name),macroName:S.name,groupingFront:"\\("+t(S.name),twine1Macro:"<<[^>\\s]+\\s*(?:\\\\.|'(?:[^'\\\\]*\\\\.)*[^'\\\\]*'|\"(?:[^\"\\\\]*\\\\.)*[^\"\\\\]*\"|[^'\"\\\\>]|>(?!>))*>>",validPropertyName:g,property:f,belongingProperty:w,possessiveOperator:k,belongingOperator:"of\\b",itsOperator:"its\\b",belongingItOperator:C,variable:b,tempVariable:y,hookName:"\\?("+s+"+)\\b",cssTime:"(\\d+\\.?\\d*|\\d*\\.?\\d+)(m?s)\\b",colour:a(a("Red","Orange","Yellow","Lime","Green","Cyan","Aqua","Blue","Navy","Purple","Fuchsia","Magenta","White","Gray","Grey","Black","Transparent"),"#[\\dA-Fa-f]{3}(?:[\\dA-Fa-f]{3})?"),datatype:a("alnum","alphanumeric","any(?:case)?","array","bool(?:ean)?","changer","codehook","colou?r","const","command","dm","data"+a("map","type","set"),"ds","digit","gradient","empty","even","int"+t("o")+"(?:eger)?","lambda","lowercase","macro","linebreak","newline","num(?:ber)?","odd","str(?:ing)?","uppercase","whitespace")+i,number:P,boolean:a("true","false")+i,identifier:v,itsProperty:x,belongingItProperty:T,escapedStringChar:"\\\\[^\\n]",singleStringOpener:"'",doubleStringOpener:'"',singleStringCloser:"'",doubleStringCloser:'"',is:"is"+t(n+"not"+i,n+"an?"+i,n+"in"+i,n+"<",n+">")+i,isNot:"is"+n+"not"+t(n+a("an?","in")+i)+i,isA:"is"+n+"an?"+i,isNotA:"is"+n+"not"+n+"an?"+i,matches:"matches\\b",doesNotMatch:"does"+n+"not"+n+"match"+i,and:"and\\b",or:"or\\b",not:"not\\b",inequality:"((?:is(?:"+n+"not)?"+o+")*)("+a("<(?!=)","<=",">(?!=)",">=")+")",isIn:"is"+n+"in"+i,contains:"contains\\b",doesNotContain:"does"+n+"not"+n+"contain"+i,isNotIn:"is"+n+"not"+n+"in"+i,addition:escape("+")+t("="),subtraction:escape("-")+t("=","type"),multiplication:escape("*")+t("="),division:a("/","%")+t("="),spread:"\\.\\.\\."+t("\\."),to:a("to\\b","="),into:"into\\b",making:"making\\b",where:"where\\b",when:"when\\b",via:"via\\b",each:"each\\b",augmentedAssign:a("\\+","\\-","\\*","\\/","%")+"=",bind:"2?bind\\b",typeSignature:escape("-type")+i,incorrectOperator:A,PlainCompare:{comma:",",commentFront:"\x3c!--",commentBack:"--\x3e",strikeOpener:"~~",italicOpener:"//",boldOpener:"''",supOpener:"^^",strongFront:"**",strongBack:"**",emFront:"*",emBack:"*",collapsedFront:"{",collapsedBack:"}",groupingBack:")"}},"object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports=e:"function"==typeof define&&define.amd?define("patterns",[],function(){return e}):this&&this.loaded?(this.modules||(this.modules={}),this.modules.Patterns=e):this.Patterns=e}.call(eval("this")||("undefined"!=typeof global?global:window)),!function(){Object.assign=Object.assign||function polyfilledAssign(e){for(var a=1;a<");return~t?25===(a=Math.round(t/(e.length-2)*50))&&(a="center"):"<"===e[0]&&">"===e.slice(-1)?a="justify":-1")?a="right":-1":">=","=<":"<=",gte:">=",lte:"<=",gt:">",lt:"<",eq:"is",isnot:"is not",neq:"is not",isa:"is a",are:"is",x:"*","or a":"or"}[e[0].toLowerCase().replace(/\s+/g," ")];return{type:"error",message:"Please say "+(a?"'"+a+"'":"something else")+" instead of '"+e[0]+"'.",explanation:"In the interests of readability, I want certain operators to be in a specific form."}},cannotFollowText:!0}},["boolean","is","to","into","where","when","via","making","each","and","or","not","isNot","contains","doesNotContain","isIn","isA","isNotA","isNotIn","matches","doesNotMatch","bind"].reduce(function(e,a){return e[a]={fn:t,cannotFollowText:!0},e},{}),["comma","spread","typeSignature","addition","subtraction","multiplication","division"].reduce(function(e,a){return e[a]={fn:t},e},{}))),h=setupRules(o,{singleStringCloser:l.singleStringOpener,doubleStringCloser:l.doubleStringOpener,escapedStringChar:l.escapedStringChar}),d=(r.push.apply(r,_toConsumableArray(u(n)).concat(_toConsumableArray(u(c)),_toConsumableArray(u(s)))),a.push.apply(a,_toConsumableArray(u(c)).concat(_toConsumableArray(u(l)))),o.push.apply(o,_toConsumableArray(u(h))),p({},n,s,c,l,h));return u(d).forEach(function(e){m.PlainCompare[e]?(d[e].pattern=m.PlainCompare[e],d[e].plainCompare=!0):d[e].pattern=RegExp("^(?:"+m[e]+")","i")}),p(e.rules,d),(s=e.modes).start=s.markup=r,s.macro=a,s.string=o,e}(e).lex,Patterns:m})}"object"===("undefined"==typeof module?"undefined":_typeof(module))?(m=require("./patterns"),module.exports=exporter(require("./lexer"))):"function"==typeof define&&define.amd?define("markup",["lexer","patterns"],function(e,a){return m=a,exporter(e)}):this&&this.loaded&&this.modules?(m=this.modules.Patterns,this.modules.Markup=exporter(this.modules.Lexer)):(m=this.Patterns,this.Markup=exporter(this.Lexer))}.call(eval("this")||("undefined"!=typeof global?global:window)),!function(){var a=Math.round,e=function insensitiveName(e){return(e+"").toLowerCase().replace(/-|_/g,"")},t={"#e61919":"red","#e68019":"orange","#e5e619":"yellow","#80e619":"lime","#19e619":"green","#19e5e6":"cyan","#197fe6":"blue","#1919e6":"navy","#7f19e6":"purple","#e619e5":"magenta","#ffffff":"white","#000000":"black","#888888":"grey"},r=function fontIcon(e){var a=1')},o=function GCD(e,a){return e?a?a