gamefic-sdk 2.0.4 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33f493dc96f3c27065f78900fcddbf966da5772770c9ed40f7e8bc665e93851f
4
- data.tar.gz: 6a9cde8c298e3640852d34bfa50ecd77df2d0998cec43cf13c3c67855b0c53b2
3
+ metadata.gz: e191127d0c07f062207511ce1abb9b6b8237252a2c211751554673cc43a9572d
4
+ data.tar.gz: e68a2692143010304e89abe4ccaf5d99f3227a39f89ef10c1cb7d56df6ed0c25
5
5
  SHA512:
6
- metadata.gz: 8d7508ff80cb9457cad967c340ad023616df7c25b746d2906a036a737b3da2eae2f04ab94c1cbba85465ac8241c56c3129614a049b0e6ec949b3009e6def7aa0
7
- data.tar.gz: 39e7fce05531a992ce3e1de4b01a9869a68103957a999f259559e651fb31fefa69e098956da1d6574778c3c1789c4c2164533b91fcd11775733359014f60dfe1
6
+ metadata.gz: b871b39cc1371113111d917ec0ff01180483daefefbe9725e95f1d486f9b72d708215b8ca8b483784b908d3682c7430b29ecb6fc13953b626c92b170555a315e
7
+ data.tar.gz: a3e31833934272af6363b821f76cb8b1af8427b1797ccc0b61dcaff023aa9dc6323b9b4de174387d659a9ee1307020be81ee111560b173dba2b2afb99e6874f9
data/.gitignore CHANGED
@@ -6,7 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- /guides/
10
9
 
11
10
  # rspec failure tracking
12
11
  .rspec_status
@@ -1,3 +1,6 @@
1
+ ## 2.1.0 - August 27, 2020
2
+ - Update web app with customizable scene components
3
+
1
4
  ## 2.0.4 - April 25, 2020
2
5
  - Server does not symbolize snapshot keys
3
6
  - Update dependencies
@@ -1,5 +1,5 @@
1
1
  module Gamefic
2
2
  module Sdk
3
- VERSION = '2.0.4'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
@@ -29,6 +29,6 @@
29
29
  "gamefic-driver": "^0.2.1",
30
30
  "react": "^16.5.2",
31
31
  "react-dom": "^16.5.2",
32
- "react-gamefic": "^0.2.2"
32
+ "react-gamefic": "^0.3.0"
33
33
  }
34
34
  }
@@ -1,13 +1,24 @@
1
1
  import React from 'react';
2
2
  import { render } from 'react-dom';
3
3
  import { Console, Terminal } from 'react-gamefic';
4
+
4
5
  import { driver } from 'driver';
6
+
7
+ import { ActivityScene, PauseScene, MultipleChoiceScene, ConclusionScene } from './scenes';
5
8
  import 'react-gamefic/styles/ebook';
6
9
  import './style.css';
7
10
 
11
+ const sceneComponents = {
12
+ Activity: ActivityScene,
13
+ Pause: PauseScene,
14
+ MultipleChoice: MultipleChoiceScene,
15
+ YesOrNo: MultipleChoiceScene,
16
+ Conclusion: ConclusionScene
17
+ }
18
+
8
19
  render(
9
20
  <Console driver={driver}>
10
- <Terminal />
21
+ <Terminal sceneComponents={sceneComponents} autoScroll={true} />
11
22
  </Console>,
12
23
  document.getElementById('root')
13
24
  );
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Output, CommandForm } from 'react-gamefic';
3
+
4
+ export class ActivityScene extends React.Component {
5
+ render() {
6
+ return (
7
+ <div className="ActivityScene">
8
+ <Output {...this.props} />
9
+ <CommandForm prompt={this.props.state.prompt} />
10
+ </div>
11
+ );
12
+ }
13
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Output } from 'react-gamefic';
3
+
4
+ export class ConclusionScene extends React.Component {
5
+ render() {
6
+ return (
7
+ <div className="ConclusionScene">
8
+ <Output {...this.props} />
9
+ </div>
10
+ );
11
+ }
12
+ }
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { Output } from 'react-gamefic';
3
+ import { CommandLink } from 'react-gamefic';
4
+
5
+ export class MultipleChoiceScene extends React.Component {
6
+ renderChoices() {
7
+ if (this.props.state.options) {
8
+ const listItems = this.props.state.options.map((opt, index) => {
9
+ return (
10
+ <li key={index}>
11
+ <CommandLink command={opt}>{opt}</CommandLink>
12
+ </li>
13
+ );
14
+ });
15
+ return (
16
+ <nav>
17
+ <ol>
18
+ {listItems}
19
+ </ol>
20
+ </nav>
21
+ );
22
+ } else {
23
+ console.warn("Error: Multiple choice scene does not have any options");
24
+ return '';
25
+ }
26
+ }
27
+
28
+ render() {
29
+ return (
30
+ <div className="MultipleChoiceScene">
31
+ <Output {...this.props} />
32
+ <label>{this.props.state.prompt}</label>
33
+ {this.renderChoices()}
34
+ </div>
35
+ );
36
+ }
37
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Output, CommandLink, CommandForm } from 'react-gamefic';
3
+
4
+ export class PauseScene extends React.Component {
5
+ render() {
6
+ return (
7
+ <div className="PauseScene">
8
+ <Output {...this.props} />
9
+ <CommandLink command="">Continue</CommandLink>
10
+ </div>
11
+ );
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ import { ActivityScene } from './ActivityScene.jsx';
2
+ import { PauseScene } from './PauseScene.jsx';
3
+ import { MultipleChoiceScene } from './MultipleChoiceScene.jsx';
4
+ import { ConclusionScene } from './ConclusionScene.jsx';
5
+
6
+ export {
7
+ ActivityScene,
8
+ PauseScene,
9
+ MultipleChoiceScene,
10
+ ConclusionScene
11
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamefic-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-25 00:00:00.000000000 Z
11
+ date: 2020-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gamefic
@@ -261,6 +261,11 @@ files:
261
261
  - scaffolds/react/web/src/driver/opal.rb
262
262
  - scaffolds/react/web/src/driver/production.js
263
263
  - scaffolds/react/web/src/index.js
264
+ - scaffolds/react/web/src/scenes/ActivityScene.jsx
265
+ - scaffolds/react/web/src/scenes/ConclusionScene.jsx
266
+ - scaffolds/react/web/src/scenes/MultipleChoiceScene.jsx
267
+ - scaffolds/react/web/src/scenes/PauseScene.jsx
268
+ - scaffolds/react/web/src/scenes/index.js
264
269
  - scaffolds/react/web/src/style.css
265
270
  - scaffolds/react/webpack.config.js
266
271
  homepage: http://gamefic.com
@@ -282,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
287
  - !ruby/object:Gem::Version
283
288
  version: '0'
284
289
  requirements: []
285
- rubygems_version: 3.0.3
290
+ rubygems_version: 3.1.2
286
291
  signing_key:
287
292
  specification_version: 4
288
293
  summary: Gamefic SDK