From 911d18bc4994f1648137da4cacb66fced9086f6f Mon Sep 17 00:00:00 2001 From: Chris Klimas Date: Sun, 28 Jul 2024 14:30:29 -0400 Subject: [PATCH] Add Chapbook 2.2.0 --- public/story-formats/chapbook-2.1.0/format.js | 1 - public/story-formats/chapbook-2.2.0/format.js | 1 + .../story-formats/{chapbook-2.1.0 => chapbook-2.2.0}/logo.svg | 0 src/store/story-formats/defaults.ts | 4 ++-- 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 public/story-formats/chapbook-2.1.0/format.js create mode 100644 public/story-formats/chapbook-2.2.0/format.js rename public/story-formats/{chapbook-2.1.0 => chapbook-2.2.0}/logo.svg (100%) diff --git a/public/story-formats/chapbook-2.1.0/format.js b/public/story-formats/chapbook-2.1.0/format.js deleted file mode 100644 index dd09ea851..000000000 --- a/public/story-formats/chapbook-2.1.0/format.js +++ /dev/null @@ -1 +0,0 @@ -window.storyFormat({"source":"{{STORY_NAME}}
{{STORY_DATA}}","author":"Chris Klimas","description":"A Twine story format emphasizing ease of authoring, multimedia, and playability on many different types of devices. Visit the guide for more information.","hydrate":"(function(l){\"use strict\";function r(){return{startState(){return{inVarsSection:!1}},token(e,t){if(t.hasVarsSection===void 0){for(let n=1,o=e.lookAhead(1);o&&t.hasVarsSection===void 0;o=e.lookAhead(++n))o===\"--\"&&(t.hasVarsSection=!0,t.inVarsSection=!0);t.hasVarsSection===void 0&&(t.hasVarsSection=!1)}return t.hasVarsSection&&t.inVarsSection&&e.sol()?e.match(/^--$/)?(t.inVarsSection=!1,e.skipToEnd(),\"punctuation\"):e.skipTo(\":\")?(e.next(),\"def\"):(e.skipToEnd(),\"text\"):e.sol()&&e.match(/^\\[[^[].*\\]$/)||e.match(/^\\{.+?\\}/)?\"keyword\":e.match(/^\\[\\[[^\\]]+?\\]\\]/)?\"link\":(e.eatWhile(/[^[{]/)||e.skipToEnd(),\"text\")}}}function c(e){return Object.keys(e).reduce((t,n)=>({...t,[n]:o=>{o.replaceSelection(e[n]),o.focus()}}),{})}function d(e){return Object.keys(e).reduce((t,n)=>({...t,[n]:o=>{const{matcher:i,wrapper:v}=e[n];o.replaceSelections(o.getSelections().map(s=>i.test(s)?s.replace(i,\"$1\"):v(s)),\"around\"),o.focus()}}),{})}const b={...d({boldText:{matcher:/^(?:__|\\*\\*)(.+)(?:__|\\*\\*)$/,wrapper:e=>`**${e}**`},italicText:{matcher:/^(?:_|\\*)(.+)(?:_|\\*)$/,wrapper:e=>`*${e}*`},monospacedText:{matcher:/^`(.+)`$/,wrapper:e=>\"`\"+e+\"`\"},smallCapsText:{matcher:/^~~(.+)~~$/,wrapper:e=>`~~${e}~~`}}),...c({insertAfter:`\n[after 1 second]\nText\n\n[continued]`,insertAppend:`\n[append]\n`,insertBlockquote:`\n
Text
\n`,insertContinue:`\n[continued]\n`,insertBulletedList:`\n- Item\n- Item\n`,insertCss:`\n[CSS]\n.page article {\n color: green;\n}\n\n[continued]\n`,insertCyclingLink:\"{cycling link for: 'variable name', choices: ['choice', 'choice']}\",insertDropdownMenu:\"{dropdown menu for: 'variable name', choices: ['choice', 'choice']}\",insertEmbedAmbientSound:\"{ambient sound: 'sound name'}\",insertEmbedSoundEffect:\"{sound effect: 'sound name'}\",insertEmbedPassage:\"{embed passage: 'Passage name'}\",insertEmbedYouTubeVideo:\"{embed YouTube video: 'URL'}\",insertImageFlickr:\"{embed Flickr image: 'Flickr embed code'}\",insertImageUrl:\"{embed image: 'URL to image'}\",insertImageUnsplash:\"{embed Unsplash image: }\",insertForkList:`\n> Link\n> Link\n`,insertIf:`\n[if condition]\nText\n\n[continue]\n`,insertIfElse:`\n[if condition]\nText\n\n[else]Text\n\n[continued]\n`,insertJs:`\n[JavaScript]\nwrite('Hello from JavaScript');\n\n[continued]\n`,insertNote:`\n[note]\nNote to self\n\n[continued]\n`,insertNumberedList:`\n1. Item\n2. Item\n`,insertPassageLink:\"{link to: 'Passage name', label: 'Label text'}\",insertRestartLink:\"{restart link, label: 'Label text'}\",insertRevealPassageLink:\"{reveal link: 'Label text', passage: 'Passage name'}\",insertRevealTextLink:\"{restart link: 'Label text', text: 'Displayed text'}\",insertSectionBreak:`\n***\n`,insertTextInput:\"{text input for: 'variable name'}\",insertUnless:`\n[unless condition]\nText\n\n[continued]\n`})},m=`\n \n \n \n\n\n\n`,p=`\n \n \n \n \n \n\n\n\n`,u=`\n \n \n \n \n \n\n\n\n`,h=`\n \n \n \n \n \n \n \n \n \n\n\n\n`,k=`\n \n \n \n \n\n\n\n`;function a(e,t){return`data:image/svg+xml;base64,${window.btoa(e.replace(/currentColor/g,t))}`}function g(e,{foregroundColor:t}){const n=e.getDoc().somethingSelected();return[{type:\"menu\",icon:a(p,t),label:\"Style\",items:[{type:\"button\",iconOnly:!0,label:\"Bold\",command:\"boldText\",disabled:!n},{type:\"button\",label:\"Italic\",command:\"italicText\",disabled:!n},{type:\"button\",label:\"Monospaced Text\",command:\"monospacedText\",disabled:!n},{type:\"button\",label:\"Small Caps\",command:\"smallCapsText\",disabled:!n},{type:\"separator\"},{type:\"button\",label:\"Blockquote\",command:\"insertBlockquote\",disabled:n},{type:\"button\",label:\"Bulleted List\",command:\"insertBulletedList\",disabled:n},{type:\"button\",label:\"Fork List\",command:\"insertForkList\",disabled:n},{type:\"button\",label:\"Numbered List\",command:\"insertNumberedList\",disabled:n},{type:\"button\",label:\"Section Break\",command:\"insertSectionBreak\",disabled:n}]},{type:\"menu\",icon:a(k,t),label:\"Link\",disabled:n,items:[{type:\"button\",label:\"Passage Link\",command:\"insertPassageLink\"},{type:\"button\",label:\"Restart Link\",command:\"insertRestartLink\"},{type:\"button\",label:\"Reveal Passage Link\",command:\"insertRevealPassageLink\"},{type:\"button\",label:\"Reveal Text Link\",command:\"insertRevealTextLink\"}]},{type:\"menu\",icon:a(m,t),label:\"Modifiers\",disabled:n,items:[{type:\"button\",label:\"If\",command:\"insertIf\"},{type:\"button\",label:\"If and Else\",command:\"insertIfElse\"},{type:\"button\",label:\"Unless\",command:\"insertUnless\"},{type:\"button\",label:\"Continue\",command:\"insertContinue\"},{type:\"separator\"},{type:\"button\",label:\"After Delay\",command:\"insertAfter\"},{type:\"button\",label:\"Append Text\",command:\"insertAppend\"},{type:\"button\",label:\"Note\",command:\"insertNote\"},{type:\"separator\"},{type:\"button\",label:\"JavaScript\",command:\"insertJs\"},{type:\"button\",label:\"CSS\",command:\"insertCss\"}]},{type:\"menu\",icon:a(u,t),label:\"Embed\",disabled:n,items:[{type:\"button\",label:\"Embed Passage\",command:\"insertEmbedPassage\"},{type:\"button\",label:\"Embed Image from Flickr\",command:\"insertImageFlickr\"},{type:\"button\",label:\"Embed Image from URL\",command:\"insertImageUrl\"},{type:\"button\",label:\"Embed Image from Unsplash\",command:\"insertImageUnsplash\"},{type:\"button\",label:\"Embed Ambient Sound\",command:\"insertEmbedAmbientSound\"},{type:\"button\",label:\"Embed Sound Effect\",command:\"insertEmbedSoundEffect\"},{type:\"button\",label:\"Embed YouTube Video\",command:\"insertEmbedYouTubeVideo\"}]},{type:\"menu\",icon:a(h,t),label:\"Input\",disabled:n,items:[{type:\"button\",label:\"Cycling Link\",command:\"insertCyclingLink\"},{type:\"button\",label:\"Dropdown Menu\",command:\"insertDropdownMenu\"},{type:\"button\",label:\"Text Input\",command:\"insertTextInput\"}]}]}function f(e){const t=[/\\{embed\\s+passage\\s*:\\s*['\"](.+?)['\"]\\s*}/g,/\\{link\\s+to\\s*:\\s*['\"](.+?)['\"]\\s*\\}/g,/\\{reveal\\s+link.+passage\\s*:\\s*['\"](.+?)['\"].*\\}/g],n=[];for(const o of t){let i;for(;i=o.exec(e);)n.push(i[1])}return n}l.editorExtensions={twine:{\"^2.4.0-beta2\":{codeMirror:{commands:b,mode:r,toolbar:g},references:{parsePassageText:f}}}}})(this);\n","image":"logo.svg","name":"Chapbook","proofing":false,"version":"2.1.0"}) \ No newline at end of file diff --git a/public/story-formats/chapbook-2.2.0/format.js b/public/story-formats/chapbook-2.2.0/format.js new file mode 100644 index 000000000..36527eac5 --- /dev/null +++ b/public/story-formats/chapbook-2.2.0/format.js @@ -0,0 +1 @@ +window.storyFormat({"source":"{{STORY_NAME}}
{{STORY_DATA}}","author":"Chris Klimas","description":"A Twine story format emphasizing ease of authoring, multimedia, and playability on many different types of devices. Visit the guide for more information.","hydrate":"(function(l){\"use strict\";function r(){return{startState(){return{inVarsSection:!1}},token(e,t){if(t.hasVarsSection===void 0){for(let n=1,o=e.lookAhead(1);o&&t.hasVarsSection===void 0;o=e.lookAhead(++n))o===\"--\"&&(t.hasVarsSection=!0,t.inVarsSection=!0);t.hasVarsSection===void 0&&(t.hasVarsSection=!1)}return t.hasVarsSection&&t.inVarsSection&&e.sol()?e.match(/^--$/)?(t.inVarsSection=!1,e.skipToEnd(),\"punctuation\"):e.skipTo(\":\")?(e.next(),\"def\"):(e.skipToEnd(),\"text\"):e.sol()&&e.match(/^\\[[^[].*\\]$/)||e.match(/^\\{.+?\\}/)?\"keyword\":e.match(/^\\[\\[[^\\]]+?\\]\\]/)?\"link\":(e.eatWhile(/[^[{]/)||e.skipToEnd(),\"text\")}}}function c(e){return Object.keys(e).reduce((t,n)=>({...t,[n]:o=>{o.replaceSelection(e[n]),o.focus()}}),{})}function d(e){return Object.keys(e).reduce((t,n)=>({...t,[n]:o=>{const{matcher:i,wrapper:v}=e[n];o.replaceSelections(o.getSelections().map(s=>i.test(s)?s.replace(i,\"$1\"):v(s)),\"around\"),o.focus()}}),{})}const b={...d({boldText:{matcher:/^(?:__|\\*\\*)(.+)(?:__|\\*\\*)$/,wrapper:e=>`**${e}**`},italicText:{matcher:/^(?:_|\\*)(.+)(?:_|\\*)$/,wrapper:e=>`*${e}*`},monospacedText:{matcher:/^`(.+)`$/,wrapper:e=>\"`\"+e+\"`\"},smallCapsText:{matcher:/^~~(.+)~~$/,wrapper:e=>`~~${e}~~`}}),...c({insertAfter:`\n[after 1 second]\nText\n\n[continued]`,insertAppend:`\n[append]\n`,insertBlockquote:`\n
Text
\n`,insertContinue:`\n[continued]\n`,insertBulletedList:`\n- Item\n- Item\n`,insertCss:`\n[CSS]\n.page article {\n color: green;\n}\n\n[continued]\n`,insertCyclingLink:\"{cycling link for: 'variable name', choices: ['choice', 'choice']}\",insertDropdownMenu:\"{dropdown menu for: 'variable name', choices: ['choice', 'choice']}\",insertEmbedAmbientSound:\"{ambient sound: 'sound name'}\",insertEmbedSoundEffect:\"{sound effect: 'sound name'}\",insertEmbedPassage:\"{embed passage: 'Passage name'}\",insertEmbedYouTubeVideo:\"{embed YouTube video: 'URL'}\",insertImageFlickr:\"{embed Flickr image: 'Flickr embed code'}\",insertImageUrl:\"{embed image: 'URL to image'}\",insertImageUnsplash:\"{embed Unsplash image: }\",insertForkList:`\n> Link\n> Link\n`,insertIf:`\n[if condition]\nText\n\n[continue]\n`,insertIfElse:`\n[if condition]\nText\n\n[else]Text\n\n[continued]\n`,insertJs:`\n[JavaScript]\nwrite('Hello from JavaScript');\n\n[continued]\n`,insertNote:`\n[note]\nNote to self\n\n[continued]\n`,insertNumberedList:`\n1. Item\n2. Item\n`,insertPassageLink:\"{link to: 'Passage name', label: 'Label text'}\",insertRestartLink:\"{restart link, label: 'Label text'}\",insertRevealPassageLink:\"{reveal link: 'Label text', passage: 'Passage name'}\",insertRevealTextLink:\"{restart link: 'Label text', text: 'Displayed text'}\",insertSectionBreak:`\n***\n`,insertTextInput:\"{text input for: 'variable name'}\",insertUnless:`\n[unless condition]\nText\n\n[continued]\n`})},m=`\n \n \n \n\n\n\n`,p=`\n \n \n \n \n \n\n\n\n`,u=`\n \n \n \n \n \n\n\n\n`,h=`\n \n \n \n \n \n \n \n \n \n\n\n\n`,k=`\n \n \n \n \n\n\n\n`;function a(e,t){return`data:image/svg+xml;base64,${window.btoa(e.replace(/currentColor/g,t))}`}function g(e,{foregroundColor:t}){const n=e.getDoc().somethingSelected();return[{type:\"menu\",icon:a(p,t),label:\"Style\",items:[{type:\"button\",iconOnly:!0,label:\"Bold\",command:\"boldText\",disabled:!n},{type:\"button\",label:\"Italic\",command:\"italicText\",disabled:!n},{type:\"button\",label:\"Monospaced Text\",command:\"monospacedText\",disabled:!n},{type:\"button\",label:\"Small Caps\",command:\"smallCapsText\",disabled:!n},{type:\"separator\"},{type:\"button\",label:\"Blockquote\",command:\"insertBlockquote\",disabled:n},{type:\"button\",label:\"Bulleted List\",command:\"insertBulletedList\",disabled:n},{type:\"button\",label:\"Fork List\",command:\"insertForkList\",disabled:n},{type:\"button\",label:\"Numbered List\",command:\"insertNumberedList\",disabled:n},{type:\"button\",label:\"Section Break\",command:\"insertSectionBreak\",disabled:n}]},{type:\"menu\",icon:a(k,t),label:\"Link\",disabled:n,items:[{type:\"button\",label:\"Passage Link\",command:\"insertPassageLink\"},{type:\"button\",label:\"Restart Link\",command:\"insertRestartLink\"},{type:\"button\",label:\"Reveal Passage Link\",command:\"insertRevealPassageLink\"},{type:\"button\",label:\"Reveal Text Link\",command:\"insertRevealTextLink\"}]},{type:\"menu\",icon:a(m,t),label:\"Modifiers\",disabled:n,items:[{type:\"button\",label:\"If\",command:\"insertIf\"},{type:\"button\",label:\"If and Else\",command:\"insertIfElse\"},{type:\"button\",label:\"Unless\",command:\"insertUnless\"},{type:\"button\",label:\"Continue\",command:\"insertContinue\"},{type:\"separator\"},{type:\"button\",label:\"After Delay\",command:\"insertAfter\"},{type:\"button\",label:\"Append Text\",command:\"insertAppend\"},{type:\"button\",label:\"Note\",command:\"insertNote\"},{type:\"separator\"},{type:\"button\",label:\"JavaScript\",command:\"insertJs\"},{type:\"button\",label:\"CSS\",command:\"insertCss\"}]},{type:\"menu\",icon:a(u,t),label:\"Embed\",disabled:n,items:[{type:\"button\",label:\"Embed Passage\",command:\"insertEmbedPassage\"},{type:\"button\",label:\"Embed Image from Flickr\",command:\"insertImageFlickr\"},{type:\"button\",label:\"Embed Image from URL\",command:\"insertImageUrl\"},{type:\"button\",label:\"Embed Image from Unsplash\",command:\"insertImageUnsplash\"},{type:\"button\",label:\"Embed Ambient Sound\",command:\"insertEmbedAmbientSound\"},{type:\"button\",label:\"Embed Sound Effect\",command:\"insertEmbedSoundEffect\"},{type:\"button\",label:\"Embed YouTube Video\",command:\"insertEmbedYouTubeVideo\"}]},{type:\"menu\",icon:a(h,t),label:\"Input\",disabled:n,items:[{type:\"button\",label:\"Cycling Link\",command:\"insertCyclingLink\"},{type:\"button\",label:\"Dropdown Menu\",command:\"insertDropdownMenu\"},{type:\"button\",label:\"Text Input\",command:\"insertTextInput\"}]}]}function f(e){const t=[/\\{embed\\s+passage\\s*:\\s*['\"](.+?)['\"]\\s*}/g,/\\{link\\s+to\\s*:\\s*['\"](.+?)['\"]\\s*\\}/g,/\\{reveal\\s+link.+passage\\s*:\\s*['\"](.+?)['\"].*\\}/g],n=[];for(const o of t){let i;for(;i=o.exec(e);)n.push(i[1])}return n}l.editorExtensions={twine:{\"^2.4.0-beta2\":{codeMirror:{commands:b,mode:r,toolbar:g},references:{parsePassageText:f}}}}})(this);\n","image":"logo.svg","name":"Chapbook","proofing":false,"version":"2.2.0"}) \ No newline at end of file diff --git a/public/story-formats/chapbook-2.1.0/logo.svg b/public/story-formats/chapbook-2.2.0/logo.svg similarity index 100% rename from public/story-formats/chapbook-2.1.0/logo.svg rename to public/story-formats/chapbook-2.2.0/logo.svg diff --git a/src/store/story-formats/defaults.ts b/src/store/story-formats/defaults.ts index db12231f0..a3aa03b2b 100644 --- a/src/store/story-formats/defaults.ts +++ b/src/store/story-formats/defaults.ts @@ -6,8 +6,8 @@ export const builtins = () => [ }, { name: 'Chapbook', - url: 'story-formats/chapbook-2.1.0/format.js', - version: '2.1.0' + url: 'story-formats/chapbook-2.2.0/format.js', + version: '2.2.0' }, { name: 'Harlowe',